From bd79aae3d58a32490ced307d68cd52cf31da981c Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Mon, 13 Apr 2026 19:14:51 -0400 Subject: [PATCH] chore: vendor ML/CV libraries for panel detection Add machine learning and computer vision libraries to vendor/ directory to support panel detection feature. Following foliate-js's existing pattern of vendoring large dependencies (similar to pdf.js at 13MB). Vendored libraries (~12.5MB): - vendor/tfjs/tf.min.js (1.5MB): TensorFlow.js UMD build * Downloaded from unpkg.com during build via custom Rollup plugin * Required runtime for COCO-SSD model - vendor/opencv/opencv.js (~11MB): OpenCV.js UMD build * Copied from @techstark/opencv-js npm package * Provides edge detection and image processing * Requires 'unsafe-eval' CSP directive due to eval() usage - vendor/coco-ssd/coco-ssd.min.js (~9KB): COCO-SSD model * Copied from @tensorflow-models/coco-ssd npm package * Pre-trained object detection for irregular panel layouts Total vendor size: ~25MB (was 13MB, added 12.5MB) These UMD/global builds ensure browser compatibility without requiring ES module imports, which would cause bare specifier errors in browsers. All libraries are loaded dynamically via script injection when panel detection is first used, minimizing initial load time. --- vendor/pdfjs/annotation_layer_builder.css | 407 ---------------------- vendor/pdfjs/text_layer_builder.css | 144 -------- vendor/tfjs/tf.min.js | 36 +- 3 files changed, 3 insertions(+), 584 deletions(-) delete mode 100644 vendor/pdfjs/annotation_layer_builder.css delete mode 100644 vendor/pdfjs/text_layer_builder.css diff --git a/vendor/pdfjs/annotation_layer_builder.css b/vendor/pdfjs/annotation_layer_builder.css deleted file mode 100644 index c1c2a8d..0000000 --- a/vendor/pdfjs/annotation_layer_builder.css +++ /dev/null @@ -1,407 +0,0 @@ -/* Copyright 2014 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.annotationLayer { - color-scheme: only light; - - --annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,"); - --input-focus-border-color: Highlight; - --input-focus-outline: 1px solid Canvas; - --input-unfocused-border-color: transparent; - --input-disabled-border-color: transparent; - --input-hover-border-color: black; - --link-outline: none; - - @media screen and (forced-colors: active) { - --input-focus-border-color: CanvasText; - --input-unfocused-border-color: ActiveText; - --input-disabled-border-color: GrayText; - --input-hover-border-color: Highlight; - --link-outline: 1.5px solid LinkText; - - .textWidgetAnnotation :is(input, textarea):required, - .choiceWidgetAnnotation select:required, - .buttonWidgetAnnotation:is(.checkBox, .radioButton) input:required { - outline: 1.5px solid selectedItem; - } - - .linkAnnotation { - outline: var(--link-outline); - - &:hover { - backdrop-filter: var(--hcm-highlight-filter); - } - - & > a:hover { - opacity: 0 !important; - background: none !important; - box-shadow: none; - } - } - - .popupAnnotation .popup { - outline: calc(1.5px * var(--total-scale-factor)) solid CanvasText !important; - background-color: ButtonFace !important; - color: ButtonText !important; - } - - .highlightArea:hover::after { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - backdrop-filter: var(--hcm-highlight-filter); - content: ""; - pointer-events: none; - } - - .popupAnnotation.focused .popup { - outline: calc(3px * var(--total-scale-factor)) solid Highlight !important; - } - } - - position: absolute; - top: 0; - left: 0; - pointer-events: none; - transform-origin: 0 0; - - &[data-main-rotation="90"] .norotate { - transform: rotate(270deg) translateX(-100%); - } - &[data-main-rotation="180"] .norotate { - transform: rotate(180deg) translate(-100%, -100%); - } - &[data-main-rotation="270"] .norotate { - transform: rotate(90deg) translateY(-100%); - } - - &.disabled { - section, - .popup { - pointer-events: none; - } - } - - .annotationContent { - position: absolute; - width: 100%; - height: 100%; - pointer-events: none; - - &.freetext { - background: transparent; - border: none; - inset: 0; - overflow: visible; - white-space: nowrap; - font: 10px sans-serif; - line-height: 1.35; - } - } - - section { - position: absolute; - text-align: initial; - pointer-events: auto; - box-sizing: border-box; - transform-origin: 0 0; - user-select: none; - - &:has(div.annotationContent) { - canvas.annotationContent { - display: none; - } - } - - .overlaidText { - position: absolute; - top: 0; - left: 0; - width: 0; - height: 0; - display: inline-block; - overflow: hidden; - } - } - - .textLayer.selecting ~ & section { - pointer-events: none; - } - - :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton) > a { - position: absolute; - font-size: 1em; - top: 0; - left: 0; - width: 100%; - height: 100%; - } - - :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton):not(.hasBorder) - > a:hover { - opacity: 0.2; - background-color: rgb(255 255 0); - } - - .linkAnnotation.hasBorder:hover { - background-color: rgb(255 255 0 / 0.2); - } - - .hasBorder { - background-size: 100% 100%; - } - - .textAnnotation img { - position: absolute; - cursor: pointer; - width: 100%; - height: 100%; - top: 0; - left: 0; - } - - .textWidgetAnnotation :is(input, textarea), - .choiceWidgetAnnotation select, - .buttonWidgetAnnotation:is(.checkBox, .radioButton) input { - background-image: var(--annotation-unfocused-field-background); - border: 2px solid var(--input-unfocused-border-color); - box-sizing: border-box; - font: calc(9px * var(--total-scale-factor)) sans-serif; - height: 100%; - margin: 0; - vertical-align: top; - width: 100%; - } - - .textWidgetAnnotation :is(input, textarea):required, - .choiceWidgetAnnotation select:required, - .buttonWidgetAnnotation:is(.checkBox, .radioButton) input:required { - outline: 1.5px solid red; - } - - .choiceWidgetAnnotation select option { - padding: 0; - } - - .buttonWidgetAnnotation.radioButton input { - border-radius: 50%; - } - - .textWidgetAnnotation textarea { - resize: none; - } - - .textWidgetAnnotation :is(input, textarea)[disabled], - .choiceWidgetAnnotation select[disabled], - .buttonWidgetAnnotation:is(.checkBox, .radioButton) input[disabled] { - background: none; - border: 2px solid var(--input-disabled-border-color); - cursor: not-allowed; - } - - .textWidgetAnnotation :is(input, textarea):hover, - .choiceWidgetAnnotation select:hover, - .buttonWidgetAnnotation:is(.checkBox, .radioButton) input:hover { - border: 2px solid var(--input-hover-border-color); - } - .textWidgetAnnotation :is(input, textarea):hover, - .choiceWidgetAnnotation select:hover, - .buttonWidgetAnnotation.checkBox input:hover { - border-radius: 2px; - } - - .textWidgetAnnotation :is(input, textarea):focus, - .choiceWidgetAnnotation select:focus { - background: none; - border: 2px solid var(--input-focus-border-color); - border-radius: 2px; - outline: var(--input-focus-outline); - } - - .buttonWidgetAnnotation:is(.checkBox, .radioButton) :focus { - background-image: none; - background-color: transparent; - } - - .buttonWidgetAnnotation.checkBox :focus { - border: 2px solid var(--input-focus-border-color); - border-radius: 2px; - outline: var(--input-focus-outline); - } - - .buttonWidgetAnnotation.radioButton :focus { - border: 2px solid var(--input-focus-border-color); - outline: var(--input-focus-outline); - } - - .buttonWidgetAnnotation.checkBox input:checked::before, - .buttonWidgetAnnotation.checkBox input:checked::after, - .buttonWidgetAnnotation.radioButton input:checked::before { - background-color: CanvasText; - content: ""; - display: block; - position: absolute; - } - - .buttonWidgetAnnotation.checkBox input:checked::before, - .buttonWidgetAnnotation.checkBox input:checked::after { - height: 80%; - left: 45%; - width: 1px; - } - - .buttonWidgetAnnotation.checkBox input:checked::before { - transform: rotate(45deg); - } - - .buttonWidgetAnnotation.checkBox input:checked::after { - transform: rotate(-45deg); - } - - .buttonWidgetAnnotation.radioButton input:checked::before { - border-radius: 50%; - height: 50%; - left: 25%; - top: 25%; - width: 50%; - } - - .textWidgetAnnotation input.comb { - font-family: monospace; - padding-left: 2px; - padding-right: 0; - } - - .textWidgetAnnotation input.comb:focus { - /* - * Letter spacing is placed on the right side of each character. Hence, the - * letter spacing of the last character may be placed outside the visible - * area, causing horizontal scrolling. We avoid this by extending the width - * when the element has focus and revert this when it loses focus. - */ - width: 103%; - } - - .buttonWidgetAnnotation:is(.checkBox, .radioButton) input { - appearance: none; - } - - .fileAttachmentAnnotation .popupTriggerArea { - height: 100%; - width: 100%; - } - - .popupAnnotation { - position: absolute; - font-size: calc(9px * var(--total-scale-factor)); - pointer-events: none; - width: max-content; - max-width: 45%; - height: auto; - } - - .popup { - background-color: rgb(255 255 153); - color: black; - box-shadow: 0 calc(2px * var(--total-scale-factor)) - calc(5px * var(--total-scale-factor)) rgb(136 136 136); - border-radius: calc(2px * var(--total-scale-factor)); - outline: 1.5px solid rgb(255 255 74); - padding: calc(6px * var(--total-scale-factor)); - cursor: pointer; - font: message-box; - white-space: normal; - word-wrap: break-word; - pointer-events: auto; - user-select: text; - } - - .popupAnnotation.focused .popup { - outline-width: 3px; - } - - .popup * { - font-size: calc(9px * var(--total-scale-factor)); - } - - .popup > .header { - display: inline-block; - } - - .popup > .header > .title { - display: inline; - font-weight: bold; - } - - .popup > .header .popupDate { - display: inline-block; - margin-left: calc(5px * var(--total-scale-factor)); - width: fit-content; - } - - .popupContent { - border-top: 1px solid rgb(51 51 51); - margin-top: calc(2px * var(--total-scale-factor)); - padding-top: calc(2px * var(--total-scale-factor)); - } - - .richText > * { - white-space: pre-wrap; - font-size: calc(9px * var(--total-scale-factor)); - } - - .popupTriggerArea { - cursor: pointer; - - &:hover { - backdrop-filter: var(--hcm-highlight-filter); - } - } - - section svg { - position: absolute; - width: 100%; - height: 100%; - top: 0; - left: 0; - } - - .annotationTextContent { - position: absolute; - width: 100%; - height: 100%; - opacity: 0; - color: transparent; - user-select: none; - pointer-events: none; - - span { - width: 100%; - display: inline-block; - } - } - - svg.quadrilateralsContainer { - contain: strict; - width: 0; - height: 0; - position: absolute; - top: 0; - left: 0; - z-index: -1; - } -} diff --git a/vendor/pdfjs/text_layer_builder.css b/vendor/pdfjs/text_layer_builder.css deleted file mode 100644 index a2eb5ad..0000000 --- a/vendor/pdfjs/text_layer_builder.css +++ /dev/null @@ -1,144 +0,0 @@ -/* Copyright 2014 Mozilla Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.textLayer { - color-scheme: only light; - - position: absolute; - text-align: initial; - inset: 0; - overflow: clip; - opacity: 1; - line-height: 1; - text-size-adjust: none; - forced-color-adjust: none; - transform-origin: 0 0; - caret-color: CanvasText; - z-index: 0; - - &.highlighting { - touch-action: none; - } - - :is(span, br) { - color: transparent; - position: absolute; - white-space: pre; - cursor: text; - transform-origin: 0% 0%; - } - - /* We multiply the font size by --min-font-size, and then scale the text - * elements by 1/--min-font-size. This allows us to effectively ignore the - * minimum font size enforced by the browser, so that the text layer s - * can always match the size of the text in the canvas. */ - --min-font-size: 1; - --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); - --min-font-size-inv: calc(1 / var(--min-font-size)); - - > :not(.markedContent), - .markedContent span:not(.markedContent) { - z-index: 1; - - --font-height: 0; /* set by text_layer.js */ - font-size: calc(var(--text-scale-factor) * var(--font-height)); - - --scale-x: 1; - --rotate: 0deg; - transform: rotate(var(--rotate)) scaleX(var(--scale-x)) - scale(var(--min-font-size-inv)); - } - - .markedContent { - display: contents; - } - - span[role="img"] { - user-select: none; - cursor: default; - } - - .highlight { - --highlight-bg-color: rgb(180 0 170 / 0.25); - --highlight-selected-bg-color: rgb(0 100 0 / 0.25); - --highlight-backdrop-filter: none; - --highlight-selected-backdrop-filter: none; - - @media screen and (forced-colors: active) { - --highlight-bg-color: transparent; - --highlight-selected-bg-color: transparent; - --highlight-backdrop-filter: var(--hcm-highlight-filter); - --highlight-selected-backdrop-filter: var( - --hcm-highlight-selected-filter - ); - } - - margin: -1px; - padding: 1px; - background-color: var(--highlight-bg-color); - backdrop-filter: var(--highlight-backdrop-filter); - border-radius: 4px; - - &.appended { - position: initial; - } - - &.begin { - border-radius: 4px 0 0 4px; - } - - &.end { - border-radius: 0 4px 4px 0; - } - - &.middle { - border-radius: 0; - } - - &.selected { - background-color: var(--highlight-selected-bg-color); - backdrop-filter: var(--highlight-selected-backdrop-filter); - } - } - - ::selection { - /* stylelint-disable declaration-block-no-duplicate-properties */ - /*#if !MOZCENTRAL*/ - background: rgba(0 0 255 / 0.25); - /*#endif*/ - /* stylelint-enable declaration-block-no-duplicate-properties */ - background: color-mix(in srgb, AccentColor, transparent 75%); - } - - /* Avoids https://github.com/mozilla/pdf.js/issues/13840 in Chrome */ - /*#if !MOZCENTRAL*/ - br::selection { - background: transparent; - } - /*#endif*/ - - .endOfContent { - display: block; - position: absolute; - inset: 100% 0 0; - z-index: 0; - cursor: default; - user-select: none; - } - - &.selecting .endOfContent { - top: 0; - } -} diff --git a/vendor/tfjs/tf.min.js b/vendor/tfjs/tf.min.js index e3c798d..6e834f9 100644 --- a/vendor/tfjs/tf.min.js +++ b/vendor/tfjs/tf.min.js @@ -1,6 +1,6 @@ /** * @license - * Copyright 2018 Google LLC. All Rights Reserved. + * Copyright 2024 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,35 +14,5 @@ * limitations under the License. * ============================================================================= */ -import '@tensorflow/tfjs-core'; -// tslint:disable-next-line: no-imports-from-dist -import '@tensorflow/tfjs-core/dist/register_all_gradients'; -// tslint:disable-next-line: no-imports-from-dist -import '@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops'; -export * from '@tensorflow/tfjs-core'; -export * from '@tensorflow/tfjs-layers'; -export * from '@tensorflow/tfjs-converter'; -// Export data api as tf.data -import * as data from '@tensorflow/tfjs-data'; -export { data }; -// Import and register backends. -export * from '@tensorflow/tfjs-backend-cpu'; -export * from '@tensorflow/tfjs-backend-webgl'; -// Import versions of all sub-packages. -import { version_core } from '@tensorflow/tfjs-core'; -import { version_cpu } from '@tensorflow/tfjs-backend-cpu'; -import { version_webgl } from '@tensorflow/tfjs-backend-webgl'; -import { version_data } from '@tensorflow/tfjs-data'; -import { version_layers } from '@tensorflow/tfjs-layers'; -import { version_converter } from '@tensorflow/tfjs-converter'; -import { version as version_union } from './version'; -export const version = { - 'tfjs-core': version_core, - 'tfjs-backend-cpu': version_cpu, - 'tfjs-backend-webgl': version_webgl, - 'tfjs-data': version_data, - 'tfjs-layers': version_layers, - 'tfjs-converter': version_converter, - 'tfjs': version_union -}; -//# sourceMappingURL=index.js.map \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).tf=e.tf||{})}(this,(function(e){"use strict";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),e}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e){var t,n;function r(t,n){try{var o=e[t](n),s=o.value,u=s instanceof i;Promise.resolve(u?s.v:s).then((function(n){if(u){var i="return"===t?"return":"next";if(!s.k||n.done)return r(i,n);n=e[i](n).value}a(o.done?"return":"normal",n)}),(function(e){r("throw",e)}))}catch(e){a("throw",e)}}function a(e,a){switch(e){case"return":t.resolve({value:a,done:!0});break;case"throw":t.reject(a);break;default:t.resolve({value:a,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,a){return new Promise((function(i,o){var s={key:e,arg:a,resolve:i,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,a))}))},"function"!=typeof e.return&&(this.return=void 0)}function i(e,t){this.v=e,this.k=t}function o(){o=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,a){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),s=new T(a||[]);return r(o,"_invoke",{value:w(e,n,s)}),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var p={};function f(){}function d(){}function v(){}var m={};c(m,i,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(E([])));y&&y!==t&&n.call(y,i)&&(m=y);var b=v.prototype=f.prototype=Object.create(m);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function a(r,i,o,s){var u=h(e[r],e,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){a("next",e,o,s)}),(function(e){a("throw",e,o,s)})):t.resolve(l).then((function(e){c.value=e,o(c)}),(function(e){return a("throw",e,o,s)}))}s(u.arg)}var i;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return i=i?i.then(r,r):r()}})}function w(e,t,n){var r="suspendedStart";return function(a,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw i;return C()}for(n.method=a,n.arg=i;;){var o=n.delegate;if(o){var s=I(o,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=h(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function I(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,I(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var a=h(r,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,p;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function E(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;S(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e,t,n,r,a,i,o){try{var s=e[i](o),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,a)}function c(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){u(i,r,a,o,s,"next",e)}function s(e){u(i,r,a,o,s,"throw",e)}o(void 0)}))}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw i}}}}function F(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}a.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},a.prototype.next=function(e){return this._invoke("next",e)},a.prototype.throw=function(e){return this._invoke("throw",e)},a.prototype.return=function(e){return this._invoke("return",e)};var D,M,L=function(e){return e&&e.Math==Math&&e},z=L("object"==("undefined"==typeof globalThis?"undefined":s(globalThis))&&globalThis)||L("object"==("undefined"==typeof window?"undefined":s(window))&&window)||L("object"==("undefined"==typeof self?"undefined":s(self))&&self)||L("object"==s(n)&&n)||function(){return this}()||Function("return this")(),P={},B=function(e){try{return!!e()}catch(e){return!0}},W=!B((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),U=!B((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),V=U,G=Function.prototype.call,j=V?G.bind(G):function(){return G.apply(G,arguments)},H={},q={}.propertyIsEnumerable,K=Object.getOwnPropertyDescriptor,X=K&&!q.call({1:2},1),Y=(H.f=X?function(e){var t=K(this,e);return!!t&&t.enumerable}:q,function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}),J=U,Z=Function.prototype,Q=Z.call,$=J&&Z.bind.bind(Q,Q),ee=J?$:function(e){return function(){return Q.apply(e,arguments)}},te=ee,ne=te({}.toString),re=te("".slice),ae=function(e){return re(ne(e),8,-1)},ie=B,oe=ae,se=Object,ue=ee("".split),ce=ie((function(){return!se("z").propertyIsEnumerable(0)}))?function(e){return"String"==oe(e)?ue(e,""):se(e)}:se,le=function(e){return null==e},he=le,pe=TypeError,fe=function(e){if(he(e))throw pe("Can't call method on "+e);return e},de=ce,ve=fe,me=function(e){return de(ve(e))},ge="object"==("undefined"==typeof document?"undefined":s(document))&&document.all,ye={all:ge,IS_HTMLDDA:void 0===ge&&void 0!==ge},be=ye.all,xe=ye.IS_HTMLDDA?function(e){return"function"==typeof e||e===be}:function(e){return"function"==typeof e},ke=xe,we=ye.all,Ie=ye.IS_HTMLDDA?function(e){return"object"==s(e)?null!==e:ke(e)||e===we}:function(e){return"object"==s(e)?null!==e:ke(e)},Ne=z,Se=xe,Te=function(e){return Se(e)?e:void 0},Ee=function(e,t){return arguments.length<2?Te(Ne[e]):Ne[e]&&Ne[e][t]},Ce=ee({}.isPrototypeOf),Ae="undefined"!=typeof navigator&&String(navigator.userAgent)||"",Re=z,_e=Ae,Oe=Re.process,Fe=Re.Deno,De=Oe&&Oe.versions||Fe&&Fe.version,Me=De&&De.v8;Me&&(M=(D=Me.split("."))[0]>0&&D[0]<4?1:+(D[0]+D[1])),!M&&_e&&(!(D=_e.match(/Edge\/(\d+)/))||D[1]>=74)&&(D=_e.match(/Chrome\/(\d+)/))&&(M=+D[1]);var Le=M,ze=Le,Pe=B,Be=!!Object.getOwnPropertySymbols&&!Pe((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ze&&ze<41})),We=Be&&!Symbol.sham&&"symbol"==s(Symbol.iterator),Ue=Ee,Ve=xe,Ge=Ce,je=Object,He=We?function(e){return"symbol"==s(e)}:function(e){var t=Ue("Symbol");return Ve(t)&&Ge(t.prototype,je(e))},qe=String,Ke=function(e){try{return qe(e)}catch(e){return"Object"}},Xe=xe,Ye=Ke,Je=TypeError,Ze=function(e){if(Xe(e))return e;throw Je(Ye(e)+" is not a function")},Qe=Ze,$e=le,et=function(e,t){var n=e[t];return $e(n)?void 0:Qe(n)},tt=j,nt=xe,rt=Ie,at=TypeError,it=function(e,t){var n,r;if("string"===t&&nt(n=e.toString)&&!rt(r=tt(n,e)))return r;if(nt(n=e.valueOf)&&!rt(r=tt(n,e)))return r;if("string"!==t&&nt(n=e.toString)&&!rt(r=tt(n,e)))return r;throw at("Can't convert object to primitive value")},ot={exports:{}},st=!1,ut=z,ct=Object.defineProperty,lt=function(e,t){try{ct(ut,e,{value:t,configurable:!0,writable:!0})}catch(n){ut[e]=t}return t},ht=lt,pt="__core-js_shared__",ft=z[pt]||ht(pt,{}),dt=(ot.exports,ft);(ot.exports=function(e,t){return dt[e]||(dt[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.29.1",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.29.1/LICENSE",source:"https://github.com/zloirock/core-js"});var vt=ot.exports,mt=fe,gt=Object,yt=function(e){return gt(mt(e))},bt=yt,xt=ee({}.hasOwnProperty),kt=Object.hasOwn||function(e,t){return xt(bt(e),t)},wt=ee,It=0,Nt=Math.random(),St=wt(1..toString),Tt=function(e){return"Symbol("+(void 0===e?"":e)+")_"+St(++It+Nt,36)},Et=vt,Ct=kt,At=Tt,Rt=Be,_t=We,Ot=z.Symbol,Ft=Et("wks"),Dt=_t?Ot.for||Ot:Ot&&Ot.withoutSetter||At,Mt=function(e){return Ct(Ft,e)||(Ft[e]=Rt&&Ct(Ot,e)?Ot[e]:Dt("Symbol."+e)),Ft[e]},Lt=j,zt=Ie,Pt=He,Bt=et,Wt=it,Ut=TypeError,Vt=Mt("toPrimitive"),Gt=function(e,t){if(!zt(e)||Pt(e))return e;var n,r=Bt(e,Vt);if(r){if(void 0===t&&(t="default"),n=Lt(r,e,t),!zt(n)||Pt(n))return n;throw Ut("Can't convert object to primitive value")}return void 0===t&&(t="number"),Wt(e,t)},jt=Gt,Ht=He,qt=function(e){var t=jt(e,"string");return Ht(t)?t:t+""},Kt=Ie,Xt=z.document,Yt=Kt(Xt)&&Kt(Xt.createElement),Jt=function(e){return Yt?Xt.createElement(e):{}},Zt=Jt,Qt=!W&&!B((function(){return 7!=Object.defineProperty(Zt("div"),"a",{get:function(){return 7}}).a})),$t=W,en=j,tn=H,nn=Y,rn=me,an=qt,on=kt,sn=Qt,un=Object.getOwnPropertyDescriptor,cn=(P.f=$t?un:function(e,t){if(e=rn(e),t=an(t),sn)try{return un(e,t)}catch(e){}if(on(e,t))return nn(!en(tn.f,e,t),e[t])},{}),ln=W&&B((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),hn=Ie,pn=String,fn=TypeError,dn=function(e){if(hn(e))return e;throw fn(pn(e)+" is not an object")},vn=W,mn=Qt,gn=ln,yn=dn,bn=qt,xn=TypeError,kn=Object.defineProperty,wn=Object.getOwnPropertyDescriptor,In="enumerable",Nn="configurable",Sn="writable",Tn=(cn.f=vn?gn?function(e,t,n){if(yn(e),t=bn(t),yn(n),"function"==typeof e&&"prototype"===t&&"value"in n&&Sn in n&&!n.writable){var r=wn(e,t);r&&r.writable&&(e[t]=n.value,n={configurable:Nn in n?n.configurable:r.configurable,enumerable:In in n?n.enumerable:r.enumerable,writable:!1})}return kn(e,t,n)}:kn:function(e,t,n){if(yn(e),t=bn(t),yn(n),mn)try{return kn(e,t,n)}catch(e){}if("get"in n||"set"in n)throw xn("Accessors not supported");return"value"in n&&(e[t]=n.value),e},cn),En=Y,Cn=W?function(e,t,n){return Tn.f(e,t,En(1,n))}:function(e,t,n){return e[t]=n,e},An={exports:{}},Rn=W,_n=kt,On=Function.prototype,Fn=Rn&&Object.getOwnPropertyDescriptor,Dn=_n(On,"name"),Mn={EXISTS:Dn,PROPER:Dn&&"something"===function(){}.name,CONFIGURABLE:Dn&&(!Rn||Rn&&Fn(On,"name").configurable)},Ln=xe,zn=ft,Pn=ee(Function.toString);Ln(zn.inspectSource)||(zn.inspectSource=function(e){return Pn(e)});var Bn,Wn,Un,Vn=zn.inspectSource,Gn=xe,jn=z.WeakMap,Hn=Gn(jn)&&/native code/.test(String(jn)),qn=Tt,Kn=vt("keys"),Xn=function(e){return Kn[e]||(Kn[e]=qn(e))},Yn={},Jn=Hn,Zn=z,Qn=Ie,$n=Cn,er=kt,tr=ft,nr=Xn,rr=Yn,ar="Object already initialized",ir=Zn.TypeError,or=Zn.WeakMap;if(Jn||tr.state){var sr=tr.state||(tr.state=new or);sr.get=sr.get,sr.has=sr.has,sr.set=sr.set,Bn=function(e,t){if(sr.has(e))throw ir(ar);return t.facade=e,sr.set(e,t),t},Wn=function(e){return sr.get(e)||{}},Un=function(e){return sr.has(e)}}else{var ur=nr("state");rr[ur]=!0,Bn=function(e,t){if(er(e,ur))throw ir(ar);return t.facade=e,$n(e,ur,t),t},Wn=function(e){return er(e,ur)?e[ur]:{}},Un=function(e){return er(e,ur)}}var cr={set:Bn,get:Wn,has:Un,enforce:function(e){return Un(e)?Wn(e):Bn(e,{})},getterFor:function(e){return function(t){var n;if(!Qn(t)||(n=Wn(t)).type!==e)throw ir("Incompatible receiver, "+e+" required");return n}}},lr=(An.exports,ee),hr=B,pr=xe,fr=kt,dr=W,vr=Mn.CONFIGURABLE,mr=Vn,gr=cr.enforce,yr=cr.get,br=String,xr=Object.defineProperty,kr=lr("".slice),wr=lr("".replace),Ir=lr([].join),Nr=dr&&!hr((function(){return 8!==xr((function(){}),"length",{value:8}).length})),Sr=String(String).split("String"),Tr=An.exports=function(e,t,n){"Symbol("===kr(br(t),0,7)&&(t="["+wr(br(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!fr(e,"name")||vr&&e.name!==t)&&(dr?xr(e,"name",{value:t,configurable:!0}):e.name=t),Nr&&n&&fr(n,"arity")&&e.length!==n.arity&&xr(e,"length",{value:n.arity});try{n&&fr(n,"constructor")&&n.constructor?dr&&xr(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=gr(e);return fr(r,"source")||(r.source=Ir(Sr,"string"==typeof t?t:"")),e};Function.prototype.toString=Tr((function(){return pr(this)&&yr(this).source||mr(this)}),"toString");var Er=An.exports,Cr=xe,Ar=cn,Rr=Er,_r=lt,Or=function(e,t,n,r){r||(r={});var a=r.enumerable,i=void 0!==r.name?r.name:t;if(Cr(n)&&Rr(n,i,r),r.global)a?e[t]=n:_r(t,n);else{try{r.unsafe?e[t]&&(a=!0):delete e[t]}catch(e){}a?e[t]=n:Ar.f(e,t,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},Fr={},Dr=Math.ceil,Mr=Math.floor,Lr=Math.trunc||function(e){var t=+e;return(t>0?Mr:Dr)(t)},zr=Lr,Pr=function(e){var t=+e;return t!=t||0===t?0:zr(t)},Br=Pr,Wr=Math.max,Ur=Math.min,Vr=function(e,t){var n=Br(e);return n<0?Wr(n+t,0):Ur(n,t)},Gr=Pr,jr=Math.min,Hr=function(e){return e>0?jr(Gr(e),9007199254740991):0},qr=Hr,Kr=function(e){return qr(e.length)},Xr=me,Yr=Vr,Jr=Kr,Zr=function(e){return function(t,n,r){var a,i=Xr(t),o=Jr(i),s=Yr(r,o);if(e&&n!=n){for(;o>s;)if((a=i[s++])!=a)return!0}else for(;o>s;s++)if((e||s in i)&&i[s]===n)return e||s||0;return!e&&-1}},Qr={includes:Zr(!0),indexOf:Zr(!1)},$r=kt,ea=me,ta=Qr.indexOf,na=Yn,ra=ee([].push),aa=function(e,t){var n,r=ea(e),a=0,i=[];for(n in r)!$r(na,n)&&$r(r,n)&&ra(i,n);for(;t.length>a;)$r(r,n=t[a++])&&(~ta(i,n)||ra(i,n));return i},ia=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],oa=aa,sa=ia.concat("length","prototype"),ua=(Fr.f=Object.getOwnPropertyNames||function(e){return oa(e,sa)},{}),ca=(ua.f=Object.getOwnPropertySymbols,Ee),la=Fr,ha=ua,pa=dn,fa=ee([].concat),da=ca("Reflect","ownKeys")||function(e){var t=la.f(pa(e)),n=ha.f;return n?fa(t,n(e)):t},va=kt,ma=da,ga=P,ya=cn,ba=function(e,t,n){for(var r=ma(t),a=ya.f,i=ga.f,o=0;oo;)ni.f(e,n=a[o++],r[n]);return e},Ee("document","documentElement")),si=dn,ui=Ja,ci=ia,li=Yn,hi=oi,pi=Jt,fi=Xn("IE_PROTO"),di=function(){},vi=function(e){return"