forked from Orange-OpenSource/hasplayer.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.js
358 lines (305 loc) · 378 KB
/
player.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
// customizable settings
// hideMetricsAtStart : if true all metrics are hidden at start and ctrl+i show them one by one; else all metrics are shown at start and ctrl+i hide them one by one
var hideMetricsAtStart = true;
// idsToToggle : ids of the metrics to toggle, metrics are hided (or shown) in the array order
var idsToToggle = ["#chartToToggle", "#sliderToToggle", "#infosToToggle"];
// updateInterval : the intervals on how often the metrics are updated in milliseconds
var updateInterval = 333;
// chartXaxisWindow : the display window on the x-axis in seconds
var chartXaxisWindow = 10;
var previousPlayedQuality = 0,
previousDownloadedQuality= 0,
previousPlayedVideoHeight,
previousPlayedVideoWidth,
previousPlayedCodecs,
chartBandwidth,
dlSeries = [],
playSeries = [],
qualityChangements = [],
chartOptions = {series: {shadowSize: 0},yaxis: {ticks: [],color:"#FFF"},xaxis: {show: false},lines: {steps: true,},grid: {markings: [],borderWidth: 0},legend: {show: false}},
video,
player,
currentIdToToggle = 0,
isPlaying = false,
firstAccess = true,
seekBarIsPresent = false,
audioTracksSelectIsPresent = false;
function update() {
var repSwitch,
bufferLevel,
bufferLengthValue,
bitrateValues,
metricsVideo = player.getMetricsFor("video"),
metricsExt = player.getMetricsExt(),
videoWidthValue,
videoHeightValue,
codecsValue,
dwnldSwitch;
repSwitch = metricsExt.getCurrentRepresentationSwitch(metricsVideo);
dwnldSwitch = metricsExt.getCurrentDownloadSwitch(metricsVideo);
if (repSwitch && dwnldSwitch) {
bufferLevel = metricsExt.getCurrentBufferLevel(metricsVideo);
bufferLengthValue = bufferLevel ? bufferLevel.level.toPrecision(5) : 0;
bitrateValues = metricsExt.getBitratesForType("video");
videoWidthValue = metricsExt.getVideoWidthForRepresentation(repSwitch.to);
videoHeightValue = metricsExt.getVideoHeightForRepresentation(repSwitch.to);
codecsValue = metricsExt.getCodecsForRepresentation(repSwitch.to);
// case of downloaded quality changmement
if (bitrateValues[dwnldSwitch.quality] != previousDownloadedQuality) {
// save quality changement for later when video currentTime = mediaStartTime
qualityChangements.push({
'mediaStartTime':dwnldSwitch.mediaStartTime,
'switchedQuality': bitrateValues[dwnldSwitch.quality],
'downloadStartTime': dwnldSwitch.downloadStartTime,
'videoWidth': videoWidthValue,
'videoHeight': videoHeightValue,
'codecsValue': codecsValue
});
previousDownloadedQuality = bitrateValues[dwnldSwitch.quality];
}
// test if it's time of changement
for (var p in qualityChangements) {
var currentQualityChangement = qualityChangements[p];
//time of downloaded quality changement !
if (currentQualityChangement.downloadStartTime <= video.currentTime) {
previousDownloadedQuality = currentQualityChangement.switchedQuality;
}
// time of played quality changement !
if (currentQualityChangement.mediaStartTime <= video.currentTime) {
previousPlayedQuality = currentQualityChangement.switchedQuality;
previousPlayedVideoWidth = currentQualityChangement.videoWidth;
previousPlayedVideoHeight = currentQualityChangement.videoHeight;
previousPlayedCodecs = currentQualityChangement.codecsValue;
// remove it when it's played
qualityChangements.splice(p,1);
}
}
dlSeries.push([video.currentTime, Math.round(previousDownloadedQuality/1000)]);
playSeries.push([video.currentTime, Math.round(previousPlayedQuality / 1000)]);
// remove older points for the x-axis move
if (dlSeries.length > (chartXaxisWindow*1000)/updateInterval) {
dlSeries.splice(0, 1);
playSeries.splice(0, 1);
}
var bandwidthData = [{
data: dlSeries,
label: "download",
color: "#2980B9"
}, {
data: playSeries,
label: "playing",
color: "#E74C3C"
}];
//initialisation of bandwidth chart , sliders
if (!chartBandwidth) {
for (var idx in bitrateValues) {
chartOptions.grid.markings.push({yaxis: { from: bitrateValues[idx]/1000, to: bitrateValues[idx]/1000 },color:"#b0b0b0"});
chartOptions.yaxis.ticks.push([bitrateValues[idx]/1000, ""+bitrateValues[idx]/1000+"k"]);
}
chartOptions.yaxis.min = Math.min.apply(null,bitrateValues)/1000;
chartOptions.yaxis.max = Math.max.apply(null,bitrateValues)/1000;
chartBandwidth = $.plot($("#chartBandwidth"), bandwidthData , chartOptions);
var labels = [];
for (var i = 0; i < bitrateValues.length; i++) {
labels.push(Math.round(bitrateValues[i] / 1000) + "k");
}
$('#sliderBitrate').labeledslider({
max: (bitrateValues.length - 1),
orientation:'vertical',
range:true,
step: 1,
values: [ 0, (bitrateValues.length - 1 )],
tickLabels: labels,
stop: function( event, ui ) {
player.setQualityBoundariesFor("video", ui.values[0], ui.values[1]);
}
});
var audioDatas = player.getAudioTracks();
if (audioDatas.length>1) {
var selectOptions = "";
for (var j = 0 ; j < audioDatas.length; j++) {
selectOptions += '<option value="'+audioDatas[j].id+'">'+audioDatas[j].lang + ' - ' + audioDatas[j].id+'</option>';
}
$("#audioTracksSelect").html(selectOptions);
audioTracksSelectIsPresent = true;
$("#audioTracksSelect").change(function(track) {
var currentTrackId = $("select option:selected")[0].value;
for (var j = 0 ; j < audioDatas.length; j++) {
if (audioDatas[j].id == currentTrackId) {
player.setAudioTrack(audioDatas[j]);
}
}
});
}
} else {
chartBandwidth.setData(bandwidthData);
chartBandwidth.setupGrid();
chartBandwidth.draw();
}
// control bar initialisation
if(firstAccess && video.duration >0) {
firstAccess = false;
// in dynamic mode, don't diplay seekbar and pause button
if(!player.metricsExt.manifestExt.getIsDynamic(player.metricsExt.manifestModel.getValue())) {
seekBarIsPresent = true;
videoDuration = video.duration;
$("#seekBar").attr('max', video.duration);
$("#videoPlayer").on('timeupdate', updateSeekBar);
}
if(audioTracksSelectIsPresent && seekBarIsPresent) {
$("#controlBar").addClass("controlBarWithAudioTrackSelectAndSeek");
} else if(audioTracksSelectIsPresent) {
$("#controlBar").addClass("controlBarWithAudioTrackSelect");
} else if (seekBarIsPresent) {
$("#controlBar").addClass("controlBarWithSeek");
}
}
previousPlayedVideoWidth = previousPlayedVideoWidth ? previousPlayedVideoWidth : "0";
previousPlayedVideoHeight = previousPlayedVideoHeight ? previousPlayedVideoHeight : "0";
previousPlayedCodecs = previousPlayedCodecs ? previousPlayedCodecs : "-";
bufferLengthValue = bufferLengthValue ? bufferLengthValue : 0;
$("#playingInfos").html("<span class='playingTitle'>Playing</span><br>"+ Math.round(previousPlayedQuality/1000) + " kbps<br>"+ previousPlayedVideoWidth +"x"+previousPlayedVideoHeight + "<br>"+ previousPlayedCodecs + "<br>"+ bufferLengthValue + "s");
$("#downloadingInfos").html("<span class='downloadingTitle'>Downloading</span><br>" + Math.round(previousDownloadedQuality/1000) + " kbps<br>"+ videoWidthValue +"x"+videoHeightValue + "<br>"+ codecsValue + "<br>"+ bufferLengthValue + "s");
}
}
function toggleFullScreen() {
if (!document.fullscreenElement && // alternative standard method
!document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement ) { // current working methods
if (document.getElementById("videoContainer").requestFullscreen) {
document.getElementById("videoContainer").requestFullscreen();
} else if (document.getElementById("videoContainer").msRequestFullscreen) {
document.getElementById("videoContainer").msRequestFullscreen();
} else if (document.getElementById("videoContainer").mozRequestFullScreen) {
document.getElementById("videoContainer").mozRequestFullScreen();
} else if (document.getElementById("videoContainer").webkitRequestFullscreen) {
document.getElementById("videoContainer").webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
}
}
function hideMetrics() {
// hide or show chart
if (currentIdToToggle < idsToToggle.length) {
// Toggle current id (toggle switch between display: none and display: block)
$(idsToToggle[currentIdToToggle]).toggle();
currentIdToToggle++;
} else {
// toggle all ids
for (var i = 0; i < idsToToggle.length ; i++) {
$(idsToToggle[i]).toggle();
}
currentIdToToggle = 0;
}
}
function updateSeekBar() {
$("#seekBar").attr('value',video.currentTime);
}
function initControlBar () {
$("#playPauseButton").click(function() {
isPlaying ? video.pause() : video.play();
});
$("#volumeButton").click(function() {
video.muted = !video.muted;
});
$("#fullscreenButton").click(function(){
toggleFullScreen();
});
$("#videoPlayer").dblclick(function() {
toggleFullScreen();
});
// init value is unknown
if (video.muted) {
$("#volumeButton").addClass("muted");
}
$("#videoPlayer").on("pause", function() {
isPlaying = false;
$("#playPauseButton").removeClass("playing");
});
$("#videoPlayer").on("play", function() {
isPlaying = true;
$("#playPauseButton").addClass("playing");
if (video.muted) {
$("#volumeButton").addClass("muted");
}
});
$("#videoPlayer").on("volumechange", function() {
if (video.muted) {
$("#volumeButton").addClass("muted");
} else {
$("#volumeButton").removeClass("muted");
}
});
/*$("#seekBar").slider({
orientation: "horizontal",
range: "min",
value: 0,
step: 0.01,
max: video.duration,
change: doSeek,
slide: function(){
isSeeking = true;
}
});*/
$("#seekBar").click(function(event) {
video.currentTime = event.offsetX * video.duration / $("#seekBar").width();
updateSeekBar();
});
}
function onLoaded () {
player = new MediaPlayer(new Custom.di.CustomContext());
video = document.querySelector("video");
player.startup();
player.attachView(video);
player.setAutoPlay(true);
// get url
var query = window.location.search;
if (query) {
query = query.substring(query.indexOf("?file=")+6);
if (query) {
player.attachSource(query);
setInterval(update, updateInterval);
}
}
// catch ctrl+i key stoke
$(document).keydown(function(e) {
if(e.keyCode == 73 && e.ctrlKey) {
hideMetrics();
return false;
}
});
initControlBar();
// force hide of all metrics
if (hideMetricsAtStart) {
currentIdToToggle = idsToToggle.length;
hideMetrics();
}
}
// /!\ ALWAYS PUT DASH.ALL.JS IN FIRST POSITION /!\
// DASH.ALL.jS
/* Last build : 16.4.2014_15:4:6 / git revision : a5ea596 */
function X2JS(a,b,c){function d(a){var b=a.localName;return null==b&&(b=a.baseName),(null==b||""==b)&&(b=a.nodeName),b}function e(a){return a.prefix}function f(a){return"string"==typeof a?a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/"):a}function g(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(///g,"/")}function h(f){if(f.nodeType==u.DOCUMENT_NODE){var i,j,k,l=f.firstChild;for(j=0,k=f.childNodes.length;k>j;j+=1)if(f.childNodes[j].nodeType!==u.COMMENT_NODE){l=f.childNodes[j];break}if(c)i=h(l);else{i={};var m=d(l);i[m]=h(l)}return i}if(f.nodeType==u.ELEMENT_NODE){var i=new Object;i.__cnt=0;for(var n=f.childNodes,o=0;o<n.length;o++){var l=n.item(o),m=d(l);if(i.__cnt++,null==i[m])i[m]=h(l),i[m+"_asArray"]=new Array(1),i[m+"_asArray"][0]=i[m];else{if(null!=i[m]&&!(i[m]instanceof Array)){var p=i[m];i[m]=new Array,i[m][0]=p,i[m+"_asArray"]=i[m]}for(var q=0;null!=i[m][q];)q++;i[m][q]=h(l)}}for(var r=0;r<f.attributes.length;r++){var s=f.attributes.item(r);i.__cnt++;for(var v=s.value,w=0,x=a.length;x>w;w++){var y=a[w];y.test.call(this,s.value)&&(v=y.converter.call(this,s.value))}i[b+s.name]=v}var z=e(f);return null!=z&&""!=z&&(i.__cnt++,i.__prefix=z),1==i.__cnt&&null!=i["#text"]&&(i=i["#text"]),null!=i["#text"]&&(i.__text=i["#text"],t&&(i.__text=g(i.__text)),delete i["#text"],delete i["#text_asArray"]),null!=i["#cdata-section"]&&(i.__cdata=i["#cdata-section"],delete i["#cdata-section"],delete i["#cdata-section_asArray"]),(null!=i.__text||null!=i.__cdata)&&(i.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),i}return f.nodeType==u.TEXT_NODE||f.nodeType==u.CDATA_SECTION_NODE?f.nodeValue:f.nodeType==u.COMMENT_NODE?null:void 0}function i(a,b,c,d){var e="<"+(null!=a&&null!=a.__prefix?a.__prefix+":":"")+b;if(null!=c)for(var f=0;f<c.length;f++){var g=c[f],h=a[g];e+=" "+g.substr(1)+"='"+h+"'"}return e+=d?"/>":">"}function j(a,b){return"</"+(null!=a.__prefix?a.__prefix+":":"")+b+">"}function k(a,b){return-1!==a.indexOf(b,a.length-b.length)}function l(a,b){return k(b.toString(),"_asArray")||0==b.toString().indexOf("_")||a[b]instanceof Function?!0:!1}function m(a){var b=0;if(a instanceof Object)for(var c in a)l(a,c)||b++;return b}function n(a){var b=[];if(a instanceof Object)for(var c in a)-1==c.toString().indexOf("__")&&0==c.toString().indexOf("_")&&b.push(c);return b}function o(a){var b="";return null!=a.__cdata&&(b+="<![CDATA["+a.__cdata+"]]>"),null!=a.__text&&(b+=t?f(a.__text):a.__text),b}function p(a){var b="";return a instanceof Object?b+=o(a):null!=a&&(b+=t?f(a):a),b}function q(a,b,c){var d="";if(0==a.length)d+=i(a,b,c,!0);else for(var e=0;e<a.length;e++)d+=i(a[e],b,n(a[e]),!1),d+=r(a[e]),d+=j(a[e],b);return d}function r(a){var b="",c=m(a);if(c>0)for(var d in a)if(!l(a,d)){var e=a[d],f=n(e);if(null==e||void 0==e)b+=i(e,d,f,!0);else if(e instanceof Object)if(e instanceof Array)b+=q(e,d,f);else{var g=m(e);g>0||null!=e.__text||null!=e.__cdata?(b+=i(e,d,f,!1),b+=r(e),b+=j(e,d)):b+=i(e,d,f,!0)}else b+=i(e,d,f,!1),b+=p(e),b+=j(e,d)}return b+=p(a)}(null===b||void 0===b)&&(b="_"),(null===c||void 0===c)&&(c=!1);var s="1.0.11",t=!1,u={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};this.parseXmlString=function(a){var b;if(window.DOMParser)try{var c=new window.DOMParser;b=c.parseFromString(a,"text/xml")}catch(d){return null}else if(0==a.indexOf("<?")&&(a=a.substr(a.indexOf("?>")+2)),b=new ActiveXObject("Microsoft.XMLDOM"),b.async="false",b.loadXML(a),0!=b.parseError.errorCode)return null;return b},this.xml2json=function(a){return h(a)},this.xml_str2json=function(a){var b=this.parseXmlString(a);return this.xml2json(b)},this.json2xml_str=function(a){return r(a)},this.json2xml=function(a){var b=this.json2xml_str(a);return this.parseXmlString(b)},this.getVersion=function(){return s},this.escapeMode=function(a){t=a}}function ObjectIron(a){var b;for(b=[],i=0,len=a.length;len>i;i+=1)b.push(a[i].isRoot?"root":a[i].name);var c=function(a,b){var c;if(null!==a&&null!==b)for(c in a)a.hasOwnProperty(c)&&(b.hasOwnProperty(c)||(b[c]=a[c]))},d=function(a,b,d){var e,f,g,h,i;if(null!==a&&0!==a.length)for(e=0,f=a.length;f>e;e+=1)g=a[e],b.hasOwnProperty(g.name)&&(d.hasOwnProperty(g.name)?g.merge&&(h=b[g.name],i=d[g.name],"object"==typeof h&&"object"==typeof i?c(h,i):d[g.name]=null!=g.mergeFunction?g.mergeFunction(h,i):h+i):d[g.name]=b[g.name])},e=function(a,b){var c,f,g,h,i,j,k,l=a;if(null!==l.children&&0!==l.children.length)for(c=0,f=l.children.length;f>c;c+=1)if(j=l.children[c],b.hasOwnProperty(j.name))if(j.isArray)for(i=b[j.name+"_asArray"],g=0,h=i.length;h>g;g+=1)k=i[g],d(l.properties,b,k),e(j,k);else k=b[j.name],d(l.properties,b,k),e(j,k)},f=function(c){var d,g,h,i,j,k,l;if(null===c)return c;if("object"!=typeof c)return c;for(d=0,g=b.length;g>d;d+=1)"root"===b[d]&&(j=a[d],k=c,e(j,k));for(i in c)if(c.hasOwnProperty(i)){if(h=b.indexOf(i),-1!==h)if(j=a[h],j.isArray)for(l=c[i+"_asArray"],d=0,g=l.length;g>d;d+=1)k=l[d],e(j,k);else k=c[i],e(j,k);f(c[i])}return c};return{run:f}}if(function(a){Q=a()}(function(){"use strict";function a(a){var b=Function.call;return function(){return b.apply(a,arguments)}}function b(a){return"[object StopIteration]"===hb(a)||a instanceof _}function c(a,b){b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(ib)&&(a.stack=d(a.stack)+"\n"+ib+"\n"+d(b.stack))}function d(a){for(var b=a.split("\n"),c=[],d=0;d<b.length;++d){var g=b[d];f(g)||e(g)||c.push(g)}return c.join("\n")}function e(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function f(a){var b=/at .+ \((.*):(\d+):\d+\)/.exec(a);if(!b)return!1;var c=b[1],d=b[2];return c===X&&d>=Z&&nb>=d}function g(){if(Error.captureStackTrace){var a,b,c=Error.prepareStackTrace;return Error.prepareStackTrace=function(c,d){a=d[1].getFileName(),b=d[1].getLineNumber()},(new Error).stack,Error.prepareStackTrace=c,X=a,b}}function h(a){return u(a)}function i(){function a(a){c&&(b=u(a),bb(c,function(a,c){Y(function(){b.promiseDispatch.apply(b,c)})},void 0),c=void 0,d=void 0)}var b,c=[],d=[],e=eb(i.prototype),f=eb(k.prototype);return f.promiseDispatch=function(a,e,f){var g=ab(arguments);c?(c.push(g),"when"===e&&f[1]&&d.push(f[1])):Y(function(){b.promiseDispatch.apply(b,g)})},f.valueOf=function(){return c?f:b=l(b)},Error.captureStackTrace&&h.longStackJumpLimit>0&&(Error.captureStackTrace(f,i),f.stack=f.stack.substring(f.stack.indexOf("\n")+1)),e.promise=f,e.resolve=a,e.fulfill=function(b){a(t(b))},e.reject=function(b){a(s(b))},e.notify=function(a){c&&bb(d,function(b,c){Y(function(){c(a)})},void 0)},e}function j(a){var b=i();return G(a,b.resolve,b.reject,b.notify).fail(b.reject),b.promise}function k(a,b,c,d,e){void 0===b&&(b=function(a){return s(new Error("Promise does not support operation: "+a))});var f=eb(k.prototype);return f.promiseDispatch=function(c,d,e){var g;try{g=a[d]?a[d].apply(f,e):b.call(f,d,e)}catch(h){g=s(h)}c&&c(g)},c&&(f.valueOf=c),e&&(f.exception=d),f}function l(a){return m(a)?a.valueOf():a}function m(a){return a&&"function"==typeof a.promiseDispatch}function n(a){return a&&"function"==typeof a.then}function o(a){return!p(a)&&!q(a)}function p(a){return!n(l(a))}function q(a){return a=l(a),m(a)&&"exception"in a}function r(){!jb&&"undefined"!=typeof window&&window.console}function s(a){var b=k({when:function(b){if(b){var c=cb(kb,this);-1!==c&&(lb.splice(c,1),kb.splice(c,1))}return b?b(a):this}},function(){return s(a)},function(){return this},a,!0);return kb.push(b),lb.push(a),r(),b}function t(a){return k({when:function(){return a},get:function(b){return a[b]},set:function(b,c){a[b]=c},"delete":function(b){delete a[b]},post:function(b,c){return null==b?a.apply(void 0,c):a[b].apply(a,c)},apply:function(b,c){return a.apply(b,c)},keys:function(){return gb(a)}},void 0,function(){return a})}function u(a){return m(a)?a:(a=l(a),n(a)?v(a):t(a))}function v(a){var b=i();return Y(function(){try{a.then(b.resolve,b.reject,b.notify)}catch(c){b.reject(c)}}),b.promise}function w(a){return k({isDef:function(){}},function(b,c){return C(a,b,c)},function(){return l(a)})}function x(a,b,d,e){function f(a){try{return"function"==typeof b?b(a):a}catch(c){return s(c)}}function g(a){if("function"==typeof d){c(a,m);try{return d(a)}catch(b){return s(b)}}return s(a)}function j(a){return"function"==typeof e?e(a):a}var k=i(),l=!1,m=u(a);return Y(function(){m.promiseDispatch(function(a){l||(l=!0,k.resolve(f(a)))},"when",[function(a){l||(l=!0,k.resolve(g(a)))}])}),m.promiseDispatch(void 0,"when",[void 0,function(a){var b,c=!1;try{b=j(a)}catch(d){if(c=!0,!h.onerror)throw d;h.onerror(d)}c||k.notify(b)}]),k.promise}function y(a,b,c){return x(a,function(a){return I(a).then(function(a){return b.apply(void 0,a)},c)},c)}function z(a){return function(){function c(a,c){var g;try{g=d[a](c)}catch(h){return b(h)?h.value:s(h)}return x(g,e,f)}var d=a.apply(this,arguments),e=c.bind(c,"send"),f=c.bind(c,"throw");return e()}}function A(a){throw new _(a)}function B(a){return function(){return y([this,I(arguments)],function(b,c){return a.apply(b,c)})}}function C(a,b,c){var d=i();return Y(function(){u(a).promiseDispatch(d.resolve,b,c)}),d.promise}function D(a){return function(b){var c=ab(arguments,1);return C(b,a,c)}}function E(a,b){var c=ab(arguments,2);return mb(a,b,c)}function F(a,b){return C(a,"apply",[void 0,b])}function G(a){var b=ab(arguments,1);return F(a,b)}function H(a){var b=ab(arguments,1);return function(){var c=b.concat(ab(arguments));return C(a,"apply",[this,c])}}function I(a){return x(a,function(a){var b=a.length;if(0===b)return u(a);var c=i();return bb(a,function(d,e,f){p(e)?(a[f]=l(e),0===--b&&c.resolve(a)):x(e,function(d){a[f]=d,0===--b&&c.resolve(a)}).fail(c.reject)},void 0),c.promise})}function J(a){return x(a,function(a){return a=db(a,u),x(I(db(a,function(a){return x(a,$,$)})),function(){return a})})}function K(a,b){return x(a,void 0,b)}function L(a,b){return x(a,void 0,void 0,b)}function M(a,b){return x(a,function(a){return x(b(),function(){return a})},function(a){return x(b(),function(){return s(a)})})}function N(a,b,d,e){var f=function(b){Y(function(){if(c(b,a),!h.onerror)throw b;h.onerror(b)})},g=b||d||e?x(a,b,d,e):a;"object"==typeof process&&process&&process.domain&&(f=process.domain.bind(f)),K(g,f)}function O(a,b){var c=i(),d=setTimeout(function(){c.reject(new Error("Timed out after "+b+" ms"))},b);return x(a,function(a){clearTimeout(d),c.resolve(a)},function(a){clearTimeout(d),c.reject(a)}),c.promise}function P(a,b){void 0===b&&(b=a,a=void 0);var c=i();return setTimeout(function(){c.resolve(a)},b),c.promise}function Q(a,b){var c=ab(b),d=i();return c.push(d.makeNodeResolver()),F(a,c).fail(d.reject),d.promise}function R(a){var b=ab(arguments,1),c=i();return b.push(c.makeNodeResolver()),F(a,b).fail(c.reject),c.promise}function S(a){var b=ab(arguments,1);return function(){var c=b.concat(ab(arguments)),d=i();return c.push(d.makeNodeResolver()),F(a,c).fail(d.reject),d.promise}}function T(a){var b=ab(arguments,1);return function(){function c(){return a.apply(f,arguments)}var d=b.concat(ab(arguments)),e=i();d.push(e.makeNodeResolver());var f=this;return F(c,d).fail(e.reject),e.promise}}function U(a,b,c){var d=ab(c||[]),e=i();return d.push(e.makeNodeResolver()),mb(a,b,d).fail(e.reject),e.promise}function V(a,b){var c=ab(arguments,2),d=i();return c.push(d.makeNodeResolver()),mb(a,b,c).fail(d.reject),d.promise}function W(a,b){return b?void a.then(function(a){Y(function(){b(null,a)})},function(a){Y(function(){b(a)})}):a}var X,Y,Z=g(),$=function(){};"undefined"!=typeof process?Y=process.nextTick:"function"==typeof setImmediate?Y="undefined"!=typeof window?setImmediate.bind(window):setImmediate:!function(){function a(){if(--f,++h>=e){h=0,e*=4;for(var a=g&&Math.min(g-1,e);a>f;)++f,b()}for(;g;){--g,c=c.next;var d=c.task;c.task=void 0,d()}h=0}var b,c={task:void 0,next:null},d=c,e=2,f=0,g=0,h=0;if(Y=function(a){d=d.next={task:a,next:null},f<++g&&e>f&&(++f,b())},"undefined"!=typeof MessageChannel){var i=new MessageChannel;i.port1.onmessage=a,b=function(){i.port2.postMessage(0)}}else b=function(){setTimeout(a,0)}}();var _,ab=a(Array.prototype.slice),bb=a(Array.prototype.reduce||function(a,b){var c=0,d=this.length;if(1===arguments.length)for(;;){if(c in this){b=this[c++];break}if(++c>=d)throw new TypeError}for(;d>c;c++)c in this&&(b=a(b,this[c],c));return b}),cb=a(Array.prototype.indexOf||function(a){for(var b=0;b<this.length;b++)if(this[b]===a)return b;return-1}),db=a(Array.prototype.map||function(a,b){var c=this,d=[];return bb(c,function(e,f,g){d.push(a.call(b,f,g,c))},void 0),d}),eb=Object.create||function(a){function b(){}return b.prototype=a,new b},fb=a(Object.prototype.hasOwnProperty),gb=Object.keys||function(a){var b=[];for(var c in a)fb(a,c)&&b.push(c);return b},hb=a(Object.prototype.toString);_="undefined"!=typeof ReturnValue?ReturnValue:function(a){this.value=a},h.longStackJumpLimit=1;var ib="From previous event:";h.nextTick=Y,h.defer=i,i.prototype.makeNodeResolver=function(){var a=this;return function(b,c){b?a.reject(b):a.resolve(arguments.length>2?ab(arguments,1):c)}},h.promise=j,h.makePromise=k,k.prototype.then=function(a,b,c){return x(this,a,b,c)},k.prototype.thenResolve=function(a){return x(this,function(){return a})},bb(["isFulfilled","isRejected","isPending","dispatch","when","spread","get","put","set","del","delete","post","send","invoke","keys","fapply","fcall","fbind","all","allResolved","timeout","delay","catch","finally","fail","fin","progress","done","nfcall","nfapply","nfbind","denodeify","nbind","ncall","napply","nbind","npost","nsend","ninvoke","nodeify"],function(a,b){k.prototype[b]=function(){return h[b].apply(h,[this].concat(ab(arguments)))}},void 0),k.prototype.toSource=function(){return this.toString()},k.prototype.toString=function(){return"[object Promise]"},h.nearer=l,h.isPromise=m,h.isPromiseAlike=n,h.isPending=o,h.isFulfilled=p,h.isRejected=q;var jb,kb=[],lb=[];"undefined"!=typeof process&&process.on&&process.on("exit",function(){for(var a=0;a<lb.length;a++){var b=lb[a];b&&"undefined"!=typeof b.stack}}),h.reject=s,h.fulfill=t,h.resolve=u,h.master=w,h.when=x,h.spread=y,h.async=z,h["return"]=A,h.promised=B,h.dispatch=C,h.dispatcher=D,h.get=D("get"),h.set=D("set"),h["delete"]=h.del=D("delete");var mb=h.post=D("post");h.send=E,h.invoke=E,h.fapply=F,h["try"]=G,h.fcall=G,h.fbind=H,h.keys=D("keys"),h.all=I,h.allResolved=J,h["catch"]=h.fail=K,h.progress=L,h["finally"]=h.fin=M,h.done=N,h.timeout=O,h.delay=P,h.nfapply=Q,h.nfcall=R,h.nfbind=S,h.denodeify=h.nfbind,h.nbind=T,h.npost=U,h.nsend=V,h.ninvoke=h.nsend,h.nodeify=W;var nb=g();return h}),function(a){"use strict";var b={VERSION:"0.5.3"};b.System=function(){this._mappings={},this._outlets={},this._handlers={},this.strictInjections=!0,this.autoMapOutlets=!1,this.postInjectionHook="setup"},b.System.prototype={_createAndSetupInstance:function(a,b){var c=new b;return this.injectInto(c,a),c},_retrieveFromCacheOrCreate:function(a,b){"undefined"==typeof b&&(b=!1);var c;if(!this._mappings.hasOwnProperty(a))throw new Error(1e3);var d=this._mappings[a];return!b&&d.isSingleton?(null==d.object&&(d.object=this._createAndSetupInstance(a,d.clazz)),c=d.object):c=d.clazz?this._createAndSetupInstance(a,d.clazz):d.object,c},mapOutlet:function(a,b,c){if("undefined"==typeof a)throw new Error(1010);return b=b||"global",c=c||a,this._outlets.hasOwnProperty(b)||(this._outlets[b]={}),this._outlets[b][c]=a,this},getObject:function(a){if("undefined"==typeof a)throw new Error(1020);return this._retrieveFromCacheOrCreate(a)},mapValue:function(a,b){if("undefined"==typeof a)throw new Error(1030);return this._mappings[a]={clazz:null,object:b,isSingleton:!0},this.autoMapOutlets&&this.mapOutlet(a),this.hasMapping(a)&&this.injectInto(b,a),this},hasMapping:function(a){if("undefined"==typeof a)throw new Error(1040);return this._mappings.hasOwnProperty(a)},mapClass:function(a,b){if("undefined"==typeof a)throw new Error(1050);if("undefined"==typeof b)throw new Error(1051);return this._mappings[a]={clazz:b,object:null,isSingleton:!1},this.autoMapOutlets&&this.mapOutlet(a),this},mapSingleton:function(a,b){if("undefined"==typeof a)throw new Error(1060);if("undefined"==typeof b)throw new Error(1061);return this._mappings[a]={clazz:b,object:null,isSingleton:!0},this.autoMapOutlets&&this.mapOutlet(a),this},instantiate:function(a){if("undefined"==typeof a)throw new Error(1070);return this._retrieveFromCacheOrCreate(a,!0)},injectInto:function(a,b){if("undefined"==typeof a)throw new Error(1080);if("object"==typeof a){var c=[];this._outlets.hasOwnProperty("global")&&c.push(this._outlets.global),"undefined"!=typeof b&&this._outlets.hasOwnProperty(b)&&c.push(this._outlets[b]);for(var d in c){var e=c[d];for(var f in e){var g=e[f];(!this.strictInjections||f in a)&&(a[f]=this.getObject(g))}}"setup"in a&&a.setup.call(a)}return this},unmap:function(a){if("undefined"==typeof a)throw new Error(1090);return delete this._mappings[a],this},unmapOutlet:function(a,b){if("undefined"==typeof a)throw new Error(1100);if("undefined"==typeof b)throw new Error(1101);return delete this._outlets[a][b],this},mapHandler:function(a,b,c,d,e){if("undefined"==typeof a)throw new Error(1110);return b=b||"global",c=c||a,"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1),this._handlers.hasOwnProperty(a)||(this._handlers[a]={}),this._handlers[a].hasOwnProperty(b)||(this._handlers[a][b]=[]),this._handlers[a][b].push({handler:c,oneShot:d,passEvent:e}),this},unmapHandler:function(a,b,c){if("undefined"==typeof a)throw new Error(1120);if(b=b||"global",c=c||a,this._handlers.hasOwnProperty(a)&&this._handlers[a].hasOwnProperty(b)){var d=this._handlers[a][b];for(var e in d){var f=d[e];if(f.handler===c){d.splice(e,1);break}}}return this},notify:function(a){if("undefined"==typeof a)throw new Error(1130);var b=Array.prototype.slice.call(arguments),c=b.slice(1);if(this._handlers.hasOwnProperty(a)){var d=this._handlers[a];for(var e in d){var f,g=d[e];"object"==typeof e?f=e:"global"!==e&&(f=this.getObject(e));var h,i,j=[];for(h=0,i=g.length;i>h;h++){var k,l=g[h];k=f&&"string"==typeof l.handler?f[l.handler]:l.handler,l.oneShot&&j.unshift(h),l.passEvent?k.apply(f,b):k.apply(f,c)}for(h=0,i=j.length;i>h;h++)g.splice(j[h],1)}}return this}},a.dijon=b}(this),"undefined"==typeof utils)var utils={};"undefined"==typeof utils.Math&&(utils.Math={}),utils.Math.to64BitNumber=function(a,b){var c,d,e;return c=new goog.math.Long(0,b),d=new goog.math.Long(a,0),e=c.add(d),e.toNumber()},goog={},goog.math={},goog.math.Long=function(a,b){this.low_=0|a,this.high_=0|b},goog.math.Long.IntCache_={},goog.math.Long.fromInt=function(a){if(a>=-128&&128>a){var b=goog.math.Long.IntCache_[a];if(b)return b}var c=new goog.math.Long(0|a,0>a?-1:0);return a>=-128&&128>a&&(goog.math.Long.IntCache_[a]=c),c},goog.math.Long.fromNumber=function(a){return isNaN(a)||!isFinite(a)?goog.math.Long.ZERO:a<=-goog.math.Long.TWO_PWR_63_DBL_?goog.math.Long.MIN_VALUE:a+1>=goog.math.Long.TWO_PWR_63_DBL_?goog.math.Long.MAX_VALUE:0>a?goog.math.Long.fromNumber(-a).negate():new goog.math.Long(a%goog.math.Long.TWO_PWR_32_DBL_|0,a/goog.math.Long.TWO_PWR_32_DBL_|0)},goog.math.Long.fromBits=function(a,b){return new goog.math.Long(a,b)},goog.math.Long.fromString=function(a,b){if(0==a.length)throw Error("number format error: empty string");var c=b||10;if(2>c||c>36)throw Error("radix out of range: "+c);if("-"==a.charAt(0))return goog.math.Long.fromString(a.substring(1),c).negate();if(a.indexOf("-")>=0)throw Error('number format error: interior "-" character: '+a);for(var d=goog.math.Long.fromNumber(Math.pow(c,8)),e=goog.math.Long.ZERO,f=0;f<a.length;f+=8){var g=Math.min(8,a.length-f),h=parseInt(a.substring(f,f+g),c);if(8>g){var i=goog.math.Long.fromNumber(Math.pow(c,g));e=e.multiply(i).add(goog.math.Long.fromNumber(h))}else e=e.multiply(d),e=e.add(goog.math.Long.fromNumber(h))}return e},goog.math.Long.TWO_PWR_16_DBL_=65536,goog.math.Long.TWO_PWR_24_DBL_=1<<24,goog.math.Long.TWO_PWR_32_DBL_=goog.math.Long.TWO_PWR_16_DBL_*goog.math.Long.TWO_PWR_16_DBL_,goog.math.Long.TWO_PWR_31_DBL_=goog.math.Long.TWO_PWR_32_DBL_/2,goog.math.Long.TWO_PWR_48_DBL_=goog.math.Long.TWO_PWR_32_DBL_*goog.math.Long.TWO_PWR_16_DBL_,goog.math.Long.TWO_PWR_64_DBL_=goog.math.Long.TWO_PWR_32_DBL_*goog.math.Long.TWO_PWR_32_DBL_,goog.math.Long.TWO_PWR_63_DBL_=goog.math.Long.TWO_PWR_64_DBL_/2,goog.math.Long.ZERO=goog.math.Long.fromInt(0),goog.math.Long.ONE=goog.math.Long.fromInt(1),goog.math.Long.NEG_ONE=goog.math.Long.fromInt(-1),goog.math.Long.MAX_VALUE=goog.math.Long.fromBits(-1,2147483647),goog.math.Long.MIN_VALUE=goog.math.Long.fromBits(0,-2147483648),goog.math.Long.TWO_PWR_24_=goog.math.Long.fromInt(1<<24),goog.math.Long.prototype.toInt=function(){return this.low_},goog.math.Long.prototype.toNumber=function(){return this.high_*goog.math.Long.TWO_PWR_32_DBL_+this.getLowBitsUnsigned()},goog.math.Long.prototype.toString=function(a){var b=a||10;if(2>b||b>36)throw Error("radix out of range: "+b);if(this.isZero())return"0";if(this.isNegative()){if(this.equals(goog.math.Long.MIN_VALUE)){var c=goog.math.Long.fromNumber(b),d=this.div(c),e=d.multiply(c).subtract(this);return d.toString(b)+e.toInt().toString(b)}return"-"+this.negate().toString(b)}for(var f=goog.math.Long.fromNumber(Math.pow(b,6)),e=this,g="";;){var h=e.div(f),i=e.subtract(h.multiply(f)).toInt(),j=i.toString(b);if(e=h,e.isZero())return j+g;for(;j.length<6;)j="0"+j;g=""+j+g}},goog.math.Long.prototype.getHighBits=function(){return this.high_},goog.math.Long.prototype.getLowBits=function(){return this.low_},goog.math.Long.prototype.getLowBitsUnsigned=function(){return this.low_>=0?this.low_:goog.math.Long.TWO_PWR_32_DBL_+this.low_},goog.math.Long.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(goog.math.Long.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var a=0!=this.high_?this.high_:this.low_,b=31;b>0&&0==(a&1<<b);b--);return 0!=this.high_?b+33:b+1},goog.math.Long.prototype.isZero=function(){return 0==this.high_&&0==this.low_},goog.math.Long.prototype.isNegative=function(){return this.high_<0},goog.math.Long.prototype.isOdd=function(){return 1==(1&this.low_)},goog.math.Long.prototype.equals=function(a){return this.high_==a.high_&&this.low_==a.low_},goog.math.Long.prototype.notEquals=function(a){return this.high_!=a.high_||this.low_!=a.low_},goog.math.Long.prototype.lessThan=function(a){return this.compare(a)<0},goog.math.Long.prototype.lessThanOrEqual=function(a){return this.compare(a)<=0},goog.math.Long.prototype.greaterThan=function(a){return this.compare(a)>0},goog.math.Long.prototype.greaterThanOrEqual=function(a){return this.compare(a)>=0},goog.math.Long.prototype.compare=function(a){if(this.equals(a))return 0;var b=this.isNegative(),c=a.isNegative();return b&&!c?-1:!b&&c?1:this.subtract(a).isNegative()?-1:1},goog.math.Long.prototype.negate=function(){return this.equals(goog.math.Long.MIN_VALUE)?goog.math.Long.MIN_VALUE:this.not().add(goog.math.Long.ONE)},goog.math.Long.prototype.add=function(a){var b=this.high_>>>16,c=65535&this.high_,d=this.low_>>>16,e=65535&this.low_,f=a.high_>>>16,g=65535&a.high_,h=a.low_>>>16,i=65535&a.low_,j=0,k=0,l=0,m=0;return m+=e+i,l+=m>>>16,m&=65535,l+=d+h,k+=l>>>16,l&=65535,k+=c+g,j+=k>>>16,k&=65535,j+=b+f,j&=65535,goog.math.Long.fromBits(l<<16|m,j<<16|k)},goog.math.Long.prototype.subtract=function(a){return this.add(a.negate())},goog.math.Long.prototype.multiply=function(a){if(this.isZero())return goog.math.Long.ZERO;if(a.isZero())return goog.math.Long.ZERO;if(this.equals(goog.math.Long.MIN_VALUE))return a.isOdd()?goog.math.Long.MIN_VALUE:goog.math.Long.ZERO;if(a.equals(goog.math.Long.MIN_VALUE))return this.isOdd()?goog.math.Long.MIN_VALUE:goog.math.Long.ZERO;if(this.isNegative())return a.isNegative()?this.negate().multiply(a.negate()):this.negate().multiply(a).negate();if(a.isNegative())return this.multiply(a.negate()).negate();if(this.lessThan(goog.math.Long.TWO_PWR_24_)&&a.lessThan(goog.math.Long.TWO_PWR_24_))return goog.math.Long.fromNumber(this.toNumber()*a.toNumber());var b=this.high_>>>16,c=65535&this.high_,d=this.low_>>>16,e=65535&this.low_,f=a.high_>>>16,g=65535&a.high_,h=a.low_>>>16,i=65535&a.low_,j=0,k=0,l=0,m=0;return m+=e*i,l+=m>>>16,m&=65535,l+=d*i,k+=l>>>16,l&=65535,l+=e*h,k+=l>>>16,l&=65535,k+=c*i,j+=k>>>16,k&=65535,k+=d*h,j+=k>>>16,k&=65535,k+=e*g,j+=k>>>16,k&=65535,j+=b*i+c*h+d*g+e*f,j&=65535,goog.math.Long.fromBits(l<<16|m,j<<16|k)},goog.math.Long.prototype.div=function(a){if(a.isZero())throw Error("division by zero");if(this.isZero())return goog.math.Long.ZERO;if(this.equals(goog.math.Long.MIN_VALUE)){if(a.equals(goog.math.Long.ONE)||a.equals(goog.math.Long.NEG_ONE))return goog.math.Long.MIN_VALUE;if(a.equals(goog.math.Long.MIN_VALUE))return goog.math.Long.ONE;var b=this.shiftRight(1),c=b.div(a).shiftLeft(1);if(c.equals(goog.math.Long.ZERO))return a.isNegative()?goog.math.Long.ONE:goog.math.Long.NEG_ONE;var d=this.subtract(a.multiply(c)),e=c.add(d.div(a));return e}if(a.equals(goog.math.Long.MIN_VALUE))return goog.math.Long.ZERO;if(this.isNegative())return a.isNegative()?this.negate().div(a.negate()):this.negate().div(a).negate();if(a.isNegative())return this.div(a.negate()).negate();for(var f=goog.math.Long.ZERO,d=this;d.greaterThanOrEqual(a);){for(var c=Math.max(1,Math.floor(d.toNumber()/a.toNumber())),g=Math.ceil(Math.log(c)/Math.LN2),h=48>=g?1:Math.pow(2,g-48),i=goog.math.Long.fromNumber(c),j=i.multiply(a);j.isNegative()||j.greaterThan(d);)c-=h,i=goog.math.Long.fromNumber(c),j=i.multiply(a);i.isZero()&&(i=goog.math.Long.ONE),f=f.add(i),d=d.subtract(j)}return f},goog.math.Long.prototype.modulo=function(a){return this.subtract(this.div(a).multiply(a))},goog.math.Long.prototype.not=function(){return goog.math.Long.fromBits(~this.low_,~this.high_)},goog.math.Long.prototype.and=function(a){return goog.math.Long.fromBits(this.low_&a.low_,this.high_&a.high_)},goog.math.Long.prototype.or=function(a){return goog.math.Long.fromBits(this.low_|a.low_,this.high_|a.high_)},goog.math.Long.prototype.xor=function(a){return goog.math.Long.fromBits(this.low_^a.low_,this.high_^a.high_)},goog.math.Long.prototype.shiftLeft=function(a){if(a&=63,0==a)return this;var b=this.low_;if(32>a){var c=this.high_;return goog.math.Long.fromBits(b<<a,c<<a|b>>>32-a)}return goog.math.Long.fromBits(0,b<<a-32)},goog.math.Long.prototype.shiftRight=function(a){if(a&=63,0==a)return this;var b=this.high_;if(32>a){var c=this.low_;return goog.math.Long.fromBits(c>>>a|b<<32-a,b>>a)}return goog.math.Long.fromBits(b>>a-32,b>=0?0:-1)},goog.math.Long.prototype.shiftRightUnsigned=function(a){if(a&=63,0==a)return this;var b=this.high_;if(32>a){var c=this.low_;return goog.math.Long.fromBits(c>>>a|b<<32-a,b>>>a)}return 32==a?goog.math.Long.fromBits(b,0):goog.math.Long.fromBits(b>>>a-32,0)};var UTF8={};UTF8.encode=function(a){for(var b=[],c=0;c<a.length;++c){var d=a.charCodeAt(c);128>d?b.push(d):2048>d?(b.push(192|d>>6),b.push(128|63&d)):65536>d?(b.push(224|d>>12),b.push(128|63&d>>6),b.push(128|63&d)):(b.push(240|d>>18),b.push(128|63&d>>12),b.push(128|63&d>>6),b.push(128|63&d))}return b},UTF8.decode=function(a){for(var b=[],c=0;c<a.length;){var d=a[c++];128>d||(224>d?(d=(31&d)<<6,d|=63&a[c++]):240>d?(d=(15&d)<<12,d|=(63&a[c++])<<6,d|=63&a[c++]):(d=(7&d)<<18,d|=(63&a[c++])<<12,d|=(63&a[c++])<<6,d|=63&a[c++])),b.push(String.fromCharCode(d))}return b.join("")};var BASE64={};if(function(b){var c=function(a){for(var c=0,d=[],e=0|a.length/3;0<e--;){var f=(a[c]<<16)+(a[c+1]<<8)+a[c+2];c+=3,d.push(b.charAt(63&f>>18)),d.push(b.charAt(63&f>>12)),d.push(b.charAt(63&f>>6)),d.push(b.charAt(63&f))}if(2==a.length-c){var f=(a[c]<<16)+(a[c+1]<<8);d.push(b.charAt(63&f>>18)),d.push(b.charAt(63&f>>12)),d.push(b.charAt(63&f>>6)),d.push("=")}else if(1==a.length-c){var f=a[c]<<16;d.push(b.charAt(63&f>>18)),d.push(b.charAt(63&f>>12)),d.push("==")}return d.join("")},d=function(){for(var a=[],c=0;c<b.length;++c)a[b.charCodeAt(c)]=c;return a["=".charCodeAt(0)]=0,a}(),e=function(a){for(var b=0,c=[],e=0|a.length/4;0<e--;){var f=(d[a.charCodeAt(b)]<<18)+(d[a.charCodeAt(b+1)]<<12)+(d[a.charCodeAt(b+2)]<<6)+d[a.charCodeAt(b+3)];c.push(255&f>>16),c.push(255&f>>8),c.push(255&f),b+=4}return c&&("="==a.charAt(b-2)?(c.pop(),c.pop()):"="==a.charAt(b-1)&&c.pop()),c},f={};f.encode=function(a){for(var b=[],c=0;c<a.length;++c)b.push(a.charCodeAt(c));return b},f.decode=function(){for(var b=0;b<s.length;++b)a[b]=String.fromCharCode(a[b]);return a.join("")},BASE64.decodeArray=function(a){var b=e(a);return new Uint8Array(b)},BASE64.encodeASCII=function(a){var b=f.encode(a);return c(b)},BASE64.decodeASCII=function(a){var b=e(a);return f.decode(b)},BASE64.encode=function(a){var b=UTF8.encode(a);return c(b)},BASE64.decode=function(a){var b=e(a);return UTF8.decode(b)}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),void 0===btoa)var btoa=BASE64.encode;if(void 0===atob)var atob=BASE64.decode;var mp4lib=function(){var a={boxes:{},fieldProcessors:{},fields:{},debug:!1,warningHandler:function(){}},b={},c={},d={};return a.registerBoxType=function(a){if(b[a.prototype.boxtype]=a,a.prototype.uuid){var e=JSON.stringify(a.prototype.uuid);c[e]=a.prototype.boxtype,d[a.prototype.boxtype]=e}},a.createBox=function(c){var d;return c in b?d=new b[c]:(a.warningHandler("Unknown boxtype:"+c+", parsing as UnknownBox"),d=new a.boxes.UnknownBox),d},a.findBoxtypeByUUID=function(a){return c[a]},a.findUUIDByBoxtype=function(a){return d[a]},a.deserialize=function(b){var c=new a.boxes.File,d=new a.fieldProcessors.DeserializationBoxFieldsProcessor(c,b,0,b.length);return c._processFields(d),c},a.serialize=function(b){var c=new a.fieldProcessors.LengthCounterBoxFieldsProcessor(b);b._processFields(c);var d=new Uint8Array(c.res),e=new a.fieldProcessors.SerializationBoxFieldsProcessor(b,d,0);return b._processFields(e),d},a.getBoxByType=function(a,b){for(var c=0;c<a.boxes.length;c++)if(a.boxes[c].boxtype===b)return a.boxes[c];return null},a.getBoxPositionByType=function(a,b){for(var c=0,d=0;d<a.boxes.length;d++){if(a.boxes[d].boxtype===b)return c;c+=a.boxes[d].size}return null},a.removeBoxByType=function(a,b){for(var c=0;c<a.boxes.length;c++)a.boxes[c].boxtype===b&&a.boxes.splice(c,1)},a.ParseException=function(a){this.message=a,this.name="ParseException"},a.DataIntegrityException=function(a){this.message=a,this.name="DataIntegrityException"},a}();if("undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=mp4lib:window.mp4lib=mp4lib,"undefined"!=typeof require)var mp4lib=require("./mp4lib.js");if(mp4lib.boxes.File=function(){},mp4lib.boxes.File.prototype._processFields=function(a){a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.boxes.Box=function(){this.size=null,this.boxtype=null},mp4lib.boxes.Box.prototype._processFields=function(a){a.eat("size",mp4lib.fields.FIELD_UINT32),a.eat("boxtype",mp4lib.fields.FIELD_ID),1==this.size&&a.eat("largesize",mp4lib.fields.FIELD_INT64),("uuid"==this.boxtype||mp4lib.findUUIDByBoxtype(this.boxtype))&&a.eat("usertype",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_INT8,16))},mp4lib.boxes.FullBox=function(){},mp4lib.boxes.FullBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("version",mp4lib.fields.FIELD_INT8),a.eat("flags",mp4lib.fields.FIELD_BIT24)},mp4lib.boxes.UnknownBox=function(){},mp4lib.boxes.UnknownBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("unrecognized_data",new mp4lib.fields.BoxFillingDataField)},mp4lib.boxes.FileTypeBox=function(){},mp4lib.boxes.FileTypeBox.prototype.boxtype="ftyp",mp4lib.boxes.FileTypeBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("major_brand",mp4lib.fields.FIELD_INT32),a.eat("minor_brand",mp4lib.fields.FIELD_INT32),a.eat("compatible_brands",new mp4lib.fields.BoxFillingArrayField(mp4lib.fields.FIELD_INT32))},mp4lib.registerBoxType(mp4lib.boxes.FileTypeBox),mp4lib.boxes.MovieBox=function(){},mp4lib.boxes.MovieBox.prototype.boxtype="moov",mp4lib.boxes.MovieBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)
},mp4lib.registerBoxType(mp4lib.boxes.MovieBox),mp4lib.boxes.MovieFragmentBox=function(){},mp4lib.boxes.MovieFragmentBox.prototype.boxtype="moof",mp4lib.boxes.MovieFragmentBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.registerBoxType(mp4lib.boxes.MovieFragmentBox),mp4lib.boxes.MovieFragmentRandomAccessBox=function(){},mp4lib.boxes.MovieFragmentRandomAccessBox.prototype.boxtype="mfra",mp4lib.boxes.MovieFragmentRandomAccessBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.registerBoxType(mp4lib.boxes.MovieFragmentRandomAccessBox),mp4lib.boxes.UserDataBox=function(){},mp4lib.boxes.UserDataBox.prototype.boxtype="udta",mp4lib.boxes.UserDataBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.registerBoxType(mp4lib.boxes.UserDataBox),mp4lib.boxes.TrackBox=function(){},mp4lib.boxes.TrackBox.prototype.boxtype="trak",mp4lib.boxes.TrackBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.registerBoxType(mp4lib.boxes.TrackBox),mp4lib.boxes.EditBox=function(){},mp4lib.boxes.EditBox.prototype.boxtype="edts",mp4lib.boxes.EditBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.registerBoxType(mp4lib.boxes.EditBox),mp4lib.boxes.MediaBox=function(){},mp4lib.boxes.MediaBox.prototype.boxtype="mdia",mp4lib.boxes.MediaBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.registerBoxType(mp4lib.boxes.MediaBox),mp4lib.boxes.MediaInformationBox=function(){},mp4lib.boxes.MediaInformationBox.prototype.boxtype="minf",mp4lib.boxes.MediaInformationBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.registerBoxType(mp4lib.boxes.MediaInformationBox),mp4lib.boxes.DataInformationBox=function(){},mp4lib.boxes.DataInformationBox.prototype.boxtype="dinf",mp4lib.boxes.DataInformationBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.registerBoxType(mp4lib.boxes.DataInformationBox),mp4lib.boxes.SampleTableBox=function(){},mp4lib.boxes.SampleTableBox.prototype.boxtype="stbl",mp4lib.boxes.SampleTableBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.registerBoxType(mp4lib.boxes.SampleTableBox),mp4lib.boxes.MovieExtendsBox=function(){},mp4lib.boxes.MovieExtendsBox.prototype.boxtype="mvex",mp4lib.boxes.MovieExtendsBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.registerBoxType(mp4lib.boxes.MovieExtendsBox),mp4lib.boxes.TrackFragmentBox=function(){},mp4lib.boxes.TrackFragmentBox.prototype.boxtype="traf",mp4lib.boxes.TrackFragmentBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.registerBoxType(mp4lib.boxes.TrackFragmentBox),mp4lib.boxes.MetaBox=function(){},mp4lib.boxes.MetaBox.prototype.boxtype="meta",mp4lib.boxes.MetaBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.registerBoxType(mp4lib.boxes.MetaBox),mp4lib.boxes.MovieHeaderBox=function(){},mp4lib.boxes.MovieHeaderBox.prototype.boxtype="mvhd",mp4lib.boxes.MovieHeaderBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),1==this.version?(a.eat("creation_time",mp4lib.fields.FIELD_UINT64),a.eat("modification_time",mp4lib.fields.FIELD_UINT64),a.eat("timescale",mp4lib.fields.FIELD_UINT32),a.eat("duration",mp4lib.fields.FIELD_UINT64)):(a.eat("creation_time",mp4lib.fields.FIELD_UINT32),a.eat("modification_time",mp4lib.fields.FIELD_UINT32),a.eat("timescale",mp4lib.fields.FIELD_UINT32),a.eat("duration",mp4lib.fields.FIELD_UINT32)),a.eat("rate",mp4lib.fields.FIELD_INT32),a.eat("volume",mp4lib.fields.FIELD_INT16),a.eat("reserved",mp4lib.fields.FIELD_INT16),a.eat("reserved_2",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_INT32,2)),a.eat("matrix",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_INT32,9)),a.eat("pre_defined",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_BIT32,6)),a.eat("next_track_ID",mp4lib.fields.FIELD_UINT32)},mp4lib.registerBoxType(mp4lib.boxes.MovieHeaderBox),mp4lib.boxes.MediaDataBox=function(){},mp4lib.boxes.MediaDataBox.prototype.boxtype="mdat",mp4lib.boxes.MediaDataBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("data",mp4lib.fields.FIELD_BOX_FILLING_DATA)},mp4lib.registerBoxType(mp4lib.boxes.MediaDataBox),mp4lib.boxes.FreeSpaceBox=function(){},mp4lib.boxes.FreeSpaceBox.prototype.boxtype="free",mp4lib.boxes.FreeSpaceBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("data",mp4lib.fields.FIELD_BOX_FILLING_DATA)},mp4lib.registerBoxType(mp4lib.boxes.FreeSpaceBox),mp4lib.boxes.SegmentIndexBox=function(){},mp4lib.boxes.SegmentIndexBox.prototype.boxtype="sidx",mp4lib.boxes.SegmentIndexBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("reference_ID",mp4lib.fields.FIELD_UINT32),a.eat("timescale",mp4lib.fields.FIELD_UINT32),1==this.version?(a.eat("earliest_presentation_time",mp4lib.fields.FIELD_UINT64),a.eat("first_offset",mp4lib.fields.FIELD_UINT64)):(a.eat("earliest_presentation_time",mp4lib.fields.FIELD_UINT32),a.eat("first_offset",mp4lib.fields.FIELD_UINT32)),a.eat("reserved",mp4lib.fields.FIELD_UINT16),a.isDeserializing||(this.reference_count=this.references.length),a.eat("reference_count",mp4lib.fields.FIELD_UINT16);var b=new mp4lib.fields.StructureField(this,mp4lib.boxes.SegmentIndexBox.prototype._processReference),c=new mp4lib.fields.ArrayField(b,this.reference_count);a.eat("references",c)},mp4lib.boxes.SegmentIndexBox.prototype._processReference=function(a,b){b.eat("reference_info",mp4lib.fields.FIELD_UINT64),b.eat("SAP",mp4lib.fields.FIELD_UINT32)},mp4lib.registerBoxType(mp4lib.boxes.SegmentIndexBox),mp4lib.boxes.TrackHeaderBox=function(){},mp4lib.boxes.TrackHeaderBox.prototype.boxtype="tkhd",mp4lib.boxes.TrackHeaderBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),1==this.version?(a.eat("creation_time",mp4lib.fields.FIELD_UINT64),a.eat("modification_time",mp4lib.fields.FIELD_UINT64),a.eat("track_id",mp4lib.fields.FIELD_UINT32),a.eat("reserved",mp4lib.fields.FIELD_UINT32),a.eat("duration",mp4lib.fields.FIELD_UINT64)):(a.eat("creation_time",mp4lib.fields.FIELD_UINT32),a.eat("modification_time",mp4lib.fields.FIELD_UINT32),a.eat("track_id",mp4lib.fields.FIELD_UINT32),a.eat("reserved",mp4lib.fields.FIELD_UINT32),a.eat("duration",mp4lib.fields.FIELD_UINT32)),a.eat("reserved_2",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_UINT32,2)),a.eat("layer",mp4lib.fields.FIELD_INT16),a.eat("alternate_group",mp4lib.fields.FIELD_INT16),a.eat("volume",mp4lib.fields.FIELD_INT16),a.eat("reserved_3",mp4lib.fields.FIELD_INT16),a.eat("matrix",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_INT32,9)),a.eat("width",mp4lib.fields.FIELD_INT32),a.eat("height",mp4lib.fields.FIELD_INT32)},mp4lib.registerBoxType(mp4lib.boxes.TrackHeaderBox),mp4lib.boxes.MediaHeaderBox=function(){},mp4lib.boxes.MediaHeaderBox.prototype.boxtype="mdhd",mp4lib.boxes.MediaHeaderBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),1==this.version?(a.eat("creation_time",mp4lib.fields.FIELD_UINT64),a.eat("modification_time",mp4lib.fields.FIELD_UINT64),a.eat("timescale",mp4lib.fields.FIELD_UINT32),a.eat("duration",mp4lib.fields.FIELD_UINT64)):(a.eat("creation_time",mp4lib.fields.FIELD_UINT32),a.eat("modification_time",mp4lib.fields.FIELD_UINT32),a.eat("timescale",mp4lib.fields.FIELD_UINT32),a.eat("duration",mp4lib.fields.FIELD_UINT32)),a.eat("language",mp4lib.fields.FIELD_UINT16),a.eat("reserved",mp4lib.fields.FIELD_UINT16)},mp4lib.registerBoxType(mp4lib.boxes.MediaHeaderBox),mp4lib.boxes.MovieExtendsHeaderBox=function(){},mp4lib.boxes.MovieExtendsHeaderBox.prototype.boxtype="mehd",mp4lib.boxes.MovieExtendsHeaderBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),1==this.version?a.eat("fragment_duration",mp4lib.fields.FIELD_UINT64):a.eat("fragment_duration",mp4lib.fields.FIELD_UINT32)},mp4lib.registerBoxType(mp4lib.boxes.MovieExtendsHeaderBox),mp4lib.boxes.HandlerBox=function(){},mp4lib.boxes.HandlerBox.prototype.boxtype="hdlr",mp4lib.boxes.HandlerBox.prototype.HANDLERTYPEVIDEO="vide",mp4lib.boxes.HandlerBox.prototype.HANDLERTYPEAUDIO="soun",mp4lib.boxes.HandlerBox.prototype.HANDLERTYPETEXT="meta",mp4lib.boxes.HandlerBox.prototype.HANDLERVIDEONAME="Video Track",mp4lib.boxes.HandlerBox.prototype.HANDLERAUDIONAME="Audio Track",mp4lib.boxes.HandlerBox.prototype.HANDLERTEXTNAME="Text Track",mp4lib.boxes.HandlerBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("pre_defined",mp4lib.fields.FIELD_UINT32),a.eat("handler_type",mp4lib.fields.FIELD_UINT32),a.eat("reserved",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_UINT32,3)),a.eat("name",mp4lib.fields.FIELD_STRING)},mp4lib.registerBoxType(mp4lib.boxes.HandlerBox),mp4lib.boxes.TimeToSampleBox=function(){},mp4lib.boxes.TimeToSampleBox.prototype.boxtype="stts",mp4lib.boxes.TimeToSampleBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.isDeserializing||(this.entry_count=this.entry.length),a.eat("entry_count",mp4lib.fields.FIELD_UINT_32);var b=new mp4lib.fields.StructureField(this,mp4lib.boxes.TimeToSampleBox.prototype._processEntry),c=new mp4lib.fields.ArrayField(b,this.entry_count);a.eat("entry",c)},mp4lib.boxes.TimeToSampleBox.prototype._processEntry=function(a,b){b.eat("sample_count",mp4lib.fields.FIELD_UINT32),b.eat("sample_delta",mp4lib.fields.FIELD_UINT32)},mp4lib.registerBoxType(mp4lib.boxes.TimeToSampleBox),mp4lib.boxes.SampleToChunkBox=function(){},mp4lib.boxes.SampleToChunkBox.prototype.boxtype="stsc",mp4lib.boxes.SampleToChunkBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.isDeserializing||(this.entry_count=this.entry.length),a.eat("entry_count",mp4lib.fields.FIELD_UINT32);var b=new mp4lib.fields.StructureField(this,mp4lib.boxes.SampleToChunkBox.prototype._processEntry),c=new mp4lib.fields.ArrayField(b,this.entry_count);a.eat("entry",c)},mp4lib.boxes.SampleToChunkBox.prototype._processEntry=function(a,b){b.eat("first_chunk",mp4lib.fields.FIELD_UINT32),b.eat("samples_per_chunk",mp4lib.fields.FIELD_UINT32),b.eat("samples_description_index",mp4lib.fields.FIELD_UINT32)},mp4lib.registerBoxType(mp4lib.boxes.SampleToChunkBox),mp4lib.boxes.ChunkOffsetBox=function(){},mp4lib.boxes.ChunkOffsetBox.prototype.boxtype="stco",mp4lib.boxes.ChunkOffsetBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.isDeserializing||(this.entry_count=this.chunk_offset.length),a.eat("entry_count",mp4lib.fields.FIELD_UINT32);var b=new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_UINT32,this.entry_count);a.eat("chunk_offset",b)},mp4lib.registerBoxType(mp4lib.boxes.ChunkOffsetBox),mp4lib.boxes.TrackExtendsBox=function(){},mp4lib.boxes.TrackExtendsBox.prototype.boxtype="trex",mp4lib.boxes.TrackExtendsBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("track_ID",mp4lib.fields.FIELD_UINT32),a.eat("default_sample_description_index",mp4lib.fields.FIELD_UINT32),a.eat("default_sample_duration",mp4lib.fields.FIELD_UINT32),a.eat("default_sample_size",mp4lib.fields.FIELD_UINT32),a.eat("default_sample_flags",mp4lib.fields.FIELD_UINT32)},mp4lib.registerBoxType(mp4lib.boxes.TrackExtendsBox),mp4lib.boxes.VideoMediaHeaderBox=function(){},mp4lib.boxes.VideoMediaHeaderBox.prototype.boxtype="vmhd",mp4lib.boxes.VideoMediaHeaderBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("graphicsmode",mp4lib.fields.FIELD_INT16),a.eat("opcolor",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_UINT16,3))},mp4lib.registerBoxType(mp4lib.boxes.VideoMediaHeaderBox),mp4lib.boxes.SoundMediaHeaderBox=function(){},mp4lib.boxes.SoundMediaHeaderBox.prototype.boxtype="smhd",mp4lib.boxes.SoundMediaHeaderBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("balance",mp4lib.fields.FIELD_INT16),a.eat("reserved",mp4lib.fields.FIELD_UINT16)},mp4lib.registerBoxType(mp4lib.boxes.SoundMediaHeaderBox),mp4lib.boxes.DataReferenceBox=function(){},mp4lib.boxes.DataReferenceBox.prototype.boxtype="dref",mp4lib.boxes.DataReferenceBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.isDeserializing||(this.entry_count=this.boxes.length),a.eat("entry_count",mp4lib.fields.FIELD_UINT32),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.registerBoxType(mp4lib.boxes.DataReferenceBox),mp4lib.boxes.DataEntryUrlBox=function(){},mp4lib.boxes.DataEntryUrlBox.prototype.boxtype="url ",mp4lib.boxes.DataEntryUrlBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.isDeserializing?this.flags&!1&&a.eat("location",mp4lib.fields.FIELD_STRING):"location"in this&&(this.flags=1|this.flags,a.eat("location",mp4lib.fields.FIELD_STRING))},mp4lib.registerBoxType(mp4lib.boxes.DataEntryUrlBox),mp4lib.boxes.DataEntryUrnBox=function(){},mp4lib.boxes.DataEntryUrnBox.prototype.boxtype="urn ",mp4lib.boxes.DataEntryUrnBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),this.flags&!1&&(a.eat("name",mp4lib.fields.FIELD_STRING),a.eat("location",mp4lib.fields.FIELD_STRING))},mp4lib.registerBoxType(mp4lib.boxes.DataEntryUrnBox),mp4lib.boxes.MovieFragmentHeaderBox=function(){},mp4lib.boxes.MovieFragmentHeaderBox.prototype.boxtype="mfhd",mp4lib.boxes.MovieFragmentHeaderBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("sequence_number",mp4lib.fields.FIELD_UINT32)},mp4lib.registerBoxType(mp4lib.boxes.MovieFragmentHeaderBox),mp4lib.boxes.TrackFragmentHeaderBox=function(){},mp4lib.boxes.TrackFragmentHeaderBox.prototype.boxtype="tfhd",mp4lib.boxes.TrackFragmentHeaderBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("track_ID",mp4lib.fields.FIELD_UINT32),a.eat_flagged(this,"flags",1,"base_data_offset",mp4lib.fields.FIELD_UINT64),a.eat_flagged(this,"flags",2,"sample_description_index",mp4lib.fields.FIELD_UINT32),a.eat_flagged(this,"flags",8,"default_sample_duration",mp4lib.fields.FIELD_UINT32),a.eat_flagged(this,"flags",16,"default_sample_size",mp4lib.fields.FIELD_UINT32),a.eat_flagged(this,"flags",32,"default_sample_flags",mp4lib.fields.FIELD_UINT32)},mp4lib.registerBoxType(mp4lib.boxes.TrackFragmentHeaderBox),mp4lib.boxes.TrackFragmentBaseMediaDecodeTimeBox=function(){},mp4lib.boxes.TrackFragmentBaseMediaDecodeTimeBox.prototype.boxtype="tfdt",mp4lib.boxes.TrackFragmentBaseMediaDecodeTimeBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),1==this.version?a.eat("baseMediaDecodeTime",mp4lib.fields.FIELD_UINT64):a.eat("baseMediaDecodeTime",mp4lib.fields.FIELD_UINT32)},mp4lib.registerBoxType(mp4lib.boxes.TrackFragmentBaseMediaDecodeTimeBox),mp4lib.boxes.TrackFragmentRunBox=function(){},mp4lib.boxes.TrackFragmentRunBox.prototype.boxtype="trun",mp4lib.boxes.TrackFragmentRunBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.isDeserializing||(this.sample_count=this.samples_table.length),a.eat("sample_count",mp4lib.fields.FIELD_UINT32),a.eat_flagged(this,"flags",1,"data_offset",mp4lib.fields.FIELD_INT32),a.eat_flagged(this,"flags",4,"first_sample_flags",mp4lib.fields.FIELD_UINT32);var b=new mp4lib.fields.StructureField(this,mp4lib.boxes.TrackFragmentRunBox.prototype._processEntry);a.eat("samples_table",new mp4lib.fields.ArrayField(b,this.sample_count))},mp4lib.boxes.TrackFragmentRunBox.prototype._processEntry=function(a,b){b.eat_flagged(a,"flags",256,"sample_duration",mp4lib.fields.FIELD_UINT32),b.eat_flagged(a,"flags",512,"sample_size",mp4lib.fields.FIELD_UINT32),b.eat_flagged(a,"flags",1024,"sample_flags",mp4lib.fields.FIELD_UINT32),1==a.version?b.eat_flagged(a,"flags",2048,"sample_composition_time_offset",mp4lib.fields.FIELD_INT32):b.eat_flagged(a,"flags",2048,"sample_composition_time_offset",mp4lib.fields.FIELD_UINT32)},mp4lib.registerBoxType(mp4lib.boxes.TrackFragmentRunBox),mp4lib.boxes.TimeToSampleBox=function(){},mp4lib.boxes.TimeToSampleBox.prototype.boxtype="stts",mp4lib.boxes.TimeToSampleBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.isDeserializing||(this.entry_count=this.entry.length),a.eat("entry_count",mp4lib.fields.FIELD_UINT32);var b=new mp4lib.fields.StructureField(this,mp4lib.boxes.TimeToSampleBox.prototype._processEntry),c=new mp4lib.fields.ArrayField(b,this.entry_count);a.eat("entry",c)},mp4lib.boxes.TimeToSampleBox.prototype._processEntry=function(a,b){b.eat("sample_count",mp4lib.fields.FIELD_UINT32),b.eat("sample_delta",mp4lib.fields.FIELD_UINT32)},mp4lib.registerBoxType(mp4lib.boxes.TimeToSampleBox),mp4lib.boxes.SampleDescriptionBox=function(){},mp4lib.boxes.SampleDescriptionBox.prototype.boxtype="stsd",mp4lib.boxes.SampleDescriptionBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.isDeserializing||(this.entry_count=this.boxes.length),a.eat("entry_count",mp4lib.fields.FIELD_UINT32),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.registerBoxType(mp4lib.boxes.SampleDescriptionBox),mp4lib.boxes.SampleDependencyTableBox=function(){},mp4lib.boxes.SampleDependencyTableBox.prototype.boxtype="sdtp",mp4lib.boxes.SampleDependencyTableBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("sample_dependency_array",new mp4lib.fields.BoxFillingArrayField(mp4lib.fields.FIELD_UINT8))},mp4lib.registerBoxType(mp4lib.boxes.SampleDependencyTableBox),mp4lib.boxes.SampleEntryBox=function(){},mp4lib.boxes.SampleEntryBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("reserved",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_UINT8,6)),a.eat("data_reference_index",mp4lib.fields.FIELD_UINT16)},mp4lib.boxes.VisualSampleEntryBox=function(){},mp4lib.boxes.VisualSampleEntryBox.prototype._processFields=function(a){mp4lib.boxes.SampleEntryBox.prototype._processFields.call(this,a),a.eat("pre_defined",mp4lib.fields.FIELD_UINT16),a.eat("reserved_2",mp4lib.fields.FIELD_UINT16),a.eat("pre_defined_2",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_UINT32,3)),a.eat("width",mp4lib.fields.FIELD_UINT16),a.eat("height",mp4lib.fields.FIELD_UINT16),a.eat("horizresolution",mp4lib.fields.FIELD_UINT32),a.eat("vertresolution",mp4lib.fields.FIELD_UINT32),a.eat("reserved_3",mp4lib.fields.FIELD_UINT32),a.eat("frame_count",mp4lib.fields.FIELD_UINT16),a.eat("compressorname",new mp4lib.fields.FixedLenStringField(32)),a.eat("depth",mp4lib.fields.FIELD_UINT16),a.eat("pre_defined_3",mp4lib.fields.FIELD_INT16),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.boxes.AVC1VisualSampleEntryBox=function(){},mp4lib.boxes.AVC1VisualSampleEntryBox.prototype.boxtype="avc1",mp4lib.boxes.AVC1VisualSampleEntryBox.prototype._processFields=function(a){mp4lib.boxes.VisualSampleEntryBox.prototype._processFields.call(this,a)},mp4lib.registerBoxType(mp4lib.boxes.AVC1VisualSampleEntryBox),mp4lib.boxes.EncryptedVideoBox=function(){},mp4lib.boxes.EncryptedVideoBox.prototype.boxtype="encv",mp4lib.boxes.EncryptedVideoBox.prototype._processFields=function(a){mp4lib.boxes.VisualSampleEntryBox.prototype._processFields.call(this,a)},mp4lib.registerBoxType(mp4lib.boxes.EncryptedVideoBox),mp4lib.boxes.AVCConfigurationBox=function(){},mp4lib.boxes.AVCConfigurationBox.prototype.boxtype="avcC",mp4lib.boxes.AVCConfigurationBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("configurationVersion",mp4lib.fields.FIELD_UINT8),a.eat("AVCProfileIndication",mp4lib.fields.FIELD_UINT8),a.eat("profile_compatibility",mp4lib.fields.FIELD_UINT8),a.eat("AVCLevelIndication",mp4lib.fields.FIELD_UINT8),a.isDeserializing?(a.eat("temp",mp4lib.fields.FIELD_UINT8),this.lengthSizeMinusOne=3&this.temp,a.eat("numOfSequenceParameterSets_tmp",mp4lib.fields.FIELD_UINT8),this.numOfSequenceParameterSets=31&this.numOfSequenceParameterSets_tmp):(this.temp=252|this.lengthSizeMinusOne,a.eat("temp",mp4lib.fields.FIELD_UINT8),this.numOfSequenceParameterSets=this.SPS_NAL.length,this.numOfSequenceParameterSets_tmp=224|this.numOfSequenceParameterSets,a.eat("numOfSequenceParameterSets_tmp",mp4lib.fields.FIELD_UINT8)),a.eat("SPS_NAL",new mp4lib.fields.VariableElementSizeArrayField(new mp4lib.fields.StructureField(this,mp4lib.boxes.AVCConfigurationBox.prototype._processNAL),this.numOfSequenceParameterSets)),a.eat("numOfPictureParameterSets",mp4lib.fields.FIELD_UINT8),a.eat("PPS_NAL",new mp4lib.fields.VariableElementSizeArrayField(new mp4lib.fields.StructureField(this,mp4lib.boxes.AVCConfigurationBox.prototype._processNAL),this.numOfPictureParameterSets))},mp4lib.boxes.AVCConfigurationBox.prototype._processNAL=function(a,b){b.eat("NAL_length",mp4lib.fields.FIELD_UINT16),b.eat("NAL",new mp4lib.fields.DataField(this.NAL_length))},mp4lib.registerBoxType(mp4lib.boxes.AVCConfigurationBox),mp4lib.boxes.PixelAspectRatioBox=function(){},mp4lib.boxes.PixelAspectRatioBox.prototype.boxtype="pasp",mp4lib.boxes.PixelAspectRatioBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("hSpacing",mp4lib.fields.FIELD_INT32),a.eat("vSpacing",mp4lib.fields.FIELD_INT32)},mp4lib.registerBoxType(mp4lib.boxes.PixelAspectRatioBox),mp4lib.boxes.AudioSampleEntryBox=function(){},mp4lib.boxes.AudioSampleEntryBox.prototype._processFields=function(a){mp4lib.boxes.SampleEntryBox.prototype._processFields.call(this,a),a.eat("reserved_2",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_UINT32,2)),a.eat("channelcount",mp4lib.fields.FIELD_UINT16),a.eat("samplesize",mp4lib.fields.FIELD_UINT16),a.eat("pre_defined",mp4lib.fields.FIELD_UINT16),a.eat("reserved_3",mp4lib.fields.FIELD_UINT16),a.eat("samplerate",mp4lib.fields.FIELD_UINT32),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.boxes.MP4AudioSampleEntryBox=function(){},mp4lib.boxes.MP4AudioSampleEntryBox.prototype.boxtype="mp4a",mp4lib.boxes.MP4AudioSampleEntryBox.prototype._processFields=function(a){mp4lib.boxes.AudioSampleEntryBox.prototype._processFields.call(this,a)},mp4lib.registerBoxType(mp4lib.boxes.MP4AudioSampleEntryBox),mp4lib.boxes.EncryptedAudioBox=function(){},mp4lib.boxes.EncryptedAudioBox.prototype.boxtype="enca",mp4lib.boxes.EncryptedAudioBox.prototype._processFields=function(a){mp4lib.boxes.AudioSampleEntryBox.prototype._processFields.call(this,a)},mp4lib.registerBoxType(mp4lib.boxes.EncryptedAudioBox),mp4lib.boxes.ESDBox=function(){},mp4lib.boxes.ESDBox.prototype.boxtype="esds",mp4lib.boxes.ESDBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("ES_tag",mp4lib.fields.FIELD_UINT8),a.eat("ES_length",mp4lib.fields.FIELD_UINT8),a.eat("ES_data",new mp4lib.fields.DataField(this.ES_length))},mp4lib.registerBoxType(mp4lib.boxes.ESDBox),mp4lib.boxes.SampleSizeBox=function(){},mp4lib.boxes.SampleSizeBox.prototype.boxtype="stsz",mp4lib.boxes.SampleSizeBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("sample_size",mp4lib.fields.FIELD_UINT32),a.eat("sample_count",mp4lib.fields.FIELD_UINT32);var b=new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_UINT32,this.sample_count);a.eat("entries",b)},mp4lib.registerBoxType(mp4lib.boxes.SampleSizeBox),mp4lib.boxes.ProtectionSystemSpecificHeaderBox=function(){},mp4lib.boxes.ProtectionSystemSpecificHeaderBox.prototype.boxtype="pssh",mp4lib.boxes.ProtectionSystemSpecificHeaderBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("SystemID",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_UINT8,16)),a.eat("DataSize",mp4lib.fields.FIELD_UINT32),a.eat("Data",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_UINT8,this.DataSize))},mp4lib.registerBoxType(mp4lib.boxes.ProtectionSystemSpecificHeaderBox),mp4lib.boxes.SampleAuxiliaryInformationSizesBox=function(){},mp4lib.boxes.SampleAuxiliaryInformationSizesBox.prototype.boxtype="saiz",mp4lib.boxes.SampleAuxiliaryInformationSizesBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),1&this.flags&&(a.eat("aux_info_type",mp4lib.fields.FIELD_UINT32),a.eat("aux_info_type_parameter",mp4lib.fields.FIELD_UINT32)),a.eat("default_sample_info_size",mp4lib.fields.FIELD_UINT8),a.eat("sample_count",mp4lib.fields.FIELD_UINT32),0===this.default_sample_info_size&&a.eat("sample_info_size",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_UINT8,this.sample_count))},mp4lib.registerBoxType(mp4lib.boxes.SampleAuxiliaryInformationSizesBox),mp4lib.boxes.SampleAuxiliaryInformationOffsetsBox=function(){},mp4lib.boxes.SampleAuxiliaryInformationOffsetsBox.prototype.boxtype="saio",mp4lib.boxes.SampleAuxiliaryInformationOffsetsBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),1&this.flags&&(a.eat("aux_info_type",mp4lib.fields.FIELD_UINT32),a.eat("aux_info_type_parameter",mp4lib.fields.FIELD_UINT32)),a.eat("entry_count",mp4lib.fields.FIELD_UINT32),0===this.version?a.eat("offset",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_UINT32,this.entry_count)):a.eat("offset",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_UINT64,this.entry_count))},mp4lib.registerBoxType(mp4lib.boxes.SampleAuxiliaryInformationOffsetsBox),mp4lib.boxes.ProtectionSchemeInformationBox=function(){},mp4lib.boxes.ProtectionSchemeInformationBox.prototype.boxtype="sinf",mp4lib.boxes.ProtectionSchemeInformationBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.registerBoxType(mp4lib.boxes.ProtectionSchemeInformationBox),mp4lib.boxes.SchemeInformationBox=function(){},mp4lib.boxes.SchemeInformationBox.prototype.boxtype="schi",mp4lib.boxes.SchemeInformationBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("boxes",mp4lib.fields.FIELD_CONTAINER_CHILDREN)},mp4lib.registerBoxType(mp4lib.boxes.SchemeInformationBox),mp4lib.boxes.TrackEncryptionBox=function(){},mp4lib.boxes.TrackEncryptionBox.prototype.boxtype="tenc",mp4lib.boxes.TrackEncryptionBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("default_IsEncrypted",mp4lib.fields.FIELD_BIT24),a.eat("default_IV_size",mp4lib.fields.FIELD_UINT8),a.eat("default_KID",new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_UINT8,16))},mp4lib.registerBoxType(mp4lib.boxes.TrackEncryptionBox),mp4lib.boxes.SchemeTypeBox=function(){},mp4lib.boxes.SchemeTypeBox.prototype.boxtype="schm",mp4lib.boxes.SchemeTypeBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("scheme_type",mp4lib.fields.FIELD_UINT32),a.eat("scheme_version",mp4lib.fields.FIELD_UINT32),1&this.flags&&a.eat("scheme_uri",mp4lib.fields.FIELD_STRING)},mp4lib.registerBoxType(mp4lib.boxes.SchemeTypeBox),mp4lib.boxes.EditListBox=function(){},mp4lib.boxes.EditListBox.prototype.boxtype="elst",mp4lib.boxes.EditListBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("entry_count",mp4lib.fields.FIELD_UINT32);var b=new mp4lib.fields.StructureField(this,mp4lib.boxes.EditListBox.prototype._processEntry),c=new mp4lib.fields.ArrayField(b,this.entry_count);a.eat("entries",c)},mp4lib.boxes.EditListBox.prototype._processEntry=function(a,b){1==a.version?(b.eat("segment_duration",mp4lib.fields.FIELD_UINT64),b.eat("media_time",mp4lib.fields.FIELD_UINT64)):(b.eat("segment_duration",mp4lib.fields.FIELD_UINT32),b.eat("media_time",mp4lib.fields.FIELD_UINT32)),b.eat("media_rate_integer",mp4lib.fields.FIELD_UINT16),b.eat("media_rate_fraction",mp4lib.fields.FIELD_UINT16)},mp4lib.registerBoxType(mp4lib.boxes.EditListBox),mp4lib.boxes.HintMediaHeaderBox=function(){},mp4lib.boxes.HintMediaHeaderBox.prototype.boxtype="hmhd",mp4lib.boxes.HintMediaHeaderBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("maxPDUsize",mp4lib.fields.FIELD_UINT16),a.eat("avgPDUsize",mp4lib.fields.FIELD_UINT16),a.eat("maxbitrate",mp4lib.fields.FIELD_UINT32),a.eat("avgbitrate",mp4lib.fields.FIELD_UINT32),a.eat("reserved",mp4lib.fields.FIELD_UINT32)},mp4lib.registerBoxType(mp4lib.boxes.HintMediaHeaderBox),mp4lib.boxes.NullMediaHeaderBox=function(){},mp4lib.boxes.NullMediaHeaderBox.prototype.boxtype="nmhd",mp4lib.boxes.NullMediaHeaderBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a)},mp4lib.registerBoxType(mp4lib.boxes.NullMediaHeaderBox),mp4lib.boxes.CompositionOffsetBox=function(){},mp4lib.boxes.CompositionOffsetBox.prototype.boxtype="ctts",mp4lib.boxes.CompositionOffsetBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("entry_count",mp4lib.fields.FIELD_UINT32);var b=new mp4lib.fields.StructureField(this,mp4lib.boxes.CompositionOffsetBox.prototype._processEntry),c=new mp4lib.fields.ArrayField(b,this.entry_count);a.eat("entries",c)},mp4lib.boxes.CompositionOffsetBox.prototype._processEntry=function(a,b){0===a.version?(b.eat("sample_count",mp4lib.fields.FIELD_UINT32),b.eat("sample_offset",mp4lib.fields.FIELD_UINT32)):(b.eat("sample_count",mp4lib.fields.FIELD_UINT32),b.eat("sample_offset",mp4lib.fields.FIELD_INT32))},mp4lib.registerBoxType(mp4lib.boxes.CompositionOffsetBox),mp4lib.boxes.CompositionToDecodeBox=function(){},mp4lib.boxes.CompositionToDecodeBox.prototype.boxtype="cslg",mp4lib.boxes.CompositionToDecodeBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("compositionToDTSShift",mp4lib.fields.FIELD_INT32),a.eat("leastDecodeToDisplayDelta",mp4lib.fields.FIELD_INT32),a.eat("greatestDecodeToDisplayDelta",mp4lib.fields.FIELD_INT32),a.eat("compositionStartTime",mp4lib.fields.FIELD_INT32),a.eat("compositionEndTime",mp4lib.fields.FIELD_INT32)},mp4lib.registerBoxType(mp4lib.boxes.CompositionToDecodeBox),mp4lib.boxes.SyncSampleBox=function(){},mp4lib.boxes.SyncSampleBox.prototype.boxtype="stss",mp4lib.boxes.SyncSampleBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("entry_count",mp4lib.fields.FIELD_UINT32);var b=new mp4lib.fields.StructureField(this,mp4lib.boxes.SyncSampleBox.prototype._processEntry),c=new mp4lib.fields.ArrayField(b,this.entry_count);a.eat("entries",c)},mp4lib.boxes.SyncSampleBox.prototype._processEntry=function(a,b){b.eat("sample_number",mp4lib.fields.FIELD_UINT32)},mp4lib.registerBoxType(mp4lib.boxes.SyncSampleBox),mp4lib.boxes.TrackReferenceBox=function(){},mp4lib.boxes.TrackReferenceBox.prototype.boxtype="tref",mp4lib.boxes.TrackReferenceBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("track_IDs",new mp4lib.fields.BoxFillingArrayField(mp4lib.fields.FIELD_UINT32))
},mp4lib.registerBoxType(mp4lib.boxes.TrackReferenceBox),mp4lib.boxes.OriginalFormatBox=function(){},mp4lib.boxes.OriginalFormatBox.prototype.boxtype="frma",mp4lib.boxes.OriginalFormatBox.prototype._processFields=function(a){mp4lib.boxes.Box.prototype._processFields.call(this,a),a.eat("data_format",mp4lib.fields.FIELD_UINT32)},mp4lib.registerBoxType(mp4lib.boxes.OriginalFormatBox),mp4lib.boxes.PiffSampleEncryptionBox=function(){},mp4lib.boxes.PiffSampleEncryptionBox.prototype.boxtype="sepiff",mp4lib.boxes.PiffSampleEncryptionBox.prototype.uuid=[162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244],mp4lib.boxes.PiffSampleEncryptionBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("sample_count",mp4lib.fields.FIELD_UINT32),1&this.flags&&a.eat("IV_size",mp4lib.fields.FIELD_UINT8);var b=new mp4lib.fields.StructureField(this,mp4lib.boxes.PiffSampleEncryptionBox.prototype._processEntry),c=new mp4lib.fields.VariableElementSizeArrayField(b,this.sample_count);a.eat("entry",c)},mp4lib.boxes.PiffSampleEncryptionBox.prototype._processEntry=function(a,b){if(b.eat("InitializationVector",new mp4lib.fields.DataField(8)),2&a.flags){b.eat("NumberOfEntries",mp4lib.fields.FIELD_UINT16);var c=new mp4lib.fields.StructureField(this,mp4lib.boxes.PiffSampleEncryptionBox.prototype._processClearEntry),d=new mp4lib.fields.ArrayField(c,this.NumberOfEntries);b.eat("clearAndCryptedData",d)}},mp4lib.boxes.PiffSampleEncryptionBox.prototype._processClearEntry=function(a,b){b.eat("BytesOfClearData",mp4lib.fields.FIELD_UINT16),b.eat("BytesOfEncryptedData",mp4lib.fields.FIELD_UINT32)},mp4lib.registerBoxType(mp4lib.boxes.PiffSampleEncryptionBox),mp4lib.boxes.PiffTrackEncryptionBox=function(){},mp4lib.boxes.PiffTrackEncryptionBox.prototype.boxtype="tepiff",mp4lib.boxes.PiffTrackEncryptionBox.prototype.uuid=[137,116,219,206,123,231,76,81,132,249,113,72,249,136,37,84],mp4lib.boxes.PiffTrackEncryptionBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a)},mp4lib.registerBoxType(mp4lib.boxes.PiffTrackEncryptionBox),mp4lib.boxes.PiffProtectionSystemSpecificHeaderBox=function(){},mp4lib.boxes.PiffProtectionSystemSpecificHeaderBox.prototype.boxtype="psshpiff",mp4lib.boxes.PiffProtectionSystemSpecificHeaderBox.prototype.uuid=[208,138,79,24,16,243,74,130,182,200,50,216,171,161,131,211],mp4lib.boxes.PiffProtectionSystemSpecificHeaderBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a)},mp4lib.registerBoxType(mp4lib.boxes.PiffProtectionSystemSpecificHeaderBox),mp4lib.boxes.TfxdBox=function(){},mp4lib.boxes.TfxdBox.prototype.boxtype="tfxd",mp4lib.boxes.TfxdBox.prototype.uuid=[109,29,155,5,66,213,68,230,128,226,20,29,175,247,87,178],mp4lib.boxes.TfxdBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),1==this.version?(a.eat("fragment_absolute_time",mp4lib.fields.FIELD_UINT64),a.eat("fragment_duration",mp4lib.fields.FIELD_UINT64)):(a.eat("fragment_absolute_time",mp4lib.fields.FIELD_UINT32),a.eat("fragment_duration",mp4lib.fields.FIELD_UINT32))},mp4lib.registerBoxType(mp4lib.boxes.TfxdBox),mp4lib.boxes.TfrfBox=function(){},mp4lib.boxes.TfrfBox.prototype.boxtype="tfrf",mp4lib.boxes.TfrfBox.prototype.uuid=[212,128,126,242,202,57,70,149,142,84,38,203,158,70,167,159],mp4lib.boxes.TfrfBox.prototype._processFields=function(a){mp4lib.boxes.FullBox.prototype._processFields.call(this,a),a.eat("fragment_count",mp4lib.fields.FIELD_UINT8);var b=new mp4lib.fields.StructureField(this,mp4lib.boxes.TfrfBox.prototype._processEntry),c=new mp4lib.fields.ArrayField(b,this.fragment_count);a.eat("entry",c)},mp4lib.boxes.TfrfBox.prototype._processEntry=function(a,b){1==a.version?(b.eat("fragment_absolute_time",mp4lib.fields.FIELD_UINT64),b.eat("fragment_duration",mp4lib.fields.FIELD_UINT64)):(b.eat("fragment_absolute_time",mp4lib.fields.FIELD_UINT32),b.eat("fragment_duration",mp4lib.fields.FIELD_UINT32))},mp4lib.registerBoxType(mp4lib.boxes.TfrfBox),"undefined"!=typeof require)var mp4lib=require("./mp4lib.js");if(mp4lib.fieldProcessors.SerializationBoxFieldsProcessor=function(a,b,c){this.box=a,this.buf=b,this.pos=c,this.isDeserializing=!1},mp4lib.fieldProcessors.SerializationBoxFieldsProcessor.prototype.eat=function(a,b){b.write(this.buf,this.pos,this.box[a]),this.pos+=b.getLength(this.box[a])},mp4lib.fieldProcessors.SerializationBoxFieldsProcessor.prototype.eat_flagged=function(a,b,c,d,e){0!==(a[b]&c)&&this.eat(d,e)},mp4lib.fieldProcessors.DeserializationBoxFieldsProcessor=function(a,b,c,d){this.box=a,this.buf=b,this.pos=c,this.bufferStart=c,this.bufferEnd=d,this.end=d,this.isDeserializing=!0},mp4lib.fieldProcessors.DeserializationBoxFieldsProcessor.prototype.eat=function(a,b){if(void 0===b)throw new mp4lib.ParseException("Undefined fieldtype for field "+a);var c=b.read(this.buf,this.pos,this.end);if(this.box[a]=c,"size"==a&&(this.end=this.bufferStart+c,this.end>this.bufferEnd))throw new mp4lib.ParseException("Deserialization error: Box size exceeds buffer ("+this.box.boxtype+")");this.pos+=b.getLength(c)},mp4lib.fieldProcessors.DeserializationBoxFieldsProcessor.prototype.eat_flagged=function(a,b,c,d,e){0!==(a[b]&c)&&this.eat(d,e)},mp4lib.fieldProcessors.LengthCounterBoxFieldsProcessor=function(a){this.box=a,this.res=0,this.isDeserializing=!1},mp4lib.fieldProcessors.LengthCounterBoxFieldsProcessor.prototype.eat=function(a,b){var c=b.getLength(this.box[a]);if(isNaN(c))throw new mp4lib.DataIntegrityException("ERROR counting size of "+a+" in "+this.box.boxtype+" = "+c);this.res+=c},mp4lib.fieldProcessors.LengthCounterBoxFieldsProcessor.prototype.eat_flagged=function(a,b,c,d,e){d in this.box&&this.eat(d,e)},"undefined"!=typeof require)var mp4lib=require("./mp4lib.js"),goog={math:{Long:require("long")}};mp4lib.fields.readBytes=function(a,b,c){for(var d=0,e=0;c>e;e++)d<<=8,d+=a[b],b++;return d},mp4lib.fields.writeBytes=function(a,b,c,d){for(var e=0;c>e;e++)a[b+c-e-1]=255&d,d>>=8},mp4lib.fields.NumberField=function(a,b){this.bits=a,this.signed=b},mp4lib.fields.NumberField.prototype.read=function(a,b){return mp4lib.fields.readBytes(a,b,this.bits/8)},mp4lib.fields.NumberField.prototype.write=function(a,b,c){mp4lib.fields.writeBytes(a,b,this.bits/8,c)},mp4lib.fields.NumberField.prototype.getLength=function(){return this.bits/8},mp4lib.fields.LongNumberField=function(){},mp4lib.fields.LongNumberField.prototype.read=function(a,b){var c=mp4lib.fields.readBytes(a,b,4),d=mp4lib.fields.readBytes(a,b+4,4);return goog.math.Long.fromBits(d,c).toNumber()},mp4lib.fields.LongNumberField.prototype.write=function(a,b,c){var d=goog.math.Long.fromNumber(c),e=d.getLowBits(),f=d.getHighBits();mp4lib.fields.writeBytes(a,b,4,f),mp4lib.fields.writeBytes(a,b+4,4,e)},mp4lib.fields.LongNumberField.prototype.getLength=function(){return 8},mp4lib.fields.FixedLenStringField=function(a){this.size=a},mp4lib.fields.FixedLenStringField.prototype.read=function(a,b){for(var c="",d=0;d<this.size;d++)c+=String.fromCharCode(a[b+d]);return c},mp4lib.fields.FixedLenStringField.prototype.write=function(a,b,c){for(var d=0;d<this.size;d++)a[b+d]=c.charCodeAt(d)},mp4lib.fields.FixedLenStringField.prototype.getLength=function(){return this.size},mp4lib.fields.BoxTypeField=function(){},mp4lib.fields.BoxTypeField.prototype.read=function(a,b){for(var c="",d=0;4>d;d++)c+=String.fromCharCode(a[b+d]);return c},mp4lib.fields.BoxTypeField.prototype.write=function(a,b,c){mp4lib.findUUIDByBoxtype(c)&&(c="uuid");for(var d=0;4>d;d++)a[b+d]=c.charCodeAt(d)},mp4lib.fields.BoxTypeField.prototype.getLength=function(){return 4},mp4lib.fields.StringField=function(){},mp4lib.fields.StringField.prototype.read=function(a,b,c){for(var d="",e=b;c>e;e++)if(d+=String.fromCharCode(a[e]),0===a[e])return d;if(255>c-b&&a[0]==String.fromCharCode(c-b))return d=d.substr(1,c-b),mp4lib.warningHandler('null-terminated string expected, but found a string "'+d+'", which seems to be length-prefixed instead. Conversion done.'),d;throw new mp4lib.ParseException('expected null-terminated string, but end of field reached without termination. Read so far:"'+d+'"')},mp4lib.fields.StringField.prototype.write=function(a,b,c){for(var d=0;d<c.length;d++)a[b+d]=c.charCodeAt(d);a[b+c.length]=0},mp4lib.fields.StringField.prototype.getLength=function(a){return a.length},mp4lib.fields.BoxFillingDataField=function(){},mp4lib.fields.BoxFillingDataField.prototype.read=function(a,b,c){var d=a.subarray(b,c);return d},mp4lib.fields.BoxFillingDataField.prototype.write=function(a,b,c){a.set(c,b)},mp4lib.fields.BoxFillingDataField.prototype.getLength=function(a){return a.length},mp4lib.fields.DataField=function(a){this.len=a},mp4lib.fields.DataField.prototype.read=function(a,b){var c=a.subarray(b,b+this.len);return c},mp4lib.fields.DataField.prototype.write=function(a,b,c){a.set(c,b)},mp4lib.fields.DataField.prototype.getLength=function(){return this.len},mp4lib.fields.ArrayField=function(a,b){this.innerField=a,this.size=b},mp4lib.fields.ArrayField.prototype.read=function(a,b){for(var c=-1,d=[],e=0;e<this.size;e++)d.push(this.innerField.read(a,b)),-1==c&&(c=this.innerField.getLength(d[e])),b+=c;return d},mp4lib.fields.ArrayField.prototype.write=function(a,b,c){var d=0;this.size>0&&(d=this.innerField.getLength(c[0]));for(var e=0;e<this.size;e++)this.innerField.write(a,b,c[e]),b+=d},mp4lib.fields.ArrayField.prototype.getLength=function(a){var b=0;return this.size>0&&(b=this.innerField.getLength(a[0])),this.size*b},mp4lib.fields.VariableElementSizeArrayField=function(a,b){this.innerField=a,this.size=b},mp4lib.fields.VariableElementSizeArrayField.prototype.read=function(a,b){for(var c=[],d=0;d<this.size;d++)c.push(this.innerField.read(a,b)),b+=this.innerField.getLength(c[d]);return c},mp4lib.fields.VariableElementSizeArrayField.prototype.write=function(a,b,c){for(var d=0;d<this.size;d++)this.innerField.write(a,b,c[d]),b+=this.innerField.getLength(c[d])},mp4lib.fields.VariableElementSizeArrayField.prototype.getLength=function(a){for(var b=0,c=0;c<this.size;c++)b+=this.innerField.getLength(a[c]);return b},mp4lib.fields.BoxFillingArrayField=function(a){this.innerField=a,this.innerFieldLength=a.getLength()},mp4lib.fields.BoxFillingArrayField.prototype.read=function(a,b,c){for(var d=[],e=(c-b)/this.innerFieldLength,f=0;e>f;f++)d.push(this.innerField.read(a,b)),b+=this.innerFieldLength;return d},mp4lib.fields.BoxFillingArrayField.prototype.write=function(a,b,c){for(var d=0;d<c.length;d++)this.innerField.write(a,b,c[d]),b+=this.innerFieldLength},mp4lib.fields.BoxFillingArrayField.prototype.getLength=function(a){return a.length*this.innerFieldLength},mp4lib.fields.StructureField=function(a,b){this.box=a,this._processStructureFields=b},mp4lib.fields.StructureField.prototype.read=function(a,b,c){var d={},e=new mp4lib.fieldProcessors.DeserializationBoxFieldsProcessor(d,a,b,c);return this._processStructureFields.call(d,this.box,e),d},mp4lib.fields.StructureField.prototype.write=function(a,b,c){var d=new mp4lib.fieldProcessors.SerializationBoxFieldsProcessor(c,a,b);this._processStructureFields.call(c,this.box,d)},mp4lib.fields.StructureField.prototype.getLength=function(a){var b=new mp4lib.fieldProcessors.LengthCounterBoxFieldsProcessor(a);if(this._processStructureFields.call(a,this.box,b),isNaN(b.res)&&void 0===a)throw new mp4lib.DataIntegrityException("The structure contained in "+this.box.boxtype+" box has undefined size. Possible cause: you have put a variable sized structure into ArrayField (but ArrayField assumes all elements have the same size). If this is the case, use VariableElementsSizeArrayField instead.");return b.res},mp4lib.fields.BoxesListField=function(){},mp4lib.fields.readString=function(a,b,c){for(var d="",e=b;b+c>e;e++)d+=String.fromCharCode(a[e]);return d},mp4lib.fields.BoxesListField.prototype.read=function(a,b,c){for(var d=[];c>b;){var e=mp4lib.fields.FIELD_UINT32.read(a,b),f=mp4lib.fields.readString(a,b+4,4);if("uuid"==f){var g=1==e?16:8,h=new mp4lib.fields.ArrayField(mp4lib.fields.FIELD_INT8,16).read(a,b+g,b+g+16);f=mp4lib.findBoxtypeByUUID(JSON.stringify(h)),void 0===f&&(f="uuid",mp4lib.warningHandler("Unknown UUID:"+JSON.stringify(h)))}var i=mp4lib.createBox(f),j=new mp4lib.fieldProcessors.DeserializationBoxFieldsProcessor(i,a,b,c);if(i._processFields(j),mp4lib.debug&&(i.__sourceBuffer=a.subarray(b,b+i.size)),i.boxtype=f,d.push(i),b+=i.size,0===i.size)throw new mp4lib.ParseException("Zero size of box "+i.boxtype+", parsing stopped to avoid infinite loop")}return d},mp4lib.fields.BoxesListField.prototype.write=function(a,b,c){for(var d=0;d<c.length;d++){var e=c[d],f=new mp4lib.fieldProcessors.SerializationBoxFieldsProcessor(e,a,b);e._processFields(f),b+=e.size}},mp4lib.fields.BoxesListField.prototype.getLength=function(a){var b,c=0;for(b=0;b<a.length;b++){var d=a[b],e=new mp4lib.fieldProcessors.LengthCounterBoxFieldsProcessor(d);d._processFields(e),d.size=e.res,c+=e.res}return c},mp4lib.fields.FIELD_INT8=new mp4lib.fields.NumberField(8,!0),mp4lib.fields.FIELD_INT16=new mp4lib.fields.NumberField(16,!0),mp4lib.fields.FIELD_INT32=new mp4lib.fields.NumberField(32,!0),mp4lib.fields.FIELD_INT64=new mp4lib.fields.LongNumberField,mp4lib.fields.FIELD_UINT8=new mp4lib.fields.NumberField(8,!1),mp4lib.fields.FIELD_UINT16=new mp4lib.fields.NumberField(16,!1),mp4lib.fields.FIELD_UINT32=new mp4lib.fields.NumberField(32,!1),mp4lib.fields.FIELD_UINT64=new mp4lib.fields.LongNumberField,mp4lib.fields.FIELD_BIT8=new mp4lib.fields.NumberField(8,!1),mp4lib.fields.FIELD_BIT16=new mp4lib.fields.NumberField(16,!1),mp4lib.fields.FIELD_BIT24=new mp4lib.fields.NumberField(24,!1),mp4lib.fields.FIELD_BIT32=new mp4lib.fields.NumberField(32,!1),mp4lib.fields.FIELD_ID=new mp4lib.fields.BoxTypeField(4),mp4lib.fields.FIELD_CONTAINER_CHILDREN=new mp4lib.fields.BoxesListField,mp4lib.fields.FIELD_STRING=new mp4lib.fields.StringField,mp4lib.fields.FIELD_BOX_FILLING_DATA=new mp4lib.fields.BoxFillingDataField,MediaPlayer=function(a){"use strict";var b,c,d,e,f,g,h="1.1.0",i=a,j=!1,k=!1,l=!0,m=!1,n=MediaPlayer.dependencies.BufferExtensions.BUFFER_SIZE_REQUIRED,o=function(){return!!c&&!!d},p=function(){if(!j)throw"MediaPlayer not initialized!";if(!this.capabilities.supportsMediaSource())return void this.errHandler.capabilityError("mediasource");if(!c||!d)throw"Missing view or source.";k=!0,f=b.getObject("streamController"),f.setVideoModel(g),f.setAutoPlay(l),f.load(d,e),b.mapValue("scheduleWhilePaused",m),b.mapOutlet("scheduleWhilePaused","stream"),b.mapValue("bufferMax",n),b.injectInto(this.bufferExt,"bufferMax")},q=function(){o()&&p.call(this)};return b=new dijon.System,b.mapValue("system",b),b.mapOutlet("system"),b.injectInto(i),{debug:void 0,eventBus:void 0,capabilities:void 0,abrController:void 0,metricsModel:void 0,metricsExt:void 0,bufferExt:void 0,addEventListener:function(a,b,c){this.eventBus.addEventListener(a,b,c)},removeEventListener:function(a,b,c){this.eventBus.removeEventListener(a,b,c)},getVersion:function(){return h},startup:function(){j||(b.injectInto(this),j=!0)},getDebug:function(){return this.debug},getVideoModel:function(){return g},setAutoPlay:function(a){l=a},getAutoPlay:function(){return l},setScheduleWhilePaused:function(a){m=a},getScheduleWhilePaused:function(){return m},setBufferMax:function(a){n=a},getBufferMax:function(){return n},getMetricsExt:function(){return this.metricsExt},getMetricsFor:function(a){var b=this.metricsModel.getReadOnlyMetricsFor(a);return b},getQualityFor:function(a){return this.abrController.getQualityFor(a)},setQualityFor:function(a,b){this.abrController.setPlaybackQuality(a,b)},getAutoSwitchQuality:function(){return this.abrController.getAutoSwitchBitrate()},setAutoSwitchQuality:function(a){this.abrController.setAutoSwitchBitrate(a)},setQualityBoundariesFor:function(a,b,c){this.metricsModel.addRepresentationBoundaries(a,new Date,b,c)},setAudioTrack:function(a){f.setAudioTrack(a)},getAudioTracks:function(){return f.getAudioTracks()},attachView:function(a){if(!j)throw"MediaPlayer not initialized!";c=a,g=null,c&&(g=b.getObject("videoModel"),g.setElement(c)),k&&f&&(f.reset(),f=null,k=!1),o.call(this)&&q.call(this)},attachSource:function(a,b){if(!j)throw"MediaPlayer not initialized!";d=a,e=b,this.setQualityFor("video",0),this.setQualityFor("audio",0),k&&f&&(f.reset(),f=null,k=!1),o.call(this)&&q.call(this)},reset:function(){this.attachSource(null),this.attachView(null)},play:p,isReady:o}},MediaPlayer.prototype={constructor:MediaPlayer},MediaPlayer.dependencies={},MediaPlayer.utils={},MediaPlayer.models={},MediaPlayer.vo={},MediaPlayer.vo.metrics={},MediaPlayer.rules={},MediaPlayer.di={},MediaPlayer.di.Context=function(){"use strict";return{system:void 0,setup:function(){this.system.autoMapOutlets=!0,this.system.mapSingleton("debug",MediaPlayer.utils.Debug),this.system.mapSingleton("eventBus",MediaPlayer.utils.EventBus),this.system.mapSingleton("capabilities",MediaPlayer.utils.Capabilities),this.system.mapSingleton("textTrackExtensions",MediaPlayer.utils.TextTrackExtensions),this.system.mapSingleton("vttParser",MediaPlayer.utils.VTTParser),this.system.mapClass("videoModel",MediaPlayer.models.VideoModel),this.system.mapSingleton("manifestModel",MediaPlayer.models.ManifestModel),this.system.mapSingleton("metricsModel",MediaPlayer.models.MetricsModel),this.system.mapClass("protectionModel",MediaPlayer.models.ProtectionModel),this.system.mapSingleton("textVTTSourceBuffer",MediaPlayer.dependencies.TextVTTSourceBuffer),this.system.mapSingleton("mediaSourceExt",MediaPlayer.dependencies.MediaSourceExtensions),this.system.mapSingleton("sourceBufferExt",MediaPlayer.dependencies.SourceBufferExtensions),this.system.mapSingleton("bufferExt",MediaPlayer.dependencies.BufferExtensions),this.system.mapSingleton("abrController",MediaPlayer.dependencies.AbrController),this.system.mapSingleton("errHandler",MediaPlayer.dependencies.ErrorHandler),this.system.mapSingleton("protectionExt",MediaPlayer.dependencies.ProtectionExtensions),this.system.mapClass("protectionController",MediaPlayer.dependencies.ProtectionController),this.system.mapClass("metrics",MediaPlayer.models.MetricsList),this.system.mapClass("downloadRatioRule",MediaPlayer.rules.DownloadRatioRule),this.system.mapClass("insufficientBufferRule",MediaPlayer.rules.InsufficientBufferRule),this.system.mapClass("limitSwitchesRule",MediaPlayer.rules.LimitSwitchesRule),this.system.mapClass("abrRulesCollection",MediaPlayer.rules.BaseRulesCollection),this.system.mapClass("textController",MediaPlayer.dependencies.TextController),this.system.mapClass("bufferController",MediaPlayer.dependencies.BufferController),this.system.mapClass("manifestLoader",MediaPlayer.dependencies.ManifestLoader),this.system.mapClass("manifestUpdater",MediaPlayer.dependencies.ManifestUpdater),this.system.mapClass("fragmentController",MediaPlayer.dependencies.FragmentController),this.system.mapClass("fragmentLoader",MediaPlayer.dependencies.FragmentLoader),this.system.mapClass("fragmentModel",MediaPlayer.dependencies.FragmentModel),this.system.mapSingleton("streamController",MediaPlayer.dependencies.StreamController),this.system.mapClass("stream",MediaPlayer.dependencies.Stream),this.system.mapClass("requestScheduler",MediaPlayer.dependencies.RequestScheduler),this.system.mapSingleton("schedulerExt",MediaPlayer.dependencies.SchedulerExtensions),this.system.mapClass("schedulerModel",MediaPlayer.dependencies.SchedulerModel)}}},Dash=function(){"use strict";return{modules:{},dependencies:{},vo:{},di:{}}}(),Dash.di.DashContext=function(){"use strict";return{system:void 0,setup:function(){Dash.di.DashContext.prototype.setup.call(this),this.system.mapClass("parser",Dash.dependencies.DashParser),this.system.mapClass("indexHandler",Dash.dependencies.DashHandler),this.system.mapClass("baseURLExt",Dash.dependencies.BaseURLExtensions),this.system.mapClass("fragmentExt",Dash.dependencies.FragmentExtensions),this.system.mapSingleton("manifestExt",Dash.dependencies.DashManifestExtensions),this.system.mapSingleton("metricsExt",Dash.dependencies.DashMetricsExtensions),this.system.mapSingleton("timelineConverter",Dash.dependencies.TimelineConverter)}}},Dash.di.DashContext.prototype=new MediaPlayer.di.Context,Dash.di.DashContext.prototype.constructor=Dash.di.DashContext,Mss=function(){"use strict";return{dependencies:{}}}(),Custom=function(){"use strict";return{dependencies:{},di:{},models:{},modules:{},utils:{},rules:{},vo:{metrics:{}}}}(),Custom.di.CustomContext=function(){"use strict";return{system:void 0,setup:function(){Custom.di.CustomContext.prototype.setup.call(this),this.system.mapClass("parser",Custom.dependencies.CustomParser),this.system.mapClass("dashParser",Dash.dependencies.DashParser),this.system.mapClass("mssParser",Mss.dependencies.MssParser),this.system.mapSingleton("contextManager",Custom.modules.ContextManager),this.system.mapClass("fragmentLoader",Custom.dependencies.CustomFragmentLoader),this.system.mapSingleton("metricsModel",Custom.models.CustomMetricsModel),this.system.mapSingleton("metricsExt",Custom.dependencies.CustomMetricsExtensions),this.system.mapSingleton("abrController",Custom.dependencies.CustomAbrController),this.system.mapClass("bufferController",Custom.dependencies.CustomBufferController),this.system.mapHandler("setContext","contextManager","setContext")}}},Custom.di.CustomContext.prototype=new Dash.di.DashContext,Custom.di.CustomContext.prototype.constructor=Custom.di.CustomContext,Custom.dependencies.CustomAbrController=function(){"use strict";var a=Custom.utils.copyMethods(MediaPlayer.dependencies.AbrController);return a.metricsExt=void 0,a.debug=void 0,a.getPlaybackQuality=function(a,b){var c=this,d=Q.defer();return c.parent.getMetricsFor.call(c,b).then(function(e){c.parent.getPlaybackQuality.call(c,a,b).then(function(b){var f=c.metricsExt.getCurrentRepresentationBoundaries(e),g=b.quality;null!==f&&(g<f.min&&(g=f.min,c.parent.setPlaybackQuality.call(c,a,g)),g>f.max&&(g=f.max,c.parent.setPlaybackQuality.call(c,a,g))),d.resolve({quality:g,confidence:b.confidence})})}),d.promise},a},Custom.dependencies.CustomAbrController.prototype={constructor:Custom.dependencies.CustomAbrController},Custom.dependencies.CustomBufferController=function(){"use strict";var a=Custom.utils.copyMethods(MediaPlayer.dependencies.BufferController);a.fragmentController=void 0,a.sourceBufferExt=void 0;var b;return a.initialize=function(a,c,d,e,f,g,h,i){b=i,this.parent.initialize.apply(this,arguments)},a.emptyBuffer=function(c){var d,e=Q.defer(),f=0,g=a.parent,h=g.getBuffer(),i=a.fragmentController.attachBufferController(a);if(h.buffered.length>0){var j=h.buffered.end(h.buffered.length-1);d=j}else d=c+5;return a.sourceBufferExt.remove(h,f,c-1,g.getPeriodInfo().duration,b).then(function(){a.sourceBufferExt.remove(h,c+3,d,g.getPeriodInfo().duration,b).then(function(){a.fragmentController.removeExecutedRequestsBeforeTime(i,d),e.resolve(),a.sourceBufferExt.getAllRanges(h).then(function(a){if(a&&a.length>0){var b,c;for(b=0,c=a.length;c>b;b+=1);}})})}),e.promise},a},Custom.dependencies.CustomBufferController.prototype={constructor:Custom.dependencies.CustomBufferController},Custom.dependencies.CustomFragmentLoader=function(){"use strict";var a=Custom.utils.copyMethods(MediaPlayer.dependencies.FragmentLoader);return a.load=function(a){var b=Q.defer();return"Initialization Segment"==a.type&&a.data?b.resolve(a,{data:a.data}):b.promise=this.parent.load.call(this,a),b.promise},a},Custom.dependencies.CustomFragmentLoader.prototype={constructor:Custom.dependencies.CustomFragmentLoader},Custom.dependencies.CustomMetricsExtensions=function(){"use strict";var a={42:"Baseline","4D":"Main",58:"Extended",64:"High"},b=function(a,b){var c,d,e,f,g,h,i,j;for(h=0;h<a.length;h+=1)for(c=a[h],e=c.AdaptationSet_asArray,i=0;i<e.length;i+=1)for(d=e[i],g=d.Representation_asArray,j=0;j<g.length;j+=1)if(f=g[j],b===f.id)return f;return null},c=function(a,b){var c=!1;return"video"===b?(this.manifestExt.getIsVideo(a),"video"===a.type&&(c=!0)):"audio"===b?(this.manifestExt.getIsAudio(a),"audio"===a.type&&(c=!0)):c=!1,c},d=Custom.utils.copyMethods(Dash.dependencies.DashMetricsExtensions);return d.getVideoWidthForRepresentation=function(a){var c,d=this,e=d.manifestModel.getValue(),f=e.Period_asArray;return c=b.call(d,f,a),null===c?null:c.width},d.getVideoHeightForRepresentation=function(a){var c,d=this,e=d.manifestModel.getValue(),f=e.Period_asArray;return c=b.call(d,f,a),null===c?null:c.height},d.getCodecsForRepresentation=function(a){var c,d=this,e=d.manifestModel.getValue(),f=e.Period_asArray;return c=b.call(d,f,a),null===c?null:c.codecs},d.getH264ProfileLevel=function(b){if(b.indexOf("avc1")<0)return"";var c=a[b.substr(5,2)],d=parseInt(b.substr(9,2),16)/10;return c+"@"+d.toString()},d.getBitratesForType=function(a){var b,d,e,f,g,h,i,j,k=this,l=k.manifestModel.getValue(),m=l.Period_asArray,n=new Array;for(d=0;d<m.length;d+=1)for(b=m[d],f=b.AdaptationSet_asArray,i=0;i<f.length;i+=1)if(e=f[i],c.call(k,e,a)){for(h=e.Representation_asArray,j=0;j<h.length;j+=1)g=h[j],n.push(g.bandwidth);return n}return n},d.getCurrentRepresentationBoundaries=function(a){if(null===a)return null;var b=a.RepBoundariesList;return null===b||b.length<=0?null:b[b.length-1]},d.getCurrentDownloadSwitch=function(a){if(null===a)return null;var b=a.DwnldSwitchList;return null===b||b.length<=0?null:b[b.length-1]},d.getCurrentBandwidth=function(a){return null===a?null:a.BandwidthValue},d},Custom.dependencies.CustomMetricsExtensions.prototype={constructor:Custom.dependencies.CustomMetricsExtensions},Custom.dependencies.CustomParser=function(){"use strict";var a=function(a,b){var c=null;if(a.indexOf("SmoothStreamingMedia")>-1)this.system.notify("setContext","MSS"),c=this.mssParser;else{if(!(a.indexOf("MPD")>-1))return Q.when(null);this.system.notify("setContext","MPD"),c=this.dashParser}return c.parse(a,b)};return{debug:void 0,system:void 0,dashParser:void 0,mssParser:void 0,metricsModel:void 0,parse:a}},Custom.dependencies.CustomParser.prototype={constructor:Custom.dependencies.CustomParser},Custom.models.CustomMetricsModel=function(){"use strict";var a=Custom.utils.copyMethods(MediaPlayer.models.MetricsModel);return a.addRepresentationBoundaries=function(a,b,c,d){var e=new MediaPlayer.vo.metrics.RepresentationBoundaries;return e.t=b,e.min=c,e.max=d,this.parent.getMetricsFor(a).RepBoundariesList.push(e),e},a.addDownloadSwitch=function(a,b,c,d){var e=new Custom.vo.metrics.DownloadSwitch;return e.type=a,e.mediaStartTime=b,e.downloadStartTime=c,e.quality=d,this.parent.getMetricsFor(a).DwnldSwitchList=[e],e},a.setBandwidthValue=function(a,b){var c=new Custom.vo.metrics.BandwidthValue;return c.value=b,this.parent.getMetricsFor(a).BandwidthValue=c,c},a},Custom.models.CustomMetricsModel.prototype={constructor:Custom.models.CustomMetricsModel},Custom.modules.ContextManager=function(){"use strict";return{system:void 0,debug:void 0,setContext:function(a){"MSS"===a?(this.system.mapClass("mp4Processor",MediaPlayer.dependencies.Mp4Processor),this.system.mapClass("indexHandler",Mss.dependencies.MssHandler),this.system.mapClass("fragmentController",Mss.dependencies.MssFragmentController)):(this.system.mapClass("fragmentController",MediaPlayer.dependencies.FragmentController),this.system.mapClass("indexHandler",Dash.dependencies.DashHandler))}}},Custom.modules.ContextManager.prototype={constructor:Custom.modules.ContextManager},Custom.rules.CustomDownloadRatioRule=function(){"use strict";var a=function(a,b,c){var d=this,e=Q.defer();return d.manifestExt.getRepresentationFor(a,c).then(function(a){d.manifestExt.getBandwidth(a).then(function(a){e.resolve(a/b)})}),e.promise};return{debug:void 0,manifestExt:void 0,metricsExt:void 0,checkIndex:function(b,c,d){var e,f,g,h,i,j,k,l,m,n,o=this,p=c.HttpList,q=this.metricsExt.getMinBitrateIdx(),r=this.metricsExt.getMaxBitrateIdx(),s=.75;return c?null===p||void 0===p||0===p.length?Q.when(new MediaPlayer.rules.SwitchRequest):(e=p[p.length-1],g=(e.tfinish.getTime()-e.trequest.getTime())/1e3,f=(e.tfinish.getTime()-e.tresponse.getTime())/1e3,0>=g?Q.when(new MediaPlayer.rules.SwitchRequest):null===e.mediaduration||void 0===e.mediaduration||e.mediaduration<=0?Q.when(new MediaPlayer.rules.SwitchRequest):(q=q?q:0,k=Q.defer(),i=e.mediaduration/g,h=e.mediaduration/f*s,isNaN(h)||isNaN(i)?Q.when(new MediaPlayer.rules.SwitchRequest):(o.manifestExt.getRepresentationCount(d).then(function(c){c-=1,q=q?q:0,r=r&&c>r?r:c,isNaN(h)?k.resolve(new MediaPlayer.rules.SwitchRequest):1>h||b>r?b>q?o.manifestExt.getRepresentationFor(b-1,d).then(function(a){o.manifestExt.getBandwidth(a).then(function(a){o.manifestExt.getRepresentationFor(b,d).then(function(c){o.manifestExt.getBandwidth(c).then(function(c){j=a/c,k.resolve(j>h?new MediaPlayer.rules.SwitchRequest(0):new MediaPlayer.rules.SwitchRequest(b-1))})})})}):k.resolve(new MediaPlayer.rules.SwitchRequest(b)):r>b?o.manifestExt.getRepresentationFor(b+1,d).then(function(e){o.manifestExt.getBandwidth(e).then(function(e){o.manifestExt.getRepresentationFor(b,d).then(function(f){o.manifestExt.getBandwidth(f).then(function(f){if(j=e/f,h>=j)if(h>1e3)k.resolve(new MediaPlayer.rules.SwitchRequest(c-1));else if(h>100)k.resolve(new MediaPlayer.rules.SwitchRequest(b+1));else{for(m=-1,l=[];(m+=1)<c;)l.push(a.call(o,m,f,d));Q.all(l).then(function(a){for(m=0,n=a.length;n>m&&!(h<a[m]);m+=1);k.resolve(new MediaPlayer.rules.SwitchRequest(m))})}else k.resolve(new MediaPlayer.rules.SwitchRequest)})})})}):k.resolve(new MediaPlayer.rules.SwitchRequest(c))}),k.promise))):Q.when(new MediaPlayer.rules.SwitchRequest)}}},Custom.rules.CustomDownloadRatioRule.prototype={constructor:Custom.rules.CustomDownloadRatioRule},Custom.utils.copyMethods=function(a){var b=new a;b.parent={};for(var c in b)b.parent[c]=b[c];return b.setup=function(){for(var a in this.parent)void 0===this.parent[a]&&(this.parent[a]=this[a])},b},Custom.utils.ObjectIron=function(a){var b;b=[];for(var c=0,d=a.length;d>c;c+=1)b.push(a[c].isRoot?"root":a[c].name);var e=function(a,b){var c;if(null!==a&&null!==b)for(c in a)a.hasOwnProperty(c)&&(b.hasOwnProperty(c)||(b[c]=a[c]))},f=function(a,b,c){var d,f,g,h,i;if(null!==a&&0!==a.length)for(d=0,f=a.length;f>d;d+=1)g=a[d],b.hasOwnProperty(g.name)&&(c.hasOwnProperty(g.name)?g.merge&&(h=b[g.name],i=c[g.name],"object"==typeof h&&"object"==typeof i?e(h,i):c[g.name]=null!=g.mergeFunction?g.mergeFunction(h,i):h+i):c[g.name]=b[g.name])},g=function(a,b){var c,d,e,h,i,j,k,l=a;if(a.transformFunc&&(b=a.transformFunc(b)),null===l.children||0===l.children.length)return b;for(c=0,d=l.children.length;d>c;c+=1){j=l.children[c];var m=null;if(b.hasOwnProperty(j.name))if(j.isArray)for(i=b[j.name+"_asArray"],e=0,h=i.length;h>e;e+=1)k=i[e],f(l.properties,b,k),m=g(j,k),b[j.name+"_asArray"][e]=m,b[j.name][e]=m;else k=b[j.name],f(l.properties,b,k),m=g(j,k),b[j.name]=m,b[j.name+"_asArray"]=[m]}return b},h=function(c){var d,e,f,i,j,k,l;if(null===c)return c;if("object"!=typeof c)return c;for(d=0,e=b.length;e>d;d+=1)"root"===b[d]&&(j=a[d],k=c,c=g(j,k));for(i in c)if(c.hasOwnProperty(i)){if(f=b.indexOf(i),-1!==f)if(j=a[f],j.isArray)for(l=c[i+"_asArray"],d=0,e=l.length;e>d;d+=1)k=l[d],c[i][d]=g(j,k),c[i+"_asArray"][d]=g(j,k);else k=c[i],c[i]=g(j,k),c[i+"_asArray"]=[g(j,k)];c[i]=h(c[i])}return c};return{run:h}},Custom.vo.metrics.BandwidthValue=function(){"use strict";this.value=null},Custom.vo.metrics.BandwidthValue.prototype={constructor:Custom.vo.metrics.BandwidthValue},Custom.vo.metrics.DownloadSwitch=function(){"use strict";this.type=null,this.mediaStartTime=null,this.downloadStartTime=null,this.quality=null},Custom.vo.metrics.DownloadSwitch.prototype={constructor:Custom.vo.metrics.DownloadSwitch},Dash.dependencies.BaseURLExtensions=function(){"use strict";var a=function(a,b){for(var c,d,e,f,g,h,i,j,k,l,m=new DataView(a),n={},o=0;"sidx"!==j&&o<m.byteLength;){for(k=m.getUint32(o),o+=4,j="",f=0;4>f;f+=1)l=m.getInt8(o),j+=String.fromCharCode(l),o+=1;"moof"!==j&&"traf"!==j&&"sidx"!==j?o+=k-8:"sidx"===j&&(o-=8)}if(e=m.getUint32(o,!1)+o,e>a.byteLength)throw"sidx terminates after array buffer";
for(n.version=m.getUint8(o+8),o+=12,n.timescale=m.getUint32(o+4,!1),o+=8,0===n.version?(n.earliest_presentation_time=m.getUint32(o,!1),n.first_offset=m.getUint32(o+4,!1),o+=8):(n.earliest_presentation_time=utils.Math.to64BitNumber(m.getUint32(o+4,!1),m.getUint32(o,!1)),n.first_offset=(m.getUint32(o+8,!1)<<32)+m.getUint32(o+12,!1),o+=16),n.first_offset+=e+(b||0),n.reference_count=m.getUint16(o+2,!1),o+=4,n.references=[],c=n.first_offset,d=n.earliest_presentation_time,f=0;f<n.reference_count;f+=1)h=m.getUint32(o,!1),g=h>>>31,h=2147483647&h,i=m.getUint32(o+4,!1),o+=12,n.references.push({size:h,type:g,offset:c,duration:i,time:d,timescale:n.timescale}),c+=h,d+=i;if(o!==e)throw"Error: final pos "+o+" differs from SIDX end "+e;return n},b=function(b,c,d){var e,f,g,h,i,j,k,l;for(e=a.call(this,b,d),f=e.references,g=[],i=0,j=f.length;j>i;i+=1)h=new Dash.vo.Segment,h.duration=f[i].duration,h.media=c,h.startTime=f[i].time,h.timescale=f[i].timescale,k=f[i].offset,l=f[i].offset+f[i].size-1,h.mediaRange=k+"-"+l,g.push(h);return Q.when(g)},c=function(a,b){for(var d,e,f,g,h,i,j,k=Q.defer(),l=new DataView(a),m=0,n="",o=0,p=!1,q=this;"moov"!==n&&m<l.byteLength;){for(o=l.getUint32(m),m+=4,n="",g=0;4>g;g+=1)h=l.getInt8(m),n+=String.fromCharCode(h),m+=1;"moov"!==n&&(m+=o-8)}return f=l.byteLength-m,"moov"!==n?(b.range.start=0,b.range.end=b.bytesLoaded+b.bytesToLoad,i=new XMLHttpRequest,i.onloadend=function(){p||k.reject("Error loading initialization.")},i.onload=function(){p=!0,b.bytesLoaded=b.range.end,c.call(q,i.response).then(function(a){k.resolve(a)})},i.onerror=function(){k.reject("Error loading initialization.")},i.open("GET",b.url),i.responseType="arraybuffer",i.setRequestHeader("Range","bytes="+b.range.start+"-"+b.range.end),i.send(null)):(d=m-8,e=d+o-1,j=d+"-"+e,k.resolve(j)),k.promise},d=function(a){var b=Q.defer(),d=new XMLHttpRequest,e=!0,f=this,g={url:a,range:{},searching:!1,bytesLoaded:0,bytesToLoad:1500,request:d};return g.range.start=0,g.range.end=g.bytesToLoad,d.onload=function(){d.status<200||d.status>299||(e=!1,g.bytesLoaded=g.range.end,c.call(f,d.response,g).then(function(a){b.resolve(a)}))},d.onloadend=d.onerror=function(){e&&(e=!1,f.errHandler.downloadError("initialization",g.url,d),b.reject(d))},d.open("GET",g.url),d.responseType="arraybuffer",d.setRequestHeader("Range","bytes="+g.range.start+"-"+g.range.end),d.send(null),b.promise},e=function(a,c){for(var d,f,g,h,i,j,k,l,m=Q.defer(),n=new DataView(a),o=new XMLHttpRequest,p=0,q="",r=0,s=!0,t=!1,u=this;"sidx"!==q&&p<n.byteLength;){for(r=n.getUint32(p),p+=4,q="",i=0;4>i;i+=1)j=n.getInt8(p),q+=String.fromCharCode(j),p+=1;"sidx"!==q&&(p+=r-8)}if(d=n.byteLength-p,"sidx"!==q)m.reject();else if(r-8>d)c.range.start=0,c.range.end=c.bytesLoaded+(r-d),o.onload=function(){o.status<200||o.status>299||(s=!1,c.bytesLoaded=c.range.end,e.call(u,o.response,c).then(function(a){m.resolve(a)}))},o.onloadend=o.onerror=function(){s&&(s=!1,u.errHandler.downloadError("SIDX",c.url,o),m.reject(o))},o.open("GET",c.url),o.responseType="arraybuffer",o.setRequestHeader("Range","bytes="+c.range.start+"-"+c.range.end),o.send(null);else if(c.range.start=p-8,c.range.end=c.range.start+r,f=new ArrayBuffer(c.range.end-c.range.start),h=new Uint8Array(f),g=new Uint8Array(a,c.range.start,c.range.end-c.range.start),h.set(g),k=this.parseSIDX.call(this,f,c.range.start),l=k.references,null!==l&&void 0!==l&&l.length>0&&(t=1===l[0].type),t){var v,w,x,y,z,A,B=[];for(v=0,w=l.length;w>v;v+=1)x=l[v].offset,y=l[v].offset+l[v].size-1,z=x+"-"+y,B.push(this.loadSegments.call(u,c.url,z));Q.all(B).then(function(a){for(A=[],v=0,w=a.length;w>v;v+=1)A=A.concat(a[v]);m.resolve(A)},function(a){m.reject(a)})}else b.call(u,f,c.url,c.range.start).then(function(a){m.resolve(a)});return m.promise},f=function(a,c){var d,f=Q.defer(),g=new XMLHttpRequest,h=!0,i=this,j={url:a,range:{},searching:!1,bytesLoaded:0,bytesToLoad:1500,request:g};return null===c?(j.searching=!0,j.range.start=0,j.range.end=j.bytesToLoad):(d=c.split("-"),j.range.start=parseFloat(d[0]),j.range.end=parseFloat(d[1])),g.onload=function(){g.status<200||g.status>299||(h=!1,j.searching?(j.bytesLoaded=j.range.end,e.call(i,g.response,j).then(function(a){f.resolve(a)})):b.call(i,g.response,j.url,j.range.start).then(function(a){f.resolve(a)}))},g.onloadend=g.onerror=function(){h&&(h=!1,i.errHandler.downloadError("SIDX",j.url,g),f.reject(g))},g.open("GET",j.url),g.responseType="arraybuffer",g.setRequestHeader("Range","bytes="+j.range.start+"-"+j.range.end),g.send(null),f.promise};return{debug:void 0,errHandler:void 0,loadSegments:f,loadInitialization:d,parseSegments:b,parseSIDX:a,findSIDX:e}},Dash.dependencies.BaseURLExtensions.prototype={constructor:Dash.dependencies.BaseURLExtensions},Dash.dependencies.DashHandler=function(){"use strict";var a,b,c=-1,d=function(a,b){var c=b.toString();return a.split("$Number$").join(c)},e=function(a,b){var c=b.toString();return a.split("$Time$").join(c)},f=function(a,b){var c=b.toString();return a.split("$Bandwidth$").join(c)},g=function(a,b){if(null===b||-1===a.indexOf("$RepresentationID$"))return a;var c=b.toString();return a.split("$RepresentationID$").join(c)},h=function(a,b){return a.representation.startNumber+b},i=function(a,b){var c,d=b.adaptation.period.mpd.manifest.Period_asArray[b.adaptation.period.index].AdaptationSet_asArray[b.adaptation.index].Representation_asArray[b.index].BaseURL;return c=a===d?a:-1!==a.indexOf("http://")?a:d+a},j=function(b,c){var d,e,f=new MediaPlayer.vo.SegmentRequest;return d=b.adaptation.period,f.streamType=c,f.type="Initialization Segment",f.url=i(b.initialization,b),f.range=b.range,e=d.start,f.availabilityStartTime=this.timelineConverter.calcAvailabilityStartTimeFromPresentationTime(e,b.adaptation.period.mpd,a),f.availabilityEndTime=this.timelineConverter.calcAvailabilityEndTimeFromPresentationTime(e+d.duration,d.mpd,a),f.quality=b.index,f},k=function(a){var c=Q.defer(),d=null,e=null,f=this;return a?(a.initialization?(d=j.call(f,a,b),c.resolve(d)):(e=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].BaseURL,f.baseURLExt.loadInitialization(e).then(function(g){a.range=g,a.initialization=e,d=j.call(f,a,b),c.resolve(d)},function(a){c.reject(a)})),c.promise):Q.reject("no represenation")},l=function(b){var d,e,f,g=b.adaptation.period,h=!1;return a?h=!1:0>c?h=!1:c<b.segments.length?(e=b.segments[c],f=e.presentationStartTime-g.start,d=b.adaptation.period.duration,h=f>=d):h=!0,Q.when(h)},m=function(b,c){var d,e,f,g;return e=b.segmentDuration,f=b.adaptation.period.start+c*e,g=f+e,d=new Dash.vo.Segment,d.representation=b,d.duration=e,d.presentationStartTime=f,d.mediaStartTime=this.timelineConverter.calcMediaTimeFromPresentationTime(d.presentationStartTime,b),d.availabilityStartTime=this.timelineConverter.calcAvailabilityStartTimeFromPresentationTime(d.presentationStartTime,b.adaptation.period.mpd,a),d.availabilityEndTime=this.timelineConverter.calcAvailabilityEndTimeFromPresentationTime(g,b.adaptation.period.mpd,a),d.wallStartTime=this.timelineConverter.calcWallTimeForSegment(d,a),d.replacementNumber=h(d,c),d},n=function(a){var b,c,d,e,f,g,h,i,j,k,l=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].SegmentTemplate,m=l.SegmentTimeline,n=[],o=0,q=0;for(k=a.timescale,b=m.S_asArray,d=0,e=b.length;e>d;d+=1)for(c=b[d],g=0,c.hasOwnProperty("r")&&(g=c.r),c.hasOwnProperty("t")&&(o=c.t),0>g&&(i=b[d+1],h=i&&i.hasOwnProperty("t")?i.t/k:a.adaptation.period.duration,g=(h-o/k)/(c.d/k)-1),f=0;g>=f;f+=1)j=p.call(this,a,o,c.d,k,l.media,c.mediaRange,q),n.push(j),j=null,o+=c.d,q+=1;return Q.when(n)},o=function(b){var c,f,g,h,i,j=[],k=b.adaptation.period.mpd.manifest.Period_asArray[b.adaptation.period.index].AdaptationSet_asArray[b.adaptation.index].Representation_asArray[b.index].SegmentTemplate,l=0,n=b.adaptation.period.duration/b.segmentDuration,o=null,p=null;for(i=b.startNumber,h=b.segmentAvailabilityRange||this.timelineConverter.calcSegmentAvailabilityRange(b,a),h&&(f=b.adaptation.period.start,g=b.segmentDuration,l=Math.floor((h.start-f)/g),n=Math.round((h.end-f)/g)),c=l;n>c;c+=1)o=m.call(this,b,c),o.replacementTime=(i+c-1)*b.segmentDuration,p=k.media,p=d(p,o.replacementNumber),p=e(p,o.replacementTime),o.media=p,j.push(o),o=null;return Q.when(j)},p=function(b,c,f,g,i,j,k){var l,m,n,o=c/g,p=Math.min(f/g,b.adaptation.period.mpd.maxSegmentDuration);return l=o,m=l+p,n=new Dash.vo.Segment,n.representation=b,n.duration=p,n.mediaStartTime=o,n.presentationStartTime=l,n.availabilityStartTime=b.adaptation.period.mpd.manifest.mpdLoadedTime,n.availabilityEndTime=this.timelineConverter.calcAvailabilityEndTimeFromPresentationTime(m,b.adaptation.period.mpd,a),n.wallStartTime=this.timelineConverter.calcWallTimeForSegment(n,a),n.replacementTime=c,n.replacementNumber=h(n,k),i=d(i,n.replacementNumber),i=e(i,n.replacementTime),n.media=i,n.mediaRange=j,n},q=function(a){var b,c,d,e,f,g=[],h=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].SegmentList;for(f=a.startNumber,b=0,c=h.SegmentURL_asArray.length;c>b;b+=1)e=h.SegmentURL_asArray[b],d=m.call(this,a,b),d.replacementTime=(f+b-1)*a.segmentDuration,d.media=e.media,d.mediaRange=e.mediaRange,d.index=e.index,d.indexRange=e.indexRange,g.push(d),d=null;return Q.when(g)},r=function(a){var b,c,d,e,f=this,g=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].BaseURL,h=Q.defer(),i=[],j=0,k=null;return a.indexRange&&(k=a.indexRange),this.baseURLExt.loadSegments(g,k).then(function(g){for(c=0,d=g.length;d>c;c+=1)b=g[c],e=p.call(f,a,b.startTime,b.duration,b.timescale,b.media,b.mediaRange,j),i.push(e),e=null,j+=1;h.resolve(i)}),h.promise},s=function(b){var c,d,e=Q.defer();return b.segments?Q.when(b.segments):(c="SegmentTimeline"===b.segmentInfoType?n.call(this,b):"SegmentTemplate"===b.segmentInfoType?o.call(this,b):"SegmentList"===b.segmentInfoType?q.call(this,b):r.call(this,b),Q.when(c).then(function(c){b.segments=c,d=c.length-1,a&&isNaN(b.adaptation.period.liveEdge)&&(b.adaptation.period.liveEdge=c[d].presentationStartTime),b.segmentAvailabilityRange={start:c[0].presentationStartTime,end:c[d].presentationStartTime},e.resolve(c)}),e.promise)},t=function(a,b){var c,d,e,f,g=b.length-1,h=-1;if(b&&b.length>0)for(f=g;f>=0;f--){if(c=b[f],d=c.presentationStartTime,e=c.duration,a+Dash.dependencies.DashHandler.EPSILON>=d&&a-Dash.dependencies.DashHandler.EPSILON<=d+e){h=f;break}-1===h&&a-Dash.dependencies.DashHandler.EPSILON>d+e&&(h=f+1)}return h>g&&(h=g),Q.when(h)},u=function(a){if(null===a||void 0===a)return Q.when(null);var h,j=new MediaPlayer.vo.SegmentRequest,k=a.representation,l=k.adaptation.period.mpd.manifest.Period_asArray[k.adaptation.period.index].AdaptationSet_asArray[k.adaptation.index].Representation_asArray[k.index].bandwidth;return h=i(a.media,k),h=d(h,a.replacementNumber),h=e(h,a.replacementTime),h=f(h,l),h=g(h,k.id),j.streamType=b,j.type="Media Segment",j.url=h,j.range=a.mediaRange,j.startTime=a.presentationStartTime,j.duration=a.duration,j.timescale=k.timescale,j.availabilityStartTime=a.availabilityStartTime,j.availabilityEndTime=a.availabilityEndTime,j.wallStartTime=a.wallStartTime,j.quality=k.index,j.index=c,Q.when(j)},v=function(a,b){var d,e,f,g=this;return a?(d=Q.defer(),s.call(g,a).then(function(a){var c;return c=t.call(g,b,a)}).then(function(b){return c=b,l.call(g,a)}).then(function(b){var h=null;return b?(e=new MediaPlayer.vo.SegmentRequest,e.action=e.ACTION_COMPLETE,e.index=c,d.resolve(e)):a.segments?(f=a.segments[c],h=u.call(g,f)):Q.when(null),h}).then(function(a){d.resolve(a)}),d.promise):Q.reject("no represenation")},w=function(a){var b,d,e,f=this;if(!a)return Q.reject("no represenation");if(-1===c)throw"You must call getSegmentRequestForTime first.";return c+=1,b=Q.defer(),l.call(f,a).then(function(g){g?(d=new MediaPlayer.vo.SegmentRequest,d.action=d.ACTION_COMPLETE,d.index=c,b.resolve(d)):s.call(f,a).then(function(b){var d;return e=a.segments[c],d=u.call(f,e)}).then(function(a){b.resolve(a)})}),b.promise},x=function(a,b,c){var d,e=this,f=Math.max(b-c,0),g=Q.defer(),h=0;return a?(s.call(e,a).then(function(a){d=a[0].duration,h=Math.ceil(f/d),g.resolve(h)},function(){g.resolve(0)}),g.promise):Q.reject("no represenation")},y=function(a){var b,d,e=this,f=Q.defer();return a?(d=c,s.call(e,a).then(function(c){0>d?b=e.timelineConverter.calcPresentationStartTime(a.adaptation.period):(d=Math.min(c.length-1,d),b=c[d].presentationStartTime),f.resolve(b)},function(){f.reject()}),f.promise):Q.reject("no represenation")};return{debug:void 0,baseURLExt:void 0,manifestModel:void 0,manifestExt:void 0,errHandler:void 0,timelineConverter:void 0,getType:function(){return b},setType:function(a){b=a},getIsDynamic:function(){return a},setIsDynamic:function(b){a=b},getInitRequest:k,getSegmentRequestForTime:v,getNextSegmentRequest:w,getCurrentTime:y,getSegmentCountForDuration:x}},Dash.dependencies.DashHandler.EPSILON=.003,Dash.dependencies.DashHandler.prototype={constructor:Dash.dependencies.DashHandler},Dash.dependencies.DashManifestExtensions=function(){"use strict";this.timelineConverter=void 0},Dash.dependencies.DashManifestExtensions.prototype={constructor:Dash.dependencies.DashManifestExtensions,getIsAudio:function(a){"use strict";var b,c,d,e=a.ContentComponent_asArray,f=!1,g=!1;if(e)for(b=0,c=e.length;c>b;b+=1)"audio"===e[b].contentType&&(f=!0,g=!0);if(a.hasOwnProperty("mimeType")&&(f=-1!==a.mimeType.indexOf("audio"),g=!0),!g)for(b=0,c=a.Representation_asArray.length;!g&&c>b;)d=a.Representation_asArray[b],d.hasOwnProperty("mimeType")&&(f=-1!==d.mimeType.indexOf("audio"),g=!0),b+=1;return f&&(a.type="audio"),Q.when(f)},getIsVideo:function(a){"use strict";var b,c,d,e=a.ContentComponent_asArray,f=!1,g=!1;if(e)for(b=0,c=e.length;c>b;b+=1)"video"===e[b].contentType&&(f=!0,g=!0);if(a.hasOwnProperty("mimeType")&&(f=-1!==a.mimeType.indexOf("video"),g=!0),!g)for(b=0,c=a.Representation_asArray.length;!g&&c>b;)d=a.Representation_asArray[b],d.hasOwnProperty("mimeType")&&(f=-1!==d.mimeType.indexOf("video"),g=!0),b+=1;return f&&(a.type="video"),Q.when(f)},getIsText:function(a){"use strict";var b,c,d,e=a.ContentComponent_asArray,f=!1,g=!1;if(e)for(b=0,c=e.length;c>b;b+=1)"text"===e[b].contentType&&(f=!0,g=!0);if(a.hasOwnProperty("mimeType")&&(f=-1!==a.mimeType.indexOf("text"),g=!0),!g)for(b=0,c=a.Representation_asArray.length;!g&&c>b;)d=a.Representation_asArray[b],d.hasOwnProperty("mimeType")&&(f=-1!==d.mimeType.indexOf("text"),g=!0),b+=1;return Q.when(f)},getIsTextTrack:function(a){return"text/vtt"===a||"application/ttml+xml"===a},getIsMain:function(){"use strict";return Q.when(!1)},processAdaptation:function(a){"use strict";return void 0!==a.Representation_asArray&&null!==a.Representation_asArray&&a.Representation_asArray.sort(function(a,b){return a.bandwidth-b.bandwidth}),a},getDataForId:function(a,b,c){"use strict";var d,e,f=b.Period_asArray[c].AdaptationSet_asArray;for(d=0,e=f.length;e>d;d+=1)if(f[d].hasOwnProperty("id")&&f[d].id===a)return Q.when(f[d]);return Q.when(null)},getDataForIndex:function(a,b,c){"use strict";var d=b.Period_asArray[c].AdaptationSet_asArray;return Q.when(d[a])},getDataIndex:function(a,b,c){"use strict";var d,e,f=b.Period_asArray[c].AdaptationSet_asArray;if(a.id){for(d=0,e=f.length;e>d;d+=1)if(f[d].id&&f[d].id===a.id)return Q.when(d)}else{var g,h=JSON.stringify(a);for(d=0,e=f.length;e>d;d+=1)if(g=JSON.stringify(f[d]),g===h)return Q.when(d)}return Q.when(-1)},getVideoData:function(a,b){"use strict";var c,d,e=this,f=a.Period_asArray[b].AdaptationSet_asArray,g=Q.defer(),h=[];for(c=0,d=f.length;d>c;c+=1)h.push(this.getIsVideo(f[c]));return Q.all(h).then(function(a){var b=!1;for(c=0,d=a.length;d>c;c+=1)a[c]===!0&&(b=!0,g.resolve(e.processAdaptation(f[c])));b||g.resolve(null)}),g.promise},getTextData:function(a,b){"use strict";var c,d,e=this,f=a.Period_asArray[b].AdaptationSet_asArray,g=Q.defer(),h=[];for(c=0,d=f.length;d>c;c+=1)h.push(this.getIsText(f[c]));return Q.all(h).then(function(a){var b=!1;for(c=0,d=a.length;d>c;c+=1)a[c]===!0&&(b=!0,g.resolve(e.processAdaptation(f[c])));b||g.resolve(null)}),g.promise},getAudioDatas:function(a,b){"use strict";var c,d,e=this,f=a.Period_asArray[b].AdaptationSet_asArray,g=Q.defer(),h=[];for(c=0,d=f.length;d>c;c+=1)h.push(this.getIsAudio(f[c]));return Q.all(h).then(function(a){var b=[];for(c=0,d=a.length;d>c;c+=1)a[c]===!0&&b.push(e.processAdaptation(f[c]));g.resolve(b)}),g.promise},getPrimaryAudioData:function(a,b){"use strict";var c,d,e=Q.defer(),f=[],g=this;return this.getAudioDatas(a,b).then(function(a){for(a&&0!==a.length||e.resolve(null),c=0,d=a.length;d>c;c+=1)f.push(g.getIsMain(a[c]));Q.all(f).then(function(b){var f=!1;for(c=0,d=b.length;d>c;c+=1)b[c]===!0&&(f=!0,e.resolve(g.processAdaptation(a[c])));f||e.resolve(a[0])})}),e.promise},getCodec:function(a){"use strict";var b=a.Representation_asArray[0],c=b.mimeType+';codecs="'+b.codecs+'"';return Q.when(c)},getMimeType:function(a){"use strict";return Q.when(a.Representation_asArray[0].mimeType)},getKID:function(a){"use strict";return a&&a.hasOwnProperty("cenc:default_KID")?a["cenc:default_KID"]:null},getContentProtectionData:function(a){"use strict";return Q.when(a&&a.hasOwnProperty("ContentProtection_asArray")&&0!==a.ContentProtection_asArray.length?a.ContentProtection_asArray:null)},getIsDynamic:function(a){"use strict";var b=!1,c="dynamic";return a.hasOwnProperty("type")&&(b=a.type===c),b},getIsDVR:function(a){"use strict";var b,c,d=this.getIsDynamic(a);return b=!isNaN(a.timeShiftBufferDepth),c=d&&b,Q.when(c)},getIsOnDemand:function(a){"use strict";var b=!1;return a.profiles&&a.profiles.length>0&&(b=-1!==a.profiles.indexOf("urn:mpeg:dash:profile:isoff-on-demand:2011")),Q.when(b)},getDuration:function(a){var b;return b=a.hasOwnProperty("mediaPresentationDuration")?a.mediaPresentationDuration:Number.POSITIVE_INFINITY,Q.when(b)},getBandwidth:function(a){"use strict";return Q.when(a.bandwidth)},getRefreshDelay:function(a){"use strict";var b=0/0;return a.hasOwnProperty("minimumUpdatePeriod")&&(b=parseFloat(a.minimumUpdatePeriod)),Q.when(b)},getRepresentationCount:function(a){"use strict";return Q.when(a.Representation_asArray.length)},getRepresentationFor:function(a,b){"use strict";return Q.when(b.Representation_asArray[a])},getRepresentationsForAdaptation:function(a,b){for(var c,d,e,f,g=a.Period_asArray[b.period.index].AdaptationSet_asArray[b.index],h=this,i=[],j=Q.defer(),k=0;k<g.Representation_asArray.length;k+=1)f=g.Representation_asArray[k],c=new Dash.vo.Representation,c.index=k,c.adaptation=b,f.hasOwnProperty("id")&&(c.id=f.id),f.hasOwnProperty("SegmentBase")?(e=f.SegmentBase,c.segmentInfoType="SegmentBase"):f.hasOwnProperty("SegmentList")?(e=f.SegmentList,c.segmentInfoType="SegmentList"):f.hasOwnProperty("SegmentTemplate")?(e=f.SegmentTemplate,c.segmentInfoType=e.hasOwnProperty("SegmentTimeline")?"SegmentTimeline":"SegmentTemplate",e.hasOwnProperty("initialization")&&(c.initialization=e.initialization.split("$Bandwidth$").join(f.bandwidth).split("$RepresentationID$").join(f.id))):(e=f.BaseURL,c.segmentInfoType="BaseURL"),e.hasOwnProperty("Initialization")?(d=e.Initialization,d.hasOwnProperty("sourceURL")?c.initialization=d.sourceURL:d.hasOwnProperty("range")&&(c.initialization=f.BaseURL,c.range=d.range)):f.hasOwnProperty("mimeType")&&h.getIsTextTrack(f.mimeType)&&(c.initialization=f.BaseURL,c.range=0),e.hasOwnProperty("timescale")&&(c.timescale=e.timescale),e.hasOwnProperty("duration")&&(c.segmentDuration=e.duration/c.timescale),e.hasOwnProperty("startNumber")&&(c.startNumber=e.startNumber),e.hasOwnProperty("indexRange")&&(c.indexRange=e.indexRange),e.hasOwnProperty("presentationTimeOffset")&&(c.presentationTimeOffset=e.presentationTimeOffset/c.timescale),c.MSETimeOffset=h.timelineConverter.calcMSETimeOffset(c),i.push(c);return j.resolve(i),j.promise},getAdaptationsForPeriod:function(a,b){for(var c,d=a.Period_asArray[b.index],e=[],f=0;f<d.AdaptationSet_asArray.length;f+=1)c=new Dash.vo.AdaptationSet,c.index=f,c.period=b,e.push(c);return Q.when(e)},getRegularPeriods:function(a,b){var c,d,e=this,f=Q.defer(),g=[],h=e.getIsDynamic(a),i=null,j=null,k=null,l=null;for(c=0,d=a.Period_asArray.length;d>c;c+=1)j=a.Period_asArray[c],j.hasOwnProperty("start")?(l=new Dash.vo.Period,l.start=j.start):null!==i&&j.hasOwnProperty("duration")?(l=new Dash.vo.Period,l.start=k.start+k.duration,l.duration=j.duration):0!==c||h||(l=new Dash.vo.Period,l.start=0),null!==k&&isNaN(k.duration)&&(k.duration=l.start-k.start),null!==l&&j.hasOwnProperty("id")&&(l.id=j.id),null!==l&&(l.index=c,l.mpd=b,g.push(l)),i=j,j=null,k=l,l=null;return e.getCheckTime(a,g[0]).then(function(a){b.checkTime=a,null!==k&&isNaN(k.duration)?e.getEndTimeForLastPeriod(b).then(function(a){k.duration=a-k.start,f.resolve(g)}):f.resolve(g)}),Q.when(f.promise)},getMpd:function(a){var b=new Dash.vo.Mpd;return b.manifest=a,b.availabilityStartTime=new Date(a.hasOwnProperty("availabilityStartTime")?a.availabilityStartTime.getTime():a.mpdLoadedTime.getTime()),a.hasOwnProperty("availabilityEndTime")&&(b.availabilityEndTime=new Date(a.availabilityEndTime.getTime())),a.hasOwnProperty("suggestedPresentationDelay")&&(b.suggestedPresentationDelay=a.suggestedPresentationDelay),a.hasOwnProperty("timeShiftBufferDepth")&&(b.timeShiftBufferDepth=a.timeShiftBufferDepth),a.hasOwnProperty("maxSegmentDuration")&&(b.maxSegmentDuration=a.maxSegmentDuration),Q.when(b)},getFetchTime:function(a,b){var c=this.timelineConverter.calcPresentationTimeFromWallTime(a.mpdLoadedTime,b,!0);return Q.when(c)},getCheckTime:function(a,b){var c=this,d=Q.defer(),e=0/0;return a.hasOwnProperty("minimumUpdatePeriod")?c.getFetchTime(a,b).then(function(b){e=b+a.minimumUpdatePeriod,d.resolve(e)}):d.resolve(e),d.promise},getEndTimeForLastPeriod:function(a){var b;return b=a.manifest.mediaPresentationDuration?a.manifest.mediaPresentationDuration:a.checkTime,Q.when(b)}},Dash.dependencies.DashMetricsExtensions=function(){"use strict";var a=function(a,b){var c,d,e,f,g,h,i,j;for(h=0;h<a.length;h+=1)for(c=a[h],e=c.AdaptationSet_asArray,i=0;i<e.length;i+=1)for(d=e[i],g=d.Representation_asArray,j=0;j<g.length;j+=1)if(f=g[j],b===f.id)return j;return-1},b=function(a,b){var c,d,e,f,g,h,i,j;for(h=0;h<a.length;h+=1)for(c=a[h],e=c.AdaptationSet_asArray,i=0;i<e.length;i+=1)for(d=e[i],g=d.Representation_asArray,j=0;j<g.length;j+=1)if(f=g[j],b===f.id)return f;return null},c=function(a,b){var c=!1;return"video"===b?(this.manifestExt.getIsVideo(a),"video"===a.type&&(c=!0)):"audio"===b?(this.manifestExt.getIsAudio(a),"audio"===a.type&&(c=!0)):c=!1,c},d=function(a,b){var d,e,f,g,h,i;for(h=0;h<a.length;h+=1)for(d=a[h],f=d.AdaptationSet_asArray,i=0;i<f.length;i+=1)if(e=f[i],g=e.Representation_asArray,c.call(this,e,b))return g.length;return-1},e=function(a){var c,d=this,e=d.manifestModel.getValue(),f=e.Period_asArray;return c=b.call(d,f,a),null===c?null:c.bandwidth},f=function(b){var c,d=this,e=d.manifestModel.getValue(),f=e.Period_asArray;return c=a.call(d,f,b)},g=function(a){var b,c=this,e=c.manifestModel.getValue(),f=e.Period_asArray;return b=d.call(this,f,a)},h=function(a){if(null===a)return null;var b,c,d,e=a.RepSwitchList;return null===e||e.length<=0?null:(b=e.length,c=b-1,d=e[c])},i=function(a){if(null===a)return null;var b,c,d,e=a.BufferLevel;return null===e||e.length<=0?null:(b=e.length,c=b-1,d=e[c])},j=function(a){if(null===a)return null;var b,c,d,e=a.HttpList;return null===e||e.length<=0?null:(b=e.length,c=b-1,d=e[c])},k=function(a){if(null===a)return null;var b,c,d,e=a.DroppedFrames;return null===e||e.length<=0?null:(b=e.length,c=b-1,d=e[c])};return{manifestModel:void 0,manifestExt:void 0,getBandwidthForRepresentation:e,getIndexForRepresentation:f,getMaxIndexForBufferType:g,getCurrentRepresentationSwitch:h,getCurrentBufferLevel:i,getCurrentHttpRequest:j,getCurrentDroppedFrames:k}},Dash.dependencies.DashMetricsExtensions.prototype={constructor:Dash.dependencies.DashMetricsExtensions},Dash.dependencies.DashParser=function(){"use strict";var a=31536e3,b=2592e3,c=86400,d=3600,e=60,f=60,g=1e3,h=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,i=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})([0-9]{2}))?/,j=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,k=[{type:"duration",test:function(a){return h.test(a)},converter:function(f){var g=h.exec(f);return parseFloat(g[2]||0)*a+parseFloat(g[4]||0)*b+parseFloat(g[6]||0)*c+parseFloat(g[8]||0)*d+parseFloat(g[10]||0)*e+parseFloat(g[12]||0)}},{type:"datetime",test:function(a){return i.test(a)},converter:function(a){var b,c=i.exec(a);if(b=Date.UTC(parseInt(c[1],10),parseInt(c[2],10)-1,parseInt(c[3],10),parseInt(c[4],10),parseInt(c[5],10),c[6]&&parseInt(c[6],10)||0,c[7]&&parseFloat(c[7])*g||0),c[9]&&c[10]){var d=parseInt(c[9],10)*f+parseInt(c[10],10);b+=("+"===c[8]?-1:1)*d*e*g}return new Date(b)}},{type:"numeric",test:function(a){return j.test(a)},converter:function(a){return parseFloat(a)}}],l=function(){var a,b,c,d;return d=[{name:"profiles",merge:!1},{name:"width",merge:!1},{name:"height",merge:!1},{name:"sar",merge:!1},{name:"frameRate",merge:!1},{name:"audioSamplingRate",merge:!1},{name:"mimeType",merge:!1},{name:"segmentProfiles",merge:!1},{name:"codecs",merge:!1},{name:"maximumSAPPeriod",merge:!1},{name:"startsWithSap",merge:!1},{name:"maxPlayoutRate",merge:!1},{name:"codingDependency",merge:!1},{name:"scanType",merge:!1},{name:"FramePacking",merge:!0},{name:"AudioChannelConfiguration",merge:!0},{name:"ContentProtection",merge:!0}],a={},a.name="AdaptationSet",a.isRoot=!1,a.isArray=!0,a.parent=null,a.children=[],a.properties=d,b={},b.name="Representation",b.isRoot=!1,b.isArray=!0,b.parent=a,b.children=[],b.properties=d,a.children.push(b),c={},c.name="SubRepresentation",c.isRoot=!1,c.isArray=!0,c.parent=b,c.children=[],c.properties=d,b.children.push(c),a},m=function(){var a,b,c,d;return d=[{name:"SegmentBase",merge:!0},{name:"SegmentTemplate",merge:!0},{name:"SegmentList",merge:!0}],a={},a.name="Period",a.isRoot=!1,a.isArray=!0,a.parent=null,a.children=[],a.properties=d,b={},b.name="AdaptationSet",b.isRoot=!1,b.isArray=!0,b.parent=a,b.children=[],b.properties=d,a.children.push(b),c={},c.name="Representation",c.isRoot=!1,c.isArray=!0,c.parent=b,c.children=[],c.properties=d,b.children.push(c),a},n=function(){var a,b,c,d,e;return e=[{name:"BaseURL",merge:!0,mergeFunction:function(a,b){var c;return c=0===b.indexOf("http://")?b:a+b}}],a={},a.name="mpd",a.isRoot=!0,a.isArray=!0,a.parent=null,a.children=[],a.properties=e,b={},b.name="Period",b.isRoot=!1,b.isArray=!0,b.parent=null,b.children=[],b.properties=e,a.children.push(b),c={},c.name="AdaptationSet",c.isRoot=!1,c.isArray=!0,c.parent=b,c.children=[],c.properties=e,b.children.push(c),d={},d.name="Representation",d.isRoot=!1,d.isArray=!0,d.parent=c,d.children=[],d.properties=e,c.children.push(d),a},o=function(){var a=[];return a.push(l()),a.push(m()),a.push(n()),a},p=function(a,b){var c,d=new X2JS(k,"",!0),e=new ObjectIron(o());return c=d.xml_str2json(a),null==c?Q.when(null):(c.hasOwnProperty("BaseURL")?(c.BaseURL=c.BaseURL_asArray[0],0!==c.BaseURL.indexOf("http")&&(c.BaseURL=b+c.BaseURL)):c.BaseURL=b,e.run(c),Q.when(c))};return{debug:void 0,parse:p}},Dash.dependencies.DashParser.prototype={constructor:Dash.dependencies.DashParser},Dash.dependencies.FragmentExtensions=function(){"use strict";var a=function(a){for(var b,c,d,e,f,g,h=Q.defer(),i=new DataView(a),j=0;"tfdt"!==e&&j<i.byteLength;){for(d=i.getUint32(j),j+=4,e="",f=0;4>f;f+=1)g=i.getInt8(j),e+=String.fromCharCode(g),j+=1;"moof"!==e&&"traf"!==e&&"tfdt"!==e&&(j+=d-8)}if(j===i.byteLength)throw"Error finding live offset.";return c=i.getUint8(j),0===c?(j+=4,b=i.getUint32(j,!1)):(j+=d-16,b=utils.Math.to64BitNumber(i.getUint32(j+4,!1),i.getUint32(j,!1))),h.resolve({version:c,base_media_decode_time:b}),h.promise},b=function(a){for(var b,c,d,e,f,g,h,i=new DataView(a),j=0;"sidx"!==f&&j<i.byteLength;){for(g=i.getUint32(j),j+=4,f="",e=0;4>e;e+=1)h=i.getInt8(j),f+=String.fromCharCode(h),j+=1;"moof"!==f&&"traf"!==f&&"sidx"!==f?j+=g-8:"sidx"===f&&(j-=8)}return b=i.getUint8(j+8),j+=12,c=i.getUint32(j+4,!1),j+=8,d=0===b?i.getUint32(j,!1):utils.Math.to64BitNumber(i.getUint32(j+4,!1),i.getUint32(j,!1)),Q.when({earliestPresentationTime:d,timescale:c})},c=function(b){var c,d,e,f=Q.defer(),g=new XMLHttpRequest,h=!1;return c=b,g.onloadend=function(){h||(d="Error loading fragment: "+c,f.reject(d))},g.onload=function(){h=!0,e=a(g.response),f.resolve(e)},g.onerror=function(){d="Error loading fragment: "+c,f.reject(d)},g.responseType="arraybuffer",g.open("GET",c),g.send(null),f.promise};return{debug:void 0,loadFragment:c,parseTFDT:a,parseSIDX:b}},Dash.dependencies.FragmentExtensions.prototype={constructor:Dash.dependencies.FragmentExtensions},Dash.dependencies.TimelineConverter=function(){"use strict";var a=function(a,b,c,d){var e=0/0;return e=d?c&&b.timeShiftBufferDepth!=Number.POSITIVE_INFINITY?new Date(b.availabilityStartTime.getTime()+1e3*(a+b.timeShiftBufferDepth)):b.availabilityEndTime:c?new Date(b.availabilityStartTime.getTime()+1e3*a):b.availabilityStartTime},b=function(b,c,d){return a.call(this,b,c,d)},c=function(b,c,d){return a.call(this,b,c,d,!0)},d=function(a){var b,c;return c="dynamic"===a.mpd.manifest.type,b=c?a.liveEdge:a.start},e=function(a,c,d){var e=b.call(this,c.start,c.mpd,d);return(a.getTime()-e.getTime())/1e3},f=function(a,b){var c=b.adaptation.period.start,d=b.presentationTimeOffset;return c-d+a},g=function(a,b){var c=b.adaptation.period.start,d=b.presentationTimeOffset;return c+d+a},h=function(a,b){var c,d,e;return b&&(c=a.representation.adaptation.period.mpd.suggestedPresentationDelay,d=a.presentationStartTime+c,e=new Date(a.availabilityStartTime.getTime()+1e3*d)),e},i=function(a,b){var c,d,f,g,h,i=null;return b&&(c=a.adaptation.period.mpd.checkTime,d=a.segmentDuration,f=e(new Date,a.adaptation.period,b)-a.adaptation.period.mpd.suggestedPresentationDelay,g=Math.max(f-a.adaptation.period.mpd.timeShiftBufferDepth-d,0),h=isNaN(c)?f:Math.min(c,f),i={start:g,end:h}),i},j=function(a){var b=a.adaptation.period.start,c=a.presentationTimeOffset;return b-c};return{system:void 0,debug:void 0,calcAvailabilityStartTimeFromPresentationTime:b,calcAvailabilityEndTimeFromPresentationTime:c,calcPresentationTimeFromWallTime:e,calcPresentationTimeFromMediaTime:f,calcPresentationStartTime:d,calcMediaTimeFromPresentationTime:g,calcSegmentAvailabilityRange:i,calcWallTimeForSegment:h,calcMSETimeOffset:j}},Dash.dependencies.TimelineConverter.prototype={constructor:Dash.dependencies.TimelineConverter},Dash.vo.AdaptationSet=function(){"use strict";this.period=null,this.index=-1},Dash.vo.AdaptationSet.prototype={constructor:Dash.vo.AdaptationSet},Dash.vo.Mpd=function(){"use strict";this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.checkTime=0/0},Dash.vo.Mpd.prototype={constructor:Dash.vo.Mpd},Dash.vo.Period=function(){"use strict";this.id=null,this.index=-1,this.duration=0/0,this.start=0/0,this.mpd=null,this.liveEdge=0/0},Dash.vo.Period.prototype={constructor:Dash.vo.Period},Dash.vo.Representation=function(){"use strict";this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.segmentDuration=0/0,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=0/0,this.segmentAvailabilityRange=null},Dash.vo.Representation.prototype={constructor:Dash.vo.Representation},Dash.vo.Segment=function(){"use strict";this.indexRange=null,this.index=null,this.mediaRange=null,this.media=null,this.duration=0/0,this.replacementTime=null,this.replacementNumber=0/0,this.mediaStartTime=0/0,this.presentationStartTime=0/0,this.availabilityStartTime=0/0,this.availabilityEndTime=0/0,this.wallStartTime=0/0,this.representation=null
},Dash.vo.Segment.prototype={constructor:Dash.vo.Segment},Mss.dependencies.MssFragmentController=function(){"use strict";var a=function(a,b){var c,d,e=b.Period_asArray;for(c=0;c<e.length;c+=1){var f=e[c].AdaptationSet_asArray;for(d=0;d<f.length;d+=1)if(f[d]===a)return d}return-1},b=function(a,b){for(var c=d.manifestModel.getValue(),e=!1,f=b.SegmentTemplate.SegmentTimeline.S,g=a.entry,h=0,i=0,j=null,k=0,l=0,m=0,n=null;m<g.length;)h=g[m].fragment_absolute_time,i=g[m].fragment_duration,j=f[f.length-1],k=void 0===j.r?0:j.r,l=j.t+j.d*k,h>l&&(i===j.d?j.r=k+1:f.push({t:h,d:i}),e=!0),m+=1;if(e)for(j=f[f.length-1],k=void 0===j.r?0:j.r,l=j.t+j.d*k,n=l-1e7*c.timeShiftBufferDepth,j=f[0];j.t<n;)void 0!==j.r&&j.r>0?(j.t+=j.d,j.r-=1):f.splice(0,1),j=f[0];return e},c=function(c,e,f){var g=!1,h=d.manifestModel.getValue(),i=a(f,h)+1,j=new mp4lib.deserialize(c),k=mp4lib.getBoxByType(j,"moof"),l=mp4lib.getBoxByType(j,"mdat"),m=mp4lib.getBoxByType(k,"traf"),n=mp4lib.getBoxByType(m,"trun"),o=mp4lib.getBoxByType(m,"tfhd"),p=mp4lib.getBoxByType(m,"sepiff");if(null!==p){p.boxtype="senc";var q=new mp4lib.boxes.SampleAuxiliaryInformationOffsetsBox;q.version=0,q.flags=0,q.entry_count=1,q.offset=[];var r=new mp4lib.boxes.SampleAuxiliaryInformationSizesBox;r.version=0,r.flags=0,r.sample_count=p.sample_count,r.default_sample_info_size=0,r.sample_info_size=[];for(var s=!1,t=0;t<p.sample_count;t++)r.sample_info_size[t]=8+6*p.entry[t].NumberOfEntries+2,t>1&&r.sample_info_size[t]!=r.sample_info_size[t-1]&&(s=!0);s===!1&&(r.default_sample_info_size=r.sample_info_size[0],r.sample_info_size=[]),m.boxes.push(r),m.boxes.push(q)}o.track_ID=i,mp4lib.removeBoxByType(m,"tfxd");var u=mp4lib.getBoxByType(m,"tfdt");null===u&&(u=new mp4lib.boxes.TrackFragmentBaseMediaDecodeTimeBox,u.version=1,u.baseMediaDecodeTime=Math.floor(e.startTime*e.timescale),m.boxes.push(u));var v=mp4lib.getBoxByType(m,"tfrf");if(null!==v&&(g=b(v,f),mp4lib.removeBoxByType(m,"tfrf")),o.flags&=16777214,o.flags|=131072,n.flags|=1,n.data_offset=0,null!==p){var w=mp4lib.getBoxPositionByType(j,"moof")+8,x=mp4lib.getBoxPositionByType(k,"traf")+8,y=mp4lib.getBoxPositionByType(m,"senc")+8;q.offset[0]=w+x+y+8}var z=new mp4lib.fieldProcessors.LengthCounterBoxFieldsProcessor(j);j._processFields(z);var A=new Uint8Array(z.res);if(n.data_offset=z.res-l.size+8,navigator.userAgent.indexOf("Chrome")>=0&&"dynamic"===h.type){u.baseMediaDecodeTime/=1e3;for(var t=0;t<n.samples_table.length;t++)n.samples_table[t].sample_composition_time_offset>0&&(n.samples_table[t].sample_composition_time_offset/=1e3),n.samples_table[t].sample_duration>0&&(n.samples_table[t].sample_duration/=1e3)}var B=new mp4lib.fieldProcessors.SerializationBoxFieldsProcessor(j,A,0);return j._processFields(B),{bytes:A,segmentsUpdated:g}},d=Custom.utils.copyMethods(MediaPlayer.dependencies.FragmentController);return d.manifestModel=void 0,d.mp4Processor=void 0,d.process=function(a,b,d){var e=null,f=this.manifestModel.getValue();if(null!==a&&void 0!==a&&a.byteLength>0&&(e=new Uint8Array(a)),b&&"Media Segment"===b.type&&d&&d.length>0){var g=f.Period_asArray[d[0].adaptation.period.index].AdaptationSet_asArray[d[0].adaptation.index],h=c(e,b,g);if(e=h.bytes,h.segmentsUpdated===!0)for(var i=0;i<d.length;i++)d[i].segments=null}if(void 0===b&&navigator.userAgent.indexOf("Chrome")>=0&&"dynamic"===f.type){var j=mp4lib.deserialize(e),k=mp4lib.getBoxByType(j,"moov"),l=mp4lib.getBoxByType(k,"mvhd"),m=mp4lib.getBoxByType(k,"trak"),n=mp4lib.getBoxByType(m,"mdia"),o=mp4lib.getBoxByType(n,"mdhd");l.timescale/=1e3,o.timescale/=1e3,e=mp4lib.serialize(j)}return Q.when(e)},d},Mss.dependencies.MssFragmentController.prototype={constructor:Mss.dependencies.MssFragmentController},Mss.dependencies.MssHandler=function(){var a=!1,b=function(a,b){var c=1;return a.AudioChannelConfiguration?c=a.AudioChannelConfiguration.value:b.AudioChannelConfiguration&&(c=b.AudioChannelConfiguration.value),c},c=function(a,b){var c=1;return c=a.audioSamplingRate?a.audioSamplingRate:b.audioSamplingRate},d=function(a){if(a){if(!a.initData){var d=e.manifestModel.getValue(),f=a.adaptation,g=d.Period_asArray[f.period.index].AdaptationSet_asArray[f.index],h=g.Representation_asArray[a.index],i={};i.type=e.getType()||"und",i.trackId=f.index+1,i.timescale=a.timescale,i.duration=a.adaptation.period.duration,i.codecs=h.codecs,i.codecPrivateData=h.codecPrivateData,i.bandwidth=h.bandwidth,void 0!=g.ContentProtection&&(i.contentProtection=g.ContentProtection),i.width=h.width||g.maxWidth,i.height=h.height||g.maxHeight,i.language=g.lang?g.lang:"und",i.channels=b(g,h),i.samplingRate=c(g,h),a.initData=e.mp4Processor.generateInitSegment(i)}return a.initData}return null},e=Custom.utils.copyMethods(Dash.dependencies.DashHandler);return e.mp4Processor=void 0,e.getInitRequest=function(b){var c=null,f=this,g=null,h=Q.defer();c=b.adaptation.period,g=c.start;var i=e.manifestModel.getValue();a=e.manifestExt.getIsDynamic(i);var j=new MediaPlayer.vo.SegmentRequest;return j.streamType=e.getType(),j.type="Initialization Segment",j.url=null,j.data=d(b),j.range=b.range,j.availabilityStartTime=f.timelineConverter.calcAvailabilityStartTimeFromPresentationTime(g,b.adaptation.period.mpd,a),j.availabilityEndTime=f.timelineConverter.calcAvailabilityEndTimeFromPresentationTime(g+c.duration,c.mpd,a),j.quality=b.index,h.resolve(j),h.promise},e},Mss.dependencies.MssHandler.prototype={constructor:Mss.dependencies.MssHandler},Mss.dependencies.MssParser=function(){"use strict";var a=1e7,b=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,c=/^0[xX][A-Fa-f0-9]+$/,d=[{type:"numeric",test:function(a){return b.test(a)},converter:function(a){return parseFloat(a)}},{type:"hexadecimal",test:function(a){return c.test(a)},converter:function(a){return a.substr(2)}}],e={video:"video/mp4",audio:"audio/mp4",text:"text/mp4"},f=function(){var a,b,c;return c=[{name:"profiles",merge:!1},{name:"width",merge:!1},{name:"height",merge:!1},{name:"sar",merge:!1},{name:"frameRate",merge:!1},{name:"audioSamplingRate",merge:!1},{name:"mimeType",merge:!1},{name:"segmentProfiles",merge:!1},{name:"codecs",merge:!1},{name:"maximumSAPPeriod",merge:!1},{name:"startsWithSap",merge:!1},{name:"maxPlayoutRate",merge:!1},{name:"codingDependency",merge:!1},{name:"scanType",merge:!1},{name:"FramePacking",merge:!0},{name:"AudioChannelConfiguration",merge:!0},{name:"ContentProtection",merge:!0}],a={},a.name="AdaptationSet",a.isRoot=!1,a.isArray=!0,a.parent=null,a.children=[],a.properties=c,b={},b.name="Representation",b.isRoot=!1,b.isArray=!0,b.parent=a,b.children=[],b.properties=c,a.children.push(b),a},g=function(){var a,b,c,d;return d=[{name:"SegmentBase",merge:!0},{name:"SegmentTemplate",merge:!0},{name:"SegmentList",merge:!0}],a={},a.name="Period",a.isRoot=!1,a.isArray=!1,a.parent=null,a.children=[],a.properties=d,b={},b.name="AdaptationSet",b.isRoot=!1,b.isArray=!0,b.parent=a,b.children=[],b.properties=d,a.children.push(b),c={},c.name="Representation",c.isRoot=!1,c.isArray=!0,c.parent=b,c.children=[],c.properties=d,b.children.push(c),a},h=function(a,b){return parseInt(a.Bitrate)-parseInt(b.Bitrate)},i=function(){var b,c,d,f,g,i,j,k,l,m;return m=[{name:"BaseURL",merge:!0,mergeFunction:function(a,b){var c;return c=0===b.indexOf("http://")?b:a+b}}],b={},b.name="mpd",b.isRoot=!0,b.isArray=!0,b.parent=null,b.children=[],b.properties=m,b.transformFunc=function(b){var c=0===b.Duration?1/0:b.Duration;if(this.isTransformed)return b;this.isTransformed=!0;var d={profiles:"urn:mpeg:dash:profile:isoff-live:2011",type:b.IsLive?"dynamic":"static",timeShiftBufferDepth:parseFloat(b.DVRWindowLength)/a,mediaPresentationDuration:parseFloat(c)/a,BaseURL:b.BaseURL,Period:b,Period_asArray:[b],minBufferTime:10};return void 0!==b.Protection&&(d.ContentProtection=b.Protection.ProtectionHeader,d.ContentProtection_asArray=b.Protection_asArray),d},b.isTransformed=!1,f={},f.name="ContentProtection",f.parent=b,f.isRoot=!1,f.isArray=!1,f.children=[],f.transformFunc=function(a){return a.pro={__text:a.__text,__prefix:"mspr"},"{"==a.SystemID[0]&&(a.SystemID=a.SystemID.substring(1,a.SystemID.length-1)),{schemeIdUri:"urn:uuid:"+a.SystemID,value:2,pro:a.pro,pro_asArray:a.pro}},b.children.push(f),c={},c.name="Period",c.isRoot=!1,c.isArray=!1,c.parent=null,c.children=[],c.properties=m,c.transformFunc=function(b){var c=0===b.Duration?1/0:b.Duration;return{duration:parseFloat(c)/a,BaseURL:b.BaseURL,AdaptationSet:b.StreamIndex,AdaptationSet_asArray:b.StreamIndex_asArray}},b.children.push(c),d={},d.name="AdaptationSet",d.isRoot=!1,d.isArray=!0,d.parent=c,d.children=[],d.properties=m,d.transformFunc=function(a){var b={id:a.Name,lang:a.Language,contentType:a.Type,mimeType:e[a.Type],maxWidth:a.MaxWidth,maxHeight:a.MaxHeight,BaseURL:a.BaseURL,Representation:a.QualityLevel,Representation_asArray:a.QualityLevel_asArray.sort(h),SegmentTemplate:a,SegmentTemplate_asArray:[a]};"audio"===a.Type&&(b.AudioChannelConfiguration=b,b.Channels=a.QualityLevel&&a.QualityLevel.Channels);for(var c=0;c<b.Representation_asArray.length;c++){var d=b.Representation_asArray[c];d.Id=b.id+"_"+d.Index}return b},c.children.push(d),g={},g.name="Representation",g.isRoot=!1,g.isArray=!0,g.parent=d,g.children=[],g.properties=m,g.transformFunc=function(a){var b="",c="";if("H264"===a.FourCC||"AVC1"===a.FourCC){b="avc1";var d=/00000001[0-9]7/.exec(a.CodecPrivateData);c=d&&d[0]?a.CodecPrivateData.substr(a.CodecPrivateData.indexOf(d[0])+10,6):void 0}else if(a.FourCC.indexOf("AAC")>=0){b="mp4a",c="40";var e=(248&parseInt(a.CodecPrivateData.toString().substr(0,2),16))>>3;c+="."+e}var f=b+"."+c;return{id:a.Id,bandwidth:a.Bitrate,width:a.MaxWidth,height:a.MaxHeight,codecs:f,audioSamplingRate:a.SamplingRate,codecPrivateData:""+a.CodecPrivateData,BaseURL:a.BaseURL}},d.children.push(g),k={},k.name="AudioChannelConfiguration",k.isRoot=!1,k.isArray=!1,k.parent=d,k.children=[],k.properties=m,k.transformFunc=function(a){return{schemeIdUri:"urn:mpeg:dash:23003:3:audio_channel_configuration:2011",value:a.Channels}},d.children.push(k),i={},i.name="SegmentTemplate",i.isRoot=!1,i.isArray=!1,i.parent=d,i.children=[],i.properties=m,i.transformFunc=function(b){var c=b.Url.replace("{bitrate}","$Bandwidth$");return c=c.replace("{start time}","$Time$"),{media:c,timescale:a,SegmentTimeline:b}},d.children.push(i),j={},j.name="SegmentTimeline",j.isRoot=!1,j.isArray=!1,j.parent=i,j.children=[],j.properties=m,j.transformFunc=function(a){if(a.c_asArray.length>1){var b=[],c=a.c_asArray;c[0].t=c[0].t||0,b.push({d:c[0].d,r:0,t:c[0].t});for(var d=1;d<c.length;d++)c[d].t=c[d].t||c[d-1].t+c[d-1].d,c[d].d===c[d-1].d?++b[b.length-1].r:b.push({d:c[d].d,r:0,t:c[d].t});a.c_asArray=b,a.c=b}return{S:a.c,S_asArray:a.c_asArray}},i.children.push(j),l={},l.name="S",l.isRoot=!1,l.isArray=!0,l.parent=j,l.children=[],l.properties=m,l.transformFunc=function(a){return{d:a.d,r:a.r?a.r:0,t:a.t?a.t:0}},j.children.push(l),b},j=function(){var a=[];return a.push(f()),a.push(g()),a.push(i()),a},k=function(b){var c,d,e=b.Period_asArray[0],f=e.AdaptationSet_asArray;if("dynamic"===b.type){var g=new Date;b.availabilityStartTime=new Date(g.getTime()-1e3*b.timeShiftBufferDepth)}for(e.start=0,c=0,d=f.length;d>c;c+=1){if("static"===b.type){var h=f[c].Representation_asArray[0].SegmentTemplate.SegmentTimeline.S_asArray[0],i=parseFloat(h.t)/a;e.start=0===e.start?i:Math.max(e.start,i)}void 0!==b.ContentProtection&&(b.Period.AdaptationSet[c].ContentProtection=b.ContentProtection,b.Period.AdaptationSet[c].ContentProtection_asArray=b.ContentProtection_asArray)}delete b.ContentProtection,delete b.ContentProtection_asArray},l=function(a,b){var c=null,e=new X2JS(d,"",!0),f=new Custom.utils.ObjectIron(j());return a=a.replace(/CodecPrivateData="/g,'CodecPrivateData="0x'),c=e.xml_str2json(a),null===c?(this.debug.error("[MssParser]","Failed to parse manifest!!"),Q.when(null)):(c.hasOwnProperty("BaseURL")?(c.BaseURL=c.BaseURL_asArray&&c.BaseURL_asArray[0]||c.BaseURL,0!==c.BaseURL.indexOf("http")&&(c.BaseURL=b+c.BaseURL)):c.BaseURL=b,c=f.run(c),k.call(this,c),Q.when(c))};return{debug:void 0,parse:l}},Mss.dependencies.MssParser.prototype={constructor:Mss.dependencies.MssParser},MediaPlayer.dependencies.AbrController=function(){"use strict";var a=!0,b={},c={},d=function(a){var c;return b.hasOwnProperty(a)||(b[a]=0),c=b[a]},e=function(a,c){b[a]=c},f=function(a){var b;return c.hasOwnProperty(a)||(c[a]=0),b=c[a]},g=function(a,b){c[a]=b};return{debug:void 0,abrRulesCollection:void 0,manifestExt:void 0,metricsModel:void 0,getAutoSwitchBitrate:function(){return a},setAutoSwitchBitrate:function(b){a=b},getMetricsFor:function(a){var b=Q.defer(),c=this;return c.manifestExt.getIsVideo(a).then(function(d){d?b.resolve(c.metricsModel.getMetricsFor("video")):c.manifestExt.getIsAudio(a).then(function(a){b.resolve(a?c.metricsModel.getMetricsFor("audio"):c.metricsModel.getMetricsFor("stream"))})}),b.promise},getPlaybackQuality:function(b,c){var h,i,j,k,l,m,n=this,o=Q.defer(),p=MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE,q=MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE,r=[];return l=d(b),m=f(b),a?n.getMetricsFor(c).then(function(a){n.abrRulesCollection.getRules().then(function(d){for(h=0,i=d.length;i>h;h+=1)r.push(d[h].checkIndex(l,a,c));Q.all(r).then(function(a){for(k={},k[MediaPlayer.rules.SwitchRequest.prototype.STRONG]=MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE,k[MediaPlayer.rules.SwitchRequest.prototype.WEAK]=MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE,k[MediaPlayer.rules.SwitchRequest.prototype.DEFAULT]=MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE,h=0,i=a.length;i>h;h+=1)j=a[h],j.quality!==MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE&&(k[j.priority]=Math.min(k[j.priority],j.quality));k[MediaPlayer.rules.SwitchRequest.prototype.WEAK]!==MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE&&(q=MediaPlayer.rules.SwitchRequest.prototype.WEAK,p=k[MediaPlayer.rules.SwitchRequest.prototype.WEAK]),k[MediaPlayer.rules.SwitchRequest.prototype.DEFAULT]!==MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE&&(q=MediaPlayer.rules.SwitchRequest.prototype.DEFAULT,p=k[MediaPlayer.rules.SwitchRequest.prototype.DEFAULT]),k[MediaPlayer.rules.SwitchRequest.prototype.STRONG]!==MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE&&(q=MediaPlayer.rules.SwitchRequest.prototype.STRONG,p=k[MediaPlayer.rules.SwitchRequest.prototype.STRONG]),p!==MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE&&void 0!==p&&(l=p),q!==MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE&&void 0!==q&&(m=q),n.manifestExt.getRepresentationCount(c).then(function(a){0>l&&(l=0),l>=a&&(l=a-1),m!=MediaPlayer.rules.SwitchRequest.prototype.STRONG&&m!=MediaPlayer.rules.SwitchRequest.prototype.WEAK&&(m=MediaPlayer.rules.SwitchRequest.prototype.DEFAULT),e(b,l),g(b,m),o.resolve({quality:l,confidence:m})})})})}):o.resolve({quality:l,confidence:m}),o.promise},setPlaybackQuality:function(a,b){var c=d(a);b!==c&&e(a,b)},getQualityFor:function(a){return d(a)}}},MediaPlayer.dependencies.AbrController.prototype={constructor:MediaPlayer.dependencies.AbrController},MediaPlayer.dependencies.BufferController=function(){"use strict";var a,b,c,d,e,f,g,h=.5,i=22,j="WAITING",k="READY",l="VALIDATING",m="LOADING",n=j,o=!1,p=!1,q=!1,r=!0,s=[],t=!1,u=-1,v=!0,w=!1,x=-1,y=!1,z=!1,A=!1,B=null,C=null,D=Q.defer(),E=null,F=null,G=null,H=0,I=null,J=0,K=!1,L=null,M=0,N=null,O=null,P=null,R=null,S=!1,T=null,U=null,V=null,W=null,X=!0,Y=function(a){n=a,null!==I&&this.fragmentController.onBufferControllerStateChange()},Z=function(a,b){},$=function(){o&&p&&(Y.call(this,k),this.requestScheduler.startScheduling(this,Bb),I=this.fragmentController.attachBufferController(this))},_=function(){var a;this.requestScheduler.isScheduled(this)||(t===!1&&(a=new Date,Z(a,MediaPlayer.vo.metrics.PlayList.Trace.USER_REQUEST_STOP_REASON),V=this.metricsModel.addPlayList(f,a,0,MediaPlayer.vo.metrics.PlayList.INITIAL_PLAY_START_REASON)),p=!0,q=!0,$.call(this))},ab=function(a){var b;t=!0,u=a,b=new Date,Z(b,MediaPlayer.vo.metrics.PlayList.Trace.USER_REQUEST_STOP_REASON),V=this.metricsModel.addPlayList(f,b,u,MediaPlayer.vo.metrics.PlayList.SEEK_START_REASON),_.call(this)},bb=function(){n!==j&&(Y.call(this,j),this.requestScheduler.stopScheduling(this),this.fragmentController.cancelPendingRequestsForModel(I),p=!1,q=!1,Z(new Date,MediaPlayer.vo.metrics.PlayList.Trace.USER_REQUEST_STOP_REASON))},cb=function(a,b){var c=this,d=Q.defer(),e=c.manifestModel.getValue();return c.manifestExt.getDataIndex(a,e,b.index).then(function(a){c.manifestExt.getAdaptationsForPeriod(e,b).then(function(b){c.manifestExt.getRepresentationsForAdaptation(e,b[a]).then(function(a){d.resolve(a)})})}),d.promise},db=function(b){return a[b]},eb=function(){n===m&&(y&&(y=!1,this.videoModel.stallStream(f,y)),Y.call(this,k))},fb=function(a){if(this.fragmentController.isInitializationRequest(a))Y.call(this,k);else{Y.call(this,m);var b=this.fragmentController.getLoadingTime(this),c=function(){(T||U)&&(Y.call(this,k),Ab.call(this))};setTimeout(c.bind(this),b)}},gb=function(a,b){this.fragmentController.isInitializationRequest(a)?mb.call(this,a,b):hb.call(this,a,b)},hb=function(b,c){var d=this;M||isNaN(b.duration)||(M=b.duration),d.fragmentController.process(c.data,b,a).then(function(a){if(null!==a&&null!==C){if(b.quality!==x)return void d.fragmentController.removeExecutedRequest(I,b);C.promise.then(function(){ib.call(d,a,b.quality).then(function(){z||D.promise.then(function(a){a.index-1!==b.index||A||(A=!0,Y.call(d,k),d.system.notify("bufferingCompleted"))})})})}})},ib=function(a,c){var e=this,f=a==L,g=f?E:Q.defer(),h=e.videoModel.getCurrentTime(),k=new Date;return X===!0&&n!==j&&-1!==x&&(X=!1,W=e.metricsModel.appendPlayListTrace(V,b.id,null,k,h,null,1,null)),Q.when(f||!B||B.promise).then(function(){U&&lb.call(e).then(function(){return c!==x?(g.resolve(),void(f&&(E=null,L=null))):void Q.when(F?F.promise:!0).then(function(){e.sourceBufferExt.append(U,a,e.videoModel).then(function(){f&&(E=null,L=null),n===j&&g===B&&_.call(e),K=!1;var a=function(){jb.call(e).then(function(){g.resolve()})};z?(e.fragmentController.removeExecutedRequestsBeforeTime(I,e.videoModel.getCurrentTime()-4),e.sourceBufferExt.remove(U,0,e.videoModel.getCurrentTime()-4,G.duration,d).then(function(){a()})):a(),!U},function(b){b.err.code===i&&(L=a,E=g,K=!0,N=e.videoModel.getCurrentTime(),H=0,bb.call(e))})})})}),B=g,g.promise},jb=function(){if(!T&&!U)return Q.when(!1);var a=this,b=Q.defer(),c=yb.call(a);return a.sourceBufferExt.getBufferLength(U,c).then(function(c){J=c,a.metricsModel.addBufferLevel(f,new Date,J),kb.call(a),xb.call(a),b.resolve()}),b.promise},kb=function(){var a=this.bufferExt.getLeastBufferLevel(),b=2*M,c=J-a;c>b&&!F?(H=0,F=Q.defer()):b>c&&F&&(F.resolve(),F=null)},lb=function(){var a,b,c=this,e=Q.defer(),f=c.videoModel.getCurrentTime(),g=0;return K?(b=c.fragmentController.getExecutedRequestForTime(I,f),a=b&&!isNaN(b.startTime)?b.startTime:Math.floor(f),M=b&&!isNaN(b.duration)?b.duration:1,c.sourceBufferExt.getBufferRange(U,f).then(function(b){null===b&&u===f&&U.buffered.length>0&&(a=U.buffered.end(U.buffered.length-1)),c.sourceBufferExt.remove(U,g,a,G.duration,d).then(function(){c.fragmentController.removeExecutedRequestsBeforeTime(I,a),e.resolve()})}),e.promise):Q.when(!0)},mb=function(a,b){var c=this,d=b.data,e=a.quality;c.fragmentController.process(d).then(function(b){null!==b&&(s[e]=b,e===x&&ib.call(c,b,a.quality).then(function(){C.resolve()}))})},nb=function(){n===m&&Y.call(this,k),this.system.notify("segmentLoadingFailed")},ob=function(){var a=this,c=b.segmentAvailabilityRange,d=43200;return P=c.end,O={start:Math.max(0,P-d),end:P+d},R=Math.floor((c.end-c.start)/2),a.indexHandler.getSegmentRequestForTime(b,P).then(pb.bind(a,P)),e=Q.defer(),e.promise},pb=function(a,c){var d=this;null===c?(b.segments=null,b.segmentAvailabilityRange={start:a-R,end:a+R},d.indexHandler.getSegmentRequestForTime(b,a).then(pb.bind(d,a))):d.fragmentController.isFragmentExists(c).then(function(a){a?rb.call(d,c):qb.call(d,c)})},qb=function(a){var c,d,e=a.startTime;return S?void sb.call(this,!1,e):(d=e-P,c=d>0?P-d:P+Math.abs(d)+R,void(c<O.start&&c>O.end?this.system.notify("segmentLoadingFailed"):(Y.call(this,k),this.indexHandler.getSegmentRequestForTime(b,c).then(pb.bind(this,c)))))},rb=function(a){var b=a.startTime;if(!S){if(0===M)return void e.resolve(b);S=!0,O.end=b+2*R}sb.call(this,!0,b)},sb=function(a,c){var d,f;a?O.start=c:O.end=c,d=Math.floor(O.end-O.start)<=M,d?e.resolve(a?c:c-M):(f=(O.start+O.end)/2,this.indexHandler.getSegmentRequestForTime(b,f).then(pb.bind(this,f)))},tb=function(a){Z(new Date,MediaPlayer.vo.metrics.PlayList.Trace.END_OF_CONTENT_STOP_REASON),bb.call(this),D.resolve(a)},ub=function(b,c){if(v&&w)return Q.when(null);var d,e=null,g=this.bufferExt.getTopQualityIndex(f),h=[];if(r&&(t||(t=!0,u=0),r=!1),v){for(C=Q.defer(),s=[],w=!0,d=0;g>=d;d+=1)h.push(this.indexHandler.getInitRequest(a[d]));x=c,e=Q.all(h)}else e=Q.when(null),b&&(C=Q.defer(),x=c,s[c]&&ib.call(this,s[c],c).then(function(){C.resolve()}));return e},vb=function(){var a,d=this;if(v&&!t)a=d.indexHandler.getSegmentRequestForTime(b,c);else{var e=Q.defer(),f=d.videoModel.getCurrentTime();a=e.promise,d.sourceBufferExt.getBufferRange(U,f).then(function(a){return Q.when(t?u:d.indexHandler.getCurrentTime(b)).then(function(c){f=c,t=!1,null!==a&&(f=a.end),d.indexHandler.getSegmentRequestForTime(b,f).then(function(a){e.resolve(a)},function(){e.reject()})},function(){e.reject()})},function(){e.reject()})}return a},wb=function(a){var c=this;null!==a?this.fragmentController.isFragmentLoadedOrPending(this,a)?"complete"!==a.action?this.indexHandler.getNextSegmentRequest(b).then(wb.bind(this)):(bb.call(this),Y.call(this,k),a=null):Q.when(F?F.promise:!0).then(function(){c.fragmentController.prepareFragmentForLoading(c,a,fb,gb,nb,tb).then(function(){Y.call(c,k)})}):(Y.call(c,k),a=null)},xb=function(){q&&(J<MediaPlayer.dependencies.BufferExtensions.START_TIME?y||(y=!0,this.videoModel.stallStream(f,y)):(q=!1,y=!1,this.videoModel.stallStream(f,y)))},yb=function(){var a=-1;return a=this.videoModel.getCurrentTime()},zb=function(){var a=this,c=a.videoModel.getPlaybackRate(),d=J/Math.max(c,1),e=Q.defer();return a.bufferExt.getRequiredBufferLength(q,a.requestScheduler.getExecuteInterval(a)/1e3,z,G.duration).then(function(c){a.indexHandler.getSegmentCountForDuration(b,c,d).then(function(a){e.resolve(a)})}),e.promise},Ab=function(){var a=this,b=a.fragmentController.getPendingRequests(a),c=a.fragmentController.getLoadingRequests(a),d=(b?b.length:0)+(c?c.length:0);H-d>0?(H--,vb.call(a).then(wb.bind(a))):(n===l&&Y.call(a,k),eb.call(a))},Bb=function(){{var a,c=this,d=!1,e=new Date,g=c.videoModel.getCurrentTime();yb.call(c)}if(xb.call(c),n===m&&h>J)y||(Z(new Date,MediaPlayer.vo.metrics.PlayList.Trace.REBUFFERING_REASON),y=!0,q=!0,c.videoModel.stallStream(f,y));else if(n===k){Y.call(c,l);var i=c.manifestModel.getValue().minBufferTime;c.bufferExt.decideBufferLength(i,G.duration,q).then(function(a){c.setMinBufferTime(a),c.requestScheduler.adjustExecuteInterval()}),c.abrController.getPlaybackQuality(f,T).then(function(h){var i=h.quality;if(void 0!==i&&(a=i),d=i!==x,d===!0){if(c.fragmentController.abortRequestsForModel(I),b=db.call(c,a),null===b||void 0===b)throw"Unexpected error!";U.timestampOffset!==b.MSETimeOffset&&(U.timestampOffset=b.MSETimeOffset),Z(new Date,MediaPlayer.vo.metrics.PlayList.Trace.REPRESENTATION_SWITCH_STOP_REASON),c.metricsModel.addRepresentationSwitch(f,e,g,b.id)}return zb.call(c,i)}).then(function(b){H=b,w||(ub.call(c,d,a).then(function(a){if(null!==a){var b,d,e=a.length;for(w=!1,d=0;e>d;d+=1)b=a[d],c.fragmentController.prepareFragmentForLoading(c,b,fb,gb,nb,tb).then(function(){Y.call(c,k)});v=!1}}),Ab.call(c))})}else n===l&&Y.call(c,k)};return{videoModel:void 0,metricsModel:void 0,manifestExt:void 0,manifestModel:void 0,bufferExt:void 0,sourceBufferExt:void 0,abrController:void 0,fragmentExt:void 0,indexHandler:void 0,debug:void 0,system:void 0,errHandler:void 0,initialize:function(a,b,c,d,e,f,h,i){var j=this,k=j.manifestModel.getValue();z=j.manifestExt.getIsDynamic(k),j.setMediaSource(i),j.setVideoModel(e),j.setType(a),j.updateData(c,b).then(function(){return z?void("video"===j.getData().contentType?ob.call(j).then(function(a){b.liveEdge=a-g,o=!0,j.system.notify("liveEdgeFound")}):o=!0):(o=!0,void $.call(j))}),j.setBuffer(d),j.setScheduler(f),j.setFragmentController(h),j.indexHandler.setIsDynamic(z),j.bufferExt.decideBufferLength(k.minBufferTime,b,q).then(function(a){j.setMinBufferTime(a)})},getType:function(){return f},setType:function(a){f=a,void 0!==this.indexHandler&&this.indexHandler.setType(a)},getPeriodInfo:function(){return G},getVideoModel:function(){return this.videoModel},setVideoModel:function(a){this.videoModel=a},getScheduler:function(){return this.requestScheduler},setScheduler:function(a){this.requestScheduler=a},getFragmentController:function(){return this.fragmentController},setFragmentController:function(a){this.fragmentController=a},getAutoSwitchBitrate:function(){var a=this;return a.abrController.getAutoSwitchBitrate()},setAutoSwitchBitrate:function(a){this.abrController.setAutoSwitchBitrate(a)},getData:function(){return T},updateData:function(d,e,g){var h=this,i=Q.defer(),j=T;return j||(j=d),bb.call(h),cb.call(h,d,e).then(function(k){a=k,G=e,h.abrController.getPlaybackQuality(f,j).then(function(a){b||(b=db.call(h,a.quality));var e=function(e){v=!0,c=e,b=db.call(h,a.quality),b.segmentDuration&&(M=b.segmentDuration),T=d,h.seek(e),h.bufferExt.updateData(T,f),$.call(h),i.resolve()};g?e(g):h.indexHandler.getCurrentTime(b).then(e)})}),i.promise},getBuffer:function(){return U},setBuffer:function(a){U=a},getMinBufferTime:function(){return g},setMinBufferTime:function(a){g=a},setMediaSource:function(a){d=a},isReady:function(){return n===k},isBufferingCompleted:function(){return A},clearMetrics:function(){null!==f&&""!==f&&this.metricsModel.clearCurrentMetricsForType(f)},updateBufferState:function(){var a=this.videoModel.getCurrentTime();K&&L&&Math.abs(a-(t?u:N))>M?(N=this.videoModel.getCurrentTime(),ib.call(this,L)):jb.call(this)},updateStalledState:function(){y=this.videoModel.isStalled(),xb.call(this)},reset:function(a){bb.call(this),this.clearMetrics(),this.fragmentController.abortRequestsForModel(I),this.fragmentController.detachBufferController(I),I=null,B=null,C=null,s=[],D=Q.defer(),O=null,P=null,S=!1,R=null,e=null,a||(this.sourceBufferExt.abort(d,U),this.sourceBufferExt.removeSourceBuffer(d,U)),T=null,U=null},start:_,seek:ab,stop:bb}},MediaPlayer.dependencies.BufferController.prototype={constructor:MediaPlayer.dependencies.BufferController},MediaPlayer.dependencies.BufferExtensions=function(){"use strict";var a,b,c=0,d=0,e=null,f=null,g=function(a){var b=this.metricsExt.getCurrentHttpRequest(a);return null!==b?(b.tresponse.getTime()-b.trequest.getTime())/1e3:0},h=function(){var a,b=this,g=Q.defer();return Q.when(e?b.abrController.getPlaybackQuality("audio",e):c).then(function(e){Q.when(f?b.abrController.getPlaybackQuality("video",f):d).then(function(b){a=e.quality===c&&b.quality===d,a=a||e.confidence===MediaPlayer.rules.SwitchRequest.prototype.STRONG&&b.confidence===MediaPlayer.rules.SwitchRequest.prototype.STRONG,g.resolve(a)})}),g.promise};return{system:void 0,videoModel:void 0,manifestExt:void 0,metricsExt:void 0,metricsModel:void 0,abrController:void 0,bufferMax:void 0,updateData:function(a,b){var g=a.Representation_asArray.length-1;"audio"===b?(c=g,e=a):"video"===b&&(d=g,f=a)},getTopQualityIndex:function(a){var b=null;return"audio"===a?b=c:"video"===a&&(b=d),b},decideBufferLength:function(b,c){return a=isNaN(c)||MediaPlayer.dependencies.BufferExtensions.DEFAULT_MIN_BUFFER_TIME<c&&c>b?Math.max(MediaPlayer.dependencies.BufferExtensions.DEFAULT_MIN_BUFFER_TIME,b):b>=c?Math.min(c,MediaPlayer.dependencies.BufferExtensions.DEFAULT_MIN_BUFFER_TIME):Math.min(c,b),Q.when(a)},getLeastBufferLevel:function(){var a=this.metricsModel.getReadOnlyMetricsFor("video"),b=this.metricsExt.getCurrentBufferLevel(a),c=this.metricsModel.getReadOnlyMetricsFor("audio"),d=this.metricsExt.getCurrentBufferLevel(c),e=null;return e=null===b||null===d?null!==d?d.level:null!==b?b.level:null:Math.min(d.level,b.level)},getRequiredBufferLength:function(c,d,e,f){var i,j=this,k=j.metricsModel.getReadOnlyMetricsFor("video"),l=j.metricsModel.getReadOnlyMetricsFor("audio"),m=f>=MediaPlayer.dependencies.BufferExtensions.LONG_FORM_CONTENT_DURATION_THRESHOLD,n=Q.defer(),o=null;return j.bufferMax===MediaPlayer.dependencies.BufferExtensions.BUFFER_SIZE_MIN?(i=a,n.resolve(i)):j.bufferMax===MediaPlayer.dependencies.BufferExtensions.BUFFER_SIZE_INFINITY?(i=f,n.resolve(i)):j.bufferMax===MediaPlayer.dependencies.BufferExtensions.BUFFER_SIZE_REQUIRED?(b=a,e||c||(o=h.call(j)),Q.when(o).then(function(a){a&&(b=m?MediaPlayer.dependencies.BufferExtensions.BUFFER_TIME_AT_TOP_QUALITY_LONG_FORM:MediaPlayer.dependencies.BufferExtensions.BUFFER_TIME_AT_TOP_QUALITY),i=b+d+Math.max(g.call(j,k),g.call(j,l)),n.resolve(i)})):n.reject("invalid bufferMax value: "+j.bufferMax),n.promise},getBufferTarget:function(){return void 0===b?a:b}}},MediaPlayer.dependencies.BufferExtensions.BUFFER_SIZE_REQUIRED="required",MediaPlayer.dependencies.BufferExtensions.BUFFER_SIZE_MIN="min",MediaPlayer.dependencies.BufferExtensions.BUFFER_SIZE_INFINITY="infinity",MediaPlayer.dependencies.BufferExtensions.BUFFER_TIME_AT_STARTUP=1,MediaPlayer.dependencies.BufferExtensions.DEFAULT_MIN_BUFFER_TIME=8,MediaPlayer.dependencies.BufferExtensions.START_TIME=2,MediaPlayer.dependencies.BufferExtensions.BUFFER_TIME_AT_TOP_QUALITY=30,MediaPlayer.dependencies.BufferExtensions.BUFFER_TIME_AT_TOP_QUALITY_LONG_FORM=300,MediaPlayer.dependencies.BufferExtensions.LONG_FORM_CONTENT_DURATION_THRESHOLD=600,MediaPlayer.dependencies.BufferExtensions.prototype.constructor=MediaPlayer.dependencies.BufferExtensions,MediaPlayer.utils.Capabilities=function(){"use strict"},MediaPlayer.utils.Capabilities.prototype={constructor:MediaPlayer.utils.Capabilities,supportsMediaSource:function(){"use strict";var a="WebKitMediaSource"in window,b="MediaSource"in window;return a||b},supportsMediaKeys:function(){"use strict";var a="WebKitMediaKeys"in window,b="MSMediaKeys"in window,c="MediaKeys"in window;return a||b||c},supportsCodec:function(a,b){"use strict";if(!(a instanceof HTMLVideoElement))throw"element must be of type HTMLVideoElement.";var c=a.canPlayType(b);return"probably"===c}},MediaPlayer.utils.Debug=function(){"use strict";var a=!0,b=function(){if(a){var b="undefined"!=typeof log4javascript?log4javascript.getLogger():null;if(b){if(!b.initialized){var c=new log4javascript.PopUpAppender,d=new log4javascript.PatternLayout("%d{HH:mm:ss.SSS} %-5p - %m%n");c.setLayout(d),b.addAppender(c),b.setLevel(log4javascript.Level.ALL),b.initialized=!0}b.info.apply(b,arguments)}else console.log.apply(console,arguments)}this.eventBus.dispatchEvent({type:"log",message:arguments[0]})};return{eventBus:void 0,setLogToBrowserConsole:function(b){a=b},getLogToBrowserConsole:function(){return a},log:b}},MediaPlayer.dependencies.ErrorHandler=function(){"use strict";return{eventBus:void 0,capabilityError:function(a){this.eventBus.dispatchEvent({type:"error",error:"capability",event:a})},downloadError:function(a,b,c){this.eventBus.dispatchEvent({type:"error",error:"download",event:{id:a,url:b,request:c}})},manifestError:function(a,b,c){this.eventBus.dispatchEvent({type:"error",error:"manifestError",event:{message:a,id:b,manifest:c}})},mediaSourceError:function(a){this.eventBus.dispatchEvent({type:"error",error:"mediasource",event:a})},mediaKeySessionError:function(a){this.eventBus.dispatchEvent({type:"error",error:"key_session",event:a})},mediaKeyMessageError:function(a){this.eventBus.dispatchEvent({type:"error",error:"key_message",event:a})},mediaKeySystemSelectionError:function(a){this.eventBus.dispatchEvent({type:"error",error:"key_system_selection",event:a})}}},MediaPlayer.dependencies.ErrorHandler.prototype={constructor:MediaPlayer.dependencies.ErrorHandler},MediaPlayer.utils.EventBus=function(){"use strict";var a,b=function(b,c){var d=(c?"1":"0")+b;
return d in a||(a[d]=[]),a[d]},c=function(){a={}};return c(),{addEventListener:function(a,c,d){var e=b(a,d),f=e.indexOf(c);-1===f&&e.push(c)},removeEventListener:function(a,c,d){var e=b(a,d),f=e.indexOf(c);-1!==f&&e.splice(f,1)},dispatchEvent:function(a){for(var c=b(a.type,!1).slice(),d=0;d<c.length;d++)c[d].call(this,a);return!a.defaultPrevented}}},MediaPlayer.dependencies.FragmentController=function(){"use strict";var a=[],b=function(b){for(var c=a.length,d=0;c>d;d++)if(a[d].getContext()==b)return a[d];return null},c=function(){for(var b=!0,c=a.length,d=0;c>d;d++)if(!a[d].isReady()){b=!1;break}return b},d=function(){for(var b=0;b<a.length;b++)a[b].executeCurrentRequest()};return{system:void 0,debug:void 0,fragmentLoader:void 0,process:function(a){var b=null;return null!==a&&void 0!==a&&a.byteLength>0&&(b=new Uint8Array(a)),Q.when(b)},attachBufferController:function(c){if(!c)return null;var d=b(c);return d||(d=this.system.getObject("fragmentModel"),d.setContext(c),a.push(d)),d},detachBufferController:function(b){var c=a.indexOf(b);c>-1&&a.splice(c,1)},onBufferControllerStateChange:function(){c()&&d.call(this)},isFragmentLoadedOrPending:function(a,c){var d,e=b(a);return e?d=e.isFragmentLoadedOrPending(c):!1},getPendingRequests:function(a){var c=b(a);return c?c.getPendingRequests():null},getLoadingRequests:function(a){var c=b(a);return c?c.getLoadingRequests():null},isInitializationRequest:function(a){return a&&a.type&&"initialization segment"===a.type.toLowerCase()},getLoadingTime:function(a){var c=b(a);return c?c.getLoadingTime():null},getExecutedRequestForTime:function(a,b){return a?a.getExecutedRequestForTime(b):null},removeExecutedRequest:function(a,b){a&&a.removeExecutedRequest(b)},removeExecutedRequestsBeforeTime:function(a,b){a&&a.removeExecutedRequestsBeforeTime(b)},cancelPendingRequestsForModel:function(a){a&&a.cancelPendingRequests()},abortRequestsForModel:function(a){a&&a.abortRequests()},isFragmentExists:function(a){var b=Q.defer();return this.fragmentLoader.checkForExistence(a).then(function(){b.resolve(!0)},function(){b.resolve(!1)}),b.promise},prepareFragmentForLoading:function(a,c,d,e,f,g){var h=b(a);return h&&c?(h.addRequest(c),h.setCallbacks(d,e,f,g),Q.when(!0)):Q.when(null)}}},MediaPlayer.dependencies.FragmentController.prototype={constructor:MediaPlayer.dependencies.FragmentController},MediaPlayer.dependencies.FragmentLoader=function(){"use strict";var a=3,b=500,c=[],d=null,e=function(a,f){var g=new XMLHttpRequest,h=null,i=!0,j=!0,k=this;c.push(g),a.requestStartDate=new Date,a.firstByteDate=a.requestStartDate,g.open("GET",a.url,!0),g.responseType="arraybuffer",d!=a.quality&&(d=a.quality,this.metricsModel.addDownloadSwitch(a.streamType,a.startTime,a.requestStartDate,a.quality)),a.range&&g.setRequestHeader("Range","bytes="+a.range),g.onprogress=function(b){i&&(i=!1,(!b.lengthComputable||b.lengthComputable&&b.total!=b.loaded)&&(a.firstByteDate=new Date))},g.onload=function(){if(!(g.status<200||g.status>299)){j=!1,a.requestEndDate=new Date;var b=a.requestEndDate,c=g.response,d=(a.firstByteDate.getTime()-a.requestStartDate.getTime(),a.requestEndDate.getTime()-a.firstByteDate.getTime(),a.requestEndDate.getTime()-a.requestStartDate.getTime());h=k.metricsModel.addHttpRequest(a.streamType,null,a.type,a.url,null,a.range,a.requestStartDate,a.firstByteDate,a.requestEndDate,g.status,null,a.duration),k.metricsModel.appendHttpTrace(h,b,(new Date).getTime()-b.getTime(),[c.byteLength]),k.metricsModel.setBandwidthValue(a.streamType,8*c.byteLength/d),a.deferred.resolve({data:c,request:a})}},g.onloadend=g.onerror=function(){if(-1!==c.indexOf(g)&&(c.splice(c.indexOf(g),1),j)){j=!1,a.requestEndDate=new Date;{a.firstByteDate.getTime()-a.requestStartDate.getTime(),a.requestEndDate.getTime()-a.firstByteDate.getTime(),a.requestEndDate.getTime()-a.requestStartDate.getTime()}h=k.metricsModel.addHttpRequest(a.streamType,null,a.type,a.url,null,a.range,a.requestStartDate,a.firstByteDate,a.requestEndDate,g.status,null,a.duration),f>0?(f--,setTimeout(function(){e.call(k,a,f)},b)):(k.errHandler.downloadError("content",a.url,g),a.deferred.reject(g))}},g.send()},f=function(a,c){var d=new XMLHttpRequest,e=!1,g=this;d.open("HEAD",a.url,!0),d.onload=function(){d.status<200||d.status>299||(e=!0,a.deferred.resolve(a))},d.onloadend=d.onerror=function(){e||(c>0?(c--,setTimeout(function(){f.call(g,a,c)},b)):a.deferred.reject(d))},d.send()};return{metricsModel:void 0,errHandler:void 0,debug:void 0,load:function(b){return b?(b.deferred=Q.defer(),e.call(this,b,a),b.deferred.promise):Q.when(null)},checkForExistence:function(b){return b?(b.deferred=Q.defer(),f.call(this,b,a),b.deferred.promise):Q.when(null)},abort:function(){var a,b,d=c.length;for(a=0;d>a;a+=1)b=c[a],c[a]=null,b.abort(),b=null;c=[]}}},MediaPlayer.dependencies.FragmentLoader.prototype={constructor:MediaPlayer.dependencies.FragmentLoader},MediaPlayer.dependencies.FragmentModel=function(){"use strict";var a,b,c,d,e,f=[],g=[],h=[],i=5,j=function(e){var g,i,j=this;b.call(a,e),g=function(b,d){h.splice(h.indexOf(b),1),f.push(b),c.call(a,b,d),b.deferred=null},i=function(b){h.splice(h.indexOf(b),1),d.call(a,b),b.deferred=null},j.fragmentLoader.load(e).then(g.bind(a,e),i.bind(a,e))},k=function(a){var b=f.indexOf(a);-1!==b&&f.splice(b,1)};return{system:void 0,debug:void 0,fragmentLoader:void 0,setContext:function(b){a=b},getContext:function(){return a},addRequest:function(a){a&&g.push(a)},setCallbacks:function(a,f,g,h){b=a,e=h,d=g,c=f},isFragmentLoadedOrPending:function(a){for(var b,c=!1,d=f.length,e=0;d>e;e++)if(b=f[e],a.startTime===b.startTime||"complete"===b.action&&a.action===b.action){if(a.url===b.url){c=!0;break}k(a)}if(!c)for(e=0,d=g.length;d>e;e+=1)b=g[e],a.url===b.url&&a.startTime===b.startTime&&(c=!0);if(!c)for(e=0,d=h.length;d>e;e+=1)b=h[e],a.url===b.url&&a.startTime===b.startTime&&(c=!0);return c},isReady:function(){return a.isReady()},getPendingRequests:function(){return g},getLoadingRequests:function(){return h},getLoadingTime:function(){var a,b,c=0;for(b=f.length-1;b>=0;b-=1)if(a=f[b],a.requestEndDate instanceof Date&&a.firstByteDate instanceof Date){c=a.requestEndDate.getTime()-a.firstByteDate.getTime();break}return c},getExecutedRequestForTime:function(a){var b,c=f.length-1,d=0/0,e=0/0,g=null;for(b=c;b>=0;b-=1)if(g=f[b],d=g.startTime,e=d+g.duration,!isNaN(d)&&!isNaN(e)&&a>d&&e>a)return g;return null},removeExecutedRequest:function(a){k.call(this,a)},removeExecutedRequestsBeforeTime:function(a){var b,c=f.length-1,d=0/0,e=null;for(b=c;b>=0;b-=1)e=f[b],d=e.startTime,!isNaN(d)&&a>d&&k.call(this,e)},cancelPendingRequests:function(){g=[]},abortRequests:function(){this.fragmentLoader.abort(),h=[]},executeCurrentRequest:function(){var b,c=this;if(0!==g.length&&!(h.length>=i))switch(b=g.shift(),b.action){case"complete":f.push(b),e.call(a,b);break;case"download":h.push(b),j.call(c,b)}}}},MediaPlayer.dependencies.FragmentModel.prototype={constructor:MediaPlayer.dependencies.FragmentModel},MediaPlayer.utils.Logger=function(){"use strict";var a="undefined"!=typeof log4javascript?log4javascript.getLogger():null,b=null,c=!0,d=function(){a?a.debug.apply(a,arguments):console.debug.apply(console,arguments)},e=function(){a?a.error.apply(a,arguments):console.error.apply(console,arguments)},f=function(){if("undefined"!=typeof log4javascript){b=new log4javascript.PopUpAppender;var c=new log4javascript.PatternLayout("%d{HH:mm:ss.SSS} %-5p - %m%n");b.setLayout(c),a.addAppender(b),a.setLevel(log4javascript.Level.ALL)}},g=function(){a?a.info.apply(a,arguments):console.info.apply(console,arguments)},h=function(){a?a.trace.apply(a,arguments):console.trace.apply(console,arguments)};return{debug:d,error:e,addAppender:f,info:g,trace:h,eventBus:void 0,setLogToBrowserConsole:function(a){c=a},getLogToBrowserConsole:function(){return c},log:function(a){this.eventBus.dispatchEvent({type:"log",message:a})}}},MediaPlayer.utils.Logger.prototype={constructor:MediaPlayer.utils.Logger},MediaPlayer.dependencies.ManifestLoader=function(){"use strict";var a=3,b=500,c=null,d=function(a){var b=null;return-1!==a.indexOf("/")&&(b=a.substring(0,a.lastIndexOf("/")+1)),b},e=function(a,f){var g=d(a),h=new XMLHttpRequest,i=new Date,j=null,k=!0,l=this;h.open("GET",a,!0),h.onload=function(){h.status<200||h.status>299||(k=!1,j=new Date,l.metricsModel.addHttpRequest("stream",null,"MPD",a,null,null,i,j,h.status,null,null),l.parser.parse(h.responseText,g).then(function(b){b.mpdUrl=a,b.mpdLoadedTime=j,c.resolve(b)},function(){c.reject(h)}))},h.onloadend=h.onerror=function(){k&&(k=!1,l.metricsModel.addHttpRequest("stream",null,"MPD",a,null,null,i,new Date,h.status,null,null),f>0?(f--,setTimeout(function(){e.call(l,a,f)},b)):(l.errHandler.downloadError("manifest",a,h),c.reject(h)))},h.send()};return{debug:void 0,parser:void 0,errHandler:void 0,metricsModel:void 0,load:function(b){return c=Q.defer(),e.call(this,b,a),c.promise}}},MediaPlayer.dependencies.ManifestLoader.prototype={constructor:MediaPlayer.dependencies.ManifestLoader},MediaPlayer.models.ManifestModel=function(){"use strict";var a;return{system:void 0,getValue:function(){return a},setValue:function(b){a=b,this.system.notify("manifestUpdated")}}},MediaPlayer.models.ManifestModel.prototype={constructor:MediaPlayer.models.ManifestModel},MediaPlayer.dependencies.ManifestUpdater=function(){"use strict";var a,b=0/0,c=null,d=function(){null!==c&&(clearInterval(c),c=null)},e=function(){d.call(this),isNaN(b)||(c=setInterval(g.bind(this),1e3*b,this))},f=function(){var a=this,c=a.manifestModel.getValue();void 0!==c&&null!==c&&a.manifestExt.getRefreshDelay(c).then(function(c){b=c,e.call(a)})},g=function(){var b,c,d=this;Q.when(a?a.promise:!0).then(function(){a=Q.defer(),b=d.manifestModel.getValue(),c=b.mpdUrl,b.hasOwnProperty("Location")&&(c=b.Location),d.manifestLoader.load(c).then(function(a){d.manifestModel.setValue(a),f.call(d)})})},h=function(){a&&a.resolve()};return{debug:void 0,system:void 0,manifestModel:void 0,manifestExt:void 0,manifestLoader:void 0,setup:function(){f.call(this),this.system.mapHandler("streamsComposed",void 0,h.bind(this))},init:function(){f.call(this)},stop:function(){d.call(this)}}},MediaPlayer.dependencies.ManifestUpdater.prototype={constructor:MediaPlayer.dependencies.ManifestUpdater},MediaPlayer.dependencies.MediaSourceExtensions=function(){"use strict"},MediaPlayer.dependencies.MediaSourceExtensions.prototype={constructor:MediaPlayer.dependencies.MediaSourceExtensions,createMediaSource:function(){"use strict";var a="WebKitMediaSource"in window,b="MediaSource"in window;return b?Q.when(new MediaSource):a?Q.when(new WebKitMediaSource):null},attachMediaSource:function(a,b){"use strict";return b.setSource(window.URL.createObjectURL(a)),Q.when(!0)},detachMediaSource:function(a){"use strict";return a.setSource(""),Q.when(!0)},setDuration:function(a,b){"use strict";return a.duration=b,Q.when(a.duration)},signalEndOfStream:function(a){"use strict";return a.endOfStream(),Q.when(!0)}},MediaPlayer.models.MetricsModel=function(){"use strict";return{system:void 0,streamMetrics:{},clearCurrentMetricsForType:function(a){delete this.streamMetrics[a]},clearAllCurrentMetrics:function(){this.streamMetrics={}},getReadOnlyMetricsFor:function(a){return this.streamMetrics.hasOwnProperty(a)?this.streamMetrics[a]:null},getMetricsFor:function(a){var b;return this.streamMetrics.hasOwnProperty(a)?b=this.streamMetrics[a]:(b=this.system.getObject("metrics"),this.streamMetrics[a]=b),b},addTcpConnection:function(a,b,c,d,e,f){var g=new MediaPlayer.vo.metrics.TCPConnection;return g.tcpid=b,g.dest=c,g.topen=d,g.tclose=e,g.tconnect=f,this.getMetricsFor(a).TcpList.push(g),g},addHttpRequest:function(a,b,c,d,e,f,g,h,i,j,k,l){var m=new MediaPlayer.vo.metrics.HTTPRequest;return m.tcpid=b,m.type=c,m.url=d,m.actualurl=e,m.range=f,m.trequest=g,m.tresponse=h,m.tfinish=i,m.responsecode=j,m.interval=k,m.mediaduration=l,this.getMetricsFor(a).HttpList=[m],m},appendHttpTrace:function(a,b,c,d){},addRepresentationSwitch:function(a,b,c,d,e){var f=new MediaPlayer.vo.metrics.RepresentationSwitch;return f.t=b,f.mt=c,f.to=d,f.lto=e,this.getMetricsFor(a).RepSwitchList.push(f),f},addBufferLevel:function(a,b,c){var d=new MediaPlayer.vo.metrics.BufferLevel;return d.t=b,d.level=c,this.getMetricsFor(a).BufferLevel=[d],d},addPlayList:function(a,b,c,d){},appendPlayListTrace:function(a,b,c,d,e,f,g,h){}}},MediaPlayer.models.MetricsModel.prototype={constructor:MediaPlayer.models.MetricsModel},MediaPlayer.dependencies.Mp4Processor=function(){"use strict";var a=function(a){var b=new mp4lib.boxes.MovieHeaderBox;return b.version=1,b.creation_time=0,b.modification_time=0,b.timescale=a.timescale,b.duration=Math.round(a.duration*a.timescale),b.rate=65536,b.volume=256,b.reserved=0,b.reserved_2=[0,0],b.matrix=[65536,0,0,0,65536,0,0,0,1073741824],b.pre_defined=[0,0,0,0,0,0],b.next_track_ID=a.trackId+1,b.flags=0,b},b=function(a){var b=new mp4lib.boxes.TrackBox;b.boxes=[];var c=new mp4lib.boxes.TrackHeaderBox;c.version=1,c.flags=7,c.creation_time=0,c.modification_time=0,c.track_id=a.trackId,c.reserved=0,c.duration=Math.round(a.duration*a.timescale),c.reserved_2=[0,0],c.layer=0,c.alternate_group=0,c.volume=256,c.reserved_3=0,c.matrix=[65536,0,0,0,65536,0,0,0,1073741824],c.width=a.width<<16,c.height=a.height<<16,b.boxes.push(c);var e=new mp4lib.boxes.MediaBox;return e.boxes=[],e.boxes.push(d(a)),e.boxes.push(f(a)),e.boxes.push(g(a)),b.boxes.push(e),b},c=function(a){var b=0,c=a.charCodeAt(0)-96<<10,d=a.charCodeAt(1)-96<<5,e=a.charCodeAt(2)-96;return b=c|d|e},d=function(a){var b=new mp4lib.boxes.MediaHeaderBox;return b.version=1,b.creation_time=0,b.modification_time=0,b.timescale=a.timescale,b.duration=Math.round(a.duration*a.timescale),b.pad=0,b.language=c(a.language),b.pre_defined=0,b},e=function(a){for(var b=0,c=0;c<a.length;c++)b|=a.charCodeAt(c)<<8*(a.length-c-1);return b},f=function(a){var b=new mp4lib.boxes.HandlerBox;switch(b.version=0,b.pre_defined=0,a.type){case"video":b.handler_type=e(b.HANDLERTYPEVIDEO),b.name=b.HANDLERVIDEONAME;break;case"audio":b.handler_type=e(b.HANDLERTYPEAUDIO),b.name=b.HANDLERAUDIONAME;break;default:b.handler_type=e(b.HANDLERTYPETEXT),b.name=b.HANDLERTEXTNAME}return b.name+="\x00",b.reserved=[0,0],b.flags=0,b},g=function(a){var b=new mp4lib.boxes.MediaInformationBox;switch(b.boxes=[],a.type){case"video":b.boxes.push(C(a));break;case"audio":b.boxes.push(D(a))}return b.boxes.push(h(a)),b.boxes.push(B(a)),b},h=function(){var a=new mp4lib.boxes.DataInformationBox;a.boxes=[];var b=new mp4lib.boxes.DataReferenceBox;b.version=0,b.entry_count=1,b.flags=0,b.boxes=[];var c=new mp4lib.boxes.DataEntryUrlBox;return c.location="",b.boxes.push(c),a.boxes.push(b),a},i=function(){var a=new mp4lib.boxes.TimeToSampleBox;return a.version=0,a.entry_count=0,a.flags=0,a.entry=[],a},j=function(){var a=new mp4lib.boxes.SampleToChunkBox;return a.version=0,a.entry_count=0,a.entry=[],a},k=function(){var a=new mp4lib.boxes.ChunkOffsetBox;return a.version=0,a.entry_count=0,a.flags=0,a.chunk_offset=[],a},l=function(){var a=new mp4lib.boxes.SampleSizeBox;return a.version=0,a.flags=0,a.sample_count=0,a.sample_size=0,a},m=function(a){for(var b=new Uint8Array(a.length/2),c=0;c<a.length/2;c++)b[c]=parseInt(""+a[2*c]+a[2*c+1],16);return b},n=function(a,b){var c=new Uint8Array(a.length+b.length);return c.set(a,0),c.set(b,a.length),c},o=function(a){var b=new mp4lib.boxes.AVCConfigurationBox;b.configurationVersion=1,b.lengthSizeMinusOne=3,b.reserved=63,b.SPS_NAL=[],b.PPS_NAL=[];var c=new Uint8Array(0),d=a.codecPrivateData,e=d.split("00000001");e.splice(0,1);for(var f=0,g=0,h=0;h<e.length;h++){var i=new RegExp("^[A-Z0-9]7","gi"),j=new RegExp("^[A-Z0-9]8","gi"),k=m(e[h]);e[h].match(i)&&(b.SPS_NAL[f++]={NAL_length:k.length,NAL:k},b.AVCProfileIndication=parseInt(e[h].substr(2,2),16),b.profile_compatibility=parseInt(e[h].substr(4,2),16),b.AVCLevelIndication=parseInt(e[h].substr(6,2),16)),e[h].match(j)&&(b.PPS_NAL[g++]={NAL_length:k.length,NAL:k});var l=new Uint8Array(k.length+4);l[3]=k.length,l.set(k,4),c=n(c,l)}return b.numOfSequenceParameterSets=f,b.numOfPictureParameterSets=g,b},p=function(a){var b=null;return b=void 0!==a.contentProtection?new mp4lib.boxes.EncryptedVideoBox:new mp4lib.boxes.AVC1VisualSampleEntryBox,b.boxes=[],b.data_reference_index=1,b.compressorname="AVC Coding",b.depth=24,b.reserved=[0,0,0,0,0,0],b.reserved_2=0,b.reserved_3=0,b.pre_defined=0,b.pre_defined_2=[0,0,0],b.pre_defined_3=65535,b.frame_count=1,b.horizresolution=4718592,b.vertresolution=4718592,b.height=a.height,b.width=a.width,b.boxes.push(o(a)),void 0!=a.contentProtection&&b.boxes.push(u(a)),b},q=function(a){var b=new mp4lib.boxes.OriginalFormatBox;return b.data_format=e(a.codecs.substring(0,a.codecs.indexOf("."))),b},r=function(){var a=new mp4lib.boxes.SchemeTypeBox;return a.flags=0,a.version=0,a.scheme_type=1667591779,a.scheme_version=65536,a},s=function(a){var b=new mp4lib.boxes.SchemeInformationBox;return b.boxes=[],b.boxes.push(t(a)),b},t=function(){var a=new mp4lib.boxes.TrackEncryptionBox;return a.default_IsEncrypted=1,a.default_IV_size=8,a.default_KID=[],a},u=function(a){var b=new mp4lib.boxes.ProtectionSchemeInformationBox;return b.boxes=[],b.boxes.push(q(a)),b.boxes.push(r()),b.boxes.push(s(a)),b},v=function(a){var b=a.codecs.substring(0,a.codecs.indexOf("."));switch(b){case"avc1":return p(a)}},w=function(a){for(var b=[];a.length>=2;)b.push(parseInt(a.substring(0,2),16)),a=a.substring(2,a.length);return b},x=function(a){var b=w(a.codecPrivateData),c=b.length,d=new Uint8Array(2+c);d[0]=5,d[1]=c,d.set(b,2);var e=13+d.length,f=new Uint8Array(2+e);f[0]=4,f[1]=e,f[2]=64,f[3]=20,f[3]|=0,f[3]|=1,f[4]=255,f[5]=255,f[6]=255,f[7]=255,f[8]=255,f[9]=255,f[10]=255,f[11]=(4278190080&a.bandwidth)>>24,f[12]|=(16711680&a.bandwidth)>>16,f[13]|=(65280&a.bandwidth)>>8,f[14]|=255&a.bandwidth,f.set(d,15);var g=3+f.length,h=new Uint8Array(2+g);return h[0]=3,h[1]=g,h[2]=(65280&a.trackId)>>8,h[3]=255&a.trackId,h[4]=0,h.set(f,5),h},y=function(a){var b=null;b=void 0!==a.contentProtection?new mp4lib.boxes.EncryptedAudioBox:new mp4lib.boxes.MP4AudioSampleEntryBox,b.boxes=[],b.reserved=[0,0,0,0,0,0],b.data_reference_index=1,b.reserved_2=[0,0],b.channelcount=a.channels,b.samplesize=16,b.pre_defined=0,b.reserved_3=0,b.samplerate=a.samplingRate<<16;var c=new mp4lib.boxes.ESDBox,d=x(a);return c.ES_tag=d[0],c.ES_length=d[1],c.ES_data=d.subarray(2,d.length),b.boxes.push(c),void 0!=a.contentProtection&&b.boxes.push(u(a)),b},z=function(a){var b=a.codecs.substring(0,a.codecs.indexOf("."));switch(b){case"mp4a":return y(a)}return null},A=function(a){var b=new mp4lib.boxes.SampleDescriptionBox;switch(b.boxes=[],a.type){case"video":b.boxes.push(v(a));break;case"audio":b.boxes.push(z(a))}return b},B=function(a){var b=new mp4lib.boxes.SampleTableBox;return b.boxes=[],b.boxes.push(i(a)),b.boxes.push(j(a)),b.boxes.push(k(a)),b.boxes.push(l(a)),b.boxes.push(A(a)),b},C=function(){var a=new mp4lib.boxes.VideoMediaHeaderBox;return a.version=0,a.flags=1,a.graphicsmode=0,a.opcolor=[0,0,0],a},D=function(){var a=new mp4lib.boxes.SoundMediaHeaderBox;return a.version=0,a.balance=0,a.reserved=0,a},E=function(){var a=new mp4lib.boxes.FileTypeBox;return a.major_brand=1769172790,a.minor_brand=1,a.compatible_brands=[],a.compatible_brands[0]=1769172845,a.compatible_brands[1]=1769172790,a.compatible_brands[2]=1836278888,a},F=function(a){var b=new mp4lib.boxes.MovieExtendsBox;if(b.boxes=[],a.duration!==Number.POSITIVE_INFINITY){var c=new mp4lib.boxes.MovieExtendsHeaderBox;c.version=1,c.flags=0,c.fragment_duration=Math.round(a.duration*a.timescale),b.boxes.push(c)}var d=new mp4lib.boxes.TrackExtendsBox;return d.track_ID=a.trackId,d.default_sample_description_index=1,d.default_sample_duration=0,d.default_sample_flags=0,d.default_sample_size=0,b.boxes.push(d),b},G=function(a){var b=new mp4lib.boxes.ProtectionSystemSpecificHeaderBox;b.version=0,b.flags=0;var c=a.contentProtection.schemeIdUri.substring(8).replace(/[^A-Fa-f0-9]/g,"");b.SystemID=m(c);var d=BASE64.decodeArray(a.contentProtection.pro.__text);return b.DataSize=d.length,b.Data=d,b},H=function(c){var d=new mp4lib.boxes.File;d.boxes=[];var e=new mp4lib.boxes.MovieBox;return e.boxes=[],e.boxes.push(a(c)),e.boxes.push(b(c)),e.boxes.push(F(c)),void 0!=c.contentProtection&&e.boxes.push(G(c)),d.boxes.push(E()),d.boxes.push(e),mp4lib.serialize(d)};return{generateInitSegment:H}},MediaPlayer.dependencies.Mp4Processor.prototype={constructor:MediaPlayer.dependencies.Mp4Processor},MediaPlayer.dependencies.ProtectionController=function(){"use strict";var a=null,b=null,c=function(a){var b=this;b.protectionModel.removeKeySystem(a)},d=function(a,c){for(var d=this,e=0;e<b.length;++e)for(var f=0;f<c.length;++f)if(b[e].isSupported(c[f])&&d.protectionExt.supportsCodec(b[e].keysTypeString,a)){var g=d.manifestExt.getKID(c[f]);return g||(g="unknown"),d.protectionModel.addKeySystem(g,c[f],b[e]),g}throw new Error("DRM: The protection system for this content is not supported.")},e=function(a,b,c){var d=this,e=null,f=null;d.protectionModel.needToAddKeySession(a)&&(f=d.protectionModel.getInitData(a),!f&&c&&(f=c),f&&(e=d.protectionModel.addKeySession(a,b,f)))},f=function(a,b,c,d){var e,f=this;return e=f.protectionModel.updateFromMessage(a,c,d),e.then(function(a){b.update(a)}),e};return{system:void 0,debug:void 0,manifestExt:void 0,capabilities:void 0,videoModel:void 0,protectionModel:void 0,protectionExt:void 0,setup:function(){b=this.protectionExt.getKeySystems()},init:function(b,c){this.videoModel=b,this.protectionModel=c,a=this.videoModel.getElement()},selectKeySystem:d,ensureKeySession:e,updateFromMessage:f,teardownKeySystem:c}},MediaPlayer.dependencies.ProtectionController.prototype={constructor:MediaPlayer.dependencies.ProtectionController},MediaPlayer.dependencies.ProtectionExtensions=function(){"use strict"},MediaPlayer.dependencies.ProtectionExtensions.prototype={constructor:MediaPlayer.dependencies.ProtectionExtensions,supportsCodec:function(a,b){"use strict";var c="WebKitMediaKeys"in window,d="MSMediaKeys"in window,e="MediaKeys"in window;return e?MediaKeys.isTypeSupported(a,b):c?WebKitMediaKeys.isTypeSupported(a,b):d?MSMediaKeys.isTypeSupported(a,b):!1},createMediaKeys:function(a){"use strict";var b="WebKitMediaKeys"in window,c="MSMediaKeys"in window,d="MediaKeys"in window;return d?new MediaKeys(a):b?new WebKitMediaKeys(a):c?new MSMediaKeys(a):null},setMediaKey:function(a,b){var c="WebKitSetMediaKeys"in a,d="msSetMediaKeys"in a,e="SetMediaKeys"in a;return e?a.SetMediaKeys(b):c?a.WebKitSetMediaKeys(b):d?a.msSetMediaKeys(b):void 0},createSession:function(a,b,c){return a.createSession(b,c)},getKeySystems:function(){var a=function(a,b){var c=Q.defer(),d=null,e=[],f=new DOMParser,g=f.parseFromString(a,"application/xml");if(!g.getElementsByTagName("Challenge")[0])return c.reject("DRM: playready update, can not find Challenge in keyMessage"),c.promise;var h=g.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;h&&(d=BASE64.decode(h));var i=g.getElementsByTagName("name"),j=g.getElementsByTagName("value");if(i.length!=j.length)return c.reject("DRM: playready update, invalid header name/value pair in keyMessage"),c.promise;for(var k=0;k<i.length;k++)e[k]={name:i[k].childNodes[0].nodeValue,value:j[k].childNodes[0].nodeValue};var l=new XMLHttpRequest;return l.onload=function(){200==l.status?c.resolve(new Uint8Array(l.response)):c.reject('DRM: playready update, XHR status is "'+l.statusText+'" ('+l.status+"), expected to be 200. readyState is "+l.readyState)},l.onabort=function(){c.reject('DRM: playready update, XHR aborted. status is "'+l.statusText+'" ('+l.status+"), readyState is "+l.readyState)},l.onerror=function(){c.reject('DRM: playready update, XHR error. status is "'+l.statusText+'" ('+l.status+"), readyState is "+l.readyState)},l.open("POST",b),l.responseType="arraybuffer",e&&e.forEach(function(a){l.setRequestHeader(a.name,a.value)}),l.send(d),c.promise},b=function(a,b){return null===a&&0===b.length},c=function(a){var b=0,c=0,d=0,e=new Uint8Array([112,115,115,104,0,0,0,0]),f=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),g=null,h=null,i=null,j=null;if("pro"in a)g=BASE64.decodeArray(a.pro.__text);else{if(!("prheader"in a))return null;g=BASE64.decodeArray(a.prheader.__text)}return c=g.length,d=4+e.length+f.length+4+c,h=new ArrayBuffer(d),i=new Uint8Array(h),j=new DataView(h),j.setUint32(b,d),b+=4,i.set(e,b),b+=e.length,i.set(f,b),b+=f.length,j.setUint32(b,c),b+=4,i.set(g,b),b+=c,i};return[{schemeIdUri:"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95",keysTypeString:"com.microsoft.playready",isSupported:function(a){return this.schemeIdUri===a.schemeIdUri.toLowerCase()},needToAddKeySession:b,getInitData:c,getUpdate:a},{schemeIdUri:"urn:mpeg:dash:mp4protection:2011",keysTypeString:"com.microsoft.playready",isSupported:function(a){return this.schemeIdUri===a.schemeIdUri.toLowerCase()&&"cenc"===a.value.toLowerCase()},needToAddKeySession:b,getInitData:function(){return null},getUpdate:a},{schemeIdUri:"urn:uuid:00000000-0000-0000-0000-000000000000",keysTypeString:"webkit-org.w3.clearkey",isSupported:function(a){return this.schemeIdUri===a.schemeIdUri.toLowerCase()},needToAddKeySession:function(){return!0},getInitData:function(){return null},getUpdate:function(a){return Q.when(a)}}]},addKey:function(a,b,c,d,e){a.webkitAddKey(b,c,d,e)},generateKeyRequest:function(a,b,c){a.webkitGenerateKeyRequest(b,c)},listenToNeedKey:function(a,b){a.listen("webkitneedkey",b),a.listen("msneedkey",b),a.listen("needKey",b)},listenToKeyError:function(a,b){a.addEventListener("webkitkeyerror",b,!1),a.addEventListener("mskeyerror",b,!1),a.addEventListener("keyerror",b,!1)},listenToKeyMessage:function(a,b){a.addEventListener("webkitkeymessage",b,!1),a.addEventListener("mskeymessage",b,!1),a.addEventListener("keymessage",b,!1)},listenToKeyAdded:function(a,b){a.addEventListener("webkitkeyadded",b,!1),a.addEventListener("mskeyadded",b,!1),a.addEventListener("keyadded",b,!1)},unlistenToKeyError:function(a,b){a.removeEventListener("webkitkeyerror",b),a.removeEventListener("mskeyerror",b),a.removeEventListener("keyerror",b)},unlistenToKeyMessage:function(a,b){a.removeEventListener("webkitkeymessage",b),a.removeEventListener("mskeymessage",b),a.removeEventListener("keymessage",b)},unlistenToKeyAdded:function(a,b){a.removeEventListener("webkitkeyadded",b),a.removeEventListener("mskeyadded",b),a.removeEventListener("keyadded",b)}},MediaPlayer.models.ProtectionModel=function(){"use strict";var a=null,b=null,c=null,d=null,e=[];return{system:void 0,videoModel:void 0,protectionExt:void 0,setup:function(){a=this.videoModel.getElement()},init:function(b){this.videoModel=b,a=this.videoModel.getElement()},addKeySession:function(a,f,g){var h=null;return h=this.protectionExt.createSession(e[a].keys,f,g),this.protectionExt.listenToKeyAdded(h,b),this.protectionExt.listenToKeyError(h,c),this.protectionExt.listenToKeyMessage(h,d),e[a].initData=g,e[a].keySessions.push(h),h},addKeySystem:function(b,c,d){var f=null;f=this.protectionExt.createMediaKeys(d.keysTypeString),this.protectionExt.setMediaKey(a,f),e[b]={kID:b,contentProtection:c,keySystem:d,keys:f,initData:null,keySessions:[]}},removeKeySystem:function(a){if(null!==a&&void 0!==e[a]&&0!==e[a].keySessions.length){for(var f=e[a].keySessions,g=0;g<f.length;++g)this.protectionExt.unlistenToKeyError(f[g],c),this.protectionExt.unlistenToKeyAdded(f[g],b),this.protectionExt.unlistenToKeyMessage(f[g],d),f[g].close();e[a]=void 0}},needToAddKeySession:function(a){var b=null;return b=e[a],b.keySystem.needToAddKeySession(b.initData,b.keySessions)},getInitData:function(a){var b=null;return b=e[a],b.keySystem.getInitData(b.contentProtection)},updateFromMessage:function(a,b,c){return e[a].keySystem.getUpdate(b,c)},listenToNeedKey:function(a){this.protectionExt.listenToNeedKey(this.videoModel,a)},listenToKeyError:function(a){c=a;for(var b=0;b<e.length;++b)for(var d=e[b].keySessions,f=0;f<d.length;++f)this.protectionExt.listenToKeyError(d[f],a)},listenToKeyMessage:function(a){d=a;for(var b=0;b<e.length;++b)for(var c=e[b].keySessions,f=0;f<c.length;++f)this.protectionExt.listenToKeyMessage(c[f],a)},listenToKeyAdded:function(a){b=a;for(var c=0;c<e.length;++c)for(var d=e[c].keySessions,f=0;f<d.length;++f)this.protectionExt.listenToKeyAdded(d[f],a)}}},MediaPlayer.models.ProtectionModel.prototype={constructor:MediaPlayer.models.ProtectionModel},MediaPlayer.dependencies.RequestScheduler=function(){"use strict";var a=[],b=null,c=null,d=!1,e=0,f=1,g=2,h=function(a,b,c){if(a&&b){var e;e=w.call(this,a,g),e.setScheduledTask(b),e.setIsScheduled(!0),e.setExecuteTime(c),d||i.call(this)}},i=function(){var a=this.videoModel.getElement();this.schedulerExt.attachScheduleListener(a,j.bind(this)),this.schedulerExt.attachUpdateScheduleListener(a,m.bind(this)),d=!0},j=function(){var a,b,c,d=x.call(this,g),e=d.length,f=this.videoModel.getCurrentTime();for(c=0;e>c;c+=1)a=d[c],b=a.getExecuteTime(),a.getIsScheduled()&&f>b&&(a.executeScheduledTask(),a.setIsScheduled(!1))},k=function(a){var b,c=z(a,g);c&&(y(c),b=x.call(this,g),0===b.length&&l.call(this))},l=function(){var a=this.videoModel.getElement();this.schedulerExt.detachScheduleListener(a,j.bind(this)),this.schedulerExt.detachUpdateScheduleListener(a,m.bind(this)),d=!1},m=function(){n.call(this),j.call(this)},n=function(){var a,b=x.call(this,g),c=b.length;for(a=0;c>a;a+=1)b[a].setIsScheduled(!0)},o=function(a,b,c){if(a&&b){var d,e,g=c.getTime()-(new Date).getTime();e=w.call(this,a,f),e.setScheduledTask(b),d=setTimeout(function(){e.executeScheduledTask(),y(e)},g),e.setExecuteId(d)}},p=function(a){var b=z(a,f);b&&(clearTimeout(b.getExecuteId()),y(b))},q=function(a,b){if(a&&b){var c=z(a,e);c||(c=w.call(this,a,e)),c.setIsScheduled(!0),c.setScheduledTask(b),t.call(this),b.call(a)}},r=function(){s.call(this)},s=function(){var a,b,c=this,d=x.call(c,e),f=d.length;for(b=0;f>b;b+=1)a=d[b],a.getIsScheduled()&&a.executeScheduledTask()},t=function(){null===c&&(this.adjustExecuteInterval(),c=setInterval(r.bind(this),b))},u=function(a){var b=z(a,e),c=x.call(this,e);b&&(y(b),0===c.length&&v.call(this))},v=function(){clearInterval(c),c=null},w=function(b,c){if(!b)return null;var d=this.system.getObject("schedulerModel");return d.setContext(b),d.setType(c),a.push(d),d},x=function(b){var c,d,e=[];for(d=0;d<a.length;d+=1)c=a[d],c.getType()===b&&e.push(c);return e},y=function(b){var c=a.indexOf(b);-1!==c&&a.splice(c,1)},z=function(b,c){for(var d=0;d<a.length;d++)if(a[d].getContext()===b&&a[d].getType()===c)return a[d];return null};return{system:void 0,videoModel:void 0,debug:void 0,schedulerExt:void 0,isScheduled:function(a){var b=z(a,e);return!!b&&b.getIsScheduled()},getExecuteInterval:function(){return b},adjustExecuteInterval:function(){if(!(a.length<1)){var d=this.schedulerExt.getExecuteInterval(a[0].getContext());b!==d&&(b=d,null!==c&&(clearInterval(c),c=setInterval(r.bind(this),b)))}},startScheduling:q,stopScheduling:u,setTriggerForVideoTime:h,setTriggerForWallTime:o,removeTriggerForVideoTime:k,removeTriggerForWallTime:p}},MediaPlayer.dependencies.RequestScheduler.prototype={constructor:MediaPlayer.dependencies.RequestScheduler},MediaPlayer.dependencies.SchedulerExtensions=function(){"use strict"},MediaPlayer.dependencies.SchedulerExtensions.prototype={constructor:MediaPlayer.dependencies.SchedulerExtensions,getExecuteInterval:function(a){var b=1e3;return"undefined"!=typeof a.getMinBufferTime&&(b=1e3*a.getMinBufferTime()/4,b=Math.max(b,1e3)),b},attachScheduleListener:function(a,b){a.addEventListener("timeupdate",b)},detachScheduleListener:function(a,b){a.removeEventListener("timeupdate",b)},attachUpdateScheduleListener:function(a,b){a.addEventListener("seeking",b)},detachUpdateScheduleListener:function(a,b){a.removeEventListener("seeking",b)}},MediaPlayer.dependencies.SchedulerModel=function(){"use strict";var a,b,c,d,e,f=!1;return{system:void 0,debug:void 0,schedulerExt:void 0,setContext:function(b){a=b},getContext:function(){return a},setScheduledTask:function(a){b=a},executeScheduledTask:function(){b.call(a)},setExecuteTime:function(a){d=a
},getExecuteTime:function(){return d},setExecuteId:function(a){e=a},getExecuteId:function(){return e},setType:function(a){c=a},getType:function(){return c},setIsScheduled:function(a){f=a},getIsScheduled:function(){return f}}},MediaPlayer.dependencies.SchedulerModel.prototype={constructor:MediaPlayer.dependencies.SchedulerModel},MediaPlayer.dependencies.SourceBufferExtensions=function(){"use strict";this.system=void 0,this.manifestExt=void 0},MediaPlayer.dependencies.SourceBufferExtensions.prototype={constructor:MediaPlayer.dependencies.SourceBufferExtensions,createSourceBuffer:function(a,b){"use strict";var c=Q.defer(),d=this;try{c.resolve(a.addSourceBuffer(b))}catch(e){d.manifestExt.getIsTextTrack(b)?c.resolve(d.system.getObject("textVTTSourceBuffer")):c.reject(e.description)}return c.promise},removeSourceBuffer:function(a,b){"use strict";var c=Q.defer();try{c.resolve(a.removeSourceBuffer(b))}catch(d){c.reject(d.description)}return c.promise},getBufferRange:function(a,b,c){"use strict";var d,e,f=null,g=0,h=0,i=null,j=null,k=0,l=c||.15;try{f=a.buffered}catch(m){return Q.when(null)}if(null!==f){for(e=0,d=f.length;d>e;e+=1)if(g=f.start(e),h=f.end(e),null===i){if(k=Math.abs(g-b),b>=g&&h>b){i=g,j=h;continue}if(l>=k){i=g,j=h;continue}}else{if(k=g-j,!(l>=k))break;j=h}if(null!==i)return Q.when({start:i,end:j})}return Q.when(null)},getAllRanges:function(a){var b=null;try{return b=a.buffered,Q.when(b)}catch(c){return Q.when(null)}},getBufferLength:function(a,b,c){"use strict";var d=this,e=Q.defer();return d.getBufferRange(a,b,c).then(function(a){e.resolve(null===a?0:a.end-b)}),e.promise},waitForUpdateEnd:function(a){"use strict";var b,c=Q.defer(),d=50,e=function(){a.updating||(clearInterval(b),c.resolve(!0))},f=function(){a.removeEventListener("updateend",f,!1),c.resolve(!0)};if(a.hasOwnProperty("addEventListener"))try{a.addEventListener("updateend",f,!1)}catch(g){b=setInterval(e,d)}else b=setInterval(e,d);return c.promise},append:function(a,b){var c=Q.defer();try{"append"in a?a.append(b):"appendBuffer"in a&&a.appendBuffer(b),this.waitForUpdateEnd(a).then(function(){c.resolve()})}catch(d){c.reject({err:d,data:b})}return c.promise},remove:function(a,b,c,d,e){var f=Q.defer();try{b>=0&&d>b&&c>b&&"ended"!==e.readyState&&a.remove(b,c),this.waitForUpdateEnd(a).then(function(){f.resolve()})}catch(g){f.reject(g)}return f.promise},abort:function(a,b){"use strict";var c=Q.defer();try{"open"===a.readyState&&b.abort(),c.resolve()}catch(d){c.reject(d.description)}return c.promise}},MediaPlayer.dependencies.Stream=function(){"use strict";var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q=null,r=null,s=null,t=null,u=-1,v=null,w=-1,x=null,y=-1,z=!0,A=!1,B=!1,C=null,D=[],E=null,F=function(){A&&this.videoModel.play()},G=function(){this.videoModel.pause()},H=function(a){A&&(this.system.notify("setCurrentTime"),this.videoModel.setCurrentTime(a),t&&t.seek(a),v&&v.seek(a))},I=function(a){var b,c=this;if(b="msneedkey"!==a.type?a.type:q,D.push({type:b,initData:a.initData}),s&&q&&!C)try{C=c.protectionController.selectKeySystem(q,s)}catch(d){G.call(c),c.errHandler.mediaKeySystemSelectionError(d)}C&&c.protectionController.ensureKeySession(C,b,a.initData)},J=function(a){var b=this,c=null,d=null,e=null,f=null;c=a.target,d=new Uint16Array(a.message.buffer),e=String.fromCharCode.apply(null,d),f=a.destinationURL;var g=b.manifestModel.getValue();g.backUrl&&(f=g.backUrl),b.protectionController.updateFromMessage(C,c,e,f).fail(function(a){G.call(b),b.errHandler.mediaKeyMessageError(a)})},K=function(){},L=function(){var a,b=event.target;switch(a="DRM: MediaKeyError - sessionId: "+b.sessionId+" errorCode: "+b.error.code+" systemErrorCode: "+b.error.systemCode+" [",b.error.code){case 1:a+="MEDIA_KEYERR_UNKNOWN - An unspecified error occurred. This value is used for errors that don't match any of the other codes.";break;case 2:a+="MEDIA_KEYERR_CLIENT - The Key System could not be installed or updated.";break;case 3:a+="MEDIA_KEYERR_SERVICE - The message passed into update indicated an error from the license service.";break;case 4:a+="MEDIA_KEYERR_OUTPUT - There is no available output device with the required characteristics for the content protection system.";break;case 5:a+="MEDIA_KEYERR_HARDWARECHANGE - A hardware configuration change caused a content protection error.";break;case 6:a+="MEDIA_KEYERR_DOMAIN - An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain."}a+="]",this.errHandler.mediaKeySessionError(a)},M=function(a){var b=Q.defer(),c=this,d=function(c){a.removeEventListener("sourceopen",d),a.removeEventListener("webkitsourceopen",d),b.resolve(a)};return a.addEventListener("sourceopen",d,!1),a.addEventListener("webkitsourceopen",d,!1),c.mediaSourceExt.attachMediaSource(a,c.videoModel),b.promise},N=function(){var c=this;t&&t.reset(B),v&&v.reset(B),b&&c.mediaSourceExt.detachMediaSource(c.videoModel),A=!1,C=null,D=[],s=null,t=null,v=null,x=null,q=null,r=null,b=null,a=null},O=function(b,c,d,e){if(b&&c&&d)if(null===t&&null===v&&null===x){var f="No streams to play.";this.errHandler.manifestError(f,"nostreams",a),e.reject()}else e.resolve(!0)},P=function(){var a=Q.defer(),c=!1,d=!1,e=!1,f=this,g=f.manifestModel.getValue();return f.manifestExt.getDuration(g,E).then(function(){f.manifestExt.getVideoData(g,E.index).then(function(h){return null!==h?(f.manifestExt.getDataIndex(h,g,E.index).then(function(a){u=a}),f.manifestExt.getCodec(h).then(function(a){return q=a,f.manifestExt.getContentProtectionData(h).then(function(c){if(c&&!f.capabilities.supportsMediaKeys())return f.errHandler.capabilityError("mediakeys"),Q.when(null);if(s=c,!f.capabilities.supportsCodec(f.videoModel.getElement(),a)){var d="Video Codec ("+a+") is not supported.";return f.errHandler.manifestError(d,"codec",g),Q.when(null)}return f.sourceBufferExt.createSourceBuffer(b,a)})}).then(function(g){null===g||(t=f.system.getObject("bufferController"),t.initialize("video",E,h,g,f.videoModel,f.requestScheduler,f.fragmentController,b)),c=!0,O.call(f,c,d,e,a)},function(){f.errHandler.mediaSourceError("Error creating video source buffer."),c=!0,O.call(f,c,d,e,a)})):(c=!0,O.call(f,c,d,e,a)),f.manifestExt.getAudioDatas(g,E.index)}).then(function(h){return null!==h&&h.length>0?f.manifestExt.getPrimaryAudioData(g,E.index).then(function(h){f.manifestExt.getDataIndex(h,g,E.index).then(function(a){w=a}),f.manifestExt.getCodec(h).then(function(a){return r=a,f.manifestExt.getContentProtectionData(h).then(function(c){if(c&&!f.capabilities.supportsMediaKeys())return f.errHandler.capabilityError("mediakeys"),Q.when(null);if(s=c,!f.capabilities.supportsCodec(f.videoModel.getElement(),a)){var d="Audio Codec ("+a+") is not supported.";return f.errHandler.manifestError(d,"codec",g),Q.when(null)}return f.sourceBufferExt.createSourceBuffer(b,a)})}).then(function(g){null===g||(v=f.system.getObject("bufferController"),v.initialize("audio",E,h,g,f.videoModel,f.requestScheduler,f.fragmentController,b)),d=!0,O.call(f,c,d,e,a)},function(){f.errHandler.mediaSourceError("Error creating audio source buffer."),d=!0,O.call(f,c,d,e,a)})}):(d=!0,O.call(f,c,d,e,a)),f.manifestExt.getTextData(g,E.index)}).then(function(h){var i;null!==h?(f.manifestExt.getDataIndex(h,g,E.index).then(function(a){y=a}),f.manifestExt.getMimeType(h).then(function(a){return i=a,f.sourceBufferExt.createSourceBuffer(b,i)}).then(function(b){null===b||(x=f.system.getObject("textController"),x.initialize(E.index,h,b,f.videoModel),b.hasOwnProperty("initialize")&&b.initialize(i,x),e=!0,O.call(f,c,d,e,a))},function(b){f.errHandler.mediaSourceError("Error creating text source buffer."),e=!0,O.call(f,c,d,e,a)})):(e=!0,O.call(f,c,d,e,a))})}),a.promise},R=function(){var a=this,c=Q.defer();return a.manifestExt.getDuration(a.manifestModel.getValue(),E).then(function(c){return a.mediaSourceExt.setDuration(b,c)}).then(function(){A=!0,c.resolve(!0)}),c.promise},S=function(){var a=this.timelineConverter.calcPresentationStartTime(E);a!=this.videoModel.getCurrentTime()&&(this.system.notify("setCurrentTime"),this.videoModel.setCurrentTime(a)),c.resolve(null)},T=function(){},U=function(){this.scheduleWhilePaused||ab.call(this)},V=function(a){var b=a.srcElement.error,c=b.code,d="";if(-1!==c){switch(c){case 1:d="MEDIA_ERR_ABORTED";break;case 2:d="MEDIA_ERR_NETWORK";break;case 3:d="MEDIA_ERR_DECODE";break;case 4:d="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:d="MEDIA_ERR_ENCRYPTED"}B=!0,this.errHandler.mediaSourceError(d),this.reset()}},W=function(){var a=this.videoModel.getCurrentTime();t&&t.seek(a),v&&v.seek(a)},X=function(){this.videoModel.listen("seeking",h),this.videoModel.unlisten("seeked",i)},Y=function(){_.call(this)},Z=function(){_.call(this)},$=function(){t&&t.updateStalledState(),v&&v.updateStalledState()},_=function(){t&&t.updateBufferState(),v&&v.updateBufferState()},ab=function(){t&&t.stop(),v&&v.stop()},bb=function(d){var e=this;return a=d,e.mediaSourceExt.createMediaSource().then(function(a){return M.call(e,a)}).then(function(a){return b=a,P.call(e)}).then(function(){return R.call(e)}).then(function(){return c.promise}).then(function(){0===E.index&&z&&F.call(e)})},cb=function(){this.videoModel.unlisten("seeking",h),this.videoModel.listen("seeked",i)},db=function(){t&&!t.isBufferingCompleted()||v&&!v.isBufferingCompleted()||b&&this.mediaSourceExt.signalEndOfStream(b)},eb=function(){ab.call(this)},fb=function(){var a=this.timelineConverter.calcPresentationStartTime(E);t&&t.seek(a),v&&v.seek(a)},gb=function(a){var b,c,d,e=this,f=Q.defer(),g=Q.defer(),h=e.manifestModel.getValue();return E=a,t?(b=t.getData(),c=b&&b.hasOwnProperty("id")?e.manifestExt.getDataForId(b.id,h,E.index):e.manifestExt.getDataForIndex(u,h,E.index),c.then(function(a){t.updateData(a,E).then(function(){f.resolve()})})):f.resolve(),v?(d=e.manifestExt.getDataForIndex(w,h,E.index),d.then(function(a){v.updateData(a,E).then(function(){g.resolve()})})):g.resolve(),Q.when(f.promise,g.promise)};return{system:void 0,videoModel:void 0,manifestLoader:void 0,manifestModel:void 0,mediaSourceExt:void 0,sourceBufferExt:void 0,bufferExt:void 0,manifestExt:void 0,fragmentController:void 0,abrController:void 0,fragmentExt:void 0,protectionModel:void 0,protectionController:void 0,protectionExt:void 0,capabilities:void 0,debug:void 0,metricsExt:void 0,errHandler:void 0,timelineConverter:void 0,requestScheduler:void 0,scheduleWhilePaused:void 0,setup:function(){this.system.mapHandler("setCurrentTime",void 0,cb.bind(this)),this.system.mapHandler("bufferingCompleted",void 0,db.bind(this)),this.system.mapHandler("segmentLoadingFailed",void 0,eb.bind(this)),this.system.mapHandler("liveEdgeFound",void 0,fb.bind(this)),c=Q.defer(),e=T.bind(this),f=U.bind(this),g=V.bind(this),h=W.bind(this),i=X.bind(this),k=Y.bind(this),l=$.bind(this),j=Z.bind(this),d=S.bind(this)},load:function(a,b){E=b,bb.call(this,a)},setVideoModel:function(a){this.videoModel=a,this.videoModel.listen("play",e),this.videoModel.listen("pause",f),this.videoModel.listen("error",g),this.videoModel.listen("seeking",h),this.videoModel.listen("timeupdate",j),this.videoModel.listen("progress",k),this.videoModel.listen("ratechange",l),this.videoModel.listen("loadedmetadata",d),this.requestScheduler.videoModel=a},setAudioTrack:function(a){var b,c=Q.defer(),d=this.videoModel.getCurrentTime(),e=this.manifestModel.getValue(),f=this;return v?f.manifestExt.getDataIndex(a,e,E.index).then(function(a){w=a,v.emptyBuffer(d).then(function(){b=e.mpdUrl,e.hasOwnProperty("Location")&&(b=e.Location),f.manifestLoader.load(b).then(function(a){f.manifestModel.setValue(a),c.resolve()})})}):c.reject(),c.promise},initProtection:function(){m=I.bind(this),n=J.bind(this),o=K.bind(this),p=L.bind(this),this.protectionModel=this.system.getObject("protectionModel"),this.protectionModel.init(this.getVideoModel()),this.protectionController=this.system.getObject("protectionController"),this.protectionController.init(this.videoModel,this.protectionModel),this.protectionModel.listenToNeedKey(m),this.protectionModel.listenToKeyMessage(n),this.protectionModel.listenToKeyError(p),this.protectionModel.listenToKeyAdded(o)},getVideoModel:function(){return this.videoModel},getManifestExt:function(){var a=this;return a.manifestExt},setAutoPlay:function(a){z=a},getAutoPlay:function(){return z},reset:function(){G.call(this),this.videoModel.unlisten("play",e),this.videoModel.unlisten("pause",f),this.videoModel.unlisten("error",g),this.videoModel.unlisten("seeking",h),this.videoModel.unlisten("timeupdate",j),this.videoModel.unlisten("progress",k),this.videoModel.unlisten("loadedmetadata",d),N.call(this),this.protectionController&&this.protectionController.teardownKeySystem(C),this.protectionController=void 0,this.protectionModel=void 0,this.fragmentController=void 0,this.requestScheduler=void 0,c=Q.defer()},getDuration:function(){return E.duration},getStartTime:function(){return E.start},getPeriodIndex:function(){return E.index},getId:function(){return E.id},getPeriodInfo:function(){return E},updateData:gb,play:F,seek:H,pause:G}},MediaPlayer.dependencies.Stream.prototype={constructor:MediaPlayer.dependencies.Stream},MediaPlayer.dependencies.StreamController=function(){"use strict";var a,b,c,d,e,f=[],g=4,h=3,i=!0,j=null,k=function(){a.play()},l=function(){a.pause()},m=function(b){a.seek(b)},n=function(a,b){var c=a.getElement(),d=b.getElement();return d.parentNode||c.parentNode.insertBefore(d,c),c.style.width="0px",d.style.width="100%",q(c,d),p.call(this,a),o.call(this,b),Q.when(!0)},o=function(a){a.listen("seeking",c),a.listen("progress",d),v()&&a.listen("timeupdate",b)},p=function(a){a.unlisten("seeking",c),a.unlisten("progress",d),a.unlisten("timeupdate",b)},q=function(a,b){["controls","loop","muted","playbackRate","volume"].forEach(function(c){b[c]=a[c]})},r=function(){var b=a.getVideoModel().getElement().buffered;if(b.length){var c=b.length-1,e=b.end(c),f=a.getStartTime()+a.getDuration()-e;g>f&&(a.getVideoModel().unlisten("progress",d),u())}},s=function(){if(!a.getVideoModel().getElement().seeking){var b=a.getStartTime()+a.getDuration(),c=a.getVideoModel().getCurrentTime();h>b-c&&z.call(this,a,v())}},t=function(){var b=a.getVideoModel().getCurrentTime(),c=w(b);c&&c!==a&&z.call(this,a,c,b)},u=function(){var a=v();a&&a.seek(a.getStartTime())},v=function(){var b=a.getPeriodIndex()+1;return b<f.length?f[b]:null},w=function(a){var b=0,c=null,d=f.length;d>0&&(b+=f[0].getStartTime());for(var e=0;d>e;e++)if(c=f[e],b+=c.getDuration(),b>a)return c},x=function(){var a=this.system.getObject("videoModel"),b=document.createElement("video");return a.setElement(b),a},y=function(a){a.parentNode&&a.parentNode.removeChild(a)},z=function(b,c,d){if(b&&c&&b!==c){var e=this;Q.when(j||!0).then(function(){b.pause(),a=c,j=n.call(e,b.getVideoModel(),c.getVideoModel()),m(d?b.getVideoModel().getCurrentTime():c.getStartTime()),k()})}},A=function(){var b,c,d,e,g,h,j=this,k=j.manifestModel.getValue(),l=Q.defer(),m=[];return k?(j.manifestExt.getMpd(k).then(function(n){j.manifestExt.getRegularPeriods(k,n).then(function(n){for(d=0,b=n.length;b>d;d+=1){for(g=n[d],e=0,c=f.length;c>e;e+=1)f[e].getId()===g.id&&(h=f[e],m.push(h.updateData(g)));h||(h=j.system.getObject("stream"),h.setVideoModel(0===d?j.videoModel:x.call(j)),h.initProtection(),h.setAutoPlay(i),h.load(k,g),f.push(h)),h=null}a||(a=f[0],o.call(j,a.getVideoModel())),Q.all(m).then(function(){l.resolve()})})}),l.promise):Q.when(!1)},B=function(){if(a){var b=this;b.manifestExt.getAudioDatas(b.manifestModel.getValue(),a.getPeriodIndex()).then(function(a){e=a,b.system.notify("audioTracksUpdated")})}},C=function(){var a=this;A.call(a).then(function(){B.call(a),a.system.notify("streamsComposed")})};return{system:void 0,videoModel:void 0,manifestLoader:void 0,manifestUpdater:void 0,manifestModel:void 0,mediaSourceExt:void 0,sourceBufferExt:void 0,bufferExt:void 0,manifestExt:void 0,fragmentController:void 0,abrController:void 0,fragmentExt:void 0,capabilities:void 0,debug:void 0,metricsExt:void 0,errHandler:void 0,backUrl:void 0,setup:function(){this.system.mapHandler("manifestUpdated",void 0,C.bind(this)),b=s.bind(this),d=r.bind(this),c=t.bind(this)},getManifestExt:function(){return a.getManifestExt()},setAutoPlay:function(a){i=a},getAutoPlay:function(){return i},getVideoModel:function(){return this.videoModel},setVideoModel:function(a){this.videoModel=a},getAudioTracks:function(){return e},setAudioTrack:function(b){a&&a.setAudioTrack(b)},load:function(a,b){var c=this;c.backUrl=b,c.manifestLoader.load(a).then(function(a){c.backUrl&&(a.backUrl=c.backUrl),c.manifestModel.setValue(a),c.manifestUpdater.init()},function(){c.reset()})},reset:function(){a&&p.call(this,a.getVideoModel());for(var b=0,c=f.length;c>b;b++){var d=f[b];d.reset(),d!==a&&y(d.getVideoModel().getElement())}f=[],this.manifestUpdater.stop(),this.manifestModel.setValue(null),j=null,a=null},play:k,seek:m,pause:l}},MediaPlayer.dependencies.StreamController.prototype={constructor:MediaPlayer.dependencies.StreamController},MediaPlayer.models.VideoModel=function(){"use strict";var a,b=[],c=function(){return b.length>0},d=function(c){null!==c&&(a.playbackRate=0,b[c]!==!0&&(b.push(c),b[c]=!0))},e=function(d){if(null!==d){b[d]=!1;var e=b.indexOf(d);-1!==e&&b.splice(e,1),c()===!1&&(a.playbackRate=1)}},f=function(a,b){b?d(a):e(a)};return{system:void 0,setup:function(){},play:function(){a.play()},pause:function(){a.pause()},isPaused:function(){return a.paused},getPlaybackRate:function(){return a.playbackRate},setPlaybackRate:function(b){a.playbackRate=b},getCurrentTime:function(){return a.currentTime},setCurrentTime:function(b){a.currentTime!=b&&(a.currentTime=b)},listen:function(b,c){a.addEventListener(b,c,!1)},unlisten:function(b,c){a.removeEventListener(b,c,!1)},getElement:function(){return a},setElement:function(b){a=b},setSource:function(b){a.src=b},isStalled:function(){return 0===a.playbackRate},stallStream:f}},MediaPlayer.models.VideoModel.prototype={constructor:MediaPlayer.models.VideoModel},MediaPlayer.dependencies.VideoModelExtensions=function(){"use strict";return{getDroppedFrames:function(a){var b=null!==a.webkitDroppedFrameCount,c=-1;return b&&(c=a.webkitDroppedFrameCount),c}}},MediaPlayer.dependencies.VideoModelExtensions.prototype={constructor:MediaPlayer.dependencies.VideoModelExtensions},MediaPlayer.dependencies.TextController=function(){var a,b,c="LOADING",d="READY",e=!1,f=null,g=d,h=function(a){g=a},i=function(){if(e&&g===d){var b=this;h.call(b,c),b.indexHandler.getInitRequest(0,a).then(function(a){b.fragmentLoader.load(a).then(k.bind(b,a),l.bind(b,a)),h.call(b,c)})}},j=function(){i.call(this)},k=function(a,c){var d=this;d.fragmentController.process(c.data,a).then(function(a){null!==a&&d.sourceBufferExt.append(b,a,d.videoModel)})},l=function(){};return{videoModel:void 0,fragmentLoader:void 0,fragmentController:void 0,indexHandler:void 0,sourceBufferExt:void 0,debug:void 0,initialize:function(a,b,c,d){var f=this;f.setVideoModel(d),f.setPeriodInfo(a),f.setData(b),f.setBuffer(c),e=!0},setPeriodInfo:function(a){f=a},getPeriodIndex:function(){return f.index},getVideoModel:function(){return this.videoModel},setVideoModel:function(a){this.videoModel=a},getData:function(){return a},setData:function(b){a=b},getBuffer:function(){return b},setBuffer:function(a){b=a},reset:function(a,c){a||(this.sourceBufferExt.abort(c,b),this.sourceBufferExt.removeSourceBuffer(c,b))},start:j}},MediaPlayer.dependencies.TextController.prototype={constructor:MediaPlayer.dependencies.TextController},MediaPlayer.utils.TextTrackExtensions=function(){"use strict";return{addTextTrack:function(a,b,c,d,e){var f=a.addTextTrack("captions",c,d);f.default=e,f.mode="showing";for(var g in b){var h=b[g];f.addCue(new TextTrackCue(h.start,h.end,h.data))}return Q.when(f)},deleteCues:function(a){for(var b=a.textTracks[0],c=b.cues,d=c.length;d>=0;d--)b.removeCue(c[d]);b.mode="disabled"}}},MediaPlayer.dependencies.TextVTTSourceBuffer=function(){var a,b,c;return{system:void 0,eventBus:void 0,initialize:function(d,e){c=d,a=e.getVideoModel().getElement(),b=e.getData()},append:function(c){var d=this;d.getParser().parse(String.fromCharCode.apply(null,new Uint16Array(c))).then(function(c){var e=b.Representation_asArray[0].id,f=b.lang;d.getTextTrackExtensions().addTextTrack(a,c,e,f,!0).then(function(){d.eventBus.dispatchEvent({type:"updateend"})})})},abort:function(){this.getTextTrackExtensions().deleteCues(a)},getParser:function(){var a;return"text/vtt"===c&&(a=this.system.getObject("vttParser")),a},getTextTrackExtensions:function(){return this.system.getObject("textTrackExtensions")},addEventListener:function(a,b,c){this.eventBus.addEventListener(a,b,c)},removeEventListener:function(a,b,c){this.eventBus.removeEventListener(a,b,c)}}},MediaPlayer.dependencies.TextVTTSourceBuffer.prototype={constructor:MediaPlayer.dependencies.TextVTTSourceBuffer},MediaPlayer.utils.VTTParser=function(){"use strict";var a=function(a){var b=a.split(":"),c=b.length-1;return a=60*parseInt(b[c-1],10)+parseFloat(b[c],10),2===c&&(a+=3600*parseInt(b[0],10)),a};return{parse:function(b){var c,d=/(?:\r\n|\r|\n)/gm,e=/-->/,f=/(^[\s]+|[\s]+$)/g,g=[];b=b.split(d),c=b.length;for(var h=0;c>h;h++){var i=b[h];if(i.length>0&&"WEBVTT"!==i&&i.match(e)){var j=i.split(e),k=b[h+1];g.push({start:a(j[0].replace(f,"")),end:a(j[1].replace(f,"")),data:k})}}return Q.when(g)}}},MediaPlayer.rules.BaseRulesCollection=function(){"use strict";var a=[];return{downloadRatioRule:void 0,insufficientBufferRule:void 0,getRules:function(){return Q.when(a)},setup:function(){var a=this;a.getRules().then(function(b){b.push(a.downloadRatioRule),b.push(a.insufficientBufferRule)})}}},MediaPlayer.rules.BaseRulesCollection.prototype={constructor:MediaPlayer.rules.BaseRulesCollection},MediaPlayer.rules.DownloadRatioRule=function(){"use strict";var a=function(a,b,c){var d=this,e=Q.defer();return d.manifestExt.getRepresentationFor(a,c).then(function(a){d.manifestExt.getBandwidth(a).then(function(a){e.resolve(a/b)})}),e.promise};return{debug:void 0,manifestExt:void 0,checkIndex:function(b,c,d){var e,f,g,h,i,j,k,l,m,n,o=this,p=c.HttpList,q=.75;return c?null===p||void 0===p||0===p.length?Q.when(new MediaPlayer.rules.SwitchRequest):(e=p[p.length-1],g=(e.tfinish.getTime()-e.trequest.getTime())/1e3,f=(e.tfinish.getTime()-e.tresponse.getTime())/1e3,0>=g?Q.when(new MediaPlayer.rules.SwitchRequest):null===e.mediaduration||void 0===e.mediaduration||e.mediaduration<=0?Q.when(new MediaPlayer.rules.SwitchRequest):(k=Q.defer(),i=e.mediaduration/g,h=e.mediaduration/f*q,isNaN(h)||isNaN(i)?Q.when(new MediaPlayer.rules.SwitchRequest):(isNaN(h)?k.resolve(new MediaPlayer.rules.SwitchRequest):1>h?b>0?o.manifestExt.getRepresentationFor(b-1,d).then(function(a){o.manifestExt.getBandwidth(a).then(function(a){o.manifestExt.getRepresentationFor(b,d).then(function(c){o.manifestExt.getBandwidth(c).then(function(c){j=a/c,k.resolve(j>h?new MediaPlayer.rules.SwitchRequest(0):new MediaPlayer.rules.SwitchRequest(b-1))})})})}):k.resolve(new MediaPlayer.rules.SwitchRequest(b)):o.manifestExt.getRepresentationCount(d).then(function(c){c-=1,c>b?o.manifestExt.getRepresentationFor(b+1,d).then(function(e){o.manifestExt.getBandwidth(e).then(function(e){o.manifestExt.getRepresentationFor(b,d).then(function(f){o.manifestExt.getBandwidth(f).then(function(f){if(j=e/f,h>=j)if(h>1e3)k.resolve(new MediaPlayer.rules.SwitchRequest(c-1));else if(h>100)k.resolve(new MediaPlayer.rules.SwitchRequest(b+1));else{for(m=-1,l=[];(m+=1)<c;)l.push(a.call(o,m,f,d));Q.all(l).then(function(a){for(m=0,n=a.length;n>m&&!(h<a[m]);m+=1);k.resolve(new MediaPlayer.rules.SwitchRequest(m))})}else k.resolve(new MediaPlayer.rules.SwitchRequest)})})})}):k.resolve(new MediaPlayer.rules.SwitchRequest(c))}),k.promise))):Q.when(new MediaPlayer.rules.SwitchRequest)}}},MediaPlayer.rules.DownloadRatioRule.prototype={constructor:MediaPlayer.rules.DownloadRatioRule},MediaPlayer.rules.InsufficientBufferRule=function(){"use strict";var a=0,b=3;return{debug:void 0,checkIndex:function(c,d){var e,f,g=!1,h=MediaPlayer.rules.SwitchRequest.prototype.DEFAULT;return null===d.PlayList||void 0===d.PlayList||0===d.PlayList.length?Q.when(new MediaPlayer.rules.SwitchRequest):(e=d.PlayList[d.PlayList.length-1],null===e||void 0===e||0===e.trace.length?Q.when(new MediaPlayer.rules.SwitchRequest):(f=e.trace[e.trace.length-2],null===f||void 0===f||null===f.stopreason||void 0===f.stopreason?Q.when(new MediaPlayer.rules.SwitchRequest):(f.stopreason===MediaPlayer.vo.metrics.PlayList.Trace.REBUFFERING_REASON&&(g=!0,a+=1),a>b&&(h=MediaPlayer.rules.SwitchRequest.prototype.STRONG),Q.when(g?new MediaPlayer.rules.SwitchRequest(c-1,h):a>b?new MediaPlayer.rules.SwitchRequest(c,h):new MediaPlayer.rules.SwitchRequest(MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE,h)))))}}},MediaPlayer.rules.InsufficientBufferRule.prototype={constructor:MediaPlayer.rules.InsufficientBufferRule},MediaPlayer.rules.LimitSwitchesRule=function(){"use strict";var a=10,b=2e4,c=5,d=0;return{debug:void 0,checkIndex:function(e,f){if(d>0)return d-=1,Q.when(new MediaPlayer.rules.SwitchRequest(e,MediaPlayer.rules.SwitchRequest.prototype.STRONG));var g,h,i,j=!1,k=(new Date).getTime(),l=f.RepSwitchList.length;for(i=l-1;i>=0&&(g=f.RepSwitchList[i],h=k-g.t.getTime(),!(h>=b));i-=1)if(i>=a){j=!0;break}return j?(d=c,Q.when(new MediaPlayer.rules.SwitchRequest(e,MediaPlayer.rules.SwitchRequest.prototype.STRONG))):Q.when(new MediaPlayer.rules.SwitchRequest(MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE,MediaPlayer.rules.SwitchRequest.prototype.STRONG))}}},MediaPlayer.rules.LimitSwitchesRule.prototype={constructor:MediaPlayer.rules.LimitSwitchesRule},MediaPlayer.rules.SwitchRequest=function(a,b){"use strict";this.quality=a,this.priority=b,void 0===this.quality&&(this.quality=999),void 0===this.priority&&(this.priority=.5)},MediaPlayer.rules.SwitchRequest.prototype={constructor:MediaPlayer.rules.SwitchRequest,NO_CHANGE:999,DEFAULT:.5,STRONG:1,WEAK:0},MediaPlayer.models.MetricsList=function(){"use strict";return{TcpList:[],HttpList:[],RepSwitchList:[],RepBoundariesList:[],DwnldSwitchList:[],BandwidthValue:null,BufferLevel:[],PlayList:[],DroppedFrames:[]}},MediaPlayer.models.MetricsList.prototype={constructor:MediaPlayer.models.MetricsList},MediaPlayer.vo.SegmentRequest=function(){"use strict";this.action="download",this.startTime=0/0,this.streamType=null,this.type=null,this.duration=0/0,this.timescale=0/0,this.range=null,this.url=null,this.requestStartDate=null,this.firstByteDate=null,this.requestEndDate=null,this.deferred=null,this.quality=0/0,this.index=0/0,this.availabilityStartTime=null,this.availabilityEndTime=null,this.wallStartTime=null},MediaPlayer.vo.SegmentRequest.prototype={constructor:MediaPlayer.vo.SegmentRequest,ACTION_DOWNLOAD:"download",ACTION_COMPLETE:"complete"},MediaPlayer.vo.metrics.BufferLevel=function(){"use strict";this.t=null,this.level=null},MediaPlayer.vo.metrics.BufferLevel.prototype={constructor:MediaPlayer.vo.metrics.BufferLevel},MediaPlayer.vo.metrics.DroppedFrames=function(){"use strict";this.time=null,this.droppedFrames=null},MediaPlayer.vo.metrics.DroppedFrames.prototype={constructor:MediaPlayer.vo.metrics.DroppedFrames},MediaPlayer.vo.metrics.HTTPRequest=function(){"use strict";this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.tfinish=null,this.responsecode=null,this.interval=null,this.mediaduration=null,this.trace=[]},MediaPlayer.vo.metrics.HTTPRequest.prototype={constructor:MediaPlayer.vo.metrics.HTTPRequest},MediaPlayer.vo.metrics.HTTPRequest.Trace=function(){"use strict";this.s=null,this.d=null,this.b=[]},MediaPlayer.vo.metrics.HTTPRequest.Trace.prototype={constructor:MediaPlayer.vo.metrics.HTTPRequest.Trace},MediaPlayer.vo.metrics.PlayList=function(){"use strict";this.start=null,this.mstart=null,this.starttype=null,this.trace=[]},MediaPlayer.vo.metrics.PlayList.Trace=function(){"use strict";this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null},MediaPlayer.vo.metrics.PlayList.prototype={constructor:MediaPlayer.vo.metrics.PlayList},MediaPlayer.vo.metrics.PlayList.INITIAL_PLAY_START_REASON="initial_start",MediaPlayer.vo.metrics.PlayList.SEEK_START_REASON="seek",MediaPlayer.vo.metrics.PlayList.Trace.prototype={constructor:MediaPlayer.vo.metrics.PlayList.Trace()},MediaPlayer.vo.metrics.PlayList.Trace.USER_REQUEST_STOP_REASON="user_request",MediaPlayer.vo.metrics.PlayList.Trace.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",MediaPlayer.vo.metrics.PlayList.Trace.END_OF_CONTENT_STOP_REASON="end_of_content",MediaPlayer.vo.metrics.PlayList.Trace.REBUFFERING_REASON="rebuffering",MediaPlayer.vo.metrics.RepresentationBoundaries=function(){"use strict";this.t=null,this.min=null,this.max=null},MediaPlayer.vo.metrics.RepresentationBoundaries.prototype={constructor:MediaPlayer.vo.metrics.RepresentationBoundaries},MediaPlayer.vo.metrics.RepresentationSwitch=function(){"use strict";this.t=null,this.mt=null,this.to=null,this.lto=null},MediaPlayer.vo.metrics.RepresentationSwitch.prototype={constructor:MediaPlayer.vo.metrics.RepresentationSwitch},MediaPlayer.vo.metrics.TCPConnection=function(){"use strict";this.tcpid=null,this.dest=null,this.topen=null,this.tclose=null,this.tconnect=null},MediaPlayer.vo.metrics.TCPConnection.prototype={constructor:MediaPlayer.vo.metrics.TCPConnection};
// JQUERY
(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
// JQUERY UI CUSTOM
(function(e,t){function i(t,i){var s,n,r,o=t.nodeName.toLowerCase();return"area"===o?(s=t.parentNode,n=s.name,t.href&&n&&"map"===s.nodeName.toLowerCase()?(r=e("img[usemap=#"+n+"]")[0],!!r&&a(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&a(t)}function a(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,n=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,a){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),a&&a.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var a,s,n=e(this[0]);n.length&&n[0]!==document;){if(a=n.css("position"),("absolute"===a||"relative"===a||"fixed"===a)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,a){return!!e.data(t,a[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var a=e.attr(t,"tabindex"),s=isNaN(a);return(s||a>=0)&&i(t,!s)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,a){function s(t,i,a,s){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,a&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===a?["Left","Right"]:["Top","Bottom"],r=a.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+a]=function(i){return i===t?o["inner"+a].call(this):this.each(function(){e(this).css(r,s(this,i)+"px")})},e.fn["outer"+a]=function(t,i){return"number"!=typeof t?o["outer"+a].call(this,t):this.each(function(){e(this).css(r,s(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,a){var s,n=e.ui[t].prototype;for(s in a)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([i,a[s]])},call:function(e,t,i){var a,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(a=0;s.length>a;a++)e.options[s[a][0]]&&s[a][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var a=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[a]>0?!0:(t[a]=1,s=t[a]>0,t[a]=0,s)}})})(jQuery);(function(e,t){var i=0,s=Array.prototype.slice,a=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler("remove")}catch(n){}a(t)},e.widget=function(i,s,a){var n,r,o,h,l={},u=i.split(".")[0];i=i.split(".")[1],n=u+"-"+i,a||(a=s,s=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:a.version,_proto:e.extend({},a),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(a,function(i,a){return e.isFunction(a)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,n=this._superApply;return this._super=e,this._superApply=t,i=a.apply(this,arguments),this._super=s,this._superApply=n,i}}(),t):(l[i]=a,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:n}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var a,n,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(a in r[o])n=r[o][a],r[o].hasOwnProperty(a)&&n!==t&&(i[a]=e.isPlainObject(n)?e.isPlainObject(i[a])?e.widget.extend({},i[a],n):e.widget.extend({},n):n);return i},e.widget.bridge=function(i,a){var n=a.prototype.widgetFullName||i;e.fn[i]=function(r){var o="string"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,a=e.data(this,n);return a?e.isFunction(a[r])&&"_"!==r.charAt(0)?(s=a[r].apply(a,h),s!==a&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error("no such method '"+r+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var t=e.data(this,n);t?t.option(r||{})._init():e.data(this,n,new a(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var a,n,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(o={},a=i.split("."),i=a.shift(),a.length){for(n=o[i]=e.widget.extend({},this.options[i]),r=0;a.length-1>r;r++)n[a[r]]=n[a[r]]||{},n=n[a[r]];if(i=a.pop(),s===t)return n[i]===t?null:n[i];n[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,a){var n,r=this;"boolean"!=typeof i&&(a=s,s=i,i=!1),a?(s=n=e(s),this.bindings=this.bindings.add(s)):(a=s,s=this.element,n=this.widget()),e.each(a,function(a,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):t}"string"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=a.match(/^(\w+)\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?n.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var a,n,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],n=i.originalEvent)for(a in n)a in i||(i[a]=n[a]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,a,n){"string"==typeof a&&(a={effect:a});var r,o=a?a===!0||"number"==typeof a?i:a.effect||i:t;a=a||{},"number"==typeof a&&(a={duration:a}),r=!e.isEmptyObject(a),a.complete=n,a.delay&&s.delay(a.delay),r&&e.effects&&e.effects.effect[o]?s[t](a):o!==t&&s[o]?s[o](a.duration,a.easing,n):s.queue(function(i){e(this)[t](),n&&n.call(s[0]),i()})}})})(jQuery);(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,a=1===i.which,n="string"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return a&&!n&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(e){var t=5;e.widget("ui.slider",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,s=this.options,a=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),n="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",r=[];for(i=s.values&&s.values.length||1,a.length>i&&(a.slice(i).remove(),a=a.slice(0,i)),t=a.length;i>t;t++)r.push(n);this.handles=a.add(e(r.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):this.range=e([])},_setupEvents:function(){var e=this.handles.add(this.range).filter("a");this._off(e),this._on(e,this._handleEvents),this._hoverable(e),this._focusable(e)},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,s,a,n,r,o,h,l,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i),a=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(s-u.values(t));(a>i||a===i&&(t===u._lastChangedValue||u.values(t)===c.min))&&(a=i,n=e(this),r=t)}),o=this._start(t,r),o===!1?!1:(this._mouseSliding=!0,this._handleIndex=r,n.addClass("ui-state-active").focus(),h=n.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-h.left-n.width()/2,top:t.pageY-h.top-n.height()/2-(parseInt(n.css("borderTopWidth"),10)||0)-(parseInt(n.css("borderBottomWidth"),10)||0)+(parseInt(n.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,r,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,s,a,n;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/t,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),a=this._valueMax()-this._valueMin(),n=this._valueMin()+s*a,this._trimAlignValue(n)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var s,a,n;this.options.values&&this.options.values.length?(s=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>s||1===t&&s>i)&&(i=s),i!==this.values(t)&&(a=this.values(),a[t]=i,n=this._trigger("slide",e,{handle:this.handles[t],value:i,values:a}),s=this.values(t?0:1),n!==!1&&this.values(t,i,!0))):i!==this.value()&&(n=this._trigger("slide",e,{handle:this.handles[t],value:i}),n!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(t,i){var s,a,n;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),undefined;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(s=this.options.values,a=arguments[0],n=0;s.length>n;n+=1)s[n]=this._trimAlignValue(a[n]),this._change(null,n);this._refreshValue()},_setOption:function(t,i){var s,a=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(a=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;a>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,s;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,s=e-i;return 2*Math.abs(i)>=t&&(s+=i>0?t:-t),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,i,s,a,n,r=this.options.range,o=this.options,h=this,l=this._animateOff?!1:o.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[l?"animate":"css"](u,o.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},o.animate),1===s&&h.range[l?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:o.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},o.animate),1===s&&h.range[l?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:o.animate}))),t=i}):(s=this.value(),a=this._valueMin(),n=this._valueMax(),i=n!==a?100*((s-a)/(n-a)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,o.animate),"min"===r&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},o.animate),"max"===r&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:o.animate}),"min"===r&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},o.animate),"max"===r&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:o.animate}))},_handleEvents:{keydown:function(i){var s,a,n,r,o=e(i.target).data("ui-slider-handle-index");switch(i.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(i.target).addClass("ui-state-active"),s=this._start(i,o),s===!1))return}switch(r=this.options.step,a=n=this.options.values&&this.options.values.length?this.values(o):this.value(),i.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(a+(this._valueMax()-this._valueMin())/t);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(a-(this._valueMax()-this._valueMin())/t);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(a===this._valueMax())return;n=this._trimAlignValue(a+r);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(a===this._valueMin())return;n=this._trimAlignValue(a-r)}this._slide(i,o,n)},click:function(e){e.preventDefault()},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}})})(jQuery);
// flotcharts.org
(function(e){e.color={};e.color.make=function(t,n,r,i){var s={};s.r=t||0;s.g=n||0;s.b=r||0;s.a=i!=null?i:1;s.add=function(e,t){for(var n=0;n<e.length;++n){s[e.charAt(n)]+=t}return s.normalize()};s.scale=function(e,t){for(var n=0;n<e.length;++n){s[e.charAt(n)]*=t}return s.normalize()};s.toString=function(){if(s.a>=1){return"rgb("+[s.r,s.g,s.b].join(",")+")"}else{return"rgba("+[s.r,s.g,s.b,s.a].join(",")+")"}};s.normalize=function(){function e(e,t,n){return t<e?e:t>n?n:t}s.r=e(0,parseInt(s.r),255);s.g=e(0,parseInt(s.g),255);s.b=e(0,parseInt(s.b),255);s.a=e(0,s.a,1);return s};s.clone=function(){return e.color.make(s.r,s.b,s.g,s.a)};return s.normalize()};e.color.extract=function(t,n){var r;do{r=t.css(n).toLowerCase();if(r!=""&&r!="transparent"){break}t=t.parent()}while(!e.nodeName(t.get(0),"body"));if(r=="rgba(0, 0, 0, 0)"){r="transparent"}return e.color.parse(r)};e.color.parse=function(n){var r,i=e.color.make;if(r=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(n)){return i(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10))}if(r=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(n)){return i(parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3],10),parseFloat(r[4]))}if(r=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(n)){return i(parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55)}if(r=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(n)){return i(parseFloat(r[1])*2.55,parseFloat(r[2])*2.55,parseFloat(r[3])*2.55,parseFloat(r[4]))}if(r=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(n)){return i(parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16))}if(r=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(n)){return i(parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16))}var s=e.trim(n).toLowerCase();if(s=="transparent"){return i(255,255,255,0)}else{r=t[s]||[0,0,0];return i(r[0],r[1],r[2])}};var t={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);(function(e){function t(t,r,s,o){function x(e,t){t=[S].concat(t);for(var n=0;n<e.length;++n)e[n].apply(this,t)}function T(){for(var t=0;t<o.length;++t){var n=o[t];n.init(S);if(n.options)e.extend(true,a,n.options)}}function N(t){var n;e.extend(true,a,t);if(a.xaxis.color==null)a.xaxis.color=a.grid.color;if(a.yaxis.color==null)a.yaxis.color=a.grid.color;if(a.xaxis.tickColor==null)a.xaxis.tickColor=a.grid.tickColor;if(a.yaxis.tickColor==null)a.yaxis.tickColor=a.grid.tickColor;if(a.grid.borderColor==null)a.grid.borderColor=a.grid.color;if(a.grid.tickColor==null)a.grid.tickColor=e.color.parse(a.grid.color).scale("a",.22).toString();for(n=0;n<Math.max(1,a.xaxes.length);++n)a.xaxes[n]=e.extend(true,{},a.xaxis,a.xaxes[n]);for(n=0;n<Math.max(1,a.yaxes.length);++n)a.yaxes[n]=e.extend(true,{},a.yaxis,a.yaxes[n]);if(a.xaxis.noTicks&&a.xaxis.ticks==null)a.xaxis.ticks=a.xaxis.noTicks;if(a.yaxis.noTicks&&a.yaxis.ticks==null)a.yaxis.ticks=a.yaxis.noTicks;if(a.x2axis){a.xaxes[1]=e.extend(true,{},a.xaxis,a.x2axis);a.xaxes[1].position="top"}if(a.y2axis){a.yaxes[1]=e.extend(true,{},a.yaxis,a.y2axis);a.yaxes[1].position="right"}if(a.grid.coloredAreas)a.grid.markings=a.grid.coloredAreas;if(a.grid.coloredAreasColor)a.grid.markingsColor=a.grid.coloredAreasColor;if(a.lines)e.extend(true,a.series.lines,a.lines);if(a.points)e.extend(true,a.series.points,a.points);if(a.bars)e.extend(true,a.series.bars,a.bars);if(a.shadowSize!=null)a.series.shadowSize=a.shadowSize;for(n=0;n<a.xaxes.length;++n)_(d,n+1).options=a.xaxes[n];for(n=0;n<a.yaxes.length;++n)_(v,n+1).options=a.yaxes[n];for(var r in E)if(a.hooks[r]&&a.hooks[r].length)E[r]=E[r].concat(a.hooks[r]);x(E.processOptions,[a])}function C(e){u=k(e);D();P()}function k(t){var n=[];for(var r=0;r<t.length;++r){var i=e.extend(true,{},a.series);if(t[r].data!=null){i.data=t[r].data;delete t[r].data;e.extend(true,i,t[r]);t[r].data=i.data}else i.data=t[r];n.push(i)}return n}function L(e,t){var n=e[t+"axis"];if(typeof n=="object")n=n.n;if(typeof n!="number")n=1;return n}function A(){return e.grep(d.concat(v),function(e){return e})}function O(e){var t={},n,r;for(n=0;n<d.length;++n){r=d[n];if(r&&r.used)t["x"+r.n]=r.c2p(e.left)}for(n=0;n<v.length;++n){r=v[n];if(r&&r.used)t["y"+r.n]=r.c2p(e.top)}if(t.x1!==undefined)t.x=t.x1;if(t.y1!==undefined)t.y=t.y1;return t}function M(e){var t={},n,r,i;for(n=0;n<d.length;++n){r=d[n];if(r&&r.used){i="x"+r.n;if(e[i]==null&&r.n==1)i="x";if(e[i]!=null){t.left=r.p2c(e[i]);break}}}for(n=0;n<v.length;++n){r=v[n];if(r&&r.used){i="y"+r.n;if(e[i]==null&&r.n==1)i="y";if(e[i]!=null){t.top=r.p2c(e[i]);break}}}return t}function _(t,n){if(!t[n-1])t[n-1]={n:n,direction:t==d?"x":"y",options:e.extend(true,{},t==d?a.xaxis:a.yaxis)};return t[n-1]}function D(){var t;var n=u.length,r=[],i=[];for(t=0;t<u.length;++t){var s=u[t].color;if(s!=null){--n;if(typeof s=="number")i.push(s);else r.push(e.color.parse(u[t].color))}}for(t=0;t<i.length;++t){n=Math.max(n,i[t]+1)}var o=[],f=0;t=0;while(o.length<n){var l;if(a.colors.length==t)l=e.color.make(100,100,100);else l=e.color.parse(a.colors[t]);var c=f%2==1?-1:1;l.scale("rgb",1+c*Math.ceil(f/2)*.2);o.push(l);++t;if(t>=a.colors.length){t=0;++f}}var h=0,p;for(t=0;t<u.length;++t){p=u[t];if(p.color==null){p.color=o[h].toString();++h}else if(typeof p.color=="number")p.color=o[p.color].toString();if(p.lines.show==null){var m,g=true;for(m in p)if(p[m]&&p[m].show){g=false;break}if(g)p.lines.show=true}p.xaxis=_(d,L(p,"x"));p.yaxis=_(v,L(p,"y"))}}function P(){function b(e,t,n){if(t<e.datamin&&t!=-r)e.datamin=t;if(n>e.datamax&&n!=r)e.datamax=n}var t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,r=Number.MAX_VALUE,i,s,o,a,f,l,c,h,p,d,v,m,g,y;e.each(A(),function(e,r){r.datamin=t;r.datamax=n;r.used=false});for(i=0;i<u.length;++i){l=u[i];l.datapoints={points:[]};x(E.processRawData,[l,l.data,l.datapoints])}for(i=0;i<u.length;++i){l=u[i];var w=l.data,S=l.datapoints.format;if(!S){S=[];S.push({x:true,number:true,required:true});S.push({y:true,number:true,required:true});if(l.bars.show||l.lines.show&&l.lines.fill){S.push({y:true,number:true,required:false,defaultValue:0});if(l.bars.horizontal){delete S[S.length-1].y;S[S.length-1].x=true}}l.datapoints.format=S}if(l.datapoints.pointsize!=null)continue;l.datapoints.pointsize=S.length;h=l.datapoints.pointsize;c=l.datapoints.points;insertSteps=l.lines.show&&l.lines.steps;l.xaxis.used=l.yaxis.used=true;for(s=o=0;s<w.length;++s,o+=h){y=w[s];var T=y==null;if(!T){for(a=0;a<h;++a){m=y[a];g=S[a];if(g){if(g.number&&m!=null){m=+m;if(isNaN(m))m=null;else if(m==Infinity)m=r;else if(m==-Infinity)m=-r}if(m==null){if(g.required)T=true;if(g.defaultValue!=null)m=g.defaultValue}}c[o+a]=m}}if(T){for(a=0;a<h;++a){m=c[o+a];if(m!=null){g=S[a];if(g.x)b(l.xaxis,m,m);if(g.y)b(l.yaxis,m,m)}c[o+a]=null}}else{if(insertSteps&&o>0&&c[o-h]!=null&&c[o-h]!=c[o]&&c[o-h+1]!=c[o+1]){for(a=0;a<h;++a)c[o+h+a]=c[o+a];c[o+1]=c[o-h+1];o+=h}}}}for(i=0;i<u.length;++i){l=u[i];x(E.processDatapoints,[l,l.datapoints])}for(i=0;i<u.length;++i){l=u[i];c=l.datapoints.points,h=l.datapoints.pointsize;var N=t,C=t,k=n,L=n;for(s=0;s<c.length;s+=h){if(c[s]==null)continue;for(a=0;a<h;++a){m=c[s+a];g=S[a];if(!g||m==r||m==-r)continue;if(g.x){if(m<N)N=m;if(m>k)k=m}if(g.y){if(m<C)C=m;if(m>L)L=m}}}if(l.bars.show){var O=l.bars.align=="left"?0:-l.bars.barWidth/2;if(l.bars.horizontal){C+=O;L+=O+l.bars.barWidth}else{N+=O;k+=O+l.bars.barWidth}}b(l.xaxis,N,k);b(l.yaxis,C,L)}e.each(A(),function(e,r){if(r.datamin==t)r.datamin=null;if(r.datamax==n)r.datamax=null})}function H(n,r){var i=document.createElement("canvas");i.className=r;i.width=g;i.height=y;if(!n)e(i).css({position:"absolute",left:0,top:0});e(i).appendTo(t);if(!i.getContext)i=window.G_vmlCanvasManager.initElement(i);i.getContext("2d").save();return i}function B(){g=t.width();y=t.height();if(g<=0||y<=0)throw"Invalid dimensions for plot, width = "+g+", height = "+y}function j(e){if(e.width!=g)e.width=g;if(e.height!=y)e.height=y;var t=e.getContext("2d");t.restore();t.save()}function F(){var n,r=t.children("canvas.base"),i=t.children("canvas.overlay");if(r.length==0||i==0){t.html("");t.css({padding:0});if(t.css("position")=="static")t.css("position","relative");B();f=H(true,"base");l=H(false,"overlay");n=false}else{f=r.get(0);l=i.get(0);n=true}h=f.getContext("2d");p=l.getContext("2d");c=e([l,f]);if(n){t.data("plot").shutdown();S.resize();p.clearRect(0,0,g,y);c.unbind();t.children().not([f,l]).remove()}t.data("plot",S)}function I(){if(a.grid.hoverable){c.mousemove(ht);c.mouseleave(pt)}if(a.grid.clickable)c.click(dt);x(E.bindEvents,[c])}function q(){if(lt)clearTimeout(lt);c.unbind("mousemove",ht);c.unbind("mouseleave",pt);c.unbind("click",dt);x(E.shutdown,[c])}function R(e){function t(e){return e}var n,r,i=e.options.transform||t,s=e.options.inverseTransform;if(e.direction=="x"){n=e.scale=b/Math.abs(i(e.max)-i(e.min));r=Math.min(i(e.max),i(e.min))}else{n=e.scale=w/Math.abs(i(e.max)-i(e.min));n=-n;r=Math.max(i(e.max),i(e.min))}if(i==t)e.p2c=function(e){return(e-r)*n};else e.p2c=function(e){return(i(e)-r)*n};if(!s)e.c2p=function(e){return r+e/n};else e.c2p=function(e){return s(r+e/n)}}function U(n){function c(r,i){return e('<div style="position:absolute;top:-10000px;'+i+'font-size:smaller">'+'<div class="'+n.direction+"Axis "+n.direction+n.n+'Axis">'+r.join("")+"</div></div>").appendTo(t)}var r=n.options,i,s=n.ticks||[],o=[],u,a=r.labelWidth,f=r.labelHeight,l;if(n.direction=="x"){if(a==null)a=Math.floor(g/(s.length>0?s.length:1));if(f==null){o=[];for(i=0;i<s.length;++i){u=s[i].label;if(u)o.push('<div class="tickLabel" style="float:left;width:'+a+'px">'+u+"</div>")}if(o.length>0){o.push('<div style="clear:left"></div>');l=c(o,"width:10000px;");f=l.height();l.remove()}}}else if(a==null||f==null){for(i=0;i<s.length;++i){u=s[i].label;if(u)o.push('<div class="tickLabel">'+u+"</div>")}if(o.length>0){l=c(o,"");if(a==null)a=l.children().width();if(f==null)f=l.find("div.tickLabel").height();l.remove()}}if(a==null)a=0;if(f==null)f=0;n.labelWidth=a;n.labelHeight=f}function z(t){var n=t.labelWidth,r=t.labelHeight,i=t.options.position,s=t.options.tickLength,o=a.grid.axisMargin,u=a.grid.labelMargin,f=t.direction=="x"?d:v,l;var c=e.grep(f,function(e){return e&&e.options.position==i&&e.reserveSpace});if(e.inArray(t,c)==c.length-1)o=0;if(s==null)s="full";var h=e.grep(f,function(e){return e&&e.reserveSpace});var p=e.inArray(t,h)==0;if(!p&&s=="full")s=5;if(!isNaN(+s))u+=+s;if(t.direction=="x"){r+=u;if(i=="bottom"){m.bottom+=r+o;t.box={top:y-m.bottom,height:r}}else{t.box={top:m.top+o,height:r};m.top+=r+o}}else{n+=u;if(i=="left"){t.box={left:m.left+o,width:n};m.left+=n+o}else{m.right+=n+o;t.box={left:g-m.right,width:n}}}t.position=i;t.tickLength=s;t.box.padding=u;t.innermost=p}function W(e){if(e.direction=="x"){e.box.left=m.left;e.box.width=b}else{e.box.top=m.top;e.box.height=w}}function X(){var t,n=A();e.each(n,function(e,t){t.show=t.options.show;if(t.show==null)t.show=t.used;t.reserveSpace=t.show||t.options.reserveSpace;V(t)});allocatedAxes=e.grep(n,function(e){return e.reserveSpace});m.left=m.right=m.top=m.bottom=0;if(a.grid.show){e.each(allocatedAxes,function(e,t){J(t);K(t);Q(t,t.ticks);U(t)});for(t=allocatedAxes.length-1;t>=0;--t)z(allocatedAxes[t]);var r=a.grid.minBorderMargin;if(r==null){r=0;for(t=0;t<u.length;++t)r=Math.max(r,u[t].points.radius+u[t].points.lineWidth/2)}for(var i in m){m[i]+=a.grid.borderWidth;m[i]=Math.max(r,m[i])}}b=g-m.left-m.right;w=y-m.bottom-m.top;e.each(n,function(e,t){R(t)});if(a.grid.show){e.each(allocatedAxes,function(e,t){W(t)});tt()}at()}function V(e){var t=e.options,n=+(t.min!=null?t.min:e.datamin),r=+(t.max!=null?t.max:e.datamax),i=r-n;if(i==0){var s=r==0?1:.01;if(t.min==null)n-=s;if(t.max==null||t.min!=null)r+=s}else{var o=t.autoscaleMargin;if(o!=null){if(t.min==null){n-=i*o;if(n<0&&e.datamin!=null&&e.datamin>=0)n=0}if(t.max==null){r+=i*o;if(r>0&&e.datamax!=null&&e.datamax<=0)r=0}}}e.min=n;e.max=r}function J(t){var r=t.options;var i;if(typeof r.ticks=="number"&&r.ticks>0)i=r.ticks;else i=.3*Math.sqrt(t.direction=="x"?g:y);var s=(t.max-t.min)/i,o,u,a,f,l,c,h;if(r.mode=="time"){var p={second:1e3,minute:60*1e3,hour:60*60*1e3,day:24*60*60*1e3,month:30*24*60*60*1e3,year:365.2425*24*60*60*1e3};var m=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"],[3,"month"],[6,"month"],[1,"year"]];var b=0;if(r.minTickSize!=null){if(typeof r.tickSize=="number")b=r.tickSize;else b=r.minTickSize[0]*p[r.minTickSize[1]]}for(var l=0;l<m.length-1;++l)if(s<(m[l][0]*p[m[l][1]]+m[l+1][0]*p[m[l+1][1]])/2&&m[l][0]*p[m[l][1]]>=b)break;o=m[l][0];a=m[l][1];if(a=="year"){c=Math.pow(10,Math.floor(Math.log(s/p.year)/Math.LN10));h=s/p.year/c;if(h<1.5)o=1;else if(h<3)o=2;else if(h<7.5)o=5;else o=10;o*=c}t.tickSize=r.tickSize||[o,a];u=function(e){var t=[],r=e.tickSize[0],i=e.tickSize[1],s=new Date(e.min);var o=r*p[i];if(i=="second")s.setUTCSeconds(n(s.getUTCSeconds(),r));if(i=="minute")s.setUTCMinutes(n(s.getUTCMinutes(),r));if(i=="hour")s.setUTCHours(n(s.getUTCHours(),r));if(i=="month")s.setUTCMonth(n(s.getUTCMonth(),r));if(i=="year")s.setUTCFullYear(n(s.getUTCFullYear(),r));s.setUTCMilliseconds(0);if(o>=p.minute)s.setUTCSeconds(0);if(o>=p.hour)s.setUTCMinutes(0);if(o>=p.day)s.setUTCHours(0);if(o>=p.day*4)s.setUTCDate(1);if(o>=p.year)s.setUTCMonth(0);var u=0,a=Number.NaN,f;do{f=a;a=s.getTime();t.push(a);if(i=="month"){if(r<1){s.setUTCDate(1);var l=s.getTime();s.setUTCMonth(s.getUTCMonth()+1);var c=s.getTime();s.setTime(a+u*p.hour+(c-l)*r);u=s.getUTCHours();s.setUTCHours(0)}else s.setUTCMonth(s.getUTCMonth()+r)}else if(i=="year"){s.setUTCFullYear(s.getUTCFullYear()+r)}else s.setTime(a+o)}while(a<e.max&&a!=f);return t};f=function(t,n){var i=new Date(t);if(r.timeformat!=null)return e.plot.formatDate(i,r.timeformat,r.monthNames);var s=n.tickSize[0]*p[n.tickSize[1]];var o=n.max-n.min;var u=r.twelveHourClock?" %p":"";if(s<p.minute)fmt="%h:%M:%S"+u;else if(s<p.day){if(o<2*p.day)fmt="%h:%M"+u;else fmt="%b %d %h:%M"+u}else if(s<p.month)fmt="%b %d";else if(s<p.year){if(o<p.year)fmt="%b";else fmt="%b %y"}else fmt="%y";return e.plot.formatDate(i,fmt,r.monthNames)}}else{var w=r.tickDecimals;var E=-Math.floor(Math.log(s)/Math.LN10);if(w!=null&&E>w)E=w;c=Math.pow(10,-E);h=s/c;if(h<1.5)o=1;else if(h<3){o=2;if(h>2.25&&(w==null||E+1<=w)){o=2.5;++E}}else if(h<7.5)o=5;else o=10;o*=c;if(r.minTickSize!=null&&o<r.minTickSize)o=r.minTickSize;t.tickDecimals=Math.max(0,w!=null?w:E);t.tickSize=r.tickSize||o;u=function(e){var t=[];var r=n(e.min,e.tickSize),i=0,s=Number.NaN,o;do{o=s;s=r+i*e.tickSize;t.push(s);++i}while(s<e.max&&s!=o);return t};f=function(e,t){return e.toFixed(t.tickDecimals)}}if(r.alignTicksWithAxis!=null){var S=(t.direction=="x"?d:v)[r.alignTicksWithAxis-1];if(S&&S.used&&S!=t){var x=u(t);if(x.length>0){if(r.min==null)t.min=Math.min(t.min,x[0]);if(r.max==null&&x.length>1)t.max=Math.max(t.max,x[x.length-1])}u=function(e){var t=[],n,r;for(r=0;r<S.ticks.length;++r){n=(S.ticks[r].v-S.min)/(S.max-S.min);n=e.min+n*(e.max-e.min);t.push(n)}return t};if(t.mode!="time"&&r.tickDecimals==null){var T=Math.max(0,-Math.floor(Math.log(s)/Math.LN10)+1),N=u(t);if(!(N.length>1&&/\..*0$/.test((N[1]-N[0]).toFixed(T))))t.tickDecimals=T}}}t.tickGenerator=u;if(e.isFunction(r.tickFormatter))t.tickFormatter=function(e,t){return""+r.tickFormatter(e,t)};else t.tickFormatter=f}function K(t){var n=t.options.ticks,r=[];if(n==null||typeof n=="number"&&n>0)r=t.tickGenerator(t);else if(n){if(e.isFunction(n))r=n({min:t.min,max:t.max});else r=n}var i,s;t.ticks=[];for(i=0;i<r.length;++i){var o=null;var u=r[i];if(typeof u=="object"){s=+u[0];if(u.length>1)o=u[1]}else s=+u;if(o==null)o=t.tickFormatter(s,t);if(!isNaN(s))t.ticks.push({v:s,label:o})}}function Q(e,t){if(e.options.autoscaleMargin&&t.length>0){if(e.options.min==null)e.min=Math.min(e.min,t[0].v);if(e.options.max==null&&t.length>1)e.max=Math.max(e.max,t[t.length-1].v)}}function G(){h.clearRect(0,0,g,y);var e=a.grid;if(e.show&&e.backgroundColor)Z();if(e.show&&!e.aboveData)et();for(var t=0;t<u.length;++t){x(E.drawSeries,[h,u[t]]);nt(u[t])}x(E.draw,[h]);if(e.show&&e.aboveData)et()}function Y(e,t){var n,r,s,o,u=A();for(i=0;i<u.length;++i){n=u[i];if(n.direction==t){o=t+n.n+"axis";if(!e[o]&&n.n==1)o=t+"axis";if(e[o]){r=e[o].from;s=e[o].to;break}}}if(!e[o]){n=t=="x"?d[0]:v[0];r=e[t+"1"];s=e[t+"2"]}if(r!=null&&s!=null&&r>s){var a=r;r=s;s=a}return{from:r,to:s,axis:n}}function Z(){h.save();h.translate(m.left,m.top);h.fillStyle=xt(a.grid.backgroundColor,w,0,"rgba(255, 255, 255, 0)");h.fillRect(0,0,b,w);h.restore()}function et(){var t;h.save();h.translate(m.left,m.top);var n=a.grid.markings;if(n){if(e.isFunction(n)){var r=S.getAxes();r.xmin=r.xaxis.min;r.xmax=r.xaxis.max;r.ymin=r.yaxis.min;r.ymax=r.yaxis.max;n=n(r)}for(t=0;t<n.length;++t){var i=n[t],s=Y(i,"x"),o=Y(i,"y");if(s.from==null)s.from=s.axis.min;if(s.to==null)s.to=s.axis.max;if(o.from==null)o.from=o.axis.min;if(o.to==null)o.to=o.axis.max;if(s.to<s.axis.min||s.from>s.axis.max||o.to<o.axis.min||o.from>o.axis.max)continue;s.from=Math.max(s.from,s.axis.min);s.to=Math.min(s.to,s.axis.max);o.from=Math.max(o.from,o.axis.min);o.to=Math.min(o.to,o.axis.max);if(s.from==s.to&&o.from==o.to)continue;s.from=s.axis.p2c(s.from);s.to=s.axis.p2c(s.to);o.from=o.axis.p2c(o.from);o.to=o.axis.p2c(o.to);if(s.from==s.to||o.from==o.to){h.beginPath();h.strokeStyle=i.color||a.grid.markingsColor;h.lineWidth=i.lineWidth||a.grid.markingsLineWidth;h.moveTo(s.from,o.from);h.lineTo(s.to,o.to);h.stroke()}else{h.fillStyle=i.color||a.grid.markingsColor;h.fillRect(s.from,o.to,s.to-s.from,o.from-o.to)}}}var r=A(),u=a.grid.borderWidth;for(var f=0;f<r.length;++f){var l=r[f],c=l.box,p=l.tickLength,d,v,g,y;if(!l.show||l.ticks.length==0)continue;h.strokeStyle=l.options.tickColor||e.color.parse(l.options.color).scale("a",.22).toString();h.lineWidth=1;if(l.direction=="x"){d=0;if(p=="full")v=l.position=="top"?0:w;else v=c.top-m.top+(l.position=="top"?c.height:0)}else{v=0;if(p=="full")d=l.position=="left"?0:b;else d=c.left-m.left+(l.position=="left"?c.width:0)}if(!l.innermost){h.beginPath();g=y=0;if(l.direction=="x")g=b;else y=w;if(h.lineWidth==1){d=Math.floor(d)+.5;v=Math.floor(v)+.5}h.moveTo(d,v);h.lineTo(d+g,v+y);h.stroke()}h.beginPath();for(t=0;t<l.ticks.length;++t){var E=l.ticks[t].v;g=y=0;if(E<l.min||E>l.max||p=="full"&&u>0&&(E==l.min||E==l.max))continue;if(l.direction=="x"){d=l.p2c(E);y=p=="full"?-w:p;if(l.position=="top")y=-y}else{v=l.p2c(E);g=p=="full"?-b:p;if(l.position=="left")g=-g}if(h.lineWidth==1){if(l.direction=="x")d=Math.floor(d)+.5;else v=Math.floor(v)+.5}h.moveTo(d,v);h.lineTo(d+g,v+y)}h.stroke()}if(u){h.lineWidth=u;h.strokeStyle=a.grid.borderColor;h.strokeRect(-u/2,-u/2,b+u,w+u)}h.restore()}function tt(){t.find(".tickLabels").remove();var e=['<div class="tickLabels" style="font-size:smaller">'];var n=A();for(var r=0;r<n.length;++r){var i=n[r],s=i.box;if(!i.show)continue;e.push('<div class="'+i.direction+"Axis "+i.direction+i.n+'Axis" style="color:'+i.options.color+'">');for(var o=0;o<i.ticks.length;++o){var u=i.ticks[o];if(!u.label||u.v<i.min||u.v>i.max)continue;var a={},f;if(i.direction=="x"){f="center";a.left=Math.round(m.left+i.p2c(u.v)-i.labelWidth/2);if(i.position=="bottom")a.top=s.top+s.padding;else a.bottom=y-(s.top+s.height-s.padding)}else{a.top=Math.round(m.top+i.p2c(u.v)-i.labelHeight/2);if(i.position=="left"){a.right=g-(s.left+s.width-s.padding);f="right"}else{a.left=s.left+s.padding;f="left"}}a.width=i.labelWidth;var l=["position:absolute","text-align:"+f];for(var c in a)l.push(c+":"+a[c]+"px");e.push('<div class="tickLabel" style="'+l.join(";")+'">'+u.label+"</div>")}e.push("</div>")}e.push("</div>");t.append(e.join(""))}function nt(e){if(e.lines.show)rt(e);if(e.bars.show)ot(e);if(e.points.show)it(e)}function rt(e){function t(e,t,n,r,i){var s=e.points,o=e.pointsize,u=null,a=null;h.beginPath();for(var f=o;f<s.length;f+=o){var l=s[f-o],c=s[f-o+1],p=s[f],d=s[f+1];if(l==null||p==null)continue;if(c<=d&&c<i.min){if(d<i.min)continue;l=(i.min-c)/(d-c)*(p-l)+l;c=i.min}else if(d<=c&&d<i.min){if(c<i.min)continue;p=(i.min-c)/(d-c)*(p-l)+l;d=i.min}if(c>=d&&c>i.max){if(d>i.max)continue;l=(i.max-c)/(d-c)*(p-l)+l;c=i.max}else if(d>=c&&d>i.max){if(c>i.max)continue;p=(i.max-c)/(d-c)*(p-l)+l;d=i.max}if(l<=p&&l<r.min){if(p<r.min)continue;c=(r.min-l)/(p-l)*(d-c)+c;l=r.min}else if(p<=l&&p<r.min){if(l<r.min)continue;d=(r.min-l)/(p-l)*(d-c)+c;p=r.min}if(l>=p&&l>r.max){if(p>r.max)continue;c=(r.max-l)/(p-l)*(d-c)+c;l=r.max}else if(p>=l&&p>r.max){if(l>r.max)continue;d=(r.max-l)/(p-l)*(d-c)+c;p=r.max}if(l!=u||c!=a)h.moveTo(r.p2c(l)+t,i.p2c(c)+n);u=p;a=d;h.lineTo(r.p2c(p)+t,i.p2c(d)+n)}h.stroke()}function n(e,t,n){var r=e.points,i=e.pointsize,s=Math.min(Math.max(0,n.min),n.max),o=0,u,a=false,f=1,l=0,c=0;while(true){if(i>0&&o>r.length+i)break;o+=i;var p=r[o-i],d=r[o-i+f],v=r[o],m=r[o+f];if(a){if(i>0&&p!=null&&v==null){c=o;i=-i;f=2;continue}if(i<0&&o==l+i){h.fill();a=false;i=-i;f=1;o=l=c+i;continue}}if(p==null||v==null)continue;if(p<=v&&p<t.min){if(v<t.min)continue;d=(t.min-p)/(v-p)*(m-d)+d;p=t.min}else if(v<=p&&v<t.min){if(p<t.min)continue;m=(t.min-p)/(v-p)*(m-d)+d;v=t.min}if(p>=v&&p>t.max){if(v>t.max)continue;d=(t.max-p)/(v-p)*(m-d)+d;p=t.max}else if(v>=p&&v>t.max){if(p>t.max)continue;m=(t.max-p)/(v-p)*(m-d)+d;v=t.max}if(!a){h.beginPath();h.moveTo(t.p2c(p),n.p2c(s));a=true}if(d>=n.max&&m>=n.max){h.lineTo(t.p2c(p),n.p2c(n.max));h.lineTo(t.p2c(v),n.p2c(n.max));continue}else if(d<=n.min&&m<=n.min){h.lineTo(t.p2c(p),n.p2c(n.min));h.lineTo(t.p2c(v),n.p2c(n.min));continue}var g=p,y=v;if(d<=m&&d<n.min&&m>=n.min){p=(n.min-d)/(m-d)*(v-p)+p;d=n.min}else if(m<=d&&m<n.min&&d>=n.min){v=(n.min-d)/(m-d)*(v-p)+p;m=n.min}if(d>=m&&d>n.max&&m<=n.max){p=(n.max-d)/(m-d)*(v-p)+p;d=n.max}else if(m>=d&&m>n.max&&d<=n.max){v=(n.max-d)/(m-d)*(v-p)+p;m=n.max}if(p!=g){h.lineTo(t.p2c(g),n.p2c(d))}h.lineTo(t.p2c(p),n.p2c(d));h.lineTo(t.p2c(v),n.p2c(m));if(v!=y){h.lineTo(t.p2c(v),n.p2c(m));h.lineTo(t.p2c(y),n.p2c(m))}}}h.save();h.translate(m.left,m.top);h.lineJoin="round";var r=e.lines.lineWidth,i=e.shadowSize;if(r>0&&i>0){h.lineWidth=i;h.strokeStyle="rgba(0,0,0,0.1)";var s=Math.PI/18;t(e.datapoints,Math.sin(s)*(r/2+i/2),Math.cos(s)*(r/2+i/2),e.xaxis,e.yaxis);h.lineWidth=i/2;t(e.datapoints,Math.sin(s)*(r/2+i/4),Math.cos(s)*(r/2+i/4),e.xaxis,e.yaxis)}h.lineWidth=r;h.strokeStyle=e.color;var o=ut(e.lines,e.color,0,w);if(o){h.fillStyle=o;n(e.datapoints,e.xaxis,e.yaxis)}if(r>0)t(e.datapoints,0,0,e.xaxis,e.yaxis);h.restore()}function it(e){function t(e,t,n,r,i,s,o,u){var a=e.points,f=e.pointsize;for(var l=0;l<a.length;l+=f){var c=a[l],p=a[l+1];if(c==null||c<s.min||c>s.max||p<o.min||p>o.max)continue;h.beginPath();c=s.p2c(c);p=o.p2c(p)+r;if(u=="circle")h.arc(c,p,t,0,i?Math.PI:Math.PI*2,false);else u(h,c,p,t,i);h.closePath();if(n){h.fillStyle=n;h.fill()}h.stroke()}}h.save();h.translate(m.left,m.top);var n=e.points.lineWidth,r=e.shadowSize,i=e.points.radius,s=e.points.symbol;if(n>0&&r>0){var o=r/2;h.lineWidth=o;h.strokeStyle="rgba(0,0,0,0.1)";t(e.datapoints,i,null,o+o/2,true,e.xaxis,e.yaxis,s);h.strokeStyle="rgba(0,0,0,0.2)";t(e.datapoints,i,null,o/2,true,e.xaxis,e.yaxis,s)}h.lineWidth=n;h.strokeStyle=e.color;t(e.datapoints,i,ut(e.points,e.color),0,false,e.xaxis,e.yaxis,s);h.restore()}function st(e,t,n,r,i,s,o,u,a,f,l,c){var h,p,d,v,m,g,y,b,w;if(l){b=g=y=true;m=false;h=n;p=e;v=t+r;d=t+i;if(p<h){w=p;p=h;h=w;m=true;g=false}}else{m=g=y=true;b=false;h=e+r;p=e+i;d=n;v=t;if(v<d){w=v;v=d;d=w;b=true;y=false}}if(p<u.min||h>u.max||v<a.min||d>a.max)return;if(h<u.min){h=u.min;m=false}if(p>u.max){p=u.max;g=false}if(d<a.min){d=a.min;b=false}if(v>a.max){v=a.max;y=false}h=u.p2c(h);d=a.p2c(d);p=u.p2c(p);v=a.p2c(v);if(o){f.beginPath();f.moveTo(h,d);f.lineTo(h,v);f.lineTo(p,v);f.lineTo(p,d);f.fillStyle=o(d,v);f.fill()}if(c>0&&(m||g||y||b)){f.beginPath();f.moveTo(h,d+s);if(m)f.lineTo(h,v+s);else f.moveTo(h,v+s);if(y)f.lineTo(p,v+s);else f.moveTo(p,v+s);if(g)f.lineTo(p,d+s);else f.moveTo(p,d+s);if(b)f.lineTo(h,d+s);else f.moveTo(h,d+s);f.stroke()}}function ot(e){function t(t,n,r,i,s,o,u){var a=t.points,f=t.pointsize;for(var l=0;l<a.length;l+=f){if(a[l]==null)continue;st(a[l],a[l+1],a[l+2],n,r,i,s,o,u,h,e.bars.horizontal,e.bars.lineWidth)}}h.save();h.translate(m.left,m.top);h.lineWidth=e.bars.lineWidth;h.strokeStyle=e.color;var n=e.bars.align=="left"?0:-e.bars.barWidth/2;var r=e.bars.fill?function(t,n){return ut(e.bars,e.color,t,n)}:null;t(e.datapoints,n,n+e.bars.barWidth,0,r,e.xaxis,e.yaxis);h.restore()}function ut(t,n,r,i){var s=t.fill;if(!s)return null;if(t.fillColor)return xt(t.fillColor,r,i,n);var o=e.color.parse(n);o.a=typeof s=="number"?s:.4;o.normalize();return o.toString()}function at(){t.find(".legend").remove();if(!a.legend.show)return;var n=[],r=false,i=a.legend.labelFormatter,s,o;for(var f=0;f<u.length;++f){s=u[f];o=s.label;if(!o)continue;if(f%a.legend.noColumns==0){if(r)n.push("</tr>");n.push("<tr>");r=true}if(i)o=i(o,s);n.push('<td class="legendColorBox"><div style="border:1px solid '+a.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+s.color+';overflow:hidden"></div></div></td>'+'<td class="legendLabel">'+o+"</td>")}if(r)n.push("</tr>");if(n.length==0)return;var l='<table style="font-size:smaller;color:'+a.grid.color+'">'+n.join("")+"</table>";if(a.legend.container!=null)e(a.legend.container).html(l);else{var c="",h=a.legend.position,p=a.legend.margin;if(p[0]==null)p=[p,p];if(h.charAt(0)=="n")c+="top:"+(p[1]+m.top)+"px;";else if(h.charAt(0)=="s")c+="bottom:"+(p[1]+m.bottom)+"px;";if(h.charAt(1)=="e")c+="right:"+(p[0]+m.right)+"px;";else if(h.charAt(1)=="w")c+="left:"+(p[0]+m.left)+"px;";var d=e('<div class="legend">'+l.replace('style="','style="position:absolute;'+c+";")+"</div>").appendTo(t);if(a.legend.backgroundOpacity!=0){var v=a.legend.backgroundColor;if(v==null){v=a.grid.backgroundColor;if(v&&typeof v=="string")v=e.color.parse(v);else v=e.color.extract(d,"background-color");v.a=1;v=v.toString()}var g=d.children();e('<div style="position:absolute;width:'+g.width()+"px;height:"+g.height()+"px;"+c+"background-color:"+v+';"> </div>').prependTo(d).css("opacity",a.legend.backgroundOpacity)}}}function ct(e,t,n){var r=a.grid.mouseActiveRadius,i=r*r+1,s=null,o=false,f,l;for(f=u.length-1;f>=0;--f){if(!n(u[f]))continue;var c=u[f],h=c.xaxis,p=c.yaxis,d=c.datapoints.points,v=c.datapoints.pointsize,m=h.c2p(e),g=p.c2p(t),y=r/h.scale,b=r/p.scale;if(h.options.inverseTransform)y=Number.MAX_VALUE;if(p.options.inverseTransform)b=Number.MAX_VALUE;if(c.lines.show||c.points.show){for(l=0;l<d.length;l+=v){var w=d[l],E=d[l+1];if(w==null)continue;if(w-m>y||w-m<-y||E-g>b||E-g<-b)continue;var S=Math.abs(h.p2c(w)-e),x=Math.abs(p.p2c(E)-t),T=S*S+x*x;if(T<i){i=T;s=[f,l/v]}}}if(c.bars.show&&!s){var N=c.bars.align=="left"?0:-c.bars.barWidth/2,C=N+c.bars.barWidth;for(l=0;l<d.length;l+=v){var w=d[l],E=d[l+1],k=d[l+2];if(w==null)continue;if(u[f].bars.horizontal?m<=Math.max(k,w)&&m>=Math.min(k,w)&&g>=E+N&&g<=E+C:m>=w+N&&m<=w+C&&g>=Math.min(k,E)&&g<=Math.max(k,E))s=[f,l/v]}}}if(s){f=s[0];l=s[1];v=u[f].datapoints.pointsize;return{datapoint:u[f].datapoints.points.slice(l*v,(l+1)*v),dataIndex:l,series:u[f],seriesIndex:f}}return null}function ht(e){if(a.grid.hoverable)vt("plothover",e,function(e){return e["hoverable"]!=false})}function pt(e){if(a.grid.hoverable)vt("plothover",e,function(e){return false})}function dt(e){vt("plotclick",e,function(e){return e["clickable"]!=false})}function vt(e,n,r){var i=c.offset(),s=n.pageX-i.left-m.left,o=n.pageY-i.top-m.top,u=O({left:s,top:o});u.pageX=n.pageX;u.pageY=n.pageY;var f=ct(s,o,r);if(f){f.pageX=parseInt(f.series.xaxis.p2c(f.datapoint[0])+i.left+m.left);f.pageY=parseInt(f.series.yaxis.p2c(f.datapoint[1])+i.top+m.top)}if(a.grid.autoHighlight){for(var l=0;l<ft.length;++l){var h=ft[l];if(h.auto==e&&!(f&&h.series==f.series&&h.point[0]==f.datapoint[0]&&h.point[1]==f.datapoint[1]))bt(h.series,h.point)}if(f)yt(f.series,f.datapoint,e)}t.trigger(e,[u,f])}function mt(){if(!lt)lt=setTimeout(gt,30)}function gt(){lt=null;p.save();p.clearRect(0,0,g,y);p.translate(m.left,m.top);var e,t;for(e=0;e<ft.length;++e){t=ft[e];if(t.series.bars.show)St(t.series,t.point);else Et(t.series,t.point)}p.restore();x(E.drawOverlay,[p])}function yt(e,t,n){if(typeof e=="number")e=u[e];if(typeof t=="number"){var r=e.datapoints.pointsize;t=e.datapoints.points.slice(r*t,r*(t+1))}var i=wt(e,t);if(i==-1){ft.push({series:e,point:t,auto:n});mt()}else if(!n)ft[i].auto=false}function bt(e,t){if(e==null&&t==null){ft=[];mt()}if(typeof e=="number")e=u[e];if(typeof t=="number")t=e.data[t];var n=wt(e,t);if(n!=-1){ft.splice(n,1);mt()}}function wt(e,t){for(var n=0;n<ft.length;++n){var r=ft[n];if(r.series==e&&r.point[0]==t[0]&&r.point[1]==t[1])return n}return-1}function Et(t,n){var r=n[0],i=n[1],s=t.xaxis,o=t.yaxis;if(r<s.min||r>s.max||i<o.min||i>o.max)return;var u=t.points.radius+t.points.lineWidth/2;p.lineWidth=u;p.strokeStyle=e.color.parse(t.color).scale("a",.5).toString();var a=1.5*u,r=s.p2c(r),i=o.p2c(i);p.beginPath();if(t.points.symbol=="circle")p.arc(r,i,a,0,2*Math.PI,false);else t.points.symbol(p,r,i,a,false);p.closePath();p.stroke()}function St(t,n){p.lineWidth=t.bars.lineWidth;p.strokeStyle=e.color.parse(t.color).scale("a",.5).toString();var r=e.color.parse(t.color).scale("a",.5).toString();var i=t.bars.align=="left"?0:-t.bars.barWidth/2;st(n[0],n[1],n[2]||0,i,i+t.bars.barWidth,0,function(){return r},t.xaxis,t.yaxis,p,t.bars.horizontal,t.bars.lineWidth)}function xt(t,n,r,i){if(typeof t=="string")return t;else{var s=h.createLinearGradient(0,r,0,n);for(var o=0,u=t.colors.length;o<u;++o){var a=t.colors[o];if(typeof a!="string"){var f=e.color.parse(i);if(a.brightness!=null)f=f.scale("rgb",a.brightness);if(a.opacity!=null)f.a*=a.opacity;a=f.toString()}s.addColorStop(o/(u-1),a)}return s}}var u=[],a={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:true,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85},xaxis:{show:null,position:"bottom",mode:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null,monthNames:null,timeformat:null,twelveHourClock:false},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:false,radius:3,lineWidth:2,fill:true,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:false,fillColor:null,steps:false},bars:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,align:"left",horizontal:false},shadowSize:3},grid:{show:true,aboveData:false,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:false,hoverable:false,autoHighlight:true,mouseActiveRadius:10},hooks:{}},f=null,l=null,c=null,h=null,p=null,d=[],v=[],m={left:0,right:0,top:0,bottom:0},g=0,y=0,b=0,w=0,E={processOptions:[],processRawData:[],processDatapoints:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},S=this;S.setData=C;S.setupGrid=X;S.draw=G;S.getPlaceholder=function(){return t};S.getCanvas=function(){return f};S.getPlotOffset=function(){return m};S.width=function(){return b};S.height=function(){return w};S.offset=function(){var e=c.offset();e.left+=m.left;e.top+=m.top;return e};S.getData=function(){return u};S.getAxes=function(){var t={},n;e.each(d.concat(v),function(e,n){if(n)t[n.direction+(n.n!=1?n.n:"")+"axis"]=n});return t};S.getXAxes=function(){return d};S.getYAxes=function(){return v};S.c2p=O;S.p2c=M;S.getOptions=function(){return a};S.highlight=yt;S.unhighlight=bt;S.triggerRedrawOverlay=mt;S.pointOffset=function(e){return{left:parseInt(d[L(e,"x")-1].p2c(+e.x)+m.left),top:parseInt(v[L(e,"y")-1].p2c(+e.y)+m.top)}};S.shutdown=q;S.resize=function(){B();j(f);j(l)};S.hooks=E;T(S);N(s);F();C(r);X();G();I();var ft=[],lt=null}function n(e,t){return t*Math.floor(e/t)}e.plot=function(n,r,i){var s=new t(e(n),r,i,e.plot.plugins);return s};e.plot.version="0.7";e.plot.plugins=[];e.plot.formatDate=function(e,t,n){var r=function(e){e=""+e;return e.length==1?"0"+e:e};var i=[];var s=false,o=false;var u=e.getUTCHours();var a=u<12;if(n==null)n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];if(t.search(/%p|%P/)!=-1){if(u>12){u=u-12}else if(u==0){u=12}}for(var f=0;f<t.length;++f){var l=t.charAt(f);if(s){switch(l){case"h":l=""+u;break;case"H":l=r(u);break;case"M":l=r(e.getUTCMinutes());break;case"S":l=r(e.getUTCSeconds());break;case"d":l=""+e.getUTCDate();break;case"m":l=""+(e.getUTCMonth()+1);break;case"y":l=""+e.getUTCFullYear();break;case"b":l=""+n[e.getUTCMonth()];break;case"p":l=a?""+"am":""+"pm";break;case"P":l=a?""+"AM":""+"PM";break;case"0":l="";o=true;break}if(l&&o){l=r(l);o=false}i.push(l);if(!o)s=false}else{if(l=="%")s=true;else i.push(l)}}return i.join("")}})(jQuery)
// LABELEDSLIDER
$.widget("ui.labeledslider",$.ui.slider,{version:"@VERSION",options:{tickInterval:0,tweenLabels:true,tickLabels:null},uiSlider:null,tickInterval:0,tweenLabels:true,_create:function(){this._detectOrientation();this.uiSlider=this.element.wrap('<div class="ui-slider-wrapper ui-widget"></div>').before('<div class="ui-slider-labels">').parent().addClass(this.orientation).css("font-size",this.element.css("font-size"));this._super();this.element.removeClass("ui-widget");this._alignWithStep();if(this.orientation=="horizontal"){this.uiSlider.width(this.element.width())}else{this.uiSlider.height(this.element.height())}this._drawLabels()},_drawLabels:function(){var e=this.options.tickLabels||{},t=this.uiSlider.children(".ui-slider-labels"),n=this.orientation=="horizontal"?"left":"bottom",r=this.options.min,i=this.options.max,s=this.tickInterval,o=(i-r)/s,u=0;t.html("");for(;u<=o;u++){$("<div>").addClass("ui-slider-label-ticks").css(n,Math.round(u/o*1e4)/100+"%").html("<span>"+(e[u*s+r]?e[u*s+r]:this.options.tweenLabels?u*s+r:"")+"</span>").appendTo(t)}},_setOption:function(e,t){this._super(e,t);switch(e){case"tickInterval":case"tickLabels":case"min":case"max":case"step":this._alignWithStep();this._drawLabels();break;case"orientation":this.element.removeClass("horizontal vertical").addClass(this.orientation);this._drawLabels();break}},_alignWithStep:function(){if(this.options.tickInterval<this.options.step)this.tickInterval=this.options.step;else this.tickInterval=this.options.tickInterval},_destroy:function(){this._super();this.uiSlider.replaceWith(this.element)},widget:function(){return this.uiSlider}})
// here we go !
$( document ).ready(onLoaded);