@d-i-t-a/reader 2.2.0-beta.2 → 2.2.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -30641,8 +30641,37 @@ var require_devtools_detector = __commonJS({
30641
30641
  return e.d(n2, "a", n2), n2;
30642
30642
  }, e.o = function(t2, n2) {
30643
30643
  return Object.prototype.hasOwnProperty.call(t2, n2);
30644
- }, e.p = "", e(e.s = 4);
30644
+ }, e.p = "", e(e.s = 3);
30645
30645
  }([function(t, n, e) {
30646
+ "use strict";
30647
+ e.d(n, "j", function() {
30648
+ return s;
30649
+ }), e.d(n, "e", function() {
30650
+ return l;
30651
+ }), e.d(n, "f", function() {
30652
+ return d;
30653
+ }), e.d(n, "d", function() {
30654
+ return h;
30655
+ }), e.d(n, "i", function() {
30656
+ return p;
30657
+ }), e.d(n, "g", function() {
30658
+ return v;
30659
+ }), e.d(n, "c", function() {
30660
+ return b;
30661
+ }), e.d(n, "h", function() {
30662
+ return y;
30663
+ }), n.a = function() {
30664
+ for (var t2, n2 = [], e2 = 0; e2 < arguments.length; e2++)
30665
+ n2[e2] = arguments[e2];
30666
+ if (f === null || f === void 0 ? void 0 : f.document)
30667
+ return (t2 = f.document).createElement.apply(t2, n2);
30668
+ return {};
30669
+ }, e.d(n, "b", function() {
30670
+ return w;
30671
+ });
30672
+ var r, i, o, u, c, a = e(1), f = Object(a.a)(), s = ((r = f === null || f === void 0 ? void 0 : f.navigator) === null || r === void 0 ? void 0 : r.userAgent) || "unknown", l = "InstallTrigger" in ((f === null || f === void 0 ? void 0 : f.window) || {}) || /firefox/i.test(s), d = /trident/i.test(s) || /msie/i.test(s), h = /edge/i.test(s), p = /webkit/i.test(s) && !h, v = /IqiyiApp/.test(s), b = ((i = f === null || f === void 0 ? void 0 : f.window) === null || i === void 0 ? void 0 : i.chrome) !== void 0 || /chrome/i.test(s) || /CriOS/i.test(s), y = (((u = (o = f === null || f === void 0 ? void 0 : f.window) === null || o === void 0 ? void 0 : o.safari) === null || u === void 0 ? void 0 : u.pushNotification) || false).toString() === "[object SafariRemoteNotification]" || /safari/i.test(s) && !b;
30673
+ var w = typeof ((c = f.document) === null || c === void 0 ? void 0 : c.createElement) == "function";
30674
+ }, function(t, n, e) {
30646
30675
  "use strict";
30647
30676
  (function(t2) {
30648
30677
  n.c = function() {
@@ -30678,24 +30707,8 @@ var require_devtools_detector = __commonJS({
30678
30707
  return t2;
30679
30708
  return this;
30680
30709
  };
30681
- var r = e(11), i = (e.n(r), e(5));
30682
- }).call(n, e(10));
30683
- }, function(t, n, e) {
30684
- "use strict";
30685
- e.d(n, "c", function() {
30686
- return f;
30687
- }), e.d(n, "d", function() {
30688
- return s;
30689
- }), e.d(n, "b", function() {
30690
- return l;
30691
- }), e.d(n, "f", function() {
30692
- return d;
30693
- }), e.d(n, "a", function() {
30694
- return h;
30695
- }), e.d(n, "e", function() {
30696
- return p;
30697
- });
30698
- var r, i, o, u = e(3), c = e(0), a = Object(c.a)(), f = "InstallTrigger" in ((a === null || a === void 0 ? void 0 : a.window) || {}) || /firefox/i.test(u.b), s = /trident/i.test(u.b) || /msie/i.test(u.b), l = /edge/i.test(u.b), d = /webkit/i.test(u.b) && !l, h = ((r = a === null || a === void 0 ? void 0 : a.window) === null || r === void 0 ? void 0 : r.chrome) !== void 0 || /chrome/i.test(u.b) || /CriOS/i.test(u.b), p = (((o = (i = a === null || a === void 0 ? void 0 : a.window) === null || i === void 0 ? void 0 : i.safari) === null || o === void 0 ? void 0 : o.pushNotification) || false).toString() === "[object SafariRemoteNotification]" || /safari/i.test(u.b) && !h;
30710
+ var r = e(8), i = (e.n(r), e(4));
30711
+ }).call(n, e(7));
30699
30712
  }, function(t, n, e) {
30700
30713
  "use strict";
30701
30714
  e.d(n, "b", function() {
@@ -30705,10 +30718,10 @@ var require_devtools_detector = __commonJS({
30705
30718
  }), e.d(n, "a", function() {
30706
30719
  return c;
30707
30720
  });
30708
- var r = e(1);
30721
+ var r = e(0);
30709
30722
  function i(t2) {
30710
30723
  if (console) {
30711
- if (!r.d && !r.b)
30724
+ if (!r.f && !r.d)
30712
30725
  return console[t2];
30713
30726
  if (t2 === "log" || t2 === "clear")
30714
30727
  return function() {
@@ -30723,59 +30736,54 @@ var require_devtools_detector = __commonJS({
30723
30736
  };
30724
30737
  }
30725
30738
  var o = i("log"), u = i("table"), c = i("clear");
30726
- }, function(t, n, e) {
30727
- "use strict";
30728
- n.a = function() {
30729
- for (var t2, n2 = [], e2 = 0; e2 < arguments.length; e2++)
30730
- n2[e2] = arguments[e2];
30731
- if (o === null || o === void 0 ? void 0 : o.document)
30732
- return (t2 = o.document).createElement.apply(t2, n2);
30733
- return {};
30734
- }, e.d(n, "b", function() {
30735
- return u;
30736
- });
30737
- var r, i = e(0), o = Object(i.a)();
30738
- var u = ((r = o === null || o === void 0 ? void 0 : o.navigator) === null || r === void 0 ? void 0 : r.userAgent) || "xxxxx";
30739
30739
  }, function(t, n, e) {
30740
30740
  "use strict";
30741
30741
  Object.defineProperty(n, "__esModule", { value: true }), n.addListener = function(t2) {
30742
- l.addListener(t2);
30742
+ s.addListener(t2);
30743
30743
  }, n.removeListener = function(t2) {
30744
- l.removeListener(t2);
30744
+ s.removeListener(t2);
30745
30745
  }, n.isLaunch = function() {
30746
- return l.isLaunch();
30746
+ return s.isLaunch();
30747
30747
  }, n.launch = function() {
30748
- l.launch();
30748
+ s.launch();
30749
30749
  }, n.stop = function() {
30750
- l.stop();
30750
+ s.stop();
30751
30751
  }, n.setDetectDelay = function(t2) {
30752
- l.setDetectDelay(t2);
30752
+ s.setDetectDelay(t2);
30753
30753
  };
30754
- var r = e(7), i = e(8);
30754
+ var r = e(6), i = e(9);
30755
30755
  e.d(n, "DevtoolsDetector", function() {
30756
30756
  return r.a;
30757
30757
  }), e.d(n, "checkers", function() {
30758
30758
  return i;
30759
30759
  });
30760
- var o = e(0);
30760
+ var o = e(1);
30761
30761
  e.d(n, "match", function() {
30762
30762
  return o.b;
30763
30763
  }), e.d(n, "specificVersionMatch", function() {
30764
30764
  return o.d;
30765
30765
  });
30766
- var u = e(1);
30767
- e.d(n, "isFirefox", function() {
30768
- return u.c;
30766
+ var u = e(0);
30767
+ e.d(n, "userAgent", function() {
30768
+ return u.j;
30769
+ }), e.d(n, "isFirefox", function() {
30770
+ return u.e;
30769
30771
  }), e.d(n, "isIE", function() {
30770
- return u.d;
30772
+ return u.f;
30771
30773
  }), e.d(n, "isEdge", function() {
30772
- return u.b;
30774
+ return u.d;
30773
30775
  }), e.d(n, "isWebkit", function() {
30774
- return u.f;
30776
+ return u.i;
30777
+ }), e.d(n, "isIqiyiApp", function() {
30778
+ return u.g;
30775
30779
  }), e.d(n, "isChrome", function() {
30776
- return u.a;
30780
+ return u.c;
30777
30781
  }), e.d(n, "isSafari", function() {
30778
- return u.e;
30782
+ return u.h;
30783
+ }), e.d(n, "createElement", function() {
30784
+ return u.a;
30785
+ }), e.d(n, "inBrowser", function() {
30786
+ return u.b;
30779
30787
  });
30780
30788
  var c = e(2);
30781
30789
  e.d(n, "log", function() {
@@ -30785,34 +30793,30 @@ var require_devtools_detector = __commonJS({
30785
30793
  }), e.d(n, "clear", function() {
30786
30794
  return c.a;
30787
30795
  });
30788
- var a = e(18);
30789
- e.d(n, "isMobile", function() {
30796
+ var a = e(4);
30797
+ e.d(n, "versionMap", function() {
30790
30798
  return a.a;
30791
30799
  });
30792
30800
  var f = e(5);
30793
- e.d(n, "versionMap", function() {
30794
- return f.a;
30795
- });
30796
- var s = e(6);
30797
30801
  e.d(n, "isMac", function() {
30798
- return s.d;
30802
+ return f.d;
30799
30803
  }), e.d(n, "isIpad", function() {
30800
- return s.b;
30804
+ return f.b;
30801
30805
  }), e.d(n, "isIphone", function() {
30802
- return s.c;
30806
+ return f.c;
30803
30807
  }), e.d(n, "isAndroid", function() {
30804
- return s.a;
30808
+ return f.a;
30805
30809
  }), e.d(n, "isWindows", function() {
30806
- return s.e;
30810
+ return f.e;
30807
30811
  });
30808
- var l = new r.a({ checkers: [i.erudaChecker, i.elementIdChecker, i.regToStringChecker, i.functionToStringChecker, i.depRegToStringChecker, i.dateToStringChecker, i.performanceChecker, i.debuggerChecker] });
30809
- n.default = l;
30812
+ var s = new r.a({ checkers: [i.erudaChecker, i.elementIdChecker, i.regToStringChecker, i.functionToStringChecker, i.depRegToStringChecker, i.dateToStringChecker, i.performanceChecker, i.debuggerChecker] });
30813
+ n.default = s;
30810
30814
  }, function(t, n, e) {
30811
30815
  "use strict";
30812
30816
  e.d(n, "a", function() {
30813
30817
  return r;
30814
30818
  });
30815
- for (var r = {}, i = 0, o = (e(3).b || "").match(/\w+\/(\d|\.)+(\s|$)/gi) || []; i < o.length; i++) {
30819
+ for (var r = {}, i = 0, o = (e(0).j || "").match(/\w+\/(\d|\.)+(\s|$)/gi) || []; i < o.length; i++) {
30816
30820
  var u = o[i].split("/"), c = u[0], a = u[1];
30817
30821
  r[c] = a;
30818
30822
  }
@@ -30829,15 +30833,15 @@ var require_devtools_detector = __commonJS({
30829
30833
  }), e.d(n, "e", function() {
30830
30834
  return a;
30831
30835
  });
30832
- var r = e(3), i = /macintosh/i.test(r.b), o = /ipad/i.test(r.b) || i && navigator.maxTouchPoints > 1, u = /iphone/i.test(r.b), c = /android/i.test(r.b), a = /windows/i.test(r.b);
30836
+ var r = e(0), i = /macintosh/i.test(r.j), o = /ipad/i.test(r.j) || i && navigator.maxTouchPoints > 1, u = /iphone/i.test(r.j), c = /android/i.test(r.j), a = /windows/i.test(r.j);
30833
30837
  }, function(t, n, e) {
30834
30838
  "use strict";
30835
30839
  e.d(n, "a", function() {
30836
- return o;
30840
+ return u;
30837
30841
  });
30838
- var r = this && this.__awaiter || function(t2, n2, e2, r2) {
30842
+ var r = e(0), i = this && this.__awaiter || function(t2, n2, e2, r2) {
30839
30843
  return new (e2 || (e2 = Promise))(function(i2, o2) {
30840
- function u(t3) {
30844
+ function u2(t3) {
30841
30845
  try {
30842
30846
  a(r2.next(t3));
30843
30847
  } catch (t4) {
@@ -30856,12 +30860,12 @@ var require_devtools_detector = __commonJS({
30856
30860
  return t4 instanceof e2 ? t4 : new e2(function(n3) {
30857
30861
  n3(t4);
30858
30862
  });
30859
- }(t3.value).then(u, c);
30863
+ }(t3.value).then(u2, c);
30860
30864
  }
30861
30865
  a((r2 = r2.apply(t2, n2 || [])).next());
30862
30866
  });
30863
- }, i = this && this.__generator || function(t2, n2) {
30864
- var e2, r2, i2, o2, u = { label: 0, sent: function() {
30867
+ }, o = this && this.__generator || function(t2, n2) {
30868
+ var e2, r2, i2, o2, u2 = { label: 0, sent: function() {
30865
30869
  if (1 & i2[0])
30866
30870
  throw i2[1];
30867
30871
  return i2[1];
@@ -30874,7 +30878,7 @@ var require_devtools_detector = __commonJS({
30874
30878
  return function(o4) {
30875
30879
  if (e2)
30876
30880
  throw new TypeError("Generator is already executing.");
30877
- for (; u; )
30881
+ for (; u2; )
30878
30882
  try {
30879
30883
  if (e2 = 1, r2 && (i2 = 2 & o4[0] ? r2.return : o4[0] ? r2.throw || ((i2 = r2.return) && i2.call(r2), 0) : r2.next) && !(i2 = i2.call(r2, o4[1])).done)
30880
30884
  return i2;
@@ -30884,34 +30888,34 @@ var require_devtools_detector = __commonJS({
30884
30888
  i2 = o4;
30885
30889
  break;
30886
30890
  case 4:
30887
- return u.label++, { value: o4[1], done: false };
30891
+ return u2.label++, { value: o4[1], done: false };
30888
30892
  case 5:
30889
- u.label++, r2 = o4[1], o4 = [0];
30893
+ u2.label++, r2 = o4[1], o4 = [0];
30890
30894
  continue;
30891
30895
  case 7:
30892
- o4 = u.ops.pop(), u.trys.pop();
30896
+ o4 = u2.ops.pop(), u2.trys.pop();
30893
30897
  continue;
30894
30898
  default:
30895
- if (!(i2 = (i2 = u.trys).length > 0 && i2[i2.length - 1]) && (o4[0] === 6 || o4[0] === 2)) {
30896
- u = 0;
30899
+ if (!(i2 = (i2 = u2.trys).length > 0 && i2[i2.length - 1]) && (o4[0] === 6 || o4[0] === 2)) {
30900
+ u2 = 0;
30897
30901
  continue;
30898
30902
  }
30899
30903
  if (o4[0] === 3 && (!i2 || o4[1] > i2[0] && o4[1] < i2[3])) {
30900
- u.label = o4[1];
30904
+ u2.label = o4[1];
30901
30905
  break;
30902
30906
  }
30903
- if (o4[0] === 6 && u.label < i2[1]) {
30904
- u.label = i2[1], i2 = o4;
30907
+ if (o4[0] === 6 && u2.label < i2[1]) {
30908
+ u2.label = i2[1], i2 = o4;
30905
30909
  break;
30906
30910
  }
30907
- if (i2 && u.label < i2[2]) {
30908
- u.label = i2[2], u.ops.push(o4);
30911
+ if (i2 && u2.label < i2[2]) {
30912
+ u2.label = i2[2], u2.ops.push(o4);
30909
30913
  break;
30910
30914
  }
30911
- i2[2] && u.ops.pop(), u.trys.pop();
30915
+ i2[2] && u2.ops.pop(), u2.trys.pop();
30912
30916
  continue;
30913
30917
  }
30914
- o4 = n2.call(t2, u);
30918
+ o4 = n2.call(t2, u2);
30915
30919
  } catch (t3) {
30916
30920
  o4 = [6, t3], r2 = 0;
30917
30921
  } finally {
@@ -30923,13 +30927,13 @@ var require_devtools_detector = __commonJS({
30923
30927
  }([o3, c2]);
30924
30928
  };
30925
30929
  }
30926
- }, o = function() {
30930
+ }, u = function() {
30927
30931
  function t2(t3) {
30928
30932
  var n2 = t3.checkers;
30929
30933
  this._listeners = [], this._isOpen = false, this._detectLoopStopped = true, this._detectLoopDelay = 500, this._checkers = n2.slice();
30930
30934
  }
30931
30935
  return t2.prototype.launch = function() {
30932
- this._detectLoopDelay <= 0 && this.setDetectDelay(500), this._detectLoopStopped && (this._detectLoopStopped = false, this._detectLoop());
30936
+ r.b && (this._detectLoopDelay <= 0 && this.setDetectDelay(500), this._detectLoopStopped && (this._detectLoopStopped = false, this._detectLoop()));
30933
30937
  }, t2.prototype.stop = function() {
30934
30938
  this._detectLoopStopped || (this._detectLoopStopped = true, clearTimeout(this._timer));
30935
30939
  }, t2.prototype.isLaunch = function() {
@@ -30951,65 +30955,137 @@ var require_devtools_detector = __commonJS({
30951
30955
  }
30952
30956
  }
30953
30957
  }, t2.prototype._detectLoop = function() {
30954
- return r(this, void 0, void 0, function() {
30955
- var t3, n2, e2, r2, o2, u, c = this;
30956
- return i(this, function(i2) {
30957
- switch (i2.label) {
30958
+ return i(this, void 0, void 0, function() {
30959
+ var t3, n2, e2, r2, i2, u2 = this;
30960
+ return o(this, function(o2) {
30961
+ switch (o2.label) {
30958
30962
  case 0:
30959
- t3 = false, n2 = "", e2 = 0, r2 = this._checkers, i2.label = 1;
30963
+ t3 = false, n2 = "", e2 = 0, r2 = this._checkers, o2.label = 1;
30960
30964
  case 1:
30961
- return e2 < r2.length ? [4, (o2 = r2[e2]).isEnable()] : [3, 6];
30965
+ return e2 < r2.length ? [4, (i2 = r2[e2]).isEnable()] : [3, 6];
30962
30966
  case 2:
30963
- return u = i2.sent(), console.log("isEnable", u), u ? (n2 = o2.name, [4, o2.isOpen()]) : [3, 4];
30967
+ return o2.sent() ? (n2 = i2.name, [4, i2.isOpen()]) : [3, 4];
30964
30968
  case 3:
30965
- t3 = i2.sent(), i2.label = 4;
30969
+ t3 = o2.sent(), o2.label = 4;
30966
30970
  case 4:
30967
30971
  if (t3)
30968
30972
  return [3, 6];
30969
- i2.label = 5;
30973
+ o2.label = 5;
30970
30974
  case 5:
30971
30975
  return e2++, [3, 1];
30972
30976
  case 6:
30973
- return t3 != this._isOpen && (this._isOpen = t3, this._broadcast({ isOpen: t3, checkerName: n2 })), this._detectLoopDelay > 0 ? this._timer = setTimeout(function() {
30974
- return c._detectLoop();
30977
+ return t3 != this._isOpen && (this._isOpen = t3, this._broadcast({ isOpen: t3, checkerName: n2 })), this._detectLoopDelay > 0 && !this._detectLoopStopped ? this._timer = setTimeout(function() {
30978
+ return u2._detectLoop();
30975
30979
  }, this._detectLoopDelay) : this.stop(), [2];
30976
30980
  }
30977
30981
  });
30978
30982
  });
30979
30983
  }, t2;
30980
30984
  }();
30985
+ }, function(t, n) {
30986
+ var e;
30987
+ e = function() {
30988
+ return this;
30989
+ }();
30990
+ try {
30991
+ e = e || Function("return this")() || (0, eval)("this");
30992
+ } catch (t2) {
30993
+ typeof window == "object" && (e = window);
30994
+ }
30995
+ t.exports = e;
30996
+ }, function(t, n, e) {
30997
+ var r, i, o;
30998
+ !function(e2, u) {
30999
+ i = [], (o = typeof (r = u) == "function" ? r.apply(n, i) : r) === void 0 || (t.exports = o);
31000
+ }(0, function() {
31001
+ var t2 = /^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+))?(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
31002
+ function n2(t3) {
31003
+ var n3 = t3.replace(/^v/, "").replace(/\+.*$/, ""), e3 = function(t4, n4) {
31004
+ return t4.indexOf(n4) === -1 ? t4.length : t4.indexOf(n4);
31005
+ }(n3, "-"), r3 = n3.substring(0, e3).split(".");
31006
+ return r3.push(n3.substring(e3 + 1)), r3;
31007
+ }
31008
+ function e2(t3) {
31009
+ return isNaN(Number(t3)) ? t3 : Number(t3);
31010
+ }
31011
+ function r2(n3) {
31012
+ if (typeof n3 != "string")
31013
+ throw new TypeError("Invalid argument expected string");
31014
+ if (!t2.test(n3))
31015
+ throw new Error("Invalid argument not valid semver ('" + n3 + "' received)");
31016
+ }
31017
+ function i2(t3, i3) {
31018
+ [t3, i3].forEach(r2);
31019
+ for (var o3 = n2(t3), u2 = n2(i3), c = 0; c < Math.max(o3.length - 1, u2.length - 1); c++) {
31020
+ var a = parseInt(o3[c] || 0, 10), f = parseInt(u2[c] || 0, 10);
31021
+ if (a > f)
31022
+ return 1;
31023
+ if (f > a)
31024
+ return -1;
31025
+ }
31026
+ var s = o3[o3.length - 1], l = u2[u2.length - 1];
31027
+ if (s && l) {
31028
+ var d = s.split(".").map(e2), h = l.split(".").map(e2);
31029
+ for (c = 0; c < Math.max(d.length, h.length); c++) {
31030
+ if (d[c] === void 0 || typeof h[c] == "string" && typeof d[c] == "number")
31031
+ return -1;
31032
+ if (h[c] === void 0 || typeof d[c] == "string" && typeof h[c] == "number")
31033
+ return 1;
31034
+ if (d[c] > h[c])
31035
+ return 1;
31036
+ if (h[c] > d[c])
31037
+ return -1;
31038
+ }
31039
+ } else if (s || l)
31040
+ return s ? -1 : 1;
31041
+ return 0;
31042
+ }
31043
+ var o2 = [">", ">=", "=", "<", "<="], u = { ">": [1], ">=": [0, 1], "=": [0], "<=": [-1, 0], "<": [-1] };
31044
+ return i2.validate = function(n3) {
31045
+ return typeof n3 == "string" && t2.test(n3);
31046
+ }, i2.compare = function(t3, n3, e3) {
31047
+ !function(t4) {
31048
+ if (typeof t4 != "string")
31049
+ throw new TypeError("Invalid operator type, expected string but got " + typeof t4);
31050
+ if (o2.indexOf(t4) === -1)
31051
+ throw new TypeError("Invalid operator, expected one of " + o2.join("|"));
31052
+ }(e3);
31053
+ var r3 = i2(t3, n3);
31054
+ return u[e3].indexOf(r3) > -1;
31055
+ }, i2;
31056
+ });
30981
31057
  }, function(t, n, e) {
30982
31058
  "use strict";
30983
31059
  Object.defineProperty(n, "__esModule", { value: true });
30984
- var r = e(9);
31060
+ var r = e(10);
30985
31061
  e.d(n, "depRegToStringChecker", function() {
30986
31062
  return r.a;
30987
31063
  });
30988
- var i = e(12);
31064
+ var i = e(11);
30989
31065
  e.d(n, "elementIdChecker", function() {
30990
31066
  return i.a;
30991
31067
  });
30992
- var o = e(13);
31068
+ var o = e(12);
30993
31069
  e.d(n, "functionToStringChecker", function() {
30994
31070
  return o.a;
30995
31071
  });
30996
- var u = e(14);
31072
+ var u = e(13);
30997
31073
  e.d(n, "regToStringChecker", function() {
30998
31074
  return u.a;
30999
31075
  });
31000
- var c = e(15);
31076
+ var c = e(14);
31001
31077
  e.d(n, "debuggerChecker", function() {
31002
31078
  return c.a;
31003
31079
  });
31004
- var a = e(16);
31080
+ var a = e(15);
31005
31081
  e.d(n, "dateToStringChecker", function() {
31006
31082
  return a.a;
31007
31083
  });
31008
- var f = e(17);
31084
+ var f = e(16);
31009
31085
  e.d(n, "performanceChecker", function() {
31010
31086
  return f.a;
31011
31087
  });
31012
- var s = e(19);
31088
+ var s = e(17);
31013
31089
  e.d(n, "erudaChecker", function() {
31014
31090
  return s.a;
31015
31091
  });
@@ -31018,7 +31094,7 @@ var require_devtools_detector = __commonJS({
31018
31094
  e.d(n, "a", function() {
31019
31095
  return s;
31020
31096
  });
31021
- var r = e(1), i = e(2), o = e(0), u = this && this.__awaiter || function(t2, n2, e2, r2) {
31097
+ var r = e(0), i = e(2), o = e(1), u = this && this.__awaiter || function(t2, n2, e2, r2) {
31022
31098
  return new (e2 || (e2 = Promise))(function(i2, o2) {
31023
31099
  function u2(t3) {
31024
31100
  try {
@@ -31119,88 +31195,16 @@ var require_devtools_detector = __commonJS({
31119
31195
  }, isEnable: function() {
31120
31196
  return u(this, void 0, void 0, function() {
31121
31197
  return c(this, function(t2) {
31122
- return [2, Object(o.b)({ includes: [true], excludes: [r.c, r.d] })];
31198
+ return [2, Object(o.b)({ includes: [true], excludes: [r.e, r.f] })];
31123
31199
  });
31124
31200
  });
31125
31201
  } };
31126
- }, function(t, n) {
31127
- var e;
31128
- e = function() {
31129
- return this;
31130
- }();
31131
- try {
31132
- e = e || Function("return this")() || (0, eval)("this");
31133
- } catch (t2) {
31134
- typeof window == "object" && (e = window);
31135
- }
31136
- t.exports = e;
31137
- }, function(t, n, e) {
31138
- var r, i, o;
31139
- !function(e2, u) {
31140
- i = [], (o = typeof (r = u) == "function" ? r.apply(n, i) : r) === void 0 || (t.exports = o);
31141
- }(0, function() {
31142
- var t2 = /^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+))?(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
31143
- function n2(t3) {
31144
- var n3 = t3.replace(/^v/, "").replace(/\+.*$/, ""), e3 = function(t4, n4) {
31145
- return t4.indexOf(n4) === -1 ? t4.length : t4.indexOf(n4);
31146
- }(n3, "-"), r3 = n3.substring(0, e3).split(".");
31147
- return r3.push(n3.substring(e3 + 1)), r3;
31148
- }
31149
- function e2(t3) {
31150
- return isNaN(Number(t3)) ? t3 : Number(t3);
31151
- }
31152
- function r2(n3) {
31153
- if (typeof n3 != "string")
31154
- throw new TypeError("Invalid argument expected string");
31155
- if (!t2.test(n3))
31156
- throw new Error("Invalid argument not valid semver ('" + n3 + "' received)");
31157
- }
31158
- function i2(t3, i3) {
31159
- [t3, i3].forEach(r2);
31160
- for (var o3 = n2(t3), u2 = n2(i3), c = 0; c < Math.max(o3.length - 1, u2.length - 1); c++) {
31161
- var a = parseInt(o3[c] || 0, 10), f = parseInt(u2[c] || 0, 10);
31162
- if (a > f)
31163
- return 1;
31164
- if (f > a)
31165
- return -1;
31166
- }
31167
- var s = o3[o3.length - 1], l = u2[u2.length - 1];
31168
- if (s && l) {
31169
- var d = s.split(".").map(e2), h = l.split(".").map(e2);
31170
- for (c = 0; c < Math.max(d.length, h.length); c++) {
31171
- if (d[c] === void 0 || typeof h[c] == "string" && typeof d[c] == "number")
31172
- return -1;
31173
- if (h[c] === void 0 || typeof d[c] == "string" && typeof h[c] == "number")
31174
- return 1;
31175
- if (d[c] > h[c])
31176
- return 1;
31177
- if (h[c] > d[c])
31178
- return -1;
31179
- }
31180
- } else if (s || l)
31181
- return s ? -1 : 1;
31182
- return 0;
31183
- }
31184
- var o2 = [">", ">=", "=", "<", "<="], u = { ">": [1], ">=": [0, 1], "=": [0], "<=": [-1, 0], "<": [-1] };
31185
- return i2.validate = function(n3) {
31186
- return typeof n3 == "string" && t2.test(n3);
31187
- }, i2.compare = function(t3, n3, e3) {
31188
- !function(t4) {
31189
- if (typeof t4 != "string")
31190
- throw new TypeError("Invalid operator type, expected string but got " + typeof t4);
31191
- if (o2.indexOf(t4) === -1)
31192
- throw new TypeError("Invalid operator, expected one of " + o2.join("|"));
31193
- }(e3);
31194
- var r3 = i2(t3, n3);
31195
- return u[e3].indexOf(r3) > -1;
31196
- }, i2;
31197
- });
31198
31202
  }, function(t, n, e) {
31199
31203
  "use strict";
31200
31204
  e.d(n, "a", function() {
31201
- return l;
31205
+ return s;
31202
31206
  });
31203
- var r = e(1), i = e(2), o = e(0), u = e(3), c = this && this.__awaiter || function(t2, n2, e2, r2) {
31207
+ var r = e(0), i = e(2), o = e(1), u = this && this.__awaiter || function(t2, n2, e2, r2) {
31204
31208
  return new (e2 || (e2 = Promise))(function(i2, o2) {
31205
31209
  function u2(t3) {
31206
31210
  try {
@@ -31225,7 +31229,7 @@ var require_devtools_detector = __commonJS({
31225
31229
  }
31226
31230
  a2((r2 = r2.apply(t2, n2 || [])).next());
31227
31231
  });
31228
- }, a = this && this.__generator || function(t2, n2) {
31232
+ }, c = this && this.__generator || function(t2, n2) {
31229
31233
  var e2, r2, i2, o2, u2 = { label: 0, sent: function() {
31230
31234
  if (1 & i2[0])
31231
31235
  throw i2[1];
@@ -31288,20 +31292,20 @@ var require_devtools_detector = __commonJS({
31288
31292
  }([o3, c3]);
31289
31293
  };
31290
31294
  }
31291
- }, f = Object(u.a)("div"), s = false;
31292
- Object.defineProperty(f, "id", { get: function() {
31293
- return s = true, l.name;
31295
+ }, a = Object(r.a)("div"), f = false;
31296
+ Object.defineProperty(a, "id", { get: function() {
31297
+ return f = true, s.name;
31294
31298
  }, configurable: true });
31295
- var l = { name: "element-id", isOpen: function() {
31296
- return c(this, void 0, void 0, function() {
31297
- return a(this, function(t2) {
31298
- return s = false, Object(i.b)(f), Object(i.a)(), [2, s];
31299
+ var s = { name: "element-id", isOpen: function() {
31300
+ return u(this, void 0, void 0, function() {
31301
+ return c(this, function(t2) {
31302
+ return f = false, Object(i.b)(a), Object(i.a)(), [2, f];
31299
31303
  });
31300
31304
  });
31301
31305
  }, isEnable: function() {
31302
- return c(this, void 0, void 0, function() {
31303
- return a(this, function(t2) {
31304
- return [2, Object(o.b)({ includes: [true], excludes: [r.d, r.b, r.c] })];
31306
+ return u(this, void 0, void 0, function() {
31307
+ return c(this, function(t2) {
31308
+ return [2, Object(o.b)({ includes: [true], excludes: [r.f, r.d, r.e] })];
31305
31309
  });
31306
31310
  });
31307
31311
  } };
@@ -31310,7 +31314,7 @@ var require_devtools_detector = __commonJS({
31310
31314
  e.d(n, "a", function() {
31311
31315
  return l;
31312
31316
  });
31313
- var r = e(1), i = e(2), o = e(6), u = e(0), c = this && this.__awaiter || function(t2, n2, e2, r2) {
31317
+ var r = e(0), i = e(2), o = e(5), u = e(1), c = this && this.__awaiter || function(t2, n2, e2, r2) {
31314
31318
  return new (e2 || (e2 = Promise))(function(i2, o2) {
31315
31319
  function u2(t3) {
31316
31320
  try {
@@ -31414,7 +31418,7 @@ var require_devtools_detector = __commonJS({
31414
31418
  }, isEnable: function() {
31415
31419
  return c(this, void 0, void 0, function() {
31416
31420
  return a(this, function(t2) {
31417
- return [2, Object(u.b)({ includes: [true], excludes: [r.c, (o.b || o.c) && r.a] })];
31421
+ return [2, Object(u.b)({ includes: [true], excludes: [r.g, r.e, (o.b || o.c) && r.c] })];
31418
31422
  });
31419
31423
  });
31420
31424
  } };
@@ -31423,7 +31427,7 @@ var require_devtools_detector = __commonJS({
31423
31427
  e.d(n, "a", function() {
31424
31428
  return s;
31425
31429
  });
31426
- var r = e(2), i = e(1), o = e(0), u = this && this.__awaiter || function(t2, n2, e2, r2) {
31430
+ var r = e(2), i = e(0), o = e(1), u = this && this.__awaiter || function(t2, n2, e2, r2) {
31427
31431
  return new (e2 || (e2 = Promise))(function(i2, o2) {
31428
31432
  function u2(t3) {
31429
31433
  try {
@@ -31524,7 +31528,7 @@ var require_devtools_detector = __commonJS({
31524
31528
  }, isEnable: function() {
31525
31529
  return u(this, void 0, void 0, function() {
31526
31530
  return c(this, function(t2) {
31527
- return [2, Object(o.b)({ includes: [true], excludes: [i.f] })];
31531
+ return [2, Object(o.b)({ includes: [true], excludes: [i.i] })];
31528
31532
  });
31529
31533
  });
31530
31534
  } };
@@ -31533,7 +31537,7 @@ var require_devtools_detector = __commonJS({
31533
31537
  e.d(n, "a", function() {
31534
31538
  return u;
31535
31539
  });
31536
- var r = e(0), i = this && this.__awaiter || function(t2, n2, e2, r2) {
31540
+ var r = e(1), i = this && this.__awaiter || function(t2, n2, e2, r2) {
31537
31541
  return new (e2 || (e2 = Promise))(function(i2, o2) {
31538
31542
  function u2(t3) {
31539
31543
  try {
@@ -31641,7 +31645,7 @@ var require_devtools_detector = __commonJS({
31641
31645
  e.d(n, "a", function() {
31642
31646
  return l;
31643
31647
  });
31644
- var r = e(1), i = e(2), o = e(0), u = e(4), c = this && this.__awaiter || function(t2, n2, e2, r2) {
31648
+ var r = e(0), i = e(2), o = e(1), u = e(3), c = this && this.__awaiter || function(t2, n2, e2, r2) {
31645
31649
  return new (e2 || (e2 = Promise))(function(i2, o2) {
31646
31650
  function u2(t3) {
31647
31651
  try {
@@ -31742,16 +31746,16 @@ var require_devtools_detector = __commonJS({
31742
31746
  }, isEnable: function() {
31743
31747
  return c(this, void 0, void 0, function() {
31744
31748
  return a(this, function(t2) {
31745
- return [2, Object(o.b)({ includes: [r.a], excludes: [(u.isIpad || u.isIphone) && r.a] })];
31749
+ return [2, Object(o.b)({ includes: [r.c], excludes: [(u.isIpad || u.isIphone) && r.c] })];
31746
31750
  });
31747
31751
  });
31748
31752
  } };
31749
31753
  }, function(t, n, e) {
31750
31754
  "use strict";
31751
31755
  e.d(n, "a", function() {
31752
- return d;
31756
+ return s;
31753
31757
  });
31754
- for (var r = e(1), i = e(2), o = e(0), u = this && this.__awaiter || function(t2, n2, e2, r2) {
31758
+ var r = e(0), i = e(2), o = e(1), u = this && this.__awaiter || function(t2, n2, e2, r2) {
31755
31759
  return new (e2 || (e2 = Promise))(function(i2, o2) {
31756
31760
  function u2(t3) {
31757
31761
  try {
@@ -31839,41 +31843,34 @@ var require_devtools_detector = __commonJS({
31839
31843
  }([o3, c3]);
31840
31844
  };
31841
31845
  }
31842
- }, a = function() {
31843
- for (var t2 = {}, n2 = 0; n2 < 500; n2++)
31844
- t2["".concat(n2)] = "".concat(n2);
31845
- return t2;
31846
- }(), f = [], s = 0; s < 50; s++)
31847
- f.push(a);
31848
- var l = Math.max(h(), 1e-3);
31849
- Object(i.a)();
31850
- var d = { name: "performance", isOpen: function() {
31846
+ }, a = null, f = 0, s = { name: "performance", isOpen: function() {
31851
31847
  return u(this, void 0, void 0, function() {
31852
- var t2;
31853
- return c(this, function(n2) {
31854
- return t2 = function() {
31848
+ var t2, n2;
31849
+ return c(this, function(e2) {
31850
+ return a === null && (a = function() {
31851
+ for (var t3 = function() {
31852
+ for (var t4 = {}, n4 = 0; n4 < 500; n4++)
31853
+ t4["".concat(n4)] = "".concat(n4);
31854
+ return t4;
31855
+ }(), n3 = [], e3 = 0; e3 < 50; e3++)
31856
+ n3.push(t3);
31857
+ return n3;
31858
+ }()), t2 = function() {
31859
+ var t3 = Object(o.c)();
31860
+ return Object(i.c)(a), Object(o.c)() - t3;
31861
+ }(), n2 = function() {
31855
31862
  var t3 = Object(o.c)();
31856
- return Object(i.c)(f), Object(o.c)() - t3;
31857
- }(), l = Math.max(l, h()), Object(i.a)(), t2 === 0 ? [2, false] : [2, t2 > 10 * l];
31863
+ return Object(i.b)(a), Object(o.c)() - t3;
31864
+ }(), f = Math.max(f, n2), Object(i.a)(), t2 === 0 ? [2, false] : f === 0 ? [2, false] : [2, t2 > 10 * f];
31858
31865
  });
31859
31866
  });
31860
31867
  }, isEnable: function() {
31861
31868
  return u(this, void 0, void 0, function() {
31862
31869
  return c(this, function(t2) {
31863
- return [2, Object(o.b)({ includes: [r.a], excludes: [] })];
31870
+ return [2, Object(o.b)({ includes: [r.c], excludes: [] })];
31864
31871
  });
31865
31872
  });
31866
31873
  } };
31867
- function h() {
31868
- var t2 = Object(o.c)();
31869
- return Object(i.b)(f), Object(o.c)() - t2;
31870
- }
31871
- }, function(t, n, e) {
31872
- "use strict";
31873
- e.d(n, "a", function() {
31874
- return i;
31875
- });
31876
- var r = e(3), i = /mobile/i.test(r.b);
31877
31874
  }, function(t, n, e) {
31878
31875
  "use strict";
31879
31876
  e.d(n, "a", function() {
@@ -55563,17 +55560,7 @@ var TextHighlighter = class {
55563
55560
  toolbox.style.top = ev.clientY + (self2.delegate.attributes?.navHeight ?? 0) + "px";
55564
55561
  toolbox.style.left = ev.clientX + "px";
55565
55562
  if (getComputedStyle(toolbox).display === "none") {
55566
- let noteH = function() {
55567
- self2.delegate.annotationModule?.api?.addCommentToAnnotation(anno).then((result) => {
55568
- self2.delegate.annotationModule?.updateAnnotation(result).then(async () => {
55569
- import_loglevel5.default.log("update highlight " + result.id);
55570
- toolbox.style.display = "none";
55571
- self2.selectionMenuClosed();
55572
- });
55573
- toolbox.style.display = "none";
55574
- self2.selectionMenuClosed();
55575
- });
55576
- }, deleteH = function() {
55563
+ let deleteH = function() {
55577
55564
  if (self2.delegate.rights.enableAnnotations) {
55578
55565
  self2.delegate.annotationModule?.deleteSelectedHighlight(anno).then(async () => {
55579
55566
  import_loglevel5.default.log("delete highlight " + anno.id);
@@ -55608,14 +55595,6 @@ var TextHighlighter = class {
55608
55595
  }
55609
55596
  if (commentIcon) {
55610
55597
  commentIcon.style.display = "none";
55611
- let clone = commentIcon.cloneNode(true);
55612
- let parent = commentIcon.parentElement;
55613
- clone.style.display = "unset";
55614
- clone.id = "cloneCommentIcon";
55615
- clone.addEventListener("click", noteH, false);
55616
- if (parent) {
55617
- parent.append(clone);
55618
- }
55619
55598
  }
55620
55599
  let deleteIcon = document.getElementById("deleteIcon");
55621
55600
  let cloneDeleteIcon = document.getElementById("cloneDeleteIcon");
@@ -58323,6 +58302,9 @@ var ContentProtectionModule = class {
58323
58302
  return true;
58324
58303
  }
58325
58304
  restrictCopy(event) {
58305
+ if (this.citation) {
58306
+ return;
58307
+ }
58326
58308
  import_loglevel13.default.log("copy action initiated");
58327
58309
  let win = this.delegate.iframes[0].contentWindow;
58328
58310
  if (win) {
@@ -58982,14 +58964,14 @@ var SearchModule = class {
58982
58964
  this.currentSearchHighlights = [];
58983
58965
  this.bookSearchResult = [];
58984
58966
  reset();
58985
- this.searchAndPaintChapter(term, 0, async () => {
58967
+ await this.searchAndPaintChapter(term, 0, async () => {
58986
58968
  });
58987
- var chapter = this.searchChapter(term);
58988
- var book = this.searchBook(term);
58989
58969
  if (current) {
58990
- return chapter;
58970
+ await this.searchBook(term);
58971
+ return await this.searchChapter(term);
58991
58972
  } else {
58992
- return book;
58973
+ await this.searchChapter(term);
58974
+ return await this.searchBook(term);
58993
58975
  }
58994
58976
  }
58995
58977
  async goToSearchID(href, index2, current) {
@@ -59197,18 +59179,33 @@ var SearchModule = class {
59197
59179
  }
59198
59180
  if (tocItem) {
59199
59181
  let href = this.publication.getAbsoluteHref(tocItem.Href);
59200
- await fetch(href, this.delegate.requestConfig).then((r) => r.text()).then(async (data) => {
59201
- let parser = new DOMParser();
59202
- let doc = parser.parseFromString(this.delegate.requestConfig?.encoded ? this.decodeBase64(data) : data, "application/xhtml+xml");
59203
- if (tocItem) {
59204
- searchDocDomSeek(term, doc, tocItem.Href, tocItem.Title).then((result) => {
59205
- result.forEach((searchItem) => {
59206
- localSearchResultBook.push(searchItem);
59207
- this.bookSearchResult.push(searchItem);
59182
+ if (this.delegate.api?.getContent) {
59183
+ await this.delegate.api?.getContent(href).then((content) => {
59184
+ let parser = new DOMParser();
59185
+ let doc = parser.parseFromString(this.delegate.requestConfig?.encoded ? this.decodeBase64(content) : content, "application/xhtml+xml");
59186
+ if (tocItem) {
59187
+ searchDocDomSeek(term, doc, tocItem.Href, tocItem.Title).then((result) => {
59188
+ result.forEach((searchItem) => {
59189
+ localSearchResultBook.push(searchItem);
59190
+ this.bookSearchResult.push(searchItem);
59191
+ });
59208
59192
  });
59209
- });
59210
- }
59211
- });
59193
+ }
59194
+ });
59195
+ } else {
59196
+ await fetch(href, this.delegate.requestConfig).then((r) => r.text()).then(async (data) => {
59197
+ let parser = new DOMParser();
59198
+ let doc = parser.parseFromString(this.delegate.requestConfig?.encoded ? this.decodeBase64(data) : data, "application/xhtml+xml");
59199
+ if (tocItem) {
59200
+ searchDocDomSeek(term, doc, tocItem.Href, tocItem.Title).then((result) => {
59201
+ result.forEach((searchItem) => {
59202
+ localSearchResultBook.push(searchItem);
59203
+ this.bookSearchResult.push(searchItem);
59204
+ });
59205
+ });
59206
+ }
59207
+ });
59208
+ }
59212
59209
  }
59213
59210
  if (index2 === this.publication.readingOrder.length - 1) {
59214
59211
  return localSearchResultBook;
@@ -59234,17 +59231,31 @@ var SearchModule = class {
59234
59231
  }
59235
59232
  if (tocItem) {
59236
59233
  let href = this.publication.getAbsoluteHref(tocItem.Href);
59237
- await fetch(href, this.delegate.requestConfig).then((r) => r.text()).then(async (data) => {
59238
- let parser = new DOMParser();
59239
- let doc = parser.parseFromString(this.delegate.requestConfig?.encoded ? this.decodeBase64(data) : data, "application/xhtml+xml");
59240
- if (tocItem) {
59241
- searchDocDomSeek(term, doc, tocItem.Href, tocItem.Title).then((result) => {
59242
- result.forEach((searchItem) => {
59243
- localSearchResultBook.push(searchItem);
59234
+ if (this.delegate.api?.getContent) {
59235
+ await this.delegate.api?.getContent(href).then((content) => {
59236
+ let parser = new DOMParser();
59237
+ let doc = parser.parseFromString(this.delegate.requestConfig?.encoded ? this.decodeBase64(content) : content, "application/xhtml+xml");
59238
+ if (tocItem) {
59239
+ searchDocDomSeek(term, doc, tocItem.Href, tocItem.Title).then((result) => {
59240
+ result.forEach((searchItem) => {
59241
+ localSearchResultBook.push(searchItem);
59242
+ });
59244
59243
  });
59245
- });
59246
- }
59247
- });
59244
+ }
59245
+ });
59246
+ } else {
59247
+ await fetch(href, this.delegate.requestConfig).then((r) => r.text()).then(async (data) => {
59248
+ let parser = new DOMParser();
59249
+ let doc = parser.parseFromString(this.delegate.requestConfig?.encoded ? this.decodeBase64(data) : data, "application/xhtml+xml");
59250
+ if (tocItem) {
59251
+ searchDocDomSeek(term, doc, tocItem.Href, tocItem.Title).then((result) => {
59252
+ result.forEach((searchItem) => {
59253
+ localSearchResultBook.push(searchItem);
59254
+ });
59255
+ });
59256
+ }
59257
+ });
59258
+ }
59248
59259
  }
59249
59260
  return localSearchResultBook;
59250
59261
  }
@@ -64360,9 +64371,12 @@ var CitationModule = class {
64360
64371
  return module2;
64361
64372
  }
64362
64373
  async stop() {
64363
- import_loglevel23.default.log("Timeline module stop");
64374
+ import_loglevel23.default.log("Citation module stop");
64364
64375
  }
64365
64376
  copyToClipboard(textToClipboard) {
64377
+ if (this.delegate?.contentProtectionModule) {
64378
+ this.delegate.contentProtectionModule.citation = true;
64379
+ }
64366
64380
  let success = true;
64367
64381
  if (window.clipboardData) {
64368
64382
  window.clipboardData.setData("text/plain", textToClipboard);
@@ -64412,7 +64426,11 @@ var CitationModule = class {
64412
64426
  let chicagoString = "";
64413
64427
  let mlaString = "";
64414
64428
  let apaString = "";
64415
- if (self2.publication.Metadata.Author?.length > 0) {
64429
+ if (self2.properties.author) {
64430
+ apaString = apaString + self2.properties.author;
64431
+ mlaString = mlaString + self2.properties.author;
64432
+ chicagoString = chicagoString + self2.properties.author;
64433
+ } else if (self2.publication.Metadata.Author?.length > 0) {
64416
64434
  let authorIndex = 0;
64417
64435
  if (authorIndex === 0) {
64418
64436
  if (self2.publication.Metadata.Author[0].Name) {
@@ -64433,11 +64451,18 @@ var CitationModule = class {
64433
64451
  let chicagoString = "";
64434
64452
  let mlaString = "";
64435
64453
  let apaString = "";
64436
- if (self2.publication.Metadata.Publisher && self2.publication.Metadata.Publisher[0].Name) {
64454
+ if (self2.properties.publisher) {
64455
+ mlaString = mlaString + self2.properties.publisher + ", ";
64456
+ chicagoString = chicagoString + self2.properties.publisher + ", ";
64457
+ } else if (self2.publication.Metadata.Publisher && self2.publication.Metadata.Publisher[0].Name) {
64437
64458
  mlaString = mlaString + self2.publication.Metadata.Publisher[0].Name + ", ";
64438
64459
  chicagoString = chicagoString + self2.publication.Metadata.Publisher[0].Name + ", ";
64439
64460
  }
64440
- if (self2.publication.Metadata.PublicationDate) {
64461
+ if (self2.properties.published) {
64462
+ apaString = apaString + "(" + self2.properties.published + ")";
64463
+ mlaString = mlaString + self2.properties.published;
64464
+ chicagoString = chicagoString + self2.properties.published;
64465
+ } else if (self2.publication.Metadata.PublicationDate) {
64441
64466
  if (self2.publication.Metadata.PublicationDate.getFullYear() > 0) {
64442
64467
  apaString = apaString + "(" + self2.publication.Metadata.PublicationDate.getFullYear() + ")";
64443
64468
  mlaString = mlaString + self2.publication.Metadata.PublicationDate.getFullYear();
@@ -64450,7 +64475,13 @@ var CitationModule = class {
64450
64475
  return ["", "", ""];
64451
64476
  };
64452
64477
  let bookTitleFormatted = function() {
64453
- if (self2.publication.Metadata.Title) {
64478
+ if (self2.properties.title) {
64479
+ return [
64480
+ self2.properties.title + ". ",
64481
+ self2.properties.title + ". ",
64482
+ self2.properties.title + ". "
64483
+ ];
64484
+ } else if (self2.publication.Metadata.Title) {
64454
64485
  return [
64455
64486
  self2.publication.Metadata.Title + ". ",
64456
64487
  self2.publication.Metadata.Title + ". ",
@@ -64467,7 +64498,11 @@ var CitationModule = class {
64467
64498
  let chicagoString = "";
64468
64499
  let mlaString = "";
64469
64500
  let apaString = "";
64470
- if (self2.publication.Metadata.Publisher && self2.publication.Metadata.Publisher[0].Name) {
64501
+ if (self2.properties.publisher) {
64502
+ mlaString = mlaString + self2.properties.publisher + ", ";
64503
+ chicagoString = chicagoString + self2.properties.publisher + ", ";
64504
+ apaString = apaString + self2.properties.publisher + ", ";
64505
+ } else if (self2.publication.Metadata.Publisher && self2.publication.Metadata.Publisher[0].Name) {
64471
64506
  mlaString = mlaString + self2.publication.Metadata.Publisher[0].Name + ", ";
64472
64507
  chicagoString = chicagoString + self2.publication.Metadata.Publisher[0].Name + ", ";
64473
64508
  apaString = apaString + self2.publication.Metadata.Publisher[0].Name + ", ";
@@ -64549,13 +64584,126 @@ var CitationModule = class {
64549
64584
  init_polyfills();
64550
64585
  var import_eventemitter32 = __toModule(require_eventemitter3());
64551
64586
  var import_pdfjs_dist = __toModule(require_pdf());
64587
+
64588
+ // src/utils/GrabToPan.ts
64589
+ init_polyfills();
64590
+ var CSS_CLASS_GRAB = "grab-to-pan-grab";
64591
+ var _onMouseDown, onMouseDown_fn, _onMouseMove, onMouseMove_fn, _endPan, endPan_fn;
64592
+ var GrabToPan = class {
64593
+ constructor(options) {
64594
+ __privateAdd(this, _onMouseDown);
64595
+ __privateAdd(this, _onMouseMove);
64596
+ __privateAdd(this, _endPan);
64597
+ this.element = options.element;
64598
+ this.document = options.element.ownerDocument;
64599
+ if (typeof options.ignoreTarget === "function") {
64600
+ this.ignoreTarget = options.ignoreTarget;
64601
+ }
64602
+ this.onActiveChanged = options.onActiveChanged;
64603
+ this.activate = this.activate.bind(this);
64604
+ this.deactivate = this.deactivate.bind(this);
64605
+ this.toggle = this.toggle.bind(this);
64606
+ this._onMouseDown = __privateMethod(this, _onMouseDown, onMouseDown_fn).bind(this);
64607
+ this._onMouseMove = __privateMethod(this, _onMouseMove, onMouseMove_fn).bind(this);
64608
+ this._endPan = __privateMethod(this, _endPan, endPan_fn).bind(this);
64609
+ const overlay = this.overlay = document.createElement("div");
64610
+ overlay.className = "grab-to-pan-grabbing";
64611
+ }
64612
+ activate() {
64613
+ if (!this.active) {
64614
+ this.active = true;
64615
+ this.element.addEventListener("mousedown", this._onMouseDown, true);
64616
+ this.element.classList.add(CSS_CLASS_GRAB);
64617
+ this.onActiveChanged?.(true);
64618
+ }
64619
+ }
64620
+ deactivate() {
64621
+ if (this.active) {
64622
+ this.active = false;
64623
+ this.element.removeEventListener("mousedown", this._onMouseDown, true);
64624
+ this._endPan();
64625
+ this.element.classList.remove(CSS_CLASS_GRAB);
64626
+ this.onActiveChanged?.(false);
64627
+ }
64628
+ }
64629
+ toggle() {
64630
+ if (this.active) {
64631
+ this.deactivate();
64632
+ } else {
64633
+ this.activate();
64634
+ }
64635
+ }
64636
+ ignoreTarget(node) {
64637
+ return node.matches("a[href], a[href] *, input, textarea, button, button *, select, option");
64638
+ }
64639
+ };
64640
+ _onMouseDown = new WeakSet();
64641
+ onMouseDown_fn = function(event) {
64642
+ if (event.button !== 0 || this.ignoreTarget(event.target)) {
64643
+ return;
64644
+ }
64645
+ if (event.originalTarget) {
64646
+ try {
64647
+ event.originalTarget.tagName;
64648
+ } catch (e) {
64649
+ return;
64650
+ }
64651
+ }
64652
+ this.scrollLeftStart = this.element.scrollLeft;
64653
+ this.scrollTopStart = this.element.scrollTop;
64654
+ this.clientXStart = event.clientX;
64655
+ this.clientYStart = event.clientY;
64656
+ this.document.addEventListener("mousemove", this._onMouseMove, true);
64657
+ this.document.addEventListener("mouseup", this._endPan, true);
64658
+ this.element.addEventListener("scroll", this._endPan, true);
64659
+ event.preventDefault();
64660
+ event.stopPropagation();
64661
+ const focusedElement = document.activeElement;
64662
+ if (focusedElement && !focusedElement.contains(event.target)) {
64663
+ focusedElement.blur();
64664
+ }
64665
+ };
64666
+ _onMouseMove = new WeakSet();
64667
+ onMouseMove_fn = function(event) {
64668
+ this.element.removeEventListener("scroll", this._endPan, true);
64669
+ if (!(event.buttons & 1)) {
64670
+ this._endPan();
64671
+ return;
64672
+ }
64673
+ const xDiff = event.clientX - this.clientXStart;
64674
+ const yDiff = event.clientY - this.clientYStart;
64675
+ const scrollTop = this.scrollTopStart - yDiff;
64676
+ const scrollLeft = this.scrollLeftStart - xDiff;
64677
+ if (this.element.scrollTo) {
64678
+ this.element.scrollTo({
64679
+ top: scrollTop,
64680
+ left: scrollLeft,
64681
+ behavior: "instant"
64682
+ });
64683
+ } else {
64684
+ this.element.scrollTop = scrollTop;
64685
+ this.element.scrollLeft = scrollLeft;
64686
+ }
64687
+ if (!this.overlay.parentNode) {
64688
+ document.body.append(this.overlay);
64689
+ }
64690
+ };
64691
+ _endPan = new WeakSet();
64692
+ endPan_fn = function() {
64693
+ this.element.removeEventListener("scroll", this._endPan, true);
64694
+ this.document.removeEventListener("mousemove", this._onMouseMove, true);
64695
+ this.document.removeEventListener("mouseup", this._endPan, true);
64696
+ this.overlay.remove();
64697
+ };
64698
+
64699
+ // src/navigator/PDFNavigator.ts
64552
64700
  var ScaleType;
64553
64701
  (function(ScaleType2) {
64554
64702
  ScaleType2[ScaleType2["Page"] = 0] = "Page";
64555
64703
  ScaleType2[ScaleType2["Width"] = 1] = "Width";
64556
64704
  })(ScaleType || (ScaleType = {}));
64557
64705
  var PDFNavigator = class extends import_eventemitter32.default {
64558
- constructor(settings, publication) {
64706
+ constructor(settings, publication, api) {
64559
64707
  super();
64560
64708
  this.pdfDoc = null;
64561
64709
  this.pageNum = 1;
@@ -64570,9 +64718,10 @@ var PDFNavigator = class extends import_eventemitter32.default {
64570
64718
  };
64571
64719
  this.settings = settings;
64572
64720
  this.publication = publication;
64721
+ this.api = api;
64573
64722
  }
64574
64723
  static async create(config2) {
64575
- const navigator2 = new this(config2.settings, config2.publication);
64724
+ const navigator2 = new this(config2.settings, config2.publication, config2.api);
64576
64725
  await navigator2.start(config2.mainElement, config2.headerMenu, config2.footerMenu);
64577
64726
  return new Promise((resolve) => resolve(navigator2));
64578
64727
  }
@@ -64585,40 +64734,58 @@ var PDFNavigator = class extends import_eventemitter32.default {
64585
64734
  console.log(this.resource);
64586
64735
  console.log(this.resource.Href1);
64587
64736
  import_pdfjs_dist.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.16.105/pdf.worker.js`;
64588
- const wrapper = findRequiredElement(this.mainElement, "main#iframe-wrapper");
64589
- this.canvas = document.getElementById("canvas");
64590
- if (this.canvas == null) {
64591
- const newCanvas = document.createElement("canvas");
64592
- newCanvas.id = "canvas";
64593
- wrapper.appendChild(newCanvas);
64594
- this.canvas = document.getElementById("canvas");
64595
- }
64596
- this.ctx = this.canvas.getContext("2d");
64737
+ this.wrapper = findRequiredElement(this.mainElement, "main#iframe-wrapper");
64738
+ this.pdfContainer = findRequiredElement(this.mainElement, "#pdf-container");
64739
+ this.handTool = new GrabToPan({
64740
+ element: this.pdfContainer
64741
+ });
64597
64742
  const self2 = this;
64743
+ let loadingMessage = document.createElement("div");
64744
+ loadingMessage.id = "loadingpdf";
64745
+ loadingMessage.innerHTML = readerLoading;
64746
+ loadingMessage.style.width = getComputedStyle(this.wrapper).width;
64747
+ loadingMessage.style.height = getComputedStyle(this.wrapper).height;
64748
+ loadingMessage.style.display = "flex";
64749
+ loadingMessage.style.zIndex = "100";
64750
+ loadingMessage.style.position = "absolute";
64751
+ loadingMessage.style.alignItems = "center";
64752
+ loadingMessage.style.justifyContent = "center";
64753
+ loadingMessage.style.background = "white";
64754
+ loadingMessage.className = "loading is-loading";
64755
+ this.pdfContainer.appendChild(loadingMessage);
64598
64756
  (0, import_pdfjs_dist.getDocument)(this.publication.getAbsoluteHref(this.resource.Href)).promise.then(function(pdfDoc_) {
64599
64757
  self2.pdfDoc = pdfDoc_;
64600
- self2.renderPage(self2.pageNum, self2.scaleType);
64758
+ self2.loadPDFJS(self2.pageNum);
64601
64759
  });
64602
64760
  this.setupEvents();
64603
64761
  }
64604
64762
  async handleResize() {
64605
- this.renderPage(this.pageNum, this.scaleType);
64763
+ this.loadPDFJS(this.pageNum);
64606
64764
  }
64607
64765
  setupEvents() {
64608
64766
  addEventListenerOptional(window, "resize", this.onResize);
64609
64767
  }
64610
- renderPage(num, type) {
64768
+ loadPDFJS(num) {
64611
64769
  const self2 = this;
64612
- self2.pageRendering = true;
64613
- const wrapper = findRequiredElement(self2.mainElement, "main#iframe-wrapper");
64614
- wrapper.style.height = "calc(100vh - 10px)";
64615
- self2.pdfDoc.getPage(num).then(function(page) {
64770
+ let currentPage = 1;
64771
+ this.wrapper.style.height = "calc(100vh - 10px)";
64772
+ this.pdfContainer.style.height = "calc(100vh - 10px)";
64773
+ this.pdfContainer.style.flexDirection = "column";
64774
+ let collection = document.getElementsByTagName("canvas");
64775
+ Array.from(collection).forEach(function(element) {
64776
+ element?.parentNode?.removeChild(element);
64777
+ });
64778
+ function renderPage(page) {
64779
+ const canvas = document.createElement("canvas");
64780
+ canvas.id = String(currentPage);
64781
+ canvas.style.border = "1px solid gray";
64782
+ canvas.style.margin = "1px";
64616
64783
  let viewport = page.getViewport({ scale: self2.scale });
64617
64784
  if (self2.scale === 1) {
64618
- const fitPage = wrapper.clientHeight / viewport.height;
64619
- const fitWidth = wrapper.clientWidth / viewport.width;
64785
+ const fitPage = self2.wrapper.clientHeight / viewport.height;
64786
+ const fitWidth = self2.wrapper.clientWidth / viewport.width;
64620
64787
  console.log(fitPage, fitWidth);
64621
- if (type === 0) {
64788
+ if (self2.scaleType === 0) {
64622
64789
  viewport = page.getViewport({
64623
64790
  scale: fitPage < fitWidth ? fitPage : fitWidth
64624
64791
  });
@@ -64626,41 +64793,55 @@ var PDFNavigator = class extends import_eventemitter32.default {
64626
64793
  viewport = page.getViewport({ scale: fitWidth });
64627
64794
  }
64628
64795
  }
64629
- self2.canvas.height = viewport.height;
64630
- self2.canvas.width = viewport.width;
64796
+ self2.pdfContainer.appendChild(canvas);
64797
+ const context = canvas.getContext("2d");
64798
+ canvas.height = viewport.height;
64799
+ canvas.width = viewport.width;
64631
64800
  const renderContext = {
64632
- canvasContext: self2.ctx,
64801
+ canvasContext: context,
64633
64802
  viewport
64634
64803
  };
64804
+ let pdfload = document.getElementById("loadingpdf");
64805
+ pdfload.style.display = "flex";
64806
+ pdfload.style.width = getComputedStyle(self2.wrapper).width;
64807
+ pdfload.style.height = getComputedStyle(self2.wrapper).height;
64635
64808
  const renderTask = page.render(renderContext);
64636
64809
  renderTask.promise.then(function() {
64637
- self2.pageRendering = false;
64638
- if (self2.pageNumPending !== null) {
64639
- self2.renderPage(self2.pageNumPending, type);
64640
- self2.pageNumPending = null;
64810
+ if (currentPage < self2.pdfDoc.numPages) {
64811
+ currentPage++;
64812
+ self2.pdfDoc.getPage(currentPage).then(renderPage);
64813
+ } else {
64814
+ document.getElementById(String(num))?.scrollIntoView();
64815
+ pdfload.style.display = "none";
64641
64816
  }
64642
64817
  });
64643
- });
64818
+ }
64819
+ this.pdfDoc.getPage(currentPage).then(renderPage);
64644
64820
  }
64645
64821
  queueRenderPage(num) {
64646
64822
  const self2 = this;
64647
64823
  if (self2.pageRendering) {
64648
64824
  self2.pageNumPending = num;
64649
64825
  } else {
64650
- self2.renderPage(num, self2.scaleType);
64826
+ this.pageNum = num;
64827
+ document.getElementById(String(num))?.scrollIntoView();
64651
64828
  }
64652
64829
  }
64653
64830
  readingOrder() {
64831
+ return this.publication.readingOrder;
64654
64832
  }
64655
64833
  tableOfContents() {
64834
+ return this.publication.tableOfContents;
64656
64835
  }
64657
64836
  currentResource() {
64658
64837
  }
64659
64838
  totalResources() {
64839
+ return this.publication.readingOrder.length;
64660
64840
  }
64661
64841
  currentLocator() {
64662
64842
  }
64663
64843
  positions() {
64844
+ return this.publication.positions ? this.publication.positions : [];
64664
64845
  }
64665
64846
  nextPage() {
64666
64847
  const self2 = this;
@@ -64692,7 +64873,7 @@ var PDFNavigator = class extends import_eventemitter32.default {
64692
64873
  (0, import_pdfjs_dist.getDocument)(this.publication.getAbsoluteHref(this.resource.Href)).promise.then(function(pdfDoc_) {
64693
64874
  self2.pdfDoc = pdfDoc_;
64694
64875
  self2.pageNum = 1;
64695
- self2.renderPage(self2.pageNum, self2.scaleType);
64876
+ self2.loadPDFJS(self2.pageNum);
64696
64877
  });
64697
64878
  }
64698
64879
  previousResource() {
@@ -64707,38 +64888,67 @@ var PDFNavigator = class extends import_eventemitter32.default {
64707
64888
  (0, import_pdfjs_dist.getDocument)(this.publication.getAbsoluteHref(this.resource.Href)).promise.then(function(pdfDoc_) {
64708
64889
  self2.pdfDoc = pdfDoc_;
64709
64890
  self2.pageNum = self2.pdfDoc.numPages;
64710
- self2.renderPage(self2.pageNum, self2.scaleType);
64891
+ self2.loadPDFJS(self2.pageNum);
64711
64892
  });
64712
64893
  }
64713
64894
  goTo(locator) {
64714
64895
  console.log(locator);
64896
+ const url = new URL(locator.href);
64897
+ if (url.searchParams.has("start")) {
64898
+ const page = url.searchParams.get("start");
64899
+ if (page) {
64900
+ this.queueRenderPage(parseInt(page));
64901
+ }
64902
+ } else {
64903
+ this.queueRenderPage(1);
64904
+ }
64715
64905
  }
64716
64906
  goToPosition(value) {
64717
64907
  console.log(value);
64908
+ this.queueRenderPage(value);
64718
64909
  }
64719
64910
  async goToPage(page) {
64720
64911
  console.log(page);
64721
64912
  this.queueRenderPage(page);
64722
64913
  }
64723
64914
  fitToWidth() {
64724
- console.log("fit to width");
64915
+ console.log("fit to width", this.pageNum);
64725
64916
  this.scale = 1;
64726
64917
  this.scaleType = 1;
64727
- this.renderPage(this.pageNum, this.scaleType);
64918
+ this.loadPDFJS(this.pageNum);
64728
64919
  }
64729
64920
  fitToPage() {
64730
- console.log("fit to page");
64921
+ console.log("fit to page", this.pageNum);
64731
64922
  this.scale = 1;
64732
64923
  this.scaleType = 0;
64733
- this.renderPage(this.pageNum, this.scaleType);
64924
+ this.loadPDFJS(this.pageNum);
64734
64925
  }
64735
64926
  zoomIn() {
64736
64927
  this.scale = this.scale + 0.2;
64737
- this.renderPage(this.pageNum, this.scaleType);
64928
+ this.loadPDFJS(this.pageNum);
64738
64929
  }
64739
64930
  zoomOut() {
64740
64931
  this.scale = this.scale - 0.2;
64741
- this.renderPage(this.pageNum, this.scaleType);
64932
+ this.loadPDFJS(this.pageNum);
64933
+ }
64934
+ activateHand() {
64935
+ this.handTool.activate();
64936
+ }
64937
+ deactivateHand() {
64938
+ this.handTool.deactivate();
64939
+ }
64940
+ async scroll(scroll, direction) {
64941
+ if (scroll) {
64942
+ if (direction === "horizontal") {
64943
+ this.pdfContainer.style.flexDirection = "row";
64944
+ } else {
64945
+ this.pdfContainer.style.flexDirection = "column";
64946
+ }
64947
+ this.pdfContainer.style.overflow = "auto";
64948
+ } else {
64949
+ this.pdfContainer.style.flexDirection = "column";
64950
+ this.pdfContainer.style.overflow = "hidden";
64951
+ }
64742
64952
  }
64743
64953
  stop() {
64744
64954
  removeEventListenerOptional(window, "resize", this.onResize);
@@ -64868,7 +65078,10 @@ var D2Reader = class {
64868
65078
  this.applyUserSettings = async (userSettings) => {
64869
65079
  return await this.settings.applyUserSettings(userSettings);
64870
65080
  };
64871
- this.scroll = async (value) => {
65081
+ this.scroll = async (value, direction) => {
65082
+ if (this.navigator instanceof PDFNavigator) {
65083
+ return this.navigator.scroll(value, direction);
65084
+ }
64872
65085
  return await this.settings.scroll(value);
64873
65086
  };
64874
65087
  this.increase = async (incremental) => {
@@ -64951,6 +65164,16 @@ var D2Reader = class {
64951
65164
  this.navigator.zoomOut();
64952
65165
  }
64953
65166
  };
65167
+ this.activateHand = () => {
65168
+ if (this.navigator instanceof PDFNavigator) {
65169
+ this.navigator.activateHand();
65170
+ }
65171
+ };
65172
+ this.deactivateHand = () => {
65173
+ if (this.navigator instanceof PDFNavigator) {
65174
+ this.navigator.deactivateHand();
65175
+ }
65176
+ };
64954
65177
  this.copyToClipboard = (text) => {
64955
65178
  this.contentProtectionModule?.copyToClipboard(text);
64956
65179
  };
@@ -65150,6 +65373,11 @@ var D2Reader = class {
65150
65373
  const contentProtectionModule = rights.enableContentProtection ? await ContentProtectionModule.create(__spreadValues({
65151
65374
  delegate: navigator2
65152
65375
  }, initialConfig.protection)) : void 0;
65376
+ const citationModule = rights.enableCitations ? await CitationModule.create(__spreadValues({
65377
+ publication,
65378
+ delegate: navigator2,
65379
+ highlighter
65380
+ }, initialConfig.citations)) : void 0;
65153
65381
  const enableMediaOverlays = rights.enableMediaOverlays;
65154
65382
  const mediaOverlaySettings = enableMediaOverlays ? await MediaOverlaySettings.create(__spreadValues({
65155
65383
  store: settingsStore,
@@ -65178,11 +65406,6 @@ var D2Reader = class {
65178
65406
  delegate: navigator2,
65179
65407
  headerMenu
65180
65408
  }) : void 0;
65181
- const citationModule = rights.enableCitations ? await CitationModule.create(__spreadValues({
65182
- publication,
65183
- delegate: navigator2,
65184
- highlighter
65185
- }, initialConfig.citations)) : void 0;
65186
65409
  return new D2Reader(settings, navigator2, highlighter, bookmarkModule, annotationModule, ttsSettings, ttsModule, searchModule, definitionsModule, contentProtectionModule, timelineModule, mediaOverlaySettings, mediaOverlayModule, pageBreakModule, lineFocusModule, historyModule, citationModule);
65187
65410
  }
65188
65411
  }