Files
2024-07-16 13:57:46 +00:00

1079 lines
60 KiB
JavaScript

var $jscomp = $jscomp || {};
$jscomp.scope = {}, $jscomp.ASSUME_ES5 = !1, $jscomp.ASSUME_NO_NATIVE_MAP = !1, $jscomp.ASSUME_NO_NATIVE_SET = !1, $jscomp.defineProperty = $jscomp.ASSUME_ES5 || "function" == typeof Object.defineProperties ? Object.defineProperty : function (t, e, n) {
t != Array.prototype && t != Object.prototype && (t[e] = n.value)
}, $jscomp.getGlobal = function (t) {
return "undefined" != typeof window && window === t ? t : "undefined" != typeof global && null != global ? global : t
}, $jscomp.global = $jscomp.getGlobal(this), $jscomp.SYMBOL_PREFIX = "jscomp_symbol_", $jscomp.initSymbol = function () {
$jscomp.initSymbol = function () {
}, $jscomp.global.Symbol || ($jscomp.global.Symbol = $jscomp.Symbol)
}, $jscomp.Symbol = function () {
var t = 0;
return function (e) {
return $jscomp.SYMBOL_PREFIX + (e || "") + t++
}
}(), $jscomp.initSymbolIterator = function () {
$jscomp.initSymbol();
var t = $jscomp.global.Symbol.iterator;
t || (t = $jscomp.global.Symbol.iterator = $jscomp.global.Symbol("iterator")), "function" != typeof Array.prototype[t] && $jscomp.defineProperty(Array.prototype, t, {
configurable: !0,
writable: !0,
value: function () {
return $jscomp.arrayIterator(this)
}
}), $jscomp.initSymbolIterator = function () {
}
}, $jscomp.initSymbolAsyncIterator = function () {
$jscomp.initSymbol();
var t = $jscomp.global.Symbol.asyncIterator;
t || (t = $jscomp.global.Symbol.asyncIterator = $jscomp.global.Symbol("asyncIterator")), $jscomp.initSymbolAsyncIterator = function () {
}
}, $jscomp.arrayIterator = function (t) {
var e = 0;
return $jscomp.iteratorPrototype(function () {
return e < t.length ? {
done: !1,
value: t[e++]
} : {
done: !0
}
})
}, $jscomp.iteratorPrototype = function (t) {
return $jscomp.initSymbolIterator(), (t = {
next: t
})[$jscomp.global.Symbol.iterator] = function () {
return this
}, t
}, $jscomp.makeIterator = function (t) {
$jscomp.initSymbolIterator();
var e = t[Symbol.iterator];
return e ? e.call(t) : $jscomp.arrayIterator(t)
}, $jscomp.polyfill = function (t, e, n, o) {
if (e) {
for (n = $jscomp.global, t = t.split("."), o = 0; o < t.length - 1; o++) {
var i = t[o];
i in n || (n[i] = {}), n = n[i]
}
(e = e(o = n[t = t[t.length - 1]])) != o && null != e && $jscomp.defineProperty(n, t, {
configurable: !0,
writable: !0,
value: e
})
}
}, $jscomp.FORCE_POLYFILL_PROMISE = !1, $jscomp.polyfill("Promise", function (t) {
function e() {
this.batch_ = null
}
function n(t) {
return t instanceof i ? t : new i(function (e, n) {
e(t)
})
}
if (t && !$jscomp.FORCE_POLYFILL_PROMISE) return t;
e.prototype.asyncExecute = function (t) {
return null == this.batch_ && (this.batch_ = [], this.asyncExecuteBatch_()), this.batch_.push(t), this
}, e.prototype.asyncExecuteBatch_ = function () {
var t = this;
this.asyncExecuteFunction(function () {
t.executeBatch_()
})
};
var o = $jscomp.global.setTimeout;
e.prototype.asyncExecuteFunction = function (t) {
o(t, 0)
}, e.prototype.executeBatch_ = function () {
for (; this.batch_ && this.batch_.length;) {
var t = this.batch_;
this.batch_ = [];
for (var e = 0; e < t.length; ++e) {
var n = t[e];
t[e] = null;
try {
n()
} catch (t) {
this.asyncThrow_(t)
}
}
}
this.batch_ = null
}, e.prototype.asyncThrow_ = function (t) {
this.asyncExecuteFunction(function () {
throw t
})
};
var i = function (t) {
this.state_ = 0, this.result_ = void 0, this.onSettledCallbacks_ = [];
var e = this.createResolveAndReject_();
try {
t(e.resolve, e.reject)
} catch (t) {
e.reject(t)
}
};
i.prototype.createResolveAndReject_ = function () {
function t(t) {
return function (o) {
n || (n = !0, t.call(e, o))
}
}
var e = this,
n = !1;
return {
resolve: t(this.resolveTo_),
reject: t(this.reject_)
}
}, i.prototype.resolveTo_ = function (t) {
if (t === this) this.reject_(new TypeError("A Promise cannot resolve to itself"));
else if (t instanceof i) this.settleSameAsPromise_(t);
else {
t: switch (typeof t) {
case "object":
var e = null != t;
break t;
case "function":
e = !0;
break t;
default:
e = !1
}
e ? this.resolveToNonPromiseObj_(t) : this.fulfill_(t)
}
}, i.prototype.resolveToNonPromiseObj_ = function (t) {
var e = void 0;
try {
e = t.then
} catch (t) {
return void this.reject_(t)
}
"function" == typeof e ? this.settleSameAsThenable_(e, t) : this.fulfill_(t)
}, i.prototype.reject_ = function (t) {
this.settle_(2, t)
}, i.prototype.fulfill_ = function (t) {
this.settle_(1, t)
}, i.prototype.settle_ = function (t, e) {
if (0 != this.state_) throw Error("Cannot settle(" + t + ", " + e + "): Promise already settled in state" + this.state_);
this.state_ = t, this.result_ = e, this.executeOnSettledCallbacks_()
}, i.prototype.executeOnSettledCallbacks_ = function () {
if (null != this.onSettledCallbacks_) {
for (var t = 0; t < this.onSettledCallbacks_.length; ++t) a.asyncExecute(this.onSettledCallbacks_[t]);
this.onSettledCallbacks_ = null
}
};
var a = new e;
return i.prototype.settleSameAsPromise_ = function (t) {
var e = this.createResolveAndReject_();
t.callWhenSettled_(e.resolve, e.reject)
}, i.prototype.settleSameAsThenable_ = function (t, e) {
var n = this.createResolveAndReject_();
try {
t.call(e, n.resolve, n.reject)
} catch (t) {
n.reject(t)
}
}, i.prototype.then = function (t, e) {
function n(t, e) {
return "function" == typeof t ? function (e) {
try {
o(t(e))
} catch (t) {
a(t)
}
} : e
}
var o, a, r = new i(function (t, e) {
o = t, a = e
});
return this.callWhenSettled_(n(t, o), n(e, a)), r
}, i.prototype.catch = function (t) {
return this.then(void 0, t)
}, i.prototype.callWhenSettled_ = function (t, e) {
function n() {
switch (o.state_) {
case 1:
t(o.result_);
break;
case 2:
e(o.result_);
break;
default:
throw Error("Unexpected state: " + o.state_)
}
}
var o = this;
null == this.onSettledCallbacks_ ? a.asyncExecute(n) : this.onSettledCallbacks_.push(n)
}, i.resolve = n, i.reject = function (t) {
return new i(function (e, n) {
n(t)
})
}, i.race = function (t) {
return new i(function (e, o) {
for (var i = $jscomp.makeIterator(t), a = i.next(); !a.done; a = i.next()) n(a.value).callWhenSettled_(e, o)
})
}, i.all = function (t) {
var e = $jscomp.makeIterator(t),
o = e.next();
return o.done ? n([]) : new i(function (t, i) {
function a(e) {
return function (n) {
r[e] = n, 0 == --s && t(r)
}
}
var r = [],
s = 0;
do {
r.push(void 0), s++, n(o.value).callWhenSettled_(a(r.length - 1), i), o = e.next()
} while (!o.done)
})
}, i
}, "es6", "es3"), $jscomp.findInternal = function (t, e, n) {
t instanceof String && (t = String(t));
for (var o = t.length, i = 0; i < o; i++) {
var a = t[i];
if (e.call(n, a, i, t)) return {
i: i,
v: a
}
}
return {
i: -1,
v: void 0
}
}, $jscomp.polyfill("Array.prototype.find", function (t) {
return t || function (t, e) {
return $jscomp.findInternal(this, t, e).v
}
}, "es6", "es3"),
function () {
var t, e, n, o = function (t, e) {
return function () {
return t.apply(e, arguments)
}
};
t = jQuery, e = {
bgColor: "#fff",
inlineStyles: !0,
lockDocumentScroll: !0,
mainWrapperClass: "fsp-wrapper",
contentWrapperClass: "fsp-content",
closePopupClass: "fsp-close",
close: !0,
animationSpeed: 200
}, n = function () {
function n(n, i) {
this.element = n, this.closePopup = o(this.closePopup, this), this.init = o(this.init, this), this.options = t.extend({}, e, i), this._defaults = e, this._name = "fullScreenPopup", this.element = t(this.element), this.body = t("body"), this.element.on("click", this.init)
}
return n.prototype.init = function (t) {
return t.preventDefault(), this.getTarget(), this.getTargetSizes(), this.createWrappers(), this.wrapTarget(), this.options.lockDocumentScroll && this.lockDocumentScroll(), this.render(), this.bindEvents()
}, n.prototype.getTarget = function () {
return this.target = this.options.popup ? this.options.popup() : t(this.element.attr("href") || this.element.data("popup")), this.targetParent = this.target.parent()
}, n.prototype.getTargetSizes = function () {
return this.targetSizes = {
width: this.target.width(),
height: this.target.height()
}
}, n.prototype.wrapTarget = function () {
return this.target = this.detachFromDom(this.target), this.target.appendTo(this.contentWrapper)
}, n.prototype.render = function () {
return this.target.show(), this.attachToDom(this.mainWrapper, "body"), this.popupCentered(), this.mainWrapper.fadeIn(this.options.animationSpeed)
}, n.prototype.detachFromDom = function (t) {
return t.detach()
}, n.prototype.attachToDom = function (t, e) {
return t.appendTo(e)
}, n.prototype.bindEvents = function () {
this.close && this.close.on("click", this.closePopup);
var e = this.closePopup;
return t(document).on("keyup.pdfembfullscreen", function (t) {
27 == (t.keyCode ? t.keyCode : t.which) && e(t)
}), this.mainWrapper.on("closePopup", this.closePopup)
}, n.prototype.createWrappers = function () {
return this.mainWrapper = t("<div/>", {
class: "" + this.options.mainWrapperClass,
style: this.options.inlineStyles ? "background: " + this.options.bgColor + "; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999; overflow-y: auto; overflow-x: hidden; display: none" : void 0
}), this.contentWrapper = t("<div/>", {
class: "" + this.options.contentWrapperClass,
style: "width: 100%; height: 100%; position: relative; top: 0px; left: 0px;"
}).appendTo(this.mainWrapper), this.options.close && (this.close = t("<a/>", {
href: "#",
html: "&times;",
class: "" + this.options.closePopupClass,
style: this.options.inlineStyles ? "position: absolute; right: 2em; top: 2em;" : void 0
}).appendTo(this.mainWrapper)), this
}, n.prototype.popupCentered = function () {
}, n.prototype.closePopup = function (e) {
e.preventDefault();
var n = this;
return t(document).unbind("keyup.pdfembfullscreen"), this.mainWrapper.fadeOut(this.options.animationSpeed, function () {
return n.options.lockDocumentScroll && n.unlockDocumentScroll(), n.target = n.detachFromDom(n.target), n.target.hide(), n.attachToDom(n.target, n.targetParent), n.deleteWrappers()
})
}, n.prototype.deleteWrappers = function () {
return this.mainWrapper.remove()
}, n.prototype.lockDocumentScroll = function () {
return this.body.css({
overflow: "hidden"
})
}, n.prototype.unlockDocumentScroll = function () {
return this.body.css({
overflow: "visible"
})
}, n
}(), t.fn.fullScreenPopup = function (e) {
return this.each(function () {
if (!t.data(this, "plugin_fullScreenPopup")) return t.data(this, "plugin_fullScreenPopup", new n(this, e))
})
}
}.call(this);
var pdfembGrabToPan = function () {
function t(t) {
this.element = t.element, this.document = t.element.ownerDocument, "function" == typeof t.ignoreTarget && (this.ignoreTarget = t.ignoreTarget), this.onActiveChanged = t.onActiveChanged, this.activate = this.activate.bind(this), this.deactivate = this.deactivate.bind(this), this.toggle = this.toggle.bind(this), this._onmousedown = this._onmousedown.bind(this), this._onmousemove = this._onmousemove.bind(this), this._ontouchstart = this._ontouchstart.bind(this), this._ontouchmove = this._ontouchmove.bind(this), this._ontouchend = this._ontouchend.bind(this), this._onmousewheel = this._onmousewheel.bind(this), this._endPan = this._endPan.bind(this), this._ondocumenttouchmove = this._ondocumenttouchmove.bind(this), this._onkeyboardpan = this._onkeyboardpan.bind(this), this.element.addEventListener("pdfembKeyboardPan", this._onkeyboardpan, !1), this.preventDocTouchScroll = !1, (this.overlay = document.createElement("div")).className = "grab-to-pan-grabbing"
}
var e;
t.prototype = {
CSS_CLASS_GRAB: "grab-to-pan-grab",
activate: function () {
!this.active && (this.active = !0, this.element.addEventListener("mousedown", this._onmousedown, !0), this.element.addEventListener("mousewheel", this._onmousewheel), this.element.addEventListener("wheel", this._onmousewheel), this.element.addEventListener("DOMMouseScroll", this._onmousewheel), this.element.addEventListener("touchstart", this._ontouchstart), document.addEventListener("touchmove", this._ondocumenttouchmove), this.element.classList.add(this.CSS_CLASS_GRAB), this.onActiveChanged) && this.onActiveChanged(!0)
},
deactivate: function () {
this.active && (this.active = !1, this.element.removeEventListener("mousedown", this._onmousedown, !0), this._endPan(), document.removeEventListener("touchmove", this._ondocumenttouchmove, !1), this.element.classList.remove(this.CSS_CLASS_GRAB), this.onActiveChanged) && this.onActiveChanged(!1)
},
toggle: function () {
this.active ? this.deactivate() : this.activate()
},
ignoreTarget: function (t) {
return t[e]("a[href], a[href] *, input, textarea, button, button *, select, option, .pdfembTextLayer > div")
},
_onmousedown: function (t) {
if (0 === t.button && !this.ignoreTarget(t.target)) {
this.scrollLeftStart = this.element.scrollLeft, this.scrollTopStart = this.element.scrollTop, this.clientXStart = t.clientX, this.clientYStart = t.clientY, this.document.addEventListener("mousemove", this._onmousemove, !0), this.document.addEventListener("mouseup", this._endPan, !0), this.element.addEventListener("scroll", this._endPan, !0), t.preventDefault(), t.stopPropagation(), this.document.documentElement.classList.add(this.CSS_CLASS_GRABBING);
var e = document.activeElement;
e && !e.contains(t.target) && e.blur()
}
},
_onmousemove: function (t) {
this.element.removeEventListener("scroll", this._endPan, !0);
var e = "buttons" in t && n ? !(1 | t.buttons) : i || a ? 0 === t.which : void 0;
e ? this._endPan() : (e = t.clientX - this.clientXStart, this.element.scrollTop = this.scrollTopStart - (t.clientY - this.clientYStart), this.element.scrollLeft = this.scrollLeftStart - e, this.overlay.parentNode || document.body.appendChild(this.overlay))
},
_ontouchstart: function (t) {
this.scrollLeftStart = this.element.scrollLeft, this.scrollTopStart = this.element.scrollTop, this.clientXStart = t.touches[0].clientX, this.clientYStart = t.touches[0].clientY, this.distStart = this._calcTouchDistance(t), this.scaledForMagnification = !1, this.document.addEventListener("touchmove", this._ontouchmove), this.document.addEventListener("touchend", this._ontouchend), 1 != t.touches.length && (t.preventDefault(), t.stopPropagation()), this.document.documentElement.classList.add(this.CSS_CLASS_GRABBING);
var e = document.activeElement;
e && !e.contains(t.target) && e.blur(), this.touchtapmaybe = 1 == t.touches.length
},
_calcTouchDistance: function (t) {
var e = NaN;
return t.touches && 2 <= t.touches.length && (e = Math.sqrt(Math.pow(t.touches[0].screenX - t.touches[1].screenX, 2) + Math.pow(t.touches[0].screenY - t.touches[1].screenY, 2))), e
},
_calcTouchCenter: function (t) {
var e = 0,
n = 0;
return t.touches && 2 <= t.touches.length && (e = (t.touches[0].clientX + t.touches[1].clientX) / 2, n = (t.touches[0].clientY + t.touches[1].clientY) / 2), [e, n]
},
_ontouchmove: function (t) {
var e = !0,
n = t.touches[0].clientX - this.clientXStart,
o = t.touches[0].clientY - this.clientYStart;
1 == t.touches.length ? (this.element.scrollTop = this.scrollTopStart - o, this.element.scrollLeft = this.scrollLeftStart - n, this.element.scrollTop == this.scrollTopStart && 0 != o && (e = !1)) : this.touchtapmaybe = !1, this.overlay.parentNode || document.body.appendChild(this.overlay), 0 == n && 0 == o || (this.touchtapmaybe = !1), n = this._calcTouchDistance(t), e ? (t.preventDefault(), this.preventDocTouchScroll = !0) : this.preventDocTouchScroll = !1, isNaN(this.distStart) ? this.distStart = n : !isNaN(n) && 0 < this.distStart && 0 < n && (1.5 < (o = (50 + n) / (50 + this.distStart)) && (o = 1.5), .75 > o && (o = .75), 1 != o && (this.scaledForMagnification = !0, (e = document.createEvent("Events")).initEvent("pdfembMagnify", !0, !0), e.magnification = o, e.gtpelement = this.element, t = this._calcTouchCenter(t), e.centreLeft = t[0], e.centreTop = t[1], this.element.dispatchEvent(e)), this.distStart = n)
},
_ondocumenttouchmove: function (t) {
if (this.preventDocTouchScroll) return t.preventDefault(), t.stopPropagation(), !1
},
_onmousewheel: function (t) {
this.element.removeEventListener("scroll", this._endPan, !0);
var e = .5;
t.deltaMode && (1 == t.deltaMode && (e = 10), 2 == t.deltaMode && (e = 1e3));
var n = t.deltaY ? -t.deltaY : t.wheelDelta ? t.wheelDelta : -t.detail;
if (this.scrollLeftStart = this.element.scrollLeft, this.scrollTopStart = this.element.scrollTop, e *= n, this.element.scrollTop = this.scrollTopStart - e, this.overlay.parentNode || document.body.appendChild(this.overlay), this.element.scrollTop != this.scrollTopStart || 0 == e) return t.preventDefault(), !1
},
_ontouchend: function (t) {
this._endPan(), this.scaledForMagnification && ((t = document.createEvent("Events")).initEvent("pdfembMagnify", !0, !0), t.magnification = -1, t.gtpelement = this.element, this.element.dispatchEvent(t)), this.touchtapmaybe && ((t = document.createEvent("Events")).initEvent("pdfembTouchTapped", !0, !0), this.element.dispatchEvent(t))
},
_endPan: function () {
this.element.removeEventListener("scroll", this._endPan, !0), this.document.removeEventListener("mousemove", this._onmousemove, !0), this.document.removeEventListener("mouseup", this._endPan, !0), this.document.removeEventListener("touchmove", this._ontouchmove, !1), this.document.removeEventListener("touchend", this._ontouchend, !1), this.preventDocTouchScroll = !1, this.overlay.parentNode && this.overlay.parentNode.removeChild(this.overlay)
},
_onkeyboardpan: function (t) {
if (37 == (t = t.detail.keyCode) || 39 == t) {
var e = this.element.offsetWidth / 7;
5 > e && (e = 5), this.element.scrollLeft -= 37 == t ? e : -e
}
38 != t && 40 != t || (5 > (e = this.element.offsetHeight / 7) && (e = 5), this.element.scrollTop -= 38 == t ? e : -e), this.overlay.parentNode || document.body.appendChild(this.overlay)
}
}, ["webkitM", "mozM", "msM", "oM", "m"].some(function (t) {
return (t += "atches") in document.documentElement && (e = t), (t += "Selector") in document.documentElement && (e = t), e
});
var n = !document.documentMode || 9 < document.documentMode,
o = window.chrome,
i = o && (o.webstore || o.app),
a = /Apple/.test(navigator.vendor) && /Version\/([6-9]\d*|[1-5]\d+)/.test(navigator.userAgent);
return t
}(),
PDFEMB_NS = {};
jQuery(document).ready(function (t) {
var e,
n = (e = document.createElement("canvas").getContext("2d"), (window.devicePixelRatio || 1) / (e.webkitBackingStorePixelRatio || e.mozBackingStorePixelRatio || e.msBackingStorePixelRatio || e.oBackingStorePixelRatio || e.backingStorePixelRatio || 1));
PDFEMB_NS.PIXEL_RATIO = n, createHiDPICanvas = function (t, e, o) {
o || (o = n);
var i = document.createElement("canvas");
return i.width = t * o, i.height = e * o, i.style.width = t + "px", i.style.height = e + "px", i.getContext("2d").setTransform(o, 0, 0, o, 0, 0), i
};
var o = 0,
i = 0;
!function () {
var t = document.createElement("div");
t.style.width = "100px", t.style.height = "100px", t.style.overflow = "scroll", t.style.position = "absolute", t.style.top = "-9999px", document.body.appendChild(t), o = t.offsetWidth - t.clientWidth, i = t.offsetHeight - t.clientHeight, document.body.removeChild(t)
}(), PDFEMB_NS.vscrollbarwidth = o, PDFEMB_NS.hscrollbarheight = i;
var a = function (t, e, n) {
this.pdfDoc = t, this.divContainer = e, this.showIsSecure = n, this.initialResize = !1, this.firstPageHeight = this.firstPageWidth = 0, this.invalidationRound = 1, this.currentPageNum = 0, this.zoom = 100, this.toZoom = this.fromZoom = 0
};
a.prototype.setup = function () {
var e = this,
n = this.divContainer,
o = this.pdfDoc,
i = this.showIsSecure;
this.numPages = o.numPages;
var a = n.data("scrollbar");
this.vscrollbar = "both" == a || "vertical" == a, this.hscrollbar = "both" == a || "horizontal" == a, a = "overflow-y: " + (this.vscrollbar ? "scroll" : "hidden") + "; ", a += "overflow-x: " + (this.hscrollbar ? "scroll" : "hidden") + "; ", n.empty().append(t("<div></div>", {
class: "pdfemb-pagescontainer",
style: a
})), n.data("pdfDoc", o), a = n.data("toolbar"), this.addToolbar(!0, !0, i), e.annotationsLayerFactory = void 0 !== PDFEMB_NS.pdfembPremiumAnnotationsLayerFactory ? new PDFEMB_NS.pdfembPremiumAnnotationsLayerFactory : {
createAnnotationsLayerBuilder: function (t, e) {
return null
}
}, e.annotationLayerFactories = [], e.textLayerFactory = void 0 !== PDFEMB_NS.pdfembPremiumTextLayerFactory ? new PDFEMB_NS.pdfembPremiumTextLayerFactory : {
createTextLayerBuilder: function (t, e) {
return null
}
}, e.textLayerFactories = [], n.on("pdfembGotopage", function (t, n) {
n > this.numPages || 0 >= n || (e.gotoPage(n), e.jumpToTop())
}), n.on("pdfembGotoHash", function (t, n) {
n.dest && (dest = n.dest, "string" == typeof dest ? (destString = dest, t = e.pdfDoc.getDestination(dest)) : t = Promise.resolve(dest), t.then(function (t) {
t instanceof Array && !(1 > t.length) && e.pdfDoc.getPageIndex(t[0]).then(function (t) {
(t += 1) > e.numPages || 0 >= t || e.currentPageNum == t || (e.gotoPage(t), e.jumpToTop())
})
}))
}), n.on("pdfembGotoAction", function (t, n) {
var o = t = e.currentPageNum;
switch (n) {
case "GoBack":
--o;
break;
case "GoForward":
case "NextPage":
++o;
break;
case "PrevPage":
--o;
break;
case "LastPage":
o = e.pageCount;
break;
case "FirstPage":
o = 1
}
o == t || o > e.pageCount || 0 >= o || e.gotoPage(o)
}), n.on("pdfembMagnify", function (t) {
e.magnifyEvent(t)
}), n.on("pdfembChangeZoom", function (t, n) {
e.changeZoom(n)
}), this.pageCount = o.numPages, (!n.data("pagenum") || 1 > n.data("pagenum") || n.data("pagenum") > this.pageCount) && n.data("pagenum", 1), n.data("showIsSecure", this.showIsSecure), n.data("pageNumPending", null), o = "on" == n.data("fullScreen") ? parseInt(n.data("startfpzoom")) : parseInt(n.data("startzoom")), (isNaN(o) || 20 > o || 500 < o) && (o = 100), this.zoom = o, 100 != o && n.find("span.pdfemb-zoom").text(o + "%"), n.find("span.pdfemb-page-count").text(this.pageCount), this.gotoPage(n.data("pagenum"))
}, a.prototype.checkForResize = function () {
var e = this,
n = e.divContainer,
o = t(window).height(),
i = t(window).width(),
a = n.data("checked-window-height"),
r = n.data("checked-window-width");
a && r || (n.data("checked-window-height", o), n.data("checked-window-width", i)), a == o && r == i || (e.resizeViewer(), e.resizeInnerDivs(), e.invalidateAllPages(), e.renderPage(this.currentPageNum), e.prerenderNearbyPages(this.currentPageNum), e.pdfembMakeMobile(), n.data("checked-window-height", o), n.data("checked-window-width", i)), "true" != n.data("fullScreenClosed") && setTimeout(function () {
e.checkForResize()
}, 100)
}, a.prototype.setSizesBasedOnPage = function (t) {
t = t.getViewport(1), this.pageWidth = t.width, this.pageHeight = t.height, (0 >= this.pageWidth || 0 >= this.pageHeight) && this.divContainer.empty().append(document.createTextNode(wpmf_pdfemb_trans.objectL10n.widthheightinvalid))
}, a.prototype.createPageInnerDivs = function () {
for (var e = this.divContainer.find(".pdfemb-pagescontainer"), n = 1; n <= this.pageCount; ++n) {
var o = e.find(".pdfemb-inner-div.pdfemb-page" + n);
0 == o.length && ((o = t("<div></div>", {
class: "pdfemb-inner-div pdfemb-page" + n
})).data("pageNum", n), e.append(o))
}
this.resizeInnerDivs()
}, a.prototype.addGrabToPan = function () {
var e = this,
n = e.divContainer,
o = n.find("div.pdfemb-pagescontainer"),
i = new pdfembGrabToPan({
element: o[0]
});
n.data("grabtopan", i), o.on("scroll", function (t) {
var n = e.getTopVisiblePageNum();
n != e.currentPageNum && (e.currentPageNum = n, e.updatePageNumDisplay(n), e.renderPage(n, !1), e.prerenderNearbyPages(n), e.deallocateFarAwayPages(n)), t.stopPropagation()
}), t(window).resize(function () {
setTimeout(function () {
e.checkForResize()
}, 100)
})
}, a.prototype.resizeInnerDivs = function (e) {
var n = this,
o = n.wantCanvasWidth,
i = n.wantCanvasHeight,
a = n.wantHeight,
r = this.divContainer.find(".pdfemb-pagescontainer").find(".pdfemb-inner-div");
e && (r = r.filter(".pdfemb-page" + e));
var s = 0;
r.each(function (a, d) {
var c = t(d);
d = c.data("widthfactor");
var p = c.data("heightfactor");
d || (d = 1), p || (p = 1), c.data("invalidation-round", this.invalidationRound - 1), c.css("width", o * d), a = i * p + (e == n.numPages || !e && a == r.length - 1 ? 0 : 2), c.css("height", a), s += a, (a = c.find(".pdfemb-the-canvas")).css("width", o * d), a.css("height", i * p)
});
var d = 0;
!e && s < a && (d = (a - s) / 2), r.first().css("top", d)
}, a.prototype.invalidateAllPages = function () {
++this.invalidationRound
}, a.prototype.prerenderNearbyPages = function (t) {
var e = 3,
n = 2;
for (100 > this.zoom && (e *= Math.min(Math.ceil(100 / this.zoom), 10), n *= Math.min(Math.ceil(100 / this.zoom), 10)), n = Math.max(1, t - n); n <= Math.min(t + e, this.numPages); ++n) n != t && this.renderPage(n, !1)
}, a.prototype.deallocateFarAwayPages = function (t) {
var e = 50,
n = 50;
if (100 > this.zoom) {
var o = Math.min(Math.ceil(100 / this.zoom), 50);
e += o, n += o
}
o = function (t) {
var e = (t = a.find(".pdfemb-page" + t)).find(".pdfemb-the-canvas");
e.length && (e.remove(), t.data("invalidation-round", 0))
};
var i, a = this.divContainer.find("div.pdfemb-pagescontainer");
for (i = 3; i < t - n; ++i) o(i);
for (i = t + e; i < this.numPages; ++i) o(i)
}, a.prototype.resizeViewer = function () {
var t = this.pageWidth,
e = this.pageHeight,
a = this.divContainer,
r = a.find("div.pdfemb-pagescontainer"),
s = r[0].scrollLeft,
d = r[0].scrollTop,
c = a.parent().width();
if ("max" == a.data("width")) var p = c;
else "auto" == a.data("width") ? p = t : (p = parseInt(a.data("width"), 10), (isNaN(p) || 0 >= p) && (p = c));
0 >= p && (p = t), p > c && 0 < c && (p = c), e = e * p / t;
var l = this.pdfembWantMobile(p, f);
this.wantMobile = l;
var h = a.find("div.pdfemb-toolbar-fixed"),
u = l ? 0 : h.length,
f = parseInt(a.data("height"), 10);
(isNaN(f) || 0 >= f || f > e) && (f = "auto" == a.data("height") ? a.parent().height() - u * h.height() : e), this.userHeight = f, p = Math.floor(p), e = Math.floor(e), c = 100;
var m = p - (this.vscrollbar ? o : 0),
v = e - (this.hscrollbar ? i : 0),
g = 1;
l || 16777e3 < (m = m * (c = this.zoom) / 100) * (v = v * c / 100) * n * n && (g = 16777e3 / (m * v * n * n)), p != a.width() && a.width(p), a.height() != f && a.height(f + u * h.height()), r.width(p), r.height(f), a = h.filter(".pdfemb-toolbar-top"), 0 < u && r.css("top", a.height()), t = (p - (this.vscrollbar ? o : 0)) / t, 0 != this.fromZoom && 0 != this.toZoom && (r[0].scrollLeft = this.toZoom / this.fromZoom * (s + this.pccentreLeft) - this.pccentreLeft, r[0].scrollTop = this.toZoom / this.fromZoom * (d + this.pccentreTop) - this.pccentreTop), this.toZoom = this.fromZoom = 0, this.wantCanvasWidth = m, this.wantCanvasHeight = v, this.reducefactor = g, this.wantWidth = p, this.wantHeight = e, this.canvasscale = t, this.zoom = c
}, a.prototype.getTopVisiblePageNum = function () {
var pagesContainer = this.divContainer.find('.pdfemb-pagescontainer');
var innerdivs = pagesContainer.find('.pdfemb-inner-div');
var max = innerdivs.length,
min = 0, c = 0;
var marginOfError = (this.divContainer.height() / 10) * (this.zoom / 100);
while (max > min && c < 50) {
++c;
var i = min + Math.floor((max - min) / 2);
var innerdiv = innerdivs[i];
var top = Math.floor(t(innerdiv).position().top);
if (top < marginOfError) {
min = i;
} else if (top > marginOfError) {
max = i;
} else {
return i + 1; // Adjust back to 1-based page nums
}
}
return min + 1; // Adjust back to 1-based page nums
}, a.prototype.gotoPage = function (t) {
0 >= t || t > this.pageCount || (this.renderPage(t, !0), this.currentPageNum = t, this.updatePageNumDisplay(t), this.prerenderNearbyPages(t), this.deallocateFarAwayPages(t))
}, a.prototype.updatePageNumDisplay = function (e) {
var n = this.divContainer;
n.find("div.pdfemb-toolbar .pdfemb-page-num").each(function (n, o) {
(n = t(o)).is("span") ? n.text(e) : n.val(e)
}), e < this.pageCount ? n.find(".pdfemb-next").removeAttr("disabled").removeClass("pdfemb-btndisabled") : n.find(".pdfemb-next").attr("disabled", "disabled").addClass("pdfemb-btndisabled"), 1 < e ? n.find(".pdfemb-prev").removeAttr("disabled").removeClass("pdfemb-btndisabled") : n.find(".pdfemb-prev").attr("disabled", "disabled").addClass("pdfemb-btndisabled")
}, a.prototype.scrollPageIntoView = function (t) {
var pagesContainer = this.divContainer.find('.pdfemb-pagescontainer');
var innerdiv = pagesContainer.find('.pdfemb-page' + t);
if (innerdiv.length == 0) {
return;
}
var offset = innerdiv.position();
var cscrolltop = pagesContainer[0].scrollTop;
pagesContainer[0].scrollTop = cscrolltop + offset.top;
/*var e = this.divContainer.find(".pdfemb-pagescontainer"),
n = e.find(".pdfemb-page" + t);
e.find(".pdfemb-inner-div").not(".pdfemb-page" + t).hide(), n.show(), e[0].scrollTop = 0*/
}, a.prototype.renderPage = function (e, o) {
var i = this,
a = i.invalidationRound,
r = this.divContainer,
s = r.data("pdfDoc"),
d = r.find(".pdfemb-pagescontainer"),
c = d.find(".pdfemb-page" + e);
if (c.length && c.data("invalidation-round") >= a) o && i.scrollPageIntoView(e);
else {
var p = c.data("pending-drawing-round");
p >= a || (0 < p && p < a ? c.data("pending-drawing-round", a) : (c.data("pending-drawing-round", a), s.getPage(e).then(function (s) {
i.initialResize || (i.initialResize = !0, i.setSizesBasedOnPage(s), i.resizeViewer(), i.createPageInnerDivs(), i.addGrabToPan(), i.pdfembMakeMobile()), 0 == c.length && (c = d.find(".pdfemb-page" + e));
var l = c.data("widthfactor"),
h = c.data("heightfactor");
if (!l || !h) {
var u = s.getViewport(1);
l = u.width / i.pageWidth, h = u.height / i.pageHeight, c.data("widthfactor", l), c.data("heightfactor", h), 1 == l && 1 == h || i.resizeInnerDivs(e)
}
var f = c.find(".pdfemb-the-canvas");
0 == f.length && (f = t("<canvas></canvas>", {
class: "pdfemb-the-canvas"
}), c.append(f)), o && i.scrollPageIntoView(e);
var m = i.wantCanvasWidth,
v = i.wantCanvasHeight;
u = i.canvasscale;
var g = i.zoom;
f.css("width", m * l), f.css("height", v * h), i.wantMobile ? r.data("grabtopan").deactivate() : r.data("grabtopan").activate();
var b = s.getViewport(u * g / 100),
y = document.createElement("canvas");
y.width = m * n * i.reducefactor * l, y.height = v * n * i.reducefactor * h;
var w = y.getContext("2d"),
_ = function () {
f[0].width = m * n * i.reducefactor * l, f[0].height = v * n * i.reducefactor * h, i.preRenderCanvas(w, e, g);
var t = w.getImageData(0, 0, y.width, y.height);
f[0].getContext("2d").putImageData(t, 0, 0), void 0 === i.annotationLayerFactories[e] ? (t = i.annotationsLayerFactory.createAnnotationsLayerBuilder(c[0], s), i.annotationLayerFactories[e] = t) : t = i.annotationLayerFactories[e], null != t && t.setupAnnotations(b, i.divContainer.data("newwindow")), void 0 === i.textLayerFactories[e] ? (t = i.textLayerFactory.createTextLayerBuilder(c[0], s), i.textLayerFactories[e] = t) : t = i.textLayerFactories[e], null != t && t.setupText(b), c.data("invalidation-round", a), p = c.data("pending-drawing-round"), c.data("pending-drawing-round", ""), p > a && i.renderPage(e, !1)
};
s.render({
canvasContext: w,
viewport: b,
transform: [n * i.reducefactor, 0, 0, n * i.reducefactor, 0, 0]
}).promise.then(function () {
"requestAnimationFrame" in window ? window.requestAnimationFrame(_) : setTimeout(_, 1)
})
})))
}
}, a.prototype.changeZoom = function (t) {
var e = this.divContainer,
n = this.zoom;
this.zoom = t = n + t, e.find("span.pdfemb-zoom").text(t + "%"), this.fromZoom = n, this.toZoom = t, e = e.find(".pdfemb-pagescontainer"), this.pccentreLeft = e.width() / 2, this.pccentreTop = e.height() / 2, this.resizeViewer(), this.resizeInnerDivs(), this.invalidateAllPages(), this.renderPage(this.currentPageNum), this.prerenderNearbyPages(this.currentPageNum)
}, a.prototype.queueRenderPage = function (t, e) {
this.renderPage(t, e)
}, a.prototype.addToolbar = function (e, n, o) {
var i = this.divContainer,
a = this,
r = t("<div></div>", {
class: "pdfemb-toolbar pdfemb-toolbar" + (n ? "-fixed" : "-hover") + " " + (e ? " pdfemb-toolbar-top" : "pdfemb-toolbar-bottom")
}),
s = t('<button class="pdfemb-prev" title="' + wpmf_pdfemb_trans.objectL10n.prev + '" type="button"></button>');
r.append(s);
var d = t('<button class="pdfemb-next" title="' + wpmf_pdfemb_trans.objectL10n.next + '" type="button"></button>');
r.append(d), r.append(t('<div class="pdfemb-page-area">' + wpmf_pdfemb_trans.objectL10n.page + ' <span class="pdfemb-page-num">0</span> / <span class="pdfemb-page-count"></span></div>'));
var c = t('<button class="pdfemb-zoomout" title="' + wpmf_pdfemb_trans.objectL10n.zoomout + '" type="button"></button>');
r.append(c);
var p = t('<button class="pdfemb-zoomin" title="' + wpmf_pdfemb_trans.objectL10n.zoomin + '" type="button"></button>');
r.append(p), r.append(t("<div>" + wpmf_pdfemb_trans.objectL10n.zoom + ' <span class="pdfemb-zoom">100%</span></div>')), o && r.append(t("<div>" + wpmf_pdfemb_trans.objectL10n.secure + "</div>")), e ? i.prepend(r) : i.append(r), s.on("click", function (t) {
1 >= a.currentPageNum || (a.gotoPage(a.currentPageNum - 1), a.jumpToTop())
}), d.on("click", function (t) {
a.currentPageNum >= a.pageCount || 0 == a.currentPageNum || (a.gotoPage(a.currentPageNum + 1), a.jumpToTop())
}), p.on("click", function (t) {
500 <= a.zoom || a.changeZoom(10)
}), c.on("click", function (t) {
20 >= a.zoom || a.changeZoom(-10)
}), a.addMoreToolbar(r), n || (i.on("mouseenter", function (t) {
!0 !== (t = i.find("div.pdfemb-toolbar-hover")).data("no-hover") && t.show()
}), i.on("mouseleave", function (t) {
i.find("div.pdfemb-toolbar-hover").hide()
}), i.on("pdfembTouchTapped", function (t) {
if (t.stopPropagation(), t.preventDefault(), !a.locktaps) {
a.locktaps = !0;
var e = (t = i.find("div.pdfemb-toolbar-hover")).is(":visible");
1 == t.data("no-hover") && (e = !0), e ? t.hide() : t.show(), setTimeout(function () {
a.locktaps = !1
}, 250)
}
})), wpmf_pdfemb_trans.poweredby && r.append(t("<div></div>", {
class: "pdfemb-poweredby"
}).append(t('<a href="https://wp-pdf.com/?utm_source=Poweredby&utm_medium=freemium&utm_campaign=Freemium" target="_blank">wp-pdf.com</a>')))
}, a.prototype.magnifyEvent = function (t) {
var e = t.originalEvent.magnification;
if (-1 == e) this.resizeViewer(), this.resizeInnerDivs(), this.invalidateAllPages(), this.renderPage(this.getTopVisiblePageNum());
else {
var n = this.divContainer.find(".pdfemb-pagescontainer").offset();
this.magnifyZoom(e, t.originalEvent.centreLeft - n.left, t.originalEvent.centreTop - n.top)
}
}, a.prototype.magnifyZoom = function (t, e, n) {
var o = this.zoom;
20 > (t = Math.floor(o * t)) && (t = 20), 500 < t && (t = 500), this.zoom = t, this.divContainer.find("span.pdfemb-zoom").text(t + "%"), this.fromZoom = o, this.toZoom = t, this.pccentreLeft = e, this.pccentreTop = n, this.resizeViewer(), this.resizeInnerDivs(), this.invalidateAllPages()
}, a.prototype.pdfembWantMobile = function (t, e) {
return !1
}, a.prototype.pdfembMakeMobile = function () {
}, a.prototype.addMoreToolbar = function (t) {
}, a.prototype.jumpToTop = function () {
}, a.prototype.preRenderCanvas = function (t, e, n) {
}, PDFEMB_NS.pdfembPagesViewer = a
}), jQuery(document).ready(function (t) {
var e = PDFEMB_NS.pdfembPagesViewer,
n = function () {
e.apply(this, arguments)
};
n.prototype = new e, wpmf_pdfemb_trans.continousscroll && (n.prototype.scrollPageIntoView = function (t) {
var e = this.divContainer.find(".pdfemb-pagescontainer");
0 != (t = e.find(".pdfemb-page" + t)).length && (t = t.position(), e[0].scrollTop += t.top)
}, n.prototype.getTopVisiblePageNum = function () {
var pagesContainer = this.divContainer.find('.pdfemb-pagescontainer');
var innerdivs = pagesContainer.find('.pdfemb-inner-div');
var max = innerdivs.length,
min = 0, c = 0;
var marginOfError = (this.divContainer.height() / 10) * (this.zoom / 100);
while (max > min && c < 50) {
++c;
var i = min + Math.floor((max - min) / 2);
var innerdiv = innerdivs[i];
var top = Math.floor($(innerdiv).position().top);
if (top < marginOfError) {
min = i;
} else if (top > marginOfError) {
max = i;
} else {
return i + 1; // Adjust back to 1-based page nums
}
}
return min + 1; // Adjust back to 1-based page nums
}), n.prototype.pdfembWantMobile = function (t, e) {
return "on" != (e = this.divContainer).data("fullScreen") && (e = parseInt(e.data("mobile-width"), 10), (isNaN(e) || 0 > e) && (e = 500), t < e)
}, n.prototype.pdfembMakeMobile = function () {
var e = this.wantMobile,
n = this.divContainer;
if (n.find("div.pdfemb-pagescontainer"), e) {
if (0 == n.find(".pdfemb-wantmobile").length) {
e = t("<div></div>", {
class: "pdfemb-inner-div-wantmobile pdfemb-wantmobile"
});
var o = t("<div></div>", {
class: "pdfemb-wantmobile-fsarea"
}),
i = t("<div></div>", {
class: "pdfemb-inner-div-wantmobile-fswrap pdfemb-wantmobile"
}).append(o.append(document.createTextNode(wpmf_pdfemb_trans.objectL10n.viewinfullscreen)));
this.bindFullScreen(o), n.prepend(e), n.prepend(i), n.find(".pdfemb-toolbar-fixed").hide(), n.find(".pdfemb-toolbar-hover").data("no-hover", !0)
}
} else n.find(".pdfemb-wantmobile").remove(), n.find(".pdfemb-toolbar-fixed").show(), n.find(".pdfemb-toolbar-hover").data("no-hover", !1)
}, e.prototype.addMoreToolbar = function (e) {
var n = this,
o = n.divContainer;
if ("on" == o.data("download")) {
var i = t('<button class="pdfemb-download" title="' + wpmf_pdfemb_trans.objectL10n.download + '" type="button"></button>'),
a = o.data("pdf-url");
a && (i.on("click", function (t) {
n.download(a, o.data("download-nonce"), o.data("tracking"))
}), e.append(i))
}
i = t('<button class="pdfemb-fs" title="' + wpmf_pdfemb_trans.objectL10n.fullscreen + '" type="button"></button>'), "on" == o.data("fullScreen") ? (i.addClass("pdfemb-toggled"), i.on("click", function (t) {
o.closest(".pdfemb-fsp-wrapper").trigger("closePopup"), o.data("fullScreenClosed", "true")
})) : n.bindFullScreen(i), e.append(i);
var r = e.find("div.pdfemb-page-area"),
s = r.find("span.pdfemb-page-num");
e = function () {
var e = t("<input />", {
type: "text",
class: "pdfemb-page-num"
});
e.on("keyup", function (t) {
(keyCode = t.keyCode ? t.keyCode : 13 == t.which) && (t = parseInt(e.val()), !isNaN(t) && 0 < t && o.trigger("pdfembGotopage", t))
}), e.val(s.text()), s.replaceWith(e), r.off("click")
}, "on" == o.data("pagetextbox") ? e() : r.on("click", e)
}, e.prototype.download = function (t, e, n) {
void 0 !== e && "" != e && (t += "&pdfemb-nonce=" + e), setTimeout(function () {
window.open(t)
}, 100), "on" == n && jQuery.post(wpmf_pdfemb_trans.ajaxurl, {
action: "pdfemb_count_download",
pdf_url: t
}, function (t) {
})
}, e.prototype.bindFullScreen = function (e) {
var n = this,
o = n.divContainer;
e.fullScreenPopup({
popup: function () {
var e = n.pdfDoc,
i = n.currentPageNum,
a = o.data("showIsSecure"),
r = o.data("pdf-url"),
s = o.data("scrollbar"),
d = o.data("download"),
c = o.data("tracking"),
p = o.data("newwindow"),
l = o.data("scrolltotop"),
h = o.data("download-nonce"),
u = o.data("disablerightclick"),
f = o.data("pagetextbox"),
m = o.data("startzoom"),
v = o.data("startfpzoom"),
g = t('<div class="pdfemb-viewer"></div>');
return g.data("pdfDoc", e), g.data("pagenum", i), g.data("showIsSecure", a), g.data("pdf-url", r), g.data("scrollbar", s), g.data("download", d), g.data("tracking", c), g.data("newwindow", p), g.data("scrolltotop", l), g.data("disablerightclick", u), g.data("pagetextbox", f), g.data("startzoom", m), g.data("startfpzoom", v), g.data("width", "max"), g.data("height", "auto"), g.data("toolbar", "bottom"), g.data("toolbar-fixed", "on"), g.data("fullScreen", "on"), void 0 !== h && g.data("download-nonce", h), g.pdfEmbedder(), t(document).on("keyup", function (t) {
var e = g.find(".pdfemb-pagescontainer");
if (33 == (t = t.keyCode ? t.keyCode : t.which)) e.trigger("pdfembGotoAction", "PrevPage");
else if (34 == t) e.trigger("pdfembGotoAction", "NextPage");
else if (37 <= t && 40 >= t) {
var n = document.createEvent("Event");
n.initEvent("pdfembKeyboardPan", !0, !1), n.detail = {
keyCode: t
}, g.find(".grab-to-pan-grab").each(function (t, e) {
e.dispatchEvent(n)
})
} else 187 == t || 109 == t || 61 == t || 43 == t ? e.trigger("changeZoom", 10) : (189 == t || 107 == t || 45 == t || 173 == t) && e.trigger("changeZoom", -10)
}), g
},
close: !1,
mainWrapperClass: "pdfemb-fsp-wrapper",
contentWrapperClass: "pdfemb-fsp-content",
inlineStyles: !1
})
}, e.prototype.jumpToTop = function () {
var t = this.divContainer;
0 < t.length && "scrollIntoView" in t[0] && "on" == t.data("scrolltotop") && t[0].scrollIntoView()
}, e.prototype.preRenderCanvas = function (e, n, o) {
var i = this.divContainer;
if (o = wpmf_pdfemb_trans.watermark_map, t.isArray(o) && 0 != o.length && -1 !== i.data("pdf-url").search("/?pdfemb-serveurl=") && (void 0 === wpmf_pdfemb_trans.watermark_evenpagesonly || !wpmf_pdfemb_trans.watermark_evenpagesonly || 0 == n % 2)) {
n = 5, i = 10;
for (var a, r = "center", s = 45, d = 0; d < o.length; ++d) {
var c = o[d];
if (t.isArray(c) && 1 <= c.length) {
var p = c[0];
if (e.save(), e.lineWidth = 1, e.fillStyle = "#444444", e.lineStyle = "#111111", e.textAlign = "left", e.font = "20pt sans-serif", e.globalAlpha = .1, 2 <= c.length && (n = c[1], 3 <= c.length && (i = c[2], 4 <= c.length && (r = c[3], 5 <= c.length && (s = c[4], 6 <= c.length && (a = c[5], e.font = Math.round(e.canvas.width / 1e3 * a * 100) / 100 + "pt sans-serif", 7 <= c.length && "object" == typeof c[6]))))))
for (var l in a = c[6]) e[l] = a[l];
var h = e.measureText(p).width;
c = e.canvas.height * i / 100, "left" == r ? (a = e.canvas.width * n / 100, h = 0) : "right" == r ? (a = e.canvas.width * (1 - n / 100), h = -h) : (a = e.canvas.width / 2, h = -h / 2), e.translate(a, c), e.rotate(-Math.PI * s / 360), e.fillText(p, h, 0), e.restore(), i += 10
}
}
}
}, PDFEMB_NS.pdfembPagesViewerUsable = n;
var o = function () {
function t(t) {
this.pageDiv = t.pageDiv, this.pdfPage = t.pdfPage, this.linkService = t.linkService, this.div = null
}
return t.prototype = {
setupAnnotations: function (t, e) {
var n = this.pdfPage,
o = this;
n.getAnnotations({
intent: "display"
}).then(function (i) {
t = t.clone({
dontFlip: !0
}), parameters = {
viewport: t,
div: o.pageDiv,
annotations: i,
page: n,
linkService: o.linkService
}, o.div ? PDFJS.AnnotationLayer.update(parameters) : 0 !== i.length && (o.div = document.createElement("div"), o.div.className = "annotationLayer pdfembAnnotationLayer", o.pageDiv.appendChild(o.div), parameters.div = o.div, PDFJS.AnnotationLayer.render(parameters), "undefined" != typeof mozL10n && mozL10n.translate(o.div), i = o.pageDiv.getElementsByTagName("canvas")[0], o.div.style.left = i.style.left, o.div.style.top = i.style.top, jQuery(o.div).find("a").each(function (t, n) {
"on" == e && (n.target = "_blank"), n.title = "", jQuery(n).on("touchstart", function (t) {
t.stopPropagation()
})
}))
})
},
hide: function () {
this.div && this.div.setAttribute("hidden", "true")
}
}, t
}();
PDFEMB_NS.pdfembPremiumAnnotationsLayerFactory = function () {
}, PDFEMB_NS.pdfembPremiumAnnotationsLayerFactory.prototype = {
createAnnotationsLayerBuilder: function (t, e) {
return new o({
pageDiv: t,
pdfPage: e,
linkService: new i(t)
})
}
};
var i = function () {
function t(t) {
this.pageDiv = t
}
return t.prototype = {
navigateTo: function (t) {
t && jQuery(this.pageDiv).parent().trigger("pdfembGotoHash", {
dest: t
})
},
getDestinationHash: function (t) {
return "#"
},
getAnchorUrl: function (t) {
return "#"
},
setHash: function (t) {
},
executeNamedAction: function (t) {
t && jQuery(this.pageDiv).parent().trigger("pdfembGotoAction", t)
},
cachePageRef: function (t, e) {
}
}, t
}(),
a = function () {
function t(t) {
this.pageDiv = t.pageDiv, this.pdfPage = t.pdfPage, this.linkService = t.linkService, this.div = null
}
return t.prototype = {
setupText: function (t) {
var e = this.pdfPage,
n = this;
e.getTextContent({}).then(function (o) {
if (t = t.clone({
dontFlip: !1
}), parameters = {
viewport: t,
textContent: o,
page: e,
enhanceTextSelection: !0
}, 0 !== o.length) {
if (0 < (o = n.pageDiv.getElementsByClassName("pdfembTextLayer")).length)
for (n.div = o[0]; n.div.firstChild;) n.div.removeChild(n.div.firstChild);
else n.div = document.createElement("div"), n.div.className = "textLayer pdfembTextLayer", n.pageDiv.appendChild(n.div);
parameters.container = n.div, PDFJS.renderTextLayer(parameters), "undefined" != typeof mozL10n && mozL10n.translate(n.div)
}
})
},
hide: function () {
this.div && this.div.setAttribute("hidden", "true")
}
}, t
}();
PDFEMB_NS.pdfembPremiumTextLayerFactory = function () {
}, PDFEMB_NS.pdfembPremiumTextLayerFactory.prototype = {
createTextLayerBuilder: function (t, e) {
return new a({
pageDiv: t,
pdfPage: e,
linkService: new i(t)
})
}
}, PDFEMB_NS.pdfembCustomStyle = function () {
function t() {
}
var e = ["ms", "Moz", "Webkit", "O"],
n = {};
return t.getProp = function (t, o) {
if (1 === arguments.length && "string" == typeof n[t]) return n[t];
var i = (o = o || document.documentElement).style;
if ("string" == typeof i[t]) return n[t] = t;
for (var a = t.charAt(0).toUpperCase() + t.slice(1), r = 0, s = e.length; r < s; r++) {
var d = e[r] + a;
if ("string" == typeof i[d]) return n[t] = d
}
return n[t] = "undefined"
}, t.setProp = function (t, e, n) {
"undefined" !== (t = this.getProp(t)) && (e.style[t] = n)
}, t
}()
}), PDFEMB_NS.pdfembGetPDF = function (t, e) {
if(typeof t !== "undefined") {
-1 == t.search("/?pdfemb-serveurl=") ? e(t, !1) : (PDFEMB_NS.pdfembAddAjaxBufferTransport(), jQuery.ajax({
dataType: "arraybuffer",
type: "POST",
url: t
}).done(function (t) {
PDFEMB_NS.pdfemb_rc4ab(wpmf_pdfemb_trans.k, t), t = new Uint8Array(t), e(t, wpmf_pdfemb_trans.is_admin)
}).fail(function (t, n, o) {
e(null, wpmf_pdfemb_trans.is_admin)
}))
}
}, PDFEMB_NS.pdfembAddAjaxBufferTransport_added = !1, PDFEMB_NS.pdfembAddAjaxBufferTransport = function () {
PDFEMB_NS.pdfembAddAjaxBufferTransport_added || (PDFEMB_NS.pdfembAddAjaxBufferTransport_added = !0, jQuery.ajaxTransport("+*", function (t, e, n) {
if (window.FormData && (t.dataType && ("blob" == t.dataType || "arraybuffer" == t.dataType) || t.data && (window.Blob && t.data instanceof Blob || window.ArrayBuffer && t.data instanceof ArrayBuffer))) return {
send: function (e, n) {
var o = new XMLHttpRequest;
e = t.url || window.location.href;
var i = t.type || "GET",
a = t.dataType || "text",
r = t.data || null,
s = t.async || !0;
o.addEventListener("load", function () {
var t = {};
t[a] = o.response, n(o.status, o.statusText, t, o.getAllResponseHeaders())
}), o.open(i, e, s), o.responseType = a, o.send(r)
},
abort: function () {
n.abort()
}
}
}))
}, PDFEMB_NS.pdfemb_rc4ab = function (t, e) {
var n = [],
o = 0,
i = new DataView(e),
a = 0;
239 == i.getUint8(0) && 187 == i.getUint8(1) && 191 == i.getUint8(2) && (a = 3);
for (var r = 0; 256 > r; r++) n[r] = r;
for (r = 0; 256 > r; r++) {
o = (o + n[r] + t.charCodeAt(r % t.length)) % 256;
var s = n[r];
n[r] = n[o], n[o] = s
}
for (o = r = 0, t = a; t < e.byteLength; t++) o = (o + n[r = (r + 1) % 256]) % 256, s = n[r], n[r] = n[o], n[o] = s, input = i.getUint8(t), output = input ^ n[(n[r] + n[o]) % 256], i.setUint8(t, output)
}, jQuery(document).ready(function (t) {
if (typeof PDFJS === "undefined") {
return;
}
t.fn.pdfEmbedder = function () {
return this.each(function (e, n) {
if ((e = t(n)).is("a")) {
n = e.data();
var o = t("<div></div>", {
class: e.attr("class"),
style: e.attr("style")
});
o.data(t.extend({
"pdf-url": e.attr("href")
}, n)), e.replaceWith(o)
} else o = e;
o.append(t("<div></div>", {
class: "pdfemb-loadingmsg"
}).append(document.createTextNode(wpmf_pdfemb_trans.objectL10n.loading))), "on" == o.data("disablerightclick") && o.bind("contextmenu", function (t) {
t.preventDefault()
});
var i = function (t, e) {
new PDFEMB_NS.pdfembPagesViewerUsable(t, o, e).setup()
};
e = function (e, n) {
null === e ? o.empty().append(t("<div></div>", {
class: "pdfemb-errormsg"
}).append(msgnode = t("<span></span>").append(document.createTextNode("Failed to load and decrypt PDF")))) : PDFJS.getDocument(e).then(function (t) {
i(t, n)
}, function (e) {
var n = document.createTextNode(e.message);
"UnknownErrorException" == e.name && "Failed to fetch" == e.message && (n = t("<span></span>").append(document.createTextNode(e.message + " " + wpmf_pdfemb_trans.objectL10n.domainerror + " ")).append(t('<a href="https://www.joomunited.com/documentation/wp-media-folder-documentation" target="_blank">' + wpmf_pdfemb_trans.objectL10n.clickhereinfo + "</a>"))), o.empty().append(t("<div></div>", {
class: "pdfemb-errormsg"
}).append(n))
})
}, o.data("pdfDoc") ? i(o.data("pdfDoc"), o.data("showIsSecure")) : (n = o.data("pdf-url"), PDFEMB_NS.pdfembGetPDF(n, e))
}), this
}, PDFJS.workerSrc = wpmf_pdfemb_trans.worker_src, PDFJS.cMapUrl = wpmf_pdfemb_trans.cmap_url, PDFJS.cMapPacked = !0, t(".wpmf-pdfemb-viewer").pdfEmbedder()
});