visionary-image 1.0.1 → 1.0.2

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.
@@ -1,10 +1,10 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.id="v7y-styles",e.appendChild(document.createTextNode('.v7y_7587:before{content:"";display:block;padding-top:var(--v-ar)}.v7y_b8c0{-webkit-user-drag:none;pointer-events:none}.v7y_e0dd{-webkit-user-select:none;user-select:none}')),document.head.appendChild(e)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
2
2
  import { jsx as G, jsxs as vt } from "react/jsx-runtime";
3
- import { useRef as Y, useCallback as q, useState as yt, useEffect as wt, useLayoutEffect as It, useMemo as xt } from "react";
4
- function Et(t) {
3
+ import { useRef as Y, useCallback as q, useState as wt, useEffect as It, useLayoutEffect as Et, useMemo as At } from "react";
4
+ function xt(t) {
5
5
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
6
6
  }
7
- var et = { exports: {} };
7
+ var nt = { exports: {} };
8
8
  /*!
9
9
  Copyright (c) 2018 Jed Watson.
10
10
  Licensed under the MIT License (MIT), see
@@ -12,11 +12,11 @@ var et = { exports: {} };
12
12
  */
13
13
  (function(t) {
14
14
  (function() {
15
- var e = {}.hasOwnProperty;
16
- function n() {
15
+ var n = {}.hasOwnProperty;
16
+ function e() {
17
17
  for (var r = "", s = 0; s < arguments.length; s++) {
18
- var a = arguments[s];
19
- a && (r = c(r, o(a)));
18
+ var u = arguments[s];
19
+ u && (r = i(r, o(u)));
20
20
  }
21
21
  return r;
22
22
  }
@@ -26,212 +26,212 @@ var et = { exports: {} };
26
26
  if (typeof r != "object")
27
27
  return "";
28
28
  if (Array.isArray(r))
29
- return n.apply(null, r);
29
+ return e.apply(null, r);
30
30
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
31
31
  return r.toString();
32
32
  var s = "";
33
- for (var a in r)
34
- e.call(r, a) && r[a] && (s = c(s, a));
33
+ for (var u in r)
34
+ n.call(r, u) && r[u] && (s = i(s, u));
35
35
  return s;
36
36
  }
37
- function c(r, s) {
37
+ function i(r, s) {
38
38
  return s ? r ? r + " " + s : r + s : r;
39
39
  }
40
- t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
40
+ t.exports ? (e.default = e, t.exports = e) : window.classNames = e;
41
41
  })();
42
- })(et);
43
- var Rt = et.exports;
44
- const At = /* @__PURE__ */ Et(Rt), St = (t, { root: e, rootMargin: n, threshold: o } = {}, c = []) => {
42
+ })(nt);
43
+ var Rt = nt.exports;
44
+ const St = /* @__PURE__ */ xt(Rt), Ut = (t, { root: n, rootMargin: e, threshold: o } = {}, i = []) => {
45
45
  const r = Y(null), s = Y(null);
46
- return q((i) => {
47
- r.current && s.current && (s.current.unobserve(r.current), s.current.disconnect(), s.current = null), i && (s.current = new IntersectionObserver(t, { root: e, rootMargin: n, threshold: o }), s.current.observe(i), r.current = i);
48
- }, [r, e, n, JSON.stringify(o), ...c]);
49
- }, Nt = ({ root: t, rootMargin: e, threshold: n, unobserveOnEnter: o, target: c, onEnter: r, onLeave: s, defaultInView: a } = {}, i = []) => {
50
- const [d, h] = yt({
51
- inView: a || !1,
46
+ return q((c) => {
47
+ r.current && s.current && (s.current.unobserve(r.current), s.current.disconnect(), s.current = null), c && (s.current = new IntersectionObserver(t, { root: n, rootMargin: e, threshold: o }), s.current.observe(c), r.current = c);
48
+ }, [r, n, e, JSON.stringify(o), ...i]);
49
+ }, Nt = ({ root: t, rootMargin: n, threshold: e, unobserveOnEnter: o, target: i, onEnter: r, onLeave: s, defaultInView: u } = {}, c = []) => {
50
+ const [a, p] = wt({
51
+ inView: u || !1,
52
52
  entry: null,
53
53
  observer: null
54
- }), f = q(([p], l) => {
55
- const b = l.thresholds.some((g) => p.intersectionRatio >= g) && p.isIntersecting;
56
- h({
54
+ }), l = q(([h], f) => {
55
+ const b = f.thresholds.some((g) => h.intersectionRatio >= g) && h.isIntersecting;
56
+ p({
57
57
  inView: b,
58
- entry: p,
59
- observer: l
60
- }), b && o && (l.unobserve(p.target), l.disconnect()), b ? r == null || r(p, l) : s == null || s(p, l);
61
- }, [r, s, o]), m = St(f, { root: t, rootMargin: e, threshold: n }, [o, ...i]);
62
- return wt(() => {
63
- c != null && c.current && m(c.current);
64
- }, [c, m]), [m, d.inView, d.entry, d.observer];
58
+ entry: h,
59
+ observer: f
60
+ }), b && o && (f.unobserve(h.target), f.disconnect()), b ? r == null || r(h, f) : s == null || s(h, f);
61
+ }, [r, s, o]), m = Ut(l, { root: t, rootMargin: n, threshold: e }, [o, ...c]);
62
+ return It(() => {
63
+ i != null && i.current && m(i.current);
64
+ }, [i, m]), [m, a.inView, a.entry, a.observer];
65
65
  };
66
- var $ = /* @__PURE__ */ ((t) => (t.AUTO = "auto", t.AVIF = "avif", t.JPEG = "jpeg", t.WEBP = "webp", t))($ || {}), y = /* @__PURE__ */ ((t) => (t.xs = "xs", t.sm = "sm", t.md = "md", t.lg = "lg", t.xl = "xl", t.xxl = "xxl", t["4k"] = "4k", t["5k"] = "5k", t.full = "full", t))(y || {}), P = /* @__PURE__ */ ((t) => (t.DEBUG = "debug", t.DOWNLOAD = "download", t))(P || {});
66
+ var V = /* @__PURE__ */ ((t) => (t.AUTO = "auto", t.AVIF = "avif", t.JPEG = "jpeg", t.WEBP = "webp", t))(V || {}), v = /* @__PURE__ */ ((t) => (t.xs = "xs", t.sm = "sm", t.md = "md", t.lg = "lg", t.xl = "xl", t.xxl = "xxl", t["4k"] = "4k", t["5k"] = "5k", t.full = "full", t))(v || {}), T = /* @__PURE__ */ ((t) => (t.DEBUG = "debug", t.DOWNLOAD = "download", t))(T || {});
67
67
  const Ot = "https://link.visionary.cloud";
68
- $.AUTO, y.lg;
68
+ V.AUTO, v.lg;
69
69
  const Z = {
70
- [y.xs]: 160,
71
- [y.sm]: 320,
72
- [y.md]: 640,
73
- [y.lg]: 1280,
74
- [y.xl]: 1920,
75
- [y.xxl]: 2560,
76
- [y["4k"]]: 3840,
77
- [y["5k"]]: 5120,
78
- [y.full]: 0
70
+ [v.xs]: 160,
71
+ [v.sm]: 320,
72
+ [v.md]: 640,
73
+ [v.lg]: 1280,
74
+ [v.xl]: 1920,
75
+ [v.xxl]: 2560,
76
+ [v["4k"]]: 3840,
77
+ [v["5k"]]: 5120,
78
+ [v.full]: 0
79
79
  };
80
80
  Object.keys(Z).reduce(
81
- (t, e) => {
82
- const n = e, o = Z[n];
83
- return o && (t[o] = n), t;
81
+ (t, n) => {
82
+ const e = n, o = Z[e];
83
+ return o && (t[o] = e), t;
84
84
  },
85
85
  {}
86
86
  );
87
- const nt = "!";
88
- var Ut = Object.defineProperty, Tt = (t, e, n) => e in t ? Ut(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Dt = (t, e, n) => Tt(t, typeof e != "symbol" ? e + "" : e, n), J = {}, L = {};
89
- Object.defineProperty(L, "__esModule", { value: !0 });
87
+ const et = "!";
88
+ var Tt = Object.defineProperty, Ct = (t, n, e) => n in t ? Tt(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e, Dt = (t, n, e) => Ct(t, typeof n != "symbol" ? n + "" : n, e), J = {}, $ = {};
89
+ Object.defineProperty($, "__esModule", { value: !0 });
90
90
  function Pt(t) {
91
91
  return String.fromCharCode(parseInt(t.slice(1), 16));
92
92
  }
93
93
  function _t(t) {
94
94
  return btoa(encodeURIComponent(t).replace(/%[0-9A-F]{2}/g, Pt));
95
95
  }
96
- L.encode = _t;
97
- function Ct(t) {
96
+ $.encode = _t;
97
+ function Lt(t) {
98
98
  return `%${`00${t.charCodeAt(0).toString(16)}`.slice(-2)}`;
99
99
  }
100
100
  function Vt(t) {
101
- return decodeURIComponent(Array.from(atob(t), Ct).join(""));
101
+ return decodeURIComponent(Array.from(atob(t), Lt).join(""));
102
102
  }
103
- L.decode = Vt;
103
+ $.decode = Vt;
104
104
  Object.defineProperty(J, "__esModule", { value: !0 });
105
- const rt = L;
105
+ const rt = $;
106
106
  function $t(t) {
107
107
  return rt.decode(t.replace(/\-/g, "+").replace(/_/g, "/"));
108
108
  }
109
- var Lt = J.decode = $t;
110
- function jt(t) {
109
+ var jt = J.decode = $t;
110
+ function kt(t) {
111
111
  return rt.encode(t).replace(/\//g, "_").replace(/\+/g, "-").replace(/=+$/, "");
112
112
  }
113
- var kt = J.encode = jt;
114
- const zt = (t) => t.filter(Boolean), K = (t) => {
113
+ var zt = J.encode = kt;
114
+ const Bt = (t) => t.filter(Boolean), K = (t) => {
115
115
  try {
116
116
  return new URL(t);
117
117
  } catch {
118
118
  return null;
119
119
  }
120
- }, j = (t = "") => /^[A-Za-z0-9_-]*$/.test(t), Bt = (t) => {
121
- const { altText: e, bcc: n, blurhash: o, blurhashX: c, blurhashY: r, sourceHeight: s, sourceWidth: a, url: i } = t;
122
- if (!i || !a || !s)
120
+ }, j = (t = "") => /^[A-Za-z0-9_-]*$/.test(t), Mt = (t) => {
121
+ const { altText: n, bcc: e, blurhash: o, blurhashX: i, blurhashY: r, sourceHeight: s, sourceWidth: u, url: c } = t;
122
+ if (!c || !u || !s)
123
123
  return new Error("Cannot construct visionary code: missing required url/width/height");
124
- const d = [i, a, s];
125
- return !n || (d.push(n), !o || !c || !r) || (d.push(o, c, r), e && e.length && d.push(e)), Mt(d);
126
- }, Mt = (t) => kt(t.join(nt)), ot = (t) => {
124
+ const a = [c, u, s];
125
+ return !e || (a.push(e), !o || !i || !r) || (a.push(o, i, r), n && n.length && a.push(n)), Gt(a);
126
+ }, Gt = (t) => zt(t.join(et)), ot = (t) => {
127
127
  if (typeof t != "string")
128
128
  return null;
129
- const e = t.trim();
130
- if (!e.length || !j(e))
129
+ const n = t.trim();
130
+ if (!n.length || !j(n))
131
131
  return null;
132
- const n = Lt(e);
133
- if (!n)
132
+ const e = jt(n);
133
+ if (!e)
134
134
  return null;
135
- const o = n.split(nt);
135
+ const o = e.split(et);
136
136
  if (o.length < 3)
137
137
  return null;
138
- const [c, r, s, a, i, d, h, f] = o, m = c.trim();
138
+ const [i, r, s, u, c, a, p, l] = o, m = i.trim();
139
139
  if (!m.length)
140
140
  return console.error("Cannot parse code, empty file id"), null;
141
- const p = Number(r.trim()), l = Number(s.trim());
142
- if (isNaN(p) || isNaN(l) || !p || !l)
141
+ const h = Number(r.trim()), f = Number(s.trim());
142
+ if (isNaN(h) || isNaN(f) || !h || !f)
143
143
  return console.error("Cannot parse Visionary Code: invalid image dimensions", r, s), null;
144
- const v = Number(d) ?? 0, b = Number(h) ?? 0;
145
- return v < 1 || b < 1 ? (console.error(
144
+ const y = Number(a) ?? 0, b = Number(p) ?? 0;
145
+ return y < 1 || b < 1 ? (console.error(
146
146
  "Cannot parse Visionary Code: invalid blurhash x, y component dimensions",
147
- v,
147
+ y,
148
148
  b
149
149
  ), null) : {
150
- altText: f,
151
- bcc: a,
152
- blurhash: i,
153
- blurhashX: v,
150
+ altText: l,
151
+ bcc: u,
152
+ blurhash: c,
153
+ blurhashX: y,
154
154
  blurhashY: b,
155
- sourceHeight: l,
156
- sourceWidth: p,
155
+ sourceHeight: f,
156
+ sourceWidth: h,
157
157
  url: m
158
158
  };
159
159
  };
160
- class Gt extends Error {
160
+ class Wt extends Error {
161
161
  constructor() {
162
162
  super(...arguments), Dt(this, "message", "invalid endpoint URL (does it contain http/https?)");
163
163
  }
164
164
  }
165
- const Wt = (t) => t === P.DEBUG, Ft = (t) => t === P.DOWNLOAD, Ht = (t) => Object.values($).includes(t), st = (t) => Object.values(y).includes(t), Xt = (t = []) => {
166
- const e = {};
167
- for (const n of t)
168
- st(n) ? e.size = y[n] : Wt(n) ? e.debug = !0 : Ft(n) ? e.download = !0 : Ht(n) && (e.format = n);
169
- return e;
170
- }, Yt = (t) => {
165
+ const Ft = (t) => t === T.DEBUG, Ht = (t) => t === T.DOWNLOAD, Xt = (t) => Object.values(V).includes(t), st = (t) => Object.values(v).includes(t), Yt = (t = []) => {
166
+ const n = {};
167
+ for (const e of t)
168
+ st(e) ? n.size = v[e] : Ft(e) ? n.debug = !0 : Ht(e) ? n.download = !0 : Xt(e) && (n.format = e);
169
+ return n;
170
+ }, Zt = (t) => {
171
171
  if (!t || typeof t != "object")
172
172
  return null;
173
- const e = [];
174
- return t.debug && e.push(P.DEBUG), t.download && e.push(P.DOWNLOAD), t.format && t.format !== $.AUTO && e.push(t.format), t.size && st(t.size) && e.push(t.size), e.length ? e.sort().join(",") : null;
175
- }, Zt = (t) => {
173
+ const n = [];
174
+ return t.debug && n.push(T.DEBUG), t.download && n.push(T.DOWNLOAD), t.format && t.format !== V.AUTO && n.push(t.format), t.size && st(t.size) && n.push(t.size), n.length ? n.sort().join(",") : null;
175
+ }, qt = (t) => {
176
176
  if (j(t)) {
177
- const e = ot(t);
178
- if (e)
177
+ const n = ot(t);
178
+ if (n)
179
179
  return {
180
- fields: e,
180
+ fields: n,
181
181
  options: {}
182
182
  };
183
183
  }
184
- return qt(t);
185
- }, qt = (t) => {
184
+ return Jt(t);
185
+ }, Jt = (t) => {
186
186
  if (!t)
187
187
  return null;
188
- const e = t.trim();
189
- if (!e)
188
+ const n = t.trim();
189
+ if (!n)
190
190
  return null;
191
191
  try {
192
- const n = Kt(e);
193
- if (!n)
192
+ const e = Qt(n);
193
+ if (!e)
194
194
  return null;
195
- const { code: o, optionTokens: c } = n, r = ot(o);
195
+ const { code: o, optionTokens: i } = e, r = ot(o);
196
196
  if (!r)
197
197
  return null;
198
- const s = Xt(c);
198
+ const s = Yt(i);
199
199
  return {
200
200
  fields: r,
201
201
  options: s
202
202
  };
203
- } catch (n) {
204
- n instanceof Error ? console.error(`Error parsing URL: ${n.message}`, n) : console.error("uncaught error", n);
203
+ } catch (e) {
204
+ e instanceof Error ? console.error(`Error parsing URL: ${e.message}`, e) : console.error("uncaught error", e);
205
205
  }
206
206
  return null;
207
- }, Jt = (t, e) => {
208
- const n = Bt(t);
209
- if (n instanceof Error)
207
+ }, Kt = (t, n) => {
208
+ const e = Mt(t);
209
+ if (e instanceof Error)
210
210
  return null;
211
211
  let o = null;
212
- if (e != null && e.endpoint && (o = K(e == null ? void 0 : e.endpoint), !o))
213
- throw new Gt(
212
+ if (n != null && n.endpoint && (o = K(n == null ? void 0 : n.endpoint), !o))
213
+ throw new Wt(
214
214
  "Cannot construct URL: bad endpoint. Ensure endpoint starts with http:// or https://"
215
215
  );
216
216
  o || (o = K(Ot));
217
- const c = [o.origin, "image", n], r = e ? Yt(e) : null;
218
- return r && c.push(r), e != null && e.filename ? c.push(e.filename) : c.push("image.jpg"), c.join("/");
219
- }, Kt = (t) => {
217
+ const i = [o.origin, "image", e], r = n ? Zt(n) : null;
218
+ return r && i.push(r), n != null && n.filename ? i.push(n.filename) : i.push("image.jpg"), i.join("/");
219
+ }, Qt = (t) => {
220
220
  try {
221
- const e = new URL(t), n = zt(e.pathname.split("/"));
222
- if (n[0] !== "image" || ![3, 4].includes(n.length))
221
+ const n = new URL(t), e = Bt(n.pathname.split("/"));
222
+ if (e[0] !== "image" || ![3, 4].includes(e.length))
223
223
  throw new Error("Unrecognized URL");
224
- const o = n[1].trim();
224
+ const o = e[1].trim();
225
225
  if (!o.length || !j(o))
226
226
  throw new Error("URL is not formatted as base64url");
227
- if (n.length === 4) {
228
- const c = n[2].split(",");
227
+ if (e.length === 4) {
228
+ const i = e[2].split(",");
229
229
  return {
230
230
  code: o,
231
- optionTokens: c
231
+ optionTokens: i
232
232
  };
233
233
  }
234
- if (n.length === 3)
234
+ if (e.length === 3)
235
235
  return {
236
236
  code: o,
237
237
  optionTokens: []
@@ -240,249 +240,261 @@ const Wt = (t) => t === P.DEBUG, Ft = (t) => t === P.DOWNLOAD, Ht = (t) => Objec
240
240
  return null;
241
241
  }
242
242
  return null;
243
- }, ct = 0.7, it = 1, N = 24, Qt = y.lg, at = process.env.NODE_ENV, te = at === "development", lt = typeof document > "u", ee = at === "test", ne = lt ? () => {
244
- } : It, re = "<visionary>", S = (t, ...e) => {
245
- !console || typeof console.log != "function" || console.log(`${re} ${t}`, ...e);
246
- }, oe = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~", C = (t, e, n) => {
243
+ }, ct = 0.7, it = 1, S = 24, tn = v.lg, at = process.env.NODE_ENV, nn = at === "development", lt = typeof document > "u", en = at === "test", rn = lt ? () => {
244
+ } : Et, on = "<visionary>", R = (t, ...n) => {
245
+ !console || typeof console.log != "function" || console.log(`${on} ${t}`, ...n);
246
+ }, ut = new Uint8Array(128);
247
+ for (let t = 0; t < 83; t++)
248
+ ut["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~".charCodeAt(
249
+ t
250
+ )] = t;
251
+ const _ = (t, n, e) => {
247
252
  let o = 0;
248
- for (; e < n; )
249
- o *= 83, o += oe.indexOf(t[e++]);
253
+ for (; n < e; )
254
+ o *= 83, o += ut[t.charCodeAt(n++)];
250
255
  return o;
251
- }, ut = Math.pow, _ = Math.PI, se = _ * 2, dt = 3294.6, ft = 269.025, ce = (t) => t > 10.31475 ? ut(t / ft + 0.052132, 2.4) : t / dt, W = (t) => ~~(t > 1227e-8 ? ft * ut(t, 0.416666) - 13.025 : t * dt + 1), D = (t) => (t < 0 ? -1 : 1) * t * t, Q = (t) => {
252
- for (t += _ / 2; t > _; )
253
- t -= se;
254
- const e = 1.27323954 * t - 0.405284735 * D(t);
255
- return 0.225 * (D(e) - e) + e;
256
+ }, ft = Math.pow, C = Math.PI, sn = C * 2, dt = 3294.6, pt = 269.025, cn = (t) => t > 10.31475 ? ft(t / pt + 0.052132, 2.4) : t / dt, W = (t) => ~~(t > 1227e-8 ? pt * ft(t, 0.416666) - 13.025 : t * dt + 1), O = (t) => (t < 0 ? -1 : 1) * t * t, Q = (t) => {
257
+ for (t += C / 2; t > C; )
258
+ t -= sn;
259
+ const n = 1.27323954 * t - 0.405284735 * O(t);
260
+ return 0.225 * (O(n) - n) + n;
256
261
  };
257
- function ie(t) {
258
- const e = C(t, 2, 6);
259
- return [e >> 16, e >> 8 & 255, e & 255];
262
+ function an(t) {
263
+ const n = _(t, 2, 6);
264
+ return [n >> 16, n >> 8 & 255, n & 255];
260
265
  }
261
- function ae(t, e, n, o) {
262
- const c = C(t, 0, 1), r = c % 9 + 1, s = ~~(c / 9) + 1, a = r * s;
263
- let i = 0, d = 0, h = 0, f = 0, m = 0, p = 0, l = 0, v = 0, b = 0, g = 0, w = 0, x = 0, u = 0, E = 0;
264
- const O = (C(t, 1, 2) + 1) / 13446 * (o | 1), I = new Float64Array(a * 3), k = ie(t);
265
- for (i = 0; i < 3; i++)
266
- I[i] = ce(k[i]);
267
- for (i = 1; i < a; i++)
268
- E = C(t, 4 + i * 2, 6 + i * 2), I[i * 3] = D(~~(E / (19 * 19)) - 9) * O, I[i * 3 + 1] = D(~~(E / 19) % 19 - 9) * O, I[i * 3 + 2] = D(E % 19 - 9) * O;
269
- const U = e * 4, R = new Uint8ClampedArray(U * n);
270
- for (f = 0; f < n; f++)
271
- for (x = _ * f / n, h = 0; h < e; h++) {
272
- for (m = 0, p = 0, l = 0, u = _ * h / e, d = 0; d < s; d++)
273
- for (b = Q(x * d), i = 0; i < r; i++)
274
- v = Q(u * i) * b, g = (i + d * r) * 3, m += I[g] * v, p += I[g + 1] * v, l += I[g + 2] * v;
275
- w = 4 * h + f * U, R[w] = W(m), R[w + 1] = W(p), R[w + 2] = W(l), R[w + 3] = 255;
266
+ function ln(t, n, e, o) {
267
+ const i = _(t, 0, 1), r = i % 9 + 1, s = ~~(i / 9) + 1, u = r * s;
268
+ let c = 0, a = 0, p = 0, l = 0, m = 0, h = 0, f = 0, y = 0, b = 0, g = 0, w = 0, E = 0;
269
+ const d = (_(t, 1, 2) + 1) / 13446 * (o | 1), I = new Float64Array(u * 3), k = an(t);
270
+ for (c = 0; c < 3; c++)
271
+ I[c] = cn(k[c]);
272
+ for (c = 1; c < u; c++)
273
+ E = _(t, 4 + c * 2, 6 + c * 2), I[c * 3] = O(~~(E / 361) - 9) * d, I[c * 3 + 1] = O(~~(E / 19) % 19 - 9) * d, I[c * 3 + 2] = O(E % 19 - 9) * d;
274
+ const D = new Float64Array(s * e), P = new Float64Array(r * n);
275
+ for (a = 0; a < s; a++)
276
+ for (l = 0; l < e; l++)
277
+ D[a * e + l] = Q(C * l * a / e);
278
+ for (c = 0; c < r; c++)
279
+ for (p = 0; p < n; p++)
280
+ P[c * n + p] = Q(C * p * c / n);
281
+ const U = n * 4, A = new Uint8ClampedArray(U * e);
282
+ for (l = 0; l < e; l++)
283
+ for (p = 0; p < n; p++) {
284
+ for (m = h = f = 0, a = 0; a < s; a++)
285
+ for (b = D[a * e + l], c = 0; c < r; c++)
286
+ y = P[c * n + p] * b, g = (c + a * r) * 3, m += I[g] * y, h += I[g + 1] * y, f += I[g + 2] * y;
287
+ w = 4 * p + l * U, A[w] = W(m), A[w + 1] = W(h), A[w + 2] = W(f), A[w + 3] = 255;
276
288
  }
277
- return R;
289
+ return A;
278
290
  }
279
- const V = (t) => {
291
+ const L = (t) => {
280
292
  try {
281
293
  return new URL(t);
282
294
  } catch {
283
295
  return null;
284
296
  }
285
- }, le = (t, e) => `rgba(${t.r},${t.g},${t.b},${e})`, F = (t) => te || ee ? {
297
+ }, un = (t, n) => `rgba(${t.r},${t.g},${t.b},${n})`, F = (t) => nn || en ? {
286
298
  "data-testid": t
287
- } : {}, ue = (t, e) => e ? {
299
+ } : {}, fn = (t, n) => n ? {
288
300
  "data-fileid": t
289
- } : {}, tt = (t, e) => Math.min(t, e), de = (t) => {
290
- let e = t.replace(/^#/, "");
291
- if (e.length !== 3 && e.length !== 6)
301
+ } : {}, tt = (t, n) => Math.min(t, n), dn = (t) => {
302
+ let n = t.replace(/^#/, "");
303
+ if (n.length !== 3 && n.length !== 6)
292
304
  return null;
293
- e.length === 3 && (e = `${e[0]}${e[0]}${e[1]}${e[1]}${e[2]}${e[2]}`);
294
- const n = parseInt(e.slice(0, 2), 16), o = parseInt(e.slice(2, 4), 16);
295
- return { b: parseInt(e.slice(4, 6), 16), g: o, r: n };
296
- }, A = (t, e = 0) => {
297
- const n = Math.pow(10, e);
298
- return Math.round(t * n) / n;
299
- }, fe = (t, e) => {
300
- const n = V(t), o = V(e);
301
- return !n || !o ? t : (o.pathname = n.pathname, o.search = n.search, o.toString());
302
- }, pe = (t, e = {}, n = ct, o = it) => {
305
+ n.length === 3 && (n = `${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`);
306
+ const e = parseInt(n.slice(0, 2), 16), o = parseInt(n.slice(2, 4), 16);
307
+ return { b: parseInt(n.slice(4, 6), 16), g: o, r: e };
308
+ }, x = (t, n = 0) => {
309
+ const e = Math.pow(10, n);
310
+ return Math.round(t * e) / e;
311
+ }, pn = (t, n) => {
312
+ const e = L(t), o = L(n);
313
+ return !e || !o ? t : (o.pathname = e.pathname, o.search = e.search, o.toString());
314
+ }, hn = (t, n = {}, e = ct, o = it) => {
303
315
  if (!t)
304
316
  return null;
305
317
  try {
306
- e.debug && S("input imageSrc:", t);
307
- const c = Zt(t);
308
- if (e.debug && S("Visionary URL data: ", c), !c)
318
+ n.debug && R("input imageSrc:", t);
319
+ const i = qt(t);
320
+ if (n.debug && R("Visionary URL data: ", i), !i)
309
321
  throw new Error("Could not parse Visionary URL");
310
- const { fields: r, options: s } = c;
322
+ const { fields: r, options: s } = i;
311
323
  if (r.sourceWidth < 1 || r.sourceHeight < 1)
312
324
  throw new Error("Invalid image dimensions");
313
- const a = r.sourceWidth / r.sourceHeight, i = (e == null ? void 0 : e.size) ?? s.size ?? Qt, d = Z[i];
314
- let h = 0, f = 0, m = 0;
315
- if (a >= 1) {
316
- f = h = tt(d, r.sourceWidth);
317
- const g = A(f / a);
318
- m = A(f / g, 6);
325
+ const u = r.sourceWidth / r.sourceHeight, c = (n == null ? void 0 : n.size) ?? s.size ?? tn, a = Z[c];
326
+ let p = 0, l = 0, m = 0;
327
+ if (u >= 1) {
328
+ l = p = tt(a, r.sourceWidth);
329
+ const g = x(l / u);
330
+ m = x(l / g, 6);
319
331
  } else
320
- h = tt(d, r.sourceHeight), f = A(h * a), m = A(f / h, 6);
321
- const p = A(100 / m, 6), l = {
332
+ p = tt(a, r.sourceHeight), l = x(p * u), m = x(l / p, 6);
333
+ const h = x(100 / m, 6), f = {
322
334
  ...r,
323
- arPaddingTop: `${p}%`,
335
+ arPaddingTop: `${h}%`,
324
336
  aspectRatio: m,
325
- maxWidth: f,
337
+ maxWidth: l,
326
338
  src: t
327
- }, v = V(r.url);
328
- if (v)
329
- l.src = v.toString();
330
- else if (!V(t) && j(r.url)) {
331
- const g = Jt(r, {
332
- endpoint: e.endpoint,
333
- size: i
339
+ }, y = L(r.url);
340
+ if (y)
341
+ f.src = y.toString();
342
+ else if (!L(t) && j(r.url)) {
343
+ const g = Kt(r, {
344
+ endpoint: n.endpoint,
345
+ size: c
334
346
  });
335
- g && (l.src = g);
347
+ g && (f.src = g);
336
348
  }
337
- e.endpoint && (l.src = fe(l.src, e.endpoint));
338
- const b = r.bcc ? de(r.bcc) : null;
339
- if (b && (l.backgroundColor = le(b, n)), !lt && r.blurhash && !e.disableBlurLayer) {
340
- const g = performance.now(), w = ae(r.blurhash, N, N, o), x = performance.now() - g;
341
- e.debug && S(`Blurhash decode time: ${A(x, 1)} ms`), w && (l.pixels = w);
349
+ n.endpoint && (f.src = pn(f.src, n.endpoint));
350
+ const b = r.bcc ? dn(r.bcc) : null;
351
+ if (b && (f.backgroundColor = un(b, e)), !lt && r.blurhash && !n.disableBlurLayer) {
352
+ const g = performance.now(), w = ln(r.blurhash, S, S, o), E = performance.now() - g;
353
+ n.debug && R(`Blurhash decode time: ${x(E, 1)} ms`), w && (f.pixels = w);
342
354
  }
343
- return e.debug && S("Visionary Image state: ", l), l;
355
+ return n.debug && R("Visionary Image state: ", f), f;
344
356
  } catch {
345
357
  return null;
346
358
  }
347
- }, pt = {
359
+ }, ht = {
348
360
  bottom: 0,
349
361
  left: 0,
350
362
  position: "absolute",
351
363
  right: 0,
352
364
  top: 0
353
- }, he = {
354
- ...pt,
365
+ }, mn = {
366
+ ...ht,
355
367
  maxHeight: "100%",
356
368
  maxWidth: "100%"
357
- }, me = {
358
- ...pt,
369
+ }, gn = {
370
+ ...ht,
359
371
  height: "100%",
360
372
  width: "100%"
361
- }, ge = (t) => {
362
- const e = {
363
- ...he
373
+ }, bn = (t) => {
374
+ const n = {
375
+ ...mn
364
376
  };
365
- return t && (e.display = "none"), e;
377
+ return t && (n.display = "none"), n;
366
378
  }, H = {
367
379
  CANVAS: "canvas",
368
380
  CONTAINER: "container",
369
381
  IMAGE: "image"
370
- }, be = "v7y_7587", ve = "v7y_b8c0", ye = "v7y_e0dd", X = {
371
- container: be,
372
- preventDrag: ve,
373
- preventSelection: ye
374
- }, Re = ({
382
+ }, yn = "v7y_7587", vn = "v7y_b8c0", wn = "v7y_e0dd", X = {
383
+ container: yn,
384
+ preventDrag: vn,
385
+ preventSelection: wn
386
+ }, Rn = ({
375
387
  alt: t,
376
- bgColorAlpha: e = ct,
377
- className: n,
388
+ bgColorAlpha: n = ct,
389
+ className: e,
378
390
  debug: o = !1,
379
- disableBlurLayer: c = !1,
391
+ disableBlurLayer: i = !1,
380
392
  disableImageLayer: r = !1,
381
393
  endpoint: s,
382
- height: a,
383
- hideImageLayer: i = !1,
384
- lazy: d = !0,
385
- onClick: h,
386
- onError: f,
394
+ height: u,
395
+ hideImageLayer: c = !1,
396
+ lazy: a = !0,
397
+ onClick: p,
398
+ onError: l,
387
399
  onLoad: m,
388
- preventDrag: p = !1,
389
- preventSelection: l = !1,
390
- punch: v = it,
400
+ preventDrag: h = !1,
401
+ preventSelection: f = !1,
402
+ punch: y = it,
391
403
  size: b,
392
404
  src: g,
393
405
  style: w,
394
- width: x
406
+ width: E
395
407
  }) => {
396
- const u = xt(() => pe(g, {
408
+ const d = At(() => hn(g, {
397
409
  debug: o,
398
- disableBlurLayer: c,
410
+ disableBlurLayer: i,
399
411
  endpoint: s,
400
412
  size: b
401
- }, e, v), [e, o, c, s, v, b, g]), E = Y(null), [O, I] = Nt();
402
- ne(
413
+ }, n, y), [n, o, i, s, y, b, g]), I = Y(null), [k, D] = Nt();
414
+ rn(
403
415
  function() {
404
- if (!E.current || !(u != null && u.blurhash))
416
+ if (!I.current || !(d != null && d.blurhash))
405
417
  return;
406
- if (!u.pixels) {
418
+ if (!d.pixels) {
407
419
  console.warn("No pixel data passed in, skipping");
408
420
  return;
409
421
  }
410
- const gt = performance.now(), B = E.current.getContext("2d");
422
+ const bt = performance.now(), B = I.current.getContext("2d");
411
423
  if (!B) {
412
424
  console.warn("Cannot access canvasRenderingContext, skipping");
413
425
  return;
414
426
  }
415
- const M = B.createImageData(N, N);
427
+ const M = B.createImageData(S, S);
416
428
  if (!M) {
417
429
  console.warn("Could not create ImageData on CanvasRenderingContext");
418
430
  return;
419
431
  }
420
- if (M.data.set(u.pixels), B.putImageData(M, 0, 0), o) {
421
- const bt = performance.now() - gt;
422
- S(`Canvas render time: ${A(bt, 1)} ms`);
432
+ if (M.data.set(d.pixels), B.putImageData(M, 0, 0), o) {
433
+ const yt = performance.now() - bt;
434
+ R(`Canvas render time: ${x(yt, 1)} ms`);
423
435
  }
424
436
  },
425
- [u == null ? void 0 : u.blurhash, u == null ? void 0 : u.pixels, o]
437
+ [d == null ? void 0 : d.blurhash, d == null ? void 0 : d.pixels, o]
426
438
  );
427
- const k = q(
428
- (T) => {
429
- o && S("Image load error ", T), f && f();
439
+ const P = q(
440
+ (N) => {
441
+ o && R("Image load error ", N), l && l();
430
442
  },
431
- [o, f]
443
+ [o, l]
432
444
  ), U = {
433
445
  alt: t,
434
- loading: !d || I ? "eager" : "lazy",
446
+ loading: !a || D ? "eager" : "lazy",
435
447
  onLoad: m
436
448
  };
437
- if (!u) {
438
- o && S("Not a Visionary URL, rendering fallback <img />");
439
- const T = {
449
+ if (!d) {
450
+ o && R("Not a Visionary URL, rendering fallback <img />");
451
+ const N = {
440
452
  ...U,
441
- className: n,
442
- height: a,
443
- onClick: h,
444
- onError: f,
453
+ className: e,
454
+ height: u,
455
+ onClick: p,
456
+ onError: l,
445
457
  src: g,
446
458
  style: w,
447
- width: x
459
+ width: E
448
460
  };
449
- return /* @__PURE__ */ G("img", { ...T });
461
+ return /* @__PURE__ */ G("img", { ...N });
450
462
  }
451
- const R = At(X.container, n, {
452
- [X.preventDrag]: !!p,
453
- [X.preventSelection]: !!l
463
+ const A = St(X.container, e, {
464
+ [X.preventDrag]: !!h,
465
+ [X.preventSelection]: !!f
454
466
  }), z = {
455
467
  ...{
456
- "--v-ar": u.arPaddingTop
468
+ "--v-ar": d.arPaddingTop
457
469
  },
458
- aspectRatio: u.aspectRatio,
459
- backgroundColor: (u == null ? void 0 : u.backgroundColor) ?? void 0,
460
- maxWidth: u.maxWidth,
470
+ aspectRatio: d.aspectRatio,
471
+ backgroundColor: (d == null ? void 0 : d.backgroundColor) ?? void 0,
472
+ maxWidth: d.maxWidth,
461
473
  position: "relative",
462
474
  width: "100%",
463
475
  ...w
464
476
  };
465
- x && (z.width = x), a && (z.height = a);
466
- const ht = {
467
- onClick: h
468
- }, mt = ge(i);
477
+ E && (z.width = E), u && (z.height = u);
478
+ const mt = {
479
+ onClick: p
480
+ }, gt = bn(c);
469
481
  return /* @__PURE__ */ vt(
470
482
  "div",
471
483
  {
472
- className: R,
473
- ref: O,
484
+ className: A,
485
+ ref: k,
474
486
  style: z,
475
- ...ue(u.url, o),
487
+ ...fn(d.url, o),
476
488
  ...F(H.CONTAINER),
477
- ...ht,
489
+ ...mt,
478
490
  children: [
479
- !c && /* @__PURE__ */ G(
491
+ !i && /* @__PURE__ */ G(
480
492
  "canvas",
481
493
  {
482
- height: N,
483
- ref: E,
484
- style: me,
485
- width: N,
494
+ height: S,
495
+ ref: I,
496
+ style: gn,
497
+ width: S,
486
498
  ...F(H.CANVAS)
487
499
  }
488
500
  ),
@@ -492,9 +504,9 @@ const V = (t) => {
492
504
  {
493
505
  ...U,
494
506
  ...F(H.IMAGE),
495
- onError: k,
496
- src: u.src,
497
- style: mt
507
+ onError: P,
508
+ src: d.src,
509
+ style: gt
498
510
  }
499
511
  )
500
512
  ]
@@ -502,5 +514,5 @@ const V = (t) => {
502
514
  );
503
515
  };
504
516
  export {
505
- Re as Image
517
+ Rn as Image
506
518
  };
@@ -1,6 +1,6 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.id="v7y-styles",e.appendChild(document.createTextNode('.v7y_7587:before{content:"";display:block;padding-top:var(--v-ar)}.v7y_b8c0{-webkit-user-drag:none;pointer-events:none}.v7y_e0dd{-webkit-user-select:none;user-select:none}')),document.head.appendChild(e)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
2
- (function(E,R){typeof exports=="object"&&typeof module<"u"?R(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],R):(E=typeof globalThis<"u"?globalThis:E||self,R(E.VisionaryImage={},E.jsxRuntime,E.React))})(this,function(E,R,I){"use strict";function ht(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var K={exports:{}};/*!
2
+ (function(A,R){typeof exports=="object"&&typeof module<"u"?R(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],R):(A=typeof globalThis<"u"?globalThis:A||self,R(A.VisionaryImage={},A.jsxRuntime,A.React))})(this,function(A,R,x){"use strict";function me(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var K={exports:{}};/*!
3
3
  Copyright (c) 2018 Jed Watson.
4
4
  Licensed under the MIT License (MIT), see
5
5
  http://jedwatson.github.io/classnames
6
- */(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var r="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(r=i(r,o(a)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var s="";for(var a in r)e.call(r,a)&&r[a]&&(s=i(s,a));return s}function i(r,s){return s?r?r+" "+s:r+s:r}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(K);var gt=K.exports;const mt=ht(gt),bt=(t,{root:e,rootMargin:n,threshold:o}={},i=[])=>{const r=I.useRef(null),s=I.useRef(null);return I.useCallback(c=>{r.current&&s.current&&(s.current.unobserve(r.current),s.current.disconnect(),s.current=null),c&&(s.current=new IntersectionObserver(t,{root:e,rootMargin:n,threshold:o}),s.current.observe(c),r.current=c)},[r,e,n,JSON.stringify(o),...i])},yt=({root:t,rootMargin:e,threshold:n,unobserveOnEnter:o,target:i,onEnter:r,onLeave:s,defaultInView:a}={},c=[])=>{const[d,h]=I.useState({inView:a||!1,entry:null,observer:null}),f=I.useCallback(([p],l)=>{const b=l.thresholds.some(m=>p.intersectionRatio>=m)&&p.isIntersecting;h({inView:b,entry:p,observer:l}),b&&o&&(l.unobserve(p.target),l.disconnect()),b?r==null||r(p,l):s==null||s(p,l)},[r,s,o]),g=bt(f,{root:t,rootMargin:e,threshold:n},[o,...c]);return I.useEffect(()=>{i!=null&&i.current&&g(i.current)},[i,g]),[g,d.inView,d.entry,d.observer]};var $=(t=>(t.AUTO="auto",t.AVIF="avif",t.JPEG="jpeg",t.WEBP="webp",t))($||{}),v=(t=>(t.xs="xs",t.sm="sm",t.md="md",t.lg="lg",t.xl="xl",t.xxl="xxl",t["4k"]="4k",t["5k"]="5k",t.full="full",t))(v||{}),C=(t=>(t.DEBUG="debug",t.DOWNLOAD="download",t))(C||{});const vt="https://link.visionary.cloud";$.AUTO,v.lg;const M={[v.xs]:160,[v.sm]:320,[v.md]:640,[v.lg]:1280,[v.xl]:1920,[v.xxl]:2560,[v["4k"]]:3840,[v["5k"]]:5120,[v.full]:0};Object.keys(M).reduce((t,e)=>{const n=e,o=M[n];return o&&(t[o]=n),t},{});const Q="!";var wt=Object.defineProperty,It=(t,e,n)=>e in t?wt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,xt=(t,e,n)=>It(t,typeof e!="symbol"?e+"":e,n),G={},L={};Object.defineProperty(L,"__esModule",{value:!0});function Et(t){return String.fromCharCode(parseInt(t.slice(1),16))}function Rt(t){return btoa(encodeURIComponent(t).replace(/%[0-9A-F]{2}/g,Et))}L.encode=Rt;function At(t){return`%${`00${t.charCodeAt(0).toString(16)}`.slice(-2)}`}function St(t){return decodeURIComponent(Array.from(atob(t),At).join(""))}L.decode=St,Object.defineProperty(G,"__esModule",{value:!0});const tt=L;function Tt(t){return tt.decode(t.replace(/\-/g,"+").replace(/_/g,"/"))}var Ot=G.decode=Tt;function Nt(t){return tt.encode(t).replace(/\//g,"_").replace(/\+/g,"-").replace(/=+$/,"")}var Ut=G.encode=Nt;const Ct=t=>t.filter(Boolean),et=t=>{try{return new URL(t)}catch{return null}},k=(t="")=>/^[A-Za-z0-9_-]*$/.test(t),Dt=t=>{const{altText:e,bcc:n,blurhash:o,blurhashX:i,blurhashY:r,sourceHeight:s,sourceWidth:a,url:c}=t;if(!c||!a||!s)return new Error("Cannot construct visionary code: missing required url/width/height");const d=[c,a,s];return!n||(d.push(n),!o||!i||!r)||(d.push(o,i,r),e&&e.length&&d.push(e)),Pt(d)},Pt=t=>Ut(t.join(Q)),nt=t=>{if(typeof t!="string")return null;const e=t.trim();if(!e.length||!k(e))return null;const n=Ot(e);if(!n)return null;const o=n.split(Q);if(o.length<3)return null;const[i,r,s,a,c,d,h,f]=o,g=i.trim();if(!g.length)return console.error("Cannot parse code, empty file id"),null;const p=Number(r.trim()),l=Number(s.trim());if(isNaN(p)||isNaN(l)||!p||!l)return console.error("Cannot parse Visionary Code: invalid image dimensions",r,s),null;const y=Number(d)??0,b=Number(h)??0;return y<1||b<1?(console.error("Cannot parse Visionary Code: invalid blurhash x, y component dimensions",y,b),null):{altText:f,bcc:a,blurhash:c,blurhashX:y,blurhashY:b,sourceHeight:l,sourceWidth:p,url:g}};class _t extends Error{constructor(){super(...arguments),xt(this,"message","invalid endpoint URL (does it contain http/https?)")}}const jt=t=>t===C.DEBUG,Vt=t=>t===C.DOWNLOAD,$t=t=>Object.values($).includes(t),rt=t=>Object.values(v).includes(t),Lt=(t=[])=>{const e={};for(const n of t)rt(n)?e.size=v[n]:jt(n)?e.debug=!0:Vt(n)?e.download=!0:$t(n)&&(e.format=n);return e},kt=t=>{if(!t||typeof t!="object")return null;const e=[];return t.debug&&e.push(C.DEBUG),t.download&&e.push(C.DOWNLOAD),t.format&&t.format!==$.AUTO&&e.push(t.format),t.size&&rt(t.size)&&e.push(t.size),e.length?e.sort().join(","):null},zt=t=>{if(k(t)){const e=nt(t);if(e)return{fields:e,options:{}}}return Bt(t)},Bt=t=>{if(!t)return null;const e=t.trim();if(!e)return null;try{const n=Gt(e);if(!n)return null;const{code:o,optionTokens:i}=n,r=nt(o);if(!r)return null;const s=Lt(i);return{fields:r,options:s}}catch(n){n instanceof Error?console.error(`Error parsing URL: ${n.message}`,n):console.error("uncaught error",n)}return null},Mt=(t,e)=>{const n=Dt(t);if(n instanceof Error)return null;let o=null;if(e!=null&&e.endpoint&&(o=et(e==null?void 0:e.endpoint),!o))throw new _t("Cannot construct URL: bad endpoint. Ensure endpoint starts with http:// or https://");o||(o=et(vt));const i=[o.origin,"image",n],r=e?kt(e):null;return r&&i.push(r),e!=null&&e.filename?i.push(e.filename):i.push("image.jpg"),i.join("/")},Gt=t=>{try{const e=new URL(t),n=Ct(e.pathname.split("/"));if(n[0]!=="image"||![3,4].includes(n.length))throw new Error("Unrecognized URL");const o=n[1].trim();if(!o.length||!k(o))throw new Error("URL is not formatted as base64url");if(n.length===4){const i=n[2].split(",");return{code:o,optionTokens:i}}if(n.length===3)return{code:o,optionTokens:[]}}catch{return null}return null},ot=.7,st=1,U=24,Wt=v.lg,it=process.env.NODE_ENV,Ft=it==="development",ct=typeof document>"u",Ht=it==="test",qt=ct?()=>{}:I.useLayoutEffect,Xt="<visionary>",T=(t,...e)=>{!console||typeof console.log!="function"||console.log(`${Xt} ${t}`,...e)},Yt="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~",z=(t,e,n)=>{let o=0;for(;e<n;)o*=83,o+=Yt.indexOf(t[e++]);return o},at=Math.pow,D=Math.PI,Zt=D*2,lt=3294.6,ut=269.025,Jt=t=>t>10.31475?at(t/ut+.052132,2.4):t/lt,W=t=>~~(t>1227e-8?ut*at(t,.416666)-13.025:t*lt+1),P=t=>(t<0?-1:1)*t*t,dt=t=>{for(t+=D/2;t>D;)t-=Zt;const e=1.27323954*t-.405284735*P(t);return .225*(P(e)-e)+e};function Kt(t){const e=z(t,2,6);return[e>>16,e>>8&255,e&255]}function Qt(t,e,n,o){const i=z(t,0,1),r=i%9+1,s=~~(i/9)+1,a=r*s;let c=0,d=0,h=0,f=0,g=0,p=0,l=0,y=0,b=0,m=0,w=0,A=0,u=0,S=0;const _=(z(t,1,2)+1)/13446*(o|1),x=new Float64Array(a*3),X=Kt(t);for(c=0;c<3;c++)x[c]=Jt(X[c]);for(c=1;c<a;c++)S=z(t,4+c*2,6+c*2),x[c*3]=P(~~(S/(19*19))-9)*_,x[c*3+1]=P(~~(S/19)%19-9)*_,x[c*3+2]=P(S%19-9)*_;const j=e*4,N=new Uint8ClampedArray(j*n);for(f=0;f<n;f++)for(A=D*f/n,h=0;h<e;h++){for(g=0,p=0,l=0,u=D*h/e,d=0;d<s;d++)for(b=dt(A*d),c=0;c<r;c++)y=dt(u*c)*b,m=(c+d*r)*3,g+=x[m]*y,p+=x[m+1]*y,l+=x[m+2]*y;w=4*h+f*j,N[w]=W(g),N[w+1]=W(p),N[w+2]=W(l),N[w+3]=255}return N}const B=t=>{try{return new URL(t)}catch{return null}},te=(t,e)=>`rgba(${t.r},${t.g},${t.b},${e})`,F=t=>Ft||Ht?{"data-testid":t}:{},ee=(t,e)=>e?{"data-fileid":t}:{},ft=(t,e)=>Math.min(t,e),ne=t=>{let e=t.replace(/^#/,"");if(e.length!==3&&e.length!==6)return null;e.length===3&&(e=`${e[0]}${e[0]}${e[1]}${e[1]}${e[2]}${e[2]}`);const n=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16);return{b:parseInt(e.slice(4,6),16),g:o,r:n}},O=(t,e=0)=>{const n=Math.pow(10,e);return Math.round(t*n)/n},re=(t,e)=>{const n=B(t),o=B(e);return!n||!o?t:(o.pathname=n.pathname,o.search=n.search,o.toString())},oe=(t,e={},n=ot,o=st)=>{if(!t)return null;try{e.debug&&T("input imageSrc:",t);const i=zt(t);if(e.debug&&T("Visionary URL data: ",i),!i)throw new Error("Could not parse Visionary URL");const{fields:r,options:s}=i;if(r.sourceWidth<1||r.sourceHeight<1)throw new Error("Invalid image dimensions");const a=r.sourceWidth/r.sourceHeight,c=(e==null?void 0:e.size)??s.size??Wt,d=M[c];let h=0,f=0,g=0;if(a>=1){f=h=ft(d,r.sourceWidth);const m=O(f/a);g=O(f/m,6)}else h=ft(d,r.sourceHeight),f=O(h*a),g=O(f/h,6);const p=O(100/g,6),l={...r,arPaddingTop:`${p}%`,aspectRatio:g,maxWidth:f,src:t},y=B(r.url);if(y)l.src=y.toString();else if(!B(t)&&k(r.url)){const m=Mt(r,{endpoint:e.endpoint,size:c});m&&(l.src=m)}e.endpoint&&(l.src=re(l.src,e.endpoint));const b=r.bcc?ne(r.bcc):null;if(b&&(l.backgroundColor=te(b,n)),!ct&&r.blurhash&&!e.disableBlurLayer){const m=performance.now(),w=Qt(r.blurhash,U,U,o),A=performance.now()-m;e.debug&&T(`Blurhash decode time: ${O(A,1)} ms`),w&&(l.pixels=w)}return e.debug&&T("Visionary Image state: ",l),l}catch{return null}},pt={bottom:0,left:0,position:"absolute",right:0,top:0},se={...pt,maxHeight:"100%",maxWidth:"100%"},ie={...pt,height:"100%",width:"100%"},ce=t=>{const e={...se};return t&&(e.display="none"),e},H={CANVAS:"canvas",CONTAINER:"container",IMAGE:"image"},q={container:"v7y_7587",preventDrag:"v7y_b8c0",preventSelection:"v7y_e0dd"},ae=({alt:t,bgColorAlpha:e=ot,className:n,debug:o=!1,disableBlurLayer:i=!1,disableImageLayer:r=!1,endpoint:s,height:a,hideImageLayer:c=!1,lazy:d=!0,onClick:h,onError:f,onLoad:g,preventDrag:p=!1,preventSelection:l=!1,punch:y=st,size:b,src:m,style:w,width:A})=>{const u=I.useMemo(()=>oe(m,{debug:o,disableBlurLayer:i,endpoint:s,size:b},e,y),[e,o,i,s,y,b,m]),S=I.useRef(null),[_,x]=yt();qt(function(){if(!S.current||!(u!=null&&u.blurhash))return;if(!u.pixels){console.warn("No pixel data passed in, skipping");return}const de=performance.now(),Z=S.current.getContext("2d");if(!Z){console.warn("Cannot access canvasRenderingContext, skipping");return}const J=Z.createImageData(U,U);if(!J){console.warn("Could not create ImageData on CanvasRenderingContext");return}if(J.data.set(u.pixels),Z.putImageData(J,0,0),o){const fe=performance.now()-de;T(`Canvas render time: ${O(fe,1)} ms`)}},[u==null?void 0:u.blurhash,u==null?void 0:u.pixels,o]);const X=I.useCallback(V=>{o&&T("Image load error ",V),f&&f()},[o,f]),j={alt:t,loading:!d||x?"eager":"lazy",onLoad:g};if(!u){o&&T("Not a Visionary URL, rendering fallback <img />");const V={...j,className:n,height:a,onClick:h,onError:f,src:m,style:w,width:A};return R.jsx("img",{...V})}const N=mt(q.container,n,{[q.preventDrag]:!!p,[q.preventSelection]:!!l}),Y={...{"--v-ar":u.arPaddingTop},aspectRatio:u.aspectRatio,backgroundColor:(u==null?void 0:u.backgroundColor)??void 0,maxWidth:u.maxWidth,position:"relative",width:"100%",...w};A&&(Y.width=A),a&&(Y.height=a);const le={onClick:h},ue=ce(c);return R.jsxs("div",{className:N,ref:_,style:Y,...ee(u.url,o),...F(H.CONTAINER),...le,children:[!i&&R.jsx("canvas",{height:U,ref:S,style:ie,width:U,...F(H.CANVAS)}),!r&&R.jsx("img",{...j,...F(H.IMAGE),onError:X,src:u.src,style:ue})]})};E.Image=ae,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
6
+ */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r="",s=0;s<arguments.length;s++){var u=arguments[s];u&&(r=i(r,o(u)))}return r}function o(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var s="";for(var u in r)t.call(r,u)&&r[u]&&(s=i(s,u));return s}function i(r,s){return s?r?r+" "+s:r+s:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(K);var ge=K.exports;const be=me(ge),ye=(e,{root:t,rootMargin:n,threshold:o}={},i=[])=>{const r=x.useRef(null),s=x.useRef(null);return x.useCallback(c=>{r.current&&s.current&&(s.current.unobserve(r.current),s.current.disconnect(),s.current=null),c&&(s.current=new IntersectionObserver(e,{root:t,rootMargin:n,threshold:o}),s.current.observe(c),r.current=c)},[r,t,n,JSON.stringify(o),...i])},ve=({root:e,rootMargin:t,threshold:n,unobserveOnEnter:o,target:i,onEnter:r,onLeave:s,defaultInView:u}={},c=[])=>{const[a,p]=x.useState({inView:u||!1,entry:null,observer:null}),l=x.useCallback(([h],f)=>{const b=f.thresholds.some(g=>h.intersectionRatio>=g)&&h.isIntersecting;p({inView:b,entry:h,observer:f}),b&&o&&(f.unobserve(h.target),f.disconnect()),b?r==null||r(h,f):s==null||s(h,f)},[r,s,o]),m=ye(l,{root:e,rootMargin:t,threshold:n},[o,...c]);return x.useEffect(()=>{i!=null&&i.current&&m(i.current)},[i,m]),[m,a.inView,a.entry,a.observer]};var j=(e=>(e.AUTO="auto",e.AVIF="avif",e.JPEG="jpeg",e.WEBP="webp",e))(j||{}),v=(e=>(e.xs="xs",e.sm="sm",e.md="md",e.lg="lg",e.xl="xl",e.xxl="xxl",e["4k"]="4k",e["5k"]="5k",e.full="full",e))(v||{}),O=(e=>(e.DEBUG="debug",e.DOWNLOAD="download",e))(O||{});const we="https://link.visionary.cloud";j.AUTO,v.lg;const M={[v.xs]:160,[v.sm]:320,[v.md]:640,[v.lg]:1280,[v.xl]:1920,[v.xxl]:2560,[v["4k"]]:3840,[v["5k"]]:5120,[v.full]:0};Object.keys(M).reduce((e,t)=>{const n=t,o=M[n];return o&&(e[o]=n),e},{});const Q="!";var Ie=Object.defineProperty,xe=(e,t,n)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ee=(e,t,n)=>xe(e,typeof t!="symbol"?t+"":t,n),G={},V={};Object.defineProperty(V,"__esModule",{value:!0});function Ae(e){return String.fromCharCode(parseInt(e.slice(1),16))}function Re(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,Ae))}V.encode=Re;function Se(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function Te(e){return decodeURIComponent(Array.from(atob(e),Se).join(""))}V.decode=Te,Object.defineProperty(G,"__esModule",{value:!0});const ee=V;function Ue(e){return ee.decode(e.replace(/\-/g,"+").replace(/_/g,"/"))}var Ne=G.decode=Ue;function Oe(e){return ee.encode(e).replace(/\//g,"_").replace(/\+/g,"-").replace(/=+$/,"")}var Ce=G.encode=Oe;const De=e=>e.filter(Boolean),te=e=>{try{return new URL(e)}catch{return null}},L=(e="")=>/^[A-Za-z0-9_-]*$/.test(e),Pe=e=>{const{altText:t,bcc:n,blurhash:o,blurhashX:i,blurhashY:r,sourceHeight:s,sourceWidth:u,url:c}=e;if(!c||!u||!s)return new Error("Cannot construct visionary code: missing required url/width/height");const a=[c,u,s];return!n||(a.push(n),!o||!i||!r)||(a.push(o,i,r),t&&t.length&&a.push(t)),_e(a)},_e=e=>Ce(e.join(Q)),ne=e=>{if(typeof e!="string")return null;const t=e.trim();if(!t.length||!L(t))return null;const n=Ne(t);if(!n)return null;const o=n.split(Q);if(o.length<3)return null;const[i,r,s,u,c,a,p,l]=o,m=i.trim();if(!m.length)return console.error("Cannot parse code, empty file id"),null;const h=Number(r.trim()),f=Number(s.trim());if(isNaN(h)||isNaN(f)||!h||!f)return console.error("Cannot parse Visionary Code: invalid image dimensions",r,s),null;const y=Number(a)??0,b=Number(p)??0;return y<1||b<1?(console.error("Cannot parse Visionary Code: invalid blurhash x, y component dimensions",y,b),null):{altText:l,bcc:u,blurhash:c,blurhashX:y,blurhashY:b,sourceHeight:f,sourceWidth:h,url:m}};class je extends Error{constructor(){super(...arguments),Ee(this,"message","invalid endpoint URL (does it contain http/https?)")}}const Ve=e=>e===O.DEBUG,Le=e=>e===O.DOWNLOAD,$e=e=>Object.values(j).includes(e),re=e=>Object.values(v).includes(e),ke=(e=[])=>{const t={};for(const n of e)re(n)?t.size=v[n]:Ve(n)?t.debug=!0:Le(n)?t.download=!0:$e(n)&&(t.format=n);return t},ze=e=>{if(!e||typeof e!="object")return null;const t=[];return e.debug&&t.push(O.DEBUG),e.download&&t.push(O.DOWNLOAD),e.format&&e.format!==j.AUTO&&t.push(e.format),e.size&&re(e.size)&&t.push(e.size),t.length?t.sort().join(","):null},Be=e=>{if(L(e)){const t=ne(e);if(t)return{fields:t,options:{}}}return Me(e)},Me=e=>{if(!e)return null;const t=e.trim();if(!t)return null;try{const n=We(t);if(!n)return null;const{code:o,optionTokens:i}=n,r=ne(o);if(!r)return null;const s=ke(i);return{fields:r,options:s}}catch(n){n instanceof Error?console.error(`Error parsing URL: ${n.message}`,n):console.error("uncaught error",n)}return null},Ge=(e,t)=>{const n=Pe(e);if(n instanceof Error)return null;let o=null;if(t!=null&&t.endpoint&&(o=te(t==null?void 0:t.endpoint),!o))throw new je("Cannot construct URL: bad endpoint. Ensure endpoint starts with http:// or https://");o||(o=te(we));const i=[o.origin,"image",n],r=t?ze(t):null;return r&&i.push(r),t!=null&&t.filename?i.push(t.filename):i.push("image.jpg"),i.join("/")},We=e=>{try{const t=new URL(e),n=De(t.pathname.split("/"));if(n[0]!=="image"||![3,4].includes(n.length))throw new Error("Unrecognized URL");const o=n[1].trim();if(!o.length||!L(o))throw new Error("URL is not formatted as base64url");if(n.length===4){const i=n[2].split(",");return{code:o,optionTokens:i}}if(n.length===3)return{code:o,optionTokens:[]}}catch{return null}return null},oe=.7,se=1,N=24,Fe=v.lg,ce=process.env.NODE_ENV,He=ce==="development",ie=typeof document>"u",Xe=ce==="test",Ye=ie?()=>{}:x.useLayoutEffect,qe="<visionary>",S=(e,...t)=>{!console||typeof console.log!="function"||console.log(`${qe} ${e}`,...t)},ae=new Uint8Array(128);for(let e=0;e<83;e++)ae["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~".charCodeAt(e)]=e;const $=(e,t,n)=>{let o=0;for(;t<n;)o*=83,o+=ae[e.charCodeAt(t++)];return o},le=Math.pow,C=Math.PI,Ze=C*2,ue=3294.6,fe=269.025,Je=e=>e>10.31475?le(e/fe+.052132,2.4):e/ue,W=e=>~~(e>1227e-8?fe*le(e,.416666)-13.025:e*ue+1),D=e=>(e<0?-1:1)*e*e,de=e=>{for(e+=C/2;e>C;)e-=Ze;const t=1.27323954*e-.405284735*D(e);return .225*(D(t)-t)+t};function Ke(e){const t=$(e,2,6);return[t>>16,t>>8&255,t&255]}function Qe(e,t,n,o){const i=$(e,0,1),r=i%9+1,s=~~(i/9)+1,u=r*s;let c=0,a=0,p=0,l=0,m=0,h=0,f=0,y=0,b=0,g=0,w=0,E=0;const d=($(e,1,2)+1)/13446*(o|1),I=new Float64Array(u*3),Y=Ke(e);for(c=0;c<3;c++)I[c]=Je(Y[c]);for(c=1;c<u;c++)E=$(e,4+c*2,6+c*2),I[c*3]=D(~~(E/361)-9)*d,I[c*3+1]=D(~~(E/19)%19-9)*d,I[c*3+2]=D(E%19-9)*d;const z=new Float64Array(s*n),B=new Float64Array(r*t);for(a=0;a<s;a++)for(l=0;l<n;l++)z[a*n+l]=de(C*l*a/n);for(c=0;c<r;c++)for(p=0;p<t;p++)B[c*t+p]=de(C*p*c/t);const P=t*4,U=new Uint8ClampedArray(P*n);for(l=0;l<n;l++)for(p=0;p<t;p++){for(m=h=f=0,a=0;a<s;a++)for(b=z[a*n+l],c=0;c<r;c++)y=B[c*t+p]*b,g=(c+a*r)*3,m+=I[g]*y,h+=I[g+1]*y,f+=I[g+2]*y;w=4*p+l*P,U[w]=W(m),U[w+1]=W(h),U[w+2]=W(f),U[w+3]=255}return U}const k=e=>{try{return new URL(e)}catch{return null}},et=(e,t)=>`rgba(${e.r},${e.g},${e.b},${t})`,F=e=>He||Xe?{"data-testid":e}:{},tt=(e,t)=>t?{"data-fileid":e}:{},pe=(e,t)=>Math.min(e,t),nt=e=>{let t=e.replace(/^#/,"");if(t.length!==3&&t.length!==6)return null;t.length===3&&(t=`${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}`);const n=parseInt(t.slice(0,2),16),o=parseInt(t.slice(2,4),16);return{b:parseInt(t.slice(4,6),16),g:o,r:n}},T=(e,t=0)=>{const n=Math.pow(10,t);return Math.round(e*n)/n},rt=(e,t)=>{const n=k(e),o=k(t);return!n||!o?e:(o.pathname=n.pathname,o.search=n.search,o.toString())},ot=(e,t={},n=oe,o=se)=>{if(!e)return null;try{t.debug&&S("input imageSrc:",e);const i=Be(e);if(t.debug&&S("Visionary URL data: ",i),!i)throw new Error("Could not parse Visionary URL");const{fields:r,options:s}=i;if(r.sourceWidth<1||r.sourceHeight<1)throw new Error("Invalid image dimensions");const u=r.sourceWidth/r.sourceHeight,c=(t==null?void 0:t.size)??s.size??Fe,a=M[c];let p=0,l=0,m=0;if(u>=1){l=p=pe(a,r.sourceWidth);const g=T(l/u);m=T(l/g,6)}else p=pe(a,r.sourceHeight),l=T(p*u),m=T(l/p,6);const h=T(100/m,6),f={...r,arPaddingTop:`${h}%`,aspectRatio:m,maxWidth:l,src:e},y=k(r.url);if(y)f.src=y.toString();else if(!k(e)&&L(r.url)){const g=Ge(r,{endpoint:t.endpoint,size:c});g&&(f.src=g)}t.endpoint&&(f.src=rt(f.src,t.endpoint));const b=r.bcc?nt(r.bcc):null;if(b&&(f.backgroundColor=et(b,n)),!ie&&r.blurhash&&!t.disableBlurLayer){const g=performance.now(),w=Qe(r.blurhash,N,N,o),E=performance.now()-g;t.debug&&S(`Blurhash decode time: ${T(E,1)} ms`),w&&(f.pixels=w)}return t.debug&&S("Visionary Image state: ",f),f}catch{return null}},he={bottom:0,left:0,position:"absolute",right:0,top:0},st={...he,maxHeight:"100%",maxWidth:"100%"},ct={...he,height:"100%",width:"100%"},it=e=>{const t={...st};return e&&(t.display="none"),t},H={CANVAS:"canvas",CONTAINER:"container",IMAGE:"image"},X={container:"v7y_7587",preventDrag:"v7y_b8c0",preventSelection:"v7y_e0dd"},at=({alt:e,bgColorAlpha:t=oe,className:n,debug:o=!1,disableBlurLayer:i=!1,disableImageLayer:r=!1,endpoint:s,height:u,hideImageLayer:c=!1,lazy:a=!0,onClick:p,onError:l,onLoad:m,preventDrag:h=!1,preventSelection:f=!1,punch:y=se,size:b,src:g,style:w,width:E})=>{const d=x.useMemo(()=>ot(g,{debug:o,disableBlurLayer:i,endpoint:s,size:b},t,y),[t,o,i,s,y,b,g]),I=x.useRef(null),[Y,z]=ve();Ye(function(){if(!I.current||!(d!=null&&d.blurhash))return;if(!d.pixels){console.warn("No pixel data passed in, skipping");return}const ft=performance.now(),Z=I.current.getContext("2d");if(!Z){console.warn("Cannot access canvasRenderingContext, skipping");return}const J=Z.createImageData(N,N);if(!J){console.warn("Could not create ImageData on CanvasRenderingContext");return}if(J.data.set(d.pixels),Z.putImageData(J,0,0),o){const dt=performance.now()-ft;S(`Canvas render time: ${T(dt,1)} ms`)}},[d==null?void 0:d.blurhash,d==null?void 0:d.pixels,o]);const B=x.useCallback(_=>{o&&S("Image load error ",_),l&&l()},[o,l]),P={alt:e,loading:!a||z?"eager":"lazy",onLoad:m};if(!d){o&&S("Not a Visionary URL, rendering fallback <img />");const _={...P,className:n,height:u,onClick:p,onError:l,src:g,style:w,width:E};return R.jsx("img",{..._})}const U=be(X.container,n,{[X.preventDrag]:!!h,[X.preventSelection]:!!f}),q={...{"--v-ar":d.arPaddingTop},aspectRatio:d.aspectRatio,backgroundColor:(d==null?void 0:d.backgroundColor)??void 0,maxWidth:d.maxWidth,position:"relative",width:"100%",...w};E&&(q.width=E),u&&(q.height=u);const lt={onClick:p},ut=it(c);return R.jsxs("div",{className:U,ref:Y,style:q,...tt(d.url,o),...F(H.CONTAINER),...lt,children:[!i&&R.jsx("canvas",{height:N,ref:I,style:ct,width:N,...F(H.CANVAS)}),!r&&R.jsx("img",{...P,...F(H.IMAGE),onError:B,src:d.src,style:ut})]})};A.Image=at,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "visionary-image",
3
3
  "description": "React image component with built-in Blurhash placeholders for better UX and Core Web Vitals.",
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "type": "module",
6
6
  "main": "./dist/visionary-image.umd.js",
7
7
  "module": "./dist/visionary-image.es.js",
@@ -17,14 +17,14 @@
17
17
  "license": "ISC",
18
18
  "scripts": {
19
19
  "build": "tsc && npm run clean && vite build",
20
+ "build-storybook": "storybook build -o storybook-static",
20
21
  "clean": "rimraf dist/",
21
22
  "dev": "vite",
22
23
  "lint": "tsc --noEmit; eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
23
24
  "preview": "vite preview",
24
- "test": "vitest",
25
- "test:coverage": "vitest run --coverage",
26
25
  "storybook": "storybook dev -p 6006 --no-open",
27
- "build-storybook": "storybook build"
26
+ "test": "vitest",
27
+ "test:coverage": "vitest run --coverage"
28
28
  },
29
29
  "files": [
30
30
  "dist/",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "classnames": "2.5.1",
40
- "fast-blurhash": "1.1.2",
40
+ "fast-blurhash": "1.1.4",
41
41
  "react-hook-inview": "4.5.1",
42
42
  "visionary-url": "1.3.1"
43
43
  },