@pictogrammers/components 0.4.8 → 0.5.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/package.json +1 -1
- package/pg/annoy/annoy.css +1 -1
- package/pg/button/button.css +5 -4
- package/pg/buttonLink/buttonLink.css +1 -1
- package/pg/buttonMenu/__examples__/basic/basic.ts +2 -2
- package/pg/buttonMenu/buttonMenu.ts +4 -1
- package/pg/cardUser/cardUser.css +1 -1
- package/pg/database/__examples__/basic/basic.ts +0 -1
- package/pg/grid/__examples__/basic/basic.ts +1 -4
- package/pg/grid/grid.css +1 -1
- package/pg/header/header.css +1 -1
- package/pg/icon/__examples__/basic/basic.ts +1 -1
- package/pg/inputCheck/__examples__/basic/basic.ts +1 -1
- package/pg/inputCheck/inputCheck.css +5 -0
- package/pg/inputCheck/inputCheck.ts +4 -0
- package/pg/inputCheckList/__examples__/basic/basic.ts +1 -1
- package/pg/inputFileLocal/inputFileLocal.css +1 -1
- package/pg/inputNumber/README.md +27 -0
- package/pg/inputNumber/__examples__/basic/basic.html +9 -0
- package/pg/inputNumber/__examples__/basic/basic.ts +30 -0
- package/pg/inputNumber/inputNumber.css +34 -0
- package/pg/inputNumber/inputNumber.html +1 -0
- package/pg/inputNumber/inputNumber.spec.ts +59 -0
- package/pg/inputNumber/inputNumber.ts +63 -0
- package/pg/inputPixelEditor/README.md +211 -29
- package/pg/inputPixelEditor/__examples__/basic/basic.css +8 -0
- package/pg/inputPixelEditor/__examples__/basic/basic.html +29 -7
- package/pg/inputPixelEditor/__examples__/basic/basic.ts +274 -13
- package/pg/inputPixelEditor/__examples__/basic/constants.ts +62 -0
- package/pg/inputPixelEditor/inputPixelEditor.css +37 -2
- package/pg/inputPixelEditor/inputPixelEditor.html +22 -0
- package/pg/inputPixelEditor/inputPixelEditor.ts +822 -82
- package/pg/inputPixelEditor/utils/bitmapToMask.ts +22 -8
- package/pg/inputPixelEditor/utils/blobToImage.ts +11 -0
- package/pg/inputPixelEditor/utils/canvasToPngBuffer.ts +12 -0
- package/pg/inputPixelEditor/utils/constants.ts +55 -1
- package/pg/inputPixelEditor/utils/crc32.ts +116 -0
- package/pg/inputPixelEditor/utils/diffMap.ts +32 -0
- package/pg/inputPixelEditor/utils/generateGradient.ts +112 -0
- package/pg/inputPixelEditor/utils/getEllipsePixels.ts +131 -19
- package/pg/inputPixelEditor/utils/getFloodFill.ts +83 -0
- package/pg/inputPixelEditor/utils/getGridColorIndexes.ts +13 -0
- package/pg/inputPixelEditor/utils/getOutline.ts +92 -0
- package/pg/inputPixelEditor/utils/inputMode.ts +7 -1
- package/pg/inputPixelEditor/utils/pixelSizes.ts +47 -0
- package/pg/inputPixelEditor/utils/pngMetadata.ts +487 -0
- package/pg/inputSelect/inputSelect.css +4 -4
- package/pg/inputText/inputText.css +14 -7
- package/pg/inputText/inputText.ts +5 -1
- package/pg/json/README.md +59 -0
- package/pg/json/__examples__/basic/basic.html +4 -0
- package/pg/json/__examples__/basic/basic.ts +31 -0
- package/pg/json/json.css +9 -0
- package/pg/json/json.html +1 -0
- package/pg/json/json.ts +124 -0
- package/pg/jsonArray/README.md +3 -0
- package/pg/jsonArray/jsonArray.css +15 -0
- package/pg/jsonArray/jsonArray.html +7 -0
- package/pg/jsonArray/jsonArray.ts +55 -0
- package/pg/jsonBoolean/README.md +3 -0
- package/pg/jsonBoolean/jsonBoolean.css +27 -0
- package/pg/jsonBoolean/jsonBoolean.html +5 -0
- package/pg/jsonBoolean/jsonBoolean.ts +69 -0
- package/pg/jsonNumber/README.md +3 -0
- package/pg/jsonNumber/jsonNumber.css +21 -0
- package/pg/jsonNumber/jsonNumber.html +5 -0
- package/pg/jsonNumber/jsonNumber.ts +42 -0
- package/pg/jsonObject/README.md +3 -0
- package/pg/jsonObject/jsonObject.css +11 -0
- package/pg/jsonObject/jsonObject.html +5 -0
- package/pg/jsonObject/jsonObject.ts +55 -0
- package/pg/jsonString/README.md +3 -0
- package/pg/jsonString/jsonString.css +21 -0
- package/pg/jsonString/jsonString.html +5 -0
- package/pg/jsonString/jsonString.ts +42 -0
- package/pg/menu/menu.ts +6 -5
- package/pg/menuItem/README.md +13 -2
- package/pg/menuItem/menuItem.css +17 -22
- package/pg/menuItem/menuItem.ts +8 -3
- package/pg/menuItemIcon/__examples__/basic/basic.html +1 -1
- package/pg/menuItemIcon/__examples__/basic/basic.ts +7 -0
- package/pg/menuItemIcon/menuItemIcon.css +18 -15
- package/pg/menuItemIcon/menuItemIcon.ts +8 -4
- package/pg/modal/README.md +29 -0
- package/pg/modal/__examples__/basic/basic.html +4 -0
- package/pg/modal/__examples__/basic/basic.ts +42 -0
- package/pg/modal/index.ts +3 -0
- package/pg/modal/modal.css +40 -0
- package/pg/modal/modal.html +9 -0
- package/pg/modal/modal.ts +14 -0
- package/pg/modification/__examples__/basic/basic.ts +1 -1
- package/pg/overlayMenu/overlayMenu.ts +6 -2
- package/pg/overlaySelectMenu/overlaySelectMenu.ts +6 -0
- package/pg/overlaySubMenu/overlaySubMenu.ts +6 -2
- package/pg/scroll/__examples__/basic/basic.ts +1 -1
- package/pg/search/search.css +1 -1
- package/pg/table/README.md +108 -0
- package/pg/table/__examples__/basic/basic.css +0 -0
- package/pg/table/__examples__/basic/basic.html +10 -0
- package/pg/table/__examples__/basic/basic.ts +111 -0
- package/pg/table/table.css +20 -0
- package/pg/table/table.html +6 -0
- package/pg/table/table.ts +86 -0
- package/pg/tableCellButtonIcon/README.md +3 -0
- package/pg/tableCellButtonIcon/tableCellButtonIcon.css +16 -0
- package/pg/tableCellButtonIcon/tableCellButtonIcon.html +5 -0
- package/pg/tableCellButtonIcon/tableCellButtonIcon.ts +34 -0
- package/pg/tableCellCheck/README.md +3 -0
- package/pg/tableCellCheck/tableCellCheck.css +15 -0
- package/pg/tableCellCheck/tableCellCheck.html +3 -0
- package/pg/tableCellCheck/tableCellCheck.ts +43 -0
- package/pg/tableCellNumber/README.md +3 -0
- package/pg/tableCellNumber/tableCellNumber.css +11 -0
- package/pg/tableCellNumber/tableCellNumber.html +3 -0
- package/pg/tableCellNumber/tableCellNumber.ts +40 -0
- package/pg/tableCellText/README.md +3 -0
- package/pg/tableCellText/tableCellText.css +11 -0
- package/pg/tableCellText/tableCellText.html +3 -0
- package/pg/tableCellText/tableCellText.ts +62 -0
- package/pg/tableColumn/README.md +3 -0
- package/pg/tableColumn/tableColumn.css +12 -0
- package/pg/tableColumn/tableColumn.html +1 -0
- package/pg/tableColumn/tableColumn.ts +29 -0
- package/pg/tableRow/README.md +3 -0
- package/pg/tableRow/tableRow.css +11 -0
- package/pg/tableRow/tableRow.html +1 -0
- package/pg/tableRow/tableRow.ts +77 -0
- package/pg/tabs/tabs.css +1 -1
- package/pg/tree/README.md +10 -4
- package/pg/tree/__examples__/basic/basic.html +1 -0
- package/pg/tree/__examples__/basic/basic.ts +6 -1
- package/pg/tree/tree.css +1 -0
- package/pg/treeItem/treeItem.css +3 -3
- package/favicon.svg +0 -20
- package/index.html +0 -321
- package/main.js +0 -2
- package/main.js.LICENSE.txt +0 -10
- package/pgAnnoy.js +0 -1
- package/pgApp.js +0 -1
- package/pgAvatar.js +0 -1
- package/pgButton.js +0 -1
- package/pgButtonGroup.js +0 -1
- package/pgButtonLink.js +0 -1
- package/pgButtonMenu.js +0 -1
- package/pgButtonToggle.js +0 -1
- package/pgCard.js +0 -1
- package/pgCardUser.js +0 -1
- package/pgColor.js +0 -1
- package/pgDatabase.js +0 -1
- package/pgDropdown.js +0 -1
- package/pgGrid.js +0 -1
- package/pgHeader.js +0 -1
- package/pgIcon.js +0 -1
- package/pgInputCheck.js +0 -1
- package/pgInputCheckList.js +0 -1
- package/pgInputFileLocal.js +0 -1
- package/pgInputHexRgb.js +0 -1
- package/pgInputPixelEditor.js +0 -1
- package/pgInputRange.js +0 -1
- package/pgInputSelect.js +0 -1
- package/pgInputText.js +0 -1
- package/pgInputTextIcon.js +0 -1
- package/pgInputUserSelect.js +0 -1
- package/pgListTag.js +0 -1
- package/pgMarkdown.js +0 -2
- package/pgMarkdown.js.LICENSE.txt +0 -10
- package/pgMenu.js +0 -1
- package/pgMenuDivider.js +0 -1
- package/pgMenuIcon.js +0 -1
- package/pgMenuItem.js +0 -1
- package/pgMenuItemIcon.js +0 -1
- package/pgModalAlert.js +0 -1
- package/pgModification.js +0 -1
- package/pgNav.js +0 -1
- package/pgOverlay.js +0 -1
- package/pgOverlayContextMenu.js +0 -1
- package/pgOverlayMenu.js +0 -1
- package/pgOverlaySelectMenu.js +0 -1
- package/pgOverlaySubMenu.js +0 -1
- package/pgPicker.js +0 -1
- package/pgPreview.js +0 -1
- package/pgScroll.js +0 -1
- package/pgSearch.js +0 -1
- package/pgTab.js +0 -1
- package/pgTabs.js +0 -1
- package/pgToast.js +0 -1
- package/pgToasts.js +0 -1
- package/pgTooltip.js +0 -1
- package/pgTree.js +0 -1
- package/pgTreeButtonIcon.js +0 -1
- package/pgTreeItem.js +0 -1
package/pgMenuIcon.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",o=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),o&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),o&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,o,i,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(o)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(r[c]=!0)}for(var l=0;l<t.length;l++){var d=[].concat(t[l]);o&&r[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),e.push(d))}},e}},601:t=>{t.exports=function(t){return t[1]}},915:(t,e,n)=>{n.d(e,{A:()=>c});var o=n(601),i=n.n(o),s=n(314),r=n.n(s)()(i());r.push([t.id,"\n[part~=contextMenu] {\n position: relative;\n background: #737E9E;\n border-radius: 0.25rem;\n width: 12rem;\n display: flex;\n flex-direction: column;\n padding: 0.25rem 0;\n box-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);\n}\n\n[part~=contextMenu] > div.section {\n color: #FFF;\n font-size: 0.875rem;\n padding: 0.25rem 0.5rem;\n cursor: default;\n font-weight: bold;\n}\n\n[part~=contextMenu] > div.section:not(:first-child) {\n border-top: 1px solid rgba(255, 255, 255, 0.3);\n margin-top: 0.5rem;\n}\n\n[part~=contextMenu] > div.group {\n margin: 0 0.5rem;\n border: 1px solid rgba(255, 255, 255, 0.2);\n border-radius: 0.25rem;\n display: flex;\n flex-direction: row;\n overflow: hidden;\n}\n[part~=contextMenu] > div.row > div.group {\n border: 1px solid rgba(255, 255, 255, 0.2);\n border-radius: 0.25rem;\n display: flex;\n flex-direction: row;\n flex: 1;\n overflow: hidden;\n}\n\n[part~=contextMenu] > div.row > div.group:first-child {\n margin-left: 0.5rem;\n margin-right: 0.25rem;\n}\n\n[part~=contextMenu] > div.row > div.group:last-child {\n margin-right: 0.5rem;\n}\n\n[part~=contextMenu] > div.group > button,\n[part~=contextMenu] > div.row > div.group > button {\n display: flex;\n flex: 1;\n padding: 0.25rem;\n justify-content: center;\n border: 0;\n margin: 0;\n background: transparent;\n color: #FFF;\n font-size: 1rem;\n line-height: 1.25rem;\n align-items: center;\n outline: none;\n}\n\n[part~=contextMenu] > button,\n[part~=contextMenu] > a {\n display: flex;\n border: 0;\n margin: 0;\n padding: 0.125rem 0.5rem;\n background: transparent;\n text-align: left;\n color: #FFF;\n font-size: 1rem;\n text-decoration: none;\n cursor: default;\n outline: none;\n}\n\n[part~=contextMenu] > div.group > button.active,\n[part~=contextMenu] > div.row > div.group > button.active {\n box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3) inset;\n background: rgba(0, 0, 0, 0.1);\n}\n\n[part~=contextMenu] > div.group > button.active:hover,\n[part~=contextMenu] > div.row > div.group > button.active:hover {\n background: rgba(0, 0, 0, 0.2);\n}\n\n[part~=contextMenu] > div.group > button:not(:first-child),\n[part~=contextMenu] > div.row > div.group > button:not(:first-child) {\n border-left: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n[part~=contextMenu] > div.row > div.group > button > svg,\n[part~=contextMenu] > div.group > button > svg,\n[part~=contextMenu] > div.row > button > svg,\n[part~=contextMenu] > button > svg {\n width: 1.5rem;\n height: 1.5rem;\n align-self: center;\n}\n\n[part~=contextMenu] > div.row > div.group > button:hover,\n[part~=contextMenu] > div.group > button:hover,\n[part~=contextMenu] > button:hover,\n[part~=contextMenu] > a:hover {\n background: rgba(255, 255, 255, 0.2);\n}\n\n[part~=contextMenu] > div.row > div.group > button:active,\n[part~=contextMenu] > div.group > button:active {\n box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3) inset;\n background: rgba(0, 0, 0, 0.2);\n}\n[part~=contextMenu] > button:active,\n[part~=contextMenu] > a:active {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) inset;\n background: rgba(0, 0, 0, 0.2);\n}\n\n.row {\n display: flex;\n}\n\n.divider {\n border-top: 1px solid rgba(255, 255, 255, 0.3);\n margin-top: 0.5rem;\n height: 0.4375rem;\n}\n\n.black {\n display: inline-flex;\n border-radius: 50%;\n width: 1rem;\n height: 1rem;\n background: #000;\n}\n\n.white {\n display: inline-flex;\n border-radius: 50%;\n width: 1rem;\n height: 1rem;\n background: #FFF;\n}\n\n.download svg {\n margin-bottom: -0.125rem;\n margin-left: 0.25rem;\n}\n\n[part~=color] {\n visibility: hidden;\n position: absolute;\n padding: 0.25rem;\n background: #737E9E;\n border-radius: 0.25rem;\n box-shadow: 0 1px 16px rgba(0, 0, 0, 0.6);\n}\n\n[part~=colorHexRgb] {\n margin-bottom: 0.25rem;\n}",""]);var a=new CSSStyleSheet;a.replaceSync(r.toString());const c=a}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var s=e[o]={id:o,exports:{}};return t[o](s,s.exports,n),s.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 o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const o=Symbol("addObserver"),i=Symbol("removeObserver"),s=Symbol("getObservers"),r=Symbol("swapObserver"),a=Symbol("isProxy"),c=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],d=new Map;function p(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case a:return!0;case c:return e;case s:return d.has(t);case r:return(e,n)=>{const o=d.get(t);o.forEach(((i,s)=>{if(s.getRootNode().host===e){const e=o.get(s);d.has(n)?d.get(n).has(s)?d.get(n).get(s).push(o.get(s)):d.get(n).set(s,o.get(s)):d.set(n,new Map([[s,e]])),d.delete(t),e.forEach((t=>{t(null,h.swap,[n])}))}}))};case o:return(e,n)=>{d.has(t)?d.get(t).has(e)?d.get(t).get(e).push(n):d.get(t).set(e,[n]):d.set(t,new Map([[e,[n]]]))};case i:return e=>{d.has(t)&&(d.get(t).delete(e),0===d.get(t).size&&d.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 d.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return d.get(e).forEach(((t,o)=>{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(d.has(t)){d.get(t).forEach(((t,o)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=d;const h={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const u=Symbol("init"),g=Symbol("template"),v=Symbol("style"),m=Symbol("parent");function f(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 y(t={}){return function(e,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var o,i;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[m]||e.prototype[m][e.prototype[m].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[m]=[e.prototype],e.prototype[v]=t.style?[t.style]:[],e.prototype[g]=t.template||""):(e.prototype[m].push(e.prototype),e.prototype[v].push(t.style),e.prototype[g]=(o=e.prototype[g],(i=t.template||null)&&i.match(/<parent\/>/)?i.replace(/<parent\/>/,o):`${o}${i||""}`));const s=e.prototype.connectedCallback||(()=>{}),r=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[g]||"";const n=document.importNode(t.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=e.prototype[v].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),o.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 o=Array.from(n.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),i=()=>{this[m].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[b(e)]=!0,t)),{}):{})}))};0===o.length?(this[u]=!0,s.call(this),i()):Promise.all(o).then((()=>{this[u]=!0,s.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));i()}))},e.prototype.disconnectedCallback=function(){r.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 $(t){return!!t&&t.constructor===Array}function w(t,e){t[u]&&t[m].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function x(t){return null===t?"null":$(t)?"array":typeof t}function k(t){return function(e,n){const o=n.name,i=Symbol(o),l=Symbol(`${o}:type`),d=Symbol(`${o}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,o,{get:()=>"object"===this[l]||"array"===this[l]?this[i][a]?this[i]:p(this[i]):this[i],set:e=>{const n=x(t?t(e):e);if("index"!==o&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${o} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!$(e))throw new PropError(`Array "${o}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,o)?.set);if(this[i]===e)throw new Error("Setting an array to itself is not allowed.");const t=p(this[i]);if(t[s]){const n=e[a]?e[c]:e;t[r](this,n),this[i]=e,console.log(">>> trigger render???",this,o)}else this[i]=e}else this[i]=t?t(e):e,w(this,o)}})})),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(!n.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,n=f(o);e[o]||(t.observedAttributes.push(n),e[o]=i)}return this[l]=x(e),"array"===this[l]?(this[i]=e,new Proxy(e,{get:(t,e)=>e===C?this[d]:(console.log("errr???"),Reflect.get(this[i],e)),set:(t,e,n)=>{if(e===C)return this[d]=n,!0;const s=Reflect.set(t,e,n);return"length"===e&&this[i].length===n||w(this,o),this[i]=n,s}})):(this[i]=t?t(this.getAttribute(o)??e):this.getAttribute(o)??e,this[i])}}}function S(){return function(t,e){const n=e.name,o=n.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,n,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${o}]`))}})}))}}Symbol("hasProxy");const C=Symbol("meta");var L=n(915);const E=t=>{var e=document.createElement("textarea");e.setAttribute("style","position:fixed;opacity:0;top:100px;left:100px;"),e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),setTimeout((function(){document.body.removeChild(e)}),1500)};const F="pgtoastadd",P="pgtoastremove";function M(t){t.key=t.key||"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}));const e=new CustomEvent(F,{detail:t});return document.body.dispatchEvent(e),setTimeout((()=>{!function(t){const e=new CustomEvent(P,{detail:{key:t}});document.body.dispatchEvent(e)}(t.key)}),1e3*t.seconds),t.key}function I(t,e=3){return M({type:"info",message:t,seconds:e})}class Alias{id;name;match=!1;constructor(t,e){void 0!==t&&(this.id=t),void 0!==e&&(this.name=e)}from(t){return void 0!==t.id&&(this.id=t.id),void 0!==t.name&&(this.name=t.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(t){return this.id=t.id,this.github=t.github,this.name=t.name,"string"==typeof t.base64&&(t.base64.match(/^data/)?this.base64=t.base64:this.base64=`data:image/png;base64,${t.base64}`),this.iconCount=t.iconCount,this.description=t.description,this.website=t.website,this.sponsored=t.sponsored,this.sponsorship=`https://github.com/users/${t.github}/sponsorship`,this.core=t.core,this}}class Tag{id;name;url;count;from(t){return void 0!==t.id&&(this.id=t.id),void 0!==t.name&&(this.name=t.name),void 0!==t.url&&(this.url=t.url),void 0!==t.count&&(this.count=t.count),this}to(){return{name:this.name,url:this.url,count:this.count}}}class Style{id;name;count=null;from(t){return this.id=t.id,this.name=t.name,this.count=t.count,this}}class FontIcon{id;codepoint;font;version;from(t){return this.id=t.id,this.codepoint=t.codepoint,this.font=t.font,this.version=t.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(t,e){this.name=t||null,this.data=e||null}from(t){return this.id=t.id,this.packageId=t.packageId,this.baseIconId=t.baseIconId,this.name=t.name,this.description=t.description,this.data=t.data,t.version&&(this.version=t.version),t.fontIcon&&(this.fontIcon=t.fontIcon),t.user&&(this.user=(new User).from(t.user)),t.aliases&&(this.aliases=t.aliases.map((t=>(new Alias).from(t)))),t.tags&&(this.tags=t.tags.map((t=>(new Tag).from(t)))),t.styles&&(this.styles=t.styles.map((t=>(new Style).from(t)))),"boolean"==typeof t.published&&(this.published=t.published),"boolean"==typeof t.deprecated&&(this.deprecated=t.deprecated),t.codepoint&&(this.codepoint=t.codepoint),t.fontIcons&&(this.fontIcons=t.fontIcons.map((t=>(new FontIcon).from(t)))),this}to(){const{id:t,name:e,description:n,data:o,version:i,fontIcon:s,packageId:r,baseIconId:a,aliases:c,tags:l}=this;return{id:t,name:e,description:n,data:o,version:i,fontIcon:s,packageId:r,baseIconId:a,aliases:c.map((t=>t.to())),tags:l.map((t=>t.to()))}}}var H=function(t,e,n,o,i,s){function r(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,c=o.kind,l="getter"===c?"get":"setter"===c?"set":"value",d=!e&&t?o.static?t:t.prototype:null,p=e||(d?Object.getOwnPropertyDescriptor(d,o.name):{}),h=!1,u=n.length-1;u>=0;u--){var g={};for(var v in o)g[v]="access"===v?{}:o[v];for(var v in o.access)g.access[v]=o.access[v];g.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(r(t||null))};var m=(0,n[u])("accessor"===c?{get:p.get,set:p.set}:p[l],g);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=r(m.get))&&(p.get=a),(a=r(m.set))&&(p.set=a),(a=r(m.init))&&i.unshift(a)}else(a=r(m))&&("field"===c?i.unshift(a):p[l]=a)}d&&Object.defineProperty(d,o.name,p),h=!0},R=function(t,e,n){for(var o=arguments.length>2,i=0;i<e.length;i++)n=o?e[i].call(t,n):e[i].call(t);return o?n:void 0};(()=>{let t,e,n,o,i,s,r,a,c,l,d,p,h,u,g,v,m,f,b,$,w,x,C,F,P,M,N,T,O,A=[y({selector:"pg-menu-icon",style:L.A,template:'<div part="contextMenu"> <a part="newTab" href="">Open icon in New Tab</a> <button part="copyIconName">Copy Icon Name</button> <div class="section">Download PNG</div> <div class="group"> <button part="png24">24</button> <button part="png36">36</button> <button part="png48">48</button> <button part="png96">96</button> </div> <div class="row" style="margin-top:.25rem"> <div class="group"> <button part="pngBlack"><span class="black"></span></button> <button part="pngWhite"><span class="white"></span></button> <button part="pngColor"> <svg viewBox="0 0 24 24"> <path fill="#fff" d="M19.35,11.72L17.22,13.85L15.81,12.43L8.1,20.14L3.5,22L2,20.5L3.86,15.9L11.57,8.19L10.15,6.78L12.28,4.65L19.35,11.72M16.76,3C17.93,1.83 19.83,1.83 21,3C22.17,4.17 22.17,6.07 21,7.24L19.08,9.16L14.84,4.92L16.76,3M5.56,17.03L4.5,19.5L6.97,18.44L14.4,11L13,9.6L5.56,17.03Z"/> <path fill="currentColor" d="M12.97 8L15.8 10.85L7.67 19L3.71 20.68L3.15 20.11L4.84 16.15L12.97 8Z"/> </svg> </button> </div> <div class="group"> <button part="pngDownload" class="download"> PNG <svg viewBox="0 0 24 24"> <path fill="currentColor" d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"/> </svg> </button> </div> </div> <div class="section">SVG</div> <div class="row" style="margin-bottom:.25rem"> <div class="group"> <button part="svgBlack" class="active"><span class="black"></span></button> <button part="svgWhite"><span class="white"></span></button> <button part="svgColor"> <svg viewBox="0 0 24 24"> <path fill="#fff" d="M19.35,11.72L17.22,13.85L15.81,12.43L8.1,20.14L3.5,22L2,20.5L3.86,15.9L11.57,8.19L10.15,6.78L12.28,4.65L19.35,11.72M16.76,3C17.93,1.83 19.83,1.83 21,3C22.17,4.17 22.17,6.07 21,7.24L19.08,9.16L14.84,4.92L16.76,3M5.56,17.03L4.5,19.5L6.97,18.44L14.4,11L13,9.6L5.56,17.03Z"/> <path fill="currentColor" d="M12.97 8L15.8 10.85L7.67 19L3.71 20.68L3.15 20.11L4.84 16.15L12.97 8Z"/> </svg> </button> </div> <div class="group"> <button part="svgDownload" class="download"> SVG <svg viewBox="0 0 24 24"> <path fill="currentColor" d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"/> </svg> </button> </div> </div> <button part="copySvgInline">Copy HTML SVG Inline</button> <button part="copySvgFile">Copy SVG File Contents</button> <button part="copySvgPath">Copy SVG Path Data</button> <div class="section">Desktop Font</div> <button part="copyUnicode">Copy Unicode Character</button> <button part="copyCodepoint">Copy Codepoint</button> <div class="divider"></div> <button part="copyPreview">Copy GitHub Preview</button> <div part="color"> <pg-input-hex-rgb part="colorHexRgb"></pg-input-hex-rgb> <pg-color part="colorPicker"></pg-color> </div> </div>'})],B=[],z=HTMLElement,D=[],W=[],j=[],V=[],U=[],G=[],Z=[],J=[],q=[],_=[],Y=[],K=[],Q=[],X=[],tt=[],et=[],nt=[],ot=[],it=[],st=[],rt=[],at=[],ct=[],lt=[],dt=[],pt=[],ht=[],ut=[],gt=[],vt=[],mt=[],ft=[],bt=[],yt=[],$t=[],wt=[],xt=[],kt=[],St=[],Ct=[],Lt=[],Et=[],Ft=[],Pt=[],Mt=[],It=[],Ht=[],Rt=[],Nt=[],Tt=[],Ot=[],At=[],Bt=[],zt=[];(class extends z{static{e=this}static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(z[Symbol.metadata]??null):void 0;var L;n=[S()],o=[S()],i=[S()],s=[S()],r=[S()],a=[S()],c=[S()],l=[S()],d=[S()],p=[S()],h=[S()],u=[S()],g=[S()],v=[S()],m=[S()],f=[S()],b=[S()],$=[S()],w=[S()],x=[S()],C=[S()],F=[S()],P=[S()],M=[S()],N=[(L="store",function(t,e){return e.name,function(t){if(!(t instanceof Map))throw new Error("@Local(key) property must be type Map");return new Proxy(t,{get(e,n){switch(n){case"get":return e=>{if(!t.has(e))throw new Error(`@Local(key) missing key ${e}`);const n=`${L}:${e}`;return null===window.localStorage.getItem(n)?t.get(e):JSON.parse(window.localStorage.getItem(n)??"null")};case"set":return(e,n)=>{if(!t.has(e))throw new Error(`@Local(key) missing key ${e}`);const o=`${L}:${e}`;null===n||JSON.stringify(n)===JSON.stringify(t.get(e))?window.localStorage.removeItem(o):window.localStorage.setItem(o,JSON.stringify(n))};default:throw new Error(`@Local(key) supported method ${n}`)}}})}})],T=[k()],O=[k()],H(null,null,n,{kind:"field",name:"$contextMenu",static:!1,private:!1,access:{has:t=>"$contextMenu"in t,get:t=>t.$contextMenu,set:(t,e)=>{t.$contextMenu=e}},metadata:y},D,W),H(null,null,o,{kind:"field",name:"$newTab",static:!1,private:!1,access:{has:t=>"$newTab"in t,get:t=>t.$newTab,set:(t,e)=>{t.$newTab=e}},metadata:y},j,V),H(null,null,i,{kind:"field",name:"$copyIconName",static:!1,private:!1,access:{has:t=>"$copyIconName"in t,get:t=>t.$copyIconName,set:(t,e)=>{t.$copyIconName=e}},metadata:y},U,G),H(null,null,s,{kind:"field",name:"$pngBlack",static:!1,private:!1,access:{has:t=>"$pngBlack"in t,get:t=>t.$pngBlack,set:(t,e)=>{t.$pngBlack=e}},metadata:y},Z,J),H(null,null,r,{kind:"field",name:"$pngWhite",static:!1,private:!1,access:{has:t=>"$pngWhite"in t,get:t=>t.$pngWhite,set:(t,e)=>{t.$pngWhite=e}},metadata:y},q,_),H(null,null,a,{kind:"field",name:"$pngColor",static:!1,private:!1,access:{has:t=>"$pngColor"in t,get:t=>t.$pngColor,set:(t,e)=>{t.$pngColor=e}},metadata:y},Y,K),H(null,null,c,{kind:"field",name:"$png24",static:!1,private:!1,access:{has:t=>"$png24"in t,get:t=>t.$png24,set:(t,e)=>{t.$png24=e}},metadata:y},Q,X),H(null,null,l,{kind:"field",name:"$png36",static:!1,private:!1,access:{has:t=>"$png36"in t,get:t=>t.$png36,set:(t,e)=>{t.$png36=e}},metadata:y},tt,et),H(null,null,d,{kind:"field",name:"$png48",static:!1,private:!1,access:{has:t=>"$png48"in t,get:t=>t.$png48,set:(t,e)=>{t.$png48=e}},metadata:y},nt,ot),H(null,null,p,{kind:"field",name:"$png96",static:!1,private:!1,access:{has:t=>"$png96"in t,get:t=>t.$png96,set:(t,e)=>{t.$png96=e}},metadata:y},it,st),H(null,null,h,{kind:"field",name:"$pngDownload",static:!1,private:!1,access:{has:t=>"$pngDownload"in t,get:t=>t.$pngDownload,set:(t,e)=>{t.$pngDownload=e}},metadata:y},rt,at),H(null,null,u,{kind:"field",name:"$svgBlack",static:!1,private:!1,access:{has:t=>"$svgBlack"in t,get:t=>t.$svgBlack,set:(t,e)=>{t.$svgBlack=e}},metadata:y},ct,lt),H(null,null,g,{kind:"field",name:"$svgWhite",static:!1,private:!1,access:{has:t=>"$svgWhite"in t,get:t=>t.$svgWhite,set:(t,e)=>{t.$svgWhite=e}},metadata:y},dt,pt),H(null,null,v,{kind:"field",name:"$svgColor",static:!1,private:!1,access:{has:t=>"$svgColor"in t,get:t=>t.$svgColor,set:(t,e)=>{t.$svgColor=e}},metadata:y},ht,ut),H(null,null,m,{kind:"field",name:"$svgDownload",static:!1,private:!1,access:{has:t=>"$svgDownload"in t,get:t=>t.$svgDownload,set:(t,e)=>{t.$svgDownload=e}},metadata:y},gt,vt),H(null,null,f,{kind:"field",name:"$copySvgInline",static:!1,private:!1,access:{has:t=>"$copySvgInline"in t,get:t=>t.$copySvgInline,set:(t,e)=>{t.$copySvgInline=e}},metadata:y},mt,ft),H(null,null,b,{kind:"field",name:"$copySvgFile",static:!1,private:!1,access:{has:t=>"$copySvgFile"in t,get:t=>t.$copySvgFile,set:(t,e)=>{t.$copySvgFile=e}},metadata:y},bt,yt),H(null,null,$,{kind:"field",name:"$copySvgPath",static:!1,private:!1,access:{has:t=>"$copySvgPath"in t,get:t=>t.$copySvgPath,set:(t,e)=>{t.$copySvgPath=e}},metadata:y},$t,wt),H(null,null,w,{kind:"field",name:"$copyUnicode",static:!1,private:!1,access:{has:t=>"$copyUnicode"in t,get:t=>t.$copyUnicode,set:(t,e)=>{t.$copyUnicode=e}},metadata:y},xt,kt),H(null,null,x,{kind:"field",name:"$copyCodepoint",static:!1,private:!1,access:{has:t=>"$copyCodepoint"in t,get:t=>t.$copyCodepoint,set:(t,e)=>{t.$copyCodepoint=e}},metadata:y},St,Ct),H(null,null,C,{kind:"field",name:"$copyPreview",static:!1,private:!1,access:{has:t=>"$copyPreview"in t,get:t=>t.$copyPreview,set:(t,e)=>{t.$copyPreview=e}},metadata:y},Lt,Et),H(null,null,F,{kind:"field",name:"$color",static:!1,private:!1,access:{has:t=>"$color"in t,get:t=>t.$color,set:(t,e)=>{t.$color=e}},metadata:y},Ft,Pt),H(null,null,P,{kind:"field",name:"$colorPicker",static:!1,private:!1,access:{has:t=>"$colorPicker"in t,get:t=>t.$colorPicker,set:(t,e)=>{t.$colorPicker=e}},metadata:y},Mt,It),H(null,null,M,{kind:"field",name:"$colorHexRgb",static:!1,private:!1,access:{has:t=>"$colorHexRgb"in t,get:t=>t.$colorHexRgb,set:(t,e)=>{t.$colorHexRgb=e}},metadata:y},Ht,Rt),H(null,null,N,{kind:"field",name:"store",static:!1,private:!1,access:{has:t=>"store"in t,get:t=>t.store,set:(t,e)=>{t.store=e}},metadata:y},Nt,Tt),H(null,null,T,{kind:"field",name:"currentIndex",static:!1,private:!1,access:{has:t=>"currentIndex"in t,get:t=>t.currentIndex,set:(t,e)=>{t.currentIndex=e}},metadata:y},Ot,At),H(null,null,O,{kind:"field",name:"icon",static:!1,private:!1,access:{has:t=>"icon"in t,get:t=>t.icon,set:(t,e)=>{t.icon=e}},metadata:y},Bt,zt),H(null,t={value:e},A,{kind:"class",name:e.name,metadata:y},null,B),e=t.value,y&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y}),R(e,B)}$contextMenu=R(this,D,void 0);$newTab=(R(this,W),R(this,j,void 0));$copyIconName=(R(this,V),R(this,U,void 0));$pngBlack=(R(this,G),R(this,Z,void 0));$pngWhite=(R(this,J),R(this,q,void 0));$pngColor=(R(this,_),R(this,Y,void 0));$png24=(R(this,K),R(this,Q,void 0));$png36=(R(this,X),R(this,tt,void 0));$png48=(R(this,et),R(this,nt,void 0));$png96=(R(this,ot),R(this,it,void 0));$pngDownload=(R(this,st),R(this,rt,void 0));$svgBlack=(R(this,at),R(this,ct,void 0));$svgWhite=(R(this,lt),R(this,dt,void 0));$svgColor=(R(this,pt),R(this,ht,void 0));$svgDownload=(R(this,ut),R(this,gt,void 0));$copySvgInline=(R(this,vt),R(this,mt,void 0));$copySvgFile=(R(this,ft),R(this,bt,void 0));$copySvgPath=(R(this,yt),R(this,$t,void 0));$copyUnicode=(R(this,wt),R(this,xt,void 0));$copyCodepoint=(R(this,kt),R(this,St,void 0));$copyPreview=(R(this,Ct),R(this,Lt,void 0));$color=(R(this,Et),R(this,Ft,void 0));$colorPicker=(R(this,Pt),R(this,Mt,void 0));$colorHexRgb=(R(this,It),R(this,Ht,void 0));store=(R(this,Rt),R(this,Nt,new Map([["cachePngColor","#000000"],["cachePngSize",24],["cacheSvgColor","#000000"]])));color=(R(this,Tt),"svg");currentIndex=R(this,Ot,0);icon=(R(this,At),R(this,Bt,new Icon));connectedCallback(){this.$copyIconName.addEventListener("click",this.handleCopyIconName.bind(this)),this.$svgBlack.addEventListener("click",(()=>{this.store.set("cacheSvgColor","#000000"),this.render()})),this.$svgWhite.addEventListener("click",(()=>{this.store.set("cacheSvgColor","#FFFFFF"),this.render()}));let t=!1;this.$svgColor.addEventListener("click",(()=>{if(t)return void(t=!1);this.color="svg",this.$colorPicker.value=this.store.get("cacheSvgColor"),this.$colorHexRgb.value=this.store.get("cacheSvgColor");const e=this;this.$color.style.visibility="visible";let n=!0;this.$color.addEventListener("mouseenter",(()=>n=!1)),this.$color.addEventListener("mouseleave",(()=>n=!0)),document.addEventListener("mousedown",(function o(i){n&&(e.$color.style.visibility="hidden",document.removeEventListener("mousedown",o),t=!0,e.render(),setTimeout((()=>t=!1),500))}))})),this.$pngBlack.addEventListener("click",(()=>{this.store.set("cachePngColor","#000000"),this.render()})),this.$pngWhite.addEventListener("click",(()=>{this.store.set("cachePngColor","#FFFFFF"),this.render()}));let e=!1;this.$pngColor.addEventListener("click",(()=>{if(e)return void(e=!1);this.color="png",this.$colorPicker.value=this.store.get("cachePngColor"),this.$colorHexRgb.value=this.store.get("cachePngColor");const t=this;this.$color.style.visibility="visible";let n=!0;this.$color.addEventListener("mouseenter",(()=>n=!1)),this.$color.addEventListener("mouseleave",(()=>n=!0)),document.addEventListener("mousedown",(function o(i){n&&(t.$color.style.visibility="hidden",document.removeEventListener("mousedown",o),e=!0,t.render(),setTimeout((()=>e=!1),500))}))})),this.$png24.addEventListener("click",(()=>{this.store.set("cachePngSize",24),this.render()})),this.$png36.addEventListener("click",(()=>{this.store.set("cachePngSize",36),this.render()})),this.$png48.addEventListener("click",(()=>{this.store.set("cachePngSize",48),this.render()})),this.$png96.addEventListener("click",(()=>{this.store.set("cachePngSize",96),this.render()})),this.$svgDownload.addEventListener("click",(()=>{alert(`SVG ${this.store.get("cacheSvgColor")}`)})),this.$pngDownload.addEventListener("click",(()=>{alert(`SVG ${this.store.get("cachePngSize")} ${this.store.get("cachePngColor")}`)})),this.$copySvgInline.addEventListener("click",(()=>{const t=this.icon;E(function(t){return`<svg viewBox="0 0 24 24"><path fill="currentColor" d="${t.data}"/></svg>`}(t)),this.hideContextMenu(),I(`Copied inline SVG "${t.name}" to clipboard.`)})),this.$copySvgFile.addEventListener("click",(()=>{})),this.$copySvgPath.addEventListener("click",(()=>{})),this.$copyUnicode.addEventListener("click",(()=>{})),this.$copyCodepoint.addEventListener("click",(()=>{})),this.$copyPreview.addEventListener("click",(()=>{}))}handleCopyIconName(){const t=this.icon;t&&t.name&&(E(t.name),I(`Copied "${t.name}" to clipboard.`)),this.hideContextMenu()}hideContextMenu(){}showContextMenu(t,e,n){this.dispatchEvent(new CustomEvent("closemenu"))}render(){const t=this.store.get("cacheSvgColor"),e=this.store.get("cachePngColor"),n=this.store.get("cachePngSize");this.$svgBlack.classList.toggle("active","#000000"===t),this.$svgWhite.classList.toggle("active","#FFFFFF"===t),this.$svgColor.classList.toggle("active","#000000"!==t&&"#FFFFFF"!==t),this.$pngBlack.classList.toggle("active","#000000"===e),this.$pngWhite.classList.toggle("active","#FFFFFF"===e),this.$pngColor.classList.toggle("active","#000000"!==e&&"#FFFFFF"!==e),this.$png24.classList.toggle("active",24===n),this.$png36.classList.toggle("active",36===n),this.$png48.classList.toggle("active",48===n),this.$png96.classList.toggle("active",96===n),this.$colorPicker.addEventListener("select",this.handleColorSelect.bind(this)),this.$colorHexRgb.addEventListener("change",this.handleHexRgbChange.bind(this)),this.syncEyedropper()}handleColorSelect(t){switch(this.color){case"svg":this.store.set("cacheSvgColor",t.detail.hex);break;case"png":this.store.set("cachePngColor",t.detail.hex)}this.$colorHexRgb.value=t.detail.hex,this.syncEyedropper()}handleHexRgbChange(t){switch(this.color){case"svg":this.store.set("cacheSvgColor",t.detail.hex);break;case"png":this.store.set("cachePngColor",t.detail.hex)}this.$colorPicker.value=t.detail.hex,this.syncEyedropper()}syncEyedropper(){const t=this.store.get("cachePngColor");this.$pngColor.style.color="#000000"!==t&&"#FFFFFF"!==t?t:"transparent";const e=this.store.get("cacheSvgColor");this.$svgColor.style.color="#000000"!==e&&"#FFFFFF"!==e?e:"transparent"}constructor(){super(...arguments),R(this,zt)}})})()})();
|
package/pgMenuItem.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e={209:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27rgb%2869, 60, 79, 0.5%29%27 /></svg>"},217:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),a=n.n(r),s=n(314),o=n.n(s)()(a());o.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n overflow: visible;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n translate: var(--pg-overlay-menu-_x, 0) var(--pg-overlay-menu-_y, 0);\n position-try-fallbacks: --custom-right, --custom-left;\n}\n\n@position-try --custom-right {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n}\n\n@position-try --custom-left {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(left) - anchor-size(width) + 0.25rem);\n}\n',""]);var i=new CSSStyleSheet;i.replaceSync(o.toString());const l=i},219:(e,t,n)=>{n.d(t,{A:()=>k});var r=n(601),a=n.n(r),s=n(314),o=n.n(s),i=n(417),l=n.n(i),c=new URL(n(662),n.b),d=new URL(n(708),n.b),u=new URL(n(383),n.b),h=new URL(n(544),n.b),p=new URL(n(570),n.b),m=new URL(n(209),n.b),f=o()(a()),g=l()(c),v=l()(d),b=l()(u),y=l()(h),w=l()(p),x=l()(m);f.push([e.id,`:host {\n display: contents;\n}\n\n[part=label] {\n outline: none;\n display: flex;\n align-items: center;\n font-family: var(--pg-font-family);\n text-align: var(--pg-menu-item-text-align, left);\n background: var(--pg-menu-item-background, transparent);\n padding: var(--pg-menu-item-padding, 0.25rem 0.5rem 0.25rem 0.5rem);\n border-color: transparent;\n border-width: 0;\n border-style: solid;\n border-top-left-radius: var(--pg-menu-item-border-radius-top, 0.25rem);\n border-top-right-radius: var(--pg-menu-item-border-radius-top, 0.25rem);\n border-bottom-left-radius: var(--pg-menu-item-border-radius-bottom, 0.25rem);\n border-bottom-right-radius: var(--pg-menu-item-border-radius-bottom, 0.25rem);\n color: var(--pg-menu-item-color, #453C4F);\n}\n\n[part=label]:not(:disabled):active,\n[part=label]:not(:disabled):hover {\n background: var(--pg-menu-item-selected-background, #453C4F);\n color: #FFFFFF;\n}\n\n[part=label]:not(:disabled):active {\n background: var(--pg-menu-item-active-background, #5f516e);\n}\n\n[part=label]:disabled {\n color: var(--pg-menu-item-disabled-color, rgb(69, 60, 79, 0.75));\n}\n\n@container style(--pg-menu-_has-check: true) {\n [part=label] {\n padding-inline-start: 1.5rem;\n }\n\n [part=label].checked::before {\n position: absolute;\n translate: -1.5rem 0;\n content: var(--pg-menu-item-check, url(${g}));\n width: 1.5rem;\n height: 1.5rem;\n }\n\n [part=label].checked:active::before,\n [part=label].checked:hover::before {\n content: var(--pg-menu-item-hover-check, url(${v}));\n }\n\n [part=label].checked:disabled::before {\n content: var(--pg-menu-item-disabled-check, url(${b}));\n }\n}\n\n[part=label]:focus-visible {\n position: relative;\n}\n\n[part=label]:focus-visible::after {\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=label]:focus-visible:not(:hover)::after {\n background: var(--pg-focus-background-color, rgb(79, 143, 249, 0.1));\n}\n\n[part=label].more {\n padding-right: 1.5rem;\n}\n\n[part=label].more::after {\n position: absolute;\n translate: -0.25rem 0;\n right: 0;\n content: var(--pg-menu-item-check, url(${y}));\n width: 1.5rem;\n height: 1.5rem;\n}\n\n[part=label].more:active::after,\n[part=label].more:hover::after {\n content: var(--pg-menu-item-hover-check, url(${w}));\n}\n\n[part=label].more:disabled::after {\n content: var(--pg-menu-item-disabled-check, url(${x}));\n}\n`,""]);var S=new CSSStyleSheet;S.replaceSync(f.toString());const k=S},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,a,s){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var i=0;i<this.length;i++){var l=this[i][0];null!=l&&(o[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&o[d[0]]||(void 0!==s&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),a&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=a):d[4]="".concat(a)),t.push(d))}},t}},383:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27rgb%2869, 60, 79, 0.5%29%27 /></svg>"},417:e=>{e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},544:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27rgb%2869, 60, 79%29%27 /></svg>"},570:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27white%27 /></svg>"},601:e=>{e.exports=function(e){return e[1]}},662:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27rgb%2869, 60, 79%29%27 /></svg>"},708:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27white%27 /></svg>"}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var s=t[r]={id:r,exports:{}};return e[r](s,s.exports,n),s.exports}n.m=e,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),n.b="undefined"!=typeof document&&document.baseURI||self.location.href;const r=Symbol("addObserver"),a=Symbol("removeObserver"),s=Symbol("getObservers"),o=Symbol("swapObserver"),i=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],d=new Map;function u(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case i:return!0;case l:return t;case s:return d.has(e);case o:return(t,n)=>{const r=d.get(e);r.forEach(((a,s)=>{if(s.getRootNode().host===t){const t=r.get(s);d.has(n)?d.get(n).has(s)?d.get(n).get(s).push(r.get(s)):d.get(n).set(s,r.get(s)):d.set(n,new Map([[s,t]])),d.delete(e),t.forEach((e=>{e(null,h.swap,[n])}))}}))};case r:return(t,n)=>{d.has(e)?d.get(e).has(t)?d.get(e).get(t).push(n):d.get(e).set(t,[n]):d.set(e,new Map([[t,[n]]]))};case a:return t=>{d.has(e)&&(d.get(e).delete(t),0===d.get(e).size&&d.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 d.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return d.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(d.has(e)){d.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=d;const h={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const p=Symbol("init"),m=Symbol("template"),f=Symbol("style"),g=Symbol("parent");function v(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 y(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,a;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[g]||t.prototype[g][t.prototype[g].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[g]=[t.prototype],t.prototype[f]=e.style?[e.style]:[],t.prototype[m]=e.template||""):(t.prototype[g].push(t.prototype),t.prototype[f].push(e.style),t.prototype[m]=(r=t.prototype[m],(a=e.template||null)&&a.match(/<parent\/>/)?a.replace(/<parent\/>/,r):`${r}${a||""}`));const s=t.prototype.connectedCallback||(()=>{}),o=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[m]||"";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))),a=()=>{this[g].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,s.call(this),a()):Promise.all(r).then((()=>{this[p]=!0,s.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));a()}))},t.prototype.disconnectedCallback=function(){o.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 w(e){return!!e&&e.constructor===Array}function x(e,t){e[p]&&e[g].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function S(e){return null===e?"null":w(e)?"array":typeof e}function k(e){return function(t,n){const r=n.name,a=Symbol(r),c=Symbol(`${r}:type`),d=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[c]||"array"===this[c]?this[a][i]?this[a]:u(this[a]):this[a],set:t=>{const n=S(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(!w(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[a]===t)throw new Error("Setting an array to itself is not allowed.");const e=u(this[a]);if(e[s]){const n=t[i]?t[l]:t;e[o](this,n),this[a]=t,console.log(">>> trigger render???",this,r)}else this[a]=t}else this[a]=e?e(t):t,x(this,r)}})})),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=v(r);t[r]||(e.observedAttributes.push(n),t[r]=a)}return this[c]=S(t),"array"===this[c]?(this[a]=t,new Proxy(t,{get:(e,t)=>t===L?this[d]:(console.log("errr???"),Reflect.get(this[a],t)),set:(e,t,n)=>{if(t===L)return this[d]=n,!0;const s=Reflect.set(e,t,n);return"length"===t&&this[a].length===n||x(this,r),this[a]=n,s}})):(this[a]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[a])}}}function E(){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 L=Symbol("meta");var $=function(e,t,n,r,a,s){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),h=!1,p=n.length-1;p>=0;p--){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(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(e||null))};var g=(0,n[p])("accessor"===l?{get:u.get,set:u.set}:u[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(i=o(g.get))&&(u.get=i),(i=o(g.set))&&(u.set=i),(i=o(g.init))&&a.unshift(i)}else(i=o(g))&&("field"===l?a.unshift(i):u[c]=i)}d&&Object.defineProperty(d,r.name,u),h=!0},C=function(e,t,n){for(var r=arguments.length>2,a=0;a<t.length;a++)n=r?t[a].call(e,n):t[a].call(e);return r?n:void 0};const P=new Set,O=new Map;const j=(()=>{let e,t,n=[y()],r=[],a=HTMLElement;(class extends a{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(a[Symbol.metadata]??null):void 0;$(null,e={value:t},n,{kind:"class",name:t.name,metadata:s},null,r),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),C(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),P.add(t),new Promise((e=>{O.set(t,e)}))}close(e){this.remove(),P.delete(this);const t=O.get(this);t&&t(e),O.delete(this)}});return t})();var R=n(217),A=function(e,t,n,r,a,s){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),h=!1,p=n.length-1;p>=0;p--){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(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(e||null))};var g=(0,n[p])("accessor"===l?{get:u.get,set:u.set}:u[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(i=o(g.get))&&(u.get=i),(i=o(g.set))&&(u.set=i),(i=o(g.init))&&a.unshift(i)}else(i=o(g))&&("field"===l?a.unshift(i):u[c]=i)}d&&Object.defineProperty(d,r.name,u),h=!0},T=function(e,t,n){for(var r=arguments.length>2,a=0;a<t.length;a++)n=r?t[a].call(e,n):t[a].call(e);return r?n:void 0};const M=[],z=[];const D=(()=>{let e,t,n,r,a,s,o,i,l,c,d=[y({selector:"pg-overlay-sub-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:R.A})],u=[],h=j,p=[],m=[],f=[],g=[],v=[],b=[],w=[],x=[],S=[],L=[],$=[],C=[],P=[],O=[],D=[],F=[];(class extends h{static{t=this}static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;n=[E()],r=[E()],a=[k()],s=[k()],o=[k()],i=[k()],l=[k()],c=[k()],A(null,null,n,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:y},p,m),A(null,null,r,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:y},f,g),A(null,null,a,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:y},v,b),A(null,null,s,{kind:"field",name:"x",static:!1,private:!1,access:{has:e=>"x"in e,get:e=>e.x,set:(e,t)=>{e.x=t}},metadata:y},w,x),A(null,null,o,{kind:"field",name:"y",static:!1,private:!1,access:{has:e=>"y"in e,get:e=>e.y,set:(e,t)=>{e.y=t}},metadata:y},S,L),A(null,null,i,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:y},$,C),A(null,null,l,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:y},P,O),A(null,null,c,{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:y},D,F),A(null,e={value:t},d,{kind:"class",name:t.name,metadata:y},null,u),t=e.value,y&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y}),T(t,u)}$overlay=T(this,p,void 0);$menu=(T(this,m),T(this,f,void 0));source=(T(this,g),T(this,v,null));x=(T(this,b),T(this,w,0));y=(T(this,x),T(this,S,0));default=(T(this,L),T(this,$,null));items=(T(this,C),T(this,P,[]));value=(T(this,O),T(this,D,null));render(e){e.items&&(this.$menu.items=this.items)}connectedCallback(){M.pop()?.close(),M.push(this),z.push(this),this.$menu.addEventListener("select",this.#e.bind(this)),this.$menu.addEventListener("close",this.#t.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#n.bind(this));this.source?.getBoundingClientRect();this.$overlay.style.setProperty("--pg-overlay-menu-_x","0px"),this.$overlay.style.setProperty("--pg-overlay-menu-_y","0px"),this.$menu.focus(0),this.#r=this.#a.bind(this),document.addEventListener("pointerdown",this.#r)}#s=(T(this,F),!1);#r;#a(e){this.#s=e.composedPath().includes(this.source)}#n(e){"closed"===e.newState&&0===z.length&&this.#s&&(console.log(e),this.source?.focus())}disconnectedCallback(){z.pop(),document.removeEventListener("pointerdown",this.#r)}#t(e){const{depth:t}=e.detail;console.log("close",t),1===t?this.close(null):this.close()}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}});return t})();var F=n(219),U=function(e,t,n,r,a,s){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),h=!1,p=n.length-1;p>=0;p--){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(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(e||null))};var g=(0,n[p])("accessor"===l?{get:u.get,set:u.set}:u[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(i=o(g.get))&&(u.get=i),(i=o(g.set))&&(u.set=i),(i=o(g.init))&&a.unshift(i)}else(i=o(g))&&("field"===l?a.unshift(i):u[c]=i)}d&&Object.defineProperty(d,r.name,u),h=!0},_=function(e,t,n){for(var r=arguments.length>2,a=0;a<t.length;a++)n=r?t[a].call(e,n):t[a].call(e);return r?n:void 0};(()=>{let e,t,n,r,a,s,o,i,l=[y({selector:"pg-menu-item",style:F.A,template:'<button part="label"></button>'})],c=[],d=HTMLElement,u=[],h=[],p=[],m=[],f=[],g=[],v=[],b=[],w=[],x=[],S=[],L=[];(class extends d{static{t=this}static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[k()],r=[k()],a=[k()],s=[k()],o=[k()],i=[E()],U(null,null,n,{kind:"field",name:"index",static:!1,private:!1,access:{has:e=>"index"in e,get:e=>e.index,set:(e,t)=>{e.index=t}},metadata:y},u,h),U(null,null,r,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:y},p,m),U(null,null,a,{kind:"field",name:"checked",static:!1,private:!1,access:{has:e=>"checked"in e,get:e=>e.checked,set:(e,t)=>{e.checked=t}},metadata:y},f,g),U(null,null,s,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:y},v,b),U(null,null,o,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:y},w,x),U(null,null,i,{kind:"field",name:"$label",static:!1,private:!1,access:{has:e=>"$label"in e,get:e=>e.$label,set:(e,t)=>{e.$label=t}},metadata:y},S,L),U(null,e={value:t},l,{kind:"class",name:t.name,metadata:y},null,c),t=e.value,y&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y})}static delegatesFocus=!0;index=_(this,u,void 0);label=(_(this,h),_(this,p,""));checked=(_(this,m),_(this,f,!1));disabled=(_(this,g),_(this,v,!1));items=(_(this,b),_(this,w,[]));$label=(_(this,x),_(this,S,void 0));render(e){e.label&&(this.$label.textContent=this.label),e.disabled&&(this.$label.disabled=this.disabled),e.checked&&this.$label.classList.toggle("checked",this.checked),e.checked&&!0===this.checked&&this.dispatchEvent(new CustomEvent("hasCheck",{bubbles:!0})),e.items&&this.$label.classList.toggle("more",this.items.length>0)}connectedCallback(){this.$label.addEventListener("click",(async()=>{if(this.items.length>0){const e=await D.open({source:this.$label,x:0,y:0,value:this.items[0],items:this.items});null===e?this.focus():e?this.dispatchEvent(new CustomEvent("select",{detail:{item:e}})):this.dispatchEvent(new CustomEvent("close",{detail:{depth:-1}}))}else this.dispatchEvent(new CustomEvent("select",{detail:{index:this.index}}))})),this.$label.addEventListener("keydown",(e=>{switch(e.key){case"ArrowDown":this.dispatchEvent(new CustomEvent("down",{detail:{index:this.index}})),e.preventDefault();break;case"ArrowUp":this.dispatchEvent(new CustomEvent("up",{detail:{index:this.index}})),e.preventDefault();break;case"Escape":this.dispatchEvent(new CustomEvent("close")),e.preventDefault()}}))}focus(){this.$label.focus()}getHeight(){return this.$label.getBoundingClientRect().height}constructor(){super(...arguments),_(this,L)}static{_(t,c)}})})()})();
|
package/pgMenuItemIcon.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e={209:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27rgb%2869, 60, 79, 0.5%29%27 /></svg>"},217:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),o=n.n(r),i=n(314),s=n.n(i)()(o());s.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n overflow: visible;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n translate: var(--pg-overlay-menu-_x, 0) var(--pg-overlay-menu-_y, 0);\n position-try-fallbacks: --custom-right, --custom-left;\n}\n\n@position-try --custom-right {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n}\n\n@position-try --custom-left {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(left) - anchor-size(width) + 0.25rem);\n}\n',""]);var a=new CSSStyleSheet;a.replaceSync(s.toString());const l=a},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,o,i){"string"==typeof e&&(e=[[null,e,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<e.length;c++){var d=[].concat(e[c]);r&&s[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),t.push(d))}},t}},374:(e,t,n)=>{n.d(t,{A:()=>k});var r=n(601),o=n.n(r),i=n(314),s=n.n(i),a=n(417),l=n.n(a),c=new URL(n(662),n.b),d=new URL(n(708),n.b),u=new URL(n(383),n.b),h=new URL(n(544),n.b),p=new URL(n(570),n.b),m=new URL(n(209),n.b),f=s()(o()),g=l()(c),v=l()(d),b=l()(u),y=l()(h),w=l()(p),x=l()(m);f.push([e.id,`:host {\n display: contents;\n}\n\n[part=button] {\n outline: none;\n display: flex;\n align-items: center;\n font-family: var(--pg-font-family);\n text-align: var(--pg-menu-item-text-align, left);\n background: var(--pg-menu-item-background, transparent);\n padding: var(--pg-menu-item-padding, 0.25rem 0.5rem 0.25rem 0.5rem);\n border-color: transparent;\n border-width: 0;\n border-style: solid;\n border-top-left-radius: var(--pg-menu-item-border-radius-top, 0.25rem);\n border-top-right-radius: var(--pg-menu-item-border-radius-top, 0.25rem);\n border-bottom-left-radius: var(--pg-menu-item-border-radius-bottom, 0.25rem);\n border-bottom-right-radius: var(--pg-menu-item-border-radius-bottom, 0.25rem);\n color: var(--pg-menu-item-color, #453C4F);\n}\n\n[part=button]:not(:disabled):active,\n[part=button]:not(:disabled):hover {\n background: var(--pg-menu-item-selected-background, #453C4F);\n color: #FFFFFF;\n --pg-icon-color: #FFFFFF;\n}\n\n[part=button]:not(:disabled):active {\n background: var(--pg-menu-item-active-background, #5f516e);\n}\n\n[part=button]:disabled {\n color: var(--pg-menu-item-disabled-color, rgb(69, 60, 79, 0.75));\n --pg-icon-color: var(--pg-menu-item-disabled-color, rgb(69, 60, 79, 0.75));\n}\n\n@container style(--pg-menu-_has-check: true) {\n [part=button] {\n padding-inline-start: 1.5rem;\n }\n\n [part=button].checked::before {\n position: absolute;\n translate: -1.5rem 0;\n content: var(--pg-menu-item-check, url(${g}));\n width: 1.5rem;\n height: 1.5rem;\n }\n\n [part=button].checked:active::before,\n [part=button].checked:hover::before {\n content: var(--pg-menu-item-hover-check, url(${v}));\n }\n\n [part=button].checked:disabled::before {\n content: var(--pg-menu-item-disabled-check, url(${b}));\n }\n}\n\n[part=button]:focus-visible {\n position: relative;\n}\n\n[part=button]:focus-visible::after {\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=button]:focus-visible:not(:hover)::after {\n background: var(--pg-focus-background-color, rgb(79, 143, 249, 0.1));\n}\n\n[part=icon] {\n margin-inline-end: 0.5rem;\n}\n\n[part=button].more [part=label]::after {\n content: var(--pg-menu-item-check, url(${y}));\n width: 1.5rem;\n height: 1.5rem;\n vertical-align: middle;\n translate: 0.25rem 0;\n}\n\n[part=button].more:active [part=label]::after,\n[part=button].more:hover [part=label]::after {\n content: var(--pg-menu-item-hover-check, url(${w}));\n}\n\n[part=button].more:disabled [part=label]::after {\n content: var(--pg-menu-item-disabled-check, url(${x}));\n}\n\n[part=label] {\n display: flex;\n align-items: center;\n}\n`,""]);var S=new CSSStyleSheet;S.replaceSync(f.toString());const k=S},383:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27rgb%2869, 60, 79, 0.5%29%27 /></svg>"},417:e=>{e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},544:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27rgb%2869, 60, 79%29%27 /></svg>"},570:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z%27 fill=%27white%27 /></svg>"},601:e=>{e.exports=function(e){return e[1]}},662:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27rgb%2869, 60, 79%29%27 /></svg>"},708:e=>{e.exports="data:image/svg+xml; utf8, <svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27><path d=%27M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z%27 fill=%27white%27 /></svg>"}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,exports:{}};return e[r](i,i.exports,n),i.exports}n.m=e,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),n.b="undefined"!=typeof document&&document.baseURI||self.location.href;const r=Symbol("addObserver"),o=Symbol("removeObserver"),i=Symbol("getObservers"),s=Symbol("swapObserver"),a=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],d=new Map;function u(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case a:return!0;case l:return t;case i:return d.has(e);case s:return(t,n)=>{const r=d.get(e);r.forEach(((o,i)=>{if(i.getRootNode().host===t){const t=r.get(i);d.has(n)?d.get(n).has(i)?d.get(n).get(i).push(r.get(i)):d.get(n).set(i,r.get(i)):d.set(n,new Map([[i,t]])),d.delete(e),t.forEach((e=>{e(null,h.swap,[n])}))}}))};case r:return(t,n)=>{d.has(e)?d.get(e).has(t)?d.get(e).get(t).push(n):d.get(e).set(t,[n]):d.set(e,new Map([[t,[n]]]))};case o:return t=>{d.has(e)&&(d.get(e).delete(t),0===d.get(e).size&&d.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 d.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return d.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(d.has(e)){d.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=d;const h={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const p=Symbol("init"),m=Symbol("template"),f=Symbol("style"),g=Symbol("parent");function v(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 y(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,o;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[g]||t.prototype[g][t.prototype[g].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[g]=[t.prototype],t.prototype[f]=e.style?[e.style]:[],t.prototype[m]=e.template||""):(t.prototype[g].push(t.prototype),t.prototype[f].push(e.style),t.prototype[m]=(r=t.prototype[m],(o=e.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,r):`${r}${o||""}`));const i=t.prototype.connectedCallback||(()=>{}),s=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[m]||"";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))),o=()=>{this[g].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,i.call(this),o()):Promise.all(r).then((()=>{this[p]=!0,i.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));o()}))},t.prototype.disconnectedCallback=function(){s.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 w(e){return!!e&&e.constructor===Array}function x(e,t){e[p]&&e[g].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function S(e){return null===e?"null":w(e)?"array":typeof e}function k(e){return function(t,n){const r=n.name,o=Symbol(r),c=Symbol(`${r}:type`),d=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[c]||"array"===this[c]?this[o][a]?this[o]:u(this[o]):this[o],set:t=>{const n=S(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(!w(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[o]===t)throw new Error("Setting an array to itself is not allowed.");const e=u(this[o]);if(e[i]){const n=t[a]?t[l]:t;e[s](this,n),this[o]=t,console.log(">>> trigger render???",this,r)}else this[o]=t}else this[o]=e?e(t):t,x(this,r)}})})),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=v(r);t[r]||(e.observedAttributes.push(n),t[r]=o)}return this[c]=S(t),"array"===this[c]?(this[o]=t,new Proxy(t,{get:(e,t)=>t===$?this[d]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,n)=>{if(t===$)return this[d]=n,!0;const i=Reflect.set(e,t,n);return"length"===t&&this[o].length===n||x(this,r),this[o]=n,i}})):(this[o]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[o])}}}function E(){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 $=Symbol("meta");var L=function(e,t,n,r,o,i){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),h=!1,p=n.length-1;p>=0;p--){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(h)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(e||null))};var g=(0,n[p])("accessor"===l?{get:u.get,set:u.set}:u[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(a=s(g.get))&&(u.get=a),(a=s(g.set))&&(u.set=a),(a=s(g.init))&&o.unshift(a)}else(a=s(g))&&("field"===l?o.unshift(a):u[c]=a)}d&&Object.defineProperty(d,r.name,u),h=!0},C=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0};const P=new Set,O=new Map;const A=(()=>{let e,t,n=[y()],r=[],o=HTMLElement;(class extends o{static{t=this}static{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;L(null,e={value:t},n,{kind:"class",name:t.name,metadata:i},null,r),t=e.value,i&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i}),C(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),P.add(t),new Promise((e=>{O.set(t,e)}))}close(e){this.remove(),P.delete(this);const t=O.get(this);t&&t(e),O.delete(this)}});return t})();var j=n(217),R=function(e,t,n,r,o,i){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),h=!1,p=n.length-1;p>=0;p--){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(h)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(e||null))};var g=(0,n[p])("accessor"===l?{get:u.get,set:u.set}:u[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(a=s(g.get))&&(u.get=a),(a=s(g.set))&&(u.set=a),(a=s(g.init))&&o.unshift(a)}else(a=s(g))&&("field"===l?o.unshift(a):u[c]=a)}d&&Object.defineProperty(d,r.name,u),h=!0},F=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0};const M=[],T=[];const z=(()=>{let e,t,n,r,o,i,s,a,l,c,d=[y({selector:"pg-overlay-sub-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:j.A})],u=[],h=A,p=[],m=[],f=[],g=[],v=[],b=[],w=[],x=[],S=[],$=[],L=[],C=[],P=[],O=[],z=[],D=[];(class extends h{static{t=this}static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;n=[E()],r=[E()],o=[k()],i=[k()],s=[k()],a=[k()],l=[k()],c=[k()],R(null,null,n,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:y},p,m),R(null,null,r,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:y},f,g),R(null,null,o,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:y},v,b),R(null,null,i,{kind:"field",name:"x",static:!1,private:!1,access:{has:e=>"x"in e,get:e=>e.x,set:(e,t)=>{e.x=t}},metadata:y},w,x),R(null,null,s,{kind:"field",name:"y",static:!1,private:!1,access:{has:e=>"y"in e,get:e=>e.y,set:(e,t)=>{e.y=t}},metadata:y},S,$),R(null,null,a,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:y},L,C),R(null,null,l,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:y},P,O),R(null,null,c,{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:y},z,D),R(null,e={value:t},d,{kind:"class",name:t.name,metadata:y},null,u),t=e.value,y&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y}),F(t,u)}$overlay=F(this,p,void 0);$menu=(F(this,m),F(this,f,void 0));source=(F(this,g),F(this,v,null));x=(F(this,b),F(this,w,0));y=(F(this,x),F(this,S,0));default=(F(this,$),F(this,L,null));items=(F(this,C),F(this,P,[]));value=(F(this,O),F(this,z,null));render(e){e.items&&(this.$menu.items=this.items)}connectedCallback(){M.pop()?.close(),M.push(this),T.push(this),this.$menu.addEventListener("select",this.#e.bind(this)),this.$menu.addEventListener("close",this.#t.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#n.bind(this));this.source?.getBoundingClientRect();this.$overlay.style.setProperty("--pg-overlay-menu-_x","0px"),this.$overlay.style.setProperty("--pg-overlay-menu-_y","0px"),this.$menu.focus(0),this.#r=this.#o.bind(this),document.addEventListener("pointerdown",this.#r)}#i=(F(this,D),!1);#r;#o(e){this.#i=e.composedPath().includes(this.source)}#n(e){"closed"===e.newState&&0===T.length&&this.#i&&(console.log(e),this.source?.focus())}disconnectedCallback(){T.pop(),document.removeEventListener("pointerdown",this.#r)}#t(e){const{depth:t}=e.detail;console.log("close",t),1===t?this.close(null):this.close()}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}});return t})();var D=n(374),U=function(e,t,n,r,o,i){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),h=!1,p=n.length-1;p>=0;p--){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(h)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(e||null))};var g=(0,n[p])("accessor"===l?{get:u.get,set:u.set}:u[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(a=s(g.get))&&(u.get=a),(a=s(g.set))&&(u.set=a),(a=s(g.init))&&o.unshift(a)}else(a=s(g))&&("field"===l?o.unshift(a):u[c]=a)}d&&Object.defineProperty(d,r.name,u),h=!0},Z=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0};(()=>{let e,t,n,r,o,i,s,a,l,c,d,u=[y({selector:"pg-menu-item-icon",style:D.A,template:'<button part="button"> <pg-icon part="icon"></pg-icon> <span part="label"></span> </button>'})],h=[],p=HTMLElement,m=[],f=[],g=[],v=[],b=[],w=[],x=[],S=[],$=[],L=[],C=[],P=[],O=[],A=[],j=[],R=[],F=[],M=[];(class extends p{static{t=this}static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(p[Symbol.metadata]??null):void 0;n=[k()],r=[k()],o=[k()],i=[k()],s=[k()],a=[k()],l=[E()],c=[E()],d=[E()],U(null,null,n,{kind:"field",name:"index",static:!1,private:!1,access:{has:e=>"index"in e,get:e=>e.index,set:(e,t)=>{e.index=t}},metadata:y},m,f),U(null,null,r,{kind:"field",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:y},g,v),U(null,null,o,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:y},b,w),U(null,null,i,{kind:"field",name:"checked",static:!1,private:!1,access:{has:e=>"checked"in e,get:e=>e.checked,set:(e,t)=>{e.checked=t}},metadata:y},x,S),U(null,null,s,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:y},$,L),U(null,null,a,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:y},C,P),U(null,null,l,{kind:"field",name:"$icon",static:!1,private:!1,access:{has:e=>"$icon"in e,get:e=>e.$icon,set:(e,t)=>{e.$icon=t}},metadata:y},O,A),U(null,null,c,{kind:"field",name:"$button",static:!1,private:!1,access:{has:e=>"$button"in e,get:e=>e.$button,set:(e,t)=>{e.$button=t}},metadata:y},j,R),U(null,null,d,{kind:"field",name:"$label",static:!1,private:!1,access:{has:e=>"$label"in e,get:e=>e.$label,set:(e,t)=>{e.$label=t}},metadata:y},F,M),U(null,e={value:t},u,{kind:"class",name:t.name,metadata:y},null,h),t=e.value,y&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y})}static delegatesFocus=!0;index=Z(this,m,void 0);icon=(Z(this,f),Z(this,g,"M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"));label=(Z(this,v),Z(this,b,""));checked=(Z(this,w),Z(this,x,!1));disabled=(Z(this,S),Z(this,$,!1));items=(Z(this,L),Z(this,C,[]));$icon=(Z(this,P),Z(this,O,void 0));$button=(Z(this,A),Z(this,j,void 0));$label=(Z(this,R),Z(this,F,void 0));render(e){e.icon&&(this.$icon.path=this.icon),e.label&&(this.$label.textContent=this.label),e.disabled&&(this.$button.disabled=this.disabled),e.checked&&this.$button.classList.toggle("checked",this.checked),e.items&&this.$button.classList.toggle("more",this.items.length>0),e.checked&&!0===this.checked&&this.dispatchEvent(new CustomEvent("hasCheck",{bubbles:!0}))}connectedCallback(){this.$button.addEventListener("click",(async()=>{if(this.items.length>0){const e=await z.open({source:this.$button,x:0,y:0,value:this.items[0],items:this.items});null===e?this.focus():e?this.dispatchEvent(new CustomEvent("select",{detail:{item:e}})):this.dispatchEvent(new CustomEvent("close",{detail:{depth:-1}}))}else this.dispatchEvent(new CustomEvent("select",{detail:{index:this.index,item:this.items[this.index]}}))})),this.$button.addEventListener("keydown",(async e=>{switch(e.key){case"ArrowDown":this.dispatchEvent(new CustomEvent("down",{detail:{index:this.index}})),e.preventDefault();break;case"ArrowUp":this.dispatchEvent(new CustomEvent("up",{detail:{index:this.index}})),e.preventDefault();break;case"ArrowLeft":this.dispatchEvent(new CustomEvent("close",{detail:{depth:1}})),e.preventDefault();break;case"ArrowRight":if(this.items.length>0){const e=await z.open({source:this.$button,x:0,y:0,value:this.items[0],items:this.items});null===e?this.focus():e?this.dispatchEvent(new CustomEvent("select",{detail:{item:e}})):this.dispatchEvent(new CustomEvent("close",{detail:{depth:-1}}))}e.preventDefault();break;case"Escape":this.dispatchEvent(new CustomEvent("close",{detail:{depth:-1}})),e.preventDefault()}}))}focus(){this.$button.focus()}getHeight(){return this.$label.getBoundingClientRect().height}constructor(){super(...arguments),Z(this,M)}static{Z(t,h)}})})()})();
|
package/pgModalAlert.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,o,a){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(r)for(var i=0;i<this.length;i++){var l=this[i][0];null!=l&&(s[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&s[d[0]]||(void 0!==a&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=a),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),o&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=o):d[4]="".concat(o)),t.push(d))}},t}},521:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),o=n.n(r),a=n(314),s=n.n(a)()(o());s.push([e.id,".backdrop {\n display: flex;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.6);\n justify-content: center;\n align-items: center;\n}\n.dialog {\n background: #fff;\n border-radius: 0.5rem;\n box-shadow: 0 1px 1rem rgba(0, 0, 0, 0.5);\n overflow: hidden;\n min-width: 15rem;\n}\nheader {\n border-bottom: 1px solid #ccc;\n background: #f1f1f1;\n padding: 0.75rem 1rem;\n}\nheader h2 {\n font-size: 1.25rem;\n margin: 0;\n font-weight: normal;\n}\nmain {\n padding: 0.5rem 1rem;\n}\nfooter {\n display: flex;\n flex-direction: row;\n padding: 0.75rem 1rem;\n border-top: 1px solid #ccc;\n background: #f1f1f1;\n justify-content: flex-end;\n gap: 0.5rem;\n}",""]);var i=new CSSStyleSheet;i.replaceSync(s.toString());const l=i},601:e=>{e.exports=function(e){return e[1]}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={id:r,exports:{}};return e[r](a,a.exports,n),a.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"),o=Symbol("removeObserver"),a=Symbol("getObservers"),s=Symbol("swapObserver"),i=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],d=new Map;function h(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case i:return!0;case l:return t;case a:return d.has(e);case s:return(t,n)=>{const r=d.get(e);r.forEach(((o,a)=>{if(a.getRootNode().host===t){const t=r.get(a);d.has(n)?d.get(n).has(a)?d.get(n).get(a).push(r.get(a)):d.get(n).set(a,r.get(a)):d.set(n,new Map([[a,t]])),d.delete(e),t.forEach((e=>{e(null,p.swap,[n])}))}}))};case r:return(t,n)=>{d.has(e)?d.get(e).has(t)?d.get(e).get(t).push(n):d.get(e).set(t,[n]):d.set(e,new Map([[t,[n]]]))};case o:return t=>{d.has(e)&&(d.get(e).delete(t),0===d.get(e).size&&d.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]?h(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(c.includes(n))return d.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return d.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return h(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(d.has(e)){d.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=d;const p={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const u=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function g(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 v(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,o;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[y]||t.prototype[y][t.prototype[y].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[y]=[t.prototype],t.prototype[m]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[y].push(t.prototype),t.prototype[m].push(e.style),t.prototype[f]=(r=t.prototype[f],(o=e.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,r):`${r}${o||""}`));const a=t.prototype.connectedCallback||(()=>{}),s=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[f]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[m].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))),o=()=>{this[y].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[b(t)]=!0,e)),{}):{})}))};0===r.length?(this[u]=!0,a.call(this),o()):Promise.all(r).then((()=>{this[u]=!0,a.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));o()}))},t.prototype.disconnectedCallback=function(){s.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 w(e){return!!e&&e.constructor===Array}function S(e,t){e[u]&&e[y].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function E(e){return null===e?"null":w(e)?"array":typeof e}function $(e){return function(t,n){const r=n.name,o=Symbol(r),c=Symbol(`${r}:type`),d=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[c]||"array"===this[c]?this[o][i]?this[o]:h(this[o]):this[o],set:t=>{const n=E(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(!w(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[o]===t)throw new Error("Setting an array to itself is not allowed.");const e=h(this[o]);if(e[a]){const n=t[i]?t[l]:t;e[s](this,n),this[o]=t,console.log(">>> trigger render???",this,r)}else this[o]=t}else this[o]=e?e(t):t,S(this,r)}})})),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=g(r);t[r]||(e.observedAttributes.push(n),t[r]=o)}return this[c]=E(t),"array"===this[c]?(this[o]=t,new Proxy(t,{get:(e,t)=>t===k?this[d]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,n)=>{if(t===k)return this[d]=n,!0;const a=Reflect.set(e,t,n);return"length"===t&&this[o].length===n||S(this,r),this[o]=n,a}})):(this[o]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[o])}}}function x(){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 k=Symbol("meta");var P=n(521),O=function(e,t,n,r,o,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),p=!1,u=n.length-1;u>=0;u--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var y=(0,n[u])("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");(i=s(y.get))&&(h.get=i),(i=s(y.set))&&(h.set=i),(i=s(y.init))&&o.unshift(i)}else(i=s(y))&&("field"===l?o.unshift(i):h[c]=i)}d&&Object.defineProperty(d,r.name,h),p=!0},A=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0};const j=new Set,T=new Map;const C=(()=>{let e,t,n=[v()],r=[],o=HTMLElement;(class extends o{static{t=this}static{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;O(null,e={value:t},n,{kind:"class",name:t.name,metadata:a},null,r),t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),A(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),j.add(t),new Promise((e=>{T.set(t,e)}))}close(e){this.remove(),j.delete(this);const t=T.get(this);t&&t(e),T.delete(this)}});return t})();var R=function(e,t,n,r,o,a){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),p=!1,u=n.length-1;u>=0;u--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");a.push(s(e||null))};var y=(0,n[u])("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");(i=s(y.get))&&(h.get=i),(i=s(y.set))&&(h.set=i),(i=s(y.init))&&o.unshift(i)}else(i=s(y))&&("field"===l?o.unshift(i):h[c]=i)}d&&Object.defineProperty(d,r.name,h),p=!0},z=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0};(()=>{let e,t,n,r,o,a,s,i,l,c=[v({selector:"pg-modal-alert",template:'<div class="backdrop"> <div class="dialog" role="dialog" id="dialog1" aria-labelledby="dialog1_label" aria-modal="true"> <header part="header"> <h2 id="dialog1_label" class="dialog_label" part="headerText"> Add Delivery Address </h2> </header> <main> <p part="message"></p> </main> <footer> <pg-button part="no">No</pg-button> <pg-button part="yes">Yes</pg-button> </footer> </div> </div>',style:P.A})],d=[],h=C,p=[],u=[],f=[],m=[],y=[],g=[],b=[],w=[],S=[],E=[],k=[],O=[],A=[],j=[];(class extends h{static{t=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;n=[$()],r=[$()],o=[x()],a=[x()],s=[x()],i=[x()],l=[x()],R(null,null,n,{kind:"field",name:"header",static:!1,private:!1,access:{has:e=>"header"in e,get:e=>e.header,set:(e,t)=>{e.header=t}},metadata:v},p,u),R(null,null,r,{kind:"field",name:"message",static:!1,private:!1,access:{has:e=>"message"in e,get:e=>e.message,set:(e,t)=>{e.message=t}},metadata:v},f,m),R(null,null,o,{kind:"field",name:"$header",static:!1,private:!1,access:{has:e=>"$header"in e,get:e=>e.$header,set:(e,t)=>{e.$header=t}},metadata:v},y,g),R(null,null,a,{kind:"field",name:"$headerText",static:!1,private:!1,access:{has:e=>"$headerText"in e,get:e=>e.$headerText,set:(e,t)=>{e.$headerText=t}},metadata:v},b,w),R(null,null,s,{kind:"field",name:"$message",static:!1,private:!1,access:{has:e=>"$message"in e,get:e=>e.$message,set:(e,t)=>{e.$message=t}},metadata:v},S,E),R(null,null,i,{kind:"field",name:"$yes",static:!1,private:!1,access:{has:e=>"$yes"in e,get:e=>e.$yes,set:(e,t)=>{e.$yes=t}},metadata:v},k,O),R(null,null,l,{kind:"field",name:"$no",static:!1,private:!1,access:{has:e=>"$no"in e,get:e=>e.$no,set:(e,t)=>{e.$no=t}},metadata:v},A,j),R(null,e={value:t},c,{kind:"class",name:t.name,metadata:v},null,d),t=e.value,v&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v}),z(t,d)}header=z(this,p,"Are you sure?");message=(z(this,u),z(this,f,"Are you sure?"));$header=(z(this,m),z(this,y,void 0));$headerText=(z(this,g),z(this,b,void 0));$message=(z(this,w),z(this,S,void 0));$yes=(z(this,E),z(this,k,void 0));$no=(z(this,O),z(this,A,void 0));#e=z(this,j);connectedCallback(){this.$yes.addEventListener("click",this.#t.bind(this)),this.$no.addEventListener("click",this.#n.bind(this)),this.#e??=this.#r.bind(this),document.addEventListener("keydown",this.#e)}disconnectedCallback(){document.removeEventListener("keydown",this.#e)}#r(e){"Escape"===e.key&&this.close(null)}#t(){this.close(!0)}#n(){this.close(!1)}render(e){e.header&&(this.$headerText.innerText=this.header),e.message&&(this.$message.innerText=this.message)}})})()})();
|
package/pgModification.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",o=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),o&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),o&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,o,r,i){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(o)for(var s=0;s<this.length;s++){var c=this[s][0];null!=c&&(a[c]=!0)}for(var p=0;p<t.length;p++){var d=[].concat(t[p]);o&&a[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),e.push(d))}},e}},601:t=>{t.exports=function(t){return t[1]}},857:(t,e,n)=>{n.d(e,{A:()=>c});var o=n(601),r=n.n(o),i=n(314),a=n.n(i)()(r());a.push([t.id,":host {\n pointer-events: none;\n}\n\n[part~=tooltip] {\n position: relative;\n}\n\n[part~=tooltipText] {\n position: absolute;\n background: #737E9E;\n border-radius: 0.25rem;\n color: #FFF;\n padding: 0.15rem 0.5rem 0.3rem 0.5rem;\n white-space: nowrap;\n left: 0;\n top: 0;\n}\n\n[part~=tooltipArrow] {\n left: 16px;\n top: -7px;\n}\n\n[part~=tooltipArrow],\n[part~=tooltipArrow]::before {\n position: absolute;\n width: 10px;\n height: 10px;\n}\n\n[part~=tooltipArrow]::before {\n content: '';\n transform: rotate(45deg);\n background: #737E9E;\n}",""]);var s=new CSSStyleSheet;s.replaceSync(a.toString());const c=s},947:(t,e,n)=>{n.d(e,{A:()=>c});var o=n(601),r=n.n(o),i=n(314),a=n.n(i)()(r());a.push([t.id,':host {\n display: flex;\n flex-direction: column;\n color: #453C4F;\n}\n\n.invalid {\n color: #721c24;\n background-color: #f8d7da;\n border-color: #f5c6cb;\n}\n\nh2 {\n font-weight: normal;\n font-size: 1.25rem;\n margin: 0.5rem 0 0.5rem 0;\n}\n\n/* Individual Templates */\n\n[part="news"] {\n display: grid;\n grid-template-columns: 3.5rem 1fr;\n grid-template-rows: 3.25rem auto;\n padding: 0.25rem;\n}\n[part="news"] [part="avatar"] {\n grid-column: 1;\n}\n[part="news"] [part="label"] {\n grid-column: 1;\n grid-row: 2;\n text-align: center;\n padding-right: 0.5rem;\n}\n[part="news"] [part="markdown"] {\n grid-column: 2;\n grid-row: 1 / span 2;\n border: 1px solid #DDD;\n padding: 0 1rem;\n background: #fff;\n border-radius: 0.25rem;\n}\n\n[part="iconCreated"],\n[part="iconRenamed"],\n[part="iconDeleted"],\n[part="iconAliasCreated"],\n[part="iconAliasDeleted"],\n[part="iconTagCreated"],\n[part="iconTagDeleted"],\n[part="iconAuthorModified"],\n[part="iconDeprecated"] {\n display: grid;\n grid-template-columns: 3.5rem 3.5rem 1fr auto auto;\n padding: 0.25rem;\n}\n[part="iconCreated"] [part="avatar"],\n[part="iconModified"] [part="avatar"],\n[part="iconRenamed"] [part="avatar"],\n[part="iconDeleted"] [part="avatar"],\n[part="iconAliasCreated"] [part="avatar"],\n[part="iconAliasDeleted"] [part="avatar"],\n[part="iconTagCreated"] [part="avatar"],\n[part="iconTagDeleted"] [part="avatar"],\n[part="iconAuthorModified"] [part="avatar"],\n[part="iconDeprecated"] [part="avatar"] {\n grid-column: 1;\n}\n[part="iconCreated"] [part="icon"],\n[part="iconModified"] [part="iconDataBefore"],\n[part="iconModified"] [part="iconDataAfter"],\n[part="iconRenamed"] [part="icon"],\n[part="iconDeleted"] [part="icon"],\n[part="iconAliasCreated"] [part="icon"],\n[part="iconAliasDeleted"] [part="icon"],\n[part="iconTagCreated"] [part="icon"],\n[part="iconTagDeleted"] [part="icon"],\n[part="iconAuthorModified"] [part="icon"],\n[part="iconDeprecated"] [part="icon"] {\n grid-column: 2;\n --pg-icon-width: 3rem;\n --pg-icon-height: 3rem;\n width: 3rem;\n border: 1px solid #ddd;\n background: #fff;\n border-radius: 0.25rem;\n align-self: flex-start;\n}\n[part="iconCreated"] [part="content"],\n[part="iconModified"] [part="content"],\n[part="iconRenamed"] [part="content"],\n[part="iconDeleted"] [part="content"],\n[part="iconAliasCreated"] [part="content"],\n[part="iconAliasDeleted"] [part="content"],\n[part="iconTagCreated"] [part="content"],\n[part="iconTagDeleted"] [part="content"],\n[part="iconAuthorModified"] [part="content"],\n[part="iconDeprecated"] [part="content"] {\n grid-column: 3;\n align-content: center;\n display: flex;\n align-items: center;\n}\n[part="iconCreated"] [part="content"] code,\n[part="iconModified"] [part="content"] code,\n[part="iconRenamed"] [part="content"] code,\n[part="iconDeleted"] [part="content"] code,\n[part="iconAliasCreated"] [part="content"] code,\n[part="iconAliasDeleted"] [part="content"] code,\n[part="iconTagCreated"] [part="content"] code,\n[part="iconTagDeleted"] [part="content"] code,\n[part="iconAuthorModified"] [part="content"] code,\n[part="iconDeprecated"] [part="content"] code {\n display: inline-block;\n background: rgba(0, 0, 0, 0.05);\n padding: 0.125rem 0.25rem;\n border-radius: 0.125rem;\n text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);\n border: 1px solid rgba(69, 60, 79, 0.2);\n line-height: 1.125rem;\n}\n[part="iconCreated"] [part="issue"],\n[part="iconModified"] [part="issue"],\n[part="iconRenamed"] [part="issue"],\n[part="iconDeleted"] [part="issue"],\n[part="iconAliasCreated"] [part="issue"],\n[part="iconAliasDeleted"] [part="issue"],\n[part="iconTagCreated"] [part="issue"],\n[part="iconTagDeleted"] [part="issue"],\n[part="iconDescriptionModified"] [part="issue"],\n[part="iconAuthorModified"] [part="issue"],\n[part="iconDeprecated"] [part="issue"] {\n grid-column: 4;\n display: flex;\n align-self: center;\n text-decoration: none;\n padding: 0.25rem 0.5rem;\n border: 1px solid #453C4F;\n color: #453C4F;\n border-radius: 0.25rem;\n}\n[part="iconCreated"] [part="issue"]:hover,\n[part="iconModified"] [part="issue"]:hover,\n[part="iconRenamed"] [part="issue"]:hover,\n[part="iconDeleted"] [part="issue"]:hover,\n[part="iconAliasCreated"] [part="issue"]:hover,\n[part="iconAliasDeleted"] [part="issue"]:hover,\n[part="iconTagCreated"] [part="issue"]:hover,\n[part="iconTagDeleted"] [part="issue"]:hover,\n[part="iconDescriptionModified"] [part="issue"]:hover,\n[part="iconAuthorModified"] [part="issue"]:hover,\n[part="iconDeprecated"] [part="issue"]:hover {\n background: #453C4F;\n color: #fff;\n}\n.edit [part="iconCreated"] [part="edit"],\n.edit [part="iconModified"] [part="edit"],\n.edit [part="iconRenamed"] [part="edit"],\n.edit [part="iconDeleted"] [part="edit"],\n.edit [part="iconAliasCreated"] [part="edit"],\n.edit [part="iconAliasDeleted"] [part="edit"],\n.edit [part="iconTagCreated"] [part="edit"],\n.edit [part="iconTagDeleted"] [part="edit"],\n.edit [part="iconDescriptionModified"] [part="edit"],\n.edit [part="iconAuthorModified"] [part="edit"],\n.edit [part="iconDeprecated"] [part="edit"] {\n display: flex;\n}\n[part="iconCreated"] [part="edit"],\n[part="iconModified"] [part="edit"],\n[part="iconRenamed"] [part="edit"],\n[part="iconDeleted"] [part="edit"],\n[part="iconAliasCreated"] [part="edit"],\n[part="iconAliasDeleted"] [part="edit"],\n[part="iconTagCreated"] [part="edit"],\n[part="iconTagDeleted"] [part="edit"],\n[part="iconDescriptionModified"] [part="edit"],\n[part="iconAuthorModified"] [part="edit"],\n[part="iconDeprecated"] [part="edit"] {\n display: none;\n grid-column: 5;\n align-self: center;\n padding: 0.25rem;\n border: 0;\n border-radius: 0.25rem;\n margin-left: 0.5rem;\n cursor: pointer;\n}\n[part="iconCreated"] [part="edit"]:hover,\n[part="iconModified"] [part="edit"]:hover,\n[part="iconRenamed"] [part="edit"]:hover,\n[part="iconDeleted"] [part="edit"]:hover,\n[part="iconAliasCreated"] [part="edit"]:hover,\n[part="iconAliasDeleted"] [part="edit"]:hover,\n[part="iconTagCreated"] [part="edit"]:hover,\n[part="iconTagDeleted"] [part="edit"]:hover,\n[part="iconDescriptionModified"] [part="edit"]:hover,\n[part="iconAuthorModified"] [part="edit"]:hover,\n[part="iconDeprecated"] [part="edit"]:hover {\n background: #453C4F;\n --pg-icon-color: #fff;\n}\n\n/* Individiual Tweaks */\n[part="iconCreated"] [part="icon"] {\n background: #d1e7dd;\n border-color: #badbcc;\n}\n\n[part="iconRenamed"] [part="icon"] {\n background-color: #fff3cd;\n border-color: #ffecb5;\n}\n\n[part="iconDeleted"] [part="icon"] {\n background: #f5c6cb;\n border-color: #d06e78;\n}\n\n[part="iconModified"] {\n display: grid;\n grid-template-columns: 3.5rem 3.5rem 3.5rem 1fr auto auto;\n padding: 0.25rem;\n}\n[part="iconModified"] [part="iconDataBefore"] {\n opacity: 0.4;\n}\n[part="iconModified"] [part="iconDataAfter"] {\n grid-column: 3;\n}\n[part="iconModified"] [part="content"] {\n grid-column: 4;\n}\n[part="iconModified"] [part="issue"] {\n grid-column: 5;\n}\n[part="iconModified"] [part="edit"] {\n grid-column: 6;\n}\n\n[part="iconAliasCreated"] [part="icon"],\n[part="iconAliasDeleted"] [part="icon"] {\n background-color: #DDC6E7;\n border-color: 1px solid #DBBDE5;\n}\n\n[part="iconTagCreated"] [part="icon"],\n[part="iconTagDeleted"] [part="icon"] {\n background-color: #cff4fc;\n border-color: #b6effb;\n}\n\n[part="iconDescriptionModified"] {\n display: grid;\n grid-template-columns: 3.5rem 3.5rem 1fr 0.5rem 1fr auto;\n grid-template-rows: auto auto;\n padding: 0.25rem;\n}\n[part="iconDescriptionModified"] [part="avatar"] {\n grid-column: 1;\n grid-row: 1 / span 2;\n}\n[part="iconDescriptionModified"] [part="icon"] {\n grid-column: 2;\n grid-row: 1 / span 2;\n --pg-icon-width: 3rem;\n --pg-icon-height: 3rem;\n width: 3rem;\n border: 1px solid #ddd;\n background: #fff;\n border-radius: 0.25rem;\n align-self: flex-start;\n}\n[part="iconDescriptionModified"] [part="iconDescriptionBefore"] {\n grid-column: 3;\n grid-row: 1 / span 2;\n border: 1px solid #DDD;\n padding: 0 1rem;\n background: #fff;\n border-radius: 0.25rem;\n}\n[part="iconDescriptionModified"] [part="iconDescriptionAfter"] {\n grid-column: 5;\n grid-row: 1 / span 2;\n border: 1px solid #DDD;\n padding: 0 1rem;\n background: #fff;\n border-radius: 0.25rem;\n}\n[part="iconDescriptionModified"] [part="issue"] {\n grid-column: 6;\n grid-row: 1;\n margin-left: 0.5rem;\n}\n[part="iconDescriptionModified"] [part="edit"] {\n grid-column: 6;\n grid-row: 2;\n justify-content: center;\n margin-top: 0.25rem;\n}\n\n.added,\n.created {\n border-bottom: 3px solid #badbcc;\n}\n\n.removed,\n.deleted {\n border-bottom: 3px solid #f5c6cb;\n}',""]);var s=new CSSStyleSheet;s.replaceSync(a.toString());const c=s}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var i=e[o]={id:o,exports:{}};return t[o](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 o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const o=Symbol("addObserver"),r=Symbol("removeObserver"),i=Symbol("getObservers"),a=Symbol("swapObserver"),s=Symbol("isProxy"),c=Symbol("getTarget"),p=["fill","pop","push","reverse","shift","sort","splice","unshift"],d=new Map;function l(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case s:return!0;case c:return e;case i:return d.has(t);case a:return(e,n)=>{const o=d.get(t);o.forEach(((r,i)=>{if(i.getRootNode().host===e){const e=o.get(i);d.has(n)?d.get(n).has(i)?d.get(n).get(i).push(o.get(i)):d.get(n).set(i,o.get(i)):d.set(n,new Map([[i,e]])),d.delete(t),e.forEach((t=>{t(null,u.swap,[n])}))}}))};case o:return(e,n)=>{d.has(t)?d.get(t).has(e)?d.get(t).get(e).push(n):d.get(t).set(e,[n]):d.set(t,new Map([[e,[n]]]))};case r:return e=>{d.has(t)&&(d.get(t).delete(e),0===d.get(t).size&&d.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]?l(e[n]):e[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(p.includes(n))return d.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return d.get(e).forEach(((t,o)=>{t.forEach((t=>{t(e,n,arguments)}))})),t}:Reflect.get(e,n);if(e[n]instanceof Array)return l(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(d.has(t)){d.get(t).forEach(((t,o)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=d;const u={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const f=Symbol("init"),h=Symbol("template"),m=Symbol("style"),g=Symbol("parent");function v(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 w(t={}){return function(e,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var o,r;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[m]=t.style?[t.style]:[],e.prototype[h]=t.template||""):(e.prototype[g].push(e.prototype),e.prototype[m].push(t.style),e.prototype[h]=(o=e.prototype[h],(r=t.template||null)&&r.match(/<parent\/>/)?r.replace(/<parent\/>/,o):`${o}${r||""}`));const i=e.prototype.connectedCallback||(()=>{}),a=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[f]||void 0!==t.template||void 0!==t.style)if(this[f]){if(this[f]&&t.style);else if(this[f]&&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),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=e.prototype[m].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),o.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 o=Array.from(n.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),r=()=>{this[g].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[b(e)]=!0,t)),{}):{})}))};0===o.length?(this[f]=!0,i.call(this),r()):Promise.all(o).then((()=>{this[f]=!0,i.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));r()}))},e.prototype.disconnectedCallback=function(){a.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 y(t){return!!t&&t.constructor===Array}function D(t,e){t[f]&&t[g].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function A(t){return null===t?"null":y(t)?"array":typeof t}function x(t){return function(e,n){const o=n.name,r=Symbol(o),p=Symbol(`${o}:type`),d=Symbol(`${o}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,o,{get:()=>"object"===this[p]||"array"===this[p]?this[r][s]?this[r]:l(this[r]):this[r],set:e=>{const n=A(t?t(e):e);if("index"!==o&&this[p]!==n&&"null"!==this[p]&&"null"!==n)throw new Error(`@Prop() ${o} with type '${this[p]}' cannot be set to ${n}.`);if("array"===this[p]){if(!y(e))throw new PropError(`Array "${o}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,o)?.set);if(this[r]===e)throw new Error("Setting an array to itself is not allowed.");const t=l(this[r]);if(t[i]){const n=e[s]?e[c]:e;t[a](this,n),this[r]=e,console.log(">>> trigger render???",this,o)}else this[r]=e}else this[r]=t?t(e):e,D(this,o)}})})),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(!n.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,n=v(o);e[o]||(t.observedAttributes.push(n),e[o]=r)}return this[p]=A(e),"array"===this[p]?(this[r]=e,new Proxy(e,{get:(t,e)=>e===C?this[d]:(console.log("errr???"),Reflect.get(this[r],e)),set:(t,e,n)=>{if(e===C)return this[d]=n,!0;const i=Reflect.set(t,e,n);return"length"===e&&this[r].length===n||D(this,o),this[r]=n,i}})):(this[r]=t?t(this.getAttribute(o)??e):this.getAttribute(o)??e,this[r])}}}function I(){return function(t,e){const n=e.name,o=n.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,n,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${o}]`))}})}))}}Symbol("hasProxy");const C=Symbol("meta");var M=n(947);class Alias{id;name;match=!1;constructor(t,e){void 0!==t&&(this.id=t),void 0!==e&&(this.name=e)}from(t){return void 0!==t.id&&(this.id=t.id),void 0!==t.name&&(this.name=t.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(t){return this.id=t.id,this.github=t.github,this.name=t.name,"string"==typeof t.base64&&(t.base64.match(/^data/)?this.base64=t.base64:this.base64=`data:image/png;base64,${t.base64}`),this.iconCount=t.iconCount,this.description=t.description,this.website=t.website,this.sponsored=t.sponsored,this.sponsorship=`https://github.com/users/${t.github}/sponsorship`,this.core=t.core,this}}class Tag{id;name;url;count;from(t){return void 0!==t.id&&(this.id=t.id),void 0!==t.name&&(this.name=t.name),void 0!==t.url&&(this.url=t.url),void 0!==t.count&&(this.count=t.count),this}to(){return{name:this.name,url:this.url,count:this.count}}}class Style{id;name;count=null;from(t){return this.id=t.id,this.name=t.name,this.count=t.count,this}}class FontIcon{id;codepoint;font;version;from(t){return this.id=t.id,this.codepoint=t.codepoint,this.font=t.font,this.version=t.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(t,e){this.name=t||null,this.data=e||null}from(t){return this.id=t.id,this.packageId=t.packageId,this.baseIconId=t.baseIconId,this.name=t.name,this.description=t.description,this.data=t.data,t.version&&(this.version=t.version),t.fontIcon&&(this.fontIcon=t.fontIcon),t.user&&(this.user=(new User).from(t.user)),t.aliases&&(this.aliases=t.aliases.map((t=>(new Alias).from(t)))),t.tags&&(this.tags=t.tags.map((t=>(new Tag).from(t)))),t.styles&&(this.styles=t.styles.map((t=>(new Style).from(t)))),"boolean"==typeof t.published&&(this.published=t.published),"boolean"==typeof t.deprecated&&(this.deprecated=t.deprecated),t.codepoint&&(this.codepoint=t.codepoint),t.fontIcons&&(this.fontIcons=t.fontIcons.map((t=>(new FontIcon).from(t)))),this}to(){const{id:t,name:e,description:n,data:o,version:r,fontIcon:i,packageId:a,baseIconId:s,aliases:c,tags:p}=this;return{id:t,name:e,description:n,data:o,version:r,fontIcon:i,packageId:a,baseIconId:s,aliases:c.map((t=>t.to())),tags:p.map((t=>t.to()))}}}class Modification{id;modificationId;packageId;user;icon;iconNameBefore;iconNameAfter;iconDescriptionBefore;iconDescriptionAfter;iconDataBefore;iconDataAfter;text;date;issue;isVisible;constructor(){}from(t){return this.id=t.id,this.modificationId=t.modificationId,this.packageId=t.packageId,this.user=(new User).from(t.user),this.icon=(new Icon).from(t.icon),this.iconNameBefore=t.iconNameBefore,this.iconNameAfter=t.iconNameAfter,this.iconDescriptionBefore=t.iconDescriptionBefore,this.iconDescriptionAfter=t.iconDescriptionAfter,this.iconDataBefore=t.iconDataBefore,this.iconDataAfter=t.iconDataAfter,this.text=t.text,this.date=t.date,this.issue=t.issue,this.isVisible=t.isVisible,this}}var T;!function(t){t.IconAliasCreated="691c8829-b1e7-11e7-bf5c-94188269ec50",t.IconAliasDeleted="f1f70a76-b975-11e9-8ca0-94188269ec50",t.IconCreated="AFFE875E-01BC-4A34-9BE3-27625A155B28",t.IconDeleted="B1CE1713-A18A-4E9D-9E26-D0B4E44A1FAC",t.IconModified="1506F66B-CC2A-4575-A20A-DC138628977A",t.IconRenamed="F7B6D49B-A86F-49AC-AF92-6B9D0DF6188B",t.IconTagCreated="a185a9e8-c192-11e7-bf5c-94188269ec50",t.IconTagDeleted="ffe6b5f6-b975-11e9-8ca0-94188269ec50",t.IconDescriptionModified="3c638179-c4ca-11e8-9f27-94188269ec50",t.IconAuthorModified="254591d0-b28e-11e9-8ca0-94188269ec50",t.WebfontPublished="66B9FA99-1FAA-4D8F-B87F-B6F3CA444624",t.News="B4DEB3A8-A146-4086-9D7B-B67842A9CCB8",t.IconDeprecated="f92f310f-bfed-11e9-8ca0-94188269ec50",t.IconWorkInProgress="e262be80-bfed-11e9-8ca0-94188269ec50",t.IconLive="f92f2ba6-bfed-11e9-8ca0-94188269ec50",t.IconPublished="e262b92e-bfed-11e9-8ca0-94188269ec50",t.Date="date"}(T||(T={}));var S=n(857);const E="top",k="top-start",$="top-end",B="right",N="right-start",R="right-end",L="bottom",P="bottom-start",F="bottom-end",O="left",j="left-start",z="left-end";var U=function(t,e,n,o,r,i){function a(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,c=o.kind,p="getter"===c?"get":"setter"===c?"set":"value",d=!e&&t?o.static?t:t.prototype:null,l=e||(d?Object.getOwnPropertyDescriptor(d,o.name):{}),u=!1,f=n.length-1;f>=0;f--){var h={};for(var m in o)h[m]="access"===m?{}:o[m];for(var m in o.access)h.access[m]=o.access[m];h.addInitializer=function(t){if(u)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(t||null))};var g=(0,n[f])("accessor"===c?{get:l.get,set:l.set}:l[p],h);if("accessor"===c){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(s=a(g.get))&&(l.get=s),(s=a(g.set))&&(l.set=s),(s=a(g.init))&&r.unshift(s)}else(s=a(g))&&("field"===c?r.unshift(s):l[p]=s)}d&&Object.defineProperty(d,o.name,l),u=!0},q=function(t,e,n){for(var o=arguments.length>2,r=0;r<e.length;r++)n=o?e[r].call(t,n):e[r].call(t);return o?n:void 0};const H={[k]:(t,e,n)=>({arrowTop:e-5,arrowLeft:n.width>t?Math.floor(t/2)-5:Math.floor(n.width/2)-5,left:n.left,top:n.top-e-10}),[E]:(t,e,n)=>({arrowTop:e-5,arrowLeft:Math.floor(t/2)-5,left:n.left-Math.floor((t-n.width)/2),top:n.top-e-10}),[$]:(t,e,n)=>({arrowTop:e-5,arrowLeft:n.width>t?t-Math.floor(t/2)-5:t-Math.floor(n.width/2)-5,left:n.left-t+n.width,top:n.top-e-10}),[N]:(t,e,n)=>({arrowTop:Math.floor(e/2)-5,arrowLeft:-5,left:n.left+n.width+10,top:n.top}),[B]:(t,e,n)=>({arrowTop:Math.floor(e/2)-5,arrowLeft:-5,left:n.left+n.width+10,top:n.top+Math.floor(n.height/2)-Math.floor(e/2)}),[R]:(t,e,n)=>({arrowTop:Math.floor(e/2)-5,arrowLeft:-5,left:n.left+n.width+10,top:n.top+n.height-e}),[P]:(t,e,n)=>({arrowTop:-5,arrowLeft:n.width>t?Math.floor(t/2)-5:Math.floor(n.width/2)-5,left:n.left,top:n.top+n.height+e-20}),[L]:(t,e,n)=>({arrowTop:-5,arrowLeft:Math.floor(t/2)-5,left:n.left-Math.floor((t-n.width)/2),top:n.top+n.height+e-20}),[F]:(t,e,n)=>({arrowTop:-5,arrowLeft:n.width>t?t-Math.floor(t/2)-5:t-Math.floor(n.width/2)-5,left:n.left-t+n.width,top:n.top+n.height+e-20}),[j]:(t,e,n)=>({arrowTop:Math.floor(e/2)-5,arrowLeft:t-5,left:n.left-t-10,top:n.top}),[O]:(t,e,n)=>({arrowTop:Math.floor(e/2)-5,arrowLeft:t-5,left:n.left-t-10,top:n.top+Math.floor(n.height/2)-Math.floor(e/2)}),[z]:(t,e,n)=>({arrowTop:Math.floor(e/2)-5,arrowLeft:t-5,left:n.left-t-10,top:n.top+n.height-e})};(()=>{let t,e,n,o,r,i,a,s,c,p=[w({selector:"pg-tooltip",style:S.A,template:'<div part="tooltip"> <span part="tooltipText"></span> <div part="tooltipArrow"></div> </div>'})],d=[],l=HTMLElement,u=[],f=[],h=[],m=[],g=[],v=[],b=[],y=[],D=[],A=[],C=[],M=[],T=[],E=[];(class extends l{static{e=this}static{const w="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;n=[x()],o=[x()],r=[x()],i=[x()],a=[I()],s=[I()],c=[I()],U(null,null,n,{kind:"field",name:"visible",static:!1,private:!1,access:{has:t=>"visible"in t,get:t=>t.visible,set:(t,e)=>{t.visible=e}},metadata:w},u,f),U(null,null,o,{kind:"field",name:"rect",static:!1,private:!1,access:{has:t=>"rect"in t,get:t=>t.rect,set:(t,e)=>{t.rect=e}},metadata:w},h,m),U(null,null,r,{kind:"field",name:"text",static:!1,private:!1,access:{has:t=>"text"in t,get:t=>t.text,set:(t,e)=>{t.text=e}},metadata:w},g,v),U(null,null,i,{kind:"field",name:"position",static:!1,private:!1,access:{has:t=>"position"in t,get:t=>t.position,set:(t,e)=>{t.position=e}},metadata:w},b,y),U(null,null,a,{kind:"field",name:"$tooltip",static:!1,private:!1,access:{has:t=>"$tooltip"in t,get:t=>t.$tooltip,set:(t,e)=>{t.$tooltip=e}},metadata:w},D,A),U(null,null,s,{kind:"field",name:"$tooltipText",static:!1,private:!1,access:{has:t=>"$tooltipText"in t,get:t=>t.$tooltipText,set:(t,e)=>{t.$tooltipText=e}},metadata:w},C,M),U(null,null,c,{kind:"field",name:"$tooltipArrow",static:!1,private:!1,access:{has:t=>"$tooltipArrow"in t,get:t=>t.$tooltipArrow,set:(t,e)=>{t.$tooltipArrow=e}},metadata:w},T,E),U(null,t={value:e},p,{kind:"class",name:e.name,metadata:w},null,d),e=t.value,w&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:w}),q(e,d)}visible=q(this,u,!1);rect=(q(this,f),q(this,h,null));text=(q(this,m),q(this,g,""));position=(q(this,v),q(this,b,L));$tooltip=(q(this,y),q(this,D,void 0));$tooltipText=(q(this,A),q(this,C,void 0));$tooltipArrow=(q(this,M),q(this,T,void 0));render(t){this.$tooltipText.textContent=this.text,this.style.position="absolute",t.visible&&(this.style.display=this.visible?"block":"none");const{width:e,height:n}=this.$tooltipText.getBoundingClientRect();let o=this.position;if(o in H||(o=L),this.rect){const{arrowLeft:t,arrowTop:r,left:i,top:a}=H[o](e,n,this.rect);this.style.left=`${i+window.scrollX}px`,this.style.top=`${a+window.scrollY}px`,this.$tooltipArrow.style.left=`${t}px`,this.$tooltipArrow.style.top=`${r}px`}}constructor(){super(...arguments),q(this,E)}})})();function V(t,e,n){t.addEventListener("mouseenter",(function(){t.dispatchEvent(new CustomEvent("tooltip",{detail:{visible:!0,rect:t.getBoundingClientRect(),text:e(),position:n??L},bubbles:!0,composed:!0}))})),t.addEventListener("mouseleave",(function(){t.dispatchEvent(new CustomEvent("tooltip",{detail:{visible:!1},bubbles:!0,composed:!0}))}))}var W=function(t,e,n,o,r,i){function a(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,c=o.kind,p="getter"===c?"get":"setter"===c?"set":"value",d=!e&&t?o.static?t:t.prototype:null,l=e||(d?Object.getOwnPropertyDescriptor(d,o.name):{}),u=!1,f=n.length-1;f>=0;f--){var h={};for(var m in o)h[m]="access"===m?{}:o[m];for(var m in o.access)h.access[m]=o.access[m];h.addInitializer=function(t){if(u)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(t||null))};var g=(0,n[f])("accessor"===c?{get:l.get,set:l.set}:l[p],h);if("accessor"===c){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(s=a(g.get))&&(l.get=s),(s=a(g.set))&&(l.set=s),(s=a(g.init))&&r.unshift(s)}else(s=a(g))&&("field"===c?r.unshift(s):l[p]=s)}d&&Object.defineProperty(d,o.name,l),u=!0},Y=function(t,e,n){for(var o=arguments.length>2,r=0;r<e.length;r++)n=o?e[r].call(t,n):e[r].call(t);return o?n:void 0};const J={[T.News]:'<div part="news"> <pg-avatar part="avatar"></pg-avatar> <span part="label">News</span> <pg-markdown part="markdown"></pg-markdown> </div>',[T.IconCreated]:'<div part="iconCreated"> <pg-avatar part="avatar"></pg-avatar> <pg-icon part="icon"></pg-icon> <span part="content"> <span> Icon <code part="iconName"></code> <span class="created">created</span>. </span> </span> <a part="issue"></a> <button part="edit"> <pg-icon part="editIcon"></pg-icon> </button> </div>',[T.IconModified]:'<div part="iconModified"> <pg-avatar part="avatar"></pg-avatar> <pg-icon part="iconDataBefore"></pg-icon> <pg-icon part="iconDataAfter"></pg-icon> <span part="content"> <span> Icon <code part="iconName"></code> modified. </span> </span> <a part="issue"></a> <button part="edit"> <pg-icon part="editIcon"></pg-icon> </button> </div>',[T.IconRenamed]:'<div part="iconRenamed"> <pg-avatar part="avatar"></pg-avatar> <pg-icon part="icon"></pg-icon> <span part="content"> <span> Icon <code part="iconNameBefore"></code> renamed to <code part="iconNameAfter"></code>. </span> </span> <a part="issue"></a> <button part="edit"> <pg-icon part="editIcon"></pg-icon> </button> </div>',[T.IconDeleted]:'<div part="iconDeleted"> <pg-avatar part="avatar"></pg-avatar> <pg-icon part="icon"></pg-icon> <span part="content"> <span> Icon <code part="iconName"></code> <span class="deleted">deleted</span>. </span> </span> <a part="issue"></a> <button part="edit"> <pg-icon part="editIcon"></pg-icon> </button> </div>',[T.IconAliasCreated]:'<div part="iconAliasCreated"> <pg-avatar part="avatar"></pg-avatar> <pg-icon part="icon"></pg-icon> <span part="content"> <span> <span class="added">Added</span> alias <code part="text"></code> to <code part="iconName"></code>. </span> </span> <a part="issue"></a> <button part="edit"> <pg-icon part="editIcon"></pg-icon> </button> </div>',[T.IconAliasDeleted]:'<div part="iconAliasDeleted"> <pg-avatar part="avatar"></pg-avatar> <pg-icon part="icon"></pg-icon> <span part="content"> <span> <span class="removed">Removed</span> alias <code part="text"></code> from <code part="iconName"></code>. </span> </span> <a part="issue"></a> <button part="edit"> <pg-icon part="editIcon"></pg-icon> </button> </div>',[T.IconTagCreated]:'<div part="iconTagCreated"> <pg-avatar part="avatar"></pg-avatar> <pg-icon part="icon"></pg-icon> <span part="content"> <span> <span class="added">Added</span> tag <code part="text"></code> to <code part="iconName"></code>. </span> </span> <a part="issue"></a> <button part="edit"> <pg-icon part="editIcon"></pg-icon> </button> </div>',[T.IconTagDeleted]:'<div part="iconTagDeleted"> <pg-avatar part="avatar"></pg-avatar> <pg-icon part="icon"></pg-icon> <span part="content"> <span> <span class="removed">Removed</span> tag <code part="text"></code> from <code part="iconName"></code>. </span> </span> <a part="issue"></a> <button part="edit"> <pg-icon part="editIcon"></pg-icon> </button> </div>',[T.IconDescriptionModified]:'<div part="iconDescriptionModified"> <pg-avatar part="avatar"></pg-avatar> <pg-icon part="icon"></pg-icon> <pg-markdown part="iconDescriptionBefore"></pg-markdown> <pg-markdown part="iconDescriptionAfter"></pg-markdown> <a part="issue"></a> <button part="edit"> <pg-icon part="editIcon"></pg-icon> </button> </div>',[T.IconAuthorModified]:'<div part="iconAuthorModified"> <pg-avatar part="avatar"></pg-avatar> <pg-icon part="icon"></pg-icon> <span part="content"> <span> Author modified. </span> </span> <a part="issue"></a> <button part="edit"> <pg-icon part="editIcon"></pg-icon> </button> </div>',[T.IconDeprecated]:'<div part="iconDeprecated"> <pg-avatar part="avatar"></pg-avatar> <pg-icon part="icon"></pg-icon> <span part="content"> <span> Deprecated. Warning this icon will be removed in a future release. </span> </span> <a part="issue"></a> <button part="edit"> <pg-icon part="editIcon"></pg-icon> </button> </div>',[T.Date]:'<h2 part="text"></h2>'},Z=["January","February","March","April","May","June","July","August","September","October","November","December"];function _(t){const e=new Date(t),n=Z[e.getMonth()];return`${e.getFullYear()}-${n}-${e.getDate()}`}function G(t){const e=[];let n="";return t.forEach(((t,o)=>{const r=function(t){const e=new Date(t);return`${Z[e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}`}(t.date);n!==r&&(e.push((new Modification).from({id:`date-${_(t.date)}`,modificationId:T.Date,text:r,user:new User,icon:new Icon})),n=r),e.push(t)})),e}(()=>{let t,e,n,o,r,i,a=[w({selector:"pg-modification",style:M.A,template:'<div part="items"></div>'})],s=[],c=HTMLElement,p=[],d=[],l=[],u=[],f=[],h=[],m=[],g=[];(class extends c{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(c[Symbol.metadata]??null):void 0;n=[x()],o=[x()],r=[x()],i=[I()],W(null,null,n,{kind:"field",name:"modifications",static:!1,private:!1,access:{has:t=>"modifications"in t,get:t=>t.modifications,set:(t,e)=>{t.modifications=e}},metadata:v},p,d),W(null,null,o,{kind:"field",name:"edit",static:!1,private:!1,access:{has:t=>"edit"in t,get:t=>t.edit,set:(t,e)=>{t.edit=e}},metadata:v},l,u),W(null,null,r,{kind:"field",name:"github",static:!1,private:!1,access:{has:t=>"github"in t,get:t=>t.github,set:(t,e)=>{t.github=e}},metadata:v},f,h),W(null,null,i,{kind:"field",name:"$items",static:!1,private:!1,access:{has:t=>"$items"in t,get:t=>t.$items,set:(t,e)=>{t.$items=e}},metadata:v},m,g),W(null,t={value:e},a,{kind:"class",name:e.name,metadata:v},null,s),e=t.value,v&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v}),Y(e,s)}modifications=Y(this,p,[]);edit=(Y(this,d),Y(this,l,!1));github=(Y(this,u),Y(this,f,""));$items=(Y(this,h),Y(this,m,void 0));render(t){t.modifications&&this.modifications&&function(t,e,n,o,r){const i=Array.from(t.children),a=i.map((t=>t.dataset.key)),s=e.map((t=>t[n]));e.forEach((e=>{if(!a.includes(e[n])){const r=o(e);return r instanceof DocumentFragment?r.children[0].dataset.key=e[n]:r.dataset.key=e[n],void t.appendChild(r)}{const t=i.find((t=>t.dataset.key===a[n]));if(e[n]===a[n])return void r(e,t)}})),i.forEach((t=>{s.includes(t.dataset.key)||t.remove()}))}(this.$items,G(this.modifications),"id",(t=>{if(t.modificationId in J){const e=function(t,e){const n=document.createElement("template");n.innerHTML=t;const o=document.importNode(n.content,!0);for(const[t,n]of Object.entries(e)){const e=o.querySelector(`[part~="${t}"]`);if(e)for(const[t,o]of Object.entries(n))o instanceof Function?null===o()?e.removeAttribute(t):e.setAttribute(t,o()):e[t]=o}return o}(J[t.modificationId],{text:{innerText:t.text},markdown:{text:t.text},icon:{path:t.icon&&t.icon.data},iconName:{innerText:t.icon&&t.icon.name},iconNameBefore:{innerText:t.iconNameBefore},iconNameAfter:{innerText:t.iconNameAfter},iconDescriptionBefore:{text:t.iconDescriptionBefore},iconDescriptionAfter:{text:t.iconDescriptionAfter},iconDataBefore:{path:t.iconDataBefore},iconDataAfter:{path:t.iconDataAfter},avatar:{user:t.user},editIcon:{path:"M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z"},issue:{style:t.issue?"":"display:none",innerText:t.issue?`#${t.issue}`:"",href:`https://github.com/${this.github}/issues/${t.issue}`}}),n=e.querySelector('[part="issue"]');n&&V(n,(()=>"View on GitHub"),F);const o=e.querySelector('[part="avatar"]');o&&V(o,(()=>t.user.name),P);const r=e.querySelector('[part="edit"]');return r&&r.addEventListener("click",(()=>{this.dispatchEvent(new CustomEvent("edit",{detail:{modification:t}}))})),e}const e=document.createElement("div");return e.classList.add("invalid"),e.innerText=`Error: Unsupported modificationId with text: "${t.text}"`,e}),((t,e)=>{})),t.edit&&this.$items.classList.toggle("edit",this.edit)}addItem(t){const e=document.createElement("div");this.$items.appendChild(e)}constructor(){super(...arguments),Y(this,g)}})})()})();
|
package/pgNav.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,s){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(o)for(var i=0;i<this.length;i++){var l=this[i][0];null!=l&&(a[l]=!0)}for(var c=0;c<t.length;c++){var p=[].concat(t[c]);o&&a[p[0]]||(void 0!==s&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=s),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}},601:t=>{t.exports=function(t){return t[1]}},689:(t,e,r)=>{r.d(e,{A:()=>l});var o=r(601),n=r.n(o),s=r(314),a=r.n(s)()(n());a.push([t.id,":host {\n align-self: center;\n}\nsvg {\n width: 1.5rem;\n height: 1.5rem;\n}\nbutton {\n border: 0;\n background: transparent;\n}\nbutton > svg {\n fill: #fff;\n}",""]);var i=new CSSStyleSheet;i.replaceSync(a.toString());const l=i}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var s=e[o]={id:o,exports:{}};return t[o](s,s.exports,r),s.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"),s=Symbol("getObservers"),a=Symbol("swapObserver"),i=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],p=new Map;function h(t){return new Proxy(t,{get(e,r){if("symbol"==typeof r){switch(r){case i:return!0;case l:return e;case s:return p.has(t);case a:return(e,r)=>{const o=p.get(t);o.forEach(((n,s)=>{if(s.getRootNode().host===e){const e=o.get(s);p.has(r)?p.get(r).has(s)?p.get(r).get(s).push(o.get(s)):p.get(r).set(s,o.get(s)):p.set(r,new Map([[s,e]])),p.delete(t),e.forEach((t=>{t(null,u.swap,[r])}))}}))};case o:return(e,r)=>{p.has(t)?p.get(t).has(e)?p.get(t).get(e).push(r):p.get(t).set(e,[r]):p.set(t,new Map([[e,[r]]]))};case n:return e=>{p.has(t)&&(p.get(t).delete(e),0===p.get(t).size&&p.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]?h(e[r]):e[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(c.includes(r))return p.has(e)?function(){const t=Array.prototype[r].apply(e,arguments);return p.get(e).forEach(((t,o)=>{t.forEach((t=>{t(e,r,arguments)}))})),t}:Reflect.get(e,r);if(e[r]instanceof Array)return h(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(p.has(t)){p.get(t).forEach(((t,o)=>{t.forEach((t=>{t(e,r)}))}))}return Reflect.set(t,e,r)}})}window.observers=p;const u={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const f=Symbol("init"),d=Symbol("template"),y=Symbol("style"),m=Symbol("parent");function v(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function b(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[m]||e.prototype[m][e.prototype[m].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[m]=[e.prototype],e.prototype[y]=t.style?[t.style]:[],e.prototype[d]=t.template||""):(e.prototype[m].push(e.prototype),e.prototype[y].push(t.style),e.prototype[d]=(o=e.prototype[d],(n=t.template||null)&&n.match(/<parent\/>/)?n.replace(/<parent\/>/,o):`${o}${n||""}`));const s=e.prototype.connectedCallback||(()=>{}),a=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[f]||void 0!==t.template||void 0!==t.style)if(this[f]){if(this[f]&&t.style);else if(this[f]&&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[d]||"";const r=document.importNode(t.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=e.prototype[y].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[m].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[g(e)]=!0,t)),{}):{})}))};0===o.length?(this[f]=!0,s.call(this),n()):Promise.all(o).then((()=>{this[f]=!0,s.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));n()}))},e.prototype.disconnectedCallback=function(){a.call(this)},e.prototype.attributeChangedCallback=function(t,e,r){this[g(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 w(t){return!!t&&t.constructor===Array}function S(t,e){t[f]&&t[m].map((r=>{r.render&&r.render.call(t,{[e]:!0})}))}function E(t){return null===t?"null":w(t)?"array":typeof t}Symbol("hasProxy");const P=Symbol("meta");var x=r(689),$=function(t,e,r,o,n,s){function a(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var i,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,f=r.length-1;f>=0;f--){var d={};for(var y in o)d[y]="access"===y?{}:o[y];for(var y in o.access)d.access[y]=o.access[y];d.addInitializer=function(t){if(u)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(t||null))};var m=(0,r[f])("accessor"===l?{get:h.get,set:h.set}:h[c],d);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(i=a(m.get))&&(h.get=i),(i=a(m.set))&&(h.set=i),(i=a(m.init))&&n.unshift(i)}else(i=a(m))&&("field"===l?n.unshift(i):h[c]=i)}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=[b({selector:"pg-nav",style:x.A,template:'<nav part="nav"> <a href="/"> <span part="name"></span> </a> <a href="/icons"> Icons </a> <a href="/icons"> Docs </a> <button part="menu"> <svg viewBox="0 0 24 24"> <path d="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z"/> </svg> </button> </nav>'})],c=[],p=HTMLElement,u=[],f=[],d=[],y=[];(class extends p{static{e=this}static{const m="function"==typeof Symbol&&Symbol.metadata?Object.create(p[Symbol.metadata]??null):void 0;var g;r=[function(t,e){const r=e.name,o=Symbol(r),n=Symbol(`${r}:type`),c=Symbol(`${r}:meta`);return e.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[n]||"array"===this[n]?this[o][i]?this[o]:h(this[o]):this[o],set:t=>{const e=E(g?g(t):t);if("index"!==r&&this[n]!==e&&"null"!==this[n]&&"null"!==e)throw new Error(`@Prop() ${r} with type '${this[n]}' cannot be set to ${e}.`);if("array"===this[n]){if(!w(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[o]===t)throw new Error("Setting an array to itself is not allowed.");const e=h(this[o]);if(e[s]){const n=t[i]?t[l]:t;e[a](this,n),this[o]=t,console.log(">>> trigger render???",this,r)}else this[o]=t}else this[o]=g?g(t):t,S(this,r)}})})),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(!e.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,n=v(r);e[r]||(t.observedAttributes.push(n),e[r]=o)}return this[n]=E(t),"array"===this[n]?(this[o]=t,new Proxy(t,{get:(t,e)=>e===P?this[c]:(console.log("errr???"),Reflect.get(this[o],e)),set:(t,e,n)=>{if(e===P)return this[c]=n,!0;const s=Reflect.set(t,e,n);return"length"===e&&this[o].length===n||S(this,r),this[o]=n,s}})):(this[o]=g?g(this.getAttribute(r)??t):this.getAttribute(r)??t,this[o])}}],o=[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}]`))}})}))}],$(null,null,r,{kind:"field",name:"nav",static:!1,private:!1,access:{has:t=>"nav"in t,get:t=>t.nav,set:(t,e)=>{t.nav=e}},metadata:m},u,f),$(null,null,o,{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},d,y),$(null,t={value:e},n,{kind:"class",name:e.name,metadata:m},null,c),e=t.value,m&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:m}),A(e,c)}nav=A(this,u,"M0 0h24v24H0V0zm2 2v20h20V2H2z");$path=(A(this,f),A(this,d,void 0));render(){}constructor(){super(...arguments),A(this,y)}})})()})();
|
package/pgOverlay.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";Symbol("addObserver"),Symbol("removeObserver"),Symbol("getObservers"),Symbol("swapObserver"),Symbol("isProxy"),Symbol("getTarget");const e=new Map;window.observers=e;Error;Symbol("index");const t=Symbol("init"),o=Symbol("template"),n=Symbol("style"),r=Symbol("parent");function a(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function l(e={}){return function(l,s){if("class"!==s.kind)throw new Error("@Component() can only decorate a class");var c,i;Reflect.defineProperty(l,"name",{value:e.selector,writable:!1,configurable:!1}),!l.prototype[r]||l.prototype[r][l.prototype[r].length-1]instanceof Object.getPrototypeOf(l)?l.prototype instanceof HTMLElement&&(l.prototype[r]=[l.prototype],l.prototype[n]=e.style?[e.style]:[],l.prototype[o]=e.template||""):(l.prototype[r].push(l.prototype),l.prototype[n].push(e.style),l.prototype[o]=(c=l.prototype[o],(i=e.template||null)&&i.match(/<parent\/>/)?i.replace(/<parent\/>/,c):`${c}${i||""}`));const p=l.prototype.connectedCallback||(()=>{}),d=l.prototype.disconnectedCallback||(()=>{});l.prototype.connectedCallback=function(){if(this[t]||void 0!==e.template||void 0!==e.style)if(this[t]){if(this[t]&&e.style);else if(this[t]&&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=l.prototype[o]||"";const t=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=l.prototype[n].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),r.appendChild(t)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const s=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&s.add(e.localName);const c=Array.from(s.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),i=()=>{this[r].map((e=>{e.render&&e.render.call(this,l.observedAttributes?l.observedAttributes.reduce(((e,t)=>(e[a(t)]=!0,e)),{}):{})}))};0===c.length?(this[t]=!0,p.call(this),i()):Promise.all(c).then((()=>{this[t]=!0,p.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));i()}))},l.prototype.disconnectedCallback=function(){d.call(this)},l.prototype.attributeChangedCallback=function(e,t,o){this[a(e)]=o},s.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${s.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,l)}}))}}Symbol("transmute");Symbol("hasProxy");Symbol("meta");var s=function(e,t,o,n,r,a){function l(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,c=n.kind,i="getter"===c?"get":"setter"===c?"set":"value",p=!t&&e?n.static?e:e.prototype:null,d=t||(p?Object.getOwnPropertyDescriptor(p,n.name):{}),m=!1,y=o.length-1;y>=0;y--){var u={};for(var h in n)u[h]="access"===h?{}:n[h];for(var h in n.access)u.access[h]=n.access[h];u.addInitializer=function(e){if(m)throw new TypeError("Cannot add initializers after decoration has completed");a.push(l(e||null))};var f=(0,o[y])("accessor"===c?{get:d.get,set:d.set}:d[i],u);if("accessor"===c){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(s=l(f.get))&&(d.get=s),(s=l(f.set))&&(d.set=s),(s=l(f.init))&&r.unshift(s)}else(s=l(f))&&("field"===c?r.unshift(s):d[i]=s)}p&&Object.defineProperty(p,n.name,d),m=!0},c=function(e,t,o){for(var n=arguments.length>2,r=0;r<t.length;r++)o=n?t[r].call(e,o):t[r].call(e);return n?o:void 0};const i=new Set,p=new Map;(()=>{let e,t,o=[l()],n=[],r=HTMLElement;(class extends r{static{t=this}static{const a="function"==typeof Symbol&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;s(null,e={value:t},o,{kind:"class",name:t.name,metadata:a},null,n),t=e.value,a&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:a}),c(t,n)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),i.add(t),new Promise((e=>{p.set(t,e)}))}close(e){this.remove(),i.delete(this);const t=p.get(this);t&&t(e),p.delete(this)}})})()})();
|
package/pgOverlayContextMenu.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&i[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),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)),t.push(u))}},t}},601:e=>{e.exports=function(e){return e[1]}},891:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),o=n.n(r),s=n(314),i=n.n(s)()(o());i.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n overflow: visible;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: anchor(top);\n left: anchor(left);\n min-width: 10rem;\n margin: var(--pg-overlay-menu-_y, 0) 0 0 var(--pg-overlay-menu-_x, 0);\n}',""]);var a=new CSSStyleSheet;a.replaceSync(i.toString());const l=a}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={id:r,exports:{}};return e[r](s,s.exports,n),s.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"),o=Symbol("removeObserver"),s=Symbol("getObservers"),i=Symbol("swapObserver"),a=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],u=new Map;function h(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case a:return!0;case l:return t;case s:return u.has(e);case i:return(t,n)=>{const r=u.get(e);r.forEach(((o,s)=>{if(s.getRootNode().host===t){const t=r.get(s);u.has(n)?u.get(n).has(s)?u.get(n).get(s).push(r.get(s)):u.get(n).set(s,r.get(s)):u.set(n,new Map([[s,t]])),u.delete(e),t.forEach((e=>{e(null,d.swap,[n])}))}}))};case r:return(t,n)=>{u.has(e)?u.get(e).has(t)?u.get(e).get(t).push(n):u.get(e).set(t,[n]):u.set(e,new Map([[t,[n]]]))};case o:return t=>{u.has(e)&&(u.get(e).delete(t),0===u.get(e).size&&u.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]?h(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(c.includes(n))return u.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return u.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return h(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(u.has(e)){u.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=u;const d={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const p=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function v(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function b(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,o;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[y]||t.prototype[y][t.prototype[y].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[y]=[t.prototype],t.prototype[m]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[y].push(t.prototype),t.prototype[m].push(e.style),t.prototype[f]=(r=t.prototype[f],(o=e.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,r):`${r}${o||""}`));const s=t.prototype.connectedCallback||(()=>{}),i=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[f]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[m].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))),o=()=>{this[y].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[g(t)]=!0,e)),{}):{})}))};0===r.length?(this[p]=!0,s.call(this),o()):Promise.all(r).then((()=>{this[p]=!0,s.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,n){this[g(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 w(e){return!!e&&e.constructor===Array}function S(e,t){e[p]&&e[y].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function E(e){return null===e?"null":w(e)?"array":typeof e}function x(e){return function(t,n){const r=n.name,o=Symbol(r),c=Symbol(`${r}:type`),u=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[c]||"array"===this[c]?this[o][a]?this[o]:h(this[o]):this[o],set:t=>{const n=E(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(!w(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[o]===t)throw new Error("Setting an array to itself is not allowed.");const e=h(this[o]);if(e[s]){const n=t[a]?t[l]:t;e[i](this,n),this[o]=t,console.log(">>> trigger render???",this,r)}else this[o]=t}else this[o]=e?e(t):t,S(this,r)}})})),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=v(r);t[r]||(e.observedAttributes.push(n),t[r]=o)}return this[c]=E(t),"array"===this[c]?(this[o]=t,new Proxy(t,{get:(e,t)=>t===P?this[u]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,n)=>{if(t===P)return this[u]=n,!0;const s=Reflect.set(e,t,n);return"length"===t&&this[o].length===n||S(this,r),this[o]=n,s}})):(this[o]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[o])}}}function $(){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 P=Symbol("meta");var O=function(e,t,n,r,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,p=n.length-1;p>=0;p--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,n[p])("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");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,r.name,h),d=!0},k=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0};const C=new Set,j=new Map;const A=(()=>{let e,t,n=[b()],r=[],o=HTMLElement;(class extends o{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;O(null,e={value:t},n,{kind:"class",name:t.name,metadata:s},null,r),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),k(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),C.add(t),new Promise((e=>{j.set(t,e)}))}close(e){this.remove(),C.delete(this);const t=j.get(this);t&&t(e),j.delete(this)}});return t})();var R=n(891),T=function(e,t,n,r,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,p=n.length-1;p>=0;p--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,n[p])("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");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,r.name,h),d=!0},z=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0};const L=[],D=[];(()=>{let e,t,n,r,o,s,i,a,l,c,u=[b({selector:"pg-overlay-context-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:R.A})],h=[],d=A,p=[],f=[],m=[],y=[],v=[],g=[],w=[],S=[],E=[],P=[],O=[],k=[],C=[],j=[],M=[],N=[];(class extends d{static{t=this}static{const b="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[$()],r=[$()],o=[x()],s=[x()],i=[x()],a=[x()],l=[x()],c=[x()],T(null,null,n,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:b},p,f),T(null,null,r,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:b},m,y),T(null,null,o,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:b},v,g),T(null,null,s,{kind:"field",name:"x",static:!1,private:!1,access:{has:e=>"x"in e,get:e=>e.x,set:(e,t)=>{e.x=t}},metadata:b},w,S),T(null,null,i,{kind:"field",name:"y",static:!1,private:!1,access:{has:e=>"y"in e,get:e=>e.y,set:(e,t)=>{e.y=t}},metadata:b},E,P),T(null,null,a,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:b},O,k),T(null,null,l,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:b},C,j),T(null,null,c,{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:b},M,N),T(null,e={value:t},u,{kind:"class",name:t.name,metadata:b},null,h),t=e.value,b&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b}),z(t,h)}$overlay=z(this,p,void 0);$menu=(z(this,f),z(this,m,void 0));source=(z(this,y),z(this,v,null));x=(z(this,g),z(this,w,0));y=(z(this,S),z(this,E,0));default=(z(this,P),z(this,O,null));items=(z(this,k),z(this,C,[]));value=(z(this,j),z(this,M,null));render(e){e.items&&(this.$menu.items=this.items)}connectedCallback(){L.pop()?.close(),L.push(this),D.push(this),this.$menu.addEventListener("select",this.#e.bind(this)),this.$menu.addEventListener("close",this.#t.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#n.bind(this));const e=this.source?.getBoundingClientRect(),t=this.x-(e?.left||0),n=this.y-(e?.top||0);this.$overlay.style.setProperty("--pg-overlay-menu-_x",`${t}px`),this.$overlay.style.setProperty("--pg-overlay-menu-_y",`${n}px`),this.$menu.focus(0),this.#r=this.#o.bind(this),document.addEventListener("pointerdown",this.#r)}#s=(z(this,N),!1);#r;#o(e){this.#s=e.composedPath().includes(this.source)}#n(e){"closed"===e.newState&&(this.close(),0===D.length&&this.#s&&(console.log(e),this.source?.focus()))}disconnectedCallback(){D.pop(),document.removeEventListener("pointerdown",this.#r)}#t(e){this.close(),this.source?.focus()}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}})})()})();
|
package/pgOverlayMenu.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,s){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(n)for(var i=0;i<this.length;i++){var l=this[i][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);n&&a[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),r&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=r):u[2]=r),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},601:e=>{e.exports=function(e){return e[1]}},697:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(601),o=r.n(n),s=r(314),a=r.n(s)()(o());a.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: calc(anchor(bottom) - 0.25rem);\n left: anchor(left);\n min-width: calc(anchor-size(width) + calc(2 * var(--pg-menu-padding, 0.25rem)));\n translate: var(--pg-overlay-menu-_x, 0) var(--pg-overlay-menu-_y, 0);\n overflow: visible;\n}',""]);var i=new CSSStyleSheet;i.replaceSync(a.toString());const l=i}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={id:n,exports:{}};return e[n](s,s.exports,r),s.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"),s=Symbol("getObservers"),a=Symbol("swapObserver"),i=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],u=new Map;function h(e){return new Proxy(e,{get(t,r){if("symbol"==typeof r){switch(r){case i:return!0;case l:return t;case s:return u.has(e);case a:return(t,r)=>{const n=u.get(e);n.forEach(((o,s)=>{if(s.getRootNode().host===t){const t=n.get(s);u.has(r)?u.get(r).has(s)?u.get(r).get(s).push(n.get(s)):u.get(r).set(s,n.get(s)):u.set(r,new Map([[s,t]])),u.delete(e),t.forEach((e=>{e(null,p.swap,[r])}))}}))};case n:return(t,r)=>{u.has(e)?u.get(e).has(t)?u.get(e).get(t).push(r):u.get(e).set(t,[r]):u.set(e,new Map([[t,[r]]]))};case o:return t=>{u.has(e)&&(u.get(e).delete(t),0===u.get(e).size&&u.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]?h(t[r]):t[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(c.includes(r))return u.has(t)?function(){const e=Array.prototype[r].apply(t,arguments);return u.get(t).forEach(((e,n)=>{e.forEach((e=>{e(t,r,arguments)}))})),e}:Reflect.get(t,r);if(t[r]instanceof Array)return h(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(u.has(e)){u.get(e).forEach(((e,n)=>{e.forEach((e=>{e(t,r)}))}))}return Reflect.set(e,t,r)}})}window.observers=u;const p={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const d=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function v(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(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[y]||t.prototype[y][t.prototype[y].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[y]=[t.prototype],t.prototype[m]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[y].push(t.prototype),t.prototype[m].push(e.style),t.prototype[f]=(n=t.prototype[f],(o=e.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,n):`${n}${o||""}`));const s=t.prototype.connectedCallback||(()=>{}),a=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[d]||void 0!==e.template||void 0!==e.style)if(this[d]){if(this[d]&&e.style);else if(this[d]&&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[f]||"";const r=document.importNode(e.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=t.prototype[m].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[y].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[g(t)]=!0,e)),{}):{})}))};0===n.length?(this[d]=!0,s.call(this),o()):Promise.all(n).then((()=>{this[d]=!0,s.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[g(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 w(e){return!!e&&e.constructor===Array}function S(e,t){e[d]&&e[y].map((r=>{r.render&&r.render.call(e,{[t]:!0})}))}function E(e){return null===e?"null":w(e)?"array":typeof e}function $(e){return function(t,r){const n=r.name,o=Symbol(n),c=Symbol(`${n}:type`),u=Symbol(`${n}:meta`);return r.addInitializer((function(){Reflect.defineProperty(this,n,{get:()=>"object"===this[c]||"array"===this[c]?this[o][i]?this[o]:h(this[o]):this[o],set:t=>{const r=E(e?e(t):t);if("index"!==n&&this[c]!==r&&"null"!==this[c]&&"null"!==r)throw new Error(`@Prop() ${n} with type '${this[c]}' cannot be set to ${r}.`);if("array"===this[c]){if(!w(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=h(this[o]);if(e[s]){const r=t[i]?t[l]:t;e[a](this,r),this[o]=t,console.log(">>> trigger render???",this,n)}else this[o]=t}else this[o]=e?e(t):t,S(this,n)}})})),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=v(n);t[n]||(e.observedAttributes.push(r),t[n]=o)}return this[c]=E(t),"array"===this[c]?(this[o]=t,new Proxy(t,{get:(e,t)=>t===x?this[u]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,r)=>{if(t===x)return this[u]=r,!0;const s=Reflect.set(e,t,r);return"length"===t&&this[o].length===r||S(this,n),this[o]=r,s}})):(this[o]=e?e(this.getAttribute(n)??t):this.getAttribute(n)??t,this[o])}}}function P(){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 O=function(e,t,r,n,o,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),p=!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(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(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");(i=a(y.get))&&(h.get=i),(i=a(y.set))&&(h.set=i),(i=a(y.init))&&o.unshift(i)}else(i=a(y))&&("field"===l?o.unshift(i):h[c]=i)}u&&Object.defineProperty(u,n.name,h),p=!0},j=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};const k=new Set,C=new Map;const A=(()=>{let e,t,r=[b()],n=[],o=HTMLElement;(class extends o{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;O(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),j(t,n)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),k.add(t),new Promise((e=>{C.set(t,e)}))}close(e){this.remove(),k.delete(this);const t=C.get(this);t&&t(e),C.delete(this)}});return t})();var R=r(697),z=function(e,t,r,n,o,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),p=!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(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(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");(i=a(y.get))&&(h.get=i),(i=a(y.set))&&(h.set=i),(i=a(y.init))&&o.unshift(i)}else(i=a(y))&&("field"===l?o.unshift(i):h[c]=i)}u&&Object.defineProperty(u,n.name,h),p=!0},T=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,s,a,i,l=[b({selector:"pg-overlay-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:R.A})],c=[],u=A,h=[],p=[],d=[],f=[],m=[],y=[],v=[],g=[],w=[],S=[],E=[],x=[];(class extends u{static{t=this}static{const b="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;r=[P()],n=[P()],o=[$()],s=[$()],a=[$()],i=[$()],z(null,null,r,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:b},h,p),z(null,null,n,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:b},d,f),z(null,null,o,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:b},m,y),z(null,null,s,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:b},v,g),z(null,null,a,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:b},w,S),z(null,null,i,{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:b},E,x),z(null,e={value:t},l,{kind:"class",name:t.name,metadata:b},null,c),t=e.value,b&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b}),T(t,c)}$overlay=T(this,h,void 0);$menu=(T(this,p),T(this,d,void 0));source=(T(this,f),T(this,m,null));default=(T(this,y),T(this,v,null));items=(T(this,g),T(this,w,[]));value=(T(this,S),T(this,E,null));render(e){}connectedCallback(){this.$menu.items=this.items,this.$menu.addEventListener("select",this.#e.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#t.bind(this));this.source?.getBoundingClientRect();const e=null===this.value||"object"!=typeof this.value?this.value:this.value.value,t=null===this.value?0:this.items.findIndex((t=>t.value===e));this.$menu.focus(t)}#t(e){"closed"===e.newState&&(this.close(),this.source?.focus())}disconnectedCallback(){}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}constructor(){super(...arguments),T(this,x)}})})()})();
|
package/pgOverlaySelectMenu.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e={97:(e,t,r)=>{r.d(t,{A:()=>l});var n=r(601),o=r.n(n),s=r(314),i=r.n(s)()(o());i.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n overflow: visible;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: anchor(top);\n left: anchor(left);\n min-width: calc(anchor-size(width) + calc(2 * var(--pg-menu-padding, 0.25rem)));\n margin: var(--pg-overlay-menu-_y, 0) 0 0 var(--pg-overlay-menu-_x, 0);\n overflow: visible;\n}\n',""]);var a=new CSSStyleSheet;a.replaceSync(i.toString());const l=a},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,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(n)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);n&&i[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),r&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=r):u[2]=r),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},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 s=t[n]={id:n,exports:{}};return e[n](s,s.exports,r),s.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"),s=Symbol("getObservers"),i=Symbol("swapObserver"),a=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],u=new Map;function h(e){return new Proxy(e,{get(t,r){if("symbol"==typeof r){switch(r){case a:return!0;case l:return t;case s:return u.has(e);case i:return(t,r)=>{const n=u.get(e);n.forEach(((o,s)=>{if(s.getRootNode().host===t){const t=n.get(s);u.has(r)?u.get(r).has(s)?u.get(r).get(s).push(n.get(s)):u.get(r).set(s,n.get(s)):u.set(r,new Map([[s,t]])),u.delete(e),t.forEach((e=>{e(null,p.swap,[r])}))}}))};case n:return(t,r)=>{u.has(e)?u.get(e).has(t)?u.get(e).get(t).push(r):u.get(e).set(t,[r]):u.set(e,new Map([[t,[r]]]))};case o:return t=>{u.has(e)&&(u.get(e).delete(t),0===u.get(e).size&&u.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]?h(t[r]):t[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(c.includes(r))return u.has(t)?function(){const e=Array.prototype[r].apply(t,arguments);return u.get(t).forEach(((e,n)=>{e.forEach((e=>{e(t,r,arguments)}))})),e}:Reflect.get(t,r);if(t[r]instanceof Array)return h(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(u.has(e)){u.get(e).forEach(((e,n)=>{e.forEach((e=>{e(t,r)}))}))}return Reflect.set(e,t,r)}})}window.observers=u;const p={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const d=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function v(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(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[y]||t.prototype[y][t.prototype[y].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[y]=[t.prototype],t.prototype[m]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[y].push(t.prototype),t.prototype[m].push(e.style),t.prototype[f]=(n=t.prototype[f],(o=e.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,n):`${n}${o||""}`));const s=t.prototype.connectedCallback||(()=>{}),i=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[d]||void 0!==e.template||void 0!==e.style)if(this[d]){if(this[d]&&e.style);else if(this[d]&&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[f]||"";const r=document.importNode(e.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=t.prototype[m].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[y].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[g(t)]=!0,e)),{}):{})}))};0===n.length?(this[d]=!0,s.call(this),o()):Promise.all(n).then((()=>{this[d]=!0,s.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[g(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 w(e){return!!e&&e.constructor===Array}function S(e,t){e[d]&&e[y].map((r=>{r.render&&r.render.call(e,{[t]:!0})}))}function E(e){return null===e?"null":w(e)?"array":typeof e}function $(e){return function(t,r){const n=r.name,o=Symbol(n),c=Symbol(`${n}:type`),u=Symbol(`${n}:meta`);return r.addInitializer((function(){Reflect.defineProperty(this,n,{get:()=>"object"===this[c]||"array"===this[c]?this[o][a]?this[o]:h(this[o]):this[o],set:t=>{const r=E(e?e(t):t);if("index"!==n&&this[c]!==r&&"null"!==this[c]&&"null"!==r)throw new Error(`@Prop() ${n} with type '${this[c]}' cannot be set to ${r}.`);if("array"===this[c]){if(!w(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=h(this[o]);if(e[s]){const r=t[a]?t[l]:t;e[i](this,r),this[o]=t,console.log(">>> trigger render???",this,n)}else this[o]=t}else this[o]=e?e(t):t,S(this,n)}})})),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=v(n);t[n]||(e.observedAttributes.push(r),t[n]=o)}return this[c]=E(t),"array"===this[c]?(this[o]=t,new Proxy(t,{get:(e,t)=>t===P?this[u]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,r)=>{if(t===P)return this[u]=r,!0;const s=Reflect.set(e,t,r);return"length"===t&&this[o].length===r||S(this,n),this[o]=r,s}})):(this[o]=e?e(this.getAttribute(n)??t):this.getAttribute(n)??t,this[o])}}}function x(){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 P=Symbol("meta");var O=function(e,t,r,n,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),p=!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(p)throw new TypeError("Cannot add initializers after decoration has completed");s.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");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,n.name,h),p=!0},k=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};const j=new Set,C=new Map;const A=(()=>{let e,t,r=[b()],n=[],o=HTMLElement;(class extends o{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;O(null,e={value:t},r,{kind:"class",name:t.name,metadata:s},null,n),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),k(t,n)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),j.add(t),new Promise((e=>{C.set(t,e)}))}close(e){this.remove(),j.delete(this);const t=C.get(this);t&&t(e),C.delete(this)}});return t})();var R=r(97),z=function(e,t,r,n,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),p=!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(p)throw new TypeError("Cannot add initializers after decoration has completed");s.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");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,n.name,h),p=!0},T=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,s,i,a,l=[b({selector:"pg-overlay-select-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:R.A})],c=[],u=A,h=[],p=[],d=[],f=[],m=[],y=[],v=[],g=[],w=[],S=[],E=[],P=[];(class extends u{static{t=this}static{const b="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;r=[x()],n=[x()],o=[$()],s=[$()],i=[$()],a=[$()],z(null,null,r,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:b},h,p),z(null,null,n,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:b},d,f),z(null,null,o,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:b},m,y),z(null,null,s,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:b},v,g),z(null,null,i,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:b},w,S),z(null,null,a,{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:b},E,P),z(null,e={value:t},l,{kind:"class",name:t.name,metadata:b},null,c),t=e.value,b&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b}),T(t,c)}$overlay=T(this,h,void 0);$menu=(T(this,p),T(this,d,void 0));source=(T(this,f),T(this,m,null));default=(T(this,y),T(this,v,null));items=(T(this,g),T(this,w,[]));value=(T(this,S),T(this,E,null));render(e){e.items&&null!==this.value&&(this.items.forEach((e=>e.checked=!1)),this.items.find((e=>e.value===this.value.value)).checked=!0)}connectedCallback(){this.$menu.items=this.items,this.$menu.addEventListener("select",this.#e.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#t.bind(this));const e=this.source?.getBoundingClientRect();let t=0;const r=null===this.value||"object"!=typeof this.value?this.value:this.value.value,n=null===this.value?-1:this.items.findIndex((e=>e.value===r));if(-1!==n){const r=this.$menu.getItemHeight(n);t-=this.$menu.getItemOffset(0,n),e?.height!==r&&e?.height&&(t+=(e.height-r)/2)}else if(this.items.length>0){this.default&&(this.default.checked=!0,this.$menu.items.unshift(this.default));const r=this.$menu.getItemHeight(0);t-=this.$menu.getItemOffset(0,0),e?.height!==r&&e?.height&&(t+=(e.height-r)/2)}this.$overlay.style.setProperty("--pg-overlay-menu-_x","0px"),this.$overlay.style.setProperty("--pg-overlay-menu-_y",`${t}px`),this.$menu.focus(n)}#t(e){"closed"===e.newState&&(this.close(),this.source?.focus())}disconnectedCallback(){}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}constructor(){super(...arguments),T(this,P)}})})()})();
|
package/pgOverlaySubMenu.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e={217:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),o=n.n(r),s=n(314),i=n.n(s)()(o());i.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n overflow: visible;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n translate: var(--pg-overlay-menu-_x, 0) var(--pg-overlay-menu-_y, 0);\n position-try-fallbacks: --custom-right, --custom-left;\n}\n\n@position-try --custom-right {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(right) - 0.25rem);\n}\n\n@position-try --custom-left {\n top: calc(anchor(top) - 0.25rem);\n left: calc(anchor(left) - anchor-size(width) + 0.25rem);\n}\n',""]);var a=new CSSStyleSheet;a.replaceSync(i.toString());const l=a},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,o,s){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&i[u[0]]||(void 0!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),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)),t.push(u))}},t}},601:e=>{e.exports=function(e){return e[1]}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={id:r,exports:{}};return e[r](s,s.exports,n),s.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"),o=Symbol("removeObserver"),s=Symbol("getObservers"),i=Symbol("swapObserver"),a=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],u=new Map;function h(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case a:return!0;case l:return t;case s:return u.has(e);case i:return(t,n)=>{const r=u.get(e);r.forEach(((o,s)=>{if(s.getRootNode().host===t){const t=r.get(s);u.has(n)?u.get(n).has(s)?u.get(n).get(s).push(r.get(s)):u.get(n).set(s,r.get(s)):u.set(n,new Map([[s,t]])),u.delete(e),t.forEach((e=>{e(null,p.swap,[n])}))}}))};case r:return(t,n)=>{u.has(e)?u.get(e).has(t)?u.get(e).get(t).push(n):u.get(e).set(t,[n]):u.set(e,new Map([[t,[n]]]))};case o:return t=>{u.has(e)&&(u.get(e).delete(t),0===u.get(e).size&&u.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]?h(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(c.includes(n))return u.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return u.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return h(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(u.has(e)){u.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=u;const p={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const d=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function v(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function b(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,o;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[y]||t.prototype[y][t.prototype[y].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[y]=[t.prototype],t.prototype[m]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[y].push(t.prototype),t.prototype[m].push(e.style),t.prototype[f]=(r=t.prototype[f],(o=e.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,r):`${r}${o||""}`));const s=t.prototype.connectedCallback||(()=>{}),i=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[d]||void 0!==e.template||void 0!==e.style)if(this[d]){if(this[d]&&e.style);else if(this[d]&&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[f]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[m].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))),o=()=>{this[y].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[g(t)]=!0,e)),{}):{})}))};0===r.length?(this[d]=!0,s.call(this),o()):Promise.all(r).then((()=>{this[d]=!0,s.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,n){this[g(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 w(e){return!!e&&e.constructor===Array}function S(e,t){e[d]&&e[y].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function E(e){return null===e?"null":w(e)?"array":typeof e}function x(e){return function(t,n){const r=n.name,o=Symbol(r),c=Symbol(`${r}:type`),u=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[c]||"array"===this[c]?this[o][a]?this[o]:h(this[o]):this[o],set:t=>{const n=E(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(!w(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[o]===t)throw new Error("Setting an array to itself is not allowed.");const e=h(this[o]);if(e[s]){const n=t[a]?t[l]:t;e[i](this,n),this[o]=t,console.log(">>> trigger render???",this,r)}else this[o]=t}else this[o]=e?e(t):t,S(this,r)}})})),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=v(r);t[r]||(e.observedAttributes.push(n),t[r]=o)}return this[c]=E(t),"array"===this[c]?(this[o]=t,new Proxy(t,{get:(e,t)=>t===P?this[u]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,n)=>{if(t===P)return this[u]=n,!0;const s=Reflect.set(e,t,n);return"length"===t&&this[o].length===n||S(this,r),this[o]=n,s}})):(this[o]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[o])}}}function $(){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 P=Symbol("meta");var O=function(e,t,n,r,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),p=!1,d=n.length-1;d>=0;d--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,n[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");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,r.name,h),p=!0},k=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0};const C=new Set,j=new Map;const A=(()=>{let e,t,n=[b()],r=[],o=HTMLElement;(class extends o{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;O(null,e={value:t},n,{kind:"class",name:t.name,metadata:s},null,r),t=e.value,s&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),k(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),C.add(t),new Promise((e=>{j.set(t,e)}))}close(e){this.remove(),C.delete(this);const t=j.get(this);t&&t(e),j.delete(this)}});return t})();var R=n(217),z=function(e,t,n,r,o,s){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),p=!1,d=n.length-1;d>=0;d--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(e||null))};var y=(0,n[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");(a=i(y.get))&&(h.get=a),(a=i(y.set))&&(h.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):h[c]=a)}u&&Object.defineProperty(u,r.name,h),p=!0},T=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0};const L=[],D=[];(()=>{let e,t,n,r,o,s,i,a,l,c,u=[b({selector:"pg-overlay-sub-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:R.A})],h=[],p=A,d=[],f=[],m=[],y=[],v=[],g=[],w=[],S=[],E=[],P=[],O=[],k=[],C=[],j=[],M=[],N=[];(class extends p{static{t=this}static{const b="function"==typeof Symbol&&Symbol.metadata?Object.create(p[Symbol.metadata]??null):void 0;n=[$()],r=[$()],o=[x()],s=[x()],i=[x()],a=[x()],l=[x()],c=[x()],z(null,null,n,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:b},d,f),z(null,null,r,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:b},m,y),z(null,null,o,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:b},v,g),z(null,null,s,{kind:"field",name:"x",static:!1,private:!1,access:{has:e=>"x"in e,get:e=>e.x,set:(e,t)=>{e.x=t}},metadata:b},w,S),z(null,null,i,{kind:"field",name:"y",static:!1,private:!1,access:{has:e=>"y"in e,get:e=>e.y,set:(e,t)=>{e.y=t}},metadata:b},E,P),z(null,null,a,{kind:"field",name:"default",static:!1,private:!1,access:{has:e=>"default"in e,get:e=>e.default,set:(e,t)=>{e.default=t}},metadata:b},O,k),z(null,null,l,{kind:"field",name:"items",static:!1,private:!1,access:{has:e=>"items"in e,get:e=>e.items,set:(e,t)=>{e.items=t}},metadata:b},C,j),z(null,null,c,{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:b},M,N),z(null,e={value:t},u,{kind:"class",name:t.name,metadata:b},null,h),t=e.value,b&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b}),T(t,h)}$overlay=T(this,d,void 0);$menu=(T(this,f),T(this,m,void 0));source=(T(this,y),T(this,v,null));x=(T(this,g),T(this,w,0));y=(T(this,S),T(this,E,0));default=(T(this,P),T(this,O,null));items=(T(this,k),T(this,C,[]));value=(T(this,j),T(this,M,null));render(e){e.items&&(this.$menu.items=this.items)}connectedCallback(){L.pop()?.close(),L.push(this),D.push(this),this.$menu.addEventListener("select",this.#e.bind(this)),this.$menu.addEventListener("close",this.#t.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#n.bind(this));this.source?.getBoundingClientRect();this.$overlay.style.setProperty("--pg-overlay-menu-_x","0px"),this.$overlay.style.setProperty("--pg-overlay-menu-_y","0px"),this.$menu.focus(0),this.#r=this.#o.bind(this),document.addEventListener("pointerdown",this.#r)}#s=(T(this,N),!1);#r;#o(e){this.#s=e.composedPath().includes(this.source)}#n(e){"closed"===e.newState&&0===D.length&&this.#s&&(console.log(e),this.source?.focus())}disconnectedCallback(){D.pop(),document.removeEventListener("pointerdown",this.#r)}#t(e){const{depth:t}=e.detail;console.log("close",t),1===t?this.close(null):this.close()}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}})})()})();
|