@pdf-viewer/react 0.0.0-experimental.7 → 0.0.0-experimental.8

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.
Files changed (227) hide show
  1. package/dist/{LayoutWrapper-e310e12f.js → LayoutWrapper-6224491f.js} +2 -10
  2. package/dist/{SearchCloseButton-52d8ac31.js → SearchCloseButton-08d57275.js} +8 -16
  3. package/dist/ToolbarLayout.module-49d71551.js +3556 -0
  4. package/dist/assets/style.css +1 -1
  5. package/dist/assets/style.js +11 -11
  6. package/dist/components/RPConfig.js +4 -28
  7. package/dist/components/RPController.js +57 -104
  8. package/dist/components/RPDropFileZone.js +20 -43
  9. package/dist/components/RPPages.js +9 -21
  10. package/dist/components/RPProvider.js +16 -43
  11. package/dist/components/RPTheme.js +10 -17
  12. package/dist/components/icons/CheckIcon.js +18 -12
  13. package/dist/components/icons/ChevronDownIcon.js +19 -15
  14. package/dist/components/icons/ChevronUpIcon.js +18 -12
  15. package/dist/components/icons/ClearIcon.js +21 -24
  16. package/dist/components/icons/ClockwiseIcon.js +18 -12
  17. package/dist/components/icons/CloseIcon.js +18 -12
  18. package/dist/components/icons/DarkPdfIcon.js +8 -5
  19. package/dist/components/icons/DualPageIcon.js +18 -12
  20. package/dist/components/icons/FileDownloadDefaultIcon.js +19 -16
  21. package/dist/components/icons/FileUploadDefaultIcon.js +19 -16
  22. package/dist/components/icons/FullScreenIcon.js +18 -12
  23. package/dist/components/icons/GoToDownIcon.js +18 -12
  24. package/dist/components/icons/HandModeDefaultIcon.js +18 -12
  25. package/dist/components/icons/HorizontalScrollingIcon.js +20 -14
  26. package/dist/components/icons/InfoIcon.js +18 -12
  27. package/dist/components/icons/LightPdfIcon.js +8 -5
  28. package/dist/components/icons/LoaderIcon.js +9 -9
  29. package/dist/components/icons/MoonIcon.js +18 -12
  30. package/dist/components/icons/PageScrollingIcon.js +20 -14
  31. package/dist/components/icons/PrintDefaultIcon.js +19 -16
  32. package/dist/components/icons/SearchIcon.js +18 -12
  33. package/dist/components/icons/SinglePageIcon.js +18 -12
  34. package/dist/components/icons/SunIcon.js +21 -24
  35. package/dist/components/icons/TextSelectionDefaultIcon.js +19 -16
  36. package/dist/components/icons/ThreeDotIcon.js +18 -12
  37. package/dist/components/icons/Thumbnail.js +50 -30
  38. package/dist/components/icons/VerticalScrollingIcon.js +20 -14
  39. package/dist/components/icons/WrappedScrollingIcon.js +20 -14
  40. package/dist/components/icons/ZoomInIcon.js +18 -12
  41. package/dist/components/icons/ZoomOutIcon.js +18 -12
  42. package/dist/components/layout/Container.js +12 -14
  43. package/dist/components/layout/LayoutContainer.js +9 -21
  44. package/dist/components/layout/LayoutWrapper.js +1 -1
  45. package/dist/components/layout/RPDefaultLayout.js +8 -20
  46. package/dist/components/layout/RPLayout.js +36 -58
  47. package/dist/components/layout/WrapperLayout.js +7 -32
  48. package/dist/components/layout/sidebar/RPSidebar.js +8 -20
  49. package/dist/components/layout/sidebar/RPSplitter.js +22 -23
  50. package/dist/components/layout/sidebar/Thumbnail.js +9 -21
  51. package/dist/components/layout/sidebar/Thumbnails.js +8 -20
  52. package/dist/components/layout/toolbar/DarkModeTool.js +6 -42
  53. package/dist/components/layout/toolbar/DocumentDialog.js +9 -21
  54. package/dist/components/layout/toolbar/DocumentProperties.js +15 -43
  55. package/dist/components/layout/toolbar/FileDownloadTool.js +8 -20
  56. package/dist/components/layout/toolbar/FileUploadTool.js +11 -80
  57. package/dist/components/layout/toolbar/FullScreenTool.js +35 -73
  58. package/dist/components/layout/toolbar/MenuItem.js +10 -28
  59. package/dist/components/layout/toolbar/MenuSeparator.js +5 -16
  60. package/dist/components/layout/toolbar/MostPageTool.js +8 -20
  61. package/dist/components/layout/toolbar/OtherTool.js +8 -20
  62. package/dist/components/layout/toolbar/Paginate.js +8 -20
  63. package/dist/components/layout/toolbar/PrintTool.js +8 -20
  64. package/dist/components/layout/toolbar/PropertyItem.js +4 -13
  65. package/dist/components/layout/toolbar/RPMenuItem.js +16 -30
  66. package/dist/components/layout/toolbar/RPMoreOptions.js +114 -111
  67. package/dist/components/layout/toolbar/RPToolbar.js +8 -20
  68. package/dist/components/layout/toolbar/RPToolbarEnd.js +8 -20
  69. package/dist/components/layout/toolbar/RotateTool.js +26 -69
  70. package/dist/components/layout/toolbar/ScrollModeTool.js +33 -83
  71. package/dist/components/layout/toolbar/SearchCloseButton.js +3 -3
  72. package/dist/components/layout/toolbar/SearchResultNavigator.js +8 -20
  73. package/dist/components/layout/toolbar/SearchTool.js +8 -20
  74. package/dist/components/layout/toolbar/SelectionModeTool.js +21 -63
  75. package/dist/components/layout/toolbar/ThumbnailTool.js +11 -48
  76. package/dist/components/layout/toolbar/ToolbarCustom.js +44 -81
  77. package/dist/components/layout/toolbar/ToolbarDefault.js +44 -80
  78. package/dist/components/layout/toolbar/ToolbarLayout.js +11 -31
  79. package/dist/components/layout/toolbar/ViewModeTool.js +26 -72
  80. package/dist/components/layout/toolbar/ZoomTool.js +8 -20
  81. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +18 -39
  82. package/dist/components/layout/toolbar/tools/DualPageTool.js +11 -44
  83. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +11 -44
  84. package/dist/components/layout/toolbar/tools/FileUploadTool.js +6 -36
  85. package/dist/components/layout/toolbar/tools/FullScreenTool.js +9 -25
  86. package/dist/components/layout/toolbar/tools/InputPageTool.js +27 -41
  87. package/dist/components/layout/toolbar/tools/NextPageTool.js +20 -50
  88. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +19 -40
  89. package/dist/components/layout/toolbar/tools/PrintTool.js +11 -44
  90. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +6 -31
  91. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +11 -31
  92. package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +8 -22
  93. package/dist/components/layout/toolbar/tools/SinglePageTool.js +11 -44
  94. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +5 -19
  95. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +19 -40
  96. package/dist/components/layout/toolbar/tools/ZoomInTool.js +14 -31
  97. package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +9 -21
  98. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +56 -82
  99. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +14 -31
  100. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +20 -64
  101. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +13 -40
  102. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +11 -36
  103. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +14 -42
  104. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +14 -42
  105. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +11 -38
  106. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +21 -73
  107. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +14 -42
  108. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +20 -57
  109. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +29 -70
  110. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +22 -58
  111. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +21 -61
  112. package/dist/components/page/AnnotationLayer.js +9 -21
  113. package/dist/components/page/CanvasLayer.js +9 -21
  114. package/dist/components/page/CustomElement.js +8 -38
  115. package/dist/components/page/DualPage.js +8 -20
  116. package/dist/components/page/RPPage.js +9 -21
  117. package/dist/components/page/SinglePage.js +8 -20
  118. package/dist/components/page/TextHighlightLayer.js +18 -30
  119. package/dist/components/page/TextLayer.js +15 -27
  120. package/dist/components/ui/Button.js +11 -13
  121. package/dist/components/ui/Checkbox.js +15 -23
  122. package/dist/components/ui/DropDown.js +18 -40
  123. package/dist/components/ui/Input.js +14 -18
  124. package/dist/components/ui/LoadingIndicator.js +8 -20
  125. package/dist/components/ui/PasswordModal.js +24 -33
  126. package/dist/components/ui/RPTooltip.js +11 -29
  127. package/dist/contexts/ConfigContext.js +2 -8
  128. package/dist/contexts/DarkModeContext.js +2 -11
  129. package/dist/contexts/DimensionPagesContext.js +28 -89
  130. package/dist/contexts/DocumentPasswordContext.js +1 -4
  131. package/dist/contexts/DownloadContext.js +9 -9
  132. package/dist/contexts/DropFileZoneContext.js +34 -45
  133. package/dist/contexts/ElementPageContext.js +80 -111
  134. package/dist/contexts/EventCallbackContext.js +11 -8
  135. package/dist/contexts/FileInputContext.js +22 -39
  136. package/dist/contexts/FullScreenContext.js +3 -18
  137. package/dist/contexts/GlobalCurrentPage.js +3 -15
  138. package/dist/contexts/HighlightContext.js +7 -32
  139. package/dist/contexts/IconContext.js +1 -4
  140. package/dist/contexts/IconToolContext.js +2 -12
  141. package/dist/contexts/InitialStateContext.js +1 -4
  142. package/dist/contexts/LayerContext.js +1 -11
  143. package/dist/contexts/LicenseContext.js +8 -17
  144. package/dist/contexts/LoaderContext.js +10 -10
  145. package/dist/contexts/LocalizationContext.js +9 -6
  146. package/dist/contexts/OtherToolContext.js +2 -7
  147. package/dist/contexts/PageViewportContext.js +1 -6
  148. package/dist/contexts/PagesRotateContext.js +13 -45
  149. package/dist/contexts/PaginationContext.js +10 -22
  150. package/dist/contexts/PrintContext.js +10 -22
  151. package/dist/contexts/RPDocumentContext.js +17 -34
  152. package/dist/contexts/RenderQueueProvider.js +10 -22
  153. package/dist/contexts/RenderedPagesCache.js +8 -23
  154. package/dist/contexts/RotationContext.js +16 -33
  155. package/dist/contexts/ScrollModeContext.js +3 -13
  156. package/dist/contexts/SearchContext.js +10 -22
  157. package/dist/contexts/SelectionModeContext.js +1 -7
  158. package/dist/contexts/SmoothScrollContext.js +3 -12
  159. package/dist/contexts/ThumbnailsContext.js +10 -22
  160. package/dist/contexts/ToolComponentContext.js +2 -10
  161. package/dist/contexts/ToolbarComponentContext.js +2 -8
  162. package/dist/contexts/ViewModeContext.js +3 -15
  163. package/dist/contexts/ViewportContext.js +2 -7
  164. package/dist/contexts/VirtualGridContext.js +2 -10
  165. package/dist/contexts/VirtualScrollContext.js +19 -18
  166. package/dist/contexts/ZoomContext.js +84 -196
  167. package/dist/{index-1d695410.js → index-808ea7bf.js} +1 -1
  168. package/dist/index-a48ec088.js +1672 -0
  169. package/dist/{index-7ca3764b.js → index-c9a2990a.js} +3 -3
  170. package/dist/main.js +91 -103
  171. package/dist/types/utils/approximateFragtion.d.ts +9 -0
  172. package/dist/types/utils/link_service.d.ts +8 -0
  173. package/dist/utils/Queue.js +18 -60
  174. package/dist/utils/annotations.js +75 -109
  175. package/dist/utils/approximateFragtion.js +22 -0
  176. package/dist/utils/calculatePage.js +11 -23
  177. package/dist/utils/convertPdfDate.js +3 -1
  178. package/dist/utils/elementPagePosition.js +1 -8
  179. package/dist/utils/getElementPositionInPage.js +44 -16
  180. package/dist/utils/getScrollDistance.js +2 -5
  181. package/dist/utils/getThumbnailViewport.js +2 -10
  182. package/dist/utils/getZoomLevel.js +4 -1
  183. package/dist/utils/highlight.js +153 -225
  184. package/dist/utils/hooks/useCopyText.js +19 -20
  185. package/dist/utils/hooks/useDarkModeProps.js +1 -4
  186. package/dist/utils/hooks/useElementSize.js +10 -25
  187. package/dist/utils/hooks/useFileDownload.js +9 -21
  188. package/dist/utils/hooks/useFullScreen.js +1 -6
  189. package/dist/utils/hooks/useGrabScroll.js +16 -17
  190. package/dist/utils/hooks/useHighlight.js +22 -25
  191. package/dist/utils/hooks/useInfiniteScroll.js +8 -8
  192. package/dist/utils/hooks/useLicense.js +55 -1174
  193. package/dist/utils/hooks/useLoadPdf.js +42 -81
  194. package/dist/utils/hooks/useLoadWorker.js +8 -8
  195. package/dist/utils/hooks/useMousePressed.js +2 -8
  196. package/dist/utils/hooks/usePageRotateContext.js +18 -33
  197. package/dist/utils/hooks/usePaginate.js +9 -21
  198. package/dist/utils/hooks/usePinch.js +39 -49
  199. package/dist/utils/hooks/usePresentPage.js +18 -30
  200. package/dist/utils/hooks/usePrint.js +9 -21
  201. package/dist/utils/hooks/useRequestAnimationFrame.js +9 -9
  202. package/dist/utils/hooks/useRotate.js +4 -17
  203. package/dist/utils/hooks/useScrollToPage.js +9 -21
  204. package/dist/utils/hooks/useSearch.js +9 -21
  205. package/dist/utils/hooks/useThumbnail.js +9 -21
  206. package/dist/utils/hooks/useVirtualReactWindow.js +9 -21
  207. package/dist/utils/hooks/useWatermark.js +42 -55
  208. package/dist/utils/link_service.js +36 -20
  209. package/dist/utils/renderPage.js +5 -12
  210. package/dist/utils/smoothScrollTo.js +1 -4
  211. package/dist/utils/withRef.js +1 -4
  212. package/package.json +5 -9
  213. package/dist/ToolbarLayout.module-d74981d1.js +0 -4270
  214. package/dist/classof-56f81803.js +0 -76
  215. package/dist/es.iterator.constructor-05468e3d.js +0 -126
  216. package/dist/es.iterator.filter-1ddb1471.js +0 -37
  217. package/dist/es.iterator.for-each-ed4cb4aa.js +0 -34
  218. package/dist/es.iterator.map-635f6e20.js +0 -157
  219. package/dist/es.iterator.reduce-969434f1.js +0 -31
  220. package/dist/esnext.json.parse-3bf99e2e.js +0 -152
  221. package/dist/esnext.map.delete-all-fa83df07.js +0 -401
  222. package/dist/function-uncurry-this-accessor-efc140e6.js +0 -17
  223. package/dist/index-922e8d58.js +0 -2545
  224. package/dist/is-pure-db2321f6.js +0 -886
  225. package/dist/iterate-1672c441.js +0 -110
  226. package/dist/iterator-helper-without-closing-on-early-error-a6637535.js +0 -69
  227. package/dist/web.url-search-params.delete-c65de04d.js +0 -51
