@pictogrammers/components 0.4.3 → 0.4.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pictogrammers/components",
3
3
  "type": "module",
4
- "version": "0.4.3",
4
+ "version": "0.4.5",
5
5
  "license": "MIT",
6
6
  "author": "Austin Andrews",
7
7
  "scripts": {
package/pg/app/app.css CHANGED
@@ -4,8 +4,8 @@
4
4
 
5
5
  [part=grid] {
6
6
  display: grid;
7
- grid-template-columns: auto 0.5rem 1fr;
8
- grid-template-rows: auto 1fr;
7
+ grid-template-columns: auto 0.5rem minmax(0, 1fr);
8
+ grid-template-rows: auto minmax(0, 1fr);
9
9
  height: 100%;
10
10
  }
11
11
 
@@ -30,7 +30,7 @@
30
30
  position: relative;
31
31
  }
32
32
 
33
- [part="button"]:focus {
33
+ [part="button"]:focus-visible {
34
34
  position: relative;
35
35
  }
36
36
 
@@ -44,7 +44,7 @@
44
44
  border-radius: var(--pg-button-border-radius, 0.25rem);
45
45
  box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.6));
46
46
  }
47
- [part="button"]:focus::before {
47
+ [part="button"]:focus-visible::before {
48
48
  pointer-events: none;
49
49
  content: '';
50
50
  position: absolute;
@@ -142,7 +142,7 @@ export default class XPgInputPixelEditorBasic extends HTMLElement {
142
142
  const size = content.match(/viewBox="\d+ \d+ (\d+) (\d+)"/) as string[];
143
143
  const width = parseInt(size[1], 10);
144
144
  const height = parseInt(size[2], 10);
145
- const path = (content.match(/d="([^"]+)"/) as string[])[1];
145
+ const path = (content.match(/\sd="([^"]+)"/) as string[])[1];
146
146
  // Render path
147
147
  console.log(path, size[1], size[2]);
148
148
  this.$input.applyTemplate(maskToBitmap(path, width, height));
@@ -435,7 +435,6 @@ export default class PgInputPixelEditor extends HTMLElement {
435
435
  switch (this.#inputMode) {
436
436
  case InputMode.Pixel:
437
437
  this.#setPixel(newX, newY, color);
438
- this.#data[this.#layer][newY][newX] = color;
439
438
  break;
440
439
  }
441
440
  console.log(this.#inputMode, newX, newY);
@@ -562,7 +561,6 @@ export default class PgInputPixelEditor extends HTMLElement {
562
561
  case InputMode.Pixel:
563
562
  for (var point of points) {
564
563
  this.#setPixel(point[0], point[1], color);
565
- data[this.#layer][point[1]][point[0]] = color;
566
564
  }
567
565
  break;
568
566
  case InputMode.Line:
@@ -27,7 +27,11 @@ export default class XPgMenuBasic extends HTMLElement {
27
27
  },
28
28
  {
29
29
  label: 'Item 3',
30
- value: 'item3'
30
+ value: 'item3',
31
+ items: [{
32
+ label: 'Item 4',
33
+ value: 'item4'
34
+ }]
31
35
  }];
32
36
  this.$menu.addEventListener('select', this.#handleSelect.bind(this));
33
37
  }
@@ -80,7 +80,7 @@
80
80
 
81
81
  [part=label].more::after {
82
82
  position: absolute;
83
- translate: -0.5rem 0;
83
+ translate: -2.5rem 0;
84
84
  right: 0;
85
85
  content: var(--pg-menu-item-check, url("data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z' fill='rgb(69, 60, 79)' /></svg>"));
86
86
  width: 1.5rem;
@@ -1,5 +1,7 @@
1
1
  import { Component, Prop, Part, forEach } from '@pictogrammers/element';
2
2
 
3
+ import PgOverlaySubMenu from '../overlaySubMenu/overlaySubMenu';
4
+
3
5
  import template from './menuItem.html';
4
6
  import style from './menuItem.css';
5
7
 
@@ -36,13 +38,41 @@ export default class PgMenuItem extends HTMLElement {
36
38
  this.dispatchEvent(new CustomEvent('hasCheck', { bubbles: true }));
37
39
  }
38
40
  }
41
+ if (changes.items) {
42
+ this.$label.classList.toggle('more', this.items.length > 0);
43
+ }
39
44
  }
40
45
 
41
46
  connectedCallback() {
42
- this.$label.addEventListener('click', () => {
43
- this.dispatchEvent(new CustomEvent('select', {
44
- detail: { index: this.index }
45
- }));
47
+ this.$label.addEventListener('click', async () => {
48
+ if (this.items.length > 0) {
49
+ const result = await PgOverlaySubMenu.open({
50
+ source: this.$label,
51
+ x: 0,
52
+ y: 0,
53
+ value: this.items[0],
54
+ items: this.items
55
+ });
56
+ if (result === null) {
57
+ this.focus();
58
+ } else if (result) {
59
+ this.dispatchEvent(new CustomEvent('select', {
60
+ detail: {
61
+ item: result
62
+ }
63
+ }));
64
+ } else {
65
+ this.dispatchEvent(new CustomEvent('close', {
66
+ detail: {
67
+ depth: -1
68
+ }
69
+ }));
70
+ }
71
+ } else {
72
+ this.dispatchEvent(new CustomEvent('select', {
73
+ detail: { index: this.index }
74
+ }));
75
+ }
46
76
  });
47
77
  this.$label.addEventListener('keydown', (e: KeyboardEvent) => {
48
78
  switch (e.key) {
@@ -1,6 +1,6 @@
1
1
  import { Component, Prop, Part } from '@pictogrammers/element';
2
2
 
3
- import PgOverlaySubMenu from '../overlaySubMenu/overlaySubMenu'
3
+ import PgOverlaySubMenu from '../overlaySubMenu/overlaySubMenu';
4
4
  import PgIcon from '../icon/icon';
5
5
 
6
6
  import template from './menuItemIcon.html';
package/pgApp.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var e={314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(o)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);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)),t.push(d))}},t}},601:e=>{e.exports=function(e){return e[1]}},801:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(601),r=n.n(o),i=n(314),a=n.n(i)()(r());a.push([e.id,":host {\n display: contents;\n}\n\n[part=grid] {\n display: grid;\n grid-template-columns: auto 0.5rem 1fr;\n grid-template-rows: auto 1fr;\n height: 100%;\n}\n\n[part=header] {\n display: flex;\n grid-column: 1 / 4;\n grid-row: 1;\n border-bottom: 2px solid #453C4F;\n}\n\n[part=header] > button {\n display: flex;\n border: 0;\n padding: 0.5rem;\n background-color: transparent;\n border-right: 1px solid rgba(69, 60, 79, 0.5);\n outline: none;\n}\n\n[part=header] > button:hover {\n background-color: rgba(69, 60, 79, 0.10);\n}\n\n[part=header] > button:focus-visible {\n position: relative;\n}\n\n[part=header] > button:focus-visible::before {\n pointer-events: none;\n content: '';\n position: absolute;\n top: 3px;\n right: 3px;\n bottom: 3px;\n left: 3px;\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgba(79, 143, 249, 0.5));\n}\n\n[part=header] > button.selected {\n --pg-icon-color: rgb(79, 143, 249);\n}\n\n[part=header] > button.selected:hover {\n background-color: #fff;\n}\n\n[part=side] {\n display: flex;\n flex-direction: column;\n grid-column: 1;\n grid-row: 2;\n min-width: 10rem;\n max-width: 20rem;\n}\n\n[part=main] {\n display: flex;\n flex-direction: column;\n grid-column: 3;\n grid-row: 2;\n}\n\n[part=resize] {\n display: flex;\n grid-column: 2;\n grid-row: 2;\n border: 0;\n padding: 0;\n cursor: ew-resize;\n border-left: 1px solid #453C4F;\n border-right: 1px solid #453C4F;\n background-color: transparent;\n}\n\n[part=resize].dragging {\n background-color: var(--pg-focus-color, rgb(79, 143, 249, 0.5))\n}\n\n[part=home] {\n display: flex;\n flex-direction: column;\n grid-column: 1 / 4;\n grid-row: 2;\n background-color: #fff;\n position: relative;\n}\n\n[part=home]::before {\n content: ' ';\n position: absolute;\n top: -2px;\n width: 2.5rem;\n height: 2px;\n background-color: #fff;\n}\n\n[part=home].selected {\n background-color: #fff;\n}\n\n.hide {\n display: none;\n}",""]);var s=new CSSStyleSheet;s.replaceSync(a.toString());const l=s}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={id:o,exports:{}};return e[o](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);Symbol("addObserver"),Symbol("removeObserver"),Symbol("getObservers"),Symbol("isProxy"),Symbol("getTarget");const o=new Map;window.observers=o;Error;Symbol("index");const r=Symbol("init"),i=Symbol("template"),a=Symbol("style"),s=Symbol("parent");function l(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function c(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var o,c;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[s]||t.prototype[s][t.prototype[s].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[s]=[t.prototype],t.prototype[a]=e.style?[e.style]:[],t.prototype[i]=e.template||""):(t.prototype[s].push(t.prototype),t.prototype[a].push(e.style),t.prototype[i]=(o=t.prototype[i],(c=e.template||null)&&c.match(/<parent\/>/)?c.replace(/<parent\/>/,o):`${o}${c||""}`));const d=t.prototype.connectedCallback||(()=>{}),p=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[r]||void 0!==e.template||void 0!==e.style)if(this[r]){if(this[r]&&e.style);else if(this[r]&&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[i]||"";const n=document.importNode(e.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=t.prototype[a].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),o.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 o=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),c=()=>{this[s].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[l(t)]=!0,e)),{}):{})}))};0===o.length?(this[r]=!0,d.call(this),c()):Promise.all(o).then((()=>{this[r]=!0,d.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));c()}))},t.prototype.disconnectedCallback=function(){p.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[l(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 d(){return function(e,t){const n=t.name,o=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${o}]`))}})}))}}Symbol("hasProxy");Symbol("meta");var p=n(801),u=function(e,t,n,o,r,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=o.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?o.static?e:e.prototype:null,p=t||(d?Object.getOwnPropertyDescriptor(d,o.name):{}),u=!1,h=n.length-1;h>=0;h--){var m={};for(var f in o)m[f]="access"===f?{}:o[f];for(var f in o.access)m.access[f]=o.access[f];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var g=(0,n[h])("accessor"===l?{get:p.get,set:p.set}:p[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(s=a(g.get))&&(p.get=s),(s=a(g.set))&&(p.set=s),(s=a(g.init))&&r.unshift(s)}else(s=a(g))&&("field"===l?r.unshift(s):p[c]=s)}d&&Object.defineProperty(d,o.name,p),u=!0},h=function(e,t,n){for(var o=arguments.length>2,r=0;r<t.length;r++)n=o?t[r].call(e,n):t[r].call(e);return o?n:void 0};(()=>{let e,t,n,o,r,i,a=[c({selector:"pg-app",style:p.A,template:'<div part="grid"> <header part="header"> <button part="logo"> <slot name="icon"></slot> </button> <slot name="top"></slot> </header> <div part="side"> <slot name="side"></slot> </div> <button part="resize"></button> <div part="main"> <slot name="main"></slot> </div> <div part="home" class="hide"> <slot name="home"></slot> </div> </div>'})],s=[],l=HTMLElement,m=[],f=[],g=[],b=[],v=[],y=[],w=[],S=[];(class extends l{static{t=this}static{const c="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;n=[d()],o=[d()],r=[d()],i=[d()],u(null,null,n,{kind:"field",name:"$logo",static:!1,private:!1,access:{has:e=>"$logo"in e,get:e=>e.$logo,set:(e,t)=>{e.$logo=t}},metadata:c},m,f),u(null,null,o,{kind:"field",name:"$home",static:!1,private:!1,access:{has:e=>"$home"in e,get:e=>e.$home,set:(e,t)=>{e.$home=t}},metadata:c},g,b),u(null,null,r,{kind:"field",name:"$side",static:!1,private:!1,access:{has:e=>"$side"in e,get:e=>e.$side,set:(e,t)=>{e.$side=t}},metadata:c},v,y),u(null,null,i,{kind:"field",name:"$resize",static:!1,private:!1,access:{has:e=>"$resize"in e,get:e=>e.$resize,set:(e,t)=>{e.$resize=t}},metadata:c},w,S),u(null,e={value:t},a,{kind:"class",name:t.name,metadata:c},null,s),t=e.value,c&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c}),h(t,s)}$logo=h(this,m,void 0);$home=(h(this,f),h(this,g,void 0));$side=(h(this,b),h(this,v,void 0));$resize=(h(this,y),h(this,w,void 0));connectedCallback(){this.$logo.addEventListener("click",this.#e.bind(this)),this.$resize.addEventListener("pointerdown",this.#t.bind(this))}#e(){this.$logo.classList.toggle("selected"),this.$home.classList.toggle("hide")}#t(e){const{clientX:t}=e;this.$resize.classList.add("dragging");const n=this.$side.getBoundingClientRect().width;let o=t;const r=e=>{const t=o-e.clientX,r=n-t;this.$side.style.width=`${r}px`},i=()=>{this.$resize.classList.remove("dragging"),document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",i)};document.addEventListener("pointermove",r),document.addEventListener("pointerup",i)}constructor(){super(...arguments),h(this,S)}})})()})();
1
+ (()=>{"use strict";var e={314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(o)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);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)),t.push(d))}},t}},601:e=>{e.exports=function(e){return e[1]}},801:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(601),r=n.n(o),i=n(314),a=n.n(i)()(r());a.push([e.id,":host {\n display: contents;\n}\n\n[part=grid] {\n display: grid;\n grid-template-columns: auto 0.5rem minmax(0, 1fr);\n grid-template-rows: auto minmax(0, 1fr);\n height: 100%;\n}\n\n[part=header] {\n display: flex;\n grid-column: 1 / 4;\n grid-row: 1;\n border-bottom: 2px solid #453C4F;\n}\n\n[part=header] > button {\n display: flex;\n border: 0;\n padding: 0.5rem;\n background-color: transparent;\n border-right: 1px solid rgba(69, 60, 79, 0.5);\n outline: none;\n}\n\n[part=header] > button:hover {\n background-color: rgba(69, 60, 79, 0.10);\n}\n\n[part=header] > button:focus-visible {\n position: relative;\n}\n\n[part=header] > button:focus-visible::before {\n pointer-events: none;\n content: '';\n position: absolute;\n top: 3px;\n right: 3px;\n bottom: 3px;\n left: 3px;\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgba(79, 143, 249, 0.5));\n}\n\n[part=header] > button.selected {\n --pg-icon-color: rgb(79, 143, 249);\n}\n\n[part=header] > button.selected:hover {\n background-color: #fff;\n}\n\n[part=side] {\n display: flex;\n flex-direction: column;\n grid-column: 1;\n grid-row: 2;\n min-width: 10rem;\n max-width: 20rem;\n}\n\n[part=main] {\n display: flex;\n flex-direction: column;\n grid-column: 3;\n grid-row: 2;\n}\n\n[part=resize] {\n display: flex;\n grid-column: 2;\n grid-row: 2;\n border: 0;\n padding: 0;\n cursor: ew-resize;\n border-left: 1px solid #453C4F;\n border-right: 1px solid #453C4F;\n background-color: transparent;\n}\n\n[part=resize].dragging {\n background-color: var(--pg-focus-color, rgb(79, 143, 249, 0.5))\n}\n\n[part=home] {\n display: flex;\n flex-direction: column;\n grid-column: 1 / 4;\n grid-row: 2;\n background-color: #fff;\n position: relative;\n}\n\n[part=home]::before {\n content: ' ';\n position: absolute;\n top: -2px;\n width: 2.5rem;\n height: 2px;\n background-color: #fff;\n}\n\n[part=home].selected {\n background-color: #fff;\n}\n\n.hide {\n display: none;\n}",""]);var s=new CSSStyleSheet;s.replaceSync(a.toString());const l=s}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={id:o,exports:{}};return e[o](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);Symbol("addObserver"),Symbol("removeObserver"),Symbol("getObservers"),Symbol("isProxy"),Symbol("getTarget");const o=new Map;window.observers=o;Error;Symbol("index");const r=Symbol("init"),i=Symbol("template"),a=Symbol("style"),s=Symbol("parent");function l(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function c(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var o,c;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[s]||t.prototype[s][t.prototype[s].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[s]=[t.prototype],t.prototype[a]=e.style?[e.style]:[],t.prototype[i]=e.template||""):(t.prototype[s].push(t.prototype),t.prototype[a].push(e.style),t.prototype[i]=(o=t.prototype[i],(c=e.template||null)&&c.match(/<parent\/>/)?c.replace(/<parent\/>/,o):`${o}${c||""}`));const d=t.prototype.connectedCallback||(()=>{}),p=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[r]||void 0!==e.template||void 0!==e.style)if(this[r]){if(this[r]&&e.style);else if(this[r]&&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[i]||"";const n=document.importNode(e.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=t.prototype[a].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),o.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 o=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),c=()=>{this[s].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[l(t)]=!0,e)),{}):{})}))};0===o.length?(this[r]=!0,d.call(this),c()):Promise.all(o).then((()=>{this[r]=!0,d.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));c()}))},t.prototype.disconnectedCallback=function(){p.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[l(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 d(){return function(e,t){const n=t.name,o=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${o}]`))}})}))}}Symbol("hasProxy");Symbol("meta");var p=n(801),u=function(e,t,n,o,r,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=o.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?o.static?e:e.prototype:null,p=t||(d?Object.getOwnPropertyDescriptor(d,o.name):{}),u=!1,h=n.length-1;h>=0;h--){var m={};for(var f in o)m[f]="access"===f?{}:o[f];for(var f in o.access)m.access[f]=o.access[f];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var g=(0,n[h])("accessor"===l?{get:p.get,set:p.set}:p[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(s=a(g.get))&&(p.get=s),(s=a(g.set))&&(p.set=s),(s=a(g.init))&&r.unshift(s)}else(s=a(g))&&("field"===l?r.unshift(s):p[c]=s)}d&&Object.defineProperty(d,o.name,p),u=!0},h=function(e,t,n){for(var o=arguments.length>2,r=0;r<t.length;r++)n=o?t[r].call(e,n):t[r].call(e);return o?n:void 0};(()=>{let e,t,n,o,r,i,a=[c({selector:"pg-app",style:p.A,template:'<div part="grid"> <header part="header"> <button part="logo"> <slot name="icon"></slot> </button> <slot name="top"></slot> </header> <div part="side"> <slot name="side"></slot> </div> <button part="resize"></button> <div part="main"> <slot name="main"></slot> </div> <div part="home" class="hide"> <slot name="home"></slot> </div> </div>'})],s=[],l=HTMLElement,m=[],f=[],g=[],b=[],v=[],y=[],w=[],S=[];(class extends l{static{t=this}static{const c="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;n=[d()],o=[d()],r=[d()],i=[d()],u(null,null,n,{kind:"field",name:"$logo",static:!1,private:!1,access:{has:e=>"$logo"in e,get:e=>e.$logo,set:(e,t)=>{e.$logo=t}},metadata:c},m,f),u(null,null,o,{kind:"field",name:"$home",static:!1,private:!1,access:{has:e=>"$home"in e,get:e=>e.$home,set:(e,t)=>{e.$home=t}},metadata:c},g,b),u(null,null,r,{kind:"field",name:"$side",static:!1,private:!1,access:{has:e=>"$side"in e,get:e=>e.$side,set:(e,t)=>{e.$side=t}},metadata:c},v,y),u(null,null,i,{kind:"field",name:"$resize",static:!1,private:!1,access:{has:e=>"$resize"in e,get:e=>e.$resize,set:(e,t)=>{e.$resize=t}},metadata:c},w,S),u(null,e={value:t},a,{kind:"class",name:t.name,metadata:c},null,s),t=e.value,c&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c}),h(t,s)}$logo=h(this,m,void 0);$home=(h(this,f),h(this,g,void 0));$side=(h(this,b),h(this,v,void 0));$resize=(h(this,y),h(this,w,void 0));connectedCallback(){this.$logo.addEventListener("click",this.#e.bind(this)),this.$resize.addEventListener("pointerdown",this.#t.bind(this))}#e(){this.$logo.classList.toggle("selected"),this.$home.classList.toggle("hide")}#t(e){const{clientX:t}=e;this.$resize.classList.add("dragging");const n=this.$side.getBoundingClientRect().width;let o=t;const r=e=>{const t=o-e.clientX,r=n-t;this.$side.style.width=`${r}px`},i=()=>{this.$resize.classList.remove("dragging"),document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",i)};document.addEventListener("pointermove",r),document.addEventListener("pointerup",i)}constructor(){super(...arguments),h(this,S)}})})()})();
package/pgButton.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var t={119:(t,e,n)=>{n.d(e,{A:()=>c});var r=n(601),o=n.n(r),a=n(314),i=n.n(a)()(o());i.push([t.id,':host {\n display: contents;\n}\n\n[part="button"] {\n display: flex;\n align-items: center;\n align-content: center;\n font-family: var(--pg-font-family);\n font-size: var(--pg-button-font-size, 1rem);\n line-height: var(--pg-button-line-height, 1.5rem);\n border: 1px solid var(--pg-button-border-color, #453C4F);\n background-color: var(--pg-button-background-color, #FFFFFF);\n color: var(--pg-button-color, #453C4F);\n padding: var(--pg-button-padding, 0.25rem 0.5rem);\n border-radius: var(--pg-button-border-radius, 0.25rem);\n outline: none;\n --pg-icon-color: var(--pg-button-color, #453C4F);\n}\n\n[part="button"]:hover {\n border: 1px solid var(--pg-button-hover-border-color, #453C4F);\n background-color: var(--pg-button-hover-background-color, #453C4F);\n color: var(--pg-button-hover-color, #FFFFFF);\n --pg-icon-color: var(--pg-button-hover-color, #FFFFFF);\n}\n\n[part="button"]:active {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n position: relative;\n}\n\n[part="button"]:focus {\n position: relative;\n}\n\n[part="button"]:active::before {\n content: \'\';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: var(--pg-button-border-radius, 0.25rem);\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.6));\n}\n[part="button"]:focus::before {\n pointer-events: none;\n content: \'\';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: var(--pg-button-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"].start {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n margin-right: -1px;\n}\n\n[part="button"].center {\n border-radius: 0;\n margin-right: -1px;\n}\n\n[part="button"].end {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n[part="button"].active {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n background-color: rgba(69, 60, 79, 0.1);\n color: var(--pg-button-color, #453C4F);\n}\n[part="button"].active:hover {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n background-color: var(--pg-button-color, #453C4F);\n color: var(--pg-button-hover-color, #fff);\n}\n\n[part="button"].block {\n flex: 1;\n}\n\n::slotted {\n align-self: center;\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const c=s},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,o,a){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(r)for(var s=0;s<this.length;s++){var c=this[s][0];null!=c&&(i[c]=!0)}for(var l=0;l<t.length;l++){var u=[].concat(t[l]);r&&i[u[0]]||(void 0!==a&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=a),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},601:t=>{t.exports=function(t){return t[1]}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var a=e[r]={id:r,exports:{}};return t[r](a,a.exports,n),a.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const r=Symbol("addObserver"),o=Symbol("removeObserver"),a=Symbol("getObservers"),i=Symbol("isProxy"),s=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],l=new Map;function u(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case i:return!0;case s:return e;case a:return l.has(t);case r:return(e,n)=>{l.has(t)?l.get(t).has(e)?l.get(t).get(e).push(n):l.get(t).set(e,[n]):l.set(t,new Map([[e,[n]]]))};case o:return e=>{l.has(t)&&(l.get(t).delete(e),0===l.get(t).size&&l.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,n)}throw new Error("Unsupported symbol")}if(n in e){if(!Number.isNaN(Number(n)))return"object"==typeof e[n]?u(e[n]):e[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(c.includes(n))return l.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return l.get(e).forEach(((t,r)=>{t.forEach((t=>{t(e,n,arguments)}))})),t}:Reflect.get(e,n);if(e[n]instanceof Array)return u(e[n])}return Reflect.get(e,n)},set(t,e,n){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,n);if(l.has(t)){l.get(t).forEach(((t,r)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=l;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const p=Symbol("init"),d=Symbol("template"),h=Symbol("style"),b=Symbol("parent");function f(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function m(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function g(t={}){return function(e,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,o;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[b]||e.prototype[b][e.prototype[b].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[b]=[e.prototype],e.prototype[h]=t.style?[t.style]:[],e.prototype[d]=t.template||""):(e.prototype[b].push(e.prototype),e.prototype[h].push(t.style),e.prototype[d]=(r=e.prototype[d],(o=t.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,r):`${r}${o||""}`));const a=e.prototype.connectedCallback||(()=>{}),i=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[p]||void 0!==t.template||void 0!==t.style)if(this[p]){if(this[p]&&t.style);else if(this[p]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[d]||"";const n=document.importNode(t.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=e.prototype[h].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),r.appendChild(n)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&n.add(t.localName);const r=Array.from(n.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),o=()=>{this[b].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[m(e)]=!0,t)),{}):{})}))};0===r.length?(this[p]=!0,a.call(this),o()):Promise.all(r).then((()=>{this[p]=!0,a.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));o()}))},e.prototype.disconnectedCallback=function(){i.call(this)},e.prototype.attributeChangedCallback=function(t,e,n){this[m(t)]=n},n.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${n.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function y(t){return!!t&&t.constructor===Array}function v(t,e){t[p]&&t[b].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function w(t){return null===t?"null":y(t)?"array":typeof t}function S(t){return function(e,n){const r=n.name,o=Symbol(r),c=Symbol(`${r}:type`),l=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[c]||"array"===this[c]?this[o][i]?this[o]:u(this[o]):this[o],set:e=>{const n=w(t?t(e):e);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(!y(e))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[o]===e)throw new Error("Setting an array to itself is not allowed.");const t=u(this[o]);if(t[a]){const n=e[i]?(l=e)[i]&&l[s]:e;t.splice(0,this[o].length,...n)}else this[o]=e}else this[o]=t?t(e):e,v(this,r);var l}})})),function(e){if(void 0===e&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==e&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,n=f(r);e[r]||(t.observedAttributes.push(n),e[r]=o)}return this[c]=w(e),"array"===this[c]?(this[o]=e,new Proxy(e,{get:(t,e)=>e===$?this[l]:(console.log("errr???"),Reflect.get(this[o],e)),set:(t,e,n)=>{if(e===$)return this[l]=n,!0;const a=Reflect.set(t,e,n);return"length"===e&&this[o].length===n||v(this,r),this[o]=n,a}})):(this[o]=t?t(this.getAttribute(r)??e):this.getAttribute(r)??e,this[o])}}}function x(){return function(t,e){const n=e.name,r=n.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,n,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}function E(t){return""===t||!0===t||null!==t&&!1!==t&&(t||!0)}Symbol("hasProxy");const $=Symbol("meta");var k=n(119),C=function(t,e,n,r,o,a){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,c=r.kind,l="getter"===c?"get":"setter"===c?"set":"value",u=!e&&t?r.static?t:t.prototype:null,p=e||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,h=n.length-1;h>=0;h--){var b={};for(var f in r)b[f]="access"===f?{}:r[f];for(var f in r.access)b.access[f]=r.access[f];b.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(t||null))};var m=(0,n[h])("accessor"===c?{get:p.get,set:p.set}:p[l],b);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=i(m.get))&&(p.get=s),(s=i(m.set))&&(p.set=s),(s=i(m.init))&&o.unshift(s)}else(s=i(m))&&("field"===c?o.unshift(s):p[l]=s)}u&&Object.defineProperty(u,r.name,p),d=!0},F=function(t,e,n){for(var r=arguments.length>2,o=0;o<e.length;o++)n=r?e[o].call(t,n):e[o].call(t);return r?n:void 0};(()=>{let t,e,n,r,o,a,i,s,c,l,u=[g({selector:"pg-button",style:k.A,template:'<button part="button"> <slot></slot> </button>'})],p=[],d=HTMLElement,h=[],b=[],f=[],m=[],y=[],v=[],w=[],$=[],P=[],A=[],O=[],R=[],j=[],z=[],L=[],T=[];(class extends d{static{e=this}static{const g="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[S(E)],r=[S(E)],o=[S(E)],a=[S(E)],i=[S(E)],s=[x()],c=[x()],l=[x()],C(null,null,n,{kind:"field",name:"active",static:!1,private:!1,access:{has:t=>"active"in t,get:t=>t.active,set:(t,e)=>{t.active=e}},metadata:g},h,b),C(null,null,r,{kind:"field",name:"block",static:!1,private:!1,access:{has:t=>"block"in t,get:t=>t.block,set:(t,e)=>{t.block=e}},metadata:g},f,m),C(null,null,o,{kind:"field",name:"start",static:!1,private:!1,access:{has:t=>"start"in t,get:t=>t.start,set:(t,e)=>{t.start=e}},metadata:g},y,v),C(null,null,a,{kind:"field",name:"center",static:!1,private:!1,access:{has:t=>"center"in t,get:t=>t.center,set:(t,e)=>{t.center=e}},metadata:g},w,$),C(null,null,i,{kind:"field",name:"end",static:!1,private:!1,access:{has:t=>"end"in t,get:t=>t.end,set:(t,e)=>{t.end=e}},metadata:g},P,A),C(null,null,s,{kind:"field",name:"$button",static:!1,private:!1,access:{has:t=>"$button"in t,get:t=>t.$button,set:(t,e)=>{t.$button=e}},metadata:g},O,R),C(null,null,c,{kind:"field",name:"$number",static:!1,private:!1,access:{has:t=>"$number"in t,get:t=>t.$number,set:(t,e)=>{t.$number=e}},metadata:g},j,z),C(null,null,l,{kind:"field",name:"$bar",static:!1,private:!1,access:{has:t=>"$bar"in t,get:t=>t.$bar,set:(t,e)=>{t.$bar=e}},metadata:g},L,T),C(null,t={value:e},u,{kind:"class",name:e.name,metadata:g},null,p),e=t.value,g&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g}),F(e,p)}active=F(this,h,!1);block=(F(this,b),F(this,f,!1));start=(F(this,m),F(this,y,!1));center=(F(this,v),F(this,w,!1));end=(F(this,$),F(this,P,!1));$button=(F(this,A),F(this,O,void 0));$number=(F(this,R),F(this,j,void 0));$bar=(F(this,z),F(this,L,void 0));connectedCallback(){this.$button.addEventListener("click",(t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("click"))}))}render(t){t.active&&this.$button.classList.toggle("active",this.active),t.start&&this.$button.classList.toggle("start",this.start),t.end&&this.$button.classList.toggle("end",this.end),t.center&&this.$button.classList.toggle("center",this.center),t.block&&this.$button.classList.toggle("block",this.block)}getBoundingClientRect(){return this.$button.getBoundingClientRect()}constructor(){super(...arguments),F(this,T)}})})()})();
1
+ (()=>{"use strict";var t={119:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(601),o=n.n(r),a=n(314),i=n.n(a)()(o());i.push([t.id,':host {\n display: contents;\n}\n\n[part="button"] {\n display: flex;\n align-items: center;\n align-content: center;\n font-family: var(--pg-font-family);\n font-size: var(--pg-button-font-size, 1rem);\n line-height: var(--pg-button-line-height, 1.5rem);\n border: 1px solid var(--pg-button-border-color, #453C4F);\n background-color: var(--pg-button-background-color, #FFFFFF);\n color: var(--pg-button-color, #453C4F);\n padding: var(--pg-button-padding, 0.25rem 0.5rem);\n border-radius: var(--pg-button-border-radius, 0.25rem);\n outline: none;\n --pg-icon-color: var(--pg-button-color, #453C4F);\n}\n\n[part="button"]:hover {\n border: 1px solid var(--pg-button-hover-border-color, #453C4F);\n background-color: var(--pg-button-hover-background-color, #453C4F);\n color: var(--pg-button-hover-color, #FFFFFF);\n --pg-icon-color: var(--pg-button-hover-color, #FFFFFF);\n}\n\n[part="button"]:active {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n position: relative;\n}\n\n[part="button"]:focus-visible {\n position: relative;\n}\n\n[part="button"]:active::before {\n content: \'\';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: var(--pg-button-border-radius, 0.25rem);\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.6));\n}\n[part="button"]:focus-visible::before {\n pointer-events: none;\n content: \'\';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: var(--pg-button-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"].start {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n margin-right: -1px;\n}\n\n[part="button"].center {\n border-radius: 0;\n margin-right: -1px;\n}\n\n[part="button"].end {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n[part="button"].active {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n background-color: rgba(69, 60, 79, 0.1);\n color: var(--pg-button-color, #453C4F);\n}\n[part="button"].active:hover {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n background-color: var(--pg-button-color, #453C4F);\n color: var(--pg-button-hover-color, #fff);\n}\n\n[part="button"].block {\n flex: 1;\n}\n\n::slotted {\n align-self: center;\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,o,a){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<t.length;c++){var u=[].concat(t[c]);r&&i[u[0]]||(void 0!==a&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=a),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),e.push(u))}},e}},601:t=>{t.exports=function(t){return t[1]}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var a=e[r]={id:r,exports:{}};return t[r](a,a.exports,n),a.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const r=Symbol("addObserver"),o=Symbol("removeObserver"),a=Symbol("getObservers"),i=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function u(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case i:return!0;case s:return e;case a:return c.has(t);case r:return(e,n)=>{c.has(t)?c.get(t).has(e)?c.get(t).get(e).push(n):c.get(t).set(e,[n]):c.set(t,new Map([[e,[n]]]))};case o:return e=>{c.has(t)&&(c.get(t).delete(e),0===c.get(t).size&&c.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,n)}throw new Error("Unsupported symbol")}if(n in e){if(!Number.isNaN(Number(n)))return"object"==typeof e[n]?u(e[n]):e[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return c.get(e).forEach(((t,r)=>{t.forEach((t=>{t(e,n,arguments)}))})),t}:Reflect.get(e,n);if(e[n]instanceof Array)return u(e[n])}return Reflect.get(e,n)},set(t,e,n){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,n);if(c.has(t)){c.get(t).forEach(((t,r)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=c;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const p=Symbol("init"),d=Symbol("template"),h=Symbol("style"),b=Symbol("parent");function f(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function m(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function g(t={}){return function(e,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,o;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[b]||e.prototype[b][e.prototype[b].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[b]=[e.prototype],e.prototype[h]=t.style?[t.style]:[],e.prototype[d]=t.template||""):(e.prototype[b].push(e.prototype),e.prototype[h].push(t.style),e.prototype[d]=(r=e.prototype[d],(o=t.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,r):`${r}${o||""}`));const a=e.prototype.connectedCallback||(()=>{}),i=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[p]||void 0!==t.template||void 0!==t.style)if(this[p]){if(this[p]&&t.style);else if(this[p]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[d]||"";const n=document.importNode(t.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=e.prototype[h].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),r.appendChild(n)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&n.add(t.localName);const r=Array.from(n.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),o=()=>{this[b].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[m(e)]=!0,t)),{}):{})}))};0===r.length?(this[p]=!0,a.call(this),o()):Promise.all(r).then((()=>{this[p]=!0,a.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));o()}))},e.prototype.disconnectedCallback=function(){i.call(this)},e.prototype.attributeChangedCallback=function(t,e,n){this[m(t)]=n},n.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${n.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function y(t){return!!t&&t.constructor===Array}function v(t,e){t[p]&&t[b].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function w(t){return null===t?"null":y(t)?"array":typeof t}function S(t){return function(e,n){const r=n.name,o=Symbol(r),l=Symbol(`${r}:type`),c=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[l]||"array"===this[l]?this[o][i]?this[o]:u(this[o]):this[o],set:e=>{const n=w(t?t(e):e);if("index"!==r&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!y(e))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[o]===e)throw new Error("Setting an array to itself is not allowed.");const t=u(this[o]);if(t[a]){const n=e[i]?(c=e)[i]&&c[s]:e;t.splice(0,this[o].length,...n)}else this[o]=e}else this[o]=t?t(e):e,v(this,r);var c}})})),function(e){if(void 0===e&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==e&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,n=f(r);e[r]||(t.observedAttributes.push(n),e[r]=o)}return this[l]=w(e),"array"===this[l]?(this[o]=e,new Proxy(e,{get:(t,e)=>e===$?this[c]:(console.log("errr???"),Reflect.get(this[o],e)),set:(t,e,n)=>{if(e===$)return this[c]=n,!0;const a=Reflect.set(t,e,n);return"length"===e&&this[o].length===n||v(this,r),this[o]=n,a}})):(this[o]=t?t(this.getAttribute(r)??e):this.getAttribute(r)??e,this[o])}}}function x(){return function(t,e){const n=e.name,r=n.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,n,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}function E(t){return""===t||!0===t||null!==t&&!1!==t&&(t||!0)}Symbol("hasProxy");const $=Symbol("meta");var k=n(119),C=function(t,e,n,r,o,a){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?r.static?t:t.prototype:null,p=e||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,h=n.length-1;h>=0;h--){var b={};for(var f in r)b[f]="access"===f?{}:r[f];for(var f in r.access)b.access[f]=r.access[f];b.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(t||null))};var m=(0,n[h])("accessor"===l?{get:p.get,set:p.set}:p[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=i(m.get))&&(p.get=s),(s=i(m.set))&&(p.set=s),(s=i(m.init))&&o.unshift(s)}else(s=i(m))&&("field"===l?o.unshift(s):p[c]=s)}u&&Object.defineProperty(u,r.name,p),d=!0},F=function(t,e,n){for(var r=arguments.length>2,o=0;o<e.length;o++)n=r?e[o].call(t,n):e[o].call(t);return r?n:void 0};(()=>{let t,e,n,r,o,a,i,s,l,c,u=[g({selector:"pg-button",style:k.A,template:'<button part="button"> <slot></slot> </button>'})],p=[],d=HTMLElement,h=[],b=[],f=[],m=[],y=[],v=[],w=[],$=[],P=[],A=[],O=[],R=[],j=[],z=[],L=[],T=[];(class extends d{static{e=this}static{const g="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[S(E)],r=[S(E)],o=[S(E)],a=[S(E)],i=[S(E)],s=[x()],l=[x()],c=[x()],C(null,null,n,{kind:"field",name:"active",static:!1,private:!1,access:{has:t=>"active"in t,get:t=>t.active,set:(t,e)=>{t.active=e}},metadata:g},h,b),C(null,null,r,{kind:"field",name:"block",static:!1,private:!1,access:{has:t=>"block"in t,get:t=>t.block,set:(t,e)=>{t.block=e}},metadata:g},f,m),C(null,null,o,{kind:"field",name:"start",static:!1,private:!1,access:{has:t=>"start"in t,get:t=>t.start,set:(t,e)=>{t.start=e}},metadata:g},y,v),C(null,null,a,{kind:"field",name:"center",static:!1,private:!1,access:{has:t=>"center"in t,get:t=>t.center,set:(t,e)=>{t.center=e}},metadata:g},w,$),C(null,null,i,{kind:"field",name:"end",static:!1,private:!1,access:{has:t=>"end"in t,get:t=>t.end,set:(t,e)=>{t.end=e}},metadata:g},P,A),C(null,null,s,{kind:"field",name:"$button",static:!1,private:!1,access:{has:t=>"$button"in t,get:t=>t.$button,set:(t,e)=>{t.$button=e}},metadata:g},O,R),C(null,null,l,{kind:"field",name:"$number",static:!1,private:!1,access:{has:t=>"$number"in t,get:t=>t.$number,set:(t,e)=>{t.$number=e}},metadata:g},j,z),C(null,null,c,{kind:"field",name:"$bar",static:!1,private:!1,access:{has:t=>"$bar"in t,get:t=>t.$bar,set:(t,e)=>{t.$bar=e}},metadata:g},L,T),C(null,t={value:e},u,{kind:"class",name:e.name,metadata:g},null,p),e=t.value,g&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g}),F(e,p)}active=F(this,h,!1);block=(F(this,b),F(this,f,!1));start=(F(this,m),F(this,y,!1));center=(F(this,v),F(this,w,!1));end=(F(this,$),F(this,P,!1));$button=(F(this,A),F(this,O,void 0));$number=(F(this,R),F(this,j,void 0));$bar=(F(this,z),F(this,L,void 0));connectedCallback(){this.$button.addEventListener("click",(t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("click"))}))}render(t){t.active&&this.$button.classList.toggle("active",this.active),t.start&&this.$button.classList.toggle("start",this.start),t.end&&this.$button.classList.toggle("end",this.end),t.center&&this.$button.classList.toggle("center",this.center),t.block&&this.$button.classList.toggle("block",this.block)}getBoundingClientRect(){return this.$button.getBoundingClientRect()}constructor(){super(...arguments),F(this,T)}})})()})();
package/pgButtonMenu.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var t={119:(t,e,n)=>{n.d(e,{A:()=>l});var a=n(601),r=n.n(a),o=n(314),i=n.n(o)()(r());i.push([t.id,':host {\n display: contents;\n}\n\n[part="button"] {\n display: flex;\n align-items: center;\n align-content: center;\n font-family: var(--pg-font-family);\n font-size: var(--pg-button-font-size, 1rem);\n line-height: var(--pg-button-line-height, 1.5rem);\n border: 1px solid var(--pg-button-border-color, #453C4F);\n background-color: var(--pg-button-background-color, #FFFFFF);\n color: var(--pg-button-color, #453C4F);\n padding: var(--pg-button-padding, 0.25rem 0.5rem);\n border-radius: var(--pg-button-border-radius, 0.25rem);\n outline: none;\n --pg-icon-color: var(--pg-button-color, #453C4F);\n}\n\n[part="button"]:hover {\n border: 1px solid var(--pg-button-hover-border-color, #453C4F);\n background-color: var(--pg-button-hover-background-color, #453C4F);\n color: var(--pg-button-hover-color, #FFFFFF);\n --pg-icon-color: var(--pg-button-hover-color, #FFFFFF);\n}\n\n[part="button"]:active {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n position: relative;\n}\n\n[part="button"]:focus {\n position: relative;\n}\n\n[part="button"]:active::before {\n content: \'\';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: var(--pg-button-border-radius, 0.25rem);\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.6));\n}\n[part="button"]:focus::before {\n pointer-events: none;\n content: \'\';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: var(--pg-button-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"].start {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n margin-right: -1px;\n}\n\n[part="button"].center {\n border-radius: 0;\n margin-right: -1px;\n}\n\n[part="button"].end {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n[part="button"].active {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n background-color: rgba(69, 60, 79, 0.1);\n color: var(--pg-button-color, #453C4F);\n}\n[part="button"].active:hover {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n background-color: var(--pg-button-color, #453C4F);\n color: var(--pg-button-hover-color, #fff);\n}\n\n[part="button"].block {\n flex: 1;\n}\n\n::slotted {\n align-self: center;\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",a=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),a&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),a&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,a,r,o){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(a)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<t.length;c++){var u=[].concat(t[c]);a&&i[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),e.push(u))}},e}},601:t=>{t.exports=function(t){return t[1]}},685:(t,e,n)=>{n.d(e,{A:()=>l});var a=n(601),r=n.n(a),o=n(314),i=n.n(o)()(r());i.push([t.id,":host {\n display: inline-flex;\n}\n\nspan {\n align-self: center;\n display: flex;\n}\n\n[part=collapse] {\n display: none;\n}",""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},697:(t,e,n)=>{n.d(e,{A:()=>l});var a=n(601),r=n.n(a),o=n(314),i=n.n(o)()(r());i.push([t.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 s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s}},e={};function n(a){var r=e[a];if(void 0!==r)return r.exports;var o=e[a]={id:a,exports:{}};return t[a](o,o.exports,n),o.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 a in e)n.o(e,a)&&!n.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const a=Symbol("addObserver"),r=Symbol("removeObserver"),o=Symbol("getObservers"),i=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function u(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case i:return!0;case s:return e;case o:return c.has(t);case a:return(e,n)=>{c.has(t)?c.get(t).has(e)?c.get(t).get(e).push(n):c.get(t).set(e,[n]):c.set(t,new Map([[e,[n]]]))};case r:return e=>{c.has(t)&&(c.get(t).delete(e),0===c.get(t).size&&c.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,n)}throw new Error("Unsupported symbol")}if(n in e){if(!Number.isNaN(Number(n)))return"object"==typeof e[n]?u(e[n]):e[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return c.get(e).forEach(((t,a)=>{t.forEach((t=>{t(e,n,arguments)}))})),t}:Reflect.get(e,n);if(e[n]instanceof Array)return u(e[n])}return Reflect.get(e,n)},set(t,e,n){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,n);if(c.has(t)){c.get(t).forEach(((t,a)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=c;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const d=Symbol("init"),p=Symbol("template"),h=Symbol("style"),f=Symbol("parent");function m(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 v(t={}){return function(e,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var a,r;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[f]||e.prototype[f][e.prototype[f].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[f]=[e.prototype],e.prototype[h]=t.style?[t.style]:[],e.prototype[p]=t.template||""):(e.prototype[f].push(e.prototype),e.prototype[h].push(t.style),e.prototype[p]=(a=e.prototype[p],(r=t.template||null)&&r.match(/<parent\/>/)?r.replace(/<parent\/>/,a):`${a}${r||""}`));const o=e.prototype.connectedCallback||(()=>{}),i=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[d]||void 0!==t.template||void 0!==t.style)if(this[d]){if(this[d]&&t.style);else if(this[d]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[p]||"";const n=document.importNode(t.content,!0),a=this.attachShadow({mode:"open"});a.adoptedStyleSheets=e.prototype[h].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),a.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 a=Array.from(n.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),r=()=>{this[f].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[b(e)]=!0,t)),{}):{})}))};0===a.length?(this[d]=!0,o.call(this),r()):Promise.all(a).then((()=>{this[d]=!0,o.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));r()}))},e.prototype.disconnectedCallback=function(){i.call(this)},e.prototype.attributeChangedCallback=function(t,e,n){this[b(t)]=n},n.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${n.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function g(t){return!!t&&t.constructor===Array}function y(t,e){t[d]&&t[f].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function w(t){return null===t?"null":g(t)?"array":typeof t}function S(t){return function(e,n){const a=n.name,r=Symbol(a),l=Symbol(`${a}:type`),c=Symbol(`${a}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,a,{get:()=>"object"===this[l]||"array"===this[l]?this[r][i]?this[r]:u(this[r]):this[r],set:e=>{const n=w(t?t(e):e);if("index"!==a&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${a} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!g(e))throw new PropError(`Array "${a}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,a)?.set);if(this[r]===e)throw new Error("Setting an array to itself is not allowed.");const t=u(this[r]);if(t[o]){const n=e[i]?(c=e)[i]&&c[s]:e;t.splice(0,this[r].length,...n)}else this[r]=e}else this[r]=t?t(e):e,y(this,a);var c}})})),function(e){if(void 0===e&&"index"!==a)throw new Error(`@Prop() ${a} must have an initial value defined.`);if(void 0!==e&&"index"===a)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${a} boolean must initialize to false.`);if(!n.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,n=m(a);e[a]||(t.observedAttributes.push(n),e[a]=r)}return this[l]=w(e),"array"===this[l]?(this[r]=e,new Proxy(e,{get:(t,e)=>e===x?this[c]:(console.log("errr???"),Reflect.get(this[r],e)),set:(t,e,n)=>{if(e===x)return this[c]=n,!0;const o=Reflect.set(t,e,n);return"length"===e&&this[r].length===n||y(this,a),this[r]=n,o}})):(this[r]=t?t(this.getAttribute(a)??e):this.getAttribute(a)??e,this[r])}}}function $(){return function(t,e){const n=e.name,a=n.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,n,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${a}]`))}})}))}}function k(t){return""===t||!0===t||null!==t&&!1!==t&&(t||!0)}Symbol("hasProxy");const x=Symbol("meta");var E=function(t,e,n,a,r,o){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=a.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?a.static?t:t.prototype:null,d=e||(u?Object.getOwnPropertyDescriptor(u,a.name):{}),p=!1,h=n.length-1;h>=0;h--){var f={};for(var m in a)f[m]="access"===m?{}:a[m];for(var m in a.access)f.access[m]=a.access[m];f.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var b=(0,n[h])("accessor"===l?{get:d.get,set:d.set}:d[c],f);if("accessor"===l){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(s=i(b.get))&&(d.get=s),(s=i(b.set))&&(d.set=s),(s=i(b.init))&&r.unshift(s)}else(s=i(b))&&("field"===l?r.unshift(s):d[c]=s)}u&&Object.defineProperty(u,a.name,d),p=!0},O=function(t,e,n){for(var a=arguments.length>2,r=0;r<e.length;r++)n=a?e[r].call(t,n):e[r].call(t);return a?n:void 0};const C=new Set,P=new Map;const j=(()=>{let t,e,n=[v()],a=[],r=HTMLElement;(class extends r{static{e=this}static{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;E(null,t={value:e},n,{kind:"class",name:e.name,metadata:o},null,a),e=t.value,o&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),O(e,a)}static open(t={}){var e=document.createElement(this.name);return Object.assign(e,t),document.body.appendChild(e),C.add(e),new Promise((t=>{P.set(e,t)}))}close(t){this.remove(),C.delete(this);const e=P.get(this);e&&e(t),P.delete(this)}});return e})();var L=n(697),F=function(t,e,n,a,r,o){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=a.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?a.static?t:t.prototype:null,d=e||(u?Object.getOwnPropertyDescriptor(u,a.name):{}),p=!1,h=n.length-1;h>=0;h--){var f={};for(var m in a)f[m]="access"===m?{}:a[m];for(var m in a.access)f.access[m]=a.access[m];f.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var b=(0,n[h])("accessor"===l?{get:d.get,set:d.set}:d[c],f);if("accessor"===l){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(s=i(b.get))&&(d.get=s),(s=i(b.set))&&(d.set=s),(s=i(b.init))&&r.unshift(s)}else(s=i(b))&&("field"===l?r.unshift(s):d[c]=s)}u&&Object.defineProperty(u,a.name,d),p=!0},A=function(t,e,n){for(var a=arguments.length>2,r=0;r<e.length;r++)n=a?e[r].call(t,n):e[r].call(t);return a?n:void 0};let T=(()=>{let t,e,n,a,r,o,i,s,l=[v({selector:"pg-overlay-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:L.A})],c=[],u=j,d=[],p=[],h=[],f=[],m=[],b=[],g=[],y=[],w=[],k=[],x=[],E=[];(class extends u{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;n=[$()],a=[$()],r=[S()],o=[S()],i=[S()],s=[S()],F(null,null,n,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:t=>"$overlay"in t,get:t=>t.$overlay,set:(t,e)=>{t.$overlay=e}},metadata:v},d,p),F(null,null,a,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:t=>"$menu"in t,get:t=>t.$menu,set:(t,e)=>{t.$menu=e}},metadata:v},h,f),F(null,null,r,{kind:"field",name:"source",static:!1,private:!1,access:{has:t=>"source"in t,get:t=>t.source,set:(t,e)=>{t.source=e}},metadata:v},m,b),F(null,null,o,{kind:"field",name:"default",static:!1,private:!1,access:{has:t=>"default"in t,get:t=>t.default,set:(t,e)=>{t.default=e}},metadata:v},g,y),F(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},w,k),F(null,null,s,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:v},x,E),F(null,t={value:e},l,{kind:"class",name:e.name,metadata:v},null,c),e=t.value,v&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v}),A(e,c)}$overlay=A(this,d,void 0);$menu=(A(this,p),A(this,h,void 0));source=(A(this,f),A(this,m,null));default=(A(this,b),A(this,g,null));items=(A(this,y),A(this,w,[]));value=(A(this,k),A(this,x,null));render(t){}connectedCallback(){this.$menu.items=this.items,this.$menu.addEventListener("select",this.#t.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#e.bind(this));this.source?.getBoundingClientRect();const t=null===this.value||"object"!=typeof this.value?this.value:this.value.value,e=null===this.value?0:this.items.findIndex((e=>e.value===t));this.$menu.focus(e)}#e(t){"closed"===t.newState&&(this.close(),this.source?.focus())}disconnectedCallback(){}#t(t){t.detail.item.index=t.detail.index,this.close(t.detail.item),this.source?.focus()}constructor(){super(...arguments),A(this,E)}});return e})();const z=T;var R=n(119),M=function(t,e,n,a,r,o){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=a.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?a.static?t:t.prototype:null,d=e||(u?Object.getOwnPropertyDescriptor(u,a.name):{}),p=!1,h=n.length-1;h>=0;h--){var f={};for(var m in a)f[m]="access"===m?{}:a[m];for(var m in a.access)f.access[m]=a.access[m];f.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var b=(0,n[h])("accessor"===l?{get:d.get,set:d.set}:d[c],f);if("accessor"===l){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(s=i(b.get))&&(d.get=s),(s=i(b.set))&&(d.set=s),(s=i(b.init))&&r.unshift(s)}else(s=i(b))&&("field"===l?r.unshift(s):d[c]=s)}u&&Object.defineProperty(u,a.name,d),p=!0},I=function(t,e,n){for(var a=arguments.length>2,r=0;r<e.length;r++)n=a?e[r].call(t,n):e[r].call(t);return a?n:void 0};(()=>{let t,e,n,a,r,o,i,s,l,c,u=[v({selector:"pg-button",style:R.A,template:'<button part="button"> <slot></slot> </button>'})],d=[],p=HTMLElement,h=[],f=[],m=[],b=[],g=[],y=[],w=[],x=[],E=[],O=[],C=[],P=[],j=[],L=[],F=[],A=[];(class extends p{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(p[Symbol.metadata]??null):void 0;n=[S(k)],a=[S(k)],r=[S(k)],o=[S(k)],i=[S(k)],s=[$()],l=[$()],c=[$()],M(null,null,n,{kind:"field",name:"active",static:!1,private:!1,access:{has:t=>"active"in t,get:t=>t.active,set:(t,e)=>{t.active=e}},metadata:v},h,f),M(null,null,a,{kind:"field",name:"block",static:!1,private:!1,access:{has:t=>"block"in t,get:t=>t.block,set:(t,e)=>{t.block=e}},metadata:v},m,b),M(null,null,r,{kind:"field",name:"start",static:!1,private:!1,access:{has:t=>"start"in t,get:t=>t.start,set:(t,e)=>{t.start=e}},metadata:v},g,y),M(null,null,o,{kind:"field",name:"center",static:!1,private:!1,access:{has:t=>"center"in t,get:t=>t.center,set:(t,e)=>{t.center=e}},metadata:v},w,x),M(null,null,i,{kind:"field",name:"end",static:!1,private:!1,access:{has:t=>"end"in t,get:t=>t.end,set:(t,e)=>{t.end=e}},metadata:v},E,O),M(null,null,s,{kind:"field",name:"$button",static:!1,private:!1,access:{has:t=>"$button"in t,get:t=>t.$button,set:(t,e)=>{t.$button=e}},metadata:v},C,P),M(null,null,l,{kind:"field",name:"$number",static:!1,private:!1,access:{has:t=>"$number"in t,get:t=>t.$number,set:(t,e)=>{t.$number=e}},metadata:v},j,L),M(null,null,c,{kind:"field",name:"$bar",static:!1,private:!1,access:{has:t=>"$bar"in t,get:t=>t.$bar,set:(t,e)=>{t.$bar=e}},metadata:v},F,A),M(null,t={value:e},u,{kind:"class",name:e.name,metadata:v},null,d),e=t.value,v&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v}),I(e,d)}active=I(this,h,!1);block=(I(this,f),I(this,m,!1));start=(I(this,b),I(this,g,!1));center=(I(this,y),I(this,w,!1));end=(I(this,x),I(this,E,!1));$button=(I(this,O),I(this,C,void 0));$number=(I(this,P),I(this,j,void 0));$bar=(I(this,L),I(this,F,void 0));connectedCallback(){this.$button.addEventListener("click",(t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("click"))}))}render(t){t.active&&this.$button.classList.toggle("active",this.active),t.start&&this.$button.classList.toggle("start",this.start),t.end&&this.$button.classList.toggle("end",this.end),t.center&&this.$button.classList.toggle("center",this.center),t.block&&this.$button.classList.toggle("block",this.block)}getBoundingClientRect(){return this.$button.getBoundingClientRect()}constructor(){super(...arguments),I(this,A)}})})();var N=n(685),D=function(t,e,n,a,r,o){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=a.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?a.static?t:t.prototype:null,d=e||(u?Object.getOwnPropertyDescriptor(u,a.name):{}),p=!1,h=n.length-1;h>=0;h--){var f={};for(var m in a)f[m]="access"===m?{}:a[m];for(var m in a.access)f.access[m]=a.access[m];f.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var b=(0,n[h])("accessor"===l?{get:d.get,set:d.set}:d[c],f);if("accessor"===l){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(s=i(b.get))&&(d.get=s),(s=i(b.set))&&(d.set=s),(s=i(b.init))&&r.unshift(s)}else(s=i(b))&&("field"===l?r.unshift(s):d[c]=s)}u&&Object.defineProperty(u,a.name,d),p=!0},H=function(t,e,n){for(var a=arguments.length>2,r=0;r<e.length;r++)n=a?e[r].call(t,n):e[r].call(t);return a?n:void 0};const Z="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z";(()=>{let t,e,n,a,r,o,i,s,l,c=[v({selector:"pg-button-menu",style:N.A,template:'<pg-button part="button"> <span part="label"></span> <pg-icon part="icon" path="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"></pg-icon> </pg-button>'})],u=[],d=HTMLElement,p=[],h=[],f=[],m=[],b=[],g=[],y=[],w=[],k=[],x=[],E=[],O=[],C=[],P=[];(class extends d{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[S()],a=[S()],r=[S()],o=[S()],i=[$()],s=[$()],l=[$()],D(null,null,n,{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},p,h),D(null,null,a,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:v},f,m),D(null,null,r,{kind:"field",name:"label",static:!1,private:!1,access:{has:t=>"label"in t,get:t=>t.label,set:(t,e)=>{t.label=e}},metadata:v},b,g),D(null,null,o,{kind:"field",name:"default",static:!1,private:!1,access:{has:t=>"default"in t,get:t=>t.default,set:(t,e)=>{t.default=e}},metadata:v},y,w),D(null,null,i,{kind:"field",name:"$button",static:!1,private:!1,access:{has:t=>"$button"in t,get:t=>t.$button,set:(t,e)=>{t.$button=e}},metadata:v},k,x),D(null,null,s,{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:v},E,O),D(null,null,l,{kind:"field",name:"$label",static:!1,private:!1,access:{has:t=>"$label"in t,get:t=>t.$label,set:(t,e)=>{t.$label=e}},metadata:v},C,P),D(null,t={value:e},c,{kind:"class",name:e.name,metadata:v},null,u),e=t.value,v&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v}),H(e,u)}items=H(this,p,[]);value=(H(this,h),H(this,f,null));label=(H(this,m),H(this,b,""));default=(H(this,g),H(this,y,null));$button=(H(this,w),H(this,k,void 0));$icon=(H(this,x),H(this,E,void 0));$label=(H(this,O),H(this,C,void 0));connectedCallback(){this.$button.addEventListener("click",this.#n.bind(this))}render(t){t.label&&(this.$label.textContent=this.label)}#a=(H(this,P),!1);async#n(){if(this.#a=!this.#a,this.$icon.path=this.#a?"M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z":Z,!this.#a)return;const t=await z.open({source:this,default:this.default??this.items[0],value:this.items.find((t=>t.value===this.value))??null,items:this.items});this.$icon.path=Z,void 0!==t&&this.dispatchEvent(new CustomEvent("change",{detail:{value:t.value}})),this.#a=!1}})})()})();
1
+ (()=>{"use strict";var t={119:(t,e,n)=>{n.d(e,{A:()=>l});var a=n(601),r=n.n(a),o=n(314),i=n.n(o)()(r());i.push([t.id,':host {\n display: contents;\n}\n\n[part="button"] {\n display: flex;\n align-items: center;\n align-content: center;\n font-family: var(--pg-font-family);\n font-size: var(--pg-button-font-size, 1rem);\n line-height: var(--pg-button-line-height, 1.5rem);\n border: 1px solid var(--pg-button-border-color, #453C4F);\n background-color: var(--pg-button-background-color, #FFFFFF);\n color: var(--pg-button-color, #453C4F);\n padding: var(--pg-button-padding, 0.25rem 0.5rem);\n border-radius: var(--pg-button-border-radius, 0.25rem);\n outline: none;\n --pg-icon-color: var(--pg-button-color, #453C4F);\n}\n\n[part="button"]:hover {\n border: 1px solid var(--pg-button-hover-border-color, #453C4F);\n background-color: var(--pg-button-hover-background-color, #453C4F);\n color: var(--pg-button-hover-color, #FFFFFF);\n --pg-icon-color: var(--pg-button-hover-color, #FFFFFF);\n}\n\n[part="button"]:active {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n position: relative;\n}\n\n[part="button"]:focus-visible {\n position: relative;\n}\n\n[part="button"]:active::before {\n content: \'\';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: var(--pg-button-border-radius, 0.25rem);\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.6));\n}\n[part="button"]:focus-visible::before {\n pointer-events: none;\n content: \'\';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: var(--pg-button-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"].start {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n margin-right: -1px;\n}\n\n[part="button"].center {\n border-radius: 0;\n margin-right: -1px;\n}\n\n[part="button"].end {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n[part="button"].active {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n background-color: rgba(69, 60, 79, 0.1);\n color: var(--pg-button-color, #453C4F);\n}\n[part="button"].active:hover {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n background-color: var(--pg-button-color, #453C4F);\n color: var(--pg-button-hover-color, #fff);\n}\n\n[part="button"].block {\n flex: 1;\n}\n\n::slotted {\n align-self: center;\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",a=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),a&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),a&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,a,r,o){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(a)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<t.length;c++){var u=[].concat(t[c]);a&&i[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),e.push(u))}},e}},601:t=>{t.exports=function(t){return t[1]}},685:(t,e,n)=>{n.d(e,{A:()=>l});var a=n(601),r=n.n(a),o=n(314),i=n.n(o)()(r());i.push([t.id,":host {\n display: inline-flex;\n}\n\nspan {\n align-self: center;\n display: flex;\n}\n\n[part=collapse] {\n display: none;\n}",""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},697:(t,e,n)=>{n.d(e,{A:()=>l});var a=n(601),r=n.n(a),o=n(314),i=n.n(o)()(r());i.push([t.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 s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s}},e={};function n(a){var r=e[a];if(void 0!==r)return r.exports;var o=e[a]={id:a,exports:{}};return t[a](o,o.exports,n),o.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 a in e)n.o(e,a)&&!n.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const a=Symbol("addObserver"),r=Symbol("removeObserver"),o=Symbol("getObservers"),i=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function u(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case i:return!0;case s:return e;case o:return c.has(t);case a:return(e,n)=>{c.has(t)?c.get(t).has(e)?c.get(t).get(e).push(n):c.get(t).set(e,[n]):c.set(t,new Map([[e,[n]]]))};case r:return e=>{c.has(t)&&(c.get(t).delete(e),0===c.get(t).size&&c.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,n)}throw new Error("Unsupported symbol")}if(n in e){if(!Number.isNaN(Number(n)))return"object"==typeof e[n]?u(e[n]):e[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return c.get(e).forEach(((t,a)=>{t.forEach((t=>{t(e,n,arguments)}))})),t}:Reflect.get(e,n);if(e[n]instanceof Array)return u(e[n])}return Reflect.get(e,n)},set(t,e,n){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,n);if(c.has(t)){c.get(t).forEach(((t,a)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=c;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const d=Symbol("init"),p=Symbol("template"),h=Symbol("style"),f=Symbol("parent");function m(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 v(t={}){return function(e,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var a,r;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[f]||e.prototype[f][e.prototype[f].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[f]=[e.prototype],e.prototype[h]=t.style?[t.style]:[],e.prototype[p]=t.template||""):(e.prototype[f].push(e.prototype),e.prototype[h].push(t.style),e.prototype[p]=(a=e.prototype[p],(r=t.template||null)&&r.match(/<parent\/>/)?r.replace(/<parent\/>/,a):`${a}${r||""}`));const o=e.prototype.connectedCallback||(()=>{}),i=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[d]||void 0!==t.template||void 0!==t.style)if(this[d]){if(this[d]&&t.style);else if(this[d]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[p]||"";const n=document.importNode(t.content,!0),a=this.attachShadow({mode:"open"});a.adoptedStyleSheets=e.prototype[h].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),a.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 a=Array.from(n.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),r=()=>{this[f].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[b(e)]=!0,t)),{}):{})}))};0===a.length?(this[d]=!0,o.call(this),r()):Promise.all(a).then((()=>{this[d]=!0,o.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));r()}))},e.prototype.disconnectedCallback=function(){i.call(this)},e.prototype.attributeChangedCallback=function(t,e,n){this[b(t)]=n},n.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${n.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function g(t){return!!t&&t.constructor===Array}function y(t,e){t[d]&&t[f].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function w(t){return null===t?"null":g(t)?"array":typeof t}function S(t){return function(e,n){const a=n.name,r=Symbol(a),l=Symbol(`${a}:type`),c=Symbol(`${a}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,a,{get:()=>"object"===this[l]||"array"===this[l]?this[r][i]?this[r]:u(this[r]):this[r],set:e=>{const n=w(t?t(e):e);if("index"!==a&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${a} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!g(e))throw new PropError(`Array "${a}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,a)?.set);if(this[r]===e)throw new Error("Setting an array to itself is not allowed.");const t=u(this[r]);if(t[o]){const n=e[i]?(c=e)[i]&&c[s]:e;t.splice(0,this[r].length,...n)}else this[r]=e}else this[r]=t?t(e):e,y(this,a);var c}})})),function(e){if(void 0===e&&"index"!==a)throw new Error(`@Prop() ${a} must have an initial value defined.`);if(void 0!==e&&"index"===a)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${a} boolean must initialize to false.`);if(!n.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,n=m(a);e[a]||(t.observedAttributes.push(n),e[a]=r)}return this[l]=w(e),"array"===this[l]?(this[r]=e,new Proxy(e,{get:(t,e)=>e===x?this[c]:(console.log("errr???"),Reflect.get(this[r],e)),set:(t,e,n)=>{if(e===x)return this[c]=n,!0;const o=Reflect.set(t,e,n);return"length"===e&&this[r].length===n||y(this,a),this[r]=n,o}})):(this[r]=t?t(this.getAttribute(a)??e):this.getAttribute(a)??e,this[r])}}}function $(){return function(t,e){const n=e.name,a=n.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,n,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${a}]`))}})}))}}function k(t){return""===t||!0===t||null!==t&&!1!==t&&(t||!0)}Symbol("hasProxy");const x=Symbol("meta");var E=function(t,e,n,a,r,o){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=a.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?a.static?t:t.prototype:null,d=e||(u?Object.getOwnPropertyDescriptor(u,a.name):{}),p=!1,h=n.length-1;h>=0;h--){var f={};for(var m in a)f[m]="access"===m?{}:a[m];for(var m in a.access)f.access[m]=a.access[m];f.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var b=(0,n[h])("accessor"===l?{get:d.get,set:d.set}:d[c],f);if("accessor"===l){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(s=i(b.get))&&(d.get=s),(s=i(b.set))&&(d.set=s),(s=i(b.init))&&r.unshift(s)}else(s=i(b))&&("field"===l?r.unshift(s):d[c]=s)}u&&Object.defineProperty(u,a.name,d),p=!0},O=function(t,e,n){for(var a=arguments.length>2,r=0;r<e.length;r++)n=a?e[r].call(t,n):e[r].call(t);return a?n:void 0};const C=new Set,P=new Map;const j=(()=>{let t,e,n=[v()],a=[],r=HTMLElement;(class extends r{static{e=this}static{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(r[Symbol.metadata]??null):void 0;E(null,t={value:e},n,{kind:"class",name:e.name,metadata:o},null,a),e=t.value,o&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),O(e,a)}static open(t={}){var e=document.createElement(this.name);return Object.assign(e,t),document.body.appendChild(e),C.add(e),new Promise((t=>{P.set(e,t)}))}close(t){this.remove(),C.delete(this);const e=P.get(this);e&&e(t),P.delete(this)}});return e})();var L=n(697),F=function(t,e,n,a,r,o){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=a.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?a.static?t:t.prototype:null,d=e||(u?Object.getOwnPropertyDescriptor(u,a.name):{}),p=!1,h=n.length-1;h>=0;h--){var f={};for(var m in a)f[m]="access"===m?{}:a[m];for(var m in a.access)f.access[m]=a.access[m];f.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var b=(0,n[h])("accessor"===l?{get:d.get,set:d.set}:d[c],f);if("accessor"===l){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(s=i(b.get))&&(d.get=s),(s=i(b.set))&&(d.set=s),(s=i(b.init))&&r.unshift(s)}else(s=i(b))&&("field"===l?r.unshift(s):d[c]=s)}u&&Object.defineProperty(u,a.name,d),p=!0},A=function(t,e,n){for(var a=arguments.length>2,r=0;r<e.length;r++)n=a?e[r].call(t,n):e[r].call(t);return a?n:void 0};let T=(()=>{let t,e,n,a,r,o,i,s,l=[v({selector:"pg-overlay-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:L.A})],c=[],u=j,d=[],p=[],h=[],f=[],m=[],b=[],g=[],y=[],w=[],k=[],x=[],E=[];(class extends u{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;n=[$()],a=[$()],r=[S()],o=[S()],i=[S()],s=[S()],F(null,null,n,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:t=>"$overlay"in t,get:t=>t.$overlay,set:(t,e)=>{t.$overlay=e}},metadata:v},d,p),F(null,null,a,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:t=>"$menu"in t,get:t=>t.$menu,set:(t,e)=>{t.$menu=e}},metadata:v},h,f),F(null,null,r,{kind:"field",name:"source",static:!1,private:!1,access:{has:t=>"source"in t,get:t=>t.source,set:(t,e)=>{t.source=e}},metadata:v},m,b),F(null,null,o,{kind:"field",name:"default",static:!1,private:!1,access:{has:t=>"default"in t,get:t=>t.default,set:(t,e)=>{t.default=e}},metadata:v},g,y),F(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},w,k),F(null,null,s,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:v},x,E),F(null,t={value:e},l,{kind:"class",name:e.name,metadata:v},null,c),e=t.value,v&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v}),A(e,c)}$overlay=A(this,d,void 0);$menu=(A(this,p),A(this,h,void 0));source=(A(this,f),A(this,m,null));default=(A(this,b),A(this,g,null));items=(A(this,y),A(this,w,[]));value=(A(this,k),A(this,x,null));render(t){}connectedCallback(){this.$menu.items=this.items,this.$menu.addEventListener("select",this.#t.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#e.bind(this));this.source?.getBoundingClientRect();const t=null===this.value||"object"!=typeof this.value?this.value:this.value.value,e=null===this.value?0:this.items.findIndex((e=>e.value===t));this.$menu.focus(e)}#e(t){"closed"===t.newState&&(this.close(),this.source?.focus())}disconnectedCallback(){}#t(t){t.detail.item.index=t.detail.index,this.close(t.detail.item),this.source?.focus()}constructor(){super(...arguments),A(this,E)}});return e})();const z=T;var R=n(119),M=function(t,e,n,a,r,o){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=a.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?a.static?t:t.prototype:null,d=e||(u?Object.getOwnPropertyDescriptor(u,a.name):{}),p=!1,h=n.length-1;h>=0;h--){var f={};for(var m in a)f[m]="access"===m?{}:a[m];for(var m in a.access)f.access[m]=a.access[m];f.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var b=(0,n[h])("accessor"===l?{get:d.get,set:d.set}:d[c],f);if("accessor"===l){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(s=i(b.get))&&(d.get=s),(s=i(b.set))&&(d.set=s),(s=i(b.init))&&r.unshift(s)}else(s=i(b))&&("field"===l?r.unshift(s):d[c]=s)}u&&Object.defineProperty(u,a.name,d),p=!0},I=function(t,e,n){for(var a=arguments.length>2,r=0;r<e.length;r++)n=a?e[r].call(t,n):e[r].call(t);return a?n:void 0};(()=>{let t,e,n,a,r,o,i,s,l,c,u=[v({selector:"pg-button",style:R.A,template:'<button part="button"> <slot></slot> </button>'})],d=[],p=HTMLElement,h=[],f=[],m=[],b=[],g=[],y=[],w=[],x=[],E=[],O=[],C=[],P=[],j=[],L=[],F=[],A=[];(class extends p{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(p[Symbol.metadata]??null):void 0;n=[S(k)],a=[S(k)],r=[S(k)],o=[S(k)],i=[S(k)],s=[$()],l=[$()],c=[$()],M(null,null,n,{kind:"field",name:"active",static:!1,private:!1,access:{has:t=>"active"in t,get:t=>t.active,set:(t,e)=>{t.active=e}},metadata:v},h,f),M(null,null,a,{kind:"field",name:"block",static:!1,private:!1,access:{has:t=>"block"in t,get:t=>t.block,set:(t,e)=>{t.block=e}},metadata:v},m,b),M(null,null,r,{kind:"field",name:"start",static:!1,private:!1,access:{has:t=>"start"in t,get:t=>t.start,set:(t,e)=>{t.start=e}},metadata:v},g,y),M(null,null,o,{kind:"field",name:"center",static:!1,private:!1,access:{has:t=>"center"in t,get:t=>t.center,set:(t,e)=>{t.center=e}},metadata:v},w,x),M(null,null,i,{kind:"field",name:"end",static:!1,private:!1,access:{has:t=>"end"in t,get:t=>t.end,set:(t,e)=>{t.end=e}},metadata:v},E,O),M(null,null,s,{kind:"field",name:"$button",static:!1,private:!1,access:{has:t=>"$button"in t,get:t=>t.$button,set:(t,e)=>{t.$button=e}},metadata:v},C,P),M(null,null,l,{kind:"field",name:"$number",static:!1,private:!1,access:{has:t=>"$number"in t,get:t=>t.$number,set:(t,e)=>{t.$number=e}},metadata:v},j,L),M(null,null,c,{kind:"field",name:"$bar",static:!1,private:!1,access:{has:t=>"$bar"in t,get:t=>t.$bar,set:(t,e)=>{t.$bar=e}},metadata:v},F,A),M(null,t={value:e},u,{kind:"class",name:e.name,metadata:v},null,d),e=t.value,v&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v}),I(e,d)}active=I(this,h,!1);block=(I(this,f),I(this,m,!1));start=(I(this,b),I(this,g,!1));center=(I(this,y),I(this,w,!1));end=(I(this,x),I(this,E,!1));$button=(I(this,O),I(this,C,void 0));$number=(I(this,P),I(this,j,void 0));$bar=(I(this,L),I(this,F,void 0));connectedCallback(){this.$button.addEventListener("click",(t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("click"))}))}render(t){t.active&&this.$button.classList.toggle("active",this.active),t.start&&this.$button.classList.toggle("start",this.start),t.end&&this.$button.classList.toggle("end",this.end),t.center&&this.$button.classList.toggle("center",this.center),t.block&&this.$button.classList.toggle("block",this.block)}getBoundingClientRect(){return this.$button.getBoundingClientRect()}constructor(){super(...arguments),I(this,A)}})})();var N=n(685),D=function(t,e,n,a,r,o){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=a.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?a.static?t:t.prototype:null,d=e||(u?Object.getOwnPropertyDescriptor(u,a.name):{}),p=!1,h=n.length-1;h>=0;h--){var f={};for(var m in a)f[m]="access"===m?{}:a[m];for(var m in a.access)f.access[m]=a.access[m];f.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var b=(0,n[h])("accessor"===l?{get:d.get,set:d.set}:d[c],f);if("accessor"===l){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(s=i(b.get))&&(d.get=s),(s=i(b.set))&&(d.set=s),(s=i(b.init))&&r.unshift(s)}else(s=i(b))&&("field"===l?r.unshift(s):d[c]=s)}u&&Object.defineProperty(u,a.name,d),p=!0},H=function(t,e,n){for(var a=arguments.length>2,r=0;r<e.length;r++)n=a?e[r].call(t,n):e[r].call(t);return a?n:void 0};const Z="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z";(()=>{let t,e,n,a,r,o,i,s,l,c=[v({selector:"pg-button-menu",style:N.A,template:'<pg-button part="button"> <span part="label"></span> <pg-icon part="icon" path="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"></pg-icon> </pg-button>'})],u=[],d=HTMLElement,p=[],h=[],f=[],m=[],b=[],g=[],y=[],w=[],k=[],x=[],E=[],O=[],C=[],P=[];(class extends d{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[S()],a=[S()],r=[S()],o=[S()],i=[$()],s=[$()],l=[$()],D(null,null,n,{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},p,h),D(null,null,a,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:v},f,m),D(null,null,r,{kind:"field",name:"label",static:!1,private:!1,access:{has:t=>"label"in t,get:t=>t.label,set:(t,e)=>{t.label=e}},metadata:v},b,g),D(null,null,o,{kind:"field",name:"default",static:!1,private:!1,access:{has:t=>"default"in t,get:t=>t.default,set:(t,e)=>{t.default=e}},metadata:v},y,w),D(null,null,i,{kind:"field",name:"$button",static:!1,private:!1,access:{has:t=>"$button"in t,get:t=>t.$button,set:(t,e)=>{t.$button=e}},metadata:v},k,x),D(null,null,s,{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:v},E,O),D(null,null,l,{kind:"field",name:"$label",static:!1,private:!1,access:{has:t=>"$label"in t,get:t=>t.$label,set:(t,e)=>{t.$label=e}},metadata:v},C,P),D(null,t={value:e},c,{kind:"class",name:e.name,metadata:v},null,u),e=t.value,v&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v}),H(e,u)}items=H(this,p,[]);value=(H(this,h),H(this,f,null));label=(H(this,m),H(this,b,""));default=(H(this,g),H(this,y,null));$button=(H(this,w),H(this,k,void 0));$icon=(H(this,x),H(this,E,void 0));$label=(H(this,O),H(this,C,void 0));connectedCallback(){this.$button.addEventListener("click",this.#n.bind(this))}render(t){t.label&&(this.$label.textContent=this.label)}#a=(H(this,P),!1);async#n(){if(this.#a=!this.#a,this.$icon.path=this.#a?"M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z":Z,!this.#a)return;const t=await z.open({source:this,default:this.default??this.items[0],value:this.items.find((t=>t.value===this.value))??null,items:this.items});this.$icon.path=Z,void 0!==t&&this.dispatchEvent(new CustomEvent("change",{detail:{value:t.value}})),this.#a=!1}})})()})();
package/pgButtonToggle.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var t={111:(t,e,n)=>{n.d(e,{A:()=>l});var o=n(601),r=n.n(o),a=n(314),i=n.n(a)()(r());i.push([t.id,":host {\n display: inline-flex;\n}\n\n::slotted(*) {\n align-self: center;\n display: flex;\n}",""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},119:(t,e,n)=>{n.d(e,{A:()=>l});var o=n(601),r=n.n(o),a=n(314),i=n.n(a)()(r());i.push([t.id,':host {\n display: contents;\n}\n\n[part="button"] {\n display: flex;\n align-items: center;\n align-content: center;\n font-family: var(--pg-font-family);\n font-size: var(--pg-button-font-size, 1rem);\n line-height: var(--pg-button-line-height, 1.5rem);\n border: 1px solid var(--pg-button-border-color, #453C4F);\n background-color: var(--pg-button-background-color, #FFFFFF);\n color: var(--pg-button-color, #453C4F);\n padding: var(--pg-button-padding, 0.25rem 0.5rem);\n border-radius: var(--pg-button-border-radius, 0.25rem);\n outline: none;\n --pg-icon-color: var(--pg-button-color, #453C4F);\n}\n\n[part="button"]:hover {\n border: 1px solid var(--pg-button-hover-border-color, #453C4F);\n background-color: var(--pg-button-hover-background-color, #453C4F);\n color: var(--pg-button-hover-color, #FFFFFF);\n --pg-icon-color: var(--pg-button-hover-color, #FFFFFF);\n}\n\n[part="button"]:active {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n position: relative;\n}\n\n[part="button"]:focus {\n position: relative;\n}\n\n[part="button"]:active::before {\n content: \'\';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: var(--pg-button-border-radius, 0.25rem);\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.6));\n}\n[part="button"]:focus::before {\n pointer-events: none;\n content: \'\';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: var(--pg-button-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"].start {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n margin-right: -1px;\n}\n\n[part="button"].center {\n border-radius: 0;\n margin-right: -1px;\n}\n\n[part="button"].end {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n[part="button"].active {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n background-color: rgba(69, 60, 79, 0.1);\n color: var(--pg-button-color, #453C4F);\n}\n[part="button"].active:hover {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n background-color: var(--pg-button-color, #453C4F);\n color: var(--pg-button-hover-color, #fff);\n}\n\n[part="button"].block {\n flex: 1;\n}\n\n::slotted {\n align-self: center;\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",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,a){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(o)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<t.length;c++){var u=[].concat(t[c]);o&&i[u[0]]||(void 0!==a&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=a),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),e.push(u))}},e}},601:t=>{t.exports=function(t){return t[1]}}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var a=e[o]={id:o,exports:{}};return t[o](a,a.exports,n),a.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var 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"),a=Symbol("getObservers"),i=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function u(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case i:return!0;case s:return e;case a:return c.has(t);case o:return(e,n)=>{c.has(t)?c.get(t).has(e)?c.get(t).get(e).push(n):c.get(t).set(e,[n]):c.set(t,new Map([[e,[n]]]))};case r:return e=>{c.has(t)&&(c.get(t).delete(e),0===c.get(t).size&&c.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,n)}throw new Error("Unsupported symbol")}if(n in e){if(!Number.isNaN(Number(n)))return"object"==typeof e[n]?u(e[n]):e[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return c.get(e).forEach(((t,o)=>{t.forEach((t=>{t(e,n,arguments)}))})),t}:Reflect.get(e,n);if(e[n]instanceof Array)return u(e[n])}return Reflect.get(e,n)},set(t,e,n){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,n);if(c.has(t)){c.get(t).forEach(((t,o)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=c;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const p=Symbol("init"),d=Symbol("template"),h=Symbol("style"),b=Symbol("parent");function f(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function m(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function v(t={}){return function(e,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[b]||e.prototype[b][e.prototype[b].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[b]=[e.prototype],e.prototype[h]=t.style?[t.style]:[],e.prototype[d]=t.template||""):(e.prototype[b].push(e.prototype),e.prototype[h].push(t.style),e.prototype[d]=(o=e.prototype[d],(r=t.template||null)&&r.match(/<parent\/>/)?r.replace(/<parent\/>/,o):`${o}${r||""}`));const a=e.prototype.connectedCallback||(()=>{}),i=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[p]||void 0!==t.template||void 0!==t.style)if(this[p]){if(this[p]&&t.style);else if(this[p]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[d]||"";const n=document.importNode(t.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=e.prototype[h].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[b].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[m(e)]=!0,t)),{}):{})}))};0===o.length?(this[p]=!0,a.call(this),r()):Promise.all(o).then((()=>{this[p]=!0,a.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));r()}))},e.prototype.disconnectedCallback=function(){i.call(this)},e.prototype.attributeChangedCallback=function(t,e,n){this[m(t)]=n},n.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${n.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function g(t){return!!t&&t.constructor===Array}function y(t,e){t[p]&&t[b].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function w(t){return null===t?"null":g(t)?"array":typeof t}function S(t){return function(e,n){const o=n.name,r=Symbol(o),l=Symbol(`${o}:type`),c=Symbol(`${o}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,o,{get:()=>"object"===this[l]||"array"===this[l]?this[r][i]?this[r]:u(this[r]):this[r],set:e=>{const n=w(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(!g(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=u(this[r]);if(t[a]){const n=e[i]?(c=e)[i]&&c[s]:e;t.splice(0,this[r].length,...n)}else this[r]=e}else this[r]=t?t(e):e,y(this,o);var c}})})),function(e){if(void 0===e&&"index"!==o)throw new Error(`@Prop() ${o} must have an initial value defined.`);if(void 0!==e&&"index"===o)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${o} boolean must initialize to false.`);if(!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]=r)}return this[l]=w(e),"array"===this[l]?(this[r]=e,new Proxy(e,{get:(t,e)=>e===k?this[c]:(console.log("errr???"),Reflect.get(this[r],e)),set:(t,e,n)=>{if(e===k)return this[c]=n,!0;const a=Reflect.set(t,e,n);return"length"===e&&this[r].length===n||y(this,o),this[r]=n,a}})):(this[r]=t?t(this.getAttribute(o)??e):this.getAttribute(o)??e,this[r])}}}function $(){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}]`))}})}))}}function x(t){return""===t||!0===t||null!==t&&!1!==t&&(t||!0)}Symbol("hasProxy");const k=Symbol("meta");var E=n(119),C=function(t,e,n,o,r,a){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=o.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?o.static?t:t.prototype:null,p=e||(u?Object.getOwnPropertyDescriptor(u,o.name):{}),d=!1,h=n.length-1;h>=0;h--){var b={};for(var f in o)b[f]="access"===f?{}:o[f];for(var f in o.access)b.access[f]=o.access[f];b.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(t||null))};var m=(0,n[h])("accessor"===l?{get:p.get,set:p.set}:p[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=i(m.get))&&(p.get=s),(s=i(m.set))&&(p.set=s),(s=i(m.init))&&r.unshift(s)}else(s=i(m))&&("field"===l?r.unshift(s):p[c]=s)}u&&Object.defineProperty(u,o.name,p),d=!0},P=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};(()=>{let t,e,n,o,r,a,i,s,l,c,u=[v({selector:"pg-button",style:E.A,template:'<button part="button"> <slot></slot> </button>'})],p=[],d=HTMLElement,h=[],b=[],f=[],m=[],g=[],y=[],w=[],k=[],F=[],O=[],A=[],j=[],R=[],z=[],T=[],L=[];(class extends d{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[S(x)],o=[S(x)],r=[S(x)],a=[S(x)],i=[S(x)],s=[$()],l=[$()],c=[$()],C(null,null,n,{kind:"field",name:"active",static:!1,private:!1,access:{has:t=>"active"in t,get:t=>t.active,set:(t,e)=>{t.active=e}},metadata:v},h,b),C(null,null,o,{kind:"field",name:"block",static:!1,private:!1,access:{has:t=>"block"in t,get:t=>t.block,set:(t,e)=>{t.block=e}},metadata:v},f,m),C(null,null,r,{kind:"field",name:"start",static:!1,private:!1,access:{has:t=>"start"in t,get:t=>t.start,set:(t,e)=>{t.start=e}},metadata:v},g,y),C(null,null,a,{kind:"field",name:"center",static:!1,private:!1,access:{has:t=>"center"in t,get:t=>t.center,set:(t,e)=>{t.center=e}},metadata:v},w,k),C(null,null,i,{kind:"field",name:"end",static:!1,private:!1,access:{has:t=>"end"in t,get:t=>t.end,set:(t,e)=>{t.end=e}},metadata:v},F,O),C(null,null,s,{kind:"field",name:"$button",static:!1,private:!1,access:{has:t=>"$button"in t,get:t=>t.$button,set:(t,e)=>{t.$button=e}},metadata:v},A,j),C(null,null,l,{kind:"field",name:"$number",static:!1,private:!1,access:{has:t=>"$number"in t,get:t=>t.$number,set:(t,e)=>{t.$number=e}},metadata:v},R,z),C(null,null,c,{kind:"field",name:"$bar",static:!1,private:!1,access:{has:t=>"$bar"in t,get:t=>t.$bar,set:(t,e)=>{t.$bar=e}},metadata:v},T,L),C(null,t={value:e},u,{kind:"class",name:e.name,metadata:v},null,p),e=t.value,v&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v}),P(e,p)}active=P(this,h,!1);block=(P(this,b),P(this,f,!1));start=(P(this,m),P(this,g,!1));center=(P(this,y),P(this,w,!1));end=(P(this,k),P(this,F,!1));$button=(P(this,O),P(this,A,void 0));$number=(P(this,j),P(this,R,void 0));$bar=(P(this,z),P(this,T,void 0));connectedCallback(){this.$button.addEventListener("click",(t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("click"))}))}render(t){t.active&&this.$button.classList.toggle("active",this.active),t.start&&this.$button.classList.toggle("start",this.start),t.end&&this.$button.classList.toggle("end",this.end),t.center&&this.$button.classList.toggle("center",this.center),t.block&&this.$button.classList.toggle("block",this.block)}getBoundingClientRect(){return this.$button.getBoundingClientRect()}constructor(){super(...arguments),P(this,L)}})})();var F=n(111),O=function(t,e,n,o,r,a){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=o.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?o.static?t:t.prototype:null,p=e||(u?Object.getOwnPropertyDescriptor(u,o.name):{}),d=!1,h=n.length-1;h>=0;h--){var b={};for(var f in o)b[f]="access"===f?{}:o[f];for(var f in o.access)b.access[f]=o.access[f];b.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(t||null))};var m=(0,n[h])("accessor"===l?{get:p.get,set:p.set}:p[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=i(m.get))&&(p.get=s),(s=i(m.set))&&(p.set=s),(s=i(m.init))&&r.unshift(s)}else(s=i(m))&&("field"===l?r.unshift(s):p[c]=s)}u&&Object.defineProperty(u,o.name,p),d=!0},A=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=[!0,"true",""];(()=>{let t,e,n,o,r,a,i=[v({selector:"pg-button-toggle",style:F.A,template:'<pg-button part="button"> <slot part="expand" name="active"></slot> <slot part="collapse" name="inactive"></slot> </pg-button>'})],s=[],l=HTMLElement,c=[],u=[],p=[],d=[],h=[],b=[],f=[],m=[];(class extends l{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;n=[S()],o=[$()],r=[$()],a=[$()],O(null,null,n,{kind:"field",name:"active",static:!1,private:!1,access:{has:t=>"active"in t,get:t=>t.active,set:(t,e)=>{t.active=e}},metadata:v},c,u),O(null,null,o,{kind:"field",name:"$button",static:!1,private:!1,access:{has:t=>"$button"in t,get:t=>t.$button,set:(t,e)=>{t.$button=e}},metadata:v},p,d),O(null,null,r,{kind:"field",name:"$expand",static:!1,private:!1,access:{has:t=>"$expand"in t,get:t=>t.$expand,set:(t,e)=>{t.$expand=e}},metadata:v},h,b),O(null,null,a,{kind:"field",name:"$collapse",static:!1,private:!1,access:{has:t=>"$collapse"in t,get:t=>t.$collapse,set:(t,e)=>{t.$collapse=e}},metadata:v},f,m),O(null,t={value:e},i,{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}),A(e,s)}active=A(this,c,!1);$button=(A(this,u),A(this,p,void 0));$expand=(A(this,d),A(this,h,void 0));$collapse=(A(this,b),A(this,f,void 0));connectedCallback(){this.$button.addEventListener("click",(t=>{t.stopPropagation(),this.active=!j.includes(this.active),this.dispatchEvent(new CustomEvent("click",{detail:{active:this.active}}))}))}render(t){t.active&&(this.$button.active=j.includes(this.active),this.$expand.style.display=this.$button.active?"initial":"none",this.$collapse.style.display=this.$button.active?"none":"initial")}constructor(){super(...arguments),A(this,m)}})})()})();
1
+ (()=>{"use strict";var t={111:(t,e,n)=>{n.d(e,{A:()=>l});var o=n(601),r=n.n(o),a=n(314),i=n.n(a)()(r());i.push([t.id,":host {\n display: inline-flex;\n}\n\n::slotted(*) {\n align-self: center;\n display: flex;\n}",""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},119:(t,e,n)=>{n.d(e,{A:()=>l});var o=n(601),r=n.n(o),a=n(314),i=n.n(a)()(r());i.push([t.id,':host {\n display: contents;\n}\n\n[part="button"] {\n display: flex;\n align-items: center;\n align-content: center;\n font-family: var(--pg-font-family);\n font-size: var(--pg-button-font-size, 1rem);\n line-height: var(--pg-button-line-height, 1.5rem);\n border: 1px solid var(--pg-button-border-color, #453C4F);\n background-color: var(--pg-button-background-color, #FFFFFF);\n color: var(--pg-button-color, #453C4F);\n padding: var(--pg-button-padding, 0.25rem 0.5rem);\n border-radius: var(--pg-button-border-radius, 0.25rem);\n outline: none;\n --pg-icon-color: var(--pg-button-color, #453C4F);\n}\n\n[part="button"]:hover {\n border: 1px solid var(--pg-button-hover-border-color, #453C4F);\n background-color: var(--pg-button-hover-background-color, #453C4F);\n color: var(--pg-button-hover-color, #FFFFFF);\n --pg-icon-color: var(--pg-button-hover-color, #FFFFFF);\n}\n\n[part="button"]:active {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n position: relative;\n}\n\n[part="button"]:focus-visible {\n position: relative;\n}\n\n[part="button"]:active::before {\n content: \'\';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: var(--pg-button-border-radius, 0.25rem);\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.6));\n}\n[part="button"]:focus-visible::before {\n pointer-events: none;\n content: \'\';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: var(--pg-button-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"].start {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n margin-right: -1px;\n}\n\n[part="button"].center {\n border-radius: 0;\n margin-right: -1px;\n}\n\n[part="button"].end {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n[part="button"].active {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n background-color: rgba(69, 60, 79, 0.1);\n color: var(--pg-button-color, #453C4F);\n}\n[part="button"].active:hover {\n box-shadow: 0 1px 0.25rem rgba(0, 0, 0, 0.5) inset;\n background-color: var(--pg-button-color, #453C4F);\n color: var(--pg-button-hover-color, #fff);\n}\n\n[part="button"].block {\n flex: 1;\n}\n\n::slotted {\n align-self: center;\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",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,a){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(o)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<t.length;c++){var u=[].concat(t[c]);o&&i[u[0]]||(void 0!==a&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=a),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),r&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=r):u[4]="".concat(r)),e.push(u))}},e}},601:t=>{t.exports=function(t){return t[1]}}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var a=e[o]={id:o,exports:{}};return t[o](a,a.exports,n),a.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var 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"),a=Symbol("getObservers"),i=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function u(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case i:return!0;case s:return e;case a:return c.has(t);case o:return(e,n)=>{c.has(t)?c.get(t).has(e)?c.get(t).get(e).push(n):c.get(t).set(e,[n]):c.set(t,new Map([[e,[n]]]))};case r:return e=>{c.has(t)&&(c.get(t).delete(e),0===c.get(t).size&&c.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,n)}throw new Error("Unsupported symbol")}if(n in e){if(!Number.isNaN(Number(n)))return"object"==typeof e[n]?u(e[n]):e[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return c.get(e).forEach(((t,o)=>{t.forEach((t=>{t(e,n,arguments)}))})),t}:Reflect.get(e,n);if(e[n]instanceof Array)return u(e[n])}return Reflect.get(e,n)},set(t,e,n){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,n);if(c.has(t)){c.get(t).forEach(((t,o)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=c;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const p=Symbol("init"),d=Symbol("template"),h=Symbol("style"),b=Symbol("parent");function f(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function m(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function v(t={}){return function(e,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[b]||e.prototype[b][e.prototype[b].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[b]=[e.prototype],e.prototype[h]=t.style?[t.style]:[],e.prototype[d]=t.template||""):(e.prototype[b].push(e.prototype),e.prototype[h].push(t.style),e.prototype[d]=(o=e.prototype[d],(r=t.template||null)&&r.match(/<parent\/>/)?r.replace(/<parent\/>/,o):`${o}${r||""}`));const a=e.prototype.connectedCallback||(()=>{}),i=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[p]||void 0!==t.template||void 0!==t.style)if(this[p]){if(this[p]&&t.style);else if(this[p]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[d]||"";const n=document.importNode(t.content,!0),o=this.attachShadow({mode:"open"});o.adoptedStyleSheets=e.prototype[h].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[b].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[m(e)]=!0,t)),{}):{})}))};0===o.length?(this[p]=!0,a.call(this),r()):Promise.all(o).then((()=>{this[p]=!0,a.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));r()}))},e.prototype.disconnectedCallback=function(){i.call(this)},e.prototype.attributeChangedCallback=function(t,e,n){this[m(t)]=n},n.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${n.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function g(t){return!!t&&t.constructor===Array}function y(t,e){t[p]&&t[b].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function w(t){return null===t?"null":g(t)?"array":typeof t}function S(t){return function(e,n){const o=n.name,r=Symbol(o),l=Symbol(`${o}:type`),c=Symbol(`${o}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,o,{get:()=>"object"===this[l]||"array"===this[l]?this[r][i]?this[r]:u(this[r]):this[r],set:e=>{const n=w(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(!g(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=u(this[r]);if(t[a]){const n=e[i]?(c=e)[i]&&c[s]:e;t.splice(0,this[r].length,...n)}else this[r]=e}else this[r]=t?t(e):e,y(this,o);var c}})})),function(e){if(void 0===e&&"index"!==o)throw new Error(`@Prop() ${o} must have an initial value defined.`);if(void 0!==e&&"index"===o)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${o} boolean must initialize to false.`);if(!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]=r)}return this[l]=w(e),"array"===this[l]?(this[r]=e,new Proxy(e,{get:(t,e)=>e===k?this[c]:(console.log("errr???"),Reflect.get(this[r],e)),set:(t,e,n)=>{if(e===k)return this[c]=n,!0;const a=Reflect.set(t,e,n);return"length"===e&&this[r].length===n||y(this,o),this[r]=n,a}})):(this[r]=t?t(this.getAttribute(o)??e):this.getAttribute(o)??e,this[r])}}}function $(){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}]`))}})}))}}function x(t){return""===t||!0===t||null!==t&&!1!==t&&(t||!0)}Symbol("hasProxy");const k=Symbol("meta");var E=n(119),C=function(t,e,n,o,r,a){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=o.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?o.static?t:t.prototype:null,p=e||(u?Object.getOwnPropertyDescriptor(u,o.name):{}),d=!1,h=n.length-1;h>=0;h--){var b={};for(var f in o)b[f]="access"===f?{}:o[f];for(var f in o.access)b.access[f]=o.access[f];b.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(t||null))};var m=(0,n[h])("accessor"===l?{get:p.get,set:p.set}:p[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=i(m.get))&&(p.get=s),(s=i(m.set))&&(p.set=s),(s=i(m.init))&&r.unshift(s)}else(s=i(m))&&("field"===l?r.unshift(s):p[c]=s)}u&&Object.defineProperty(u,o.name,p),d=!0},P=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};(()=>{let t,e,n,o,r,a,i,s,l,c,u=[v({selector:"pg-button",style:E.A,template:'<button part="button"> <slot></slot> </button>'})],p=[],d=HTMLElement,h=[],b=[],f=[],m=[],g=[],y=[],w=[],k=[],F=[],O=[],A=[],j=[],R=[],z=[],T=[],L=[];(class extends d{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[S(x)],o=[S(x)],r=[S(x)],a=[S(x)],i=[S(x)],s=[$()],l=[$()],c=[$()],C(null,null,n,{kind:"field",name:"active",static:!1,private:!1,access:{has:t=>"active"in t,get:t=>t.active,set:(t,e)=>{t.active=e}},metadata:v},h,b),C(null,null,o,{kind:"field",name:"block",static:!1,private:!1,access:{has:t=>"block"in t,get:t=>t.block,set:(t,e)=>{t.block=e}},metadata:v},f,m),C(null,null,r,{kind:"field",name:"start",static:!1,private:!1,access:{has:t=>"start"in t,get:t=>t.start,set:(t,e)=>{t.start=e}},metadata:v},g,y),C(null,null,a,{kind:"field",name:"center",static:!1,private:!1,access:{has:t=>"center"in t,get:t=>t.center,set:(t,e)=>{t.center=e}},metadata:v},w,k),C(null,null,i,{kind:"field",name:"end",static:!1,private:!1,access:{has:t=>"end"in t,get:t=>t.end,set:(t,e)=>{t.end=e}},metadata:v},F,O),C(null,null,s,{kind:"field",name:"$button",static:!1,private:!1,access:{has:t=>"$button"in t,get:t=>t.$button,set:(t,e)=>{t.$button=e}},metadata:v},A,j),C(null,null,l,{kind:"field",name:"$number",static:!1,private:!1,access:{has:t=>"$number"in t,get:t=>t.$number,set:(t,e)=>{t.$number=e}},metadata:v},R,z),C(null,null,c,{kind:"field",name:"$bar",static:!1,private:!1,access:{has:t=>"$bar"in t,get:t=>t.$bar,set:(t,e)=>{t.$bar=e}},metadata:v},T,L),C(null,t={value:e},u,{kind:"class",name:e.name,metadata:v},null,p),e=t.value,v&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v}),P(e,p)}active=P(this,h,!1);block=(P(this,b),P(this,f,!1));start=(P(this,m),P(this,g,!1));center=(P(this,y),P(this,w,!1));end=(P(this,k),P(this,F,!1));$button=(P(this,O),P(this,A,void 0));$number=(P(this,j),P(this,R,void 0));$bar=(P(this,z),P(this,T,void 0));connectedCallback(){this.$button.addEventListener("click",(t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("click"))}))}render(t){t.active&&this.$button.classList.toggle("active",this.active),t.start&&this.$button.classList.toggle("start",this.start),t.end&&this.$button.classList.toggle("end",this.end),t.center&&this.$button.classList.toggle("center",this.center),t.block&&this.$button.classList.toggle("block",this.block)}getBoundingClientRect(){return this.$button.getBoundingClientRect()}constructor(){super(...arguments),P(this,L)}})})();var F=n(111),O=function(t,e,n,o,r,a){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=o.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!e&&t?o.static?t:t.prototype:null,p=e||(u?Object.getOwnPropertyDescriptor(u,o.name):{}),d=!1,h=n.length-1;h>=0;h--){var b={};for(var f in o)b[f]="access"===f?{}:o[f];for(var f in o.access)b.access[f]=o.access[f];b.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(t||null))};var m=(0,n[h])("accessor"===l?{get:p.get,set:p.set}:p[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=i(m.get))&&(p.get=s),(s=i(m.set))&&(p.set=s),(s=i(m.init))&&r.unshift(s)}else(s=i(m))&&("field"===l?r.unshift(s):p[c]=s)}u&&Object.defineProperty(u,o.name,p),d=!0},A=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=[!0,"true",""];(()=>{let t,e,n,o,r,a,i=[v({selector:"pg-button-toggle",style:F.A,template:'<pg-button part="button"> <slot part="expand" name="active"></slot> <slot part="collapse" name="inactive"></slot> </pg-button>'})],s=[],l=HTMLElement,c=[],u=[],p=[],d=[],h=[],b=[],f=[],m=[];(class extends l{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;n=[S()],o=[$()],r=[$()],a=[$()],O(null,null,n,{kind:"field",name:"active",static:!1,private:!1,access:{has:t=>"active"in t,get:t=>t.active,set:(t,e)=>{t.active=e}},metadata:v},c,u),O(null,null,o,{kind:"field",name:"$button",static:!1,private:!1,access:{has:t=>"$button"in t,get:t=>t.$button,set:(t,e)=>{t.$button=e}},metadata:v},p,d),O(null,null,r,{kind:"field",name:"$expand",static:!1,private:!1,access:{has:t=>"$expand"in t,get:t=>t.$expand,set:(t,e)=>{t.$expand=e}},metadata:v},h,b),O(null,null,a,{kind:"field",name:"$collapse",static:!1,private:!1,access:{has:t=>"$collapse"in t,get:t=>t.$collapse,set:(t,e)=>{t.$collapse=e}},metadata:v},f,m),O(null,t={value:e},i,{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}),A(e,s)}active=A(this,c,!1);$button=(A(this,u),A(this,p,void 0));$expand=(A(this,d),A(this,h,void 0));$collapse=(A(this,b),A(this,f,void 0));connectedCallback(){this.$button.addEventListener("click",(t=>{t.stopPropagation(),this.active=!j.includes(this.active),this.dispatchEvent(new CustomEvent("click",{detail:{active:this.active}}))}))}render(t){t.active&&(this.$button.active=j.includes(this.active),this.$expand.style.display=this.$button.active?"initial":"none",this.$collapse.style.display=this.$button.active?"none":"initial")}constructor(){super(...arguments),A(this,m)}})})()})();
@@ -1 +1 @@
1
- (()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i="",s=void 0!==e[5];return e[4]&&(i+="@supports (".concat(e[4],") {")),e[2]&&(i+="@media ".concat(e[2]," {")),s&&(i+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),i+=t(e),s&&(i+="}"),e[2]&&(i+="}"),e[4]&&(i+="}"),i})).join("")},e.i=function(t,i,s,n,r){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(s)for(var o=0;o<this.length;o++){var h=this[o][0];null!=h&&(a[h]=!0)}for(var l=0;l<t.length;l++){var c=[].concat(t[l]);s&&a[c[0]]||(void 0!==r&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=r),i&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=i):c[2]=i),n&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=n):c[4]="".concat(n)),e.push(c))}},e}},601:t=>{t.exports=function(t){return t[1]}},713:(t,e,i)=>{i.d(e,{A:()=>h});var s=i(601),n=i.n(s),r=i(314),a=i.n(r)()(n());a.push([t.id,':host {\n display: inline-flex;\n}\n\n[part="wrapper"] {\n display: flex;\n position: relative;\n outline: 0;\n}\n\n[part="wrapper"]:focus-visible::before {\n pointer-events: none;\n content: \'\';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: 0.125rem;\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.5));\n}\n\ncanvas {\n touch-action: none;\n user-select: none;\n outline: 0;\n}',""]);var o=new CSSStyleSheet;o.replaceSync(a.toString());const h=o}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={id:s,exports:{}};return t[s](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const s=Symbol("addObserver"),n=Symbol("removeObserver"),r=Symbol("getObservers"),a=Symbol("isProxy"),o=Symbol("getTarget"),h=["fill","pop","push","reverse","shift","sort","splice","unshift"],l=new Map;function c(t){return new Proxy(t,{get(e,i){if("symbol"==typeof i){switch(i){case a:return!0;case o:return e;case r:return l.has(t);case s:return(e,i)=>{l.has(t)?l.get(t).has(e)?l.get(t).get(e).push(i):l.get(t).set(e,[i]):l.set(t,new Map([[e,[i]]]))};case n:return e=>{l.has(t)&&(l.get(t).delete(e),0===l.get(t).size&&l.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,i)}throw new Error("Unsupported symbol")}if(i in e){if(!Number.isNaN(Number(i)))return"object"==typeof e[i]?c(e[i]):e[i];if("copyWithin"===i)throw new Error("Unsupported array method copyWithin");if(h.includes(i))return l.has(e)?function(){const t=Array.prototype[i].apply(e,arguments);return l.get(e).forEach(((t,s)=>{t.forEach((t=>{t(e,i,arguments)}))})),t}:Reflect.get(e,i);if(e[i]instanceof Array)return c(e[i])}return Reflect.get(e,i)},set(t,e,i){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,i);if(l.has(t)){l.get(t).forEach(((t,s)=>{t.forEach((t=>{t(e,i)}))}))}return Reflect.set(t,e,i)}})}window.observers=l;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const d=Symbol("init"),p=Symbol("template"),y=Symbol("style"),u=Symbol("parent");function f(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 m(t={}){return function(e,i){if("class"!==i.kind)throw new Error("@Component() can only decorate a class");var s,n;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[u]||e.prototype[u][e.prototype[u].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[u]=[e.prototype],e.prototype[y]=t.style?[t.style]:[],e.prototype[p]=t.template||""):(e.prototype[u].push(e.prototype),e.prototype[y].push(t.style),e.prototype[p]=(s=e.prototype[p],(n=t.template||null)&&n.match(/<parent\/>/)?n.replace(/<parent\/>/,s):`${s}${n||""}`));const r=e.prototype.connectedCallback||(()=>{}),a=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[d]||void 0!==t.template||void 0!==t.style)if(this[d]){if(this[d]&&t.style);else if(this[d]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[p]||"";const i=document.importNode(t.content,!0),s=this.attachShadow({mode:"open"});s.adoptedStyleSheets=e.prototype[y].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),s.appendChild(i)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const i=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&i.add(t.localName);const s=Array.from(i.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),n=()=>{this[u].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[g(e)]=!0,t)),{}):{})}))};0===s.length?(this[d]=!0,r.call(this),n()):Promise.all(s).then((()=>{this[d]=!0,r.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,i){this[g(t)]=i},i.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${i.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function x(t){return!!t&&t.constructor===Array}function v(t,e){t[d]&&t[u].map((i=>{i.render&&i.render.call(t,{[e]:!0})}))}function w(t){return null===t?"null":x(t)?"array":typeof t}function b(t){return function(e,i){const s=i.name,n=Symbol(s),h=Symbol(`${s}:type`),l=Symbol(`${s}:meta`);return i.addInitializer((function(){Reflect.defineProperty(this,s,{get:()=>"object"===this[h]||"array"===this[h]?this[n][a]?this[n]:c(this[n]):this[n],set:e=>{const i=w(t?t(e):e);if("index"!==s&&this[h]!==i&&"null"!==this[h]&&"null"!==i)throw new Error(`@Prop() ${s} with type '${this[h]}' cannot be set to ${i}.`);if("array"===this[h]){if(!x(e))throw new PropError(`Array "${s}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,s)?.set);if(this[n]===e)throw new Error("Setting an array to itself is not allowed.");const t=c(this[n]);if(t[r]){const i=e[a]?(l=e)[a]&&l[o]:e;t.splice(0,this[n].length,...i)}else this[n]=e}else this[n]=t?t(e):e,v(this,s);var l}})})),function(e){if(void 0===e&&"index"!==s)throw new Error(`@Prop() ${s} must have an initial value defined.`);if(void 0!==e&&"index"===s)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${s} boolean must initialize to false.`);if(!i.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,i=f(s);e[s]||(t.observedAttributes.push(i),e[s]=n)}return this[h]=w(e),"array"===this[h]?(this[n]=e,new Proxy(e,{get:(t,e)=>e===E?this[l]:(console.log("errr???"),Reflect.get(this[n],e)),set:(t,e,i)=>{if(e===E)return this[l]=i,!0;const r=Reflect.set(t,e,i);return"length"===e&&this[n].length===i||v(this,s),this[n]=i,r}})):(this[n]=t?t(this.getAttribute(s)??e):this.getAttribute(s)??e,this[n])}}}function L(t){return parseInt(`${t}`,10)}function C(t){return""===t||!0===t||null!==t&&!1!==t&&(t||!0)}Symbol("hasProxy");const E=Symbol("meta");var S=i(713);function P(t){const e=[];for(let i=0;i<t.length;i++){e.push([]);for(let s=0;s<t[0].length;s++)e[i].push(t[i][s])}return e}function M(t,e,i,s){return function(t,e,i){return Math.sqrt(Math.pow(e*i,2)+Math.pow(t,2))}(t,e,s)<=i}function z(t,e,i,s){return function(t,e,i,s){return M(t,e,i,s)&&!(M(t+1,e,i,s)&&M(t-1,e,i,s)&&M(t,e+1,i,s)&&M(t,e-1,i,s))}(t=-.5*(i-2*(t+.5)),e=-.5*(s-2*(e+.5)),i/2,i/s)}function $(t,e,i,s){return Math.abs(t-i)===Math.abs(e-s)&&Math.abs(t-i)?(console.log("circle",Math.abs(t-i),Math.abs(e-s)),function(t,e,i,s){const n=Math.abs(t-i),r=Math.abs(e-s),a=Math.min(t,i),o=Math.min(e,s),h=[];for(let t=0;t<r;t++)for(let e=0;e<n;e++)z(e,t,n,r)&&h.push({x:e+a,y:t+o});return h}(t,e,i+1,s+1)):function(t,e,i,s){const n=[];var r,a=Math.abs(i-t),o=Math.abs(s-e),h=1&o,l=4*(1-a)*o*o,c=4*(h+1)*a*a,d=l+c+h*a*a;t>i&&(t=i,i+=a),e>s&&(e=s),s=(e+=o+1>>1)-h,a*=8*a,h=8*o*o;do{n.push({x:i,y:e}),n.push({x:t,y:e}),n.push({x:t,y:s}),n.push({x:i,y:s}),(r=2*d)<=c&&(e++,s--,d+=c+=a),(r>=l||2*d>c)&&(t++,i--,d+=l+=h)}while(t<=i);for(;e-s<=o;)n.push({x:t-1,y:e}),n.push({x:i+1,y:e++}),n.push({x:t-1,y:s}),n.push({x:i+1,y:s--});return n}(t,e,i,s)}const k="#FFFFFF";function R(t,e,i,s){const n=[],r=Math.abs(i-t),a=Math.abs(s-e),o=t<i?1:-1,h=e<s?1:-1;let l=r-a;for(;n.push({x:t,y:e}),t!==i||e!==s;){var c=2*l;c>-a&&(l-=a,t+=o),c<r&&(l+=r,e+=h)}return n}function A(t,e,i,s){const n=[],r=Math.min(t,i),a=Math.min(e,s);for(var o=Math.abs(i-t)+1,h=Math.abs(s-e)+1,l=a;l<a+h;l++)for(var c=r;c<r+o;c++)n.push({x:c,y:l});return n}function O(t,e,i,s){const n=[],r=Math.min(t,i),a=Math.min(e,s);for(var o=Math.abs(i-t),h=Math.abs(s-e),l=a;l<=a+h;l++)n.push({x:r,y:l}),n.push({x:r+o,y:l});for(var c=r+1;c<=r+o-1;c++)n.push({x:c,y:a}),n.push({x:c,y:a+h});return n}function H(t,e){let i=[];for(let s=0;s<e;s++){const e=[];for(let i=0;i<t;i++)e.push(0);i.push(e)}return i}function I(t,e){for(let i=0;i<t.length;i++)for(let s=0;s<t[0].length;s++)e(s,i,t[i][s])}function Y(t,e,i){return e*i+t}function X(t,e){const i=document.createElement("canvas");return i.width=t,i.height=e,[i,i.getContext("2d")]}const U=[{name:"Circle Outer",width:22,height:22,color:"#F00",opacity:1,lines:[[7,1],[15,1],[15,2],[17,2],[17,3],[18,3],[18,4],[19,4],[19,5],[20,5],[20,7],[21,7],[21,15],[20,15],[20,17],[19,17],[19,18],[18,18],[18,19],[17,19],[17,20],[15,20],[15,21],[7,21],[7,20],[5,20],[5,19],[4,19],[4,18],[3,18],[3,17],[2,17],[2,15],[1,15],[1,7],[2,7],[2,5],[3,5],[3,4],[4,4],[4,3],[5,3],[5,2],[7,2],[7,1]]},{name:"Circle Inner",width:22,height:22,color:"#00F",opacity:1,lines:[[8,3],[14,3],[14,4],[16,4],[16,5],[17,5],[17,6],[18,6],[18,8],[19,8],[19,14],[18,14],[18,16],[17,16],[17,17],[16,17],[16,18],[14,18],[14,19],[8,19],[8,18],[6,18],[6,17],[5,17],[5,16],[4,16],[4,14],[3,14],[3,8],[4,8],[4,6],[5,6],[5,5],[6,5],[6,4],[8,4],[8,3]]},{name:"Square",width:22,height:22,color:"#9932cc",opacity:1,dashed:[4,4],lines:[[2,2],[20,2],[20,20],[2,20],[2,2]]},{name:"Square",width:22,height:22,color:"#9932cc",opacity:.1,dashed:[4,4],dashOffset:4,lines:[[2,2],[20,2],[20,20],[2,20],[2,2]]}],j=new Map;function D(t,e,i,s){const n=`${t}:${e}:${i}:${s}`;if(j.has(n))return j.get(n);let r=U.filter((i=>i.width===t&&i.height===e));0===r.length&&t%2==0&&e%2==0&&(r=[{name:"Horizontal",color:"#00F",opacity:1,lines:[[0,e/2],[t,e/2]]},{name:"Vertical",color:"#00F",opacity:1,lines:[[t/2,0],[t/2,e]]}]);const a=i+s,o=t*a-s,h=e*a-s,l=document.createElement("canvas"),c=l.getContext("2d");if(l.width=o,l.height=h,0!==s){c.fillStyle="#BBB";for(let e=1;e<t;e++)c.fillRect(e*a-s,0,1,h);for(let t=1;t<e;t++)c.fillRect(0,t*a-s,o,1)}return r.forEach((t=>{c.lineDashOffset=t.dashOffset||0,c.setLineDash(t.dashed||[1]),c.strokeStyle=t.color,c.globalAlpha=t.opacity,c.lineWidth=1,c.fillStyle="transparent",c.beginPath(),t.lines.forEach(((t,e)=>{0===e?c.moveTo(t[0]*(i+s)-.5,t[1]*(i+s)-.5):c.lineTo(t[0]*(i+s)-.5,t[1]*(i+s)-.5)})),c.stroke()})),j.set(n,l),l}var T,K=function(t,e,i,s,n,r){function a(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var o,h=s.kind,l="getter"===h?"get":"setter"===h?"set":"value",c=!e&&t?s.static?t:t.prototype:null,d=e||(c?Object.getOwnPropertyDescriptor(c,s.name):{}),p=!1,y=i.length-1;y>=0;y--){var u={};for(var f in s)u[f]="access"===f?{}:s[f];for(var f in s.access)u.access[f]=s.access[f];u.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");r.push(a(t||null))};var g=(0,i[y])("accessor"===h?{get:d.get,set:d.set}:d[l],u);if("accessor"===h){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(o=a(g.get))&&(d.get=o),(o=a(g.set))&&(d.set=o),(o=a(g.init))&&n.unshift(o)}else(o=a(g))&&("field"===h?n.unshift(o):d[l]=o)}c&&Object.defineProperty(c,s.name,d),p=!0},G=function(t,e,i){for(var s=arguments.length>2,n=0;n<e.length;n++)i=s?e[n].call(t,i):e[n].call(t);return s?i:void 0};function F([t,e,i,s]){return`rgba(${t}, ${e}, ${i}, ${s})`}!function(t){t[t.Group=0]="Group",t[t.Pixel=1]="Pixel",t[t.ColorUpdate=2]="ColorUpdate",t[t.ColorAdd=3]="ColorAdd",t[t.ColorRemove=4]="ColorRemove",t[t.LayerAdd=5]="LayerAdd",t[t.LayerRemove=6]="LayerRemove",t[t.LayerName=7]="LayerName",t[t.LayerLock=8]="LayerLock",t[t.LayerUnlock=9]="LayerUnlock",t[t.LayerExport=10]="LayerExport",t[t.LayerVisible=11]="LayerVisible",t[t.LayerOpacity=12]="LayerOpacity"}(T||(T={}));(()=>{let t,e,i,s,n,r,a,o,h,l=[m({selector:"pg-input-pixel-editor",style:S.A,template:'<div part="wrapper" tabindex="0"> <canvas part="canvas" draggable="false"></canvas> </div>'})],c=[],d=HTMLElement,p=[],y=[],u=[],f=[],g=[],x=[],v=[],w=[],E=[],M=[],z=[],U=[],j=[],N=[];(class extends d{static{e=this}static{const m="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;i=[b(L)],s=[b(L)],n=[b(L)],r=[b(L)],a=[b(C)],o=[b()],h=[function(t,e){const i=e.name,s=i.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,i,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${s}]`))}})}))}],K(null,null,i,{kind:"field",name:"width",static:!1,private:!1,access:{has:t=>"width"in t,get:t=>t.width,set:(t,e)=>{t.width=e}},metadata:m},p,y),K(null,null,s,{kind:"field",name:"height",static:!1,private:!1,access:{has:t=>"height"in t,get:t=>t.height,set:(t,e)=>{t.height=e}},metadata:m},u,f),K(null,null,n,{kind:"field",name:"size",static:!1,private:!1,access:{has:t=>"size"in t,get:t=>t.size,set:(t,e)=>{t.size=e}},metadata:m},g,x),K(null,null,r,{kind:"field",name:"gridSize",static:!1,private:!1,access:{has:t=>"gridSize"in t,get:t=>t.gridSize,set:(t,e)=>{t.gridSize=e}},metadata:m},v,w),K(null,null,a,{kind:"field",name:"transparent",static:!1,private:!1,access:{has:t=>"transparent"in t,get:t=>t.transparent,set:(t,e)=>{t.transparent=e}},metadata:m},E,M),K(null,null,o,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:t=>"placeholder"in t,get:t=>t.placeholder,set:(t,e)=>{t.placeholder=e}},metadata:m},z,U),K(null,null,h,{kind:"field",name:"$canvas",static:!1,private:!1,access:{has:t=>"$canvas"in t,get:t=>t.$canvas,set:(t,e)=>{t.$canvas=e}},metadata:m},j,N),K(null,t={value:e},l,{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}),G(e,c)}width=G(this,p,10);height=(G(this,y),G(this,u,10));size=(G(this,f),G(this,g,10));gridSize=(G(this,x),G(this,v,1));transparent=(G(this,w),G(this,E,!1));placeholder=(G(this,M),G(this,z,""));$canvas=(G(this,U),G(this,j,void 0));#t=(G(this,N),0);#e=!1;#i=!1;#s=-1;#n=-1;#r=-1;#a=-1;#o=-1;#h=0;#l=[];#c=!1;#d=!1;#p=!1;#y=[];#u=[];#f=[];#g;#m=[[0,0,0,0],[0,0,0,1]];#x;#v;#w;#b;#L;#C;#E;#S;connectedCallback(){const t=this.$canvas.getContext("2d");null!==t&&(this.#g=t,this.$canvas.addEventListener("contextmenu",this.handleContextMenu.bind(this)),this.$canvas.addEventListener("doubleclick",this.handleDoubleClick.bind(this)),this.$canvas.addEventListener("pointerdown",this.handlePointerDown.bind(this)),this.$canvas.addEventListener("pointerenter",this.handlePointerEnter.bind(this)),this.$canvas.addEventListener("pointerleave",this.handlePointerLeave.bind(this)),this.$canvas.addEventListener("keydown",this.handleKeyDown.bind(this)),this.$canvas.addEventListener("keyup",this.handleKeyUp.bind(this)))}render(t){(t.width||t.height||t.size||t.transparent)&&this.#P()}#M=!0;#P(){const t=this.size+this.gridSize,e=this.width*t-this.gridSize,i=this.height*t-this.gridSize;if(this.$canvas.width=e,this.$canvas.height=i,this.#g.clearRect(0,0,e,i),[this.#x,this.#v]=X(e,i),[this.#w,this.#b]=X(e,i),[this.#L,this.#C]=X(e,i),[this.#E,this.#S]=X(e,i),this.transparent)for(let e=0;e<this.height;e++)for(let i=0;i<this.width;i++)this.#v.fillStyle=k,this.#v.fillRect(i*t,e*t,this.size+1,this.size+1),this.#v.fillStyle="#DDD",this.#v.fillRect(i*t+Math.ceil(this.size/2),e*t,Math.floor(this.size/2),Math.floor(this.size/2)),this.#v.fillRect(i*t,e*t+Math.floor(this.size/2),Math.ceil(this.size/2),Math.ceil(this.size/2));else this.#v.clearRect(0,0,e,i);this.#M?(this.#h=0,this.#l=[{name:"Layer 1",export:!0,locked:!1,visible:!0,opacity:1}],this.#y=[H(this.width,this.height)],this.#M=!1,this.#u=[],this.#f=[]):this.#z(),this.#$()}#z(){const t=this.#y.toReversed(),e=t.length;for(let i=0;i<this.height;i++){if(i>=t[0].length)for(let i=0;i<e;i++)t[i].push(new Array(this.width).fill(0));for(let s=0;s<this.width;s++){if(s>=t[0][i].length)for(let s=0;s<e;s++)t[s][i].push(0);for(let n=0;n<e;n++)if(0!==t[n][i][s]){this.#k(s,i,t[n][i][s]);break}}}}#R(){const t=this.#y.map((t=>function(t,e={}){let i,s,n,r=1,a=0,o=0;if(e.width){if(i=t,s=e.width,n=i.length/s,n%1!=0)throw new Error(`Invalid bitmask width. ${n} = ${i.length} / ${s}`)}else{if(!(t[0]instanceof Array))throw new Error("options.width is required for 1 dimensional array.");i=t.flat(),s=t[0].length,n=t.length}e.scale&&(r=e.scale),e.offsetX&&(a=e.offsetX),e.offsetY&&(o=e.offsetY);const h=s+2,l=Array(h*(n+2)).fill(0);function c(t,e){return(e+1)*h+(t+1)}for(let t=0;t<n;++t)for(let e=0;e<s;++e)l[c(e,t)]=i[Y(e,t,s)];const d=s*(n+1),p=Array(d+(s+1)*n).fill(0).map((()=>({x:0,y:0,next:void 0})));function y(t,e){return e*s+t}function u(t,e){return d+e*(s+1)+t}const f=new Set;function g(t,e,i){t.x=e,t.y=i,f.add(t)}function m(t){for(var e=t.next;void 0!==e&&e!==t;e=e.next)f.delete(e);void 0!==e&&f.add(t)}for(let t=0;t<n;++t)for(let e=0;e<s;++e)if(1==l[c(e,t)]){if(0==l[c(e-1,t)]){const i=p[u(e,t)];g(i,e,t+1),l[c(e-1,t-1)]?i.next=p[y(e-1,t)]:l[c(e,t-1)]?i.next=p[u(e,t-1)]:i.next=p[y(e,t)],m(i)}if(0==l[c(e+1,t)]){const i=p[u(e+1,t)];g(i,e+1,t),l[c(e+1,t+1)]?i.next=p[y(e+1,t+1)]:l[c(e,t+1)]?i.next=p[u(e+1,t+1)]:i.next=p[y(e,t+1)],m(i)}if(0==l[c(e,t-1)]){const i=p[y(e,t)];g(i,e,t),l[c(e+1,t-1)]?i.next=p[u(e+1,t-1)]:l[c(e+1,t)]?i.next=p[y(e+1,t)]:i.next=p[u(e+1,t)],m(i)}if(0==l[c(e,t+1)]){const i=p[y(e,t+1)];g(i,e+1,t+1),l[c(e-1,t+1)]?i.next=p[u(e,t+1)]:l[c(e-1,t)]?i.next=p[y(e-1,t+1)]:i.next=p[u(e,t)],m(i)}}for(const t of f){let e=t;do{e.next&&(e.next.type=e.x==e?.next?.x?"V":"H",e=e.next)}while(e!==t)}for(let t of f){let e=t;do{if(e.type!=e.next?.type)for(;e.next?.type==e.next?.next?.type;)e.next===t&&(f.delete(t),t=e.next.next,f.add(t)),e.next=e.next?.next;e=e.next}while(e!==t)}let x="";for(const t of f){x+=`M${t.x*r},${t.y*r}`;for(var v=t.next;v!=t;v=v?.next)"H"==v?.type?x+=`H${v?.x*r+a}`:"V"==v?.type&&(x+=`V${v?.y*r+o}`);x+="Z"}return x}(t,{scale:1})));console.log("change:",t),this.dispatchEvent(new CustomEvent("change",{detail:{value:t}}))}#A=0;#O(){clearInterval(this.#A),this.#A=window.setTimeout(this.#R.bind(this),1e3)}#k(t,e,i){if(t>=this.width||t<0)return;if(e>=this.height||e<0)return;const s=this.size+this.gridSize;this.#g.clearRect(t*s,e*s,this.size,this.size),this.#b.clearRect(t*s,e*s,this.size,this.size),this.#C.clearRect(t*s,e*s,this.size,this.size),0!==this.#m[i][3]&&(this.#b.fillStyle=k,this.#b.fillRect(t*s-this.gridSize+1,e*s-this.gridSize+1,this.size+2*this.gridSize-2,this.size+2*this.gridSize-2),this.#b.fillStyle=F(this.#m[i]),this.#b.fillRect(t*s+1,e*s+1,this.size-2,this.size-2)),0!==this.#m[i][3]&&(this.#C.fillStyle=F(this.#m[i]),this.#C.fillRect(t*s,e*s,this.size,this.size)),this.#g.drawImage(this.#x,t*s,e*s,this.size+2,this.size+2,t*s,e*s,this.size+2,this.size+2),this.#g.drawImage(this.#i?this.#w:this.#L,t*s,e*s,this.size+2,this.size+2,t*s,e*s,this.size+2,this.size+2),this.#y[this.#h][e][t]=i,this.#O()}#H(){for(let t=0;t<this.height;t++)for(let e=0;e<this.width;e++)this.#k(e,t,this.#y[this.#h][t][e])}#I(t,e,i){const s=this.size+this.gridSize,n=this.width*s-this.gridSize,r=this.height*s-this.gridSize,{minX:a,maxX:o,minY:h,maxY:l}=t.reduce(((t,s)=>({minX:Math.min(t.minX,s.x,e),maxX:Math.max(t.maxX,s.x,e),minY:Math.min(t.minY,s.y,i),maxY:Math.max(t.maxY,s.y,i)})),{minX:this.width,maxX:0,minY:this.height,maxY:0}),c=a*s,d=h*s,p=(o-a+1)*s,y=(l-h+1)*s;this.#g.clearRect(c,d,p,y),this.#g.drawImage(this.#x,c,d,p,y,c,d,p,y),this.#g.drawImage(this.#w,c,d,p,y,c,d,p,y),this.#S.clearRect(0,0,n,r),t.forEach((({x:t,y:e})=>{this.#S.fillStyle=k,this.#S.beginPath(),this.#S.arc(t*s+5,e*s+5,3,0,2*Math.PI),this.#S.closePath(),this.#S.fill(),this.#S.fillStyle="#1B79C8",this.#S.beginPath(),this.#S.arc(t*s+5,e*s+5,2,0,2*Math.PI),this.#S.closePath(),this.#S.fill()})),this.#g.drawImage(this.#E,c,d,p,y,c,d,p,y),this.dispatchEvent(new CustomEvent("debug",{detail:{x:c,y:d,width:p,height:y,canvas:this.$canvas,context:this.#g,editLayer:this.#w,noEditLayer:this.#L,baseLayer:this.#x,previewLayer:this.#E}}))}handleKeyDown(t){switch(console.log(t.shiftKey,t.ctrlKey,t.altKey,t.key),t.key){case" ":console.log("space");break;case"Escape":console.log("escape")}}handleKeyUp(t){}handleContextMenu(t){t?.preventDefault()}handleDoubleClick(t){t?.preventDefault()}#Y;#X;handlePointerDown(t){if(1!==t.buttons&&32!==t.buttons)return t.preventDefault(),void t.stopPropagation();this.#p=t.altKey,this.#c=t.ctrlKey,this.#d=t.shiftKey;const e=this.$canvas.getBoundingClientRect(),i=this.size+this.gridSize;let s=Math.floor((t.clientX-e.left)/i),n=Math.floor((t.clientY-e.top)/i);if(s===this.#a&&n===this.#o)return;s>=this.width&&(s=this.width-1),n>=this.height&&(n=this.height-1),this.#e=!0,this.#s=this.#y[this.#h][n][s],this.#n=s,this.#r=n,this.#a=s,this.#o=n;const r=32===t.buttons?0:1;if(0===this.#t)this.#k(s,n,r),this.#y[this.#h][n][s]=r;console.log(this.#t,s,n),this.#Y=this.handlePointerMove.bind(this),document.addEventListener("pointermove",this.#Y),this.#X=this.handlePointerUp.bind(this),document.addEventListener("pointerup",this.#X)}#U=!1;handlePointerUpGlobal(){this.#U&&(this.handlePointerUp({clientX:100,clientY:100}),this.cleanupPointerGlobal())}cleanupPointerGlobal(){document.removeEventListener("pointermove",this.#Y),document.removeEventListener("pointerup",this.#X)}handlePointerUp(t){const e=this.$canvas.getBoundingClientRect(),i=this.size+this.gridSize;let s=Math.floor((t.clientX-e.left)/i),n=Math.floor((t.clientY-e.top)/i);if(s===this.#n&&n===this.#r&&1===this.#s){if(0===this.#t)this.#k(s,n,0),this.#y[this.#h][n][s]=0}else switch(this.#t){case 1:R(this.#n,this.#r,s,n).forEach((({x:t,y:e})=>{this.#k(t,e,1)}));break;case 2:A(this.#n,this.#r,s,n).forEach((({x:t,y:e})=>{this.#k(t,e,1)}));break;case 3:O(this.#n,this.#r,s,n).forEach((({x:t,y:e})=>{this.#k(t,e,1)}));break;case 4:case 5:$(this.#n,this.#r,s,n).forEach((({x:t,y:e})=>{this.#k(t,e,1)}))}this.#a=-1,this.#o=-1,this.#e=!1,this.cleanupPointerGlobal()}handlePointerMove(t){const e=this.$canvas;if(this.#e){this.#p=t.altKey,this.#c=t.ctrlKey,this.#d=t.shiftKey;const s=this.#y,n=e.getBoundingClientRect(),r=this.size+this.gridSize,a=[],o=this.#n,h=this.#r,l=this.#a,c=this.#o;if("function"==typeof t.getCoalescedEvents){const e=t.getCoalescedEvents();for(const t of e){let e=Math.floor((t.clientX-n.left)/r),i=Math.floor((t.clientY-n.top)/r);e===l&&i===c||a.push([e,i])}}else{let e=Math.floor((t.clientX-n.left)/r),i=Math.floor((t.clientY-n.top)/r);if(e===l&&i===c)return;a.push([e,i])}const d=32===t.buttons?0:1;if(0===a.length)return;const[p,y]=a.at(-1);switch(this.#a=p,this.#o=y,this.#t){case 0:for(var i of a)this.#k(i[0],i[1],d),s[this.#h][i[1]][i[0]]=d;break;case 1:this.#I(R(o,h,p,y),l,c);break;case 2:this.#I(A(o,h,p,y),l,c);break;case 3:this.#I(O(o,h,p,y),l,c);break;case 4:case 5:this.#I($(o,h,p,y),l,c)}}}handlePointerEnter(t){this.#e||this.#i||(this.#i=!0,this.#g.drawImage(this.#x,0,0),this.#g.drawImage(this.#i?this.#w:this.#L,0,0)),this.#U=!1}handlePointerLeave(t){this.#e?this.#i&&(this.#U=!0):(this.#i=!1,this.#g.drawImage(this.#x,0,0),this.#g.drawImage(this.#i?this.#w:this.#L,0,0))}#$(){this.#g.drawImage(this.#x,0,0),this.#g.drawImage(this.#L,0,0)}mergeColor(t,e){}clear(){const t=H(this.width,this.height);!function(t,e){const i=[],s=t[0].length,n=t.length,r=e[0].length,a=e.length,o=Math.max(s,r),h=Math.max(n,a);for(let s=0;s<h;s++)for(let n=0;n<o;n++){const r=e&&e[s]&&e[s][n],a=t&&t[s]&&t[s][n];r!==a&&i.push([n,s,a,r])}}(this.#y[this.#h],t);this.#u.push({type:T.Group,data:{name:"Clear"}}),this.#u.push({type:T.Pixel,data:{pixels:[],layer:this.#h}}),this.#y=[H(this.width,this.height)],this.#$()}reset(){this.#M=!0,this.#P()}clearHistory(){this.#u=[],this.#f=[]}applyTemplate(t){this.#y=[t],this.#H()}flipHorizontal(){const t=P(this.#y[this.#h]),e=t[0].length-1;I(this.#y[this.#h],((i,s)=>{t[s][i]=this.#y[this.#h][s][e-i]})),this.#y[this.#h]=t}flipVertical(){const t=P(this.#y[this.#h]),e=t.length-1;I(this.#y[this.#h],((i,s)=>{t[this.#h][s][i]=this.#y[e-s][i]})),this.#y[this.#h]=t}move(t,e){const i=H(this.width,this.height);for(let t=0;t<this.height;t++)i[t].fill(0);I(this.#y[this.#h],((s,n)=>{n-e<0||s-t<0||n-e>=this.height||s-t>=this.width||(i[n][s]=this.#y[this.#h][n-e][s-t])})),this.#y[this.#h]=i}invert(){this.#m.length>2||(I(this.#y[this.#h],((t,e)=>{this.#y[this.#h][e][t]=0===this.#y[this.#h][e][t]?1:0})),this.#H())}applyGuides(){const t=D(this.width,this.height,this.size,this.gridSize);this.#v.drawImage(t,0,0)}clearGuides(){}undo(){const t=this.#u.pop();if(t&&t.type===T.Pixel)this.#f.push(t),t.data.pixels.forEach((t=>{const[e,i]=t;this.#y[this.#h][i][e]=t[2]}))}redo(){}rotateClockwise(){this.#j(!1)}rotateCounterclockwise(){this.#j(!0)}#j(t=!1){const e=P(this.#y[this.#h]);if(t){const t=this.#y[0].map(((t,e)=>this.#y.map((t=>t[t.length-1-e]))));for(let i=0;i<this.height;i++)for(let s=0;s<this.width;s++)e[i][s]=t[this.#h][i][s]}else{const t=this.#y[0].map(((t,e)=>this.#y.map((t=>t[e])).reverse()));for(let i=0;i<this.height;i++)for(let s=0;s<this.width;s++)e[i][s]=t[this.#h][i][s]}this.#y[this.#h]=e}hasUndo(){return 0!==this.#u.length}hasRedo(){return 0!==this.#f.length}inputModePixel(){this.#t=0}inputModeLine(){this.#t=1}inputModeRectangle(){this.#t=2}inputModeRectangleOutline(){this.#t=3}inputModeEllipse(){this.#t=4}inputModeEllipseOutline(){this.#t=5}async save(t={}){const e={width:this.width,height:this.height,transparent:this.transparent,colors:this.#m,layers:this.#l,data:this.#y};!0===t.history&&(e.undo=this.#u,e.redo=this.#f);for(let t=0;t<e.data.length;t++)for(let i=e.data[t].length-1;i>=0;i--)if(i>=this.height)e.data[t].pop();else for(let s=e.data[t][i].length-1;s>=0;s--)s>=this.width&&e.data[t][i].pop();return e}async open(t){if("object"!=typeof t)return["json must be type object"];const e=[],i=Object.keys(t);["width","height","transparent","colors","layers","data"].forEach((t=>{i.includes(t)||e.push(`JSON key '${t}' required.`)})),this.width=t.width,this.height=t.height,this.transparent=t.transparent,this.#m=t.colors,this.#l=t.layers,this.#y=t.data,t.undo&&(this.#u=t.undo),t.redo&&(this.#f=t.redo),this.#P()}})})()})();
1
+ (()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i="",s=void 0!==e[5];return e[4]&&(i+="@supports (".concat(e[4],") {")),e[2]&&(i+="@media ".concat(e[2]," {")),s&&(i+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),i+=t(e),s&&(i+="}"),e[2]&&(i+="}"),e[4]&&(i+="}"),i})).join("")},e.i=function(t,i,s,n,r){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(s)for(var o=0;o<this.length;o++){var h=this[o][0];null!=h&&(a[h]=!0)}for(var l=0;l<t.length;l++){var c=[].concat(t[l]);s&&a[c[0]]||(void 0!==r&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=r),i&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=i):c[2]=i),n&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=n):c[4]="".concat(n)),e.push(c))}},e}},601:t=>{t.exports=function(t){return t[1]}},713:(t,e,i)=>{i.d(e,{A:()=>h});var s=i(601),n=i.n(s),r=i(314),a=i.n(r)()(n());a.push([t.id,':host {\n display: inline-flex;\n}\n\n[part="wrapper"] {\n display: flex;\n position: relative;\n outline: 0;\n}\n\n[part="wrapper"]:focus-visible::before {\n pointer-events: none;\n content: \'\';\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n left: -1px;\n border-radius: 0.125rem;\n box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.5));\n}\n\ncanvas {\n touch-action: none;\n user-select: none;\n outline: 0;\n}',""]);var o=new CSSStyleSheet;o.replaceSync(a.toString());const h=o}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={id:s,exports:{}};return t[s](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const s=Symbol("addObserver"),n=Symbol("removeObserver"),r=Symbol("getObservers"),a=Symbol("isProxy"),o=Symbol("getTarget"),h=["fill","pop","push","reverse","shift","sort","splice","unshift"],l=new Map;function c(t){return new Proxy(t,{get(e,i){if("symbol"==typeof i){switch(i){case a:return!0;case o:return e;case r:return l.has(t);case s:return(e,i)=>{l.has(t)?l.get(t).has(e)?l.get(t).get(e).push(i):l.get(t).set(e,[i]):l.set(t,new Map([[e,[i]]]))};case n:return e=>{l.has(t)&&(l.get(t).delete(e),0===l.get(t).size&&l.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,i)}throw new Error("Unsupported symbol")}if(i in e){if(!Number.isNaN(Number(i)))return"object"==typeof e[i]?c(e[i]):e[i];if("copyWithin"===i)throw new Error("Unsupported array method copyWithin");if(h.includes(i))return l.has(e)?function(){const t=Array.prototype[i].apply(e,arguments);return l.get(e).forEach(((t,s)=>{t.forEach((t=>{t(e,i,arguments)}))})),t}:Reflect.get(e,i);if(e[i]instanceof Array)return c(e[i])}return Reflect.get(e,i)},set(t,e,i){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,i);if(l.has(t)){l.get(t).forEach(((t,s)=>{t.forEach((t=>{t(e,i)}))}))}return Reflect.set(t,e,i)}})}window.observers=l;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const d=Symbol("init"),p=Symbol("template"),u=Symbol("style"),y=Symbol("parent");function f(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 m(t={}){return function(e,i){if("class"!==i.kind)throw new Error("@Component() can only decorate a class");var s,n;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[y]||e.prototype[y][e.prototype[y].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[y]=[e.prototype],e.prototype[u]=t.style?[t.style]:[],e.prototype[p]=t.template||""):(e.prototype[y].push(e.prototype),e.prototype[u].push(t.style),e.prototype[p]=(s=e.prototype[p],(n=t.template||null)&&n.match(/<parent\/>/)?n.replace(/<parent\/>/,s):`${s}${n||""}`));const r=e.prototype.connectedCallback||(()=>{}),a=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[d]||void 0!==t.template||void 0!==t.style)if(this[d]){if(this[d]&&t.style);else if(this[d]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[p]||"";const i=document.importNode(t.content,!0),s=this.attachShadow({mode:"open"});s.adoptedStyleSheets=e.prototype[u].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),s.appendChild(i)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const i=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&i.add(t.localName);const s=Array.from(i.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),n=()=>{this[y].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[g(e)]=!0,t)),{}):{})}))};0===s.length?(this[d]=!0,r.call(this),n()):Promise.all(s).then((()=>{this[d]=!0,r.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,i){this[g(t)]=i},i.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${i.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function x(t){return!!t&&t.constructor===Array}function v(t,e){t[d]&&t[y].map((i=>{i.render&&i.render.call(t,{[e]:!0})}))}function w(t){return null===t?"null":x(t)?"array":typeof t}function b(t){return function(e,i){const s=i.name,n=Symbol(s),h=Symbol(`${s}:type`),l=Symbol(`${s}:meta`);return i.addInitializer((function(){Reflect.defineProperty(this,s,{get:()=>"object"===this[h]||"array"===this[h]?this[n][a]?this[n]:c(this[n]):this[n],set:e=>{const i=w(t?t(e):e);if("index"!==s&&this[h]!==i&&"null"!==this[h]&&"null"!==i)throw new Error(`@Prop() ${s} with type '${this[h]}' cannot be set to ${i}.`);if("array"===this[h]){if(!x(e))throw new PropError(`Array "${s}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,s)?.set);if(this[n]===e)throw new Error("Setting an array to itself is not allowed.");const t=c(this[n]);if(t[r]){const i=e[a]?(l=e)[a]&&l[o]:e;t.splice(0,this[n].length,...i)}else this[n]=e}else this[n]=t?t(e):e,v(this,s);var l}})})),function(e){if(void 0===e&&"index"!==s)throw new Error(`@Prop() ${s} must have an initial value defined.`);if(void 0!==e&&"index"===s)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${s} boolean must initialize to false.`);if(!i.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,i=f(s);e[s]||(t.observedAttributes.push(i),e[s]=n)}return this[h]=w(e),"array"===this[h]?(this[n]=e,new Proxy(e,{get:(t,e)=>e===E?this[l]:(console.log("errr???"),Reflect.get(this[n],e)),set:(t,e,i)=>{if(e===E)return this[l]=i,!0;const r=Reflect.set(t,e,i);return"length"===e&&this[n].length===i||v(this,s),this[n]=i,r}})):(this[n]=t?t(this.getAttribute(s)??e):this.getAttribute(s)??e,this[n])}}}function L(t){return parseInt(`${t}`,10)}function C(t){return""===t||!0===t||null!==t&&!1!==t&&(t||!0)}Symbol("hasProxy");const E=Symbol("meta");var S=i(713);function P(t){const e=[];for(let i=0;i<t.length;i++){e.push([]);for(let s=0;s<t[0].length;s++)e[i].push(t[i][s])}return e}function M(t,e,i,s){return function(t,e,i){return Math.sqrt(Math.pow(e*i,2)+Math.pow(t,2))}(t,e,s)<=i}function z(t,e,i,s){return function(t,e,i,s){return M(t,e,i,s)&&!(M(t+1,e,i,s)&&M(t-1,e,i,s)&&M(t,e+1,i,s)&&M(t,e-1,i,s))}(t=-.5*(i-2*(t+.5)),e=-.5*(s-2*(e+.5)),i/2,i/s)}function $(t,e,i,s){return Math.abs(t-i)===Math.abs(e-s)&&Math.abs(t-i)?(console.log("circle",Math.abs(t-i),Math.abs(e-s)),function(t,e,i,s){const n=Math.abs(t-i),r=Math.abs(e-s),a=Math.min(t,i),o=Math.min(e,s),h=[];for(let t=0;t<r;t++)for(let e=0;e<n;e++)z(e,t,n,r)&&h.push({x:e+a,y:t+o});return h}(t,e,i+1,s+1)):function(t,e,i,s){const n=[];var r,a=Math.abs(i-t),o=Math.abs(s-e),h=1&o,l=4*(1-a)*o*o,c=4*(h+1)*a*a,d=l+c+h*a*a;t>i&&(t=i,i+=a),e>s&&(e=s),s=(e+=o+1>>1)-h,a*=8*a,h=8*o*o;do{n.push({x:i,y:e}),n.push({x:t,y:e}),n.push({x:t,y:s}),n.push({x:i,y:s}),(r=2*d)<=c&&(e++,s--,d+=c+=a),(r>=l||2*d>c)&&(t++,i--,d+=l+=h)}while(t<=i);for(;e-s<=o;)n.push({x:t-1,y:e}),n.push({x:i+1,y:e++}),n.push({x:t-1,y:s}),n.push({x:i+1,y:s--});return n}(t,e,i,s)}const k="#FFFFFF";function R(t,e,i,s){const n=[],r=Math.abs(i-t),a=Math.abs(s-e),o=t<i?1:-1,h=e<s?1:-1;let l=r-a;for(;n.push({x:t,y:e}),t!==i||e!==s;){var c=2*l;c>-a&&(l-=a,t+=o),c<r&&(l+=r,e+=h)}return n}function A(t,e,i,s){const n=[],r=Math.min(t,i),a=Math.min(e,s);for(var o=Math.abs(i-t)+1,h=Math.abs(s-e)+1,l=a;l<a+h;l++)for(var c=r;c<r+o;c++)n.push({x:c,y:l});return n}function O(t,e,i,s){const n=[],r=Math.min(t,i),a=Math.min(e,s);for(var o=Math.abs(i-t),h=Math.abs(s-e),l=a;l<=a+h;l++)n.push({x:r,y:l}),n.push({x:r+o,y:l});for(var c=r+1;c<=r+o-1;c++)n.push({x:c,y:a}),n.push({x:c,y:a+h});return n}function H(t,e){let i=[];for(let s=0;s<e;s++){const e=[];for(let i=0;i<t;i++)e.push(0);i.push(e)}return i}function I(t,e){for(let i=0;i<t.length;i++)for(let s=0;s<t[0].length;s++)e(s,i,t[i][s])}function Y(t,e,i){return e*i+t}function X(t,e){const i=document.createElement("canvas");return i.width=t,i.height=e,[i,i.getContext("2d")]}const U=[{name:"Circle Outer",width:22,height:22,color:"#F00",opacity:1,lines:[[7,1],[15,1],[15,2],[17,2],[17,3],[18,3],[18,4],[19,4],[19,5],[20,5],[20,7],[21,7],[21,15],[20,15],[20,17],[19,17],[19,18],[18,18],[18,19],[17,19],[17,20],[15,20],[15,21],[7,21],[7,20],[5,20],[5,19],[4,19],[4,18],[3,18],[3,17],[2,17],[2,15],[1,15],[1,7],[2,7],[2,5],[3,5],[3,4],[4,4],[4,3],[5,3],[5,2],[7,2],[7,1]]},{name:"Circle Inner",width:22,height:22,color:"#00F",opacity:1,lines:[[8,3],[14,3],[14,4],[16,4],[16,5],[17,5],[17,6],[18,6],[18,8],[19,8],[19,14],[18,14],[18,16],[17,16],[17,17],[16,17],[16,18],[14,18],[14,19],[8,19],[8,18],[6,18],[6,17],[5,17],[5,16],[4,16],[4,14],[3,14],[3,8],[4,8],[4,6],[5,6],[5,5],[6,5],[6,4],[8,4],[8,3]]},{name:"Square",width:22,height:22,color:"#9932cc",opacity:1,dashed:[4,4],lines:[[2,2],[20,2],[20,20],[2,20],[2,2]]},{name:"Square",width:22,height:22,color:"#9932cc",opacity:.1,dashed:[4,4],dashOffset:4,lines:[[2,2],[20,2],[20,20],[2,20],[2,2]]}],j=new Map;function D(t,e,i,s){const n=`${t}:${e}:${i}:${s}`;if(j.has(n))return j.get(n);let r=U.filter((i=>i.width===t&&i.height===e));0===r.length&&t%2==0&&e%2==0&&(r=[{name:"Horizontal",color:"#00F",opacity:1,lines:[[0,e/2],[t,e/2]]},{name:"Vertical",color:"#00F",opacity:1,lines:[[t/2,0],[t/2,e]]}]);const a=i+s,o=t*a-s,h=e*a-s,l=document.createElement("canvas"),c=l.getContext("2d");if(l.width=o,l.height=h,0!==s){c.fillStyle="#BBB";for(let e=1;e<t;e++)c.fillRect(e*a-s,0,1,h);for(let t=1;t<e;t++)c.fillRect(0,t*a-s,o,1)}return r.forEach((t=>{c.lineDashOffset=t.dashOffset||0,c.setLineDash(t.dashed||[1]),c.strokeStyle=t.color,c.globalAlpha=t.opacity,c.lineWidth=1,c.fillStyle="transparent",c.beginPath(),t.lines.forEach(((t,e)=>{0===e?c.moveTo(t[0]*(i+s)-.5,t[1]*(i+s)-.5):c.lineTo(t[0]*(i+s)-.5,t[1]*(i+s)-.5)})),c.stroke()})),j.set(n,l),l}var T,K=function(t,e,i,s,n,r){function a(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var o,h=s.kind,l="getter"===h?"get":"setter"===h?"set":"value",c=!e&&t?s.static?t:t.prototype:null,d=e||(c?Object.getOwnPropertyDescriptor(c,s.name):{}),p=!1,u=i.length-1;u>=0;u--){var y={};for(var f in s)y[f]="access"===f?{}:s[f];for(var f in s.access)y.access[f]=s.access[f];y.addInitializer=function(t){if(p)throw new TypeError("Cannot add initializers after decoration has completed");r.push(a(t||null))};var g=(0,i[u])("accessor"===h?{get:d.get,set:d.set}:d[l],y);if("accessor"===h){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(o=a(g.get))&&(d.get=o),(o=a(g.set))&&(d.set=o),(o=a(g.init))&&n.unshift(o)}else(o=a(g))&&("field"===h?n.unshift(o):d[l]=o)}c&&Object.defineProperty(c,s.name,d),p=!0},G=function(t,e,i){for(var s=arguments.length>2,n=0;n<e.length;n++)i=s?e[n].call(t,i):e[n].call(t);return s?i:void 0};function F([t,e,i,s]){return`rgba(${t}, ${e}, ${i}, ${s})`}!function(t){t[t.Group=0]="Group",t[t.Pixel=1]="Pixel",t[t.ColorUpdate=2]="ColorUpdate",t[t.ColorAdd=3]="ColorAdd",t[t.ColorRemove=4]="ColorRemove",t[t.LayerAdd=5]="LayerAdd",t[t.LayerRemove=6]="LayerRemove",t[t.LayerName=7]="LayerName",t[t.LayerLock=8]="LayerLock",t[t.LayerUnlock=9]="LayerUnlock",t[t.LayerExport=10]="LayerExport",t[t.LayerVisible=11]="LayerVisible",t[t.LayerOpacity=12]="LayerOpacity"}(T||(T={}));(()=>{let t,e,i,s,n,r,a,o,h,l=[m({selector:"pg-input-pixel-editor",style:S.A,template:'<div part="wrapper" tabindex="0"> <canvas part="canvas" draggable="false"></canvas> </div>'})],c=[],d=HTMLElement,p=[],u=[],y=[],f=[],g=[],x=[],v=[],w=[],E=[],M=[],z=[],U=[],j=[],N=[];(class extends d{static{e=this}static{const m="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;i=[b(L)],s=[b(L)],n=[b(L)],r=[b(L)],a=[b(C)],o=[b()],h=[function(t,e){const i=e.name,s=i.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,i,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${s}]`))}})}))}],K(null,null,i,{kind:"field",name:"width",static:!1,private:!1,access:{has:t=>"width"in t,get:t=>t.width,set:(t,e)=>{t.width=e}},metadata:m},p,u),K(null,null,s,{kind:"field",name:"height",static:!1,private:!1,access:{has:t=>"height"in t,get:t=>t.height,set:(t,e)=>{t.height=e}},metadata:m},y,f),K(null,null,n,{kind:"field",name:"size",static:!1,private:!1,access:{has:t=>"size"in t,get:t=>t.size,set:(t,e)=>{t.size=e}},metadata:m},g,x),K(null,null,r,{kind:"field",name:"gridSize",static:!1,private:!1,access:{has:t=>"gridSize"in t,get:t=>t.gridSize,set:(t,e)=>{t.gridSize=e}},metadata:m},v,w),K(null,null,a,{kind:"field",name:"transparent",static:!1,private:!1,access:{has:t=>"transparent"in t,get:t=>t.transparent,set:(t,e)=>{t.transparent=e}},metadata:m},E,M),K(null,null,o,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:t=>"placeholder"in t,get:t=>t.placeholder,set:(t,e)=>{t.placeholder=e}},metadata:m},z,U),K(null,null,h,{kind:"field",name:"$canvas",static:!1,private:!1,access:{has:t=>"$canvas"in t,get:t=>t.$canvas,set:(t,e)=>{t.$canvas=e}},metadata:m},j,N),K(null,t={value:e},l,{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}),G(e,c)}width=G(this,p,10);height=(G(this,u),G(this,y,10));size=(G(this,f),G(this,g,10));gridSize=(G(this,x),G(this,v,1));transparent=(G(this,w),G(this,E,!1));placeholder=(G(this,M),G(this,z,""));$canvas=(G(this,U),G(this,j,void 0));#t=(G(this,N),0);#e=!1;#i=!1;#s=-1;#n=-1;#r=-1;#a=-1;#o=-1;#h=0;#l=[];#c=!1;#d=!1;#p=!1;#u=[];#y=[];#f=[];#g;#m=[[0,0,0,0],[0,0,0,1]];#x;#v;#w;#b;#L;#C;#E;#S;connectedCallback(){const t=this.$canvas.getContext("2d");null!==t&&(this.#g=t,this.$canvas.addEventListener("contextmenu",this.handleContextMenu.bind(this)),this.$canvas.addEventListener("doubleclick",this.handleDoubleClick.bind(this)),this.$canvas.addEventListener("pointerdown",this.handlePointerDown.bind(this)),this.$canvas.addEventListener("pointerenter",this.handlePointerEnter.bind(this)),this.$canvas.addEventListener("pointerleave",this.handlePointerLeave.bind(this)),this.$canvas.addEventListener("keydown",this.handleKeyDown.bind(this)),this.$canvas.addEventListener("keyup",this.handleKeyUp.bind(this)))}render(t){(t.width||t.height||t.size||t.transparent)&&this.#P()}#M=!0;#P(){const t=this.size+this.gridSize,e=this.width*t-this.gridSize,i=this.height*t-this.gridSize;if(this.$canvas.width=e,this.$canvas.height=i,this.#g.clearRect(0,0,e,i),[this.#x,this.#v]=X(e,i),[this.#w,this.#b]=X(e,i),[this.#L,this.#C]=X(e,i),[this.#E,this.#S]=X(e,i),this.transparent)for(let e=0;e<this.height;e++)for(let i=0;i<this.width;i++)this.#v.fillStyle=k,this.#v.fillRect(i*t,e*t,this.size+1,this.size+1),this.#v.fillStyle="#DDD",this.#v.fillRect(i*t+Math.ceil(this.size/2),e*t,Math.floor(this.size/2),Math.floor(this.size/2)),this.#v.fillRect(i*t,e*t+Math.floor(this.size/2),Math.ceil(this.size/2),Math.ceil(this.size/2));else this.#v.clearRect(0,0,e,i);this.#M?(this.#h=0,this.#l=[{name:"Layer 1",export:!0,locked:!1,visible:!0,opacity:1}],this.#u=[H(this.width,this.height)],this.#M=!1,this.#y=[],this.#f=[]):this.#z(),this.#$()}#z(){const t=this.#u.toReversed(),e=t.length;for(let i=0;i<this.height;i++){if(i>=t[0].length)for(let i=0;i<e;i++)t[i].push(new Array(this.width).fill(0));for(let s=0;s<this.width;s++){if(s>=t[0][i].length)for(let s=0;s<e;s++)t[s][i].push(0);for(let n=0;n<e;n++)if(0!==t[n][i][s]){this.#k(s,i,t[n][i][s]);break}}}}#R(){const t=this.#u.map((t=>function(t,e={}){let i,s,n,r=1,a=0,o=0;if(e.width){if(i=t,s=e.width,n=i.length/s,n%1!=0)throw new Error(`Invalid bitmask width. ${n} = ${i.length} / ${s}`)}else{if(!(t[0]instanceof Array))throw new Error("options.width is required for 1 dimensional array.");i=t.flat(),s=t[0].length,n=t.length}e.scale&&(r=e.scale),e.offsetX&&(a=e.offsetX),e.offsetY&&(o=e.offsetY);const h=s+2,l=Array(h*(n+2)).fill(0);function c(t,e){return(e+1)*h+(t+1)}for(let t=0;t<n;++t)for(let e=0;e<s;++e)l[c(e,t)]=i[Y(e,t,s)];const d=s*(n+1),p=Array(d+(s+1)*n).fill(0).map((()=>({x:0,y:0,next:void 0})));function u(t,e){return e*s+t}function y(t,e){return d+e*(s+1)+t}const f=new Set;function g(t,e,i){t.x=e,t.y=i,f.add(t)}function m(t){for(var e=t.next;void 0!==e&&e!==t;e=e.next)f.delete(e);void 0!==e&&f.add(t)}for(let t=0;t<n;++t)for(let e=0;e<s;++e)if(1==l[c(e,t)]){if(0==l[c(e-1,t)]){const i=p[y(e,t)];g(i,e,t+1),l[c(e-1,t-1)]?i.next=p[u(e-1,t)]:l[c(e,t-1)]?i.next=p[y(e,t-1)]:i.next=p[u(e,t)],m(i)}if(0==l[c(e+1,t)]){const i=p[y(e+1,t)];g(i,e+1,t),l[c(e+1,t+1)]?i.next=p[u(e+1,t+1)]:l[c(e,t+1)]?i.next=p[y(e+1,t+1)]:i.next=p[u(e,t+1)],m(i)}if(0==l[c(e,t-1)]){const i=p[u(e,t)];g(i,e,t),l[c(e+1,t-1)]?i.next=p[y(e+1,t-1)]:l[c(e+1,t)]?i.next=p[u(e+1,t)]:i.next=p[y(e+1,t)],m(i)}if(0==l[c(e,t+1)]){const i=p[u(e,t+1)];g(i,e+1,t+1),l[c(e-1,t+1)]?i.next=p[y(e,t+1)]:l[c(e-1,t)]?i.next=p[u(e-1,t+1)]:i.next=p[y(e,t)],m(i)}}for(const t of f){let e=t;do{e.next&&(e.next.type=e.x==e?.next?.x?"V":"H",e=e.next)}while(e!==t)}for(let t of f){let e=t;do{if(e.type!=e.next?.type)for(;e.next?.type==e.next?.next?.type;)e.next===t&&(f.delete(t),t=e.next.next,f.add(t)),e.next=e.next?.next;e=e.next}while(e!==t)}let x="";for(const t of f){x+=`M${t.x*r},${t.y*r}`;for(var v=t.next;v!=t;v=v?.next)"H"==v?.type?x+=`H${v?.x*r+a}`:"V"==v?.type&&(x+=`V${v?.y*r+o}`);x+="Z"}return x}(t,{scale:1})));console.log("change:",t),this.dispatchEvent(new CustomEvent("change",{detail:{value:t}}))}#A=0;#O(){clearInterval(this.#A),this.#A=window.setTimeout(this.#R.bind(this),1e3)}#k(t,e,i){if(t>=this.width||t<0)return;if(e>=this.height||e<0)return;const s=this.size+this.gridSize;this.#g.clearRect(t*s,e*s,this.size,this.size),this.#b.clearRect(t*s,e*s,this.size,this.size),this.#C.clearRect(t*s,e*s,this.size,this.size),0!==this.#m[i][3]&&(this.#b.fillStyle=k,this.#b.fillRect(t*s-this.gridSize+1,e*s-this.gridSize+1,this.size+2*this.gridSize-2,this.size+2*this.gridSize-2),this.#b.fillStyle=F(this.#m[i]),this.#b.fillRect(t*s+1,e*s+1,this.size-2,this.size-2)),0!==this.#m[i][3]&&(this.#C.fillStyle=F(this.#m[i]),this.#C.fillRect(t*s,e*s,this.size,this.size)),this.#g.drawImage(this.#x,t*s,e*s,this.size+2,this.size+2,t*s,e*s,this.size+2,this.size+2),this.#g.drawImage(this.#i?this.#w:this.#L,t*s,e*s,this.size+2,this.size+2,t*s,e*s,this.size+2,this.size+2),this.#u[this.#h][e][t]=i,this.#O()}#H(){for(let t=0;t<this.height;t++)for(let e=0;e<this.width;e++)this.#k(e,t,this.#u[this.#h][t][e])}#I(t,e,i){const s=this.size+this.gridSize,n=this.width*s-this.gridSize,r=this.height*s-this.gridSize,{minX:a,maxX:o,minY:h,maxY:l}=t.reduce(((t,s)=>({minX:Math.min(t.minX,s.x,e),maxX:Math.max(t.maxX,s.x,e),minY:Math.min(t.minY,s.y,i),maxY:Math.max(t.maxY,s.y,i)})),{minX:this.width,maxX:0,minY:this.height,maxY:0}),c=a*s,d=h*s,p=(o-a+1)*s,u=(l-h+1)*s;this.#g.clearRect(c,d,p,u),this.#g.drawImage(this.#x,c,d,p,u,c,d,p,u),this.#g.drawImage(this.#w,c,d,p,u,c,d,p,u),this.#S.clearRect(0,0,n,r),t.forEach((({x:t,y:e})=>{this.#S.fillStyle=k,this.#S.beginPath(),this.#S.arc(t*s+5,e*s+5,3,0,2*Math.PI),this.#S.closePath(),this.#S.fill(),this.#S.fillStyle="#1B79C8",this.#S.beginPath(),this.#S.arc(t*s+5,e*s+5,2,0,2*Math.PI),this.#S.closePath(),this.#S.fill()})),this.#g.drawImage(this.#E,c,d,p,u,c,d,p,u),this.dispatchEvent(new CustomEvent("debug",{detail:{x:c,y:d,width:p,height:u,canvas:this.$canvas,context:this.#g,editLayer:this.#w,noEditLayer:this.#L,baseLayer:this.#x,previewLayer:this.#E}}))}handleKeyDown(t){switch(console.log(t.shiftKey,t.ctrlKey,t.altKey,t.key),t.key){case" ":console.log("space");break;case"Escape":console.log("escape")}}handleKeyUp(t){}handleContextMenu(t){t?.preventDefault()}handleDoubleClick(t){t?.preventDefault()}#Y;#X;handlePointerDown(t){if(1!==t.buttons&&32!==t.buttons)return t.preventDefault(),void t.stopPropagation();this.#p=t.altKey,this.#c=t.ctrlKey,this.#d=t.shiftKey;const e=this.$canvas.getBoundingClientRect(),i=this.size+this.gridSize;let s=Math.floor((t.clientX-e.left)/i),n=Math.floor((t.clientY-e.top)/i);if(s===this.#a&&n===this.#o)return;s>=this.width&&(s=this.width-1),n>=this.height&&(n=this.height-1),this.#e=!0,this.#s=this.#u[this.#h][n][s],this.#n=s,this.#r=n,this.#a=s,this.#o=n;const r=32===t.buttons?0:1;if(0===this.#t)this.#k(s,n,r);console.log(this.#t,s,n),this.#Y=this.handlePointerMove.bind(this),document.addEventListener("pointermove",this.#Y),this.#X=this.handlePointerUp.bind(this),document.addEventListener("pointerup",this.#X)}#U=!1;handlePointerUpGlobal(){this.#U&&(this.handlePointerUp({clientX:100,clientY:100}),this.cleanupPointerGlobal())}cleanupPointerGlobal(){document.removeEventListener("pointermove",this.#Y),document.removeEventListener("pointerup",this.#X)}handlePointerUp(t){const e=this.$canvas.getBoundingClientRect(),i=this.size+this.gridSize;let s=Math.floor((t.clientX-e.left)/i),n=Math.floor((t.clientY-e.top)/i);if(s===this.#n&&n===this.#r&&1===this.#s){if(0===this.#t)this.#k(s,n,0),this.#u[this.#h][n][s]=0}else switch(this.#t){case 1:R(this.#n,this.#r,s,n).forEach((({x:t,y:e})=>{this.#k(t,e,1)}));break;case 2:A(this.#n,this.#r,s,n).forEach((({x:t,y:e})=>{this.#k(t,e,1)}));break;case 3:O(this.#n,this.#r,s,n).forEach((({x:t,y:e})=>{this.#k(t,e,1)}));break;case 4:case 5:$(this.#n,this.#r,s,n).forEach((({x:t,y:e})=>{this.#k(t,e,1)}))}this.#a=-1,this.#o=-1,this.#e=!1,this.cleanupPointerGlobal()}handlePointerMove(t){const e=this.$canvas;if(this.#e){this.#p=t.altKey,this.#c=t.ctrlKey,this.#d=t.shiftKey;this.#u;const s=e.getBoundingClientRect(),n=this.size+this.gridSize,r=[],a=this.#n,o=this.#r,h=this.#a,l=this.#o;if("function"==typeof t.getCoalescedEvents){const e=t.getCoalescedEvents();for(const t of e){let e=Math.floor((t.clientX-s.left)/n),i=Math.floor((t.clientY-s.top)/n);e===h&&i===l||r.push([e,i])}}else{let e=Math.floor((t.clientX-s.left)/n),i=Math.floor((t.clientY-s.top)/n);if(e===h&&i===l)return;r.push([e,i])}const c=32===t.buttons?0:1;if(0===r.length)return;const[d,p]=r.at(-1);switch(this.#a=d,this.#o=p,this.#t){case 0:for(var i of r)this.#k(i[0],i[1],c);break;case 1:this.#I(R(a,o,d,p),h,l);break;case 2:this.#I(A(a,o,d,p),h,l);break;case 3:this.#I(O(a,o,d,p),h,l);break;case 4:case 5:this.#I($(a,o,d,p),h,l)}}}handlePointerEnter(t){this.#e||this.#i||(this.#i=!0,this.#g.drawImage(this.#x,0,0),this.#g.drawImage(this.#i?this.#w:this.#L,0,0)),this.#U=!1}handlePointerLeave(t){this.#e?this.#i&&(this.#U=!0):(this.#i=!1,this.#g.drawImage(this.#x,0,0),this.#g.drawImage(this.#i?this.#w:this.#L,0,0))}#$(){this.#g.drawImage(this.#x,0,0),this.#g.drawImage(this.#L,0,0)}mergeColor(t,e){}clear(){const t=H(this.width,this.height);!function(t,e){const i=[],s=t[0].length,n=t.length,r=e[0].length,a=e.length,o=Math.max(s,r),h=Math.max(n,a);for(let s=0;s<h;s++)for(let n=0;n<o;n++){const r=e&&e[s]&&e[s][n],a=t&&t[s]&&t[s][n];r!==a&&i.push([n,s,a,r])}}(this.#u[this.#h],t);this.#y.push({type:T.Group,data:{name:"Clear"}}),this.#y.push({type:T.Pixel,data:{pixels:[],layer:this.#h}}),this.#u=[H(this.width,this.height)],this.#$()}reset(){this.#M=!0,this.#P()}clearHistory(){this.#y=[],this.#f=[]}applyTemplate(t){this.#u=[t],this.#H()}flipHorizontal(){const t=P(this.#u[this.#h]),e=t[0].length-1;I(this.#u[this.#h],((i,s)=>{t[s][i]=this.#u[this.#h][s][e-i]})),this.#u[this.#h]=t}flipVertical(){const t=P(this.#u[this.#h]),e=t.length-1;I(this.#u[this.#h],((i,s)=>{t[this.#h][s][i]=this.#u[e-s][i]})),this.#u[this.#h]=t}move(t,e){const i=H(this.width,this.height);for(let t=0;t<this.height;t++)i[t].fill(0);I(this.#u[this.#h],((s,n)=>{n-e<0||s-t<0||n-e>=this.height||s-t>=this.width||(i[n][s]=this.#u[this.#h][n-e][s-t])})),this.#u[this.#h]=i}invert(){this.#m.length>2||(I(this.#u[this.#h],((t,e)=>{this.#u[this.#h][e][t]=0===this.#u[this.#h][e][t]?1:0})),this.#H())}applyGuides(){const t=D(this.width,this.height,this.size,this.gridSize);this.#v.drawImage(t,0,0)}clearGuides(){}undo(){const t=this.#y.pop();if(t&&t.type===T.Pixel)this.#f.push(t),t.data.pixels.forEach((t=>{const[e,i]=t;this.#u[this.#h][i][e]=t[2]}))}redo(){}rotateClockwise(){this.#j(!1)}rotateCounterclockwise(){this.#j(!0)}#j(t=!1){const e=P(this.#u[this.#h]);if(t){const t=this.#u[0].map(((t,e)=>this.#u.map((t=>t[t.length-1-e]))));for(let i=0;i<this.height;i++)for(let s=0;s<this.width;s++)e[i][s]=t[this.#h][i][s]}else{const t=this.#u[0].map(((t,e)=>this.#u.map((t=>t[e])).reverse()));for(let i=0;i<this.height;i++)for(let s=0;s<this.width;s++)e[i][s]=t[this.#h][i][s]}this.#u[this.#h]=e}hasUndo(){return 0!==this.#y.length}hasRedo(){return 0!==this.#f.length}inputModePixel(){this.#t=0}inputModeLine(){this.#t=1}inputModeRectangle(){this.#t=2}inputModeRectangleOutline(){this.#t=3}inputModeEllipse(){this.#t=4}inputModeEllipseOutline(){this.#t=5}async save(t={}){const e={width:this.width,height:this.height,transparent:this.transparent,colors:this.#m,layers:this.#l,data:this.#u};!0===t.history&&(e.undo=this.#y,e.redo=this.#f);for(let t=0;t<e.data.length;t++)for(let i=e.data[t].length-1;i>=0;i--)if(i>=this.height)e.data[t].pop();else for(let s=e.data[t][i].length-1;s>=0;s--)s>=this.width&&e.data[t][i].pop();return e}async open(t){if("object"!=typeof t)return["json must be type object"];const e=[],i=Object.keys(t);["width","height","transparent","colors","layers","data"].forEach((t=>{i.includes(t)||e.push(`JSON key '${t}' required.`)})),this.width=t.width,this.height=t.height,this.transparent=t.transparent,this.#m=t.colors,this.#l=t.layers,this.#u=t.data,t.undo&&(this.#y=t.undo),t.redo&&(this.#f=t.redo),this.#P()}})})()})();
package/pgMenu.js CHANGED
@@ -1 +1 @@
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>"},219:(e,t,n)=>{n.d(t,{A:()=>E});var r=n(601),i=n.n(r),o=n(314),s=n.n(o),a=n(417),l=n.n(a),c=new URL(n(662),n.b),d=new URL(n(708),n.b),h=new URL(n(383),n.b),u=new URL(n(544),n.b),p=new URL(n(570),n.b),m=new URL(n(209),n.b),f=s()(i()),b=l()(c),g=l()(d),v=l()(h),y=l()(u),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(${b}));\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(${g}));\n }\n\n [part=label].checked:disabled::before {\n content: var(--pg-menu-item-disabled-check, url(${v}));\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\n[part=label].more::after {\n position: absolute;\n translate: -0.5rem 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 k=new CSSStyleSheet;k.replaceSync(f.toString());const E=k},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var 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!==o&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),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)),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>"},553:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),i=n.n(r),o=n(314),s=n.n(o)()(i());s.push([e.id,":host {\n display: contents;\n}\n\n[part=items] {\n display: flex;\n flex-direction: column;\n padding: var(--pg-menu-padding, 0.25rem);\n border-width: var(--pg-menu-border-width, 1px);\n border-color: var(--pg-menu-border-color, #453C4F);\n border-style: solid;\n border-radius: 0.5rem;\n background-color: var(--pg-menu-background-color, #FFFFFF);\n box-shadow: var(--pg-menu-box-shadow, none);\n}\n\n[part=items].check {\n --pg-menu-_has-check: true;\n}",""]);var a=new CSSStyleSheet;a.replaceSync(s.toString());const l=a},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 i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,exports:{}};return e[r](o,o.exports,n),o.exports}n.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"),i=Symbol("removeObserver"),o=Symbol("getObservers"),s=Symbol("isProxy"),a=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function d(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case s:return!0;case a:return t;case o:return c.has(e);case r:return(t,n)=>{c.has(e)?c.get(e).has(t)?c.get(e).get(t).push(n):c.get(e).set(t,[n]):c.set(e,new Map([[t,[n]]]))};case i:return t=>{c.has(e)&&(c.get(e).delete(t),0===c.get(e).size&&c.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,n)}throw new Error("Unsupported symbol")}if(n in t){if(!Number.isNaN(Number(n)))return"object"==typeof t[n]?d(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return c.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return d(t[n])}return Reflect.get(t,n)},set(e,t,n){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,n);if(c.has(e)){c.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=c;const h="fill",u="pop",p="push",m="reverse",f="shift",b="sort",g="splice",v="unshift";class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const y=Symbol("init"),w=Symbol("template"),x=Symbol("style"),k=Symbol("parent");function E(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function S(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function L(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,i;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[k]||t.prototype[k][t.prototype[k].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[k]=[t.prototype],t.prototype[x]=e.style?[e.style]:[],t.prototype[w]=e.template||""):(t.prototype[k].push(t.prototype),t.prototype[x].push(e.style),t.prototype[w]=(r=t.prototype[w],(i=e.template||null)&&i.match(/<parent\/>/)?i.replace(/<parent\/>/,r):`${r}${i||""}`));const o=t.prototype.connectedCallback||(()=>{}),s=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[y]||void 0!==e.template||void 0!==e.style)if(this[y]){if(this[y]&&e.style);else if(this[y]&&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[w]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[x].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),r.appendChild(n)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&n.add(e.localName);const r=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),i=()=>{this[k].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[S(t)]=!0,e)),{}):{})}))};0===r.length?(this[y]=!0,o.call(this),i()):Promise.all(r).then((()=>{this[y]=!0,o.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));i()}))},t.prototype.disconnectedCallback=function(){s.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[S(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 $(e){return!!e&&e.constructor===Array}function C(e,t){e[y]&&e[k].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function P(e){return null===e?"null":$(e)?"array":typeof e}function O(e){return function(t,n){const r=n.name,i=Symbol(r),l=Symbol(`${r}:type`),c=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[l]||"array"===this[l]?this[i][s]?this[i]:d(this[i]):this[i],set:t=>{const n=P(e?e(t):t);if("index"!==r&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!$(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[i]===t)throw new Error("Setting an array to itself is not allowed.");const e=d(this[i]);if(e[o]){const n=t[s]?(c=t)[s]&&c[a]:t;e.splice(0,this[i].length,...n)}else this[i]=t}else this[i]=e?e(t):t,C(this,r);var c}})})),function(t){if(void 0===t&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==t&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=E(r);t[r]||(e.observedAttributes.push(n),t[r]=i)}return this[l]=P(t),"array"===this[l]?(this[i]=t,new Proxy(t,{get:(e,t)=>t===R?this[c]:(console.log("errr???"),Reflect.get(this[i],t)),set:(e,t,n)=>{if(t===R)return this[c]=n,!0;const o=Reflect.set(e,t,n);return"length"===t&&this[i].length===n||C(this,r),this[i]=n,o}})):(this[i]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[i])}}}function A(){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 R=Symbol("meta");function j({container:e,items:t,type:n,create:i,connect:o,disconnect:s,update:a}){function l(e,o){const s=n(e),a=document.createElement(E(s.name),s),l=s.observedAttributes??[],c=function(e,t){const n=new Set(e);return t.filter((e=>n.has(e)))}(Object.keys(e),l);return l.includes("index")&&(a.index=o),-1!==c.indexOf("index")&&c.splice(c.indexOf("index"),1),c.forEach((t=>{a[t]=e[t]})),i&&i(a,d(e)),t[o][r](a,((e,t)=>{a[e]=t})),a}t.forEach(((t,n)=>{const r=l(t,n);e.appendChild(r),o&&o(r,d(t))})),t[r](e,((n,r,i)=>{switch(r){case h:const[n,r,a]=i;for(let i=r||0;i<(a||t.length);i++)Object.keys(n).forEach((t=>{e.children[i][t]=n[t]}));break;case u:const c=e.children.length;c>0&&e.children[c-1].remove();break;case p:const y=e.children.length;[...i].forEach(((t,n)=>{const r=l(t,y+n);e.appendChild(r),o&&o(r,d(t))}));break;case m:for(var s=1;s<e.children.length;s++)e.insertBefore(e.children[s],e.children[0]);break;case f:e.children.length&&e.children[0].remove();for(let t=0;t<e.children.length;t++)e.children[t].index=t;break;case b:throw new Error("ToDo... write sort.");case g:const[w,x,...k]=i;if(x>0)for(let t=w;t<x+w;t++)e.children[t].remove();let E=k.length||0;if(E>0){const t=k.map(((e,t)=>l(e,w+t)));0===w?e.prepend(...t):e.children[w-1].after(...t);for(let t=w-x+E;t<e.children.length;t++)e.children[t].index=t;t.forEach((e=>{o&&o(e,k[s])}))}else for(let t=w;t<e.children.length;t++)e.children[t].index=t;break;case v:const S=e.children.length&&e.children[0],L=[...i].length;[...i].forEach(((t,n)=>{S?S.before(l(t,n)):e.appendChild(l(t,n))}));for(let t=L;t<e.children.length;t++)e.children[t].index=t}}))}var F=n(219),T=function(e,t,n,r,i,o){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,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!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(u)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(e||null))};var b=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],m);if("accessor"===l){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(a=s(b.get))&&(h.get=a),(a=s(b.set))&&(h.set=a),(a=s(b.init))&&i.unshift(a)}else(a=s(b))&&("field"===l?i.unshift(a):h[c]=a)}d&&Object.defineProperty(d,r.name,h),u=!0},M=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0};const z=(()=>{let e,t,n,r,i,o,s,a,l=[L({selector:"pg-menu-item",style:F.A,template:'<button part="label"></button>'})],c=[],d=HTMLElement,h=[],u=[],p=[],m=[],f=[],b=[],g=[],v=[],y=[],w=[],x=[],k=[];(class extends d{static{t=this}static{const E="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[O()],r=[O()],i=[O()],o=[O()],s=[O()],a=[A()],T(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:E},h,u),T(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:E},p,m),T(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:E},f,b),T(null,null,o,{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:E},g,v),T(null,null,s,{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:E},y,w),T(null,null,a,{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:E},x,k),T(null,e={value:t},l,{kind:"class",name:t.name,metadata:E},null,c),t=e.value,E&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:E})}static delegatesFocus=!0;index=M(this,h,void 0);label=(M(this,u),M(this,p,""));checked=(M(this,m),M(this,f,!1));disabled=(M(this,b),M(this,g,!1));items=(M(this,v),M(this,y,[]));$label=(M(this,w),M(this,x,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}))}connectedCallback(){this.$label.addEventListener("click",(()=>{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),M(this,k)}static{M(t,c)}});return t})();var I=n(553),U=function(e,t,n,r,i,o){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,h=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!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(u)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(e||null))};var b=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],m);if("accessor"===l){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(a=s(b.get))&&(h.get=a),(a=s(b.set))&&(h.set=a),(a=s(b.init))&&i.unshift(a)}else(a=s(b))&&("field"===l?i.unshift(a):h[c]=a)}d&&Object.defineProperty(d,r.name,h),u=!0},D=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0};(()=>{let e,t,n,r,i=[L({selector:"pg-menu",style:I.A,template:'<div part="items"></div>'})],o=[],s=HTMLElement,a=[],l=[],c=[],d=[];(class extends s{static{t=this}static{const h="function"==typeof Symbol&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;n=[O()],r=[A()],U(null,null,n,{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:h},a,l),U(null,null,r,{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:h},c,d),U(null,e={value:t},i,{kind:"class",name:t.name,metadata:h},null,o),t=e.value,h&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:h}),D(t,o)}items=D(this,a,[]);$items=(D(this,l),D(this,c,void 0));connectedCallback(){j({container:this.$items,items:this.items,type:e=>e.type??z,create:(e,t)=>{e.addEventListener("close",(e=>{const{depth:t}=e.detail;this.dispatchEvent(new CustomEvent("close",{detail:{depth:t}}))})),e.addEventListener("select",(e=>{const{index:n}=e.detail;this.dispatchEvent(new CustomEvent("select",{detail:{indexes:[n],item:t}}))})),e.addEventListener("up",(e=>{const{index:t}=e.detail;this.#e(t-1,-1,t)})),e.addEventListener("down",(e=>{const{index:t}=e.detail;this.#e(t+1,1,t)}))}}),this.$items.addEventListener("hasCheck",(e=>{e.stopPropagation(),this.$items.classList.toggle("check",!0)}))}#e(e,t,n){if(e===n)return;if(-1===e)return this.#e(this.items.length-1,t,n);if(e>=this.items.length)return this.#e(0,t,n);const r=this.$items.children[e];if(!1===r.focusable||this.items[e].disabled)return this.#e(e+t,t,n);r?.focus()}focus(e){if(-1===e)this.#e(0,1,this.items.length-1);else{const t=this.$items.children[e];t?.focus()}}getItemOffset(e,t){const n=getComputedStyle(this.$items);let r=parseInt(n.getPropertyValue("padding-top"),10);const i=this.items.length;if(e>i||t>i)throw new Error("startIndex or endIndex not within range of items");for(let n=e;n<t;n++){r+=this.$items.children[n].getHeight()}return r}getItemHeight(e){if(e>this.items.length)throw new Error("index outside range of items");return this.$items.children[e].getHeight()}constructor(){super(...arguments),D(this,d)}})})()})();
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),i=n.n(r),s=n(314),a=n.n(s)()(i());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 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 min-width: 10rem;\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 o=new CSSStyleSheet;o.replaceSync(a.toString());const l=o},219:(e,t,n)=>{n.d(t,{A:()=>E});var r=n(601),i=n.n(r),s=n(314),a=n.n(s),o=n(417),l=n.n(o),c=new URL(n(662),n.b),d=new URL(n(708),n.b),h=new URL(n(383),n.b),u=new URL(n(544),n.b),p=new URL(n(570),n.b),m=new URL(n(209),n.b),f=a()(i()),g=l()(c),v=l()(d),b=l()(h),y=l()(u),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\n[part=label].more::after {\n position: absolute;\n translate: -2.5rem 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 k=new CSSStyleSheet;k.replaceSync(f.toString());const E=k},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var o=0;o<this.length;o++){var l=this[o][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&a[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)),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>"},553:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),i=n.n(r),s=n(314),a=n.n(s)()(i());a.push([e.id,":host {\n display: contents;\n}\n\n[part=items] {\n display: flex;\n flex-direction: column;\n padding: var(--pg-menu-padding, 0.25rem);\n border-width: var(--pg-menu-border-width, 1px);\n border-color: var(--pg-menu-border-color, #453C4F);\n border-style: solid;\n border-radius: 0.5rem;\n background-color: var(--pg-menu-background-color, #FFFFFF);\n box-shadow: var(--pg-menu-box-shadow, none);\n}\n\n[part=items].check {\n --pg-menu-_has-check: true;\n}",""]);var o=new CSSStyleSheet;o.replaceSync(a.toString());const l=o},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 i=t[r];if(void 0!==i)return i.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"),i=Symbol("removeObserver"),s=Symbol("getObservers"),a=Symbol("isProxy"),o=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function d(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case a:return!0;case o:return t;case s:return c.has(e);case r:return(t,n)=>{c.has(e)?c.get(e).has(t)?c.get(e).get(t).push(n):c.get(e).set(t,[n]):c.set(e,new Map([[t,[n]]]))};case i:return t=>{c.has(e)&&(c.get(e).delete(t),0===c.get(e).size&&c.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,n)}throw new Error("Unsupported symbol")}if(n in t){if(!Number.isNaN(Number(n)))return"object"==typeof t[n]?d(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return c.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return d(t[n])}return Reflect.get(t,n)},set(e,t,n){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,n);if(c.has(e)){c.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=c;const h="fill",u="pop",p="push",m="reverse",f="shift",g="sort",v="splice",b="unshift";class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const y=Symbol("init"),w=Symbol("template"),x=Symbol("style"),k=Symbol("parent");function E(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function S(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function $(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,i;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[k]||t.prototype[k][t.prototype[k].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[k]=[t.prototype],t.prototype[x]=e.style?[e.style]:[],t.prototype[w]=e.template||""):(t.prototype[k].push(t.prototype),t.prototype[x].push(e.style),t.prototype[w]=(r=t.prototype[w],(i=e.template||null)&&i.match(/<parent\/>/)?i.replace(/<parent\/>/,r):`${r}${i||""}`));const s=t.prototype.connectedCallback||(()=>{}),a=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[y]||void 0!==e.template||void 0!==e.style)if(this[y]){if(this[y]&&e.style);else if(this[y]&&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[w]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[x].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),r.appendChild(n)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&n.add(e.localName);const r=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),i=()=>{this[k].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[S(t)]=!0,e)),{}):{})}))};0===r.length?(this[y]=!0,s.call(this),i()):Promise.all(r).then((()=>{this[y]=!0,s.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));i()}))},t.prototype.disconnectedCallback=function(){a.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[S(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 L(e){return!!e&&e.constructor===Array}function C(e,t){e[y]&&e[k].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function O(e){return null===e?"null":L(e)?"array":typeof e}function P(e){return function(t,n){const r=n.name,i=Symbol(r),l=Symbol(`${r}:type`),c=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[l]||"array"===this[l]?this[i][a]?this[i]:d(this[i]):this[i],set:t=>{const n=O(e?e(t):t);if("index"!==r&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!L(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[i]===t)throw new Error("Setting an array to itself is not allowed.");const e=d(this[i]);if(e[s]){const n=t[a]?(c=t)[a]&&c[o]:t;e.splice(0,this[i].length,...n)}else this[i]=t}else this[i]=e?e(t):t,C(this,r);var c}})})),function(t){if(void 0===t&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==t&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=E(r);t[r]||(e.observedAttributes.push(n),t[r]=i)}return this[l]=O(t),"array"===this[l]?(this[i]=t,new Proxy(t,{get:(e,t)=>t===A?this[c]:(console.log("errr???"),Reflect.get(this[i],t)),set:(e,t,n)=>{if(t===A)return this[c]=n,!0;const s=Reflect.set(e,t,n);return"length"===t&&this[i].length===n||C(this,r),this[i]=n,s}})):(this[i]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[i])}}}function j(){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 A=Symbol("meta");function R({container:e,items:t,type:n,create:i,connect:s,disconnect:a,update:o}){function l(e,s){const a=n(e),o=document.createElement(E(a.name),a),l=a.observedAttributes??[],c=function(e,t){const n=new Set(e);return t.filter((e=>n.has(e)))}(Object.keys(e),l);return l.includes("index")&&(o.index=s),-1!==c.indexOf("index")&&c.splice(c.indexOf("index"),1),c.forEach((t=>{o[t]=e[t]})),i&&i(o,d(e)),t[s][r](o,((e,t)=>{o[e]=t})),o}t.forEach(((t,n)=>{const r=l(t,n);e.appendChild(r),s&&s(r,d(t))})),t[r](e,((n,r,i)=>{switch(r){case h:const[n,r,o]=i;for(let i=r||0;i<(o||t.length);i++)Object.keys(n).forEach((t=>{e.children[i][t]=n[t]}));break;case u:const c=e.children.length;c>0&&e.children[c-1].remove();break;case p:const y=e.children.length;[...i].forEach(((t,n)=>{const r=l(t,y+n);e.appendChild(r),s&&s(r,d(t))}));break;case m:for(var a=1;a<e.children.length;a++)e.insertBefore(e.children[a],e.children[0]);break;case f:e.children.length&&e.children[0].remove();for(let t=0;t<e.children.length;t++)e.children[t].index=t;break;case g:throw new Error("ToDo... write sort.");case v:const[w,x,...k]=i;if(x>0)for(let t=w;t<x+w;t++)e.children[t].remove();let E=k.length||0;if(E>0){const t=k.map(((e,t)=>l(e,w+t)));0===w?e.prepend(...t):e.children[w-1].after(...t);for(let t=w-x+E;t<e.children.length;t++)e.children[t].index=t;t.forEach((e=>{s&&s(e,k[a])}))}else for(let t=w;t<e.children.length;t++)e.children[t].index=t;break;case b:const S=e.children.length&&e.children[0],$=[...i].length;[...i].forEach(((t,n)=>{S?S.before(l(t,n)):e.appendChild(l(t,n))}));for(let t=$;t<e.children.length;t++)e.children[t].index=t}}))}var T=function(e,t,n,r,i,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,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):{}),u=!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(u)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var g=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(o=a(g.get))&&(h.get=o),(o=a(g.set))&&(h.set=o),(o=a(g.init))&&i.unshift(o)}else(o=a(g))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},F=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0};const z=new Set,M=new Map;const D=(()=>{let e,t,n=[$()],r=[],i=HTMLElement;(class extends i{static{t=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;T(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}),F(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),z.add(t),new Promise((e=>{M.set(t,e)}))}close(e){this.remove(),z.delete(this);const t=M.get(this);t&&t(e),M.delete(this)}});return t})();var I=n(217),U=function(e,t,n,r,i,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,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):{}),u=!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(u)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var g=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(o=a(g.get))&&(h.get=o),(o=a(g.set))&&(h.set=o),(o=a(g.init))&&i.unshift(o)}else(o=a(g))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},_=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0};const B=[],H=[];const Z=(()=>{let e,t,n,r,i,s,a,o,l,c,d=[$({selector:"pg-overlay-sub-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:I.A})],h=[],u=D,p=[],m=[],f=[],g=[],v=[],b=[],y=[],w=[],x=[],k=[],E=[],S=[],L=[],C=[],O=[],A=[];(class extends u{static{t=this}static{const $="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;n=[j()],r=[j()],i=[P()],s=[P()],a=[P()],o=[P()],l=[P()],c=[P()],U(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:$},p,m),U(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:$},f,g),U(null,null,i,{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:$},v,b),U(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),U(null,null,a,{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:$},x,k),U(null,null,o,{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:$},E,S),U(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:$},L,C),U(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:$},O,A),U(null,e={value:t},d,{kind:"class",name:t.name,metadata:$},null,h),t=e.value,$&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:$}),_(t,h)}$overlay=_(this,p,void 0);$menu=(_(this,m),_(this,f,void 0));source=(_(this,g),_(this,v,null));x=(_(this,b),_(this,y,0));y=(_(this,w),_(this,x,0));default=(_(this,k),_(this,E,null));items=(_(this,S),_(this,L,[]));value=(_(this,C),_(this,O,null));render(e){e.items&&(this.$menu.items=this.items)}connectedCallback(){B.pop()?.close(),B.push(this),H.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.#i.bind(this),document.addEventListener("pointerdown",this.#r)}#s=(_(this,A),!1);#r;#i(e){this.#s=e.composedPath().includes(this.source)}#n(e){"closed"===e.newState&&0===H.length&&this.#s&&(console.log(e),this.source?.focus())}disconnectedCallback(){H.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 N=n(219),q=function(e,t,n,r,i,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,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):{}),u=!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(u)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var g=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(o=a(g.get))&&(h.get=o),(o=a(g.set))&&(h.set=o),(o=a(g.init))&&i.unshift(o)}else(o=a(g))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},W=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0};const Q=(()=>{let e,t,n,r,i,s,a,o,l=[$({selector:"pg-menu-item",style:N.A,template:'<button part="label"></button>'})],c=[],d=HTMLElement,h=[],u=[],p=[],m=[],f=[],g=[],v=[],b=[],y=[],w=[],x=[],k=[];(class extends d{static{t=this}static{const E="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[P()],r=[P()],i=[P()],s=[P()],a=[P()],o=[j()],q(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:E},h,u),q(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:E},p,m),q(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:E},f,g),q(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:E},v,b),q(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:E},y,w),q(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:E},x,k),q(null,e={value:t},l,{kind:"class",name:t.name,metadata:E},null,c),t=e.value,E&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:E})}static delegatesFocus=!0;index=W(this,h,void 0);label=(W(this,u),W(this,p,""));checked=(W(this,m),W(this,f,!1));disabled=(W(this,g),W(this,v,!1));items=(W(this,b),W(this,y,[]));$label=(W(this,w),W(this,x,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 Z.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),W(this,k)}static{W(t,c)}});return t})();var V=n(553),Y=function(e,t,n,r,i,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,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):{}),u=!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(u)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var g=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],m);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(o=a(g.get))&&(h.get=o),(o=a(g.set))&&(h.set=o),(o=a(g.init))&&i.unshift(o)}else(o=a(g))&&("field"===l?i.unshift(o):h[c]=o)}d&&Object.defineProperty(d,r.name,h),u=!0},G=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0};(()=>{let e,t,n,r,i=[$({selector:"pg-menu",style:V.A,template:'<div part="items"></div>'})],s=[],a=HTMLElement,o=[],l=[],c=[],d=[];(class extends a{static{t=this}static{const h="function"==typeof Symbol&&Symbol.metadata?Object.create(a[Symbol.metadata]??null):void 0;n=[P()],r=[j()],Y(null,null,n,{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:h},o,l),Y(null,null,r,{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:h},c,d),Y(null,e={value:t},i,{kind:"class",name:t.name,metadata:h},null,s),t=e.value,h&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:h}),G(t,s)}items=G(this,o,[]);$items=(G(this,l),G(this,c,void 0));connectedCallback(){R({container:this.$items,items:this.items,type:e=>e.type??Q,create:(e,t)=>{e.addEventListener("close",(e=>{const{depth:t}=e.detail;this.dispatchEvent(new CustomEvent("close",{detail:{depth:t}}))})),e.addEventListener("select",(e=>{const{index:n}=e.detail;this.dispatchEvent(new CustomEvent("select",{detail:{indexes:[n],item:t}}))})),e.addEventListener("up",(e=>{const{index:t}=e.detail;this.#a(t-1,-1,t)})),e.addEventListener("down",(e=>{const{index:t}=e.detail;this.#a(t+1,1,t)}))}}),this.$items.addEventListener("hasCheck",(e=>{e.stopPropagation(),this.$items.classList.toggle("check",!0)}))}#a(e,t,n){if(e===n)return;if(-1===e)return this.#a(this.items.length-1,t,n);if(e>=this.items.length)return this.#a(0,t,n);const r=this.$items.children[e];if(!1===r.focusable||this.items[e].disabled)return this.#a(e+t,t,n);r?.focus()}focus(e){if(-1===e)this.#a(0,1,this.items.length-1);else{const t=this.$items.children[e];t?.focus()}}getItemOffset(e,t){const n=getComputedStyle(this.$items);let r=parseInt(n.getPropertyValue("padding-top"),10);const i=this.items.length;if(e>i||t>i)throw new Error("startIndex or endIndex not within range of items");for(let n=e;n<t;n++){r+=this.$items.children[n].getHeight()}return r}getItemHeight(e){if(e>this.items.length)throw new Error("index outside range of items");return this.$items.children[e].getHeight()}constructor(){super(...arguments),G(this,d)}})})()})();
package/pgMenuItem.js CHANGED
@@ -1 +1 @@
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>"},219:(e,t,n)=>{n.d(t,{A:()=>k});var r=n(601),o=n.n(r),a=n(314),i=n.n(a),s=n(417),l=n.n(s),c=new URL(n(662),n.b),d=new URL(n(708),n.b),p=new URL(n(383),n.b),u=new URL(n(544),n.b),h=new URL(n(570),n.b),m=new URL(n(209),n.b),b=i()(o()),f=l()(c),g=l()(d),v=l()(p),y=l()(u),w=l()(h),x=l()(m);b.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(${f}));\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(${g}));\n }\n\n [part=label].checked:disabled::before {\n content: var(--pg-menu-item-disabled-check, url(${v}));\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\n[part=label].more::after {\n position: absolute;\n translate: -0.5rem 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(b.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,o,a){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&i[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}},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 a=t[r]={id:r,exports:{}};return e[r](a,a.exports,n),a.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"),a=Symbol("getObservers"),i=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function d(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case i:return!0;case s:return t;case a:return c.has(e);case r:return(t,n)=>{c.has(e)?c.get(e).has(t)?c.get(e).get(t).push(n):c.get(e).set(t,[n]):c.set(e,new Map([[t,[n]]]))};case o:return t=>{c.has(e)&&(c.get(e).delete(t),0===c.get(e).size&&c.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,n)}throw new Error("Unsupported symbol")}if(n in t){if(!Number.isNaN(Number(n)))return"object"==typeof t[n]?d(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return c.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return d(t[n])}return Reflect.get(t,n)},set(e,t,n){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,n);if(c.has(e)){c.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=c;class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const p=Symbol("init"),u=Symbol("template"),h=Symbol("style"),m=Symbol("parent");function b(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function f(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function g(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,o;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[m]||t.prototype[m][t.prototype[m].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[m]=[t.prototype],t.prototype[h]=e.style?[e.style]:[],t.prototype[u]=e.template||""):(t.prototype[m].push(t.prototype),t.prototype[h].push(e.style),t.prototype[u]=(r=t.prototype[u],(o=e.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,r):`${r}${o||""}`));const a=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[u]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[h].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),r.appendChild(n)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&n.add(e.localName);const r=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),o=()=>{this[m].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[f(t)]=!0,e)),{}):{})}))};0===r.length?(this[p]=!0,a.call(this),o()):Promise.all(r).then((()=>{this[p]=!0,a.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));o()}))},t.prototype.disconnectedCallback=function(){i.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[f(e)]=n},n.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${n.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function v(e){return!!e&&e.constructor===Array}function y(e,t){e[p]&&e[m].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function w(e){return null===e?"null":v(e)?"array":typeof e}function x(e){return function(t,n){const r=n.name,o=Symbol(r),l=Symbol(`${r}:type`),c=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[l]||"array"===this[l]?this[o][i]?this[o]:d(this[o]):this[o],set:t=>{const n=w(e?e(t):t);if("index"!==r&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!v(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=d(this[o]);if(e[a]){const n=t[i]?(c=t)[i]&&c[s]:t;e.splice(0,this[o].length,...n)}else this[o]=t}else this[o]=e?e(t):t,y(this,r);var c}})})),function(t){if(void 0===t&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==t&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=b(r);t[r]||(e.observedAttributes.push(n),t[r]=o)}return this[l]=w(t),"array"===this[l]?(this[o]=t,new Proxy(t,{get:(e,t)=>t===S?this[c]:(console.log("errr???"),Reflect.get(this[o],t)),set:(e,t,n)=>{if(t===S)return this[c]=n,!0;const a=Reflect.set(e,t,n);return"length"===t&&this[o].length===n||y(this,r),this[o]=n,a}})):(this[o]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[o])}}}Symbol("hasProxy");const S=Symbol("meta");var k=n(219),L=function(e,t,n,r,o,a){function i(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?r.static?e:e.prototype:null,p=t||(d?Object.getOwnPropertyDescriptor(d,r.name):{}),u=!1,h=n.length-1;h>=0;h--){var m={};for(var b in r)m[b]="access"===b?{}:r[b];for(var b in r.access)m.access[b]=r.access[b];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(e||null))};var f=(0,n[h])("accessor"===l?{get:p.get,set:p.set}:p[c],m);if("accessor"===l){if(void 0===f)continue;if(null===f||"object"!=typeof f)throw new TypeError("Object expected");(s=i(f.get))&&(p.get=s),(s=i(f.set))&&(p.set=s),(s=i(f.init))&&o.unshift(s)}else(s=i(f))&&("field"===l?o.unshift(s):p[c]=s)}d&&Object.defineProperty(d,r.name,p),u=!0},E=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,i,s,l=[g({selector:"pg-menu-item",style:k.A,template:'<button part="label"></button>'})],c=[],d=HTMLElement,p=[],u=[],h=[],m=[],b=[],f=[],v=[],y=[],w=[],S=[],$=[],C=[];(class extends d{static{t=this}static{const g="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[x()],r=[x()],o=[x()],a=[x()],i=[x()],s=[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}]`))}})}))}],L(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:g},p,u),L(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:g},h,m),L(null,null,o,{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:g},b,f),L(null,null,a,{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:g},v,y),L(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:g},w,S),L(null,null,s,{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:g},$,C),L(null,e={value:t},l,{kind:"class",name:t.name,metadata:g},null,c),t=e.value,g&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g})}static delegatesFocus=!0;index=E(this,p,void 0);label=(E(this,u),E(this,h,""));checked=(E(this,m),E(this,b,!1));disabled=(E(this,f),E(this,v,!1));items=(E(this,y),E(this,w,[]));$label=(E(this,S),E(this,$,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}))}connectedCallback(){this.$label.addEventListener("click",(()=>{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),E(this,C)}static{E(t,c)}})})()})();
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),o=n(314),s=n.n(o)()(a());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 min-width: 10rem;\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(s.toString());const l=i},219:(e,t,n)=>{n.d(t,{A:()=>k});var r=n(601),a=n.n(r),o=n(314),s=n.n(o),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=s()(a()),v=l()(c),g=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(${v}));\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(${g}));\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\n[part=label].more::after {\n position: absolute;\n translate: -2.5rem 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,o){"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!==o&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),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 o=t[r]={id:r,exports:{}};return e[r](o,o.exports,n),o.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"),o=Symbol("getObservers"),s=Symbol("isProxy"),i=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function d(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case s:return!0;case i:return t;case o:return c.has(e);case r:return(t,n)=>{c.has(e)?c.get(e).has(t)?c.get(e).get(t).push(n):c.get(e).set(t,[n]):c.set(e,new Map([[t,[n]]]))};case a:return t=>{c.has(e)&&(c.get(e).delete(t),0===c.get(e).size&&c.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,n)}throw new Error("Unsupported symbol")}if(n in t){if(!Number.isNaN(Number(n)))return"object"==typeof t[n]?d(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return c.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return d(t[n])}return Reflect.get(t,n)},set(e,t,n){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,n);if(c.has(e)){c.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=c;class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const u=Symbol("init"),h=Symbol("template"),p=Symbol("style"),m=Symbol("parent");function f(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function v(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function g(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,a;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[m]||t.prototype[m][t.prototype[m].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[m]=[t.prototype],t.prototype[p]=e.style?[e.style]:[],t.prototype[h]=e.template||""):(t.prototype[m].push(t.prototype),t.prototype[p].push(e.style),t.prototype[h]=(r=t.prototype[h],(a=e.template||null)&&a.match(/<parent\/>/)?a.replace(/<parent\/>/,r):`${r}${a||""}`));const o=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[h]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[p].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[m].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[v(t)]=!0,e)),{}):{})}))};0===r.length?(this[u]=!0,o.call(this),a()):Promise.all(r).then((()=>{this[u]=!0,o.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));a()}))},t.prototype.disconnectedCallback=function(){s.call(this)},t.prototype.attributeChangedCallback=function(e,t,n){this[v(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 b(e){return!!e&&e.constructor===Array}function y(e,t){e[u]&&e[m].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function w(e){return null===e?"null":b(e)?"array":typeof e}function x(e){return function(t,n){const r=n.name,a=Symbol(r),l=Symbol(`${r}:type`),c=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[l]||"array"===this[l]?this[a][s]?this[a]:d(this[a]):this[a],set:t=>{const n=w(e?e(t):t);if("index"!==r&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!b(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=d(this[a]);if(e[o]){const n=t[s]?(c=t)[s]&&c[i]:t;e.splice(0,this[a].length,...n)}else this[a]=t}else this[a]=e?e(t):t,y(this,r);var c}})})),function(t){if(void 0===t&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==t&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=f(r);t[r]||(e.observedAttributes.push(n),t[r]=a)}return this[l]=w(t),"array"===this[l]?(this[a]=t,new Proxy(t,{get:(e,t)=>t===k?this[c]:(console.log("errr???"),Reflect.get(this[a],t)),set:(e,t,n)=>{if(t===k)return this[c]=n,!0;const o=Reflect.set(e,t,n);return"length"===t&&this[a].length===n||y(this,r),this[a]=n,o}})):(this[a]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[a])}}}function S(){return function(e,t){const n=t.name,r=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}Symbol("hasProxy");const k=Symbol("meta");var E=function(e,t,n,r,a,o){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,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");o.push(s(e||null))};var v=(0,n[p])("accessor"===l?{get:u.get,set:u.set}:u[c],m);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(i=s(v.get))&&(u.get=i),(i=s(v.set))&&(u.set=i),(i=s(v.init))&&a.unshift(i)}else(i=s(v))&&("field"===l?a.unshift(i):u[c]=i)}d&&Object.defineProperty(d,r.name,u),h=!0},L=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 $=new Set,C=new Map;const P=(()=>{let e,t,n=[g()],r=[],a=HTMLElement;(class extends a{static{t=this}static{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(a[Symbol.metadata]??null):void 0;E(null,e={value:t},n,{kind:"class",name:t.name,metadata:o},null,r),t=e.value,o&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o}),L(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),$.add(t),new Promise((e=>{C.set(t,e)}))}close(e){this.remove(),$.delete(this);const t=C.get(this);t&&t(e),C.delete(this)}});return t})();var O=n(217),j=function(e,t,n,r,a,o){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,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");o.push(s(e||null))};var v=(0,n[p])("accessor"===l?{get:u.get,set:u.set}:u[c],m);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(i=s(v.get))&&(u.get=i),(i=s(v.set))&&(u.set=i),(i=s(v.init))&&a.unshift(i)}else(i=s(v))&&("field"===l?a.unshift(i):u[c]=i)}d&&Object.defineProperty(d,r.name,u),h=!0},A=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 R=[],T=[];const z=(()=>{let e,t,n,r,a,o,s,i,l,c,d=[g({selector:"pg-overlay-sub-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:O.A})],u=[],h=P,p=[],m=[],f=[],v=[],b=[],y=[],w=[],k=[],E=[],L=[],$=[],C=[],z=[],M=[],D=[],F=[];(class extends h{static{t=this}static{const g="function"==typeof Symbol&&Symbol.metadata?Object.create(h[Symbol.metadata]??null):void 0;n=[S()],r=[S()],a=[x()],o=[x()],s=[x()],i=[x()],l=[x()],c=[x()],j(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:g},p,m),j(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:g},f,v),j(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:g},b,y),j(null,null,o,{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:g},w,k),j(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:g},E,L),j(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:g},$,C),j(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:g},z,M),j(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:g},D,F),j(null,e={value:t},d,{kind:"class",name:t.name,metadata:g},null,u),t=e.value,g&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g}),A(t,u)}$overlay=A(this,p,void 0);$menu=(A(this,m),A(this,f,void 0));source=(A(this,v),A(this,b,null));x=(A(this,y),A(this,w,0));y=(A(this,k),A(this,E,0));default=(A(this,L),A(this,$,null));items=(A(this,C),A(this,z,[]));value=(A(this,M),A(this,D,null));render(e){e.items&&(this.$menu.items=this.items)}connectedCallback(){R.pop()?.close(),R.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.#a.bind(this),document.addEventListener("pointerdown",this.#r)}#o=(A(this,F),!1);#r;#a(e){this.#o=e.composedPath().includes(this.source)}#n(e){"closed"===e.newState&&0===T.length&&this.#o&&(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 M=n(219),D=function(e,t,n,r,a,o){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,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");o.push(s(e||null))};var v=(0,n[p])("accessor"===l?{get:u.get,set:u.set}:u[c],m);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(i=s(v.get))&&(u.get=i),(i=s(v.set))&&(u.set=i),(i=s(v.init))&&a.unshift(i)}else(i=s(v))&&("field"===l?a.unshift(i):u[c]=i)}d&&Object.defineProperty(d,r.name,u),h=!0},F=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,o,s,i,l=[g({selector:"pg-menu-item",style:M.A,template:'<button part="label"></button>'})],c=[],d=HTMLElement,u=[],h=[],p=[],m=[],f=[],v=[],b=[],y=[],w=[],k=[],E=[],L=[];(class extends d{static{t=this}static{const g="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;n=[x()],r=[x()],a=[x()],o=[x()],s=[x()],i=[S()],D(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:g},u,h),D(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:g},p,m),D(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:g},f,v),D(null,null,o,{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:g},b,y),D(null,null,s,{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:g},w,k),D(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:g},E,L),D(null,e={value:t},l,{kind:"class",name:t.name,metadata:g},null,c),t=e.value,g&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g})}static delegatesFocus=!0;index=F(this,u,void 0);label=(F(this,h),F(this,p,""));checked=(F(this,m),F(this,f,!1));disabled=(F(this,v),F(this,b,!1));items=(F(this,y),F(this,w,[]));$label=(F(this,k),F(this,E,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 z.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),F(this,L)}static{F(t,c)}})})()})();