@annotorious/react-manifold 3.0.0-rc.19 → 3.0.0-rc.19.1

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 (45) hide show
  1. package/dist/annotorious-react-manifold.es10.js +8 -599
  2. package/dist/annotorious-react-manifold.es10.js.map +1 -1
  3. package/dist/annotorious-react-manifold.es11.js +7 -2
  4. package/dist/annotorious-react-manifold.es11.js.map +1 -1
  5. package/dist/annotorious-react-manifold.es12.js +16 -2
  6. package/dist/annotorious-react-manifold.es12.js.map +1 -1
  7. package/dist/annotorious-react-manifold.es13.js +5 -0
  8. package/dist/annotorious-react-manifold.es13.js.map +1 -0
  9. package/dist/annotorious-react-manifold.es14.js +33 -0
  10. package/dist/annotorious-react-manifold.es14.js.map +1 -0
  11. package/dist/annotorious-react-manifold.es15.js +602 -0
  12. package/dist/annotorious-react-manifold.es15.js.map +1 -0
  13. package/dist/annotorious-react-manifold.es16.js +5 -0
  14. package/dist/annotorious-react-manifold.es16.js.map +1 -0
  15. package/dist/annotorious-react-manifold.es17.js +5 -0
  16. package/dist/annotorious-react-manifold.es17.js.map +1 -0
  17. package/dist/annotorious-react-manifold.es18.js +9 -0
  18. package/dist/annotorious-react-manifold.es18.js.map +1 -0
  19. package/dist/annotorious-react-manifold.es19.js +5 -0
  20. package/dist/annotorious-react-manifold.es19.js.map +1 -0
  21. package/dist/annotorious-react-manifold.es2.js +14 -12
  22. package/dist/annotorious-react-manifold.es2.js.map +1 -1
  23. package/dist/annotorious-react-manifold.es20.js +33 -0
  24. package/dist/annotorious-react-manifold.es20.js.map +1 -0
  25. package/dist/annotorious-react-manifold.es21.js +602 -0
  26. package/dist/annotorious-react-manifold.es21.js.map +1 -0
  27. package/dist/annotorious-react-manifold.es22.js +5 -0
  28. package/dist/annotorious-react-manifold.es22.js.map +1 -0
  29. package/dist/annotorious-react-manifold.es23.js +5 -0
  30. package/dist/annotorious-react-manifold.es23.js.map +1 -0
  31. package/dist/annotorious-react-manifold.es4.js +7 -6
  32. package/dist/annotorious-react-manifold.es4.js.map +1 -1
  33. package/dist/annotorious-react-manifold.es6.js +4 -3
  34. package/dist/annotorious-react-manifold.es6.js.map +1 -1
  35. package/dist/annotorious-react-manifold.es7.js +3 -3
  36. package/dist/annotorious-react-manifold.es7.js.map +1 -1
  37. package/dist/annotorious-react-manifold.es8.js +46 -2
  38. package/dist/annotorious-react-manifold.es8.js.map +1 -1
  39. package/dist/annotorious-react-manifold.es9.js +1385 -29
  40. package/dist/annotorious-react-manifold.es9.js.map +1 -1
  41. package/dist/openseadragon/OpenSeadragonViewerManifold.d.ts +1 -0
  42. package/dist/openseadragon/OpenSeadragonViewerManifold.d.ts.map +1 -1
  43. package/package.json +4 -4
  44. package/LICENSE +0 -28
  45. package/README.md +0 -7
