@annotorious/svelte 3.0.0-rc.1 → 3.0.0-rc.10

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 (33) hide show
  1. package/dist/annotorious-svelte.es.js +14 -6
  2. package/dist/annotorious-svelte.es.js.map +1 -1
  3. package/dist/annotorious-svelte.es10.js +120 -2
  4. package/dist/annotorious-svelte.es10.js.map +1 -1
  5. package/dist/annotorious-svelte.es11.js +2 -2
  6. package/dist/annotorious-svelte.es11.js.map +1 -1
  7. package/dist/annotorious-svelte.es12.js +20 -0
  8. package/dist/annotorious-svelte.es12.js.map +1 -0
  9. package/dist/annotorious-svelte.es13.js +7 -0
  10. package/dist/annotorious-svelte.es13.js.map +1 -0
  11. package/dist/annotorious-svelte.es14.js +11 -0
  12. package/dist/annotorious-svelte.es14.js.map +1 -0
  13. package/dist/annotorious-svelte.es15.js +10 -0
  14. package/dist/annotorious-svelte.es15.js.map +1 -0
  15. package/dist/annotorious-svelte.es2.js +1 -1
  16. package/dist/annotorious-svelte.es3.js +2 -110
  17. package/dist/annotorious-svelte.es3.js.map +1 -1
  18. package/dist/annotorious-svelte.es4.js +9 -123
  19. package/dist/annotorious-svelte.es4.js.map +1 -1
  20. package/dist/annotorious-svelte.es5.js +1204 -223
  21. package/dist/annotorious-svelte.es5.js.map +1 -1
  22. package/dist/annotorious-svelte.es6.js +108 -7
  23. package/dist/annotorious-svelte.es6.js.map +1 -1
  24. package/dist/annotorious-svelte.es7.js +125 -2
  25. package/dist/annotorious-svelte.es7.js.map +1 -1
  26. package/dist/annotorious-svelte.es8.js +238 -20518
  27. package/dist/annotorious-svelte.es8.js.map +1 -1
  28. package/dist/annotorious-svelte.es9.js +22148 -115
  29. package/dist/annotorious-svelte.es9.js.map +1 -1
  30. package/dist/index.d.ts +11 -2
  31. package/dist/index.d.ts.map +1 -1
  32. package/package.json +7 -2
  33. package/src/index.ts +53 -5
