input-duration 2.2.6 → 2.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2424 @@
1
+ function resizePlayer() {
2
+ var n = $(".video-container").width();
3
+ $(".video-container").height(Math.ceil(n / 16 * 9));
4
+ $(".video-container iframe").css("height", "98%")
5
+ }
6
+
7
+ function initSelectDates() {
8
+ $(".clip-date").length && $(".clip-date").selectpicker({
9
+ style: "btn-clip-date form-control input-lg",
10
+ size: 4
11
+ })
12
+ }
13
+
14
+ function loadPlayer(n, t) {
15
+ var i = $("#ProgramDateTime").val(),
16
+ r = $("#getVideoUrl").val();
17
+ $.getJSON(r, {
18
+ audioOnly: n,
19
+ autoStart: t
20
+ }, function(n) {
21
+ if ($("#videoContainer").html(n.scriptableEmbedCode), $("#ProgramDateTime").val(""), i != "") var t = setInterval(function() {
22
+ $("#ProgramDateTime").val() != "" && (clearInterval(t), setTimeout(function() {
23
+ var n = $("#UKPPlayer")[0],
24
+ t = {
25
+ "function": "seekPostMessage",
26
+ sender: document.location.href,
27
+ data: "seek-program-date-time_" + i + "_delaystart"
28
+ };
29
+ $.postMessage(JSON.stringify(t), n.src, n.contentWindow)
30
+ }, 600))
31
+ }, 200)
32
+ })
33
+ }
34
+
35
+ function updateTitle() {
36
+ var n = $("#eventTitleContainer").data("load-url");
37
+ $.get(n, function(n) {
38
+ $("#eventTitleContainer").html(n)
39
+ })
40
+ }
41
+
42
+ function updateDownloadForm() {
43
+ var n = $("#downloadFormContainer").data("load-url");
44
+ $.get(n, function(n) {
45
+ $("#downloadFormContainer").html(n)
46
+ })
47
+ }
48
+
49
+ function updateDownloadTab() {
50
+ var n = $("#download").data("load-url");
51
+ $.get(n, function(n) {
52
+ $("#download").html(n)
53
+ })
54
+ }
55
+
56
+ function updateClipping() {
57
+ var n = $("#clippingContainer").data("load-url");
58
+ $.get(n, function(n) {
59
+ $("#clippingContainer").html(n);
60
+ initSelectDates();
61
+ initCheckbox();
62
+ reloadEmbedData();
63
+ initSetShareTime();
64
+ initShareInputMask();
65
+ initShareUpdateEmbed()
66
+ })
67
+ }
68
+
69
+ function updateAudioButton() {
70
+ if ($("#audioToggle").hasClass("hidden")) {
71
+ var n = $("#audioToggle").data("load-url");
72
+ $.get(n, function(n) {
73
+ n && $("#audioToggle").removeClass("hidden")
74
+ })
75
+ }
76
+ }
77
+
78
+ function updateStacksAndLogs() {
79
+ $("#index-message").addClass("hidden")
80
+ }
81
+
82
+ function pollEvent() {
83
+ setTimeout(function() {
84
+ updateTitle();
85
+ updateAudioButton();
86
+ $("#AllowClippingRefresh").val() == "True" && updateClipping();
87
+ pollEvent()
88
+ }, eventPollingsInterval)
89
+ }
90
+
91
+ function stateChanged(n, t, i) {
92
+ updateTitle();
93
+ updateDownloadTab();
94
+ updateClipping();
95
+ updateAudioButton();
96
+ updateDownloadForm();
97
+ i == "REVOKE" && window.location.reload();
98
+ t == "COMPLETED" && updateStacksAndLogs()
99
+ }
100
+
101
+ function reloadEmbedData() {
102
+ function t() {
103
+ clearTimeout(embedGenTimeoutId);
104
+ embedGenTimeoutId = setTimeout(function() {
105
+ var t = n.options.start.input.val(),
106
+ r;
107
+ t == undefined && (t = "");
108
+ t != "" && (n.options.start.checkbox.prop("checked", !0), t = n.options.start.date.val() + "T" + t);
109
+ r = n.urlBase + "/" + n.eventId + "?in=" + t;
110
+ $.ajax(r, {
111
+ success: i
112
+ })
113
+ }, 500)
114
+ }
115
+
116
+ function i(t) {
117
+ n.fields.longUrl.val(t.pageUrl);
118
+ n.fields.embed.text(t.embedCode);
119
+ n.fields.longUrl.trigger("updated-url", t.pageUrl)
120
+ }
121
+ var n = {
122
+ options: {
123
+ start: {
124
+ input: $("#shareStartTime"),
125
+ date: $("#startClipDate"),
126
+ hiddenStart: $("#hiddenStart"),
127
+ checkbox: $("#startTimeCheck")
128
+ },
129
+ end: {
130
+ input: $("#shareEndTime"),
131
+ date: $("#endClipDate"),
132
+ hiddenEnd: $("#hiddenEnd"),
133
+ checkbox: $("#endTimeCheck")
134
+ }
135
+ },
136
+ urlBase: $("#share").data("url"),
137
+ eventId: $("#eventId").val(),
138
+ fields: {
139
+ longUrl: $("#url"),
140
+ embed: $("#embed")
141
+ },
142
+ timepickerOpts: {
143
+ defaultTime: !1,
144
+ showSeconds: !0,
145
+ showMeridian: !1,
146
+ minuteStep: 1,
147
+ secondStep: 1
148
+ }
149
+ };
150
+ $.each(n.options, function() {
151
+ if (this.hasOwnProperty("input")) this.input.on("changeTime.timepicker", t);
152
+ if (this.hasOwnProperty("date")) this.date.on("change", t)
153
+ });
154
+ $(n.options.start.checkbox).click(function() {
155
+ n.options.start.checkbox.prop("checked") == !1 ? (n.options.start.input.val(""), n.options.end.input.val(""), n.options.end.checkbox.prop("checked", !1), initCheckbox()) : n.options.start.input.val(n.options.start.hiddenStart.val());
156
+ t()
157
+ });
158
+ n.options.end.checkbox.click(function() {
159
+ n.options.end.checkbox.prop("checked") == !1 ? n.options.end.input.val("") : n.options.end.input.val(n.options.end.hiddenEnd.val());
160
+ t()
161
+ });
162
+ t()
163
+ }
164
+
165
+ function selectableEmbedCode() {
166
+ var n = $("#embed, #url");
167
+ n.bind("click", function() {
168
+ this.focus();
169
+ this.setSelectionRange(0, 9999)
170
+ })
171
+ }
172
+
173
+ function updateSocialLinks(n, t) {
174
+ var i = [$(".btn-facebook"), $(".btn-twitter"), $(".btn-google"), $(".btn-linkedin")];
175
+ t = encodeURIComponent(t);
176
+ $.each(i, function() {
177
+ var n = $(this).data("share-url");
178
+ this.hasClass("btn-twitter") ? (n += "Parliamentlive.tv ", n += "&url=" + t) : n += t;
179
+ $(this).attr("href", n)
180
+ })
181
+ }
182
+
183
+ function setAudioButtonState(n) {
184
+ var t = $("#audioToggle"),
185
+ i = $(t).data("audioonly-on-state");
186
+ if (i == "True") {
187
+ $(t).data("audioonly-on-state", "False");
188
+ n || loadPlayer(!0, !0);
189
+ $(t).html('video with audio <i class="fa fa-player-volume fa-2x"><\/i>');
190
+ return
191
+ }
192
+ if (i == "False") {
193
+ $(t).data("audioonly-on-state", "True");
194
+ n || loadPlayer(!1, !0);
195
+ $(t).html('audio only <i class="fa fa-player-volume fa-2x"><\/i>');
196
+ return
197
+ }
198
+ }
199
+
200
+ function audiOnlySwitch() {
201
+ setAudioButtonState(!0);
202
+ $(document).on("click", "#audioToggle", null, function() {
203
+ setAudioButtonState(!1)
204
+ })
205
+ }
206
+
207
+ function stopHub() {
208
+ $.connection.hub.stop()
209
+ }
210
+
211
+ function randomIntFromInterval(n, t) {
212
+ return Math.floor(Math.random() * (t - n + 1) + n)
213
+ }
214
+
215
+ function scrollStackAndLogs() {
216
+ $(".log-list").length && ($(".log-list").slimScroll({
217
+ railVisible: !0,
218
+ railColor: "#9c9c9c",
219
+ railOpacity: 1,
220
+ color: "#000",
221
+ size: "16px",
222
+ height: "525px",
223
+ alwaysVisible: !0,
224
+ disableFadeOut: !0,
225
+ start: logPos
226
+ }), $(".log-list").slimScroll().bind("slimscroll", function(n, t) {
227
+ logPos = t
228
+ }));
229
+ var n = window.matchMedia("(max-width: 480px)");
230
+ n.matches || $(".stack-list").length && ($(".stack-list").slimScroll({
231
+ railVisible: !0,
232
+ railColor: "#9c9c9c",
233
+ railOpacity: 1,
234
+ color: "#000",
235
+ size: "16px",
236
+ height: "525px",
237
+ alwaysVisible: !0,
238
+ disableFadeOut: !0,
239
+ start: logPos
240
+ }), $(".stack-list").slimScroll().bind("slimscroll", function(n, t) {
241
+ stackPos = t
242
+ }))
243
+ }
244
+
245
+ function refreshStackItems() {
246
+ var n = $("#stackTab").data("refresh-stack-url");
247
+ $.get(n, {}, function(n) {
248
+ $(".stack-list").html(n);
249
+ scrollStackAndLogs()
250
+ })
251
+ }
252
+
253
+ function refreshStackInterval() {
254
+ setInterval(refreshStackItems, 24e4)
255
+ }
256
+
257
+ function appendArchiveLog() {
258
+ $($(".log-list > li").get().reverse()).each(function(n, t) {
259
+ var i = $(t).find(".time-code").data("time"),
260
+ r;
261
+ return i == "" ? !0 : (r = $("#logTab").data("load-new-log-url"), $.get(r, {
262
+ startTime: i
263
+ }, function(n) {
264
+ $(n).insertAfter($(t))
265
+ }), !1)
266
+ })
267
+ }
268
+
269
+ function appendLiveLog() {
270
+ var n = randomIntFromInterval(1, 15) * 1e3;
271
+ setTimeout(function() {
272
+ var n = $(".log-list > li").first().find(".time-code").data("time"),
273
+ t = $("#logTab").data("load-new-log-url");
274
+ $.get(t, {
275
+ startTime: n
276
+ }, function(n) {
277
+ $(".log-list").prepend(n)
278
+ })
279
+ }, n)
280
+ }
281
+
282
+ function appendLogMoments() {
283
+ $("#LiveLogging").val() == "True" ? appendLiveLog() : appendArchiveLog()
284
+ }
285
+
286
+ function refreshLogMoments() {
287
+ var n = $("#logTab").data("refresh-log-url"),
288
+ t = randomIntFromInterval(1, 45) * 1e3;
289
+ setTimeout(function() {
290
+ $.get(n, {}, function(n) {
291
+ $(".log-list").html(n);
292
+ scrollStackAndLogs()
293
+ })
294
+ }, t)
295
+ }
296
+
297
+ function highlightLiveLog(n) {
298
+ var t = $(".log-list > li.logouter");
299
+ t.removeClass("active");
300
+ t = $(".log-list > li.logouter").get().reverse();
301
+ $(t).each(function(i, r) {
302
+ var u = $(r),
303
+ f = new Date(u.find(".time-code").data("time"));
304
+ if (n >= f) {
305
+ $(t[i - 1]).removeClass("active");
306
+ u.addClass("active");
307
+ return
308
+ }
309
+ })
310
+ }
311
+
312
+ function highlightArchiveLog(n) {
313
+ var t = $(".log-list > li.logouter");
314
+ t.removeClass("active");
315
+ t.each(function(i, r) {
316
+ var u = $(r),
317
+ f = new Date(u.find(".time-code").data("time"));
318
+ if (n >= f) {
319
+ $(t[i - 1]).removeClass("active");
320
+ u.addClass("active");
321
+ return
322
+ }
323
+ })
324
+ }
325
+
326
+ function highlightLogItems(n) {
327
+ $("#LiveLogging").val() == "True" ? highlightLiveLog(n) : highlightArchiveLog(n)
328
+ }
329
+
330
+ function logItemClicked(n) {
331
+ var r = $(this),
332
+ t, u, i, f;
333
+ return highlightItem = !1, t = r.find(".time-code").data("time"), lastClickedTimecode = new Date(t), u = $(".log-list > li.logouter"), u.removeClass("active"), r.addClass("active"), $("#seekToLiveButton").removeClass("btn-seek-to-live-grey"), i = $("#UKPPlayer")[0], f = {
334
+ "function": "seekPostMessage",
335
+ sender: document.location.href,
336
+ data: "seek-program-date-time_" + t
337
+ }, $.postMessage(JSON.stringify(f), i.src, i.contentWindow), setTimeout(function() {
338
+ highlightItem = !0
339
+ }, 6e3), n.preventDefault(), !1
340
+ }
341
+
342
+ function seekToLive() {
343
+ $("#seekToLiveButton").addClass("btn-seek-to-live-grey");
344
+ var n = $("#UKPPlayer")[0],
345
+ t = {
346
+ "function": "seekPostMessage",
347
+ sender: document.location.href,
348
+ data: "seek-to-live_true"
349
+ };
350
+ $.postMessage(JSON.stringify(t), n.src, n.contentWindow);
351
+ setTimeout(function() {
352
+ var n = $(".log-list > li.logouter");
353
+ n.removeClass("active")
354
+ }, 2e3)
355
+ }
356
+
357
+ function timeUpdate(n) {
358
+ var i = n.timeUpdateString.split("_"),
359
+ t;
360
+ i.length < 2 || i[0].indexOf("program-date-time") != -1 && (t = new Date(i[1]), $("#ProgramDateTime").val(t.toISOString()), (lastClickedTimecode == null || t > lastClickedTimecode) && highlightItem && highlightLogItems(t))
361
+ }
362
+
363
+ function initTermsAndConditions() {
364
+ var n = $(".acceptance");
365
+ n.on("click", termsAndConditionsClickHandler)
366
+ }
367
+
368
+ function initEnableEmbed() {
369
+ var n = document.getElementById("shareContinue");
370
+ n.addEventListener("click", enableEmbed)
371
+ }
372
+
373
+ function initEnableEmail() {
374
+ var n = document.getElementById("downloadContinue");
375
+ n.addEventListener("click", enableEmail)
376
+ }
377
+
378
+ function initSetShareTime() {
379
+ var n = $(".set-share-time");
380
+ n.on("click", getShareTime)
381
+ }
382
+
383
+ function initSetDownloadTime() {
384
+ var n = $(".set-download-time");
385
+ n.on("click", getDownloadTime)
386
+ }
387
+
388
+ function initSetClipboard() {
389
+ var n = $(".fa-clipboard");
390
+ n.on("click", copyToClipbloard)
391
+ }
392
+
393
+ function initSetFileType() {
394
+ var n = $(".fileType");
395
+ n.on("change", checkMakeClip)
396
+ }
397
+
398
+ function initEmailValid() {
399
+ var n = $("#email");
400
+ n.on("change", checkMakeClip)
401
+ }
402
+
403
+ function checkStartTime() {
404
+ var r = $("#downloadStartTime").val().split(":"),
405
+ e = $('[data-id="startDownloadDate"]')[0],
406
+ n = new Date(Date.parse(e.title)),
407
+ u, i, t, f;
408
+ if (n.setHours(n.getHours() + r[0]), n.setMinutes(n.getMinutes() + r[1]), n.setSeconds(n.getSeconds() + r[2]), u = document.getElementById("MeetingStartTime").value, !isNaN(n.valueOf()))
409
+ if (i = n.toISOString().split(".")[0] + "Z", t = $("#EndTime").val(), t === "" && (t = document.getElementById("MeetingEndTime").value), i < t && i >= u) {
410
+ if (f = new Date(t), f - n >= 324e5) {
411
+ setErrorMessage("Clip cannot exceed 9 hours");
412
+ return
413
+ }
414
+ setDownloadTimeForm("StartTime", i);
415
+ timesValid = !0;
416
+ keepError || $(".error-message").prop("hidden", !0);
417
+ checkMakeClip()
418
+ } else keepError = !1, i > t ? setErrorMessage("Start Time cannot be later than the End Time") : i === t ? setErrorMessage("Start Time cannot be equal to the End Time") : setErrorMessage("Start Time cannot be earlier than the meeting start time")
419
+ }
420
+
421
+ function setErrorMessage(n) {
422
+ $(".error-message").text(n);
423
+ $(".error-message").removeAttr("hidden");
424
+ timesValid = !1;
425
+ checkMakeClip()
426
+ }
427
+
428
+ function setDownloadTimeForm(n, t) {
429
+ document.getElementById(n).value = t
430
+ }
431
+
432
+ function checkEndTime() {
433
+ var r = $("#downloadEndTime").val().split(":"),
434
+ o = $('[data-id="endDownloadDate"]')[0],
435
+ n = new Date(Date.parse(o.title)),
436
+ u, t, i, f, e;
437
+ if (n.setHours(n.getHours() + r[0]), n.setMinutes(n.getMinutes() + r[1]), n.setSeconds(n.getSeconds() + r[2]), u = document.getElementById("MeetingEndTime").value, !isNaN(n.valueOf()))
438
+ if (t = n.toISOString().split(".")[0] + "Z", i = $("#StartTime").val(), t > i && t <= u) {
439
+ if (isLivePlayer() && (f = new Date(u).getTime() / 1e3, e = n.getTime() / 1e3, f - e <= 11)) {
440
+ setErrorMessage("End Time cannot be within 10 seconds of the live edge");
441
+ timesValid = !1;
442
+ return
443
+ }
444
+ setDownloadTimeForm("EndTime", t);
445
+ timesValid = !0;
446
+ keepError || $(".error-message").prop("hidden", !0);
447
+ checkMakeClip()
448
+ } else keepError = !1, t < i ? setErrorMessage("End Time cannot be earlier than the Start Time") : t === i ? setErrorMessage("End Time cannot be equal to the Start Time") : setErrorMessage("End Time cannot be later than the meeting end time")
449
+ }
450
+
451
+ function compareTimes() {
452
+ var s = document.getElementById("downloadStartTime").value.split(":"),
453
+ h = document.querySelectorAll('[data-id="startDownloadDate"]')[0],
454
+ c = document.getElementById("downloadEndTime").value.split(":"),
455
+ l = document.querySelectorAll('[data-id="endDownloadDate"]')[0],
456
+ t = getDate(s, h),
457
+ n = getDate(c, l),
458
+ u = document.getElementById("MeetingStartTime").value,
459
+ f = document.getElementById("MeetingEndTime").value,
460
+ i, r;
461
+ if (isNaN(n.valueOf()) || isNaN(t.valueOf())) return !1;
462
+ if (i = t.toISOString().split(".")[0] + "Z", r = n.toISOString().split(".")[0] + "Z", n - t >= 1e4 && r <= f && i >= u) return n - t >= 324e5 ? (setErrorMessage("Clip cannot exceed 9 hours"), !1) : checkLiveEdge(f, n) ? (setDownloadTimeForm("StartTime", i), setDownloadTimeForm("EndTime", r), timesValid = !0, keepError || (document.getElementsByClassName("error-message")[0].hidden = !0), checkMakeClip()) : !1;
463
+ keepError = !1;
464
+ setTimeError(i, r, u);
465
+ var e = new Date(u),
466
+ a = new Date(e.getFullYear(), e.getMonth(), e.getDate()),
467
+ o = new Date(f),
468
+ v = new Date(o.getFullYear(), o.getMonth(), o.getDate());
469
+ return Math.floor((v.getTime() - a.getTime()) / 864e5) > 0 && $(".error-message").append(" Please ensure you have selected the correct date"), !1
470
+ }
471
+
472
+ function getDate(n, t) {
473
+ var i = "+0000";
474
+ return document.getElementById("IsEventDaylightSavingTime").value === "True" && (i = "+0100"), new Date(Date.parse(t.title + " " + n[0] + ":" + n[1] + ":" + n[2] + " GMT" + i))
475
+ }
476
+
477
+ function checkLiveEdge(n, t) {
478
+ if (isLivePlayer()) {
479
+ var i = new Date(n).getTime() / 1e3,
480
+ r = t.getTime() / 1e3;
481
+ if (i - r <= 11) return setErrorMessage("End Time cannot be within 10 seconds of the live edge"), timesValid = !1, !1
482
+ }
483
+ return !0
484
+ }
485
+
486
+ function setTimeError(n, t, i) {
487
+ startDate = new Date(n);
488
+ endDate = new Date(t);
489
+ n > t ? setErrorMessage("Start Time cannot be later than the End Time.") : endDate - startDate < 1e4 ? setErrorMessage("Start Time and End Time must be at least 10 seconds apart.") : n < i ? setErrorMessage("Start Time cannot be earlier than the meeting start time.") : t < n ? setErrorMessage("End Time cannot be earlier than the Start Time.") : setErrorMessage("End Time cannot be later than the meeting end time.")
490
+ }
491
+
492
+ function termsAndConditionsClickHandler(n) {
493
+ var t = n.target.dataset.continueId;
494
+ enableDisableButton(t, n.target.checked)
495
+ }
496
+
497
+ function enableDisableButton(n, t) {
498
+ var i = document.getElementById(n);
499
+ t ? $(i).removeAttr("disabled") : $(i).prop("disabled", !0)
500
+ }
501
+
502
+ function enableEmbed() {
503
+ var n = $(".embed-code"),
504
+ t = $(".share-terms");
505
+ t.fadeOut();
506
+ n.fadeIn();
507
+ urlPageNavigation("#player-tabs")
508
+ }
509
+
510
+ function enableEmail() {
511
+ var n = $(".email-me"),
512
+ t = $(".download-terms");
513
+ t.fadeOut();
514
+ n.fadeIn();
515
+ urlPageNavigation("#player-tabs")
516
+ }
517
+
518
+ function urlPageNavigation(n) {
519
+ var t = window.location.href;
520
+ t.indexOf("#") !== -1 ? t = t.substring(0, t.indexOf("#")) + n : t += n;
521
+ window.location.href = t
522
+ }
523
+
524
+ function copyToClipbloard() {
525
+ var i = document.querySelector("#embed"),
526
+ n, t, r;
527
+ i.select();
528
+ n = $(".response-message");
529
+ try {
530
+ t = document.execCommand("copy");
531
+ r = t ? "successful" : "unsuccessful";
532
+ n.text("Copied to Clipboard");
533
+ n.addClass("show")
534
+ } catch (u) {
535
+ n.text("unable to copy")
536
+ }
537
+ }
538
+
539
+ function resetDownloadTab() {
540
+ $(".thankyou").prop("hidden", !0);
541
+ $(".download-form").removeAttr("hidden");
542
+ $("#email").val("");
543
+ document.getElementById("ClipRequested").value = !1;
544
+ document.getElementById("EmailAddress").value = "";
545
+ grecaptcha.reset()
546
+ }
547
+
548
+ function checkMakeClip() {
549
+ var n = !1,
550
+ t = document.getElementById("ClipRequested").value === "true";
551
+ return isRadioChecked() && isValidEmail() && captchaValid && timesValid && !t && (n = !0), n ? ($("#downloadSubmit").removeAttr("disabled"), keepError || $(".error-message").prop("hidden", !0)) : $("#downloadSubmit").prop("disabled", !0), n
552
+ }
553
+
554
+ function isRadioChecked() {
555
+ var n = $("input:radio.radioFileType:checked");
556
+ return n.length > 0 ? ($("#AudioOnly").val(n[0].id === "fileType2"), !0) : !1
557
+ }
558
+
559
+ function isValidEmail() {
560
+ var n = $("#email").val(),
561
+ t = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n);
562
+ return t && $("#EmailAddress").val(n), t
563
+ }
564
+
565
+ function captchaResponse() {
566
+ return grecaptcha.getResponse()
567
+ }
568
+
569
+ function expCallback() {
570
+ captchaValid = !1;
571
+ checkMakeClip()
572
+ }
573
+
574
+ function recaptchaCallback() {
575
+ captchaValid = !0;
576
+ checkMakeClip()
577
+ }
578
+
579
+ function initShareUpdateEmbed() {
580
+ var n = document.getElementById("shareStartTime"),
581
+ t = document.getElementById("shareEndTime");
582
+ n != null && t != null && (n.addEventListener("focusout", reloadEmbedData), t.addEventListener("focusout", reloadEmbedData), n.addEventListener("focusout", updatePartnerElement), t.addEventListener("focusout", updatePartnerElement), n.addEventListener("focusout", compareTimes), t.addEventListener("focusout", compareTimes))
583
+ }
584
+
585
+ function updatePartnerElement(n) {
586
+ document.getElementById(n.target.dataset.partnerId).value = n.target.value;
587
+ reloadEmbedData()
588
+ }
589
+
590
+ function initInputMask() {
591
+ var n = document.getElementById("downloadStartTime"),
592
+ t = document.getElementById("downloadEndTime");
593
+ n != null && t != null && (n.addEventListener("keydown", inputMask), n.addEventListener("input", mobileMask), t.addEventListener("keydown", inputMask), t.addEventListener("input", mobileMask))
594
+ }
595
+
596
+ function initShareInputMask() {
597
+ var n = document.getElementById("shareStartTime"),
598
+ t = document.getElementById("shareEndTime");
599
+ n != null && t != null && (n.addEventListener("keydown", inputMask), n.addEventListener("input", mobileMask), t.addEventListener("keydown", inputMask), t.addEventListener("input", mobileMask))
600
+ }
601
+
602
+ function mobileMask(n) {
603
+ var e = "00:00:00",
604
+ r = n.target.dataset.lastInput,
605
+ t, u, f, i;
606
+ if (androidInput) {
607
+ if (t = this.selectionStart, u = this.selectionEnd, t === u ? (f = n.target.value.substring(t - 1, u), t--) : f = n.target.value.substring(t, u), r !== n.target.value) {
608
+ if (i = parseInt(f), isNaN(i) || t === 8) {
609
+ n.target.value = r;
610
+ return
611
+ }
612
+ r.substring(t, t + 1) === ":" && (t++, u++);
613
+ n.target.value.substring(t + 1, t + 2) === ":" && (t++, u++);
614
+ t === 0 && i > 2 && (i = 2, parseInt(n.target.value.substr(t + 1, t + 2)) > 3 && i > 1 && (i = 1));
615
+ t === 1 && n.target.value.substr(0, 1) === "2" && i > 3 && (i = 3);
616
+ (t === 3 || t === 6 || t === 2 || t === 5) && i > 5 && (i = 5);
617
+ n.target.value = r.substring(0, t) + i + r.substring(u, r.length);
618
+ n.target.value += e.substr(n.target.value.length, e.length);
619
+ r = n.target.value;
620
+ n.target.dataset.lastInput = r;
621
+ this.selectionStart = t + 1;
622
+ this.selectionEnd = t + 1
623
+ }
624
+ androidInput = !1
625
+ }
626
+ }
627
+
628
+ function inputMask(n) {
629
+ var e = "00:00:00",
630
+ i = n.target.value,
631
+ t = this.selectionStart,
632
+ r = this.selectionEnd,
633
+ f = "",
634
+ u, o, s;
635
+ if (n.keyCode === 229) {
636
+ androidInput = !0;
637
+ return
638
+ }
639
+ n.keyCode < 41 && n.keyCode > 36 || (n.preventDefault(), n.keyCode === 8 && (t === r && t--, f = i.substring(0, t) + e.substring(t, r) + i.substring(r, i.length), ApplyMask(n.target, f, e, t)), n.keyCode === 46 && (t === r && n.keyCode === 46 && r++, f = i.substring(0, t) + e.substring(t, r) + i.substring(r, i.length), ApplyMask(n.target, f, e, r)), u = parseInt(n.key), isNaN(u)) || t !== 8 && (t === 0 && u > 2 && (u = 2), parseInt(i.substr(t + 1, t + 2)) > 3 && u > 1 && (u = 1), t === 1 && i.substr(0, 1) === "2" && u > 3 && (u = 3), (t === 3 || t === 6 || t === 2 || t === 5) && u > 5 && (u = 5), i.substring(t, t + 1) === ":" && (t++, r++), t === r ? f = i.substr(0, t) + u + i.substr(r + 1, i.length) : (o = u + e.substr(t + 1, r - 1), f = i.substring(0, t) + o, s = f.length, f += i.substr(s, 8)), ApplyMask(n.target, f, e, t + 1))
640
+ }
641
+
642
+ function ApplyMask(n, t, i, r) {
643
+ t += i.substr(t.length, i.length);
644
+ n.value = t;
645
+ n.selectionStart = r;
646
+ n.selectionEnd = n.selectionStart;
647
+ n.dataset.lastInput = n.value
648
+ }
649
+ var embedGenTimeoutId, eventPollingsInterval, androidInput;
650
+ $(function() {
651
+ resizePlayer();
652
+ setTimeout(function() {
653
+ resizePlayer()
654
+ }, 1e3);
655
+ $(window).resize(function() {
656
+ resizePlayer()
657
+ })
658
+ }),
659
+ function(n, t, i) {
660
+ function v(t, i) {
661
+ var u, f;
662
+ if (n.isArray(t)) {
663
+ for (u = t.length - 1; u >= 0; u--) f = t[u], n.type(f) === "string" && r.transports[f] || (i.log("Invalid transport: " + f + ", removing it from the transports list."), t.splice(u, 1));
664
+ t.length === 0 && (i.log("No transports remain within the specified transport array."), t = null)
665
+ } else if (r.transports[t] || t === "auto") {
666
+ if (t === "auto" && r._.ieVersion <= 8) return ["longPolling"]
667
+ } else i.log("Invalid transport: " + t.toString() + "."), t = null;
668
+ return t
669
+ }
670
+
671
+ function y(n) {
672
+ return n === "http:" ? 80 : n === "https:" ? 443 : void 0
673
+ }
674
+
675
+ function h(n, t) {
676
+ return t.match(/:\d+$/) ? t : t + ":" + y(n)
677
+ }
678
+
679
+ function p(t, i) {
680
+ var u = this,
681
+ r = [];
682
+ u.tryBuffer = function(i) {
683
+ return t.state === n.signalR.connectionState.connecting ? (r.push(i), !0) : !1
684
+ };
685
+ u.drain = function() {
686
+ if (t.state === n.signalR.connectionState.connected)
687
+ while (r.length > 0) i(r.shift())
688
+ };
689
+ u.clear = function() {
690
+ r = []
691
+ }
692
+ }
693
+ var f = {
694
+ nojQuery: "jQuery was not found. Please ensure jQuery is referenced before the SignalR client JavaScript file.",
695
+ noTransportOnInit: "No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization.",
696
+ errorOnNegotiate: "Error during negotiation request.",
697
+ stoppedWhileLoading: "The connection was stopped during page load.",
698
+ stoppedWhileNegotiating: "The connection was stopped during the negotiate request.",
699
+ errorParsingNegotiateResponse: "Error parsing negotiate response.",
700
+ errorDuringStartRequest: "Error during start request. Stopping the connection.",
701
+ stoppedDuringStartRequest: "The connection was stopped during the start request.",
702
+ errorParsingStartResponse: "Error parsing start response: '{0}'. Stopping the connection.",
703
+ invalidStartResponse: "Invalid start response: '{0}'. Stopping the connection.",
704
+ protocolIncompatible: "You are using a version of the client that isn't compatible with the server. Client version {0}, server version {1}.",
705
+ sendFailed: "Send failed.",
706
+ parseFailed: "Failed at parsing response: {0}",
707
+ longPollFailed: "Long polling request failed.",
708
+ eventSourceFailedToConnect: "EventSource failed to connect.",
709
+ eventSourceError: "Error raised by EventSource",
710
+ webSocketClosed: "WebSocket closed.",
711
+ pingServerFailedInvalidResponse: "Invalid ping response when pinging server: '{0}'.",
712
+ pingServerFailed: "Failed to ping server.",
713
+ pingServerFailedStatusCode: "Failed to ping server. Server responded with status code {0}, stopping the connection.",
714
+ pingServerFailedParse: "Failed to parse ping server response, stopping the connection.",
715
+ noConnectionTransport: "Connection is in an invalid state, there is no transport active.",
716
+ webSocketsInvalidState: "The Web Socket transport is in an invalid state, transitioning into reconnecting.",
717
+ reconnectTimeout: "Couldn't reconnect within the configured timeout of {0} ms, disconnecting.",
718
+ reconnectWindowTimeout: "The client has been inactive since {0} and it has exceeded the inactivity timeout of {1} ms. Stopping the connection."
719
+ };
720
+ if (typeof n != "function") throw new Error(f.nojQuery);
721
+ var r, c, s = t.document.readyState === "complete",
722
+ e = n(t),
723
+ l = "__Negotiate Aborted__",
724
+ u = {
725
+ onStart: "onStart",
726
+ onStarting: "onStarting",
727
+ onReceived: "onReceived",
728
+ onError: "onError",
729
+ onConnectionSlow: "onConnectionSlow",
730
+ onReconnecting: "onReconnecting",
731
+ onReconnect: "onReconnect",
732
+ onStateChanged: "onStateChanged",
733
+ onDisconnect: "onDisconnect"
734
+ },
735
+ w = function(n, i) {
736
+ if (i !== !1) {
737
+ var r;
738
+ typeof t.console != "undefined" && (r = "[" + (new Date).toTimeString() + "] SignalR: " + n, t.console.debug ? t.console.debug(r) : t.console.log && t.console.log(r))
739
+ }
740
+ },
741
+ o = function(t, i, r) {
742
+ return i === t.state ? (t.state = r, n(t).triggerHandler(u.onStateChanged, [{
743
+ oldState: i,
744
+ newState: r
745
+ }]), !0) : !1
746
+ },
747
+ b = function(n) {
748
+ return n.state === r.connectionState.disconnected
749
+ },
750
+ a = function(n) {
751
+ return n._.keepAliveData.activated && n.transport.supportsKeepAlive(n)
752
+ },
753
+ k = function(i) {
754
+ var f, e;
755
+ i._.configuredStopReconnectingTimeout || (e = function(t) {
756
+ var i = r._.format(r.resources.reconnectTimeout, t.disconnectTimeout);
757
+ t.log(i);
758
+ n(t).triggerHandler(u.onError, [r._.error(i, "TimeoutException")]);
759
+ t.stop(!1, !1)
760
+ }, i.reconnecting(function() {
761
+ var n = this;
762
+ n.state === r.connectionState.reconnecting && (f = t.setTimeout(function() {
763
+ e(n)
764
+ }, n.disconnectTimeout))
765
+ }), i.stateChanged(function(n) {
766
+ n.oldState === r.connectionState.reconnecting && t.clearTimeout(f)
767
+ }), i._.configuredStopReconnectingTimeout = !0)
768
+ };
769
+ r = function(n, t, i) {
770
+ return new r.fn.init(n, t, i)
771
+ };
772
+ r._ = {
773
+ defaultContentType: "application/x-www-form-urlencoded; charset=UTF-8",
774
+ ieVersion: function() {
775
+ var i, n;
776
+ return t.navigator.appName === "Microsoft Internet Explorer" && (n = /MSIE ([0-9]+\.[0-9]+)/.exec(t.navigator.userAgent), n && (i = t.parseFloat(n[1]))), i
777
+ }(),
778
+ error: function(n, t, i) {
779
+ var r = new Error(n);
780
+ return r.source = t, typeof i != "undefined" && (r.context = i), r
781
+ },
782
+ transportError: function(n, t, r, u) {
783
+ var f = this.error(n, r, u);
784
+ return f.transport = t ? t.name : i, f
785
+ },
786
+ format: function() {
787
+ for (var t = arguments[0], n = 0; n < arguments.length - 1; n++) t = t.replace("{" + n + "}", arguments[n + 1]);
788
+ return t
789
+ },
790
+ firefoxMajorVersion: function(n) {
791
+ var t = n.match(/Firefox\/(\d+)/);
792
+ return !t || !t.length || t.length < 2 ? 0 : parseInt(t[1], 10)
793
+ },
794
+ configurePingInterval: function(i) {
795
+ var f = i._.config,
796
+ e = function(t) {
797
+ n(i).triggerHandler(u.onError, [t])
798
+ };
799
+ f && !i._.pingIntervalId && f.pingInterval && (i._.pingIntervalId = t.setInterval(function() {
800
+ r.transports._logic.pingServer(i).fail(e)
801
+ }, f.pingInterval))
802
+ }
803
+ };
804
+ r.events = u;
805
+ r.resources = f;
806
+ r.ajaxDefaults = {
807
+ processData: !0,
808
+ timeout: null,
809
+ async: !0,
810
+ global: !1,
811
+ cache: !1
812
+ };
813
+ r.changeState = o;
814
+ r.isDisconnecting = b;
815
+ r.connectionState = {
816
+ connecting: 0,
817
+ connected: 1,
818
+ reconnecting: 2,
819
+ disconnected: 4
820
+ };
821
+ r.hub = {
822
+ start: function() {
823
+ throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. <script src='/signalr/js'><\/script>.");
824
+ }
825
+ };
826
+ e.load(function() {
827
+ s = !0
828
+ });
829
+ r.fn = r.prototype = {
830
+ init: function(t, i, r) {
831
+ var f = n(this);
832
+ this.url = t;
833
+ this.qs = i;
834
+ this.lastError = null;
835
+ this._ = {
836
+ keepAliveData: {},
837
+ connectingMessageBuffer: new p(this, function(n) {
838
+ f.triggerHandler(u.onReceived, [n])
839
+ }),
840
+ onFailedTimeoutHandle: null,
841
+ lastMessageAt: (new Date).getTime(),
842
+ lastActiveAt: (new Date).getTime(),
843
+ beatInterval: 5e3,
844
+ beatHandle: null,
845
+ totalTransportConnectTimeout: 0
846
+ };
847
+ typeof r == "boolean" && (this.logging = r)
848
+ },
849
+ _parseResponse: function(n) {
850
+ var t = this;
851
+ return n ? typeof n == "string" ? t.json.parse(n) : n : n
852
+ },
853
+ _originalJson: t.JSON,
854
+ json: t.JSON,
855
+ isCrossDomain: function(i, r) {
856
+ var u;
857
+ return (i = n.trim(i), r = r || t.location, i.indexOf("http") !== 0) ? !1 : (u = t.document.createElement("a"), u.href = i, u.protocol + h(u.protocol, u.host) !== r.protocol + h(r.protocol, r.host))
858
+ },
859
+ ajaxDataType: "text",
860
+ contentType: "application/json; charset=UTF-8",
861
+ logging: !1,
862
+ state: r.connectionState.disconnected,
863
+ clientProtocol: "1.4",
864
+ reconnectDelay: 2e3,
865
+ transportConnectTimeout: 0,
866
+ disconnectTimeout: 3e4,
867
+ reconnectWindow: 3e4,
868
+ keepAliveWarnAt: 2 / 3,
869
+ start: function(i, h) {
870
+ var c = this,
871
+ y = {
872
+ pingInterval: 3e5,
873
+ waitForPageLoad: !0,
874
+ transport: "auto",
875
+ jsonp: !1
876
+ },
877
+ d, p = c._deferral || n.Deferred(),
878
+ w = t.document.createElement("a"),
879
+ b, g;
880
+ if (c.lastError = null, c._deferral = p, !c.json) throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");
881
+ if (n.type(i) === "function" ? h = i : n.type(i) === "object" && (n.extend(y, i), n.type(y.callback) === "function" && (h = y.callback)), y.transport = v(y.transport, c), !y.transport) throw new Error("SignalR: Invalid transport(s) specified, aborting start.");
882
+ return (c._.config = y, !s && y.waitForPageLoad === !0) ? (c._.deferredStartHandler = function() {
883
+ c.start(i, h)
884
+ }, e.bind("load", c._.deferredStartHandler), p.promise()) : c.state === r.connectionState.connecting ? p.promise() : o(c, r.connectionState.disconnected, r.connectionState.connecting) === !1 ? (p.resolve(c), p.promise()) : (k(c), w.href = c.url, w.protocol && w.protocol !== ":" ? (c.protocol = w.protocol, c.host = w.host) : (c.protocol = t.document.location.protocol, c.host = w.host || t.document.location.host), c.baseUrl = c.protocol + "//" + c.host, c.wsProtocol = c.protocol === "https:" ? "wss://" : "ws://", y.transport === "auto" && y.jsonp === !0 && (y.transport = "longPolling"), c.url.indexOf("//") === 0 && (c.url = t.location.protocol + c.url, c.log("Protocol relative URL detected, normalizing it to '" + c.url + "'.")), this.isCrossDomain(c.url) && (c.log("Auto detected cross domain url."), y.transport === "auto" && (y.transport = ["webSockets", "serverSentEvents", "longPolling"]), typeof y.withCredentials == "undefined" && (y.withCredentials = !0), y.jsonp || (y.jsonp = !n.support.cors, y.jsonp && c.log("Using jsonp because this browser doesn't support CORS.")), c.contentType = r._.defaultContentType), c.withCredentials = y.withCredentials, c.ajaxDataType = y.jsonp ? "jsonp" : "text", n(c).bind(u.onStart, function() {
885
+ n.type(h) === "function" && h.call(c);
886
+ p.resolve(c)
887
+ }), d = function(i, s) {
888
+ var y = r._.error(f.noTransportOnInit);
889
+ if (s = s || 0, s >= i.length) {
890
+ n(c).triggerHandler(u.onError, [y]);
891
+ p.reject(y);
892
+ c.stop();
893
+ return
894
+ }
895
+ if (c.state !== r.connectionState.disconnected) {
896
+ var w = i[s],
897
+ h = r.transports[w],
898
+ l = !1,
899
+ v = function() {
900
+ l || (l = !0, t.clearTimeout(c._.onFailedTimeoutHandle), h.stop(c), d(i, s + 1))
901
+ };
902
+ c.transport = h;
903
+ try {
904
+ c._.onFailedTimeoutHandle = t.setTimeout(function() {
905
+ c.log(h.name + " timed out when trying to connect.");
906
+ v()
907
+ }, c._.totalTransportConnectTimeout);
908
+ h.start(c, function() {
909
+ var i = function() {
910
+ var i = r._.firefoxMajorVersion(t.navigator.userAgent) >= 11,
911
+ f = !!c.withCredentials && i;
912
+ c.log("The start request succeeded. Transitioning to the connected state.");
913
+ a(c) && r.transports._logic.monitorKeepAlive(c);
914
+ r.transports._logic.startHeartbeat(c);
915
+ r._.configurePingInterval(c);
916
+ o(c, r.connectionState.connecting, r.connectionState.connected) || c.log("WARNING! The connection was not in the connecting state.");
917
+ c._.connectingMessageBuffer.drain();
918
+ n(c).triggerHandler(u.onStart);
919
+ e.bind("unload", function() {
920
+ c.log("Window unloading, stopping the connection.");
921
+ c.stop(f)
922
+ });
923
+ i && e.bind("beforeunload", function() {
924
+ t.setTimeout(function() {
925
+ c.stop(f)
926
+ }, 0)
927
+ })
928
+ };
929
+ if (!l) {
930
+ if (l = !0, t.clearTimeout(c._.onFailedTimeoutHandle), c.state === r.connectionState.disconnected) return;
931
+ c.log(h.name + " transport selected. Initiating start request.");
932
+ r.transports._logic.ajaxStart(c, i)
933
+ }
934
+ }, v)
935
+ } catch (b) {
936
+ c.log(h.name + " transport threw '" + b.message + "' when attempting to start.");
937
+ v()
938
+ }
939
+ }
940
+ }, b = c.url + "/negotiate", g = function(t, i) {
941
+ var e = r._.error(f.errorOnNegotiate, t, i._.negotiateRequest);
942
+ n(i).triggerHandler(u.onError, e);
943
+ p.reject(e);
944
+ i.stop()
945
+ }, n(c).triggerHandler(u.onStarting), b = r.transports._logic.prepareQueryString(c, b), c.log("Negotiating with '" + b + "'."), c._.negotiateRequest = r.transports._logic.ajax(c, {
946
+ url: b,
947
+ error: function(n, t) {
948
+ t !== l ? g(n, c) : p.reject(r._.error(f.stoppedWhileNegotiating, null, c._.negotiateRequest))
949
+ },
950
+ success: function(t) {
951
+ var i, e, h, o = [],
952
+ s = [];
953
+ try {
954
+ i = c._parseResponse(t)
955
+ } catch (l) {
956
+ g(r._.error(f.errorParsingNegotiateResponse, l), c);
957
+ return
958
+ }
959
+ if (e = c._.keepAliveData, c.appRelativeUrl = i.Url, c.id = i.ConnectionId, c.token = i.ConnectionToken, c.webSocketServerUrl = i.WebSocketServerUrl, c._.longPollDelay = i.LongPollDelay * 1e3, c.disconnectTimeout = i.DisconnectTimeout * 1e3, c._.totalTransportConnectTimeout = c.transportConnectTimeout + i.TransportConnectTimeout * 1e3, i.KeepAliveTimeout ? (e.activated = !0, e.timeout = i.KeepAliveTimeout * 1e3, e.timeoutWarning = e.timeout * c.keepAliveWarnAt, c._.beatInterval = (e.timeout - e.timeoutWarning) / 3) : e.activated = !1, c.reconnectWindow = c.disconnectTimeout + (e.timeout || 0), !i.ProtocolVersion || i.ProtocolVersion !== c.clientProtocol) {
960
+ h = r._.error(r._.format(f.protocolIncompatible, c.clientProtocol, i.ProtocolVersion));
961
+ n(c).triggerHandler(u.onError, [h]);
962
+ p.reject(h);
963
+ return
964
+ }
965
+ n.each(r.transports, function(n) {
966
+ if (n.indexOf("_") === 0 || n === "webSockets" && !i.TryWebSockets) return !0;
967
+ s.push(n)
968
+ });
969
+ n.isArray(y.transport) ? n.each(y.transport, function(t, i) {
970
+ n.inArray(i, s) >= 0 && o.push(i)
971
+ }) : y.transport === "auto" ? o = s : n.inArray(y.transport, s) >= 0 && o.push(y.transport);
972
+ d(o)
973
+ }
974
+ }), p.promise())
975
+ },
976
+ starting: function(t) {
977
+ var i = this;
978
+ return n(i).bind(u.onStarting, function() {
979
+ t.call(i)
980
+ }), i
981
+ },
982
+ send: function(n) {
983
+ var t = this;
984
+ if (t.state === r.connectionState.disconnected) throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()");
985
+ if (t.state === r.connectionState.connecting) throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.");
986
+ return t.transport.send(t, n), t
987
+ },
988
+ received: function(t) {
989
+ var i = this;
990
+ return n(i).bind(u.onReceived, function(n, r) {
991
+ t.call(i, r)
992
+ }), i
993
+ },
994
+ stateChanged: function(t) {
995
+ var i = this;
996
+ return n(i).bind(u.onStateChanged, function(n, r) {
997
+ t.call(i, r)
998
+ }), i
999
+ },
1000
+ error: function(t) {
1001
+ var i = this;
1002
+ return n(i).bind(u.onError, function(n, r, u) {
1003
+ i.lastError = r;
1004
+ t.call(i, r, u)
1005
+ }), i
1006
+ },
1007
+ disconnected: function(t) {
1008
+ var i = this;
1009
+ return n(i).bind(u.onDisconnect, function() {
1010
+ t.call(i)
1011
+ }), i
1012
+ },
1013
+ connectionSlow: function(t) {
1014
+ var i = this;
1015
+ return n(i).bind(u.onConnectionSlow, function() {
1016
+ t.call(i)
1017
+ }), i
1018
+ },
1019
+ reconnecting: function(t) {
1020
+ var i = this;
1021
+ return n(i).bind(u.onReconnecting, function() {
1022
+ t.call(i)
1023
+ }), i
1024
+ },
1025
+ reconnected: function(t) {
1026
+ var i = this;
1027
+ return n(i).bind(u.onReconnect, function() {
1028
+ t.call(i)
1029
+ }), i
1030
+ },
1031
+ stop: function(i, h) {
1032
+ var c = this,
1033
+ v = c._deferral;
1034
+ if (c._.deferredStartHandler && e.unbind("load", c._.deferredStartHandler), delete c._.config, delete c._.deferredStartHandler, !s && (!c._.config || c._.config.waitForPageLoad === !0)) {
1035
+ c.log("Stopping connection prior to negotiate.");
1036
+ v && v.reject(r._.error(f.stoppedWhileLoading));
1037
+ return
1038
+ }
1039
+ if (c.state !== r.connectionState.disconnected) return c.log("Stopping connection."), o(c, c.state, r.connectionState.disconnected), t.clearTimeout(c._.beatHandle), t.clearTimeout(c._.onFailedTimeoutHandle), t.clearInterval(c._.pingIntervalId), c.transport && (c.transport.stop(c), h !== !1 && c.transport.abort(c, i), a(c) && r.transports._logic.stopMonitoringKeepAlive(c), c.transport = null), c._.negotiateRequest && (c._.negotiateRequest.abort(l), delete c._.negotiateRequest), r.transports._logic.tryAbortStartRequest(c), n(c).triggerHandler(u.onDisconnect), delete c._deferral, delete c.messageId, delete c.groupsToken, delete c.id, delete c._.pingIntervalId, delete c._.lastMessageAt, delete c._.lastActiveAt, delete c._.longPollDelay, c._.connectingMessageBuffer.clear(), c
1040
+ },
1041
+ log: function(n) {
1042
+ w(n, this.logging)
1043
+ }
1044
+ };
1045
+ r.fn.init.prototype = r.fn;
1046
+ r.noConflict = function() {
1047
+ return n.connection === r && (n.connection = c), r
1048
+ };
1049
+ n.connection && (c = n.connection);
1050
+ n.connection = n.signalR = r
1051
+ }(window.jQuery, window),
1052
+ function(n, t) {
1053
+ function e(n) {
1054
+ n._.keepAliveData.monitoring && s(n);
1055
+ r.markActive(n) && (n._.beatHandle = t.setTimeout(function() {
1056
+ e(n)
1057
+ }, n._.beatInterval))
1058
+ }
1059
+
1060
+ function s(t) {
1061
+ var r = t._.keepAliveData,
1062
+ f;
1063
+ t.state === i.connectionState.connected && (f = (new Date).getTime() - t._.lastMessageAt, f >= r.timeout ? (t.log("Keep alive timed out. Notifying transport that connection has been lost."), t.transport.lostConnection(t)) : f >= r.timeoutWarning ? r.userNotified || (t.log("Keep alive has been missed, connection may be dead/slow."), n(t).triggerHandler(u.onConnectionSlow), r.userNotified = !0) : r.userNotified = !1)
1064
+ }
1065
+
1066
+ function f(n, t) {
1067
+ var i = n.url + t;
1068
+ return n.transport && (i += "?transport=" + n.transport.name), r.prepareQueryString(n, i)
1069
+ }
1070
+ var i = n.signalR,
1071
+ u = n.signalR.events,
1072
+ h = n.signalR.changeState,
1073
+ o = "__Start Aborted__",
1074
+ r;
1075
+ i.transports = {};
1076
+ r = i.transports._logic = {
1077
+ ajax: function(t, i) {
1078
+ return n.ajax(n.extend(!0, {}, n.signalR.ajaxDefaults, {
1079
+ type: "GET",
1080
+ data: {},
1081
+ xhrFields: {
1082
+ withCredentials: t.withCredentials
1083
+ },
1084
+ contentType: t.contentType,
1085
+ dataType: t.ajaxDataType
1086
+ }, i))
1087
+ },
1088
+ pingServer: function(t) {
1089
+ var e, f, u = n.Deferred();
1090
+ return t.transport ? (e = t.url + "/ping", e = r.addQs(e, t.qs), f = r.ajax(t, {
1091
+ url: e,
1092
+ success: function(n) {
1093
+ var r;
1094
+ try {
1095
+ r = t._parseResponse(n)
1096
+ } catch (e) {
1097
+ u.reject(i._.transportError(i.resources.pingServerFailedParse, t.transport, e, f));
1098
+ t.stop();
1099
+ return
1100
+ }
1101
+ r.Response === "pong" ? u.resolve() : u.reject(i._.transportError(i._.format(i.resources.pingServerFailedInvalidResponse, n), t.transport, null, f))
1102
+ },
1103
+ error: function(n) {
1104
+ n.status === 401 || n.status === 403 ? (u.reject(i._.transportError(i._.format(i.resources.pingServerFailedStatusCode, n.status), t.transport, n, f)), t.stop()) : u.reject(i._.transportError(i.resources.pingServerFailed, t.transport, n, f))
1105
+ }
1106
+ })) : u.reject(i._.transportError(i.resources.noConnectionTransport, t.transport)), u.promise()
1107
+ },
1108
+ prepareQueryString: function(n, i) {
1109
+ var u;
1110
+ return u = r.addQs(i, "clientProtocol=" + n.clientProtocol), u = r.addQs(u, n.qs), n.token && (u += "&connectionToken=" + t.encodeURIComponent(n.token)), n.data && (u += "&connectionData=" + t.encodeURIComponent(n.data)), u
1111
+ },
1112
+ addQs: function(t, i) {
1113
+ var r = t.indexOf("?") !== -1 ? "&" : "?",
1114
+ u;
1115
+ if (!i) return t;
1116
+ if (typeof i == "object") return t + r + n.param(i);
1117
+ if (typeof i == "string") return u = i.charAt(0), (u === "?" || u === "&") && (r = ""), t + r + i;
1118
+ throw new Error("Query string property must be either a string or object.");
1119
+ },
1120
+ getUrl: function(n, i, u, f) {
1121
+ var s = i === "webSockets" ? "" : n.baseUrl,
1122
+ e = s + n.appRelativeUrl,
1123
+ o = "transport=" + i;
1124
+ return n.groupsToken && (o += "&groupsToken=" + t.encodeURIComponent(n.groupsToken)), u ? (e += f ? "/poll" : "/reconnect", n.messageId && (o += "&messageId=" + t.encodeURIComponent(n.messageId))) : e += "/connect", e += "?" + o, e = r.prepareQueryString(n, e), e + ("&tid=" + Math.floor(Math.random() * 11))
1125
+ },
1126
+ maximizePersistentResponse: function(n) {
1127
+ return {
1128
+ MessageId: n.C,
1129
+ Messages: n.M,
1130
+ Initialized: typeof n.S != "undefined" ? !0 : !1,
1131
+ Disconnect: typeof n.D != "undefined" ? !0 : !1,
1132
+ ShouldReconnect: typeof n.T != "undefined" ? !0 : !1,
1133
+ LongPollDelay: n.L,
1134
+ GroupsToken: n.G
1135
+ }
1136
+ },
1137
+ updateGroups: function(n, t) {
1138
+ t && (n.groupsToken = t)
1139
+ },
1140
+ stringifySend: function(n, t) {
1141
+ return typeof t == "string" || typeof t == "undefined" || t === null ? t : n.json.stringify(t)
1142
+ },
1143
+ ajaxSend: function(t, e) {
1144
+ var h = r.stringifySend(t, e),
1145
+ c = f(t, "/send"),
1146
+ o, s = function(t, r) {
1147
+ n(r).triggerHandler(u.onError, [i._.transportError(i.resources.sendFailed, r.transport, t, o), e])
1148
+ };
1149
+ return o = r.ajax(t, {
1150
+ url: c,
1151
+ type: t.ajaxDataType === "jsonp" ? "GET" : "POST",
1152
+ contentType: i._.defaultContentType,
1153
+ data: {
1154
+ data: h
1155
+ },
1156
+ success: function(n) {
1157
+ var i;
1158
+ if (n) {
1159
+ try {
1160
+ i = t._parseResponse(n)
1161
+ } catch (u) {
1162
+ s(u, t);
1163
+ t.stop();
1164
+ return
1165
+ }
1166
+ r.triggerReceived(t, i)
1167
+ }
1168
+ },
1169
+ error: function(n, i) {
1170
+ i !== "abort" && i !== "parsererror" && s(n, t)
1171
+ }
1172
+ })
1173
+ },
1174
+ ajaxAbort: function(n, t) {
1175
+ if (typeof n.transport != "undefined") {
1176
+ t = typeof t == "undefined" ? !0 : t;
1177
+ var i = f(n, "/abort");
1178
+ r.ajax(n, {
1179
+ url: i,
1180
+ async: t,
1181
+ timeout: 1e3,
1182
+ type: "POST"
1183
+ });
1184
+ n.log("Fired ajax abort async = " + t + ".")
1185
+ }
1186
+ },
1187
+ ajaxStart: function(t, e) {
1188
+ var h = function(n) {
1189
+ var i = t._deferral;
1190
+ i && i.reject(n)
1191
+ },
1192
+ s = function(i) {
1193
+ t.log("The start request failed. Stopping the connection.");
1194
+ n(t).triggerHandler(u.onError, [i]);
1195
+ h(i);
1196
+ t.stop()
1197
+ };
1198
+ t._.startRequest = r.ajax(t, {
1199
+ url: f(t, "/start"),
1200
+ success: function(n, r, u) {
1201
+ var f;
1202
+ try {
1203
+ f = t._parseResponse(n)
1204
+ } catch (o) {
1205
+ s(i._.error(i._.format(i.resources.errorParsingStartResponse, n), o, u));
1206
+ return
1207
+ }
1208
+ f.Response === "started" ? e() : s(i._.error(i._.format(i.resources.invalidStartResponse, n), null, u))
1209
+ },
1210
+ error: function(n, r, u) {
1211
+ r !== o ? s(i._.error(i.resources.errorDuringStartRequest, u, n)) : (t.log("The start request aborted because connection.stop() was called."), h(i._.error(i.resources.stoppedDuringStartRequest, null, n)))
1212
+ }
1213
+ })
1214
+ },
1215
+ tryAbortStartRequest: function(n) {
1216
+ n._.startRequest && (n._.startRequest.abort(o), delete n._.startRequest)
1217
+ },
1218
+ tryInitialize: function(n, t) {
1219
+ n.Initialized && t()
1220
+ },
1221
+ triggerReceived: function(t, i) {
1222
+ t._.connectingMessageBuffer.tryBuffer(i) || n(t).triggerHandler(u.onReceived, [i])
1223
+ },
1224
+ processMessages: function(t, i, u) {
1225
+ var f;
1226
+ r.markLastMessage(t);
1227
+ i && (f = r.maximizePersistentResponse(i), r.updateGroups(t, f.GroupsToken), f.MessageId && (t.messageId = f.MessageId), f.Messages && (n.each(f.Messages, function(n, i) {
1228
+ r.triggerReceived(t, i)
1229
+ }), r.tryInitialize(f, u)))
1230
+ },
1231
+ monitorKeepAlive: function(t) {
1232
+ var i = t._.keepAliveData;
1233
+ i.monitoring ? t.log("Tried to monitor keep alive but it's already being monitored.") : (i.monitoring = !0, r.markLastMessage(t), t._.keepAliveData.reconnectKeepAliveUpdate = function() {
1234
+ r.markLastMessage(t)
1235
+ }, n(t).bind(u.onReconnect, t._.keepAliveData.reconnectKeepAliveUpdate), t.log("Now monitoring keep alive with a warning timeout of " + i.timeoutWarning + " and a connection lost timeout of " + i.timeout + "."))
1236
+ },
1237
+ stopMonitoringKeepAlive: function(t) {
1238
+ var i = t._.keepAliveData;
1239
+ i.monitoring && (i.monitoring = !1, n(t).unbind(u.onReconnect, t._.keepAliveData.reconnectKeepAliveUpdate), t._.keepAliveData = {}, t.log("Stopping the monitoring of the keep alive."))
1240
+ },
1241
+ startHeartbeat: function(n) {
1242
+ n._.lastActiveAt = (new Date).getTime();
1243
+ e(n)
1244
+ },
1245
+ markLastMessage: function(n) {
1246
+ n._.lastMessageAt = (new Date).getTime()
1247
+ },
1248
+ markActive: function(n) {
1249
+ return r.verifyLastActive(n) ? (n._.lastActiveAt = (new Date).getTime(), !0) : !1
1250
+ },
1251
+ isConnectedOrReconnecting: function(n) {
1252
+ return n.state === i.connectionState.connected || n.state === i.connectionState.reconnecting
1253
+ },
1254
+ ensureReconnectingState: function(t) {
1255
+ return h(t, i.connectionState.connected, i.connectionState.reconnecting) === !0 && n(t).triggerHandler(u.onReconnecting), t.state === i.connectionState.reconnecting
1256
+ },
1257
+ clearReconnectTimeout: function(n) {
1258
+ n && n._.reconnectTimeout && (t.clearTimeout(n._.reconnectTimeout), delete n._.reconnectTimeout)
1259
+ },
1260
+ verifyLastActive: function(t) {
1261
+ if ((new Date).getTime() - t._.lastActiveAt >= t.reconnectWindow) {
1262
+ var r = i._.format(i.resources.reconnectWindowTimeout, new Date(t._.lastActiveAt), t.reconnectWindow);
1263
+ return t.log(r), n(t).triggerHandler(u.onError, [i._.error(r, "TimeoutException")]), t.stop(!1, !1), !1
1264
+ }
1265
+ return !0
1266
+ },
1267
+ reconnect: function(n, u) {
1268
+ var f = i.transports[u];
1269
+ if (r.isConnectedOrReconnecting(n) && !n._.reconnectTimeout) {
1270
+ if (!r.verifyLastActive(n)) return;
1271
+ n._.reconnectTimeout = t.setTimeout(function() {
1272
+ r.verifyLastActive(n) && (f.stop(n), r.ensureReconnectingState(n) && (n.log(u + " reconnecting."), f.start(n)))
1273
+ }, n.reconnectDelay)
1274
+ }
1275
+ },
1276
+ handleParseFailure: function(t, r, f, e, o) {
1277
+ t.state === i.connectionState.connecting ? (t.log("Failed to parse server response while attempting to connect."), e()) : (n(t).triggerHandler(u.onError, [i._.transportError(i._.format(i.resources.parseFailed, r), t.transport, f, o)]), t.stop())
1278
+ },
1279
+ foreverFrame: {
1280
+ count: 0,
1281
+ connections: {}
1282
+ }
1283
+ }
1284
+ }(window.jQuery, window),
1285
+ function(n, t) {
1286
+ var r = n.signalR,
1287
+ u = n.signalR.events,
1288
+ f = n.signalR.changeState,
1289
+ i = r.transports._logic;
1290
+ r.transports.webSockets = {
1291
+ name: "webSockets",
1292
+ supportsKeepAlive: function() {
1293
+ return !0
1294
+ },
1295
+ send: function(t, f) {
1296
+ var e = i.stringifySend(t, f);
1297
+ try {
1298
+ t.socket.send(e)
1299
+ } catch (o) {
1300
+ n(t).triggerHandler(u.onError, [r._.transportError(r.resources.webSocketsInvalidState, t.transport, o, t.socket), f])
1301
+ }
1302
+ },
1303
+ start: function(e, o, s) {
1304
+ var h, c = !1,
1305
+ l = this,
1306
+ a = !o,
1307
+ v = n(e);
1308
+ if (!t.WebSocket) {
1309
+ s();
1310
+ return
1311
+ }
1312
+ e.socket || (h = e.webSocketServerUrl ? e.webSocketServerUrl : e.wsProtocol + e.host, h += i.getUrl(e, this.name, a), e.log("Connecting to websocket endpoint '" + h + "'."), e.socket = new t.WebSocket(h), e.socket.onopen = function() {
1313
+ c = !0;
1314
+ e.log("Websocket opened.");
1315
+ i.clearReconnectTimeout(e);
1316
+ f(e, r.connectionState.reconnecting, r.connectionState.connected) === !0 && v.triggerHandler(u.onReconnect)
1317
+ }, e.socket.onclose = function(t) {
1318
+ if (this === e.socket) {
1319
+ if (c) typeof t.wasClean != "undefined" && t.wasClean === !1 ? (n(e).triggerHandler(u.onError, [r._.transportError(r.resources.webSocketClosed, e.transport, t)]), e.log("Unclean disconnect from websocket: " + t.reason || "[no reason given].")) : e.log("Websocket closed.");
1320
+ else {
1321
+ s ? s() : a && l.reconnect(e);
1322
+ return
1323
+ }
1324
+ l.reconnect(e)
1325
+ }
1326
+ }, e.socket.onmessage = function(t) {
1327
+ var r;
1328
+ try {
1329
+ r = e._parseResponse(t.data)
1330
+ } catch (u) {
1331
+ i.handleParseFailure(e, t.data, u, s, t);
1332
+ return
1333
+ }
1334
+ r && (n.isEmptyObject(r) || r.M ? i.processMessages(e, r, o) : i.triggerReceived(e, r))
1335
+ })
1336
+ },
1337
+ reconnect: function(n) {
1338
+ i.reconnect(n, this.name)
1339
+ },
1340
+ lostConnection: function(n) {
1341
+ this.reconnect(n)
1342
+ },
1343
+ stop: function(n) {
1344
+ i.clearReconnectTimeout(n);
1345
+ n.socket && (n.log("Closing the Websocket."), n.socket.close(), n.socket = null)
1346
+ },
1347
+ abort: function(n, t) {
1348
+ i.ajaxAbort(n, t)
1349
+ }
1350
+ }
1351
+ }(window.jQuery, window),
1352
+ function(n, t) {
1353
+ var i = n.signalR,
1354
+ u = n.signalR.events,
1355
+ e = n.signalR.changeState,
1356
+ r = i.transports._logic,
1357
+ f = function(n) {
1358
+ t.clearTimeout(n._.reconnectAttemptTimeoutHandle);
1359
+ delete n._.reconnectAttemptTimeoutHandle
1360
+ };
1361
+ i.transports.serverSentEvents = {
1362
+ name: "serverSentEvents",
1363
+ supportsKeepAlive: function() {
1364
+ return !0
1365
+ },
1366
+ timeOut: 3e3,
1367
+ start: function(o, s, h) {
1368
+ var c = this,
1369
+ l = !1,
1370
+ a = n(o),
1371
+ v = !s,
1372
+ y;
1373
+ if (o.eventSource && (o.log("The connection already has an event source. Stopping it."), o.stop()), !t.EventSource) {
1374
+ h && (o.log("This browser doesn't support SSE."), h());
1375
+ return
1376
+ }
1377
+ y = r.getUrl(o, this.name, v);
1378
+ try {
1379
+ o.log("Attempting to connect to SSE endpoint '" + y + "'.");
1380
+ o.eventSource = new t.EventSource(y, {
1381
+ withCredentials: o.withCredentials
1382
+ })
1383
+ } catch (p) {
1384
+ o.log("EventSource failed trying to connect with error " + p.Message + ".");
1385
+ h ? h() : (a.triggerHandler(u.onError, [i._.transportError(i.resources.eventSourceFailedToConnect, o.transport, p)]), v && c.reconnect(o));
1386
+ return
1387
+ }
1388
+ v && (o._.reconnectAttemptTimeoutHandle = t.setTimeout(function() {
1389
+ l === !1 && o.eventSource.readyState !== t.EventSource.OPEN && c.reconnect(o)
1390
+ }, c.timeOut));
1391
+ o.eventSource.addEventListener("open", function() {
1392
+ o.log("EventSource connected.");
1393
+ f(o);
1394
+ r.clearReconnectTimeout(o);
1395
+ l === !1 && (l = !0, e(o, i.connectionState.reconnecting, i.connectionState.connected) === !0 && a.triggerHandler(u.onReconnect))
1396
+ }, !1);
1397
+ o.eventSource.addEventListener("message", function(n) {
1398
+ var t;
1399
+ if (n.data !== "initialized") {
1400
+ try {
1401
+ t = o._parseResponse(n.data)
1402
+ } catch (i) {
1403
+ r.handleParseFailure(o, n.data, i, h, n);
1404
+ return
1405
+ }
1406
+ r.processMessages(o, t, s)
1407
+ }
1408
+ }, !1);
1409
+ o.eventSource.addEventListener("error", function(n) {
1410
+ if (this === o.eventSource) {
1411
+ if (!l) {
1412
+ h && h();
1413
+ return
1414
+ }
1415
+ o.log("EventSource readyState: " + o.eventSource.readyState + ".");
1416
+ n.eventPhase === t.EventSource.CLOSED ? (o.log("EventSource reconnecting due to the server connection ending."), c.reconnect(o)) : (o.log("EventSource error."), a.triggerHandler(u.onError, [i._.transportError(i.resources.eventSourceError, o.transport, n)]))
1417
+ }
1418
+ }, !1)
1419
+ },
1420
+ reconnect: function(n) {
1421
+ r.reconnect(n, this.name)
1422
+ },
1423
+ lostConnection: function(n) {
1424
+ this.reconnect(n)
1425
+ },
1426
+ send: function(n, t) {
1427
+ r.ajaxSend(n, t)
1428
+ },
1429
+ stop: function(n) {
1430
+ f(n);
1431
+ r.clearReconnectTimeout(n);
1432
+ n && n.eventSource && (n.log("EventSource calling close()."), n.eventSource.close(), n.eventSource = null, delete n.eventSource)
1433
+ },
1434
+ abort: function(n, t) {
1435
+ r.ajaxAbort(n, t)
1436
+ }
1437
+ }
1438
+ }(window.jQuery, window),
1439
+ function(n, t) {
1440
+ var r = n.signalR,
1441
+ e = n.signalR.events,
1442
+ o = n.signalR.changeState,
1443
+ i = r.transports._logic,
1444
+ u = function() {
1445
+ var n = t.document.createElement("iframe");
1446
+ return n.setAttribute("style", "position:absolute;top:0;left:0;width:0;height:0;visibility:hidden;"), n
1447
+ },
1448
+ f = function() {
1449
+ var i = null,
1450
+ f = 1e3,
1451
+ n = 0;
1452
+ return {
1453
+ prevent: function() {
1454
+ r._.ieVersion <= 8 && (n === 0 && (i = t.setInterval(function() {
1455
+ var n = u();
1456
+ t.document.body.appendChild(n);
1457
+ t.document.body.removeChild(n);
1458
+ n = null
1459
+ }, f)), n++)
1460
+ },
1461
+ cancel: function() {
1462
+ n === 1 && t.clearInterval(i);
1463
+ n > 0 && n--
1464
+ }
1465
+ }
1466
+ }();
1467
+ r.transports.foreverFrame = {
1468
+ name: "foreverFrame",
1469
+ supportsKeepAlive: function() {
1470
+ return !0
1471
+ },
1472
+ iframeClearThreshold: 50,
1473
+ start: function(n, r, e) {
1474
+ var l = this,
1475
+ s = i.foreverFrame.count += 1,
1476
+ h, o = u(),
1477
+ c = function() {
1478
+ n.log("Forever frame iframe finished loading and is no longer receiving messages.");
1479
+ l.reconnect(n)
1480
+ };
1481
+ if (t.EventSource) {
1482
+ e && (n.log("This browser supports SSE, skipping Forever Frame."), e());
1483
+ return
1484
+ }
1485
+ o.setAttribute("data-signalr-connection-id", n.id);
1486
+ f.prevent();
1487
+ h = i.getUrl(n, this.name);
1488
+ h += "&frameId=" + s;
1489
+ t.document.body.appendChild(o);
1490
+ n.log("Binding to iframe's load event.");
1491
+ o.addEventListener ? o.addEventListener("load", c, !1) : o.attachEvent && o.attachEvent("onload", c);
1492
+ o.src = h;
1493
+ i.foreverFrame.connections[s] = n;
1494
+ n.frame = o;
1495
+ n.frameId = s;
1496
+ r && (n.onSuccess = function() {
1497
+ n.log("Iframe transport started.");
1498
+ r()
1499
+ })
1500
+ },
1501
+ reconnect: function(n) {
1502
+ var r = this;
1503
+ i.isConnectedOrReconnecting(n) && i.verifyLastActive(n) && t.setTimeout(function() {
1504
+ if (i.verifyLastActive(n) && n.frame && i.ensureReconnectingState(n)) {
1505
+ var u = n.frame,
1506
+ t = i.getUrl(n, r.name, !0) + "&frameId=" + n.frameId;
1507
+ n.log("Updating iframe src to '" + t + "'.");
1508
+ u.src = t
1509
+ }
1510
+ }, n.reconnectDelay)
1511
+ },
1512
+ lostConnection: function(n) {
1513
+ this.reconnect(n)
1514
+ },
1515
+ send: function(n, t) {
1516
+ i.ajaxSend(n, t)
1517
+ },
1518
+ receive: function(t, u) {
1519
+ var f, e, o;
1520
+ if (t.json !== t._originalJson && (u = t._originalJson.stringify(u)), o = t._parseResponse(u), i.processMessages(t, o, t.onSuccess), t.state === n.signalR.connectionState.connected && (t.frameMessageCount = (t.frameMessageCount || 0) + 1, t.frameMessageCount > r.transports.foreverFrame.iframeClearThreshold && (t.frameMessageCount = 0, f = t.frame.contentWindow || t.frame.contentDocument, f && f.document && f.document.body)))
1521
+ for (e = f.document.body; e.firstChild;) e.removeChild(e.firstChild)
1522
+ },
1523
+ stop: function(n) {
1524
+ var r = null;
1525
+ if (f.cancel(), n.frame) {
1526
+ if (n.frame.stop) n.frame.stop();
1527
+ else try {
1528
+ r = n.frame.contentWindow || n.frame.contentDocument;
1529
+ r.document && r.document.execCommand && r.document.execCommand("Stop")
1530
+ } catch (u) {
1531
+ n.log("Error occured when stopping foreverFrame transport. Message = " + u.message + ".")
1532
+ }
1533
+ n.frame.parentNode === t.document.body && t.document.body.removeChild(n.frame);
1534
+ delete i.foreverFrame.connections[n.frameId];
1535
+ n.frame = null;
1536
+ n.frameId = null;
1537
+ delete n.frame;
1538
+ delete n.frameId;
1539
+ delete n.onSuccess;
1540
+ delete n.frameMessageCount;
1541
+ n.log("Stopping forever frame.")
1542
+ }
1543
+ },
1544
+ abort: function(n, t) {
1545
+ i.ajaxAbort(n, t)
1546
+ },
1547
+ getConnection: function(n) {
1548
+ return i.foreverFrame.connections[n]
1549
+ },
1550
+ started: function(t) {
1551
+ o(t, r.connectionState.reconnecting, r.connectionState.connected) === !0 && n(t).triggerHandler(e.onReconnect)
1552
+ }
1553
+ }
1554
+ }(window.jQuery, window),
1555
+ function(n, t) {
1556
+ var r = n.signalR,
1557
+ u = n.signalR.events,
1558
+ e = n.signalR.changeState,
1559
+ f = n.signalR.isDisconnecting,
1560
+ i = r.transports._logic,
1561
+ o = function() {
1562
+ try {
1563
+ return "onprogress" in new t.XMLHttpRequest
1564
+ } catch (n) {
1565
+ return !1
1566
+ }
1567
+ }();
1568
+ r.transports.longPolling = {
1569
+ name: "longPolling",
1570
+ supportsKeepAlive: function(n) {
1571
+ return o && n.ajaxDataType !== "jsonp" && n._.longPollDelay === 0
1572
+ },
1573
+ reconnectDelay: 3e3,
1574
+ start: function(o, s, h) {
1575
+ var a = this,
1576
+ v = function() {
1577
+ v = n.noop;
1578
+ h = null;
1579
+ o.log("LongPolling connected.");
1580
+ s()
1581
+ },
1582
+ y = function() {
1583
+ return h ? (h(), h = null, o.log("LongPolling failed to connect."), !0) : !1
1584
+ },
1585
+ c = o._,
1586
+ l = 0,
1587
+ p = function(i) {
1588
+ t.clearTimeout(c.reconnectTimeoutId);
1589
+ c.reconnectTimeoutId = null;
1590
+ e(i, r.connectionState.reconnecting, r.connectionState.connected) === !0 && (i.log("Raising the reconnect event"), n(i).triggerHandler(u.onReconnect))
1591
+ },
1592
+ w = 36e5;
1593
+ o.pollXhr && (o.log("Polling xhr requests already exists, aborting."), o.stop());
1594
+ o.messageId = null;
1595
+ c.reconnectTimeoutId = null;
1596
+ c.pollTimeoutId = t.setTimeout(function() {
1597
+ (function e(s, h) {
1598
+ var d = s.messageId,
1599
+ g = d === null,
1600
+ b = !g,
1601
+ nt = !h,
1602
+ k = i.getUrl(s, a.name, b, nt);
1603
+ f(s) !== !0 && (o.log("Opening long polling request to '" + k + "'."), s.pollXhr = i.ajax(o, {
1604
+ xhrFields: {
1605
+ onprogress: function() {
1606
+ i.markLastMessage(o)
1607
+ }
1608
+ },
1609
+ url: k,
1610
+ success: function(r) {
1611
+ var h, w = 0,
1612
+ u, a;
1613
+ o.log("Long poll complete.");
1614
+ l = 0;
1615
+ try {
1616
+ h = o._parseResponse(r)
1617
+ } catch (b) {
1618
+ i.handleParseFailure(s, r, b, y, s.pollXhr);
1619
+ return
1620
+ }(c.reconnectTimeoutId !== null && p(s), h && (u = i.maximizePersistentResponse(h)), i.processMessages(s, h, v), u && n.type(u.LongPollDelay) === "number" && (w = u.LongPollDelay), u && u.Disconnect) || f(s) !== !0 && (a = u && u.ShouldReconnect, !a || i.ensureReconnectingState(s)) && (w > 0 ? c.pollTimeoutId = t.setTimeout(function() {
1621
+ e(s, a)
1622
+ }, w) : e(s, a))
1623
+ },
1624
+ error: function(f, h) {
1625
+ if (t.clearTimeout(c.reconnectTimeoutId), c.reconnectTimeoutId = null, h === "abort") {
1626
+ o.log("Aborted xhr request.");
1627
+ return
1628
+ }
1629
+ if (!y()) {
1630
+ if (l++, o.state !== r.connectionState.reconnecting && (o.log("An error occurred using longPolling. Status = " + h + ". Response = " + f.responseText + "."), n(s).triggerHandler(u.onError, [r._.transportError(r.resources.longPollFailed, o.transport, f, s.pollXhr)])), (o.state === r.connectionState.connected || o.state === r.connectionState.reconnecting) && !i.verifyLastActive(o)) return;
1631
+ if (!i.ensureReconnectingState(s)) return;
1632
+ c.pollTimeoutId = t.setTimeout(function() {
1633
+ e(s, !0)
1634
+ }, a.reconnectDelay)
1635
+ }
1636
+ }
1637
+ }), b && h === !0 && (c.reconnectTimeoutId = t.setTimeout(function() {
1638
+ p(s)
1639
+ }, Math.min(1e3 * (Math.pow(2, l) - 1), w))))
1640
+ })(o)
1641
+ }, 250)
1642
+ },
1643
+ lostConnection: function(n) {
1644
+ n.pollXhr && n.pollXhr.abort("lostConnection")
1645
+ },
1646
+ send: function(n, t) {
1647
+ i.ajaxSend(n, t)
1648
+ },
1649
+ stop: function(n) {
1650
+ t.clearTimeout(n._.pollTimeoutId);
1651
+ t.clearTimeout(n._.reconnectTimeoutId);
1652
+ delete n._.pollTimeoutId;
1653
+ delete n._.reconnectTimeoutId;
1654
+ n.pollXhr && (n.pollXhr.abort(), n.pollXhr = null, delete n.pollXhr)
1655
+ },
1656
+ abort: function(n, t) {
1657
+ i.ajaxAbort(n, t)
1658
+ }
1659
+ }
1660
+ }(window.jQuery, window),
1661
+ function(n) {
1662
+ function r(n) {
1663
+ return n + s
1664
+ }
1665
+
1666
+ function e(n, t, i) {
1667
+ for (var f = n.length, u = [], r = 0; r < f; r += 1) n.hasOwnProperty(r) && (u[r] = t.call(i, n[r], r, n));
1668
+ return u
1669
+ }
1670
+
1671
+ function o(t) {
1672
+ return n.isFunction(t) ? null : n.type(t) === "undefined" ? null : t
1673
+ }
1674
+
1675
+ function u(n) {
1676
+ for (var t in n)
1677
+ if (n.hasOwnProperty(t)) return !0;
1678
+ return !1
1679
+ }
1680
+
1681
+ function f(n, t) {
1682
+ var i = n._.invocationCallbacks,
1683
+ r, f;
1684
+ u(i) && n.log("Clearing hub invocation callbacks with error: " + t + ".");
1685
+ n._.invocationCallbackId = 0;
1686
+ delete n._.invocationCallbacks;
1687
+ n._.invocationCallbacks = {};
1688
+ for (f in i) r = i[f], r.method.call(r.scope, {
1689
+ E: t
1690
+ })
1691
+ }
1692
+
1693
+ function i(n, t) {
1694
+ return new i.fn.init(n, t)
1695
+ }
1696
+
1697
+ function t(i, r) {
1698
+ var u = {
1699
+ qs: null,
1700
+ logging: !1,
1701
+ useDefaultPath: !0
1702
+ };
1703
+ return n.extend(u, r), (!i || u.useDefaultPath) && (i = (i || "") + "/signalr"), new t.fn.init(i, u)
1704
+ }
1705
+ var s = ".hubProxy",
1706
+ h = n.signalR;
1707
+ i.fn = i.prototype = {
1708
+ init: function(n, t) {
1709
+ this.state = {};
1710
+ this.connection = n;
1711
+ this.hubName = t;
1712
+ this._ = {
1713
+ callbackMap: {}
1714
+ }
1715
+ },
1716
+ hasSubscriptions: function() {
1717
+ return u(this._.callbackMap)
1718
+ },
1719
+ on: function(t, i) {
1720
+ var u = this,
1721
+ f = u._.callbackMap;
1722
+ return t = t.toLowerCase(), f[t] || (f[t] = {}), f[t][i] = function(n, t) {
1723
+ i.apply(u, t)
1724
+ }, n(u).bind(r(t), f[t][i]), u
1725
+ },
1726
+ off: function(t, i) {
1727
+ var e = this,
1728
+ o = e._.callbackMap,
1729
+ f;
1730
+ return t = t.toLowerCase(), f = o[t], f && (f[i] ? (n(e).unbind(r(t), f[i]), delete f[i], u(f) || delete o[t]) : i || (n(e).unbind(r(t)), delete o[t])), e
1731
+ },
1732
+ invoke: function(t) {
1733
+ var i = this,
1734
+ r = i.connection,
1735
+ s = n.makeArray(arguments).slice(1),
1736
+ c = e(s, o),
1737
+ f = {
1738
+ H: i.hubName,
1739
+ M: t,
1740
+ A: c,
1741
+ I: r._.invocationCallbackId
1742
+ },
1743
+ u = n.Deferred(),
1744
+ l = function(f) {
1745
+ var e = i._maximizeHubResponse(f),
1746
+ s, o;
1747
+ n.extend(i.state, e.State);
1748
+ e.Progress ? u.notifyWith ? u.notifyWith(i, [e.Progress.Data]) : r._.progressjQueryVersionLogged || (r.log("A hub method invocation progress update was received but the version of jQuery in use (" + n.prototype.jquery + ") does not support progress updates. Upgrade to jQuery 1.7+ to receive progress notifications."), r._.progressjQueryVersionLogged = !0) : e.Error ? (e.StackTrace && r.log(e.Error + "\n" + e.StackTrace + "."), s = e.IsHubException ? "HubException" : "Exception", o = h._.error(e.Error, s), o.data = e.ErrorData, r.log(i.hubName + "." + t + " failed to execute. Error: " + o.message), u.rejectWith(i, [o])) : (r.log("Invoked " + i.hubName + "." + t), u.resolveWith(i, [e.Result]))
1749
+ };
1750
+ return r._.invocationCallbacks[r._.invocationCallbackId.toString()] = {
1751
+ scope: i,
1752
+ method: l
1753
+ }, r._.invocationCallbackId += 1, n.isEmptyObject(i.state) || (f.S = i.state), r.log("Invoking " + i.hubName + "." + t), r.send(f), u.promise()
1754
+ },
1755
+ _maximizeHubResponse: function(n) {
1756
+ return {
1757
+ State: n.S,
1758
+ Result: n.R,
1759
+ Progress: n.P ? {
1760
+ Id: n.P.I,
1761
+ Data: n.P.D
1762
+ } : null,
1763
+ Id: n.I,
1764
+ IsHubException: n.H,
1765
+ Error: n.E,
1766
+ StackTrace: n.T,
1767
+ ErrorData: n.D
1768
+ }
1769
+ }
1770
+ };
1771
+ i.fn.init.prototype = i.fn;
1772
+ t.fn = t.prototype = n.connection();
1773
+ t.fn.init = function(t, i) {
1774
+ var e = {
1775
+ qs: null,
1776
+ logging: !1,
1777
+ useDefaultPath: !0
1778
+ },
1779
+ u = this;
1780
+ n.extend(e, i);
1781
+ n.signalR.fn.init.call(u, t, e.qs, e.logging);
1782
+ u.proxies = {};
1783
+ u._.invocationCallbackId = 0;
1784
+ u._.invocationCallbacks = {};
1785
+ u.received(function(t) {
1786
+ var f, o, e, i, s, h;
1787
+ t && (typeof t.P != "undefined" ? (e = t.P.I.toString(), i = u._.invocationCallbacks[e], i && i.method.call(i.scope, t)) : typeof t.I != "undefined" ? (e = t.I.toString(), i = u._.invocationCallbacks[e], i && (u._.invocationCallbacks[e] = null, delete u._.invocationCallbacks[e], i.method.call(i.scope, t))) : (f = this._maximizeClientHubInvocation(t), u.log("Triggering client hub event '" + f.Method + "' on hub '" + f.Hub + "'."), s = f.Hub.toLowerCase(), h = f.Method.toLowerCase(), o = this.proxies[s], n.extend(o.state, f.State), n(o).triggerHandler(r(h), [f.Args])))
1788
+ });
1789
+ u.error(function(n, t) {
1790
+ var i, r;
1791
+ t && (i = t.I, r = u._.invocationCallbacks[i], r && (u._.invocationCallbacks[i] = null, delete u._.invocationCallbacks[i], r.method.call(r.scope, {
1792
+ E: n
1793
+ })))
1794
+ });
1795
+ u.reconnecting(function() {
1796
+ u.transport && u.transport.name === "webSockets" && f(u, "Connection started reconnecting before invocation result was received.")
1797
+ });
1798
+ u.disconnected(function() {
1799
+ f(u, "Connection was disconnected before invocation result was received.")
1800
+ })
1801
+ };
1802
+ t.fn._maximizeClientHubInvocation = function(n) {
1803
+ return {
1804
+ Hub: n.H,
1805
+ Method: n.M,
1806
+ Args: n.A,
1807
+ State: n.S
1808
+ }
1809
+ };
1810
+ t.fn._registerSubscribedHubs = function() {
1811
+ var t = this;
1812
+ t._subscribedToHubs || (t._subscribedToHubs = !0, t.starting(function() {
1813
+ var i = [];
1814
+ n.each(t.proxies, function(n) {
1815
+ this.hasSubscriptions() && (i.push({
1816
+ name: n
1817
+ }), t.log("Client subscribed to hub '" + n + "'."))
1818
+ });
1819
+ i.length === 0 && t.log("No hubs have been subscribed to. The client will not receive data from hubs. To fix, declare at least one client side function prior to connection start for each hub you wish to subscribe to.");
1820
+ t.data = t.json.stringify(i)
1821
+ }))
1822
+ };
1823
+ t.fn.createHubProxy = function(n) {
1824
+ n = n.toLowerCase();
1825
+ var t = this.proxies[n];
1826
+ return t || (t = i(this, n), this.proxies[n] = t), this._registerSubscribedHubs(), t
1827
+ };
1828
+ t.fn.init.prototype = t.fn;
1829
+ n.hubConnection = t
1830
+ }(window.jQuery, window),
1831
+ function(n) {
1832
+ n.signalR.version = "2.1.1"
1833
+ }(window.jQuery),
1834
+ function($) {
1835
+ var n, f, h = 1,
1836
+ t, i = this,
1837
+ r = !1,
1838
+ u = "postMessage",
1839
+ e = "addEventListener",
1840
+ o, s = i[u];
1841
+ $[u] = function(n, t, i) {
1842
+ t && (n = typeof n == "string" ? n : $.param(n), i = i || parent, s ? i[u](n, t.replace(/([^:]+:\/\/[^\/]+).*/, "$1")) : t && (i.location = t.replace(/#.*$/, "") + "#" + +new Date + h++ + "&" + n))
1843
+ };
1844
+ $.receiveMessage = o = function(u, h, c) {
1845
+ s ? (u && (t && o(), t = function(n) {
1846
+ if (typeof h == "string" && n.origin !== h || $.isFunction(h) && h(n.origin) === r) return r;
1847
+ u(n)
1848
+ }), i[e] ? i[u ? e : "removeEventListener"]("message", t, r) : i[u ? "attachEvent" : "detachEvent"]("onmessage", t)) : (n && clearInterval(n), n = null, u && (c = typeof h == "number" ? h : typeof c == "number" ? c : 100, n = setInterval(function() {
1849
+ var n = document.location.hash,
1850
+ t = /^#?\d+&/;
1851
+ n !== f && t.test(n) && (f = n, u({
1852
+ data: n.replace(t, "")
1853
+ }))
1854
+ }, c)))
1855
+ }
1856
+ }(jQuery),
1857
+ function(n, t, i, r) {
1858
+ "use strict";
1859
+ var u = function(t, i) {
1860
+ this.widget = "";
1861
+ this.$element = n(t);
1862
+ this.defaultTime = i.defaultTime;
1863
+ this.disableFocus = i.disableFocus;
1864
+ this.isOpen = i.isOpen;
1865
+ this.minuteStep = i.minuteStep;
1866
+ this.modalBackdrop = i.modalBackdrop;
1867
+ this.secondStep = i.secondStep;
1868
+ this.showInputs = i.showInputs;
1869
+ this.showMeridian = i.showMeridian;
1870
+ this.showSeconds = i.showSeconds;
1871
+ this.template = i.template;
1872
+ this.appendWidgetTo = i.appendWidgetTo;
1873
+ this.upArrowStyle = i.upArrowStyle;
1874
+ this.downArrowStyle = i.downArrowStyle;
1875
+ this.containerClass = i.containerClass;
1876
+ this.timeSeparator = i.timeSeparator;
1877
+ this._init()
1878
+ };
1879
+ u.prototype = {
1880
+ constructor: u,
1881
+ _init: function() {
1882
+ var t = this;
1883
+ if (this.$element.parent().hasClass("input-group")) {
1884
+ if (this.$element.parent(".input-group").find(".input-group-addon").length) this.$element.parent(".input-group").find(".input-group-addon").on({
1885
+ mousedown: n.proxy(this.showWidget, this)
1886
+ });
1887
+ else this.$element.closest(this.containerClass).find(".input-group-addon").on({
1888
+ mousedown: n.proxy(this.showWidget, this)
1889
+ });
1890
+ this.$element.on({
1891
+ "focus.timepicker": n.proxy(this.highlightUnit, this),
1892
+ mousedown: n.proxy(this.highlightUnit, this),
1893
+ "keydown.timepicker": n.proxy(this.elementKeydown, this),
1894
+ "blur.timepicker": n.proxy(this.blurElement, this)
1895
+ })
1896
+ } else if (this.template) this.$element.on({
1897
+ "focus.timepicker": n.proxy(this.showWidget, this),
1898
+ mousedown: n.proxy(this.showWidget, this),
1899
+ "blur.timepicker": n.proxy(this.blurElement, this)
1900
+ });
1901
+ else this.$element.on({
1902
+ "focus.timepicker": n.proxy(this.highlightUnit, this),
1903
+ mousedown: n.proxy(this.highlightUnit, this),
1904
+ "keydown.timepicker": n.proxy(this.elementKeydown, this),
1905
+ "blur.timepicker": n.proxy(this.blurElement, this)
1906
+ });
1907
+ this.$widget = this.template !== !1 ? n(this.getTemplate()).prependTo(this.$element.parents(this.appendWidgetTo)).on("click", n.proxy(this.widgetClick, this)) : !1;
1908
+ this.showInputs && this.$widget !== !1 && this.$widget.find("input").each(function() {
1909
+ n(this).on({
1910
+ mousedown: function() {
1911
+ n(this).select()
1912
+ },
1913
+ "keydown.timepicker": n.proxy(t.widgetKeydown, t)
1914
+ })
1915
+ });
1916
+ this.bindClickHandlers();
1917
+ this.setDefaultTime(this.defaultTime)
1918
+ },
1919
+ bindClickHandlers: function() {
1920
+ if (this.$element.parent().hasClass("input-group")) {
1921
+ if (this.$element.parent(".input-group").find(".input-group-addon").length) this.$element.parent(".input-group").find(".input-group-addon").one({
1922
+ mousedown: n.proxy(this.showWidget, this)
1923
+ });
1924
+ else this.$element.closest(this.containerClass).find(".input-group-addon").one({
1925
+ mousedown: n.proxy(this.showWidget, this)
1926
+ });
1927
+ this.$element.one({
1928
+ mousedown: n.proxy(this.highlightUnit, this)
1929
+ })
1930
+ } else if (this.template) this.$element.one({
1931
+ mousedown: n.proxy(this.showWidget, this)
1932
+ });
1933
+ else this.$element.one({
1934
+ mousedown: n.proxy(this.highlightUnit, this)
1935
+ });
1936
+ this.showInputs && this.$widget !== !1 && this.$widget.find("input").each(function() {
1937
+ n(this).one({
1938
+ mousedown: function() {
1939
+ n(this).select()
1940
+ }
1941
+ })
1942
+ })
1943
+ },
1944
+ blurElement: function() {
1945
+ this.highlightedUnit = r;
1946
+ this.updateFromElementVal()
1947
+ },
1948
+ decrementHour: function() {
1949
+ if (this.showMeridian)
1950
+ if (this.hour === 1) this.hour = 12;
1951
+ else {
1952
+ if (this.hour === 12) return this.hour--, this.toggleMeridian();
1953
+ if (this.hour === 0) return this.hour = 11, this.toggleMeridian();
1954
+ this.hour--
1955
+ }
1956
+ else this.hour === 0 ? this.hour = 23 : this.hour--
1957
+ },
1958
+ decrementMinute: function(n) {
1959
+ var t;
1960
+ t = n ? this.minute - n : this.minute - this.minuteStep;
1961
+ t < 0 ? (this.decrementHour(), this.minute = t + 60) : this.minute = t
1962
+ },
1963
+ decrementSecond: function() {
1964
+ var n = this.second - this.secondStep;
1965
+ n < 0 ? (this.decrementMinute(!0), this.second = n + 60) : this.second = n
1966
+ },
1967
+ elementKeydown: function(n) {
1968
+ switch (n.keyCode) {
1969
+ case 9:
1970
+ this.updateFromElementVal();
1971
+ switch (this.highlightedUnit) {
1972
+ case "hour":
1973
+ n.preventDefault();
1974
+ this.highlightNextUnit();
1975
+ break;
1976
+ case "minute":
1977
+ (this.showMeridian || this.showSeconds) && (n.preventDefault(), this.highlightNextUnit());
1978
+ break;
1979
+ case "second":
1980
+ this.showMeridian && (n.preventDefault(), this.highlightNextUnit())
1981
+ }
1982
+ break;
1983
+ case 27:
1984
+ this.updateFromElementVal();
1985
+ break;
1986
+ case 37:
1987
+ n.preventDefault();
1988
+ this.highlightPrevUnit();
1989
+ this.updateFromElementVal();
1990
+ break;
1991
+ case 38:
1992
+ n.preventDefault();
1993
+ switch (this.highlightedUnit) {
1994
+ case "hour":
1995
+ this.incrementHour();
1996
+ this.highlightHour();
1997
+ break;
1998
+ case "minute":
1999
+ this.incrementMinute();
2000
+ this.highlightMinute();
2001
+ break;
2002
+ case "second":
2003
+ this.incrementSecond();
2004
+ this.highlightSecond();
2005
+ break;
2006
+ case "meridian":
2007
+ this.toggleMeridian();
2008
+ this.highlightMeridian()
2009
+ }
2010
+ break;
2011
+ case 39:
2012
+ n.preventDefault();
2013
+ this.updateFromElementVal();
2014
+ this.highlightNextUnit();
2015
+ break;
2016
+ case 40:
2017
+ n.preventDefault();
2018
+ switch (this.highlightedUnit) {
2019
+ case "hour":
2020
+ this.decrementHour();
2021
+ this.highlightHour();
2022
+ break;
2023
+ case "minute":
2024
+ this.decrementMinute();
2025
+ this.highlightMinute();
2026
+ break;
2027
+ case "second":
2028
+ this.decrementSecond();
2029
+ this.highlightSecond();
2030
+ break;
2031
+ case "meridian":
2032
+ this.toggleMeridian();
2033
+ this.highlightMeridian()
2034
+ }
2035
+ }
2036
+ },
2037
+ formatTime: function(n, t, i, r) {
2038
+ return n = n < 10 ? "0" + n : n, t = t < 10 ? "0" + t : t, i = i < 10 ? "0" + i : i, n + ":" + t + (this.showSeconds ? ":" + i : "") + (this.showMeridian ? " " + r : "")
2039
+ },
2040
+ getCursorPosition: function() {
2041
+ var n = this.$element.get(0),
2042
+ t, r;
2043
+ return "selectionStart" in n ? n.selectionStart : i.selection ? (n.focus(), t = i.selection.createRange(), r = i.selection.createRange().text.length, t.moveStart("character", -n.value.length), t.text.length - r) : void 0
2044
+ },
2045
+ getTemplate: function() {
2046
+ var n, t, i, r, u, f;
2047
+ this.showInputs ? (t = '<input type="text" name="hour" class="bootstrap-timepicker-hour form-control" maxlength="2"/>', i = '<input type="text" name="minute" class="bootstrap-timepicker-minute form-control" maxlength="2"/>', r = '<input type="text" name="second" class="bootstrap-timepicker-second form-control" maxlength="2"/>', u = '<input type="text" name="meridian" class="bootstrap-timepicker-meridian form-control" maxlength="2"/>') : (t = '<span class="bootstrap-timepicker-hour"><\/span>', i = '<span class="bootstrap-timepicker-minute"><\/span>', r = '<span class="bootstrap-timepicker-second"><\/span>', u = '<span class="bootstrap-timepicker-meridian"><\/span>');
2048
+ f = '<table><tr><td><a href="#" data-action="incrementHour"><i class="' + this.upArrowStyle + '"><\/i><\/a><\/td><td class="separator">&nbsp;<\/td><td><a href="#" data-action="incrementMinute"><i class="' + this.upArrowStyle + '"><\/i><\/a><\/td>' + (this.showSeconds ? '<td class="separator">&nbsp;<\/td><td><a href="#" data-action="incrementSecond"><i class="' + this.upArrowStyle + '"><\/i><\/a><\/td>' : "") + (this.showMeridian ? '<td class="separator">&nbsp;<\/td><td class="meridian-column"><a href="#" data-action="toggleMeridian"><i class="' + this.upArrowStyle + '"><\/i><\/a><\/td>' : "") + "<\/tr><tr><td>" + t + '<\/td> <td class="separator">' + this.timeSeparator + "<\/td><td>" + i + "<\/td> " + (this.showSeconds ? '<td class="separator">' + this.timeSeparator + "<\/td><td>" + r + "<\/td>" : "") + (this.showMeridian ? '<td class="separator">&nbsp;<\/td><td>' + u + "<\/td>" : "") + '<\/tr><tr><td><a href="#" data-action="decrementHour"><i class="' + this.downArrowStyle + '"><\/i><\/a><\/td><td class="separator"><\/td><td><a href="#" data-action="decrementMinute"><i class="' + this.downArrowStyle + '"><\/i><\/a><\/td>' + (this.showSeconds ? '<td class="separator">&nbsp;<\/td><td><a href="#" data-action="decrementSecond"><i class="' + this.downArrowStyle + '"><\/i><\/a><\/td>' : "") + (this.showMeridian ? '<td class="separator">&nbsp;<\/td><td><a href="#" data-action="toggleMeridian"><i class="' + this.downArrowStyle + '"><\/i><\/a><\/td>' : "") + "<\/tr><\/table>";
2049
+ switch (this.template) {
2050
+ case "modal":
2051
+ n = '<div class="bootstrap-timepicker-widget modal hide fade in" data-backdrop="' + (this.modalBackdrop ? "true" : "false") + '"><div class="modal-header"><a href="#" class="close" data-dismiss="modal">×<\/a><h3>Pick a Time<\/h3><\/div><div class="modal-content">' + f + '<\/div><div class="modal-footer"><a href="#" class="btn btn-primary" data-dismiss="modal">OK<\/a><\/div><\/div>';
2052
+ break;
2053
+ case "dropdown":
2054
+ n = '<div class="bootstrap-timepicker-widget dropdown-menu">' + f + "<\/div>"
2055
+ }
2056
+ return n
2057
+ },
2058
+ getTime: function() {
2059
+ return this.formatTime(this.hour, this.minute, this.second, this.meridian)
2060
+ },
2061
+ hideWidget: function() {
2062
+ this.isOpen !== !1 && (this.showInputs && this.updateFromWidgetInputs(), this.$element.trigger({
2063
+ type: "hide.timepicker",
2064
+ time: {
2065
+ value: this.getTime(),
2066
+ hours: this.hour,
2067
+ minutes: this.minute,
2068
+ seconds: this.second,
2069
+ meridian: this.meridian
2070
+ }
2071
+ }), this.template === "modal" && this.$widget.modal ? this.$widget.modal("hide") : (this.$widget.removeClass("open"), this.$widget.hide()), n(i).off("mousedown.timepicker"), this.isOpen = !1, this.bindClickHandlers())
2072
+ },
2073
+ highlightUnit: function() {
2074
+ this.position = this.getCursorPosition();
2075
+ this.position >= 0 && this.position <= 2 ? this.highlightHour() : this.position >= 3 && this.position <= 5 ? this.highlightMinute() : this.position >= 6 && this.position <= 8 ? this.showSeconds ? this.highlightSecond() : this.highlightMeridian() : this.position >= 9 && this.position <= 11 && this.highlightMeridian()
2076
+ },
2077
+ highlightNextUnit: function() {
2078
+ switch (this.highlightedUnit) {
2079
+ case "hour":
2080
+ this.highlightMinute();
2081
+ break;
2082
+ case "minute":
2083
+ this.showSeconds ? this.highlightSecond() : this.showMeridian ? this.highlightMeridian() : this.highlightHour();
2084
+ break;
2085
+ case "second":
2086
+ this.showMeridian ? this.highlightMeridian() : this.highlightHour();
2087
+ break;
2088
+ case "meridian":
2089
+ this.highlightHour()
2090
+ }
2091
+ },
2092
+ highlightPrevUnit: function() {
2093
+ switch (this.highlightedUnit) {
2094
+ case "hour":
2095
+ this.highlightMeridian();
2096
+ break;
2097
+ case "minute":
2098
+ this.highlightHour();
2099
+ break;
2100
+ case "second":
2101
+ this.highlightMinute();
2102
+ break;
2103
+ case "meridian":
2104
+ this.showSeconds ? this.highlightSecond() : this.highlightMinute()
2105
+ }
2106
+ },
2107
+ highlightHour: function() {
2108
+ var n = this.$element.get(0);
2109
+ this.highlightedUnit = "hour";
2110
+ n.setSelectionRange && setTimeout(function() {
2111
+ n.setSelectionRange(0, 2)
2112
+ }, 0)
2113
+ },
2114
+ highlightMinute: function() {
2115
+ var n = this.$element.get(0);
2116
+ this.highlightedUnit = "minute";
2117
+ n.setSelectionRange && setTimeout(function() {
2118
+ n.setSelectionRange(3, 5)
2119
+ }, 0)
2120
+ },
2121
+ highlightSecond: function() {
2122
+ var n = this.$element.get(0);
2123
+ this.highlightedUnit = "second";
2124
+ n.setSelectionRange && setTimeout(function() {
2125
+ n.setSelectionRange(6, 8)
2126
+ }, 0)
2127
+ },
2128
+ highlightMeridian: function() {
2129
+ var n = this.$element.get(0);
2130
+ this.highlightedUnit = "meridian";
2131
+ n.setSelectionRange && (this.showSeconds ? setTimeout(function() {
2132
+ n.setSelectionRange(9, 11)
2133
+ }, 0) : setTimeout(function() {
2134
+ n.setSelectionRange(6, 8)
2135
+ }, 0))
2136
+ },
2137
+ incrementHour: function() {
2138
+ if (this.showMeridian) {
2139
+ if (this.hour === 11) return this.hour++, this.toggleMeridian();
2140
+ this.hour === 12 && (this.hour = 0)
2141
+ }
2142
+ if (this.hour === 23) {
2143
+ this.hour = 0;
2144
+ return
2145
+ }
2146
+ this.hour++
2147
+ },
2148
+ incrementMinute: function(n) {
2149
+ var t;
2150
+ t = n ? this.minute + n : this.minute + this.minuteStep - this.minute % this.minuteStep;
2151
+ t > 59 ? (this.incrementHour(), this.minute = t - 60) : this.minute = t
2152
+ },
2153
+ incrementSecond: function() {
2154
+ var n = this.second + this.secondStep - this.second % this.secondStep;
2155
+ n > 59 ? (this.incrementMinute(!0), this.second = n - 60) : this.second = n
2156
+ },
2157
+ remove: function() {
2158
+ n("document").off(".timepicker");
2159
+ this.$widget && this.$widget.remove();
2160
+ delete this.$element.data().timepicker
2161
+ },
2162
+ setDefaultTime: function(n) {
2163
+ if (this.$element.val()) this.updateFromElementVal();
2164
+ else if (n === "current") {
2165
+ var i = new Date,
2166
+ t = i.getHours(),
2167
+ u = Math.floor(i.getMinutes() / this.minuteStep) * this.minuteStep,
2168
+ f = Math.floor(i.getSeconds() / this.secondStep) * this.secondStep,
2169
+ r = "AM";
2170
+ this.showMeridian && (t === 0 ? t = 12 : t >= 12 ? (t > 12 && (t = t - 12), r = "PM") : r = "AM");
2171
+ this.hour = t;
2172
+ this.minute = u;
2173
+ this.second = f;
2174
+ this.meridian = r;
2175
+ this.update()
2176
+ } else n === !1 ? (this.hour = 0, this.minute = 0, this.second = 0, this.meridian = "AM") : this.setTime(n)
2177
+ },
2178
+ setTime: function(n) {
2179
+ var i, t;
2180
+ this.showMeridian ? (i = n.split(" "), t = i[0].split(":"), this.meridian = i[1]) : t = n.split(":");
2181
+ this.hour = parseInt(t[0], 10);
2182
+ this.minute = parseInt(t[1], 10);
2183
+ this.second = parseInt(t[2], 10);
2184
+ isNaN(this.hour) && (this.hour = 0);
2185
+ isNaN(this.minute) && (this.minute = 0);
2186
+ this.showMeridian ? (this.hour > 12 ? this.hour = 12 : this.hour < 1 && (this.hour = 12), this.meridian === "am" || this.meridian === "a" ? this.meridian = "AM" : (this.meridian === "pm" || this.meridian === "p") && (this.meridian = "PM"), this.meridian !== "AM" && this.meridian !== "PM" && (this.meridian = "AM")) : this.hour >= 24 ? this.hour = 23 : this.hour < 0 && (this.hour = 0);
2187
+ this.minute < 0 ? this.minute = 0 : this.minute >= 60 && (this.minute = 59);
2188
+ this.showSeconds && (isNaN(this.second) ? this.second = 0 : this.second < 0 ? this.second = 0 : this.second >= 60 && (this.second = 59));
2189
+ this.update()
2190
+ },
2191
+ showWidget: function(t) {
2192
+ if ((t.stopPropagation(), !this.isOpen) && !this.$element.is(":disabled")) {
2193
+ var r = this;
2194
+ n(i).on("mousedown.timepicker touchstart.timepicker", function(t) {
2195
+ n(t.target).closest(".bootstrap-timepicker-widget").length === 0 && r.hideWidget()
2196
+ });
2197
+ if (this.$element.trigger({
2198
+ type: "show.timepicker",
2199
+ time: {
2200
+ value: this.getTime(),
2201
+ hours: this.hour,
2202
+ minutes: this.minute,
2203
+ seconds: this.second,
2204
+ meridian: this.meridian
2205
+ }
2206
+ }), this.disableFocus && this.$element.blur(), this.updateFromElementVal(), this.template === "modal" && this.$widget.modal) this.$widget.modal("show").on("hidden", n.proxy(this.hideWidget, this));
2207
+ else this.isOpen === !1 && (this.$widget.addClass("open"), this.$widget.show());
2208
+ this.isOpen = !0
2209
+ }
2210
+ },
2211
+ toggleMeridian: function() {
2212
+ this.meridian = this.meridian === "AM" ? "PM" : "AM";
2213
+ this.update()
2214
+ },
2215
+ update: function() {
2216
+ this.$element.trigger({
2217
+ type: "changeTime.timepicker",
2218
+ time: {
2219
+ value: this.getTime(),
2220
+ hours: this.hour,
2221
+ minutes: this.minute,
2222
+ seconds: this.second,
2223
+ meridian: this.meridian
2224
+ }
2225
+ });
2226
+ this.updateElement();
2227
+ this.updateWidget()
2228
+ },
2229
+ updateElement: function() {
2230
+ this.$element.val(this.getTime()).change()
2231
+ },
2232
+ updateFromElementVal: function() {
2233
+ var n = this.$element.val();
2234
+ n && this.setTime(n)
2235
+ },
2236
+ updateWidget: function() {
2237
+ if (this.$widget !== !1) {
2238
+ var n = this.hour < 10 ? "0" + this.hour : this.hour,
2239
+ t = this.minute < 10 ? "0" + this.minute : this.minute,
2240
+ i = this.second < 10 ? "0" + this.second : this.second;
2241
+ this.showInputs ? (this.$widget.find("input.bootstrap-timepicker-hour").val(n), this.$widget.find("input.bootstrap-timepicker-minute").val(t), this.showSeconds && this.$widget.find("input.bootstrap-timepicker-second").val(i), this.showMeridian && this.$widget.find("input.bootstrap-timepicker-meridian").val(this.meridian)) : (this.$widget.find("span.bootstrap-timepicker-hour").text(n), this.$widget.find("span.bootstrap-timepicker-minute").text(t), this.showSeconds && this.$widget.find("span.bootstrap-timepicker-second").text(i), this.showMeridian && this.$widget.find("span.bootstrap-timepicker-meridian").text(this.meridian))
2242
+ }
2243
+ },
2244
+ updateFromWidgetInputs: function() {
2245
+ if (this.$widget !== !1) {
2246
+ var t = n("input.bootstrap-timepicker-hour", this.$widget).val() + ":" + n("input.bootstrap-timepicker-minute", this.$widget).val() + (this.showSeconds ? ":" + n("input.bootstrap-timepicker-second", this.$widget).val() : "") + (this.showMeridian ? " " + n("input.bootstrap-timepicker-meridian", this.$widget).val() : "");
2247
+ this.setTime(t)
2248
+ }
2249
+ },
2250
+ widgetClick: function(t) {
2251
+ t.stopPropagation();
2252
+ t.preventDefault();
2253
+ var i = n(t.target).closest("a").data("action");
2254
+ i && (this[i](), this.update())
2255
+ },
2256
+ widgetKeydown: function(t) {
2257
+ var r = n(t.target).closest("input"),
2258
+ i = r.attr("name");
2259
+ switch (t.keyCode) {
2260
+ case 9:
2261
+ if (this.showMeridian) {
2262
+ if (i === "meridian") return this.hideWidget()
2263
+ } else if (this.showSeconds) {
2264
+ if (i === "second") return this.hideWidget()
2265
+ } else if (i === "minute") return this.hideWidget();
2266
+ this.updateFromWidgetInputs();
2267
+ break;
2268
+ case 27:
2269
+ this.hideWidget();
2270
+ break;
2271
+ case 38:
2272
+ t.preventDefault();
2273
+ switch (i) {
2274
+ case "hour":
2275
+ this.incrementHour();
2276
+ this.update();
2277
+ break;
2278
+ case "minute":
2279
+ this.incrementMinute();
2280
+ this.update();
2281
+ break;
2282
+ case "second":
2283
+ this.incrementSecond();
2284
+ this.update();
2285
+ break;
2286
+ case "meridian":
2287
+ this.toggleMeridian();
2288
+ this.update()
2289
+ }
2290
+ break;
2291
+ case 40:
2292
+ t.preventDefault();
2293
+ switch (i) {
2294
+ case "hour":
2295
+ this.decrementHour();
2296
+ this.update();
2297
+ break;
2298
+ case "minute":
2299
+ this.decrementMinute();
2300
+ this.update();
2301
+ break;
2302
+ case "second":
2303
+ this.decrementSecond();
2304
+ this.update();
2305
+ break;
2306
+ case "meridian":
2307
+ this.toggleMeridian();
2308
+ this.update()
2309
+ }
2310
+ }
2311
+ }
2312
+ };
2313
+ n.fn.timepicker = function(t) {
2314
+ var i = Array.apply(null, arguments);
2315
+ return i.shift(), this.each(function() {
2316
+ var f = n(this),
2317
+ r = f.data("timepicker"),
2318
+ e = typeof t == "object" && t;
2319
+ r || f.data("timepicker", r = new u(this, n.extend({}, n.fn.timepicker.defaults, e, n(this).data())));
2320
+ typeof t == "string" && r[t].apply(r, i)
2321
+ })
2322
+ };
2323
+ n.fn.timepicker.defaults = {
2324
+ defaultTime: "current",
2325
+ disableFocus: !1,
2326
+ isOpen: !1,
2327
+ minuteStep: 15,
2328
+ modalBackdrop: !1,
2329
+ secondStep: 15,
2330
+ showSeconds: !1,
2331
+ showInputs: !0,
2332
+ showMeridian: !0,
2333
+ template: "dropdown",
2334
+ appendWidgetTo: ".bootstrap-timepicker",
2335
+ upArrowStyle: "fa fa-arrow-up fa-2x",
2336
+ downArrowStyle: "fa fa-arrow-down fa-2x",
2337
+ containerClass: "bootstrap-timepicker",
2338
+ timeSeparator: ":"
2339
+ };
2340
+ n.fn.timepicker.Constructor = u
2341
+ }(jQuery, window, document);
2342
+ embedGenTimeoutId = null;
2343
+ eventPollingsInterval = 12e4;
2344
+ $(function() {
2345
+ var t = 288e5,
2346
+ r = $.connection.eventStateHub,
2347
+ u = $("#eventId").val(),
2348
+ i = setTimeout(stopHub, t),
2349
+ n;
2350
+
2351
+ $.connection.hub.start().done(function() {});
2352
+ $(".embed-code").hide();
2353
+ $(".embed-terms .btn-agree").on("click", function(n) {
2354
+ n.preventDefault();
2355
+ $(".embed-terms").fadeOut();
2356
+ $(".embed-code").fadeIn()
2357
+ });
2358
+ n = {
2359
+ defaultTime: !1,
2360
+ showSeconds: !0,
2361
+ showMeridian: !0,
2362
+ minuteStep: 1,
2363
+ secondStep: 1
2364
+ };
2365
+ $("#startTime").timepicker(n);
2366
+ $("#endTime").timepicker(n);
2367
+ $(".embed-code").hide();
2368
+ $(".embed-terms .btn-agree").bind("click", function(n) {
2369
+ n.preventDefault();
2370
+ $(".embed-terms").fadeOut();
2371
+ $(".embed-code").fadeIn()
2372
+ });
2373
+ updateSocialLinks(null, $("#url").val());
2374
+ $("#url").bind("updated-url", updateSocialLinks);
2375
+ updateClipping();
2376
+ selectableEmbedCode();
2377
+ audiOnlySwitch();
2378
+ pollEvent()
2379
+ });
2380
+ var stackPos = "top",
2381
+ logPos = "top",
2382
+ lastClickedTimecode = null,
2383
+ highlightItem = !0;
2384
+ $(function() {
2385
+ var n = $.connection.eventStateHub,
2386
+ t = $("#eventId").val();
2387
+ $("#ContainsLogMoments").val() == "True" && $("#DefaultToStackTab").val() == "False" && ($("#stacks").removeClass("active").removeClass("in"), $("#logs").addClass("active").addClass("in"));
2388
+ n.client.logUpdate = function(n, i) {
2389
+ if (t == i) {
2390
+ if ($("#ContainsLogMoments").val() == "False") {
2391
+ $("#LiveLogging").val("True");
2392
+ $("#index-message").removeClass("hidden");
2393
+ $("#ContainsLogMoments").val("True");
2394
+ $("#logTab").removeClass("invisible");
2395
+ $("#logTab a").tab("show");
2396
+ refreshLogMoments();
2397
+ return
2398
+ }
2399
+ n == "Add" ? appendLogMoments() : refreshLogMoments()
2400
+ }
2401
+ };
2402
+ $.connection.hub.start().done(function() {});
2403
+ scrollStackAndLogs();
2404
+ refreshStackInterval();
2405
+ $(document).on("tap", ".logouter", logItemClicked);
2406
+ $(document).on("click", ".logouter", logItemClicked);
2407
+ $(document).on("click", "#seekToLiveButton", seekToLive)
2408
+ });
2409
+ var captchaValid = !1,
2410
+ timesValid = !0,
2411
+ keepError = !1;
2412
+ $(function() {
2413
+ initTermsAndConditions();
2414
+ initEnableEmbed();
2415
+ initSetShareTime();
2416
+ initSetDownloadTime();
2417
+ initSetClipboard();
2418
+ initSetFileType();
2419
+ initEmailValid()
2420
+ });
2421
+ $(function() {
2422
+ initInputMask()
2423
+ });
2424
+ androidInput = !1