@pictogrammers/components 0.4.6 → 0.4.7

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.
Files changed (58) hide show
  1. package/package.json +1 -1
  2. package/pg/buttonMenu/README.md +5 -12
  3. package/pg/tree/README.md +11 -3
  4. package/pg/tree/__examples__/basic/basic.ts +3 -9
  5. package/pg/tree/tree.ts +12 -2
  6. package/pgAnnoy.js +1 -1
  7. package/pgApp.js +1 -1
  8. package/pgAvatar.js +1 -1
  9. package/pgButton.js +1 -1
  10. package/pgButtonGroup.js +1 -1
  11. package/pgButtonLink.js +1 -1
  12. package/pgButtonMenu.js +1 -1
  13. package/pgButtonToggle.js +1 -1
  14. package/pgCard.js +1 -1
  15. package/pgCardUser.js +1 -1
  16. package/pgColor.js +1 -1
  17. package/pgDatabase.js +1 -1
  18. package/pgDropdown.js +1 -1
  19. package/pgGrid.js +1 -1
  20. package/pgHeader.js +1 -1
  21. package/pgIcon.js +1 -1
  22. package/pgInputCheck.js +1 -1
  23. package/pgInputCheckList.js +1 -1
  24. package/pgInputFileLocal.js +1 -1
  25. package/pgInputHexRgb.js +1 -1
  26. package/pgInputPixelEditor.js +1 -1
  27. package/pgInputRange.js +1 -1
  28. package/pgInputSelect.js +1 -1
  29. package/pgInputText.js +1 -1
  30. package/pgInputTextIcon.js +1 -1
  31. package/pgInputUserSelect.js +1 -1
  32. package/pgListTag.js +1 -1
  33. package/pgMarkdown.js +1 -1
  34. package/pgMenu.js +1 -1
  35. package/pgMenuDivider.js +1 -1
  36. package/pgMenuIcon.js +1 -1
  37. package/pgMenuItem.js +1 -1
  38. package/pgMenuItemIcon.js +1 -1
  39. package/pgModalAlert.js +1 -1
  40. package/pgModification.js +1 -1
  41. package/pgNav.js +1 -1
  42. package/pgOverlay.js +1 -1
  43. package/pgOverlayContextMenu.js +1 -1
  44. package/pgOverlayMenu.js +1 -1
  45. package/pgOverlaySelectMenu.js +1 -1
  46. package/pgOverlaySubMenu.js +1 -1
  47. package/pgPicker.js +1 -1
  48. package/pgPreview.js +1 -1
  49. package/pgScroll.js +1 -1
  50. package/pgSearch.js +1 -1
  51. package/pgTab.js +1 -1
  52. package/pgTabs.js +1 -1
  53. package/pgToast.js +1 -1
  54. package/pgToasts.js +1 -1
  55. package/pgTooltip.js +1 -1
  56. package/pgTree.js +1 -1
  57. package/pgTreeButtonIcon.js +1 -1
  58. package/pgTreeItem.js +1 -1