@@ -1,33 +1,1389 @@
1
- import { __exports as t } from "./annotorious-react-manifold.es11.js";
2
- import R from "react";
3
- /**
4
- * @license React
5
- * react-jsx-runtime.production.min.js
6
- *
7
- * Copyright (c) Facebook, Inc. and its affiliates.
8
- *
9
- * This source code is licensed under the MIT license found in the
10
- * LICENSE file in the root directory of this source tree.
11
- */
12
- var p;
13
- function v() {
14
- if (p)
15
- return t;
16
- p = 1;
17
- var s = R, m = Symbol.for("react.element"), l = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, d = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, y = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function i(o, r, u) {
19
- var e, n = {}, _ = null, f = null;
20
- u !== void 0 && (_ = "" + u), r.key !== void 0 && (_ = "" + r.key), r.ref !== void 0 && (f = r.ref);
21
- for (e in r)
22
- c.call(r, e) && !y.hasOwnProperty(e) && (n[e] = r[e]);
23
- if (o && o.defaultProps)
24
- for (e in r = o.defaultProps, r)
25
- n[e] === void 0 && (n[e] = r[e]);
26
- return { $$typeof: m, type: o, key: _, ref: f, props: n, _owner: d.current };
27
- }
28
- return t.Fragment = l, t.jsx = i, t.jsxs = i, t;
1
+ var Qt = Object.defineProperty, Wt = (t, n, o) => n in t ? Qt(t, n, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[n] = o, Mt = (t, n, o) => (Wt(t, typeof n != "symbol" ? n + "" : n, o), o);
2
+ function nt() {
29
3
  }
4
+ function Ot(t, n) {
5
+ for (const o in n)
6
+ t[o] = n[o];
7
+ return (
8
+ /** @type {T & S} */
9
+ t
10
+ );
11
+ }
12
+ function Xt(t) {
13
+ return t();
14
+ }
15
+ function At() {
16
+ return /* @__PURE__ */ Object.create(null);
17
+ }
18
+ function F(t) {
19
+ t.forEach(Xt);
20
+ }
21
+ function _(t) {
22
+ return typeof t == "function";
23
+ }
24
+ function dt(t, n) {
25
+ return t != t ? n == n : t !== n || t && typeof t == "object" || typeof t == "function";
26
+ }
27
+ function Jt(t) {
28
+ return Object.keys(t).length === 0;
29
+ }
30
+ function Zt(t, n, o, r) {
31
+ if (t) {
32
+ const e = Dt(t, n, o, r);
33
+ return t[0](e);
34
+ }
35
+ }
36
+ function Dt(t, n, o, r) {
37
+ return t[1] && r ? Ot(o.ctx.slice(), t[1](r(n))) : o.ctx;
38
+ }
39
+ function vt(t, n, o, r) {
40
+ if (t[2] && r) {
41
+ const e = t[2](r(o));
42
+ if (n.dirty === void 0)
43
+ return e;
44
+ if (typeof e == "object") {
45
+ const a = [], c = Math.max(n.dirty.length, e.length);
46
+ for (let i = 0; i < c; i += 1)
47
+ a[i] = n.dirty[i] | e[i];
48
+ return a;
49
+ }
50
+ return n.dirty | e;
51
+ }
52
+ return n.dirty;
53
+ }
54
+ function Yt(t, n, o, r, e, a) {
55
+ if (e) {
56
+ const c = Dt(n, o, r, a);
57
+ t.p(c, e);
58
+ }
59
+ }
60
+ function tn(t) {
61
+ if (t.ctx.length > 32) {
62
+ const n = [], o = t.ctx.length / 32;
63
+ for (let r = 0; r < o; r++)
64
+ n[r] = -1;
65
+ return n;
66
+ }
67
+ return -1;
68
+ }
69
+ function Ht(t) {
70
+ const n = {};
71
+ for (const o in t)
72
+ o[0] !== "$" && (n[o] = t[o]);
73
+ return n;
74
+ }
75
+ function ht(t) {
76
+ return t ?? "";
77
+ }
78
+ function It(t, n) {
79
+ t.appendChild(n);
80
+ }
81
+ function E(t, n, o) {
82
+ t.insertBefore(n, o || null);
83
+ }
84
+ function b(t) {
85
+ t.parentNode && t.parentNode.removeChild(t);
86
+ }
87
+ function nn(t, n) {
88
+ for (let o = 0; o < t.length; o += 1)
89
+ t[o] && t[o].d(n);
90
+ }
91
+ function M(t) {
92
+ return document.createElementNS("http://www.w3.org/2000/svg", t);
93
+ }
94
+ function zt(t) {
95
+ return document.createTextNode(t);
96
+ }
97
+ function k() {
98
+ return zt(" ");
99
+ }
100
+ function qt() {
101
+ return zt("");
102
+ }
103
+ function P(t, n, o, r) {
104
+ return t.addEventListener(n, o, r), () => t.removeEventListener(n, o, r);
105
+ }
106
+ function s(t, n, o) {
107
+ o == null ? t.removeAttribute(n) : t.getAttribute(n) !== o && t.setAttribute(n, o);
108
+ }
109
+ function on(t) {
110
+ return Array.from(t.childNodes);
111
+ }
112
+ function kt(t, n, o) {
113
+ t.classList.toggle(n, !!o);
114
+ }
115
+ function rn(t, n, { bubbles: o = !1, cancelable: r = !1 } = {}) {
116
+ return new CustomEvent(t, { detail: n, bubbles: o, cancelable: r });
117
+ }
118
+ let ot;
119
+ function tt(t) {
120
+ ot = t;
121
+ }
122
+ function en() {
123
+ if (!ot)
124
+ throw new Error("Function called outside component initialization");
125
+ return ot;
126
+ }
127
+ function sn() {
128
+ const t = en();
129
+ return (n, o, { cancelable: r = !1 } = {}) => {
130
+ const e = t.$$.callbacks[n];
131
+ if (e) {
132
+ const a = rn(
133
+ /** @type {string} */
134
+ n,
135
+ o,
136
+ { cancelable: r }
137
+ );
138
+ return e.slice().forEach((c) => {
139
+ c.call(t, a);
140
+ }), !a.defaultPrevented;
141
+ }
142
+ return !0;
143
+ };
144
+ }
145
+ function R(t, n) {
146
+ const o = t.$$.callbacks[n.type];
147
+ o && o.slice().forEach((r) => r.call(this, n));
148
+ }
149
+ const J = [], Gt = [];
150
+ let Z = [];
151
+ const Nt = [], an = /* @__PURE__ */ Promise.resolve();
152
+ let St = !1;
153
+ function cn() {
154
+ St || (St = !0, an.then(Vt));
155
+ }
156
+ function Pt(t) {
157
+ Z.push(t);
158
+ }
159
+ const Et = /* @__PURE__ */ new Set();
160
+ let W = 0;
161
+ function Vt() {
162
+ if (W !== 0)
163
+ return;
164
+ const t = ot;
165
+ do {
166
+ try {
167
+ for (; W < J.length; ) {
168
+ const n = J[W];
169
+ W++, tt(n), ln(n.$$);
170
+ }
171
+ } catch (n) {
172
+ throw J.length = 0, W = 0, n;
173
+ }
174
+ for (tt(null), J.length = 0, W = 0; Gt.length; )
175
+ Gt.pop()();
176
+ for (let n = 0; n < Z.length; n += 1) {
177
+ const o = Z[n];
178
+ Et.has(o) || (Et.add(o), o());
179
+ }
180
+ Z.length = 0;
181
+ } while (J.length);
182
+ for (; Nt.length; )
183
+ Nt.pop()();
184
+ St = !1, Et.clear(), tt(t);
185
+ }
186
+ function ln(t) {
187
+ if (t.fragment !== null) {
188
+ t.update(), F(t.before_update);
189
+ const n = t.dirty;
190
+ t.dirty = [-1], t.fragment && t.fragment.p(t.ctx, n), t.after_update.forEach(Pt);
191
+ }
192
+ }
193
+ function un(t) {
194
+ const n = [], o = [];
195
+ Z.forEach((r) => t.indexOf(r) === -1 ? n.push(r) : o.push(r)), o.forEach((r) => r()), Z = n;
196
+ }
197
+ const ft = /* @__PURE__ */ new Set();
198
+ let K;
199
+ function pn() {
200
+ K = {
201
+ r: 0,
202
+ c: [],
203
+ p: K
204
+ // parent group
205
+ };
206
+ }
207
+ function fn() {
208
+ K.r || F(K.c), K = K.p;
209
+ }
210
+ function H(t, n) {
211
+ t && t.i && (ft.delete(t), t.i(n));
212
+ }
213
+ function G(t, n, o, r) {
214
+ if (t && t.o) {
215
+ if (ft.has(t))
216
+ return;
217
+ ft.add(t), K.c.push(() => {
218
+ ft.delete(t), r && (o && t.d(1), r());
219
+ }), t.o(n);
220
+ } else
221
+ r && r();
222
+ }
223
+ function Rt(t) {
224
+ return (t == null ? void 0 : t.length) !== void 0 ? t : Array.from(t);
225
+ }
226
+ function Q(t) {
227
+ t && t.c();
228
+ }
229
+ function D(t, n, o) {
230
+ const { fragment: r, after_update: e } = t.$$;
231
+ r && r.m(n, o), Pt(() => {
232
+ const a = t.$$.on_mount.map(Xt).filter(_);
233
+ t.$$.on_destroy ? t.$$.on_destroy.push(...a) : F(a), t.$$.on_mount = [];
234
+ }), e.forEach(Pt);
235
+ }
236
+ function z(t, n) {
237
+ const o = t.$$;
238
+ o.fragment !== null && (un(o.after_update), F(o.on_destroy), o.fragment && o.fragment.d(n), o.on_destroy = o.fragment = null, o.ctx = []);
239
+ }
240
+ function hn(t, n) {
241
+ t.$$.dirty[0] === -1 && (J.push(t), cn(), t.$$.dirty.fill(0)), t.$$.dirty[n / 31 | 0] |= 1 << n % 31;
242
+ }
243
+ function gt(t, n, o, r, e, a, c = null, i = [-1]) {
244
+ const l = ot;
245
+ tt(t);
246
+ const h = t.$$ = {
247
+ fragment: null,
248
+ ctx: [],
249
+ // state
250
+ props: a,
251
+ update: nt,
252
+ not_equal: e,
253
+ bound: At(),
254
+ // lifecycle
255
+ on_mount: [],
256
+ on_destroy: [],
257
+ on_disconnect: [],
258
+ before_update: [],
259
+ after_update: [],
260
+ context: new Map(n.context || (l ? l.$$.context : [])),
261
+ // everything else
262
+ callbacks: At(),
263
+ dirty: i,
264
+ skip_bound: !1,
265
+ root: n.target || l.$$.root
266
+ };
267
+ c && c(h.root);
268
+ let d = !1;
269
+ if (h.ctx = o ? o(t, n.props || {}, ($, u, ...y) => {
270
+ const g = y.length ? y[0] : u;
271
+ return h.ctx && e(h.ctx[$], h.ctx[$] = g) && (!h.skip_bound && h.bound[$] && h.bound[$](g), d && hn(t, $)), u;
272
+ }) : [], h.update(), d = !0, F(h.before_update), h.fragment = r ? r(h.ctx) : !1, n.target) {
273
+ if (n.hydrate) {
274
+ const $ = on(n.target);
275
+ h.fragment && h.fragment.l($), $.forEach(b);
276
+ } else
277
+ h.fragment && h.fragment.c();
278
+ n.intro && H(t.$$.fragment), D(t, n.target, n.anchor), Vt();
279
+ }
280
+ tt(l);
281
+ }
282
+ class yt {
283
+ constructor() {
284
+ Mt(this, "$$"), Mt(this, "$$set");
285
+ }
286
+ /** @returns {void} */
287
+ $destroy() {
288
+ z(this, 1), this.$destroy = nt;
289
+ }
290
+ /**
291
+ * @template {Extract<keyof Events, string>} K
292
+ * @param {K} type
293
+ * @param {((e: Events[K]) => void) | null | undefined} callback
294
+ * @returns {() => void}
295
+ */
296
+ $on(n, o) {
297
+ if (!_(o))
298
+ return nt;
299
+ const r = this.$$.callbacks[n] || (this.$$.callbacks[n] = []);
300
+ return r.push(o), () => {
301
+ const e = r.indexOf(o);
302
+ e !== -1 && r.splice(e, 1);
303
+ };
304
+ }
305
+ /**
306
+ * @param {Partial<Props>} props
307
+ * @returns {void}
308
+ */
309
+ $set(n) {
310
+ this.$$set && !Jt(n) && (this.$$.skip_bound = !0, this.$$set(n), this.$$.skip_bound = !1);
311
+ }
312
+ }
313
+ const dn = "4";
314
+ typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(dn);
315
+ var v = /* @__PURE__ */ ((t) => (t.ELLIPSE = "ELLIPSE", t.POLYGON = "POLYGON", t.RECTANGLE = "RECTANGLE", t))(v || {});
316
+ const Lt = (t, n) => n, gn = (t) => {
317
+ let n = 1 / 0, o = 1 / 0, r = -1 / 0, e = -1 / 0;
318
+ return t.forEach(([a, c]) => {
319
+ n = Math.min(n, a), o = Math.min(o, c), r = Math.max(r, a), e = Math.max(e, c);
320
+ }), { minX: n, minY: o, maxX: r, maxY: e };
321
+ }, yn = {
322
+ area: (t) => Math.PI * t.geometry.rx * t.geometry.ry,
323
+ intersects: (t, n, o) => {
324
+ const { cx: r, cy: e, rx: a, ry: c } = t.geometry, i = 0, l = Math.cos(i), h = Math.sin(i), d = n - r, $ = o - e, u = l * d + h * $, y = h * d - l * $;
325
+ return u * u / (a * a) + y * y / (c * c) <= 1;
326
+ }
327
+ };
328
+ Lt(v.ELLIPSE, yn);
329
+ const mn = {
330
+ area: (t) => {
331
+ const { points: n } = t.geometry;
332
+ let o = 0, r = n.length - 1;
333
+ for (let e = 0; e < n.length; e++)
334
+ o += (n[r][0] + n[e][0]) * (n[r][1] - n[e][1]), r = e;
335
+ return Math.abs(0.5 * o);
336
+ },
337
+ intersects: (t, n, o) => {
338
+ const { points: r } = t.geometry;
339
+ let e = !1;
340
+ for (let a = 0, c = r.length - 1; a < r.length; c = a++) {
341
+ const i = r[a][0], l = r[a][1], h = r[c][0], d = r[c][1];
342
+ l > o != d > o && n < (h - i) * (o - l) / (d - l) + i && (e = !e);
343
+ }
344
+ return e;
345
+ }
346
+ };
347
+ Lt(v.POLYGON, mn);
348
+ const $n = {
349
+ area: (t) => t.geometry.w * t.geometry.h,
350
+ intersects: (t, n, o) => n >= t.geometry.x && n <= t.geometry.x + t.geometry.w && o >= t.geometry.y && o <= t.geometry.y + t.geometry.h
351
+ };
352
+ Lt(v.RECTANGLE, $n);
353
+ const xn = [];
354
+ for (let t = 0; t < 256; ++t)
355
+ xn.push((t + 256).toString(16).slice(1));
356
+ typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
357
+ const wn = [];
358
+ for (let t = 0; t < 256; ++t)
359
+ wn.push((t + 256).toString(16).slice(1));
360
+ typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
361
+ let Tn = (t = 21) => crypto.getRandomValues(new Uint8Array(t)).reduce((n, o) => (o &= 63, o < 36 ? n += o.toString(36) : o < 62 ? n += (o - 26).toString(36).toUpperCase() : o > 62 ? n += "-" : n += "_", n), "");
362
+ Tn();
363
+ function Ft(t, n, o) {
364
+ const r = t.slice();
365
+ return r[10] = n[o], r[12] = o, r;
366
+ }
367
+ function Bt(t) {
368
+ let n, o;
369
+ return n = new Y({
370
+ props: {
371
+ x: (
372
+ /*point*/
373
+ t[10][0]
374
+ ),
375
+ y: (
376
+ /*point*/
377
+ t[10][1]
378
+ ),
379
+ scale: (
380
+ /*viewportScale*/
381
+ t[3]
382
+ )
383
+ }
384
+ }), n.$on("pointerdown", function() {
385
+ _(
386
+ /*grab*/
387
+ t[9](`HANDLE-${/*idx*/
388
+ t[12]}`)
389
+ ) && t[9](`HANDLE-${/*idx*/
390
+ t[12]}`).apply(this, arguments);
391
+ }), {
392
+ c() {
393
+ Q(n.$$.fragment);
394
+ },
395
+ m(r, e) {
396
+ D(n, r, e), o = !0;
397
+ },
398
+ p(r, e) {
399
+ t = r;
400
+ const a = {};
401
+ e & /*geom*/
402
+ 16 && (a.x = /*point*/
403
+ t[10][0]), e & /*geom*/
404
+ 16 && (a.y = /*point*/
405
+ t[10][1]), e & /*viewportScale*/
406
+ 8 && (a.scale = /*viewportScale*/
407
+ t[3]), n.$set(a);
408
+ },
409
+ i(r) {
410
+ o || (H(n.$$.fragment, r), o = !0);
411
+ },
412
+ o(r) {
413
+ G(n.$$.fragment, r), o = !1;
414
+ },
415
+ d(r) {
416
+ z(n, r);
417
+ }
418
+ };
419
+ }
420
+ function bn(t) {
421
+ let n, o, r, e, a, c, i, l, h, d, $, u = Rt(
422
+ /*geom*/
423
+ t[4].points
424
+ ), y = [];
425
+ for (let p = 0; p < u.length; p += 1)
426
+ y[p] = Bt(Ft(t, u, p));
427
+ const g = (p) => G(y[p], 1, 1, () => {
428
+ y[p] = null;
429
+ });
430
+ return {
431
+ c() {
432
+ n = M("polygon"), e = k(), a = M("polygon"), i = k();
433
+ for (let p = 0; p < y.length; p += 1)
434
+ y[p].c();
435
+ l = qt(), s(n, "class", "a9s-outer"), s(n, "style", o = /*computedStyle*/
436
+ t[1] ? "display:none;" : void 0), s(n, "points", r = /*geom*/
437
+ t[4].points.map(Ut).join(" ")), s(a, "class", "a9s-inner a9s-shape-handle"), s(
438
+ a,
439
+ "style",
440
+ /*computedStyle*/
441
+ t[1]
442
+ ), s(a, "points", c = /*geom*/
443
+ t[4].points.map(jt).join(" "));
444
+ },
445
+ m(p, m) {
446
+ E(p, n, m), E(p, e, m), E(p, a, m), E(p, i, m);
447
+ for (let w = 0; w < y.length; w += 1)
448
+ y[w] && y[w].m(p, m);
449
+ E(p, l, m), h = !0, d || ($ = [
450
+ P(n, "pointerdown", function() {
451
+ _(
452
+ /*grab*/
453
+ t[9]("SHAPE")
454
+ ) && t[9]("SHAPE").apply(this, arguments);
455
+ }),
456
+ P(a, "pointerdown", function() {
457
+ _(
458
+ /*grab*/
459
+ t[9]("SHAPE")
460
+ ) && t[9]("SHAPE").apply(this, arguments);
461
+ })
462
+ ], d = !0);
463
+ },
464
+ p(p, m) {
465
+ if (t = p, (!h || m & /*computedStyle*/
466
+ 2 && o !== (o = /*computedStyle*/
467
+ t[1] ? "display:none;" : void 0)) && s(n, "style", o), (!h || m & /*geom*/
468
+ 16 && r !== (r = /*geom*/
469
+ t[4].points.map(Ut).join(" "))) && s(n, "points", r), (!h || m & /*computedStyle*/
470
+ 2) && s(
471
+ a,
472
+ "style",
473
+ /*computedStyle*/
474
+ t[1]
475
+ ), (!h || m & /*geom*/
476
+ 16 && c !== (c = /*geom*/
477
+ t[4].points.map(jt).join(" "))) && s(a, "points", c), m & /*geom, viewportScale, grab*/
478
+ 536) {
479
+ u = Rt(
480
+ /*geom*/
481
+ t[4].points
482
+ );
483
+ let w;
484
+ for (w = 0; w < u.length; w += 1) {
485
+ const S = Ft(t, u, w);
486
+ y[w] ? (y[w].p(S, m), H(y[w], 1)) : (y[w] = Bt(S), y[w].c(), H(y[w], 1), y[w].m(l.parentNode, l));
487
+ }
488
+ for (pn(), w = u.length; w < y.length; w += 1)
489
+ g(w);
490
+ fn();
491
+ }
492
+ },
493
+ i(p) {
494
+ if (!h) {
495
+ for (let m = 0; m < u.length; m += 1)
496
+ H(y[m]);
497
+ h = !0;
498
+ }
499
+ },
500
+ o(p) {
501
+ y = y.filter(Boolean);
502
+ for (let m = 0; m < y.length; m += 1)
503
+ G(y[m]);
504
+ h = !1;
505
+ },
506
+ d(p) {
507
+ p && (b(n), b(e), b(a), b(i), b(l)), nn(y, p), d = !1, F($);
508
+ }
509
+ };
510
+ }
511
+ function En(t) {
512
+ let n, o;
513
+ return n = new Kt({
514
+ props: {
515
+ shape: (
516
+ /*shape*/
517
+ t[0]
518
+ ),
519
+ transform: (
520
+ /*transform*/
521
+ t[2]
522
+ ),
523
+ editor: (
524
+ /*editor*/
525
+ t[5]
526
+ ),
527
+ $$slots: {
528
+ default: [
529
+ bn,
530
+ ({ grab: r }) => ({ 9: r }),
531
+ ({ grab: r }) => r ? 512 : 0
532
+ ]
533
+ },
534
+ $$scope: { ctx: t }
535
+ }
536
+ }), n.$on(
537
+ "change",
538
+ /*change_handler*/
539
+ t[6]
540
+ ), n.$on(
541
+ "grab",
542
+ /*grab_handler*/
543
+ t[7]
544
+ ), n.$on(
545
+ "release",
546
+ /*release_handler*/
547
+ t[8]
548
+ ), {
549
+ c() {
550
+ Q(n.$$.fragment);
551
+ },
552
+ m(r, e) {
553
+ D(n, r, e), o = !0;
554
+ },
555
+ p(r, [e]) {
556
+ const a = {};
557
+ e & /*shape*/
558
+ 1 && (a.shape = /*shape*/
559
+ r[0]), e & /*transform*/
560
+ 4 && (a.transform = /*transform*/
561
+ r[2]), e & /*$$scope, geom, viewportScale, grab, computedStyle*/
562
+ 8730 && (a.$$scope = { dirty: e, ctx: r }), n.$set(a);
563
+ },
564
+ i(r) {
565
+ o || (H(n.$$.fragment, r), o = !0);
566
+ },
567
+ o(r) {
568
+ G(n.$$.fragment, r), o = !1;
569
+ },
570
+ d(r) {
571
+ z(n, r);
572
+ }
573
+ };
574
+ }
575
+ const Ut = (t) => t.join(","), jt = (t) => t.join(",");
576
+ function On(t, n, o) {
577
+ let r, { shape: e } = n, { computedStyle: a } = n, { transform: c } = n, { viewportScale: i = 1 } = n;
578
+ const l = (u, y, g) => {
579
+ let p;
580
+ const m = u.geometry;
581
+ y === "SHAPE" ? p = m.points.map(([S, O]) => [S + g[0], O + g[1]]) : p = m.points.map(([S, O], I) => y === `HANDLE-${I}` ? [S + g[0], O + g[1]] : [S, O]);
582
+ const w = gn(p);
583
+ return { ...u, geometry: { points: p, bounds: w } };
584
+ };
585
+ function h(u) {
586
+ R.call(this, t, u);
587
+ }
588
+ function d(u) {
589
+ R.call(this, t, u);
590
+ }
591
+ function $(u) {
592
+ R.call(this, t, u);
593
+ }
594
+ return t.$$set = (u) => {
595
+ "shape" in u && o(0, e = u.shape), "computedStyle" in u && o(1, a = u.computedStyle), "transform" in u && o(2, c = u.transform), "viewportScale" in u && o(3, i = u.viewportScale);
596
+ }, t.$$.update = () => {
597
+ t.$$.dirty & /*shape*/
598
+ 1 && o(4, r = e.geometry);
599
+ }, [
600
+ e,
601
+ a,
602
+ c,
603
+ i,
604
+ r,
605
+ l,
606
+ h,
607
+ d,
608
+ $
609
+ ];
610
+ }
611
+ class Sn extends yt {
612
+ constructor(n) {
613
+ super(), gt(this, n, On, En, dt, {
614
+ shape: 0,
615
+ computedStyle: 1,
616
+ transform: 2,
617
+ viewportScale: 3
618
+ });
619
+ }
620
+ }
621
+ const Pn = "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
622
+ function Ln(t) {
623
+ let n, o, r, e, a, c;
624
+ return {
625
+ c() {
626
+ n = M("rect"), s(n, "class", o = ht(`a9s-handle ${/*$$props*/
627
+ t[8].class || ""}`.trim()) + " svelte-1sgkh33"), s(n, "x", r = /*x*/
628
+ t[0] - /*handleSize*/
629
+ t[5] / 2), s(n, "y", e = /*y*/
630
+ t[1] - /*handleSize*/
631
+ t[5] / 2), s(
632
+ n,
633
+ "width",
634
+ /*handleSize*/
635
+ t[5]
636
+ ), s(
637
+ n,
638
+ "height",
639
+ /*handleSize*/
640
+ t[5]
641
+ );
642
+ },
643
+ m(i, l) {
644
+ E(i, n, l), a || (c = P(
645
+ n,
646
+ "pointerdown",
647
+ /*pointerdown_handler_2*/
648
+ t[11]
649
+ ), a = !0);
650
+ },
651
+ p(i, l) {
652
+ l & /*$$props*/
653
+ 256 && o !== (o = ht(`a9s-handle ${/*$$props*/
654
+ i[8].class || ""}`.trim()) + " svelte-1sgkh33") && s(n, "class", o), l & /*x, handleSize*/
655
+ 33 && r !== (r = /*x*/
656
+ i[0] - /*handleSize*/
657
+ i[5] / 2) && s(n, "x", r), l & /*y, handleSize*/
658
+ 34 && e !== (e = /*y*/
659
+ i[1] - /*handleSize*/
660
+ i[5] / 2) && s(n, "y", e), l & /*handleSize*/
661
+ 32 && s(
662
+ n,
663
+ "width",
664
+ /*handleSize*/
665
+ i[5]
666
+ ), l & /*handleSize*/
667
+ 32 && s(
668
+ n,
669
+ "height",
670
+ /*handleSize*/
671
+ i[5]
672
+ );
673
+ },
674
+ d(i) {
675
+ i && b(n), a = !1, c();
676
+ }
677
+ };
678
+ }
679
+ function _n(t) {
680
+ let n, o, r, e, a, c, i, l, h;
681
+ return {
682
+ c() {
683
+ n = M("g"), o = M("circle"), e = M("rect"), s(
684
+ o,
685
+ "cx",
686
+ /*x*/
687
+ t[0]
688
+ ), s(
689
+ o,
690
+ "cy",
691
+ /*y*/
692
+ t[1]
693
+ ), s(o, "r", r = /*radius*/
694
+ t[3] / /*scale*/
695
+ t[2]), s(o, "class", "a9s-touch-halo svelte-1sgkh33"), kt(
696
+ o,
697
+ "touched",
698
+ /*touched*/
699
+ t[4]
700
+ ), s(e, "class", a = ht(`a9s-handle ${/*$$props*/
701
+ t[8].class || ""}`.trim()) + " svelte-1sgkh33"), s(e, "x", c = /*x*/
702
+ t[0] - /*handleSize*/
703
+ t[5] / 2), s(e, "y", i = /*y*/
704
+ t[1] - /*handleSize*/
705
+ t[5] / 2), s(
706
+ e,
707
+ "width",
708
+ /*handleSize*/
709
+ t[5]
710
+ ), s(
711
+ e,
712
+ "height",
713
+ /*handleSize*/
714
+ t[5]
715
+ ), s(n, "class", "a9s-touch-handle");
716
+ },
717
+ m(d, $) {
718
+ E(d, n, $), It(n, o), It(n, e), l || (h = [
719
+ P(
720
+ o,
721
+ "pointerdown",
722
+ /*pointerdown_handler*/
723
+ t[10]
724
+ ),
725
+ P(
726
+ o,
727
+ "pointerdown",
728
+ /*onPointerDown*/
729
+ t[6]
730
+ ),
731
+ P(
732
+ o,
733
+ "pointerup",
734
+ /*onPointerUp*/
735
+ t[7]
736
+ ),
737
+ P(
738
+ e,
739
+ "pointerdown",
740
+ /*pointerdown_handler_1*/
741
+ t[9]
742
+ ),
743
+ P(
744
+ e,
745
+ "pointerdown",
746
+ /*onPointerDown*/
747
+ t[6]
748
+ ),
749
+ P(
750
+ e,
751
+ "pointerup",
752
+ /*onPointerUp*/
753
+ t[7]
754
+ )
755
+ ], l = !0);
756
+ },
757
+ p(d, $) {
758
+ $ & /*x*/
759
+ 1 && s(
760
+ o,
761
+ "cx",
762
+ /*x*/
763
+ d[0]
764
+ ), $ & /*y*/
765
+ 2 && s(
766
+ o,
767
+ "cy",
768
+ /*y*/
769
+ d[1]
770
+ ), $ & /*radius, scale*/
771
+ 12 && r !== (r = /*radius*/
772
+ d[3] / /*scale*/
773
+ d[2]) && s(o, "r", r), $ & /*touched*/
774
+ 16 && kt(
775
+ o,
776
+ "touched",
777
+ /*touched*/
778
+ d[4]
779
+ ), $ & /*$$props*/
780
+ 256 && a !== (a = ht(`a9s-handle ${/*$$props*/
781
+ d[8].class || ""}`.trim()) + " svelte-1sgkh33") && s(e, "class", a), $ & /*x, handleSize*/
782
+ 33 && c !== (c = /*x*/
783
+ d[0] - /*handleSize*/
784
+ d[5] / 2) && s(e, "x", c), $ & /*y, handleSize*/
785
+ 34 && i !== (i = /*y*/
786
+ d[1] - /*handleSize*/
787
+ d[5] / 2) && s(e, "y", i), $ & /*handleSize*/
788
+ 32 && s(
789
+ e,
790
+ "width",
791
+ /*handleSize*/
792
+ d[5]
793
+ ), $ & /*handleSize*/
794
+ 32 && s(
795
+ e,
796
+ "height",
797
+ /*handleSize*/
798
+ d[5]
799
+ );
800
+ },
801
+ d(d) {
802
+ d && b(n), l = !1, F(h);
803
+ }
804
+ };
805
+ }
806
+ function Mn(t) {
807
+ let n;
808
+ function o(e, a) {
809
+ return Pn ? _n : Ln;
810
+ }
811
+ let r = o()(t);
812
+ return {
813
+ c() {
814
+ r.c(), n = qt();
815
+ },
816
+ m(e, a) {
817
+ r.m(e, a), E(e, n, a);
818
+ },
819
+ p(e, [a]) {
820
+ r.p(e, a);
821
+ },
822
+ i: nt,
823
+ o: nt,
824
+ d(e) {
825
+ e && b(n), r.d(e);
826
+ }
827
+ };
828
+ }
829
+ function An(t, n, o) {
830
+ let r, { x: e } = n, { y: a } = n, { scale: c } = n, { radius: i = 30 } = n, l = !1;
831
+ const h = (g) => {
832
+ g.pointerType === "touch" && o(4, l = !0);
833
+ }, d = () => o(4, l = !1);
834
+ function $(g) {
835
+ R.call(this, t, g);
836
+ }
837
+ function u(g) {
838
+ R.call(this, t, g);
839
+ }
840
+ function y(g) {
841
+ R.call(this, t, g);
842
+ }
843
+ return t.$$set = (g) => {
844
+ o(8, n = Ot(Ot({}, n), Ht(g))), "x" in g && o(0, e = g.x), "y" in g && o(1, a = g.y), "scale" in g && o(2, c = g.scale), "radius" in g && o(3, i = g.radius);
845
+ }, t.$$.update = () => {
846
+ t.$$.dirty & /*scale*/
847
+ 4 && o(5, r = 10 / c);
848
+ }, n = Ht(n), [
849
+ e,
850
+ a,
851
+ c,
852
+ i,
853
+ l,
854
+ r,
855
+ h,
856
+ d,
857
+ n,
858
+ $,
859
+ u,
860
+ y
861
+ ];
862
+ }
863
+ class Y extends yt {
864
+ constructor(n) {
865
+ super(), gt(this, n, An, Mn, dt, { x: 0, y: 1, scale: 2, radius: 3 });
866
+ }
867
+ }
868
+ function Hn(t) {
869
+ let n, o, r, e, a, c, i, l, h, d, $, u, y, g, p, m, w, S, O, I, N, B, q, L, V, rt, et, mt, A, st, at, ct, $t, U, xt, j, wt, C, Tt, X, T, bt, _t;
870
+ return U = new Y({
871
+ props: {
872
+ class: "a9s-corner-handle-topleft",
873
+ x: (
874
+ /*geom*/
875
+ t[4].x
876
+ ),
877
+ y: (
878
+ /*geom*/
879
+ t[4].y
880
+ ),
881
+ scale: (
882
+ /*viewportScale*/
883
+ t[3]
884
+ )
885
+ }
886
+ }), U.$on("pointerdown", function() {
887
+ _(
888
+ /*grab*/
889
+ t[9]("TOP_LEFT")
890
+ ) && t[9]("TOP_LEFT").apply(this, arguments);
891
+ }), j = new Y({
892
+ props: {
893
+ class: "a9s-corner-handle-topright",
894
+ x: (
895
+ /*geom*/
896
+ t[4].x + /*geom*/
897
+ t[4].w
898
+ ),
899
+ y: (
900
+ /*geom*/
901
+ t[4].y
902
+ ),
903
+ scale: (
904
+ /*viewportScale*/
905
+ t[3]
906
+ )
907
+ }
908
+ }), j.$on("pointerdown", function() {
909
+ _(
910
+ /*grab*/
911
+ t[9]("TOP_RIGHT")
912
+ ) && t[9]("TOP_RIGHT").apply(this, arguments);
913
+ }), C = new Y({
914
+ props: {
915
+ class: "a9s-corner-handle-bottomright",
916
+ x: (
917
+ /*geom*/
918
+ t[4].x + /*geom*/
919
+ t[4].w
920
+ ),
921
+ y: (
922
+ /*geom*/
923
+ t[4].y + /*geom*/
924
+ t[4].h
925
+ ),
926
+ scale: (
927
+ /*viewportScale*/
928
+ t[3]
929
+ )
930
+ }
931
+ }), C.$on("pointerdown", function() {
932
+ _(
933
+ /*grab*/
934
+ t[9]("BOTTOM_RIGHT")
935
+ ) && t[9]("BOTTOM_RIGHT").apply(this, arguments);
936
+ }), X = new Y({
937
+ props: {
938
+ class: "a9s-corner-handle-bottomleft",
939
+ x: (
940
+ /*geom*/
941
+ t[4].x
942
+ ),
943
+ y: (
944
+ /*geom*/
945
+ t[4].y + /*geom*/
946
+ t[4].h
947
+ ),
948
+ scale: (
949
+ /*viewportScale*/
950
+ t[3]
951
+ )
952
+ }
953
+ }), X.$on("pointerdown", function() {
954
+ _(
955
+ /*grab*/
956
+ t[9]("BOTTOM_LEFT")
957
+ ) && t[9]("BOTTOM_LEFT").apply(this, arguments);
958
+ }), {
959
+ c() {
960
+ n = M("rect"), i = k(), l = M("rect"), y = k(), g = M("rect"), S = k(), O = M("rect"), q = k(), L = M("rect"), mt = k(), A = M("rect"), $t = k(), Q(U.$$.fragment), xt = k(), Q(j.$$.fragment), wt = k(), Q(C.$$.fragment), Tt = k(), Q(X.$$.fragment), s(n, "class", "a9s-outer"), s(n, "style", o = /*computedStyle*/
961
+ t[1] ? "display:none;" : void 0), s(n, "x", r = /*geom*/
962
+ t[4].x), s(n, "y", e = /*geom*/
963
+ t[4].y), s(n, "width", a = /*geom*/
964
+ t[4].w), s(n, "height", c = /*geom*/
965
+ t[4].h), s(l, "class", "a9s-inner a9s-shape-handle"), s(
966
+ l,
967
+ "style",
968
+ /*computedStyle*/
969
+ t[1]
970
+ ), s(l, "x", h = /*geom*/
971
+ t[4].x), s(l, "y", d = /*geom*/
972
+ t[4].y), s(l, "width", $ = /*geom*/
973
+ t[4].w), s(l, "height", u = /*geom*/
974
+ t[4].h), s(g, "class", "a9s-edge-handle a9s-edge-handle-top"), s(g, "x", p = /*geom*/
975
+ t[4].x), s(g, "y", m = /*geom*/
976
+ t[4].y), s(g, "height", 1), s(g, "width", w = /*geom*/
977
+ t[4].w), s(O, "class", "a9s-edge-handle a9s-edge-handle-right"), s(O, "x", I = /*geom*/
978
+ t[4].x + /*geom*/
979
+ t[4].w), s(O, "y", N = /*geom*/
980
+ t[4].y), s(O, "height", B = /*geom*/
981
+ t[4].h), s(O, "width", 1), s(L, "class", "a9s-edge-handle a9s-edge-handle-bottom"), s(L, "x", V = /*geom*/
982
+ t[4].x), s(L, "y", rt = /*geom*/
983
+ t[4].y + /*geom*/
984
+ t[4].h), s(L, "height", 1), s(L, "width", et = /*geom*/
985
+ t[4].w), s(A, "class", "a9s-edge-handle a9s-edge-handle-left"), s(A, "x", st = /*geom*/
986
+ t[4].x), s(A, "y", at = /*geom*/
987
+ t[4].y), s(A, "height", ct = /*geom*/
988
+ t[4].h), s(A, "width", 1);
989
+ },
990
+ m(x, f) {
991
+ E(x, n, f), E(x, i, f), E(x, l, f), E(x, y, f), E(x, g, f), E(x, S, f), E(x, O, f), E(x, q, f), E(x, L, f), E(x, mt, f), E(x, A, f), E(x, $t, f), D(U, x, f), E(x, xt, f), D(j, x, f), E(x, wt, f), D(C, x, f), E(x, Tt, f), D(X, x, f), T = !0, bt || (_t = [
992
+ P(n, "pointerdown", function() {
993
+ _(
994
+ /*grab*/
995
+ t[9]("SHAPE")
996
+ ) && t[9]("SHAPE").apply(this, arguments);
997
+ }),
998
+ P(l, "pointerdown", function() {
999
+ _(
1000
+ /*grab*/
1001
+ t[9]("SHAPE")
1002
+ ) && t[9]("SHAPE").apply(this, arguments);
1003
+ }),
1004
+ P(g, "pointerdown", function() {
1005
+ _(
1006
+ /*grab*/
1007
+ t[9]("TOP")
1008
+ ) && t[9]("TOP").apply(this, arguments);
1009
+ }),
1010
+ P(O, "pointerdown", function() {
1011
+ _(
1012
+ /*grab*/
1013
+ t[9]("RIGHT")
1014
+ ) && t[9]("RIGHT").apply(this, arguments);
1015
+ }),
1016
+ P(L, "pointerdown", function() {
1017
+ _(
1018
+ /*grab*/
1019
+ t[9]("BOTTOM")
1020
+ ) && t[9]("BOTTOM").apply(this, arguments);
1021
+ }),
1022
+ P(A, "pointerdown", function() {
1023
+ _(
1024
+ /*grab*/
1025
+ t[9]("LEFT")
1026
+ ) && t[9]("LEFT").apply(this, arguments);
1027
+ })
1028
+ ], bt = !0);
1029
+ },
1030
+ p(x, f) {
1031
+ t = x, (!T || f & /*computedStyle*/
1032
+ 2 && o !== (o = /*computedStyle*/
1033
+ t[1] ? "display:none;" : void 0)) && s(n, "style", o), (!T || f & /*geom*/
1034
+ 16 && r !== (r = /*geom*/
1035
+ t[4].x)) && s(n, "x", r), (!T || f & /*geom*/
1036
+ 16 && e !== (e = /*geom*/
1037
+ t[4].y)) && s(n, "y", e), (!T || f & /*geom*/
1038
+ 16 && a !== (a = /*geom*/
1039
+ t[4].w)) && s(n, "width", a), (!T || f & /*geom*/
1040
+ 16 && c !== (c = /*geom*/
1041
+ t[4].h)) && s(n, "height", c), (!T || f & /*computedStyle*/
1042
+ 2) && s(
1043
+ l,
1044
+ "style",
1045
+ /*computedStyle*/
1046
+ t[1]
1047
+ ), (!T || f & /*geom*/
1048
+ 16 && h !== (h = /*geom*/
1049
+ t[4].x)) && s(l, "x", h), (!T || f & /*geom*/
1050
+ 16 && d !== (d = /*geom*/
1051
+ t[4].y)) && s(l, "y", d), (!T || f & /*geom*/
1052
+ 16 && $ !== ($ = /*geom*/
1053
+ t[4].w)) && s(l, "width", $), (!T || f & /*geom*/
1054
+ 16 && u !== (u = /*geom*/
1055
+ t[4].h)) && s(l, "height", u), (!T || f & /*geom*/
1056
+ 16 && p !== (p = /*geom*/
1057
+ t[4].x)) && s(g, "x", p), (!T || f & /*geom*/
1058
+ 16 && m !== (m = /*geom*/
1059
+ t[4].y)) && s(g, "y", m), (!T || f & /*geom*/
1060
+ 16 && w !== (w = /*geom*/
1061
+ t[4].w)) && s(g, "width", w), (!T || f & /*geom*/
1062
+ 16 && I !== (I = /*geom*/
1063
+ t[4].x + /*geom*/
1064
+ t[4].w)) && s(O, "x", I), (!T || f & /*geom*/
1065
+ 16 && N !== (N = /*geom*/
1066
+ t[4].y)) && s(O, "y", N), (!T || f & /*geom*/
1067
+ 16 && B !== (B = /*geom*/
1068
+ t[4].h)) && s(O, "height", B), (!T || f & /*geom*/
1069
+ 16 && V !== (V = /*geom*/
1070
+ t[4].x)) && s(L, "x", V), (!T || f & /*geom*/
1071
+ 16 && rt !== (rt = /*geom*/
1072
+ t[4].y + /*geom*/
1073
+ t[4].h)) && s(L, "y", rt), (!T || f & /*geom*/
1074
+ 16 && et !== (et = /*geom*/
1075
+ t[4].w)) && s(L, "width", et), (!T || f & /*geom*/
1076
+ 16 && st !== (st = /*geom*/
1077
+ t[4].x)) && s(A, "x", st), (!T || f & /*geom*/
1078
+ 16 && at !== (at = /*geom*/
1079
+ t[4].y)) && s(A, "y", at), (!T || f & /*geom*/
1080
+ 16 && ct !== (ct = /*geom*/
1081
+ t[4].h)) && s(A, "height", ct);
1082
+ const it = {};
1083
+ f & /*geom*/
1084
+ 16 && (it.x = /*geom*/
1085
+ t[4].x), f & /*geom*/
1086
+ 16 && (it.y = /*geom*/
1087
+ t[4].y), f & /*viewportScale*/
1088
+ 8 && (it.scale = /*viewportScale*/
1089
+ t[3]), U.$set(it);
1090
+ const lt = {};
1091
+ f & /*geom*/
1092
+ 16 && (lt.x = /*geom*/
1093
+ t[4].x + /*geom*/
1094
+ t[4].w), f & /*geom*/
1095
+ 16 && (lt.y = /*geom*/
1096
+ t[4].y), f & /*viewportScale*/
1097
+ 8 && (lt.scale = /*viewportScale*/
1098
+ t[3]), j.$set(lt);
1099
+ const ut = {};
1100
+ f & /*geom*/
1101
+ 16 && (ut.x = /*geom*/
1102
+ t[4].x + /*geom*/
1103
+ t[4].w), f & /*geom*/
1104
+ 16 && (ut.y = /*geom*/
1105
+ t[4].y + /*geom*/
1106
+ t[4].h), f & /*viewportScale*/
1107
+ 8 && (ut.scale = /*viewportScale*/
1108
+ t[3]), C.$set(ut);
1109
+ const pt = {};
1110
+ f & /*geom*/
1111
+ 16 && (pt.x = /*geom*/
1112
+ t[4].x), f & /*geom*/
1113
+ 16 && (pt.y = /*geom*/
1114
+ t[4].y + /*geom*/
1115
+ t[4].h), f & /*viewportScale*/
1116
+ 8 && (pt.scale = /*viewportScale*/
1117
+ t[3]), X.$set(pt);
1118
+ },
1119
+ i(x) {
1120
+ T || (H(U.$$.fragment, x), H(j.$$.fragment, x), H(C.$$.fragment, x), H(X.$$.fragment, x), T = !0);
1121
+ },
1122
+ o(x) {
1123
+ G(U.$$.fragment, x), G(j.$$.fragment, x), G(C.$$.fragment, x), G(X.$$.fragment, x), T = !1;
1124
+ },
1125
+ d(x) {
1126
+ x && (b(n), b(i), b(l), b(y), b(g), b(S), b(O), b(q), b(L), b(mt), b(A), b($t), b(xt), b(wt), b(Tt)), z(U, x), z(j, x), z(C, x), z(X, x), bt = !1, F(_t);
1127
+ }
1128
+ };
1129
+ }
1130
+ function In(t) {
1131
+ let n, o;
1132
+ return n = new Kt({
1133
+ props: {
1134
+ shape: (
1135
+ /*shape*/
1136
+ t[0]
1137
+ ),
1138
+ transform: (
1139
+ /*transform*/
1140
+ t[2]
1141
+ ),
1142
+ editor: (
1143
+ /*editor*/
1144
+ t[5]
1145
+ ),
1146
+ $$slots: {
1147
+ default: [
1148
+ Hn,
1149
+ ({ grab: r }) => ({ 9: r }),
1150
+ ({ grab: r }) => r ? 512 : 0
1151
+ ]
1152
+ },
1153
+ $$scope: { ctx: t }
1154
+ }
1155
+ }), n.$on(
1156
+ "grab",
1157
+ /*grab_handler*/
1158
+ t[6]
1159
+ ), n.$on(
1160
+ "change",
1161
+ /*change_handler*/
1162
+ t[7]
1163
+ ), n.$on(
1164
+ "release",
1165
+ /*release_handler*/
1166
+ t[8]
1167
+ ), {
1168
+ c() {
1169
+ Q(n.$$.fragment);
1170
+ },
1171
+ m(r, e) {
1172
+ D(n, r, e), o = !0;
1173
+ },
1174
+ p(r, [e]) {
1175
+ const a = {};
1176
+ e & /*shape*/
1177
+ 1 && (a.shape = /*shape*/
1178
+ r[0]), e & /*transform*/
1179
+ 4 && (a.transform = /*transform*/
1180
+ r[2]), e & /*$$scope, geom, viewportScale, grab, computedStyle*/
1181
+ 1562 && (a.$$scope = { dirty: e, ctx: r }), n.$set(a);
1182
+ },
1183
+ i(r) {
1184
+ o || (H(n.$$.fragment, r), o = !0);
1185
+ },
1186
+ o(r) {
1187
+ G(n.$$.fragment, r), o = !1;
1188
+ },
1189
+ d(r) {
1190
+ z(n, r);
1191
+ }
1192
+ };
1193
+ }
1194
+ function kn(t, n, o) {
1195
+ let r, { shape: e } = n, { computedStyle: a } = n, { transform: c } = n, { viewportScale: i = 1 } = n;
1196
+ const l = (u, y, g) => {
1197
+ const p = u.geometry.bounds;
1198
+ let [m, w] = [p.minX, p.minY], [S, O] = [p.maxX, p.maxY];
1199
+ const [I, N] = g;
1200
+ if (y === "SHAPE")
1201
+ m += I, S += I, w += N, O += N;
1202
+ else {
1203
+ switch (y) {
1204
+ case "TOP":
1205
+ case "TOP_LEFT":
1206
+ case "TOP_RIGHT": {
1207
+ w += N;
1208
+ break;
1209
+ }
1210
+ case "BOTTOM":
1211
+ case "BOTTOM_LEFT":
1212
+ case "BOTTOM_RIGHT": {
1213
+ O += N;
1214
+ break;
1215
+ }
1216
+ }
1217
+ switch (y) {
1218
+ case "LEFT":
1219
+ case "TOP_LEFT":
1220
+ case "BOTTOM_LEFT": {
1221
+ m += I;
1222
+ break;
1223
+ }
1224
+ case "RIGHT":
1225
+ case "TOP_RIGHT":
1226
+ case "BOTTOM_RIGHT": {
1227
+ S += I;
1228
+ break;
1229
+ }
1230
+ }
1231
+ }
1232
+ const B = Math.min(m, S), q = Math.min(w, O), L = Math.abs(S - m), V = Math.abs(O - w);
1233
+ return {
1234
+ ...u,
1235
+ geometry: {
1236
+ x: B,
1237
+ y: q,
1238
+ w: L,
1239
+ h: V,
1240
+ bounds: {
1241
+ minX: B,
1242
+ minY: q,
1243
+ maxX: B + L,
1244
+ maxY: q + V
1245
+ }
1246
+ }
1247
+ };
1248
+ };
1249
+ function h(u) {
1250
+ R.call(this, t, u);
1251
+ }
1252
+ function d(u) {
1253
+ R.call(this, t, u);
1254
+ }
1255
+ function $(u) {
1256
+ R.call(this, t, u);
1257
+ }
1258
+ return t.$$set = (u) => {
1259
+ "shape" in u && o(0, e = u.shape), "computedStyle" in u && o(1, a = u.computedStyle), "transform" in u && o(2, c = u.transform), "viewportScale" in u && o(3, i = u.viewportScale);
1260
+ }, t.$$.update = () => {
1261
+ t.$$.dirty & /*shape*/
1262
+ 1 && o(4, r = e.geometry);
1263
+ }, [
1264
+ e,
1265
+ a,
1266
+ c,
1267
+ i,
1268
+ r,
1269
+ l,
1270
+ h,
1271
+ d,
1272
+ $
1273
+ ];
1274
+ }
1275
+ class Gn extends yt {
1276
+ constructor(n) {
1277
+ super(), gt(this, n, kn, In, dt, {
1278
+ shape: 0,
1279
+ computedStyle: 1,
1280
+ transform: 2,
1281
+ viewportScale: 3
1282
+ });
1283
+ }
1284
+ }
1285
+ v.RECTANGLE, v.POLYGON;
1286
+ const Nn = (t) => ({}), Ct = (t) => ({ grab: (
1287
+ /*onGrab*/
1288
+ t[0]
1289
+ ) });
1290
+ function Rn(t) {
1291
+ let n, o, r, e;
1292
+ const a = (
1293
+ /*#slots*/
1294
+ t[7].default
1295
+ ), c = Zt(
1296
+ a,
1297
+ t,
1298
+ /*$$scope*/
1299
+ t[6],
1300
+ Ct
1301
+ );
1302
+ return {
1303
+ c() {
1304
+ n = M("g"), c && c.c(), s(n, "class", "a9s-annotation selected");
1305
+ },
1306
+ m(i, l) {
1307
+ E(i, n, l), c && c.m(n, null), o = !0, r || (e = [
1308
+ P(
1309
+ n,
1310
+ "pointerup",
1311
+ /*onRelease*/
1312
+ t[2]
1313
+ ),
1314
+ P(
1315
+ n,
1316
+ "pointermove",
1317
+ /*onPointerMove*/
1318
+ t[1]
1319
+ )
1320
+ ], r = !0);
1321
+ },
1322
+ p(i, [l]) {
1323
+ c && c.p && (!o || l & /*$$scope*/
1324
+ 64) && Yt(
1325
+ c,
1326
+ a,
1327
+ i,
1328
+ /*$$scope*/
1329
+ i[6],
1330
+ o ? vt(
1331
+ a,
1332
+ /*$$scope*/
1333
+ i[6],
1334
+ l,
1335
+ Nn
1336
+ ) : tn(
1337
+ /*$$scope*/
1338
+ i[6]
1339
+ ),
1340
+ Ct
1341
+ );
1342
+ },
1343
+ i(i) {
1344
+ o || (H(c, i), o = !0);
1345
+ },
1346
+ o(i) {
1347
+ G(c, i), o = !1;
1348
+ },
1349
+ d(i) {
1350
+ i && b(n), c && c.d(i), r = !1, F(e);
1351
+ }
1352
+ };
1353
+ }
1354
+ function Fn(t, n, o) {
1355
+ let { $$slots: r = {}, $$scope: e } = n;
1356
+ const a = sn();
1357
+ let { shape: c } = n, { editor: i } = n, { transform: l } = n, h, d, $;
1358
+ const u = (p) => (m) => {
1359
+ h = p, d = l.elementToImage(m.offsetX, m.offsetY), $ = c, m.target.setPointerCapture(m.pointerId), a("grab", m);
1360
+ }, y = (p) => {
1361
+ if (h) {
1362
+ const [m, w] = l.elementToImage(p.offsetX, p.offsetY), S = [m - d[0], w - d[1]];
1363
+ o(3, c = i($, h, S)), a("change", c);
1364
+ }
1365
+ }, g = (p) => {
1366
+ p.target.releasePointerCapture(p.pointerId), h = void 0, $ = c, a("release", p);
1367
+ };
1368
+ return t.$$set = (p) => {
1369
+ "shape" in p && o(3, c = p.shape), "editor" in p && o(4, i = p.editor), "transform" in p && o(5, l = p.transform), "$$scope" in p && o(6, e = p.$$scope);
1370
+ }, [u, y, g, c, i, l, e, r];
1371
+ }
1372
+ class Kt extends yt {
1373
+ constructor(n) {
1374
+ super(), gt(this, n, Fn, Rn, dt, { shape: 3, editor: 4, transform: 5 });
1375
+ }
1376
+ }
1377
+ navigator.userAgent.indexOf("Mac OS X");
30
1378
  export {
31
- v as __require
1379
+ Kt as Editor,
1380
+ Y as Handle,
1381
+ Sn as PolygonEditor,
1382
+ Gn as RectangleEditor,
1383
+ $n as RectangleUtil,
1384
+ v as ShapeType,
1385
+ gn as boundsFromPoints,
1386
+ Pn as isTouch,
1387
+ Lt as registerShapeUtil
32
1388
  };
33
1389
  //# sourceMappingURL=annotorious-react-manifold.es9.js.map