@pictogrammers/components 0.3.2 → 0.4.0
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.
- package/README.md +11 -12
- package/favicon.svg +20 -0
- package/index.html +67 -49
- package/main.js +2 -0
- package/main.js.LICENSE.txt +10 -0
- package/package.json +6 -6
- package/pg/annoy/README.md +0 -5
- package/pg/annoy/__examples__/basic/basic.css +3 -0
- package/pg/annoy/__examples__/basic/basic.html +4 -7
- package/pg/annoy/__examples__/basic/basic.ts +3 -1
- package/pg/annoy/annoy.css +29 -198
- package/pg/annoy/annoy.html +5 -56
- package/pg/annoy/annoy.ts +4 -25
- package/pg/app/README.md +11 -0
- package/pg/app/__examples__/basic/basic.css +8 -0
- package/pg/app/__examples__/basic/basic.html +15 -0
- package/pg/app/__examples__/basic/basic.ts +13 -0
- package/pg/app/app.css +108 -0
- package/pg/app/app.html +16 -0
- package/pg/app/app.ts +45 -0
- package/pg/app/index.ts +3 -0
- package/pg/avatar/__examples__/basic/basic.ts +5 -3
- package/pg/button/README.md +3 -0
- package/pg/button/button.css +13 -12
- package/pg/button/button.spec.ts +35 -0
- package/pg/button/button.ts +17 -12
- package/pg/buttonLink/buttonLink.css +3 -2
- package/pg/buttonMenu/README.md +54 -0
- package/pg/buttonMenu/__examples__/basic/basic.html +6 -0
- package/pg/buttonMenu/__examples__/basic/basic.ts +43 -0
- package/pg/buttonMenu/buttonMenu.css +12 -0
- package/pg/buttonMenu/buttonMenu.html +4 -0
- package/pg/buttonMenu/buttonMenu.ts +63 -0
- package/pg/buttonMenu/index.ts +3 -0
- package/pg/buttonToggle/__examples__/basic/basic.ts +2 -2
- package/pg/buttonToggle/__examples__/persist/persist.html +10 -0
- package/pg/buttonToggle/__examples__/persist/persist.ts +35 -0
- package/pg/cardUser/__examples__/basic/basic.ts +0 -1
- package/pg/cardUser/cardUser.css +2 -10
- package/pg/cardUser/cardUser.html +0 -5
- package/pg/cardUser/cardUser.ts +0 -6
- package/pg/database/README.md +1 -1
- package/pg/database/__examples__/basic/basic.html +2 -1
- package/pg/database/__examples__/basic/basic.ts +3 -3
- package/pg/dropdown/dropdown.ts +0 -19
- package/pg/grid/__examples__/basic/basic.html +2 -2
- package/pg/grid/__examples__/basic/basic.ts +3 -2
- package/pg/grid/grid.ts +0 -1
- package/pg/icon/README.md +6 -5
- package/pg/icon/__examples__/basic/basic.html +2 -2
- package/pg/icon/__examples__/basic/basic.ts +1 -1
- package/pg/icon/icon.ts +6 -0
- package/pg/inputCheckList/__examples__/basic/basic.ts +5 -5
- package/pg/inputCheckList/inputCheckList.ts +2 -0
- package/pg/inputFileLocal/inputFileLocal.css +3 -2
- package/pg/inputPixelEditor/README.md +132 -0
- package/pg/inputPixelEditor/__examples__/basic/basic.css +29 -0
- package/pg/inputPixelEditor/__examples__/basic/basic.html +63 -0
- package/pg/inputPixelEditor/__examples__/basic/basic.ts +200 -0
- package/pg/inputPixelEditor/__examples__/basic/openUtils.ts +41 -0
- package/pg/inputPixelEditor/__examples__/basic/saveUtil.ts +35 -0
- package/pg/inputPixelEditor/index.ts +3 -0
- package/pg/inputPixelEditor/inputPixelEditor.css +27 -0
- package/pg/inputPixelEditor/inputPixelEditor.html +3 -0
- package/pg/inputPixelEditor/inputPixelEditor.ts +839 -0
- package/pg/inputPixelEditor/utils/bitmapToMask.ts +202 -0
- package/pg/inputPixelEditor/utils/cloneGrid.ts +17 -0
- package/pg/inputPixelEditor/utils/constants.ts +1 -0
- package/pg/inputPixelEditor/utils/createLayer.ts +8 -0
- package/pg/inputPixelEditor/utils/debounce.ts +5 -0
- package/pg/inputPixelEditor/utils/diffGrid.ts +26 -0
- package/pg/inputPixelEditor/utils/fillGrid.ts +11 -0
- package/pg/inputPixelEditor/utils/getEllipseOutlinePixels.ts +105 -0
- package/pg/inputPixelEditor/utils/getEllipsePixels.ts +28 -0
- package/pg/inputPixelEditor/utils/getGuides.ts +232 -0
- package/pg/inputPixelEditor/utils/getLinePixels.ts +18 -0
- package/pg/inputPixelEditor/utils/getRectangleOutlinePixels.ts +20 -0
- package/pg/inputPixelEditor/utils/getRectanglePixels.ts +15 -0
- package/pg/inputPixelEditor/utils/inputMode.ts +8 -0
- package/pg/inputPixelEditor/utils/interateGrid.ts +7 -0
- package/pg/inputPixelEditor/utils/isEmptyGrid.ts +3 -0
- package/pg/inputPixelEditor/utils/maskToBitmap.ts +66 -0
- package/pg/inputRange/__examples__/basic/basic.ts +4 -4
- package/pg/inputRange/inputRange.ts +6 -4
- package/pg/inputSelect/README.md +1 -1
- package/pg/inputSelect/__examples__/basic/basic.ts +7 -5
- package/pg/inputSelect/inputSelect.css +15 -12
- package/pg/inputSelect/inputSelect.html +3 -3
- package/pg/inputSelect/inputSelect.ts +33 -30
- package/pg/inputText/__examples__/basic/basic.ts +6 -6
- package/pg/inputText/inputText.css +1 -0
- package/pg/inputUserSelect/README.md +1 -1
- package/pg/inputUserSelect/inputUserSelect.ts +1 -1
- package/pg/listTag/__examples__/basic/basic.ts +4 -5
- package/pg/markdown/README.md +17 -3
- package/pg/markdown/__examples__/basic/basic.ts +2 -2
- package/pg/markdown/__examples__/basic/constants.ts +1 -1
- package/pg/markdown/markdown.css +11 -0
- package/pg/menu/README.md +46 -0
- package/pg/menu/__examples__/basic/basic.html +6 -0
- package/pg/menu/__examples__/basic/basic.ts +46 -0
- package/pg/menu/index.ts +3 -0
- package/pg/menu/menu.css +19 -0
- package/pg/menu/menu.html +1 -0
- package/pg/menu/menu.ts +119 -0
- package/pg/menuDivider/README.md +7 -0
- package/pg/menuDivider/__examples__/basic/basic.html +3 -0
- package/pg/menuDivider/__examples__/basic/basic.ts +28 -0
- package/pg/menuDivider/index.ts +3 -0
- package/pg/menuDivider/menuDivider.css +9 -0
- package/pg/menuDivider/menuDivider.html +1 -0
- package/pg/menuDivider/menuDivider.ts +22 -0
- package/pg/menuIcon/menuIcon.ts +43 -36
- package/pg/menuItem/README.md +32 -0
- package/pg/menuItem/__examples__/basic/basic.html +26 -0
- package/pg/menuItem/__examples__/basic/basic.ts +41 -0
- package/pg/menuItem/index.ts +3 -0
- package/pg/menuItem/menuItem.css +97 -0
- package/pg/menuItem/menuItem.html +1 -0
- package/pg/menuItem/menuItem.ts +77 -0
- package/pg/menuItemIcon/README.md +32 -0
- package/pg/menuItemIcon/__examples__/basic/basic.html +34 -0
- package/pg/menuItemIcon/__examples__/basic/basic.ts +55 -0
- package/pg/menuItemIcon/index.ts +3 -0
- package/pg/menuItemIcon/menuItemIcon.css +106 -0
- package/pg/menuItemIcon/menuItemIcon.html +4 -0
- package/pg/menuItemIcon/menuItemIcon.ts +156 -0
- package/pg/modalAlert/__examples__/basic/basic.ts +1 -1
- package/pg/modalAlert/modalAlert.css +1 -4
- package/pg/modalAlert/modalAlert.ts +18 -4
- package/pg/modification/__examples__/basic/basic.ts +1 -2
- package/pg/modification/__examples__/basic/constants.ts +25 -50
- package/pg/modification/modification.ts +1 -1
- package/pg/overlay/overlay.ts +13 -12
- package/pg/overlayContextMenu/README.md +35 -0
- package/pg/overlayContextMenu/__examples__/basic/basic.css +23 -0
- package/pg/overlayContextMenu/__examples__/basic/basic.html +7 -0
- package/pg/overlayContextMenu/__examples__/basic/basic.ts +87 -0
- package/pg/overlayContextMenu/index.ts +3 -0
- package/pg/overlayContextMenu/overlayContextMenu.css +16 -0
- package/pg/overlayContextMenu/overlayContextMenu.html +3 -0
- package/pg/overlayContextMenu/overlayContextMenu.ts +98 -0
- package/pg/overlayMenu/README.md +33 -0
- package/pg/overlayMenu/__examples__/basic/basic.css +3 -0
- package/pg/overlayMenu/__examples__/basic/basic.html +5 -0
- package/pg/overlayMenu/__examples__/basic/basic.ts +62 -0
- package/pg/overlayMenu/index.ts +3 -0
- package/pg/overlayMenu/overlayMenu.css +16 -0
- package/pg/overlayMenu/overlayMenu.html +3 -0
- package/pg/overlayMenu/overlayMenu.ts +67 -0
- package/pg/overlaySelectMenu/README.md +33 -0
- package/pg/overlaySelectMenu/__examples__/basic/basic.css +3 -0
- package/pg/overlaySelectMenu/__examples__/basic/basic.html +5 -0
- package/pg/overlaySelectMenu/__examples__/basic/basic.ts +62 -0
- package/pg/overlaySelectMenu/index.ts +3 -0
- package/pg/overlaySelectMenu/overlaySelectMenu.css +17 -0
- package/pg/overlaySelectMenu/overlaySelectMenu.html +3 -0
- package/pg/overlaySelectMenu/overlaySelectMenu.ts +96 -0
- package/pg/overlaySubMenu/README.md +35 -0
- package/pg/overlaySubMenu/index.ts +3 -0
- package/pg/overlaySubMenu/overlaySubMenu.css +27 -0
- package/pg/overlaySubMenu/overlaySubMenu.html +3 -0
- package/pg/overlaySubMenu/overlaySubMenu.ts +103 -0
- package/pg/picker/picker.ts +1 -19
- package/pg/scroll/__examples__/basic/basic.ts +1 -1
- package/pg/search/__examples__/basic/basic.ts +10 -7
- package/pg/search/search.css +2 -2
- package/pg/shared/models/user.ts +0 -2
- package/pg/tab/tab.ts +0 -10
- package/pg/tabs/partials/tab.css +42 -0
- package/pg/tabs/partials/tab.ts +70 -0
- package/pg/tabs/tabs.css +0 -53
- package/pg/tabs/tabs.ts +54 -70
- package/pg/toast/README.md +35 -6
- package/pg/toast/__examples__/basic/basic.html +7 -0
- package/pg/toast/__examples__/basic/basic.ts +76 -0
- package/pg/toast/toast.css +3 -0
- package/pg/toast/toast.ts +20 -4
- package/pg/tooltip/addTooltip.ts +3 -1
- package/pg/tooltip/tooltip.ts +1 -1
- package/pg/tree/README.md +67 -0
- package/pg/tree/__examples__/basic/basic.html +10 -0
- package/pg/tree/__examples__/basic/basic.ts +162 -0
- package/pg/tree/index.ts +3 -0
- package/pg/tree/tree.css +28 -0
- package/pg/tree/tree.html +1 -0
- package/pg/tree/tree.ts +217 -0
- package/pg/treeButtonIcon/README.md +39 -0
- package/pg/treeButtonIcon/index.ts +3 -0
- package/pg/treeButtonIcon/treeButtonIcon.css +18 -0
- package/pg/treeButtonIcon/treeButtonIcon.html +3 -0
- package/pg/treeButtonIcon/treeButtonIcon.ts +42 -0
- package/pg/treeItem/README.md +3 -0
- package/pg/treeItem/index.ts +3 -0
- package/pg/treeItem/treeItem.css +263 -0
- package/pg/treeItem/treeItem.html +16 -0
- package/pg/treeItem/treeItem.ts +558 -0
- package/pgAnnoy.js +1 -0
- package/pgApp.js +1 -0
- package/pgAvatar.js +1 -0
- package/pgButton.js +1 -0
- package/pgButtonGroup.js +1 -0
- package/pgButtonLink.js +1 -0
- package/pgButtonMenu.js +1 -0
- package/pgButtonToggle.js +1 -0
- package/pgCard.js +1 -0
- package/pgCardUser.js +1 -0
- package/pgColor.js +1 -0
- package/pgDatabase.js +1 -0
- package/pgDropdown.js +1 -0
- package/pgGrid.js +1 -0
- package/pgHeader.js +1 -0
- package/pgIcon.js +1 -0
- package/pgInputCheck.js +1 -0
- package/pgInputCheckList.js +1 -0
- package/pgInputFileLocal.js +1 -0
- package/pgInputHexRgb.js +1 -0
- package/pgInputPixelEditor.js +1 -0
- package/pgInputRange.js +1 -0
- package/pgInputSelect.js +1 -0
- package/pgInputText.js +1 -0
- package/pgInputTextIcon.js +1 -0
- package/pgInputUserSelect.js +1 -0
- package/pgListTag.js +1 -0
- package/pgMarkdown.js +2 -0
- package/pgMarkdown.js.LICENSE.txt +10 -0
- package/pgMenu.js +1 -0
- package/pgMenuDivider.js +1 -0
- package/pgMenuIcon.js +1 -0
- package/pgMenuItem.js +1 -0
- package/pgMenuItemIcon.js +1 -0
- package/pgModalAlert.js +1 -0
- package/pgModification.js +1 -0
- package/pgNav.js +1 -0
- package/pgOverlay.js +1 -0
- package/pgOverlayContextMenu.js +1 -0
- package/pgOverlayMenu.js +1 -0
- package/pgOverlaySelectMenu.js +1 -0
- package/pgOverlaySubMenu.js +1 -0
- package/pgPicker.js +1 -0
- package/pgPreview.js +1 -0
- package/pgScroll.js +1 -0
- package/pgSearch.js +1 -0
- package/pgTab.js +1 -0
- package/pgTabs.js +1 -0
- package/pgToast.js +1 -0
- package/pgToasts.js +1 -0
- package/pgTooltip.js +1 -0
- package/pgTree.js +1 -0
- package/pgTreeButtonIcon.js +1 -0
- package/pgTreeItem.js +1 -0
- package/theme-ui3.css +31 -0
- package/@types/css.d.ts +0 -4
- package/@types/html.d.ts +0 -4
- package/dist/main.js +0 -3819
- package/dist/pgAnnoy.js +0 -116
- package/dist/pgAvatar.js +0 -136
- package/dist/pgButton.js +0 -116
- package/dist/pgButtonGroup.js +0 -116
- package/dist/pgButtonLink.js +0 -116
- package/dist/pgButtonToggle.js +0 -146
- package/dist/pgCard.js +0 -116
- package/dist/pgCardUser.js +0 -196
- package/dist/pgColor.js +0 -136
- package/dist/pgDatabase.js +0 -236
- package/dist/pgDropdown.js +0 -686
- package/dist/pgGrid.js +0 -126
- package/dist/pgHeader.js +0 -116
- package/dist/pgIcon.js +0 -116
- package/dist/pgInputCheck.js +0 -116
- package/dist/pgInputCheckList.js +0 -126
- package/dist/pgInputFileLocal.js +0 -116
- package/dist/pgInputHexRgb.js +0 -126
- package/dist/pgInputRange.js +0 -116
- package/dist/pgInputSelect.js +0 -116
- package/dist/pgInputText.js +0 -116
- package/dist/pgInputTextIcon.js +0 -176
- package/dist/pgInputUserSelect.js +0 -116
- package/dist/pgListTag.js +0 -136
- package/dist/pgMarkdown.js +0 -346
- package/dist/pgMenuIcon.js +0 -206
- package/dist/pgModalAlert.js +0 -126
- package/dist/pgModification.js +0 -396
- package/dist/pgNav.js +0 -116
- package/dist/pgOverlay.js +0 -96
- package/dist/pgPicker.js +0 -116
- package/dist/pgPreview.js +0 -116
- package/dist/pgScroll.js +0 -266
- package/dist/pgSearch.js +0 -146
- package/dist/pgTab.js +0 -116
- package/dist/pgTabs.js +0 -136
- package/dist/pgToast.js +0 -136
- package/dist/pgToasts.js +0 -136
- package/dist/pgTooltip.js +0 -126
package/pgDatabase.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,s,i){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(o[c]=!0)}for(var l=0;l<e.length;l++){var u=[].concat(e[l]);r&&o[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),s&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=s):u[4]="".concat(s)),t.push(u))}},t}},601:e=>{e.exports=function(e){return e[1]}},689:(e,t,n)=>{n.d(t,{A:()=>c});var r=n(601),s=n.n(r),i=n(314),o=n.n(i)()(s());o.push([e.id,"",""]);var a=new CSSStyleSheet;a.replaceSync(o.toString());const c=a}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={id:r,exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const r=Symbol("addObserver"),s=Symbol("removeObserver"),i=Symbol("getObservers"),o=Symbol("isProxy"),a=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],l=new Map;function u(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case o:return!0;case a:return t;case i:return l.has(e);case r:return(t,n)=>{l.has(e)?l.get(e).has(t)?l.get(e).get(t).push(n):l.get(e).set(t,[n]):l.set(e,new Map([[t,[n]]]))};case s:return t=>{l.has(e)&&(l.get(e).delete(t),0===l.get(e).size&&l.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,n)}throw new Error("Unsupported symbol")}if(n in t){if(!Number.isNaN(Number(n)))return"object"==typeof t[n]?u(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(c.includes(n))return l.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return l.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return u(t[n])}return Reflect.get(t,n)},set(e,t,n){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,n);if(l.has(e)){l.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=l;class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const h=Symbol("init"),d=Symbol("template"),f=Symbol("style"),p=Symbol("parent");function y(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function m(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function g(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,s;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[p]||t.prototype[p][t.prototype[p].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[p]=[t.prototype],t.prototype[f]=e.style?[e.style]:[],t.prototype[d]=e.template||""):(t.prototype[p].push(t.prototype),t.prototype[f].push(e.style),t.prototype[d]=(r=t.prototype[d],(s=e.template||null)&&s.match(/<parent\/>/)?s.replace(/<parent\/>/,r):`${r}${s||""}`));const i=t.prototype.connectedCallback||(()=>{}),o=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[h]||void 0!==e.template||void 0!==e.style)if(this[h]){if(this[h]&&e.style);else if(this[h]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[d]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[f].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),r.appendChild(n)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&n.add(e.localName);const r=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),s=()=>{this[p].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[m(t)]=!0,e)),{}):{})}))};0===r.length?(this[h]=!0,i.call(this),s()):Promise.all(r).then((()=>{this[h]=!0,i.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));s()}))},t.prototype.disconnectedCallback=function(){o.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[m(e)]=n},n.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${n.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function v(e){return!!e&&e.constructor===Array}function b(e,t){e[h]&&e[p].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function w(e){return null===e?"null":v(e)?"array":typeof e}function _(e){return function(t,n){const r=n.name,s=Symbol(r),c=Symbol(`${r}:type`),l=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[c]||"array"===this[c]?this[s][o]?this[s]:u(this[s]):this[s],set:t=>{const n=w(e?e(t):t);if("index"!==r&&this[c]!==n&&"null"!==this[c]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[c]}' cannot be set to ${n}.`);if("array"===this[c]){if(!v(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[s]===t)throw new Error("Setting an array to itself is not allowed.");const e=u(this[s]);if(e[i]){const n=t[o]?(l=t)[o]&&l[a]:t;e.splice(0,this[s].length,...n)}else this[s]=t}else this[s]=e?e(t):t,b(this,r);var l}})})),function(t){if(void 0===t&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==t&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=y(r);t[r]||(e.observedAttributes.push(n),t[r]=s)}return this[c]=w(t),"array"===this[c]?(this[s]=t,new Proxy(t,{get:(e,t)=>t===x?this[l]:(console.log("errr???"),Reflect.get(this[s],t)),set:(e,t,n)=>{if(t===x)return this[l]=n,!0;const i=Reflect.set(e,t,n);return"length"===t&&this[s].length===n||b(this,r),this[s]=n,i}})):(this[s]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[s])}}}Symbol("hasProxy");const x=Symbol("meta");var k=n(689);const E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,S=Object.keys,P=Array.isArray;function O(e,t){return"object"!=typeof t||S(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||E.Promise||(E.Promise=Promise);const C=Object.getPrototypeOf,A={}.hasOwnProperty;function I(e,t){return A.call(e,t)}function j(e,t){"function"==typeof t&&(t=t(C(e))),("undefined"==typeof Reflect?S:Reflect.ownKeys)(t).forEach((n=>{T(e,n,t[n])}))}const K=Object.defineProperty;function T(e,t,n,r){K(e,t,O(n&&I(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function D(e){return{from:function(t){return e.prototype=Object.create(t.prototype),T(e.prototype,"constructor",e),{extend:j.bind(null,e.prototype)}}}}const R=Object.getOwnPropertyDescriptor;function B(e,t){let n;return R(e,t)||(n=C(e))&&B(n,t)}const F=[].slice;function N(e,t,n){return F.call(e,t,n)}function $(e,t){return t(e)}function M(e){if(!e)throw new Error("Assertion Failed")}function q(e){E.setImmediate?setImmediate(e):setTimeout(e,0)}function L(e,t){return e.reduce(((e,n,r)=>{var s=t(n,r);return s&&(e[s[0]]=s[1]),e}),{})}function U(e,t){if(I(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,s=t.length;r<s;++r){var i=U(e,t[r]);n.push(i)}return n}var o=t.indexOf(".");if(-1!==o){var a=e[t.substr(0,o)];return void 0===a?void 0:U(a,t.substr(o+1))}}function z(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){M("string"!=typeof n&&"length"in n);for(var r=0,s=t.length;r<s;++r)z(e,t[r],n[r])}else{var i=t.indexOf(".");if(-1!==i){var o=t.substr(0,i),a=t.substr(i+1);if(""===a)void 0===n?P(e)&&!isNaN(parseInt(o))?e.splice(o,1):delete e[o]:e[o]=n;else{var c=e[o];c||(c=e[o]={}),z(c,a,n)}}else void 0===n?P(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function V(e){var t={};for(var n in e)I(e,n)&&(t[n]=e[n]);return t}const W=[].concat;function Y(e){return W.apply([],e)}const H="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Y([8,16,32,64].map((e=>["Int","Uint","Float"].map((t=>t+e+"Array")))))).filter((e=>E[e])),G=H.map((e=>E[e]));L(H,(e=>[e,!0]));let Q=null;function X(e){Q="undefined"!=typeof WeakMap&&new WeakMap;const t=J(e);return Q=null,t}function J(e){if(!e||"object"!=typeof e)return e;let t=Q&&Q.get(e);if(t)return t;if(P(e)){t=[],Q&&Q.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(J(e[n]))}else if(G.indexOf(e.constructor)>=0)t=e;else{const n=C(e);for(var s in t=n===Object.prototype?{}:Object.create(n),Q&&Q.set(e,t),e)I(e,s)&&(t[s]=J(e[s]))}return t}const{toString:Z}={};function ee(e){return Z.call(e).slice(8,-1)}const te="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",ne="symbol"==typeof te?function(e){var t;return null!=e&&(t=e[te])&&t.apply(e)}:function(){return null},re={};function se(e){var t,n,r,s;if(1===arguments.length){if(P(e))return e.slice();if(this===re&&"string"==typeof e)return[e];if(s=ne(e)){for(n=[];!(r=s.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}const ie="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var oe="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function ae(e,t){oe=e,ce=t}var ce=()=>!0;const le=!new Error("").stack;function ue(){if(le)try{throw ue.arguments,new Error}catch(e){return e}return new Error}function he(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(ce).map((e=>"\n"+e)).join("")):""}var de=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],fe=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(de),pe={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function ye(e,t){this._e=ue(),this.name=e,this.message=t}function me(e,t){return e+". Errors: "+Object.keys(t).map((e=>t[e].toString())).filter(((e,t,n)=>n.indexOf(e)===t)).join("\n")}function ge(e,t,n,r){this._e=ue(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=me(e,t)}function ve(e,t){this._e=ue(),this.name="BulkError",this.failures=Object.keys(t).map((e=>t[e])),this.failuresByPos=t,this.message=me(e,t)}D(ye).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+he(this._e,2))}},toString:function(){return this.name+": "+this.message}}),D(ge).from(ye),D(ve).from(ye);var be=fe.reduce(((e,t)=>(e[t]=t+"Error",e)),{});const we=ye;var _e=fe.reduce(((e,t)=>{var n=t+"Error";function r(e,r){this._e=ue(),this.name=n,e?"string"==typeof e?(this.message=`${e}${r?"\n "+r:""}`,this.inner=r||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=pe[t]||n,this.inner=null)}return D(r).from(we),e[t]=r,e}),{});_e.Syntax=SyntaxError,_e.Type=TypeError,_e.Range=RangeError;var xe=de.reduce(((e,t)=>(e[t+"Error"]=_e[t],e)),{}),ke=fe.reduce(((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=_e[t]),e)),{});function Ee(){}function Se(e){return e}function Pe(e,t){return null==e||e===Se?t:function(n){return t(e(n))}}function Oe(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Ce(e,t){return e===Ee?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,s=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Oe(r,this.onsuccess):r),s&&(this.onerror=this.onerror?Oe(s,this.onerror):s),void 0!==i?i:n}}function Ae(e,t){return e===Ee?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?Oe(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Oe(r,this.onerror):r)}}function Ie(e,t){return e===Ee?t:function(n){var r=e.apply(this,arguments);O(n,r);var s=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return s&&(this.onsuccess=this.onsuccess?Oe(s,this.onsuccess):s),i&&(this.onerror=this.onerror?Oe(i,this.onerror):i),void 0===r?void 0===o?void 0:o:O(r,o)}}function je(e,t){return e===Ee?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function Ke(e,t){return e===Ee?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,s=arguments.length,i=new Array(s);s--;)i[s]=arguments[s];return n.then((function(){return t.apply(r,i)}))}return t.apply(this,arguments)}}ke.ModifyError=ge,ke.DexieError=ye,ke.BulkError=ve;var Te={};const[De,Re,Be]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,C(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,C(t),e]})(),Fe=Re&&Re.then,Ne=De&&De.constructor,$e=!!Be;var Me=!1,qe=Be?()=>{Be.then(ut)}:E.setImmediate?setImmediate.bind(null,ut):E.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver((()=>{ut(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(ut,0)},Le=function(e,t){Xe.push([e,t]),ze&&(qe(),ze=!1)},Ue=!0,ze=!0,Ve=[],We=[],Ye=null,He=Se,Ge={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Bt,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((e=>{try{Bt(e[0],e[1])}catch(e){}}))}},Qe=Ge,Xe=[],Je=0,Ze=[];function et(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=Ee,this._lib=!1;var t=this._PSD=Qe;if(oe&&(this._stackHolder=ue(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Te)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&st(this,this._value))}this._state=null,this._value=null,++t.ref,rt(this,e)}const tt={get:function(){var e=Qe,t=wt;function n(n,r){var s=!e.global&&(e!==Qe||t!==wt);const i=s&&!St();var o=new et(((t,o)=>{ot(this,new nt(Tt(n,e,s,i),Tt(r,e,s,i),t,o,e))}));return oe&<(o,this),o}return n.prototype=Te,n},set:function(e){T(this,"then",e&&e.prototype===Te?tt:{get:function(){return e},set:tt.set})}};function nt(e,t,n,r,s){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=s}function rt(e,t){try{t((t=>{if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&ht();t&&"function"==typeof t.then?rt(e,((e,n)=>{t instanceof et?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,it(e)),n&&dt()}}),st.bind(null,e))}catch(t){st(e,t)}}function st(e,t){if(We.push(t),null===e._state){var n=e._lib&&ht();t=He(t),e._state=!1,e._value=t,oe&&null!==t&&"object"==typeof t&&!t._promise&&function(e){try{e.apply(null,void 0)}catch(e){}}((()=>{var n=B(t,"stack");t._promise=e,T(t,"stack",{get:()=>Me?n&&(n.get?n.get.apply(t):n.value):e.stack})})),function(e){Ve.some((t=>t._value===e._value))||Ve.push(e)}(e),it(e),n&&dt()}}function it(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)ot(e,t[n]);var s=e._PSD;--s.ref||s.finalize(),0===Je&&(++Je,Le((()=>{0==--Je&&ft()}),[]))}function ot(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++Je,Le(at,[n,e,t])}else e._listeners.push(t)}function at(e,t,n){try{Ye=t;var r,s=t._value;t._state?r=e(s):(We.length&&(We=[]),r=e(s),-1===We.indexOf(s)&&function(e){for(var t=Ve.length;t;)if(Ve[--t]._value===e._value)return void Ve.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{Ye=null,0==--Je&&ft(),--n.psd.ref||n.psd.finalize()}}function ct(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var s,i,o=e._value;null!=o?(s=o.name||"Error",i=o.message||o,r=he(o,0)):(s=o,i=""),t.push(s+(i?": "+i:"")+r)}return oe&&((r=he(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&ct(e._prev,t,n)),t}function lt(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function ut(){ht()&&dt()}function ht(){var e=Ue;return Ue=!1,ze=!1,e}function dt(){var e,t,n;do{for(;Xe.length>0;)for(e=Xe,Xe=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(Xe.length>0);Ue=!0,ze=!0}function ft(){var e=Ve;Ve=[],e.forEach((e=>{e._PSD.onunhandled.call(null,e._value,e)}));for(var t=Ze.slice(0),n=t.length;n;)t[--n]()}function pt(e){return new et(Te,!1,e)}function yt(e,t){var n=Qe;return function(){var r=ht(),s=Qe;try{return At(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{At(s,!1),r&&dt()}}}j(et.prototype,{then:tt,_then:function(e,t){ot(this,new nt(null,null,e,t,Qe))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,(e=>e instanceof t?n(e):pt(e))):this.then(null,(e=>e&&e.name===t?n(e):pt(e)))},finally:function(e){return this.then((t=>(e(),t)),(t=>(e(),pt(t))))},stack:{get:function(){if(this._stack)return this._stack;try{Me=!0;var e=ct(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Me=!1}}},timeout:function(e,t){return e<1/0?new et(((n,r)=>{var s=setTimeout((()=>r(new _e.Timeout(t))),e);this.then(n,r).finally(clearTimeout.bind(null,s))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&T(et.prototype,Symbol.toStringTag,"Dexie.Promise"),Ge.env=It(),j(et,{all:function(){var e=se.apply(null,arguments).map(Pt);return new et((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(((s,i)=>et.resolve(s).then((n=>{e[i]=n,--r||t(e)}),n)))}))},resolve:e=>{if(e instanceof et)return e;if(e&&"function"==typeof e.then)return new et(((t,n)=>{e.then(t,n)}));var t=new et(Te,!0,e);return lt(t,Ye),t},reject:pt,race:function(){var e=se.apply(null,arguments).map(Pt);return new et(((t,n)=>{e.map((e=>et.resolve(e).then(t,n)))}))},PSD:{get:()=>Qe,set:e=>Qe=e},totalEchoes:{get:()=>wt},newPSD:xt,usePSD:jt,scheduler:{get:()=>Le,set:e=>{Le=e}},rejectionMapper:{get:()=>He,set:e=>{He=e}},follow:(e,t)=>new et(((n,r)=>xt(((t,n)=>{var r=Qe;r.unhandleds=[],r.onunhandled=n,r.finalize=Oe((function(){!function(e){Ze.push((function t(){e(),Ze.splice(Ze.indexOf(t),1)})),++Je,Le((()=>{0==--Je&&ft()}),[])}((()=>{0===this.unhandleds.length?t():n(this.unhandleds[0])}))}),r.finalize),e()}),t,n,r)))}),Ne&&(Ne.allSettled&&T(et,"allSettled",(function(){const e=se.apply(null,arguments).map(Pt);return new et((t=>{0===e.length&&t([]);let n=e.length;const r=new Array(n);e.forEach(((e,s)=>et.resolve(e).then((e=>r[s]={status:"fulfilled",value:e}),(e=>r[s]={status:"rejected",reason:e})).then((()=>--n||t(r)))))}))})),Ne.any&&"undefined"!=typeof AggregateError&&T(et,"any",(function(){const e=se.apply(null,arguments).map(Pt);return new et(((t,n)=>{0===e.length&&n(new AggregateError([]));let r=e.length;const s=new Array(r);e.forEach(((e,i)=>et.resolve(e).then((e=>t(e)),(e=>{s[i]=e,--r||n(new AggregateError(s))}))))}))})));const mt={awaits:0,echoes:0,id:0};var gt=0,vt=[],bt=0,wt=0,_t=0;function xt(e,t,n,r){var s=Qe,i=Object.create(s);i.parent=s,i.ref=0,i.global=!1,i.id=++_t;var o=Ge.env;i.env=$e?{Promise:et,PromiseProp:{value:et,configurable:!0,writable:!0},all:et.all,race:et.race,allSettled:et.allSettled,any:et.any,resolve:et.resolve,reject:et.reject,nthen:Dt(o.nthen,i),gthen:Dt(o.gthen,i)}:{},t&&O(i,t),++s.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=jt(i,e,n,r);return 0===i.ref&&i.finalize(),a}function Et(){return mt.id||(mt.id=++gt),++mt.awaits,mt.echoes+=100,mt.id}function St(){return!!mt.awaits&&(0==--mt.awaits&&(mt.id=0),mt.echoes=100*mt.awaits,!0)}function Pt(e){return mt.echoes&&e&&e.constructor===Ne?(Et(),e.then((e=>(St(),e)),(e=>(St(),Ft(e))))):e}function Ot(e){++wt,mt.echoes&&0!=--mt.echoes||(mt.echoes=mt.id=0),vt.push(Qe),At(e,!0)}function Ct(){var e=vt[vt.length-1];vt.pop(),At(e,!1)}function At(e,t){var n=Qe;if((t?!mt.echoes||bt++&&e===Qe:!bt||--bt&&e===Qe)||Kt(t?Ot.bind(null,e):Ct),e!==Qe&&(Qe=e,n===Ge&&(Ge.env=It()),$e)){var r=Ge.env.Promise,s=e.env;Re.then=s.nthen,r.prototype.then=s.gthen,(n.global||e.global)&&(Object.defineProperty(E,"Promise",s.PromiseProp),r.all=s.all,r.race=s.race,r.resolve=s.resolve,r.reject=s.reject,s.allSettled&&(r.allSettled=s.allSettled),s.any&&(r.any=s.any))}}function It(){var e=E.Promise;return $e?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(E,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:Re.then,gthen:e.prototype.then}:{}}function jt(e,t,n,r,s){var i=Qe;try{return At(e,!0),t(n,r,s)}finally{At(i,!1)}}function Kt(e){Fe.call(De,e)}function Tt(e,t,n,r){return"function"!=typeof e?e:function(){var s=Qe;n&&Et(),At(t,!0);try{return e.apply(this,arguments)}finally{At(s,!1),r&&Kt(St)}}}function Dt(e,t){return function(n,r){return e.call(this,Tt(n,t),Tt(r,t))}}function Bt(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,s={promise:t,reason:e};if(E.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),O(r,s)):E.CustomEvent&&O(r=new CustomEvent("unhandledrejection",{detail:s}),s),r&&E.dispatchEvent&&(dispatchEvent(r),!E.PromiseRejectionEvent&&E.onunhandledrejection))try{E.onunhandledrejection(r)}catch(e){}oe&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+Fe).indexOf("[native code]")&&(Et=St=Ee);var Ft=et.reject;function Nt(e,t,n,r){if(e.idbdb&&(e._state.openComplete||Qe.letThrough||e._vip)){var s=e._createTransaction(t,n,e._dbSchema);try{s.create(),e._state.PR1398_maxLoop=3}catch(s){return s.name===be.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Nt(e,t,n,r)))):Ft(s)}return s._promise(t,((e,t)=>xt((()=>(Qe.trans=s,r(e,t,s)))))).then((e=>s._completion.then((()=>e))))}if(e._state.openComplete)return Ft(new _e.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return Ft(new _e.DatabaseClosed);e.open().catch(Ee)}return e._state.dbReadyPromise.then((()=>Nt(e,t,n,r)))}const $t=String.fromCharCode(65535),Mt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",qt=[],Lt="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Ut=Lt,zt=Lt,Vt=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function Wt(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const Ht={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Gt(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=X(t))[e],t)}class kt{_trans(e,t,n){const r=this._tx||Qe.trans,s=this.name;function i(e,n,r){if(!r.schema[s])throw new _e.NotFound("Table "+s+" not part of transaction");return t(r.idbtrans,r)}const o=ht();try{return r&&r.db===this.db?r===Qe.trans?r._promise(e,i,n):xt((()=>r._promise(e,i,n)),{trans:r,transless:Qe.transless||Qe}):Nt(this.db,e,[this.name],i)}finally{o&&dt()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(t=>this.core.get({trans:t,key:e}).then((e=>this.hook.reading.fire(e))))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(P(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const t=S(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);const n=this.schema.indexes.concat(this.schema.primKey).filter((e=>e.compound&&t.every((t=>e.keyPath.indexOf(t)>=0))&&e.keyPath.every((e=>t.indexOf(e)>=0))))[0];if(n&&this.db._maxKey!==$t)return this.where(n.name).equals(n.keyPath.map((t=>e[t])));!n&&oe&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);const{idxByName:r}=this.schema,s=this.db._deps.indexedDB;function i(e,t){try{return 0===s.cmp(e,t)}catch(e){return!1}}const[o,a]=t.reduce((([t,n],s)=>{const o=r[s],a=e[s];return[t||o,t||!o?Wt(n,o&&o.multi?e=>{const t=U(e,s);return P(t)&&t.some((e=>i(a,e)))}:e=>i(a,U(e,s))):n]}),[null,null]);return o?this.where(o.name).equals(e[o.keyPath]).filter(a):n?this.filter(a):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,P(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;const t=t=>{if(!t)return t;const n=Object.create(e.prototype);for(var r in t)if(I(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}defineClass(){return this.mapToClass((function(e){O(this,e)}))}add(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let s=e;return r&&n&&(s=Gt(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[s]}))).then((e=>e.numFailures?et.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{z(e,r,t)}catch(e){}return t}))}update(e,t){if("object"!=typeof e||P(e))return this.where(":id").equals(e).modify(t);{const n=U(e,this.schema.primKey.keyPath);if(void 0===n)return Ft(new _e.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?S(t).forEach((n=>{z(e,n,t[n])})):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}}put(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let s=e;return r&&n&&(s=Gt(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"put",values:[s],keys:null!=t?[t]:null}))).then((e=>e.numFailures?et.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{z(e,r,t)}catch(e){}return t}))}delete(e){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:[e]}))).then((e=>e.numFailures?et.reject(e.failures[0]):void 0))}clear(){return this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"deleteRange",range:Ht}))).then((e=>e.numFailures?et.reject(e.failures[0]):void 0))}bulkGet(e){return this._trans("readonly",(t=>this.core.getMany({keys:e,trans:t}).then((e=>e.map((e=>this.hook.reading.fire(e)))))))}bulkAdd(e,t,n){const r=Array.isArray(t)?t:void 0,s=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new _e.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new _e.InvalidArgument("Arguments objects and keys must have the same length");const o=e.length;let a=i&&n?e.map(Gt(i)):e;return this.core.mutate({trans:t,type:"add",keys:r,values:a,wantResults:s}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return s?t:n;throw new ve(`${this.name}.bulkAdd(): ${e} of ${o} operations failed`,r)}))}))}bulkPut(e,t,n){const r=Array.isArray(t)?t:void 0,s=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new _e.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new _e.InvalidArgument("Arguments objects and keys must have the same length");const o=e.length;let a=i&&n?e.map(Gt(i)):e;return this.core.mutate({trans:t,type:"put",keys:r,values:a,wantResults:s}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return s?t:n;throw new ve(`${this.name}.bulkPut(): ${e} of ${o} operations failed`,r)}))}))}bulkDelete(e){const t=e.length;return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:e}))).then((({numFailures:e,lastResult:n,failures:r})=>{if(0===e)return n;throw new ve(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,r)}))}}function Xt(e){var t={},n=function(n,r){if(r){for(var s=arguments.length,i=new Array(s-1);--s;)i[s-1]=arguments[s];return t[n].subscribe.apply(null,i),e}if("string"==typeof n)return t[n]};n.addEventType=i;for(var r=1,s=arguments.length;r<s;++r)i(arguments[r]);return n;function i(e,r,s){if("object"==typeof e)return o(e);r||(r=je),s||(s=Ee);var i={subscribers:[],fire:s,subscribe:function(e){-1===i.subscribers.indexOf(e)&&(i.subscribers.push(e),i.fire=r(i.fire,e))},unsubscribe:function(e){i.subscribers=i.subscribers.filter((function(t){return t!==e})),i.fire=i.subscribers.reduce(r,s)}};return t[e]=n[e]=i,i}function o(e){S(e).forEach((function(t){var n=e[t];if(P(n))i(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new _e.InvalidArgument("Invalid event config");var r=i(t,Se,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){q((function(){e.apply(null,t)}))}))}))}}))}}function Jt(e,t){return D(t).from({prototype:e}),t}function Zt(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function en(e,t){e.filter=Wt(e.filter,t)}function tn(e,t,n){var r=e.replayFilter;e.replayFilter=r?()=>Wt(r(),t()):t,e.justLimit=n&&!r}function nn(e,t){if(e.isPrimKey)return t.primaryKey;const n=t.getIndexByKeyPath(e.index);if(!n)throw new _e.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function rn(e,t,n){const r=nn(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function sn(e,t,n,r){const s=e.replayFilter?Wt(e.filter,e.replayFilter()):e.filter;if(e.or){const i={},o=(e,n,r)=>{if(!s||s(n,r,(e=>n.stop(e)),(e=>n.fail(e)))){var o=n.primaryKey,a=""+o;"[object ArrayBuffer]"===a&&(a=""+new Uint8Array(o)),I(i,a)||(i[a]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(o,n),on(rn(e,r,n),e.algorithm,o,!e.keysOnly&&e.valueMapper)])}return on(rn(e,r,n),Wt(e.algorithm,s),t,!e.keysOnly&&e.valueMapper)}function on(e,t,n,r){var s=yt(r?(e,t,s)=>n(r(e),t,s):n);return e.then((e=>{if(e)return e.start((()=>{var n=()=>e.continue();t&&!t(e,(e=>n=e),(t=>{e.stop(t),n=Ee}),(t=>{e.fail(t),n=Ee}))||s(e.value,e,(e=>n=e)),n()}))}))}function an(e,t){try{const n=cn(e),r=cn(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){const n=e.length,r=t.length,s=n<r?n:r;for(let n=0;n<s;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return n===r?0:n<r?-1:1}(ln(e),ln(t));case"Array":return function(e,t){const n=e.length,r=t.length,s=n<r?n:r;for(let n=0;n<s;++n){const r=an(e[n],t[n]);if(0!==r)return r}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function cn(e){const t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";const n=ee(e);return"ArrayBuffer"===n?"binary":n}function ln(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class Rt{_read(e,t){var n=this._ctx;return n.error?n.table._trans(null,Ft.bind(null,n.error)):n.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,Ft.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=Wt(t.algorithm,e)}_iterate(e,t){return sn(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&O(n,e),t._ctx=n,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read((n=>sn(t,e,n,t.table.core)))}count(e){return this._read((e=>{const t=this._ctx,n=t.table.core;if(Zt(t,!0))return n.count({trans:e,query:{index:nn(t,n.schema),range:t.range}}).then((e=>Math.min(e,t.limit)));var r=0;return sn(t,(()=>(++r,!1)),e,n).then((()=>r))})).then(e)}sortBy(e,t){const n=e.split(".").reverse(),r=n[0],s=n.length-1;function i(e,t){return t?i(e[n[t]],t-1):e[r]}var o="next"===this._ctx.dir?1:-1;function a(e,t){var n=i(e,s),r=i(t,s);return n<r?-o:n>r?o:0}return this.toArray((function(e){return e.sort(a)})).then(t)}toArray(e){return this._read((e=>{var t=this._ctx;if("next"===t.dir&&Zt(t,!0)&&t.limit>0){const{valueMapper:n}=t,r=nn(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:r,range:t.range}}).then((({result:e})=>n?e.map(n):e))}{const n=[];return sn(t,(e=>n.push(e)),e,t.table.core).then((()=>n))}}),e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,Zt(t)?tn(t,(()=>{var t=e;return(e,n)=>0===t||(1===t?(--t,!1):(n((()=>{e.advance(t),t=0})),!1))})):tn(t,(()=>{var t=e;return()=>--t<0}))),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),tn(this._ctx,(()=>{var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this}until(e,t){return en(this._ctx,(function(n,r,s){return!e(n.value)||(r(s),t)})),this}first(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}last(e){return this.reverse().first(e)}filter(e){var t,n;return en(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=Wt(t.isMatch,n),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))}keys(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&Zt(t,!0)&&t.limit>0)return this._read((e=>{var n=nn(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((({result:e})=>e)).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return en(this._ctx,(function(e){var t=e.primaryKey.toString(),r=I(n,t);return n[t]=!0,!r})),this}modify(e){var t=this._ctx;return this._write((n=>{var r;if("function"==typeof e)r=e;else{var s=S(e),i=s.length;r=function(t){for(var n=!1,r=0;r<i;++r){var o=s[r],a=e[o];U(t,o)!==a&&(z(t,o,a),n=!0)}return n}}const o=t.table.core,{outbound:a,extractKey:c}=o.schema.primaryKey,l=this.db._options.modifyChunkSize||200,u=[];let h=0;const d=[],f=(e,t)=>{const{failures:n,numFailures:r}=t;h+=e-r;for(let e of S(n))u.push(n[e])};return this.clone().primaryKeys().then((s=>{const i=u=>{const h=Math.min(l,s.length-u);return o.getMany({trans:n,keys:s.slice(u,u+h),cache:"immutable"}).then((d=>{const p=[],y=[],m=a?[]:null,g=[];for(let e=0;e<h;++e){const t=d[e],n={value:X(t),primKey:s[u+e]};!1!==r.call(n,n.value,n)&&(null==n.value?g.push(s[u+e]):a||0===an(c(t),c(n.value))?(y.push(n.value),a&&m.push(s[u+e])):(g.push(s[u+e]),p.push(n.value)))}const v=Zt(t)&&t.limit===1/0&&("function"!=typeof e||e===un)&&{index:t.index,range:t.range};return Promise.resolve(p.length>0&&o.mutate({trans:n,type:"add",values:p}).then((e=>{for(let t in e.failures)g.splice(parseInt(t),1);f(p.length,e)}))).then((()=>(y.length>0||v&&"object"==typeof e)&&o.mutate({trans:n,type:"put",keys:m,values:y,criteria:v,changeSpec:"function"!=typeof e&&e}).then((e=>f(y.length,e))))).then((()=>(g.length>0||v&&e===un)&&o.mutate({trans:n,type:"delete",keys:g,criteria:v}).then((e=>f(g.length,e))))).then((()=>s.length>u+h&&i(u+l)))}))};return i(0).then((()=>{if(u.length>0)throw new ge("Error modifying one or more objects",u,h,d);return s.length}))}))}))}delete(){var e=this._ctx,t=e.range;return Zt(e)&&(e.isPrimKey&&!zt||3===t.type)?this._write((n=>{const{primaryKey:r}=e.table.core.schema,s=t;return e.table.core.count({trans:n,query:{index:r,range:s}}).then((t=>e.table.core.mutate({trans:n,type:"deleteRange",range:s}).then((({failures:e,lastResult:n,results:r,numFailures:s})=>{if(s)throw new ge("Could not delete some values",Object.keys(e).map((t=>e[t])),t-s);return t-s}))))})):this.modify(un)}}const un=(e,t)=>t.value=null;function hn(e,t){return e<t?-1:e===t?0:1}function dn(e,t){return e>t?-1:e===t?0:1}function fn(e,t,n){var r=e instanceof Yt?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function pn(e){return new e.Collection(e,(()=>bn(""))).limit(0)}function yn(e,t,n,r,s,i){for(var o=Math.min(e.length,r.length),a=-1,c=0;c<o;++c){var l=t[c];if(l!==r[c])return s(e[c],n[c])<0?e.substr(0,c)+n[c]+n.substr(c+1):s(e[c],r[c])<0?e.substr(0,c)+r[c]+n.substr(c+1):a>=0?e.substr(0,a)+t[a]+n.substr(a+1):null;s(e[c],l)<0&&(a=c)}return o<r.length&&"next"===i?e+n.substr(e.length):o<e.length&&"prev"===i?e.substr(0,n.length):a<0?null:e.substr(0,a)+r[a]+n.substr(a+1)}function mn(e,t,n,r){var s,i,o,a,c,l,u,h=n.length;if(!n.every((e=>"string"==typeof e)))return fn(e,"String expected.");function d(e){s=function(e){return"next"===e?e=>e.toUpperCase():e=>e.toLowerCase()}(e),i=function(e){return"next"===e?e=>e.toLowerCase():e=>e.toUpperCase()}(e),o="next"===e?hn:dn;var t=n.map((function(e){return{lower:i(e),upper:s(e)}})).sort((function(e,t){return o(e.lower,t.lower)}));a=t.map((function(e){return e.upper})),c=t.map((function(e){return e.lower})),l=e,u="next"===e?"":r}d("next");var f=new e.Collection(e,(()=>gn(a[0],c[h-1]+r)));f._ondirectionchange=function(e){d(e)};var p=0;return f._addAlgorithm((function(e,n,r){var s=e.key;if("string"!=typeof s)return!1;var d=i(s);if(t(d,c,p))return!0;for(var f=null,y=p;y<h;++y){var m=yn(s,d,a[y],c[y],o,l);null===m&&null===f?p=y+1:(null===f||o(f,m)>0)&&(f=m)}return n(null!==f?function(){e.continue(f+u)}:r),!1})),f}function gn(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function bn(e){return{type:1,lower:e,upper:e}}class Yt{get Collection(){return this._ctx.table.db.Collection}between(e,t,n,r){n=!1!==n,r=!0===r;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?pn(this):new this.Collection(this,(()=>gn(e,t,!n,!r)))}catch(e){return fn(this,Mt)}}equals(e){return null==e?fn(this,Mt):new this.Collection(this,(()=>bn(e)))}above(e){return null==e?fn(this,Mt):new this.Collection(this,(()=>gn(e,void 0,!0)))}aboveOrEqual(e){return null==e?fn(this,Mt):new this.Collection(this,(()=>gn(e,void 0,!1)))}below(e){return null==e?fn(this,Mt):new this.Collection(this,(()=>gn(void 0,e,!1,!0)))}belowOrEqual(e){return null==e?fn(this,Mt):new this.Collection(this,(()=>gn(void 0,e)))}startsWith(e){return"string"!=typeof e?fn(this,"String expected."):this.between(e,e+$t,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):mn(this,((e,t)=>0===e.indexOf(t[0])),[e],$t)}equalsIgnoreCase(e){return mn(this,((e,t)=>e===t[0]),[e],"")}anyOfIgnoreCase(){var e=se.apply(re,arguments);return 0===e.length?pn(this):mn(this,((e,t)=>-1!==t.indexOf(e)),e,"")}startsWithAnyOfIgnoreCase(){var e=se.apply(re,arguments);return 0===e.length?pn(this):mn(this,((e,t)=>t.some((t=>0===e.indexOf(t)))),e,$t)}anyOf(){const e=se.apply(re,arguments);let t=this._cmp;try{e.sort(t)}catch(e){return fn(this,Mt)}if(0===e.length)return pn(this);const n=new this.Collection(this,(()=>gn(e[0],e[e.length-1])));n._ondirectionchange=n=>{t="next"===n?this._ascending:this._descending,e.sort(t)};let r=0;return n._addAlgorithm(((n,s,i)=>{const o=n.key;for(;t(o,e[r])>0;)if(++r,r===e.length)return s(i),!1;return 0===t(o,e[r])||(s((()=>{n.continue(e[r])})),!1)})),n}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=se.apply(re,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return fn(this,Mt)}const t=e.reduce(((e,t)=>e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,t){const n=this._cmp,r=this._ascending,s=this._descending,i=this._min,o=this._max;if(0===e.length)return pn(this);if(!e.every((e=>void 0!==e[0]&&void 0!==e[1]&&r(e[0],e[1])<=0)))return fn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",_e.InvalidArgument);const a=!t||!1!==t.includeLowers,c=t&&!0===t.includeUppers;let l,u=r;function h(e,t){return u(e[0],t[0])}try{l=e.reduce((function(e,t){let r=0,s=e.length;for(;r<s;++r){const s=e[r];if(n(t[0],s[1])<0&&n(t[1],s[0])>0){s[0]=i(s[0],t[0]),s[1]=o(s[1],t[1]);break}}return r===s&&e.push(t),e}),[]),l.sort(h)}catch(e){return fn(this,Mt)}let d=0;const f=c?e=>r(e,l[d][1])>0:e=>r(e,l[d][1])>=0,p=a?e=>s(e,l[d][0])>0:e=>s(e,l[d][0])>=0;let y=f;const m=new this.Collection(this,(()=>gn(l[0][0],l[l.length-1][1],!a,!c)));return m._ondirectionchange=e=>{"next"===e?(y=f,u=r):(y=p,u=s),l.sort(h)},m._addAlgorithm(((e,t,n)=>{for(var s=e.key;y(s);)if(++d,d===l.length)return t(n),!1;return!!function(e){return!f(e)&&!p(e)}(s)||(0===this._cmp(s,l[d][1])||0===this._cmp(s,l[d][0])||t((()=>{u===r?e.continue(l[d][0]):e.continue(l[d][1])})),!1)})),m}startsWithAnyOf(){const e=se.apply(re,arguments);return e.every((e=>"string"==typeof e))?0===e.length?pn(this):this.inAnyRange(e.map((e=>[e,e+$t]))):fn(this,"startsWithAnyOf() only works with strings")}}function wn(e){return yt((function(t){return _n(t),e(t.target.error),!1}))}function _n(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const xn=Xt(null,"storagemutated");class Qt{_lock(){return M(!Qe.global),++this._reculock,1!==this._reculock||Qe.global||(Qe.lockOwnerFor=this),this}_unlock(){if(M(!Qe.global),0==--this._reculock)for(Qe.global||(Qe.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{jt(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&Qe.lockOwnerFor!==this}create(e){if(!this.mode)return this;const t=this.db.idbdb,n=this.db._state.dbOpenError;if(M(!this.idbtrans),!e&&!t)switch(n&&n.name){case"DatabaseClosedError":throw new _e.DatabaseClosed(n);case"MissingAPIError":throw new _e.MissingAPI(n.message,n);default:throw new _e.OpenFailed(n)}if(!this.active)throw new _e.TransactionInactive;return M(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=yt((t=>{_n(t),this._reject(e.error)})),e.onabort=yt((t=>{_n(t),this.active&&this._reject(new _e.Abort(e.error)),this.active=!1,this.on("abort").fire(t)})),e.oncomplete=yt((()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&xn.storagemutated.fire(e.mutatedParts)})),this}_promise(e,t,n){if("readwrite"===e&&"readwrite"!==this.mode)return Ft(new _e.ReadOnly("Transaction is readonly"));if(!this.active)return Ft(new _e.TransactionInactive);if(this._locked())return new et(((r,s)=>{this._blockedFuncs.push([()=>{this._promise(e,t,n).then(r,s)},Qe])}));if(n)return xt((()=>{var e=new et(((e,n)=>{this._lock();const r=t(e,n,this);r&&r.then&&r.then(e,n)}));return e.finally((()=>this._unlock())),e._lib=!0,e}));var r=new et(((e,n)=>{var r=t(e,n,this);r&&r.then&&r.then(e,n)}));return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();const n=et.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((()=>n));else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var s=t._waitingFor;return new et(((e,r)=>{n.then((n=>t._waitingQueue.push(yt(e.bind(null,n)))),(e=>t._waitingQueue.push(yt(r.bind(null,e))))).finally((()=>{t._waitingFor===s&&(t._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new _e.Abort))}table(e){const t=this._memoizedTables||(this._memoizedTables={});if(I(t,e))return t[e];const n=this.schema[e];if(!n)throw new _e.NotFound("Table "+e+" not part of transaction");const r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}}function kn(e,t,n,r,s,i,o){return{name:e,keyPath:t,unique:n,multi:r,auto:s,compound:i,src:(n&&!o?"&":"")+(r?"*":"")+(s?"++":"")+En(t)}}function En(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Sn(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:L(n,(e=>[e.name,e]))}}let Pn=e=>{try{return e.only([[]]),Pn=()=>[[]],[[]]}catch(e){return Pn=()=>$t,$t}};function On(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?t=>t[e]:t=>U(t,e)}(e):t=>U(t,e)}function Cn(e){return[].slice.call(e)}let An=0;function In(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function jn(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:n,upper:r,lowerOpen:s,upperOpen:i}=e;return void 0===n?void 0===r?null:t.upperBound(r,!!i):void 0===r?t.lowerBound(n,!!s):t.bound(n,r,!!s,!!i)}const{schema:s,hasGetAll:i}=function(e,t){const n=Cn(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((e=>t.objectStore(e))).map((e=>{const{keyPath:t,autoIncrement:n}=e,r=P(t),s=null==t,i={},o={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:s,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:On(t)},indexes:Cn(e.indexNames).map((t=>e.index(t))).map((e=>{const{name:t,unique:n,multiEntry:r,keyPath:s}=e,o={name:t,compound:P(s),keyPath:s,unique:n,multiEntry:r,extractKey:On(s)};return i[In(s)]=o,o})),getIndexByKeyPath:e=>i[In(e)]};return i[":id"]=o.primaryKey,null!=t&&(i[In(t)]=o.primaryKey),o}))},hasGetAll:n.length>0&&"getAll"in t.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,n),o=s.tables.map((e=>function(e){const t=e.name;return{name:t,schema:e,mutate:function({trans:e,type:n,keys:s,values:i,range:o}){return new Promise(((a,c)=>{a=yt(a);const l=e.objectStore(t),u=null==l.keyPath,h="put"===n||"add"===n;if(!h&&"delete"!==n&&"deleteRange"!==n)throw new Error("Invalid operation type: "+n);const{length:d}=s||i||{length:1};if(s&&i&&s.length!==i.length)throw new Error("Given keys array must have same length as given values array.");if(0===d)return a({numFailures:0,failures:{},results:[],lastResult:void 0});let f;const p=[],y=[];let m=0;const g=e=>{++m,_n(e)};if("deleteRange"===n){if(4===o.type)return a({numFailures:m,failures:y,results:[],lastResult:void 0});3===o.type?p.push(f=l.clear()):p.push(f=l.delete(r(o)))}else{const[e,t]=h?u?[i,s]:[i,null]:[s,null];if(h)for(let r=0;r<d;++r)p.push(f=t&&void 0!==t[r]?l[n](e[r],t[r]):l[n](e[r])),f.onerror=g;else for(let t=0;t<d;++t)p.push(f=l[n](e[t])),f.onerror=g}const v=e=>{const t=e.target.result;p.forEach(((e,t)=>null!=e.error&&(y[t]=e.error))),a({numFailures:m,failures:y,results:"delete"===n?s:p.map((e=>e.result)),lastResult:t})};f.onerror=e=>{g(e),v(e)},f.onsuccess=v}))},getMany:({trans:e,keys:n})=>new Promise(((r,s)=>{r=yt(r);const i=e.objectStore(t),o=n.length,a=new Array(o);let c,l=0,u=0;const h=e=>{const t=e.target;a[t._pos]=t.result,++u===l&&r(a)},d=wn(s);for(let e=0;e<o;++e)null!=n[e]&&(c=i.get(n[e]),c._pos=e,c.onsuccess=h,c.onerror=d,++l);0===l&&r(a)})),get:({trans:e,key:n})=>new Promise(((r,s)=>{r=yt(r);const i=e.objectStore(t).get(n);i.onsuccess=e=>r(e.target.result),i.onerror=wn(s)})),query:function(e){return n=>new Promise(((s,i)=>{s=yt(s);const{trans:o,values:a,limit:c,query:l}=n,u=c===1/0?void 0:c,{index:h,range:d}=l,f=o.objectStore(t),p=h.isPrimaryKey?f:f.index(h.name),y=r(d);if(0===c)return s({result:[]});if(e){const e=a?p.getAll(y,u):p.getAllKeys(y,u);e.onsuccess=e=>s({result:e.target.result}),e.onerror=wn(i)}else{let e=0;const t=a||!("openKeyCursor"in p)?p.openCursor(y):p.openKeyCursor(y),n=[];t.onsuccess=r=>{const i=t.result;return i?(n.push(a?i.value:i.primaryKey),++e===c?s({result:n}):void i.continue()):s({result:n})},t.onerror=wn(i)}}))}(i),openCursor:function({trans:e,values:n,query:s,reverse:i,unique:o}){return new Promise(((a,c)=>{a=yt(a);const{index:l,range:u}=s,h=e.objectStore(t),d=l.isPrimaryKey?h:h.index(l.name),f=i?o?"prevunique":"prev":o?"nextunique":"next",p=n||!("openKeyCursor"in d)?d.openCursor(r(u),f):d.openKeyCursor(r(u),f);p.onerror=wn(c),p.onsuccess=yt((t=>{const n=p.result;if(!n)return void a(null);n.___id=++An,n.done=!1;const r=n.continue.bind(n);let s=n.continuePrimaryKey;s&&(s=s.bind(n));const i=n.advance.bind(n),o=()=>{throw new Error("Cursor not stopped")};n.trans=e,n.stop=n.continue=n.continuePrimaryKey=n.advance=()=>{throw new Error("Cursor not started")},n.fail=yt(c),n.next=function(){let e=1;return this.start((()=>e--?this.continue():this.stop())).then((()=>this))},n.start=e=>{const t=new Promise(((e,t)=>{e=yt(e),p.onerror=wn(t),n.fail=t,n.stop=t=>{n.stop=n.continue=n.continuePrimaryKey=n.advance=o,e(t)}})),a=()=>{if(p.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=()=>{throw new Error("Cursor behind last entry")},n.stop()};return p.onsuccess=yt((e=>{p.onsuccess=a,a()})),n.continue=r,n.continuePrimaryKey=s,n.advance=i,a(),t},a(n)}),c)}))},count({query:e,trans:n}){const{index:s,range:i}=e;return new Promise(((e,o)=>{const a=n.objectStore(t),c=s.isPrimaryKey?a:a.index(s.name),l=r(i),u=l?c.count(l):c.count();u.onsuccess=yt((t=>e(t.target.result))),u.onerror=wn(o)}))}}}(e))),a={};return o.forEach((e=>a[e.name]=e)),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!a[e])throw new Error(`Table '${e}' not found`);return a[e]},MIN_KEY:-1/0,MAX_KEY:Pn(t),schema:s}}function Kn({_novip:e},t){const n=t.db,r=function(e,t,{IDBKeyRange:n,indexedDB:r},s){const i=function(e,t){return t.reduce(((e,{create:t})=>({...e,...t(e)})),e)}(jn(t,n,s),e.dbcore);return{dbcore:i}}(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach((t=>{const n=t.name;e.core.schema.tables.some((e=>e.name===n))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function Tn({_novip:e},t,n,r){n.forEach((n=>{const s=r[n];t.forEach((t=>{const r=B(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?T(t,n,{get(){return this.table(n)},set(e){K(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,s))}))}))}function Dn({_novip:e},t){t.forEach((t=>{for(let n in t)t[n]instanceof e.Table&&delete t[n]}))}function Rn(e,t){return e._cfg.version-t._cfg.version}function Bn(e,t,n,r){const s=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,s);i.create(n),i._completion.catch(r);const o=i._reject.bind(i),a=Qe.transless||Qe;xt((()=>{Qe.trans=i,Qe.transless=a,0===t?(S(s).forEach((e=>{Nn(n,e,s[e].primKey,s[e].indexes)})),Kn(e,n),et.follow((()=>e.on.populate.fire(i))).catch(o)):function({_novip:e},t,n,r){const s=[],i=e._versions;let o=e._dbSchema=qn(e,e.idbdb,r),a=!1;return i.filter((e=>e._cfg.version>=t)).forEach((i=>{s.push((()=>{const s=o,c=i._cfg.dbschema;Un(e,s,r),Un(e,c,r),o=e._dbSchema=c;const l=Fn(s,c);l.add.forEach((e=>{Nn(r,e[0],e[1].primKey,e[1].indexes)})),l.change.forEach((e=>{if(e.recreate)throw new _e.Upgrade("Not yet support for changing primary key");{const t=r.objectStore(e.name);e.add.forEach((e=>Mn(t,e))),e.change.forEach((e=>{t.deleteIndex(e.name),Mn(t,e)})),e.del.forEach((e=>t.deleteIndex(e)))}}));const u=i._cfg.contentUpgrade;if(u&&i._cfg.version>t){Kn(e,r),n._memoizedTables={},a=!0;let t=V(c);l.del.forEach((e=>{t[e]=s[e]})),Dn(e,[e.Transaction.prototype]),Tn(e,[e.Transaction.prototype],S(t),t),n.schema=t;const i=ie(u);let o;i&&Et();const h=et.follow((()=>{if(o=u(n),o&&i){var e=St.bind(null,null);o.then(e,e)}}));return o&&"function"==typeof o.then?et.resolve(o):h.then((()=>o))}})),s.push((t=>{a&&Ut||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((n=>null==e[n]&&t.db.deleteObjectStore(n)))}(i._cfg.dbschema,t),Dn(e,[e.Transaction.prototype]),Tn(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),function e(){return s.length?et.resolve(s.shift()(n.idbtrans)).then(e):et.resolve()}().then((()=>{var e,t;t=r,S(e=o).forEach((n=>{t.db.objectStoreNames.contains(n)||Nn(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,i,n).catch(o)}))}function Fn(e,t){const n={del:[],add:[],change:[]};let r;for(r in e)t[r]||n.del.push(r);for(r in t){const s=e[r],i=t[r];if(s){const e={name:r,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(s.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||s.primKey.auto!==i.primKey.auto&&!Lt)e.recreate=!0,n.change.push(e);else{const t=s.idxByName,r=i.idxByName;let o;for(o in t)r[o]||e.del.push(o);for(o in r){const n=t[o],s=r[o];n?n.src!==s.src&&e.change.push(s):e.add.push(s)}(e.del.length>0||e.add.length>0||e.change.length>0)&&n.change.push(e)}}else n.add.push([r,i])}return n}function Nn(e,t,n,r){const s=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((e=>Mn(s,e))),s}function Mn(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function qn(e,t,n){const r={};return N(t.objectStoreNames,0).forEach((e=>{const t=n.objectStore(e);let s=t.keyPath;const i=kn(En(s),s||"",!1,!1,!!t.autoIncrement,s&&"string"!=typeof s,!0),o=[];for(let e=0;e<t.indexNames.length;++e){const n=t.index(t.indexNames[e]);s=n.keyPath;var a=kn(n.name,s,!!n.unique,!!n.multiEntry,!1,s&&"string"!=typeof s,!1);o.push(a)}r[e]=Sn(e,i,o)})),r}function Un({_novip:e},t,n){const r=n.db.objectStoreNames;for(let s=0;s<r.length;++s){const i=r[s],o=n.objectStore(i);e._hasGetAll="getAll"in o;for(let e=0;e<o.indexNames.length;++e){const n=o.indexNames[e],r=o.index(n).keyPath,s="string"==typeof r?r:"["+N(r).join("+")+"]";if(t[i]){const e=t[i].idxByName[s];e&&(e.name=n,delete t[i].idxByName[s],t[i].idxByName[n]=e)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&E.WorkerGlobalScope&&E instanceof E.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class vn{_parseStoresSpec(e,t){S(e).forEach((n=>{if(null!==e[n]){var r=e[n].split(",").map(((e,t)=>{const n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return kn(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),P(r),0===t)})),s=r.shift();if(s.multi)throw new _e.Schema("Primary key cannot be multi-valued");r.forEach((e=>{if(e.auto)throw new _e.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new _e.Schema("Index must have a name and cannot be an empty string")})),t[n]=Sn(n,s,r)}}))}stores(e){const t=this.db;this._cfg.storesSource=this._cfg.storesSource?O(this._cfg.storesSource,e):e;const n=t._versions,r={};let s={};return n.forEach((e=>{O(r,e._cfg.storesSource),s=e._cfg.dbschema={},e._parseStoresSpec(r,s)})),t._dbSchema=s,Dn(t,[t._allTables,t,t.Transaction.prototype]),Tn(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],S(s),s),t._storeNames=S(s),this}upgrade(e){return this._cfg.contentUpgrade=Ke(this._cfg.contentUpgrade||Ee,e),this}}function zn(e,t){let n=e._dbNamesDB;return n||(n=e._dbNamesDB=new $n("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function Vn(e){return e&&"function"==typeof e.databases}function Wn(e){return xt((function(){return Qe.letThrough=!0,e()}))}function Yn(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()})).finally((function(){return clearInterval(e)})):Promise.resolve()}function Hn(e){var t=t=>e.next(t),n=s(t),r=s((t=>e.throw(t)));function s(e){return t=>{var s=e(t),i=s.value;return s.done?i:i&&"function"==typeof i.then?i.then(n,r):P(i)?Promise.all(i).then(n,r):n(i)}}return s(t)()}function Gn(e,t,n){var r=arguments.length;if(r<2)throw new _e.InvalidArgument("Too few arguments");for(var s=new Array(r-1);--r;)s[r-1]=arguments[r];return n=s.pop(),[e,Y(s),n]}function Qn(e,t,n,r,s){return et.resolve().then((()=>{const i=Qe.transless||Qe,o=e._createTransaction(t,n,e._dbSchema,r),a={trans:o,transless:i};if(r)o.idbtrans=r.idbtrans;else try{o.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===be.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Qn(e,t,n,null,s)))):Ft(r)}const c=ie(s);let l;c&&Et();const u=et.follow((()=>{if(l=s.call(o,o),l)if(c){var e=St.bind(null,null);l.then(e,e)}else"function"==typeof l.next&&"function"==typeof l.throw&&(l=Hn(l))}),a);return(l&&"function"==typeof l.then?et.resolve(l).then((e=>o.active?e:Ft(new _e.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):u.then((()=>l))).then((e=>(r&&o._resolve(),o._completion.then((()=>e))))).catch((e=>(o._reject(e),Ft(e))))}))}function Xn(e,t,n){const r=P(e)?e.slice():[e];for(let e=0;e<n;++e)r.push(t);return r}const Jn={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){const n=e.table(t),{schema:r}=n,s={},i=[];function o(e,t,n){const r=In(e),a=s[r]=s[r]||[],c=null==e?0:"string"==typeof e?1:e.length,l=t>0,u={...n,isVirtual:l,keyTail:t,keyLength:c,extractKey:On(e),unique:!l&&n.unique};return a.push(u),u.isPrimaryKey||i.push(u),c>1&&o(2===c?e[0]:e.slice(0,c-1),t+1,n),a.sort(((e,t)=>e.keyTail-t.keyTail)),u}const a=o(r.primaryKey.keyPath,0,r.primaryKey);s[":id"]=[a];for(const e of r.indexes)o(e.keyPath,0,e);function c(t){const n=t.query.index;return n.isVirtual?{...t,query:{index:n,range:(r=t.query.range,s=n.keyTail,{type:1===r.type?2:r.type,lower:Xn(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,s),lowerOpen:!0,upper:Xn(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,s),upperOpen:!0})}}:t;var r,s}const l={...n,schema:{...r,primaryKey:a,indexes:i,getIndexByKeyPath:function(e){const t=s[In(e)];return t&&t[0]}},count:e=>n.count(c(e)),query:e=>n.query(c(e)),openCursor(t){const{keyTail:r,isVirtual:s,keyLength:i}=t.query.index;return s?n.openCursor(c(t)).then((n=>n&&function(n){const s=Object.create(n,{continue:{value:function(s){null!=s?n.continue(Xn(s,t.reverse?e.MAX_KEY:e.MIN_KEY,r)):t.unique?n.continue(n.key.slice(0,i).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,r)):n.continue()}},continuePrimaryKey:{value(t,s){n.continuePrimaryKey(Xn(t,e.MAX_KEY,r),s)}},primaryKey:{get:()=>n.primaryKey},key:{get(){const e=n.key;return 1===i?e[0]:e.slice(0,i)}},value:{get:()=>n.value}});return s}(n))):n.openCursor(t)}};return l}}}};function Zn(e,t,n,r){return n=n||{},r=r||"",S(e).forEach((s=>{if(I(t,s)){var i=e[s],o=t[s];if("object"==typeof i&&"object"==typeof o&&i&&o){const e=ee(i);e!==ee(o)?n[r+s]=t[s]:"Object"===e?Zn(i,o,n,r+s+"."):i!==o&&(n[r+s]=t[s])}else i!==o&&(n[r+s]=t[s])}else n[r+s]=void 0})),S(t).forEach((s=>{I(e,s)||(n[r+s]=t[s])})),n}const er={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){const n=e.table(t),{primaryKey:r}=n.schema,s={...n,mutate(e){const s=Qe.trans,{deleting:i,creating:o,updating:a}=s.table(t).hook;switch(e.type){case"add":if(o.fire===Ee)break;return s._promise("readwrite",(()=>c(e)),!0);case"put":if(o.fire===Ee&&a.fire===Ee)break;return s._promise("readwrite",(()=>c(e)),!0);case"delete":if(i.fire===Ee)break;return s._promise("readwrite",(()=>c(e)),!0);case"deleteRange":if(i.fire===Ee)break;return s._promise("readwrite",(()=>function(e){return l(e.trans,e.range,1e4)}(e)),!0)}return n.mutate(e);function c(e){const t=Qe.trans,s=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(r,e);if(!s)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:s}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),function(e,t,n){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:"immutable"})}(n,e,s).then((c=>{const l=s.map(((n,s)=>{const l=c[s],u={onerror:null,onsuccess:null};if("delete"===e.type)i.fire.call(u,n,l,t);else if("add"===e.type||void 0===l){const i=o.fire.call(u,n,e.values[s],t);null==n&&null!=i&&(n=i,e.keys[s]=n,r.outbound||z(e.values[s],r.keyPath,n))}else{const r=Zn(l,e.values[s]),i=a.fire.call(u,r,n,l,t);if(i){const t=e.values[s];Object.keys(i).forEach((e=>{I(t,e)?t[e]=i[e]:z(t,e,i[e])}))}}return u}));return n.mutate(e).then((({failures:t,results:n,numFailures:r,lastResult:i})=>{for(let r=0;r<s.length;++r){const i=n?n[r]:s[r],o=l[r];null==i?o.onerror&&o.onerror(t[r]):o.onsuccess&&o.onsuccess("put"===e.type&&c[r]?e.values[r]:i)}return{failures:t,results:n,numFailures:r,lastResult:i}})).catch((e=>(l.forEach((t=>t.onerror&&t.onerror(e))),Promise.reject(e))))}))}function l(e,t,s){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:s}).then((({result:n})=>c({type:"delete",keys:n,trans:e}).then((r=>r.numFailures>0?Promise.reject(r.failures[0]):n.length<s?{failures:[],numFailures:0,lastResult:void 0}:l(e,{...t,lower:n[n.length-1],lowerOpen:!0},s)))))}}};return s}})};function tr(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;const r=[];for(let s=0,i=0;s<t.keys.length&&i<e.length;++s)0===an(t.keys[s],e[i])&&(r.push(n?X(t.values[s]):t.values[s]),++i);return r.length===e.length?r:null}catch(e){return null}}const nr={stack:"dbcore",level:-1,create:e=>({table:t=>{const n=e.table(t);return{...n,getMany:e=>{if(!e.cache)return n.getMany(e);const t=tr(e.keys,e.trans._cache,"clone"===e.cache);return t?et.resolve(t):n.getMany(e).then((t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?X(t):t},t)))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),n.mutate(e))}}})};function rr(e){return!("from"in e)}const sr=function(e,t){if(!this){const t=new sr;return e&&"d"in e&&O(t,e),t}O(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function ir(e,t,n){const r=an(t,n);if(isNaN(r))return;if(r>0)throw RangeError();if(rr(e))return O(e,{from:t,to:n,d:1});const s=e.l,i=e.r;if(an(n,e.from)<0)return s?ir(s,t,n):e.l={from:t,to:n,d:1,l:null,r:null},cr(e);if(an(t,e.to)>0)return i?ir(i,t,n):e.r={from:t,to:n,d:1,l:null,r:null},cr(e);an(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),an(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);const o=!e.r;s&&!e.l&&or(e,s),i&&o&&or(e,i)}function or(e,t){rr(t)||function e(t,{from:n,to:r,l:s,r:i}){ir(t,n,r),s&&e(t,s),i&&e(t,i)}(e,t)}function ar(e){let t=rr(e)?null:{s:0,n:e};return{next(e){const n=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&an(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||an(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function cr(e){var t,n;const r=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(n=e.l)||void 0===n?void 0:n.d)||0),s=r>1?"r":r<-1?"l":"";if(s){const t="r"===s?"l":"r",n={...e},r=e[s];e.from=r.from,e.to=r.to,e[s]=r[s],n[s]=r[t],e[t]=n,n.d=lr(n)}e.d=lr(e)}function lr({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}j(sr.prototype,{add(e){return or(this,e),this},addKey(e){return ir(this,e,e),this},addKeys(e){return e.forEach((e=>ir(this,e,e))),this},[te](){return ar(this)}});const ur={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,n=new sr(e.MIN_KEY,e.MAX_KEY);return{...e,table:r=>{const s=e.table(r),{schema:i}=s,{primaryKey:o}=i,{extractKey:a,outbound:c}=o,l={...s,mutate:e=>{const o=e.trans,a=o.mutatedParts||(o.mutatedParts={}),c=e=>{const n=`idb://${t}/${r}/${e}`;return a[n]||(a[n]=new sr)},l=c(""),u=c(":dels"),{type:h}=e;let[d,f]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[];const p=e.trans._cache;return s.mutate(e).then((e=>{if(P(d)){"delete"!==h&&(d=e.results),l.addKeys(d);const t=tr(d,p);t||"add"===h||u.addKeys(d),(t||f)&&function(e,t,n,r){t.indexes.forEach((function(t){const s=e(t.name||"");function i(e){return null!=e?t.extractKey(e):null}const o=e=>t.multiEntry&&P(e)?e.forEach((e=>s.addKey(e))):s.addKey(e);(n||r).forEach(((e,t)=>{const s=n&&i(n[t]),a=r&&i(r[t]);0!==an(s,a)&&(null!=s&&o(s),null!=a&&o(a))}))}))}(c,i,t,f)}else if(d){const e={from:d.lower,to:d.upper};u.add(e),l.add(e)}else l.add(n),u.add(n),i.indexes.forEach((e=>c(e.name).add(n)));return e}))}},u=({query:{index:t,range:n}})=>{var r,s;return[t,new sr(null!==(r=n.lower)&&void 0!==r?r:e.MIN_KEY,null!==(s=n.upper)&&void 0!==s?s:e.MAX_KEY)]},h={get:e=>[o,new sr(e.key)],getMany:e=>[o,(new sr).addKeys(e.keys)],count:u,query:u,openCursor:u};return S(h).forEach((e=>{l[e]=function(i){const{subscr:o}=Qe;if(o){const l=e=>{const n=`idb://${t}/${r}/${e}`;return o[n]||(o[n]=new sr)},u=l(""),d=l(":dels"),[f,p]=h[e](i);if(l(f.name||"").add(p),!f.isPrimaryKey){if("count"!==e){const t="query"===e&&c&&i.values&&s.query({...i,values:!1});return s[e].apply(this,arguments).then((n=>{if("query"===e){if(c&&i.values)return t.then((({result:e})=>(u.addKeys(e),n)));const e=i.values?n.result.map(a):n.result;i.values?u.addKeys(e):d.addKeys(e)}else if("openCursor"===e){const e=n,t=i.values;return e&&Object.create(e,{key:{get:()=>(d.addKey(e.primaryKey),e.key)},primaryKey:{get(){const t=e.primaryKey;return d.addKey(t),t}},value:{get:()=>(t&&u.addKey(e.primaryKey),e.value)}})}return n}))}d.add(n)}}return s[e].apply(this,arguments)}})),l}}}};class $n{constructor(e,t){this._middlewares={},this.verno=0;const n=$n.dependencies;this._options=t={addons:$n.addons,autoOpen:!0,indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:r}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const s={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Ee,dbReadyPromise:null,cancelOpen:Ee,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var i;s.dbReadyPromise=new et((e=>{s.dbReadyResolve=e})),s.openCanceller=new et(((e,t)=>{s.cancelOpen=t})),this._state=s,this.name=e,this.on=Xt(this,"populate","blocked","versionchange","close",{ready:[Ke,Ee]}),this.on.ready.subscribe=$(this.on.ready.subscribe,(e=>(t,n)=>{$n.vip((()=>{const r=this._state;if(r.openComplete)r.dbOpenError||et.resolve().then(t),n&&e(t);else if(r.onReadyBeingFired)r.onReadyBeingFired.push(t),n&&e(t);else{e(t);const r=this;n||e((function e(){r.on.ready.unsubscribe(t),r.on.ready.unsubscribe(e)}))}}))})),this.Collection=(i=this,Jt(Rt.prototype,(function(e,t){this.db=i;let n=Ht,r=null;if(t)try{n=t()}catch(e){r=e}const s=e._ctx,o=s.table,a=o.hook.reading.fire;this._ctx={table:o,index:s.index,isPrimKey:!s.index||o.schema.primKey.keyPath&&s.index===o.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:s.or,valueMapper:a!==Se?a:null}}))),this.Table=function(e){return Jt(kt.prototype,(function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:Xt(null,{creating:[Ce,Ee],reading:[Pe,Se],updating:[Ie,Ee],deleting:[Ae,Ee]})}))}(this),this.Transaction=function(e){return Jt(Qt.prototype,(function(t,n,r,s,i){this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=s,this.idbtrans=null,this.on=Xt(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new et(((e,t)=>{this._resolve=e,this._reject=t})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),Ft(e)}))}))}(this),this.Version=function(e){return Jt(vn.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return Jt(Yt.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};const s=e._deps.indexedDB;if(!s)throw new _e.MissingAPI;this._cmp=this._ascending=s.cmp.bind(s),this._descending=(e,t)=>s.cmp(t,e),this._max=(e,t)=>s.cmp(e,t)>0?e:t,this._min=(e,t)=>s.cmp(e,t)<0?e:t,this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()})),this.on("blocked",(e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)})),this._maxKey=Pn(t.IDBKeyRange),this._createTransaction=(e,t,n,r)=>new this.Transaction(e,t,n,this._options.chromeTransactionDurability,r),this._fireOnBlocked=e=>{this.on("blocked").fire(e),qt.filter((e=>e.name===this.name&&e!==this&&!e._state.vcFired)).map((t=>t.on("versionchange").fire(e)))},this.use(Jn),this.use(er),this.use(ur),this.use(nr),this.vip=Object.create(this,{_vip:{value:!0}}),r.forEach((e=>e(this)))}version(e){if(isNaN(e)||e<.1)throw new _e.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new _e.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);const t=this._versions;var n=t.filter((t=>t._cfg.version===e))[0];return n||(n=new this.Version(e),t.push(n),t.sort(Rn),n.stores({}),this._state.autoSchema=!1,n)}_whenReady(e){return this.idbdb&&(this._state.openComplete||Qe.letThrough||this._vip)?e():new et(((e,t)=>{if(this._state.openComplete)return t(new _e.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new _e.DatabaseClosed);this.open().catch(Ee)}this._state.dbReadyPromise.then(e,t)})).then(e)}use({stack:e,create:t,level:n,name:r}){r&&this.unuse({stack:e,name:r});const s=this._middlewares[e]||(this._middlewares[e]=[]);return s.push({stack:e,create:t,level:null==n?10:n,name:r}),s.sort(((e,t)=>e.level-t.level)),this}unuse({stack:e,name:t,create:n}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((e=>n?e.create!==n:!!t&&e.name!==t))),this}open(){return function(e){const t=e._state,{indexedDB:n}=e._deps;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((()=>t.dbOpenError?Ft(t.dbOpenError):e));oe&&(t.openCanceller._stackHolder=ue()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const r=t.openCanceller;function s(){if(t.openCanceller!==r)throw new _e.DatabaseClosed("db.open() was cancelled")}let i=t.dbReadyResolve,o=null,a=!1;return et.race([r,("undefined"==typeof navigator?et.resolve():Yn()).then((()=>new et(((r,i)=>{if(s(),!n)throw new _e.MissingAPI;const c=e.name,l=t.autoSchema?n.open(c):n.open(c,Math.round(10*e.verno));if(!l)throw new _e.MissingAPI;l.onerror=wn(i),l.onblocked=yt(e._fireOnBlocked),l.onupgradeneeded=yt((r=>{if(o=l.transaction,t.autoSchema&&!e._options.allowEmptyDB){l.onerror=_n,o.abort(),l.result.close();const e=n.deleteDatabase(c);e.onsuccess=e.onerror=yt((()=>{i(new _e.NoSuchDatabase(`Database ${c} doesnt exist`))}))}else{o.onerror=wn(i);var s=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;a=s<1,e._novip.idbdb=l.result,Bn(e,s/10,o,i)}}),i),l.onsuccess=yt((()=>{o=null;const n=e._novip.idbdb=l.result,s=N(n.objectStoreNames);if(s.length>0)try{const r=n.transaction(1===(i=s).length?i[0]:i,"readonly");t.autoSchema?function({_novip:e},t,n){e.verno=t.version/10;const r=e._dbSchema=qn(0,t,n);e._storeNames=N(t.objectStoreNames,0),Tn(e,[e._allTables],S(r),r)}(e,n,r):(Un(e,e._dbSchema,r),function(e,t){const n=Fn(qn(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some((e=>e.add.length||e.change.length)))}(e,r)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Kn(e,r)}catch(e){}var i;qt.push(e),n.onversionchange=yt((n=>{t.vcFired=!0,e.on("versionchange").fire(n)})),n.onclose=yt((t=>{e.on("close").fire(t)})),a&&function({indexedDB:e,IDBKeyRange:t},n){!Vn(e)&&"__dbnames"!==n&&zn(e,t).put({name:n}).catch(Ee)}(e._deps,c),r()}),i)}))))]).then((()=>(s(),t.onReadyBeingFired=[],et.resolve(Wn((()=>e.on.ready.fire(e.vip)))).then((function n(){if(t.onReadyBeingFired.length>0){let r=t.onReadyBeingFired.reduce(Ke,Ee);return t.onReadyBeingFired=[],et.resolve(Wn((()=>r(e.vip)))).then(n)}}))))).finally((()=>{t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((()=>e)).catch((n=>{t.dbOpenError=n;try{o&&o.abort()}catch(e){}return r===t.openCanceller&&e._close(),Ft(n)})).finally((()=>{t.openComplete=!0,i()}))}(this)}_close(){const e=this._state,t=qt.indexOf(this);if(t>=0&&qt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new et((t=>{e.dbReadyResolve=t})),e.openCanceller=new et(((t,n)=>{e.cancelOpen=n}))}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new _e.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,t=this._state;return new et(((n,r)=>{const s=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=yt((()=>{!function({indexedDB:e,IDBKeyRange:t},n){!Vn(e)&&"__dbnames"!==n&&zn(e,t).delete(n).catch(Ee)}(this._deps,this.name),n()})),e.onerror=wn(r),e.onblocked=this._fireOnBlocked};if(e)throw new _e.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(s):s()}))}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){const e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return S(this._allTables).map((e=>this._allTables[e]))}transaction(){const e=Gn.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,n){let r=Qe.trans;r&&r.db===this&&-1===e.indexOf("!")||(r=null);const s=-1!==e.indexOf("?");let i,o;e=e.replace("!","").replace("?","");try{if(o=t.map((e=>{var t=e instanceof this.Table?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||"readonly"===e)i="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new _e.InvalidArgument("Invalid transaction mode: "+e);i="readwrite"}if(r){if("readonly"===r.mode&&"readwrite"===i){if(!s)throw new _e.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&o.forEach((e=>{if(r&&-1===r.storeNames.indexOf(e)){if(!s)throw new _e.SubTransaction("Table "+e+" not included in parent transaction.");r=null}})),s&&r&&!r.active&&(r=null)}}catch(e){return r?r._promise(null,((t,n)=>{n(e)})):Ft(e)}const a=Qn.bind(null,this,i,o,r,n);return r?r._promise(i,a,"lock"):Qe.trans?jt(Qe.transless,(()=>this._whenReady(a))):this._whenReady(a)}table(e){if(!I(this._allTables,e))throw new _e.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}const hr="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class Ln{constructor(e){this._subscribe=e}subscribe(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}[hr](){return this}}function dr(e,t){return S(t).forEach((n=>{or(e[n]||(e[n]=new sr),t[n])})),e}let fr;try{fr={indexedDB:E.indexedDB||E.mozIndexedDB||E.webkitIndexedDB||E.msIndexedDB,IDBKeyRange:E.IDBKeyRange||E.webkitIDBKeyRange}}catch(E){fr={indexedDB:null,IDBKeyRange:null}}const pr=$n;function yr(e){let t=mr;try{mr=!0,xn.storagemutated.fire(e)}finally{mr=t}}j(pr,{...ke,delete:e=>new pr(e,{addons:[]}).delete(),exists:e=>new pr(e,{addons:[]}).open().then((e=>(e.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(e){try{return function({indexedDB:e,IDBKeyRange:t}){return Vn(e)?Promise.resolve(e.databases()).then((e=>e.map((e=>e.name)).filter((e=>"__dbnames"!==e)))):zn(e,t).toCollection().primaryKeys()}(pr.dependencies).then(e)}catch(e){return Ft(new _e.MissingAPI)}},defineClass:()=>function(e){O(this,e)},ignoreTransaction:e=>Qe.trans?jt(Qe.transless,e):e(),vip:Wn,async:function(e){return function(){try{var t=Hn(e.apply(this,arguments));return t&&"function"==typeof t.then?t:et.resolve(t)}catch(e){return Ft(e)}}},spawn:function(e,t,n){try{var r=Hn(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:et.resolve(r)}catch(e){return Ft(e)}},currentTransaction:{get:()=>Qe.trans||null},waitFor:function(e,t){const n=et.resolve("function"==typeof e?pr.ignoreTransaction(e):e).timeout(t||6e4);return Qe.trans?Qe.trans.waitFor(n):n},Promise:et,debug:{get:()=>oe,set:e=>{ae(e,"dexie"===e?()=>!0:Vt)}},derive:D,extend:O,props:j,override:$,Events:Xt,on:xn,liveQuery:function(e){return new Ln((t=>{const n=ie(e);let r=!1,s={},i={};const o={get closed(){return r},unsubscribe:()=>{r=!0,xn.storagemutated.unsubscribe(u)}};t.start&&t.start(o);let a=!1,c=!1;function l(){return S(i).some((e=>s[e]&&function(e,t){const n=ar(t);let r=n.next();if(r.done)return!1;let s=r.value;const i=ar(e);let o=i.next(s.from),a=o.value;for(;!r.done&&!o.done;){if(an(a.from,s.to)<=0&&an(a.to,s.from)>=0)return!0;an(s.from,a.from)<0?s=(r=n.next(a.from)).value:a=(o=i.next(s.from)).value}return!1}(s[e],i[e])))}const u=e=>{dr(s,e),l()&&h()},h=()=>{if(a||r)return;s={};const d={},f=function(t){n&&Et();const r=()=>xt(e,{subscr:t,trans:null}),s=Qe.trans?jt(Qe.transless,r):r();return n&&s.then(St,St),s}(d);c||(xn("storagemutated",u),c=!0),a=!0,Promise.resolve(f).then((e=>{a=!1,r||(l()?h():(s={},i=d,t.next&&t.next(e)))}),(e=>{a=!1,t.error&&t.error(e),o.unsubscribe()}))};return h(),o}))},extendObservabilitySet:dr,getByKeyPath:U,setByKeyPath:z,delByKeyPath:function(e,t){"string"==typeof t?z(e,t,void 0):"length"in t&&[].map.call(t,(function(t){z(e,t,void 0)}))},shallowClone:V,deepClone:X,getObjectDiff:Zn,cmp:an,asap:q,minKey:-1/0,addons:[],connections:qt,errnames:be,dependencies:fr,semVer:"3.2.1",version:"3.2.1".split(".").map((e=>parseInt(e))).reduce(((e,t,n)=>e+t/Math.pow(10,2*n)))}),pr.maxKey=Pn(pr.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(xn("storagemutated",(e=>{if(!mr){let t;Lt?(t=document.createEvent("CustomEvent"),t.initCustomEvent("x-storagemutated-1",!0,!0,e)):t=new CustomEvent("x-storagemutated-1",{detail:e}),mr=!0,dispatchEvent(t),mr=!1}})),addEventListener("x-storagemutated-1",(({detail:e})=>{mr||yr(e)})));let mr=!1;if("undefined"!=typeof BroadcastChannel){const e=new BroadcastChannel("x-storagemutated-1");xn("storagemutated",(t=>{mr||e.postMessage(t)})),e.onmessage=e=>{e.data&&yr(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){xn("storagemutated",(e=>{try{mr||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((t=>t.postMessage({type:"x-storagemutated-1",changedParts:e}))))}catch(e){}})),addEventListener("storage",(e=>{if("x-storagemutated-1"===e.key){const t=JSON.parse(e.newValue);t&&yr(t.changedParts)}}));const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",(function({data:e}){e&&"x-storagemutated-1"===e.type&&yr(e.changedParts)}))}et.rejectionMapper=function(e,t){if(!e||e instanceof ye||e instanceof TypeError||e instanceof SyntaxError||!e.name||!xe[e.name])return e;var n=new xe[e.name](t||e.message,e);return"stack"in e&&T(n,"stack",{get:function(){return this.inner.stack}}),n},ae(oe,Vt);class Database extends $n{hashes;icons;constructor(){super("IconCache"),this.version(1).stores({hashes:"&id, hash",icons:"&id, idFull, fontId, name, data, aliases, tags, codepoint"}),this.hashes=this.table("hashes"),this.icons=this.table("icons")}}const gr=window.location.href.match(/localhost/),vr=window.location.href.match(/templarian\.github\.io/);const br={get:async function(e,t={}){const{params:n={}}=t,r=Object.keys(n),s=`?${r.map((e=>{const t=n[e];return t instanceof Array?`${e}=${t.join(",")}`:`${e}=${t}`})).join("&")}`;if(gr||vr){const t=r.map((e=>{const t=n[e];return t instanceof Array?(t.forEach(((e,n)=>{e.match(/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/)&&(t[n]=e.substr(0,3))})),`${e}/${t.join("-")}`):`${e}/${t}`})).join("/");t&&(e+=`/_/${t}`),vr&&(e=e.replace(/^\//,""))}const i=await fetch(gr||vr?`${e}/mock.get.json`:`${e}${"?"===s?"":s}`);try{return i.json()}catch(e){}if(!i.ok)throw new Error(i.statusText);return Promise.reject()},asset:async function(e,t={}){const{params:n={}}=t,r=`?${Object.keys(n).map((e=>`${e}=${n[e]}`)).join("&")}`,s=await fetch(`${e}${"?"===r?"":r}`);try{return s.text()}catch(e){}if(!s.ok)throw new Error(s.statusText);return Promise.reject()}};class Alias{id;name;match=!1;constructor(e,t){void 0!==e&&(this.id=e),void 0!==t&&(this.name=t)}from(e){return void 0!==e.id&&(this.id=e.id),void 0!==e.name&&(this.name=e.name),this}to(){return{name:this.name}}}class User{id=null;github=null;name=null;base64=null;iconCount=null;description=null;website=null;sponsored=!1;sponsorship="";core=!1;from(e){return this.id=e.id,this.github=e.github,this.name=e.name,"string"==typeof e.base64&&(e.base64.match(/^data/)?this.base64=e.base64:this.base64=`data:image/png;base64,${e.base64}`),this.iconCount=e.iconCount,this.description=e.description,this.website=e.website,this.sponsored=e.sponsored,this.sponsorship=`https://github.com/users/${e.github}/sponsorship`,this.core=e.core,this}}class Tag{id;name;url;count;from(e){return void 0!==e.id&&(this.id=e.id),void 0!==e.name&&(this.name=e.name),void 0!==e.url&&(this.url=e.url),void 0!==e.count&&(this.count=e.count),this}to(){return{name:this.name,url:this.url,count:this.count}}}class Style{id;name;count=null;from(e){return this.id=e.id,this.name=e.name,this.count=e.count,this}}class FontIcon{id;codepoint;font;version;from(e){return this.id=e.id,this.codepoint=e.codepoint,this.font=e.font,this.version=e.version,this}to(){return{id:this.id,codepoint:this.codepoint,font:this.font,version:this.version}}}class Icon{id=null;packageId=null;baseIconId=null;name=null;description=null;data=null;user=null;version=null;aliases=[];tags=[];styles=[];published=!0;deprecated=!1;codepoint=null;fontIcons=[];fontIcon=null;constructor(e,t){this.name=e||null,this.data=t||null}from(e){return this.id=e.id,this.packageId=e.packageId,this.baseIconId=e.baseIconId,this.name=e.name,this.description=e.description,this.data=e.data,e.version&&(this.version=e.version),e.fontIcon&&(this.fontIcon=e.fontIcon),e.user&&(this.user=(new User).from(e.user)),e.aliases&&(this.aliases=e.aliases.map((e=>(new Alias).from(e)))),e.tags&&(this.tags=e.tags.map((e=>(new Tag).from(e)))),e.styles&&(this.styles=e.styles.map((e=>(new Style).from(e)))),"boolean"==typeof e.published&&(this.published=e.published),"boolean"==typeof e.deprecated&&(this.deprecated=e.deprecated),e.codepoint&&(this.codepoint=e.codepoint),e.fontIcons&&(this.fontIcons=e.fontIcons.map((e=>(new FontIcon).from(e)))),this}to(){const{id:e,name:t,description:n,data:r,version:s,fontIcon:i,packageId:o,baseIconId:a,aliases:c,tags:l}=this;return{id:e,name:t,description:n,data:r,version:s,fontIcon:i,packageId:o,baseIconId:a,aliases:c.map((e=>e.to())),tags:l.map((e=>e.to()))}}}class FontVersion{id;major;minor;patch;iconCount;description;date;released;from(e){return this.id=e.id,this.major=e.major,this.minor=e.minor,this.patch=e.patch,this.iconCount=e.iconCount,this.description=e.description,this.date=new Date(e.date),this.released=e.released,this}}class Font{id;name;description;prefix;fontName;fileName;fontFamily;fontWeight;price;versions=[];iconCount;from(e){return this.id=e.id,this.name=e.name,this.description=e.description,this.prefix=e.prefix,this.fontName=e.fontName,this.fontFamily=e.fontFamily,this.fontWeight=e.fontWeight,this.price=e.price,this.iconCount=e.iconCount,e.versions&&(this.versions=e.versions.map((e=>(new FontVersion).from(e)))),this}}var wr=function(e,t,n,r,s,i){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,c=r.kind,l="getter"===c?"get":"setter"===c?"set":"value",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,f=n.length-1;f>=0;f--){var p={};for(var y in r)p[y]="access"===y?{}:r[y];for(var y in r.access)p.access[y]=r.access[y];p.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");i.push(o(e||null))};var m=(0,n[f])("accessor"===c?{get:h.get,set:h.set}:h[l],p);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=o(m.get))&&(h.get=a),(a=o(m.set))&&(h.set=a),(a=o(m.init))&&s.unshift(a)}else(a=o(m))&&("field"===c?s.unshift(a):h[l]=a)}u&&Object.defineProperty(u,r.name,h),d=!0},_r=function(e,t,n){for(var r=arguments.length>2,s=0;s<t.length;s++)n=r?t[s].call(e,n):t[s].call(e);return r?n:void 0};const xr=new class DatabaseService{db=new Database;async getHashesFromServer(e){return await br.get(`/api/font/${e.id}/hash`)}async getIconsFromServer(e,t){if(0===t.length)return[];return(await br.get(`/api/font/${e.id}`,{params:{ids:t.join(",")}})).map((e=>(new Icon).from(e)))}async getIconsByPage(e,t,n){return(await br.get(`/api/font/${e.id}`,{params:{page:t.toString(),size:n.toString()}})).map((e=>(new Icon).from(e)))}async asyncThrottledMap(e,t,n){let r=new Set;const s=[];for(let o of t){r.size>=e&&await Promise.race(r);const t=i(n(o));s.push(t)}return Promise.all(s);async function i(e){r.add(e);const t=await e;return r.delete(e),t}}async exists(e){return await this.getCount(e)>0}async resync(e){let t=!1;const n=(new Font).from({id:e}),r=await this.getHashesFromServer(n),s=Object.keys(r),i=await this.db.hashes.toArray(),o={};i.forEach((e=>{o[e.id]=e.hash}));const a=Object.keys(o),c=[];s.forEach((e=>{e in o&&o[e]===r[e]||c.push(e)}));const l=[];if(a.forEach((e=>{e in r||l.push(e)})),await this.db.icons.bulkDelete(l),(c.length>0||l.length>0)&&(t=!0),c.length<500){let e,t,r=[],s=100;for(e=0,t=c.length;e<t;e+=s)r.push(c.slice(e,e+s));const i=r.map((e=>this.getIconsFromServer(n,e)));(await Promise.all(i)).forEach((e=>{this.db.icons.bulkPut(e.map((e=>({id:e.fontIcon.id,idFull:e.id,fontId:n.id,name:e.name,data:e.data,version:e.version,codepoint:e.codepoint,aliases:e.aliases,tags:e.tags}))))}))}else if(0!==c.length){let e=500,t=Math.ceil(s.length/e),r=[];for(let s=1;s<=t;s++)r.push(this.getIconsByPage(n,s,e));await this.asyncThrottledMap(2,r,(e=>e.then((e=>{this.db.icons.bulkPut(e.map((e=>({id:e.fontIcon.id,idFull:e.id,fontId:n.id,name:e.name,data:e.data,version:e.version,codepoint:e.codepoint,aliases:JSON.stringify(e.aliases.map((e=>({name:e.name})))),tags:JSON.stringify(e.tags.map((e=>({name:e.name,url:e.url}))))}))))}))))}return t&&(await this.db.hashes.bulkPut(s.map((e=>({id:e,hash:r[e]})))),await this.db.hashes.bulkDelete(l)),t}synced=!1;async sync(e){if(!this.synced){const t=await this.resync(e);return this.synced=!0,t}return!1}convert(e){const t=new Icon;t.id=e.idFull,t.name=e.name,t.data=e.data,t.version=e.version,t.codepoint=e.codepoint;const n=e.aliases instanceof Array?e.aliases:JSON.parse(e.aliases);t.aliases=n.map((e=>(new Alias).from(e)));const r=e.tags instanceof Array?e.tags:JSON.parse(e.tags);return t.tags=r.map((e=>(new Tag).from(e))),t}async getIconByName(e){const t=await this.db.icons.where("name").equals(e).first();return t?this.convert(t):null}async getIcons(e,t){let n;if(t){const r=t.toLowerCase().replace(/[^a-z0-9-]/g,""),s=new RegExp(`${r}`);n=await this.db.icons.where("fontId").equals(e).filter((e=>null!==e.name.match(s))).sortBy("name")}else n=await this.db.icons.where("fontId").equals(e).sortBy("name");return n.map((e=>this.convert(e)))}async getCount(e){return await this.db.icons.where("fontId").equals(e).count()}async delete(){await this.db.delete()}};(()=>{let e,t,n,r=[g({selector:"pg-database",style:k.A,template:""})],s=[],i=HTMLElement,o=[],a=[];(class extends i{static{t=this}static{const c="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;n=[_()],wr(null,null,n,{kind:"field",name:"font",static:!1,private:!1,access:{has:e=>"font"in e,get:e=>e.font,set:(e,t)=>{e.font=t}},metadata:c},o,a),wr(null,e={value:t},r,{kind:"class",name:t.name,metadata:c},null,s),t=e.value,c&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c}),_r(t,s)}font=_r(this,o,"");async render(){if(""!==this.font){let e=!0;await xr.exists(this.font)&&this.dispatchEvent(new CustomEvent("sync",{detail:{db:xr,delay:e}}));await xr.sync(this.font)&&(e=!1,this.dispatchEvent(new CustomEvent("sync",{detail:{db:xr,delay:e}})))}}constructor(){super(...arguments),_r(this,a)}})})()})();
|
package/pgDropdown.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o="",r=void 0!==t[5];return t[4]&&(o+="@supports (".concat(t[4],") {")),t[2]&&(o+="@media ".concat(t[2]," {")),r&&(o+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),o+=e(t),r&&(o+="}"),t[2]&&(o+="}"),t[4]&&(o+="}"),o})).join("")},t.i=function(e,o,r,n,a){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var p=0;p<this.length;p++){var l=this[p][0];null!=l&&(i[l]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);r&&i[c[0]]||(void 0!==a&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=a),o&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=o):c[2]=o),n&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=n):c[4]="".concat(n)),t.push(c))}},t}},601:e=>{e.exports=function(e){return e[1]}},697:(e,t,o)=>{o.d(t,{A:()=>l});var r=o(601),n=o.n(r),a=o(314),i=o.n(a)()(n());i.push([e.id,"[part~=popover] {\n background: #FFF;\n padding: 0.5rem;\n border-radius: 0.5rem;\n box-shadow: 0 1px 14px rgba(0, 0, 0, 0.2);\n border: 4px solid var(--pg-dropdown-border-color);\n}\n\n[part~=arrow],\n[part~=arrow]::before {\n position: absolute;\n width: 10px;\n height: 10px;\n}\n\n[part~=arrow]::before {\n content: '';\n transform: rotate(45deg);\n background: #FFF;\n}\n\n[part~=popover][data-popper-placement^='top'] > [part~=arrow] {\n bottom: -5px;\n}\n[part~=popover][data-popper-placement^='top'] > [part~=arrow]::before {\n border-bottom: 4px solid var(--pg-dropdown-border-color);\n border-right: 4px solid var(--pg-dropdown-border-color);\n border-bottom-right-radius: 0.25rem;\n}\n\n[part~=popover][data-popper-placement^='bottom'] > [part~=arrow] {\n top: -10px;\n}\n[part~=popover][data-popper-placement^='bottom'] > [part~=arrow]::before {\n border-top: 4px solid var(--pg-dropdown-border-color);\n border-left: 4px solid var(--pg-dropdown-border-color);\n border-top-left-radius: 0.25rem;\n}\n\n[part~=popover][data-popper-placement^='left'] > [part~=arrow] {\n right: -5px;\n}\n\n[part~=popover][data-popper-placement^='right'] > [part~=arrow] {\n left: -5px;\n}",""]);var p=new CSSStyleSheet;p.replaceSync(i.toString());const l=p}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var a=t[r]={id:r,exports:{}};return e[r](a,a.exports,o),a.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);Symbol("addObserver"),Symbol("removeObserver"),Symbol("getObservers"),Symbol("isProxy"),Symbol("getTarget");const r=new Map;window.observers=r;Error;Symbol("index");const n=Symbol("init"),a=Symbol("template"),i=Symbol("style"),p=Symbol("parent");function l(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function s(e={}){return function(t,o){if("class"!==o.kind)throw new Error("@Component() can only decorate a class");var r,s;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[p]||t.prototype[p][t.prototype[p].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[p]=[t.prototype],t.prototype[i]=e.style?[e.style]:[],t.prototype[a]=e.template||""):(t.prototype[p].push(t.prototype),t.prototype[i].push(e.style),t.prototype[a]=(r=t.prototype[a],(s=e.template||null)&&s.match(/<parent\/>/)?s.replace(/<parent\/>/,r):`${r}${s||""}`));const c=t.prototype.connectedCallback||(()=>{}),d=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[n]||void 0!==e.template||void 0!==e.style)if(this[n]){if(this[n]&&e.style);else if(this[n]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[a]||"";const o=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[i].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),r.appendChild(o)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const o=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&o.add(e.localName);const r=Array.from(o.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),s=()=>{this[p].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[l(t)]=!0,e)),{}):{})}))};0===r.length?(this[n]=!0,c.call(this),s()):Promise.all(r).then((()=>{this[n]=!0,c.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));s()}))},t.prototype.disconnectedCallback=function(){d.call(this)},t.prototype.attributeChangedCallback=function(e,t,o){this[l(e)]=o},o.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${o.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function c(){return function(e,t){const o=t.name,r=o.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,o,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}Symbol("hasProxy");Symbol("meta");var d=o(697),m=function(e,t,o,r,n,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var p,l=r.kind,s="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),m=!1,u=o.length-1;u>=0;u--){var h={};for(var v in r)h[v]="access"===v?{}:r[v];for(var v in r.access)h.access[v]=r.access[v];h.addInitializer=function(e){if(m)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var f=(0,o[u])("accessor"===l?{get:d.get,set:d.set}:d[s],h);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(p=i(f.get))&&(d.get=p),(p=i(f.set))&&(d.set=p),(p=i(f.init))&&n.unshift(p)}else(p=i(f))&&("field"===l?n.unshift(p):d[s]=p)}c&&Object.defineProperty(c,r.name,d),m=!0},u=function(e,t,o){for(var r=arguments.length>2,n=0;n<t.length;n++)o=r?t[n].call(e,o):t[n].call(e);return r?o:void 0};window.process={env:{}};(()=>{let e,t,o,r,n,a=[s({selector:"pg-dropdown",style:d.A,template:'<slot part="main"></slot> <div part="popover"> <div part="arrow"></div> <slot name="popover"></slot> </div>'})],i=[],p=HTMLElement,l=[],h=[],v=[],f=[],b=[],y=[];(class extends p{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(p[Symbol.metadata]??null):void 0;o=[c()],r=[c()],n=[c()],m(null,null,o,{kind:"field",name:"$main",static:!1,private:!1,access:{has:e=>"$main"in e,get:e=>e.$main,set:(e,t)=>{e.$main=t}},metadata:s},l,h),m(null,null,r,{kind:"field",name:"$popover",static:!1,private:!1,access:{has:e=>"$popover"in e,get:e=>e.$popover,set:(e,t)=>{e.$popover=t}},metadata:s},v,f),m(null,null,n,{kind:"field",name:"$arrow",static:!1,private:!1,access:{has:e=>"$arrow"in e,get:e=>e.$arrow,set:(e,t)=>{e.$arrow=t}},metadata:s},b,y),m(null,e={value:t},a,{kind:"class",name:t.name,metadata:s},null,i),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),u(t,i)}$main=u(this,l,void 0);$popover=(u(this,h),u(this,v,void 0));$arrow=(u(this,f),u(this,b,void 0));isVisible=(u(this,y),!1);connectedCallback(){this.$main.addEventListener("slotchange",(e=>{for(var t=this.$main.assignedElements(),o=0;o<t.length;o++){var r=t[o];this.wireUpPopover(r)}}))}wireUpPopover(e){this.$popover.style.visibility="hidden",e.addEventListener("click",(e=>{this.$popover.style.visibility=this.isVisible?"hidden":"visible",this.isVisible=!this.isVisible,e.preventDefault()}))}render(){}})})()})();
|
package/pgGrid.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",i=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),i&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),i&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,i,s,r){"string"==typeof t&&(t=[[null,t,void 0]]);var o={};if(i)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(o[l]=!0)}for(var c=0;c<t.length;c++){var h=[].concat(t[c]);i&&o[h[0]]||(void 0!==r&&(void 0===h[5]||(h[1]="@layer".concat(h[5].length>0?" ".concat(h[5]):""," {").concat(h[1],"}")),h[5]=r),n&&(h[2]?(h[1]="@media ".concat(h[2]," {").concat(h[1],"}"),h[2]=n):h[2]=n),s&&(h[4]?(h[1]="@supports (".concat(h[4],") {").concat(h[1],"}"),h[4]=s):h[4]="".concat(s)),e.push(h))}},e}},601:t=>{t.exports=function(t){return t[1]}},967:(t,e,n)=>{n.d(e,{A:()=>l});var i=n(601),s=n.n(i),r=n(314),o=n.n(r)()(s());o.push([t.id,"* {\n font-family: var(--pg-font-family);\n}\n\n:host {\n display: block;\n}\n\n[part~=none] {\n display: none;\n}\n\n[part~=none].show {\n display: block;\n}\n\n[part~=grid] {\n position: relative;\n}\n\n[part~=grid] > button {\n border: 0;\n background: transparent;\n padding: 0.625rem;\n outline: none;\n width: 2.75rem;\n height: 2.75rem;\n position: absolute;\n left: 0;\n top: 0;\n border: 0;\n border-radius: 0.25rem;\n}\n\n[part~=grid] > button.hover {\n background: rgba(0, 0, 0, 0.1);\n}\n\n[part~=grid] > button:focus,\n[part~=grid] > button:active {\n background: rgba(0, 0, 0, 0.15);\n box-shadow: 0 0.0125rem 0.25rem rgba(0, 0, 0, 0.2) inset;\n}\n\n[part~=grid] > button > svg {\n fill: #453C4F;\n width: 1.5rem;\n height: 1.5rem;\n}\n\n[part~=grid] > button > svg {\n fill: #453C4F;\n}\n\n[part~=grid]::-webkit-scrollbar {\n width: 1em;\n}\n\n[part~=grid]::-webkit-scrollbar-track {\n box-shadow: inset 0 0 6px rgba(0,0,0,0.2);\n border-radius: 0.25rem;\n}\n\n[part~=grid]::-webkit-scrollbar-thumb {\n background-color: #453C4F;\n outline: 1px solid slategrey;\n border-radius: 0.25rem;\n}",""]);var a=new CSSStyleSheet;a.replaceSync(o.toString());const l=a}},e={};function n(i){var s=e[i];if(void 0!==s)return s.exports;var r=e[i]={id:i,exports:{}};return t[i](r,r.exports,n),r.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const i=Symbol("addObserver"),s=Symbol("removeObserver"),r=Symbol("getObservers"),o=Symbol("isProxy"),a=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function h(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case o:return!0;case a:return e;case r:return c.has(t);case i:return(e,n)=>{c.has(t)?c.get(t).has(e)?c.get(t).get(e).push(n):c.get(t).set(e,[n]):c.set(t,new Map([[e,[n]]]))};case s:return e=>{c.has(t)&&(c.get(t).delete(e),0===c.get(t).size&&c.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,n)}throw new Error("Unsupported symbol")}if(n in e){if(!Number.isNaN(Number(n)))return"object"==typeof e[n]?h(e[n]):e[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return c.get(e).forEach(((t,i)=>{t.forEach((t=>{t(e,n,arguments)}))})),t}:Reflect.get(e,n);if(e[n]instanceof Array)return h(e[n])}return Reflect.get(e,n)},set(t,e,n){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,n);if(c.has(t)){c.get(t).forEach(((t,i)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=c;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const d=Symbol("init"),u=Symbol("template"),p=Symbol("style"),g=Symbol("parent");function m(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function f(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function y(t={}){return function(e,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var i,s;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[g]||e.prototype[g][e.prototype[g].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[g]=[e.prototype],e.prototype[p]=t.style?[t.style]:[],e.prototype[u]=t.template||""):(e.prototype[g].push(e.prototype),e.prototype[p].push(t.style),e.prototype[u]=(i=e.prototype[u],(s=t.template||null)&&s.match(/<parent\/>/)?s.replace(/<parent\/>/,i):`${i}${s||""}`));const r=e.prototype.connectedCallback||(()=>{}),o=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[d]||void 0!==t.template||void 0!==t.style)if(this[d]){if(this[d]&&t.style);else if(this[d]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[u]||"";const n=document.importNode(t.content,!0),i=this.attachShadow({mode:"open"});i.adoptedStyleSheets=e.prototype[p].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),i.appendChild(n)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&n.add(t.localName);const i=Array.from(n.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),s=()=>{this[g].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[f(e)]=!0,t)),{}):{})}))};0===i.length?(this[d]=!0,r.call(this),s()):Promise.all(i).then((()=>{this[d]=!0,r.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));s()}))},e.prototype.disconnectedCallback=function(){o.call(this)},e.prototype.attributeChangedCallback=function(t,e,n){this[f(t)]=n},n.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${n.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function v(t){return!!t&&t.constructor===Array}function w(t,e){t[d]&&t[g].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function b(t){return null===t?"null":v(t)?"array":typeof t}function x(t){return function(e,n){const i=n.name,s=Symbol(i),l=Symbol(`${i}:type`),c=Symbol(`${i}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,i,{get:()=>"object"===this[l]||"array"===this[l]?this[s][o]?this[s]:h(this[s]):this[s],set:e=>{const n=b(t?t(e):e);if("index"!==i&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${i} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!v(e))throw new PropError(`Array "${i}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,i)?.set);if(this[s]===e)throw new Error("Setting an array to itself is not allowed.");const t=h(this[s]);if(t[r]){const n=e[o]?(c=e)[o]&&c[a]:e;t.splice(0,this[s].length,...n)}else this[s]=e}else this[s]=t?t(e):e,w(this,i);var c}})})),function(e){if(void 0===e&&"index"!==i)throw new Error(`@Prop() ${i} must have an initial value defined.`);if(void 0!==e&&"index"===i)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${i} boolean must initialize to false.`);if(!n.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,n=m(i);e[i]||(t.observedAttributes.push(n),e[i]=s)}return this[l]=b(e),"array"===this[l]?(this[s]=e,new Proxy(e,{get:(t,e)=>e===E?this[c]:(console.log("errr???"),Reflect.get(this[s],e)),set:(t,e,n)=>{if(e===E)return this[c]=n,!0;const r=Reflect.set(t,e,n);return"length"===e&&this[s].length===n||w(this,i),this[s]=n,r}})):(this[s]=t?t(this.getAttribute(i)??e):this.getAttribute(i)??e,this[s])}}}function S(){return function(t,e){const n=e.name,i=n.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,n,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${i}]`))}})}))}}Symbol("hasProxy");const E=Symbol("meta");var $=n(967),C=function(t,e,n,i,s,r){function o(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=i.kind,c="getter"===l?"get":"setter"===l?"set":"value",h=!e&&t?i.static?t:t.prototype:null,d=e||(h?Object.getOwnPropertyDescriptor(h,i.name):{}),u=!1,p=n.length-1;p>=0;p--){var g={};for(var m in i)g[m]="access"===m?{}:i[m];for(var m in i.access)g.access[m]=i.access[m];g.addInitializer=function(t){if(u)throw new TypeError("Cannot add initializers after decoration has completed");r.push(o(t||null))};var f=(0,n[p])("accessor"===l?{get:d.get,set:d.set}:d[c],g);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(a=o(f.get))&&(d.get=a),(a=o(f.set))&&(d.set=a),(a=o(f.init))&&s.unshift(a)}else(a=o(f))&&("field"===l?s.unshift(a):d[c]=a)}h&&Object.defineProperty(h,i.name,d),u=!0},k=function(t,e,n){for(var i=arguments.length>2,s=0;s<e.length;s++)n=i?e[s].call(t,n):e[s].call(t);return i?n:void 0};const P="ArrowUp",R="ArrowRight",A="ArrowDown",M="ArrowLeft";(()=>{let t,e,n,i,s,r,o,a,l,c,h,d=[y({selector:"pg-grid",style:$.A,template:'<div part="none"> <slot></slot> </div> <pg-scroll part="scroll"> <div part="grid"></div> </pg-scroll>'})],u=[],p=HTMLElement,g=[],m=[],f=[],v=[],w=[],b=[],E=[],z=[],O=[],T=[],L=[],H=[],j=[],F=[],I=[],D=[],N=[],W=[];(class extends p{static{e=this}static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(p[Symbol.metadata]??null):void 0;n=[x()],i=[x()],s=[x()],r=[x()],o=[x()],a=[x()],l=[S()],c=[S()],h=[S()],C(null,null,n,{kind:"field",name:"icons",static:!1,private:!1,access:{has:t=>"icons"in t,get:t=>t.icons,set:(t,e)=>{t.icons=e}},metadata:y},g,m),C(null,null,i,{kind:"field",name:"size",static:!1,private:!1,access:{has:t=>"size"in t,get:t=>t.size,set:(t,e)=>{t.size=e}},metadata:y},f,v),C(null,null,s,{kind:"field",name:"padding",static:!1,private:!1,access:{has:t=>"padding"in t,get:t=>t.padding,set:(t,e)=>{t.padding=e}},metadata:y},w,b),C(null,null,r,{kind:"field",name:"gap",static:!1,private:!1,access:{has:t=>"gap"in t,get:t=>t.gap,set:(t,e)=>{t.gap=e}},metadata:y},E,z),C(null,null,o,{kind:"field",name:"width",static:!1,private:!1,access:{has:t=>"width"in t,get:t=>t.width,set:(t,e)=>{t.width=e}},metadata:y},O,T),C(null,null,a,{kind:"field",name:"height",static:!1,private:!1,access:{has:t=>"height"in t,get:t=>t.height,set:(t,e)=>{t.height=e}},metadata:y},L,H),C(null,null,l,{kind:"field",name:"$none",static:!1,private:!1,access:{has:t=>"$none"in t,get:t=>t.$none,set:(t,e)=>{t.$none=e}},metadata:y},j,F),C(null,null,c,{kind:"field",name:"$scroll",static:!1,private:!1,access:{has:t=>"$scroll"in t,get:t=>t.$scroll,set:(t,e)=>{t.$scroll=e}},metadata:y},I,D),C(null,null,h,{kind:"field",name:"$grid",static:!1,private:!1,access:{has:t=>"$grid"in t,get:t=>t.$grid,set:(t,e)=>{t.$grid=e}},metadata:y},N,W),C(null,t={value:e},d,{kind:"class",name:e.name,metadata:y},null,u),e=t.value,y&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y}),k(e,u)}icons=k(this,g,[]);size=(k(this,m),k(this,f,24));padding=(k(this,v),k(this,w,8));gap=(k(this,b),k(this,E,4));width=(k(this,z),k(this,O,"auto"));height=(k(this,T),k(this,L,"auto"));$none=(k(this,H),k(this,j,void 0));$scroll=(k(this,F),k(this,I,void 0));$grid=(k(this,D),k(this,N,void 0));currentCount=(k(this,W),0);currentSize=0;currentPadding=0;currentGap=0;rowHeight=0;items=[];svg="http://www.w3.org/2000/svg";columns;debounceRender=((t,e)=>{let n;return(...i)=>new Promise((s=>{n&&clearTimeout(n),n=setTimeout((()=>s(t(...i))),e)}))})((()=>this.render({})),300);color="svg";resizeObserver=new ResizeObserver((()=>{this.debounceRender()}));connectedCallback(){this.resizeObserver.observe(this.$grid),this.addEventListener("mousemove",this.handleTooltip.bind(this)),this.addEventListener("mouseleave",(t=>{this.index=-2,this.handleTooltip(t)})),this.$scroll.addEventListener("calculate",(t=>{const{offsetY:e,height:n,viewWidth:i,viewHeight:s}=t.detail;this.calculate(e,n,i,s)}))}getMetaFromMouse(t){const{width:e,height:n,gap:i,extra:s}=this.getIconMetrics();var r=t.target.getBoundingClientRect();const o=t.clientX-r.left,a=t.clientY-r.top;console.log(o,a);const l=this.getColumnFromX(o,e,i,s),c=this.getRowFromY(a,n,i,s),h=-1!==l&&-1!==c?l+c*this.columns:-1,d=e+i+(l-1)*e+l*(i+s),u=c*n+(c+1)*i;return{gridX:d,gridY:u,x:d+r.left,y:u+r.top,width:e,height:n,column:l,row:c,gap:i,extra:s,index:h,icon:this.icons[h]}}getColumnFromX(t,e,n,i){if((t=Math.round(t))<n)return-1;if(t<=e+n)return 0;const s=Math.floor((t-e-n)/(e+n+i))+1;return t-s*(e+n+i)<n+i?-1:s}getRowFromY(t,e,n,i){if(t<n)return-1;if(t<=e+n)return 0;const s=Math.floor((t-e-n)/(e+n))+1;return t-s*(e+n)<n?-1:s}index=0;hoverLast=0;handleTooltip(t){const e=this.getMetaFromMouse(t),{column:n,index:i}=e;this.hoverLast>=0&&this.items[this.hoverLast][0].classList.toggle("hover",!1);var s=i-this.currentRow*this.columns;s>=0&&(this.items[s][0].classList.toggle("hover",!0),this.hoverLast=s),this.index!==i&&(-1===i||-2===this.index?(e.index=this.index,this.hideTooltip(this.icons[this.index],e),this.index=-1):this.icons[i]&&(n>this.columns-1?(e.index=this.index,this.hideTooltip(this.icons[this.index],e),this.index=-1):(this.showTooltip(this.icons[i],e),this.index=i)))}updateHover(){this.items[this.index][0].classList.toggle("hover",!1)}syncVirtual(t){for(let e=this.currentCount;e<t;e++){this.currentCount=e+1;const t=document.createElement("button");t.dataset.index=`${e}`,t.addEventListener("click",(()=>{const t=e+this.columns*this.currentRow;this.handleClick(this.icons[t])})),t.addEventListener("keydown",(t=>{const n=e+this.columns*this.currentRow;this.moveFocus(t,n)})),t.addEventListener("contextmenu",(t=>{var n=this.$grid.getBoundingClientRect();const i=Math.floor(t.clientX-n.left),s=Math.floor(t.clientY-n.top);this.showContextMenu(e,i,s),t.preventDefault()}));const n=document.createElementNS(this.svg,"svg");n.setAttribute("viewBox","0 0 24 24");const i=document.createElementNS(this.svg,"path");n.appendChild(i),t.appendChild(n),this.$grid.appendChild(t),this.items.push([t,n,i])}for(let e=this.currentCount;e>t;e--){const t=this.items.pop();this.$grid.removeChild(t[0]),this.currentCount--}const{size:e,padding:n,gap:i,width:s,height:r,rowHeight:o,scrollWidth:a,extra:l}=this.getIconMetrics();let c=i,h=i;this.items.forEach((([t,o],a)=>{t.style.padding=`${n}px`,t.style.width=`${s}px`,t.style.height=`${r}px`,t.style.transform=`translate(${c}px, ${h}px)`,o.style.width=`${e}px`,o.style.height=`${e}px`,c+=s+i+l,a%this.columns==this.columns-1&&(h+=r+i,c=i)}))}currentRow=0;timeouts=[];cacheHeight=0;cacheViewWidth=0;calculate(t,e,n,i){const s=this.rowHeight,r=this.icons.length,o=Math.ceil(i/s)+1,a=Math.floor(t/s);this.$grid.style.transform=`translateY(${-1*t%s}px)`,this.cacheHeight===e&&this.cacheViewWidth===n||(this.syncVirtual(o*this.columns),this.cacheHeight=e,this.cacheViewWidth=n),this.currentRow!==a&&(this.items.forEach((([t,e,n],i)=>{const s=i+a*this.columns;s<r?(n.setAttribute("d",this.icons[s].data),t.style.display="block"):t.style.display="none"})),this.currentRow=a)}getIconMetrics(){const t=parseInt(this.size,10),e=parseInt(this.padding,10),n=parseInt(this.gap,10),{width:i}=this.$scroll.getBoundingClientRect(),s=t+2*e,r=s+n;return{size:t,padding:e,gap:n,width:s,height:s,rowHeight:r,extra:(i-n-r*this.columns)/(this.columns-1),scrollWidth:i}}calculateColumns(t,e){const n=t-this.currentGap,i=Math.floor(n/e);return i>0?i:1}render(t){const{size:e,padding:n,gap:i,rowHeight:s,scrollWidth:r}=this.getIconMetrics();this.currentSize===e&&this.currentPadding===n&&this.currentGap===i||(this.currentSize=e,this.currentPadding=n,this.currentGap=i,this.rowHeight=s);const o=this.calculateColumns(r,s);this.columns!==o&&(this.columns=o);const a=this.icons.length;if(a){const t=Math.ceil(a/this.columns);this.currentRow=-1,console.log("---",i+t*s),console.log("init",this.$scroll.height),this.$scroll.setAttribute("height",(i+t*s).toString())}else this.$scroll.setAttribute("height","0");this.$none.classList.toggle("show",0===a)}moveFocus(t,e){let n;switch(t.key){case M:n=e-1,n>=0&&(this.items[n][0].focus(),t.preventDefault());break;case P:n=e-this.columns,n>=0&&(this.items[n][0].focus(),t.preventDefault());break;case R:n=e+1,n<this.icons.length&&(this.items[n][0].focus(),t.preventDefault());break;case A:n=e+this.columns,n<this.icons.length?(this.items[n][0].focus(),t.preventDefault()):n!==this.icons.length-1&&(this.items[this.icons.length-1][0].focus(),t.preventDefault())}}handleClick(t){this.dispatchEvent(new CustomEvent("select",{detail:t}))}canOpenTooltip=!0;preventClose=!1;currentIndex=0;showContextMenu(t,e,n){this.dispatchEvent(new CustomEvent("openmenu"))}hideContextMenu(){this.dispatchEvent(new CustomEvent("closemenu")),this.canOpenTooltip=!0}showTooltip(t,e){this.canOpenTooltip&&this.dispatchEvent(new CustomEvent("entericon",{detail:e}))}hideTooltip(t,e){this.dispatchEvent(new CustomEvent("leaveicon",{detail:e}))}getPositionFromIndex(t){return{x:t%this.columns,y:Math.floor(t/this.columns)}}})})()})();
|
package/pgHeader.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,o,a){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(n)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var p=[].concat(e[c]);n&&i[p[0]]||(void 0!==a&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=a),r&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=r):p[2]=r),o&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=o):p[4]="".concat(o)),t.push(p))}},t}},537:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(601),o=r.n(n),a=r(314),i=r.n(a)()(o());i.push([e.id,":host {\n display: block;\n}\nheader {\n display: grid;\n grid-template-columns: auto 1fr;\n grid-template-rows: 1fr;\n grid-row: 1;\n grid-column: 1 / span 2;\n background: var(--pg-header-background, #fff);\n color: var(--pg-header-color, #453C4F);\n font-family: var(--pg-font-family);\n height: 3rem;\n}\nheader > a {\n grid-column: 1;\n display: inline-flex;\n color: var(--pg-header-color, #453C4F);\n text-decoration: none;\n align-items: center;\n}\nheader > a svg,\nheader > a slot::slotted(svg) {\n display: inline-flex;\n width: 1.75rem;\n height: 1.75rem;\n margin: 0 0.75rem 0 1rem;\n}\nheader > a > span {\n display: inline-flex;\n color: var(--pg-header-color, #453C4F);\n font-size: 1.5rem;\n margin: 0;\n font-weight: normal;\n padding-bottom: 1px;\n}\nheader > div {\n display: flex;\n grid-column: 2;\n justify-self: right;\n margin-right: 1rem;\n}",""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},601:e=>{e.exports=function(e){return e[1]}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={id:n,exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const n=Symbol("addObserver"),o=Symbol("removeObserver"),a=Symbol("getObservers"),i=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function p(e){return new Proxy(e,{get(t,r){if("symbol"==typeof r){switch(r){case i:return!0;case s:return t;case a:return c.has(e);case n:return(t,r)=>{c.has(e)?c.get(e).has(t)?c.get(e).get(t).push(r):c.get(e).set(t,[r]):c.set(e,new Map([[t,[r]]]))};case o:return t=>{c.has(e)&&(c.get(e).delete(t),0===c.get(e).size&&c.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,r)}throw new Error("Unsupported symbol")}if(r in t){if(!Number.isNaN(Number(r)))return"object"==typeof t[r]?p(t[r]):t[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(l.includes(r))return c.has(t)?function(){const e=Array.prototype[r].apply(t,arguments);return c.get(t).forEach(((e,n)=>{e.forEach((e=>{e(t,r,arguments)}))})),e}:Reflect.get(t,r);if(t[r]instanceof Array)return p(t[r])}return Reflect.get(t,r)},set(e,t,r){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,r);if(c.has(e)){c.get(e).forEach(((e,n)=>{e.forEach((e=>{e(t,r)}))}))}return Reflect.set(e,t,r)}})}window.observers=c;class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const h=Symbol("init"),u=Symbol("template"),d=Symbol("style"),f=Symbol("parent");function m(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function y(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function g(e={}){return function(t,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var n,o;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[f]||t.prototype[f][t.prototype[f].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[f]=[t.prototype],t.prototype[d]=e.style?[e.style]:[],t.prototype[u]=e.template||""):(t.prototype[f].push(t.prototype),t.prototype[d].push(e.style),t.prototype[u]=(n=t.prototype[u],(o=e.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,n):`${n}${o||""}`));const a=t.prototype.connectedCallback||(()=>{}),i=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[h]||void 0!==e.template||void 0!==e.style)if(this[h]){if(this[h]&&e.style);else if(this[h]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[u]||"";const r=document.importNode(e.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=t.prototype[d].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),n.appendChild(r)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&r.add(e.localName);const n=Array.from(r.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),o=()=>{this[f].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[y(t)]=!0,e)),{}):{})}))};0===n.length?(this[h]=!0,a.call(this),o()):Promise.all(n).then((()=>{this[h]=!0,a.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));o()}))},t.prototype.disconnectedCallback=function(){i.call(this)},t.prototype.attributeChangedCallback=function(e,t,r){this[y(e)]=r},r.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${r.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function v(e){return!!e&&e.constructor===Array}function b(e,t){e[h]&&e[f].map((r=>{r.render&&r.render.call(e,{[t]:!0})}))}function w(e){return null===e?"null":v(e)?"array":typeof e}function S(e){return function(t,r){const n=r.name,o=Symbol(n),l=Symbol(`${n}:type`),c=Symbol(`${n}:meta`);return r.addInitializer((function(){Reflect.defineProperty(this,n,{get:()=>"object"===this[l]||"array"===this[l]?this[o][i]?this[o]:p(this[o]):this[o],set:t=>{const r=w(e?e(t):t);if("index"!==n&&this[l]!==r&&"null"!==this[l]&&"null"!==r)throw new Error(`@Prop() ${n} with type '${this[l]}' cannot be set to ${r}.`);if("array"===this[l]){if(!v(t))throw new PropError(`Array "${n}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,n)?.set);if(this[o]===t)throw new Error("Setting an array to itself is not allowed.");const e=p(this[o]);if(e[a]){const r=t[i]?(c=t)[i]&&c[s]:t;e.splice(0,this[o].length,...r)}else this[o]=t}else this[o]=e?e(t):t,b(this,n);var c}})})),function(t){if(void 0===t&&"index"!==n)throw new Error(`@Prop() ${n} must have an initial value defined.`);if(void 0!==t&&"index"===n)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${n} boolean must initialize to false.`);if(!r.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,r=m(n);t[n]||(e.observedAttributes.push(r),t[n]=o)}return this[l]=w(t),"array"===this[l]?(this[o]=t,new Proxy(t,{get:(e,t)=>t===x?this[c]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,r)=>{if(t===x)return this[c]=r,!0;const a=Reflect.set(e,t,r);return"length"===t&&this[o].length===r||b(this,n),this[o]=r,a}})):(this[o]=e?e(this.getAttribute(n)??t):this.getAttribute(n)??t,this[o])}}}function E(){return function(e,t){const r=t.name,n=r.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,r,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${n}]`))}})}))}}Symbol("hasProxy");const x=Symbol("meta");var $=r(537),P=function(e,t,r,n,o,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!t&&e?n.static?e:e.prototype:null,h=t||(p?Object.getOwnPropertyDescriptor(p,n.name):{}),u=!1,d=r.length-1;d>=0;d--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var y=(0,r[d])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=i(y.get))&&(h.get=s),(s=i(y.set))&&(h.set=s),(s=i(y.init))&&o.unshift(s)}else(s=i(y))&&("field"===l?o.unshift(s):h[c]=s)}p&&Object.defineProperty(p,n.name,h),u=!0},A=function(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0};(()=>{let e,t,r,n,o,a,i=[g({selector:"pg-header",style:$.A,template:'<header> <a href="/"> <slot name="logo"> <svg viewBox="0 0 24 24"> <path part="path" fill="currentColor" d=""></path> </svg> </slot> <span part="name"></span> </a> <div> <slot name="nav"></slot> <slot name="search"></slot> <slot name="menu"></slot> </div> </header>'})],s=[],l=HTMLElement,c=[],p=[],h=[],u=[],d=[],f=[],m=[],y=[];(class extends l{static{t=this}static{const g="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;r=[S()],n=[S()],o=[E()],a=[E()],P(null,null,r,{kind:"field",name:"logo",static:!1,private:!1,access:{has:e=>"logo"in e,get:e=>e.logo,set:(e,t)=>{e.logo=t}},metadata:g},c,p),P(null,null,n,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:g},h,u),P(null,null,o,{kind:"field",name:"$path",static:!1,private:!1,access:{has:e=>"$path"in e,get:e=>e.$path,set:(e,t)=>{e.$path=t}},metadata:g},d,f),P(null,null,a,{kind:"field",name:"$name",static:!1,private:!1,access:{has:e=>"$name"in e,get:e=>e.$name,set:(e,t)=>{e.$name=t}},metadata:g},m,y),P(null,e={value:t},i,{kind:"class",name:t.name,metadata:g},null,s),t=e.value,g&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g}),A(t,s)}logo=A(this,c,"M0 0h24v24H0V0zm2 2v20h20V2H2z");name=(A(this,p),A(this,h,"Default"));$path=(A(this,u),A(this,d,void 0));$name=(A(this,f),A(this,m,void 0));render(e){e.logo&&this.$path.setAttribute("d",this.logo),e.name&&(this.$name.innerText=this.name)}constructor(){super(...arguments),A(this,y)}})})()})();
|
package/pgIcon.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",o=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),o&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),o&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,o,n,i){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(o)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<t.length;c++){var p=[].concat(t[c]);o&&s[p[0]]||(void 0!==i&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=i),r&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=r):p[2]=r),n&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=n):p[4]="".concat(n)),e.push(p))}},e}},441:(t,e,r)=>{r.d(e,{A:()=>l});var o=r(601),n=r.n(o),i=r(314),s=r.n(i)()(n());s.push([t.id,':host {\n display: inline-flex;\n color: var(--pg-icon-color, #453C4F);\n}\n\n[part="svg"] {\n width: var(--pg-icon-width, 1.5rem);\n height: var(--pg-icon-height, 1.5rem);\n}',""]);var a=new CSSStyleSheet;a.replaceSync(s.toString());const l=a},601:t=>{t.exports=function(t){return t[1]}}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={id:o,exports:{}};return t[o](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const o=Symbol("addObserver"),n=Symbol("removeObserver"),i=Symbol("getObservers"),s=Symbol("isProxy"),a=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function p(t){return new Proxy(t,{get(e,r){if("symbol"==typeof r){switch(r){case s:return!0;case a:return e;case i:return c.has(t);case o:return(e,r)=>{c.has(t)?c.get(t).has(e)?c.get(t).get(e).push(r):c.get(t).set(e,[r]):c.set(t,new Map([[e,[r]]]))};case n:return e=>{c.has(t)&&(c.get(t).delete(e),0===c.get(t).size&&c.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,r)}throw new Error("Unsupported symbol")}if(r in e){if(!Number.isNaN(Number(r)))return"object"==typeof e[r]?p(e[r]):e[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(l.includes(r))return c.has(e)?function(){const t=Array.prototype[r].apply(e,arguments);return c.get(e).forEach(((t,o)=>{t.forEach((t=>{t(e,r,arguments)}))})),t}:Reflect.get(e,r);if(e[r]instanceof Array)return p(e[r])}return Reflect.get(e,r)},set(t,e,r){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,r);if(c.has(t)){c.get(t).forEach(((t,o)=>{t.forEach((t=>{t(e,r)}))}))}return Reflect.set(t,e,r)}})}window.observers=c;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const h=Symbol("init"),u=Symbol("template"),d=Symbol("style"),f=Symbol("parent");function y(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function m(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function v(t={}){return function(e,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var o,n;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[f]||e.prototype[f][e.prototype[f].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[f]=[e.prototype],e.prototype[d]=t.style?[t.style]:[],e.prototype[u]=t.template||""):(e.prototype[f].push(e.prototype),e.prototype[d].push(t.style),e.prototype[u]=(o=e.prototype[u],(n=t.template||null)&&n.match(/<parent\/>/)?n.replace(/<parent\/>/,o):`${o}${n||""}`));const i=e.prototype.connectedCallback||(()=>{}),s=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[h]||void 0!==t.template||void 0!==t.style)if(this[h]){if(this[h]&&t.style);else if(this[h]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[u]||"";const r=document.importNode(t.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=e.prototype[d].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),o.appendChild(r)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&r.add(t.localName);const o=Array.from(r.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),n=()=>{this[f].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[m(e)]=!0,t)),{}):{})}))};0===o.length?(this[h]=!0,i.call(this),n()):Promise.all(o).then((()=>{this[h]=!0,i.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));n()}))},e.prototype.disconnectedCallback=function(){s.call(this)},e.prototype.attributeChangedCallback=function(t,e,r){this[m(t)]=r},r.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${r.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function g(t){return!!t&&t.constructor===Array}function b(t,e){t[h]&&t[f].map((r=>{r.render&&r.render.call(t,{[e]:!0})}))}function w(t){return null===t?"null":g(t)?"array":typeof t}function S(t){return function(e,r){const o=r.name,n=Symbol(o),l=Symbol(`${o}:type`),c=Symbol(`${o}:meta`);return r.addInitializer((function(){Reflect.defineProperty(this,o,{get:()=>"object"===this[l]||"array"===this[l]?this[n][s]?this[n]:p(this[n]):this[n],set:e=>{const r=w(t?t(e):e);if("index"!==o&&this[l]!==r&&"null"!==this[l]&&"null"!==r)throw new Error(`@Prop() ${o} with type '${this[l]}' cannot be set to ${r}.`);if("array"===this[l]){if(!g(e))throw new PropError(`Array "${o}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,o)?.set);if(this[n]===e)throw new Error("Setting an array to itself is not allowed.");const t=p(this[n]);if(t[i]){const r=e[s]?(c=e)[s]&&c[a]:e;t.splice(0,this[n].length,...r)}else this[n]=e}else this[n]=t?t(e):e,b(this,o);var c}})})),function(e){if(void 0===e&&"index"!==o)throw new Error(`@Prop() ${o} must have an initial value defined.`);if(void 0!==e&&"index"===o)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${o} boolean must initialize to false.`);if(!r.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,r=y(o);e[o]||(t.observedAttributes.push(r),e[o]=n)}return this[l]=w(e),"array"===this[l]?(this[n]=e,new Proxy(e,{get:(t,e)=>e===$?this[c]:(console.log("errr???"),Reflect.get(this[n],e)),set:(t,e,r)=>{if(e===$)return this[c]=r,!0;const i=Reflect.set(t,e,r);return"length"===e&&this[n].length===r||b(this,o),this[n]=r,i}})):(this[n]=t?t(this.getAttribute(o)??e):this.getAttribute(o)??e,this[n])}}}function E(){return function(t,e){const r=e.name,o=r.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,r,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${o}]`))}})}))}}Symbol("hasProxy");const $=Symbol("meta");var P=r(441),x=function(t,e,r,o,n,i){function s(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=o.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?o.static?t:t.prototype:null,h=e||(p?Object.getOwnPropertyDescriptor(p,o.name):{}),u=!1,d=r.length-1;d>=0;d--){var f={};for(var y in o)f[y]="access"===y?{}:o[y];for(var y in o.access)f.access[y]=o.access[y];f.addInitializer=function(t){if(u)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(t||null))};var m=(0,r[d])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=s(m.get))&&(h.get=a),(a=s(m.set))&&(h.set=a),(a=s(m.init))&&n.unshift(a)}else(a=s(m))&&("field"===l?n.unshift(a):h[c]=a)}p&&Object.defineProperty(p,o.name,h),u=!0},A=function(t,e,r){for(var o=arguments.length>2,n=0;n<e.length;n++)r=o?e[n].call(t,r):e[n].call(t);return o?r:void 0};(()=>{let t,e,r,o,n,i=[v({selector:"pg-icon",style:P.A,template:'<svg part="svg" viewBox="0 0 24 24"> <path part="path" fill="currentColor" d="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"/> </svg>'})],s=[],a=HTMLElement,l=[],c=[],p=[],h=[],u=[],d=[];(class extends a{static{e=this}static{const f="function"==typeof Symbol&&Symbol.metadata?Object.create(a[Symbol.metadata]??null):void 0;r=[S()],o=[E()],n=[E()],x(null,null,r,{kind:"field",name:"path",static:!1,private:!1,access:{has:t=>"path"in t,get:t=>t.path,set:(t,e)=>{t.path=e}},metadata:f},l,c),x(null,null,o,{kind:"field",name:"$svg",static:!1,private:!1,access:{has:t=>"$svg"in t,get:t=>t.$svg,set:(t,e)=>{t.$svg=e}},metadata:f},p,h),x(null,null,n,{kind:"field",name:"$path",static:!1,private:!1,access:{has:t=>"$path"in t,get:t=>t.$path,set:(t,e)=>{t.$path=e}},metadata:f},u,d),x(null,t={value:e},i,{kind:"class",name:e.name,metadata:f},null,s),e=t.value,f&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:f}),A(e,s)}path=A(this,l,"M0 0h24v24H0V0zm2 2v20h20V2H2z");$svg=(A(this,c),A(this,p,void 0));$path=(A(this,h),A(this,u,void 0));render(t){if(t.path){const t=getComputedStyle(this).getPropertyValue("--pg-icon-viewbox");if(this.$svg.setAttribute("viewBox",t||"0 0 24 24"),!this.path)throw new Error("invalid path set on pg-icon");this.$path.setAttribute("d",this.path)}}constructor(){super(...arguments),A(this,d)}})})()})();
|
package/pgInputCheck.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var t={175:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(601),o=n.n(r),a=n(314),i=n.n(a)()(o());i.push([t.id,':host {\n display: inline-flex;\n}\n\n.blank {\n color: var(--pg-input-check-blank-color, #453C4F);\n}\n.blank [part="check"] {\n visibility: hidden;\n}\n\n.checked {\n color: var(--pg-input-check-checked-color, #453C4F);\n}\n\n[part="button"] {\n display: flex;\n padding: 0;\n border: 0;\n outline: 0;\n border-radius: 0.25rem;\n background: transparent;\n}\n\n[part="svg"] {\n width: var(--pg-icon-check-size, 1.5rem);\n height: var(--pg-icon-check-size, 1.5rem);\n}\n\n[part="button"]:not(:hover):active {\n box-shadow: 0 0 0 3px var(--pg-input-check-active-glow, rgb(79, 143, 249, 0.6));\n}\n[part="button"]:not(:hover):focus:not(:focus-visible) {\n box-shadow: none;\n}\n[part="button"]:not(:hover):focus {\n box-shadow: 0 0 0 3px var(--pg-input-check-focus-glow, rgb(79, 143, 249, 0.5));\n}\n[part="button"]:not(:disabled):hover [part="path"] {\n fill: #4f8ff9;\n}\n\n[part="button"]:disabled {\n color: #AAA;\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,o,a){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<t.length;c++){var u=[].concat(t[c]);r&&i[u[0]]||(void 0!==a&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=a),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},601:t=>{t.exports=function(t){return t[1]}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var a=e[r]={id:r,exports:{}};return t[r](a,a.exports,n),a.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const r=Symbol("addObserver"),o=Symbol("removeObserver"),a=Symbol("getObservers"),i=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function u(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case i:return!0;case s:return e;case a:return c.has(t);case r:return(e,n)=>{c.has(t)?c.get(t).has(e)?c.get(t).get(e).push(n):c.get(t).set(e,[n]):c.set(t,new Map([[e,[n]]]))};case o:return e=>{c.has(t)&&(c.get(t).delete(e),0===c.get(t).size&&c.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,n)}throw new Error("Unsupported symbol")}if(n in e){if(!Number.isNaN(Number(n)))return"object"==typeof e[n]?u(e[n]):e[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return c.get(e).forEach(((t,r)=>{t.forEach((t=>{t(e,n,arguments)}))})),t}:Reflect.get(e,n);if(e[n]instanceof Array)return u(e[n])}return Reflect.get(e,n)},set(t,e,n){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,n);if(c.has(t)){c.get(t).forEach(((t,r)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=c;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const p=Symbol("init"),h=Symbol("template"),d=Symbol("style"),f=Symbol("parent");function y(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function b(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function m(t={}){return function(e,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,o;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[f]||e.prototype[f][e.prototype[f].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[f]=[e.prototype],e.prototype[d]=t.style?[t.style]:[],e.prototype[h]=t.template||""):(e.prototype[f].push(e.prototype),e.prototype[d].push(t.style),e.prototype[h]=(r=e.prototype[h],(o=t.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,r):`${r}${o||""}`));const a=e.prototype.connectedCallback||(()=>{}),i=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[p]||void 0!==t.template||void 0!==t.style)if(this[p]){if(this[p]&&t.style);else if(this[p]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[h]||"";const n=document.importNode(t.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=e.prototype[d].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),r.appendChild(n)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&n.add(t.localName);const r=Array.from(n.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),o=()=>{this[f].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[b(e)]=!0,t)),{}):{})}))};0===r.length?(this[p]=!0,a.call(this),o()):Promise.all(r).then((()=>{this[p]=!0,a.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));o()}))},e.prototype.disconnectedCallback=function(){i.call(this)},e.prototype.attributeChangedCallback=function(t,e,n){this[b(t)]=n},n.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${n.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function v(t){return!!t&&t.constructor===Array}function g(t,e){t[p]&&t[f].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function w(t){return null===t?"null":v(t)?"array":typeof t}function S(t){return function(e,n){const r=n.name,o=Symbol(r),l=Symbol(`${r}:type`),c=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[l]||"array"===this[l]?this[o][i]?this[o]:u(this[o]):this[o],set:e=>{const n=w(t?t(e):e);if("index"!==r&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!v(e))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[o]===e)throw new Error("Setting an array to itself is not allowed.");const t=u(this[o]);if(t[a]){const n=e[i]?(c=e)[i]&&c[s]:e;t.splice(0,this[o].length,...n)}else this[o]=e}else this[o]=t?t(e):e,g(this,r);var c}})})),function(e){if(void 0===e&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==e&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,n=y(r);e[r]||(t.observedAttributes.push(n),e[r]=o)}return this[l]=w(e),"array"===this[l]?(this[o]=e,new Proxy(e,{get:(t,e)=>e===k?this[c]:(console.log("errr???"),Reflect.get(this[o],e)),set:(t,e,n)=>{if(e===k)return this[c]=n,!0;const a=Reflect.set(t,e,n);return"length"===e&&this[o].length===n||g(this,r),this[o]=n,a}})):(this[o]=t?t(this.getAttribute(r)??e):this.getAttribute(r)??e,this[o])}}}function E(){return function(t,e){const n=e.name,r=n.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,n,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}Symbol("hasProxy");const k=Symbol("meta");var C=n(175),$=function(t,e,n,r,o,a){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?r.static?t:t.prototype:null,p=e||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var f={};for(var y in r)f[y]="access"===y?{}:r[y];for(var y in r.access)f.access[y]=r.access[y];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(t||null))};var b=(0,n[d])("accessor"===l?{get:p.get,set:p.set}:p[c],f);if("accessor"===l){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(s=i(b.get))&&(p.get=s),(s=i(b.set))&&(p.set=s),(s=i(b.init))&&o.unshift(s)}else(s=i(b))&&("field"===l?o.unshift(s):p[c]=s)}u&&Object.defineProperty(u,r.name,p),h=!0},x=function(t,e,n){for(var r=arguments.length>2,o=0;o<e.length;o++)n=r?e[o].call(t,n):e[o].call(t);return r?n:void 0};(()=>{let t,e,n,r,o,a,i=[m({selector:"pg-input-check",style:C.A,template:'<button part="button"> <svg part="svg" viewBox="0 0 24 24"> <path part="path" fill="currentColor" d="M19 19L5 19V5H15V3H5C3.89 3 3 3.89 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V11H19"/> <path part="check" fill="currentColor" d="M7.91 10.08L6.5 11.5L11 16L21 6L19.59 4.58L11 13.17L7.91 10.08Z"/> </svg> </button>'})],s=[],l=HTMLElement,c=[],u=[],p=[],h=[],d=[],f=[],y=[],b=[];(class extends l{static{e=this}static{const m="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;n=[S()],r=[S()],o=[E()],a=[E()],$(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:m},c,u),$(null,null,r,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:t=>"disabled"in t,get:t=>t.disabled,set:(t,e)=>{t.disabled=e}},metadata:m},p,h),$(null,null,o,{kind:"field",name:"$button",static:!1,private:!1,access:{has:t=>"$button"in t,get:t=>t.$button,set:(t,e)=>{t.$button=e}},metadata:m},d,f),$(null,null,a,{kind:"field",name:"$path",static:!1,private:!1,access:{has:t=>"$path"in t,get:t=>t.$path,set:(t,e)=>{t.$path=e}},metadata:m},y,b),$(null,t={value:e},i,{kind:"class",name:e.name,metadata:m},null,s),e=t.value,m&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:m}),x(e,s)}value=x(this,c,!1);disabled=(x(this,u),x(this,p,!1));$button=(x(this,h),x(this,d,void 0));$path=(x(this,f),x(this,y,void 0));connectedCallback(){this.$button.addEventListener("click",this.handleClick.bind(this))}handleClick(){const t=[!0,"true"].includes(this.value);this.value=!t,this.dispatchEvent(new CustomEvent("change"))}render(t){if(t.value){const t=[!0,"true"].includes(this.value);this.$path.setAttribute("d",t?"M19 19L5 19V5H15V3H5C3.89 3 3 3.89 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V11H19":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z"),this.$button.classList.toggle("blank",!t),this.$button.classList.toggle("checked",t)}t.disabled&&(this.$button.disabled=["",!0,"true"].includes(this.disabled))}constructor(){super(...arguments),x(this,b)}})})()})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,o,i){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(s[l]=!0)}for(var c=0;c<t.length;c++){var p=[].concat(t[c]);r&&s[p[0]]||(void 0!==i&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=i),n&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=n):p[2]=n),o&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=o):p[4]="".concat(o)),e.push(p))}},e}},359:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(601),o=n.n(r),i=n(314),s=n.n(i)()(o());s.push([t.id,':host {\n display: flex;\n flex-direction: column;\n}\n\n.blank {\n color: var(--pg-input-check-blank-color, #453C4F);\n}\n.blank [part="check"] {\n visibility: hidden;\n}\n\n.checked {\n color: var(--pg-input-check-checked-color, #453C4F);\n}\n\n[part="list"] {\n display: flex;\n flex-direction: column;\n list-style: none;\n margin: 0;\n padding: 0.25rem 0;\n}\n\n[part="list"] li {\n display: flex;\n flex-direction: column;\n}\n\n[part="list"] li:not(:last-child) {\n margin-bottom: 0.25rem;\n}\n\n[part="list"] button {\n display: flex;\n padding: 0;\n border: 0;\n outline: 0;\n border-radius: 0.25rem;\n align-items: center;\n background: transparent;\n}\n\n[part="svg"] {\n width: var(--pg-icon-check-size, 1.5rem);\n height: var(--pg-icon-check-size, 1.5rem);\n}\n\n[part="list"] button span {\n margin-left: 0.25rem;\n}\n\n[part="list"] button:not(:hover):active {\n box-shadow: 0 0 0 3px var(--pg-input-check-active-glow, rgb(79, 143, 249, 0.6));\n}\n[part="list"] button:not(:hover):focus:not(:focus-visible) {\n box-shadow: none;\n}\n[part="list"] button:not(:hover):focus-visible {\n box-shadow: 0 0 0 3px var(--pg-input-check-focus-glow, rgb(79, 143, 249, 0.5));\n}\n[part="list"] button:not(:disabled):hover [part="path"] {\n fill: #4f8ff9;\n}\n[part="list"] button:not(:disabled):hover span {\n color: #4f8ff9;\n}\n[part="list"] button:disabled {\n color: #AAA;\n}',""]);var a=new CSSStyleSheet;a.replaceSync(s.toString());const l=a},601:t=>{t.exports=function(t){return t[1]}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,exports:{}};return t[r](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const r=Symbol("addObserver"),o=Symbol("removeObserver"),i=Symbol("getObservers"),s=Symbol("isProxy"),a=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function p(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case s:return!0;case a:return e;case i:return c.has(t);case r:return(e,n)=>{c.has(t)?c.get(t).has(e)?c.get(t).get(e).push(n):c.get(t).set(e,[n]):c.set(t,new Map([[e,[n]]]))};case o:return e=>{c.has(t)&&(c.get(t).delete(e),0===c.get(t).size&&c.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,n)}throw new Error("Unsupported symbol")}if(n in e){if(!Number.isNaN(Number(n)))return"object"==typeof e[n]?p(e[n]):e[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return c.get(e).forEach(((t,r)=>{t.forEach((t=>{t(e,n,arguments)}))})),t}:Reflect.get(e,n);if(e[n]instanceof Array)return p(e[n])}return Reflect.get(e,n)},set(t,e,n){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,n);if(c.has(t)){c.get(t).forEach(((t,r)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=c;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const u=Symbol("init"),h=Symbol("template"),d=Symbol("style"),f=Symbol("parent");function y(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function m(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function b(t={}){return function(e,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,o;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[f]||e.prototype[f][e.prototype[f].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[f]=[e.prototype],e.prototype[d]=t.style?[t.style]:[],e.prototype[h]=t.template||""):(e.prototype[f].push(e.prototype),e.prototype[d].push(t.style),e.prototype[h]=(r=e.prototype[h],(o=t.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,r):`${r}${o||""}`));const i=e.prototype.connectedCallback||(()=>{}),s=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[u]||void 0!==t.template||void 0!==t.style)if(this[u]){if(this[u]&&t.style);else if(this[u]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[h]||"";const n=document.importNode(t.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=e.prototype[d].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),r.appendChild(n)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&n.add(t.localName);const r=Array.from(n.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),o=()=>{this[f].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[m(e)]=!0,t)),{}):{})}))};0===r.length?(this[u]=!0,i.call(this),o()):Promise.all(r).then((()=>{this[u]=!0,i.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));o()}))},e.prototype.disconnectedCallback=function(){s.call(this)},e.prototype.attributeChangedCallback=function(t,e,n){this[m(t)]=n},n.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${n.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function v(t){return!!t&&t.constructor===Array}function g(t,e){t[u]&&t[f].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function w(t){return null===t?"null":v(t)?"array":typeof t}function S(t){return function(e,n){const r=n.name,o=Symbol(r),l=Symbol(`${r}:type`),c=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[l]||"array"===this[l]?this[o][s]?this[o]:p(this[o]):this[o],set:e=>{const n=w(t?t(e):e);if("index"!==r&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!v(e))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[o]===e)throw new Error("Setting an array to itself is not allowed.");const t=p(this[o]);if(t[i]){const n=e[s]?(c=e)[s]&&c[a]:e;t.splice(0,this[o].length,...n)}else this[o]=e}else this[o]=t?t(e):e,g(this,r);var c}})})),function(e){if(void 0===e&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==e&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,n=y(r);e[r]||(t.observedAttributes.push(n),e[r]=o)}return this[l]=w(e),"array"===this[l]?(this[o]=e,new Proxy(e,{get:(t,e)=>e===E?this[c]:(console.log("errr???"),Reflect.get(this[o],e)),set:(t,e,n)=>{if(e===E)return this[c]=n,!0;const i=Reflect.set(t,e,n);return"length"===e&&this[o].length===n||g(this,r),this[o]=n,i}})):(this[o]=t?t(this.getAttribute(r)??e):this.getAttribute(r)??e,this[o])}}}Symbol("hasProxy");const E=Symbol("meta");var x=n(359);var k=function(t,e,n,r,o,i){function s(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?r.static?t:t.prototype:null,u=e||(p?Object.getOwnPropertyDescriptor(p,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var f={};for(var y in r)f[y]="access"===y?{}:r[y];for(var y in r.access)f.access[y]=r.access[y];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(t||null))};var m=(0,n[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=s(m.get))&&(u.get=a),(a=s(m.set))&&(u.set=a),(a=s(m.init))&&o.unshift(a)}else(a=s(m))&&("field"===l?o.unshift(a):u[c]=a)}p&&Object.defineProperty(p,r.name,u),h=!0},A=function(t,e,n){for(var r=arguments.length>2,o=0;o<e.length;o++)n=r?e[o].call(t,n):e[o].call(t);return r?n:void 0};(()=>{let t,e,n,r,o,i=[b({selector:"pg-input-check-list",style:x.A,template:'<ul part="list"></ul>'})],s=[],a=HTMLElement,l=[],c=[],p=[],u=[],h=[],d=[];(class extends a{static{e=this}static{const f="function"==typeof Symbol&&Symbol.metadata?Object.create(a[Symbol.metadata]??null):void 0;n=[S()],r=[S()],o=[function(t,e){const n=e.name,r=n.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,n,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}],k(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:f},l,c),k(null,null,r,{kind:"field",name:"options",static:!1,private:!1,access:{has:t=>"options"in t,get:t=>t.options,set:(t,e)=>{t.options=e}},metadata:f},p,u),k(null,null,o,{kind:"field",name:"$list",static:!1,private:!1,access:{has:t=>"$list"in t,get:t=>t.$list,set:(t,e)=>{t.$list=e}},metadata:f},h,d),k(null,t={value:e},i,{kind:"class",name:e.name,metadata:f},null,s),e=t.value,f&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:f}),A(e,s)}value=A(this,l,[]);options=(A(this,c),A(this,p,[]));$list=(A(this,u),A(this,h,void 0));connectedCallback(){}handleClick(t){const e=this.value.includes(t.value),n=function(t,e,n){return Array.from(t.children).find((t=>t.dataset.key===e[n]))}(this.$list,t,"value"),r=n.querySelector("button");r?.classList.toggle("blank",e),r?.classList.toggle("checked",!e),n.querySelector('[part="path"]')?.setAttribute("d",e?"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z":"M19 19L5 19V5H15V3H5C3.89 3 3 3.89 3 5V19C3 20.1 3.89 21 5 21H19C20.1 21 21 20.1 21 19V11H19"),e?this.value.splice(this.value.findIndex((e=>e===t.value)),1):this.value.push(t.value),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value}}))}render(t){t.options,t.value}constructor(){super(...arguments),A(this,d)}})})()})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(n)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var p=[].concat(e[c]);n&&a[p[0]]||(void 0!==i&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=i),r&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=r):p[2]=r),o&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=o):p[4]="".concat(o)),t.push(p))}},t}},601:e=>{e.exports=function(e){return e[1]}},945:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(601),o=r.n(n),i=r(314),a=r.n(i)()(o());a.push([e.id,':host {\n display: block;\n}\n\n[part="label"] {\n display: grid;\n grid-template-columns: 1.5rem auto;\n grid-template-rows: auto;\n font-family: var(--pg-font-family);\n font-size: 1rem;\n line-height: 1.5rem;\n border: 1px solid var(--pg-button-border-color, #453C4F);\n background-color: var(--pg-button-background-color, #fff);\n color: var(--pg-button-color, #453C4F);\n padding: var(--pg-button-padding, 0.25rem 0.5rem);\n border-radius: 0.25rem;\n outline: none;\n --pg-icon-color: var(--pg-button-color, #453C4F);\n}\n\n[part="label"]:hover {\n border: 1px solid var(--pg-button-hover-border-color, #453C4F);\n background-color: var(--pg-button-hover-background-color, #453C4F);\n color: var(--pg-button-hover-color, #fff);\n --pg-icon-color: var(--pg-button-hover-color, #fff);\n}\n\n[part="label"]:active {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n position: relative;\n}\n\n[part="label"]:focus {\n position: relative;\n}\n\n[part="label"]:active::before {\n content: \'\';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: 0.25rem;\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.6));\n}\n\n[part="label"]:focus::before {\n pointer-events: none;\n content: \'\';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: 0.25rem;\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.5));\n}\n\n[part="file"] {\n width: 100%;\n border: 0;\n outline: 0;\n height: 1.5rem;\n grid-row: 1;\n grid-column: 1 / span 2;\n visibility: hidden;\n}\n\n[part="icon"] {\n grid-row: 1;\n grid-column: 1;\n transform: translate(-0.25rem, 0.075rem);\n pointer-events: none;\n}\n\n[part="text"] {\n grid-row: 1;\n grid-column: 2;\n pointer-events: none;\n}',""]);var s=new CSSStyleSheet;s.replaceSync(a.toString());const l=s}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const n=Symbol("addObserver"),o=Symbol("removeObserver"),i=Symbol("getObservers"),a=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function p(e){return new Proxy(e,{get(t,r){if("symbol"==typeof r){switch(r){case a:return!0;case s:return t;case i:return c.has(e);case n:return(t,r)=>{c.has(e)?c.get(e).has(t)?c.get(e).get(t).push(r):c.get(e).set(t,[r]):c.set(e,new Map([[t,[r]]]))};case o:return t=>{c.has(e)&&(c.get(e).delete(t),0===c.get(e).size&&c.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,r)}throw new Error("Unsupported symbol")}if(r in t){if(!Number.isNaN(Number(r)))return"object"==typeof t[r]?p(t[r]):t[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(l.includes(r))return c.has(t)?function(){const e=Array.prototype[r].apply(t,arguments);return c.get(t).forEach(((e,n)=>{e.forEach((e=>{e(t,r,arguments)}))})),e}:Reflect.get(t,r);if(t[r]instanceof Array)return p(t[r])}return Reflect.get(t,r)},set(e,t,r){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,r);if(c.has(e)){c.get(e).forEach(((e,n)=>{e.forEach((e=>{e(t,r)}))}))}return Reflect.set(e,t,r)}})}window.observers=c;class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const u=Symbol("init"),d=Symbol("template"),f=Symbol("style"),h=Symbol("parent");function m(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function y(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function b(e={}){return function(t,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var n,o;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[h]||t.prototype[h][t.prototype[h].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[h]=[t.prototype],t.prototype[f]=e.style?[e.style]:[],t.prototype[d]=e.template||""):(t.prototype[h].push(t.prototype),t.prototype[f].push(e.style),t.prototype[d]=(n=t.prototype[d],(o=e.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,n):`${n}${o||""}`));const i=t.prototype.connectedCallback||(()=>{}),a=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[u]||void 0!==e.template||void 0!==e.style)if(this[u]){if(this[u]&&e.style);else if(this[u]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[d]||"";const r=document.importNode(e.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=t.prototype[f].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),n.appendChild(r)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&r.add(e.localName);const n=Array.from(r.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),o=()=>{this[h].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[y(t)]=!0,e)),{}):{})}))};0===n.length?(this[u]=!0,i.call(this),o()):Promise.all(n).then((()=>{this[u]=!0,i.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));o()}))},t.prototype.disconnectedCallback=function(){a.call(this)},t.prototype.attributeChangedCallback=function(e,t,r){this[y(e)]=r},r.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${r.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function g(e){return!!e&&e.constructor===Array}function v(e,t){e[u]&&e[h].map((r=>{r.render&&r.render.call(e,{[t]:!0})}))}function w(e){return null===e?"null":g(e)?"array":typeof e}function S(e){return function(t,r){const n=r.name,o=Symbol(n),l=Symbol(`${n}:type`),c=Symbol(`${n}:meta`);return r.addInitializer((function(){Reflect.defineProperty(this,n,{get:()=>"object"===this[l]||"array"===this[l]?this[o][a]?this[o]:p(this[o]):this[o],set:t=>{const r=w(e?e(t):t);if("index"!==n&&this[l]!==r&&"null"!==this[l]&&"null"!==r)throw new Error(`@Prop() ${n} with type '${this[l]}' cannot be set to ${r}.`);if("array"===this[l]){if(!g(t))throw new PropError(`Array "${n}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,n)?.set);if(this[o]===t)throw new Error("Setting an array to itself is not allowed.");const e=p(this[o]);if(e[i]){const r=t[a]?(c=t)[a]&&c[s]:t;e.splice(0,this[o].length,...r)}else this[o]=t}else this[o]=e?e(t):t,v(this,n);var c}})})),function(t){if(void 0===t&&"index"!==n)throw new Error(`@Prop() ${n} must have an initial value defined.`);if(void 0!==t&&"index"===n)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${n} boolean must initialize to false.`);if(!r.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,r=m(n);t[n]||(e.observedAttributes.push(r),t[n]=o)}return this[l]=w(t),"array"===this[l]?(this[o]=t,new Proxy(t,{get:(e,t)=>t===E?this[c]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,r)=>{if(t===E)return this[c]=r,!0;const i=Reflect.set(e,t,r);return"length"===t&&this[o].length===r||v(this,n),this[o]=r,i}})):(this[o]=e?e(this.getAttribute(n)??t):this.getAttribute(n)??t,this[o])}}}Symbol("hasProxy");const E=Symbol("meta");var x=r(945),$=function(e,t,r,n,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!t&&e?n.static?e:e.prototype:null,u=t||(p?Object.getOwnPropertyDescriptor(p,n.name):{}),d=!1,f=r.length-1;f>=0;f--){var h={};for(var m in n)h[m]="access"===m?{}:n[m];for(var m in n.access)h.access[m]=n.access[m];h.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var y=(0,r[f])("accessor"===l?{get:u.get,set:u.set}:u[c],h);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=a(y.get))&&(u.get=s),(s=a(y.set))&&(u.set=s),(s=a(y.init))&&o.unshift(s)}else(s=a(y))&&("field"===l?o.unshift(s):u[c]=s)}p&&Object.defineProperty(p,n.name,u),d=!0},C=function(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0};(()=>{let e,t,r,n,o=[b({selector:"pg-input-file-local",style:x.A,template:'<label part="label"> <input type="file" part="file"/> <svg part="icon" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z"/></svg> <span part="text">Upload a File...</span> </label>'})],i=[],a=HTMLElement,s=[],l=[],c=[],p=[];(class extends a{static{t=this}static{const u="function"==typeof Symbol&&Symbol.metadata?Object.create(a[Symbol.metadata]??null):void 0;r=[S()],n=[function(e,t){const r=t.name,n=r.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,r,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${n}]`))}})}))}],$(null,null,r,{kind:"field",name:"acceptsFileType",static:!1,private:!1,access:{has:e=>"acceptsFileType"in e,get:e=>e.acceptsFileType,set:(e,t)=>{e.acceptsFileType=t}},metadata:u},s,l),$(null,null,n,{kind:"field",name:"$file",static:!1,private:!1,access:{has:e=>"$file"in e,get:e=>e.$file,set:(e,t)=>{e.$file=t}},metadata:u},c,p),$(null,e={value:t},o,{kind:"class",name:t.name,metadata:u},null,i),t=e.value,u&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:u}),C(t,i)}acceptsFileType=C(this,s,"");$file=(C(this,l),C(this,c,void 0));connectedCallback(){this.$file.addEventListener("change",(()=>{if(null!==this.$file.files&&0!==this.$file.files.length){var e=this.$file.files[0];if(this.acceptsFileType){var t=this.acceptsFileType.split(",").join("|"),r=new RegExp(`(${t})$`,"i");if(null===e.name.match(r))return void alert(`${this.acceptsFileType} file only`)}var n=new FileReader;n.addEventListener("loadstart",(function(){})),n.addEventListener("load",(t=>{var r=t.target.result;this.dispatchEvent(new CustomEvent("change",{detail:{value:r,name:e.name}}))})),n.addEventListener("error",(function(){alert("Error : Failed to read file")})),n.addEventListener("progress",(function(e){if(1==e.lengthComputable)Math.floor(e.loaded/e.total*100)})),n.readAsText(e)}else alert("Error : No file selected")}))}render(e){}constructor(){super(...arguments),C(this,p)}})})()})();
|
package/pgInputHexRgb.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&a[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),t.push(u))}},t}},457:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),i=n.n(r),o=n(314),a=n.n(o)()(i());a.push([e.id,':host {\n display: block;\n}\n\n:host > div {\n display: grid;\n grid-template-rows: auto 1rem 2rem 1rem 2rem 1rem 2rem;\n grid-template-rows: 1fr;\n}\n\n[part~="hex"] {\n grid-row: 1;\n grid-column: 1;\n}\n\n[part~="labelRed"] {\n grid-row: 1;\n grid-column: 2;\n background: red;\n}\n\n[part~="red"] {\n grid-row: 1;\n grid-column: 3;\n}\n\n[part~="labelGreen"] {\n grid-row: 1;\n grid-column: 4;\n background: green;\n color: white;\n}\n\n[part~="green"] {\n grid-row: 1;\n grid-column: 5;\n}\n\n[part~="labelBlue"] {\n grid-row: 1;\n grid-column: 6;\n background: blue;\n color: white;\n}\n\n[part~="blue"] {\n grid-row: 1;\n grid-column: 7;\n}\n\n[part~="labelRed"],\n[part~="labelGreen"],\n[part~="labelBlue"] {\n display: flex;\n margin-left: 0.25rem;\n align-items: center;\n justify-content: center;\n border-radius: 0.25rem 0 0 0.25rem;\n color: white;\n min-width: 1rem;\n}\n\n[part~="hex"] {\n border-radius: 0.25rem;\n min-width: 4rem;\n}\n\n[part~="hex"],\n[part~="red"],\n[part~="green"],\n[part~="blue"] {\n outline: none;\n font-size: 1rem;\n padding: 0.25rem 0.5rem;\n border: 0;\n width: calc(100% - 1rem);\n}\n\n[part~="red"],\n[part~="green"],\n[part~="blue"] {\n border-radius: 0 0.25rem 0.25rem 0;\n -moz-appearance: textfield;\n width: calc(100% - 1rem);\n min-width: 2rem;\n}\n\n[part~="red"]::-webkit-inner-spin-button,\n[part~="red"]::-webkit-outer-spin-button,\n[part~="green"]::-webkit-inner-spin-button,\n[part~="green"]::-webkit-outer-spin-button,\n[part~="blue"]::-webkit-inner-spin-button,\n[part~="blue"]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}',""]);var s=new CSSStyleSheet;s.replaceSync(a.toString());const l=s},601:e=>{e.exports=function(e){return e[1]}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const r=Symbol("addObserver"),i=Symbol("removeObserver"),o=Symbol("getObservers"),a=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function u(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case a:return!0;case s:return t;case o:return c.has(e);case r:return(t,n)=>{c.has(e)?c.get(e).has(t)?c.get(e).get(t).push(n):c.get(e).set(t,[n]):c.set(e,new Map([[t,[n]]]))};case i:return t=>{c.has(e)&&(c.get(e).delete(t),0===c.get(e).size&&c.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,n)}throw new Error("Unsupported symbol")}if(n in t){if(!Number.isNaN(Number(n)))return"object"==typeof t[n]?u(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return c.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return u(t[n])}return Reflect.get(t,n)},set(e,t,n){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,n);if(c.has(e)){c.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=c;class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const p=Symbol("init"),d=Symbol("template"),h=Symbol("style"),m=Symbol("parent");function f(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function b(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function g(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,i;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[m]||t.prototype[m][t.prototype[m].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[m]=[t.prototype],t.prototype[h]=e.style?[e.style]:[],t.prototype[d]=e.template||""):(t.prototype[m].push(t.prototype),t.prototype[h].push(e.style),t.prototype[d]=(r=t.prototype[d],(i=e.template||null)&&i.match(/<parent\/>/)?i.replace(/<parent\/>/,r):`${r}${i||""}`));const o=t.prototype.connectedCallback||(()=>{}),a=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[p]||void 0!==e.template||void 0!==e.style)if(this[p]){if(this[p]&&e.style);else if(this[p]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[d]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[h].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),r.appendChild(n)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&n.add(e.localName);const r=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),i=()=>{this[m].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[b(t)]=!0,e)),{}):{})}))};0===r.length?(this[p]=!0,o.call(this),i()):Promise.all(r).then((()=>{this[p]=!0,o.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));i()}))},t.prototype.disconnectedCallback=function(){a.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[b(e)]=n},n.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${n.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function y(e){return!!e&&e.constructor===Array}function v(e,t){e[p]&&e[m].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function w(e){return null===e?"null":y(e)?"array":typeof e}function $(e){return function(t,n){const r=n.name,i=Symbol(r),l=Symbol(`${r}:type`),c=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[l]||"array"===this[l]?this[i][a]?this[i]:u(this[i]):this[i],set:t=>{const n=w(e?e(t):t);if("index"!==r&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!y(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[i]===t)throw new Error("Setting an array to itself is not allowed.");const e=u(this[i]);if(e[o]){const n=t[a]?(c=t)[a]&&c[s]:t;e.splice(0,this[i].length,...n)}else this[i]=t}else this[i]=e?e(t):t,v(this,r);var c}})})),function(t){if(void 0===t&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==t&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=f(r);t[r]||(e.observedAttributes.push(n),t[r]=i)}return this[l]=w(t),"array"===this[l]?(this[i]=t,new Proxy(t,{get:(e,t)=>t===x?this[c]:(console.log("errr???"),Reflect.get(this[i],t)),set:(e,t,n)=>{if(t===x)return this[c]=n,!0;const o=Reflect.set(e,t,n);return"length"===t&&this[i].length===n||v(this,r),this[i]=n,o}})):(this[i]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[i])}}}function S(){return function(e,t){const n=t.name,r=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}Symbol("hasProxy");const x=Symbol("meta");function E(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function k(e){const t=e.toUpperCase();return 7===t.length?t:4===t.length?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:"#000000"}function P(e){var t=e.toString(16);return 1==t.length?"0"+t:t}function R(e,t,n){return"#"+P(e)+P(t)+P(n)}var A=n(457),C=function(e,t,n,r,i,o){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,p=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,h=n.length-1;h>=0;h--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(a(e||null))};var b=(0,n[h])("accessor"===l?{get:p.get,set:p.set}:p[c],m);if("accessor"===l){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(s=a(b.get))&&(p.get=s),(s=a(b.set))&&(p.set=s),(s=a(b.init))&&i.unshift(s)}else(s=a(b))&&("field"===l?i.unshift(s):p[c]=s)}u&&Object.defineProperty(u,r.name,p),d=!0},O=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0};(()=>{let e,t,n,r,i,o,a,s=[g({selector:"pg-input-hex-rgb",style:A.A,template:'<div> <input part="hex" type="text"/> <label part="labelRed">R</label> <input part="red" type="number" step="1" min="0" max="255"/> <label part="labelGreen">G</label> <input part="green" type="number" step="1" min="0" max="255"/> <label part="labelBlue">B</label> <input part="blue" type="number" step="1" min="0" max="255"/> </div>'})],l=[],c=HTMLElement,u=[],p=[],d=[],h=[],m=[],f=[],b=[],y=[],v=[],w=[];(class extends c{static{t=this}static{const g="function"==typeof Symbol&&Symbol.metadata?Object.create(c[Symbol.metadata]??null):void 0;n=[$()],r=[S()],i=[S()],o=[S()],a=[S()],C(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:g},u,p),C(null,null,r,{kind:"field",name:"$hex",static:!1,private:!1,access:{has:e=>"$hex"in e,get:e=>e.$hex,set:(e,t)=>{e.$hex=t}},metadata:g},d,h),C(null,null,i,{kind:"field",name:"$red",static:!1,private:!1,access:{has:e=>"$red"in e,get:e=>e.$red,set:(e,t)=>{e.$red=t}},metadata:g},m,f),C(null,null,o,{kind:"field",name:"$green",static:!1,private:!1,access:{has:e=>"$green"in e,get:e=>e.$green,set:(e,t)=>{e.$green=t}},metadata:g},b,y),C(null,null,a,{kind:"field",name:"$blue",static:!1,private:!1,access:{has:e=>"$blue"in e,get:e=>e.$blue,set:(e,t)=>{e.$blue=t}},metadata:g},v,w),C(null,e={value:t},s,{kind:"class",name:t.name,metadata:g},null,l),t=e.value,g&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g}),O(t,l)}value=O(this,u,"#000000");$hex=(O(this,p),O(this,d,void 0));$red=(O(this,h),O(this,m,void 0));$green=(O(this,f),O(this,b,void 0));$blue=(O(this,y),O(this,v,void 0));connectedCallback(){this.$hex.value=this.value,this.updateRgb(),this.$hex.addEventListener("input",this.updateRgbDispatch.bind(this)),this.$red.addEventListener("input",this.updateHexDispatch.bind(this)),this.$green.addEventListener("input",this.updateHexDispatch.bind(this)),this.$blue.addEventListener("input",this.updateHexDispatch.bind(this))}updateRgb(){const e=E(k(this.$hex.value));null!==e&&(this.$red.value=e.r.toString(),this.$green.value=e.g.toString(),this.$blue.value=e.b.toString())}updateRgbDispatch(){this.updateRgb(),this.dispatchSelect()}updateHexDispatch(){this.$hex.value=R(parseInt(this.$red.value||"0",10),parseInt(this.$green.value||"0",10),parseInt(this.$blue.value||"0",10)),this.dispatchSelect()}dispatchSelect(){const e=k(this.$hex.value),t=R(parseInt(this.$red.value||"0",10),parseInt(this.$green.value||"0"),parseInt(this.$blue.value||"0"));this.value=e,this.dispatchEvent(new CustomEvent("change",{detail:{hex:e,rgb:t}}))}render(){const e=k(this.value),t=E(e);this.$hex.value=e,this.$red.value=`${t?t.r:0}`,this.$green.value=`${t?t.g:0}`,this.$blue.value=`${t?t.b:0}`}constructor(){super(...arguments),O(this,w)}})})()})();
|