@@ -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,r,n){"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!==n&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=n),i&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=i):c[2]=i),r&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=r):c[4]="".concat(r)),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),r=i.n(s),n=i(314),a=i.n(n)()(r());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 r=e[s];if(void 0!==r)return r.exports;var n=e[s]={id:s,exports:{}};return t[s](n,n.exports,i),n.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"),r=Symbol("removeObserver"),n=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 n: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 r: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,r;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],(r=t.template||null)&&r.match(/<parent\/>/)?r.replace(/<parent\/>/,s):`${s}${r||""}`));const n=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))),r=()=>{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,n.call(this),r()):Promise.all(s).then((()=>{this[d]=!0,n.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));r()}))},e.prototype.disconnectedCallback=function(){a.call(this)},e.prototype.attributeChangedCallback=function(t,e,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,r=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[r][a]?this[r]:c(this[r]):this[r],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[r]===e)throw new Error("Setting an array to itself is not allowed.");const t=c(this[r]);if(t[n]){const i=e[a]?(l=e)[a]&&l[o]:e;t.splice(0,this[r].length,...i)}else this[r]=e}else this[r]=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]=r)}return this[h]=w(e),"array"===this[h]?(this[r]=e,new Proxy(e,{get:(t,e)=>e===E?this[l]:(console.log("errr???"),Reflect.get(this[r],e)),set:(t,e,i)=>{if(e===E)return this[l]=i,!0;const n=Reflect.set(t,e,i);return"length"===e&&this[r].length===i||v(this,s),this[r]=i,n}})):(this[r]=t?t(this.getAttribute(s)??e):this.getAttribute(s)??e,this[r])}}}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 r=Math.abs(t-i),n=Math.abs(e-s),a=Math.min(t,i),o=Math.min(e,s),h=[];for(let t=0;t<n;t++)for(let e=0;e<r;e++)z(e,t,r,n)&&h.push({x:e+a,y:t+o});return h}(t,e,i+1,s+1)):function(t,e,i,s){const r=[];var n,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{r.push({x:i,y:e}),r.push({x:t,y:e}),r.push({x:t,y:s}),r.push({x:i,y:s}),(n=2*d)<=c&&(e++,s--,d+=c+=a),(n>=l||2*d>c)&&(t++,i--,d+=l+=h)}while(t<=i);for(;e-s<=o;)r.push({x:t-1,y:e}),r.push({x:i+1,y:e++}),r.push({x:t-1,y:s}),r.push({x:i+1,y:s--});return r}(t,e,i,s)}const k="#FFFFFF";function R(t,e,i,s){const r=[],n=Math.abs(i-t),a=Math.abs(s-e),o=t<i?1:-1,h=e<s?1:-1;let l=n-a;for(;r.push({x:t,y:e}),t!==i||e!==s;){var c=2*l;c>-a&&(l-=a,t+=o),c<n&&(l+=n,e+=h)}return r}function A(t,e,i,s){const r=[],n=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=n;c<n+o;c++)r.push({x:c,y:l});return r}function O(t,e,i,s){const r=[],n=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++)r.push({x:n,y:l}),r.push({x:n+o,y:l});for(var c=n+1;c<=n+o-1;c++)r.push({x:c,y:a}),r.push({x:c,y:a+h});return r}function I(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 H(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 j=[{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]]}],D=new Map;function T(t,e,i,s){const r=`${t}:${e}:${i}:${s}`;if(D.has(r))return D.get(r);let n=j.filter((i=>i.width===t&&i.height===e));0===n.length&&t%2==0&&e%2==0&&(n=[{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 n.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()})),D.set(r,l),l}var U,K=function(t,e,i,s,r,n){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");n.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))&&r.unshift(o)}else(o=a(g))&&("field"===h?r.unshift(o):d[l]=o)}c&&Object.defineProperty(c,s.name,d),p=!0},F=function(t,e,i){for(var s=arguments.length>2,r=0;r<e.length;r++)i=s?e[r].call(t,i):e[r].call(t);return s?i:void 0};function G([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"}(U||(U={}));(()=>{let t,e,i,s,r,n,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=[],j=[],D=[],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)],r=[b(L)],n=[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,r,{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,n,{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,j),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},D,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}),F(e,c)}width=F(this,p,10);height=(F(this,y),F(this,u,10));size=(F(this,f),F(this,g,10));gridSize=(F(this,x),F(this,v,1));transparent=(F(this,w),F(this,E,!1));placeholder=(F(this,M),F(this,z,""));$canvas=(F(this,j),F(this,D,void 0));#t=(F(this,N),0);#e=!1;#i=!1;#s=-1;#r=-1;#n=-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=[I(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 r=0;r<e;r++)if(0!==t[r][i][s]){this.#k(s,i,t[r][i][s]);break}}}}#R(){const t=this.#y.map((t=>function(t,e={}){let i,s,r,n=1,a=0,o=0;if(e.width){if(i=t,s=e.width,r=i.length/s,r%1!=0)throw new Error(`Invalid bitmask width. ${r} = ${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,r=t.length}e.scale&&(n=e.scale),e.offsetX&&(a=e.offsetX),e.offsetY&&(o=e.offsetY);const h=s+2,l=Array(h*(r+2)).fill(0);function c(t,e){return(e+1)*h+(t+1)}for(let t=0;t<r;++t)for(let e=0;e<s;++e)l[c(e,t)]=i[Y(e,t,s)];const d=s*(r+1),p=Array(d+(s+1)*r).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<r;++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*n},${t.y*n}`;for(var v=t.next;v!=t;v=v?.next)"H"==v?.type?x+=`H${v?.x*n+a}`:"V"==v?.type&&(x+=`V${v?.y*n+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=G(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=G(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()}#I(){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])}#H(t,e,i){const s=this.size+this.gridSize,r=this.width*s-this.gridSize,n=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,r,n),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),r=Math.floor((t.clientY-e.top)/i);if(s===this.#a&&r===this.#o)return;s>=this.width&&(s=this.width-1),r>=this.height&&(r=this.height-1),this.#e=!0,this.#s=this.#y[this.#h][r][s],this.#r=s,this.#n=r,this.#a=s,this.#o=r;const n=32===t.buttons?0:1;if(0===this.#t)this.#k(s,r,n);console.log(this.#t,s,r),this.#Y=this.handlePointerMove.bind(this),document.addEventListener("pointermove",this.#Y),this.#X=this.handlePointerUp.bind(this),document.addEventListener("pointerup",this.#X)}#j=!1;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),r=Math.floor((t.clientY-e.top)/i);if(s===this.#r&&r===this.#n&&1===this.#s){if(0===this.#t)this.#k(s,r,0),this.#y[this.#h][r][s]=0}else switch(this.#t){case 1:R(this.#r,this.#n,s,r).forEach((({x:t,y:e})=>{this.#k(t,e,1)}));break;case 2:A(this.#r,this.#n,s,r).forEach((({x:t,y:e})=>{this.#k(t,e,1)}));break;case 3:O(this.#r,this.#n,s,r).forEach((({x:t,y:e})=>{this.#k(t,e,1)}));break;case 4:case 5:$(this.#r,this.#n,s,r).forEach((({x:t,y:e})=>{this.#k(t,e,1)}))}this.#a=-1,this.#o=-1,this.#e=!1,this.cleanupPointerGlobal(),this.#j&&(this.#i=!1,this.#g.drawImage(this.#x,0,0),this.#g.drawImage(this.#i?this.#w:this.#L,0,0))}handlePointerMove(t){const e=this.$canvas;if(this.#e){this.#p=t.altKey,this.#c=t.ctrlKey,this.#d=t.shiftKey;this.#y;const s=e.getBoundingClientRect(),r=this.size+this.gridSize,n=[],a=this.#r,o=this.#n,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)/r),i=Math.floor((t.clientY-s.top)/r);e===h&&i===l||n.push([e,i])}}else{let e=Math.floor((t.clientX-s.left)/r),i=Math.floor((t.clientY-s.top)/r);if(e===h&&i===l)return;n.push([e,i])}const c=32===t.buttons?0:1;if(0===n.length)return;const[d,p]=n.at(-1);switch(this.#a=d,this.#o=p,this.#t){case 0:for(var i of n)this.#k(i[0],i[1],c);break;case 1:this.#H(R(a,o,d,p),h,l);break;case 2:this.#H(A(a,o,d,p),h,l);break;case 3:this.#H(O(a,o,d,p),h,l);break;case 4:case 5:this.#H($(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.#j=!1}handlePointerLeave(t){this.#e?this.#i&&(this.#j=!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=I(this.width,this.height);!function(t,e){const i=[],s=t[0].length,r=t.length,n=e[0].length,a=e.length,o=Math.max(s,n),h=Math.max(r,a);for(let s=0;s<h;s++)for(let r=0;r<o;r++){const n=e&&e[s]&&e[s][r],a=t&&t[s]&&t[s][r];n!==a&&i.push([r,s,a,n])}}(this.#y[this.#h],t);this.#u.push({type:U.Group,data:{name:"Clear"}}),this.#u.push({type:U.Pixel,data:{pixels:[],layer:this.#h}}),this.#y=[I(this.width,this.height)],this.#$()}reset(){this.#M=!0,this.#P()}clearHistory(){this.#u=[],this.#f=[]}applyTemplate(t){this.#y=[t],this.#I()}flipHorizontal(){const t=P(this.#y[this.#h]),e=t[0].length-1;H(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;H(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=I(this.width,this.height);for(let t=0;t<this.height;t++)i[t].fill(0);H(this.#y[this.#h],((s,r)=>{r-e<0||s-t<0||r-e>=this.height||s-t>=this.width||(i[r][s]=this.#y[this.#h][r-e][s-t])})),this.#y[this.#h]=i}invert(){this.#m.length>2||(H(this.#y[this.#h],((t,e)=>{this.#y[this.#h][e][t]=0===this.#y[this.#h][e][t]?1:0})),this.#I())}applyGuides(){const t=T(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===U.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.#D(!1)}rotateCounterclockwise(){this.#D(!0)}#D(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,r,n){"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!==n&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=n),i&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=i):c[2]=i),r&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=r):c[4]="".concat(r)),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),r=i.n(s),n=i(314),a=i.n(n)()(r());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 r=e[s];if(void 0!==r)return r.exports;var n=e[s]={id:s,exports:{}};return t[s](n,n.exports,i),n.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"),r=Symbol("removeObserver"),n=Symbol("getObservers"),a=Symbol("swapObserver"),o=Symbol("isProxy"),h=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function d(t){return new Proxy(t,{get(e,i){if("symbol"==typeof i){switch(i){case o:return!0;case h:return e;case n:return c.has(t);case a:return(e,i)=>{const s=c.get(t);s.forEach(((r,n)=>{if(n.getRootNode().host===e){const e=s.get(n);c.has(i)?c.get(i).has(n)?c.get(i).get(n).push(s.get(n)):c.get(i).set(n,s.get(n)):c.set(i,new Map([[n,e]])),c.delete(t),e.forEach((t=>{t(null,p.swap,[i])}))}}))};case s:return(e,i)=>{c.has(t)?c.get(t).has(e)?c.get(t).get(e).push(i):c.get(t).set(e,[i]):c.set(t,new Map([[e,[i]]]))};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,i)}throw new Error("Unsupported symbol")}if(i in e){if(!Number.isNaN(Number(i)))return"object"==typeof e[i]?d(e[i]):e[i];if("copyWithin"===i)throw new Error("Unsupported array method copyWithin");if(l.includes(i))return c.has(e)?function(){const t=Array.prototype[i].apply(e,arguments);return c.get(e).forEach(((t,s)=>{t.forEach((t=>{t(e,i,arguments)}))})),t}:Reflect.get(e,i);if(e[i]instanceof Array)return d(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(c.has(t)){c.get(t).forEach(((t,s)=>{t.forEach((t=>{t(e,i)}))}))}return Reflect.set(t,e,i)}})}window.observers=c;const p={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const u=Symbol("init"),y=Symbol("template"),f=Symbol("style"),g=Symbol("parent");function m(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function x(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function v(t={}){return function(e,i){if("class"!==i.kind)throw new Error("@Component() can only decorate a class");var s,r;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[g]||e.prototype[g][e.prototype[g].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[g]=[e.prototype],e.prototype[f]=t.style?[t.style]:[],e.prototype[y]=t.template||""):(e.prototype[g].push(e.prototype),e.prototype[f].push(t.style),e.prototype[y]=(s=e.prototype[y],(r=t.template||null)&&r.match(/<parent\/>/)?r.replace(/<parent\/>/,s):`${s}${r||""}`));const n=e.prototype.connectedCallback||(()=>{}),a=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[u]||void 0!==t.template||void 0!==t.style)if(this[u]){if(this[u]&&t.style);else if(this[u]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[y]||"";const i=document.importNode(t.content,!0),s=this.attachShadow({mode:"open"});s.adoptedStyleSheets=e.prototype[f].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))),r=()=>{this[g].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[x(e)]=!0,t)),{}):{})}))};0===s.length?(this[u]=!0,n.call(this),r()):Promise.all(s).then((()=>{this[u]=!0,n.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));r()}))},e.prototype.disconnectedCallback=function(){a.call(this)},e.prototype.attributeChangedCallback=function(t,e,i){this[x(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 w(t){return!!t&&t.constructor===Array}function b(t,e){t[u]&&t[g].map((i=>{i.render&&i.render.call(t,{[e]:!0})}))}function L(t){return null===t?"null":w(t)?"array":typeof t}function E(t){return function(e,i){const s=i.name,r=Symbol(s),l=Symbol(`${s}:type`),c=Symbol(`${s}:meta`);return i.addInitializer((function(){Reflect.defineProperty(this,s,{get:()=>"object"===this[l]||"array"===this[l]?this[r][o]?this[r]:d(this[r]):this[r],set:e=>{const i=L(t?t(e):e);if("index"!==s&&this[l]!==i&&"null"!==this[l]&&"null"!==i)throw new Error(`@Prop() ${s} with type '${this[l]}' cannot be set to ${i}.`);if("array"===this[l]){if(!w(e))throw new PropError(`Array "${s}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,s)?.set);if(this[r]===e)throw new Error("Setting an array to itself is not allowed.");const t=d(this[r]);if(t[n]){const i=e[o]?e[h]:e;t[a](this,i),this[r]=e,console.log(">>> trigger render???",this,s)}else this[r]=e}else this[r]=t?t(e):e,b(this,s)}})})),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=m(s);e[s]||(t.observedAttributes.push(i),e[s]=r)}return this[l]=L(e),"array"===this[l]?(this[r]=e,new Proxy(e,{get:(t,e)=>e===P?this[c]:(console.log("errr???"),Reflect.get(this[r],e)),set:(t,e,i)=>{if(e===P)return this[c]=i,!0;const n=Reflect.set(t,e,i);return"length"===e&&this[r].length===i||b(this,s),this[r]=i,n}})):(this[r]=t?t(this.getAttribute(s)??e):this.getAttribute(s)??e,this[r])}}}function C(t){return parseInt(`${t}`,10)}function S(t){return""===t||!0===t||null!==t&&!1!==t&&(t||!0)}Symbol("hasProxy");const P=Symbol("meta");var M=i(713);function z(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 $(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 k(t,e,i,s){return function(t,e,i,s){return $(t,e,i,s)&&!($(t+1,e,i,s)&&$(t-1,e,i,s)&&$(t,e+1,i,s)&&$(t,e-1,i,s))}(t=-.5*(i-2*(t+.5)),e=-.5*(s-2*(e+.5)),i/2,i/s)}function R(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 r=Math.abs(t-i),n=Math.abs(e-s),a=Math.min(t,i),o=Math.min(e,s),h=[];for(let t=0;t<n;t++)for(let e=0;e<r;e++)k(e,t,r,n)&&h.push({x:e+a,y:t+o});return h}(t,e,i+1,s+1)):function(t,e,i,s){const r=[];var n,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{r.push({x:i,y:e}),r.push({x:t,y:e}),r.push({x:t,y:s}),r.push({x:i,y:s}),(n=2*d)<=c&&(e++,s--,d+=c+=a),(n>=l||2*d>c)&&(t++,i--,d+=l+=h)}while(t<=i);for(;e-s<=o;)r.push({x:t-1,y:e}),r.push({x:i+1,y:e++}),r.push({x:t-1,y:s}),r.push({x:i+1,y:s--});return r}(t,e,i,s)}const A="#FFFFFF";function O(t,e,i,s){const r=[],n=Math.abs(i-t),a=Math.abs(s-e),o=t<i?1:-1,h=e<s?1:-1;let l=n-a;for(;r.push({x:t,y:e}),t!==i||e!==s;){var c=2*l;c>-a&&(l-=a,t+=o),c<n&&(l+=n,e+=h)}return r}function I(t,e,i,s){const r=[],n=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=n;c<n+o;c++)r.push({x:c,y:l});return r}function H(t,e,i,s){const r=[],n=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++)r.push({x:n,y:l}),r.push({x:n+o,y:l});for(var c=n+1;c<=n+o-1;c++)r.push({x:c,y:a}),r.push({x:c,y:a+h});return r}function Y(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 X(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 j(t,e,i){return e*i+t}function D(t,e){const i=document.createElement("canvas");return i.width=t,i.height=e,[i,i.getContext("2d")]}const T=[{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]]}],U=new Map;function K(t,e,i,s){const r=`${t}:${e}:${i}:${s}`;if(U.has(r))return U.get(r);let n=T.filter((i=>i.width===t&&i.height===e));0===n.length&&t%2==0&&e%2==0&&(n=[{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 n.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()})),U.set(r,l),l}var F,N=function(t,e,i,s,r,n){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");n.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))&&r.unshift(o)}else(o=a(g))&&("field"===h?r.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,r=0;r<e.length;r++)i=s?e[r].call(t,i):e[r].call(t);return s?i:void 0};function q([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"}(F||(F={}));(()=>{let t,e,i,s,r,n,a,o,h,l=[v({selector:"pg-input-pixel-editor",style:M.A,template:'<div part="wrapper" tabindex="0"> <canvas part="canvas" draggable="false"></canvas> </div>'})],c=[],d=HTMLElement,p=[],u=[],y=[],f=[],g=[],m=[],x=[],w=[],b=[],L=[],P=[],$=[],k=[],T=[];(class extends d{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(d[Symbol.metadata]??null):void 0;i=[E(C)],s=[E(C)],r=[E(C)],n=[E(C)],a=[E(S)],o=[E()],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}]`))}})}))}],N(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:v},p,u),N(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:v},y,f),N(null,null,r,{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:v},g,m),N(null,null,n,{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:v},x,w),N(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:v},b,L),N(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:v},P,$),N(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:v},k,T),N(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}),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,m),G(this,x,1));transparent=(G(this,w),G(this,b,!1));placeholder=(G(this,L),G(this,P,""));$canvas=(G(this,$),G(this,k,void 0));#t=(G(this,T),0);#e=!1;#i=!1;#s=-1;#r=-1;#n=-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;#E;#C;#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]=D(e,i),[this.#w,this.#b]=D(e,i),[this.#L,this.#E]=D(e,i),[this.#C,this.#S]=D(e,i),this.transparent)for(let e=0;e<this.height;e++)for(let i=0;i<this.width;i++)this.#v.fillStyle=A,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=[Y(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 r=0;r<e;r++)if(0!==t[r][i][s]){this.#k(s,i,t[r][i][s]);break}}}}#R(){const t=this.#u.map((t=>function(t,e={}){let i,s,r,n=1,a=0,o=0;if(e.width){if(i=t,s=e.width,r=i.length/s,r%1!=0)throw new Error(`Invalid bitmask width. ${r} = ${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,r=t.length}e.scale&&(n=e.scale),e.offsetX&&(a=e.offsetX),e.offsetY&&(o=e.offsetY);const h=s+2,l=Array(h*(r+2)).fill(0);function c(t,e){return(e+1)*h+(t+1)}for(let t=0;t<r;++t)for(let e=0;e<s;++e)l[c(e,t)]=i[j(e,t,s)];const d=s*(r+1),p=Array(d+(s+1)*r).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<r;++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*n},${t.y*n}`;for(var v=t.next;v!=t;v=v?.next)"H"==v?.type?x+=`H${v?.x*n+a}`:"V"==v?.type&&(x+=`V${v?.y*n+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.#E.clearRect(t*s,e*s,this.size,this.size),0!==this.#m[i][3]&&(this.#b.fillStyle=A,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=q(this.#m[i]),this.#b.fillRect(t*s+1,e*s+1,this.size-2,this.size-2)),0!==this.#m[i][3]&&(this.#E.fillStyle=q(this.#m[i]),this.#E.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()}#I(){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])}#H(t,e,i){const s=this.size+this.gridSize,r=this.width*s-this.gridSize,n=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,r,n),t.forEach((({x:t,y:e})=>{this.#S.fillStyle=A,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.#C,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.#C}}))}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),r=Math.floor((t.clientY-e.top)/i);if(s===this.#a&&r===this.#o)return;s>=this.width&&(s=this.width-1),r>=this.height&&(r=this.height-1),this.#e=!0,this.#s=this.#u[this.#h][r][s],this.#r=s,this.#n=r,this.#a=s,this.#o=r;const n=32===t.buttons?0:1;if(0===this.#t)this.#k(s,r,n);console.log(this.#t,s,r),this.#Y=this.handlePointerMove.bind(this),document.addEventListener("pointermove",this.#Y),this.#X=this.handlePointerUp.bind(this),document.addEventListener("pointerup",this.#X)}#j=!1;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),r=Math.floor((t.clientY-e.top)/i);if(s===this.#r&&r===this.#n&&1===this.#s){if(0===this.#t)this.#k(s,r,0),this.#u[this.#h][r][s]=0}else switch(this.#t){case 1:O(this.#r,this.#n,s,r).forEach((({x:t,y:e})=>{this.#k(t,e,1)}));break;case 2:I(this.#r,this.#n,s,r).forEach((({x:t,y:e})=>{this.#k(t,e,1)}));break;case 3:H(this.#r,this.#n,s,r).forEach((({x:t,y:e})=>{this.#k(t,e,1)}));break;case 4:case 5:R(this.#r,this.#n,s,r).forEach((({x:t,y:e})=>{this.#k(t,e,1)}))}this.#a=-1,this.#o=-1,this.#e=!1,this.cleanupPointerGlobal(),this.#j&&(this.#i=!1,this.#g.drawImage(this.#x,0,0),this.#g.drawImage(this.#i?this.#w:this.#L,0,0))}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(),r=this.size+this.gridSize,n=[],a=this.#r,o=this.#n,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)/r),i=Math.floor((t.clientY-s.top)/r);e===h&&i===l||n.push([e,i])}}else{let e=Math.floor((t.clientX-s.left)/r),i=Math.floor((t.clientY-s.top)/r);if(e===h&&i===l)return;n.push([e,i])}const c=32===t.buttons?0:1;if(0===n.length)return;const[d,p]=n.at(-1);switch(this.#a=d,this.#o=p,this.#t){case 0:for(var i of n)this.#k(i[0],i[1],c);break;case 1:this.#H(O(a,o,d,p),h,l);break;case 2:this.#H(I(a,o,d,p),h,l);break;case 3:this.#H(H(a,o,d,p),h,l);break;case 4:case 5:this.#H(R(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.#j=!1}handlePointerLeave(t){this.#e?this.#i&&(this.#j=!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=Y(this.width,this.height);!function(t,e){const i=[],s=t[0].length,r=t.length,n=e[0].length,a=e.length,o=Math.max(s,n),h=Math.max(r,a);for(let s=0;s<h;s++)for(let r=0;r<o;r++){const n=e&&e[s]&&e[s][r],a=t&&t[s]&&t[s][r];n!==a&&i.push([r,s,a,n])}}(this.#u[this.#h],t);this.#y.push({type:F.Group,data:{name:"Clear"}}),this.#y.push({type:F.Pixel,data:{pixels:[],layer:this.#h}}),this.#u=[Y(this.width,this.height)],this.#$()}reset(){this.#M=!0,this.#P()}clearHistory(){this.#y=[],this.#f=[]}applyTemplate(t){this.#u=[t],this.#I()}flipHorizontal(){const t=z(this.#u[this.#h]),e=t[0].length-1;X(this.#u[this.#h],((i,s)=>{t[s][i]=this.#u[this.#h][s][e-i]})),this.#u[this.#h]=t}flipVertical(){const t=z(this.#u[this.#h]),e=t.length-1;X(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=Y(this.width,this.height);for(let t=0;t<this.height;t++)i[t].fill(0);X(this.#u[this.#h],((s,r)=>{r-e<0||s-t<0||r-e>=this.height||s-t>=this.width||(i[r][s]=this.#u[this.#h][r-e][s-t])})),this.#u[this.#h]=i}invert(){this.#m.length>2||(X(this.#u[this.#h],((t,e)=>{this.#u[this.#h][e][t]=0===this.#u[this.#h][e][t]?1:0})),this.#I())}applyGuides(){const t=K(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===F.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.#D(!1)}rotateCounterclockwise(){this.#D(!0)}#D(t=!1){const e=z(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/pgInputRange.js CHANGED
@@ -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 n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,o,i){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<t.length;c++){var p=[].concat(t[c]);r&&a[p[0]]||(void 0!==i&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=i),n&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=n):p[2]=n),o&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=o):p[4]="".concat(o)),e.push(p))}},e}},593:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(601),o=n.n(r),i=n(314),a=n.n(i)()(o());a.push([t.id,"",""]);var s=new CSSStyleSheet;s.replaceSync(a.toString());const l=s},601:t=>{t.exports=function(t){return t[1]}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,exports:{}};return t[r](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const r=Symbol("addObserver"),o=Symbol("removeObserver"),i=Symbol("getObservers"),a=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function p(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case a:return!0;case s:return e;case i:return c.has(t);case r:return(e,n)=>{c.has(t)?c.get(t).has(e)?c.get(t).get(e).push(n):c.get(t).set(e,[n]):c.set(t,new Map([[e,[n]]]))};case o:return e=>{c.has(t)&&(c.get(t).delete(e),0===c.get(t).size&&c.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,n)}throw new Error("Unsupported symbol")}if(n in e){if(!Number.isNaN(Number(n)))return"object"==typeof e[n]?p(e[n]):e[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return c.get(e).forEach(((t,r)=>{t.forEach((t=>{t(e,n,arguments)}))})),t}:Reflect.get(e,n);if(e[n]instanceof Array)return p(e[n])}return Reflect.get(e,n)},set(t,e,n){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,n);if(c.has(t)){c.get(t).forEach(((t,r)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=c;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const u=Symbol("init"),h=Symbol("template"),d=Symbol("style"),f=Symbol("parent");function m(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function y(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 r,o;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[f]||e.prototype[f][e.prototype[f].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[f]=[e.prototype],e.prototype[d]=t.style?[t.style]:[],e.prototype[h]=t.template||""):(e.prototype[f].push(e.prototype),e.prototype[d].push(t.style),e.prototype[h]=(r=e.prototype[h],(o=t.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,r):`${r}${o||""}`));const i=e.prototype.connectedCallback||(()=>{}),a=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[u]||void 0!==t.template||void 0!==t.style)if(this[u]){if(this[u]&&t.style);else if(this[u]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[h]||"";const n=document.importNode(t.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=e.prototype[d].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),r.appendChild(n)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&n.add(t.localName);const r=Array.from(n.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),o=()=>{this[f].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[y(e)]=!0,t)),{}):{})}))};0===r.length?(this[u]=!0,i.call(this),o()):Promise.all(r).then((()=>{this[u]=!0,i.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));o()}))},e.prototype.disconnectedCallback=function(){a.call(this)},e.prototype.attributeChangedCallback=function(t,e,n){this[y(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 b(t,e){t[u]&&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 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][a]?this[o]:p(this[o]):this[o],set:e=>{const n=w(t?t(e):e);if("index"!==r&&this[l]!==n&&"null"!==this[l]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[l]}' cannot be set to ${n}.`);if("array"===this[l]){if(!g(e))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[o]===e)throw new Error("Setting an array to itself is not allowed.");const t=p(this[o]);if(t[i]){const n=e[a]?(c=e)[a]&&c[s]:e;t.splice(0,this[o].length,...n)}else this[o]=e}else this[o]=t?t(e):e,b(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=m(r);e[r]||(t.observedAttributes.push(n),e[r]=o)}return this[l]=w(e),"array"===this[l]?(this[o]=e,new Proxy(e,{get:(t,e)=>e===E?this[c]:(console.log("errr???"),Reflect.get(this[o],e)),set:(t,e,n)=>{if(e===E)return this[c]=n,!0;const i=Reflect.set(t,e,n);return"length"===e&&this[o].length===n||b(this,r),this[o]=n,i}})):(this[o]=t?t(this.getAttribute(r)??e):this.getAttribute(r)??e,this[o])}}}Symbol("hasProxy");const E=Symbol("meta");var x=n(593),P=function(t,e,n,r,o,i){function a(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",p=!e&&t?r.static?t:t.prototype:null,u=e||(p?Object.getOwnPropertyDescriptor(p,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(t||null))};var y=(0,n[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=a(y.get))&&(u.get=s),(s=a(y.set))&&(u.set=s),(s=a(y.init))&&o.unshift(s)}else(s=a(y))&&("field"===l?o.unshift(s):u[c]=s)}p&&Object.defineProperty(p,r.name,u),h=!0},$=function(t,e,n){for(var r=arguments.length>2,o=0;o<e.length;o++)n=r?e[o].call(t,n):e[o].call(t);return r?n:void 0};(()=>{let t,e,n,r,o,i,a,s=[v({selector:"pg-input-range",style:x.A,template:'<input part="input" type="range"/>'})],l=[],c=HTMLElement,p=[],u=[],h=[],d=[],f=[],m=[],y=[],g=[],b=[],w=[];(class extends c{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(c[Symbol.metadata]??null):void 0;n=[S()],r=[S()],o=[S()],i=[S()],a=[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}]`))}})}))}],P(null,null,n,{kind:"field",name:"min",static:!1,private:!1,access:{has:t=>"min"in t,get:t=>t.min,set:(t,e)=>{t.min=e}},metadata:v},p,u),P(null,null,r,{kind:"field",name:"max",static:!1,private:!1,access:{has:t=>"max"in t,get:t=>t.max,set:(t,e)=>{t.max=e}},metadata:v},h,d),P(null,null,o,{kind:"field",name:"step",static:!1,private:!1,access:{has:t=>"step"in t,get:t=>t.step,set:(t,e)=>{t.step=e}},metadata:v},f,m),P(null,null,i,{kind:"field",name:"name",static:!1,private:!1,access:{has:t=>"name"in t,get:t=>t.name,set:(t,e)=>{t.name=e}},metadata:v},y,g),P(null,null,a,{kind:"field",name:"$input",static:!1,private:!1,access:{has:t=>"$input"in t,get:t=>t.$input,set:(t,e)=>{t.$input=e}},metadata:v},b,w),P(null,t={value:e},s,{kind:"class",name:e.name,metadata:v},null,l),e=t.value,v&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v}),$(e,l)}min=$(this,p,"0");max=($(this,u),$(this,h,"100"));step=($(this,d),$(this,f,"1"));name=($(this,m),$(this,y,""));$input=($(this,g),$(this,b,void 0));render(){this.$input.min=this.min,this.$input.max=this.max,this.$input.step=this.step}connectedCallback(){this.$input.addEventListener("change",this.#t.bind(this)),this.$input.addEventListener("input",this.#e.bind(this))}#t(t){t.stopPropagation();const{value:e}=t.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:e,name:this.name}}))}#e(t){t.stopPropagation();const{value:e}=t.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:e,name:this.name}}))}constructor(){super(...arguments),$(this,w)}})})()})();
1
+ (()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,o,s){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var l=this[a][0];null!=l&&(i[l]=!0)}for(var c=0;c<t.length;c++){var p=[].concat(t[c]);r&&i[p[0]]||(void 0!==s&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=s),n&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=n):p[2]=n),o&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=o):p[4]="".concat(o)),e.push(p))}},e}},593:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(601),o=n.n(r),s=n(314),i=n.n(s)()(o());i.push([t.id,"",""]);var a=new CSSStyleSheet;a.replaceSync(i.toString());const l=a},601:t=>{t.exports=function(t){return t[1]}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var s=e[r]={id:r,exports:{}};return t[r](s,s.exports,n),s.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var 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"),s=Symbol("getObservers"),i=Symbol("swapObserver"),a=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],p=new Map;function u(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case a:return!0;case l:return e;case s:return p.has(t);case i:return(e,n)=>{const r=p.get(t);r.forEach(((o,s)=>{if(s.getRootNode().host===e){const e=r.get(s);p.has(n)?p.get(n).has(s)?p.get(n).get(s).push(r.get(s)):p.get(n).set(s,r.get(s)):p.set(n,new Map([[s,e]])),p.delete(t),e.forEach((t=>{t(null,h.swap,[n])}))}}))};case r:return(e,n)=>{p.has(t)?p.get(t).has(e)?p.get(t).get(e).push(n):p.get(t).set(e,[n]):p.set(t,new Map([[e,[n]]]))};case o:return e=>{p.has(t)&&(p.get(t).delete(e),0===p.get(t).size&&p.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,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 p.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return p.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(p.has(t)){p.get(t).forEach(((t,r)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=p;const h={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const d=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function g(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function v(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function b(t={}){return function(e,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,o;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[y]||e.prototype[y][e.prototype[y].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[y]=[e.prototype],e.prototype[m]=t.style?[t.style]:[],e.prototype[f]=t.template||""):(e.prototype[y].push(e.prototype),e.prototype[m].push(t.style),e.prototype[f]=(r=e.prototype[f],(o=t.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,r):`${r}${o||""}`));const s=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[f]||"";const n=document.importNode(t.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=e.prototype[m].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[y].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[v(e)]=!0,t)),{}):{})}))};0===r.length?(this[d]=!0,s.call(this),o()):Promise.all(r).then((()=>{this[d]=!0,s.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[v(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 w(t){return!!t&&t.constructor===Array}function S(t,e){t[d]&&t[y].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function E(t){return null===t?"null":w(t)?"array":typeof t}function x(t){return function(e,n){const r=n.name,o=Symbol(r),c=Symbol(`${r}:type`),p=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[c]||"array"===this[c]?this[o][a]?this[o]:u(this[o]):this[o],set:e=>{const n=E(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(!w(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[s]){const n=e[a]?e[l]:e;t[i](this,n),this[o]=e,console.log(">>> trigger render???",this,r)}else this[o]=e}else this[o]=t?t(e):e,S(this,r)}})})),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=g(r);e[r]||(t.observedAttributes.push(n),e[r]=o)}return this[c]=E(e),"array"===this[c]?(this[o]=e,new Proxy(e,{get:(t,e)=>e===P?this[p]:(console.log("errr???"),Reflect.get(this[o],e)),set:(t,e,n)=>{if(e===P)return this[p]=n,!0;const s=Reflect.set(t,e,n);return"length"===e&&this[o].length===n||S(this,r),this[o]=n,s}})):(this[o]=t?t(this.getAttribute(r)??e):this.getAttribute(r)??e,this[o])}}}Symbol("hasProxy");const P=Symbol("meta");var $=n(593),C=function(t,e,n,r,o,s){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=r.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?r.static?t:t.prototype:null,u=e||(p?Object.getOwnPropertyDescriptor(p,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(t||null))};var y=(0,n[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(a=i(y.get))&&(u.get=a),(a=i(y.set))&&(u.set=a),(a=i(y.init))&&o.unshift(a)}else(a=i(y))&&("field"===l?o.unshift(a):u[c]=a)}p&&Object.defineProperty(p,r.name,u),h=!0},A=function(t,e,n){for(var r=arguments.length>2,o=0;o<e.length;o++)n=r?e[o].call(t,n):e[o].call(t);return r?n:void 0};(()=>{let t,e,n,r,o,s,i,a=[b({selector:"pg-input-range",style:$.A,template:'<input part="input" type="range"/>'})],l=[],c=HTMLElement,p=[],u=[],h=[],d=[],f=[],m=[],y=[],g=[],v=[],w=[];(class extends c{static{e=this}static{const b="function"==typeof Symbol&&Symbol.metadata?Object.create(c[Symbol.metadata]??null):void 0;n=[x()],r=[x()],o=[x()],s=[x()],i=[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}]`))}})}))}],C(null,null,n,{kind:"field",name:"min",static:!1,private:!1,access:{has:t=>"min"in t,get:t=>t.min,set:(t,e)=>{t.min=e}},metadata:b},p,u),C(null,null,r,{kind:"field",name:"max",static:!1,private:!1,access:{has:t=>"max"in t,get:t=>t.max,set:(t,e)=>{t.max=e}},metadata:b},h,d),C(null,null,o,{kind:"field",name:"step",static:!1,private:!1,access:{has:t=>"step"in t,get:t=>t.step,set:(t,e)=>{t.step=e}},metadata:b},f,m),C(null,null,s,{kind:"field",name:"name",static:!1,private:!1,access:{has:t=>"name"in t,get:t=>t.name,set:(t,e)=>{t.name=e}},metadata:b},y,g),C(null,null,i,{kind:"field",name:"$input",static:!1,private:!1,access:{has:t=>"$input"in t,get:t=>t.$input,set:(t,e)=>{t.$input=e}},metadata:b},v,w),C(null,t={value:e},a,{kind:"class",name:e.name,metadata:b},null,l),e=t.value,b&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b}),A(e,l)}min=A(this,p,"0");max=(A(this,u),A(this,h,"100"));step=(A(this,d),A(this,f,"1"));name=(A(this,m),A(this,y,""));$input=(A(this,g),A(this,v,void 0));render(){this.$input.min=this.min,this.$input.max=this.max,this.$input.step=this.step}connectedCallback(){this.$input.addEventListener("change",this.#t.bind(this)),this.$input.addEventListener("input",this.#e.bind(this))}#t(t){t.stopPropagation();const{value:e}=t.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:e,name:this.name}}))}#e(t){t.stopPropagation();const{value:e}=t.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:e,name:this.name}}))}constructor(){super(...arguments),A(this,w)}})})()})();
package/pgInputSelect.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var e={97:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),a=n.n(r),o=n(314),i=n.n(o)()(a());i.push([e.id,':host {\n display: contents;\n}\n\n[part="overlay"] {\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n overflow: visible;\n --pg-menu-box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);\n top: anchor(top);\n left: anchor(left);\n min-width: calc(anchor-size(width) + calc(2 * var(--pg-menu-padding, 0.25rem)));\n margin: var(--pg-overlay-menu-_y, 0) 0 0 var(--pg-overlay-menu-_x, 0);\n overflow: visible;\n}\n',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=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 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 u=[].concat(e[c]);r&&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),a&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=a):u[4]="".concat(a)),t.push(u))}},t}},529:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(601),a=n.n(r),o=n(314),i=n.n(o)()(a());i.push([e.id,":host {\n display: contents;\n}\n\n[part=button] {\n font-family: var(--pg-font-family);\n background: var(--pg-input-select-background, #FFFFFF);\n text-align: left;\n display: grid;\n grid-template-rows: auto;\n grid-template-columns: 100% 0;\n border: 1px solid var(--pg-input-select-border-color, #453C4F);\n border-radius: 0.25rem;\n padding: 0;\n width: 100%;\n font-size: 1rem;\n outline: 0;\n}\n\n[part=button]:focus {\n box-shadow: 0 0 0 3px rgba(79, 143, 249, 0.5);\n}\n\n[part=label] {\n grid-row: 1;\n grid-column: 1;\n padding: 0.5rem 0.75rem;\n font-size: var(--pg-input-select-font-size, 1rem);\n}\n\n[part=chevron] {\n grid-row: 1;\n grid-column: 2;\n pointer-events: none;\n width: 1.5rem;\n height: 1.5rem;\n align-self: center;\n transform: translate(-2rem, 0);\n}",""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},601:e=>{e.exports=function(e){return e[1]}}},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.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const r=Symbol("addObserver"),a=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(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case i:return!0;case s:return t;case o:return c.has(e);case r:return(t,n)=>{c.has(e)?c.get(e).has(t)?c.get(e).get(t).push(n):c.get(e).set(t,[n]):c.set(e,new Map([[t,[n]]]))};case 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]?u(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return c.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return u(t[n])}return Reflect.get(t,n)},set(e,t,n){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,n);if(c.has(e)){c.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=c;class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const d=Symbol("init"),h=Symbol("template"),p=Symbol("style"),f=Symbol("parent");function m(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 y(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,a;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[f]||t.prototype[f][t.prototype[f].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[f]=[t.prototype],t.prototype[p]=e.style?[e.style]:[],t.prototype[h]=e.template||""):(t.prototype[f].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||(()=>{}),i=t.prototype.disconnectedCallback||(()=>{});t.prototype.connectedCallback=function(){if(this[d]||void 0!==e.template||void 0!==e.style)if(this[d]){if(this[d]&&e.style);else if(this[d]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[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[f].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[v(t)]=!0,e)),{}):{})}))};0===r.length?(this[d]=!0,o.call(this),a()):Promise.all(r).then((()=>{this[d]=!0,o.call(this);for(const e of this.shadowRoot.querySelectorAll("slot"))e.dispatchEvent(new CustomEvent("slotchange"));a()}))},t.prototype.disconnectedCallback=function(){i.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 g(e){return!!e&&e.constructor===Array}function b(e,t){e[d]&&e[f].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function w(e){return null===e?"null":g(e)?"array":typeof e}function S(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][i]?this[a]:u(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(!g(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[a]===t)throw new Error("Setting an array to itself is not allowed.");const e=u(this[a]);if(e[o]){const n=t[i]?(c=t)[i]&&c[s]:t;e.splice(0,this[a].length,...n)}else this[a]=t}else this[a]=e?e(t):t,b(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=m(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===E?this[c]:(console.log("errr???"),Reflect.get(this[a],t)),set:(e,t,n)=>{if(t===E)return this[c]=n,!0;const o=Reflect.set(e,t,n);return"length"===t&&this[a].length===n||b(this,r),this[a]=n,o}})):(this[a]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[a])}}}function $(){return function(e,t){const n=t.name,r=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}Symbol("hasProxy");const E=Symbol("meta");var x=function(e,t,n,r,a,o){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",u=!t&&e?r.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),h=!1,p=n.length-1;p>=0;p--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(e||null))};var v=(0,n[p])("accessor"===l?{get:d.get,set:d.set}:d[c],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=i(v.get))&&(d.get=s),(s=i(v.set))&&(d.set=s),(s=i(v.init))&&a.unshift(s)}else(s=i(v))&&("field"===l?a.unshift(s):d[c]=s)}u&&Object.defineProperty(u,r.name,d),h=!0},k=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 O=new Set,P=new Map;const C=(()=>{let e,t,n=[y()],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;x(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}),k(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),O.add(t),new Promise((e=>{P.set(t,e)}))}close(e){this.remove(),O.delete(this);const t=P.get(this);t&&t(e),P.delete(this)}});return t})();var j=n(97),A=function(e,t,n,r,a,o){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",u=!t&&e?r.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),h=!1,p=n.length-1;p>=0;p--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(e||null))};var v=(0,n[p])("accessor"===l?{get:d.get,set:d.set}:d[c],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=i(v.get))&&(d.get=s),(s=i(v.set))&&(d.set=s),(s=i(v.init))&&a.unshift(s)}else(s=i(v))&&("field"===l?a.unshift(s):d[c]=s)}u&&Object.defineProperty(u,r.name,d),h=!0},z=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 T=(()=>{let e,t,n,r,a,o,i,s,l=[y({selector:"pg-overlay-select-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:j.A})],c=[],u=C,d=[],h=[],p=[],f=[],m=[],v=[],g=[],b=[],w=[],E=[],x=[],k=[];(class extends u{static{t=this}static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;n=[$()],r=[$()],a=[S()],o=[S()],i=[S()],s=[S()],A(null,null,n,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:y},d,h),A(null,null,r,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:y},p,f),A(null,null,a,{kind:"field",name:"source",static:!1,private:!1,access:{has:e=>"source"in e,get:e=>e.source,set:(e,t)=>{e.source=t}},metadata:y},m,v),A(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:y},g,b),A(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:y},w,E),A(null,null,s,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:y},x,k),A(null,e={value:t},l,{kind:"class",name:t.name,metadata:y},null,c),t=e.value,y&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y}),z(t,c)}$overlay=z(this,d,void 0);$menu=(z(this,h),z(this,p,void 0));source=(z(this,f),z(this,m,null));default=(z(this,v),z(this,g,null));items=(z(this,b),z(this,w,[]));value=(z(this,E),z(this,x,null));render(e){e.items&&null!==this.value&&(this.items.forEach((e=>e.checked=!1)),this.items.find((e=>e.value===this.value.value)).checked=!0)}connectedCallback(){this.$menu.items=this.items,this.$menu.addEventListener("select",this.#e.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#t.bind(this));const e=this.source?.getBoundingClientRect();let t=0;const n=null===this.value||"object"!=typeof this.value?this.value:this.value.value,r=null===this.value?-1:this.items.findIndex((e=>e.value===n));if(-1!==r){const n=this.$menu.getItemHeight(r);t-=this.$menu.getItemOffset(0,r),e?.height!==n&&e?.height&&(t+=(e.height-n)/2)}else if(this.items.length>0){this.default&&(this.default.checked=!0,this.$menu.items.unshift(this.default));const n=this.$menu.getItemHeight(0);t-=this.$menu.getItemOffset(0,0),e?.height!==n&&e?.height&&(t+=(e.height-n)/2)}this.$overlay.style.setProperty("--pg-overlay-menu-_x","0px"),this.$overlay.style.setProperty("--pg-overlay-menu-_y",`${t}px`),this.$menu.focus(r)}#t(e){"closed"===e.newState&&(this.close(),this.source?.focus())}disconnectedCallback(){}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}constructor(){super(...arguments),z(this,k)}});return t})();const R=T;var L=n(529),I=function(e,t,n,r,a,o){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",u=!t&&e?r.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),h=!1,p=n.length-1;p>=0;p--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(e||null))};var v=(0,n[p])("accessor"===l?{get:d.get,set:d.set}:d[c],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(s=i(v.get))&&(d.get=s),(s=i(v.set))&&(d.set=s),(s=i(v.init))&&a.unshift(s)}else(s=i(v))&&("field"===l?a.unshift(s):d[c]=s)}u&&Object.defineProperty(u,r.name,d),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,i,s,l=[y({selector:"pg-input-select",style:L.A,template:'<button part="button"> <span part="label"></span> <svg part="chevron" viewBox="0 0 24 24"><path d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"/></svg> </button>'})],c=[],u=HTMLElement,d=[],h=[],p=[],f=[],m=[],v=[],g=[],b=[],w=[],E=[],x=[],k=[];(class extends u{static{t=this}static{const y="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;n=[S()],r=[S()],a=[S()],o=[S()],i=[$()],s=[$()],I(null,null,n,{kind:"field",name:"options",static:!1,private:!1,access:{has:e=>"options"in e,get:e=>e.options,set:(e,t)=>{e.options=t}},metadata:y},d,h),I(null,null,r,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:y},p,f),I(null,null,a,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:y},m,v),I(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:y},g,b),I(null,null,i,{kind:"field",name:"$button",static:!1,private:!1,access:{has:e=>"$button"in e,get:e=>e.$button,set:(e,t)=>{e.$button=t}},metadata:y},w,E),I(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:y},x,k),I(null,e={value:t},l,{kind:"class",name:t.name,metadata:y},null,c),t=e.value,y&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:y}),F(t,c)}options=F(this,d,[]);value=(F(this,h),F(this,p,""));name=(F(this,f),F(this,m,""));default=(F(this,v),F(this,g,null));$button=(F(this,b),F(this,w,void 0));$label=(F(this,E),F(this,x,void 0));connectedCallback(){this.$button.addEventListener("click",this.#n.bind(this))}render(e){(e.value||e.default)&&(this.$label.textContent=this.value?this.value:this.default?this.default.label:" ")}#r=(F(this,k),!1);async#n(){if(this.#r)return;this.#r=!0;const e=await R.open({source:this.$button,default:this.default,value:this.options.find((e=>e.value===this.value))??null,items:this.options});void 0!==e&&(this.dispatchEvent(new CustomEvent("change",{detail:{value:e.value}})),this.$label.textContent=e.label),this.#r=!1}})})()})();
1
+ (()=>{"use strict";var e={97:(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: anchor(top);\n left: anchor(left);\n min-width: calc(anchor-size(width) + calc(2 * var(--pg-menu-padding, 0.25rem)));\n margin: var(--pg-overlay-menu-_y, 0) 0 0 var(--pg-overlay-menu-_x, 0);\n overflow: visible;\n}\n',""]);var i=new CSSStyleSheet;i.replaceSync(s.toString());const l=i},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 u=[].concat(e[c]);r&&s[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),a&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=a):u[4]="".concat(a)),t.push(u))}},t}},529:(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=button] {\n font-family: var(--pg-font-family);\n background: var(--pg-input-select-background, #FFFFFF);\n text-align: left;\n display: grid;\n grid-template-rows: auto;\n grid-template-columns: 100% 0;\n border: 1px solid var(--pg-input-select-border-color, #453C4F);\n border-radius: 0.25rem;\n padding: 0;\n width: 100%;\n font-size: 1rem;\n outline: 0;\n}\n\n[part=button]:focus {\n box-shadow: 0 0 0 3px rgba(79, 143, 249, 0.5);\n}\n\n[part=label] {\n grid-row: 1;\n grid-column: 1;\n padding: 0.5rem 0.75rem;\n font-size: var(--pg-input-select-font-size, 1rem);\n}\n\n[part=chevron] {\n grid-row: 1;\n grid-column: 2;\n pointer-events: none;\n width: 1.5rem;\n height: 1.5rem;\n align-self: center;\n transform: translate(-2rem, 0);\n}",""]);var i=new CSSStyleSheet;i.replaceSync(s.toString());const l=i},601:e=>{e.exports=function(e){return e[1]}}},t={};function n(r){var 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.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const r=Symbol("addObserver"),a=Symbol("removeObserver"),o=Symbol("getObservers"),s=Symbol("swapObserver"),i=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],u=new Map;function h(e){return new Proxy(e,{get(t,n){if("symbol"==typeof n){switch(n){case i:return!0;case l:return t;case o:return u.has(e);case s:return(t,n)=>{const r=u.get(e);r.forEach(((a,o)=>{if(o.getRootNode().host===t){const t=r.get(o);u.has(n)?u.get(n).has(o)?u.get(n).get(o).push(r.get(o)):u.get(n).set(o,r.get(o)):u.set(n,new Map([[o,t]])),u.delete(e),t.forEach((e=>{e(null,d.swap,[n])}))}}))};case r:return(t,n)=>{u.has(e)?u.get(e).has(t)?u.get(e).get(t).push(n):u.get(e).set(t,[n]):u.set(e,new Map([[t,[n]]]))};case a:return t=>{u.has(e)&&(u.get(e).delete(t),0===u.get(e).size&&u.delete(e))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(t,n)}throw new Error("Unsupported symbol")}if(n in t){if(!Number.isNaN(Number(n)))return"object"==typeof t[n]?h(t[n]):t[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(c.includes(n))return u.has(t)?function(){const e=Array.prototype[n].apply(t,arguments);return u.get(t).forEach(((e,r)=>{e.forEach((e=>{e(t,n,arguments)}))})),e}:Reflect.get(t,n);if(t[n]instanceof Array)return h(t[n])}return Reflect.get(t,n)},set(e,t,n){if("symbol"==typeof t)throw new Error("Setting symbols not allowed.");if(Array.isArray(e))return Reflect.set(e,t,n);if(u.has(e)){u.get(e).forEach(((e,r)=>{e.forEach((e=>{e(t,n)}))}))}return Reflect.set(e,t,n)}})}window.observers=u;const d={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(e,t){super(e),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}}Symbol("index");const p=Symbol("init"),f=Symbol("template"),m=Symbol("style"),v=Symbol("parent");function y(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(e){return e.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))}function b(e={}){return function(t,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,a;Reflect.defineProperty(t,"name",{value:e.selector,writable:!1,configurable:!1}),!t.prototype[v]||t.prototype[v][t.prototype[v].length-1]instanceof Object.getPrototypeOf(t)?t.prototype instanceof HTMLElement&&(t.prototype[v]=[t.prototype],t.prototype[m]=e.style?[e.style]:[],t.prototype[f]=e.template||""):(t.prototype[v].push(t.prototype),t.prototype[m].push(e.style),t.prototype[f]=(r=t.prototype[f],(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[p]||void 0!==e.template||void 0!==e.style)if(this[p]){if(this[p]&&e.style);else if(this[p]&&e.selector&&!e.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===e.useShadow)throw new Error("unsupported");{const e=document.createElement("template");e.innerHTML=t.prototype[f]||"";const n=document.importNode(e.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=t.prototype[m].map((e=>{if(e instanceof CSSStyleSheet)return e;var t=new CSSStyleSheet;return t.replaceSync(e.toString()),t})),r.appendChild(n)}}else!1===e.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const e of this.shadowRoot.querySelectorAll("*"))-1!==e.localName.indexOf("-")&&n.add(e.localName);const r=Array.from(n.values()).map((e=>customElements.get(e)?Promise.resolve():customElements.whenDefined(e))),a=()=>{this[v].map((e=>{e.render&&e.render.call(this,t.observedAttributes?t.observedAttributes.reduce(((e,t)=>(e[g(t)]=!0,e)),{}):{})}))};0===r.length?(this[p]=!0,o.call(this),a()):Promise.all(r).then((()=>{this[p]=!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[g(e)]=n},n.addInitializer((function(){if(e.selector){if(window.customElements.get(e.selector))throw new Error(`@Component() ${n.name} duplicate selector '${e.selector}'`);window.customElements.define(e.selector,t)}}))}}Symbol("transmute");function w(e){return!!e&&e.constructor===Array}function S(e,t){e[p]&&e[v].map((n=>{n.render&&n.render.call(e,{[t]:!0})}))}function $(e){return null===e?"null":w(e)?"array":typeof e}function E(e){return function(t,n){const r=n.name,a=Symbol(r),c=Symbol(`${r}:type`),u=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[c]||"array"===this[c]?this[a][i]?this[a]:h(this[a]):this[a],set:t=>{const n=$(e?e(t):t);if("index"!==r&&this[c]!==n&&"null"!==this[c]&&"null"!==n)throw new Error(`@Prop() ${r} with type '${this[c]}' cannot be set to ${n}.`);if("array"===this[c]){if(!w(t))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[a]===t)throw new Error("Setting an array to itself is not allowed.");const e=h(this[a]);if(e[o]){const n=t[i]?t[l]:t;e[s](this,n),this[a]=t,console.log(">>> trigger render???",this,r)}else this[a]=t}else this[a]=e?e(t):t,S(this,r)}})})),function(t){if(void 0===t&&"index"!==r)throw new Error(`@Prop() ${r} must have an initial value defined.`);if(void 0!==t&&"index"===r)throw new Error("@Prop() index must not have an initial value defined.");if(!0===t)throw new Error(`@Prop() ${r} boolean must initialize to false.`);if(!n.private){const{constructor:e}=this;e.observedAttributes??=[],e.symbols||(e.symbols={});const{symbols:t}=e,n=y(r);t[r]||(e.observedAttributes.push(n),t[r]=a)}return this[c]=$(t),"array"===this[c]?(this[a]=t,new Proxy(t,{get:(e,t)=>t===k?this[u]:(console.log("errr???"),Reflect.get(this[a],t)),set:(e,t,n)=>{if(t===k)return this[u]=n,!0;const o=Reflect.set(e,t,n);return"length"===t&&this[a].length===n||S(this,r),this[a]=n,o}})):(this[a]=e?e(this.getAttribute(r)??t):this.getAttribute(r)??t,this[a])}}}function x(){return function(e,t){const n=t.name,r=n.replace(/^\$/,"");t.addInitializer((function(){let e=null;Reflect.defineProperty(this,n,{get(){return e??(e=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}Symbol("hasProxy");const k=Symbol("meta");var O=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",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,p=n.length-1;p>=0;p--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(e||null))};var v=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(i=s(v.get))&&(h.get=i),(i=s(v.set))&&(h.set=i),(i=s(v.init))&&a.unshift(i)}else(i=s(v))&&("field"===l?a.unshift(i):h[c]=i)}u&&Object.defineProperty(u,r.name,h),d=!0},P=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 C=new Set,j=new Map;const A=(()=>{let e,t,n=[b()],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;O(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}),P(t,r)}static open(e={}){var t=document.createElement(this.name);return Object.assign(t,e),document.body.appendChild(t),C.add(t),new Promise((e=>{j.set(t,e)}))}close(e){this.remove(),C.delete(this);const t=j.get(this);t&&t(e),j.delete(this)}});return t})();var z=n(97),T=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",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,p=n.length-1;p>=0;p--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(e||null))};var v=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(i=s(v.get))&&(h.get=i),(i=s(v.set))&&(h.set=i),(i=s(v.init))&&a.unshift(i)}else(i=s(v))&&("field"===l?a.unshift(i):h[c]=i)}u&&Object.defineProperty(u,r.name,h),d=!0},R=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 L=(()=>{let e,t,n,r,a,o,s,i,l=[b({selector:"pg-overlay-select-menu",template:'<div part="overlay"> <pg-menu part="menu"></pg-menu> </div>',style:z.A})],c=[],u=A,h=[],d=[],p=[],f=[],m=[],v=[],y=[],g=[],w=[],S=[],$=[],k=[];(class extends u{static{t=this}static{const b="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;n=[x()],r=[x()],a=[E()],o=[E()],s=[E()],i=[E()],T(null,null,n,{kind:"field",name:"$overlay",static:!1,private:!1,access:{has:e=>"$overlay"in e,get:e=>e.$overlay,set:(e,t)=>{e.$overlay=t}},metadata:b},h,d),T(null,null,r,{kind:"field",name:"$menu",static:!1,private:!1,access:{has:e=>"$menu"in e,get:e=>e.$menu,set:(e,t)=>{e.$menu=t}},metadata:b},p,f),T(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:b},m,v),T(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:b},y,g),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:b},w,S),T(null,null,i,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:b},$,k),T(null,e={value:t},l,{kind:"class",name:t.name,metadata:b},null,c),t=e.value,b&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b}),R(t,c)}$overlay=R(this,h,void 0);$menu=(R(this,d),R(this,p,void 0));source=(R(this,f),R(this,m,null));default=(R(this,v),R(this,y,null));items=(R(this,g),R(this,w,[]));value=(R(this,S),R(this,$,null));render(e){e.items&&null!==this.value&&(this.items.forEach((e=>e.checked=!1)),this.items.find((e=>e.value===this.value.value)).checked=!0)}connectedCallback(){this.$menu.items=this.items,this.$menu.addEventListener("select",this.#e.bind(this)),this.$overlay.popover="auto",null!==this.source&&this.$overlay.showPopover({source:this.source}),this.$overlay.addEventListener("toggle",this.#t.bind(this));const e=this.source?.getBoundingClientRect();let t=0;const n=null===this.value||"object"!=typeof this.value?this.value:this.value.value,r=null===this.value?-1:this.items.findIndex((e=>e.value===n));if(-1!==r){const n=this.$menu.getItemHeight(r);t-=this.$menu.getItemOffset(0,r),e?.height!==n&&e?.height&&(t+=(e.height-n)/2)}else if(this.items.length>0){this.default&&(this.default.checked=!0,this.$menu.items.unshift(this.default));const n=this.$menu.getItemHeight(0);t-=this.$menu.getItemOffset(0,0),e?.height!==n&&e?.height&&(t+=(e.height-n)/2)}this.$overlay.style.setProperty("--pg-overlay-menu-_x","0px"),this.$overlay.style.setProperty("--pg-overlay-menu-_y",`${t}px`),this.$menu.focus(r)}#t(e){"closed"===e.newState&&(this.close(),this.source?.focus())}disconnectedCallback(){}#e(e){e.detail.item.index=e.detail.index,this.close(e.detail.item),this.source?.focus()}constructor(){super(...arguments),R(this,k)}});return t})();const I=L;var F=n(529),M=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",u=!t&&e?r.static?e:e.prototype:null,h=t||(u?Object.getOwnPropertyDescriptor(u,r.name):{}),d=!1,p=n.length-1;p>=0;p--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(e||null))};var v=(0,n[p])("accessor"===l?{get:h.get,set:h.set}:h[c],f);if("accessor"===l){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(i=s(v.get))&&(h.get=i),(i=s(v.set))&&(h.set=i),(i=s(v.init))&&a.unshift(i)}else(i=s(v))&&("field"===l?a.unshift(i):h[c]=i)}u&&Object.defineProperty(u,r.name,h),d=!0},N=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=[b({selector:"pg-input-select",style:F.A,template:'<button part="button"> <span part="label"></span> <svg part="chevron" viewBox="0 0 24 24"><path d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"/></svg> </button>'})],c=[],u=HTMLElement,h=[],d=[],p=[],f=[],m=[],v=[],y=[],g=[],w=[],S=[],$=[],k=[];(class extends u{static{t=this}static{const b="function"==typeof Symbol&&Symbol.metadata?Object.create(u[Symbol.metadata]??null):void 0;n=[E()],r=[E()],a=[E()],o=[E()],s=[x()],i=[x()],M(null,null,n,{kind:"field",name:"options",static:!1,private:!1,access:{has:e=>"options"in e,get:e=>e.options,set:(e,t)=>{e.options=t}},metadata:b},h,d),M(null,null,r,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:b},p,f),M(null,null,a,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:b},m,v),M(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:b},y,g),M(null,null,s,{kind:"field",name:"$button",static:!1,private:!1,access:{has:e=>"$button"in e,get:e=>e.$button,set:(e,t)=>{e.$button=t}},metadata:b},w,S),M(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:b},$,k),M(null,e={value:t},l,{kind:"class",name:t.name,metadata:b},null,c),t=e.value,b&&Object.defineProperty(t,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:b}),N(t,c)}options=N(this,h,[]);value=(N(this,d),N(this,p,""));name=(N(this,f),N(this,m,""));default=(N(this,v),N(this,y,null));$button=(N(this,g),N(this,w,void 0));$label=(N(this,S),N(this,$,void 0));connectedCallback(){this.$button.addEventListener("click",this.#n.bind(this))}render(e){(e.value||e.default)&&(this.$label.textContent=this.value?this.value:this.default?this.default.label:" ")}#r=(N(this,k),!1);async#n(){if(this.#r)return;this.#r=!0;const e=await I.open({source:this.$button,default:this.default,value:this.options.find((e=>e.value===this.value))??null,items:this.options});void 0!==e&&(this.dispatchEvent(new CustomEvent("change",{detail:{value:e.value}})),this.$label.textContent=e.label),this.#r=!1}})})()})();
package/pgInputText.js CHANGED
@@ -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 r="",n=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),n&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),n&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,n,o,a){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(n)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<t.length;c++){var p=[].concat(t[c]);n&&i[p[0]]||(void 0!==a&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=a),r&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=r):p[2]=r),o&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=o):p[4]="".concat(o)),e.push(p))}},e}},569:(t,e,r)=>{r.d(e,{A:()=>l});var n=r(601),o=r.n(n),a=r(314),i=r.n(a)()(o());i.push([t.id,':host {\n display: block;\n font-family: var(--pg-font-family);\n}\n\n[part="input"] {\n border: 1px solid var(--pg-input-text-border-color, #453C4F);\n border-radius: 0.125rem;\n padding: calc(0.5rem - 1px) 0.75rem;\n font-family: var(--pg-font-family);\n font-size: 1rem;\n outline: none;\n width: calc(100% - 1.5rem - 2px);\n}\n\n[part="input"]:active {\n box-shadow: 0 0 0 3px var(--pg-input-text-active-glow, rgb(79, 143, 249, 0.6));\n}\n[part="input"]:focus {\n box-shadow: 0 0 0 3px var(--pg-input-text-focus-glow, rgb(79, 143, 249, 0.5));\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},601:t=>{t.exports=function(t){return t[1]}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var a=e[n]={id:n,exports:{}};return t[n](a,a.exports,r),a.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const n=Symbol("addObserver"),o=Symbol("removeObserver"),a=Symbol("getObservers"),i=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function p(t){return new Proxy(t,{get(e,r){if("symbol"==typeof r){switch(r){case i:return!0;case s:return e;case a:return c.has(t);case n:return(e,r)=>{c.has(t)?c.get(t).has(e)?c.get(t).get(e).push(r):c.get(t).set(e,[r]):c.set(t,new Map([[e,[r]]]))};case 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,r)}throw new Error("Unsupported symbol")}if(r in e){if(!Number.isNaN(Number(r)))return"object"==typeof e[r]?p(e[r]):e[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(l.includes(r))return c.has(e)?function(){const t=Array.prototype[r].apply(e,arguments);return c.get(e).forEach(((t,n)=>{t.forEach((t=>{t(e,r,arguments)}))})),t}:Reflect.get(e,r);if(e[r]instanceof Array)return p(e[r])}return Reflect.get(e,r)},set(t,e,r){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,r);if(c.has(t)){c.get(t).forEach(((t,n)=>{t.forEach((t=>{t(e,r)}))}))}return Reflect.set(t,e,r)}})}window.observers=c;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const u=Symbol("init"),h=Symbol("template"),d=Symbol("style"),f=Symbol("parent");function m(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function y(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function v(t={}){return function(e,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var n,o;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[f]||e.prototype[f][e.prototype[f].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[f]=[e.prototype],e.prototype[d]=t.style?[t.style]:[],e.prototype[h]=t.template||""):(e.prototype[f].push(e.prototype),e.prototype[d].push(t.style),e.prototype[h]=(n=e.prototype[h],(o=t.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,n):`${n}${o||""}`));const a=e.prototype.connectedCallback||(()=>{}),i=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[u]||void 0!==t.template||void 0!==t.style)if(this[u]){if(this[u]&&t.style);else if(this[u]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[h]||"";const r=document.importNode(t.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=e.prototype[d].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),n.appendChild(r)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&r.add(t.localName);const n=Array.from(r.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),o=()=>{this[f].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[y(e)]=!0,t)),{}):{})}))};0===n.length?(this[u]=!0,a.call(this),o()):Promise.all(n).then((()=>{this[u]=!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,r){this[y(t)]=r},r.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${r.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function g(t){return!!t&&t.constructor===Array}function b(t,e){t[u]&&t[f].map((r=>{r.render&&r.render.call(t,{[e]:!0})}))}function w(t){return null===t?"null":g(t)?"array":typeof t}function S(t){return function(e,r){const n=r.name,o=Symbol(n),l=Symbol(`${n}:type`),c=Symbol(`${n}:meta`);return r.addInitializer((function(){Reflect.defineProperty(this,n,{get:()=>"object"===this[l]||"array"===this[l]?this[o][i]?this[o]:p(this[o]):this[o],set:e=>{const r=w(t?t(e):e);if("index"!==n&&this[l]!==r&&"null"!==this[l]&&"null"!==r)throw new Error(`@Prop() ${n} with type '${this[l]}' cannot be set to ${r}.`);if("array"===this[l]){if(!g(e))throw new PropError(`Array "${n}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,n)?.set);if(this[o]===e)throw new Error("Setting an array to itself is not allowed.");const t=p(this[o]);if(t[a]){const r=e[i]?(c=e)[i]&&c[s]:e;t.splice(0,this[o].length,...r)}else this[o]=e}else this[o]=t?t(e):e,b(this,n);var c}})})),function(e){if(void 0===e&&"index"!==n)throw new Error(`@Prop() ${n} must have an initial value defined.`);if(void 0!==e&&"index"===n)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${n} boolean must initialize to false.`);if(!r.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,r=m(n);e[n]||(t.observedAttributes.push(r),e[n]=o)}return this[l]=w(e),"array"===this[l]?(this[o]=e,new Proxy(e,{get:(t,e)=>e===E?this[c]:(console.log("errr???"),Reflect.get(this[o],e)),set:(t,e,r)=>{if(e===E)return this[c]=r,!0;const a=Reflect.set(t,e,r);return"length"===e&&this[o].length===r||b(this,n),this[o]=r,a}})):(this[o]=t?t(this.getAttribute(n)??e):this.getAttribute(n)??e,this[o])}}}Symbol("hasProxy");const E=Symbol("meta");var x=r(569),P=function(t,e,r,n,o,a){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?n.static?t:t.prototype:null,u=e||(p?Object.getOwnPropertyDescriptor(p,n.name):{}),h=!1,d=r.length-1;d>=0;d--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(t||null))};var y=(0,r[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=i(y.get))&&(u.get=s),(s=i(y.set))&&(u.set=s),(s=i(y.init))&&o.unshift(s)}else(s=i(y))&&("field"===l?o.unshift(s):u[c]=s)}p&&Object.defineProperty(p,n.name,u),h=!0},$=function(t,e,r){for(var n=arguments.length>2,o=0;o<e.length;o++)r=n?e[o].call(t,r):e[o].call(t);return n?r:void 0};(()=>{let t,e,r,n,o,a,i=[v({selector:"pg-input-text",style:x.A,template:'<input part="input" type="text"/>'})],s=[],l=HTMLElement,c=[],p=[],u=[],h=[],d=[],f=[],m=[],y=[];(class extends l{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;r=[S()],n=[S()],o=[S()],a=[function(t,e){const r=e.name,n=r.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,r,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${n}]`))}})}))}],P(null,null,r,{kind:"field",name:"name",static:!1,private:!1,access:{has:t=>"name"in t,get:t=>t.name,set:(t,e)=>{t.name=e}},metadata:v},c,p),P(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:v},u,h),P(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:v},d,f),P(null,null,a,{kind:"field",name:"$input",static:!1,private:!1,access:{has:t=>"$input"in t,get:t=>t.$input,set:(t,e)=>{t.$input=e}},metadata:v},m,y),P(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}),$(e,s)}name=$(this,c,"");value=($(this,p),$(this,u,""));placeholder=($(this,h),$(this,d,""));$input=($(this,f),$(this,m,void 0));connectedCallback(){this.$input.addEventListener("input",this.handleInput.bind(this)),this.$input.addEventListener("change",this.handleChange.bind(this))}skipValue=($(this,y),!1);render(t){t.value&&!this.skipValue&&(this.$input.value=this.value),t.placeholder&&(this.$input.placeholder=this.placeholder),this.skipValue=!1}handleInput(t){t.stopPropagation(),this.skipValue=!0,this.value=t.target.value,this.dispatchEvent(new CustomEvent("input",{detail:{value:t.target.value,name:t.name}}))}handleChange(t){this.dispatchEvent(new CustomEvent("change",{detail:{value:t.target.value,name:t.name}}))}})})()})();
1
+ (()=>{"use strict";var t={314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r="",n=void 0!==e[5];return e[4]&&(r+="@supports (".concat(e[4],") {")),e[2]&&(r+="@media ".concat(e[2]," {")),n&&(r+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),r+=t(e),n&&(r+="}"),e[2]&&(r+="}"),e[4]&&(r+="}"),r})).join("")},e.i=function(t,r,n,o,a){"string"==typeof t&&(t=[[null,t,void 0]]);var i={};if(n)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(i[l]=!0)}for(var c=0;c<t.length;c++){var p=[].concat(t[c]);n&&i[p[0]]||(void 0!==a&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=a),r&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=r):p[2]=r),o&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=o):p[4]="".concat(o)),e.push(p))}},e}},569:(t,e,r)=>{r.d(e,{A:()=>l});var n=r(601),o=r.n(n),a=r(314),i=r.n(a)()(o());i.push([t.id,':host {\n display: block;\n font-family: var(--pg-font-family);\n}\n\n[part="input"] {\n border: 1px solid var(--pg-input-text-border-color, #453C4F);\n border-radius: 0.125rem;\n padding: calc(0.5rem - 1px) 0.75rem;\n font-family: var(--pg-font-family);\n font-size: 1rem;\n outline: none;\n width: calc(100% - 1.5rem - 2px);\n}\n\n[part="input"]:active {\n box-shadow: 0 0 0 3px var(--pg-input-text-active-glow, rgb(79, 143, 249, 0.6));\n}\n[part="input"]:focus {\n box-shadow: 0 0 0 3px var(--pg-input-text-focus-glow, rgb(79, 143, 249, 0.5));\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},601:t=>{t.exports=function(t){return t[1]}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var a=e[n]={id:n,exports:{}};return t[n](a,a.exports,r),a.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const n=Symbol("addObserver"),o=Symbol("removeObserver"),a=Symbol("getObservers"),i=Symbol("swapObserver"),s=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],p=new Map;function u(t){return new Proxy(t,{get(e,r){if("symbol"==typeof r){switch(r){case s:return!0;case l:return e;case a:return p.has(t);case i:return(e,r)=>{const n=p.get(t);n.forEach(((o,a)=>{if(a.getRootNode().host===e){const e=n.get(a);p.has(r)?p.get(r).has(a)?p.get(r).get(a).push(n.get(a)):p.get(r).set(a,n.get(a)):p.set(r,new Map([[a,e]])),p.delete(t),e.forEach((t=>{t(null,h.swap,[r])}))}}))};case n:return(e,r)=>{p.has(t)?p.get(t).has(e)?p.get(t).get(e).push(r):p.get(t).set(e,[r]):p.set(t,new Map([[e,[r]]]))};case o:return e=>{p.has(t)&&(p.get(t).delete(e),0===p.get(t).size&&p.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,r)}throw new Error("Unsupported symbol")}if(r in e){if(!Number.isNaN(Number(r)))return"object"==typeof e[r]?u(e[r]):e[r];if("copyWithin"===r)throw new Error("Unsupported array method copyWithin");if(c.includes(r))return p.has(e)?function(){const t=Array.prototype[r].apply(e,arguments);return p.get(e).forEach(((t,n)=>{t.forEach((t=>{t(e,r,arguments)}))})),t}:Reflect.get(e,r);if(e[r]instanceof Array)return u(e[r])}return Reflect.get(e,r)},set(t,e,r){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,r);if(p.has(t)){p.get(t).forEach(((t,n)=>{t.forEach((t=>{t(e,r)}))}))}return Reflect.set(t,e,r)}})}window.observers=p;const h={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const d=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function v(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function b(t={}){return function(e,r){if("class"!==r.kind)throw new Error("@Component() can only decorate a class");var n,o;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[m]=t.style?[t.style]:[],e.prototype[f]=t.template||""):(e.prototype[y].push(e.prototype),e.prototype[m].push(t.style),e.prototype[f]=(n=e.prototype[f],(o=t.template||null)&&o.match(/<parent\/>/)?o.replace(/<parent\/>/,n):`${n}${o||""}`));const a=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[f]||"";const r=document.importNode(t.content,!0),n=this.attachShadow({mode:"open"});n.adoptedStyleSheets=e.prototype[m].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),n.appendChild(r)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const r=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&r.add(t.localName);const n=Array.from(r.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),o=()=>{this[y].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[g(e)]=!0,t)),{}):{})}))};0===n.length?(this[d]=!0,a.call(this),o()):Promise.all(n).then((()=>{this[d]=!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,r){this[g(t)]=r},r.addInitializer((function(){if(t.selector){if(window.customElements.get(t.selector))throw new Error(`@Component() ${r.name} duplicate selector '${t.selector}'`);window.customElements.define(t.selector,e)}}))}}Symbol("transmute");function w(t){return!!t&&t.constructor===Array}function S(t,e){t[d]&&t[y].map((r=>{r.render&&r.render.call(t,{[e]:!0})}))}function E(t){return null===t?"null":w(t)?"array":typeof t}function x(t){return function(e,r){const n=r.name,o=Symbol(n),c=Symbol(`${n}:type`),p=Symbol(`${n}:meta`);return r.addInitializer((function(){Reflect.defineProperty(this,n,{get:()=>"object"===this[c]||"array"===this[c]?this[o][s]?this[o]:u(this[o]):this[o],set:e=>{const r=E(t?t(e):e);if("index"!==n&&this[c]!==r&&"null"!==this[c]&&"null"!==r)throw new Error(`@Prop() ${n} with type '${this[c]}' cannot be set to ${r}.`);if("array"===this[c]){if(!w(e))throw new PropError(`Array "${n}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,n)?.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 r=e[s]?e[l]:e;t[i](this,r),this[o]=e,console.log(">>> trigger render???",this,n)}else this[o]=e}else this[o]=t?t(e):e,S(this,n)}})})),function(e){if(void 0===e&&"index"!==n)throw new Error(`@Prop() ${n} must have an initial value defined.`);if(void 0!==e&&"index"===n)throw new Error("@Prop() index must not have an initial value defined.");if(!0===e)throw new Error(`@Prop() ${n} boolean must initialize to false.`);if(!r.private){const{constructor:t}=this;t.observedAttributes??=[],t.symbols||(t.symbols={});const{symbols:e}=t,r=v(n);e[n]||(t.observedAttributes.push(r),e[n]=o)}return this[c]=E(e),"array"===this[c]?(this[o]=e,new Proxy(e,{get:(t,e)=>e===P?this[p]:(console.log("errr???"),Reflect.get(this[o],e)),set:(t,e,r)=>{if(e===P)return this[p]=r,!0;const a=Reflect.set(t,e,r);return"length"===e&&this[o].length===r||S(this,n),this[o]=r,a}})):(this[o]=t?t(this.getAttribute(n)??e):this.getAttribute(n)??e,this[o])}}}Symbol("hasProxy");const P=Symbol("meta");var $=r(569),C=function(t,e,r,n,o,a){function i(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var s,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",p=!e&&t?n.static?t:t.prototype:null,u=e||(p?Object.getOwnPropertyDescriptor(p,n.name):{}),h=!1,d=r.length-1;d>=0;d--){var f={};for(var m in n)f[m]="access"===m?{}:n[m];for(var m in n.access)f.access[m]=n.access[m];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(i(t||null))};var y=(0,r[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=i(y.get))&&(u.get=s),(s=i(y.set))&&(u.set=s),(s=i(y.init))&&o.unshift(s)}else(s=i(y))&&("field"===l?o.unshift(s):u[c]=s)}p&&Object.defineProperty(p,n.name,u),h=!0},k=function(t,e,r){for(var n=arguments.length>2,o=0;o<e.length;o++)r=n?e[o].call(t,r):e[o].call(t);return n?r:void 0};(()=>{let t,e,r,n,o,a,i=[b({selector:"pg-input-text",style:$.A,template:'<input part="input" type="text"/>'})],s=[],l=HTMLElement,c=[],p=[],u=[],h=[],d=[],f=[],m=[],y=[];(class extends l{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;r=[x()],n=[x()],o=[x()],a=[function(t,e){const r=e.name,n=r.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,r,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${n}]`))}})}))}],C(null,null,r,{kind:"field",name:"name",static:!1,private:!1,access:{has:t=>"name"in t,get:t=>t.name,set:(t,e)=>{t.name=e}},metadata:v},c,p),C(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:v},u,h),C(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:v},d,f),C(null,null,a,{kind:"field",name:"$input",static:!1,private:!1,access:{has:t=>"$input"in t,get:t=>t.$input,set:(t,e)=>{t.$input=e}},metadata:v},m,y),C(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}),k(e,s)}name=k(this,c,"");value=(k(this,p),k(this,u,""));placeholder=(k(this,h),k(this,d,""));$input=(k(this,f),k(this,m,void 0));connectedCallback(){this.$input.addEventListener("input",this.handleInput.bind(this)),this.$input.addEventListener("change",this.handleChange.bind(this))}skipValue=(k(this,y),!1);render(t){t.value&&!this.skipValue&&(this.$input.value=this.value),t.placeholder&&(this.$input.placeholder=this.placeholder),this.skipValue=!1}handleInput(t){t.stopPropagation(),this.skipValue=!0,this.value=t.target.value,this.dispatchEvent(new CustomEvent("input",{detail:{value:t.target.value,name:t.name}}))}handleChange(t){this.dispatchEvent(new CustomEvent("change",{detail:{value:t.target.value,name:t.name}}))}})})()})();
@@ -1 +1 @@
1
- (()=>{"use strict";var t={277:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(601),a=n.n(r),o=n(314),i=n.n(o)()(a());i.push([t.id,':host {\n display: block;\n}\n\n[part="grid"] {\n display: grid;\n grid-template-columns: auto 1.5rem;\n}\n\n[part="icon"] {\n grid-row: 1;\n grid-column: 2;\n pointer-events: none;\n transform: translate(calc(-0.35rem + 1px), calc(0.25rem + 1px));\n}\n\n[part="input"] {\n grid-row: 1;\n grid-column: 1 / span 2;\n}\n\n[part="input"]:focus + [part="icon"] {\n --pg-icon-color: #4f8ff9;\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,a,o){"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 p=[].concat(t[c]);r&&i[p[0]]||(void 0!==o&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=o),n&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=n):p[2]=n),a&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=a):p[4]="".concat(a)),e.push(p))}},e}},441:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(601),a=n.n(r),o=n(314),i=n.n(o)()(a());i.push([t.id,':host {\n display: inline-flex;\n color: var(--pg-icon-color, #453C4F);\n}\n\n[part="svg"] {\n width: var(--pg-icon-width, 1.5rem);\n height: var(--pg-icon-height, 1.5rem);\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},569:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(601),a=n.n(r),o=n(314),i=n.n(o)()(a());i.push([t.id,':host {\n display: block;\n font-family: var(--pg-font-family);\n}\n\n[part="input"] {\n border: 1px solid var(--pg-input-text-border-color, #453C4F);\n border-radius: 0.125rem;\n padding: calc(0.5rem - 1px) 0.75rem;\n font-family: var(--pg-font-family);\n font-size: 1rem;\n outline: none;\n width: calc(100% - 1.5rem - 2px);\n}\n\n[part="input"]:active {\n box-shadow: 0 0 0 3px var(--pg-input-text-active-glow, rgb(79, 143, 249, 0.6));\n}\n[part="input"]:focus {\n box-shadow: 0 0 0 3px var(--pg-input-text-focus-glow, rgb(79, 143, 249, 0.5));\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},601:t=>{t.exports=function(t){return t[1]}}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var o=e[r]={id:r,exports:{}};return t[r](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 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"),a=Symbol("removeObserver"),o=Symbol("getObservers"),i=Symbol("isProxy"),s=Symbol("getTarget"),l=["fill","pop","push","reverse","shift","sort","splice","unshift"],c=new Map;function p(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case i:return!0;case s:return e;case o: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 a:return e=>{c.has(t)&&(c.get(t).delete(e),0===c.get(t).size&&c.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,n)}throw new Error("Unsupported symbol")}if(n in e){if(!Number.isNaN(Number(n)))return"object"==typeof e[n]?p(e[n]):e[n];if("copyWithin"===n)throw new Error("Unsupported array method copyWithin");if(l.includes(n))return c.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return c.get(e).forEach(((t,r)=>{t.forEach((t=>{t(e,n,arguments)}))})),t}:Reflect.get(e,n);if(e[n]instanceof Array)return p(e[n])}return Reflect.get(e,n)},set(t,e,n){if("symbol"==typeof e)throw new Error("Setting symbols not allowed.");if(Array.isArray(t))return Reflect.set(t,e,n);if(c.has(t)){c.get(t).forEach(((t,r)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=c;class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const u=Symbol("init"),h=Symbol("template"),d=Symbol("style"),f=Symbol("parent");function m(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function y(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 r,a;Reflect.defineProperty(e,"name",{value:t.selector,writable:!1,configurable:!1}),!e.prototype[f]||e.prototype[f][e.prototype[f].length-1]instanceof Object.getPrototypeOf(e)?e.prototype instanceof HTMLElement&&(e.prototype[f]=[e.prototype],e.prototype[d]=t.style?[t.style]:[],e.prototype[h]=t.template||""):(e.prototype[f].push(e.prototype),e.prototype[d].push(t.style),e.prototype[h]=(r=e.prototype[h],(a=t.template||null)&&a.match(/<parent\/>/)?a.replace(/<parent\/>/,r):`${r}${a||""}`));const o=e.prototype.connectedCallback||(()=>{}),i=e.prototype.disconnectedCallback||(()=>{});e.prototype.connectedCallback=function(){if(this[u]||void 0!==t.template||void 0!==t.style)if(this[u]){if(this[u]&&t.style);else if(this[u]&&t.selector&&!t.template)throw new Error("You need to pass a template for an extended element.")}else{if(!1===t.useShadow)throw new Error("unsupported");{const t=document.createElement("template");t.innerHTML=e.prototype[h]||"";const n=document.importNode(t.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=e.prototype[d].map((t=>{if(t instanceof CSSStyleSheet)return t;var e=new CSSStyleSheet;return e.replaceSync(t.toString()),e})),r.appendChild(n)}}else!1===t.useShadow||this.attachShadow({mode:"open"});const n=new Set;for(const t of this.shadowRoot.querySelectorAll("*"))-1!==t.localName.indexOf("-")&&n.add(t.localName);const r=Array.from(n.values()).map((t=>customElements.get(t)?Promise.resolve():customElements.whenDefined(t))),a=()=>{this[f].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[y(e)]=!0,t)),{}):{})}))};0===r.length?(this[u]=!0,o.call(this),a()):Promise.all(r).then((()=>{this[u]=!0,o.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));a()}))},e.prototype.disconnectedCallback=function(){i.call(this)},e.prototype.attributeChangedCallback=function(t,e,n){this[y(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 b(t,e){t[u]&&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 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][i]?this[a]:p(this[a]):this[a],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(!g(e))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[a]===e)throw new Error("Setting an array to itself is not allowed.");const t=p(this[a]);if(t[o]){const n=e[i]?(c=e)[i]&&c[s]:e;t.splice(0,this[a].length,...n)}else this[a]=e}else this[a]=t?t(e):e,b(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=m(r);e[r]||(t.observedAttributes.push(n),e[r]=a)}return this[l]=w(e),"array"===this[l]?(this[a]=e,new Proxy(e,{get:(t,e)=>e===x?this[c]:(console.log("errr???"),Reflect.get(this[a],e)),set:(t,e,n)=>{if(e===x)return this[c]=n,!0;const o=Reflect.set(t,e,n);return"length"===e&&this[a].length===n||b(this,r),this[a]=n,o}})):(this[a]=t?t(this.getAttribute(r)??e):this.getAttribute(r)??e,this[a])}}}function E(){return function(t,e){const n=e.name,r=n.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,n,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}Symbol("hasProxy");const x=Symbol("meta");var $=n(277);var P=n(569),k=function(t,e,n,r,a,o){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",p=!e&&t?r.static?t:t.prototype:null,u=e||(p?Object.getOwnPropertyDescriptor(p,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var y=(0,n[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=i(y.get))&&(u.get=s),(s=i(y.set))&&(u.set=s),(s=i(y.init))&&a.unshift(s)}else(s=i(y))&&("field"===l?a.unshift(s):u[c]=s)}p&&Object.defineProperty(p,r.name,u),h=!0},C=function(t,e,n){for(var r=arguments.length>2,a=0;a<e.length;a++)n=r?e[a].call(t,n):e[a].call(t);return r?n:void 0};const O=(()=>{let t,e,n,r,a,o,i=[v({selector:"pg-input-text",style:P.A,template:'<input part="input" type="text"/>'})],s=[],l=HTMLElement,c=[],p=[],u=[],h=[],d=[],f=[],m=[],y=[];(class extends l{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;n=[S()],r=[S()],a=[S()],o=[E()],k(null,null,n,{kind:"field",name:"name",static:!1,private:!1,access:{has:t=>"name"in t,get:t=>t.name,set:(t,e)=>{t.name=e}},metadata:v},c,p),k(null,null,r,{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},u,h),k(null,null,a,{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:v},d,f),k(null,null,o,{kind:"field",name:"$input",static:!1,private:!1,access:{has:t=>"$input"in t,get:t=>t.$input,set:(t,e)=>{t.$input=e}},metadata:v},m,y),k(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}),C(e,s)}name=C(this,c,"");value=(C(this,p),C(this,u,""));placeholder=(C(this,h),C(this,d,""));$input=(C(this,f),C(this,m,void 0));connectedCallback(){this.$input.addEventListener("input",this.handleInput.bind(this)),this.$input.addEventListener("change",this.handleChange.bind(this))}skipValue=(C(this,y),!1);render(t){t.value&&!this.skipValue&&(this.$input.value=this.value),t.placeholder&&(this.$input.placeholder=this.placeholder),this.skipValue=!1}handleInput(t){t.stopPropagation(),this.skipValue=!0,this.value=t.target.value,this.dispatchEvent(new CustomEvent("input",{detail:{value:t.target.value,name:t.name}}))}handleChange(t){this.dispatchEvent(new CustomEvent("change",{detail:{value:t.target.value,name:t.name}}))}});return e})();var j=n(441),A=function(t,e,n,r,a,o){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",p=!e&&t?r.static?t:t.prototype:null,u=e||(p?Object.getOwnPropertyDescriptor(p,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var y=(0,n[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=i(y.get))&&(u.get=s),(s=i(y.set))&&(u.set=s),(s=i(y.init))&&a.unshift(s)}else(s=i(y))&&("field"===l?a.unshift(s):u[c]=s)}p&&Object.defineProperty(p,r.name,u),h=!0},z=function(t,e,n){for(var r=arguments.length>2,a=0;a<e.length;a++)n=r?e[a].call(t,n):e[a].call(t);return r?n:void 0};(()=>{let t,e,n,r,a,o=[v({selector:"pg-icon",style:j.A,template:'<svg part="svg" viewBox="0 0 24 24"> <path part="path" fill="currentColor" d="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"/> </svg>'})],i=[],s=HTMLElement,l=[],c=[],p=[],u=[],h=[],d=[];(class extends s{static{e=this}static{const f="function"==typeof Symbol&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;n=[S()],r=[E()],a=[E()],A(null,null,n,{kind:"field",name:"path",static:!1,private:!1,access:{has:t=>"path"in t,get:t=>t.path,set:(t,e)=>{t.path=e}},metadata:f},l,c),A(null,null,r,{kind:"field",name:"$svg",static:!1,private:!1,access:{has:t=>"$svg"in t,get:t=>t.$svg,set:(t,e)=>{t.$svg=e}},metadata:f},p,u),A(null,null,a,{kind:"field",name:"$path",static:!1,private:!1,access:{has:t=>"$path"in t,get:t=>t.$path,set:(t,e)=>{t.$path=e}},metadata:f},h,d),A(null,t={value:e},o,{kind:"class",name:e.name,metadata:f},null,i),e=t.value,f&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:f}),z(e,i)}path=z(this,l,"M0 0h24v24H0V0zm2 2v20h20V2H2z");$svg=(z(this,c),z(this,p,void 0));$path=(z(this,u),z(this,h,void 0));render(t){if(t.path){const t=getComputedStyle(this).getPropertyValue("--pg-icon-viewbox");if(this.$svg.setAttribute("viewBox",t||"0 0 24 24"),!this.path)throw new Error("invalid path set on pg-icon");this.$path.setAttribute("d",this.path)}}constructor(){super(...arguments),z(this,d)}})})();var T=function(t,e,n,r,a,o){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",p=!e&&t?r.static?t:t.prototype:null,u=e||(p?Object.getOwnPropertyDescriptor(p,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var y=(0,n[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=i(y.get))&&(u.get=s),(s=i(y.set))&&(u.set=s),(s=i(y.init))&&a.unshift(s)}else(s=i(y))&&("field"===l?a.unshift(s):u[c]=s)}p&&Object.defineProperty(p,r.name,u),h=!0},R=function(t,e,n){for(var r=arguments.length>2,a=0;a<e.length;a++)n=r?e[a].call(t,n):e[a].call(t);return r?n:void 0};(()=>{let t,e,n,r,a=[v({selector:"pg-input-text-icon",style:$.A,template:'<div part="grid"> <parent/> <pg-icon part="icon"></pg-icon> </div>'})],o=[],i=O,s=[],l=[],c=[],p=[];(class extends i{static{e=this}static{const u="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;n=[S()],r=[E()],T(null,null,n,{kind:"field",name:"path",static:!1,private:!1,access:{has:t=>"path"in t,get:t=>t.path,set:(t,e)=>{t.path=e}},metadata:u},s,l),T(null,null,r,{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:u},c,p),T(null,t={value:e},a,{kind:"class",name:e.name,metadata:u},null,o),e=t.value,u&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:u}),R(e,o)}path=R(this,s,"M3,3V21H21V3");$icon=(R(this,l),R(this,c,void 0));render(t){t.path&&(this.$icon.path=this.path)}constructor(){super(...arguments),R(this,p)}})})()})();
1
+ (()=>{"use strict";var t={277:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(601),a=n.n(r),o=n(314),i=n.n(o)()(a());i.push([t.id,':host {\n display: block;\n}\n\n[part="grid"] {\n display: grid;\n grid-template-columns: auto 1.5rem;\n}\n\n[part="icon"] {\n grid-row: 1;\n grid-column: 2;\n pointer-events: none;\n transform: translate(calc(-0.35rem + 1px), calc(0.25rem + 1px));\n}\n\n[part="input"] {\n grid-row: 1;\n grid-column: 1 / span 2;\n}\n\n[part="input"]:focus + [part="icon"] {\n --pg-icon-color: #4f8ff9;\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,a,o){"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 p=[].concat(t[c]);r&&i[p[0]]||(void 0!==o&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=o),n&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=n):p[2]=n),a&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=a):p[4]="".concat(a)),e.push(p))}},e}},441:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(601),a=n.n(r),o=n(314),i=n.n(o)()(a());i.push([t.id,':host {\n display: inline-flex;\n color: var(--pg-icon-color, #453C4F);\n}\n\n[part="svg"] {\n width: var(--pg-icon-width, 1.5rem);\n height: var(--pg-icon-height, 1.5rem);\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},569:(t,e,n)=>{n.d(e,{A:()=>l});var r=n(601),a=n.n(r),o=n(314),i=n.n(o)()(a());i.push([t.id,':host {\n display: block;\n font-family: var(--pg-font-family);\n}\n\n[part="input"] {\n border: 1px solid var(--pg-input-text-border-color, #453C4F);\n border-radius: 0.125rem;\n padding: calc(0.5rem - 1px) 0.75rem;\n font-family: var(--pg-font-family);\n font-size: 1rem;\n outline: none;\n width: calc(100% - 1.5rem - 2px);\n}\n\n[part="input"]:active {\n box-shadow: 0 0 0 3px var(--pg-input-text-active-glow, rgb(79, 143, 249, 0.6));\n}\n[part="input"]:focus {\n box-shadow: 0 0 0 3px var(--pg-input-text-focus-glow, rgb(79, 143, 249, 0.5));\n}',""]);var s=new CSSStyleSheet;s.replaceSync(i.toString());const l=s},601:t=>{t.exports=function(t){return t[1]}}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var o=e[r]={id:r,exports:{}};return t[r](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 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"),a=Symbol("removeObserver"),o=Symbol("getObservers"),i=Symbol("swapObserver"),s=Symbol("isProxy"),l=Symbol("getTarget"),c=["fill","pop","push","reverse","shift","sort","splice","unshift"],p=new Map;function u(t){return new Proxy(t,{get(e,n){if("symbol"==typeof n){switch(n){case s:return!0;case l:return e;case o:return p.has(t);case i:return(e,n)=>{const r=p.get(t);r.forEach(((a,o)=>{if(o.getRootNode().host===e){const e=r.get(o);p.has(n)?p.get(n).has(o)?p.get(n).get(o).push(r.get(o)):p.get(n).set(o,r.get(o)):p.set(n,new Map([[o,e]])),p.delete(t),e.forEach((t=>{t(null,h.swap,[n])}))}}))};case r:return(e,n)=>{p.has(t)?p.get(t).has(e)?p.get(t).get(e).push(n):p.get(t).set(e,[n]):p.set(t,new Map([[e,[n]]]))};case a:return e=>{p.has(t)&&(p.get(t).delete(e),0===p.get(t).size&&p.delete(t))};case Symbol.toPrimitive:case Symbol.toStringTag:return Reflect.get(e,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 p.has(e)?function(){const t=Array.prototype[n].apply(e,arguments);return p.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(p.has(t)){p.get(t).forEach(((t,r)=>{t.forEach((t=>{t(e,n)}))}))}return Reflect.set(t,e,n)}})}window.observers=p;const h={fill:"fill",pop:"pop",push:"push",reverse:"reverse",shift:"shift",sort:"sort",splice:"splice",unshift:"unshift",swap:"swap"};class PropError extends Error{constructor(t,e){super(t),this.name="PropError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}Symbol("index");const d=Symbol("init"),f=Symbol("template"),m=Symbol("style"),y=Symbol("parent");function v(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function g(t){return t.replace(/-([a-z])/g,(t=>t[1].toUpperCase()))}function b(t={}){return function(e,n){if("class"!==n.kind)throw new Error("@Component() can only decorate a class");var r,a;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[m]=t.style?[t.style]:[],e.prototype[f]=t.template||""):(e.prototype[y].push(e.prototype),e.prototype[m].push(t.style),e.prototype[f]=(r=e.prototype[f],(a=t.template||null)&&a.match(/<parent\/>/)?a.replace(/<parent\/>/,r):`${r}${a||""}`));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[f]||"";const n=document.importNode(t.content,!0),r=this.attachShadow({mode:"open"});r.adoptedStyleSheets=e.prototype[m].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))),a=()=>{this[y].map((t=>{t.render&&t.render.call(this,e.observedAttributes?e.observedAttributes.reduce(((t,e)=>(t[g(e)]=!0,t)),{}):{})}))};0===r.length?(this[d]=!0,o.call(this),a()):Promise.all(r).then((()=>{this[d]=!0,o.call(this);for(const t of this.shadowRoot.querySelectorAll("slot"))t.dispatchEvent(new CustomEvent("slotchange"));a()}))},e.prototype.disconnectedCallback=function(){i.call(this)},e.prototype.attributeChangedCallback=function(t,e,n){this[g(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 w(t){return!!t&&t.constructor===Array}function S(t,e){t[d]&&t[y].map((n=>{n.render&&n.render.call(t,{[e]:!0})}))}function E(t){return null===t?"null":w(t)?"array":typeof t}function x(t){return function(e,n){const r=n.name,a=Symbol(r),c=Symbol(`${r}:type`),p=Symbol(`${r}:meta`);return n.addInitializer((function(){Reflect.defineProperty(this,r,{get:()=>"object"===this[c]||"array"===this[c]?this[a][s]?this[a]:u(this[a]):this[a],set:e=>{const n=E(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(!w(e))throw new PropError(`Array "${r}" (Prop) initialized already. Reassignments must be array type.`,Object.getOwnPropertyDescriptor(this,r)?.set);if(this[a]===e)throw new Error("Setting an array to itself is not allowed.");const t=u(this[a]);if(t[o]){const n=e[s]?e[l]:e;t[i](this,n),this[a]=e,console.log(">>> trigger render???",this,r)}else this[a]=e}else this[a]=t?t(e):e,S(this,r)}})})),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=v(r);e[r]||(t.observedAttributes.push(n),e[r]=a)}return this[c]=E(e),"array"===this[c]?(this[a]=e,new Proxy(e,{get:(t,e)=>e===P?this[p]:(console.log("errr???"),Reflect.get(this[a],e)),set:(t,e,n)=>{if(e===P)return this[p]=n,!0;const o=Reflect.set(t,e,n);return"length"===e&&this[a].length===n||S(this,r),this[a]=n,o}})):(this[a]=t?t(this.getAttribute(r)??e):this.getAttribute(r)??e,this[a])}}}function $(){return function(t,e){const n=e.name,r=n.replace(/^\$/,"");e.addInitializer((function(){let t=null;Reflect.defineProperty(this,n,{get(){return t??(t=this.shadowRoot?.querySelector(`[part~=${r}]`))}})}))}}Symbol("hasProxy");const P=Symbol("meta");var k=n(277);var O=n(569),C=function(t,e,n,r,a,o){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",p=!e&&t?r.static?t:t.prototype:null,u=e||(p?Object.getOwnPropertyDescriptor(p,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var y=(0,n[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=i(y.get))&&(u.get=s),(s=i(y.set))&&(u.set=s),(s=i(y.init))&&a.unshift(s)}else(s=i(y))&&("field"===l?a.unshift(s):u[c]=s)}p&&Object.defineProperty(p,r.name,u),h=!0},j=function(t,e,n){for(var r=arguments.length>2,a=0;a<e.length;a++)n=r?e[a].call(t,n):e[a].call(t);return r?n:void 0};const A=(()=>{let t,e,n,r,a,o,i=[b({selector:"pg-input-text",style:O.A,template:'<input part="input" type="text"/>'})],s=[],l=HTMLElement,c=[],p=[],u=[],h=[],d=[],f=[],m=[],y=[];(class extends l{static{e=this}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(l[Symbol.metadata]??null):void 0;n=[x()],r=[x()],a=[x()],o=[$()],C(null,null,n,{kind:"field",name:"name",static:!1,private:!1,access:{has:t=>"name"in t,get:t=>t.name,set:(t,e)=>{t.name=e}},metadata:v},c,p),C(null,null,r,{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},u,h),C(null,null,a,{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:v},d,f),C(null,null,o,{kind:"field",name:"$input",static:!1,private:!1,access:{has:t=>"$input"in t,get:t=>t.$input,set:(t,e)=>{t.$input=e}},metadata:v},m,y),C(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}),j(e,s)}name=j(this,c,"");value=(j(this,p),j(this,u,""));placeholder=(j(this,h),j(this,d,""));$input=(j(this,f),j(this,m,void 0));connectedCallback(){this.$input.addEventListener("input",this.handleInput.bind(this)),this.$input.addEventListener("change",this.handleChange.bind(this))}skipValue=(j(this,y),!1);render(t){t.value&&!this.skipValue&&(this.$input.value=this.value),t.placeholder&&(this.$input.placeholder=this.placeholder),this.skipValue=!1}handleInput(t){t.stopPropagation(),this.skipValue=!0,this.value=t.target.value,this.dispatchEvent(new CustomEvent("input",{detail:{value:t.target.value,name:t.name}}))}handleChange(t){this.dispatchEvent(new CustomEvent("change",{detail:{value:t.target.value,name:t.name}}))}});return e})();var z=n(441),T=function(t,e,n,r,a,o){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",p=!e&&t?r.static?t:t.prototype:null,u=e||(p?Object.getOwnPropertyDescriptor(p,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var y=(0,n[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=i(y.get))&&(u.get=s),(s=i(y.set))&&(u.set=s),(s=i(y.init))&&a.unshift(s)}else(s=i(y))&&("field"===l?a.unshift(s):u[c]=s)}p&&Object.defineProperty(p,r.name,u),h=!0},R=function(t,e,n){for(var r=arguments.length>2,a=0;a<e.length;a++)n=r?e[a].call(t,n):e[a].call(t);return r?n:void 0};(()=>{let t,e,n,r,a,o=[b({selector:"pg-icon",style:z.A,template:'<svg part="svg" viewBox="0 0 24 24"> <path part="path" fill="currentColor" d="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"/> </svg>'})],i=[],s=HTMLElement,l=[],c=[],p=[],u=[],h=[],d=[];(class extends s{static{e=this}static{const f="function"==typeof Symbol&&Symbol.metadata?Object.create(s[Symbol.metadata]??null):void 0;n=[x()],r=[$()],a=[$()],T(null,null,n,{kind:"field",name:"path",static:!1,private:!1,access:{has:t=>"path"in t,get:t=>t.path,set:(t,e)=>{t.path=e}},metadata:f},l,c),T(null,null,r,{kind:"field",name:"$svg",static:!1,private:!1,access:{has:t=>"$svg"in t,get:t=>t.$svg,set:(t,e)=>{t.$svg=e}},metadata:f},p,u),T(null,null,a,{kind:"field",name:"$path",static:!1,private:!1,access:{has:t=>"$path"in t,get:t=>t.$path,set:(t,e)=>{t.$path=e}},metadata:f},h,d),T(null,t={value:e},o,{kind:"class",name:e.name,metadata:f},null,i),e=t.value,f&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:f}),R(e,i)}path=R(this,l,"M0 0h24v24H0V0zm2 2v20h20V2H2z");$svg=(R(this,c),R(this,p,void 0));$path=(R(this,u),R(this,h,void 0));render(t){if(t.path){const t=getComputedStyle(this).getPropertyValue("--pg-icon-viewbox");if(this.$svg.setAttribute("viewBox",t||"0 0 24 24"),!this.path)throw new Error("invalid path set on pg-icon");this.$path.setAttribute("d",this.path)}}constructor(){super(...arguments),R(this,d)}})})();var M=function(t,e,n,r,a,o){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",p=!e&&t?r.static?t:t.prototype:null,u=e||(p?Object.getOwnPropertyDescriptor(p,r.name):{}),h=!1,d=n.length-1;d>=0;d--){var f={};for(var m in r)f[m]="access"===m?{}:r[m];for(var m in r.access)f.access[m]=r.access[m];f.addInitializer=function(t){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(i(t||null))};var y=(0,n[d])("accessor"===l?{get:u.get,set:u.set}:u[c],f);if("accessor"===l){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(s=i(y.get))&&(u.get=s),(s=i(y.set))&&(u.set=s),(s=i(y.init))&&a.unshift(s)}else(s=i(y))&&("field"===l?a.unshift(s):u[c]=s)}p&&Object.defineProperty(p,r.name,u),h=!0},H=function(t,e,n){for(var r=arguments.length>2,a=0;a<e.length;a++)n=r?e[a].call(t,n):e[a].call(t);return r?n:void 0};(()=>{let t,e,n,r,a=[b({selector:"pg-input-text-icon",style:k.A,template:'<div part="grid"> <parent/> <pg-icon part="icon"></pg-icon> </div>'})],o=[],i=A,s=[],l=[],c=[],p=[];(class extends i{static{e=this}static{const u="function"==typeof Symbol&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;n=[x()],r=[$()],M(null,null,n,{kind:"field",name:"path",static:!1,private:!1,access:{has:t=>"path"in t,get:t=>t.path,set:(t,e)=>{t.path=e}},metadata:u},s,l),M(null,null,r,{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:u},c,p),M(null,t={value:e},a,{kind:"class",name:e.name,metadata:u},null,o),e=t.value,u&&Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:u}),H(e,o)}path=H(this,s,"M3,3V21H21V3");$icon=(H(this,l),H(this,c,void 0));render(t){t.path&&(this.$icon.path=this.path)}constructor(){super(...arguments),H(this,p)}})})()})();