"));
}
var c = o.find(".annotationDiv");
c.empty();
if (
s.options.pageSize == t.PAGE_SIZE.DOUBLEINTERNAL &&
r > 2 &&
r % 2 == 1
) {
c.css({ left: "-100%" });
} else if (r == 1) {
c.css({ left: "" });
}
pdfjsLib.AnnotationLayer.render({
annotations: l,
div: c[0],
page: e,
viewport: a,
imageResourcesPath: n.imageResourcesPath,
linkService: s.linkService,
});
if (s.options.annotationClass && s.options.annotationClass !== "") {
c.find(" > section").addClass(s.options.annotationClass);
}
if (s.options.search == true) {
if (o.find(".textLayerDiv").length == 0) {
o.append(i("
"));
}
var u = o.find(".textLayerDiv");
e.getTextContent().then(function (e) {
var i = new t.TextLayerBuilder({
textLayerDiv: u[0],
pageIndex: null,
viewport: a.clone({ dontFlip: false }),
});
i.setTextContent(e);
i.render();
});
}
});
};
return a;
})({});
var K = (function () {
function e(e) {
this.angles = e.angles || [0, 0, 0, 0, 0, 0];
this.stiffness = e.angles || 0.1;
this.segments = e.segments || 1;
this.canvasMode =
e.contentSourceType !== c.IMAGE && e.canvasToBlob == false;
this.initDOM();
}
function a(e) {
var t = (e.contentLayer = i(h.div, { class: "df-page-content" }));
e.append(t);
}
e.prototype = {
initDOM: function () {
var e = (this.element = i(h.div, { class: "df-book-page" }));
var t = (this.wrapper = i(h.div, { class: "df-page-wrapper" }));
var n = (this.front = i(h.div, { class: "df-page-front" }));
var o = (this.back = i(h.div, { class: "df-page-back" }));
var r = (this.foldInnerShadow = i(h.div, {
class: "df-page-fold-inner-shadow",
}));
var s = (this.foldOuterShadow = i(h.div, {
class: "df-page-fold-outer-shadow",
}));
this.frontIMG = new Image();
this.backIMG = new Image();
a(n, this.segments, true);
a(o, this.segments, false);
e.append(t).append(s);
t.append(n).append(o).append(r);
},
updatePoint: function (e) {
if (e == null) return;
var i =
this.parent.dragPage != null
? this.parent.dragPage
: e.page != null
? e.page
: this;
var n = i.element.width(),
a = i.element.height();
var o = this.parent.corner != null ? this.parent.corner : e.corner,
r = t.CORNERS;
var s = i.side == d.right,
l = o == r.BL || o == r.BR;
e.rx = s == true ? n * 2 - e.x : e.x;
e.ry = l == true ? a - e.y : e.y;
var c = Math.atan2(e.ry, e.rx);
c = Math.PI / 2 - S(c, 0, v(90));
var u = s ? e.x / 2 : n - e.x / 2,
f = e.ry / 2,
h = Math.max(0, Math.sin(c - Math.atan2(f, u)) * E(u, f)),
p = 0.5 * E(e.rx, e.ry);
var g = Math.round(n - h * Math.sin(c)),
b = Math.round(h * Math.cos(c)),
x = m(c);
var y = l ? (s ? 180 + (90 - x) : 180 + x) : s ? x : 90 - x;
var C = l ? (s ? 180 + (90 - x) : x) : s ? x + 180 : y,
L = l ? (s ? 90 - x : x + 90) : s ? y - 90 : y + 180,
I = s ? n - g : g,
T = l ? a + b : -b,
k = s ? -g : g - n,
O = l ? -a - b : b;
var R = S((e.distance * 0.5) / n, 0, 0.5);
var F = S(((n * 2 - e.rx) * 0.5) / n, 0.05, 0.3);
i.element.addClass("df-folding");
var M = s ? i.back : i.front;
var D = s ? i.front : i.back;
var A = i.foldOuterShadow;
var z = i.foldInnerShadow;
i.wrapper.css({ transform: w(I, T) + P(y) });
M.css({ transform: P(-y) + w(-I, -T) });
D.css({
transform: P(C) + w(k, O),
boxShadow: "rgba(0, 0, 0, " + R + ") 0px 0px 20px",
});
z.css({
transform: P(C) + w(k, O),
opacity: F / 2,
backgroundImage:
N.css +
"linear-gradient( " +
L +
"deg, rgba(0, 0, 0, 0.25) , rgb(0, 0, 0) " +
p * 0.7 +
"px, rgb(255, 255, 255) " +
p +
"px)",
});
A.css({
opacity: F / 2,
left: s ? "auto" : 0,
right: s ? 0 : "auto",
backgroundImage:
N.css +
"linear-gradient( " +
(-L + 180) +
"deg, rgba(0, 0, 0,0) " +
p / 3 +
"px, rgb(0, 0, 0) " +
p +
"px)",
});
},
updateAngle: function (e, t) {
var i = this.element.width() * 5;
this.wrapper.css({
perspective: i,
perspectiveOrigin: t == true ? "0% 50%" : "100% 50%",
});
this.front.css({
display:
t == true
? e <= -90
? "block"
: "none"
: e < 90
? "block"
: "none",
transform:
(N.dom !== "MfS" ? "" : "perspective(" + i + "px) ") +
(t == true ? "translateX(-100%) " : "") +
"rotateY(" +
((t == true ? 180 : 0) + e) +
"deg)",
});
this.back.css({
display:
t == true
? e > -90
? "block"
: "none"
: e >= 90
? "block"
: "none",
transform:
(N.dom !== "MSd" ? "" : "perspective(" + i + "px) ") +
(t == false ? "translateX(100%) " : "") +
"rotateY(" +
((t == false ? -180 : 0) + e) +
"deg)",
});
return;
},
tween: function (e) {
var i = this;
if (i == null || i.parent == null) return;
var n = A(i.parent);
var a = i.side == d.right;
var o = i.parent.direction == t.DIRECTION.RTL;
var r =
i.parent.corner == t.CORNERS.BL || i.parent.corner == t.CORNERS.BR;
var s = i.magnetic == true;
var l = r ? i.parent.height : 0;
var c,
u,
f,
h = 0;
var p = (i.end =
i && i.animateToReset == true
? { x: a ? i.parent.fullWidth : 0, y: l }
: { x: a ? 0 : i.parent.fullWidth, y: l });
i.ease = i.isHard
? TWEEN.Easing.Quadratic.InOut
: TWEEN.Easing.Linear.None;
var g = i.parent.duration;
if (i.isHard == true) {
if (e != null) {
h = T(e.distance, e.fullWidth);
}
c = i.init = { angle: h * (a ? -1 : 1) };
p = i.end =
i && i.animateToReset == true
? { angle: a ? 0 : -0 }
: { angle: a ? -180 : 180 };
} else {
if (e == null) {
c = i.init =
i && i.animateToReset == true
? { x: a ? 0 : i.parent.fullWidth, y: 0 }
: { x: a ? i.parent.fullWidth : 0, y: 0 };
u = i.first = { x: ((a ? 3 : 1) * i.parent.fullWidth) / 4, y: 0 };
f = i.mid = { x: ((a ? 1 : 3) * i.parent.fullWidth) / 4, y: 0 };
} else {
c = i.init = { x: e.x, y: e.y, opacity: 1 };
u = i.first = { x: (e.x * 3) / 4, y: (e.y * 3) / 4, opacity: 1 };
f = i.mid = { x: e.x / 4, y: e.y / 4, opacity: 1 };
g =
(i.parent.duration * I(c.x, c.y, p.x, p.y)) / i.parent.fullWidth;
g = S(g, i.parent.duration / 3, i.parent.duration);
}
}
c.index = 0;
p.index = 1;
i.isFlipping = true;
var v = function (e) {
if (i.isHard == true) {
i.updateAngle(e.angle, a);
i.angle = e.angle;
} else {
i.updatePoint({ x: e.x, y: e.y });
i.x = e.x;
i.y = e.y;
}
if (n && !s)
i.element[0].style.opacity =
(a && !o) || (!a && o)
? e.index > 0.5
? 2 * (1 - e.index)
: 1
: e.index < 0.5
? 2 * e.index
: 1;
};
if (n && ((!a && !o) || (a && o))) i.element[0].style.opacity = 0;
var m = (i.completeTween =
i.completeTween ||
function (e) {
i.isFlipping = false;
if (i.isHard == true) {
i.updateAngle(i.end.angle);
i.back.css({ display: "block" });
i.front.css({ display: "block" });
} else {
i.updatePoint({ x: i.end.x, y: i.end.y });
}
i.element[0].style.opacity = 1;
if (i.animateToReset !== true) {
i.side = i.side == d.right ? d.left : d.right;
} else i.animateToReset = null;
i.currentTween = null;
i.pendingPoint = null;
i.magnetic = false;
i.parent.dragPage = null;
i.parent.corner = t.CORNERS.NONE;
if (e != true) i.parent.refresh();
});
if (i.isHard == true) {
i.currentTween = new TWEEN.Tween(c)
.delay(0)
.to(p, i.parent.duration)
.onUpdate(function () {
v(this);
})
.easing(i.ease)
.onComplete(i.completeTween)
.start();
} else {
if (e == null) {
i.currentTween = new TWEEN.Tween(c)
.delay(0)
.to(p, i.parent.duration)
.onUpdate(function () {
v(this);
})
.easing(TWEEN.Easing.Sinusoidal.Out)
.onComplete(i.completeTween)
.start();
} else {
i.currentTween = new TWEEN.Tween(c)
.delay(0)
.to(p, g)
.onUpdate(function () {
v(this);
})
.easing(TWEEN.Easing.Sinusoidal.Out)
.onComplete(i.completeTween);
i.currentTween.start();
}
}
},
frontImage: function (e, t) {
var a = this;
function o() {
a.front.css({ backgroundImage: C(e) });
if (t != null) t();
}
if (a.canvasMode == true) {
a.front.find(">canvas").remove();
if (e !== n.textureLoadFallback) {
a.front.append(i(e));
}
if (t != null) t();
} else {
if (e == n.textureLoadFallback) {
o();
} else {
a.frontIMG.onload = o;
a.frontIMG.src = e;
}
}
},
backImage: function (e, t) {
var a = this;
function o() {
a.back.css({ backgroundImage: C(e) });
if (t != null) t();
}
if (a.canvasMode == true) {
a.back.find(">canvas").remove();
if (e !== n.textureLoadFallback) {
a.back.append(i(e));
}
if (t != null) t();
} else {
if (e == n.textureLoadFallback) {
o();
} else {
a.backIMG.onload = o;
a.backIMG.src = e;
}
}
},
updateCSS: function (e) {
this.element.css(e);
},
resetCSS: function () {
this.wrapper.css({ transform: "" });
this.front.css({ transform: "", boxShadow: "" });
this.back.css({ transform: "", boxShadow: "" });
},
clearTween: function (e) {
this.currentTween.stop();
this.completeTween(e == true);
this.resetCSS();
},
};
return e;
})();
var X = (function (e) {
H(s, e);
function o(e) {
e.parent.container.find(".df-folding").removeClass("df-folding");
e.element.addClass("df-folding");
}
function r(e) {
var t = false;
for (var i = 0; i < e.pages.length; i++) {
var n = e.pages[i];
if (n.isFlipping == true) {
t = true;
break;
}
}
return t;
}
function s(e, n) {
var s = this;
s.type = "BookCSS";
s.images = e.images || [];
s.pageCount = e.pageCount || 1;
s.foldSense = 50;
s.stackCount = 4;
s.mode = "css";
s.pages = [];
s.duration = e.duration;
s.container = i(n);
s.options = e;
s.drag = d.none;
s.pageMode =
e.pageMode ||
(B || s.pageCount <= 2 ? t.PAGE_MODE.SINGLE : t.PAGE_MODE.DOUBLE);
s.singlePageMode =
e.singlePageMode ||
(B ? t.SINGLE_PAGE_MODE.BOOKLET : t.SINGLE_PAGE_MODE.ZOOM);
s.swipe_threshold = B ? 15 : 50;
s.direction = e.direction || t.DIRECTION.LTR;
s.startPage = 1;
s.endPage = s.pageCount;
s._activePage = e.openPage || s.startPage;
s.hardConfig = e.hard;
a =
"WebKitCSSMatrix" in window ||
(document.body && "MozPerspective" in document.body.style);
s.animateF = function () {
if (TWEEN.getAll().length > 0) TWEEN.update();
else clearInterval(s.animate);
};
s.init(e);
s.skipDrag = false;
function c(e) {
if (s.dragPage != e.page && e.page.visible == true) {
s.dragPage.clearTween(true);
s.dragPage = e.page;
s.corner = e.corner;
s.dragPage.pendingPoint = e;
}
}
var u = function (e) {
var i = s.eventToPoint(e);
if (
e.touches != null &&
e.touches.length == 2 &&
s.startTouches != null
) {
s.zoomDirty = true;
var n = l.getVectorAvg(l.getTouches(e, s.container.offset())),
a = l.calculateScale(s.startTouches, l.getTouches(e)),
o = a / s.lastScale;
var c = s.contentProvider.zoomScale,
u = n.x,
f = n.y;
s.stage.css({
transform:
"translate3d(" +
s.left +
"px," +
s.top +
"px,0) scale3d(" +
a +
"," +
a +
",1)",
});
s.lastScale = a;
s.lastZoomCenter = n;
e.preventDefault();
}
if (
(e.touches != null && e.touches.length > 1) ||
s.startPoint == null ||
s.startTouches != null
)
return;
var h = s.dragPage || i.page;
if (s.contentProvider.zoomScale !== 1) {
if (e.touches != null || s.isPanning == true) {
s.pan(i);
e.preventDefault();
}
} else {
if (s.skipDrag !== true) {
var p = i.distance;
if (!r(s)) {
if (s.dragPage != null || i.isInside == true) {
if (s.dragPage != null) {
k("set mouse down move");
} else {
i.y = S(i.y, 1, s.height - 1);
i.x = S(i.x, 1, i.fullWidth - 1);
}
var g = s.corner || i.corner;
if (h.isHard) {
var v = g == t.CORNERS.BR || g == t.CORNERS.TR;
var m = T(i.distance, i.fullWidth);
h.updateAngle(m * (v ? -1 : 1), v);
} else {
h.updatePoint(i, s);
}
h.magnetic = true;
h.magneticCorner = i.corner;
e.preventDefault();
}
if (
s.dragPage == null &&
h != null &&
i.isInside == false &&
h.magnetic == true
) {
h.pendingPoint = i;
h.animateToReset = true;
s.corner = h.magneticCorner;
s.animatePage(h);
h.pendingPoint = null;
h.magnetic = false;
h.magneticCorner = null;
}
if (
s.isPanning == true &&
s.dragPage == null &&
s.contentProvider.zoomScale == 1
) {
var b = i.x - s.lastPos,
w = performance.now() - s.lastTime;
if (Math.abs(b) > s.swipe_threshold) {
if (b < 0) {
s.next();
} else {
s.prev();
}
s.drag = d.none;
s.isPanning = false;
e.preventDefault();
}
s.lastPos = i.x;
s.lastTime = performance.now();
}
}
}
}
},
f = function (e) {
if (e.touches != null && e.touches.length == 0) {
var i = s.contentProvider.zoomScale;
if (s.zoomDirty == true) {
s.previewObject.contentProvider.zoomScale = l.limitAt(
s.previewObject.contentProvider.zoomScale * s.lastScale,
1,
s.previewObject.contentProvider.maxZoom
);
s.previewObject.zoomValue =
s.previewObject.contentProvider.zoomScale * 1;
s.previewObject.resize();
s.zoomDirty = false;
}
s.wrapper.css({ transform: "" });
s.lastScale = null;
s.startTouches = null;
}
s.isPanning = false;
if (e.touches != null && e.touches.length > 1) return;
if (s.skipDrag !== true) {
var n = s.eventToPoint(e);
if (s.dragPage) {
e.preventDefault();
s.dragPage.pendingPoint = n;
if (
n.x == s.startPoint.x &&
n.y == s.startPoint.y &&
n.isInside == true
) {
if (s.corner == t.CORNERS.BR || s.corner == t.CORNERS.TR) {
c(n);
if (s.dragPage.isFlipping !== true) s.next();
} else if (
s.corner == t.CORNERS.BL ||
s.corner == t.CORNERS.TL
) {
c(n);
if (s.dragPage.isFlipping !== true) s.prev();
}
} else if (s.dragPage.isFlipping !== true) {
if (n.distance > n.fullWidth / 2) {
if (n.x > n.fullWidth / 2) s.prev();
else s.next();
} else {
s.dragPage.animateToReset = true;
s.animatePage(s.dragPage);
}
}
if (s.dragPage) {
s.dragPage.pendingPoint = null;
s.dragPage.magnetic = false;
}
} else {
}
s.drag = d.none;
}
},
h = function (e) {
var i = s.eventToPoint(e);
var n = e.srcElement || e.originalTarget;
if (s.dragPage && s.dragPage.magnetic) return;
if (
s.wrapper[0].contains(e.target) &&
s.contentProvider.zoomScale == 1 &&
i.x == s.startPoint.x &&
i.y == s.startPoint.y &&
i.isInsidePage &&
s.startPoint.page == i.page &&
!i.page.isFlipping &&
n.nodeName !== "A"
) {
if (s.startPoint.page.side == 0) {
s.corner = t.CORNERS.TL;
s.prev();
s.startPoint.page = null;
} else {
s.corner = t.CORNERS.TR;
s.next();
s.startPoint.page = null;
}
s.isPanning = false;
}
},
p = function (e) {
if (
e.touches != null &&
e.touches.length == 2 &&
s.startTouches == null
) {
s.startTouches = l.getTouches(e);
s.lastScale = 1;
}
if (
(e.touches != null && e.touches.length > 1) ||
(e.touches == null && e.button !== 0)
)
return;
var i = s.eventToPoint(e);
s.startPoint = i;
s.left = s.left || 0;
s.top = s.top || 0;
s.isPanning = true;
s.lastPos = i.x;
s.lastTime = performance.now();
if (s.skipDrag !== true) {
if (i.isInside == true && !r(s)) {
s.startPoint = i;
s.drag = i.drag;
s.dragPage = i.page;
s.corner = i.corner;
k(s.corner);
o(s.dragPage);
if (i.page.isHard) {
} else {
i.page.updatePoint(i, s);
}
if (i.page.name == "0") {
s.shadow.css({
width: "50%",
left: s.direction == t.DIRECTION.RTL ? 0 : "50%",
transitionDelay: "",
});
} else if (i.page.name == Math.ceil(s.pageCount / 2) - 1) {
s.shadow.css({
width: "50%",
left: s.direction == t.DIRECTION.RTL ? "50%" : 0,
transitionDelay: "",
});
}
}
}
},
g = function (e) {
var t = 0;
if (e.wheelDelta != null) {
t = e.wheelDelta / 120;
} else if (e.detail != null) {
t = -e.detail / 3;
}
var i = s.contentProvider.zoomScale,
n = s.contentProvider.maxZoom;
if (t) {
if ((t > 0 && i < n) || (t < 0 && i > 1)) {
e.stopPropagation();
e.preventDefault();
var a = s.eventToPoint(e);
var o = s.eventToPoint(e);
var r = {
x: s.container.width() / 2,
y: -23 + s.container.height() / 2,
};
s.previewObject.zoom(t);
var l = s.contentProvider.zoomScale;
if (i !== l) {
var c = l / i;
if (l == 1) {
s.left = 0;
s.top = 0;
} else {
s.left *= c;
s.top *= c;
}
var u = (a.raw.x - r.x) * c,
d = (a.raw.y - r.y) * c;
o.raw.x = r.x + u;
o.raw.y = r.y + d;
s.startPoint = o;
s.pan(a);
var f = s.dragPage || a.page;
if (
s.dragPage == null &&
f != null &&
a.isInside == true &&
f.magnetic == true
) {
f.pendingPoint = a;
f.animateToReset = true;
s.corner = f.magneticCorner;
s.animatePage(f);
f.pendingPoint = null;
f.magnetic = false;
f.magneticCorner = null;
}
}
}
}
};
var v = s.container[0];
var m = s.stage[0];
if (v) {
m.addEventListener("mousemove", u, false);
m.addEventListener("touchmove", u, false);
m.addEventListener("mousedown", p, false);
m.addEventListener("click", h, false);
m.addEventListener("mouseup", f, false);
m.addEventListener("touchend", f, false);
m.addEventListener("touchstart", p, false);
if (s.options.scrollWheel == true) {
m.addEventListener("mousewheel", g, false);
m.addEventListener("DOMMouseScroll", g, false);
}
}
this.dispose = function () {
m.removeEventListener("mousemove", u, false);
m.removeEventListener("touchmove", u, false);
m.removeEventListener("mousedown", p, false);
m.removeEventListener("click", h, false);
m.removeEventListener("mouseup", f, false);
m.removeEventListener("touchend", f, false);
m.removeEventListener("touchstart", p, false);
if (s.options.scrollWheel == true) {
m.removeEventListener("mousewheel", g, false);
m.removeEventListener("DOMMouseScroll", g, false);
}
s.updatePageCallback = null;
s.flipCallback = null;
s.animateF = null;
s.stage.remove();
};
}
s.prototype = {
add: function (e) {
if (e instanceof K) this.container.append(i(e.element));
else this.container.append(i(e));
},
pan: function (e) {
var t = this.startPoint;
var i = this.contentProvider.zoomScale;
var n = this.left + (e.raw.x - t.raw.x),
a = this.top + (e.raw.y - t.raw.y);
this.left = Math.round(S(n, -this.shiftWidth, this.shiftWidth));
this.top = Math.round(S(a, -this.shiftHeight, this.shiftHeight));
if (i == 1) {
this.left = 0;
this.top = 0;
}
this.startPoint = e;
this.stage.css({
transform: "translate3d(" + this.left + "px," + this.top + "px,0)",
});
},
getPageByNumber: function (e) {
var t = A(this) ? (z(this) ? e + 1 : e) : Math.floor((e - 1) / 2);
var i;
for (var n = 0; n < this.pages.length; n++) {
if (t == parseInt(this.pages[n].name, 10)) i = this.pages[n];
}
return i;
},
getPageSide: function (e) {
var i = this.direction == t.DIRECTION.RTL;
var n = this.getPageByNumber(e);
if (n == null) return;
if (A(this)) return i ? n.front : n.back;
if (e % 2 == 0) return i ? n.back : n.front;
else return i ? n.front : n.back;
},
getContentLayer: function (e) {
var t = this.getPageSide(e);
return t == null ? null : t.contentLayer;
},
};
s.prototype.init = function (e) {
var t = this;
t.stage = i(h.div, { class: "df-book-stage" });
t.wrapper = i(h.div, { class: "df-book-wrapper" });
t.shadow = i(h.div, { class: "df-book-shadow" });
t.container.append(t.stage);
t.stage.append(t.wrapper);
t.wrapper.append(t.shadow);
t.createStack(e);
};
s.prototype.createStack = function (e) {
var t = "red,green,blue,yellow,orange,black".split(",");
for (var i = 0; i < this.stackCount; i++) {
e.angles = [, this.stackCount - i];
e.stiffness = (this.stackCount - i) / 100;
var n = new K(e);
n.angles[1] = 180;
n.index = i;
n.parent = this;
n.textureReady = false;
n.textureRequested = false;
this.wrapper.append(n.element);
n.isFlipping = false;
this.pages.push(n);
n.color = t[i];
}
this.children = this.pages;
};
s.prototype.isPageHard = function (e) {
return l.isHardPage(this.hardConfig, e, this.pageCount, A(this));
};
s.prototype.setDuration = function (e) {
this.duration = e;
};
s.prototype.moveBy = function (e) {
var t = this._activePage + e;
t = S(t, this.startPage, this.endPage);
if (this.firstFlipped != true) {
this.previewObject.analytics({
eventAction: "First Page Flip",
options: this.previewObject.options,
});
this.firstFlipped = true;
}
this.gotoPage(t);
};
s.prototype.next = function (e) {
if (e == null)
e = this.direction == t.DIRECTION.RTL ? -this.pageMode : this.pageMode;
this.moveBy(e);
};
s.prototype.prev = function (e) {
if (e == null)
e = this.direction == t.DIRECTION.RTL ? this.pageMode : -this.pageMode;
this.moveBy(e);
};
s.prototype.eventToPoint = function (e) {
e = D(e);
var n = this.wrapper,
a = this.pages,
o = this.pageWidth,
r = this.fullWidth,
s = this.height,
l = i(window),
c = { x: e.clientX, y: e.clientY };
var u = c.x - n[0].getBoundingClientRect().left;
var f = c.y - n[0].getBoundingClientRect().top;
c.x = c.x - this.container[0].getBoundingClientRect().left;
c.y = c.y - this.container[0].getBoundingClientRect().top;
var h =
this.drag == d.none
? u < o
? u
: r - u
: this.drag == d.left
? u
: r - u;
var p = u < o ? a[this.stackCount / 2 - 1] : a[this.stackCount / 2];
var g =
u < this.foldSense ? d.left : u > r - this.foldSense ? d.right : d.none;
var v = u,
m = f,
b = s,
w = r,
x = this.foldSense,
P = t.CORNERS,
y;
if (v >= 0 && v < x) {
if (m >= 0 && m <= x) y = P.TL;
else if (m >= b - x && m <= b) y = P.BL;
else if (m > x && m < b - x) y = P.L;
else y = P.NONE;
} else if (v >= w - x && v <= w) {
if (m >= 0 && m <= x) y = P.TR;
else if (m >= b - x && m <= b) y = P.BR;
else if (m > x && m < b - x) y = P.R;
else y = P.NONE;
} else y = P.NONE;
return {
isInsidePage: v >= 0 && v <= w && m >= 0 && m <= b,
isInside: y !== P.NONE && y !== P.L && y !== P.R,
x: u,
y: f,
fullWidth: r,
rawDistance: r - u,
distance: h,
page: p,
drag: g,
foldSense: this.foldSense,
event: e,
raw: c,
corner: y,
};
};
s.prototype.gotoPage = function (e) {
e = parseInt(e, 10);
this._activePage = e;
if (this.autoPlay == true) {
this.previewObject.setAutoPlay(this.autoPlay);
}
this.updatePage(e);
if (this && this.thumblist && this.thumblist.review)
this.thumblist.review();
};
s.prototype.refresh = function () {
this.updatePage(this._activePage);
if (this.flipCallback != null) this.flipCallback();
};
s.prototype.updatePage = function (e) {
var a = this.direction == t.DIRECTION.RTL,
o = A(this),
r = F(e);
var s = o ? 1 : 2;
e = Math.floor(e / s);
if (a) e = Math.ceil(this.pageCount / s) - e;
var l = this.oldBaseNumber || 0;
var c = this.pageCount / s;
var u = this.stackCount;
var f = Math.floor(u / 2);
if (l > e) {
this.children[u - 1].skipFlip = true;
this.children.unshift(this.children.pop());
} else if (l < e) {
this.children[0].skipFlip = true;
this.children.push(this.children.shift());
}
for (var h = 0; h < u; h++) {
var p = this.children[h];
if (l !== e) {
if (p.currentTween != null) {
p.clearTween(true);
}
}
var g = p.side;
var v;
var m = e - f + h;
if (a)
m = o ? this.pageCount - m : Math.ceil(this.pageCount / 2) - m - 1;
var b = p.name;
p.isHard = this.isPageHard(m);
if (p.isHard) {
p.element.addClass("df-hard-page");
} else {
p.element.removeClass("df-hard-page");
p.front.css({ display: "block" });
p.back.css({ display: "block" });
}
if (m == 0 || m == c) {
p.element.addClass("df-cover-page");
} else {
p.element.removeClass("df-cover-page");
}
var w = i(p.element).attr("pageNumber");
if (w != m) {
p.front.contentLayer.empty();
p.back.contentLayer.empty();
}
i(p.element).attr("pageNumber", m);
p.isEdge = false;
if (h == 0) {
} else if (h == u - 1) {
} else {
p.isEdge = false;
}
if (h < f) {
v = d.left;
} else {
v = d.right;
}
if (p.isFlipping == false) {
if (v !== g && p.skipFlip == false) {
this.animatePage(p);
if (this.preFlipCallback != null) this.preFlipCallback();
} else {
p.skipFlip = false;
p.element.removeClass(
"df-flipping df-quick-turn df-folding df-left-side df-right-side"
);
p.element.addClass(h < f ? "df-left-side" : "df-right-side");
p.side = v;
}
}
p.visible = o
? a
? h < f || p.isFlipping
: h >= f || p.isFlipping
: (m >= 0 && m < c) || (o && m == c);
if (this.requestPage != null && p.visible == true) {
p.name = m.toString();
if (p.name != b) {
p.backTextureLoaded = false;
p.frontTextureLoaded = false;
p.backPageStamp = "-1";
p.frontPageStamp = "-1";
p.thumbLoaded = false;
p.front.contentLayer.html("");
p.back.contentLayer.html("");
p.frontImage(n.textureLoadFallback);
p.backImage(n.textureLoadFallback);
this.requestPage();
}
}
p.oldDepth = p.depth;
p.updateCSS({
display: p.visible == true ? "block" : "none",
zIndex: 6 + (h < f ? h - f : f - h),
transform: "",
});
if (p.pendingPoint == null && p.isFlipping == false) {
p.resetCSS();
}
}
if (TWEEN.getAll().length == 0) {
clearInterval(this.animate);
}
i(".quick-hint").html(e);
this.oldBaseNumber = e;
if (this.updatePageCallback) this.updatePageCallback();
};
s.prototype.animatePage = function (e) {
e.element.addClass("df-flipping");
e.isFlipping = true;
if (this.animate != null) {
clearInterval(this.animate);
}
this.animate = setInterval(this.animateF, 30);
e.tween(e.pendingPoint);
};
return s;
})({});
var Q = (function (e) {
H(a, e);
function a(n, a, o) {
e.call(this, o);
var r = this;
r.type = "FlipBook";
r.container = n;
r.options = o;
r.options.source = a;
r.contentSource = a;
if (o.height != null && o.height.toString().indexOf("%") < 0) {
r.container.height(Math.min(o.height, i(window).height()));
} else {
r.container.height(o.height);
}
if (r.options.isLightBox) {
window.dfLightBox.closeButton.addClass(r.options.icons["close"]);
}
if (r.options.pageSize == t.PAGE_SIZE.DOUBLEINTERNAL) {
if (
Array === r.contentSource.constructor ||
Array.isArray(r.contentSource) ||
r.contentSource instanceof Array
) {
r.options.singlePageMode = t.SINGLE_PAGE_MODE.ZOOM;
}
r.container.addClass("df-double-internal");
}
if (!r.options.isLightBox && r.container.attr("id") != null) {
r.options.id = r.container.attr("id");
}
if (r.options.parsed !== true && r.options.links != null) {
t.parseLinks(r.options.links);
}
var l = (r.webgl = o.webgl == true && j == true);
n.addClass(
"df-container df-loading df-init df-floating" +
" df-controls-" +
r.options.controlsPosition
);
if (r.options.transparent == true) {
n.addClass("df-transparent");
}
if (r.options.direction == t.DIRECTION.RTL) {
n.addClass("df-rtl");
}
r.container.info = i(h.div, { class: "loading-info" })
.appendTo(r.container)
.html(r.options.text.loading + "...");
if (
s.indexOf("MSIE") !== -1 ||
navigator.appVersion.indexOf("Trident/") > 0 ||
(_ && !U)
) {
r.options.webgl = false;
}
if (!!s.match(/msie\s[5-9]/i)) {
r.container.info
.html(
"Your browser (Internet Explorer) is out of date to run DFlip Flipbook Plugin.
Upgrade to a new one"
)
.addClass("df-old-browser");
n.removeClass("df-loading");
return r;
}
var c =
o.backgroundImage == null || o.backgroundImage == ""
? ""
: "url('" + o.backgroundImage + "')";
r.container.css({
position: "relative",
overflow: "hidden",
backgroundColor: o.backgroundColor,
backgroundImage: c,
});
if (r.options.isLightBox == true) {
r.analytics({ eventAction: "Open Book", options: r.options });
}
r.init(l, a);
if (r.options.onCreate != null) r.options.onCreate(r);
return r;
}
a.prototype.init = function (e) {
var a = this;
var o = a.target;
var r = a.options;
if (e == true) {
var s = function (e) {
var i = function () {
MOCKUP.defaults.anisotropy = 0;
MOCKUP.defaults.groundTexture = "blank";
THREE.skipPowerOfTwo = true;
q();
if (e != null) e();
};
if (window.MOCKUP == null) {
a.updateInfo(r.text.loading + " WEBGL 3D ...");
if (
typeof define === "function" &&
define.amd &&
window.requirejs
) {
requirejs.config({
paths: { three: n.threejsSrc.replace(".js", "") },
shim: { three: { exports: "THREE" } },
});
require(["three"], function (e) {
window.THREE = e;
M(n.mockupjsSrc + "?ver=" + t.version, function () {
i();
});
return e;
});
} else if (typeof define === "function" && define.amd) {
require(["three", n.threejsSrc.replace(".js", "")], function (
e,
t
) {
e(function () {});
});
} else {
M(n.threejsSrc + "?ver=" + t.version, function () {
M(n.mockupjsSrc + "?ver=" + t.version, function () {
i();
});
});
}
} else {
i();
}
};
s(function () {
a.container.css({ minHeight: 300, minWidth: 300 });
a.stage = new G(R(a.options, { container: a.container }));
a.stage.previewObject = a;
a.contentProvider = new Y(
a.contentSource,
function (n) {
var r = {
pageCount: n.pageCount,
stackCount: 6,
segments: 20,
width: n.bookSize.width,
height: n.bookSize.height,
};
a.target =
o =
a.stage.target =
new MOCKUP.Book(R(a.options, r), a.stage);
a.extendtarget();
V(a.container, a);
o.ui = a.ui;
o.container = a.container;
n.webgl = e;
n.setTarget(a.target);
o.getContentLayer = function (e) {
var i = o.direction == t.DIRECTION.RTL,
n = a.stage.cssScene.divLeft.element,
r = a.stage.cssScene.divRight.element;
var s = F(o._activePage);
if (A(o)) return i ? n : r;
if (e % 2 == 0) return i ? r : n;
else return i ? n : r;
};
o.stage = a.stage;
o.flipCallback = function () {
if (a.contentProvider) {
a.contentProvider.review("flipCallback");
var e = F(o._activePage);
var n, r;
var s = o.getPageByNumber(e),
l = o.getPageByNumber(e + 1);
var c = o.parent.cssScene.divLeft,
u = o.parent.cssScene.divRight;
var d = o.pageMode == t.PAGE_MODE.SINGLE;
var f = o.direction == t.DIRECTION.RTL;
if (s != null && c != null) {
n = Math.abs(
s.geometry.boundingBox.max.x -
s.geometry.boundingBox.min.x
);
r = Math.abs(
s.geometry.boundingBox.max.z -
s.geometry.boundingBox.min.z
);
c.rotation.y = -Math.atan2(r, n) * 0.9;
c.position.z = r * 0.8;
c.position.x = r / 2.5;
i(c.element).css({ width: n, left: -n / 2 });
}
if (l != null && u != null) {
n = Math.abs(
l.geometry.boundingBox.max.x -
l.geometry.boundingBox.min.x
);
r = Math.abs(
l.geometry.boundingBox.max.z -
l.geometry.boundingBox.min.z
);
u.rotation.y = Math.atan2(r, n) * 0.9;
u.position.z = r * 0.8;
u.position.x = -r / 2.5;
i(u.element).css({ width: n, left: n / 2 });
}
if (a.options.onFlip != null) a.options.onFlip(a);
}
};
o.resize = (function () {
a.resize();
})();
o.updatePageCallback = function () {
a.ui.update();
a.checkCenter();
a.stage.renderRequestPending = true;
};
var s = i(a.stage.cssScene.divLeft.element);
var l = i(a.stage.cssScene.divRight.element);
o.preFlipCallback = function () {
s.empty();
l.empty();
if (a.options.beforeFlip != null) a.options.beforeFlip(a);
a.playSound();
};
i(window).trigger("resize");
s.css({
width: n.bookSize.width,
height: n.bookSize.height,
left: -n.bookSize.width / 2,
});
l.css({
width: n.bookSize.width,
height: n.bookSize.height,
left: n.bookSize.width / 2,
});
o.ease = TWEEN.Easing.Cubic.InOut;
o.contentProvider = n;
o.duration = a.options.duration;
o.gotoPage(o._activePage);
o.flipCallback();
if (a.options.isLightBox == true) {
a.analytics({ eventAction: "Book Ready", options: a.options });
}
if (a.options.onReady != null) a.options.onReady(a);
},
r,
a
);
});
} else {
a.contentProvider = new Y(
a.contentSource,
function (t) {
var n = {
pageCount: t.pageCount,
contentSourceType: t.contentSourceType,
};
a.target = o = new X(R(a.options, n), a.container);
a.target.previewObject = a;
a.extendtarget();
V(a.container, a);
t.webgl = e;
t.setTarget(a.target);
t.waitPeriod = 2;
o.ease = TWEEN.Easing.Quadratic.InOut;
o.duration = a.options.duration;
o.container = a.container;
o.updatePageCallback = function () {
a.ui.update();
a.checkCenter();
};
o.resize = (function () {
a.resize();
})();
i(window).trigger("resize");
o.flipCallback = function () {
if (a.contentProvider) {
a.contentProvider.review("flipCallback");
if (a.options.onFlip != null) a.options.onFlip(a);
}
};
o.preFlipCallback = function () {
if (a.options.beforeFlip != null) a.options.beforeFlip(a);
a.playSound();
};
o.gotoPage(o._activePage);
o.flipCallback();
if (a.options.onReady != null) a.options.onReady(a);
a.analytics({ eventAction: "Book Ready", options: a.options });
},
r,
a
);
}
};
a.prototype.extendtarget = function () {
var e = this;
e.target.previewObject = e;
e.target.reset = function () {
for (var t = 0; t < e.target.children.length; t++) {
var i = e.target.children[t];
i.skipFlip = true;
i.name = "-2";
}
e.contentProvider.annotedPage = "-2";
e.target.refresh();
};
};
a.prototype.getURLHash = function () {
if (this.options.id != null) {
var e =
l.getSharePrefix() +
(this.options.slug != null ? this.options.slug : this.options.id) +
"/";
if (this.target != null && this.target._activePage != null) {
e += this.target._activePage + "/";
}
window.location.hash = e;
}
return window.location.href;
};
a.prototype.end = function () {
this.target.gotoPage(this.target.endPage);
};
a.prototype.gotoPage = function (e) {
this.target.gotoPage(e);
if (this.ui != null) this.ui.update();
};
a.prototype.prev = function () {
this.target.prev();
};
a.prototype.next = function () {
this.target.next();
};
a.prototype.updateInfo = function (e) {
if (this.container && this.container.info && this.container.info.html)
this.container.info.html(e);
};
a.prototype.analytics = function (e) {
if (this.options.enableAnalytics == true) {
try {
var t = e.options,
i = undefined;
if (t) {
i = t.bookTitle || t.slug || t.id;
}
var n = window.gtag;
if (n) {
n("event", e.eventAction, {
event_category: "Flipbook",
event_label: i,
});
} else {
var a = window.ga || window.__gaTracker;
a("send", {
hitType: "event",
eventCategory: "Flipbook",
eventAction: e.eventAction,
eventLabel: i,
});
}
} catch (e) {}
}
};
return a;
})(Z);
i.fn.extend({
shelf: function () {},
flipBook: function (e, t) {
return new Q(i(this), e, W(t));
},
});
})(DFLIP, jQuery);
(function (e) {
"use strict";
e.URL = e.URL || e.webkitURL;
if (e.Blob && e.URL) {
try {
new Blob();
return;
} catch (e) {}
}
var t =
e.BlobBuilder ||
e.WebKitBlobBuilder ||
e.MozBlobBuilder ||
(function (e) {
var t = function (e) {
return Object.prototype.toString
.call(e)
.match(/^\[object\s(.*)\]$/)[1];
},
i = function e() {
this.data = [];
},
n = function e(t, i, n) {
this.data = t;
this.size = t.length;
this.type = i;
this.encoding = n;
},
a = i.prototype,
o = n.prototype,
r = e.FileReaderSync,
s = function (e) {
this.code = this[(this.name = e)];
},
l = (
"NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR " +
"NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
).split(" "),
c = l.length,
u = e.URL || e.webkitURL || e,
d = u.createObjectURL,
f = u.revokeObjectURL,
h = u,
p = e.btoa,
g = e.atob,
v = e.ArrayBuffer,
m = e.Uint8Array,
b = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;
n.fake = o.fake = true;
while (c--) {
s.prototype[l[c]] = c + 1;
}
if (!u.createObjectURL) {
h = e.URL = function (e) {
var t = document.createElementNS("http://www.w3.org/1999/xhtml", "a"),
i;
t.href = e;
if (!("origin" in t)) {
if (t.protocol.toLowerCase() === "data:") {
t.origin = null;
} else {
i = e.match(b);
t.origin = i && i[1];
}
}
return t;
};
}
h.createObjectURL = function (e) {
var t = e.type,
i;
if (t === null) {
t = "application/octet-stream";
}
if (e instanceof n) {
i = "data:" + t;
if (e.encoding === "base64") {
return i + ";base64," + e.data;
} else if (e.encoding === "URI") {
return i + "," + decodeURIComponent(e.data);
}
if (p) {
return i + ";base64," + p(e.data);
} else {
return i + "," + encodeURIComponent(e.data);
}
} else if (d) {
return d.call(u, e);
}
};
h.revokeObjectURL = function (e) {
if (e.substring(0, 5) !== "data:" && f) {
f.call(u, e);
}
};
a.append = function (e) {
var i = this.data;
if (m && (e instanceof v || e instanceof m)) {
var a = "",
o = new m(e),
l = 0,
c = o.length;
for (; l < c; l++) {
a += String.fromCharCode(o[l]);
}
i.push(a);
} else if (t(e) === "Blob" || t(e) === "File") {
if (r) {
var u = new r();
i.push(u.readAsBinaryString(e));
} else {
throw new s("NOT_READABLE_ERR");
}
} else if (e instanceof n) {
if (e.encoding === "base64" && g) {
i.push(g(e.data));
} else if (e.encoding === "URI") {
i.push(decodeURIComponent(e.data));
} else if (e.encoding === "raw") {
i.push(e.data);
}
} else {
if (typeof e !== "string") {
e += "";
}
i.push(unescape(encodeURIComponent(e)));
}
};
a.getBlob = function (e) {
if (!arguments.length) {
e = null;
}
return new n(this.data.join(""), e, "raw");
};
a.toString = function () {
return "[object BlobBuilder]";
};
o.slice = function (e, t, i) {
var a = arguments.length;
if (a < 3) {
i = null;
}
return new n(
this.data.slice(e, a > 1 ? t : this.data.length),
i,
this.encoding
);
};
o.toString = function () {
return "[object Blob]";
};
o.close = function () {
this.size = 0;
delete this.data;
};
return i;
})(e);
e.Blob = function (e, i) {
var n = i ? i.type || "" : "";
var a = new t();
if (e) {
for (var o = 0, r = e.length; o < r; o++) {
if (Uint8Array && e[o] instanceof Uint8Array) {
a.append(e[o].buffer);
} else {
a.append(e[o]);
}
}
}
var s = a.getBlob(n);
if (!s.slice && s.webkitSlice) {
s.slice = s.webkitSlice;
}
return s;
};
var i =
Object.getPrototypeOf ||
function (e) {
return e.__proto__;
};
e.Blob.prototype = i(new e.Blob());
})(window);
(function (e) {
"use strict";
var t = e.Uint8Array,
i = e.HTMLCanvasElement,
n = i && i.prototype,
a = /\s*;\s*base64\s*(?:;|$)/i,
o = "toDataURL",
r,
s = function (e) {
var i = e.length,
n = new t(((i / 4) * 3) | 0),
a = 0,
o = 0,
s = [0, 0],
l = 0,
c = 0,
u,
d;
while (i--) {
d = e.charCodeAt(a++);
u = r[d - 43];
if (u !== 255 && u != null) {
s[1] = s[0];
s[0] = d;
c = (c << 6) | u;
l++;
if (l === 4) {
n[o++] = c >>> 16;
if (s[1] !== 61) {
n[o++] = c >>> 8;
}
if (s[0] !== 61) {
n[o++] = c;
}
l = 0;
}
}
}
return n;
};
if (t) {
r = new t([
62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, 0,
-1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29,
30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51,
]);
}
if (i && !n.toBlob) {
n.toBlob = function (e, i) {
if (!i) {
i = "image/png";
}
if (this.mozGetAsFile) {
e(this.mozGetAsFile("canvas", i));
return;
}
if (this.msToBlob && /^\s*image\/png\s*(?:$|;)/i.test(i)) {
e(this.msToBlob());
return;
}
var n = Array.prototype.slice.call(arguments, 1),
r = this[o].apply(this, n),
l = r.indexOf(","),
c = r.substring(l + 1),
u = a.test(r.substring(0, l)),
d;
if (Blob.fake) {
d = new Blob();
if (u) {
d.encoding = "base64";
} else {
d.encoding = "URI";
}
d.data = c;
d.size = c.length;
} else if (t) {
if (u) {
d = new Blob([s(c)], { type: i });
} else {
d = new Blob([decodeURIComponent(c)], { type: i });
}
}
e(d);
};
if (n.toDataURLHD) {
n.toBlobHD = function () {
o = "toDataURLHD";
var e = this.toBlob();
o = "toDataURL";
return e;
};
} else {
n.toBlobHD = n.toBlob;
}
}
})(window);
(function e() {
if ("performance" in window === false) {
window.performance = {};
}
Date.now =
Date.now ||
function () {
return new Date().getTime();
};
if ("now" in window.performance === false) {
var t =
window.performance.timing && window.performance.timing.navigationStart
? window.performance.timing.navigationStart
: Date.now();
window.performance.now = function () {
return Date.now() - t;
};
}
})();
(function e() {
var t =
t ||
(function () {
var e = [];
return {
getAll: function () {
return e;
},
removeAll: function () {
e = [];
},
add: function (t) {
e.push(t);
},
remove: function (t) {
var i = e.indexOf(t);
if (i !== -1) {
e.splice(i, 1);
}
},
update: function (t) {
if (e.length === 0) {
return false;
}
var i = 0;
t = t != null ? t : window.performance.now();
while (i < e.length) {
if (e[i].update(t)) {
i++;
} else {
e.splice(i, 1);
}
}
return true;
},
};
})();
t.Tween = function (e) {
var i = e;
var n = {};
var a = {};
var o = {};
var r = 1e3;
var s = 0;
var l = false;
var c = false;
var u = false;
var d = 0;
var f = null;
var h = t.Easing.Linear.None;
var p = t.Interpolation.Linear;
var g = [];
var v = null;
var m = false;
var b = null;
var w = null;
var x = null;
for (var P in e) {
n[P] = parseFloat(e[P], 10);
}
this.to = function (e, t) {
if (t != null) {
r = t;
}
a = e;
return this;
};
this.start = function (e) {
t.add(this);
c = true;
m = false;
f = e != null ? e : window.performance.now();
f += d;
for (var r in a) {
if (a[r] instanceof Array) {
if (a[r].length === 0) {
continue;
}
a[r] = [i[r]].concat(a[r]);
}
if (n[r] === null) {
continue;
}
n[r] = i[r];
if (n[r] instanceof Array === false) {
n[r] *= 1;
}
o[r] = n[r] || 0;
}
return this;
};
this.stop = function () {
if (!c) {
return this;
}
t.remove(this);
c = false;
if (x !== null) {
x.call(i);
}
this.stopChainedTweens();
return this;
};
this.stopChainedTweens = function () {
for (var e = 0, t = g.length; e < t; e++) {
g[e].stop();
}
};
this.complete = function () {
if (!c) {
return this;
}
t.remove(this);
c = false;
if (w !== null) {
w.call(i);
}
this.completeChainedTweens();
return this;
};
this.completeChainedTweens = function () {
for (var e = 0, t = g.length; e < t; e++) {
g[e].complete();
}
};
this.delay = function (e) {
d = e;
return this;
};
this.repeat = function (e) {
s = e;
return this;
};
this.yoyo = function (e) {
l = e;
return this;
};
this.easing = function (e) {
h = e == null ? h : e;
return this;
};
this.interpolation = function (e) {
p = e;
return this;
};
this.chain = function () {
g = arguments;
return this;
};
this.onStart = function (e) {
v = e;
return this;
};
this.onUpdate = function (e) {
b = e;
return this;
};
this.onComplete = function (e) {
w = e;
return this;
};
this.onStop = function (e) {
x = e;
return this;
};
this.update = function (e) {
var t;
var c;
var x;
if (e < f) {
return true;
}
if (m === false) {
if (v !== null) {
v.call(i);
}
m = true;
}
c = (e - f) / r;
c = c > 1 ? 1 : c;
x = h(c);
for (t in a) {
if (n[t] === null) {
continue;
}
var P = n[t] || 0;
var y = a[t];
if (y instanceof Array) {
i[t] = p(y, x);
} else {
if (typeof y === "string") {
if (y.startsWith("+") || y.startsWith("-")) {
y = P + parseFloat(y, 10);
} else {
y = parseFloat(y, 10);
}
}
if (typeof y === "number") {
i[t] = P + (y - P) * x;
}
}
}
if (b !== null) {
b.call(i, x);
}
if (c === 1) {
if (s > 0) {
if (isFinite(s)) {
s--;
}
for (t in o) {
if (typeof a[t] === "string") {
o[t] = o[t] + parseFloat(a[t], 10);
}
if (l) {
var C = o[t];
o[t] = a[t];
a[t] = C;
}
n[t] = o[t];
}
if (l) {
u = !u;
}
f = e + d;
return true;
} else {
if (w !== null) {
w.call(i);
}
for (var L = 0, S = g.length; L < S; L++) {
g[L].start(f + r);
}
return false;
}
}
return true;
};
};
t.Easing = {
Linear: {
None: function (e) {
return e;
},
},
Quadratic: {
In: function (e) {
return e * e;
},
Out: function (e) {
return e * (2 - e);
},
InOut: function (e) {
if ((e *= 2) < 1) {
return 0.5 * e * e;
}
return -0.5 * (--e * (e - 2) - 1);
},
},
Quartic: {
In: function (e) {
return e * e * e * e;
},
Out: function (e) {
return 1 - --e * e * e * e;
},
InOut: function (e) {
if ((e *= 2) < 1) {
return 0.5 * e * e * e * e;
}
return -0.5 * ((e -= 2) * e * e * e - 2);
},
},
Sinusoidal: {
In: function (e) {
return 1 - Math.cos((e * Math.PI) / 2);
},
Out: function (e) {
return Math.sin((e * Math.PI) / 2);
},
InOut: function (e) {
return 0.5 * (1 - Math.cos(Math.PI * e));
},
},
Cubic: {
In: function (e) {
return e * e * e;
},
Out: function (e) {
return --e * e * e + 1;
},
InOut: function (e) {
if ((e *= 2) < 1) {
return 0.5 * e * e * e;
}
return 0.5 * ((e -= 2) * e * e + 2);
},
},
};
t.Interpolation = {
Linear: function (e, i) {
var n = e.length - 1;
var a = n * i;
var o = Math.floor(a);
var r = t.Interpolation.Utils.Linear;
if (i < 0) {
return r(e[0], e[1], a);
}
if (i > 1) {
return r(e[n], e[n - 1], n - a);
}
return r(e[o], e[o + 1 > n ? n : o + 1], a - o);
},
Bezier: function (e, i) {
var n = 0;
var a = e.length - 1;
var o = Math.pow;
var r = t.Interpolation.Utils.Bernstein;
for (var s = 0; s <= a; s++) {
n += o(1 - i, a - s) * o(i, s) * e[s] * r(a, s);
}
return n;
},
Utils: {
Linear: function (e, t, i) {
return (t - e) * i + e;
},
Bernstein: function (e, i) {
var n = t.Interpolation.Utils.Factorial;
return n(e) / n(i) / n(e - i);
},
Factorial: (function () {
var e = [1];
return function (t) {
var i = 1;
if (e[t]) {
return e[t];
}
for (var n = t; n > 1; n--) {
i *= n;
}
e[t] = i;
return i;
};
})(),
CatmullRom: function (e, t, i, n, a) {
var o = (i - e) * 0.5;
var r = (n - t) * 0.5;
var s = a * a;
var l = a * s;
return (
(2 * t - 2 * i + o + r) * l +
(-3 * t + 3 * i - 2 * o - r) * s +
o * a +
t
);
},
},
};
window.TWEEN = t;
})();
DFLIP.createBlob = function e(t, i) {
if (typeof Blob !== "undefined") {
return new Blob([t], { type: i });
}
var n = new MozBlobBuilder();
n.append(t);
return n.getBlob(i);
};
DFLIP.createObjectURL = (function e() {
var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
return function e(i, n) {
if (typeof URL !== "undefined" && URL.createObjectURL) {
var a = DFLIP.createBlob(i, n);
return URL.createObjectURL(a);
}
var o = "data:" + n + ";base64,";
for (var r = 0, s = i.length; r < s; r += 3) {
var l = i[r] & 255;
var c = i[r + 1] & 255;
var u = i[r + 2] & 255;
var d = l >> 2,
f = ((l & 3) << 4) | (c >> 4);
var h = r + 1 < s ? ((c & 15) << 2) | (u >> 6) : 64;
var p = r + 2 < s ? u & 63 : 64;
o += t[d] + t[f] + t[h] + t[p];
}
return o;
};
})();
var ThumbList = (function e() {
function t(e) {
var i = (e && e.w + "px") || "100%";
var n = (e && e.h + "px") || "100%";
var a = (this.itemHeight = e.itemHeight);
this.items = e.items;
this.generatorFn = e.generatorFn;
this.totalRows = e.totalRows || (e.items && e.items.length);
this.addFn = e.addFn;
this.scrollFn = e.scrollFn;
var o = t.createScroller(a * this.totalRows);
this.container = t.createContainer(i, n);
this.container.appendChild(o);
this.screenItemsLen = Math.ceil(e.h / a);
this.offsetItems = this.screenItemsLen;
this.cachedItemsLen = this.screenItemsLen + this.offsetItems * 2;
this._renderChunk(this.container, 0);
var r = this;
r.lastRepaintY = 0;
var s = this.screenItemsLen * a;
var l = 0;
var c;
function u(e) {
var t = e.target.scrollTop;
if (
!r.lastRepaintY ||
Math.abs(t - r.lastRepaintY) >= r.offsetItems * r.itemHeight
) {
var i = parseInt(t / a, 10) - r.offsetItems;
r._renderChunk(r.container, i < 0 ? 0 : i);
r.lastRepaintY = t;
}
r.lastScrolled = l = Date.now();
if (r.scrollFn != null) {
r.scrollFn();
}
e.preventDefault && e.preventDefault();
}
r.dispose = function () {
if (r.container) {
if (r.container.parentNode) {
r.container.parentNode.removeChild(r.container);
}
}
r.container.removeEventListener("scroll", u);
};
r.container.addEventListener("scroll", u);
}
t.prototype.reset = function (e) {
this.screenItemsLen = Math.ceil(e / this.itemHeight);
this.cachedItemsLen = this.screenItemsLen + this.offsetItems * 2;
var t =
parseInt(this.lastRepaintY / this.itemHeight, 10) - this.offsetItems;
this.needReset = true;
this._renderChunk(this.container, Math.max(t, 0));
};
t.prototype.createRow = function (e) {
var t;
if (this.generatorFn) {
t = this.generatorFn(e);
t.classList.add("df-vrow");
t.style.position = "absolute";
t.style.top = e * this.itemHeight + "px";
t.setAttribute("index", e);
}
return t;
};
t.prototype._renderChunk = function (e, t) {
var i = this.range == null;
this.range = this.range || { min: 0, max: this.cachedItemsLen };
var n = this.range;
var a = n.min,
o = n.max;
var r = i ? true : t >= a;
if (!i && t == a && this.needReset == false) return;
var s;
var l = i ? a : r ? o : t;
l = l > this.totalRows ? this.totalRows : l < 0 ? 0 : l;
var c = t + this.cachedItemsLen;
c = c > this.totalRows ? this.totalRows : c;
for (s = l; s < c; s++) {
if (r) e.appendChild(this.createRow(s));
else e.insertBefore(this.createRow(s), e.childNodes[1 + s - l]);
if (this.addFn != null) {
this.addFn(s);
}
}
var u = Math.abs(t - a);
this.needReset = false;
if (!i && e.childNodes.length > this.cachedItemsLen + 1) {
var d = r ? 1 : 1 + this.cachedItemsLen,
f = d + (c - l);
for (var h = f; h > d; h--) {
if (e.childNodes[d]) this.container.removeChild(e.childNodes[d]);
}
}
this.range.min = t;
this.range.max = c;
};
t.createContainer = function (e, t) {
var i = document.createElement("div");
i.style.width = e;
i.style.height = t;
i.style.overflow = "auto";
i.style.position = "relative";
i.style.padding = 0;
return i;
};
t.createScroller = function (e) {
var t = document.createElement("div");
t.style.opacity = 0;
t.style.position = "absolute";
t.style.top = 0;
t.style.left = 0;
t.style.width = "1px";
t.style.height = e + "px";
return t;
};
return t;
})();
var BookMarkViewer = (function e() {
function t(e) {
this.outline = null;
this.lastToggleIsShow = true;
this.container = e.container;
this.linkService = e.linkService;
this.outlineItemClass = e.outlineItemClass || "outlineItem";
this.outlineToggleClass = e.outlineToggleClass || "outlineItemToggler";
this.outlineToggleHiddenClass =
e.outlineToggleHiddenClass || "outlineItemsHidden";
}
t.prototype = {
dispose: function () {
if (this.container) {
if (this.container.parentNode) {
this.container.parentNode.removeChild(this.container);
}
}
this.linkService = null;
},
reset: function e() {
this.outline = null;
this.lastToggleIsShow = true;
var t = this.container;
while (t.firstChild) {
t.removeChild(t.firstChild);
}
},
_dispatchEvent: function e(t) {
var i = document.createEvent("CustomEvent");
i.initCustomEvent("outlineloaded", true, true, { outlineCount: t });
this.container.dispatchEvent(i);
},
_bindLink: function e(t, i) {
var n = this.linkService;
if (i.custom == true) {
t.href = n.getCustomDestinationHash(i.dest);
t.onclick = function e(t) {
n.customNavigateTo(i.dest);
return false;
};
} else {
if (i.url) {
pdfjsLib.addLinkAttributes(t, { url: i.url });
return;
}
t.href = n.getDestinationHash(i.dest);
t.onclick = function e(t) {
n.navigateTo(i.dest);
return false;
};
}
},
_addToggleButton: function e(t) {
var i = document.createElement("div");
i.className =
this.outlineToggleClass + " " + this.outlineToggleHiddenClass;
i.onclick = function (e) {
e.stopPropagation();
i.classList.toggle(this.outlineToggleHiddenClass);
if (e.shiftKey) {
var n = !i.classList.contains(this.outlineToggleHiddenClass);
this._toggleOutlineItem(t, n);
}
}.bind(this);
t.insertBefore(i, t.firstChild);
},
_toggleOutlineItem: function e(t, i) {
this.lastToggleIsShow = i;
var n = t.querySelectorAll("." + this.outlineToggleClass);
for (var a = 0, o = n.length; a < o; ++a) {
n[a].classList[i ? "remove" : "add"](this.outlineToggleHiddenClass);
}
},
toggleOutlineTree: function e() {
if (!this.outline) {
return;
}
this._toggleOutlineItem(this.container, !this.lastToggleIsShow);
},
render: function e(t) {
var i = (t && t.outline) || null;
var n = 0;
if (this.outline) {
this.reset();
}
this.outline = i;
if (!i) {
return;
}
var a = document.createDocumentFragment();
var o = [{ parent: a, items: this.outline }];
var r = false;
while (o.length > 0) {
var s = o.shift();
var l = s.custom;
for (var c = 0, u = s.items.length; c < u; c++) {
var d = s.items[c];
var f = document.createElement("div");
f.className = this.outlineItemClass;
var h = document.createElement("a");
if (d.custom == null && l != null) d.custom = l;
this._bindLink(h, d);
h.textContent = d.title.replace(/\x00/g, "");
f.appendChild(h);
if (d.items && d.items.length > 0) {
r = true;
this._addToggleButton(f);
var p = document.createElement("div");
p.className = this.outlineItemClass + "s";
f.appendChild(p);
o.push({ parent: p, custom: d.custom, items: d.items });
}
s.parent.appendChild(f);
n++;
}
}
if (r) {
if (this.container.classList != null) {
this.container.classList.add(this.outlineItemClass + "s");
} else if (this.container.className != null) {
this.container.className += " picWindow";
}
}
this.container.appendChild(a);
this._dispatchEvent(n);
},
};
return t;
})();
var DFLightBox = (function e(t) {
function i(e, i) {
this.duration = 300;
var n = this;
n.lightboxWrapper = t("
").addClass("df-lightbox-wrapper");
n.container = t("
")
.addClass("df-container")
.appendTo(n.lightboxWrapper);
n.controls = t("
")
.addClass("df-lightbox-controls")
.appendTo(n.lightboxWrapper);
n.closeButton = t("
")
.addClass("df-lightbox-close df-ui-btn")
.on("click", function () {
n.close(e);
})
.appendTo(n.controls);
n.lightboxWrapper.append(n.container);
return n;
}
i.prototype.show = function (e) {
if (this.lightboxWrapper.parent().length == 0)
t("body").append(this.lightboxWrapper);
t("html,body").addClass("df-lightbox-open");
this.lightboxWrapper.fadeIn(this.duration, e);
return this;
};
i.prototype.close = function (e) {
this.lightboxWrapper.fadeOut(this.duration);
setTimeout(e, this.duration);
t("html,body").removeClass("df-lightbox-open");
return this;
};
return i;
})(jQuery);
DFLIP.Share = (function e(t) {
function i(e, i) {
var n = this;
var a = "
";
var o = "df-share-button";
var r = "width=500,height=400";
n.isOpen = false;
n.shareUrl = "";
n.wrapper = t('
').on(
"click",
function (e) {
n.close();
}
);
n.box = t('
')
.on("click", function (e) {
e.preventDefault();
e.stopPropagation();
})
.appendTo(n.wrapper)
.html('
' + i.text.share + "");
n.urlInput = t('