@drawnagency/primitives 0.1.57 → 0.1.58

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.
@@ -0,0 +1,1779 @@
1
+ import {
2
+ require_defineProperty
3
+ } from "./chunk-ESE5UBQI.js";
4
+ import {
5
+ __commonJS,
6
+ __toESM
7
+ } from "./chunk-JSBRDJBE.js";
8
+
9
+ // ../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/arrayWithHoles.js
10
+ var require_arrayWithHoles = __commonJS({
11
+ "../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/arrayWithHoles.js"(exports, module) {
12
+ "use strict";
13
+ function _arrayWithHoles(r) {
14
+ if (Array.isArray(r)) return r;
15
+ }
16
+ module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
17
+ }
18
+ });
19
+
20
+ // ../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js
21
+ var require_iterableToArrayLimit = __commonJS({
22
+ "../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"(exports, module) {
23
+ "use strict";
24
+ function _iterableToArrayLimit(r, l) {
25
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
26
+ if (null != t) {
27
+ var e, n, i, u, a = [], f = true, o = false;
28
+ try {
29
+ if (i = (t = t.call(r)).next, 0 === l) {
30
+ if (Object(t) !== t) return;
31
+ f = false;
32
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ;
33
+ } catch (r2) {
34
+ o = true, n = r2;
35
+ } finally {
36
+ try {
37
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
38
+ } finally {
39
+ if (o) throw n;
40
+ }
41
+ }
42
+ return a;
43
+ }
44
+ }
45
+ module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
46
+ }
47
+ });
48
+
49
+ // ../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/arrayLikeToArray.js
50
+ var require_arrayLikeToArray = __commonJS({
51
+ "../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/arrayLikeToArray.js"(exports, module) {
52
+ "use strict";
53
+ function _arrayLikeToArray3(r, a) {
54
+ (null == a || a > r.length) && (a = r.length);
55
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
56
+ return n;
57
+ }
58
+ module.exports = _arrayLikeToArray3, module.exports.__esModule = true, module.exports["default"] = module.exports;
59
+ }
60
+ });
61
+
62
+ // ../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js
63
+ var require_unsupportedIterableToArray = __commonJS({
64
+ "../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"(exports, module) {
65
+ "use strict";
66
+ var arrayLikeToArray = require_arrayLikeToArray();
67
+ function _unsupportedIterableToArray3(r, a) {
68
+ if (r) {
69
+ if ("string" == typeof r) return arrayLikeToArray(r, a);
70
+ var t = {}.toString.call(r).slice(8, -1);
71
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;
72
+ }
73
+ }
74
+ module.exports = _unsupportedIterableToArray3, module.exports.__esModule = true, module.exports["default"] = module.exports;
75
+ }
76
+ });
77
+
78
+ // ../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/nonIterableRest.js
79
+ var require_nonIterableRest = __commonJS({
80
+ "../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/nonIterableRest.js"(exports, module) {
81
+ "use strict";
82
+ function _nonIterableRest() {
83
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
84
+ }
85
+ module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
86
+ }
87
+ });
88
+
89
+ // ../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/slicedToArray.js
90
+ var require_slicedToArray = __commonJS({
91
+ "../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/slicedToArray.js"(exports, module) {
92
+ "use strict";
93
+ var arrayWithHoles = require_arrayWithHoles();
94
+ var iterableToArrayLimit = require_iterableToArrayLimit();
95
+ var unsupportedIterableToArray = require_unsupportedIterableToArray();
96
+ var nonIterableRest = require_nonIterableRest();
97
+ function _slicedToArray3(r, e) {
98
+ return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();
99
+ }
100
+ module.exports = _slicedToArray3, module.exports.__esModule = true, module.exports["default"] = module.exports;
101
+ }
102
+ });
103
+
104
+ // ../../node_modules/.pnpm/bind-event-listener@3.0.0/node_modules/bind-event-listener/dist/bind.js
105
+ var require_bind = __commonJS({
106
+ "../../node_modules/.pnpm/bind-event-listener@3.0.0/node_modules/bind-event-listener/dist/bind.js"(exports) {
107
+ "use strict";
108
+ Object.defineProperty(exports, "__esModule", { value: true });
109
+ exports.bind = void 0;
110
+ function bind3(target, _a) {
111
+ var type = _a.type, listener = _a.listener, options = _a.options;
112
+ target.addEventListener(type, listener, options);
113
+ return function unbind() {
114
+ target.removeEventListener(type, listener, options);
115
+ };
116
+ }
117
+ exports.bind = bind3;
118
+ }
119
+ });
120
+
121
+ // ../../node_modules/.pnpm/bind-event-listener@3.0.0/node_modules/bind-event-listener/dist/bind-all.js
122
+ var require_bind_all = __commonJS({
123
+ "../../node_modules/.pnpm/bind-event-listener@3.0.0/node_modules/bind-event-listener/dist/bind-all.js"(exports) {
124
+ "use strict";
125
+ var __assign = exports && exports.__assign || function() {
126
+ __assign = Object.assign || function(t) {
127
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
128
+ s = arguments[i];
129
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
130
+ t[p] = s[p];
131
+ }
132
+ return t;
133
+ };
134
+ return __assign.apply(this, arguments);
135
+ };
136
+ Object.defineProperty(exports, "__esModule", { value: true });
137
+ exports.bindAll = void 0;
138
+ var bind_1 = require_bind();
139
+ function toOptions(value) {
140
+ if (typeof value === "undefined") {
141
+ return void 0;
142
+ }
143
+ if (typeof value === "boolean") {
144
+ return {
145
+ capture: value
146
+ };
147
+ }
148
+ return value;
149
+ }
150
+ function getBinding(original, sharedOptions) {
151
+ if (sharedOptions == null) {
152
+ return original;
153
+ }
154
+ var binding = __assign(__assign({}, original), { options: __assign(__assign({}, toOptions(sharedOptions)), toOptions(original.options)) });
155
+ return binding;
156
+ }
157
+ function bindAll4(target, bindings, sharedOptions) {
158
+ var unbinds = bindings.map(function(original) {
159
+ var binding = getBinding(original, sharedOptions);
160
+ return (0, bind_1.bind)(target, binding);
161
+ });
162
+ return function unbindAll() {
163
+ unbinds.forEach(function(unbind) {
164
+ return unbind();
165
+ });
166
+ };
167
+ }
168
+ exports.bindAll = bindAll4;
169
+ }
170
+ });
171
+
172
+ // ../../node_modules/.pnpm/bind-event-listener@3.0.0/node_modules/bind-event-listener/dist/index.js
173
+ var require_dist = __commonJS({
174
+ "../../node_modules/.pnpm/bind-event-listener@3.0.0/node_modules/bind-event-listener/dist/index.js"(exports) {
175
+ "use strict";
176
+ Object.defineProperty(exports, "__esModule", { value: true });
177
+ exports.bindAll = exports.bind = void 0;
178
+ var bind_1 = require_bind();
179
+ Object.defineProperty(exports, "bind", { enumerable: true, get: function() {
180
+ return bind_1.bind;
181
+ } });
182
+ var bind_all_1 = require_bind_all();
183
+ Object.defineProperty(exports, "bindAll", { enumerable: true, get: function() {
184
+ return bind_all_1.bindAll;
185
+ } });
186
+ }
187
+ });
188
+
189
+ // ../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js
190
+ var require_arrayWithoutHoles = __commonJS({
191
+ "../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js"(exports, module) {
192
+ "use strict";
193
+ var arrayLikeToArray = require_arrayLikeToArray();
194
+ function _arrayWithoutHoles(r) {
195
+ if (Array.isArray(r)) return arrayLikeToArray(r);
196
+ }
197
+ module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
198
+ }
199
+ });
200
+
201
+ // ../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/iterableToArray.js
202
+ var require_iterableToArray = __commonJS({
203
+ "../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/iterableToArray.js"(exports, module) {
204
+ "use strict";
205
+ function _iterableToArray(r) {
206
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
207
+ }
208
+ module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
209
+ }
210
+ });
211
+
212
+ // ../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/nonIterableSpread.js
213
+ var require_nonIterableSpread = __commonJS({
214
+ "../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/nonIterableSpread.js"(exports, module) {
215
+ "use strict";
216
+ function _nonIterableSpread() {
217
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
218
+ }
219
+ module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
220
+ }
221
+ });
222
+
223
+ // ../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/toConsumableArray.js
224
+ var require_toConsumableArray = __commonJS({
225
+ "../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/toConsumableArray.js"(exports, module) {
226
+ "use strict";
227
+ var arrayWithoutHoles = require_arrayWithoutHoles();
228
+ var iterableToArray = require_iterableToArray();
229
+ var unsupportedIterableToArray = require_unsupportedIterableToArray();
230
+ var nonIterableSpread = require_nonIterableSpread();
231
+ function _toConsumableArray3(r) {
232
+ return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread();
233
+ }
234
+ module.exports = _toConsumableArray3, module.exports.__esModule = true, module.exports["default"] = module.exports;
235
+ }
236
+ });
237
+
238
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter.js
239
+ var import_slicedToArray2 = __toESM(require_slicedToArray());
240
+ var import_bind_event_listener4 = __toESM(require_dist());
241
+
242
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/get-element-from-point-without-honey-pot.js
243
+ var import_slicedToArray = __toESM(require_slicedToArray());
244
+
245
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/honey-pot-data-attribute.js
246
+ var honeyPotDataAttribute = "data-pdnd-honey-pot";
247
+
248
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/is-honey-pot-element.js
249
+ function isHoneyPotElement(target) {
250
+ return target instanceof Element && target.hasAttribute(honeyPotDataAttribute);
251
+ }
252
+
253
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/get-element-from-point-without-honey-pot.js
254
+ function getElementFromPointWithoutHoneypot(client) {
255
+ var _document$elementsFro = document.elementsFromPoint(client.x, client.y), _document$elementsFro2 = (0, import_slicedToArray.default)(_document$elementsFro, 2), top = _document$elementsFro2[0], second = _document$elementsFro2[1];
256
+ if (!top) {
257
+ return null;
258
+ }
259
+ if (isHoneyPotElement(top)) {
260
+ return second !== null && second !== void 0 ? second : null;
261
+ }
262
+ return top;
263
+ }
264
+
265
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/make-honey-pot-fix.js
266
+ var import_defineProperty = __toESM(require_defineProperty());
267
+ var import_bind_event_listener = __toESM(require_dist());
268
+
269
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/max-z-index.js
270
+ var maxZIndex = 2147483647;
271
+
272
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/popover-reset-styles.js
273
+ var popoverResetUserAgentStyles = {
274
+ inset: "unset",
275
+ border: "none",
276
+ padding: 0,
277
+ margin: 0,
278
+ overflow: "visible",
279
+ color: "inherit",
280
+ background: "transparent"
281
+ };
282
+
283
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/once.js
284
+ function once(fn) {
285
+ var cache = null;
286
+ return function wrapped() {
287
+ if (!cache) {
288
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
289
+ args[_key] = arguments[_key];
290
+ }
291
+ var result = fn.apply(this, args);
292
+ cache = {
293
+ result
294
+ };
295
+ }
296
+ return cache.result;
297
+ };
298
+ }
299
+
300
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/supports-popover.js
301
+ var supportsPopover = once(function supportsPopover2() {
302
+ return typeof HTMLElement !== "undefined" && typeof HTMLElement.prototype.showPopover === "function";
303
+ });
304
+
305
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/make-honey-pot-fix.js
306
+ function ownKeys(e, r) {
307
+ var t = Object.keys(e);
308
+ if (Object.getOwnPropertySymbols) {
309
+ var o = Object.getOwnPropertySymbols(e);
310
+ r && (o = o.filter(function(r2) {
311
+ return Object.getOwnPropertyDescriptor(e, r2).enumerable;
312
+ })), t.push.apply(t, o);
313
+ }
314
+ return t;
315
+ }
316
+ function _objectSpread(e) {
317
+ for (var r = 1; r < arguments.length; r++) {
318
+ var t = null != arguments[r] ? arguments[r] : {};
319
+ r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
320
+ (0, import_defineProperty.default)(e, r2, t[r2]);
321
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
322
+ Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
323
+ });
324
+ }
325
+ return e;
326
+ }
327
+ var honeyPotSize = 2;
328
+ var halfHoneyPotSize = honeyPotSize / 2;
329
+ function floorToClosestPixel(point) {
330
+ return {
331
+ x: Math.floor(point.x),
332
+ y: Math.floor(point.y)
333
+ };
334
+ }
335
+ function pullBackByHalfHoneyPotSize(point) {
336
+ return {
337
+ x: point.x - halfHoneyPotSize,
338
+ y: point.y - halfHoneyPotSize
339
+ };
340
+ }
341
+ function preventGoingBackwardsOffScreen(point) {
342
+ return {
343
+ x: Math.max(point.x, 0),
344
+ y: Math.max(point.y, 0)
345
+ };
346
+ }
347
+ function preventGoingForwardsOffScreen(point) {
348
+ return {
349
+ x: Math.min(point.x, window.innerWidth - honeyPotSize),
350
+ y: Math.min(point.y, window.innerHeight - honeyPotSize)
351
+ };
352
+ }
353
+ function getHoneyPotRectFor(_ref) {
354
+ var client = _ref.client;
355
+ var point = preventGoingForwardsOffScreen(preventGoingBackwardsOffScreen(pullBackByHalfHoneyPotSize(floorToClosestPixel(client))));
356
+ return DOMRect.fromRect({
357
+ x: point.x,
358
+ y: point.y,
359
+ width: honeyPotSize,
360
+ height: honeyPotSize
361
+ });
362
+ }
363
+ function getRectStyles(_ref2) {
364
+ var clientRect = _ref2.clientRect;
365
+ return {
366
+ left: "".concat(clientRect.left, "px"),
367
+ top: "".concat(clientRect.top, "px"),
368
+ width: "".concat(clientRect.width, "px"),
369
+ height: "".concat(clientRect.height, "px")
370
+ };
371
+ }
372
+ function isWithin(_ref3) {
373
+ var client = _ref3.client, clientRect = _ref3.clientRect;
374
+ return (
375
+ // is within horizontal bounds
376
+ client.x >= clientRect.x && client.x <= clientRect.x + clientRect.width && // is within vertical bounds
377
+ client.y >= clientRect.y && client.y <= clientRect.y + clientRect.height
378
+ );
379
+ }
380
+ function mountHoneyPot(_ref4) {
381
+ var initial = _ref4.initial;
382
+ var element = document.createElement("div");
383
+ element.setAttribute(honeyPotDataAttribute, "true");
384
+ if (supportsPopover()) {
385
+ element.setAttribute("popover", "manual");
386
+ }
387
+ var clientRect = getHoneyPotRectFor({
388
+ client: initial
389
+ });
390
+ Object.assign(element.style, _objectSpread(_objectSpread({
391
+ position: "fixed"
392
+ }, supportsPopover() ? (
393
+ // needs to come first as it has 'inset: unset' which
394
+ // needs to be overridden by our top / left values
395
+ popoverResetUserAgentStyles
396
+ ) : {
397
+ // Fallback: using maximum possible z-index so that this element
398
+ // will always be on top of other positioned content.
399
+ zIndex: maxZIndex
400
+ }), {}, {
401
+ // Setting a background color explicitly to avoid any inherited styles.
402
+ // Looks like this could be `opacity: 0`, but worried that _might_
403
+ // cause the element to be ignored on some platforms.
404
+ // When debugging, set backgroundColor to something like "red".
405
+ backgroundColor: "transparent",
406
+ // Being explicit to avoid inheriting styles
407
+ padding: 0,
408
+ margin: 0,
409
+ boxSizing: "border-box",
410
+ // We want this element to absorb pointer events,
411
+ // it's kind of the whole point 😉
412
+ pointerEvents: "auto"
413
+ }, getRectStyles({
414
+ clientRect
415
+ })));
416
+ document.body.appendChild(element);
417
+ if (supportsPopover()) {
418
+ element.showPopover();
419
+ }
420
+ var unbindPointerMove = (0, import_bind_event_listener.bind)(window, {
421
+ type: "pointermove",
422
+ listener: function listener(event) {
423
+ var client = {
424
+ x: event.clientX,
425
+ y: event.clientY
426
+ };
427
+ clientRect = getHoneyPotRectFor({
428
+ client
429
+ });
430
+ Object.assign(element.style, getRectStyles({
431
+ clientRect
432
+ }));
433
+ },
434
+ // using capture so we are less likely to be impacted by event stopping
435
+ options: {
436
+ capture: true
437
+ }
438
+ });
439
+ return function finish(_ref5) {
440
+ var current = _ref5.current;
441
+ unbindPointerMove();
442
+ if (isWithin({
443
+ client: current,
444
+ clientRect
445
+ })) {
446
+ element.remove();
447
+ return;
448
+ }
449
+ function cleanup() {
450
+ unbindPostDragEvents();
451
+ element.remove();
452
+ }
453
+ var unbindPostDragEvents = (0, import_bind_event_listener.bindAll)(window, [
454
+ {
455
+ type: "pointerdown",
456
+ listener: cleanup
457
+ },
458
+ {
459
+ type: "pointermove",
460
+ listener: cleanup
461
+ },
462
+ {
463
+ type: "focusin",
464
+ listener: cleanup
465
+ },
466
+ {
467
+ type: "focusout",
468
+ listener: cleanup
469
+ },
470
+ // a 'pointerdown' should happen before 'dragstart', but just being super safe
471
+ {
472
+ type: "dragstart",
473
+ listener: cleanup
474
+ },
475
+ // if the user has dragged something out of the window
476
+ // and then is dragging something back into the window
477
+ // the first events we will see are "dragenter" (and then "dragover").
478
+ // So if we see any of these we need to clear the post drag fix.
479
+ {
480
+ type: "dragenter",
481
+ listener: cleanup
482
+ },
483
+ {
484
+ type: "dragover",
485
+ listener: cleanup
486
+ }
487
+ // Not adding a "wheel" event listener, as "wheel" by itself does not
488
+ // resolve the bug.
489
+ ], {
490
+ // Using `capture` so less likely to be impacted by other code stopping events
491
+ capture: true
492
+ });
493
+ };
494
+ }
495
+ function makeHoneyPotFix() {
496
+ var latestPointerMove = null;
497
+ function bindEvents() {
498
+ latestPointerMove = null;
499
+ return (0, import_bind_event_listener.bind)(window, {
500
+ type: "pointermove",
501
+ listener: function listener(event) {
502
+ latestPointerMove = {
503
+ x: event.clientX,
504
+ y: event.clientY
505
+ };
506
+ },
507
+ // listening for pointer move in capture phase
508
+ // so we are less likely to be impacted by events being stopped.
509
+ options: {
510
+ capture: true
511
+ }
512
+ });
513
+ }
514
+ function getOnPostDispatch() {
515
+ var finish = null;
516
+ return function onPostEvent(_ref6) {
517
+ var eventName = _ref6.eventName, payload = _ref6.payload;
518
+ if (eventName === "onDragStart") {
519
+ var input = payload.location.initial.input;
520
+ var initial = latestPointerMove !== null && latestPointerMove !== void 0 ? latestPointerMove : {
521
+ x: input.clientX,
522
+ y: input.clientY
523
+ };
524
+ finish = mountHoneyPot({
525
+ initial
526
+ });
527
+ }
528
+ if (eventName === "onDrop") {
529
+ var _finish;
530
+ var _input = payload.location.current.input;
531
+ (_finish = finish) === null || _finish === void 0 || _finish({
532
+ current: {
533
+ x: _input.clientX,
534
+ y: _input.clientY
535
+ }
536
+ });
537
+ finish = null;
538
+ latestPointerMove = null;
539
+ }
540
+ };
541
+ }
542
+ return {
543
+ bindEvents,
544
+ getOnPostDispatch
545
+ };
546
+ }
547
+
548
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/lifecycle-manager.js
549
+ var import_toConsumableArray = __toESM(require_toConsumableArray());
550
+ var import_bind_event_listener3 = __toESM(require_dist());
551
+
552
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-firefox.js
553
+ var isFirefox = once(function isFirefox2() {
554
+ if (process.env.NODE_ENV === "test") {
555
+ return false;
556
+ }
557
+ return navigator.userAgent.includes("Firefox");
558
+ });
559
+
560
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-safari.js
561
+ var isSafari = once(function isSafari2() {
562
+ if (process.env.NODE_ENV === "test") {
563
+ return false;
564
+ }
565
+ var _navigator = navigator, userAgent = _navigator.userAgent;
566
+ return userAgent.includes("AppleWebKit") && !userAgent.includes("Chrome");
567
+ });
568
+
569
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js
570
+ var import_bind_event_listener2 = __toESM(require_dist());
571
+ var symbols = {
572
+ isLeavingWindow: /* @__PURE__ */ Symbol("leaving"),
573
+ isEnteringWindow: /* @__PURE__ */ Symbol("entering")
574
+ };
575
+ function isLeavingWindowInSafari(_ref2) {
576
+ var dragLeave = _ref2.dragLeave;
577
+ if (!isSafari()) {
578
+ return false;
579
+ }
580
+ return dragLeave.hasOwnProperty(symbols.isLeavingWindow);
581
+ }
582
+ (function fixSafari() {
583
+ if (typeof window === "undefined") {
584
+ return;
585
+ }
586
+ if (process.env.NODE_ENV === "test") {
587
+ return;
588
+ }
589
+ if (!isSafari()) {
590
+ return;
591
+ }
592
+ function getInitialState() {
593
+ return {
594
+ enterCount: 0,
595
+ isOverWindow: false
596
+ };
597
+ }
598
+ var state = getInitialState();
599
+ function resetState() {
600
+ state = getInitialState();
601
+ }
602
+ (0, import_bind_event_listener2.bindAll)(
603
+ window,
604
+ [{
605
+ type: "dragstart",
606
+ listener: function listener() {
607
+ state.enterCount = 0;
608
+ state.isOverWindow = true;
609
+ }
610
+ }, {
611
+ type: "drop",
612
+ listener: resetState
613
+ }, {
614
+ type: "dragend",
615
+ listener: resetState
616
+ }, {
617
+ type: "dragenter",
618
+ listener: function listener(event) {
619
+ if (!state.isOverWindow && state.enterCount === 0) {
620
+ event[symbols.isEnteringWindow] = true;
621
+ }
622
+ state.isOverWindow = true;
623
+ state.enterCount++;
624
+ }
625
+ }, {
626
+ type: "dragleave",
627
+ listener: function listener(event) {
628
+ state.enterCount--;
629
+ if (state.isOverWindow && state.enterCount === 0) {
630
+ event[symbols.isLeavingWindow] = true;
631
+ state.isOverWindow = false;
632
+ }
633
+ }
634
+ }],
635
+ // using `capture: true` so that adding event listeners
636
+ // in bubble phase will have the correct symbols
637
+ {
638
+ capture: true
639
+ }
640
+ );
641
+ })();
642
+
643
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-from-another-window.js
644
+ function isNodeLike(target) {
645
+ return "nodeName" in target;
646
+ }
647
+ function isFromAnotherWindow(eventTarget) {
648
+ return isNodeLike(eventTarget) && eventTarget.ownerDocument !== document;
649
+ }
650
+
651
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-leaving-window.js
652
+ function isLeavingWindow(_ref) {
653
+ var dragLeave = _ref.dragLeave;
654
+ var type = dragLeave.type, relatedTarget = dragLeave.relatedTarget;
655
+ if (type !== "dragleave") {
656
+ return false;
657
+ }
658
+ if (isSafari()) {
659
+ return isLeavingWindowInSafari({
660
+ dragLeave
661
+ });
662
+ }
663
+ if (relatedTarget == null) {
664
+ return true;
665
+ }
666
+ if (isFirefox()) {
667
+ return isFromAnotherWindow(relatedTarget);
668
+ }
669
+ return relatedTarget instanceof HTMLIFrameElement;
670
+ }
671
+
672
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/detect-broken-drag.js
673
+ function getBindingsForBrokenDrags(_ref) {
674
+ var onDragEnd = _ref.onDragEnd;
675
+ return [
676
+ // ## Detecting drag ending for removed draggables
677
+ //
678
+ // If a draggable element is removed during a drag and the user drops:
679
+ // 1. if over a valid drop target: we get a "drop" event to know the drag is finished
680
+ // 2. if not over a valid drop target (or cancelled): we get nothing
681
+ // The "dragend" event will not fire on the source draggable if it has been
682
+ // removed from the DOM.
683
+ // So we need to figure out if a drag operation has finished by looking at other events
684
+ // We can do this by looking at other events
685
+ // ### First detection: "pointermove" events
686
+ // 1. "pointermove" events cannot fire during a drag and drop operation
687
+ // according to the spec. So if we get a "pointermove" it means that
688
+ // the drag and drop operations has finished. So if we get a "pointermove"
689
+ // we know that the drag is over
690
+ // 2. 🦊😤 Drag and drop operations are _supposed_ to suppress
691
+ // other pointer events. However, firefox will allow a few
692
+ // pointer event to get through after a drag starts.
693
+ // The most I've seen is 3
694
+ {
695
+ type: "pointermove",
696
+ listener: /* @__PURE__ */ (function() {
697
+ var callCount = 0;
698
+ return function listener() {
699
+ if (callCount < 20) {
700
+ callCount++;
701
+ return;
702
+ }
703
+ onDragEnd();
704
+ };
705
+ })()
706
+ },
707
+ // ### Second detection: "pointerdown" events
708
+ // If we receive this event then we know that a drag operation has finished
709
+ // and potentially another one is about to start.
710
+ // Note: `pointerdown` fires on all browsers / platforms before "dragstart"
711
+ {
712
+ type: "pointerdown",
713
+ listener: onDragEnd
714
+ }
715
+ ];
716
+ }
717
+
718
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/get-input.js
719
+ function getInput(event) {
720
+ return {
721
+ altKey: event.altKey,
722
+ button: event.button,
723
+ buttons: event.buttons,
724
+ ctrlKey: event.ctrlKey,
725
+ metaKey: event.metaKey,
726
+ shiftKey: event.shiftKey,
727
+ clientX: event.clientX,
728
+ clientY: event.clientY,
729
+ pageX: event.pageX,
730
+ pageY: event.pageY
731
+ };
732
+ }
733
+
734
+ // ../../node_modules/.pnpm/raf-schd@4.0.3/node_modules/raf-schd/dist/raf-schd.esm.js
735
+ var rafSchd = function rafSchd2(fn) {
736
+ var lastArgs = [];
737
+ var frameId = null;
738
+ var wrapperFn = function wrapperFn2() {
739
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
740
+ args[_key] = arguments[_key];
741
+ }
742
+ lastArgs = args;
743
+ if (frameId) {
744
+ return;
745
+ }
746
+ frameId = requestAnimationFrame(function() {
747
+ frameId = null;
748
+ fn.apply(void 0, lastArgs);
749
+ });
750
+ };
751
+ wrapperFn.cancel = function() {
752
+ if (!frameId) {
753
+ return;
754
+ }
755
+ cancelAnimationFrame(frameId);
756
+ frameId = null;
757
+ };
758
+ return wrapperFn;
759
+ };
760
+ var raf_schd_esm_default = rafSchd;
761
+
762
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dispatch-consumer-event.js
763
+ var scheduleOnDrag = raf_schd_esm_default(function(fn) {
764
+ return fn();
765
+ });
766
+ var dragStart = /* @__PURE__ */ (function() {
767
+ var scheduled = null;
768
+ function schedule(fn) {
769
+ var frameId = requestAnimationFrame(function() {
770
+ scheduled = null;
771
+ fn();
772
+ });
773
+ scheduled = {
774
+ frameId,
775
+ fn
776
+ };
777
+ }
778
+ function flush() {
779
+ if (scheduled) {
780
+ cancelAnimationFrame(scheduled.frameId);
781
+ scheduled.fn();
782
+ scheduled = null;
783
+ }
784
+ }
785
+ return {
786
+ schedule,
787
+ flush
788
+ };
789
+ })();
790
+ function makeDispatch(_ref) {
791
+ var source = _ref.source, initial = _ref.initial, dispatchEvent = _ref.dispatchEvent;
792
+ var previous = {
793
+ dropTargets: []
794
+ };
795
+ function safeDispatch(args) {
796
+ dispatchEvent(args);
797
+ previous = {
798
+ dropTargets: args.payload.location.current.dropTargets
799
+ };
800
+ }
801
+ var dispatch = {
802
+ start: function start2(_ref2) {
803
+ var nativeSetDragImage = _ref2.nativeSetDragImage;
804
+ var location = {
805
+ current: initial,
806
+ previous,
807
+ initial
808
+ };
809
+ safeDispatch({
810
+ eventName: "onGenerateDragPreview",
811
+ payload: {
812
+ source,
813
+ location,
814
+ nativeSetDragImage
815
+ }
816
+ });
817
+ dragStart.schedule(function() {
818
+ safeDispatch({
819
+ eventName: "onDragStart",
820
+ payload: {
821
+ source,
822
+ location
823
+ }
824
+ });
825
+ });
826
+ },
827
+ dragUpdate: function dragUpdate(_ref3) {
828
+ var current = _ref3.current;
829
+ dragStart.flush();
830
+ scheduleOnDrag.cancel();
831
+ safeDispatch({
832
+ eventName: "onDropTargetChange",
833
+ payload: {
834
+ source,
835
+ location: {
836
+ initial,
837
+ previous,
838
+ current
839
+ }
840
+ }
841
+ });
842
+ },
843
+ drag: function drag(_ref4) {
844
+ var current = _ref4.current;
845
+ scheduleOnDrag(function() {
846
+ dragStart.flush();
847
+ var location = {
848
+ initial,
849
+ previous,
850
+ current
851
+ };
852
+ safeDispatch({
853
+ eventName: "onDrag",
854
+ payload: {
855
+ source,
856
+ location
857
+ }
858
+ });
859
+ });
860
+ },
861
+ drop: function drop(_ref5) {
862
+ var current = _ref5.current, updatedSourcePayload = _ref5.updatedSourcePayload;
863
+ dragStart.flush();
864
+ scheduleOnDrag.cancel();
865
+ safeDispatch({
866
+ eventName: "onDrop",
867
+ payload: {
868
+ source: updatedSourcePayload !== null && updatedSourcePayload !== void 0 ? updatedSourcePayload : source,
869
+ location: {
870
+ current,
871
+ previous,
872
+ initial
873
+ }
874
+ }
875
+ });
876
+ }
877
+ };
878
+ return dispatch;
879
+ }
880
+
881
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/lifecycle-manager.js
882
+ var globalState = {
883
+ isActive: false
884
+ };
885
+ function canStart() {
886
+ return !globalState.isActive;
887
+ }
888
+ function getNativeSetDragImage(event) {
889
+ if (event.dataTransfer) {
890
+ return event.dataTransfer.setDragImage.bind(event.dataTransfer);
891
+ }
892
+ return null;
893
+ }
894
+ function hasHierarchyChanged(_ref) {
895
+ var current = _ref.current, next = _ref.next;
896
+ if (current.length !== next.length) {
897
+ return true;
898
+ }
899
+ for (var i = 0; i < current.length; i++) {
900
+ if (current[i].element !== next[i].element) {
901
+ return true;
902
+ }
903
+ }
904
+ return false;
905
+ }
906
+ function start(_ref2) {
907
+ var event = _ref2.event, dragType = _ref2.dragType, getDropTargetsOver = _ref2.getDropTargetsOver, dispatchEvent = _ref2.dispatchEvent;
908
+ if (!canStart()) {
909
+ return;
910
+ }
911
+ var initial = getStartLocation({
912
+ event,
913
+ dragType,
914
+ getDropTargetsOver
915
+ });
916
+ globalState.isActive = true;
917
+ var state = {
918
+ current: initial
919
+ };
920
+ setDropEffectOnEvent({
921
+ event,
922
+ current: initial.dropTargets
923
+ });
924
+ var dispatch = makeDispatch({
925
+ source: dragType.payload,
926
+ dispatchEvent,
927
+ initial
928
+ });
929
+ function updateState(next) {
930
+ var hasChanged = hasHierarchyChanged({
931
+ current: state.current.dropTargets,
932
+ next: next.dropTargets
933
+ });
934
+ state.current = next;
935
+ if (hasChanged) {
936
+ dispatch.dragUpdate({
937
+ current: state.current
938
+ });
939
+ }
940
+ }
941
+ function onUpdateEvent(event2) {
942
+ var input = getInput(event2);
943
+ var target = isHoneyPotElement(event2.target) ? getElementFromPointWithoutHoneypot({
944
+ x: input.clientX,
945
+ y: input.clientY
946
+ }) : event2.target;
947
+ var nextDropTargets = getDropTargetsOver({
948
+ target,
949
+ input,
950
+ source: dragType.payload,
951
+ current: state.current.dropTargets
952
+ });
953
+ if (nextDropTargets.length) {
954
+ event2.preventDefault();
955
+ setDropEffectOnEvent({
956
+ event: event2,
957
+ current: nextDropTargets
958
+ });
959
+ }
960
+ updateState({
961
+ dropTargets: nextDropTargets,
962
+ input
963
+ });
964
+ }
965
+ function cancel() {
966
+ if (state.current.dropTargets.length) {
967
+ updateState({
968
+ dropTargets: [],
969
+ input: state.current.input
970
+ });
971
+ }
972
+ dispatch.drop({
973
+ current: state.current,
974
+ updatedSourcePayload: null
975
+ });
976
+ finish();
977
+ }
978
+ function finish() {
979
+ globalState.isActive = false;
980
+ unbindEvents();
981
+ }
982
+ var unbindEvents = (0, import_bind_event_listener3.bindAll)(
983
+ window,
984
+ [{
985
+ // 👋 Note: we are repurposing the `dragover` event as our `drag` event
986
+ // this is because firefox does not publish pointer coordinates during
987
+ // a `drag` event, but does for every other type of drag event
988
+ // `dragover` fires on all elements that are being dragged over
989
+ // Because we are binding to `window` - our `dragover` is effectively the same as a `drag`
990
+ // 🦊😤
991
+ type: "dragover",
992
+ listener: function listener(event2) {
993
+ onUpdateEvent(event2);
994
+ dispatch.drag({
995
+ current: state.current
996
+ });
997
+ }
998
+ }, {
999
+ type: "dragenter",
1000
+ listener: onUpdateEvent
1001
+ }, {
1002
+ type: "dragleave",
1003
+ listener: function listener(event2) {
1004
+ if (!isLeavingWindow({
1005
+ dragLeave: event2
1006
+ })) {
1007
+ return;
1008
+ }
1009
+ updateState({
1010
+ input: state.current.input,
1011
+ dropTargets: []
1012
+ });
1013
+ if (dragType.startedFrom === "external") {
1014
+ cancel();
1015
+ }
1016
+ }
1017
+ }, {
1018
+ // A "drop" can only happen if the browser allowed the drop
1019
+ type: "drop",
1020
+ listener: function listener(event2) {
1021
+ state.current = {
1022
+ dropTargets: state.current.dropTargets,
1023
+ input: getInput(event2)
1024
+ };
1025
+ if (!state.current.dropTargets.length) {
1026
+ cancel();
1027
+ return;
1028
+ }
1029
+ event2.preventDefault();
1030
+ setDropEffectOnEvent({
1031
+ event: event2,
1032
+ current: state.current.dropTargets
1033
+ });
1034
+ dispatch.drop({
1035
+ current: state.current,
1036
+ // When dropping something native, we need to extract the latest
1037
+ // `.items` from the "drop" event as it is now accessible
1038
+ updatedSourcePayload: dragType.type === "external" ? dragType.getDropPayload(event2) : null
1039
+ });
1040
+ finish();
1041
+ }
1042
+ }, {
1043
+ // "dragend" fires when on the drag source (eg a draggable element)
1044
+ // when the drag is finished.
1045
+ // "dragend" will fire after "drop" (if there was a successful drop)
1046
+ // "dragend" does not fire if the draggable source has been removed during the drag
1047
+ // or for external drag sources (eg files)
1048
+ // This "dragend" listener will not fire if there was a successful drop
1049
+ // as we will have already removed the event listener
1050
+ type: "dragend",
1051
+ listener: function listener(event2) {
1052
+ state.current = {
1053
+ dropTargets: state.current.dropTargets,
1054
+ input: getInput(event2)
1055
+ };
1056
+ cancel();
1057
+ }
1058
+ }].concat((0, import_toConsumableArray.default)(getBindingsForBrokenDrags({
1059
+ onDragEnd: cancel
1060
+ }))),
1061
+ // Once we have started a managed drag operation it is important that we see / own all drag events
1062
+ // We got one adoption bug pop up where some code was stopping (`event.stopPropagation()`)
1063
+ // all "drop" events in the bubble phase on the `document.body`.
1064
+ // This meant that we never saw the "drop" event.
1065
+ {
1066
+ capture: true
1067
+ }
1068
+ );
1069
+ dispatch.start({
1070
+ nativeSetDragImage: getNativeSetDragImage(event)
1071
+ });
1072
+ }
1073
+ function setDropEffectOnEvent(_ref3) {
1074
+ var _current$;
1075
+ var event = _ref3.event, current = _ref3.current;
1076
+ var innerMost = (_current$ = current[0]) === null || _current$ === void 0 ? void 0 : _current$.dropEffect;
1077
+ if (innerMost != null && event.dataTransfer) {
1078
+ event.dataTransfer.dropEffect = innerMost;
1079
+ }
1080
+ }
1081
+ function getStartLocation(_ref4) {
1082
+ var event = _ref4.event, dragType = _ref4.dragType, getDropTargetsOver = _ref4.getDropTargetsOver;
1083
+ var input = getInput(event);
1084
+ if (dragType.startedFrom === "external") {
1085
+ return {
1086
+ input,
1087
+ dropTargets: []
1088
+ };
1089
+ }
1090
+ var dropTargets = getDropTargetsOver({
1091
+ input,
1092
+ source: dragType.payload,
1093
+ target: event.target,
1094
+ current: []
1095
+ });
1096
+ return {
1097
+ input,
1098
+ dropTargets
1099
+ };
1100
+ }
1101
+ var lifecycle = {
1102
+ canStart,
1103
+ start
1104
+ };
1105
+
1106
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/usage-ledger.js
1107
+ var ledger = /* @__PURE__ */ new Map();
1108
+ function registerUsage(_ref) {
1109
+ var typeKey = _ref.typeKey, mount2 = _ref.mount;
1110
+ var entry = ledger.get(typeKey);
1111
+ if (entry) {
1112
+ entry.usageCount++;
1113
+ return entry;
1114
+ }
1115
+ var initial = {
1116
+ typeKey,
1117
+ unmount: mount2(),
1118
+ usageCount: 1
1119
+ };
1120
+ ledger.set(typeKey, initial);
1121
+ return initial;
1122
+ }
1123
+ function register(args) {
1124
+ var entry = registerUsage(args);
1125
+ return function unregister() {
1126
+ entry.usageCount--;
1127
+ if (entry.usageCount > 0) {
1128
+ return;
1129
+ }
1130
+ entry.unmount();
1131
+ ledger.delete(args.typeKey);
1132
+ };
1133
+ }
1134
+
1135
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-drop-target.js
1136
+ var import_defineProperty2 = __toESM(require_defineProperty());
1137
+ var import_toConsumableArray2 = __toESM(require_toConsumableArray());
1138
+
1139
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/combine.js
1140
+ function combine() {
1141
+ for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
1142
+ fns[_key] = arguments[_key];
1143
+ }
1144
+ return function cleanup() {
1145
+ fns.forEach(function(fn) {
1146
+ return fn();
1147
+ });
1148
+ };
1149
+ }
1150
+
1151
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/add-attribute.js
1152
+ function addAttribute(element, _ref) {
1153
+ var attribute = _ref.attribute, value = _ref.value;
1154
+ element.setAttribute(attribute, value);
1155
+ return function() {
1156
+ return element.removeAttribute(attribute);
1157
+ };
1158
+ }
1159
+
1160
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-drop-target.js
1161
+ function ownKeys2(e, r) {
1162
+ var t = Object.keys(e);
1163
+ if (Object.getOwnPropertySymbols) {
1164
+ var o = Object.getOwnPropertySymbols(e);
1165
+ r && (o = o.filter(function(r2) {
1166
+ return Object.getOwnPropertyDescriptor(e, r2).enumerable;
1167
+ })), t.push.apply(t, o);
1168
+ }
1169
+ return t;
1170
+ }
1171
+ function _objectSpread2(e) {
1172
+ for (var r = 1; r < arguments.length; r++) {
1173
+ var t = null != arguments[r] ? arguments[r] : {};
1174
+ r % 2 ? ownKeys2(Object(t), true).forEach(function(r2) {
1175
+ (0, import_defineProperty2.default)(e, r2, t[r2]);
1176
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys2(Object(t)).forEach(function(r2) {
1177
+ Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
1178
+ });
1179
+ }
1180
+ return e;
1181
+ }
1182
+ function _createForOfIteratorHelper(r, e) {
1183
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
1184
+ if (!t) {
1185
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
1186
+ t && (r = t);
1187
+ var _n = 0, F = function F2() {
1188
+ };
1189
+ return { s: F, n: function n() {
1190
+ return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
1191
+ }, e: function e2(r2) {
1192
+ throw r2;
1193
+ }, f: F };
1194
+ }
1195
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1196
+ }
1197
+ var o, a = true, u = false;
1198
+ return { s: function s() {
1199
+ t = t.call(r);
1200
+ }, n: function n() {
1201
+ var r2 = t.next();
1202
+ return a = r2.done, r2;
1203
+ }, e: function e2(r2) {
1204
+ u = true, o = r2;
1205
+ }, f: function f() {
1206
+ try {
1207
+ a || null == t.return || t.return();
1208
+ } finally {
1209
+ if (u) throw o;
1210
+ }
1211
+ } };
1212
+ }
1213
+ function _unsupportedIterableToArray(r, a) {
1214
+ if (r) {
1215
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
1216
+ var t = {}.toString.call(r).slice(8, -1);
1217
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
1218
+ }
1219
+ }
1220
+ function _arrayLikeToArray(r, a) {
1221
+ (null == a || a > r.length) && (a = r.length);
1222
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
1223
+ return n;
1224
+ }
1225
+ function copyReverse(array) {
1226
+ return array.slice(0).reverse();
1227
+ }
1228
+ function makeDropTarget(_ref) {
1229
+ var typeKey = _ref.typeKey, defaultDropEffect = _ref.defaultDropEffect;
1230
+ var registry = /* @__PURE__ */ new WeakMap();
1231
+ var dropTargetDataAtt = "data-drop-target-for-".concat(typeKey);
1232
+ var dropTargetSelector = "[".concat(dropTargetDataAtt, "]");
1233
+ function addToRegistry2(args) {
1234
+ registry.set(args.element, args);
1235
+ return function() {
1236
+ return registry.delete(args.element);
1237
+ };
1238
+ }
1239
+ function dropTargetForConsumers(args) {
1240
+ if (process.env.NODE_ENV !== "production") {
1241
+ var existing = registry.get(args.element);
1242
+ if (existing) {
1243
+ console.warn("You have already registered a [".concat(typeKey, "] dropTarget on the same element"), {
1244
+ existing,
1245
+ proposed: args
1246
+ });
1247
+ }
1248
+ if (args.element instanceof HTMLIFrameElement) {
1249
+ console.warn("\n We recommend not registering <iframe> elements as drop targets\n as it can result in some strange browser event ordering.\n ".replace(/\s{2,}/g, " ").trim());
1250
+ }
1251
+ }
1252
+ var cleanup = combine(addAttribute(args.element, {
1253
+ attribute: dropTargetDataAtt,
1254
+ value: "true"
1255
+ }), addToRegistry2(args));
1256
+ return once(cleanup);
1257
+ }
1258
+ function getActualDropTargets(_ref2) {
1259
+ var _args$getData, _args$getData2, _args$getDropEffect, _args$getDropEffect2;
1260
+ var source = _ref2.source, target = _ref2.target, input = _ref2.input, _ref2$result = _ref2.result, result = _ref2$result === void 0 ? [] : _ref2$result;
1261
+ if (target == null) {
1262
+ return result;
1263
+ }
1264
+ if (!(target instanceof Element)) {
1265
+ if (target instanceof Node) {
1266
+ return getActualDropTargets({
1267
+ source,
1268
+ target: target.parentElement,
1269
+ input,
1270
+ result
1271
+ });
1272
+ }
1273
+ return result;
1274
+ }
1275
+ var closest = target.closest(dropTargetSelector);
1276
+ if (closest == null) {
1277
+ return result;
1278
+ }
1279
+ var args = registry.get(closest);
1280
+ if (args == null) {
1281
+ return result;
1282
+ }
1283
+ var feedback = {
1284
+ input,
1285
+ source,
1286
+ element: args.element
1287
+ };
1288
+ if (args.canDrop && !args.canDrop(feedback)) {
1289
+ return getActualDropTargets({
1290
+ source,
1291
+ target: args.element.parentElement,
1292
+ input,
1293
+ result
1294
+ });
1295
+ }
1296
+ var data = (_args$getData = (_args$getData2 = args.getData) === null || _args$getData2 === void 0 ? void 0 : _args$getData2.call(args, feedback)) !== null && _args$getData !== void 0 ? _args$getData : {};
1297
+ var dropEffect = (_args$getDropEffect = (_args$getDropEffect2 = args.getDropEffect) === null || _args$getDropEffect2 === void 0 ? void 0 : _args$getDropEffect2.call(args, feedback)) !== null && _args$getDropEffect !== void 0 ? _args$getDropEffect : defaultDropEffect;
1298
+ var record = {
1299
+ data,
1300
+ element: args.element,
1301
+ dropEffect,
1302
+ // we are collecting _actual_ drop targets, so these are
1303
+ // being applied _not_ due to stickiness
1304
+ isActiveDueToStickiness: false
1305
+ };
1306
+ return getActualDropTargets({
1307
+ source,
1308
+ target: args.element.parentElement,
1309
+ input,
1310
+ // Using bubble ordering. Same ordering as `event.getPath()`
1311
+ result: [].concat((0, import_toConsumableArray2.default)(result), [record])
1312
+ });
1313
+ }
1314
+ function notifyCurrent(_ref3) {
1315
+ var eventName = _ref3.eventName, payload = _ref3.payload;
1316
+ var _iterator = _createForOfIteratorHelper(payload.location.current.dropTargets), _step;
1317
+ try {
1318
+ for (_iterator.s(); !(_step = _iterator.n()).done; ) {
1319
+ var _entry$eventName;
1320
+ var record = _step.value;
1321
+ var entry = registry.get(record.element);
1322
+ var args = _objectSpread2(_objectSpread2({}, payload), {}, {
1323
+ self: record
1324
+ });
1325
+ entry === null || entry === void 0 || (_entry$eventName = entry[eventName]) === null || _entry$eventName === void 0 || _entry$eventName.call(
1326
+ entry,
1327
+ // I cannot seem to get the types right here.
1328
+ // TS doesn't seem to like that one event can need `nativeSetDragImage`
1329
+ // @ts-expect-error
1330
+ args
1331
+ );
1332
+ }
1333
+ } catch (err) {
1334
+ _iterator.e(err);
1335
+ } finally {
1336
+ _iterator.f();
1337
+ }
1338
+ }
1339
+ var actions = {
1340
+ onGenerateDragPreview: notifyCurrent,
1341
+ onDrag: notifyCurrent,
1342
+ onDragStart: notifyCurrent,
1343
+ onDrop: notifyCurrent,
1344
+ onDropTargetChange: function onDropTargetChange(_ref4) {
1345
+ var payload = _ref4.payload;
1346
+ var isCurrent = new Set(payload.location.current.dropTargets.map(function(record2) {
1347
+ return record2.element;
1348
+ }));
1349
+ var visited = /* @__PURE__ */ new Set();
1350
+ var _iterator2 = _createForOfIteratorHelper(payload.location.previous.dropTargets), _step2;
1351
+ try {
1352
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
1353
+ var _entry$onDropTargetCh;
1354
+ var record = _step2.value;
1355
+ visited.add(record.element);
1356
+ var entry = registry.get(record.element);
1357
+ var isOver = isCurrent.has(record.element);
1358
+ var args = _objectSpread2(_objectSpread2({}, payload), {}, {
1359
+ self: record
1360
+ });
1361
+ entry === null || entry === void 0 || (_entry$onDropTargetCh = entry.onDropTargetChange) === null || _entry$onDropTargetCh === void 0 || _entry$onDropTargetCh.call(entry, args);
1362
+ if (!isOver) {
1363
+ var _entry$onDragLeave;
1364
+ entry === null || entry === void 0 || (_entry$onDragLeave = entry.onDragLeave) === null || _entry$onDragLeave === void 0 || _entry$onDragLeave.call(entry, args);
1365
+ }
1366
+ }
1367
+ } catch (err) {
1368
+ _iterator2.e(err);
1369
+ } finally {
1370
+ _iterator2.f();
1371
+ }
1372
+ var _iterator3 = _createForOfIteratorHelper(payload.location.current.dropTargets), _step3;
1373
+ try {
1374
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
1375
+ var _entry$onDropTargetCh2, _entry$onDragEnter;
1376
+ var _record = _step3.value;
1377
+ if (visited.has(_record.element)) {
1378
+ continue;
1379
+ }
1380
+ var _args = _objectSpread2(_objectSpread2({}, payload), {}, {
1381
+ self: _record
1382
+ });
1383
+ var _entry = registry.get(_record.element);
1384
+ _entry === null || _entry === void 0 || (_entry$onDropTargetCh2 = _entry.onDropTargetChange) === null || _entry$onDropTargetCh2 === void 0 || _entry$onDropTargetCh2.call(_entry, _args);
1385
+ _entry === null || _entry === void 0 || (_entry$onDragEnter = _entry.onDragEnter) === null || _entry$onDragEnter === void 0 || _entry$onDragEnter.call(_entry, _args);
1386
+ }
1387
+ } catch (err) {
1388
+ _iterator3.e(err);
1389
+ } finally {
1390
+ _iterator3.f();
1391
+ }
1392
+ }
1393
+ };
1394
+ function dispatchEvent(args) {
1395
+ actions[args.eventName](args);
1396
+ }
1397
+ function getIsOver(_ref5) {
1398
+ var source = _ref5.source, target = _ref5.target, input = _ref5.input, current = _ref5.current;
1399
+ var actual = getActualDropTargets({
1400
+ source,
1401
+ target,
1402
+ input
1403
+ });
1404
+ if (actual.length >= current.length) {
1405
+ return actual;
1406
+ }
1407
+ var lastCaptureOrdered = copyReverse(current);
1408
+ var actualCaptureOrdered = copyReverse(actual);
1409
+ var resultCaptureOrdered = [];
1410
+ for (var index = 0; index < lastCaptureOrdered.length; index++) {
1411
+ var _argsForLast$getIsSti;
1412
+ var last = lastCaptureOrdered[index];
1413
+ var fresh = actualCaptureOrdered[index];
1414
+ if (fresh != null) {
1415
+ resultCaptureOrdered.push(fresh);
1416
+ continue;
1417
+ }
1418
+ var parent = resultCaptureOrdered[index - 1];
1419
+ var lastParent = lastCaptureOrdered[index - 1];
1420
+ if ((parent === null || parent === void 0 ? void 0 : parent.element) !== (lastParent === null || lastParent === void 0 ? void 0 : lastParent.element)) {
1421
+ break;
1422
+ }
1423
+ var argsForLast = registry.get(last.element);
1424
+ if (!argsForLast) {
1425
+ break;
1426
+ }
1427
+ var feedback = {
1428
+ input,
1429
+ source,
1430
+ element: argsForLast.element
1431
+ };
1432
+ if (argsForLast.canDrop && !argsForLast.canDrop(feedback)) {
1433
+ break;
1434
+ }
1435
+ if (!((_argsForLast$getIsSti = argsForLast.getIsSticky) !== null && _argsForLast$getIsSti !== void 0 && _argsForLast$getIsSti.call(argsForLast, feedback))) {
1436
+ break;
1437
+ }
1438
+ resultCaptureOrdered.push(_objectSpread2(_objectSpread2({}, last), {}, {
1439
+ // making it clear to consumers this drop target is active due to stickiness
1440
+ isActiveDueToStickiness: true
1441
+ }));
1442
+ }
1443
+ return copyReverse(resultCaptureOrdered);
1444
+ }
1445
+ return {
1446
+ dropTargetForConsumers,
1447
+ getIsOver,
1448
+ dispatchEvent
1449
+ };
1450
+ }
1451
+
1452
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-monitor.js
1453
+ var import_defineProperty3 = __toESM(require_defineProperty());
1454
+ function _createForOfIteratorHelper2(r, e) {
1455
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
1456
+ if (!t) {
1457
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray2(r)) || e && r && "number" == typeof r.length) {
1458
+ t && (r = t);
1459
+ var _n = 0, F = function F2() {
1460
+ };
1461
+ return { s: F, n: function n() {
1462
+ return _n >= r.length ? { done: true } : { done: false, value: r[_n++] };
1463
+ }, e: function e2(r2) {
1464
+ throw r2;
1465
+ }, f: F };
1466
+ }
1467
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1468
+ }
1469
+ var o, a = true, u = false;
1470
+ return { s: function s() {
1471
+ t = t.call(r);
1472
+ }, n: function n() {
1473
+ var r2 = t.next();
1474
+ return a = r2.done, r2;
1475
+ }, e: function e2(r2) {
1476
+ u = true, o = r2;
1477
+ }, f: function f() {
1478
+ try {
1479
+ a || null == t.return || t.return();
1480
+ } finally {
1481
+ if (u) throw o;
1482
+ }
1483
+ } };
1484
+ }
1485
+ function _unsupportedIterableToArray2(r, a) {
1486
+ if (r) {
1487
+ if ("string" == typeof r) return _arrayLikeToArray2(r, a);
1488
+ var t = {}.toString.call(r).slice(8, -1);
1489
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray2(r, a) : void 0;
1490
+ }
1491
+ }
1492
+ function _arrayLikeToArray2(r, a) {
1493
+ (null == a || a > r.length) && (a = r.length);
1494
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
1495
+ return n;
1496
+ }
1497
+ function ownKeys3(e, r) {
1498
+ var t = Object.keys(e);
1499
+ if (Object.getOwnPropertySymbols) {
1500
+ var o = Object.getOwnPropertySymbols(e);
1501
+ r && (o = o.filter(function(r2) {
1502
+ return Object.getOwnPropertyDescriptor(e, r2).enumerable;
1503
+ })), t.push.apply(t, o);
1504
+ }
1505
+ return t;
1506
+ }
1507
+ function _objectSpread3(e) {
1508
+ for (var r = 1; r < arguments.length; r++) {
1509
+ var t = null != arguments[r] ? arguments[r] : {};
1510
+ r % 2 ? ownKeys3(Object(t), true).forEach(function(r2) {
1511
+ (0, import_defineProperty3.default)(e, r2, t[r2]);
1512
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys3(Object(t)).forEach(function(r2) {
1513
+ Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
1514
+ });
1515
+ }
1516
+ return e;
1517
+ }
1518
+ function makeMonitor() {
1519
+ var registry = /* @__PURE__ */ new Set();
1520
+ var dragging = null;
1521
+ function tryAddToActive(monitor) {
1522
+ if (!dragging) {
1523
+ return;
1524
+ }
1525
+ if (!monitor.canMonitor || monitor.canMonitor(dragging.canMonitorArgs)) {
1526
+ dragging.active.add(monitor);
1527
+ }
1528
+ }
1529
+ function monitorForConsumers(args) {
1530
+ var entry = _objectSpread3({}, args);
1531
+ registry.add(entry);
1532
+ tryAddToActive(entry);
1533
+ function cleanup() {
1534
+ registry.delete(entry);
1535
+ if (dragging) {
1536
+ dragging.active.delete(entry);
1537
+ }
1538
+ }
1539
+ return once(cleanup);
1540
+ }
1541
+ function dispatchEvent(_ref) {
1542
+ var eventName = _ref.eventName, payload = _ref.payload;
1543
+ if (eventName === "onGenerateDragPreview") {
1544
+ dragging = {
1545
+ canMonitorArgs: {
1546
+ initial: payload.location.initial,
1547
+ source: payload.source
1548
+ },
1549
+ active: /* @__PURE__ */ new Set()
1550
+ };
1551
+ var _iterator = _createForOfIteratorHelper2(registry), _step;
1552
+ try {
1553
+ for (_iterator.s(); !(_step = _iterator.n()).done; ) {
1554
+ var monitor = _step.value;
1555
+ tryAddToActive(monitor);
1556
+ }
1557
+ } catch (err) {
1558
+ _iterator.e(err);
1559
+ } finally {
1560
+ _iterator.f();
1561
+ }
1562
+ }
1563
+ if (!dragging) {
1564
+ return;
1565
+ }
1566
+ var active = Array.from(dragging.active);
1567
+ for (var _i = 0, _active = active; _i < _active.length; _i++) {
1568
+ var _monitor = _active[_i];
1569
+ if (dragging.active.has(_monitor)) {
1570
+ var _monitor$eventName;
1571
+ (_monitor$eventName = _monitor[eventName]) === null || _monitor$eventName === void 0 || _monitor$eventName.call(_monitor, payload);
1572
+ }
1573
+ }
1574
+ if (eventName === "onDrop") {
1575
+ dragging.active.clear();
1576
+ dragging = null;
1577
+ }
1578
+ }
1579
+ return {
1580
+ dispatchEvent,
1581
+ monitorForConsumers
1582
+ };
1583
+ }
1584
+
1585
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-adapter.js
1586
+ function makeAdapter(_ref) {
1587
+ var typeKey = _ref.typeKey, mount2 = _ref.mount, dispatchEventToSource2 = _ref.dispatchEventToSource, onPostDispatch = _ref.onPostDispatch, defaultDropEffect = _ref.defaultDropEffect;
1588
+ var monitorAPI = makeMonitor();
1589
+ var dropTargetAPI = makeDropTarget({
1590
+ typeKey,
1591
+ defaultDropEffect
1592
+ });
1593
+ function dispatchEvent(args) {
1594
+ dispatchEventToSource2 === null || dispatchEventToSource2 === void 0 || dispatchEventToSource2(args);
1595
+ dropTargetAPI.dispatchEvent(args);
1596
+ monitorAPI.dispatchEvent(args);
1597
+ onPostDispatch === null || onPostDispatch === void 0 || onPostDispatch(args);
1598
+ }
1599
+ function start2(_ref2) {
1600
+ var event = _ref2.event, dragType = _ref2.dragType;
1601
+ lifecycle.start({
1602
+ event,
1603
+ dragType,
1604
+ getDropTargetsOver: dropTargetAPI.getIsOver,
1605
+ dispatchEvent
1606
+ });
1607
+ }
1608
+ function registerUsage2() {
1609
+ function mountAdapter() {
1610
+ var api = {
1611
+ canStart: lifecycle.canStart,
1612
+ start: start2
1613
+ };
1614
+ return mount2(api);
1615
+ }
1616
+ return register({
1617
+ typeKey,
1618
+ mount: mountAdapter
1619
+ });
1620
+ }
1621
+ return {
1622
+ registerUsage: registerUsage2,
1623
+ dropTarget: dropTargetAPI.dropTargetForConsumers,
1624
+ monitor: monitorAPI.monitorForConsumers
1625
+ };
1626
+ }
1627
+
1628
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/android.js
1629
+ var isAndroid = once(function isAndroid2() {
1630
+ return navigator.userAgent.toLocaleLowerCase().includes("android");
1631
+ });
1632
+ var androidFallbackText = "pdnd:android-fallback";
1633
+
1634
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/media-types/text-media-type.js
1635
+ var textMediaType = "text/plain";
1636
+
1637
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/media-types/url-media-type.js
1638
+ var URLMediaType = "text/uri-list";
1639
+
1640
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter-native-data-key.js
1641
+ var elementAdapterNativeDataKey = "application/vnd.pdnd";
1642
+
1643
+ // ../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@1.8.1/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter.js
1644
+ var draggableRegistry = /* @__PURE__ */ new WeakMap();
1645
+ function addToRegistry(args) {
1646
+ draggableRegistry.set(args.element, args);
1647
+ return function cleanup() {
1648
+ draggableRegistry.delete(args.element);
1649
+ };
1650
+ }
1651
+ var honeyPotFix = makeHoneyPotFix();
1652
+ var adapter = makeAdapter({
1653
+ typeKey: "element",
1654
+ defaultDropEffect: "move",
1655
+ mount: function mount(api) {
1656
+ return combine(honeyPotFix.bindEvents(), (0, import_bind_event_listener4.bind)(document, {
1657
+ type: "dragstart",
1658
+ listener: function listener(event) {
1659
+ var _entry$dragHandle, _entry$getInitialData, _entry$getInitialData2, _entry$dragHandle2, _entry$getInitialData3, _entry$getInitialData4;
1660
+ if (!api.canStart(event)) {
1661
+ return;
1662
+ }
1663
+ if (event.defaultPrevented) {
1664
+ return;
1665
+ }
1666
+ if (!event.dataTransfer) {
1667
+ if (process.env.NODE_ENV !== "production") {
1668
+ console.warn("\n It appears as though you have are not testing DragEvents correctly.\n\n - If you are unit testing, ensure you have polyfilled DragEvent.\n - If you are browser testing, ensure you are dispatching drag events correctly.\n\n Please see our testing guides for more information:\n https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing\n ".replace(/ {2}/g, ""));
1669
+ }
1670
+ return;
1671
+ }
1672
+ var target = event.target;
1673
+ if (!(target instanceof HTMLElement)) {
1674
+ return;
1675
+ }
1676
+ var entry = draggableRegistry.get(target);
1677
+ if (!entry) {
1678
+ return;
1679
+ }
1680
+ var input = getInput(event);
1681
+ var feedback = {
1682
+ element: entry.element,
1683
+ dragHandle: (_entry$dragHandle = entry.dragHandle) !== null && _entry$dragHandle !== void 0 ? _entry$dragHandle : null,
1684
+ input
1685
+ };
1686
+ if (entry.canDrag && !entry.canDrag(feedback)) {
1687
+ event.preventDefault();
1688
+ return;
1689
+ }
1690
+ if (entry.dragHandle) {
1691
+ var over = getElementFromPointWithoutHoneypot({
1692
+ x: input.clientX,
1693
+ y: input.clientY
1694
+ });
1695
+ if (!entry.dragHandle.contains(over)) {
1696
+ event.preventDefault();
1697
+ return;
1698
+ }
1699
+ }
1700
+ var nativeData = (_entry$getInitialData = (_entry$getInitialData2 = entry.getInitialDataForExternal) === null || _entry$getInitialData2 === void 0 ? void 0 : _entry$getInitialData2.call(entry, feedback)) !== null && _entry$getInitialData !== void 0 ? _entry$getInitialData : null;
1701
+ if (nativeData) {
1702
+ for (var _i = 0, _Object$entries = Object.entries(nativeData); _i < _Object$entries.length; _i++) {
1703
+ var _Object$entries$_i = (0, import_slicedToArray2.default)(_Object$entries[_i], 2), key = _Object$entries$_i[0], data = _Object$entries$_i[1];
1704
+ event.dataTransfer.setData(key, data !== null && data !== void 0 ? data : "");
1705
+ }
1706
+ }
1707
+ if (isAndroid() && !event.dataTransfer.types.includes(textMediaType) && !event.dataTransfer.types.includes(URLMediaType)) {
1708
+ event.dataTransfer.setData(textMediaType, androidFallbackText);
1709
+ }
1710
+ event.dataTransfer.setData(elementAdapterNativeDataKey, "");
1711
+ var payload = {
1712
+ element: entry.element,
1713
+ dragHandle: (_entry$dragHandle2 = entry.dragHandle) !== null && _entry$dragHandle2 !== void 0 ? _entry$dragHandle2 : null,
1714
+ data: (_entry$getInitialData3 = (_entry$getInitialData4 = entry.getInitialData) === null || _entry$getInitialData4 === void 0 ? void 0 : _entry$getInitialData4.call(entry, feedback)) !== null && _entry$getInitialData3 !== void 0 ? _entry$getInitialData3 : {}
1715
+ };
1716
+ var dragType = {
1717
+ type: "element",
1718
+ payload,
1719
+ startedFrom: "internal"
1720
+ };
1721
+ api.start({
1722
+ event,
1723
+ dragType
1724
+ });
1725
+ }
1726
+ }));
1727
+ },
1728
+ dispatchEventToSource: function dispatchEventToSource(_ref) {
1729
+ var _draggableRegistry$ge, _draggableRegistry$ge2;
1730
+ var eventName = _ref.eventName, payload = _ref.payload;
1731
+ (_draggableRegistry$ge = draggableRegistry.get(payload.source.element)) === null || _draggableRegistry$ge === void 0 || (_draggableRegistry$ge2 = _draggableRegistry$ge[eventName]) === null || _draggableRegistry$ge2 === void 0 || _draggableRegistry$ge2.call(
1732
+ _draggableRegistry$ge,
1733
+ // I cannot seem to get the types right here.
1734
+ // TS doesn't seem to like that one event can need `nativeSetDragImage`
1735
+ // @ts-expect-error
1736
+ payload
1737
+ );
1738
+ },
1739
+ onPostDispatch: honeyPotFix.getOnPostDispatch()
1740
+ });
1741
+ var dropTargetForElements = adapter.dropTarget;
1742
+ var monitorForElements = adapter.monitor;
1743
+ function draggable(args) {
1744
+ if (process.env.NODE_ENV !== "production") {
1745
+ if (args.dragHandle && !args.element.contains(args.dragHandle)) {
1746
+ console.warn("Drag handle element must be contained in draggable element", {
1747
+ element: args.element,
1748
+ dragHandle: args.dragHandle
1749
+ });
1750
+ }
1751
+ }
1752
+ if (process.env.NODE_ENV !== "production") {
1753
+ var existing = draggableRegistry.get(args.element);
1754
+ if (existing) {
1755
+ console.warn("You have already registered a `draggable` on the same element", {
1756
+ existing,
1757
+ proposed: args
1758
+ });
1759
+ }
1760
+ }
1761
+ var cleanup = combine(
1762
+ // making the draggable register the adapter rather than drop targets
1763
+ // this is because you *must* have a draggable element to start a drag
1764
+ // but you _might_ not have any drop targets immediately
1765
+ // (You might create drop targets async)
1766
+ adapter.registerUsage(),
1767
+ addToRegistry(args),
1768
+ addAttribute(args.element, {
1769
+ attribute: "draggable",
1770
+ value: "true"
1771
+ })
1772
+ );
1773
+ return once(cleanup);
1774
+ }
1775
+ export {
1776
+ draggable,
1777
+ dropTargetForElements,
1778
+ monitorForElements
1779
+ };