@@ -1,1124 +1,27 @@
1
- import { b as $, s as Q, g as D, m as Ke, N as gt, r as F, H as G, O as Et, i as Ze, J as Nr, K as Tt, G as _t, j as Rt, q as mt, F as bt, k as It, P as qt, L as wt, l as rt, p as Ot, a as St, Q as Bt, t as Ct, w as xt, I as Dt, x as Nt, e as Pt } from "../../is-pure-db2321f6.js";
2
- import { r as Pr } from "../../function-uncurry-this-accessor-efc140e6.js";
3
- import { b as Ur, c as Ut, a as Lr, r as J } from "../../classof-56f81803.js";
4
- import "../../esnext.json.parse-3bf99e2e.js";
5
- import { useState as Lt, useCallback as Mt, useEffect as Ft } from "react";
6
- import { appConsole as z } from "../appConsole.js";
7
- var Hr = {}, rr, jr;
8
- function Vt() {
9
- if (jr)
10
- return rr;
11
- jr = 1;
12
- var r = Ur(), t = Ut(), e = RangeError;
13
- return rr = function(a) {
14
- if (a === void 0)
15
- return 0;
16
- var n = r(a), i = t(n);
17
- if (n !== i)
18
- throw new e("Wrong length or index");
19
- return i;
20
- }, rr;
21
- }
22
- var kr = {}, Gr;
23
- function $t() {
24
- if (Gr)
25
- return kr;
26
- Gr = 1;
27
- var r = $(), t = nt();
28
- return t && r({
29
- target: "ArrayBuffer",
30
- proto: !0
31
- }, {
32
- transferToFixedLength: function() {
33
- return t(this, arguments.length ? arguments[0] : void 0, !1);
34
- }
35
- }), kr;
36
- }
37
- $t();
38
- module.exports = typeof ArrayBuffer < "u" && typeof DataView < "u";
39
- const Ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
40
- __proto__: null
41
- }, Symbol.toStringTag, { value: "Module" })), et = /* @__PURE__ */ Q(Ht);
42
- var er, Yr;
43
- function tt() {
44
- if (Yr)
45
- return er;
46
- Yr = 1;
47
- var r = D(), t = Pr(), e = Ke(), a = r.ArrayBuffer, n = r.TypeError;
48
- return er = a && t(a.prototype, "byteLength", "get") || function(i) {
49
- if (e(i) !== "ArrayBuffer")
50
- throw new n("ArrayBuffer expected");
51
- return i.byteLength;
52
- }, er;
53
- }
54
- var tr, Wr;
55
- function jt() {
56
- if (Wr)
57
- return tr;
58
- Wr = 1;
59
- var r = D(), t = et, e = tt(), a = r.DataView;
60
- return tr = function(n) {
61
- if (!t || e(n) !== 0)
62
- return !1;
63
- try {
64
- return new a(n), !1;
65
- } catch {
66
- return !0;
67
- }
68
- }, tr;
69
- }
70
- var ar, Xr;
71
- function Y() {
72
- if (Xr)
73
- return ar;
74
- Xr = 1;
75
- var r = jt(), t = TypeError;
76
- return ar = function(e) {
77
- if (r(e))
78
- throw new t("ArrayBuffer is detached");
79
- return e;
80
- }, ar;
81
- }
82
- var nr, zr;
83
- function kt() {
84
- if (zr)
85
- return nr;
86
- zr = 1;
87
- var r = D(), t = gt(), e = Ke(), a = function(n) {
88
- return t.slice(0, n.length) === n;
89
- };
90
- return nr = function() {
91
- return a("Bun/") ? "BUN" : a("Cloudflare-Workers") ? "CLOUDFLARE" : a("Deno/") ? "DENO" : a("Node.js/") ? "NODE" : r.Bun && typeof Bun.version == "string" ? "BUN" : r.Deno && typeof Deno.version == "object" ? "DENO" : e(r.process) === "process" ? "NODE" : r.window && r.document ? "BROWSER" : "REST";
92
- }(), nr;
93
- }
94
- var ir, Qr;
95
- function Gt() {
96
- if (Qr)
97
- return ir;
98
- Qr = 1;
99
- var r = kt();
100
- return ir = r === "NODE", ir;
101
- }
102
- var or, Jr;
103
- function Yt() {
104
- if (Jr)
105
- return or;
106
- Jr = 1;
107
- var r = D(), t = Gt();
108
- return or = function(e) {
109
- if (t) {
110
- try {
111
- return r.process.getBuiltinModule(e);
112
- } catch {
113
- }
114
- try {
115
- return Function('return require("' + e + '")')();
116
- } catch {
117
- }
118
- }
119
- }, or;
120
- }
121
- var Wt = require("../internals/global-this"), Xt = require("../internals/fails"), ur = require("../internals/environment-v8-version"), sr = require("../internals/environment"), Kr = Wt.structuredClone;
122
- module.exports = !!Kr && !Xt(function() {
123
- if (sr === "DENO" && ur > 92 || sr === "NODE" && ur > 94 || sr === "BROWSER" && ur > 97)
124
- return !1;
125
- var r = new ArrayBuffer(8), t = Kr(r, {
126
- transfer: [r]
127
- });
128
- return r.byteLength !== 0 || t.byteLength !== 8;
129
- });
130
- const zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
131
- __proto__: null
132
- }, Symbol.toStringTag, { value: "Module" })), at = /* @__PURE__ */ Q(zt);
133
- var fr, Zr;
134
- function Qt() {
135
- if (Zr)
136
- return fr;
137
- Zr = 1;
138
- var r = D(), t = Yt(), e = at, a = r.structuredClone, n = r.ArrayBuffer, i = r.MessageChannel, o = !1, s, c, f, v;
139
- if (e)
140
- o = function(l) {
141
- a(l, {
142
- transfer: [l]
143
- });
144
- };
145
- else if (n)
146
- try {
147
- i || (s = t("worker_threads"), s && (i = s.MessageChannel)), i && (c = new i(), f = new n(2), v = function(l) {
148
- c.port1.postMessage(null, [l]);
149
- }, f.byteLength === 2 && (v(f), f.byteLength === 0 && (o = v)));
150
- } catch {
151
- }
152
- return fr = o, fr;
153
- }
154
- var vr, re;
155
- function nt() {
156
- if (re)
157
- return vr;
158
- re = 1;
159
- var r = D(), t = F(), e = Pr(), a = Vt(), n = Y(), i = tt(), o = Qt(), s = at, c = r.structuredClone, f = r.ArrayBuffer, v = r.DataView, l = Math.min, d = f.prototype, m = v.prototype, g = t(d.slice), w = e(d, "resizable", "get"), y = e(d, "maxByteLength", "get"), E = t(m.getInt8), b = t(m.setInt8);
160
- return vr = (s || o) && function(u, p, A) {
161
- var _ = i(u), h = p === void 0 ? _ : a(p), T = !w || !w(u), O;
162
- if (n(u), s && (u = c(u, {
163
- transfer: [u]
164
- }), _ === h && (A || T)))
165
- return u;
166
- if (_ >= h && (!A || T))
167
- O = g(u, 0, h);
168
- else {
169
- var I = A && !T && y ? {
170
- maxByteLength: y(u)
171
- } : void 0;
172
- O = new f(h, I);
173
- for (var q = new v(u), U = new v(O), N = l(h, _), B = 0; B < N; B++)
174
- b(U, B, E(q, B));
175
- }
176
- return s || o(u), O;
177
- }, vr;
178
- }
179
- var ee;
180
- function Jt() {
181
- if (ee)
182
- return Hr;
183
- ee = 1;
184
- var r = $(), t = nt();
185
- return t && r({
186
- target: "ArrayBuffer",
187
- proto: !0
188
- }, {
189
- transfer: function() {
190
- return t(this, arguments.length ? arguments[0] : void 0, !0);
191
- }
192
- }), Hr;
193
- }
194
- Jt();
195
- var Kt = require("../internals/descriptors"), Zt = require("../internals/define-built-in-accessor"), ra = require("../internals/array-buffer-is-detached"), te = ArrayBuffer.prototype;
196
- Kt && !("detached" in te) && Zt(te, "detached", {
197
- configurable: !0,
198
- get: function() {
199
- return ra(this);
200
- }
201
- });
202
- var ae = {}, cr, ne;
203
- function ea() {
204
- if (ne)
205
- return cr;
206
- ne = 1;
207
- var r = Lr();
208
- return cr = function(t, e) {
209
- for (var a = r(t), n = new e(a), i = 0; i < a; i++)
210
- n[i] = t[a - i - 1];
211
- return n;
212
- }, cr;
213
- }
214
- var yr, ie;
215
- function ta() {
216
- if (ie)
217
- return yr;
218
- ie = 1;
219
- var r = G();
220
- return yr = function(t) {
221
- return r(t) || t === null;
222
- }, yr;
223
- }
224
- var dr, oe;
225
- function aa() {
226
- if (oe)
227
- return dr;
228
- oe = 1;
229
- var r = ta(), t = String, e = TypeError;
230
- return dr = function(a) {
231
- if (r(a))
232
- return a;
233
- throw new e("Can't set " + t(a) + " as a prototype");
234
- }, dr;
235
- }
236
- var lr, ue;
237
- function it() {
238
- if (ue)
239
- return lr;
240
- ue = 1;
241
- var r = Pr(), t = G(), e = Et(), a = aa();
242
- return lr = Object.setPrototypeOf || ("__proto__" in {} ? function() {
243
- var n = !1, i = {}, o;
244
- try {
245
- o = r(Object.prototype, "__proto__", "set"), o(i, []), n = i instanceof Array;
246
- } catch {
247
- }
248
- return function(c, f) {
249
- return e(c), a(f), t(c) && (n ? o(c, f) : c.__proto__ = f), c;
250
- };
251
- }() : void 0), lr;
252
- }
253
- var pr, se;
254
- function W() {
255
- if (se)
256
- return pr;
257
- se = 1;
258
- var r = et, t = Ze(), e = D(), a = rt(), n = G(), i = Nr(), o = J(), s = Ot(), c = Tt(), f = _t(), v = Rt(), l = mt(), d = bt(), m = it(), g = It(), w = qt(), y = wt(), E = y.enforce, b = y.get, u = e.Int8Array, p = u && u.prototype, A = e.Uint8ClampedArray, _ = A && A.prototype, h = u && d(u), T = p && d(p), O = Object.prototype, I = e.TypeError, q = g("toStringTag"), U = w("TYPED_ARRAY_TAG"), N = "TypedArrayConstructor", B = r && !!m && o(e.opera) !== "Opera", X = !1, S, P, H, M = {
259
- Int8Array: 1,
260
- Uint8Array: 1,
261
- Uint8ClampedArray: 1,
262
- Int16Array: 2,
263
- Uint16Array: 2,
264
- Int32Array: 4,
265
- Uint32Array: 4,
266
- Float32Array: 4,
267
- Float64Array: 8
268
- }, Z = {
269
- BigInt64Array: 8,
270
- BigUint64Array: 8
271
- }, dt = function(C) {
272
- if (!n(C))
273
- return !1;
274
- var x = o(C);
275
- return x === "DataView" || i(M, x) || i(Z, x);
276
- }, Vr = function(R) {
277
- var C = d(R);
278
- if (n(C)) {
279
- var x = b(C);
280
- return x && i(x, N) ? x[N] : Vr(C);
281
- }
282
- }, $r = function(R) {
283
- if (!n(R))
284
- return !1;
285
- var C = o(R);
286
- return i(M, C) || i(Z, C);
287
- }, lt = function(R) {
288
- if ($r(R))
289
- return R;
290
- throw new I("Target is not a typed array");
291
- }, pt = function(R) {
292
- if (a(R) && (!m || l(h, R)))
293
- return R;
294
- throw new I(s(R) + " is not a typed array constructor");
295
- }, At = function(R, C, x, j) {
296
- if (t) {
297
- if (x)
298
- for (var L in M) {
299
- var k = e[L];
300
- if (k && i(k.prototype, R))
301
- try {
302
- delete k.prototype[R];
303
- } catch {
304
- try {
305
- k.prototype[R] = C;
306
- } catch {
307
- }
308
- }
309
- }
310
- (!T[R] || x) && f(T, R, x ? C : B && p[R] || C, j);
311
- }
312
- }, ht = function(R, C, x) {
313
- var j, L;
314
- if (t) {
315
- if (m) {
316
- if (x) {
317
- for (j in M)
318
- if (L = e[j], L && i(L, R))
319
- try {
320
- delete L[R];
321
- } catch {
322
- }
323
- }
324
- if (!h[R] || x)
325
- try {
326
- return f(h, R, x ? C : B && h[R] || C);
327
- } catch {
328
- }
329
- else
330
- return;
331
- }
332
- for (j in M)
333
- L = e[j], L && (!L[R] || x) && f(L, R, C);
334
- }
335
- };
336
- for (S in M)
337
- P = e[S], H = P && P.prototype, H ? E(H)[N] = P : B = !1;
338
- for (S in Z)
339
- P = e[S], H = P && P.prototype, H && (E(H)[N] = P);
340
- if ((!B || !a(h) || h === Function.prototype) && (h = function() {
341
- throw new I("Incorrect invocation");
342
- }, B))
343
- for (S in M)
344
- e[S] && m(e[S], h);
345
- if ((!B || !T || T === O) && (T = h.prototype, B))
346
- for (S in M)
347
- e[S] && m(e[S].prototype, T);
348
- if (B && d(_) !== T && m(_, T), t && !i(T, q)) {
349
- X = !0, v(T, q, {
350
- configurable: !0,
351
- get: function() {
352
- return n(this) ? this[U] : void 0;
353
- }
354
- });
355
- for (S in M)
356
- e[S] && c(e[S], U, S);
357
- }
358
- return pr = {
359
- NATIVE_ARRAY_BUFFER_VIEWS: B,
360
- TYPED_ARRAY_TAG: X && U,
361
- aTypedArray: lt,
362
- aTypedArrayConstructor: pt,
363
- exportTypedArrayMethod: At,
364
- exportTypedArrayStaticMethod: ht,
365
- getTypedArrayConstructor: Vr,
366
- isView: dt,
367
- isTypedArray: $r,
368
- TypedArray: h,
369
- TypedArrayPrototype: T
370
- }, pr;
371
- }
372
- var fe;
373
- function na() {
374
- if (fe)
375
- return ae;
376
- fe = 1;
377
- var r = ea(), t = W(), e = t.aTypedArray, a = t.exportTypedArrayMethod, n = t.getTypedArrayConstructor;
378
- return a("toReversed", function() {
379
- return r(e(this), n(this));
380
- }), ae;
381
- }
382
- na();
383
- var ve = {}, Ar, ce;
384
- function ot() {
385
- if (ce)
386
- return Ar;
387
- ce = 1;
388
- var r = Lr();
389
- return Ar = function(t, e, a) {
390
- for (var n = 0, i = arguments.length > 2 ? a : r(e), o = new t(i); i > n; )
391
- o[n] = e[n++];
392
- return o;
393
- }, Ar;
394
- }
395
- var ye;
396
- function ia() {
397
- if (ye)
398
- return ve;
399
- ye = 1;
400
- var r = W(), t = F(), e = St(), a = ot(), n = r.aTypedArray, i = r.getTypedArrayConstructor, o = r.exportTypedArrayMethod, s = t(r.TypedArrayPrototype.sort);
401
- return o("toSorted", function(f) {
402
- f !== void 0 && e(f);
403
- var v = n(this), l = a(i(v), v);
404
- return s(l, f);
405
- }), ve;
406
- }
407
- ia();
408
- var oa = require("../internals/export"), ua = require("../internals/array-with"), sa = require("../internals/to-indexed-object"), fa = Array, va = function() {
409
- try {
410
- [].with({
411
- valueOf: function() {
412
- throw 4;
413
- }
414
- }, null);
415
- } catch (r) {
416
- return r !== 4;
417
- }
418
- }();
419
- oa({
420
- target: "Array",
421
- proto: !0,
422
- forced: va
423
- }, {
424
- with: function(r, t) {
425
- return ua(sa(this), fa, r, t);
426
- }
427
- });
428
- var ca = require("../internals/export"), ya = require("../internals/array-iteration").filterReject, da = require("../internals/add-to-unscopables");
429
- ca({
430
- target: "Array",
431
- proto: !0,
432
- forced: !0
433
- }, {
434
- filterReject: function(t) {
435
- return ya(this, t, arguments.length > 1 ? arguments[1] : void 0);
436
- }
437
- });
438
- da("filterReject");
439
- var ut = require("../internals/array-buffer-view-core"), la = require("../internals/array-iteration").filterReject, pa = require("../internals/typed-array-from-same-type-and-list"), Aa = ut.aTypedArray, ha = ut.exportTypedArrayMethod;
440
- ha("filterReject", function(t) {
441
- var e = la(Aa(this), t, arguments.length > 1 ? arguments[1] : void 0);
442
- return pa(this, e);
443
- }, !0);
444
- var de = {}, ga = require("../internals/function-bind-context"), Ea = require("../internals/function-uncurry-this"), Ta = require("../internals/indexed-object"), _a = require("../internals/to-object"), Ra = require("../internals/to-property-key"), ma = require("../internals/length-of-array-like"), ba = require("../internals/object-create"), Ia = require("../internals/array-from-constructor-and-list"), qa = Array, wa = Ea([].push);
445
- module.exports = function(r, t, e, a) {
446
- for (var n = _a(r), i = Ta(n), o = ga(t, e), s = ba(null), c = ma(i), f = 0, v, l, d; c > f; f++)
447
- d = i[f], l = Ra(o(d, f, n)), l in s ? wa(s[l], d) : s[l] = [d];
448
- if (a && (v = a(n), v !== qa))
449
- for (l in s)
450
- s[l] = Ia(v, s[l]);
451
- return s;
452
- };
453
- const Oa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
454
- __proto__: null
455
- }, Symbol.toStringTag, { value: "Module" })), Sa = /* @__PURE__ */ Q(Oa);
456
- var le;
457
- function Ba() {
458
- if (le)
459
- return de;
460
- le = 1;
461
- var r = W(), t = Sa, e = r.aTypedArray, a = r.getTypedArrayConstructor, n = r.exportTypedArrayMethod;
462
- return n("groupBy", function(o) {
463
- var s = arguments.length > 1 ? arguments[1] : void 0;
464
- return t(e(this), o, s, a);
465
- }, !0), de;
466
- }
467
- Ba();
468
- var pe = {}, hr, Ae;
469
- function Ca() {
470
- if (Ae)
471
- return hr;
472
- Ae = 1;
473
- var r = J();
474
- return hr = function(t) {
475
- var e = r(t);
476
- return e === "BigInt64Array" || e === "BigUint64Array";
477
- }, hr;
478
- }
479
- var gr, he;
480
- function xa() {
481
- if (he)
482
- return gr;
483
- he = 1;
484
- var r = Ur(), t = Math.max, e = Math.min;
485
- return gr = function(a, n) {
486
- var i = r(a);
487
- return i < 0 ? t(i + n, 0) : e(i, n);
488
- }, gr;
489
- }
490
- var Er, ge;
491
- function Da() {
492
- if (ge)
493
- return Er;
494
- ge = 1;
495
- var r = Bt(), t = TypeError;
496
- return Er = function(e) {
497
- var a = r(e, "number");
498
- if (typeof a == "number")
499
- throw new t("Can't convert number to bigint");
500
- return BigInt(a);
501
- }, Er;
502
- }
503
- var Ee;
504
- function Na() {
505
- if (Ee)
506
- return pe;
507
- Ee = 1;
508
- var r = W(), t = Lr(), e = Ca(), a = xa(), n = Da(), i = Ur(), o = r.aTypedArray, s = r.getTypedArrayConstructor, c = r.exportTypedArrayMethod, f = Math.max, v = Math.min;
509
- return c("toSpliced", function(d, m) {
510
- var g = o(this), w = s(g), y = t(g), E = a(d, y), b = arguments.length, u = 0, p, A, _, h, T, O, I;
511
- if (b === 0)
512
- p = A = 0;
513
- else if (b === 1)
514
- p = 0, A = y - E;
515
- else if (A = v(f(i(m), 0), y - E), p = b - 2, p) {
516
- h = new w(p), _ = e(h);
517
- for (var q = 2; q < b; q++)
518
- T = arguments[q], h[q - 2] = _ ? n(T) : +T;
519
- }
520
- for (O = y + p - A, I = new w(O); u < E; u++)
521
- I[u] = g[u];
522
- for (; u < E + p; u++)
523
- I[u] = h[u - E];
524
- for (; u < O; u++)
525
- I[u] = g[u + A - p];
526
- return I;
527
- }, !0), pe;
528
- }
529
- Na();
530
- var Te = {}, Pa = require("../internals/function-uncurry-this"), Ua = require("../internals/a-callable"), La = require("../internals/is-null-or-undefined"), Ma = require("../internals/length-of-array-like"), Fa = require("../internals/to-object"), Mr = require("../internals/map-helpers"), Va = require("../internals/map-iterate"), $a = Mr.Map, Ha = Mr.has, ja = Mr.set, ka = Pa([].push);
531
- module.exports = function(t) {
532
- var e = Fa(this), a = Ma(e), n = [], i = new $a(), o = La(t) ? function(v) {
533
- return v;
534
- } : Ua(t), s, c, f;
535
- for (s = 0; s < a; s++)
536
- c = e[s], f = o(c), Ha(i, f) || ja(i, f, c);
537
- return Va(i, function(v) {
538
- ka(n, v);
539
- }), n;
540
- };
541
- const Ga = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
542
- __proto__: null
543
- }, Symbol.toStringTag, { value: "Module" })), Ya = /* @__PURE__ */ Q(Ga);
544
- var _e;
545
- function Wa() {
546
- if (_e)
547
- return Te;
548
- _e = 1;
549
- var r = F(), t = W(), e = ot(), a = Ya, n = t.aTypedArray, i = t.getTypedArrayConstructor, o = t.exportTypedArrayMethod, s = r(a);
550
- return o("uniqueBy", function(f) {
551
- return n(this), e(i(this), s(this, f));
552
- }, !0), Te;
553
- }
554
- Wa();
555
- var Xa = require("../internals/array-with"), Fr = require("../internals/array-buffer-view-core"), za = require("../internals/is-big-int-array"), Qa = require("../internals/to-integer-or-infinity"), Ja = require("../internals/to-big-int"), Ka = Fr.aTypedArray, Za = Fr.getTypedArrayConstructor, rn = Fr.exportTypedArrayMethod, st = function() {
556
- try {
557
- new Int8Array(1).with(2, {
558
- valueOf: function() {
559
- throw 8;
560
- }
561
- });
562
- } catch (r) {
563
- return r === 8;
564
- }
565
- }(), en = st && function() {
566
- try {
567
- new Int8Array(1).with(-0.5, 1);
568
- } catch {
569
- return !0;
570
- }
571
- }();
572
- rn("with", function(r, t) {
573
- var e = Ka(this), a = Qa(r), n = za(e) ? Ja(t) : +t;
574
- return Xa(e, Za(e), a, n);
575
- }, !st || en);
576
- var Re = {}, me = {}, Tr, be;
577
- function ft() {
578
- if (be)
579
- return Tr;
580
- be = 1;
581
- var r = G(), t = String, e = TypeError;
582
- return Tr = function(a) {
583
- if (a === void 0 || r(a))
584
- return a;
585
- throw new e(t(a) + " is not an object or undefined");
586
- }, Tr;
587
- }
588
- var _r, Ie;
589
- function vt() {
590
- if (Ie)
591
- return _r;
592
- Ie = 1;
593
- var r = TypeError;
594
- return _r = function(t) {
595
- if (typeof t == "string")
596
- return t;
597
- throw new r("Argument is not a string");
598
- }, _r;
599
- }
600
- var Rr, qe;
601
- function ct() {
602
- if (qe)
603
- return Rr;
604
- qe = 1;
605
- var r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", t = r + "+/", e = r + "-_", a = function(n) {
606
- for (var i = {}, o = 0; o < 64; o++)
607
- i[n.charAt(o)] = o;
608
- return i;
609
- };
610
- return Rr = {
611
- i2c: t,
612
- c2i: a(t),
613
- i2cUrl: e,
614
- c2iUrl: a(e)
615
- }, Rr;
616
- }
617
- var mr, we;
618
- function yt() {
619
- if (we)
620
- return mr;
621
- we = 1;
622
- var r = TypeError;
623
- return mr = function(t) {
624
- var e = t && t.alphabet;
625
- if (e === void 0 || e === "base64" || e === "base64url")
626
- return e || "base64";
627
- throw new r("Incorrect `alphabet` option");
628
- }, mr;
629
- }
630
- var br, Oe;
631
- function tn() {
632
- if (Oe)
633
- return br;
634
- Oe = 1;
635
- var r = D(), t = F(), e = ft(), a = vt(), n = Nr(), i = ct(), o = yt(), s = Y(), c = i.c2i, f = i.c2iUrl, v = r.SyntaxError, l = r.TypeError, d = t("".charAt), m = function(y, E) {
636
- for (var b = y.length; E < b; E++) {
637
- var u = d(y, E);
638
- if (u !== " " && u !== " " && u !== `
639
- ` && u !== "\f" && u !== "\r")
640
- break;
641
- }
642
- return E;
643
- }, g = function(y, E, b) {
644
- var u = y.length;
645
- u < 4 && (y += u === 2 ? "AA" : "A");
646
- var p = (E[d(y, 0)] << 18) + (E[d(y, 1)] << 12) + (E[d(y, 2)] << 6) + E[d(y, 3)], A = [p >> 16 & 255, p >> 8 & 255, p & 255];
647
- if (u === 2) {
648
- if (b && A[1] !== 0)
649
- throw new v("Extra bits");
650
- return [A[0]];
651
- }
652
- if (u === 3) {
653
- if (b && A[2] !== 0)
654
- throw new v("Extra bits");
655
- return [A[0], A[1]];
656
- }
657
- return A;
658
- }, w = function(y, E, b) {
659
- for (var u = E.length, p = 0; p < u; p++)
660
- y[b + p] = E[p];
661
- return b + u;
662
- };
663
- return br = function(y, E, b, u) {
664
- a(y), e(E);
665
- var p = o(E) === "base64" ? c : f, A = E ? E.lastChunkHandling : void 0;
666
- if (A === void 0 && (A = "loose"), A !== "loose" && A !== "strict" && A !== "stop-before-partial")
667
- throw new l("Incorrect `lastChunkHandling` option");
668
- b && s(b.buffer);
669
- var _ = y.length, h = b || [], T = 0, O = 0, I = "", q = 0;
670
- if (u)
671
- for (; ; ) {
672
- if (q = m(y, q), q === _) {
673
- if (I.length > 0) {
674
- if (A === "stop-before-partial")
675
- break;
676
- if (A === "loose") {
677
- if (I.length === 1)
678
- throw new v("Malformed padding: exactly one additional character");
679
- T = w(h, g(I, p, !1), T);
680
- } else
681
- throw new v("Missing padding");
682
- }
683
- O = _;
684
- break;
685
- }
686
- var U = d(y, q);
687
- if (++q, U === "=") {
688
- if (I.length < 2)
689
- throw new v("Padding is too early");
690
- if (q = m(y, q), I.length === 2) {
691
- if (q === _) {
692
- if (A === "stop-before-partial")
693
- break;
694
- throw new v("Malformed padding: only one =");
695
- }
696
- d(y, q) === "=" && (++q, q = m(y, q));
697
- }
698
- if (q < _)
699
- throw new v("Unexpected character after padding");
700
- T = w(h, g(I, p, A === "strict"), T), O = _;
701
- break;
702
- }
703
- if (!n(p, U))
704
- throw new v("Unexpected character");
705
- var N = u - T;
706
- if (N === 1 && I.length === 2 || N === 2 && I.length === 3 || (I += U, I.length === 4 && (T = w(h, g(I, p, !1), T), I = "", O = q, T === u)))
707
- break;
708
- }
709
- return {
710
- bytes: h,
711
- read: O,
712
- written: T
713
- };
714
- }, br;
715
- }
716
- var Ir, Se;
717
- function K() {
718
- if (Se)
719
- return Ir;
720
- Se = 1;
721
- var r = J(), t = TypeError;
722
- return Ir = function(e) {
723
- if (r(e) === "Uint8Array")
724
- return e;
725
- throw new t("Argument is not an Uint8Array");
726
- }, Ir;
727
- }
728
- var Be;
729
- function an() {
730
- if (Be)
731
- return me;
732
- Be = 1;
733
- var r = $(), t = D(), e = tn(), a = K(), n = t.Uint8Array, i = !n || !n.prototype.setFromBase64 || !function() {
734
- var o = new n([255, 255, 255, 255, 255]);
735
- try {
736
- o.setFromBase64("", null);
737
- return;
738
- } catch {
739
- }
740
- try {
741
- o.setFromBase64("a");
742
- return;
743
- } catch {
744
- }
745
- try {
746
- o.setFromBase64("MjYyZg===");
747
- } catch {
748
- return o[0] === 50 && o[1] === 54 && o[2] === 50 && o[3] === 255 && o[4] === 255;
749
- }
750
- }();
751
- return n && r({
752
- target: "Uint8Array",
753
- proto: !0,
754
- forced: i
755
- }, {
756
- setFromBase64: function(s) {
757
- a(this);
758
- var c = e(s, arguments.length > 1 ? arguments[1] : void 0, this, this.length);
759
- return {
760
- read: c.read,
761
- written: c.written
762
- };
763
- }
764
- }), me;
765
- }
766
- var Ce;
767
- function nn() {
768
- return Ce || (Ce = 1, an()), Re;
769
- }
770
- nn();
771
- var xe = {}, De = {}, qr, Ne;
772
- function on() {
773
- if (Ne)
774
- return qr;
775
- Ne = 1;
776
- var r = D(), t = F(), e = r.Uint8Array, a = r.SyntaxError, n = r.parseInt, i = Math.min, o = /[^\da-f]/i, s = t(o.exec), c = t("".slice);
777
- return qr = function(f, v) {
778
- var l = f.length;
779
- if (l % 2 !== 0)
780
- throw new a("String should be an even number of characters");
781
- for (var d = v ? i(v.length, l / 2) : l / 2, m = v || new e(d), g = 0, w = 0; w < d; ) {
782
- var y = c(f, g, g += 2);
783
- if (s(o, y))
784
- throw new a("String should only contain hex characters");
785
- m[w++] = n(y, 16);
786
- }
787
- return {
788
- bytes: m,
789
- read: g
790
- };
791
- }, qr;
792
- }
793
- var Pe;
794
- function un() {
795
- if (Pe)
796
- return De;
797
- Pe = 1;
798
- var r = $(), t = D(), e = vt(), a = K(), n = Y(), i = on();
799
- return t.Uint8Array && r({
800
- target: "Uint8Array",
801
- proto: !0
802
- }, {
803
- setFromHex: function(s) {
804
- a(this), e(s), n(this.buffer);
805
- var c = i(s, this).read;
806
- return {
807
- read: c,
808
- written: c / 2
809
- };
810
- }
811
- }), De;
812
- }
813
- var Ue;
814
- function sn() {
815
- return Ue || (Ue = 1, un()), xe;
816
- }
817
- sn();
818
- var Le = {}, Me = {}, Fe;
819
- function fn() {
820
- if (Fe)
821
- return Me;
822
- Fe = 1;
823
- var r = $(), t = D(), e = F(), a = ft(), n = K(), i = Y(), o = ct(), s = yt(), c = o.i2c, f = o.i2cUrl, v = e("".charAt), l = t.Uint8Array, d = !l || !l.prototype.toBase64 || !function() {
824
- try {
825
- var m = new l();
826
- m.toBase64(null);
827
- } catch {
828
- return !0;
829
- }
830
- }();
831
- return l && r({
832
- target: "Uint8Array",
833
- proto: !0,
834
- forced: d
835
- }, {
836
- toBase64: function() {
837
- var g = n(this), w = arguments.length ? a(arguments[0]) : void 0, y = s(w) === "base64" ? c : f, E = !!w && !!w.omitPadding;
838
- i(this.buffer);
839
- for (var b = "", u = 0, p = g.length, A, _ = function(h) {
840
- return v(y, A >> 6 * h & 63);
841
- }; u + 2 < p; u += 3)
842
- A = (g[u] << 16) + (g[u + 1] << 8) + g[u + 2], b += _(3) + _(2) + _(1) + _(0);
843
- return u + 2 === p ? (A = (g[u] << 16) + (g[u + 1] << 8), b += _(3) + _(2) + _(1) + (E ? "" : "=")) : u + 1 === p && (A = g[u] << 16, b += _(3) + _(2) + (E ? "" : "==")), b;
844
- }
845
- }), Me;
846
- }
847
- var Ve;
848
- function vn() {
849
- return Ve || (Ve = 1, fn()), Le;
850
- }
851
- vn();
852
- var $e = {}, He = {}, je;
853
- function cn() {
854
- if (je)
855
- return He;
856
- je = 1;
857
- var r = $(), t = D(), e = F(), a = K(), n = Y(), i = e(1.1.toString), o = t.Uint8Array, s = !o || !o.prototype.toHex || !function() {
858
- try {
859
- var c = new o([255, 255, 255, 255, 255, 255, 255, 255]);
860
- return c.toHex() === "ffffffffffffffff";
861
- } catch {
862
- return !1;
863
- }
864
- }();
865
- return o && r({
866
- target: "Uint8Array",
867
- proto: !0,
868
- forced: s
869
- }, {
870
- toHex: function() {
871
- a(this), n(this.buffer);
872
- for (var f = "", v = 0, l = this.length; v < l; v++) {
873
- var d = i(this[v], 16);
874
- f += d.length === 1 ? "0" + d : d;
875
- }
876
- return f;
877
- }
878
- }), He;
879
- }
880
- var ke;
881
- function yn() {
882
- return ke || (ke = 1, cn()), $e;
883
- }
884
- yn();
885
- var Ge = {}, wr, Ye;
886
- function dn() {
887
- if (Ye)
888
- return wr;
889
- Ye = 1;
890
- var r = rt(), t = G(), e = it();
891
- return wr = function(a, n, i) {
892
- var o, s;
893
- return (
894
- // it can work only with native `setPrototypeOf`
895
- e && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
896
- r(o = n.constructor) && o !== i && t(s = o.prototype) && s !== i.prototype && e(a, s), a
897
- );
898
- }, wr;
899
- }
900
- var Or, We;
901
- function ln() {
902
- if (We)
903
- return Or;
904
- We = 1;
905
- var r = J(), t = String;
906
- return Or = function(e) {
907
- if (r(e) === "Symbol")
908
- throw new TypeError("Cannot convert a Symbol value to a string");
909
- return t(e);
910
- }, Or;
911
- }
912
- var Sr, Xe;
913
- function pn() {
914
- if (Xe)
915
- return Sr;
916
- Xe = 1;
917
- var r = ln();
918
- return Sr = function(t, e) {
919
- return t === void 0 ? arguments.length < 2 ? "" : e : r(t);
920
- }, Sr;
921
- }
922
- var Br, ze;
923
- function An() {
924
- return ze || (ze = 1, Br = {
925
- IndexSizeError: {
926
- s: "INDEX_SIZE_ERR",
927
- c: 1,
928
- m: 1
929
- },
930
- DOMStringSizeError: {
931
- s: "DOMSTRING_SIZE_ERR",
932
- c: 2,
933
- m: 0
934
- },
935
- HierarchyRequestError: {
936
- s: "HIERARCHY_REQUEST_ERR",
937
- c: 3,
938
- m: 1
939
- },
940
- WrongDocumentError: {
941
- s: "WRONG_DOCUMENT_ERR",
942
- c: 4,
943
- m: 1
944
- },
945
- InvalidCharacterError: {
946
- s: "INVALID_CHARACTER_ERR",
947
- c: 5,
948
- m: 1
949
- },
950
- NoDataAllowedError: {
951
- s: "NO_DATA_ALLOWED_ERR",
952
- c: 6,
953
- m: 0
954
- },
955
- NoModificationAllowedError: {
956
- s: "NO_MODIFICATION_ALLOWED_ERR",
957
- c: 7,
958
- m: 1
959
- },
960
- NotFoundError: {
961
- s: "NOT_FOUND_ERR",
962
- c: 8,
963
- m: 1
964
- },
965
- NotSupportedError: {
966
- s: "NOT_SUPPORTED_ERR",
967
- c: 9,
968
- m: 1
969
- },
970
- InUseAttributeError: {
971
- s: "INUSE_ATTRIBUTE_ERR",
972
- c: 10,
973
- m: 1
974
- },
975
- InvalidStateError: {
976
- s: "INVALID_STATE_ERR",
977
- c: 11,
978
- m: 1
979
- },
980
- SyntaxError: {
981
- s: "SYNTAX_ERR",
982
- c: 12,
983
- m: 1
984
- },
985
- InvalidModificationError: {
986
- s: "INVALID_MODIFICATION_ERR",
987
- c: 13,
988
- m: 1
989
- },
990
- NamespaceError: {
991
- s: "NAMESPACE_ERR",
992
- c: 14,
993
- m: 1
994
- },
995
- InvalidAccessError: {
996
- s: "INVALID_ACCESS_ERR",
997
- c: 15,
998
- m: 1
999
- },
1000
- ValidationError: {
1001
- s: "VALIDATION_ERR",
1002
- c: 16,
1003
- m: 0
1004
- },
1005
- TypeMismatchError: {
1006
- s: "TYPE_MISMATCH_ERR",
1007
- c: 17,
1008
- m: 1
1009
- },
1010
- SecurityError: {
1011
- s: "SECURITY_ERR",
1012
- c: 18,
1013
- m: 1
1014
- },
1015
- NetworkError: {
1016
- s: "NETWORK_ERR",
1017
- c: 19,
1018
- m: 1
1019
- },
1020
- AbortError: {
1021
- s: "ABORT_ERR",
1022
- c: 20,
1023
- m: 1
1024
- },
1025
- URLMismatchError: {
1026
- s: "URL_MISMATCH_ERR",
1027
- c: 21,
1028
- m: 1
1029
- },
1030
- QuotaExceededError: {
1031
- s: "QUOTA_EXCEEDED_ERR",
1032
- c: 22,
1033
- m: 1
1034
- },
1035
- TimeoutError: {
1036
- s: "TIMEOUT_ERR",
1037
- c: 23,
1038
- m: 1
1039
- },
1040
- InvalidNodeTypeError: {
1041
- s: "INVALID_NODE_TYPE_ERR",
1042
- c: 24,
1043
- m: 1
1044
- },
1045
- DataCloneError: {
1046
- s: "DATA_CLONE_ERR",
1047
- c: 25,
1048
- m: 1
1049
- }
1050
- }), Br;
1051
- }
1052
- var Cr, Qe;
1053
- function hn() {
1054
- if (Qe)
1055
- return Cr;
1056
- Qe = 1;
1057
- var r = F(), t = Error, e = r("".replace), a = function(o) {
1058
- return String(new t(o).stack);
1059
- }("zxcasd"), n = /\n\s*at [^:]*:[^\n]*/, i = n.test(a);
1060
- return Cr = function(o, s) {
1061
- if (i && typeof o == "string" && !t.prepareStackTrace)
1062
- for (; s--; )
1063
- o = e(o, n, "");
1064
- return o;
1065
- }, Cr;
1066
- }
1067
- var Je;
1068
- function gn() {
1069
- if (Je)
1070
- return Ge;
1071
- Je = 1;
1072
- var r = $(), t = D(), e = Ct(), a = Nt(), n = xt().f, i = Nr(), o = Dt(), s = dn(), c = pn(), f = An(), v = hn(), l = Ze(), d = Pt(), m = "DOMException", g = e("Error"), w = e(m), y = function() {
1073
- o(this, E);
1074
- var N = arguments.length, B = c(N < 1 ? void 0 : arguments[0]), X = c(N < 2 ? void 0 : arguments[1], "Error"), S = new w(B, X), P = new g(B);
1075
- return P.name = m, n(S, "stack", a(1, v(P.stack, 1))), s(S, this, y), S;
1076
- }, E = y.prototype = w.prototype, b = "stack" in new g(m), u = "stack" in new w(1, 2), p = w && l && Object.getOwnPropertyDescriptor(t, m), A = !!p && !(p.writable && p.configurable), _ = b && !A && !u;
1077
- r({
1078
- global: !0,
1079
- constructor: !0,
1080
- forced: d || _
1081
- }, {
1082
- // TODO: fix export logic
1083
- DOMException: _ ? y : w
1084
- });
1085
- var h = e(m), T = h.prototype;
1086
- if (T.constructor !== h) {
1087
- d || n(T, "constructor", a(1, h));
1088
- for (var O in f)
1089
- if (i(f, O)) {
1090
- var I = f[O], q = I.s;
1091
- i(h, q) || n(h, q, a(6, I.c));
1092
- }
1093
- }
1094
- return Ge;
1095
- }
1096
- gn();
1097
- const En = /* @__PURE__ */ new Date("2026-01-06T20:22:33.853Z"), xr = "Please visit https://www.react-pdf.dev/manage-license/ to generate a new license key.", V = {
1098
- invalidLicense: `You are currently using without a valid license. ${xr}`,
1099
- mismatchedDomain: `Your license key is not valid for the current domain / IP. ${xr}`,
1100
- expired: `Your license key has expired. ${xr}`,
1
+ import { useState as E, useCallback as h, useEffect as A } from "react";
2
+ import { appConsole as l } from "../appConsole.js";
3
+ const b = /* @__PURE__ */ new Date("2026-01-08T21:52:18.688Z"), d = "Please visit https://www.react-pdf.dev/manage-license/ to generate a new license key.", s = {
4
+ invalidLicense: `You are currently using without a valid license. ${d}`,
5
+ mismatchedDomain: `Your license key is not valid for the current domain / IP. ${d}`,
6
+ expired: `Your license key has expired. ${d}`,
1101
7
  exceededVersion: "Your license does not support the current version of React PDF. The library version you are using exceeds the supported range of your license.",
1102
8
  invalidSignature: "Invalid license key: Signature mismatch"
1103
9
  };
1104
- function Tn(r) {
1105
- const t = r.replace(/-----BEGIN PUBLIC KEY-----/, "").replace(/-----END PUBLIC KEY-----/, "").replace(/\s+/g, ""), e = atob(t), a = new Uint8Array(e.length);
1106
- for (let n = 0; n < e.length; n++)
1107
- a[n] = e.charCodeAt(n);
1108
- return a.buffer;
10
+ function L(r) {
11
+ const t = r.replace(/-----BEGIN PUBLIC KEY-----/, "").replace(/-----END PUBLIC KEY-----/, "").replace(/\s+/g, ""), e = atob(t), n = new Uint8Array(e.length);
12
+ for (let i = 0; i < e.length; i++)
13
+ n[i] = e.charCodeAt(i);
14
+ return n.buffer;
1109
15
  }
1110
- function _n(r) {
16
+ function S(r) {
1111
17
  const t = atob(r), e = new Uint8Array(t.length);
1112
- for (let a = 0; a < t.length; a++)
1113
- e[a] = t.charCodeAt(a);
18
+ for (let n = 0; n < t.length; n++)
19
+ e[n] = t.charCodeAt(n);
1114
20
  return e.buffer;
1115
21
  }
1116
- async function Rn(r, t = "SHA-256") {
22
+ async function I(r, t = "SHA-256") {
1117
23
  try {
1118
- const {
1119
- data: e,
1120
- signature: a
1121
- } = JSON.parse(atob(r)), n = Tn(`-----BEGIN PUBLIC KEY-----
24
+ const { data: e, signature: n } = JSON.parse(atob(r)), i = L(`-----BEGIN PUBLIC KEY-----
1122
25
  MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvIokvErJ0Fctu0jduSAx
1123
26
  gr+5Har/VSuZLlOunS28hnlqqA+OF1apHL7RYkjBosS15yvviYdLrVWYHpHnoY4b
1124
27
  HLQ9I6YX6FMB9T/VbB4xLdVdKvfi8r49aTScl5EKuSpgpPgz2VSJTfvVGcRuth/Y
@@ -1126,104 +29,82 @@ Bm7PPGYdL2l2gvKDxchmmsHFPukGki9L4JOUeIVX0GXAxabENckaEH/iC1NZhX+W
1126
29
  vXnpHeHuIIKlZ16LSivXNgo6BH2Z3GFdg4G3cAaXr6qNP8fsacYNqv2SpTW1viFD
1127
30
  vzcGRabN25gpJAp9/syeScefWH3OiJY1lmw88oTiJbjIoiq6AkPhfn3G9mF54nvR
1128
31
  kwIDAQAB
1129
- -----END PUBLIC KEY-----`), i = await window.crypto.subtle.importKey(
32
+ -----END PUBLIC KEY-----`), a = await window.crypto.subtle.importKey(
1130
33
  "spki",
1131
34
  // str2ab(publicKeyContent), // Convert PEM string to ArrayBuffer
1132
- n,
1133
- {
1134
- name: "RSA-PSS",
1135
- hash: t
1136
- },
35
+ i,
36
+ { name: "RSA-PSS", hash: t },
1137
37
  !0,
1138
38
  ["verify"]
1139
39
  );
1140
40
  if (!await window.crypto.subtle.verify(
1141
- {
1142
- name: "RSA-PSS",
1143
- saltLength: 32
1144
- },
1145
- i,
1146
- _n(a),
41
+ { name: "RSA-PSS", saltLength: 32 },
42
+ a,
43
+ S(n),
1147
44
  // Convert signature to ArrayBuffer
1148
45
  new TextEncoder().encode(atob(e))
1149
46
  ))
1150
- throw new Error(V.invalidSignature);
47
+ throw new Error(s.invalidSignature);
1151
48
  return JSON.parse(atob(e));
1152
49
  } catch {
1153
- throw new Error(V.invalidLicense);
50
+ throw new Error(s.invalidLicense);
1154
51
  }
1155
52
  }
1156
- const mn = (r, t) => r === "specific" ? t === window.location.host : window.location.host.includes(t), Dr = {
53
+ const y = (r, t) => r === "specific" ? t === window.location.host : window.location.host.includes(t), u = {
1157
54
  isValid: !0,
1158
- invalidatedMessage: V.invalidLicense,
55
+ invalidatedMessage: s.invalidLicense,
1159
56
  type: void 0
1160
- }, xn = (r) => {
1161
- const [t, e] = Lt(Dr), a = Mt(async () => {
1162
- if (e((g) => ({
1163
- ...g,
1164
- validating: !0
1165
- })), !r)
1166
- throw e({
1167
- ...Dr,
1168
- validating: !1
1169
- }), new Error(V.invalidLicense);
1170
- let n;
57
+ }, x = (r) => {
58
+ const [t, e] = E(u), n = h(async () => {
59
+ if (e((c) => ({ ...c, validating: !0 })), !r)
60
+ throw e({ ...u, validating: !1 }), new Error(s.invalidLicense);
61
+ let i;
1171
62
  try {
1172
- n = await Rn(r);
1173
- } catch (g) {
1174
- throw z.warn(g.message), new Error(g.message);
63
+ i = await I(r);
64
+ } catch (c) {
65
+ throw l.warn(c.message), new Error(c.message);
1175
66
  }
1176
- z.debug(">>> validatedLicense", n);
1177
- const {
1178
- avu: i,
1179
- exp: o,
1180
- dmt: s,
1181
- dm: c,
1182
- t: f
1183
- } = n;
67
+ l.debug(">>> validatedLicense", i);
68
+ const { avu: a, exp: o, dmt: m, dm: w, t: f } = i;
1184
69
  if (!o)
1185
70
  throw new Error("License is missing expiration timestamp");
1186
71
  if (o > Number.MAX_SAFE_INTEGER / 1e3)
1187
72
  throw new Error("Invalid expiration timestamp: value too large");
1188
- const v = new Date(o * 1e3), l = (/* @__PURE__ */ new Date()).getTime();
1189
- if (v.getTime() < l)
1190
- throw new Error(V.expired);
1191
- if (!i)
73
+ const p = new Date(o * 1e3), g = (/* @__PURE__ */ new Date()).getTime();
74
+ if (p.getTime() < g)
75
+ throw new Error(s.expired);
76
+ if (!a)
1192
77
  throw new Error("License is missing available until version timestamp");
1193
- if (i > Number.MAX_SAFE_INTEGER / 1e3)
78
+ if (a > Number.MAX_SAFE_INTEGER / 1e3)
1194
79
  throw new Error("Invalid available until version timestamp: value too large");
1195
- const d = new Date(i * 1e3);
1196
- if (z.debug("availableUntilTimestamp", d), d.getTime() < En.getTime())
1197
- throw new Error(V.exceededVersion);
1198
- if (!mn(s, c))
1199
- throw new Error(V.mismatchedDomain);
80
+ const v = new Date(a * 1e3);
81
+ if (l.debug("availableUntilTimestamp", v), v.getTime() < b.getTime())
82
+ throw new Error(s.exceededVersion);
83
+ if (!y(m, w))
84
+ throw new Error(s.mismatchedDomain);
1200
85
  return {
1201
86
  isValid: !0,
1202
87
  type: f,
1203
88
  invalidatedMessage: void 0
1204
89
  };
1205
90
  }, [r]);
1206
- return Ft(() => {
1207
- a().then(({
1208
- isValid: n,
1209
- type: i,
1210
- invalidatedMessage: o
1211
- }) => {
91
+ return A(() => {
92
+ n().then(({ isValid: i, type: a, invalidatedMessage: o }) => {
1212
93
  e({
1213
- isValid: n,
1214
- type: i,
94
+ isValid: i,
95
+ type: a,
1215
96
  invalidatedMessage: o,
1216
97
  validating: !1
1217
98
  });
1218
- }).catch((n) => {
99
+ }).catch((i) => {
1219
100
  e({
1220
- ...Dr,
101
+ ...u,
1221
102
  isValid: !1,
1222
103
  validating: !1
1223
- }), z.warn(n.message);
104
+ }), l.warn(i.message);
1224
105
  });
1225
- }, [a]), t;
106
+ }, [n]), t;
1226
107
  };
1227
108
  export {
1228
- xn as useLicense
109
+ x as useLicense
1229
110
  };