@@ -1,11 +1,112 @@
1
- const c = (e) => ({
2
- ...e,
3
- subscribe: (s) => {
4
- const t = (r) => s(r.state);
5
- return e.observe(t), s(e.all()), () => e.unobserve(t);
1
+ import { SvelteComponent as g, init as b, safe_not_equal as h, empty as k, insert as w, transition_in as l, transition_out as c, check_outros as A, detach as O, create_slot as v, update_slot_base as C, get_all_dirty_from_scope as q, get_slot_changes as y, group_outros as D, setContext as m } from "./annotorious-svelte.es8.js";
2
+ import { toSvelteStore as N } from "@annotorious/core";
3
+ import { createOSDAnnotator as T } from "./annotorious-svelte.es9.js";
4
+ function d(s) {
5
+ let n;
6
+ const o = (
7
+ /*#slots*/
8
+ s[4].default
9
+ ), t = v(
10
+ o,
11
+ s,
12
+ /*$$scope*/
13
+ s[3],
14
+ null
15
+ );
16
+ return {
17
+ c() {
18
+ t && t.c();
19
+ },
20
+ m(e, i) {
21
+ t && t.m(e, i), n = !0;
22
+ },
23
+ p(e, i) {
24
+ t && t.p && (!n || i & /*$$scope*/
25
+ 8) && C(
26
+ t,
27
+ o,
28
+ e,
29
+ /*$$scope*/
30
+ e[3],
31
+ n ? y(
32
+ o,
33
+ /*$$scope*/
34
+ e[3],
35
+ i,
36
+ null
37
+ ) : q(
38
+ /*$$scope*/
39
+ e[3]
40
+ ),
41
+ null
42
+ );
43
+ },
44
+ i(e) {
45
+ n || (l(t, e), n = !0);
46
+ },
47
+ o(e) {
48
+ c(t, e), n = !1;
49
+ },
50
+ d(e) {
51
+ t && t.d(e);
52
+ }
53
+ };
54
+ }
55
+ function j(s) {
56
+ let n, o, t = (
57
+ /*viewer*/
58
+ s[0] && d(s)
59
+ );
60
+ return {
61
+ c() {
62
+ t && t.c(), n = k();
63
+ },
64
+ m(e, i) {
65
+ t && t.m(e, i), w(e, n, i), o = !0;
66
+ },
67
+ p(e, [i]) {
68
+ /*viewer*/
69
+ e[0] ? t ? (t.p(e, i), i & /*viewer*/
70
+ 1 && l(t, 1)) : (t = d(e), t.c(), l(t, 1), t.m(n.parentNode, n)) : t && (D(), c(t, 1, 1, () => {
71
+ t = null;
72
+ }), A());
73
+ },
74
+ i(e) {
75
+ o || (l(t), o = !0);
76
+ },
77
+ o(e) {
78
+ c(t), o = !1;
79
+ },
80
+ d(e) {
81
+ t && t.d(e), e && O(n);
82
+ }
83
+ };
84
+ }
85
+ function z(s, n, o) {
86
+ let { $$slots: t = {}, $$scope: e } = n, { viewer: i } = n, { opts: f = {} } = n, { anno: a = void 0 } = n;
87
+ const S = (r) => {
88
+ if (r) {
89
+ const u = T(r, f), p = N(u.state.store), _ = {
90
+ ...u,
91
+ state: { ...u.state, store: p }
92
+ };
93
+ m("anno", _), m("viewer", r), o(1, a = _);
94
+ }
95
+ };
96
+ return s.$$set = (r) => {
97
+ "viewer" in r && o(0, i = r.viewer), "opts" in r && o(2, f = r.opts), "anno" in r && o(1, a = r.anno), "$$scope" in r && o(3, e = r.$$scope);
98
+ }, s.$$.update = () => {
99
+ s.$$.dirty & /*viewer*/
100
+ 1 && S(i);
101
+ }, [i, a, f, e, t];
102
+ }
103
+ class B extends g {
104
+ constructor(n) {
105
+ super(), b(this, n, z, j, h, { viewer: 0, opts: 2, anno: 1 });
6
106
  }
7
- });
107
+ }
108
+ const H = B;
8
109
  export {
9
- c as toSvelteStore
110
+ H as default
10
111
  };
11
112
  //# sourceMappingURL=annotorious-svelte.es6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"annotorious-svelte.es6.js","sources":["../../annotorious-core/src/state/SvelteStore.ts"],"sourcesContent":["import type { Annotation, Annotator, AnnotatorState } from '../model';\nimport type { Store } from './Store';\nimport type { StoreChangeEvent } from './StoreObserver';\n\ntype Subscriber<T extends Annotation> = (annotation: T[]) => void; \n\nexport interface SvelteStore<T extends Annotation> extends Store<T> {\n\n subscribe(onChange: Subscriber<T>): void;\n\n}\n\nexport interface SvelteAnnotatorState<T extends Annotation> extends AnnotatorState<T> {\n\n store: SvelteStore<T>\n\n}\n\nexport interface SvelteAnnotator<T extends Annotation> extends Annotator<T> {\n\n state: SvelteAnnotatorState<T>\n\n}\n\n/** \n * A simple wrapper around the event-based store implementation\n * that adds a Svelte shim, for use with the reactive '$' notation.\n * Other frameworks might not actually need this. But it's pretty\n * convenient for everyone using Svelte, as well as for the\n * basic (Svelte-based) Annotorious standard implementation.\n */\nexport const toSvelteStore = <T extends Annotation>(store: Store<T>): SvelteStore<T> => {\n\n const subscribe = (onChange: Subscriber<T>) => {\n\n // Register a store observer on behalf of the subscriber\n const shim = (event: StoreChangeEvent<T>) => onChange(event.state);\n store.observe(shim);\n\n // Immediately call the subscriber function with the\n // current store value, according to the Svelte contract.\n // https://stackoverflow.com/questions/68220955/how-does-svelte-unsubscribe-actually-work\n onChange(store.all());\n\n // Return the unsubscribe function\n return () => store.unobserve(shim);\n }\n\n return {\n ...store,\n subscribe\n }\n\n}"],"names":["toSvelteStore","store","onChange","shim","event"],"mappings":"AA+Ba,MAAAA,IAAgB,CAAuBC,OAiB3C;AAAA,EACL,GAAGA;AAAA,EACH,WAjBgB,CAACC,MAA4B;AAG7C,UAAMC,IAAO,CAACC,MAA+BF,EAASE,EAAM,KAAK;AACjE,WAAAH,EAAM,QAAQE,CAAI,GAKTD,EAAAD,EAAM,KAAK,GAGb,MAAMA,EAAM,UAAUE,CAAI;AAAA,EAAA;AAKjC;"}
1
+ {"version":3,"file":"annotorious-svelte.es6.js","sources":["../src/osd/OpenSeadragonAnnotator.svelte"],"sourcesContent":["<script lang=\"ts\">\n import { setContext } from 'svelte';\n import { SvelteAnnotator, SvelteAnnotatorState, toSvelteStore } from '@annotorious/core';\n import { createOSDAnnotator, ImageAnnotation } from '@annotorious/openseadragon';\n import type OpenSeadragon from 'openseadragon';\n\n /** props **/\n export let viewer: OpenSeadragon.Viewer;\n export let opts = {};\n export let anno: SvelteAnnotator<ImageAnnotation> = undefined;\n\n $: init(viewer);\n\n const init = (viewer: OpenSeadragon.Viewer) => {\n if (viewer) {\n const annotator = createOSDAnnotator(viewer, opts);\n\n // Wrap the store for Svelte reactivity\n const svelteStore = toSvelteStore(annotator.state.store);\n\n const shim = {\n ...annotator,\n state: {\n ...annotator.state,\n store: svelteStore\n } as SvelteAnnotatorState<ImageAnnotation>\n } as SvelteAnnotator<ImageAnnotation>\n\n setContext('anno', shim);\n setContext('viewer', viewer);\n\n anno = shim;\n }\n }\n</script>\n\n{#if viewer}\n <slot />\n{/if}\n"],"names":["ctx","create_if_block","viewer","$$props","opts","anno","init","annotator","createOSDAnnotator","svelteStore","toSvelteStore","shim","setContext","$$invalidate"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoCKA,EAAM,CAAA,KAAAC,EAAAD,CAAA;AAAA;;;;;;;;;;MAANA,EAAM,CAAA;;;;;;;;;;;;;;;;;6CA7BE,QAAAE,EAA4B,IAAAC,KAC5B,MAAAC,IAAI,GAAA,IAAAD,GACJ,EAAA,MAAAE,IAAyC,OAAS,IAAAF;AAIvD,QAAAG,IAAQ,CAAAJ,MAA4B;QACpCA,GAAM;AACF,YAAAK,IAAYC,EAAmBN,GAAQE,CAAI,GAG3CK,IAAcC,EAAcH,EAAU,MAAM,KAAK,GAEjDI,IAAI;AAAA,WACLJ;AAAA,QACH,YACKA,EAAU,OACb,OAAOE,EAAA;AAAA;AAIX,MAAAG,EAAW,QAAQD,CAAI,GACvBC,EAAW,UAAUV,CAAM,GAE3BW,EAAA,GAAAR,IAAOM,CAAI;AAAA;;;;;;SApBZL,EAAKJ,CAAM;AAAA;;;;;;;;"}
@@ -1,3 +1,126 @@
1
- import { nanoid as o } from "./annotorious-svelte.es11.js";
2
- o();
1
+ import { SvelteComponent as H, init as I, safe_not_equal as T, empty as X, insert as P, noop as v, detach as S, component_subscribe as Y, onMount as q, element as x, text as G, attr as L, append as R, action_destroyer as U, listen as _, set_data as z, is_function as B, run_all as F } from "./annotorious-svelte.es8.js";
2
+ import { draggable as J } from "./annotorious-svelte.es10.js";
3
+ import b from "openseadragon";
4
+ import "./annotorious-svelte.es11.js";
5
+ function w(n) {
6
+ let o, e = (
7
+ /*$selection*/
8
+ n[0].selected.map(y).join(", ") + ""
9
+ ), t, s, a, d;
10
+ return {
11
+ c() {
12
+ o = x("div"), t = G(e), L(o, "class", "a9s-popup a9s-osd-popup svelte-1xuxeat");
13
+ },
14
+ m(r, l) {
15
+ P(r, o, l), R(o, t), a || (d = [
16
+ U(s = J.call(null, o, {
17
+ position: { x: (
18
+ /*left*/
19
+ n[1]
20
+ ), y: (
21
+ /*top*/
22
+ n[2]
23
+ ) }
24
+ })),
25
+ _(
26
+ o,
27
+ "neodrag:start",
28
+ /*onDragStart*/
29
+ n[4]
30
+ ),
31
+ _(
32
+ o,
33
+ "neodrag:end",
34
+ /*onDragEnd*/
35
+ n[5]
36
+ )
37
+ ], a = !0);
38
+ },
39
+ p(r, l) {
40
+ l & /*$selection*/
41
+ 1 && e !== (e = /*$selection*/
42
+ r[0].selected.map(y).join(", ") + "") && z(t, e), s && B(s.update) && l & /*left, top*/
43
+ 6 && s.update.call(null, {
44
+ position: { x: (
45
+ /*left*/
46
+ r[1]
47
+ ), y: (
48
+ /*top*/
49
+ r[2]
50
+ ) }
51
+ });
52
+ },
53
+ d(r) {
54
+ r && S(o), a = !1, F(d);
55
+ }
56
+ };
57
+ }
58
+ function K(n) {
59
+ let o, e = (
60
+ /*$selection*/
61
+ n[0] && w(n)
62
+ );
63
+ return {
64
+ c() {
65
+ e && e.c(), o = X();
66
+ },
67
+ m(t, s) {
68
+ e && e.m(t, s), P(t, o, s);
69
+ },
70
+ p(t, [s]) {
71
+ /*$selection*/
72
+ t[0] ? e ? e.p(t, s) : (e = w(t), e.c(), e.m(o.parentNode, o)) : e && (e.d(1), e = null);
73
+ },
74
+ i: v,
75
+ o: v,
76
+ d(t) {
77
+ e && e.d(t), t && S(o);
78
+ }
79
+ };
80
+ }
81
+ const y = (n) => n.id;
82
+ function Q(n, o, e) {
83
+ let t, { state: s } = o, { viewer: a } = o, d, r, l = !1, c;
84
+ const { selection: m, store: u } = s;
85
+ Y(n, m, (i) => e(0, t = i));
86
+ const g = (i) => {
87
+ var p;
88
+ return ((p = i.selected) == null ? void 0 : p.length) > 0;
89
+ }, E = () => {
90
+ l = !0, a.setMouseNavEnabled(!1);
91
+ }, D = () => {
92
+ a.setMouseNavEnabled(!0);
93
+ }, N = () => {
94
+ c && u.unobserve(c), g(t) && (l = !1, f(t), c = (i) => {
95
+ l || f(t);
96
+ }, u.observe(c, {
97
+ annotations: t.selected.map((i) => i.id)
98
+ }));
99
+ }, f = (i) => {
100
+ const p = i.selected[0].id, O = u.getAnnotation(p), { minX: h, minY: k, maxX: C, maxY: M } = O.target.selector.geometry.bounds, V = 14, j = a.viewport.imageToViewerElementCoordinates(new b.Point(h, k)), A = a.viewport.imageToViewerElementCoordinates(new b.Point(C, M));
101
+ e(1, d = A.x + V), e(2, r = j.y);
102
+ };
103
+ return q(() => {
104
+ const i = () => {
105
+ g(t) && !l && f(t);
106
+ };
107
+ return a.addHandler("update-viewport", i), () => {
108
+ a.removeHandler("update-viewport", i);
109
+ };
110
+ }), n.$$set = (i) => {
111
+ "state" in i && e(6, s = i.state), "viewer" in i && e(7, a = i.viewer);
112
+ }, n.$$.update = () => {
113
+ n.$$.dirty & /*$selection*/
114
+ 1 && N();
115
+ }, [t, d, r, m, E, D, s, a];
116
+ }
117
+ class W extends H {
118
+ constructor(o) {
119
+ super(), I(this, o, Q, K, T, { state: 6, viewer: 7 });
120
+ }
121
+ }
122
+ const oe = W;
123
+ export {
124
+ oe as default
125
+ };
3
126
  //# sourceMappingURL=annotorious-svelte.es7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"annotorious-svelte.es7.js","sources":["../../annotorious-core/src/presence/PresenceState.ts"],"sourcesContent":["import { nanoid } from 'nanoid';\nimport { createNanoEvents, type Unsubscribe } from 'nanoevents';\nimport type { User } from '../model';\nimport type { PresentUser } from './PresentUser';\nimport type { PresenceEvents } from './PresenceEvents';\nimport { createDefaultAppearenceProvider } from './AppearanceProvider';\nimport type { AppearanceProvider } from './AppearanceProvider';\n\nexport interface PresenceState {\n\n // Get users currently present to this room\n getPresentUsers(): PresentUser[];\n\n // Notify of a given present user's activity on the given annotations\n notifyActivity(presenceKey: string, annotationIds: string[]): void;\n\n // Add a listener for the given presence event\n on<E extends keyof PresenceEvents>(event: E, callback: PresenceEvents[E]): Unsubscribe;\n\n // Initial sync - which users are present under which keys\n syncUsers(state: { presenceKey: string, user: User }[]): void;\n\n // Update the selection state for the given prresent user\n updateSelection(presenceKey: string, selection: string[] | null): void;\n\n}\n\nconst isListEqual = (listA: any[], listB: any[]) => \n listA.every(a => listA.includes(a)) && listB.every(b => listA.includes(b));\n\n// This client's presence key\nexport const PRESENCE_KEY = nanoid();\n\nexport const createPresenceState = (\n appearanceProvider: AppearanceProvider = createDefaultAppearenceProvider()\n): PresenceState => {\n\n const emitter = createNanoEvents<PresenceEvents>();\n\n const presentUsers = new Map<string, PresentUser>();\n\n const selectionStates = new Map<string, string[]>();\n\n const addUser = (presenceKey: string, user: User) => {\n if (presentUsers.has(presenceKey)) {\n console.warn('Attempt to add user that is already present', presenceKey, user);\n return; \n }\n\n const appearance = appearanceProvider.addUser(presenceKey, user);\n\n presentUsers.set(presenceKey, { \n ...user,\n presenceKey,\n appearance\n });\n }\n\n const removeUser = (presenceKey: string) => {\n const user = presentUsers.get(presenceKey);\n if (!user) {\n console.warn('Attempt to remove user that is not present', presenceKey);\n return;\n }\n\n appearanceProvider.removeUser(user);\n\n presentUsers.delete(presenceKey);\n }\n\n const syncUsers = (state: { presenceKey: string, user: User }[]) => {\n // const keys = new Set(others.map(s => s.presenceKey));\n const keys = new Set(state.map(s => s.presenceKey));\n\n // These users need to be added to the presentUsers list\n // const toAdd = others.filter(({ presenceKey }) => !presentUsers.has(presenceKey));\n const toAdd = state.filter(({ presenceKey }) => !presentUsers.has(presenceKey));\n\n // These users need to be dropped from the list\n const toRemove = Array.from(presentUsers.values()).filter(presentUser =>\n !keys.has(presentUser.presenceKey));\n\n toAdd.forEach(({ presenceKey, user }) => addUser(presenceKey, user));\n\n toRemove.forEach(user => {\n const { presenceKey } = user;\n\n // If this user has a selection, fire deselect event\n if (selectionStates.has(presenceKey))\n emitter.emit('selectionChange', user, null);\n\n removeUser(presenceKey)\n });\n\n if (toAdd.length > 0 || toRemove.length > 0)\n emitter.emit('presence', getPresentUsers());\n }\n\n const notifyActivity = (presenceKey: string, annotationIds: string[]) => { \n const user = presentUsers.get(presenceKey);\n \n if (!user) {\n console.warn('Activity notification from user that is not present');\n return;\n }\n\n const currentSelection = selectionStates.get(presenceKey);\n\n // Was there a selection change we might have missed?\n if (!currentSelection || !isListEqual(currentSelection, annotationIds)) {\n selectionStates.set(presenceKey, annotationIds);\n emitter.emit('selectionChange', user, annotationIds);\n }\n }\n\n const updateSelection = (presenceKey: string, selection: string[] | null) => {\n const from = presentUsers.get(presenceKey);\n if (!from) {\n console.warn('Selection change for user that is not present', presenceKey);\n return;\n }\n\n if (selection)\n selectionStates.set(presenceKey, selection);\n else \n selectionStates.delete(presenceKey);\n\n emitter.emit('selectionChange', from, selection);\n }\n\n const getPresentUsers = () =>\n [...Array.from(presentUsers.values())];\n \n const on = <E extends keyof PresenceEvents>(event: E, callback: PresenceEvents[E]) =>\n emitter.on(event, callback);\n\n return {\n getPresentUsers,\n notifyActivity,\n on,\n syncUsers,\n updateSelection\n }\n\n}"],"names":["nanoid"],"mappings":";AA+B4BA,EAAO;"}
1
+ {"version":3,"file":"annotorious-svelte.es7.js","sources":["../src/osd/OpenSeadragonPopup.svelte"],"sourcesContent":["<script lang=\"ts\">\n import { onMount } from 'svelte';\n import { draggable } from '@neodrag/svelte';\n import OpenSeadragon from 'openseadragon';\n import type { Selection, StoreChangeEvent, SvelteAnnotatorState } from '@annotorious/core';\n import type { ImageAnnotation } from '@annotorious/annotorious';\n\n export let state: SvelteAnnotatorState<ImageAnnotation>;\n\n export let viewer: OpenSeadragon.Viewer;\n\n let left: number;\n\n let top: number;\n\n let dragged = false;\n\n let storeObserver: (event: StoreChangeEvent<ImageAnnotation>) => void;\n\n const { selection, store } = state; \n\n const isSelected = (selection: Selection) => selection.selected?.length > 0;\n\n const onDragStart = () => {\n dragged = true;\n viewer.setMouseNavEnabled(false);\n }\n\n const onDragEnd = () => {\n viewer.setMouseNavEnabled(true);\n }\n\n $: $selection, onSelect();\n\n const onSelect = () => {\n if (storeObserver)\n store.unobserve(storeObserver);\n\n if (isSelected($selection)) {\n dragged = false;\n\n setPosition($selection);\n\n storeObserver = (event: StoreChangeEvent<ImageAnnotation>) => {\n if (!dragged)\n setPosition($selection);\n }\n\n store.observe(storeObserver, { annotations: $selection.selected.map(s => s.id) });\n }\n }\n\n const setPosition = (selection: Selection) => {\n // Note: this demo popup only supports a single selection\n const selectedId = selection.selected[0].id;\n const annotation = store.getAnnotation(selectedId);\n\n const { minX, minY, maxX, maxY } = annotation.target.selector.geometry.bounds;\n\n const PADDING = 14;\n\n const topLeft = viewer.viewport.imageToViewerElementCoordinates(new OpenSeadragon.Point(minX, minY));\n const bottomRight = viewer.viewport.imageToViewerElementCoordinates(new OpenSeadragon.Point(maxX, maxY));\n\n // [left, top] = defaultStrategy(annotation, lastPointerDown);\n left = bottomRight.x + PADDING;\n top = topLeft.y;\n }\n\n onMount(() => {\n const onUpdateViewport = () => {\n if (isSelected($selection) && !dragged)\n setPosition($selection);\n }\n\n viewer.addHandler('update-viewport', onUpdateViewport);\n\n return () => {\n viewer.removeHandler('update-viewport', onUpdateViewport);\n }\n });\n</script>\n\n{#if $selection}\n <div \n class=\"a9s-popup a9s-osd-popup\"\n use:draggable={{ position: { x: left, y: top }}}\n on:neodrag:start={onDragStart}\n on:neodrag:end={onDragEnd}>\n {$selection.selected.map(s => s.id).join(', ')}\n </div>\n{/if}\n\n<style>\n .a9s-osd-popup {\n background-color: #fff;\n border: 1px solid #a2a2a2;\n height: 250px;\n position: absolute;\n width: 400px;\n z-index: 1;\n }\n</style>"],"names":["t_value","ctx","func","insert","target","div","anchor","dirty","set_data","create_if_block","s","state","$$props","viewer","left","top","dragged","storeObserver","selection","store","isSelected","_a","onDragStart","onDragEnd","onSelect","$selection","setPosition","event","selectedId","annotation","minX","minY","maxX","maxY","PADDING","topLeft","OpenSeadragon","bottomRight","$$invalidate","onMount","onUpdateViewport"],"mappings":";;;;;SAyFKA;AAAA;AAAA,IAAAC,KAAW,SAAS,IAAeC,CAAA,EAAA,KAAK,IAAI,IAAA;AAAA;;;;;;AAL/C,MAAAC,EAMKC,GAAAC,GAAAC,CAAA;;UAJc,YAAY;AAAA;AAAA,YAAGL,EAAM,CAAA;AAAA,aAAA;AAAA;AAAA,YAAGA,EAAG,CAAA;AAAA,YAAA;AAAA;;;;;UAC1BA,EAAW,CAAA;AAAA,QAAA;AAAA;;;;UACbA,EAAS,CAAA;AAAA,QAAA;AAAA;;;AACxB,MAAAM;AAAA,MAAA,KAAAP,OAAAA;AAAA,MAAAC,KAAW,SAAS,IAAeC,CAAA,EAAA,KAAK,IAAI,IAAA,OAAAM,EAAA,GAAAR,CAAA;;QAH5B,YAAY;AAAA;AAAA,UAAGC,EAAM,CAAA;AAAA,WAAA;AAAA;AAAA,UAAGA,EAAG,CAAA;AAAA,UAAA;AAAA;;;;;;;;;;IAH3CA,EAAU,CAAA,KAAAQ,EAAAR,CAAA;AAAA;;;;;;;;;;MAAVA,EAAU,CAAA;;;;;;;;;UAMc,CAAAS,MAAKA,EAAE;;WAlFvB,OAAAC,EAA4C,IAAAC,KAE5C,QAAAC,EAA4B,IAAAD,GAEnCE,GAEAC,GAEAC,IAAU,IAEVC;UAEI,WAAAC,GAAW,OAAAC,EAAK,IAAKR;;QAEvBS,IAAc,CAAAF,MAAyB;;AAAA,aAAAG,IAAAH,EAAU,aAAV,gBAAAG,EAAoB,UAAS;AAAA,KAEpEC,IAAW,MAAA;AACf,IAAAN,IAAU,IACVH,EAAO,mBAAmB,EAAK;AAAA,KAG3BU,IAAS,MAAA;AACb,IAAAV,EAAO,mBAAmB,EAAI;AAAA,KAK1BW,IAAQ,MAAA;AACR,IAAAP,KACFE,EAAM,UAAUF,CAAa,GAE3BG,EAAWK,CAAU,MACvBT,IAAU,IAEVU,EAAYD,CAAU,GAEtBR,IAAiB,CAAAU,MAAwC;MAClDX,KACHU,EAAYD,CAAU;AAAA,OAG1BN,EAAM,QAAQF,GAAa;AAAA,MAAI,aAAaQ,EAAW,SAAS,IAAI,CAAAf,MAAKA,EAAE,EAAE;AAAA;KAI3EgB,IAAe,CAAAR,MAAoB;AAEjC,UAAAU,IAAaV,EAAU,SAAS,CAAC,EAAE,IACnCW,IAAaV,EAAM,cAAcS,CAAU,GAEzC,EAAA,MAAAE,GAAM,MAAAC,GAAM,MAAAC,GAAM,MAAAC,EAAI,IAAKJ,EAAW,OAAO,SAAS,SAAS,QAEjEK,IAAU,IAEVC,IAAUtB,EAAO,SAAS,gCAAoC,IAAAuB,EAAc,MAAMN,GAAMC,CAAI,CAAA,GAC5FM,IAAcxB,EAAO,SAAS,gCAAoC,IAAAuB,EAAc,MAAMJ,GAAMC,CAAI,CAAA;AAGtG,IAAAK,EAAA,GAAAxB,IAAOuB,EAAY,IAAIH,CAAO,QAC9BnB,IAAMoB,EAAQ,CAAC;AAAA;AAGjB,SAAAI,EAAO,MAAA;UACCC,IAAgB,MAAA;AAChB,MAAApB,EAAWK,CAAU,KAAA,CAAMT,KAC7BU,EAAYD,CAAU;AAAA;AAG1B,WAAAZ,EAAO,WAAW,mBAAmB2B,CAAgB;AAGnD,MAAA3B,EAAO,cAAc,mBAAmB2B,CAAgB;AAAA;;;;;SA9C7ChB,EAAQ;AAAA;;;;;;;;"}