!function (e, t) { "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define("pdfjs-dist/build/pdf", [], t) : "object" == typeof exports ? exports["pdfjs-dist/build/pdf"] = t() : e["pdfjs-dist/build/pdf"] = e.pdfjsDistBuildPdf = t() }("undefined" != typeof self ? self : this, function () { return function (e) { var t = {}; function n(r) { if (t[r]) return t[r].exports; var i = t[r] = {i: r, l: !1, exports: {}}; return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports } return n.m = e, n.c = t, n.d = function (e, t, r) { n.o(e, t) || Object.defineProperty(e, t, {configurable: !1, enumerable: !0, get: r}) }, n.n = function (e) { var t = e && e.__esModule ? function () { return e.default } : function () { return e }; return n.d(t, "a", t), t }, n.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t) }, n.p = "", n(n.s = 98) }([function (e, t, n) { "use strict"; var r = e.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")(); "number" == typeof __g && (__g = r) }, function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}), t.unreachable = t.warn = t.utf8StringToString = t.stringToUTF8String = t.stringToPDFString = t.stringToBytes = t.string32 = t.shadow = t.setVerbosityLevel = t.ReadableStream = t.removeNullCharacters = t.readUint32 = t.readUint16 = t.readInt8 = t.log2 = t.loadJpegStream = t.isEvalSupported = t.isLittleEndian = t.createValidAbsoluteUrl = t.isSameOrigin = t.isNodeJS = t.isSpace = t.isString = t.isNum = t.isEmptyObj = t.isBool = t.isArrayBuffer = t.info = t.getVerbosityLevel = t.getLookupTableFactory = t.deprecated = t.createObjectURL = t.createPromiseCapability = t.createBlob = t.bytesToString = t.assert = t.arraysToBytes = t.arrayByteLength = t.FormatError = t.XRefParseException = t.Util = t.UnknownErrorException = t.UnexpectedResponseException = t.TextRenderingMode = t.StreamType = t.StatTimer = t.PasswordResponses = t.PasswordException = t.PageViewport = t.NotImplementedException = t.NativeImageDecoding = t.MissingPDFException = t.MissingDataException = t.MessageHandler = t.InvalidPDFException = t.AbortException = t.CMapCompressionType = t.ImageKind = t.FontType = t.AnnotationType = t.AnnotationFlag = t.AnnotationFieldFlag = t.AnnotationBorderStyleType = t.UNSUPPORTED_FEATURES = t.VERBOSITY_LEVELS = t.OPS = t.IDENTITY_MATRIX = t.FONT_IDENTITY_MATRIX = t.BaseException = void 0; var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }; n(99); var i = n(140), a = {errors: 0, warnings: 1, infos: 5}, o = a.warnings; function s(e) { o >= a.warnings && console.log("Warning: " + e) } function l(e) { throw new Error(e) } function c(e, t) { e || l(t) } var u = function () { function e(e, t) { this.name = "PasswordException", this.message = e, this.code = t } return e.prototype = new Error, e.constructor = e, e }(), d = function () { function e(e, t) { this.name = "UnknownErrorException", this.message = e, this.details = t } return e.prototype = new Error, e.constructor = e, e }(), h = function () { function e(e) { this.name = "InvalidPDFException", this.message = e } return e.prototype = new Error, e.constructor = e, e }(), p = function () { function e(e) { this.name = "MissingPDFException", this.message = e } return e.prototype = new Error, e.constructor = e, e }(), f = function () { function e(e, t) { this.name = "UnexpectedResponseException", this.message = e, this.status = t } return e.prototype = new Error, e.constructor = e, e }(), m = function () { function e(e) { this.message = e } return e.prototype = new Error, e.prototype.name = "NotImplementedException", e.constructor = e, e }(), v = function () { function e(e, t) { this.begin = e, this.end = t, this.message = "Missing data [" + e + ", " + t + ")" } return e.prototype = new Error, e.prototype.name = "MissingDataException", e.constructor = e, e }(), g = function () { function e(e) { this.message = e } return e.prototype = new Error, e.prototype.name = "XRefParseException", e.constructor = e, e }(), y = function () { function e(e) { this.message = e } return e.prototype = new Error, e.prototype.name = "FormatError", e.constructor = e, e }(), b = function () { function e(e) { this.name = "AbortException", this.message = e } return e.prototype = new Error, e.constructor = e, e }(), w = /\x00/g; function S(e) { c("string" == typeof e, "Invalid argument for stringToBytes"); for (var t = e.length, n = new Uint8Array(t), r = 0; r < t; ++r) n[r] = 255 & e.charCodeAt(r); return n } function _(e) { return void 0 !== e.length ? e.length : (c(void 0 !== e.byteLength), e.byteLength) } var k = function () { function e() { } var t = ["rgb(", 0, ",", 0, ",", 0, ")"]; e.makeCssRgb = function (e, n, r) { return t[1] = e, t[3] = n, t[5] = r, t.join("") }, e.transform = function (e, t) { return [e[0] * t[0] + e[2] * t[1], e[1] * t[0] + e[3] * t[1], e[0] * t[2] + e[2] * t[3], e[1] * t[2] + e[3] * t[3], e[0] * t[4] + e[2] * t[5] + e[4], e[1] * t[4] + e[3] * t[5] + e[5]] }, e.applyTransform = function (e, t) { return [e[0] * t[0] + e[1] * t[2] + t[4], e[0] * t[1] + e[1] * t[3] + t[5]] }, e.applyInverseTransform = function (e, t) { var n = t[0] * t[3] - t[1] * t[2]; return [(e[0] * t[3] - e[1] * t[2] + t[2] * t[5] - t[4] * t[3]) / n, (-e[0] * t[1] + e[1] * t[0] + t[4] * t[1] - t[5] * t[0]) / n] }, e.getAxialAlignedBoundingBox = function (t, n) { var r = e.applyTransform(t, n), i = e.applyTransform(t.slice(2, 4), n), a = e.applyTransform([t[0], t[3]], n), o = e.applyTransform([t[2], t[1]], n); return [Math.min(r[0], i[0], a[0], o[0]), Math.min(r[1], i[1], a[1], o[1]), Math.max(r[0], i[0], a[0], o[0]), Math.max(r[1], i[1], a[1], o[1])] }, e.inverseTransform = function (e) { var t = e[0] * e[3] - e[1] * e[2]; return [e[3] / t, -e[1] / t, -e[2] / t, e[0] / t, (e[2] * e[5] - e[4] * e[3]) / t, (e[4] * e[1] - e[5] * e[0]) / t] }, e.apply3dTransform = function (e, t) { return [e[0] * t[0] + e[1] * t[1] + e[2] * t[2], e[3] * t[0] + e[4] * t[1] + e[5] * t[2], e[6] * t[0] + e[7] * t[1] + e[8] * t[2]] }, e.singularValueDecompose2dScale = function (e) { var t = [e[0], e[2], e[1], e[3]], n = e[0] * t[0] + e[1] * t[2], r = e[0] * t[1] + e[1] * t[3], i = e[2] * t[0] + e[3] * t[2], a = e[2] * t[1] + e[3] * t[3], o = (n + a) / 2, s = Math.sqrt((n + a) * (n + a) - 4 * (n * a - i * r)) / 2, l = o + s || 1, c = o - s || 1; return [Math.sqrt(l), Math.sqrt(c)] }, e.normalizeRect = function (e) { var t = e.slice(0); return e[0] > e[2] && (t[0] = e[2], t[2] = e[0]), e[1] > e[3] && (t[1] = e[3], t[3] = e[1]), t }, e.intersect = function (t, n) { function r(e, t) { return e - t } var i = [t[0], t[2], n[0], n[2]].sort(r), a = [t[1], t[3], n[1], n[3]].sort(r), o = []; return t = e.normalizeRect(t), n = e.normalizeRect(n), (i[0] === t[0] && i[1] === n[0] || i[0] === n[0] && i[1] === t[0]) && (o[0] = i[1], o[2] = i[2], (a[0] === t[1] && a[1] === n[1] || a[0] === n[1] && a[1] === t[1]) && (o[1] = a[1], o[3] = a[2], o)) }; var n = ["", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM", "", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC", "", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"]; return e.toRoman = function (e, t) { c(Number.isInteger(e) && e > 0, "The number should be a positive integer."); for (var r, i = []; e >= 1e3;) e -= 1e3, i.push("M"); r = e / 100 | 0, e %= 100, i.push(n[r]), r = e / 10 | 0, e %= 10, i.push(n[10 + r]), i.push(n[20 + e]); var a = i.join(""); return t ? a.toLowerCase() : a }, e.appendToArray = function (e, t) { Array.prototype.push.apply(e, t) }, e.prependToArray = function (e, t) { Array.prototype.unshift.apply(e, t) }, e.extendObj = function (e, t) { for (var n in t) e[n] = t[n] }, e.getInheritableProperty = function (e, t, n) { for (; e && !e.has(t);) e = e.get("Parent"); return e ? n ? e.getArray(t) : e.get(t) : null }, e.inherit = function (e, t, n) { for (var r in e.prototype = Object.create(t.prototype), e.prototype.constructor = e, n) e.prototype[r] = n[r] }, e.loadScript = function (e, t) { var n = document.createElement("script"), r = !1; n.setAttribute("src", e), t && (n.onload = function () { r || t(), r = !0 }), document.getElementsByTagName("head")[0].appendChild(n) }, e }(), x = function () { function e(e, t, n, r, i, a) { this.viewBox = e, this.scale = t, this.rotation = n, this.offsetX = r, this.offsetY = i; var o, s, l, c, u, d, h, p, f = (e[2] + e[0]) / 2, m = (e[3] + e[1]) / 2; switch (n = (n %= 360) < 0 ? n + 360 : n) { case 180: o = -1, s = 0, l = 0, c = 1; break; case 90: o = 0, s = 1, l = 1, c = 0; break; case 270: o = 0, s = -1, l = -1, c = 0; break; default: o = 1, s = 0, l = 0, c = -1 } a && (l = -l, c = -c), 0 === o ? (u = Math.abs(m - e[1]) * t + r, d = Math.abs(f - e[0]) * t + i, h = Math.abs(e[3] - e[1]) * t, p = Math.abs(e[2] - e[0]) * t) : (u = Math.abs(f - e[0]) * t + r, d = Math.abs(m - e[1]) * t + i, h = Math.abs(e[2] - e[0]) * t, p = Math.abs(e[3] - e[1]) * t), this.transform = [o * t, s * t, l * t, c * t, u - o * t * f - l * t * m, d - s * t * f - c * t * m], this.width = h, this.height = p, this.fontScale = t } return e.prototype = { clone: function (t) { var n = "scale" in (t = t || {}) ? t.scale : this.scale, r = "rotation" in t ? t.rotation : this.rotation; return new e(this.viewBox.slice(), n, r, this.offsetX, this.offsetY, t.dontFlip) }, convertToViewportPoint: function (e, t) { return k.applyTransform([e, t], this.transform) }, convertToViewportRectangle: function (e) { var t = k.applyTransform([e[0], e[1]], this.transform), n = k.applyTransform([e[2], e[3]], this.transform); return [t[0], t[1], n[0], n[1]] }, convertToPdfPoint: function (e, t) { return k.applyInverseTransform([e, t], this.transform) } }, e }(), P = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 728, 711, 710, 729, 733, 731, 730, 732, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8226, 8224, 8225, 8230, 8212, 8211, 402, 8260, 8249, 8250, 8722, 8240, 8222, 8220, 8221, 8216, 8217, 8218, 8482, 64257, 64258, 321, 338, 352, 376, 381, 305, 322, 339, 353, 382, 0, 8364]; function C() { var e = {}; return e.promise = new Promise(function (t, n) { e.resolve = t, e.reject = n }), e } var A, T = function () { function e(e, t, n) { for (; e.length < n;) e += t; return e } function t() { this.started = Object.create(null), this.times = [], this.enabled = !0 } return t.prototype = { time: function (e) { this.enabled && (e in this.started && s("Timer is already running for " + e), this.started[e] = Date.now()) }, timeEnd: function (e) { this.enabled && (e in this.started || s("Timer has not been started for " + e), this.times.push({ name: e, start: this.started[e], end: Date.now() }), delete this.started[e]) }, toString: function () { var t, n, r = this.times, i = "", a = 0; for (t = 0, n = r.length; t < n; ++t) { var o = r[t].name; o.length > a && (a = o.length) } for (t = 0, n = r.length; t < n; ++t) { var s = r[t], l = s.end - s.start; i += e(s.name, " ", a) + " " + l + "ms\n" } return i } }, t }(), E = function (e, t) { if ("undefined" != typeof Blob) return new Blob([e], {type: t}); throw new Error('The "Blob" constructor is not supported.') }, D = (A = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", function (e, t) { if (!(arguments.length > 2 && void 0 !== arguments[2] && arguments[2]) && URL.createObjectURL) { var n = E(e, t); return URL.createObjectURL(n) } for (var r = "data:" + t + ";base64,", i = 0, a = e.length; i < a; i += 3) { var o = 255 & e[i], s = 255 & e[i + 1], l = 255 & e[i + 2]; r += A[o >> 2] + A[(3 & o) << 4 | s >> 4] + A[i + 1 < a ? (15 & s) << 2 | l >> 6 : 64] + A[i + 2 < a ? 63 & l : 64] } return r }); function I(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null; return e ? new Promise(function (r, i) { r(e.apply(n, t)) }) : Promise.resolve(void 0) } function L(e) { if ("object" !== (void 0 === e ? "undefined" : r(e))) return e; switch (e.name) { case"AbortException": return new b(e.message); case"MissingPDFException": return new p(e.message); case"UnexpectedResponseException": return new f(e.message, e.status); default: return new d(e.message, e.details) } } function O(e, t, n) { t ? e.resolve() : e.reject(n) } function M(e, t, n) { var r = this; this.sourceName = e, this.targetName = t, this.comObj = n, this.callbackId = 1, this.streamId = 1, this.postMessageTransfers = !0, this.streamSinks = Object.create(null), this.streamControllers = Object.create(null); var i = this.callbacksCapabilities = Object.create(null), a = this.actionHandler = Object.create(null); this._onComObjOnMessage = function (e) { var t = e.data; if (t.targetName === r.sourceName) if (t.stream) r._processStreamMessage(t); else if (t.isReply) { var o = t.callbackId; if (!(t.callbackId in i)) throw new Error("Cannot resolve callback " + o); var s = i[o]; delete i[o], "error" in t ? s.reject(L(t.error)) : s.resolve(t.data) } else { if (!(t.action in a)) throw new Error("Unknown action from worker: " + t.action); var l = a[t.action]; if (t.callbackId) { var c = r.sourceName, u = t.sourceName; Promise.resolve().then(function () { return l[0].call(l[1], t.data) }).then(function (e) { n.postMessage({sourceName: c, targetName: u, isReply: !0, callbackId: t.callbackId, data: e}) }, function (e) { n.postMessage({ sourceName: c, targetName: u, isReply: !0, callbackId: t.callbackId, error: function (e) { return !(e instanceof Error) || e instanceof b || e instanceof p || e instanceof f || e instanceof d ? e : new d(e.message, e.toString()) }(e) }) }) } else t.streamId ? r._createStreamSink(t) : l[0].call(l[1], t.data) } }, n.addEventListener("message", this._onComObjOnMessage) } M.prototype = { on: function (e, t, n) { var r = this.actionHandler; if (r[e]) throw new Error('There is already an actionName called "' + e + '"'); r[e] = [t, n] }, send: function (e, t, n) { var r = {sourceName: this.sourceName, targetName: this.targetName, action: e, data: t}; this.postMessage(r, n) }, sendWithPromise: function (e, t, n) { var r = this.callbackId++, i = {sourceName: this.sourceName, targetName: this.targetName, action: e, data: t, callbackId: r}, a = C(); this.callbacksCapabilities[r] = a; try { this.postMessage(i, n) } catch (e) { a.reject(e) } return a.promise }, sendWithStream: function (e, t, n, r) { var a = this, o = this.streamId++, s = this.sourceName, l = this.targetName; return new i.ReadableStream({ start: function (n) { var r = C(); return a.streamControllers[o] = {controller: n, startCall: r, isClosed: !1}, a.postMessage({ sourceName: s, targetName: l, action: e, streamId: o, data: t, desiredSize: n.desiredSize }), r.promise }, pull: function (e) { var t = C(); return a.streamControllers[o].pullCall = t, a.postMessage({ sourceName: s, targetName: l, stream: "pull", streamId: o, desiredSize: e.desiredSize }), t.promise }, cancel: function (e) { var t = C(); return a.streamControllers[o].cancelCall = t, a.streamControllers[o].isClosed = !0, a.postMessage({ sourceName: s, targetName: l, stream: "cancel", reason: e, streamId: o }), t.promise } }, n) }, _createStreamSink: function (e) { var t = this, n = this, r = this.actionHandler[e.action], i = e.streamId, a = e.desiredSize, o = this.sourceName, s = e.sourceName, l = function (e) { var n = e.stream, r = e.chunk, a = e.transfers, l = e.success, c = e.reason; t.postMessage({sourceName: o, targetName: s, stream: n, streamId: i, chunk: r, success: l, reason: c}, a) }, c = { enqueue: function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, n = arguments[2]; if (!this.isCancelled) { var r = this.desiredSize; this.desiredSize -= t, r > 0 && this.desiredSize <= 0 && (this.sinkCapability = C(), this.ready = this.sinkCapability.promise), l({ stream: "enqueue", chunk: e, transfers: n }) } }, close: function () { this.isCancelled || (this.isCancelled = !0, l({stream: "close"}), delete n.streamSinks[i]) }, error: function (e) { this.isCancelled || (this.isCancelled = !0, l({stream: "error", reason: e})) }, sinkCapability: C(), onPull: null, onCancel: null, isCancelled: !1, desiredSize: a, ready: null }; c.sinkCapability.resolve(), c.ready = c.sinkCapability.promise, this.streamSinks[i] = c, I(r[0], [e.data, c], r[1]).then(function () { l({stream: "start_complete", success: !0}) }, function (e) { l({stream: "start_complete", success: !1, reason: e}) }) }, _processStreamMessage: function (e) { var t = this, n = this.sourceName, r = e.sourceName, i = e.streamId, a = function (e) { var a = e.stream, o = e.success, s = e.reason; t.comObj.postMessage({sourceName: n, targetName: r, stream: a, success: o, streamId: i, reason: s}) }, o = function () { Promise.all([t.streamControllers[e.streamId].startCall, t.streamControllers[e.streamId].pullCall, t.streamControllers[e.streamId].cancelCall].map(function (e) { return e && (t = e.promise, Promise.resolve(t).catch(function () { })); var t })).then(function () { delete t.streamControllers[e.streamId] }) }; switch (e.stream) { case"start_complete": O(this.streamControllers[e.streamId].startCall, e.success, L(e.reason)); break; case"pull_complete": O(this.streamControllers[e.streamId].pullCall, e.success, L(e.reason)); break; case"pull": if (!this.streamSinks[e.streamId]) { a({stream: "pull_complete", success: !0}); break } this.streamSinks[e.streamId].desiredSize <= 0 && e.desiredSize > 0 && this.streamSinks[e.streamId].sinkCapability.resolve(), this.streamSinks[e.streamId].desiredSize = e.desiredSize, I(this.streamSinks[e.streamId].onPull).then(function () { a({stream: "pull_complete", success: !0}) }, function (e) { a({stream: "pull_complete", success: !1, reason: e}) }); break; case"enqueue": c(this.streamControllers[e.streamId], "enqueue should have stream controller"), this.streamControllers[e.streamId].isClosed || this.streamControllers[e.streamId].controller.enqueue(e.chunk); break; case"close": if (c(this.streamControllers[e.streamId], "close should have stream controller"), this.streamControllers[e.streamId].isClosed) break; this.streamControllers[e.streamId].isClosed = !0, this.streamControllers[e.streamId].controller.close(), o(); break; case"error": c(this.streamControllers[e.streamId], "error should have stream controller"), this.streamControllers[e.streamId].controller.error(L(e.reason)), o(); break; case"cancel_complete": O(this.streamControllers[e.streamId].cancelCall, e.success, L(e.reason)), o(); break; case"cancel": if (!this.streamSinks[e.streamId]) break; I(this.streamSinks[e.streamId].onCancel, [L(e.reason)]).then(function () { a({stream: "cancel_complete", success: !0}) }, function (e) { a({stream: "cancel_complete", success: !1, reason: e}) }), this.streamSinks[e.streamId].sinkCapability.reject(L(e.reason)), this.streamSinks[e.streamId].isCancelled = !0, delete this.streamSinks[e.streamId]; break; default: throw new Error("Unexpected stream case") } }, postMessage: function (e, t) { t && this.postMessageTransfers ? this.comObj.postMessage(e, t) : this.comObj.postMessage(e) }, destroy: function () { this.comObj.removeEventListener("message", this._onComObjOnMessage) } }; var N = function () { function e(t, n) { this.constructor === e && l("Cannot initialize BaseException."), this.message = t, this.name = n } return e.prototype = new Error, e.constructor = e, e }(); t.BaseException = N, t.FONT_IDENTITY_MATRIX = [.001, 0, 0, .001, 0, 0], t.IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0], t.OPS = { dependency: 1, setLineWidth: 2, setLineCap: 3, setLineJoin: 4, setMiterLimit: 5, setDash: 6, setRenderingIntent: 7, setFlatness: 8, setGState: 9, save: 10, restore: 11, transform: 12, moveTo: 13, lineTo: 14, curveTo: 15, curveTo2: 16, curveTo3: 17, closePath: 18, rectangle: 19, stroke: 20, closeStroke: 21, fill: 22, eoFill: 23, fillStroke: 24, eoFillStroke: 25, closeFillStroke: 26, closeEOFillStroke: 27, endPath: 28, clip: 29, eoClip: 30, beginText: 31, endText: 32, setCharSpacing: 33, setWordSpacing: 34, setHScale: 35, setLeading: 36, setFont: 37, setTextRenderingMode: 38, setTextRise: 39, moveText: 40, setLeadingMoveText: 41, setTextMatrix: 42, nextLine: 43, showText: 44, showSpacedText: 45, nextLineShowText: 46, nextLineSetSpacingShowText: 47, setCharWidth: 48, setCharWidthAndBounds: 49, setStrokeColorSpace: 50, setFillColorSpace: 51, setStrokeColor: 52, setStrokeColorN: 53, setFillColor: 54, setFillColorN: 55, setStrokeGray: 56, setFillGray: 57, setStrokeRGBColor: 58, setFillRGBColor: 59, setStrokeCMYKColor: 60, setFillCMYKColor: 61, shadingFill: 62, beginInlineImage: 63, beginImageData: 64, endInlineImage: 65, paintXObject: 66, markPoint: 67, markPointProps: 68, beginMarkedContent: 69, beginMarkedContentProps: 70, endMarkedContent: 71, beginCompat: 72, endCompat: 73, paintFormXObjectBegin: 74, paintFormXObjectEnd: 75, beginGroup: 76, endGroup: 77, beginAnnotations: 78, endAnnotations: 79, beginAnnotation: 80, endAnnotation: 81, paintJpegXObject: 82, paintImageMaskXObject: 83, paintImageMaskXObjectGroup: 84, paintImageXObject: 85, paintInlineImageXObject: 86, paintInlineImageXObjectGroup: 87, paintImageXObjectRepeat: 88, paintImageMaskXObjectRepeat: 89, paintSolidColorImageMask: 90, constructPath: 91 }, t.VERBOSITY_LEVELS = a, t.UNSUPPORTED_FEATURES = { unknown: "unknown", forms: "forms", javaScript: "javaScript", smask: "smask", shadingPattern: "shadingPattern", font: "font" }, t.AnnotationBorderStyleType = { SOLID: 1, DASHED: 2, BEVELED: 3, INSET: 4, UNDERLINE: 5 }, t.AnnotationFieldFlag = { READONLY: 1, REQUIRED: 2, NOEXPORT: 4, MULTILINE: 4096, PASSWORD: 8192, NOTOGGLETOOFF: 16384, RADIO: 32768, PUSHBUTTON: 65536, COMBO: 131072, EDIT: 262144, SORT: 524288, FILESELECT: 1048576, MULTISELECT: 2097152, DONOTSPELLCHECK: 4194304, DONOTSCROLL: 8388608, COMB: 16777216, RICHTEXT: 33554432, RADIOSINUNISON: 33554432, COMMITONSELCHANGE: 67108864 }, t.AnnotationFlag = { INVISIBLE: 1, HIDDEN: 2, PRINT: 4, NOZOOM: 8, NOROTATE: 16, NOVIEW: 32, READONLY: 64, LOCKED: 128, TOGGLENOVIEW: 256, LOCKEDCONTENTS: 512 }, t.AnnotationType = { TEXT: 1, LINK: 2, FREETEXT: 3, LINE: 4, SQUARE: 5, CIRCLE: 6, POLYGON: 7, POLYLINE: 8, HIGHLIGHT: 9, UNDERLINE: 10, SQUIGGLY: 11, STRIKEOUT: 12, STAMP: 13, CARET: 14, INK: 15, POPUP: 16, FILEATTACHMENT: 17, SOUND: 18, MOVIE: 19, WIDGET: 20, SCREEN: 21, PRINTERMARK: 22, TRAPNET: 23, WATERMARK: 24, THREED: 25, REDACT: 26 }, t.FontType = { UNKNOWN: 0, TYPE1: 1, TYPE1C: 2, CIDFONTTYPE0: 3, CIDFONTTYPE0C: 4, TRUETYPE: 5, CIDFONTTYPE2: 6, TYPE3: 7, OPENTYPE: 8, TYPE0: 9, MMTYPE1: 10 }, t.ImageKind = {GRAYSCALE_1BPP: 1, RGB_24BPP: 2, RGBA_32BPP: 3}, t.CMapCompressionType = { NONE: 0, BINARY: 1, STREAM: 2 }, t.AbortException = b, t.InvalidPDFException = h, t.MessageHandler = M, t.MissingDataException = v, t.MissingPDFException = p, t.NativeImageDecoding = { NONE: "none", DECODE: "decode", DISPLAY: "display" }, t.NotImplementedException = m, t.PageViewport = x, t.PasswordException = u, t.PasswordResponses = { NEED_PASSWORD: 1, INCORRECT_PASSWORD: 2 }, t.StatTimer = T, t.StreamType = { UNKNOWN: 0, FLATE: 1, LZW: 2, DCT: 3, JPX: 4, JBIG: 5, A85: 6, AHX: 7, CCF: 8, RL: 9 }, t.TextRenderingMode = { FILL: 0, STROKE: 1, FILL_STROKE: 2, INVISIBLE: 3, FILL_ADD_TO_PATH: 4, STROKE_ADD_TO_PATH: 5, FILL_STROKE_ADD_TO_PATH: 6, ADD_TO_PATH: 7, FILL_STROKE_MASK: 3, ADD_TO_PATH_FLAG: 4 }, t.UnexpectedResponseException = f, t.UnknownErrorException = d, t.Util = k, t.XRefParseException = g, t.FormatError = y, t.arrayByteLength = _, t.arraysToBytes = function (e) { if (1 === e.length && e[0] instanceof Uint8Array) return e[0]; var t, n, r, i = 0, a = e.length; for (t = 0; t < a; t++) i += r = _(n = e[t]); var o = 0, s = new Uint8Array(i); for (t = 0; t < a; t++) (n = e[t]) instanceof Uint8Array || (n = "string" == typeof n ? S(n) : new Uint8Array(n)), r = n.byteLength, s.set(n, o), o += r; return s }, t.assert = c, t.bytesToString = function (e) { c(null !== e && "object" === (void 0 === e ? "undefined" : r(e)) && void 0 !== e.length, "Invalid argument for bytesToString"); var t = e.length; if (t < 8192) return String.fromCharCode.apply(null, e); for (var n = [], i = 0; i < t; i += 8192) { var a = Math.min(i + 8192, t), o = e.subarray(i, a); n.push(String.fromCharCode.apply(null, o)) } return n.join("") }, t.createBlob = E, t.createPromiseCapability = C, t.createObjectURL = D, t.deprecated = function (e) { console.log("Deprecated API usage: " + e) }, t.getLookupTableFactory = function (e) { var t; return function () { return e && (t = Object.create(null), e(t), e = null), t } }, t.getVerbosityLevel = function () { return o }, t.info = function (e) { o >= a.infos && console.log("Info: " + e) }, t.isArrayBuffer = function (e) { return "object" === (void 0 === e ? "undefined" : r(e)) && null !== e && void 0 !== e.byteLength }, t.isBool = function (e) { return "boolean" == typeof e }, t.isEmptyObj = function (e) { for (var t in e) return !1; return !0 }, t.isNum = function (e) { return "number" == typeof e }, t.isString = function (e) { return "string" == typeof e }, t.isSpace = function (e) { return 32 === e || 9 === e || 13 === e || 10 === e }, t.isNodeJS = function () { return "object" === ("undefined" == typeof process ? "undefined" : r(process)) && process + "" == "[object process]" }, t.isSameOrigin = function (e, t) { try { var n = new URL(e); if (!n.origin || "null" === n.origin) return !1 } catch (e) { return !1 } var r = new URL(t, n); return n.origin === r.origin }, t.createValidAbsoluteUrl = function (e, t) { if (!e) return null; try { var n = t ? new URL(e, t) : new URL(e); if (function (e) { if (!e) return !1; switch (e.protocol) { case"http:": case"https:": case"ftp:": case"mailto:": case"tel:": return !0; default: return !1 } }(n)) return n } catch (e) { } return null }, t.isLittleEndian = function () { var e = new Uint8Array(4); return e[0] = 1, 1 === new Uint32Array(e.buffer, 0, 1)[0] }, t.isEvalSupported = function () { try { return new Function(""), !0 } catch (e) { return !1 } }, t.loadJpegStream = function (e, t, n) { var r = new Image; r.onload = function () { n.resolve(e, r) }, r.onerror = function () { n.resolve(e, null), s("Error during JPEG image loading") }, r.src = t }, t.log2 = function (e) { return e <= 0 ? 0 : Math.ceil(Math.log2(e)) }, t.readInt8 = function (e, t) { return e[t] << 24 >> 24 }, t.readUint16 = function (e, t) { return e[t] << 8 | e[t + 1] }, t.readUint32 = function (e, t) { return (e[t] << 24 | e[t + 1] << 16 | e[t + 2] << 8 | e[t + 3]) >>> 0 }, t.removeNullCharacters = function (e) { return "string" != typeof e ? (s("The argument for removeNullCharacters must be a string."), e) : e.replace(w, "") }, t.ReadableStream = i.ReadableStream, t.setVerbosityLevel = function (e) { o = e }, t.shadow = function (e, t, n) { return Object.defineProperty(e, t, {value: n, enumerable: !0, configurable: !0, writable: !1}), n }, t.string32 = function (e) { return String.fromCharCode(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, 255 & e) }, t.stringToBytes = S, t.stringToPDFString = function (e) { var t, n = e.length, r = []; if ("þ" === e[0] && "ÿ" === e[1]) for (t = 2; t < n; t += 2) r.push(String.fromCharCode(e.charCodeAt(t) << 8 | e.charCodeAt(t + 1))); else for (t = 0; t < n; ++t) { var i = P[e.charCodeAt(t)]; r.push(i ? String.fromCharCode(i) : e.charAt(t)) } return r.join("") }, t.stringToUTF8String = function (e) { return decodeURIComponent(escape(e)) }, t.utf8StringToString = function (e) { return unescape(encodeURIComponent(e)) }, t.warn = s, t.unreachable = l }, function (e, t, n) { "use strict"; var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }; o = function () { var e = e || function (e, t) { var n; "undefined" != typeof window && window.crypto && (n = window.crypto), !n && "undefined" != typeof window && window.msCrypto && (n = window.msCrypto), !n && "undefined" != typeof global && global.crypto && (n = global.crypto); var r = function () { if (n) { if ("function" == typeof n.getRandomValues) try { return n.getRandomValues(new Uint32Array(1))[0] } catch (e) { } if ("function" == typeof n.randomBytes) try { return n.randomBytes(4).readInt32LE() } catch (e) { } } throw new Error("Native crypto module could not be used to get secure random number.") }, i = Object.create || function () { function e() { } return function (t) { var n; return e.prototype = t, n = new e, e.prototype = null, n } }(), a = {}, o = a.lib = {}, s = o.Base = { extend: function (e) { var t = i(this); return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () { t.$super.init.apply(this, arguments) }), t.init.prototype = t, t.$super = this, t }, create: function () { var e = this.extend(); return e.init.apply(e, arguments), e }, init: function () { }, mixIn: function (e) { for (var t in e) e.hasOwnProperty(t) && (this[t] = e[t]); e.hasOwnProperty("toString") && (this.toString = e.toString) }, clone: function () { return this.init.prototype.extend(this) } }, l = o.WordArray = s.extend({ init: function (e, t) { e = this.words = e || [], this.sigBytes = void 0 != t ? t : 4 * e.length }, toString: function (e) { return (e || u).stringify(this) }, concat: function (e) { var t = this.words, n = e.words, r = this.sigBytes, i = e.sigBytes; if (this.clamp(), r % 4) for (var a = 0; a < i; a++) { var o = n[a >>> 2] >>> 24 - a % 4 * 8 & 255; t[r + a >>> 2] |= o << 24 - (r + a) % 4 * 8 } else for (a = 0; a < i; a += 4) t[r + a >>> 2] = n[a >>> 2]; return this.sigBytes += i, this }, clamp: function () { var t = this.words, n = this.sigBytes; t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4) }, clone: function () { var e = s.clone.call(this); return e.words = this.words.slice(0), e }, random: function (e) { for (var t = [], n = 0; n < e; n += 4) t.push(r()); return new l.init(t, e) } }), c = a.enc = {}, u = c.Hex = { stringify: function (e) { for (var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++) { var a = t[i >>> 2] >>> 24 - i % 4 * 8 & 255; r.push((a >>> 4).toString(16)), r.push((15 & a).toString(16)) } return r.join("") }, parse: function (e) { for (var t = e.length, n = [], r = 0; r < t; r += 2) n[r >>> 3] |= parseInt(e.substr(r, 2), 16) << 24 - r % 8 * 4; return new l.init(n, t / 2) } }, d = c.Latin1 = { stringify: function (e) { for (var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++) { var a = t[i >>> 2] >>> 24 - i % 4 * 8 & 255; r.push(String.fromCharCode(a)) } return r.join("") }, parse: function (e) { for (var t = e.length, n = [], r = 0; r < t; r++) n[r >>> 2] |= (255 & e.charCodeAt(r)) << 24 - r % 4 * 8; return new l.init(n, t) } }, h = c.Utf8 = { stringify: function (e) { try { return decodeURIComponent(escape(d.stringify(e))) } catch (e) { throw new Error("Malformed UTF-8 data") } }, parse: function (e) { return d.parse(unescape(encodeURIComponent(e))) } }, p = o.BufferedBlockAlgorithm = s.extend({ reset: function () { this._data = new l.init, this._nDataBytes = 0 }, _append: function (e) { "string" == typeof e && (e = h.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes }, _process: function (t) { var n, r = this._data, i = r.words, a = r.sigBytes, o = this.blockSize, s = a / (4 * o), c = (s = t ? e.ceil(s) : e.max((0 | s) - this._minBufferSize, 0)) * o, u = e.min(4 * c, a); if (c) { for (var d = 0; d < c; d += o) this._doProcessBlock(i, d); n = i.splice(0, c), r.sigBytes -= u } return new l.init(n, u) }, clone: function () { var e = s.clone.call(this); return e._data = this._data.clone(), e }, _minBufferSize: 0 }), f = (o.Hasher = p.extend({ cfg: s.extend(), init: function (e) { this.cfg = this.cfg.extend(e), this.reset() }, reset: function () { p.reset.call(this), this._doReset() }, update: function (e) { return this._append(e), this._process(), this }, finalize: function (e) { return e && this._append(e), this._doFinalize() }, blockSize: 16, _createHelper: function (e) { return function (t, n) { return new e.init(n).finalize(t) } }, _createHmacHelper: function (e) { return function (t, n) { return new f.HMAC.init(e, n).finalize(t) } } }), a.algo = {}); return a }(Math); return e }, "object" === s(t) ? e.exports = t = o() : (i = [], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a)) }, function (e, t, n) { "use strict"; var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }; e.exports = function (e) { return "object" === (void 0 === e ? "undefined" : r(e)) ? null !== e : "function" == typeof e } }, function (e, t, n) { "use strict"; var r = n(44)("wks"), i = n(19), a = n(0).Symbol, o = "function" == typeof a; (e.exports = function (e) { return r[e] || (r[e] = o && a[e] || (o ? a : i)("Symbol." + e)) }).store = r }, function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}), t.pxCovertToMM = t.mmCovertToPx = void 0; var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }; t.scrollToResizeScreen = function () { if (window.navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) { var e = void 0, t = void 0; t = setInterval(function () { e = document.documentElement.scrollTop || document.body.scrollTop, e -= 1, window.scrollTo(0, e), e += 1, window.scrollTo(0, e), clearInterval(t) }, 100) } }, t.computeTextWdith = function (e, t, n) { if (n) { var r = document.createElement("canvas"), i = r.getContext("2d"); return i.font = t + "px " + n, i.measureText(e).width } return t * e.length }, t.closeOverlay = function () { var e = window.KGPdfViewerWebApp.PDFViewerApplication.overlayManager; if (e._active.length) { var t = []; return e._active.forEach(function (n) { t.push(e.close(n)) }), Promise.all(t) } return Promise.resolve() }, t.createTextLayerElement = function (e, t, n, r, i, a, o) { var s = document.createElement("div"), l = Math.sin((360 - a) * Math.PI / 180), c = Math.cos((360 - a) * Math.PI / 180); return s.innerText = e, s.style.left = t - r * l / 2 + "px", s.style.top = n - r * c / 2 + "px", s.style.fontSize = r * o + "px", s.style.fontFamily = i, s.style.transform = "rotate(" + a + "deg) translate(-50%, -50%)", s }, t.renderTextLayerElements = function (e, t) { var n = e.textLayer; if (n) { var r = n.textLayerDiv; if (r) for (var i = r.querySelector("endOfContent"), a = 0; a < t.length; a++) r.insertBefore(t[a], i) } }, t.leftTopTransformToLeftBottom = function (e, t) { return {x: e.x, y: t - e.y} }, t.trim = function (e) { return e.replace(/^\s*/, "").replace(/\s*$/, "") }, t.unique = function (e) { for (var t = 0; t < e.length; t++) for (var n = t + 1; n < e.length; n++) e[t] === e[n] && (e.splice(n, 1), n--); return e }, t.getDom = function (e, t, n) { for (var r = [], i = document.getElementsByTagName(e), a = 0; a < i.length; a++) n === i[a].getAttribute(t) && r.push(i[a]); return r }, t.deepCopy = function e(t, n) { var n = n || {}; for (var i in t) if ("object" == r(t[i])) { var a = Array.isArray(t[i]); n[i] = 1 == a ? [] : {}, e(t[i], n[i]) } else n[i] = t[i]; return n }, t.deleteSessionItem = function (e) { sessionStorage.removeItem(e) }, t.getSessionItem = function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = sessionStorage.getItem(e); if (n) return t ? s.default.decrypt(n, c).toString(a.default) : n; return null }, t.setSessionItem = function (e, t) { arguments.length > 2 && void 0 !== arguments[2] && arguments[2] ? sessionStorage.setItem(e, s.default.encrypt(t, c).toString()) : sessionStorage.setItem(e, t) }, t.deleteCookieAndStorage = function (e) { o.default.remove(e), localStorage.removeItem(e) }, t.getCookieOrStorage = function (e) { var t = o.default.get(e), n = localStorage.getItem(e); return t || (n || "") }, t.setCookieOrStorage = function (e, t, n) { o.default.set(e, t, n), o.default.get(e) || localStorage.setItem(e, t) }, t.randomString = function (e) { e = e || 32; for (var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890", n = "", r = 0; r < e; r++) n += t.charAt(Math.floor(Math.random() * t.length)); return n }, t.functionalJudgment = function (e) { var t = window.KGPdfViewerWebApp, n = t.textToSeal, r = t.prepareStamp, i = t.readOnly, a = t.fileType, o = t.additionText, s = t.pagingSeal, l = t.sealOrigin, c = t.certOrigin, u = t.multipleStamp, d = t.useCaptcha, h = t.disableSignaturePad, p = t.fjrs, f = t.mobile, m = t.download, v = t.watermark, g = t.showPrintBtn, y = t.verifyChainInfo, b = t.annotation, w = t.stampType, S = t.sealType, _ = t.scanStamp, k = t.openLocalFile, x = t.secretSeal, P = t.indicateSeal, C = t.useTextWidget, A = t.isUrlDoc, T = t.sealPreLocation, E = t.globalAnnotation, D = t.iWebAuth, I = t.isUkey, L = t.stampSystemOrigin, O = t.unifySealPlatformV2, M = t.fingerPrint; switch (e) { case"stamp": return A || !n && !r && !i; case"prepareStamp": return r && !i; case"additionText": return o && !r && "PDF" === a; case"captcha": return d && !r; case"pagingSeal": return s; case"openLocalFile": return k && window.FormData; case"stampConfirm": return u && !r; case"signature": return !(A || !(0 === l && 0 === c && ("PT" === S && 0 === w || "GM" === S && 2 === w || "OFD" === a) || 1 === l && 1 === c && ("GM" === S && 2 === w || "OFD" === a) || -1 === c) || d || i || n || h || null != p || r || _); case"download": return m && !i; case"fjrs": return !i && !r && null != p; case"scanStamp": return !i && !r && _ && 1 === L && !O; case"textToSeal": return n && !r && !i && 0 === f; case"watermark": return v && !i; case"print": return g || n && 0 === f && !i; case"blockChain": return y; case"certValidity": return 2 == w && "GB" == S && "1" == l && "1" == c; case"annotation": return b; case"secretSeal": return x && "1" == l && "1" == c; case"indicateSeal": return P; case"textConfirm": return C; case"sealPreLocation": return null != T; case"docSignConfirm": return !!E; case"iWebAuth": return D.scan || D.uKey; case"isUkey": return I; case"unifySealPlatformV2": return O; case"fingerPrint": return !!M; default: return !1 } }, t.convertRGB = function (e) { for (var t = "", n = 0; n < 3; n++) { var r = parseInt(e[n]), i = "0123456789ABCDEF", a = "", o = r % 16; a = i.substr(o, 1), t += i.substr(o = (r - o) / 16, 1) + a } return t }, t.convertHex = function (e) { function t(e, t, n, r) { return parseInt(e.slice(t, n), r) } e = function (e) { var t = [], n = e; if (3 == e.length) { for (var r = 0; r < 3; r++) t[r] = e.slice(r, r + 1) + e.slice(r, r + 1); n = t.join("") } return n }(e); for (var n = [], r = 0; r < 3; r++) n[r] = t(e, 2 * r, 2 * r + 2, 16); return n }, t.hexToRgb = function (e) { var t = e.toLowerCase(); if (/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)) { if (4 === t.length) { for (var n = "#", r = 1; r < 4; r += 1) n += t.slice(r, r + 1).concat(t.slice(r, r + 1)); t = n } for (var i = [], r = 1; r < 7; r += 2) i.push(parseInt("0x" + t.slice(r, r + 2))); return {rgb: "rgb(" + i.join(",") + ")", rgbArr: i} } return t }, t.IsFontExist = function (e) { if ("" == e) return ""; var t = document.createElement("span"), n = "测试文字"; t.style.fontSize = "72px", t.innerHTML = n; var r = document.getElementsByTagName("body")[0]; r.appendChild(t), t.style.fontFamily = n; var i = t.offsetWidth, a = t.offsetHeight; t.style.fontFamily = e + "," + n; var o = t.offsetWidth != i || t.offsetHeight != a; return r.removeChild(t), !!o }, t.toTransparentImg = function (e) { var t = [255, 255, 255, 255], n = null, r = t[0], i = t[1], a = t[2], o = t[3], s = void 0, l = void 0, c = void 0, u = void 0, d = document.createElement("canvas"), h = d.getContext("2d"), p = e.width, f = e.height; d.width = p, d.height = f, h.drawImage(e, 0, 0), n = h.getImageData(0, 0, p, f); for (var m = 0; m < n.data.length; m += 4) { s = n.data[m], l = n.data[m + 1], c = n.data[m + 2], u = n.data[m + 3]; var v = Math.sqrt(Math.pow(s - r, 2) + Math.pow(l - i, 2) + Math.pow(c - a, 2) + Math.pow(u - o, 2)); v <= 60 && (n.data[m] = 0, n.data[m + 1] = 0, n.data[m + 2] = 0, n.data[m + 3] = 0) } return h.putImageData(n, 0, 0), d.toDataURL("image/png") }, t.externalSign = function (e, t, n, r) { if (null == window.KGPdfViewerWebApp.externalSign || "function" != typeof window.KGPdfViewerWebApp.externalSign) r("外部签名接口未定义"); else { for (var o = [], s = function (t) { var n = e[t].needSigMessage; 0 == window.KGPdfViewerWebApp.stampType && (n = i.default.stringify(a.default.parse(n))), o.push(new Promise(function (e) { return window.KGPdfViewerWebApp.externalSign(n, e) })) }, l = 0; l < e.length; l++) s(l); Promise.all(o).then(function (n) { for (var r = [], i = void 0, a = 0; a < n.length; a++) { var o = n[a], s = o.cert, l = o.signedData, c = o.message; if (!s || !l) { i = {message: c || "外部接口签名失败"}; break } 0 == window.KGPdfViewerWebApp.stampType ? e[a].certSignMsg = l : e[a].sigedData = l; var u = {cert: s, signedData: [e[a]]}; r.push(t(u)) } return i ? Promise.reject(i) : Promise.all(r) }).then(function () { n && n() }).catch(function (e) { r(e.message || "外部接口签名失败") }) } }, t.mergerConfig = function (e, t) { for (var n in t) !0 === t.hasOwnProperty(n) && (e[n] = t[n]); return e }, t.flatten = function (e) { var t = {}; return function e(n, r) { if (Object(r) !== r) n && (t[n] = r); else if (Array.isArray(r)) { for (var i = 0, a = r.length; i < a; i++) e(n + "[" + i + "]", r[i]); 0 === r.length && n && (t[n] = []) } else { var o = !0; for (var s in r) o = !1, e((n ? n + "." : n) + s, r[s]); o && n && (t[n] = {}) } }("", e), t }, t.titleCase = function (e) { return e.slice(0, 1).toUpperCase() + e.slice(1) }, t.isMobile = function () { var e = navigator.userAgent.toLowerCase(), t = "ipad" == e.match(/ipad/i), n = "iphone" == e.match(/iphone/i), r = "ipod" == e.match(/ipd/i), i = "android" == e.match(/android/i), a = "blackberry" == e.match(/blackberry/i), o = "symbianos" == e.match(/symbianos/i); return !!(t || n || r || i || a || o) }, t.parseCilentSealImgData = function (e) { var t = e.substring(0, 65), n = e.substring(65); return i.default.stringify(i.default.parse(n, t)) }, t.closest = function (e, t) { Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector); Element.prototype.closest || (Element.prototype.closest = function (e) { var t = this; if (!document.documentElement.contains(t)) return null; do { if (!t.matches) return null; if (t.matches(e)) return t; t = t.parentNode } while (null !== t); return null }); return e.closest(t) }, t._deepClone = function e(t) { var n = void 0; if ("object" === (void 0 === t ? "undefined" : r(t))) for (var i in n = Array.isArray(t) ? [] : {}, t) t.hasOwnProperty(i) && ("object" !== r(t[i]) ? n[i] = t[i] : n[i] = e(t[i])); else n = t; return n }, t.sortClass = function (e, t) { return n = e, r = function (e) { var n = e; return t.forEach(function (e) { n = n[e] }), n }, i = {}, n.forEach(function (e) { var t = JSON.stringify(r(e)); i[t] = i[t] || [], i[t].push(e) }), Object.keys(i).map(function (e) { return i[e] }); var n, r, i }, t.removePrototype = function (e) { var t = Object.create(null); for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]); return t }, t.transformData = function (e) { var t = window.KGPdfViewerWebApp, n = t.aesEncrypt, r = t.postEncrypt, i = void 0 !== r && r, a = void 0, o = Object.create(null); a = i ? n(JSON.stringify(e)) : e; return o.isEncrypt = i, o.data = a, o }, t.getXYPoint = function (e, t) { var n = void 0, r = void 0, i = void 0, a = void 0, o = u(e, t); switch (o) { case"left-top": i = e.left / t.width, a = e.top / t.height, n = t.width * a, r = t.height * i; break; case"right-top": i = (t.width - e.left - e.width) / t.width, a = e.top / t.height, n = t.width * a, r = (t.height - e.width) * (1 - i); break; case"left-bottom": i = e.left / t.width, a = (t.height - e.top - e.height) / t.height, n = (t.width - e.height) * (1 - a), r = t.height * i; break; case"right-bottom": i = (t.width - e.left - e.width) / t.width, a = (t.height - e.top - e.height) / t.height, n = (t.width - e.height) * (1 - a), r = (t.height - e.width) * (1 - i) } return {XYType: o, r_top: n, r_left: r, xsacle: i, ysacle: a} }, t.getXYPoint_diffentSize = function (e) { var t = e.tempSeal, n = e.hRatio, r = e.wRatio, i = void 0, a = void 0; switch (t.XYType) { case"left-top": i = t.top * n, a = t.left * r; break; case"right-top": i = t.top * n, a = t.left * r + t.width * r - t.width; break; case"left-bottom": i = t.top * n + t.height * n - t.height, a = t.left * r; break; case"right-bottom": i = t.top * n + t.height * n - t.height, a = t.left * r + t.width * r - t.width } return {d_top: i, d_left: a} }, t.isIE = function () { return navigator.userAgent.indexOf("Trident") >= 0 }, t.pxConversionMm = function (e) { return e / d()[0] * 25.4 }, t.mmConversionPx = function (e) { return e / 25.4 * d()[0] }, t.proxyFunction = function (e, t, n) { Function.prototype.before || (Function.prototype.before = function (e) { var t = this; return function () { var n = e.apply(this, arguments); return n && t.apply(this, arguments) } }); Function.prototype.after || (Function.prototype.after = function (e) { var t = this; return function () { return t.apply(this, arguments), e.apply(this, arguments) } }); return t[e](n) }, t.download = function (e, t) { (function (e) { return new Promise(function (t) { var n = new XMLHttpRequest; n.open("GET", e, !0), n.responseType = "blob", n.onload = function () { 200 === n.status && t(n.response) }, n.send() }) })(e + "?docType=0&action=download&documentId=" + t + "&t=" + (new Date).getTime()).then(function (e) { !function (e) { if (window.navigator.msSaveBlob) return window.navigator.msSaveBlob(e, decodeURIComponent(t)); var n = document.createElement("a"); n.href = window.URL.createObjectURL(e), n.download = decodeURIComponent(t), (document.body || document.documentElement).appendChild(n), n.click(), n.parentNode.removeChild(n) }(e) }) }, t.limitQueueFn = function (e, t, n) { var r = 0, i = 0, a = new Array(e.length).fill(0); return new Promise(function (o, s) { for (var l = 0; l < t; l++) c(); function c() { new Promise(function (t, i) { var a = e[r]; r++, t(n(a)) }).then(function (t) { a[i] = t, i++, r < e.length ? c() : o(a) }) } }) }; var i = l(n(15)), a = l(n(32)), o = l(n(149)), s = l(n(88)); function l(e) { return e && e.__esModule ? e : {default: e} } var c = "+97]4Up@ 0 ? i(r(e), 9007199254740991) : 0 } }, function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}), t.DOMSVGFactory = t.DOMCMapReaderFactory = t.DOMCanvasFactory = t.DEFAULT_LINK_REL = t.getDefaultSetting = t.LinkTarget = t.getFilenameFromUrl = t.isValidUrl = t.isExternalLinkTargetSet = t.addLinkAttributes = t.RenderingCancelledException = t.CustomStyle = void 0; var r, i = function () { function e(e, t) { for (var n = 0; n < t.length; n++) { var r = t[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r) } } return function (t, n, r) { return n && e(t.prototype, n), r && e(t, r), t } }(), a = n(1), o = n(25), s = (r = o) && r.__esModule ? r : {default: r}; function l(e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") } var c = "noopener noreferrer nofollow", u = "http://www.w3.org/2000/svg", d = function () { function e() { l(this, e) } return i(e, [{ key: "create", value: function (e, t) { if (e <= 0 || t <= 0) throw new Error("invalid canvas size"); var n = document.createElement("canvas"), r = n.getContext("2d"); return n.width = e, n.height = t, {canvas: n, context: r} } }, { key: "reset", value: function (e, t, n) { if (!e.canvas) throw new Error("canvas is not specified"); if (t <= 0 || n <= 0) throw new Error("invalid canvas size"); e.canvas.width = t, e.canvas.height = n } }, { key: "destroy", value: function (e) { if (!e.canvas) throw new Error("canvas is not specified"); e.canvas.width = 0, e.canvas.height = 0, e.canvas = null, e.context = null } }]), e }(), h = function () { function e(t) { var n = t.baseUrl, r = void 0 === n ? null : n, i = t.isCompressed, a = void 0 !== i && i; l(this, e), this.baseUrl = r, this.isCompressed = a } return i(e, [{ key: "fetch", value: function (e) { var t = this, n = e.name; return this.baseUrl ? n ? new Promise(function (e, r) { var i = t.baseUrl + n + (t.isCompressed ? ".bcmap" : ""), o = new XMLHttpRequest; o.open("GET", i, !0), t.isCompressed && (o.responseType = "arraybuffer"), o.onreadystatechange = function () { if (o.readyState === XMLHttpRequest.DONE) { if (200 === o.status || 0 === o.status) { var n = void 0; if (t.isCompressed && o.response ? n = new Uint8Array(o.response) : !t.isCompressed && o.responseText && (n = (0, a.stringToBytes)(o.responseText)), n) return void e({ cMapData: n, compressionType: t.isCompressed ? a.CMapCompressionType.BINARY : a.CMapCompressionType.NONE }) } r(new Error("Unable to load " + (t.isCompressed ? "binary " : "") + "CMap at: " + i)) } }, o.send(null) }) : Promise.reject(new Error("CMap name must be specified.")) : Promise.reject(new Error('CMap baseUrl must be specified, see "PDFJS.cMapUrl" (and also "PDFJS.cMapPacked").')) } }]), e }(), p = function () { function e() { l(this, e) } return i(e, [{ key: "create", value: function (e, t) { (0, a.assert)(e > 0 && t > 0, "Invalid SVG dimensions"); var n = document.createElementNS(u, "svg:svg"); return n.setAttribute("version", "1.1"), n.setAttribute("width", e + "px"), n.setAttribute("height", t + "px"), n.setAttribute("preserveAspectRatio", "none"), n.setAttribute("viewBox", "0 0 " + e + " " + t), n } }, { key: "createElement", value: function (e) { return (0, a.assert)("string" == typeof e, "Invalid SVG element type"), document.createElementNS(u, e) } }]), e }(), f = function () { var e = ["ms", "Moz", "Webkit", "O"], t = Object.create(null); function n() { } return n.getProp = function (n, r) { if (1 === arguments.length && "string" == typeof t[n]) return t[n]; var i, a, o = (r = r || document.documentElement).style; if ("string" == typeof o[n]) return t[n] = n; a = n.charAt(0).toUpperCase() + n.slice(1); for (var s = 0, l = e.length; s < l; s++) if ("string" == typeof o[i = e[s] + a]) return t[n] = i; return t[n] = "undefined" }, n.setProp = function (e, t, n) { var r = this.getProp(e); "undefined" !== r && (t.style[r] = n) }, n }(), m = function () { function e(e, t) { this.message = e, this.type = t } return e.prototype = new Error, e.prototype.name = "RenderingCancelledException", e.constructor = e, e }(), v = {NONE: 0, SELF: 1, BLANK: 2, PARENT: 3, TOP: 4}, g = ["", "_self", "_blank", "_parent", "_top"]; function y(e) { var t = s.default.PDFJS; switch (e) { case"pdfBug": return !!t && t.pdfBug; case"disableAutoFetch": return !!t && t.disableAutoFetch; case"disableStream": return !!t && t.disableStream; case"disableRange": return !!t && t.disableRange; case"disableFontFace": return !!t && t.disableFontFace; case"disableCreateObjectURL": return !!t && t.disableCreateObjectURL; case"disableWebGL": return !t || t.disableWebGL; case"cMapUrl": return t ? t.cMapUrl : null; case"cMapPacked": return !!t && t.cMapPacked; case"postMessageTransfers": return !t || t.postMessageTransfers; case"workerPort": return t ? t.workerPort : null; case"workerSrc": return t ? t.workerSrc : null; case"disableWorker": return !!t && t.disableWorker; case"maxImageSize": return t ? t.maxImageSize : -1; case"imageResourcesPath": return t ? t.imageResourcesPath : ""; case"isEvalSupported": return !t || t.isEvalSupported; case"externalLinkTarget": if (!t) return v.NONE; switch (t.externalLinkTarget) { case v.NONE: case v.SELF: case v.BLANK: case v.PARENT: case v.TOP: return t.externalLinkTarget } return (0, a.warn)("PDFJS.externalLinkTarget is invalid: " + t.externalLinkTarget), t.externalLinkTarget = v.NONE, v.NONE; case"externalLinkRel": return t ? t.externalLinkRel : c; case"enableStats": return !(!t || !t.enableStats); case"pdfjsNext": return !(!t || !t.pdfjsNext); default: throw new Error("Unknown default setting: " + e) } } t.CustomStyle = f, t.RenderingCancelledException = m, t.addLinkAttributes = function (e, t) { var n = t && t.url; if (e.href = e.title = n ? (0, a.removeNullCharacters)(n) : "", n) { var r = t.target; void 0 === r && (r = y("externalLinkTarget")), e.target = g[r]; var i = t.rel; void 0 === i && (i = y("externalLinkRel")), e.rel = i } }, t.isExternalLinkTargetSet = function () { switch (y("externalLinkTarget")) { case v.NONE: return !1; case v.SELF: case v.BLANK: case v.PARENT: case v.TOP: return !0 } }, t.isValidUrl = function (e, t) { (0, a.deprecated)("isValidUrl(), please use createValidAbsoluteUrl() instead."); var n = t ? "http://example.com" : null; return null !== (0, a.createValidAbsoluteUrl)(e, n) }, t.getFilenameFromUrl = function (e) { var t = e.indexOf("#"), n = e.indexOf("?"), r = Math.min(t > 0 ? t : e.length, n > 0 ? n : e.length); return e.substring(e.lastIndexOf("/", r) + 1, r) }, t.LinkTarget = v, t.getDefaultSetting = y, t.DEFAULT_LINK_REL = c, t.DOMCanvasFactory = d, t.DOMCMapReaderFactory = h, t.DOMSVGFactory = p }, function (e, t, n) { "use strict"; var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }; o = function (e) { return function () { var t = e, n = t.lib.WordArray; t.enc.Base64 = { stringify: function (e) { var t = e.words, n = e.sigBytes, r = this._map; e.clamp(); for (var i = [], a = 0; a < n; a += 3) for (var o = (t[a >>> 2] >>> 24 - a % 4 * 8 & 255) << 16 | (t[a + 1 >>> 2] >>> 24 - (a + 1) % 4 * 8 & 255) << 8 | t[a + 2 >>> 2] >>> 24 - (a + 2) % 4 * 8 & 255, s = 0; s < 4 && a + .75 * s < n; s++) i.push(r.charAt(o >>> 6 * (3 - s) & 63)); var l = r.charAt(64); if (l) for (; i.length % 4;) i.push(l); return i.join("") }, parse: function (e, t) { for (var r = e.length, i = (t = t || this._map, []), a = 0; a < t.length; a++) i[t.charCodeAt(a)] = a; var o = t.charAt(64); if (o) { var s = e.indexOf(o); -1 !== s && (r = s) } return function (e, t, r) { for (var i = [], a = 0, o = 0; o < t; o++) if (o % 4) { var s = r[e.charCodeAt(o - 1)] << o % 4 * 2, l = r[e.charCodeAt(o)] >>> 6 - o % 4 * 2, c = s | l; i[a >>> 2] |= c << 24 - a % 4 * 8, a++ } return n.create(i, a) }(e, r, i) }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" } }(), e.enc.Base64 }, "object" === s(t) ? e.exports = t = o(n(2)) : (i = [n(2)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a)) }, function (e, t, n) { "use strict"; e.exports = function (e) { try { return !!e() } catch (e) { return !0 } } }, function (e, t, n) { "use strict"; var r = n(10), i = n(62), a = n(43), o = Object.defineProperty; t.f = n(8) ? Object.defineProperty : function (e, t, n) { if (r(e), t = a(t, !0), r(n), i) try { return o(e, t, n) } catch (e) { } if ("get" in n || "set" in n) throw TypeError("Accessors not supported!"); return "value" in n && (e[t] = n.value), e } }, function (e, t, n) { "use strict"; var r = n(0), i = n(9), a = n(11), o = n(19)("src"), s = n(103), l = ("" + s).split("toString"); n(6).inspectSource = function (e) { return s.call(e) }, (e.exports = function (e, t, n, s) { var c = "function" == typeof n; c && (a(n, "name") || i(n, "name", t)), e[t] !== n && (c && (a(n, o) || i(n, o, e[t] ? "" + e[t] : l.join(String(t)))), e === r ? e[t] = n : s ? e[t] ? e[t] = n : i(e, t, n) : (delete e[t], i(e, t, n))) })(Function.prototype, "toString", function () { return "function" == typeof this && this[o] || s.call(this) }) }, function (e, t, n) { "use strict"; var r = 0, i = Math.random(); e.exports = function (e) { return "Symbol(".concat(void 0 === e ? "" : e, ")_", (++r + i).toString(36)) } }, function (e, t, n) { "use strict"; var r = Math.ceil, i = Math.floor; e.exports = function (e) { return isNaN(e = +e) ? 0 : (e > 0 ? i : r)(e) } }, function (e, t, n) { "use strict"; var r = n(46); e.exports = function (e) { return Object(r(e)) } }, function (e, t, n) { "use strict"; e.exports = {} }, function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}), t.PDFRenderingQueue = t.RenderingStates = void 0; var r = function () { function e(e, t) { for (var n = 0; n < t.length; n++) { var r = t[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r) } } return function (t, n, r) { return n && e(t.prototype, n), r && e(t, r), t } }(), i = n(24), a = n(165), o = n(5); var s = {INITIAL: 0, RUNNING: 1, PAUSED: 2, FINISHED: 3}, l = function () { function e() { !function (e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") }(this, e), this.pdfViewer = null, this.pdfThumbnailViewer = null, this.onIdle = null, this.highestPriorityPage = null, this.idleTimeout = null, this.printing = !1, this.isThumbnailViewEnabled = !1 } return r(e, [{ key: "setViewer", value: function (e) { this.pdfViewer = e } }, { key: "setThumbnailViewer", value: function (e) { this.pdfThumbnailViewer = e } }, { key: "isHighestPriority", value: function (e) { return this.highestPriorityPage === e.renderingId } }, { key: "renderHighestPriority", value: function (e) { this.idleTimeout && (clearTimeout(this.idleTimeout), this.idleTimeout = null), this.pdfViewer.forceRendering(e) || this.pdfThumbnailViewer && this.isThumbnailViewEnabled && this.pdfThumbnailViewer.forceRendering() || this.printing || this.onIdle && (this.idleTimeout = setTimeout(this.onIdle.bind(this), 3e4)) } }, { key: "getHighestPriority", value: function (e, t, n) { var r = e.views, i = r.length; if (0 === i) return !1; for (var a = 0; a < i; ++a) { var o = r[a].view; if (!this.isViewFinished(o)) return o } if (n) { var s = e.last.id; if (t[s] && !this.isViewFinished(t[s])) return t[s] } else { var l = e.first.id - 2; if (t[l] && !this.isViewFinished(t[l])) return t[l] } return null } }, { key: "isViewFinished", value: function (e) { return e.renderingState === s.FINISHED } }, { key: "renderView", value: function (e) { var t = this; switch (e.renderingState) { case s.FINISHED: return !1; case s.PAUSED: this.highestPriorityPage = e.renderingId, e.resume(); break; case s.RUNNING: this.highestPriorityPage = e.renderingId; break; case s.INITIAL: this.highestPriorityPage = e.renderingId; var n = function () { if (t.renderHighestPriority(), null != e.canvas) { var n = e.viewport.scale * (e.canvas.width / e.canvas.offsetWidth), r = e.pdfPage.newStamps; for (var s in r) { var l = (I = r[s]).querySelector("img"), c = I.style.width, u = I.style.height, d = c.substring(0, c.length - 2) * n, h = u.substring(0, u.length - 2) * n, p = I.style.left, f = I.style.top, m = p.substring(0, p.length - 2) * n, v = f.substring(0, f.length - 2) * n; (L = e.canvas.getContext("2d")).globalCompositeOperation = "multiply", "multiply" !== L.globalCompositeOperation && (L.globalAlpha = .75), L.drawImage(l, m, v, d, h) } for (var g = e.pdfPage.textToSeals, y = 0; y < g.length; y++) { var b = g[y].section, w = b.querySelector("img"), S = (0, i.getNumbOfPx)(b.style.width) * n, _ = (0, i.getNumbOfPx)(b.style.height) * n, k = ((0, i.getNumbOfPx)(b.style.left) + 1) * n, x = ((0, i.getNumbOfPx)(b.style.top) + 1) * n, P = e.canvas.getContext("2d"); P.globalCompositeOperation = "multiply", "multiply" !== P.globalCompositeOperation && (P.globalAlpha = .75), P.drawImage(w, k, x, S, _) } var C = e.pdfPage.newWatermark; for (var A in C) { var T = C[A]; (0, a.renderWaterMark)(T, e.canvas, n, e.canvas.width, e.canvas.height, null, !0).then(function (t) { (0, o.renderTextLayerElements)(e, t) }) } var E = e.pdfPage.newDocSigns; for (var D in E) { var I, L; l = (I = E[D]).querySelector("img"), c = I.style.width, u = I.style.height, d = c.substring(0, c.length - 2) * n, h = u.substring(0, u.length - 2) * n, p = I.style.left, f = I.style.top, m = p.substring(0, p.length - 2) * n, v = f.substring(0, f.length - 2) * n; (L = e.canvas.getContext("2d")).globalCompositeOperation = "source-over", (L = e.canvas.getContext("2d")).drawImage(l, m, v, d, h) } } e.deleteStampCallback && (e.deleteStampCallback(), e.deleteStampCallback = null), e.reRenderWait && (e.destroy(), e.renderingState = 0, e.renderingQueue.renderView(e), e.reRenderWait = !1) }; e.draw().then(n, n) } return !0 } }]), e }(); t.RenderingStates = s, t.PDFRenderingQueue = l }, function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}), t.convertScreenToViewportPoint = t.getNumbOfPx = t.getPath = t.CustomStyle = t.PDFStamp = void 0; var r, i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }, a = function () { return function (e, t) { if (Array.isArray(e)) return e; if (Symbol.iterator in Object(e)) return function (e, t) { var n = [], r = !0, i = !1, a = void 0; try { for (var o, s = e[Symbol.iterator](); !(r = (o = s.next()).done) && (n.push(o.value), !t || n.length !== t); r = !0) ; } catch (e) { i = !0, a = e } finally { try { !r && s.return && s.return() } finally { if (i) throw a } } return n }(e, t); throw new TypeError("Invalid attempt to destructure non-iterable instance") } }(), o = n(23), s = n(148), l = n(154), c = n(41), u = n(56), d = n(95), h = (r = d) && r.__esModule ? r : {default: r}, p = n(94), f = n(5), m = n(164); var v = function () { var e = ["ms", "Moz", "Webkit", "O"], t = Object.create(null); function n() { } return n.getProp = function (n, r) { if (1 === arguments.length && "string" == typeof t[n]) return t[n]; var i, a, o = (r = r || document.documentElement).style; if ("string" == typeof o[n]) return t[n] = n; a = n.charAt(0).toUpperCase() + n.slice(1); for (var s = 0, l = e.length; s < l; s++) if ("string" == typeof o[i = e[s] + a]) return t[n] = i; return t[n] = "undefined" }, n.setProp = function (e, t, n) { var r = this.getProp(e); "undefined" !== r && (t.style[r] = n) }, n }(); function g(e) { var t = e.path; if (!t) { t = []; var n = e.target; for (t.push(n); n.parentNode;) n = n.parentNode, t.push(n) } return t } function y(e) { return parseFloat(e.substring(0, e.length - 2)) } function b(e, t) { for (var n = g(e), r = 0; r < n.length; r++) { var i = n[r], a = i.id, o = i.className; if (a && o) if (-1 != a.indexOf("pageContainer") && "page" === o) { for (var s = n[r++]; "viewerContainer" != s.id;) s = n[r++]; var l = a.substring(13), c = window.hightMap.get(l); if (!c) { c = 0; for (var u = 1; u < l; u++) { c += document.getElementById("pageContainer" + u).clientHeight + 12 } window.hightMap.set(l, c) } var d = e.clientY, h = e.clientX; if (null == d) { var p = e.touches[0]; h = p.clientX, d = p.clientY } var f = s.scrollTop + (d - 48) - (c + 10), m = s.scrollLeft + h, v = y(i.style.width), b = s.clientWidth; return {node: i, pageNumber: l, pageX: b >= v ? m - (b - v) / 2 : m, pageY: f} } } return null } window.hightMap = { set: function (e, t) { this[e] = t }, get: function (e) { return this[e] }, contains: function (e) { return null != this[e] }, remove: function (e) { delete this[e] }, removeAll: function () { for (var e in this) "function" != typeof this[e] && delete this[e] } }; var w = function () { function e(e, t, n) { if (this.isStamp = !1, this.toolbarButton = e, this.secondaryToolbarButton = t, this.app = n, this.sidebar = n.pdfSidebar, this.fileType = window.KGPdfViewerWebApp.fileType, this.seal = null, this.capability = null, this.touchstartEvent = null, this.pdfStampSeal = new s.PDFStampSeal(l.KGPdfViewerWebApp), this.stampMobileTip = document.getElementById("stamp-mobile-tip"), this.stampMobieCancel = document.getElementById("stamp-mobile-cancel"), this.isContinuityStampCheck = !1, this.continuityRange = null, this.isStampOfQfz = !1, this.tempSeals = [], this.stampSealType = "default", this.renderSignatureSeals = this.renderSignatureSeals.bind(this), this.selectSign = null, this.removeSignBtn = document.getElementById("docSignRemove"), this.selectSealData = null, !window.KGPdfViewerWebApp.chainStamp) { var r = this; this.continuityStampModal = new m.KG_ModalFactory(this.app, this.app.overlayManager, { overlayName: "KG_CustomModalOverlay", message: "印章改变位置,拖动在指定位置", width: 320, buttons: [{ content: "当前签章", callback: function () { delete r.selectSealData.lastSelected }, type: "primary" }, { content: "全局签章", callback: function () { var e = void 0, t = void 0, n = r.selectSealData, i = n.lastSelected, a = i.index, o = i.scale, s = i.tempStampSections, l = n.extraPosition[a], c = l.left, u = l.top, h = l.xsacle, p = l.ysacle, m = l.XYType; n.top = u, n.left = c, n.xsacle = h, n.ysacle = p, n.XYType = m, s.map(function (r) { var i = Object.values(r)[0], a = i.isRotate, s = i.isDiffentSize, l = i.ratio, h = i.page; if (a) { var p = (0, f.getXYPoint)(n, {width: h.height / o, height: h.width / o}), m = p.r_left, v = p.r_top; e = v, t = m } else e = u, t = c; if (s) { var g = (0, f.getXYPoint_diffentSize)({wRatio: l.wRatio, hRatio: l.hRatio, tempSeal: n}), y = g.d_top, b = g.d_left; e = y, t = b } (0, d.setSectionStyle)(i, o, t, e) }), delete n.lastSelected, n.extraPosition = Object.create(null) } }] }) } this.initStampPosition(), this.init() } return e.prototype = { init: function () { var e = this, t = this; function n(e, n) { e.preventDefault(), e.stopPropagation(), t.app.secondaryToolbar.close(); var r = window.KGPdfViewerWebApp.getSelectSealPrompt(); if ((t.tempSeals.length || t.isStamp) && null !== r.seals && r.seals.length > 0) { t.isStamp = !1, t.app.KGStampConfirm.hide(), r.open(); for (var i = 1; i < t.app.pagesCount; i++) { var a = t.app.pdfViewer.getPageView(i - 1).pdfPage.tempStamps; for (var o in a) if (a.hasOwnProperty(o)) { var s = a[o].querySelector(".deleteTempStampSection"); s && (s.style.display = "none"); var l = a[o].querySelector(".scaleTempStampSection"); l && (l.style.display = "none") } } document.body.style.cursor = "default", document.onmousemove = null } else t.stamp(n) } window.KGPdfViewerWebApp.elecSigModeCheckFile().then(function (t) { t.status || e.app.KGAlertPrompt.open(t.message); var r = window.KGPdfViewerWebApp.btnPositionConfig, i = r.toolbar, a = void 0 === i ? [] : i, o = r.sidebar, s = void 0 === o ? [] : o; if ((0, f.functionalJudgment)("secretSeal")) { var l = e.app.appConfig.KG_SecretSeal, c = l.button, u = l.secondaryButton; a.indexOf("stamp") > -1 && (c.removeAttribute("hidden"), t.status ? c.onclick = function (e) { return n(e, "secret") } : c.setAttribute("disabled", !0)), s.indexOf("stamp") > -1 && (u.removeAttribute("hidden"), t.status ? u.onclick = function (e) { return n(e, "secret") } : u.setAttribute("disabled", !0)) } else a.indexOf("stamp") > -1 && !window.KGPdfViewerWebApp.isUrlDoc && !window.KGPdfViewerWebApp.scanStamp && !window.KGPdfViewerWebApp.unifySealPlatformV2 && (e.toolbarButton.removeAttribute("hidden"), t.status ? e.toolbarButton.onclick = n : e.toolbarButton.setAttribute("disabled", !0)), s.indexOf("stamp") > -1 && !window.KGPdfViewerWebApp.isUrlDoc && !window.KGPdfViewerWebApp.scanStamp && !window.KGPdfViewerWebApp.unifySealPlatformV2 && (e.secondaryToolbarButton.removeAttribute("hidden"), t.status ? e.secondaryToolbarButton.onclick = n : e.secondaryToolbarButton.setAttribute("disabled", !0)), 2 == window.KGPdfViewerWebApp.stampSystemOrigin && (e.secondaryToolbarButton.removeAttribute("hidden"), t.status ? e.secondaryToolbarButton.onclick = n : e.secondaryToolbarButton.setAttribute("disabled", !0), document.getElementById("secondaryKgSignature").setAttribute("hidden", !0)); "0" === window.KGPdfViewerWebApp.mobile.toString() ? (document.oncontextmenu = e.onDocumentContextmenu.bind(e), document.addEventListener("click", e.onDocumentClick.bind(e))) : (document.ontouchstart = e.onDocumentTouchStart.bind(e), document.ontouchmove = e.onDocumentTouchMove.bind(e), document.ontouchend = e.onDocumentTouchEnd.bind(e)) }) }, onDocumentClick: function (e) { 0 === e.button && ((0, u.removeStampMenu)(), this.documentClick(e)), this.editDocSign(e) }, onDocumentContextmenu: function (e) { if (this.isStamp) if (e && (e.preventDefault(), e.stopPropagation()), this.tempSeals.length) { this.app.KGStampConfirm.show(), this.tempSeals.forEach(function (e) { e.eventRegister() }); for (var t = 1; t <= this.app.pagesCount; t++) { var n = this.app.pdfViewer.getPageView(t - 1).pdfPage.tempStamps; for (var r in n) if (n.hasOwnProperty(r)) { var i = n[r].querySelector(".deleteTempStampSection"); i && (i.style.display = "block"); var a = n[r].querySelector(".scaleTempStampSection"); a && (a.style.display = "block") } } } else this.app.KG_ScanStamp && this.app.KG_ScanStamp.clearSealData(); this.cancelStamp() }, onDocumentTouchStart: function (e) { this.isStamp && (this.touchstartEvent = e), this.editDocSign(e) }, onDocumentTouchMove: function () { this.touchstartEvent = null }, onDocumentTouchEnd: function (e) { null != this.touchstartEvent ? this.documentClick(this.touchstartEvent) : "rightMenu" !== e.target.parentNode.id && (0, u.removeStampMenu)() }, addStamp: function (e, t) { var n = (0, f.deepCopy)(e); n.sealdata.forEach(function (e, t) { delete e.qfzSeal }), t && t.removeAttribute("class"), this.cancelStamp(), this.capability.resolve(n) }, setSealData: function (e) { this.seal = e.seal, this.isContinuityStampCheck = e.isContinuityStampCheck, this.isStampOfQfz = e.isStampOfQfz, this.continuityRange = e.continuityRange, this.getSealObjectCallback(e) }, getSealObjectCallback: function (e) { var t = this; this.seal = e.seal, this.isContinuityStampCheck = e.isContinuityStampCheck, this.continuityRange = e.continuityRange, this.isStampOfQfz = e.isStampOfQfz, this.capability = this.pdfStampSeal.createAddSealPromise(); var n = this.app.KG_SealPreLocation; !n || n.hasStamp ? (this.app.KGStampConfirm && this.app.KGStampConfirm.hide(), this.tempSeals.length && this.tempSeals.forEach(function (e) { e.eventUnregister() }), ("stamp" === this.stampPosition.mode || e.isContinuityStampCheck || e.isStampOfQfz) && ("1" === window.KGPdfViewerWebApp.mobile.toString() ? (this.stampMobileTip.style.display = "block", this.stampMobieCancel.addEventListener("click", function (e) { t.stampMobileTip.style.display = "none", t.tempSeals.length && t.app.KGStampConfirm.show(), t.cancelStamp() }), this.isStamp = !0, document.ontouchstart = this.app.pdfStamp.onDocumentTouchStart.bind(this), document.ontouchmove = this.app.pdfStamp.onDocumentTouchMove.bind(this), document.ontouchend = this.app.pdfStamp.onDocumentTouchEnd.bind(this)) : (document.body.style.cursor = "move", this.stopMoveStamp || (document.onmousemove = function (e) { t.isStamp = !0, t.movestamp(e, t) })))) : n.isStamp || (n.deletePreSeal(), this.isStamp = !0, n.isStamp = !0, this.movestamp(void 0, this), this.documentClick()) }, documentClick: function (e) { var t = this; if (this.isStamp) { var n = void 0; if (e) n = b(e, this.sidebar); else { var r = this.app, i = r.KG_SealPreLocation, a = r.pdfViewer; if (i) { var o = i.seal.page; n = {node: a.getPageView(o - 1).div, pageNumber: o} } } if (n) { window.KGPdfViewerWebApp.allowFollow && window.KGPdfViewerWebApp.multipleStamp || (this.isStamp = !1, document.body.style.cursor = "default", document.onmousemove = null); var s = n, l = s.node, u = s.pageNumber; "1" === window.KGPdfViewerWebApp.mobile.toString() && (this.stampMobileTip.style.display = "none", this.movestamp(e, this)); var p = document.getElementById(l.id + "stamp"); if (p) { var m = this.app.pdfViewer, v = this.seal; if (v.left = y(p.style.left), v.top = y(p.style.top), v.width = y(p.style.width), v.height = y(p.style.height), this.isContinuityStampCheck) { v.isContinuityStampCheck = !0, v.page = this.continuityRange; var g = (T = m.getPageView(u - 1)).viewport.scale, w = (T.width, T.height / g), S = T.div, _ = parseInt(getComputedStyle(S).width), k = parseInt(getComputedStyle(S).height), x = (0, f.getXYPoint)(v, {width: _ / g, height: k / g}), P = x.XYType, C = x.xsacle, A = x.ysacle; x.r_left, x.r_top; v.XYType = P, v.xsacle = C, v.ysacle = A, v.actionPageInfo = (0, f.removePrototype)({ width: _, height: k, direction: k > _ ? "vertical" : "horizontal" }) } else if (this.isStampOfQfz) { var T; w = (T = m.getPageView(u - 1)).height / T.viewport.scale; v.bottom = w - v.top - v.height, v.isStampOfQfz = !0, v.pageAttr.bottom = v.bottom; var E = v.top + v.height; v.pageAttr.top = E, v.qfzSeal.forEach(function (e) { e.top = v.top, e.width *= v.height / e.height, e.height = v.height }), delete v.isContinuityStampCheck, delete v.xsacle, delete v.ysacle, delete v.left, delete v.top, delete v.bottom } else v.page = u, v.hasOwnProperty("isContinuityStampCheck") && delete v.isContinuityStampCheck, v.hasOwnProperty("xsacle") && delete v.xsacle, v.hasOwnProperty("ysacle") && delete v.ysacle; var D = (0, c.createCapability)(); if (window.KGPdfViewerWebApp.multipleStamp) v.isStampOfQfz || (v.currentPage = u), this.tempSeals.push(new h.default(p, v)), this.tempSeals.length && (this.app.KGStampConfirm.show(), this.app.KGStampConfirm.sealDatas = this.tempSeals.map(function (e) { return e.sealData }), this.app.KGStampConfirm.capability = D, window.KGPdfViewerWebApp.allowFollow && "1" !== window.KGPdfViewerWebApp.mobile.toString() || this.onDocumentContextmenu()); else { if (v.isStampOfQfz) { for (var I = 0; I < v.qfzSeal.length; I++) { var L = v.qfzSeal[I]; L.sealdata = [], L.sealdata[0] = { left: L.left, width: L.width, imgdata: L.imgdata }, delete L.left, delete L.width, delete L.imgdata; var O = p.cloneNode(!0); O.setAttribute("id", p.id + "-" + L.page); var M = m.getPageView(L.page - 1), N = M.viewport, R = M.annotationLayer, W = N.scale, V = M.width / W; O.style.width = L.sealdata[0].width + "px", O.style.height = L.height + "px", L.sealdata[0].left = V - L.sealdata[0].width, (0, d.setSectionStyle)(O, W, L.sealdata[0].left, L.top), O.querySelector("img").src = L.sealdata[0].imgdata, L.section = O, Object.defineProperty(L, "section", {enumerable: !1}), R && (R.div || (R.div = document.createElement("div"), R.div.className = "annotationLayer", M.div.appendChild(R.div)), R.div.appendChild(O)) } p.parentNode.removeChild(p) } !0 === window.KGPdfViewerWebApp.useCaptcha ? (this.app.KGCaptcha.okCallback = function (e) { t.addStamp({sealdata: [v], capability: D, captcha: e}) }, this.app.KGCaptcha.cancelCallback = function () { t.isStamp = !0, t.cancelStamp() }, this.app.KGCaptcha.open(v.phone)) : this.addStamp({sealdata: [v], capability: D}) } D.promise.then(this.renderSignatureSeals) } } } }, renderSignatureSeals: function (e) { var t = this, n = e.status, r = e.message, i = e.successPassBackParameter, a = this.app.pdfViewer; if (this.app.KG_ScanStamp && this.app.KG_ScanStamp.clearSealData(), n) { if (window.KGPdfViewerWebApp.multipleStamp) { var o = this.tempSeals.concat(); if ("OFD" === self.fileType && window.KGPdfViewerWebApp.multipleStamp && "1" === window.KGPdfViewerWebApp.sealOrigin.toString() && (o = o.filter(function (e) { return e.ofdStampSuccess })), !o || !o.length) return; if ("OFD" === window.KGPdfViewerWebApp.fileType || 2 == window.KGPdfViewerWebApp.stampType) (0, f.sortClass)(o, ["sealData", "esid"]).forEach(function (e) { var n = void 0; e.forEach(function (e, r) { if (0 === r && (n = e.section.getAttribute("data-annotation-id")), e.sealData.isStampOfQfz) { var i = e.section.getAttribute("data-annotation-id"); t.app.appConfig.viewerContainer.querySelectorAll('section[data-annotation-id="' + i + '"]').forEach(function (e) { e.setAttribute("data-annotation-id", n) }) } else e.section.setAttribute("data-annotation-id", n) }) }); var s = o[0].section.getAttribute("data-annotation-id"); o.forEach(function (e, n) { e.section.removeAttribute("class"); var r = function (e) { e.removeAttribute("class"); var t = e.querySelector(".deleteTempStampSection"); t && e.removeChild(t); var n = e.querySelector(".scaleTempStampSection"); n && e.removeChild(n) }; if (r(e.section), e.sealData.isContinuityStampCheck) for (var i = e.sealData.page.split("-"), o = parseInt(i[0]), l = parseInt(i[1]), c = e.sealData._tempStampkey, u = o; u <= l; u++) { for (var d = a.getPageView(u - 1), h = d.pdfPage.tempStamps, p = null, f = Object.keys(h), m = 0; m <= f.length; m++) { var v = f[m]; if (-1 != v.indexOf(c)) { p = h[v].cloneNode(!0); break } } if (!p) return; r(p), p.id = n + "-" + s + "-" + u; var g = e.section.getAttribute("data-annotation-id"); if (p.setAttribute("data-annotation-id", g), 1 === window.KGPdfViewerWebApp.stampType) 0 == window.KGPdfViewerWebApp.getSelectSealPrompt().sigWithDifferentCert && p.setAttribute("data-annotation-id", s); t.updatePageView(d, p) } else if (e.sealData.isStampOfQfz) for (var y = 0; y < e.sealData.qfzSeal.length; y++) { var b = e.sealData.qfzSeal[y], w = e.section.id + "-" + b.page, S = a.getPageView(b.page - 1), _ = S.pdfPage.tempStamps[w]; _.removeAttribute("class"); var k = _.querySelector(".deleteTempStampSection"); k && _.removeChild(k); var x = _.querySelector(".scaleTempStampSection"); x && _.removeChild(x), _.id = n + "-" + s + "-" + y + "-" + b.page, t.updatePageView(S, _) } else { var P = a.getPageView(Number(e.sealData.page) - 1), C = e.section.cloneNode(!0); if (C.id = n + "-" + s, 1 === window.KGPdfViewerWebApp.stampType) 0 == window.KGPdfViewerWebApp.getSelectSealPrompt().sigWithDifferentCert && C.setAttribute("data-annotation-id", s); t.updateUI(P, C); var A = P.annotationLayer; A && (A.div || (A.div = document.createElement("div"), A.div.className = "annotationLayer", P.div.appendChild(A.div)), A.div.appendChild(C)) } }), this.clearTempSeals(!1) } else { section.className = ""; var l = section.getAttribute("data-annotation-id"); if (self.isContinuityStampCheck) { var c = self.continuityRange.split("-"), u = parseInt(c[0]), d = parseInt(c[1]), h = section.cloneNode(!0); section.parentNode.removeChild(section); for (var p = u; p <= d; p++) { var m = h.cloneNode(!0); m.setAttribute("id", p + "-" + l); var g = a.getPageView(p - 1), y = g.width / g.viewport.scale * xsacle, b = g.height / g.viewport.scale * ysacle; m.style.left = y + "px", m.style.top = b + "px", v.setProp("transformOrigin", m, -1 * y + "px " + -1 * b + "px"), self.updatePageView(g, m) } } else if (self.isStampOfQfz) for (var w = 0; w < sealdata.qfzSeal.length; w++) { var S = sealdata.qfzSeal[w], _ = a.getPageView(S.page - 1); S.section.removeAttribute("class"), S.section.id = S.page + "-" + l, this.updatePageView(_, S.section) } else { var k = a.getPageView(pageNumber - 1); section.id = l, self.updateUI(k, section), window.KGPdfViewerWebApp.isUrlDoc && (i || (i = {}), i.section = section) } } var x = this.app.KG_SealPreLocation; x && !x.hasStamp && (x.hasStamp = !0, window.KGPdfViewerWebApp.multipleStamp = x.previewMultipleStampConfig), window.KGPdfViewerWebApp.stampSuccess && (!window.KGPdfViewerWebApp.fjrs || window.KGPdfViewerWebApp.fjrs && !window.KGPdfViewerWebApp.isServer) && window.KGPdfViewerWebApp.stampSuccess(i) } else { this.removeStampNode(), window.hightMap.removeAll(), window.KGPdfViewerWebApp.multipleStamp && (this.cancelStamp(), this.clearTempSeals(!0)), null != window.KGPdfViewerWebApp.externalStampSeal && window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(r || "调用外部接口加盖签章失败!") } }, updatePageView: function (e, t) { var n = t, r = e.pdfPage, i = e.annotationLayer; if (i) if (2 !== e.renderingState) { if (1 === e.renderingState) return e.reRenderWait = !0, void (r.newStamps[n.id] = n); i.div || (i.div = document.createElement("div"), i.div.className = "annotationLayer", e.div.appendChild(i.div)), i.div.appendChild(n), this.updateUI(e, n) } else r.newStamps[n.id] = n; else r.newStamps[n.id] = n }, updateUI: function (e, t) { var n = e.pdfPage, r = t.style.width, i = t.style.height, a = y(t.style.left), s = y(t.style.top), l = y(r), c = y(i), d = t.querySelector("img"); d.style.display = "none"; var h = (0, u.createSealNode)(n, e, t, r, i); if (t.appendChild(h), n.newStamps[t.id] = t, void 0 !== e.canvas) { var p = e.viewport.scale * (e.canvas.width / e.canvas.offsetWidth), f = a * p, m = s * p, v = e.canvas.getContext("2d"); v.globalCompositeOperation = "multiply", "multiply" !== v.globalCompositeOperation && (v.globalAlpha = .85); var g = this; d.onload = function () { v.drawImage(d, f, m, l * p, c * p); var t = g.app.pdfThumbnailViewer.getThumbnail(n.pageIndex); t.renderingState = o.RenderingStates.INITIAL, t.setImage(e) }, d.src = d.src } }, stamp: function (e) { var t = this; this.pdfStampSeal.getSealObjet(e).then(function (e) { var n = e.isStampOfQfz, r = e.isContinuityStampCheck; if (n || r) return t.stampDefault(e); var i = t.stampPosition, a = i.page, o = i.pos, s = i.text; switch (i.mode) { case"stamp": t.stampDefault(e); break; case"stampOfXY": t.stampOfXY(a, o.x, o.y, e.seal); break; case"stampOfText": t.stampOfText(a, s, e.seal) } }) }, SCSJTT_getFirstSealFromServer: function (e, t) { this.pdfStampSeal.SCSJTT_getFirstSealFromServer(e, t) }, movestamp: function (e, t) { if (!t.stopMoveStamp) { var n = void 0, r = this.app, i = r.KG_SealPreLocation, a = r.pdfViewer; if (e) n = b(e, this.sidebar); else if (i) { var o = i.seal, s = o.page, l = o.left, c = o.top, u = o.width, d = o.height; n = { node: a.getPageView(s - 1).div, pageNumber: s, pageX: (l + u / 2) * a.currentScale * 96 / 72, pageY: (c + d / 2) * a.currentScale * 96 / 72 } } if (n) { var h = n, f = h.node, m = h.pageNumber, g = h.pageX, y = h.pageY; f.style.overflow = "hidden"; var w = t.app.pdfViewer.getPageView(m - 1), S = w.annotationLayer; S.div || (S.div = document.createElement("div"), S.div.className = "annotationLayer", f.appendChild(S.div)); var _ = w.viewport.scale; if (g > 0 && y > 0 || i) { var k = document.getElementById(f.id + "stamp"), x = g / _ - t.seal.width / 2, P = y / _ - t.seal.height / 2, C = (new Date).getTime(); k ? (k.setAttribute("data-annotation-id", C), k.style.transform = "matrix(" + _ + ", 0, 0, " + _ + ", 0, 0)", k.style.left = x + "px", k.style.top = P + "px", v.setProp("transform", k, "matrix(" + _ + ", 0, 0, " + _ + ", 0, 0)"), v.setProp("transformOrigin", k, -1 * x + "px " + -1 * P + "px")) : (this.removeStampNode(), (k = this._createSection(this.seal, f.id + "stamp", C, "stamp", x, P, _)).querySelector("img").addEventListener("mousedown", p.eventPreventDefault), S.div.appendChild(k)) } else this.removeStampNode() } else this.removeStampNode() } }, _createSection: function (e, t, n, r, i, a, o) { var s = document.createElement("section"); s.setAttribute("data-annotation-id", n), s.id = t, s.className = r, s.style.width = e.width + "px", s.style.height = e.height + "px"; var l = document.createElement("img"); return l.src = e.imgdata, l.style.width = "100%", l.style.height = "100%", l.style.opacity = "0.8", s.appendChild(l), s.style.transform = "matrix(" + o + ", 0, 0, " + o + ", 0, 0)", s.style.left = i + "px", s.style.top = a + "px", v.setProp("transform", s, "matrix(" + o + ", 0, 0, " + o + ", 0, 0)"), v.setProp("transformOrigin", s, -1 * i + "px " + -1 * a + "px"), s }, cancelStamp: function () { this.stopMoveStamp = !1, this.stampSealType = "default", this.isStamp && (this.isStamp = !1, document.body.style.cursor = "default", document.onmousemove = null, this.removeStampNode(), window.hightMap.removeAll()) }, clearTempSeals: function () { for (var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], t = this.app, n = t.pagesCount, r = t.pdfViewer, i = 1; i <= n; i++) { var a = r.getPageView(i - 1), o = a.pdfPage.tempStamps, s = a.annotationLayer; for (var l in o) if (o.hasOwnProperty(l)) { if (s && s.div && document.getElementById(o[l].id)) { var c = !1; if (3 === l.split("-").length) o[l].getAttribute("class") || (c = !0); (!c || c && e) && s.div.removeChild(o[l]) } delete o[l] } } this.tempSeals = [] }, removeStampNode: function () { var e = document.getElementsByClassName("stamp"); 0 !== e.length && e[0].parentNode.removeChild(e[0]) }, checkPageNum: function (e) { var t = window.KGPdfViewerWebApp.getNumPages(); if (e || (e = "0-" + t), -1 !== e.indexOf(",")) return { pages: e, chunk_pages: e.split(",").map(function (e) { var t = e.split("-"), n = a(t, 2), r = n[0], i = n[1]; return [r, void 0 === i ? r : i].map(Number) }) }; if (1 == e.length) { if (e > t) return {pages: e, begin: e, end: e}; e = e + "-" + e } if (!/^\d+-\d+$/.test(e)) return {error: "页码格式不正确!"}; var n = e.split("-"), r = parseInt(n[0]), i = parseInt(n[1]); if (r > i) { var o = r; r = i, i = o } return r < 1 && (r = 1), r > t && (r = t), i > t && (i = t), {pages: r + "-" + i, begin: r, end: i} }, stampDefault: function (e) { var t = this, n = {capability: this.pdfStampSeal.createAddSealPromise()}; for (var r in e) n[r] = e[r]; l.KGPdfViewerWebApp.selectedSeal ? l.KGPdfViewerWebApp.selectedSeal(e.seal).then(function (e) { e && t.getSealObjectCallback(n) }) : this.getSealObjectCallback(n) }, stampOfXY: function (e, t, n, r, o) { var s = this, l = this.checkPageNum(e), u = l.begin, d = l.end, h = l.chunk_pages, p = l.pages, f = l.error; if (f) return this.app.KGAlertPrompt.open(f); var m = this; this.stopMoveStamp = !0, (r ? Promise.resolve({seal: r}) : this.pdfStampSeal.getSealObjet()).then(function (e) { var r = e.seal, l = m.pdfStampSeal.createAddSealPromise(), f = null; Array.isArray(r) ? f = r : ((f = r).left = t, f.top = n, f.page = p, f.isStampOfXY = !0); var v = (0, c.createCapability)(), g = {sealdata: Array.isArray(r) ? f : [f], capability: v}; l.resolve(g), v.promise.then(function (e) { var s = this; if (e.status) if (o && o(), Array.isArray(r)) for (var l = function (e) { var t = r[e], n = m.checkPageNum(t.page), i = n.begin, o = n.end, l = n.chunk_pages, c = (n.pages, n.error); if (c) return {v: s.app.KGAlertPrompt.open(c)}; var u = (new Date).getTime(), d = m.app.pdfViewer.getPageView(0), h = d.viewport.scale, p = m._createSection(t, "", u, "", t.left, t.top, h), f = function (e, t) { for (var n = window.KGPdfViewerWebApp.getNumPages(), r = e; r <= t; r++) { if (r > n) return; d = m.app.pdfViewer.getPageView(r - 1); var i = p.cloneNode(!0); i.id = (new Date).getTime() + "-" + b + 1, m.updatePageView(d, i) } }; l ? l.map(function (e) { var t = a(e, 2), n = t[0], r = t[1]; f(n, r) }) : f(i, o) }, c = 0; c < r.length; c++) { var p = l(c); if ("object" === (void 0 === p ? "undefined" : i(p))) return p.v } else { var f = (new Date).getTime(), v = m.app.pdfViewer.getPageView(0), g = v.viewport.scale, y = m._createSection(r, "", f, "", t, n, g), b = 0, w = function (e, t) { for (var n = window.KGPdfViewerWebApp.getNumPages(), r = e; r <= t; r++) { if (r > n) return; v = m.app.pdfViewer.getPageView(r - 1); var i = y.cloneNode(!0); i.id = (new Date).getTime() + "-" + b++, m.updatePageView(v, i) } }; h ? h.map(function (e) { var t = a(e, 2), n = t[0], r = t[1]; w(n, r) }) : w(u, d) } }).finally(function () { s.onDocumentContextmenu() }) }) }, stampOfText: function (e, t, n, r) { var i = this, a = this.checkPageNum(e), o = a.pages, s = a.error; if (s) return this.app.KGAlertPrompt.open(s); var l = this; this.stopMoveStamp = !0, (n ? Promise.resolve({seal: n}) : this.pdfStampSeal.getSealObjet()).then(function (e) { var n = e.seal, a = l.pdfStampSeal.createAddSealPromise(), s = null; Array.isArray(n) ? s = n : ((s = n).page = o, s.isStampOfText = !0, s.text = t); var u = (0, c.createCapability)(), d = {sealdata: Array.isArray(n) ? s : [s], capability: u}; a.resolve(d), u.promise.then(function (e) { if (e.status) if (r && r(), Array.isArray(n)) for (var t = 0; t < n.length; t++) { var i = n[t], a = l.checkPageNum(i.page), o = (a.begin, a.end, a.chunk_pages, a.pages, a.error); if (o) return this.app.KGAlertPrompt.open(o); for (var c = (new Date).getTime(), u = e.textPositions, d = 0; d < u.length; d++) { var h = u[d], p = h.page, f = h.x - i.width / 2 + i.offsetX, m = h.y - i.height / 2 + i.offsetY, v = l.app.pdfViewer.getPageView(p - 1), g = v.viewport.scale, y = (new Date).getTime() + "-" + d, b = l._createSection(i, y, c, "", f, m, g); l.updatePageView(v, b) } var w = e.successPassBackParameter; window.KGPdfViewerWebApp.stampSuccess && window.KGPdfViewerWebApp.stampSuccess(w) } else { for (var S = (new Date).getTime(), _ = e.textPositions, k = 0; k < _.length; k++) { var x = _[k], P = x.page, C = x.x - s.width / 2, A = x.y - s.height / 2, T = l.app.pdfViewer.getPageView(P - 1), E = T.viewport.scale, D = (new Date).getTime() + "-" + k, I = l._createSection(s, D, S, "", C, A, E); l.updatePageView(T, I) } var L = e.successPassBackParameter; window.KGPdfViewerWebApp.stampSuccess && window.KGPdfViewerWebApp.stampSuccess(L) } }).finally(function () { i.onDocumentContextmenu() }) }) }, editDocSign: function (e) { var t, n, r, i = (0, f.closest)(e.target, "section"); if (i) { var a = i.classList[0]; if (-1 == ["lineAnnotation", "circleAnnotation", "squareAnnotation"].indexOf(a)) return; var o = window.KGPdfViewerWebApp, s = o.PDFViewerApplication, l = o.globalAnnotation, c = o.deleteDocSignOnCanvas, u = (0, f.closest)(e.target, ".page"), d = Number(u.dataset.pageNumber), h = s.pdfViewer.getPageView(d - 1); if (this.selectSign == i) return; var p = i.getAttribute("data-author") || ""; if ((l.author || "") != p) return s.KGAlertPrompt.open("您没有权限操作该批注!"); var m = (t = Array.prototype.slice.call(document.getElementsByClassName("lineAnnotation")), n = Array.prototype.slice.call(document.getElementsByClassName("circleAnnotation")), r = Array.prototype.slice.call(document.getElementsByClassName("squareAnnotation")), t.concat(n).concat(r)); m.map(function (e) { e.style["pointer-events"] = "none" }), i.style["pointer-events"] = "all"; var v = e.target; "svg:svg" != v.tagName && "svg" != v.tagName || (v = v.firstChild); var g = h.viewport.scale, y = parseInt(i.style.top); d > 1 && (y += (u.offsetTop - 12) / g), c(i, h), this.app.KG_DocSign.editDocSign({ top: y, left: parseInt(i.style.left), editData: { scale: g, pageNumber: d, pdfPageView: h, shape: v.tagName, section: i.cloneNode(!0), element: v.cloneNode(!0), strokeWidth: parseInt(v.getAttribute("stroke-width")) } }), m.map(function (e) { e.style["pointer-events"] = "all" }) } }, initStampPosition: function () { this.stampPosition = {mode: "stamp"}; var e = window.KGPdfViewerWebApp, t = e.stampPosition, n = e.fileType; t && "PDF" == n && (this.stampPosition = Object.assign({}, t), this.stampPosition.pos && (this.stampPosition.mode = "stampOfXY"), !this.stampPosition.pos && this.stampPosition.text && (this.stampPosition.mode = "stampOfText")) } }, e }(); t.PDFStamp = w, t.CustomStyle = v, t.getPath = g, t.getNumbOfPx = y, t.convertScreenToViewportPoint = b }, function (e, t, n) { "use strict"; e.exports = "undefined" != typeof window && window.Math === Math ? window : "undefined" != typeof global && global.Math === Math ? global : "undefined" != typeof self && self.Math === Math ? self : {} }, function (e, t, n) { "use strict"; e.exports = !1 }, function (e, t, n) { "use strict"; e.exports = function (e) { if ("function" != typeof e) throw TypeError(e + " is not a function!"); return e } }, function (e, t, n) { "use strict"; var r = n(18); e.exports = function (e, t, n) { for (var i in t) r(e, i, t[i], n); return e } }, function (e, t, n) { "use strict"; e.exports = function (e, t, n, r) { if (!(e instanceof t) || void 0 !== r && r in e) throw TypeError(n + ": incorrect invocation!"); return e } }, function (e, t, n) { "use strict"; var r = {}.toString; e.exports = function (e) { return r.call(e).slice(8, -1) } }, function (e, t, n) { "use strict"; var r = n(17).f, i = n(11), a = n(4)("toStringTag"); e.exports = function (e, t, n) { e && !i(e = n ? e : e.prototype, a) && r(e, a, {configurable: !0, value: t}) } }, function (e, t, n) { "use strict"; var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }; o = function (e) { return e.enc.Utf8 }, "object" === s(t) ? e.exports = t = o(n(2)) : (i = [n(2)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a)) }, function (e, t, n) { "use strict"; e.exports = function (e, t) { return {enumerable: !(1 & e), configurable: !(2 & e), writable: !(4 & e), value: t} } }, function (e, t, n) { "use strict"; var r = n(45), i = n(46); e.exports = function (e) { return r(i(e)) } }, function (e, t, n) { "use strict"; var r = n(20), i = Math.max, a = Math.min; e.exports = function (e, t) { return (e = r(e)) < 0 ? i(e + t, 0) : a(e, t) } }, function (e, t, n) { "use strict"; var r = n(30), i = n(4)("toStringTag"), a = "Arguments" == r(function () { return arguments }()); e.exports = function (e) { var t, n, o; return void 0 === e ? "Undefined" : null === e ? "Null" : "string" == typeof (n = function (e, t) { try { return e[t] } catch (e) { } }(t = Object(e), i)) ? n : a ? r(t) : "Object" == (o = r(t)) && "function" == typeof t.callee ? "Arguments" : o } }, function (e, t, n) { "use strict"; var r = n(12), i = n(122), a = n(69), o = n(10), s = n(13), l = n(73), c = {}, u = {}, d = e.exports = function (e, t, n, d, h) { var p, f, m, v, g = h ? function () { return e } : l(e), y = r(n, d, t ? 2 : 1), b = 0; if ("function" != typeof g) throw TypeError(e + " is not iterable!"); if (a(g)) { for (p = s(e.length); p > b; b++) if ((v = t ? y(o(f = e[b])[0], f[1]) : y(e[b])) === c || v === u) return v } else for (m = g.call(e); !(f = m.next()).done;) if ((v = i(m, y, f.value, t)) === c || v === u) return v }; d.BREAK = c, d.RETURN = u }, function (e, t, n) { "use strict"; var r, i, a, o, s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }; o = function (e) { var t, n, r, i, a, o, s; return n = (t = e).lib, r = n.Base, i = n.WordArray, a = t.algo, o = a.MD5, s = a.EvpKDF = r.extend({ cfg: r.extend({ keySize: 4, hasher: o, iterations: 1 }), init: function (e) { this.cfg = this.cfg.extend(e) }, compute: function (e, t) { for (var n, r = this.cfg, a = r.hasher.create(), o = i.create(), s = o.words, l = r.keySize, c = r.iterations; s.length < l;) { n && a.update(n), n = a.update(e).finalize(t), a.reset(); for (var u = 1; u < c; u++) n = a.finalize(n), a.reset(); o.concat(n) } return o.sigBytes = 4 * l, o } }), t.EvpKDF = function (e, t, n) { return s.create(n).compute(e, t) }, e.EvpKDF }, "object" === s(t) ? e.exports = t = o(n(2), n(90), n(91)) : (i = [n(2), n(90), n(91)], void 0 === (a = "function" == typeof (r = o) ? r.apply(t, i) : r) || (e.exports = a)) }, function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}), t.getOfdSealsByTG = t.WebKGVerify = t.getCertByScanStamp = t.pdfSM2RegionSign = t.deleteOfdSeal = t.ofdSign = t.getOfdSeals = t.getCert = t.getKeySN = t.KG_OFD = void 0; var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }, i = function () { function e(e, t) { for (var n = 0; n < t.length; n++) { var r = t[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r) } } return function (t, n, r) { return n && e(t.prototype, n), r && e(t, r), t } }(), a = n(40), o = n(5), s = u(n(15)), l = u(n(32)), c = n(59); function u(e) { return e && e.__esModule ? e : {default: e} } var d = function () { function e() { var t = this; !function (e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function") }(this, e), this.kg = new a.KG("ISIGNATURESERVER.iSignatureServerCtrl.1", "2015DB05-ABB5-4924-A66FA88D7919C782"); var n = (0, a.createCapability)(); this.promise = n.promise; var r = window.KGPdfViewerWebApp.appCode; this.kg.init().then(function () { t.kg.invoke("SetParamByName", "APPCODE", r).then(n.resolve) }) } return i(e, [{ key: "WebOpenKey", value: function (e) { var t = this; return this.kg.invoke("WebOpenKey", e).then(function (e) { return e && "none" !== e && "0" !== e.toString() ? Promise.resolve(e) : t.WebGetLastErrorMsg("开启密钥盘失败") }) } }, { key: "WebCloseKey", value: function (e) { return this.kg.invoke("WebCloseKey", e) } }, { key: "WebGetKeyCount", value: function () { var e = this; return this.kg.invoke("WebGetKeyCount", "").then(function (t) { return isNaN(Number(t)) || 1 !== Number(t) ? Number(t) > 1 ? Promise.reject({message: "插入了太多的密钥盘"}) : -1 === Number(t) ? e.WebGetLastErrorMsg("授权已过期") : Promise.reject({message: "没有插入密钥盘"}) : Promise.resolve() }) } }, { key: "WebKeyIsNotAdmin", value: function (e) { var t = this; return this.kg.invoke("WebKeyIsAdmin", e).then(function (e) { return "false" === e || !1 === e ? Promise.resolve() : t.WebGetLastErrorMsg("没有检测到用户密钥盘") }) } }, { key: "WebSign", value: function (e, t) { var n = this; return this.kg.invoke("WebSign", e, t).then(function (e) { return e ? Promise.resolve(e) : n.WebGetLastErrorMsg("数据签名失败") }) } }, { key: "WebVerifyPin", value: function (e, t) { var n = this; return this.kg.invoke("WebVerifyPin", e, t).then(function (e) { return e && "0" === e ? Promise.resolve() : (window.KGPdfViewerWebApp.getPasswordPrompt().clearRememberedPwd(), n.WebGetLastErrorMsg("密钥盘密码错误")) }) } }, { key: "WebSetAlgoFlag", value: function () { var e = this, t = window.KGPdfViewerWebApp.algorithmType.key; if (null != t) { var n = "sm2" === t.toLowerCase(), r = "rsa" === t.toLowerCase(), i = n ? 0 : r ? 1 : null; return null != i ? this.kg.invoke("WebSetAlgoFlag", i).then(function (t) { return t ? Promise.resolve() : e.WebGetLastErrorMsg("获取证书失败") }) : Promise.resolve() } return Promise.resolve() } }, { key: "WebGetSignCertByContainerName", value: function (e) { var t = this, n = window.KGPdfViewerWebApp.adaptContainer; return this.kg.invoke("WebGetCertByContainerName", e, 0, "").then(function (e) { if (e.result) { if (e.data = e.data.filter(function (e) { return 2 == e.certAlgo && 0 == e.certExpiration }), 0 === e.data.length) return Promise.reject({message: "没有有效的证书"}); for (var i = [], a = function (t) { if (0 !== (i = e.data.filter(function (e) { return e.containername === n[t] })).length) return {v: Promise.resolve(i[0].cert)} }, o = 0; o < n.length; o++) { var s = a(o); if ("object" === (void 0 === s ? "undefined" : r(s))) return s.v } return Promise.resolve(e.data[0].cert) } return t.WebGetLastErrorMsg() }) } }, { key: "WebGetFirstCert", value: function (e) { var t = this; return this.kg.invoke("WebGetCertData", e, 0).then(function (e) { return e && "none" !== e ? Promise.resolve(e) : t.WebGetLastErrorMsg("获取证书失败") }) } }, { key: "WebGetCertData", value: function (e) { return 0 !== window.KGPdfViewerWebApp.adaptContainer.length ? this.WebGetSignCertByContainerName(e) : this.WebGetFirstCert(e) } }, { key: "WebGetSealCount", value: function (e) { var t = this; return this.kg.invoke("WebGetSealCount", e).then(function (e) { return !isNaN(Number(e)) && Number(e) >= 1 ? Promise.resolve(Number(e)) : t.WebGetLastErrorMsg("密钥盘中不存在印章") }) } }, { key: "WebGetSealCount_TG", value: function (e) { return this.kg.invoke("WebGetSealCount", e).then(function (e) { return !isNaN(Number(e)) && Number(e) >= 1 ? Promise.resolve(Number(e)) : Promise.reject({ seals: [], status: !1 }) }) } }, { key: "WebGetSealData", value: function (e) { var t = this, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; return this.kg.invoke("WebGetSealData", e, n).then(function (e) { return e && "none" !== e ? Promise.resolve(e) : t.WebGetLastErrorMsg("获取印章失败(印章索引:" + n + ")") }) } }, { key: "WebGetKeySerialNumber", value: function (e) { var t = this; return this.kg.invoke("WebGetKeySerialNumber", e).then(function (e) { return e && "none" !== e ? Promise.resolve(e) : t.WebGetLastErrorMsg("获取密钥盘序列号失败") }) } }, { key: "WebGetKeyUnit", value: function (e) { var t = this; return this.kg.invoke("WebGetKeyUnit", e).then(function (e) { return e && "none" !== e ? Promise.resolve(e) : t.WebGetLastErrorMsg("获取用章单位失败") }) } }, { key: "WebGetLastErrorMsg", value: function (e) { return this.kg.invoke("WebGetLastErrorMsg").then(function (t) { return t && "none" !== t ? Promise.reject({ message: t.value || t, defaultMsg: e }) : Promise.reject({message: e, defaultMsg: e}) }) } }, { key: "WebKGVerify", value: function (e, t, n) { var r = this; return this.kg.invoke("WebKGVerify", e, t, n).then(function (e) { var t = "true" == e; return t ? Promise.resolve(t) : r.WebGetLastErrorMsg("程序异常") }) } }]), e }(); t.KG_OFD = d, t.getKeySN = function () { var e = new d; return e.promise.then(function () { return e.WebGetKeyCount() }).then(function () { return e.WebOpenKey(0) }).then(function (t) { return e.WebGetKeySerialNumber(t) }) }, t.getCert = function (e, t, n, r) { var i = new d, a = void 0; i.promise.then(function () { return i.WebGetKeyCount() }).then(function () { return i.WebOpenKey(0) }).then(function (e) { return a = e, i.WebKeyIsNotAdmin(a) }).then(function () { return i.WebVerifyPin(a, e) }).then(function () { return i.WebSetAlgoFlag() }).then(function () { return i.WebGetCertData(a) }).then(function (e) { return t(e) }).then(function (e) { n && n(e) }).catch(function (e) { var t = e.message; return r(t), Promise.resolve() }).then(function () { if (null != a) return i.WebCloseKey(a) }) }, t.getOfdSeals = function (e, t, n, r) { var i = new d, a = void 0, o = void 0, s = void 0, l = void 0; i.promise.then(function () { return i.WebGetKeyCount() }).then(function () { return i.WebOpenKey(0) }).then(function (e) { return a = e, i.WebKeyIsNotAdmin(e) }).then(function () { return i.WebVerifyPin(a, e) }).then(function () { return i.WebGetKeySerialNumber(a) }).then(function (e) { return o = e, (0, c.verifyKeySn)(e) }).then(function () { return i.WebGetKeyUnit(a) }).then(function (e) { return s = e, i.WebSetAlgoFlag() }).then(function () { return i.WebGetCertData(a) }).then(function (e) { return l = e, i.WebGetSealCount(a) }).then(function (e) { for (var t = [], n = 0; n < e; n++) t.push(i.WebGetSealData(a, n)); return Promise.all(t) }).then(function (e) { if (!e || 0 === e.length) return i.WebGetLastErrorMsg("获取印章失败"); var n = { action: "handleCilentSeal", keySN: o, unitName: s, stampType: window.KGPdfViewerWebApp.stampType, seals: e }; return window.KGPdfViewerWebApp.cilentSeals = e, t && t(n) }).then(function (e) { var t = e.data; n && n(t, l, o) }).catch(function (e) { return e && r && r({message: e.message, defaultMsg: e.defaultMsg}), Promise.resolve() }).then(function () { if (null != a) return i.WebCloseKey(a) }) }, t.ofdSign = function (e, t, n, r, i, a) { var o = new d, s = void 0, l = void 0; o.promise.then(function () { return o.WebGetKeyCount() }).then(function () { return o.WebOpenKey(0) }).then(function (e) { return s = e, o.WebKeyIsNotAdmin(e) }).then(function () { return o.WebVerifyPin(s, e) }).then(function () { return 1 == window.KGPdfViewerWebApp.sealOrigin ? o.WebGetKeySerialNumber(s).then(function (e) { return t !== e ? Promise.reject({message: "密钥盘已更换"}) : Promise.resolve() }) : Promise.resolve() }).then(function () { return o.WebSetAlgoFlag() }).then(function () { return o.WebGetCertData(s) }).then(function (e) { l = e; for (var t = [], r = 0; r < n.length; r++) t.push(o.WebSign(s, n[r].toSignData)); return Promise.all(t) }).then(function (e) { for (var t = [], i = 0; i < e.length; i++) { var a = { signedData: e[i], cert: l, sealType: n[i].sealType, toSignData: n[i].toSignData, signDirPath: n[i].signDirPath }; t.push(r(a)) } return Promise.all(t) }).catch(function (e) { var t = e.message; return a && a(t), Promise.resolve() }).then(function () { return null != s ? o.WebCloseKey(s) : Promise.resolve() }).then(function () { i && i() }) }, t.deleteOfdSeal = function (e, t, n) { var r = new d, i = void 0, a = (0, o.randomString)(); r.promise.then(function () { return r.WebGetKeyCount() }).then(function () { return r.WebOpenKey(0) }).then(function (e) { return i = e, r.WebKeyIsNotAdmin(e) }).then(function () { return r.WebVerifyPin(i, e) }).then(function () { return r.WebGetKeySerialNumber(i) }).then(function (e) { return (0, c.verifyKeySn)(e) }).then(function () { return r.WebSetAlgoFlag() }).then(function () { var e = s.default.stringify(l.default.parse(a)); return r.WebSign(i, e) }).then(function (e) { return t(a, e) }).catch(function (e) { return e && n && n(e.message || e.defaultMsg || e), Promise.resolve() }).then(function () { if (null != i) return r.WebCloseKey(i) }) }, t.pdfSM2RegionSign = function (e, t, n, r, i, a) { var o = new d, s = void 0, l = void 0; o.promise.then(function () { return o.WebGetKeyCount() }).then(function () { return o.WebOpenKey(0) }).then(function (e) { return s = e, o.WebKeyIsNotAdmin(e) }).then(function () { return o.WebVerifyPin(s, e) }).then(function () { return 1 == window.KGPdfViewerWebApp.sealOrigin ? o.WebGetKeySerialNumber(s).then(function (e) { return t !== e ? Promise.reject({message: "密钥盘已更换"}) : Promise.resolve() }) : Promise.resolve() }).then(function () { return o.WebSetAlgoFlag() }).then(function () { return o.WebGetCertData(s) }).then(function (e) { l = e; for (var t = [], r = 0; r < n.length; r++) t.push(o.WebSign(s, n[r].needSigMessage)); return Promise.all(t) }).then(function (e) { for (var t = [], i = 0; i < n.length; i++) { n[i].sigedData = e[i]; var a = {cert: l, signedData: [n[i]]}; t.push(r(a)) } return Promise.all(t) }).catch(function (e) { var t = e.message; return a && a(t), Promise.resolve() }).then(function () { return null != s ? o.WebCloseKey(s) : Promise.resolve() }).then(function () { i && i() }) }, t.getCertByScanStamp = function (e, t, n, r) { var i = new d, a = void 0, o = {token: t}; i.promise.then(function () { return i.WebGetKeyCount() }).then(function () { return i.WebOpenKey(0) }).then(function (e) { return a = e, i.WebKeyIsNotAdmin(a) }).then(function () { return i.WebVerifyPin(a, e) }).then(function () { return i.WebSetAlgoFlag() }).then(function () { return i.WebGetCertData(a) }).then(function (e) { return o.cert = e, i.WebSign(a, t) }).then(function (e) { o.signData = e, n(o) }).catch(function (e) { var t = e.message; return r(t), Promise.resolve() }).then(function () { if (null != a) return i.WebCloseKey(a) }) }, t.WebKGVerify = function (e, t, n, r, i) { var a = new d, o = void 0; return a.promise.then(function () { return a.WebGetKeyCount() }).then(function () { return a.WebOpenKey(0) }).then(function (e) { return o = e, a.WebKeyIsNotAdmin(e) }).then(function () { return a.WebVerifyPin(o, n) }).then(function () { return a.WebKGVerify(e, t, o) }).then(function (e) { r && r(e) }).catch(function (e) { var t = e.message; return i && i(t), Promise.resolve() }).then(function () { if (null != o) return a.WebCloseKey(o) }) }, t.getOfdSealsByTG = function (e, t, n, r) { var i = new d, a = void 0, o = void 0, s = void 0, l = void 0; i.promise.then(function () { return i.WebGetKeyCount() }).then(function () { return i.WebOpenKey(0) }).then(function (e) { return a = e, i.WebKeyIsNotAdmin(e) }).then(function () { return i.WebVerifyPin(a, e) }).then(function () { return i.WebGetKeySerialNumber(a) }).then(function (e) { return o = e, (0, c.verifyKeySn)(e) }).then(function () { return i.WebGetKeyUnit(a) }).then(function (e) { return s = e, i.WebSetAlgoFlag() }).then(function () { return i.WebGetCertData(a) }).then(function (e) { return l = e, i.WebGetSealCount_TG(a) }).then(function (e) { for (var t = [], n = 0; n < e; n++) t.push(i.WebGetSealData(a, n)); return Promise.all(t) }).then(function (e) { if (!e || 0 === e.length) return i.WebGetLastErrorMsg("获取印章失败"); var n = { action: "handleCilentSeal", keySN: o, unitName: s, stampType: window.KGPdfViewerWebApp.stampType, seals: e }; return window.KGPdfViewerWebApp.cilentSeals = e, t && t(n) }).then(function (e) { var t = e.data; n && n(t, l, o) }).catch(function (e) { return e && r && r({message: e.message, defaultMsg: e.defaultMsg, status: e.status}), Promise.resolve() }).then(function () { if (null != a) return i.WebCloseKey(a) }) } }, function (module, exports, __w_pdfjs_require__) { "use strict"; Object.defineProperty(exports, "__esModule", {value: !0}); var _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }, _timeout = 6e4; window.kgAlert = function (e) { window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(e) }, window.kgAlert || (window.kgAlert = function (e) { window.alert(e) }); var createCapability = function () { var e = {}; return e.promise = new Promise(function (t, n) { e.resolve = t, e.reject = n }), e }; function createCORSRequest(e, t, n) { var r = new XMLHttpRequest; return "withCredentials" in r ? r.open(e, t, !0) : "undefined" != typeof XDomainRequest && (r = new XDomainRequest).open(e, t), r } var defaultOptions = { url: "", method: "post", data: "", async: !0, callback: function (e) { }, error: function () { } }, xhr = { init: function (e) { e.method = e.method || defaultOptions.method, e.async = e.async || defaultOptions.async, e.callback = e.callback || defaultOptions.callback, e.data = e.data || defaultOptions.data }, ajax: function (e) { this.init(e); var t = new XMLHttpRequest; "withCredentials" in xhr ? t.open(e.method, e.url, e.async) : "undefined" != typeof XDomainRequest ? (t = new XDomainRequest).open(e.method, e.url, e.async) : t.open(e.method, e.url, e.async), t.onload = function (e) { }, t.ontimeout = function (e) { }, t.onerror = function (e) { }, xhr.send(e.data) }, post: function () { }, get: function (e) { this.init(e) } }, KG = function (e, t) { this.url = "https:" === window.location.protocol ? "https://local.kinggrid.com:9582" : "http://127.0.0.1:9581", this.progid = e, this.inter = t, this.caller = 0, this.time = _timeout }; KG.prototype = { init: function init() { var disableTips = arguments.length > 0 && void 0 !== arguments[0] && arguments[0], self = this, capability = createCapability(), val = JSON.stringify({ GetInterface: {progid: this.progid, interface: this.inter}, usercode: window.KGPdfViewerWebApp.clientCode }), xhr = createCORSRequest("POST", this.url + "/GetInterface", this); return xhr.timeout = _timeout, window.KGPdfViewerWebApp.hasClientServer = !1, xhr.onload = function (e) { if (window.KGPdfViewerWebApp.hasClientServer = !0, null == this.status || 200 === this.status || 304 === this.status || disableTips) { var obj = eval("(" + this.responseText + ")"); "0" === obj.value.toString() || "none" === obj.value && !disableTips ? window.kgAlert(self.progid + "控件初始化失败!") : (self.caller = obj.value, capability.resolve()) } else window.kgAlert("签章客户端服务异常:status = " + this.status) }, xhr.ontimeout = function () { disableTips || (window.kgAlert("签章客户端服务请求超时!"), window.KGPdfViewerWebApp.getTipPrompt().close()) }, xhr.onerror = function () { disableTips || (window.kgAlert("签章客户端未安装或未启动!"), window.KGPdfViewerWebApp.getTipPrompt().close()) }, xhr.send("value=" + val), capability.promise }, invoke: function invoke(method) { var capability = createCapability(), self = this, params = []; if (arguments.length >= 2) for (var i = 1; i < arguments.length; i++) { var typeVal = _typeof(arguments[i]), value = null != arguments[i] ? arguments[i].toString() : "null", data = null; data = "boolean" === typeVal ? {type: "BOOL", value: value} : "number" === typeVal ? { type: "LONG", value: value } : {type: "BSTR", value: value}, params.push(data) } var val = JSON.stringify({ MethodCall: {caller: this.caller, function: method, params: params}, usercode: window.KGPdfViewerWebApp.clientCode }), xhr = createCORSRequest("POST", this.url + "/MethodCall", this); return xhr.timeout = self.time, xhr.onload = function (e) { if (self.time = _timeout, void 0 == this.status || 200 == this.status || 304 == this.status) { var obj = eval("(" + this.responseText + ")"); capability.resolve(obj.value) } else window.kgAlert("签章客户端服务异常:status = " + this.status) }, xhr.ontimeout = function (e) { self.time = _timeout, window.kgAlert("签章客户端服务请求超时!"), window.KGPdfViewerWebApp.getTipPrompt().close() }, xhr.onerror = function (e) { window.kgAlert("签章客户端未安装或未启动!"), window.KGPdfViewerWebApp.getTipPrompt().close() }, xhr.send("value=" + val), capability.promise }, get: function get(property) { var capability = createCapability(), self = this, val = JSON.stringify({ PropertyCall: {caller: this.caller, property: property}, usercode: window.KGPdfViewerWebApp.clientCode }), xhr = createCORSRequest("POST", this.url + "/PropCall", this); return xhr.timeout = self.time, xhr.onload = function (e) { if (void 0 == this.status || 200 == this.status || 304 == this.status) { var obj = eval("(" + this.responseText + ")"); capability.resolve(obj.value) } else window.kgAlert("签章客户端服务异常:status = " + this.status) }, xhr.ontimeout = function (e) { window.kgAlert("签章客户端服务请求超时!") }, xhr.onerror = function (e) { window.kgAlert("签章客户端未安装或未启动!") }, xhr.send("value=" + val), capability.promise }, put: function put(property, value) { var self = this, typeVal = void 0 === value ? "undefined" : _typeof(value), _value = void 0 != value ? value.toString() : "null", data = null; data = "boolean" === typeVal ? {type: "BOOL", value: _value} : "number" === typeVal ? { type: "LONG", value: _value } : {type: "BSTR", value: _value}; var val = JSON.stringify({ PropertyCallPut: {caller: self.caller, property: property, params: [data]}, usercode: window.KGPdfViewerWebApp.clientCode }), capability = createCapability(), xhr = createCORSRequest("POST", this.url + "/PropCall", this); return xhr.timeout = self.time, xhr.onload = function (e) { if (200 == this.status && 304 == this.status) { var obj = eval("(" + this.responseText + ")"); capability.resolve(obj.value) } else window.kgAlert("签章客户端服务异常:status=" + this.status) }, xhr.ontimeout = function (e) { window.kgAlert("签章客户端服务请求超时!") }, xhr.onerror = function (e) { window.kgAlert("签章客户端未安装或未启动!") }, xhr.send("value=" + val), capability.promise }, setUrl: function (e) { this.url = e } }, exports.createCapability = createCapability, exports.KG = KG }, function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}), t.cryptAPISig = t.cryptAPICtrl = t.iWebAssistError = t.iWebAssist = t.createCapability = void 0; var r = n(40), i = n(93), a = n(153); t.createCapability = r.createCapability, t.iWebAssist = i.iWebAssist, t.iWebAssistError = i.iWebAssistError, t.cryptAPICtrl = a.cryptAPICtrl, t.cryptAPISig = a.cryptAPISig }, function (e, t, n) { "use strict"; var r = n(3), i = n(0).document, a = r(i) && r(i.createElement); e.exports = function (e) { return a ? i.createElement(e) : {} } }, function (e, t, n) { "use strict"; var r = n(3); e.exports = function (e, t) { if (!r(e)) return e; var n, i; if (t && "function" == typeof (n = e.toString) && !r(i = n.call(e))) return i; if ("function" == typeof (n = e.valueOf) && !r(i = n.call(e))) return i; if (!t && "function" == typeof (n = e.toString) && !r(i = n.call(e))) return i; throw TypeError("Can't convert object to primitive value") } }, function (e, t, n) { "use strict"; var r = n(6), i = n(0), a = i["__core-js_shared__"] || (i["__core-js_shared__"] = {}); (e.exports = function (e, t) { return a[e] || (a[e] = void 0 !== t ? t : {}) })("versions", []).push({ version: r.version, mode: n(26) ? "pure" : "global", copyright: "© 2019 Denis Pushkarev (zloirock.ru)" }) }, function (e, t, n) { "use strict"; var r = n(30); e.exports = Object("z").propertyIsEnumerable(0) ? Object : function (e) { return "String" == r(e) ? e.split("") : Object(e) } }, function (e, t, n) { "use strict"; e.exports = function (e) { if (void 0 == e) throw TypeError("Can't call method on " + e); return e } }, function (e, t, n) { "use strict"; var r = n(44)("keys"), i = n(19); e.exports = function (e) { return r[e] || (r[e] = i(e)) } }, function (e, t, n) { "use strict"; e.exports = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",") }, function (e, t, n) { "use strict"; var r = n(66), i = n(48); e.exports = Object.keys || function (e) { return r(e, i) } }, function (e, t, n) { "use strict"; var r = n(12), i = n(45), a = n(21), o = n(13), s = n(106); e.exports = function (e, t) { var n = 1 == e, l = 2 == e, c = 3 == e, u = 4 == e, d = 6 == e, h = 5 == e || d, p = t || s; return function (t, s, f) { for (var m, v, g = a(t), y = i(g), b = r(s, f, 3), w = o(y.length), S = 0, _ = n ? p(t, w) : l ? p(t, 0) : void 0; w > S; S++) if ((h || S in y) && (v = b(m = y[S], S, g), e)) if (n) _[S] = v; else if (v) switch (e) { case 3: return !0; case 5: return m; case 6: return S; case 2: _.push(m) } else if (u) return !1; return d ? -1 : c || u ? u : _ } } }, function (e, t, n) { "use strict"; var r = n(10), i = n(27), a = n(4)("species"); e.exports = function (e, t) { var n, o = r(e).constructor; return void 0 === o || void 0 == (n = r(o)[a]) ? t : i(n) } }, function (e, t, n) { "use strict"; var r = n(4)("iterator"), i = !1; try { var a = [7][r](); a.return = function () { i = !0 }, Array.from(a, function () { throw 2 }) } catch (e) { } e.exports = function (e, t) { if (!t && !i) return !1; var n = !1; try { var a = [7], o = a[r](); o.next = function () { return {done: n = !0} }, a[r] = function () { return o }, e(a) } catch (e) { } return n } }, function (e, t, n) { "use strict"; var r = n(27); e.exports.f = function (e) { return new function (e) { var t, n; this.promise = new e(function (e, r) { if (void 0 !== t || void 0 !== n) throw TypeError("Bad Promise constructor"); t = e, n = r }), this.resolve = r(t), this.reject = r(n) }(e) } }, function (e, t, n) { "use strict"; var r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }, i = n(19)("meta"), a = n(3), o = n(11), s = n(17).f, l = 0, c = Object.isExtensible || function () { return !0 }, u = !n(16)(function () { return c(Object.preventExtensions({})) }), d = function (e) { s(e, i, {value: {i: "O" + ++l, w: {}}}) }, h = e.exports = { KEY: i, NEED: !1, fastKey: function (e, t) { if (!a(e)) return "symbol" == (void 0 === e ? "undefined" : r(e)) ? e : ("string" == typeof e ? "S" : "P") + e; if (!o(e, i)) { if (!c(e)) return "F"; if (!t) return "E"; d(e) } return e[i].i }, getWeak: function (e, t) { if (!o(e, i)) { if (!c(e)) return !0; if (!t) return !1; d(e) } return e[i].w }, onFreeze: function (e) { return u && h.NEED && c(e) && !o(e, i) && d(e), e } } }, function (e, t, n) { "use strict"; var r = n(3); e.exports = function (e, t) { if (!r(e) || e._t !== t) throw TypeError("Incompatible receiver, " + t + " required!"); return e } }, function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}), t.deleteOneSeal = t.removeStampMenu = t.createSealNode = void 0; var r = n(23), i = n(58), a = n(39), o = n(24), s = n(41), l = n(59), c = n(5); var u = null; function d(e, t, n, r, d, m) { var v = !(arguments.length > 6 && void 0 !== arguments[6]) || arguments[6], g = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt, y = (0, o.getNumbOfPx)(n.style.left), b = (0, o.getNumbOfPx)(n.style.top), w = (0, o.getNumbOfPx)(n.style.width), S = (0, o.getNumbOfPx)(n.style.height); function _(r) { r.preventDefault(), r.stopPropagation(); var s = t.pdfViewer.app, d = (e.pageIndex, t.viewport.scale), p = (0, o.convertScreenToViewportPoint)(r, s.pdfSidebar), m = p.pageX / d, v = p.pageY / d, y = window.KGPdfViewerWebApp.PDFViewerApplication, b = y.KG_FJRS, w = y.KG_ScanStamp, S = y.KG_UkeyStamp, _ = y.KG_ScanStamp_V2; if (_) _.delete(function () { return f(t, s, e, n, m, v, "") }); else if (!0 === window.KGPdfViewerWebApp.useCaptcha) (0, l.getPhone)().then(function (r) { s.KGCaptcha.okCallback = function (r) { f(t, s, e, n, m, v, r) }, s.KGCaptcha.open(r) }); else if (b && b.delKeySN && "1" === b.bSignByCalibrary) b.deleteScanStamp(function () { f(t, s, e, n, m, v, "") }); else if (!(w || S && "1" == window.KGPdfViewerWebApp.stampModel) || window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isScanStamp) { var k = window.KGPdfViewerWebApp.getPasswordPrompt(); k.setUpdateCallback(function (r) { var o = window.KGPdfViewerWebApp, l = o.certOrigin, d = o.sealOrigin, p = o.fileType, y = o.isSM, b = o.stampModel, w = function () { f(t, s, e, n, m, v, r) }; if (1 == l && "OFD" === p) { var S = function (i, a) { return f(t, s, e, n, m, v, r, i, a) }, _ = function (e) { return (0, c.closeOverlay)().then(function () { return g.open(e) }) }; if (!0 === window.KGPdfViewerWebApp.useNFSSystem) (0, i.deleteNFSSeal)(r, S, _); else new Promise(function (e) { if (y) { var t = void 0; (0, a.WebKGVerify)(u, "", r, function (e) { t = e }, _).then(function () { return e(t) }) } else e(!0) }).then(function (e) { return e && (0, a.deleteOfdSeal)(r, S, _) }) } else window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs ? "0" === window.KGPdfViewerWebApp._stampOrigin ? f(t, s, e, n, m, v, r) : h({ password: r, deleteSealCallback: w }) : 1 == l || 1 == d || "2" == b ? h({password: r, deleteSealCallback: w}) : f(t, s, e, n, m, v, r) }), k.open(!1, "delete") } else "1" == window.KGPdfViewerWebApp.stampModel ? S.delete(function () { f(t, s, e, n, m, v, "") }) : w.getQrCodeImage("delete", function () { f(t, s, e, n, m, v, "") }) } var k = m.querySelector(".delSealNode"); function x(r) { if (r.preventDefault(), r.stopPropagation(), !window.KGPdfViewerWebApp.isUrlDoc) { var i = window.KGPdfViewerWebApp.PDFViewerApplication, l = i.KG_SealPreLocation; if (!(i.KG_IWebAuth || l && n.dataset.annotationId == l.annotId)) { var u = t.pdfViewer.app, d = t.viewport.scale, h = (0, o.convertScreenToViewportPoint)(r, u.pdfSidebar), p = h.pageX, f = h.pageY, m = p / d, _ = f / d; if (v) { if (!(m >= y && m <= y + w && _ >= b && _ <= b + S)) return } else { var k = t.getPagePoint(p, f), x = k[0], P = k[1], C = t.viewport.viewBox; if (P = Math.abs(C[3] - C[1]) - P, !(x >= y && x <= y + w && P >= b && P <= b + S)) return } var A = window.KGPdfViewerWebApp.getTipPrompt(); switch (t.pdfViewer.app.l10n._lang) { case"zh-TW": A.open("正在驗證印章..."); break; case"en-US": A.open("Verifying seal..."); break; default: A.open("正在验证印章...") } new Promise(function (t) { null != window.KGPdfViewerWebApp.externalVerifySeal ? window.KGPdfViewerWebApp.externalVerifySeal(t, window.KGPdfViewerWebApp.documentId, e.pageIndex + 1, m, _) : window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs ? window.KGPdfViewerWebApp.hasClientServer ? window.KGPdfViewerWebApp.verifySeal(e.pageIndex + 1, m, _, t, "1") : window.KGPdfViewerWebApp.verifySeal(e.pageIndex + 1, m, _, t, "2") : window.KGPdfViewerWebApp.verifySeal(e.pageIndex + 1, m, _, t) }).then(function (t) { if (t.status) { var n = window.KGPdfViewerWebApp.PDFViewerApplication.KG_VerifySealPrompt, i = t.seal.cert; if (window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs) { if (window.KGPdfViewerWebApp.hasClientServer) { var o = new s.iWebAssist({cilentType: "0"}); return Promise.all([o.promise]).then(function () { return window.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS ? i.bSignByCalibrary ? o.setParamByName("FJRSISPHONE", "1") : o.setParamByName("FJRSISPHONE", "0") : Promise.resolve() }).then(function () { return o.verifySignMessage(i.newHash, i.sigData) }).then(function (r) { r.result ? (i.sigEffectiveness = !0, A.close().then(function () { return n.open(t) })) : new Promise(function (t) { window.KGPdfViewerWebApp.verifySeal(e.pageIndex + 1, m, _, t, "2") }).then(function (e) { i.sigEffectiveness = e.seal && e.seal.cert && e.seal.cert.sigEffectiveness, A.close().then(function () { return n.open(e) }) }) }) } return i.sigEffectiveness = t.seal && t.seal.cert && t.seal.cert.sigEffectiveness, void A.close().then(function () { return n.open(t) }) } if (!("OFD" !== window.KGPdfViewerWebApp.fileType || t.seal.effectiveness && t.seal.cert.sigEffectiveness || null != window.KGPdfViewerWebApp.externalVerifySeal)) { var l = void 0; switch (r.target.nodeName.toUpperCase()) { case"DIV": l = r.target; break; case"SVG": l = r.target.parentNode; break; case"SECTION": l = r.target.firstChild } if (l && !window.KGPdfViewerWebApp.stampMask) { var u = "width:" + (w - 2) + "px;height:" + (S - 2) + "px"; l.innerHTML = '' } } if (i && i.newHash && null == window.KGPdfViewerWebApp.externalVerifySeal) { var d = new s.iWebAssist({cilentType: "0"}); return Promise.all([d.promise]).then(function () { return window.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS ? i.bSignByCalibrary ? d.setParamByName("FJRSISPHONE", "1") : d.setParamByName("FJRSISPHONE", "0") : Promise.resolve() }).then(function () { return d.verifySignMessage(i.newHash, i.sigData) }).then(function (e) { if (e.result) i.sigEffectiveness = !0; else { if ("-8" != e.errcode) return "-1" == e.errcode ? void g.open("未安装签名组件") : void g.open(e.errmsg || "签名验证失败,errcode=" + e.errcode); i.sigEffectiveness = !1 } A.close().then(function () { return n.open(t) }) }) } var h = !0; new Promise(function (e) { var n = window.KGPdfViewerWebApp, r = n.isSM, i = n.fileType; if (r && "OFD" == i) { var o = function (e) { return (0, c.closeOverlay)().then(function () { h = !1, g.open(e) }) }, s = function (e) { t.seal.effectiveness = e, t.seal.cert.sigEffectiveness = e, l.remember() }, l = window.KGPdfViewerWebApp.getPasswordPrompt(); l.open(), l.setUpdateCallback(function (n) { var r = t.seal.sm, i = r.dataHashBase64, l = r.sesSignatureBase64; (0, a.WebKGVerify)(l, i, n, s, o).then(function () { e(t) }) }) } else e(t) }).then(function (e) { h && A.close().then(function () { return n.open(e) }) }) } else A.close().then(function () { return g.open(t.message) }) }) } } } function P(r) { if (r.preventDefault(), r.stopPropagation(), !window.KGPdfViewerWebApp.isUrlDoc) { var i = window.KGPdfViewerWebApp.PDFViewerApplication, a = i.KG_SealPreLocation; if (!(i.KG_IWebAuth || a && n.dataset.annotationId == a.annotId)) { var s = document.getElementById("rightMenu"); s && s.parentNode.removeChild(s); var l = t.pdfViewer.app, c = t.viewport.scale, d = (0, o.convertScreenToViewportPoint)(r, l.pdfSidebar), h = d.pageX, f = d.pageY, m = h / c, g = f / c; if (v) { if (!(m >= y && m <= y + w && g >= b && g <= b + S)) return } else { var k = t.getPagePoint(h, f), P = k[0], C = k[1], A = t.viewport.viewBox; if (C = Math.abs(A[3] - A[1]) - C, !(P >= y && P <= y + w && C >= b && C <= b + S)) return } var T = l.KG_FJRS; T && (T.delKeySN = null), window.KGPdfViewerWebApp.checkLastone(e.pageIndex + 1, m, g).then(function (e) { if (e) { var n = document.createElement("div"); n.id = "rightMenu", n.style.position = "absolute", n.style["background-color"] = "white", n.style.border = "1px solid #999", n.style.zIndex = "200", t.viewport.width < parseFloat(h) + 94 && (h -= 94), t.viewport.height < parseFloat(f) + 70 && (f -= 70), n.style.top = f + "px", n.style.left = h + "px"; var i = '签章验证'; e.status && 2 != window.KGPdfViewerWebApp.stampSystemOrigin ? (n.innerHTML = i + '删除签章', window.KGPdfViewerWebApp._stampOrigin = e.stampOrigin, T && e.keySN && (T.delKeySN = e.keySN, T.bSignByCalibrary = e.bSignByCalibrary), window.KGPdfViewerWebApp.scanStamp && (l.KG_ScanStamp.esid = e.esid, l.KG_ScanStamp.sealType = e.sealType), window.KGPdfViewerWebApp.isUkey && (l.KG_UkeyStamp.esid = e.esid), e.stampModel ? window.KGPdfViewerWebApp.stampModel = e.stampModel : window.KGPdfViewerWebApp.stampModel = null, u = window.KGPdfViewerWebApp.isSM ? e.sesSignatureBase64 : null) : n.innerHTML = i, t.div.appendChild(n), t.pdfViewer.app.l10n.translate(n); var a = n.querySelector(".menuVerifySeal"), o = n.querySelector(".menuDeleteSeal"); a.addEventListener("click", function (e) { e.preventDefault(), e.stopPropagation(), x(r), p() }), a.oncontextmenu = null, o && o.addEventListener("click", function (e) { e.preventDefault(), e.stopPropagation(), _(r), p() }) } }) } } } if (n.onmouseout = function (e) { k && (k.style.display = "none"), m.style.border = "1px dashed transparent" }, n.onmouseover = function (e) { m.style.border = "1px dashed black", k && (k.style.display = "block") }, "0" === window.KGPdfViewerWebApp.mobile.toString()) { if (n.addEventListener("click", x), k && k.addEventListener("click", _), window.KGPdfViewerWebApp.readOnly) return; n.oncontextmenu = P } else n.addEventListener("touchstart", function (e) { e.preventDefault(), e.stopPropagation(), window.touchstartEvent = e, window.KGPdfViewerWebApp.readOnly || (window.kgTimer = setTimeout(function () { window.kgTimer = 0, P(e) }, 500)) }), n.addEventListener("touchend", function (e) { if (e.preventDefault(), e.stopPropagation(), 0 != window.kgTimer) return clearTimeout(window.kgTimer), x(window.touchstartEvent), !1 }) } function h(e) { var t = e.password, n = e.deleteSealCallback, r = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt, i = new s.iWebAssist({cilentType: "0"}); Promise.all([i.promise]).then(function () { return i.getKeyOtherInfo() }).then(function (e) { if (!e.result) { var a = s.iWebAssistError.getKeyOtherInfo, o = e.errmsg || a[e.errcode] || "未知异常"; return window.KGPdfViewerWebApp.getTipPrompt().close(), void r.open(o) } var l = e.Res, c = l.substring(1, l.length - 1); i.verifyPin(t, c).then(function (e) { if (e.result) window.KGPdfViewerWebApp.fjrs && window.KGPdfViewerWebApp.fjrs.isFjrs ? window.KGPdfViewerWebApp.PDFViewerApplication.KG_FJRS.delKeySN = c : window.KGPdfViewerWebApp.userId = c, n && n(); else { var t = { "-1": "未安装签名组件", "-2": "待验证pin的key和当前插入的key不匹配", 1: "没有检测到用户key", 2: "非法为授权的key", 3: "没有找到key驱动文件", 4: "插入太多的key", 7: "密码错误", 8: "非法授权key", 9: "网络连接失败" }[e.errcode] || e.errmsg || "未知异常"; r.open(t) } }) }) } function p() { var e = document.getElementById("rightMenu"); e && e.parentNode.removeChild(e) } function f(e, t, n, i, a, o, s, l, u) { var d = n.pageIndex; window.KGPdfViewerWebApp.deleteSeal(d + 1, a, o, s, l, u).then(function (a) { return (0, c.closeOverlay)().then(function () { if (a.data.status) { if (window.KGPdfViewerWebApp.deleteSealSuccess && window.KGPdfViewerWebApp.deleteSealSuccess(), !1 === window.KGPdfViewerWebApp.useCaptcha) window.KGPdfViewerWebApp.getPasswordPrompt().remember("delete"); if ("OFD" === window.KGPdfViewerWebApp.fileType) !function (e, t) { function n(t) { t.renderingState !== r.RenderingStates.RUNNING && t.renderingState !== r.RenderingStates.PAUSED ? (t.deleteStampCallback = function () { var n = t.div.querySelector(".canvasWrapper"); n && t.div.removeChild(n); var i = e.pdfThumbnailViewer.getThumbnail(t.pdfPage.pageIndex); i.renderingState = r.RenderingStates.INITIAL, i.setImage(t) }, t.renderingState = r.RenderingStates.INITIAL, t.renderingQueue.renderView(t)) : t.reRenderWait = !0 } var i = e.pdfViewer, a = e.pagesCount, o = t.getAttribute("data-annotation-id"), s = t.getAttribute("data-goldGridSeal-id"); if (s) for (var l = 0; l < a; l++) { var c = i.getPageView(l), u = c.pdfPage, d = c.annotationLayer; if (null == u.delOFDSeal && (u.delOFDSeal = {}), u.reloadOperatorList = !0, null != d && d.div) { var h = d.div.querySelectorAll("section[data-goldGridSeal-id]"); if (h.length) for (var p = 0; p < h.length; p++) { var f = h[p]; f.getAttribute("data-goldGridSeal-id") === s && (u.delOFDSeal[s] = !0, d.div.removeChild(f), n(c)) } } else u.delOFDSeal[s] = !0 } else for (var m = 0; m < a; m++) { var v = i.getPageView(m), g = v.pdfPage, y = g.newStamps, b = v.annotationLayer; for (var w in y) if (y.hasOwnProperty(w)) { var S = y[w], _ = S.getAttribute("data-annotation-id"); _ === o && (delete y[w], null != b && b.div && (b.div.removeChild(S), n(v))) } } }(t, i); else { var o = a.data.delSeals; if (o) { var s = e.pdfViewer, l = i.getAttribute("data-annotation-id"); i.id ? v(o, s, l) : v(o, s) } else m(e, t, n, i) } } else { var c = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt; "密码错误" === a.data.message && window.KGPdfViewerWebApp.getPasswordPrompt().clearRememberedPwd(), c.open(a.data.message) } }) }) } function m(e, t, n, r, i) { var a = !0; if (void 0 != i && (a = i), n.newStamps[r.id]) delete n.newStamps[r.id]; else { n.delAnnotions || (n.delAnnotions = {}); var o = r.getAttribute("data-annotation-id"); n.delAnnotions[o] = !0, n.reloadOperatorList = !0 } var s = e.div; s.querySelector(".annotationLayer").removeChild(r), a && (2 != e.renderingState ? 1 != e.renderingState ? (e.deleteStampCallback = function () { var r = s.querySelector(".canvasWrapper"), i = s.querySelector(".textLayer"); r && s.removeChild(r), i && s.removeChild(i); var a = t.pdfThumbnailViewer.getThumbnail(n.pageIndex); a.renderingState = 0, a.setImage(e) }, e.renderingState = 0, e.renderingQueue.renderView(e)) : e.reRenderWait = !0 : n.reloadOperatorList && (e.reRenderWait = !0)) } function v(e, t, n) { var r = t.app; if (n) for (var i in e) { var a = i, o = t.getPageView(a), s = o.pdfPage, l = o.div.querySelector(".annotationLayer"); if (l && 0 != l.children.length) { for (var c = [], u = l.children, d = 0; d < u.length; d++) { var h = u[d]; h.getAttribute("data-annotation-id") == n && c.push(h) } for (var p = 0; p < c.length; p++) { var f = c[p]; p + 1 == c.length ? m(o, r, o.pdfPage, f) : m(o, r, o.pdfPage, f, !1) } } else { var v = s.newStamps; for (var g in v) { v[g].getAttribute("data-annotation-id") == n && delete v[g] } } } else for (var i in e) { var y = i, b = e[i], w = t.getPageView(y), S = w.pdfPage, _ = w.div.querySelector(".annotationLayer"); if (_) for (var k = 0; k < b.length; k++) for (var x = _.children, P = 0; P < x.length; P++) { var C = x[P], A = C.getAttribute("data-annotation-id"); b[k] == A && (k + 1 == b.length ? m(w, r, w.pdfPage, C) : m(w, r, w.pdfPage, C, !1)) } else { S.delAnnotions || (S.delAnnotions = {}); for (var T = 0; T < b.length; T++) { var E = b[T]; S.delAnnotions[E] = !0 } S.reloadOperatorList = !0; var D = r.pdfThumbnailViewer.getThumbnail(S.pageIndex); D.renderingState = 0, D.setImage(w) } } } t.createSealNode = function (e, t, n, r, i, a) { n.style["border-width"] = "0"; var s = document.createElement("div"), l = (0, o.getNumbOfPx)(r) - 2, c = (0, o.getNumbOfPx)(i) - 2; s.style.width = l + "px", s.style.height = c + "px", s.style.border = "1px dashed transparent", s.style.cursor = "pointer"; var u = "width:" + l + "px;height:" + c + "px"; if (a) { var h = a.data.id, p = null, f = new Promise(function (e) { p = e }), m = window.KGPdfViewerWebApp.PDFViewerApplication.KG_IWebAuth; "PDF" !== window.KGPdfViewerWebApp.fileType || m ? p({ status: !0, effectiveness: !0 }) : null != window.KGPdfViewerWebApp.externalVerifyOnLoad ? window.KGPdfViewerWebApp.externalVerifyOnLoad(p, window.KGPdfViewerWebApp.documentId, e.pageIndex + 1, h) : window.KGPdfViewerWebApp.verifySealOnLoad(e.pageIndex + 1, h, p), f.then(function (a) { if (a.status) { var o = null; o = a.effectiveness || window.KGPdfViewerWebApp.stampMask ? '' : '', "1" === window.KGPdfViewerWebApp.mobile.toString() ? s.innerHTML = o : s.innerHTML = o + "", d(e, t, n, r, i, s, !1) } else console.log("seal is not exist! id = " + h) }) } else { var v = ''; "1" === window.KGPdfViewerWebApp.mobile.toString() ? s.innerHTML = v : s.innerHTML = v + "", d(e, t, n, r, i, s) } return s }, t.removeStampMenu = p, t.deleteOneSeal = m }, function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}), t.axios = t.myaxios = void 0; var r = n(5), i = n(151), a = i.axios.create({ withCredentials: !0, headers: {"X-Requested-With": "XMLHttpRequest", "Content-Type": "application/json"} }), o = { post: function (e, t) { var n = {}; return n.promise = new Promise(function (e, t) { n.resolve = e, n.reject = t }), a.post(e, (0, r.transformData)(t)).then(function (e) { n.resolve(e) }).catch(function (e) { (0, r.closeOverlay)().then(function () { var t = window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt; null != e.response ? t.open("请求异常,状态码:" + e.response.status) : t.open("网络连接异常:" + e.message) }), n.reject() }), n.promise } }; t.myaxios = o, t.axios = i.axios }, function (e, t, n) { "use strict"; function r(e) { return new Promise(function (t, n) { var r = document.getElementById("SMObj"), i = r.WebGetKeyCount(); if (isNaN(Number(i)) || 1 !== Number(i)) Number(i) > 1 ? n({message: "插入了太多的密钥盘"}) : -1 === Number(i) ? n({message: o(r, "授权已过期")}) : n({message: o(r, "没有插入密钥盘")}); else { var a = r.WebOpenKey(0); if (a && "none" !== a && "0" !== a.toString()) { var s = r.WebKeyIsAdmin(a); if ("false" === s || !1 === s) { var l = r.WebVerifyPin(a, e); if (l && "-1" !== l.toString()) t({ SMObj: r, keyHandle: a }); else window.KGPdfViewerWebApp.getPasswordPrompt().clearRememberedPwd(), n({ message: o(r, "密钥盘密码错误,请输入正确的密码"), defaultMsg: "密钥盘密码错误" }) } else n({message: "没有检测到用户密钥盘"}) } else n({message: o(r, "开启密钥盘失败")}) } }) } function i(e, t) { e.WebCloseKey(t) } function a(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0; return new Promise(function (r, i) { var a = e.WebGetSealData(t, n); a && "none" !== a ? r(a) : i({message: o(e, "获取印章失败(印章索引:" + n + ")")}) }) } function o(e, t) { var n = e.WebGetLastErrorMsg(); return n && "none" !== n ? n : t } function s(e, t, n) { return new Promise(function (r, i) { var a = e.WebSign(t, n); a && "-1" !== a.toString() ? r(a) : i({message: o(e, "数据签名失败")}) }) } Object.defineProperty(t, "__esModule", {value: !0}), t.closeNFSKey = i, t.getNFSSeals = function (e, t, n, s) { var l = void 0, c = void 0, u = void 0, d = void 0, h = void 0; return r(e).then(function (e) { var t = e.SMObj, n = e.keyHandle; return d = t, h = n, new Promise(function (e, t) { var n = d.WebGetSealCount(h); !isNaN(Number(n)) && Number(n) >= 1 ? e(n) : t({message: o(d, "密钥盘中不存在印章")}) }) }).then(function (e) { for (var t = [], n = 0; n < e; n++) t.push(a(d, h, n)); return Promise.all(t) }).then(function (e) { if (!e || 0 === e.length) return Promise.reject({message: o(d, "获取印章失败")}); l = d.WebGetKeySerialNumber(h), c = d.WebGetCertData(h), u = d.WebGetKeyUnit(h); var n = {action: "handleCilentSeal", keySN: l, unitName: u, seals: e}; return t && t(n) }).then(function (e) { var t = e.data; n && n(t, c, l) }).catch(function (e) { var t = e.message, n = e.defaultMsg; return s && s({message: t, defaultMsg: n}), Promise.resolve() }).then(function () { return null != h && i(d, h), Promise.resolve() }) }, t.NFSSign = function (e, t, n, a, o, l) { var c = void 0, u = void 0, d = void 0; return r(e).then(function (e) { var r = e.SMObj, i = e.keyHandle; u = i; var a = (c = r).WebGetKeySerialNumber(u); if (t !== a) return Promise.reject({message: "密钥盘已更换"}); d = c.WebGetCertData(u); for (var o = [], l = 0; l < n.length; l++) o.push(s(c, u, n[l].toSignData)); return Promise.all(o) }).then(function (e) { for (var t = [], r = 0; r < e.length; r++) { var i = { signedData: e[r], cert: d, sealType: n[r].sealType, toSignData: n[r].toSignData, signDirPath: n[r].signDirPath }; t.push(a(i)) } return Promise.all(t) }).then(function () { o && o() }).catch(function (e) { var t = e.message; return l && l(t), Promise.resolve() }).then(function () { null != u && i(c, u) }) }, t.deleteNFSSeal = function (e, t, n) { var a = void 0, o = void 0; return r(e).then(function (e) { var t = e.SMObj, n = e.keyHandle; a = t, o = n }).then(function () { return t && t() }).catch(function (e) { var t = e.message; return n && n(t), Promise.resolve() }).then(function () { null != o && i(a, o) }) } }, function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}), t.getPhone = t.verifyKeySn = t.sendCaptcha = t.getFontList = void 0; var r = n(57), i = n(5), a = [{en: "Network Error", zh: "网络错误"}]; function o(e) { window.KGPdfViewerWebApp.PDFViewerApplication.KGAlertPrompt.open(e) } var s = r.axios.create({headers: {"X-Requested-With": "XMLHttpRequest", "Content-Type": "application/json"}}); s.interceptors.response.use(function (e) { return e.data && !1 === e.data.status ? ((0, i.closeOverlay)().then(function () { o(e.data.message || "程序异常,请联系管理员!") }), Promise.reject()) : e.data }, function (e) { if (e.message) { var t = a.filter(function (t) { return e.message.indexOf(t.en) > -1 })[0]; o(t ? t.zh : e.message) } else o("程序异常,请联系管理员!"); return Promise.reject(e) }), t.getFontList = function () { return s.post(window.KGPdfViewerWebApp.getDocTypeUrl(), (0, i.transformData)({ action: "getFonts", documentId: window.KGPdfViewerWebApp.documentId, docType: window.KGPdfViewerWebApp.docType })) }, t.sendCaptcha = function () { return s.post(window.KGPdfViewerWebApp.getDocTypeUrl(), (0, i.transformData)({ action: "sendCaptcha", keySN: window.KGPdfViewerWebApp.userId })) }, t.verifyKeySn = function (e) { var t = window.KGPdfViewerWebApp, n = t.userCode, r = t.isCa3, a = t.mobile, o = t.fileType; return n && r && "OFD" === o.toUpperCase() && 0 == a ? s.post(window.KGPdfViewerWebApp.getDocTypeUrl(), (0, i.transformData)({ action: "verifyKeySn", keySN: e, userCode: n })) : Promise.resolve() }, t.getPhone = function () { return s.post(window.KGPdfViewerWebApp.getDocTypeUrl(), (0, i.transformData)({ action: "getPhone", keySN: window.KGPdfViewerWebApp.userId })).then(function (e) { return e.phone }) } }, function (e, t, n) { "use strict"; (function (e) { var r, i, a, o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e }; a = function () { var t, r; function i() { return t.apply(null, arguments) } function a(e) { return e instanceof Array || "[object Array]" === Object.prototype.toString.call(e) } function s(e) { return null != e && "[object Object]" === Object.prototype.toString.call(e) } function l(e) { return void 0 === e } function c(e) { return "number" == typeof e || "[object Number]" === Object.prototype.toString.call(e) } function u(e) { return e instanceof Date || "[object Date]" === Object.prototype.toString.call(e) } function d(e, t) { var n, r = []; for (n = 0; n < e.length; ++n) r.push(t(e[n], n)); return r } function h(e, t) { return Object.prototype.hasOwnProperty.call(e, t) } function p(e, t) { for (var n in t) h(t, n) && (e[n] = t[n]); return h(t, "toString") && (e.toString = t.toString), h(t, "valueOf") && (e.valueOf = t.valueOf), e } function f(e, t, n, r) { return It(e, t, n, r, !0).utc() } function m(e) { return null == e._pf && (e._pf = { empty: !1, unusedTokens: [], unusedInput: [], overflow: -2, charsLeftOver: 0, nullInput: !1, invalidMonth: null, invalidFormat: !1, userInvalidated: !1, iso: !1, parsedDateParts: [], meridiem: null, rfc2822: !1, weekdayMismatch: !1 }), e._pf } function v(e) { if (null == e._isValid) { var t = m(e), n = r.call(t.parsedDateParts, function (e) { return null != e }), i = !isNaN(e._d.getTime()) && t.overflow < 0 && !t.empty && !t.invalidMonth && !t.invalidWeekday && !t.weekdayMismatch && !t.nullInput && !t.invalidFormat && !t.userInvalidated && (!t.meridiem || t.meridiem && n); if (e._strict && (i = i && 0 === t.charsLeftOver && 0 === t.unusedTokens.length && void 0 === t.bigHour), null != Object.isFrozen && Object.isFrozen(e)) return i; e._isValid = i } return e._isValid } function g(e) { var t = f(NaN); return null != e ? p(m(t), e) : m(t).userInvalidated = !0, t } r = Array.prototype.some ? Array.prototype.some : function (e) { for (var t = Object(this), n = t.length >>> 0, r = 0; r < n; r++) if (r in t && e.call(this, t[r], r, t)) return !0; return !1 }; var y = i.momentProperties = []; function b(e, t) { var n, r, i; if (l(t._isAMomentObject) || (e._isAMomentObject = t._isAMomentObject), l(t._i) || (e._i = t._i), l(t._f) || (e._f = t._f), l(t._l) || (e._l = t._l), l(t._strict) || (e._strict = t._strict), l(t._tzm) || (e._tzm = t._tzm), l(t._isUTC) || (e._isUTC = t._isUTC), l(t._offset) || (e._offset = t._offset), l(t._pf) || (e._pf = m(t)), l(t._locale) || (e._locale = t._locale), y.length > 0) for (n = 0; n < y.length; n++) l(i = t[r = y[n]]) || (e[r] = i); return e } var w = !1; function S(e) { b(this, e), this._d = new Date(null != e._d ? e._d.getTime() : NaN), this.isValid() || (this._d = new Date(NaN)), !1 === w && (w = !0, i.updateOffset(this), w = !1) } function _(e) { return e instanceof S || null != e && null != e._isAMomentObject } function k(e) { return e < 0 ? Math.ceil(e) || 0 : Math.floor(e) } function x(e) { var t = +e, n = 0; return 0 !== t && isFinite(t) && (n = k(t)), n } function P(e, t, n) { var r, i = Math.min(e.length, t.length), a = Math.abs(e.length - t.length), o = 0; for (r = 0; r < i; r++) (n && e[r] !== t[r] || !n && x(e[r]) !== x(t[r])) && o++; return o + a } function C(e) { !1 === i.suppressDeprecationWarnings && "undefined" != typeof console && console.warn && console.warn("Deprecation warning: " + e) } function A(e, t) { var n = !0; return p(function () { if (null != i.deprecationHandler && i.deprecationHandler(null, e), n) { for (var r, a = [], s = 0; s < arguments.length; s++) { if (r = "", "object" === o(arguments[s])) { for (var l in r += "\n[" + s + "] ", arguments[0]) r += l + ": " + arguments[0][l] + ", "; r = r.slice(0, -2) } else r = arguments[s]; a.push(r) } C(e + "\nArguments: " + Array.prototype.slice.call(a).join("") + "\n" + (new Error).stack), n = !1 } return t.apply(this, arguments) }, t) } var T, E = {}; function D(e, t) { null != i.deprecationHandler && i.deprecationHandler(e, t), E[e] || (C(t), E[e] = !0) } function I(e) { return e instanceof Function || "[object Function]" === Object.prototype.toString.call(e) } function L(e, t) { var n, r = p({}, e); for (n in t) h(t, n) && (s(e[n]) && s(t[n]) ? (r[n] = {}, p(r[n], e[n]), p(r[n], t[n])) : null != t[n] ? r[n] = t[n] : delete r[n]); for (n in e) h(e, n) && !h(t, n) && s(e[n]) && (r[n] = p({}, r[n])); return r } function O(e) { null != e && this.set(e) } i.suppressDeprecationWarnings = !1, i.deprecationHandler = null, T = Object.keys ? Object.keys : function (e) { var t, n = []; for (t in e) h(e, t) && n.push(t); return n }; var M = {}; function N(e, t) { var n = e.toLowerCase(); M[n] = M[n + "s"] = M[t] = e } function R(e) { return "string" == typeof e ? M[e] || M[e.toLowerCase()] : void 0 } function W(e) { var t, n, r = {}; for (n in e) h(e, n) && (t = R(n)) && (r[t] = e[n]); return r } var V = {}; function F(e, t) { V[e] = t } function G(e, t, n) { var r = "" + Math.abs(e), i = t - r.length; return (e >= 0 ? n ? "+" : "" : "-") + Math.pow(10, Math.max(0, i)).toString().substr(1) + r } var B = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, K = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, j = {}, z = {}; function U(e, t, n, r) { var i = r; "string" == typeof r && (i = function () { return this[r]() }), e && (z[e] = i), t && (z[t[0]] = function () { return G(i.apply(this, arguments), t[1], t[2]) }), n && (z[n] = function () { return this.localeData().ordinal(i.apply(this, arguments), e) }) } function q(e, t) { return e.isValid() ? (t = H(t, e.localeData()), j[t] = j[t] || function (e) { var t, n, r, i = e.match(B); for (t = 0, n = i.length; t < n; t++) z[i[t]] ? i[t] = z[i[t]] : i[t] = (r = i[t]).match(/\[[\s\S]/) ? r.replace(/^\[|\]$/g, "") : r.replace(/\\/g, ""); return function (t) { var r, a = ""; for (r = 0; r < n; r++) a += I(i[r]) ? i[r].call(t, e) : i[r]; return a } }(t), j[t](e)) : e.localeData().invalidDate() } function H(e, t) { var n = 5; function r(e) { return t.longDateFormat(e) || e } for (K.lastIndex = 0; n >= 0 && K.test(e);) e = e.replace(K, r), K.lastIndex = 0, n -= 1; return e } var Y = /\d/, X = /\d\d/, J = /\d{3}/, Q = /\d{4}/, $ = /[+-]?\d{6}/, Z = /\d\d?/, ee = /\d\d\d\d?/, te = /\d\d\d\d\d\d?/, ne = /\d{1,3}/, re = /\d{1,4}/, ie = /[+-]?\d{1,6}/, ae = /\d+/, oe = /[+-]?\d+/, se = /Z|[+-]\d\d:?\d\d/gi, le = /Z|[+-]\d\d(?::?\d\d)?/gi, ce = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, ue = {}; function de(e, t, n) { ue[e] = I(t) ? t : function (e, r) { return e && n ? n : t } } function he(e, t) { return h(ue, e) ? ue[e](t._strict, t._locale) : new RegExp(pe(e.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (e, t, n, r, i) { return t || n || r || i }))) } function pe(e) { return e.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&") } var fe = {}; function me(e, t) { var n, r = t; for ("string" == typeof e && (e = [e]), c(t) && (r = function (e, n) { n[t] = x(e) }), n = 0; n < e.length; n++) fe[e[n]] = r } function ve(e, t) { me(e, function (e, n, r, i) { r._w = r._w || {}, t(e, r._w, r, i) }) } function ge(e, t, n) { null != t && h(fe, e) && fe[e](t, n._a, n, e) } var ye = 0, be = 1, we = 2, Se = 3, _e = 4, ke = 5, xe = 6, Pe = 7, Ce = 8; function Ae(e) { return Te(e) ? 366 : 365 } function Te(e) { return e % 4 == 0 && e % 100 != 0 || e % 400 == 0 } U("Y", 0, 0, function () { var e = this.year(); return e <= 9999 ? "" + e : "+" + e }), U(0, ["YY", 2], 0, function () { return this.year() % 100 }), U(0, ["YYYY", 4], 0, "year"), U(0, ["YYYYY", 5], 0, "year"), U(0, ["YYYYYY", 6, !0], 0, "year"), N("year", "y"), F("year", 1), de("Y", oe), de("YY", Z, X), de("YYYY", re, Q), de("YYYYY", ie, $), de("YYYYYY", ie, $), me(["YYYYY", "YYYYYY"], ye), me("YYYY", function (e, t) { t[ye] = 2 === e.length ? i.parseTwoDigitYear(e) : x(e) }), me("YY", function (e, t) { t[ye] = i.parseTwoDigitYear(e) }), me("Y", function (e, t) { t[ye] = parseInt(e, 10) }), i.parseTwoDigitYear = function (e) { return x(e) + (x(e) > 68 ? 1900 : 2e3) }; var Ee, De = Ie("FullYear", !0); function Ie(e, t) { return function (n) { return null != n ? (Oe(this, e, n), i.updateOffset(this, t), this) : Le(this, e) } } function Le(e, t) { return e.isValid() ? e._d["get" + (e._isUTC ? "UTC" : "") + t]() : NaN } function Oe(e, t, n) { e.isValid() && !isNaN(n) && ("FullYear" === t && Te(e.year()) && 1 === e.month() && 29 === e.date() ? e._d["set" + (e._isUTC ? "UTC" : "") + t](n, e.month(), Me(n, e.month())) : e._d["set" + (e._isUTC ? "UTC" : "") + t](n)) } function Me(e, t) { if (isNaN(e) || isNaN(t)) return NaN; var n, r = (t % (n = 12) + n) % n; return e += (t - r) / 12, 1 === r ? Te(e) ? 29 : 28 : 31 - r % 7 % 2 } Ee = Array.prototype.indexOf ? Array.prototype.indexOf : function (e) { var t; for (t = 0; t < this.length; ++t) if (this[t] === e) return t; return -1 }, U("M", ["MM", 2], "Mo", function () { return this.month() + 1 }), U("MMM", 0, 0, function (e) { return this.localeData().monthsShort(this, e) }), U("MMMM", 0, 0, function (e) { return this.localeData().months(this, e) }), N("month", "M"), F("month", 8), de("M", Z), de("MM", Z, X), de("MMM", function (e, t) { return t.monthsShortRegex(e) }), de("MMMM", function (e, t) { return t.monthsRegex(e) }), me(["M", "MM"], function (e, t) { t[be] = x(e) - 1 }), me(["MMM", "MMMM"], function (e, t, n, r) { var i = n._locale.monthsParse(e, r, n._strict); null != i ? t[be] = i : m(n).invalidMonth = e }); var Ne = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, Re = "January_February_March_April_May_June_July_August_September_October_November_December".split("_"); var We = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"); function Ve(e, t) { var n; if (!e.isValid()) return e; if ("string" == typeof t) if (/^\d+$/.test(t)) t = x(t); else if (!c(t = e.localeData().monthsParse(t))) return e; return n = Math.min(e.date(), Me(e.year(), t)), e._d["set" + (e._isUTC ? "UTC" : "") + "Month"](t, n), e } function Fe(e) { return null != e ? (Ve(this, e), i.updateOffset(this, !0), this) : Le(this, "Month") } var Ge = ce; var Be = ce; function Ke() { function e(e, t) { return t.length - e.length } var t, n, r = [], i = [], a = []; for (t = 0; t < 12; t++) n = f([2e3, t]), r.push(this.monthsShort(n, "")), i.push(this.months(n, "")), a.push(this.months(n, "")), a.push(this.monthsShort(n, "")); for (r.sort(e), i.sort(e), a.sort(e), t = 0; t < 12; t++) r[t] = pe(r[t]), i[t] = pe(i[t]); for (t = 0; t < 24; t++) a[t] = pe(a[t]); this._monthsRegex = new RegExp("^(" + a.join("|") + ")", "i"), this._monthsShortRegex = this._monthsRegex, this._monthsStrictRegex = new RegExp("^(" + i.join("|") + ")", "i"), this._monthsShortStrictRegex = new RegExp("^(" + r.join("|") + ")", "i") } function je(e) { var t; if (e < 100 && e >= 0) { var n = Array.prototype.slice.call(arguments); n[0] = e + 400, t = new Date(Date.UTC.apply(null, n)), isFinite(t.getUTCFullYear()) && t.setUTCFullYear(e) } else t = new Date(Date.UTC.apply(null, arguments)); return t } function ze(e, t, n) { var r = 7 + t - n; return -((7 + je(e, 0, r).getUTCDay() - t) % 7) + r - 1 } function Ue(e, t, n, r, i) { var a, o, s = 1 + 7 * (t - 1) + (7 + n - r) % 7 + ze(e, r, i); return s <= 0 ? o = Ae(a = e - 1) + s : s > Ae(e) ? (a = e + 1, o = s - Ae(e)) : (a = e, o = s), { year: a, dayOfYear: o } } function qe(e, t, n) { var r, i, a = ze(e.year(), t, n), o = Math.floor((e.dayOfYear() - a - 1) / 7) + 1; return o < 1 ? r = o + He(i = e.year() - 1, t, n) : o > He(e.year(), t, n) ? (r = o - He(e.year(), t, n), i = e.year() + 1) : (i = e.year(), r = o), { week: r, year: i } } function He(e, t, n) { var r = ze(e, t, n), i = ze(e + 1, t, n); return (Ae(e) - r + i) / 7 } U("w", ["ww", 2], "wo", "week"), U("W", ["WW", 2], "Wo", "isoWeek"), N("week", "w"), N("isoWeek", "W"), F("week", 5), F("isoWeek", 5), de("w", Z), de("ww", Z, X), de("W", Z), de("WW", Z, X), ve(["w", "ww", "W", "WW"], function (e, t, n, r) { t[r.substr(0, 1)] = x(e) }); function Ye(e, t) { return e.slice(t, 7).concat(e.slice(0, t)) } U("d", 0, "do", "day"), U("dd", 0, 0, function (e) { return this.localeData().weekdaysMin(this, e) }), U("ddd", 0, 0, function (e) { return this.localeData().weekdaysShort(this, e) }), U("dddd", 0, 0, function (e) { return this.localeData().weekdays(this, e) }), U("e", 0, 0, "weekday"), U("E", 0, 0, "isoWeekday"), N("day", "d"), N("weekday", "e"), N("isoWeekday", "E"), F("day", 11), F("weekday", 11), F("isoWeekday", 11), de("d", Z), de("e", Z), de("E", Z), de("dd", function (e, t) { return t.weekdaysMinRegex(e) }), de("ddd", function (e, t) { return t.weekdaysShortRegex(e) }), de("dddd", function (e, t) { return t.weekdaysRegex(e) }), ve(["dd", "ddd", "dddd"], function (e, t, n, r) { var i = n._locale.weekdaysParse(e, r, n._strict); null != i ? t.d = i : m(n).invalidWeekday = e }), ve(["d", "e", "E"], function (e, t, n, r) { t[r] = x(e) }); var Xe = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"); var Je = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"); var Qe = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"); var $e = ce; var Ze = ce; var et = ce; function tt() { function e(e, t) { return t.length - e.length } var t, n, r, i, a, o = [], s = [], l = [], c = []; for (t = 0; t < 7; t++) n = f([2e3, 1]).day(t), r = this.weekdaysMin(n, ""), i = this.weekdaysShort(n, ""), a = this.weekdays(n, ""), o.push(r), s.push(i), l.push(a), c.push(r), c.push(i), c.push(a); for (o.sort(e), s.sort(e), l.sort(e), c.sort(e), t = 0; t < 7; t++) s[t] = pe(s[t]), l[t] = pe(l[t]), c[t] = pe(c[t]); this._weekdaysRegex = new RegExp("^(" + c.join("|") + ")", "i"), this._weekdaysShortRegex = this._weekdaysRegex, this._weekdaysMinRegex = this._weekdaysRegex, this._weekdaysStrictRegex = new RegExp("^(" + l.join("|") + ")", "i"), this._weekdaysShortStrictRegex = new RegExp("^(" + s.join("|") + ")", "i"), this._weekdaysMinStrictRegex = new RegExp("^(" + o.join("|") + ")", "i") } function nt() { return this.hours() % 12 || 12 } function rt(e, t) { U(e, 0, 0, function () { return this.localeData().meridiem(this.hours(), this.minutes(), t) }) } function it(e, t) { return t._meridiemParse } U("H", ["HH", 2], 0, "hour"), U("h", ["hh", 2], 0, nt), U("k", ["kk", 2], 0, function () { return this.hours() || 24 }), U("hmm", 0, 0, function () { return "" + nt.apply(this) + G(this.minutes(), 2) }), U("hmmss", 0, 0, function () { return "" + nt.apply(this) + G(this.minutes(), 2) + G(this.seconds(), 2) }), U("Hmm", 0, 0, function () { return "" + this.hours() + G(this.minutes(), 2) }), U("Hmmss", 0, 0, function () { return "" + this.hours() + G(this.minutes(), 2) + G(this.seconds(), 2) }), rt("a", !0), rt("A", !1), N("hour", "h"), F("hour", 13), de("a", it), de("A", it), de("H", Z), de("h", Z), de("k", Z), de("HH", Z, X), de("hh", Z, X), de("kk", Z, X), de("hmm", ee), de("hmmss", te), de("Hmm", ee), de("Hmmss", te), me(["H", "HH"], Se), me(["k", "kk"], function (e, t, n) { var r = x(e); t[Se] = 24 === r ? 0 : r }), me(["a", "A"], function (e, t, n) { n._isPm = n._locale.isPM(e), n._meridiem = e }), me(["h", "hh"], function (e, t, n) { t[Se] = x(e), m(n).bigHour = !0 }), me("hmm", function (e, t, n) { var r = e.length - 2; t[Se] = x(e.substr(0, r)), t[_e] = x(e.substr(r)), m(n).bigHour = !0 }), me("hmmss", function (e, t, n) { var r = e.length - 4, i = e.length - 2; t[Se] = x(e.substr(0, r)), t[_e] = x(e.substr(r, 2)), t[ke] = x(e.substr(i)), m(n).bigHour = !0 }), me("Hmm", function (e, t, n) { var r = e.length - 2; t[Se] = x(e.substr(0, r)), t[_e] = x(e.substr(r)) }), me("Hmmss", function (e, t, n) { var r = e.length - 4, i = e.length - 2; t[Se] = x(e.substr(0, r)), t[_e] = x(e.substr(r, 2)), t[ke] = x(e.substr(i)) }); var at, ot = Ie("Hours", !0), st = { calendar: { sameDay: "[Today at] LT", nextDay: "[Tomorrow at] LT", nextWeek: "dddd [at] LT", lastDay: "[Yesterday at] LT", lastWeek: "[Last] dddd [at] LT", sameElse: "L" }, longDateFormat: { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, invalidDate: "Invalid date", ordinal: "%d", dayOfMonthOrdinalParse: /\d{1,2}/, relativeTime: { future: "in %s", past: "%s ago", s: "a few seconds", ss: "%d seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" }, months: Re, monthsShort: We, week: {dow: 0, doy: 6}, weekdays: Xe, weekdaysMin: Qe, weekdaysShort: Je, meridiemParse: /[ap]\.?m?\.?/i }, lt = {}, ct = {}; function ut(e) { return e ? e.toLowerCase().replace("_", "-") : e } function dt(t) { var r = null; if (!lt[t] && void 0 !== e && e && e.exports) try { r = at._abbr; n(157), ht(r) } catch (e) { } return lt[t] } function ht(e, t) { var n; return e && ((n = l(t) ? ft(e) : pt(e, t)) ? at = n : "undefined" != typeof console && console.warn && console.warn("Locale " + e + " not found. Did you forget to load it?")), at._abbr } function pt(e, t) { if (null !== t) { var n, r = st; if (t.abbr = e, null != lt[e]) D("defineLocaleOverride", "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."), r = lt[e]._config; else if (null != t.parentLocale) if (null != lt[t.parentLocale]) r = lt[t.parentLocale]._config; else { if (null == (n = dt(t.parentLocale))) return ct[t.parentLocale] || (ct[t.parentLocale] = []), ct[t.parentLocale].push({ name: e, config: t }), null; r = n._config } return lt[e] = new O(L(r, t)), ct[e] && ct[e].forEach(function (e) { pt(e.name, e.config) }), ht(e), lt[e] } return delete lt[e], null } function ft(e) { var t; if (e && e._locale && e._locale._abbr && (e = e._locale._abbr), !e) return at; if (!a(e)) { if (t = dt(e)) return t; e = [e] } return function (e) { for (var t, n, r, i, a = 0; a < e.length;) { for (t = (i = ut(e[a]).split("-")).length, n = (n = ut(e[a + 1])) ? n.split("-") : null; t > 0;) { if (r = dt(i.slice(0, t).join("-"))) return r; if (n && n.length >= t && P(i, n, !0) >= t - 1) break; t-- } a++ } return at }(e) } function mt(e) { var t, n = e._a; return n && -2 === m(e).overflow && (t = n[be] < 0 || n[be] > 11 ? be : n[we] < 1 || n[we] > Me(n[ye], n[be]) ? we : n[Se] < 0 || n[Se] > 24 || 24 === n[Se] && (0 !== n[_e] || 0 !== n[ke] || 0 !== n[xe]) ? Se : n[_e] < 0 || n[_e] > 59 ? _e : n[ke] < 0 || n[ke] > 59 ? ke : n[xe] < 0 || n[xe] > 999 ? xe : -1, m(e)._overflowDayOfYear && (t < ye || t > we) && (t = we), m(e)._overflowWeeks && -1 === t && (t = Pe), m(e)._overflowWeekday && -1 === t && (t = Ce), m(e).overflow = t), e } function vt(e, t, n) { return null != e ? e : null != t ? t : n } function gt(e) { var t, n, r, a, o, s = []; if (!e._d) { for (r = function (e) { var t = new Date(i.now()); return e._useUTC ? [t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()] : [t.getFullYear(), t.getMonth(), t.getDate()] }(e), e._w && null == e._a[we] && null == e._a[be] && function (e) { var t, n, r, i, a, o, s, l; if (null != (t = e._w).GG || null != t.W || null != t.E) a = 1, o = 4, n = vt(t.GG, e._a[ye], qe(Lt(), 1, 4).year), r = vt(t.W, 1), ((i = vt(t.E, 1)) < 1 || i > 7) && (l = !0); else { a = e._locale._week.dow, o = e._locale._week.doy; var c = qe(Lt(), a, o); n = vt(t.gg, e._a[ye], c.year), r = vt(t.w, c.week), null != t.d ? ((i = t.d) < 0 || i > 6) && (l = !0) : null != t.e ? (i = t.e + a, (t.e < 0 || t.e > 6) && (l = !0)) : i = a } r < 1 || r > He(n, a, o) ? m(e)._overflowWeeks = !0 : null != l ? m(e)._overflowWeekday = !0 : (s = Ue(n, r, i, a, o), e._a[ye] = s.year, e._dayOfYear = s.dayOfYear) }(e), null != e._dayOfYear && (o = vt(e._a[ye], r[ye]), (e._dayOfYear > Ae(o) || 0 === e._dayOfYear) && (m(e)._overflowDayOfYear = !0), n = je(o, 0, e._dayOfYear), e._a[be] = n.getUTCMonth(), e._a[we] = n.getUTCDate()), t = 0; t < 3 && null == e._a[t]; ++t) e._a[t] = s[t] = r[t]; for (; t < 7; t++) e._a[t] = s[t] = null == e._a[t] ? 2 === t ? 1 : 0 : e._a[t]; 24 === e._a[Se] && 0 === e._a[_e] && 0 === e._a[ke] && 0 === e._a[xe] && (e._nextDay = !0, e._a[Se] = 0), e._d = (e._useUTC ? je : function (e, t, n, r, i, a, o) { var s; return e < 100 && e >= 0 ? (s = new Date(e + 400, t, n, r, i, a, o), isFinite(s.getFullYear()) && s.setFullYear(e)) : s = new Date(e, t, n, r, i, a, o), s }).apply(null, s), a = e._useUTC ? e._d.getUTCDay() : e._d.getDay(), null != e._tzm && e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), e._nextDay && (e._a[Se] = 24), e._w && void 0 !== e._w.d && e._w.d !== a && (m(e).weekdayMismatch = !0) } } var yt = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/, bt = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/, wt = /Z|[+-]\d\d(?::?\d\d)?/, St = [["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/], ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/], ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/], ["GGGG-[W]WW", /\d{4}-W\d\d/, !1], ["YYYY-DDD", /\d{4}-\d{3}/], ["YYYY-MM", /\d{4}-\d\d/, !1], ["YYYYYYMMDD", /[+-]\d{10}/], ["YYYYMMDD", /\d{8}/], ["GGGG[W]WWE", /\d{4}W\d{3}/], ["GGGG[W]WW", /\d{4}W\d{2}/, !1], ["YYYYDDD", /\d{7}/]], _t = [["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/], ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/], ["HH:mm:ss", /\d\d:\d\d:\d\d/], ["HH:mm", /\d\d:\d\d/], ["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/], ["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/], ["HHmmss", /\d\d\d\d\d\d/], ["HHmm", /\d\d\d\d/], ["HH", /\d\d/]], kt = /^\/?Date\((\-?\d+)/i; function xt(e) { var t, n, r, i, a, o, s = e._i, l = yt.exec(s) || bt.exec(s); if (l) { for (m(e).iso = !0, t = 0, n = St.length; t < n; t++) if (St[t][1].exec(l[1])) { i = St[t][0], r = !1 !== St[t][2]; break } if (null == i) return void (e._isValid = !1); if (l[3]) { for (t = 0, n = _t.length; t < n; t++) if (_t[t][1].exec(l[3])) { a = (l[2] || " ") + _t[t][0]; break } if (null == a) return void (e._isValid = !1) } if (!r && null != a) return void (e._isValid = !1); if (l[4]) { if (!wt.exec(l[4])) return void (e._isValid = !1); o = "Z" } e._f = i + (a || "") + (o || ""), Et(e) } else e._isValid = !1 } var Pt = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/; function Ct(e, t, n, r, i, a) { var o = [function (e) { var t = parseInt(e, 10); if (t <= 49) return 2e3 + t; if (t <= 999) return 1900 + t; return t }(e), We.indexOf(t), parseInt(n, 10), parseInt(r, 10), parseInt(i, 10)]; return a && o.push(parseInt(a, 10)), o } var At = { UT: 0, GMT: 0, EDT: -240, EST: -300, CDT: -300, CST: -360, MDT: -360, MST: -420, PDT: -420, PST: -480 }; function Tt(e) { var t = Pt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "")); if (t) { var n = Ct(t[4], t[3], t[2], t[5], t[6], t[7]); if (!function (e, t, n) { return !e || Je.indexOf(e) === new Date(t[0], t[1], t[2]).getDay() || (m(n).weekdayMismatch = !0, n._isValid = !1, !1) }(t[1], n, e)) return; e._a = n, e._tzm = function (e, t, n) { if (e) return At[e]; if (t) return 0; var r = parseInt(n, 10), i = r % 100; return (r - i) / 100 * 60 + i }(t[8], t[9], t[10]), e._d = je.apply(null, e._a), e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), m(e).rfc2822 = !0 } else e._isValid = !1 } function Et(e) { if (e._f !== i.ISO_8601) if (e._f !== i.RFC_2822) { e._a = [], m(e).empty = !0; var t, n, r, a, o, s = "" + e._i, l = s.length, c = 0; for (r = H(e._f, e._locale).match(B) || [], t = 0; t < r.length; t++) a = r[t], (n = (s.match(he(a, e)) || [])[0]) && ((o = s.substr(0, s.indexOf(n))).length > 0 && m(e).unusedInput.push(o), s = s.slice(s.indexOf(n) + n.length), c += n.length), z[a] ? (n ? m(e).empty = !1 : m(e).unusedTokens.push(a), ge(a, n, e)) : e._strict && !n && m(e).unusedTokens.push(a); m(e).charsLeftOver = l - c, s.length > 0 && m(e).unusedInput.push(s), e._a[Se] <= 12 && !0 === m(e).bigHour && e._a[Se] > 0 && (m(e).bigHour = void 0), m(e).parsedDateParts = e._a.slice(0), m(e).meridiem = e._meridiem, e._a[Se] = function (e, t, n) { var r; if (null == n) return t; return null != e.meridiemHour ? e.meridiemHour(t, n) : null != e.isPM ? ((r = e.isPM(n)) && t < 12 && (t += 12), r || 12 !== t || (t = 0), t) : t }(e._locale, e._a[Se], e._meridiem), gt(e), mt(e) } else Tt(e); else xt(e) } function Dt(e) { var t = e._i, n = e._f; return e._locale = e._locale || ft(e._l), null === t || void 0 === n && "" === t ? g({nullInput: !0}) : ("string" == typeof t && (e._i = t = e._locale.preparse(t)), _(t) ? new S(mt(t)) : (u(t) ? e._d = t : a(n) ? function (e) { var t, n, r, i, a; if (0 === e._f.length) return m(e).invalidFormat = !0, void (e._d = new Date(NaN)); for (i = 0; i < e._f.length; i++) a = 0, t = b({}, e), null != e._useUTC && (t._useUTC = e._useUTC), t._f = e._f[i], Et(t), v(t) && (a += m(t).charsLeftOver, a += 10 * m(t).unusedTokens.length, m(t).score = a, (null == r || a < r) && (r = a, n = t)); p(e, n || t) }(e) : n ? Et(e) : function (e) { var t = e._i; l(t) ? e._d = new Date(i.now()) : u(t) ? e._d = new Date(t.valueOf()) : "string" == typeof t ? function (e) { var t = kt.exec(e._i); null === t ? (xt(e), !1 === e._isValid && (delete e._isValid, Tt(e), !1 === e._isValid && (delete e._isValid, i.createFromInputFallback(e)))) : e._d = new Date(+t[1]) }(e) : a(t) ? (e._a = d(t.slice(0), function (e) { return parseInt(e, 10) }), gt(e)) : s(t) ? function (e) { if (!e._d) { var t = W(e._i); e._a = d([t.year, t.month, t.day || t.date, t.hour, t.minute, t.second, t.millisecond], function (e) { return e && parseInt(e, 10) }), gt(e) } }(e) : c(t) ? e._d = new Date(t) : i.createFromInputFallback(e) }(e), v(e) || (e._d = null), e)) } function It(e, t, n, r, i) { var o, l = {}; return !0 !== n && !1 !== n || (r = n, n = void 0), (s(e) && function (e) { if (Object.getOwnPropertyNames) return 0 === Object.getOwnPropertyNames(e).length; var t; for (t in e) if (e.hasOwnProperty(t)) return !1; return !0 }(e) || a(e) && 0 === e.length) && (e = void 0), l._isAMomentObject = !0, l._useUTC = l._isUTC = i, l._l = n, l._i = e, l._f = t, l._strict = r, (o = new S(mt(Dt(l))))._nextDay && (o.add(1, "d"), o._nextDay = void 0), o } function Lt(e, t, n, r) { return It(e, t, n, r, !1) } i.createFromInputFallback = A("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.", function (e) { e._d = new Date(e._i + (e._useUTC ? " UTC" : "")) }), i.ISO_8601 = function () { }, i.RFC_2822 = function () { }; var Ot = A("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/", function () { var e = Lt.apply(null, arguments); return this.isValid() && e.isValid() ? e < this ? this : e : g() }), Mt = A("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/", function () { var e = Lt.apply(null, arguments); return this.isValid() && e.isValid() ? e > this ? this : e : g() }); function Nt(e, t) { var n, r; if (1 === t.length && a(t[0]) && (t = t[0]), !t.length) return Lt(); for (n = t[0], r = 1; r < t.length; ++r) t[r].isValid() && !t[r][e](n) || (n = t[r]); return n } var Rt = ["year", "quarter", "month", "week", "day", "hour", "minute", "second", "millisecond"]; function Wt(e) { var t = W(e), n = t.year || 0, r = t.quarter || 0, i = t.month || 0, a = t.week || t.isoWeek || 0, o = t.day || 0, s = t.hour || 0, l = t.minute || 0, c = t.second || 0, u = t.millisecond || 0; this._isValid = function (e) { for (var t in e) if (-1 === Ee.call(Rt, t) || null != e[t] && isNaN(e[t])) return !1; for (var n = !1, r = 0; r < Rt.length; ++r) if (e[Rt[r]]) { if (n) return !1; parseFloat(e[Rt[r]]) !== x(e[Rt[r]]) && (n = !0) } return !0 }(t), this._milliseconds = +u + 1e3 * c + 6e4 * l + 1e3 * s * 60 * 60, this._days = +o + 7 * a, this._months = +i + 3 * r + 12 * n, this._data = {}, this._locale = ft(), this._bubble() } function Vt(e) { return e instanceof Wt } function Ft(e) { return e < 0 ? -1 * Math.round(-1 * e) : Math.round(e) } function Gt(e, t) { U(e, 0, 0, function () { var e = this.utcOffset(), n = "+"; return e < 0 && (e = -e, n = "-"), n + G(~~(e / 60), 2) + t + G(~~e % 60, 2) }) } Gt("Z", ":"), Gt("ZZ", ""), de("Z", le), de("ZZ", le), me(["Z", "ZZ"], function (e, t, n) { n._useUTC = !0, n._tzm = Kt(le, e) }); var Bt = /([\+\-]|\d\d)/gi; function Kt(e, t) { var n = (t || "").match(e); if (null === n) return null; var r = ((n[n.length - 1] || []) + "").match(Bt) || ["-", 0, 0], i = 60 * r[1] + x(r[2]); return 0 === i ? 0 : "+" === r[0] ? i : -i } function jt(e, t) { var n, r; return t._isUTC ? (n = t.clone(), r = (_(e) || u(e) ? e.valueOf() : Lt(e).valueOf()) - n.valueOf(), n._d.setTime(n._d.valueOf() + r), i.updateOffset(n, !1), n) : Lt(e).local() } function zt(e) { return 15 * -Math.round(e._d.getTimezoneOffset() / 15) } function Ut() { return !!this.isValid() && (this._isUTC && 0 === this._offset) } i.updateOffset = function () { }; var qt = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/, Ht = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; function Yt(e, t) { var n, r, i, a = e, s = null; return Vt(e) ? a = { ms: e._milliseconds, d: e._days, M: e._months } : c(e) ? (a = {}, t ? a[t] = e : a.milliseconds = e) : (s = qt.exec(e)) ? (n = "-" === s[1] ? -1 : 1, a = { y: 0, d: x(s[we]) * n, h: x(s[Se]) * n, m: x(s[_e]) * n, s: x(s[ke]) * n, ms: x(Ft(1e3 * s[xe])) * n }) : (s = Ht.exec(e)) ? (n = "-" === s[1] ? -1 : 1, a = { y: Xt(s[2], n), M: Xt(s[3], n), w: Xt(s[4], n), d: Xt(s[5], n), h: Xt(s[6], n), m: Xt(s[7], n), s: Xt(s[8], n) }) : null == a ? a = {} : "object" === (void 0 === a ? "undefined" : o(a)) && ("from" in a || "to" in a) && (i = function (e, t) { var n; if (!e.isValid() || !t.isValid()) return {milliseconds: 0, months: 0}; t = jt(t, e), e.isBefore(t) ? n = Jt(e, t) : ((n = Jt(t, e)).milliseconds = -n.milliseconds, n.months = -n.months); return n }(Lt(a.from), Lt(a.to)), (a = {}).ms = i.milliseconds, a.M = i.months), r = new Wt(a), Vt(e) && h(e, "_locale") && (r._locale = e._locale), r } function Xt(e, t) { var n = e && parseFloat(e.replace(",", ".")); return (isNaN(n) ? 0 : n) * t } function Jt(e, t) { var n = {}; return n.months = t.month() - e.month() + 12 * (t.year() - e.year()), e.clone().add(n.months, "M").isAfter(t) && --n.months, n.milliseconds = +t - +e.clone().add(n.months, "M"), n } function Qt(e, t) { return function (n, r) { var i; return null === r || isNaN(+r) || (D(t, "moment()." + t + "(period, number) is deprecated. Please use moment()." + t + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."), i = n, n = r, r = i), $t(this, Yt(n = "string" == typeof n ? +n : n, r), e), this } } function $t(e, t, n, r) { var a = t._milliseconds, o = Ft(t._days), s = Ft(t._months); e.isValid() && (r = null == r || r, s && Ve(e, Le(e, "Month") + s * n), o && Oe(e, "Date", Le(e, "Date") + o * n), a && e._d.setTime(e._d.valueOf() + a * n), r && i.updateOffset(e, o || s)) } Yt.fn = Wt.prototype, Yt.invalid = function () { return Yt(NaN) }; var Zt = Qt(1, "add"), en = Qt(-1, "subtract"); function tn(e, t) { var n = 12 * (t.year() - e.year()) + (t.month() - e.month()), r = e.clone().add(n, "months"); return -(n + (t - r < 0 ? (t - r) / (r - e.clone().add(n - 1, "months")) : (t - r) / (e.clone().add(n + 1, "months") - r))) || 0 } function nn(e) { var t; return void 0 === e ? this._locale._abbr : (null != (t = ft(e)) && (this._locale = t), this) } i.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ", i.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]"; var rn = A("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.", function (e) { return void 0 === e ? this.localeData() : this.locale(e) }); function an() { return this._locale } var on = 1e3, sn = 60 * on, ln = 60 * sn, cn = 3506328 * ln; function un(e, t) { return (e % t + t) % t } function dn(e, t, n) { return e < 100 && e >= 0 ? new Date(e + 400, t, n) - cn : new Date(e, t, n).valueOf() } function hn(e, t, n) { return e < 100 && e >= 0 ? Date.UTC(e + 400, t, n) - cn : Date.UTC(e, t, n) } function pn(e, t) { U(0, [e, e.length], 0, t) } function fn(e, t, n, r, i) { var a; return null == e ? qe(this, r, i).year : (t > (a = He(e, r, i)) && (t = a), function (e, t, n, r, i) { var a = Ue(e, t, n, r, i), o = je(a.year, 0, a.dayOfYear); return this.year(o.getUTCFullYear()), this.month(o.getUTCMonth()), this.date(o.getUTCDate()), this }.call(this, e, t, n, r, i)) } U(0, ["gg", 2], 0, function () { return this.weekYear() % 100 }), U(0, ["GG", 2], 0, function () { return this.isoWeekYear() % 100 }), pn("gggg", "weekYear"), pn("ggggg", "weekYear"), pn("GGGG", "isoWeekYear"), pn("GGGGG", "isoWeekYear"), N("weekYear", "gg"), N("isoWeekYear", "GG"), F("weekYear", 1), F("isoWeekYear", 1), de("G", oe), de("g", oe), de("GG", Z, X), de("gg", Z, X), de("GGGG", re, Q), de("gggg", re, Q), de("GGGGG", ie, $), de("ggggg", ie, $), ve(["gggg", "ggggg", "GGGG", "GGGGG"], function (e, t, n, r) { t[r.substr(0, 2)] = x(e) }), ve(["gg", "GG"], function (e, t, n, r) { t[r] = i.parseTwoDigitYear(e) }), U("Q", 0, "Qo", "quarter"), N("quarter", "Q"), F("quarter", 7), de("Q", Y), me("Q", function (e, t) { t[be] = 3 * (x(e) - 1) }), U("D", ["DD", 2], "Do", "date"), N("date", "D"), F("date", 9), de("D", Z), de("DD", Z, X), de("Do", function (e, t) { return e ? t._dayOfMonthOrdinalParse || t._ordinalParse : t._dayOfMonthOrdinalParseLenient }), me(["D", "DD"], we), me("Do", function (e, t) { t[we] = x(e.match(Z)[0]) }); var mn = Ie("Date", !0); U("DDD", ["DDDD", 3], "DDDo", "dayOfYear"), N("dayOfYear", "DDD"), F("dayOfYear", 4), de("DDD", ne), de("DDDD", J), me(["DDD", "DDDD"], function (e, t, n) { n._dayOfYear = x(e) }), U("m", ["mm", 2], 0, "minute"), N("minute", "m"), F("minute", 14), de("m", Z), de("mm", Z, X), me(["m", "mm"], _e); var vn = Ie("Minutes", !1); U("s", ["ss", 2], 0, "second"), N("second", "s"), F("second", 15), de("s", Z), de("ss", Z, X), me(["s", "ss"], ke); var gn, yn = Ie("Seconds", !1); for (U("S", 0, 0, function () { return ~~(this.millisecond() / 100) }), U(0, ["SS", 2], 0, function () { return ~~(this.millisecond() / 10) }), U(0, ["SSS", 3], 0, "millisecond"), U(0, ["SSSS", 4], 0, function () { return 10 * this.millisecond() }), U(0, ["SSSSS", 5], 0, function () { return 100 * this.millisecond() }), U(0, ["SSSSSS", 6], 0, function () { return 1e3 * this.millisecond() }), U(0, ["SSSSSSS", 7], 0, function () { return 1e4 * this.millisecond() }), U(0, ["SSSSSSSS", 8], 0, function () { return 1e5 * this.millisecond() }), U(0, ["SSSSSSSSS", 9], 0, function () { return 1e6 * this.millisecond() }), N("millisecond", "ms"), F("millisecond", 16), de("S", ne, Y), de("SS", ne, X), de("SSS", ne, J), gn = "SSSS"; gn.length <= 9; gn += "S") de(gn, ae); function bn(e, t) { t[xe] = x(1e3 * ("0." + e)) } for (gn = "S"; gn.length <= 9; gn += "S") me(gn, bn); var wn = Ie("Milliseconds", !1); U("z", 0, 0, "zoneAbbr"), U("zz", 0, 0, "zoneName"); var Sn = S.prototype; function _n(e) { return e } Sn.add = Zt, Sn.calendar = function (e, t) { var n = e || Lt(), r = jt(n, this).startOf("day"), a = i.calendarFormat(this, r) || "sameElse", o = t && (I(t[a]) ? t[a].call(this, n) : t[a]); return this.format(o || this.localeData().calendar(a, this, Lt(n))) }, Sn.clone = function () { return new S(this) }, Sn.diff = function (e, t, n) { var r, i, a; if (!this.isValid()) return NaN; if (!(r = jt(e, this)).isValid()) return NaN; switch (i = 6e4 * (r.utcOffset() - this.utcOffset()), t = R(t)) { case"year": a = tn(this, r) / 12; break; case"month": a = tn(this, r); break; case"quarter": a = tn(this, r) / 3; break; case"second": a = (this - r) / 1e3; break; case"minute": a = (this - r) / 6e4; break; case"hour": a = (this - r) / 36e5; break; case"day": a = (this - r - i) / 864e5; break; case"week": a = (this - r - i) / 6048e5; break; default: a = this - r } return n ? a : k(a) }, Sn.endOf = function (e) { var t; if (void 0 === (e = R(e)) || "millisecond" === e || !this.isValid()) return this; var n = this._isUTC ? hn : dn; switch (e) { case"year": t = n(this.year() + 1, 0, 1) - 1; break; case"quarter": t = n(this.year(), this.month() - this.month() % 3 + 3, 1) - 1; break; case"month": t = n(this.year(), this.month() + 1, 1) - 1; break; case"week": t = n(this.year(), this.month(), this.date() - this.weekday() + 7) - 1; break; case"isoWeek": t = n(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1; break; case"day": case"date": t = n(this.year(), this.month(), this.date() + 1) - 1; break; case"hour": t = this._d.valueOf(), t += ln - un(t + (this._isUTC ? 0 : this.utcOffset() * sn), ln) - 1; break; case"minute": t = this._d.valueOf(), t += sn - un(t, sn) - 1; break; case"second": t = this._d.valueOf(), t += on - un(t, on) - 1 } return this._d.setTime(t), i.updateOffset(this, !0), this }, Sn.format = function (e) { e || (e = this.isUtc() ? i.defaultFormatUtc : i.defaultFormat); var t = q(this, e); return this.localeData().postformat(t) }, Sn.from = function (e, t) { return this.isValid() && (_(e) && e.isValid() || Lt(e).isValid()) ? Yt({ to: this, from: e }).locale(this.locale()).humanize(!t) : this.localeData().invalidDate() }, Sn.fromNow = function (e) { return this.from(Lt(), e) }, Sn.to = function (e, t) { return this.isValid() && (_(e) && e.isValid() || Lt(e).isValid()) ? Yt({ from: this, to: e }).locale(this.locale()).humanize(!t) : this.localeData().invalidDate() }, Sn.toNow = function (e) { return this.to(Lt(), e) }, Sn.get = function (e) { return I(this[e = R(e)]) ? this[e]() : this }, Sn.invalidAt = function () { return m(this).overflow }, Sn.isAfter = function (e, t) { var n = _(e) ? e : Lt(e); return !(!this.isValid() || !n.isValid()) && ("millisecond" === (t = R(t) || "millisecond") ? this.valueOf() > n.valueOf() : n.valueOf() < this.clone().startOf(t).valueOf()) }, Sn.isBefore = function (e, t) { var n = _(e) ? e : Lt(e); return !(!this.isValid() || !n.isValid()) && ("millisecond" === (t = R(t) || "millisecond") ? this.valueOf() < n.valueOf() : this.clone().endOf(t).valueOf() < n.valueOf()) }, Sn.isBetween = function (e, t, n, r) { var i = _(e) ? e : Lt(e), a = _(t) ? t : Lt(t); return !!(this.isValid() && i.isValid() && a.isValid()) && ("(" === (r = r || "()")[0] ? this.isAfter(i, n) : !this.isBefore(i, n)) && (")" === r[1] ? this.isBefore(a, n) : !this.isAfter(a, n)) }, Sn.isSame = function (e, t) { var n, r = _(e) ? e : Lt(e); return !(!this.isValid() || !r.isValid()) && ("millisecond" === (t = R(t) || "millisecond") ? this.valueOf() === r.valueOf() : (n = r.valueOf(), this.clone().startOf(t).valueOf() <= n && n <= this.clone().endOf(t).valueOf())) }, Sn.isSameOrAfter = function (e, t) { return this.isSame(e, t) || this.isAfter(e, t) }, Sn.isSameOrBefore = function (e, t) { return this.isSame(e, t) || this.isBefore(e, t) }, Sn.isValid = function () { return v(this) }, Sn.lang = rn, Sn.locale = nn, Sn.localeData = an, Sn.max = Mt, Sn.min = Ot, Sn.parsingFlags = function () { return p({}, m(this)) }, Sn.set = function (e, t) { if ("object" === (void 0 === e ? "undefined" : o(e))) for (var n = function (e) { var t = []; for (var n in e) t.push({unit: n, priority: V[n]}); return t.sort(function (e, t) { return e.priority - t.priority }), t }(e = W(e)), r = 0; r < n.length; r++) this[n[r].unit](e[n[r].unit]); else if (I(this[e = R(e)])) return this[e](t); return this }, Sn.startOf = function (e) { var t; if (void 0 === (e = R(e)) || "millisecond" === e || !this.isValid()) return this; var n = this._isUTC ? hn : dn; switch (e) { case"year": t = n(this.year(), 0, 1); break; case"quarter": t = n(this.year(), this.month() - this.month() % 3, 1); break; case"month": t = n(this.year(), this.month(), 1); break; case"week": t = n(this.year(), this.month(), this.date() - this.weekday()); break; case"isoWeek": t = n(this.year(), this.month(), this.date() - (this.isoWeekday() - 1)); break; case"day": case"date": t = n(this.year(), this.month(), this.date()); break; case"hour": t = this._d.valueOf(), t -= un(t + (this._isUTC ? 0 : this.utcOffset() * sn), ln); break; case"minute": t = this._d.valueOf(), t -= un(t, sn); break; case"second": t = this._d.valueOf(), t -= un(t, on) } return this._d.setTime(t), i.updateOffset(this, !0), this }, Sn.subtract = en, Sn.toArray = function () { var e = this; return [e.year(), e.month(), e.date(), e.hour(), e.minute(), e.second(), e.millisecond()] }, Sn.toObject = function () { var e = this; return { years: e.year(), months: e.month(), date: e.date(), hours: e.hours(), minutes: e.minutes(), seconds: e.seconds(), milliseconds: e.milliseconds() } }, Sn.toDate = function () { return new Date(this.valueOf()) }, Sn.toISOString = function (e) { if (!this.isValid()) return null; var t = !0 !== e, n = t ? this.clone().utc() : this; return n.year() < 0 || n.year() > 9999 ? q(n, t ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ") : I(Date.prototype.toISOString) ? t ? this.toDate().toISOString() : new Date(this.valueOf() + 60 * this.utcOffset() * 1e3).toISOString().replace("Z", q(n, "Z")) : q(n, t ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ") }, Sn.inspect = function () { if (!this.isValid()) return "moment.invalid(/* " + this._i + " */)"; var e = "moment", t = ""; this.isLocal() || (e = 0 === this.utcOffset() ? "moment.utc" : "moment.parseZone", t = "Z"); var n = "[" + e + '("]', r = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY", i = t + '[")]'; return this.format(n + r + "-MM-DD[T]HH:mm:ss.SSS" + i) }, Sn.toJSON = function () { return this.isValid() ? this.toISOString() : null }, Sn.toString = function () { return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ") }, Sn.unix = function () { return Math.floor(this.valueOf() / 1e3) }, Sn.valueOf = function () { return this._d.valueOf() - 6e4 * (this._offset || 0) }, Sn.creationData = function () { return {input: this._i, format: this._f, locale: this._locale, isUTC: this._isUTC, strict: this._strict} }, Sn.year = De, Sn.isLeapYear = function () { return Te(this.year()) }, Sn.weekYear = function (e) { return fn.call(this, e, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy) }, Sn.isoWeekYear = function (e) { return fn.call(this, e, this.isoWeek(), this.isoWeekday(), 1, 4) }, Sn.quarter = Sn.quarters = function (e) { return null == e ? Math.ceil((this.month() + 1) / 3) : this.month(3 * (e - 1) + this.month() % 3) }, Sn.month = Fe, Sn.daysInMonth = function () { return Me(this.year(), this.month()) }, Sn.week = Sn.weeks = function (e) { var t = this.localeData().week(this); return null == e ? t : this.add(7 * (e - t), "d") }, Sn.isoWeek = Sn.isoWeeks = function (e) { var t = qe(this, 1, 4).week; return null == e ? t : this.add(7 * (e - t), "d") }, Sn.weeksInYear = function () { var e = this.localeData()._week; return He(this.year(), e.dow, e.doy) }, Sn.isoWeeksInYear = function () { return He(this.year(), 1, 4) }, Sn.date = mn, Sn.day = Sn.days = function (e) { if (!this.isValid()) return null != e ? this : NaN; var t = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); return null != e ? (e = function (e, t) { return "string" != typeof e ? e : isNaN(e) ? "number" == typeof (e = t.weekdaysParse(e)) ? e : null : parseInt(e, 10) }(e, this.localeData()), this.add(e - t, "d")) : t }, Sn.weekday = function (e) { if (!this.isValid()) return null != e ? this : NaN; var t = (this.day() + 7 - this.localeData()._week.dow) % 7; return null == e ? t : this.add(e - t, "d") }, Sn.isoWeekday = function (e) { if (!this.isValid()) return null != e ? this : NaN; if (null != e) { var t = function (e, t) { return "string" == typeof e ? t.weekdaysParse(e) % 7 || 7 : isNaN(e) ? null : e }(e, this.localeData()); return this.day(this.day() % 7 ? t : t - 7) } return this.day() || 7 }, Sn.dayOfYear = function (e) { var t = Math.round((this.clone().startOf("day") - this.clone().startOf("year")) / 864e5) + 1; return null == e ? t : this.add(e - t, "d") }, Sn.hour = Sn.hours = ot, Sn.minute = Sn.minutes = vn, Sn.second = Sn.seconds = yn, Sn.millisecond = Sn.milliseconds = wn, Sn.utcOffset = function (e, t, n) { var r, a = this._offset || 0; if (!this.isValid()) return null != e ? this : NaN; if (null != e) { if ("string" == typeof e) { if (null === (e = Kt(le, e))) return this } else Math.abs(e) < 16 && !n && (e *= 60); return !this._isUTC && t && (r = zt(this)), this._offset = e, this._isUTC = !0, null != r && this.add(r, "m"), a !== e && (!t || this._changeInProgress ? $t(this, Yt(e - a, "m"), 1, !1) : this._changeInProgress || (this._changeInProgress = !0, i.updateOffset(this, !0), this._changeInProgress = null)), this } return this._isUTC ? a : zt(this) }, Sn.utc = function (e) { return this.utcOffset(0, e) }, Sn.local = function (e) { return this._isUTC && (this.utcOffset(0, e), this._isUTC = !1, e && this.subtract(zt(this), "m")), this }, Sn.parseZone = function () { if (null != this._tzm) this.utcOffset(this._tzm, !1, !0); else if ("string" == typeof this._i) { var e = Kt(se, this._i); null != e ? this.utcOffset(e) : this.utcOffset(0, !0) } return this }, Sn.hasAlignedHourOffset = function (e) { return !!this.isValid() && (e = e ? Lt(e).utcOffset() : 0, (this.utcOffset() - e) % 60 == 0) }, Sn.isDST = function () { return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset() }, Sn.isLocal = function () { return !!this.isValid() && !this._isUTC }, Sn.isUtcOffset = function () { return !!this.isValid() && this._isUTC }, Sn.isUtc = Ut, Sn.isUTC = Ut, Sn.zoneAbbr = function () { return this._isUTC ? "UTC" : "" }, Sn.zoneName = function () { return this._isUTC ? "Coordinated Universal Time" : "" }, Sn.dates = A("dates accessor is deprecated. Use date instead.", mn), Sn.months = A("months accessor is deprecated. Use month instead", Fe), Sn.years = A("years accessor is deprecated. Use year instead", De), Sn.zone = A("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/", function (e, t) { return null != e ? ("string" != typeof e && (e = -e), this.utcOffset(e, t), this) : -this.utcOffset() }), Sn.isDSTShifted = A("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information", function () { if (!l(this._isDSTShifted)) return this._isDSTShifted; var e = {}; if (b(e, this), (e = Dt(e))._a) { var t = e._isUTC ? f(e._a) : Lt(e._a); this._isDSTShifted = this.isValid() && P(e._a, t.toArray()) > 0 } else this._isDSTShifted = !1; return this._isDSTShifted }); var kn = O.prototype; function xn(e, t, n, r) { var i = ft(), a = f().set(r, t); return i[n](a, e) } function Pn(e, t, n) { if (c(e) && (t = e, e = void 0), e = e || "", null != t) return xn(e, t, n, "month"); var r, i = []; for (r = 0; r < 12; r++) i[r] = xn(e, r, n, "month"); return i } function Cn(e, t, n, r) { "boolean" == typeof e ? (c(t) && (n = t, t = void 0), t = t || "") : (n = t = e, e = !1, c(t) && (n = t, t = void 0), t = t || ""); var i, a = ft(), o = e ? a._week.dow : 0; if (null != n) return xn(t, (n + o) % 7, r, "day"); var s = []; for (i = 0; i < 7; i++) s[i] = xn(t, (i + o) % 7, r, "day"); return s } kn.calendar = function (e, t, n) { var r = this._calendar[e] || this._calendar.sameElse; return I(r) ? r.call(t, n) : r }, kn.longDateFormat = function (e) { var t = this._longDateFormat[e], n = this._longDateFormat[e.toUpperCase()]; return t || !n ? t : (this._longDateFormat[e] = n.replace(/MMMM|MM|DD|dddd/g, function (e) { return e.slice(1) }), this._longDateFormat[e]) }, kn.invalidDate = function () { return this._invalidDate }, kn.ordinal = function (e) { return this._ordinal.replace("%d", e) }, kn.preparse = _n, kn.postformat = _n, kn.relativeTime = function (e, t, n, r) { var i = this._relativeTime[n]; return I(i) ? i(e, t, n, r) : i.replace(/%d/i, e) }, kn.pastFuture = function (e, t) { var n = this._relativeTime[e > 0 ? "future" : "past"]; return I(n) ? n(t) : n.replace(/%s/i, t) }, kn.set = function (e) { var t, n; for (n in e) I(t = e[n]) ? this[n] = t : this["_" + n] = t; this._config = e, this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source) }, kn.months = function (e, t) { return e ? a(this._months) ? this._months[e.month()] : this._months[(this._months.isFormat || Ne).test(t) ? "format" : "standalone"][e.month()] : a(this._months) ? this._months : this._months.standalone }, kn.monthsShort = function (e, t) { return e ? a(this._monthsShort) ? this._monthsShort[e.month()] : this._monthsShort[Ne.test(t) ? "format" : "standalone"][e.month()] : a(this._monthsShort) ? this._monthsShort : this._monthsShort.standalone }, kn.monthsParse = function (e, t, n) { var r, i, a; if (this._monthsParseExact) return function (e, t, n) { var r, i, a, o = e.toLocaleLowerCase(); if (!this._monthsParse) for (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = [], r = 0; r < 12; ++r) a = f([2e3, r]), this._shortMonthsParse[r] = this.monthsShort(a, "").toLocaleLowerCase(), this._longMonthsParse[r] = this.months(a, "").toLocaleLowerCase(); return n ? "MMM" === t ? -1 !== (i = Ee.call(this._shortMonthsParse, o)) ? i : null : -1 !== (i = Ee.call(this._longMonthsParse, o)) ? i : null : "MMM" === t ? -1 !== (i = Ee.call(this._shortMonthsParse, o)) ? i : -1 !== (i = Ee.call(this._longMonthsParse, o)) ? i : null : -1 !== (i = Ee.call(this._longMonthsParse, o)) ? i : -1 !== (i = Ee.call(this._shortMonthsParse, o)) ? i : null }.call(this, e, t, n); for (this._monthsParse || (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = []), r = 0; r < 12; r++) { if (i = f([2e3, r]), n && !this._longMonthsParse[r] && (this._longMonthsParse[r] = new RegExp("^" + this.months(i, "").replace(".", "") + "$", "i"), this._shortMonthsParse[r] = new RegExp("^" + this.monthsShort(i, "").replace(".", "") + "$", "i")), n || this._monthsParse[r] || (a = "^" + this.months(i, "") + "|^" + this.monthsShort(i, ""), this._monthsParse[r] = new RegExp(a.replace(".", ""), "i")), n && "MMMM" === t && this._longMonthsParse[r].test(e)) return r; if (n && "MMM" === t && this._shortMonthsParse[r].test(e)) return r; if (!n && this._monthsParse[r].test(e)) return r } }, kn.monthsRegex = function (e) { return this._monthsParseExact ? (h(this, "_monthsRegex") || Ke.call(this), e ? this._monthsStrictRegex : this._monthsRegex) : (h(this, "_monthsRegex") || (this._monthsRegex = Be), this._monthsStrictRegex && e ? this._monthsStrictRegex : this._monthsRegex) }, kn.monthsShortRegex = function (e) { return this._monthsParseExact ? (h(this, "_monthsRegex") || Ke.call(this), e ? this._monthsShortStrictRegex : this._monthsShortRegex) : (h(this, "_monthsShortRegex") || (this._monthsShortRegex = Ge), this._monthsShortStrictRegex && e ? this._monthsShortStrictRegex : this._monthsShortRegex) }, kn.week = function (e) { return qe(e, this._week.dow, this._week.doy).week }, kn.firstDayOfYear = function () { return this._week.doy }, kn.firstDayOfWeek = function () { return this._week.dow }, kn.weekdays = function (e, t) { var n = a(this._weekdays) ? this._weekdays : this._weekdays[e && !0 !== e && this._weekdays.isFormat.test(t) ? "format" : "standalone"]; return !0 === e ? Ye(n, this._week.dow) : e ? n[e.day()] : n }, kn.weekdaysMin = function (e) { return !0 === e ? Ye(this._weekdaysMin, this._week.dow) : e ? this._weekdaysMin[e.day()] : this._weekdaysMin }, kn.weekdaysShort = function (e) { return !0 === e ? Ye(this._weekdaysShort, this._week.dow) : e ? this._weekdaysShort[e.day()] : this._weekdaysShort }, kn.weekdaysParse = function (e, t, n) { var r, i, a; if (this._weekdaysParseExact) return function (e, t, n) { var r, i, a, o = e.toLocaleLowerCase(); if (!this._weekdaysParse) for (this._weekdaysParse = [], this._shortWeekdaysParse = [], this._minWeekdaysParse = [], r = 0; r < 7; ++r) a = f([2e3, 1]).day(r), this._minWeekdaysParse[r] = this.weekdaysMin(a, "").toLocaleLowerCase(), this._shortWeekdaysParse[r] = this.weekdaysShort(a, "").toLocaleLowerCase(), this._weekdaysParse[r] = this.weekdays(a, "").toLocaleLowerCase(); return n ? "dddd" === t ? -1 !== (i = Ee.call(this._weekdaysParse, o)) ? i : null : "ddd" === t ? -1 !== (i = Ee.call(this._shortWeekdaysParse, o)) ? i : null : -1 !== (i = Ee.call(this._minWeekdaysParse, o)) ? i : null : "dddd" === t ? -1 !== (i = Ee.call(this._weekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._shortWeekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._minWeekdaysParse, o)) ? i : null : "ddd" === t ? -1 !== (i = Ee.call(this._shortWeekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._weekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._minWeekdaysParse, o)) ? i : null : -1 !== (i = Ee.call(this._minWeekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._weekdaysParse, o)) ? i : -1 !== (i = Ee.call(this._shortWeekdaysParse, o)) ? i : null }.call(this, e, t, n); for (this._weekdaysParse || (this._weekdaysParse = [], this._minWeekdaysParse = [], this._shortWeekdaysParse = [], this._fullWeekdaysParse = []), r = 0; r < 7; r++) { if (i = f([2e3, 1]).day(r), n && !this._fullWeekdaysParse[r] && (this._fullWeekdaysParse[r] = new RegExp("^" + this.weekdays(i, "").replace(".", "\\.?") + "$", "i"), this._shortWeekdaysParse[r] = new RegExp("^" + this.weekdaysShort(i, "").replace(".", "\\.?") + "$", "i"), this._minWeekdaysParse[r] = new RegExp("^" + this.weekdaysMin(i, "").replace(".", "\\.?") + "$", "i")), this._weekdaysParse[r] || (a = "^" + this.weekdays(i, "") + "|^" + this.weekdaysShort(i, "") + "|^" + this.weekdaysMin(i, ""), this._weekdaysParse[r] = new RegExp(a.replace(".", ""), "i")), n && "dddd" === t && this._fullWeekdaysParse[r].test(e)) return r; if (n && "ddd" === t && this._shortWeekdaysParse[r].test(e)) return r; if (n && "dd" === t && this._minWeekdaysParse[r].test(e)) return r; if (!n && this._weekdaysParse[r].test(e)) return r } }, kn.weekdaysRegex = function (e) { return this._weekdaysParseExact ? (h(this, "_weekdaysRegex") || tt.call(this), e ? this._weekdaysStrictRegex : this._weekdaysRegex) : (h(this, "_weekdaysRegex") || (this._weekdaysRegex = $e), this._weekdaysStrictRegex && e ? this._weekdaysStrictRegex : this._weekdaysRegex) }, kn.weekdaysShortRegex = function (e) { return this._weekdaysParseExact ? (h(this, "_weekdaysRegex") || tt.call(this), e ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex) : (h(this, "_weekdaysShortRegex") || (this._weekdaysShortRegex = Ze), this._weekdaysShortStrictRegex && e ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex) }, kn.weekdaysMinRegex = function (e) { return this._weekdaysParseExact ? (h(this, "_weekdaysRegex") || tt.call(this), e ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex) : (h(this, "_weekdaysMinRegex") || (this._weekdaysMinRegex = et), this._weekdaysMinStrictRegex && e ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex) }, kn.isPM = function (e) { return "p" === (e + "").toLowerCase().charAt(0) }, kn.meridiem = function (e, t, n) { return e > 11 ? n ? "pm" : "PM" : n ? "am" : "AM" }, ht("en", { dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal: function (e) { var t = e % 10; return e + (1 === x(e % 100 / 10) ? "th" : 1 === t ? "st" : 2 === t ? "nd" : 3 === t ? "rd" : "th") } }), i.lang = A("moment.lang is deprecated. Use moment.locale instead.", ht), i.langData = A("moment.langData is deprecated. Use moment.localeData instead.", ft); var An = Math.abs; function Tn(e, t, n, r) { var i = Yt(t, n); return e._milliseconds += r * i._milliseconds, e._days += r * i._days, e._months += r * i._months, e._bubble() } function En(e) { return e < 0 ? Math.floor(e) : Math.ceil(e) } function Dn(e) { return 4800 * e / 146097 } function In(e) { return 146097 * e / 4800 } function Ln(e) { return function () { return this.as(e) } } var On = Ln("ms"), Mn = Ln("s"), Nn = Ln("m"), Rn = Ln("h"), Wn = Ln("d"), Vn = Ln("w"), Fn = Ln("M"), Gn = Ln("Q"), Bn = Ln("y"); function Kn(e) { return function () { return this.isValid() ? this._data[e] : NaN } } var jn = Kn("milliseconds"), zn = Kn("seconds"), Un = Kn("minutes"), qn = Kn("hours"), Hn = Kn("days"), Yn = Kn("months"), Xn = Kn("years"); var Jn = Math.round, Qn = {ss: 44, s: 45, m: 45, h: 22, d: 26, M: 11}; var $n = Math.abs; function Zn(e) { return (e > 0) - (e < 0) || +e } function er() { if (!this.isValid()) return this.localeData().invalidDate(); var e, t, n = $n(this._milliseconds) / 1e3, r = $n(this._days), i = $n(this._months); t = k((e = k(n / 60)) / 60), n %= 60, e %= 60; var a = k(i / 12), o = i %= 12, s = r, l = t, c = e, u = n ? n.toFixed(3).replace(/\.?0+$/, "") : "", d = this.asSeconds(); if (!d) return "P0D"; var h = d < 0 ? "-" : "", p = Zn(this._months) !== Zn(d) ? "-" : "", f = Zn(this._days) !== Zn(d) ? "-" : "", m = Zn(this._milliseconds) !== Zn(d) ? "-" : ""; return h + "P" + (a ? p + a + "Y" : "") + (o ? p + o + "M" : "") + (s ? f + s + "D" : "") + (l || c || u ? "T" : "") + (l ? m + l + "H" : "") + (c ? m + c + "M" : "") + (u ? m + u + "S" : "") } var tr = Wt.prototype; return tr.isValid = function () { return this._isValid }, tr.abs = function () { var e = this._data; return this._milliseconds = An(this._milliseconds), this._days = An(this._days), this._months = An(this._months), e.milliseconds = An(e.milliseconds), e.seconds = An(e.seconds), e.minutes = An(e.minutes), e.hours = An(e.hours), e.months = An(e.months), e.years = An(e.years), this }, tr.add = function (e, t) { return Tn(this, e, t, 1) }, tr.subtract = function (e, t) { return Tn(this, e, t, -1) }, tr.as = function (e) { if (!this.isValid()) return NaN; var t, n, r = this._milliseconds; if ("month" === (e = R(e)) || "quarter" === e || "year" === e) switch (t = this._days + r / 864e5, n = this._months + Dn(t), e) { case"month": return n; case"quarter": return n / 3; case"year": return n / 12 } else switch (t = this._days + Math.round(In(this._months)), e) { case"week": return t / 7 + r / 6048e5; case"day": return t + r / 864e5; case"hour": return 24 * t + r / 36e5; case"minute": return 1440 * t + r / 6e4; case"second": return 86400 * t + r / 1e3; case"millisecond": return Math.floor(864e5 * t) + r; default: throw new Error("Unknown unit " + e) } }, tr.asMilliseconds = On, tr.asSeconds = Mn, tr.asMinutes = Nn, tr.asHours = Rn, tr.asDays = Wn, tr.asWeeks = Vn, tr.asMonths = Fn, tr.asQuarters = Gn, tr.asYears = Bn, tr.valueOf = function () { return this.isValid() ? this._milliseconds + 864e5 * this._days + this._months % 12 * 2592e6 + 31536e6 * x(this._months / 12) : NaN }, tr._bubble = function () { var e, t, n, r, i, a = this._milliseconds, o = this._days, s = this._months, l = this._data; return a >= 0 && o >= 0 && s >= 0 || a <= 0 && o <= 0 && s <= 0 || (a += 864e5 * En(In(s) + o), o = 0, s = 0), l.milliseconds = a % 1e3, e = k(a / 1e3), l.seconds = e % 60, t = k(e / 60), l.minutes = t % 60, n = k(t / 60), l.hours = n % 24, s += i = k(Dn(o += k(n / 24))), o -= En(In(i)), r = k(s / 12), s %= 12, l.days = o, l.months = s, l.years = r, this }, tr.clone = function () { return Yt(this) }, tr.get = function (e) { return e = R(e), this.isValid() ? this[e + "s"]() : NaN }, tr.milliseconds = jn, tr.seconds = zn, tr.minutes = Un, tr.hours = qn, tr.days = Hn, tr.weeks = function () { return k(this.days() / 7) }, tr.months = Yn, tr.years = Xn, tr.humanize = function (e) { if (!this.isValid()) return this.localeData().invalidDate(); var t = this.localeData(), n = function (e, t, n) { var r = Yt(e).abs(), i = Jn(r.as("s")), a = Jn(r.as("m")), o = Jn(r.as("h")), s = Jn(r.as("d")), l = Jn(r.as("M")), c = Jn(r.as("y")), u = i <= Qn.ss && ["s", i] || i < Qn.s && ["ss", i] || a <= 1 && ["m"] || a < Qn.m && ["mm", a] || o <= 1 && ["h"] || o < Qn.h && ["hh", o] || s <= 1 && ["d"] || s < Qn.d && ["dd", s] || l <= 1 && ["M"] || l < Qn.M && ["MM", l] || c <= 1 && ["y"] || ["yy", c]; return u[2] = t, u[3] = +e > 0, u[4] = n, function (e, t, n, r, i) { return i.relativeTime(t || 1, !!n, e, r) }.apply(null, u) }(this, !e, t); return e && (n = t.pastFuture(+this, n)), t.postformat(n) }, tr.toISOString = er, tr.toString = er, tr.toJSON = er, tr.locale = nn, tr.localeData = an, tr.toIsoString = A("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", er), tr.lang = rn, U("X", 0, 0, "unix"), U("x", 0, 0, "valueOf"), de("x", oe), de("X", /[+-]?\d+(\.\d{1,3})?/), me("X", function (e, t, n) { n._d = new Date(1e3 * parseFloat(e, 10)) }), me("x", function (e, t, n) { n._d = new Date(x(e)) }), i.version = "2.24.0", t = Lt, i.fn = Sn, i.min = function () { return Nt("isBefore", [].slice.call(arguments, 0)) }, i.max = function () { return Nt("isAfter", [].slice.call(arguments, 0)) }, i.now = function () { return Date.now ? Date.now() : +new Date }, i.utc = f, i.unix = function (e) { return Lt(1e3 * e) }, i.months = function (e, t) { return Pn(e, t, "months") }, i.isDate = u, i.locale = ht, i.invalid = g, i.duration = Yt, i.isMoment = _, i.weekdays = function (e, t, n) { return Cn(e, t, n, "weekdays") }, i.parseZone = function () { return Lt.apply(null, arguments).parseZone() }, i.localeData = ft, i.isDuration = Vt, i.monthsShort = function (e, t) { return Pn(e, t, "monthsShort") }, i.weekdaysMin = function (e, t, n) { return Cn(e, t, n, "weekdaysMin") }, i.defineLocale = pt, i.updateLocale = function (e, t) { if (null != t) { var n, r, i = st; null != (r = dt(e)) && (i = r._config), (n = new O(t = L(i, t))).parentLocale = lt[e], lt[e] = n, ht(e) } else null != lt[e] && (null != lt[e].parentLocale ? lt[e] = lt[e].parentLocale : null != lt[e] && delete lt[e]); return lt[e] }, i.locales = function () { return T(lt) }, i.weekdaysShort = function (e, t, n) { return Cn(e, t, n, "weekdaysShort") }, i.normalizeUnits = R, i.relativeTimeRounding = function (e) { return void 0 === e ? Jn : "function" == typeof e && (Jn = e, !0) }, i.relativeTimeThreshold = function (e, t) { return void 0 !== Qn[e] && (void 0 === t ? Qn[e] : (Qn[e] = t, "s" === e && (Qn.ss = t - 1), !0)) }, i.calendarFormat = function (e, t) { var n = e.diff(t, "days", !0); return n < -6 ? "sameElse" : n < -1 ? "lastWeek" : n < 0 ? "lastDay" : n < 1 ? "sameDay" : n < 2 ? "nextDay" : n < 7 ? "nextWeek" : "sameElse" }, i.prototype = Sn, i.HTML5_FMT = { DATETIME_LOCAL: "YYYY-MM-DDTHH:mm", DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss", DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS", DATE: "YYYY-MM-DD", TIME: "HH:mm", TIME_SECONDS: "HH:mm:ss", TIME_MS: "HH:mm:ss.SSS", WEEK: "GGGG-[W]WW", MONTH: "YYYY-MM" }, i }, "object" === o(t) && void 0 !== e ? e.exports = a() : void 0 === (i = "function" == typeof (r = a) ? r.call(t, n, t, e) : r) || (e.exports = i) }).call(t, n(156)(e)) }, function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", {value: !0}), t.validateResponseStatus = t.validateRangeRequestCapabilities = t.createResponseStatusError = void 0; var r = n(1); t.createResponseStatusError = function (e, t) { return 404 === e || 0 === e && /^file:/.test(t) ? new r.MissingPDFException('Missing PDF "' + t + '".') : new r.UnexpectedResponseException("Unexpected server response (" + e + ') while retrieving PDF "' + t + '".', e) }, t.validateRangeRequestCapabilities = function (e) { var t = e.getResponseHeader, n = e.isHttp, i = e.rangeChunkSize, a = e.disableRange; (0, r.assert)(i > 0); var o = {allowRangeRequests: !1, suggestedLength: void 0}; if (a || !n) return o; if ("bytes" !== t("Accept-Ranges")) return o; if ("identity" !== (t("Content-Encoding") || "identity")) return o; var s = parseInt(t("Content-Length"), 10); return Number.isInteger(s) ? (o.suggestedLength = s, s <= 2 * i ? o : (window.KGPdfViewerWebApp.getTipPrompt().open("加载中..."), o.allowRangeRequests = !0, o)) : o }, t.validateResponseStatus = function (e) { return 200 === e || 206 === e } }, function (e, t, n) { "use strict"; e.exports = !n(8) && !n(16)(function () { return 7 != Object.defineProperty(n(42)("div"), "a", { get: function () { return 7 } }).a }) }, function (e, t, n) { "use strict"; for (var r, i = n(0), a = n(9), o = n(19), s = o("typed_array"), l = o("view"), c = !(!i.ArrayBuffer || !i.DataView), u = c, d = 0, h = "Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(","); d < 9;) (r = i[h[d++]]) ? (a(r.prototype, s, !0), a(r.prototype, l, !0)) : u = !1; e.exports = {ABV: c, CONSTR: u, TYPED: s, VIEW: l} }, function (e, t, n) { "use strict"; var r = n(20), i = n(13); e.exports = function (e) { if (void 0 === e) return 0; var t = r(e), n = i(t); if (t !== n) throw RangeError("Wrong length!"); return n } }, function (e, t, n) { "use strict"; var r = n(66), i = n(48).concat("length", "prototype"); t.f = Object.getOwnPropertyNames || function (e) { return r(e, i) } }, function (e, t, n) { "use strict"; var r = n(11), i = n(34), a = n(67)(!1), o = n(47)("IE_PROTO"); e.exports = function (e, t) { var n, s = i(e), l = 0, c = []; for (n in s) n != o && r(s, n) && c.push(n); for (; t.length > l;) r(s, n = t[l++]) && (~a(c, n) || c.push(n)); return c } }, function (e, t, n) { "use strict"; var r = n(34), i = n(13), a = n(35); e.exports = function (e) { return function (t, n, o) { var s, l = r(t), c = i(l.length), u = a(o, c); if (e && n != n) { for (; c > u;) if ((s = l[u++]) != s) return !0 } else for (; c > u; u++) if ((e || u in l) && l[u] === n) return e || u || 0; return !e && -1 } } }, function (e, t, n) { "use strict"; var r = n(21), i = n(35), a = n(13); e.exports = function (e) { for (var t = r(this), n = a(t.length), o = arguments.length, s = i(o > 1 ? arguments[1] : void 0, n), l = o > 2 ? arguments[2] : void 0, c = void 0 === l ? n : i(l, n); c > s;) t[s++] = e; return t } }, function (e, t, n) { "use strict"; var r = n(22), i = n(4)("iterator"), a = Array.prototype; e.exports = function (e) { return void 0 !== e && (r.Array === e || a[i] === e) } }, function (e, t, n) { "use strict"; var r = n(10), i = n(105), a = n(48), o = n(47)("IE_PROTO"), s = function () { }, l = function () { var e, t = n(42)("iframe"), r = a.length; for (t.style.display = "none", n(71).appendChild(t), t.src = "javascript:", (e = t.contentWindow.document).open(), e.write("