chunk-JNQZPBNY.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. import {
  2. init_define_APP_INFO
  3. } from "./chunk-XY75H3MP.js";
  4. // node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
  5. init_define_APP_INFO();
  6. var MapShim = function() {
  7. if (typeof Map !== "undefined") {
  8. return Map;
  9. }
  10. function getIndex(arr, key) {
  11. var result = -1;
  12. arr.some(function(entry, index2) {
  13. if (entry[0] === key) {
  14. result = index2;
  15. return true;
  16. }
  17. return false;
  18. });
  19. return result;
  20. }
  21. return function() {
  22. function class_1() {
  23. this.__entries__ = [];
  24. }
  25. Object.defineProperty(class_1.prototype, "size", {
  26. get: function() {
  27. return this.__entries__.length;
  28. },
  29. enumerable: true,
  30. configurable: true
  31. });
  32. class_1.prototype.get = function(key) {
  33. var index2 = getIndex(this.__entries__, key);
  34. var entry = this.__entries__[index2];
  35. return entry && entry[1];
  36. };
  37. class_1.prototype.set = function(key, value) {
  38. var index2 = getIndex(this.__entries__, key);
  39. if (~index2) {
  40. this.__entries__[index2][1] = value;
  41. } else {
  42. this.__entries__.push([key, value]);
  43. }
  44. };
  45. class_1.prototype.delete = function(key) {
  46. var entries = this.__entries__;
  47. var index2 = getIndex(entries, key);
  48. if (~index2) {
  49. entries.splice(index2, 1);
  50. }
  51. };
  52. class_1.prototype.has = function(key) {
  53. return !!~getIndex(this.__entries__, key);
  54. };
  55. class_1.prototype.clear = function() {
  56. this.__entries__.splice(0);
  57. };
  58. class_1.prototype.forEach = function(callback, ctx) {
  59. if (ctx === void 0) {
  60. ctx = null;
  61. }
  62. for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
  63. var entry = _a[_i];
  64. callback.call(ctx, entry[1], entry[0]);
  65. }
  66. };
  67. return class_1;
  68. }();
  69. }();
  70. var isBrowser = typeof window !== "undefined" && typeof document !== "undefined" && window.document === document;
  71. var global$1 = function() {
  72. if (typeof global !== "undefined" && global.Math === Math) {
  73. return global;
  74. }
  75. if (typeof self !== "undefined" && self.Math === Math) {
  76. return self;
  77. }
  78. if (typeof window !== "undefined" && window.Math === Math) {
  79. return window;
  80. }
  81. return Function("return this")();
  82. }();
  83. var requestAnimationFrame$1 = function() {
  84. if (typeof requestAnimationFrame === "function") {
  85. return requestAnimationFrame.bind(global$1);
  86. }
  87. return function(callback) {
  88. return setTimeout(function() {
  89. return callback(Date.now());
  90. }, 1e3 / 60);
  91. };
  92. }();
  93. var trailingTimeout = 2;
  94. function throttle(callback, delay) {
  95. var leadingCall = false, trailingCall = false, lastCallTime = 0;
  96. function resolvePending() {
  97. if (leadingCall) {
  98. leadingCall = false;
  99. callback();
  100. }
  101. if (trailingCall) {
  102. proxy();
  103. }
  104. }
  105. function timeoutCallback() {
  106. requestAnimationFrame$1(resolvePending);
  107. }
  108. function proxy() {
  109. var timeStamp = Date.now();
  110. if (leadingCall) {
  111. if (timeStamp - lastCallTime < trailingTimeout) {
  112. return;
  113. }
  114. trailingCall = true;
  115. } else {
  116. leadingCall = true;
  117. trailingCall = false;
  118. setTimeout(timeoutCallback, delay);
  119. }
  120. lastCallTime = timeStamp;
  121. }
  122. return proxy;
  123. }
  124. var REFRESH_DELAY = 20;
  125. var transitionKeys = ["top", "right", "bottom", "left", "width", "height", "size", "weight"];
  126. var mutationObserverSupported = typeof MutationObserver !== "undefined";
  127. var ResizeObserverController = function() {
  128. function ResizeObserverController2() {
  129. this.connected_ = false;
  130. this.mutationEventsAdded_ = false;
  131. this.mutationsObserver_ = null;
  132. this.observers_ = [];
  133. this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
  134. this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
  135. }
  136. ResizeObserverController2.prototype.addObserver = function(observer) {
  137. if (!~this.observers_.indexOf(observer)) {
  138. this.observers_.push(observer);
  139. }
  140. if (!this.connected_) {
  141. this.connect_();
  142. }
  143. };
  144. ResizeObserverController2.prototype.removeObserver = function(observer) {
  145. var observers2 = this.observers_;
  146. var index2 = observers2.indexOf(observer);
  147. if (~index2) {
  148. observers2.splice(index2, 1);
  149. }
  150. if (!observers2.length && this.connected_) {
  151. this.disconnect_();
  152. }
  153. };
  154. ResizeObserverController2.prototype.refresh = function() {
  155. var changesDetected = this.updateObservers_();
  156. if (changesDetected) {
  157. this.refresh();
  158. }
  159. };
  160. ResizeObserverController2.prototype.updateObservers_ = function() {
  161. var activeObservers = this.observers_.filter(function(observer) {
  162. return observer.gatherActive(), observer.hasActive();
  163. });
  164. activeObservers.forEach(function(observer) {
  165. return observer.broadcastActive();
  166. });
  167. return activeObservers.length > 0;
  168. };
  169. ResizeObserverController2.prototype.connect_ = function() {
  170. if (!isBrowser || this.connected_) {
  171. return;
  172. }
  173. document.addEventListener("transitionend", this.onTransitionEnd_);
  174. window.addEventListener("resize", this.refresh);
  175. if (mutationObserverSupported) {
  176. this.mutationsObserver_ = new MutationObserver(this.refresh);
  177. this.mutationsObserver_.observe(document, {
  178. attributes: true,
  179. childList: true,
  180. characterData: true,
  181. subtree: true
  182. });
  183. } else {
  184. document.addEventListener("DOMSubtreeModified", this.refresh);
  185. this.mutationEventsAdded_ = true;
  186. }
  187. this.connected_ = true;
  188. };
  189. ResizeObserverController2.prototype.disconnect_ = function() {
  190. if (!isBrowser || !this.connected_) {
  191. return;
  192. }
  193. document.removeEventListener("transitionend", this.onTransitionEnd_);
  194. window.removeEventListener("resize", this.refresh);
  195. if (this.mutationsObserver_) {
  196. this.mutationsObserver_.disconnect();
  197. }
  198. if (this.mutationEventsAdded_) {
  199. document.removeEventListener("DOMSubtreeModified", this.refresh);
  200. }
  201. this.mutationsObserver_ = null;
  202. this.mutationEventsAdded_ = false;
  203. this.connected_ = false;
  204. };
  205. ResizeObserverController2.prototype.onTransitionEnd_ = function(_a) {
  206. var _b = _a.propertyName, propertyName = _b === void 0 ? "" : _b;
  207. var isReflowProperty = transitionKeys.some(function(key) {
  208. return !!~propertyName.indexOf(key);
  209. });
  210. if (isReflowProperty) {
  211. this.refresh();
  212. }
  213. };
  214. ResizeObserverController2.getInstance = function() {
  215. if (!this.instance_) {
  216. this.instance_ = new ResizeObserverController2();
  217. }
  218. return this.instance_;
  219. };
  220. ResizeObserverController2.instance_ = null;
  221. return ResizeObserverController2;
  222. }();
  223. var defineConfigurable = function(target, props) {
  224. for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
  225. var key = _a[_i];
  226. Object.defineProperty(target, key, {
  227. value: props[key],
  228. enumerable: false,
  229. writable: false,
  230. configurable: true
  231. });
  232. }
  233. return target;
  234. };
  235. var getWindowOf = function(target) {
  236. var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
  237. return ownerGlobal || global$1;
  238. };
  239. var emptyRect = createRectInit(0, 0, 0, 0);
  240. function toFloat(value) {
  241. return parseFloat(value) || 0;
  242. }
  243. function getBordersSize(styles) {
  244. var positions = [];
  245. for (var _i = 1; _i < arguments.length; _i++) {
  246. positions[_i - 1] = arguments[_i];
  247. }
  248. return positions.reduce(function(size, position) {
  249. var value = styles["border-" + position + "-width"];
  250. return size + toFloat(value);
  251. }, 0);
  252. }
  253. function getPaddings(styles) {
  254. var positions = ["top", "right", "bottom", "left"];
  255. var paddings = {};
  256. for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
  257. var position = positions_1[_i];
  258. var value = styles["padding-" + position];
  259. paddings[position] = toFloat(value);
  260. }
  261. return paddings;
  262. }
  263. function getSVGContentRect(target) {
  264. var bbox = target.getBBox();
  265. return createRectInit(0, 0, bbox.width, bbox.height);
  266. }
  267. function getHTMLElementContentRect(target) {
  268. var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
  269. if (!clientWidth && !clientHeight) {
  270. return emptyRect;
  271. }
  272. var styles = getWindowOf(target).getComputedStyle(target);
  273. var paddings = getPaddings(styles);
  274. var horizPad = paddings.left + paddings.right;
  275. var vertPad = paddings.top + paddings.bottom;
  276. var width = toFloat(styles.width), height = toFloat(styles.height);
  277. if (styles.boxSizing === "border-box") {
  278. if (Math.round(width + horizPad) !== clientWidth) {
  279. width -= getBordersSize(styles, "left", "right") + horizPad;
  280. }
  281. if (Math.round(height + vertPad) !== clientHeight) {
  282. height -= getBordersSize(styles, "top", "bottom") + vertPad;
  283. }
  284. }
  285. if (!isDocumentElement(target)) {
  286. var vertScrollbar = Math.round(width + horizPad) - clientWidth;
  287. var horizScrollbar = Math.round(height + vertPad) - clientHeight;
  288. if (Math.abs(vertScrollbar) !== 1) {
  289. width -= vertScrollbar;
  290. }
  291. if (Math.abs(horizScrollbar) !== 1) {
  292. height -= horizScrollbar;
  293. }
  294. }
  295. return createRectInit(paddings.left, paddings.top, width, height);
  296. }
  297. var isSVGGraphicsElement = function() {
  298. if (typeof SVGGraphicsElement !== "undefined") {
  299. return function(target) {
  300. return target instanceof getWindowOf(target).SVGGraphicsElement;
  301. };
  302. }
  303. return function(target) {
  304. return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === "function";
  305. };
  306. }();
  307. function isDocumentElement(target) {
  308. return target === getWindowOf(target).document.documentElement;
  309. }
  310. function getContentRect(target) {
  311. if (!isBrowser) {
  312. return emptyRect;
  313. }
  314. if (isSVGGraphicsElement(target)) {
  315. return getSVGContentRect(target);
  316. }
  317. return getHTMLElementContentRect(target);
  318. }
  319. function createReadOnlyRect(_a) {
  320. var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
  321. var Constr = typeof DOMRectReadOnly !== "undefined" ? DOMRectReadOnly : Object;
  322. var rect = Object.create(Constr.prototype);
  323. defineConfigurable(rect, {
  324. x,
  325. y,
  326. width,
  327. height,
  328. top: y,
  329. right: x + width,
  330. bottom: height + y,
  331. left: x
  332. });
  333. return rect;
  334. }
  335. function createRectInit(x, y, width, height) {
  336. return { x, y, width, height };
  337. }
  338. var ResizeObservation = function() {
  339. function ResizeObservation2(target) {
  340. this.broadcastWidth = 0;
  341. this.broadcastHeight = 0;
  342. this.contentRect_ = createRectInit(0, 0, 0, 0);
  343. this.target = target;
  344. }
  345. ResizeObservation2.prototype.isActive = function() {
  346. var rect = getContentRect(this.target);
  347. this.contentRect_ = rect;
  348. return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;
  349. };
  350. ResizeObservation2.prototype.broadcastRect = function() {
  351. var rect = this.contentRect_;
  352. this.broadcastWidth = rect.width;
  353. this.broadcastHeight = rect.height;
  354. return rect;
  355. };
  356. return ResizeObservation2;
  357. }();
  358. var ResizeObserverEntry = function() {
  359. function ResizeObserverEntry2(target, rectInit) {
  360. var contentRect = createReadOnlyRect(rectInit);
  361. defineConfigurable(this, { target, contentRect });
  362. }
  363. return ResizeObserverEntry2;
  364. }();
  365. var ResizeObserverSPI = function() {
  366. function ResizeObserverSPI2(callback, controller, callbackCtx) {
  367. this.activeObservations_ = [];
  368. this.observations_ = new MapShim();
  369. if (typeof callback !== "function") {
  370. throw new TypeError("The callback provided as parameter 1 is not a function.");
  371. }
  372. this.callback_ = callback;
  373. this.controller_ = controller;
  374. this.callbackCtx_ = callbackCtx;
  375. }
  376. ResizeObserverSPI2.prototype.observe = function(target) {
  377. if (!arguments.length) {
  378. throw new TypeError("1 argument required, but only 0 present.");
  379. }
  380. if (typeof Element === "undefined" || !(Element instanceof Object)) {
  381. return;
  382. }
  383. if (!(target instanceof getWindowOf(target).Element)) {
  384. throw new TypeError('parameter 1 is not of type "Element".');
  385. }
  386. var observations = this.observations_;
  387. if (observations.has(target)) {
  388. return;
  389. }
  390. observations.set(target, new ResizeObservation(target));
  391. this.controller_.addObserver(this);
  392. this.controller_.refresh();
  393. };
  394. ResizeObserverSPI2.prototype.unobserve = function(target) {
  395. if (!arguments.length) {
  396. throw new TypeError("1 argument required, but only 0 present.");
  397. }
  398. if (typeof Element === "undefined" || !(Element instanceof Object)) {
  399. return;
  400. }
  401. if (!(target instanceof getWindowOf(target).Element)) {
  402. throw new TypeError('parameter 1 is not of type "Element".');
  403. }
  404. var observations = this.observations_;
  405. if (!observations.has(target)) {
  406. return;
  407. }
  408. observations.delete(target);
  409. if (!observations.size) {
  410. this.controller_.removeObserver(this);
  411. }
  412. };
  413. ResizeObserverSPI2.prototype.disconnect = function() {
  414. this.clearActive();
  415. this.observations_.clear();
  416. this.controller_.removeObserver(this);
  417. };
  418. ResizeObserverSPI2.prototype.gatherActive = function() {
  419. var _this = this;
  420. this.clearActive();
  421. this.observations_.forEach(function(observation) {
  422. if (observation.isActive()) {
  423. _this.activeObservations_.push(observation);
  424. }
  425. });
  426. };
  427. ResizeObserverSPI2.prototype.broadcastActive = function() {
  428. if (!this.hasActive()) {
  429. return;
  430. }
  431. var ctx = this.callbackCtx_;
  432. var entries = this.activeObservations_.map(function(observation) {
  433. return new ResizeObserverEntry(observation.target, observation.broadcastRect());
  434. });
  435. this.callback_.call(ctx, entries, ctx);
  436. this.clearActive();
  437. };
  438. ResizeObserverSPI2.prototype.clearActive = function() {
  439. this.activeObservations_.splice(0);
  440. };
  441. ResizeObserverSPI2.prototype.hasActive = function() {
  442. return this.activeObservations_.length > 0;
  443. };
  444. return ResizeObserverSPI2;
  445. }();
  446. var observers = typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : new MapShim();
  447. var ResizeObserver = function() {
  448. function ResizeObserver2(callback) {
  449. if (!(this instanceof ResizeObserver2)) {
  450. throw new TypeError("Cannot call a class as a function.");
  451. }
  452. if (!arguments.length) {
  453. throw new TypeError("1 argument required, but only 0 present.");
  454. }
  455. var controller = ResizeObserverController.getInstance();
  456. var observer = new ResizeObserverSPI(callback, controller, this);
  457. observers.set(this, observer);
  458. }
  459. return ResizeObserver2;
  460. }();
  461. [
  462. "observe",
  463. "unobserve",
  464. "disconnect"
  465. ].forEach(function(method) {
  466. ResizeObserver.prototype[method] = function() {
  467. var _a;
  468. return (_a = observers.get(this))[method].apply(_a, arguments);
  469. };
  470. });
  471. var index = function() {
  472. if (typeof global$1.ResizeObserver !== "undefined") {
  473. return global$1.ResizeObserver;
  474. }
  475. return ResizeObserver;
  476. }();
  477. var ResizeObserver_es_default = index;
  478. export {
  479. ResizeObserver_es_default
  480. };
  481. //# sourceMappingURL=chunk-JNQZPBNY.js.map