@mborecki/crossword 0.0.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/cjs/{index-TyGpRn4d.js → index-BlTGwvVC.js} +63 -2
  2. package/dist/cjs/{index-CwHIXXW5.js → index-CEGyCfpa.js} +29 -1
  3. package/dist/cjs/index.cjs.js +2 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/mb-crossword.cjs.entry.js +159 -38
  6. package/dist/cjs/mb-crossword.cjs.js +2 -2
  7. package/dist/collection/components/crossword/cell.js +7 -2
  8. package/dist/collection/components/crossword/clue.js +2 -2
  9. package/dist/collection/components/crossword/mb-crossword.css +107 -13
  10. package/dist/collection/components/crossword/mb-crossword.js +189 -32
  11. package/dist/collection/utils/utils.js +6 -0
  12. package/dist/components/index.js +1 -1
  13. package/dist/components/mb-crossword.js +1 -1
  14. package/dist/esm/{index-B4XIBYtu.js → index-BGHKtxML.js} +63 -2
  15. package/dist/esm/{index-0i8AYf_G.js → index-Dn3GSx6U.js} +29 -2
  16. package/dist/esm/index.js +1 -1
  17. package/dist/esm/loader.js +3 -3
  18. package/dist/esm/mb-crossword.entry.js +159 -38
  19. package/dist/esm/mb-crossword.js +3 -3
  20. package/dist/mb-crossword/index.esm.js +1 -1
  21. package/dist/mb-crossword/mb-crossword.esm.js +1 -1
  22. package/dist/mb-crossword/p-34ea8cf1.entry.js +1 -0
  23. package/dist/mb-crossword/{p-B4XIBYtu.js → p-BGHKtxML.js} +2 -2
  24. package/dist/mb-crossword/p-Dn3GSx6U.js +1 -0
  25. package/dist/types/components/crossword/cell.d.ts +3 -1
  26. package/dist/types/components/crossword/clue.d.ts +5 -3
  27. package/dist/types/components/crossword/mb-crossword.d.ts +18 -6
  28. package/dist/types/components/crossword/types.d.ts +21 -2
  29. package/dist/types/components.d.ts +9 -0
  30. package/dist/types/roboczy/mb-puzzle/apps/crossword/.stencil/shared/grid/src/grid.d.ts +12 -0
  31. package/dist/types/roboczy/mb-puzzle/apps/crossword/.stencil/shared/grid/vitest.config.d.ts +2 -0
  32. package/dist/types/roboczy/mb-puzzle/apps/crossword/.stencil/shared/vec2/src/vec2.d.ts +9 -2
  33. package/dist/types/utils/utils.d.ts +1 -0
  34. package/package.json +6 -1
  35. package/dist/mb-crossword/p-0i8AYf_G.js +0 -1
  36. package/dist/mb-crossword/p-5b227b8e.entry.js +0 -1
@@ -1 +1 @@
1
- var t,e,n,i,s,r,o,l,h,f,c,u,a,p,d,v,m,b=Object.create,w=Object.defineProperty,g=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyNames,$=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty,j=t=>{throw TypeError(t)},S=(t,e)=>function(){return e||(0,t[y(t)[0]])((e={exports:{}}).exports,e),e.exports},E=(t,e,n)=>e.has(t)||j("Cannot "+n),M=(t,e,n)=>(E(t,e,"read from private field"),n?n.call(t):e.get(t)),k=(t,e,n)=>e.has(t)?j("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),x=(t,e,n)=>(E(t,e,"write to private field"),e.set(t,n),n),N=(t,e,n)=>(E(t,e,"access private method"),n),P=S({"node_modules/balanced-match/index.js"(t,e){function n(t,e,n){t instanceof RegExp&&(t=i(t,n)),e instanceof RegExp&&(e=i(e,n));var r=s(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function i(t,e){var n=e.match(t);return n?n[0]:null}function s(t,e,n){var i,s,r,o,l,h=n.indexOf(t),f=n.indexOf(e,h+1),c=h;if(h>=0&&f>0){if(t===e)return[h,f];for(i=[],r=n.length;c>=0&&!l;)c==h?(i.push(c),h=n.indexOf(t,c+1)):1==i.length?l=[i.pop(),f]:((s=i.pop())<r&&(r=s,o=f),f=n.indexOf(e,c+1)),c=h<f&&h>=0?h:f;i.length&&(l=[r,o])}return l}e.exports=n,n.range=s}}),W=S({"node_modules/brace-expansion/index.js"(t,e){var n=P();e.exports=function(t){return t?("{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2)),v(function(t){return t.split("\\\\").join(i).split("\\{").join(s).split("\\}").join(r).split("\\,").join(o).split("\\.").join(l)}(t),!0).map(f)):[]};var i="\0SLASH"+Math.random()+"\0",s="\0OPEN"+Math.random()+"\0",r="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",l="\0PERIOD"+Math.random()+"\0";function h(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function f(t){return t.split(i).join("\\").split(s).join("{").split(r).join("}").split(o).join(",").split(l).join(".")}function c(t){if(!t)return[""];var e=[],i=n("{","}",t);if(!i)return t.split(",");var s=i.body,r=i.post,o=i.pre.split(",");o[o.length-1]+="{"+s+"}";var l=c(r);return r.length&&(o[o.length-1]+=l.shift(),o.push.apply(o,l)),e.push.apply(e,o),e}function u(t){return"{"+t+"}"}function a(t){return/^-?0\d/.test(t)}function p(t,e){return t<=e}function d(t,e){return t>=e}function v(t,e){var i=[],s=n("{","}",t);if(!s)return[t];var o=s.pre,l=s.post.length?v(s.post,!1):[""];if(/\$$/.test(s.pre))for(var f=0;f<l.length;f++)i.push(R=o+"{"+s.body+"}"+l[f]);else{var m,b,w=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),y=w||g,$=s.body.indexOf(",")>=0;if(!y&&!$)return s.post.match(/,(?!,).*\}/)?v(t=s.pre+"{"+s.body+r+s.post):[t];if(y)m=s.body.split(/\.\./);else if(1===(m=c(s.body)).length&&1===(m=v(m[0],!1).map(u)).length)return l.map((function(t){return s.pre+m[0]+t}));if(y){var O=h(m[0]),j=h(m[1]),S=Math.max(m[0].length,m[1].length),E=3==m.length?Math.abs(h(m[2])):1,M=p;j<O&&(E*=-1,M=d);var k=m.some(a);b=[];for(var x=O;M(x,j);x+=E){var N;if(g)"\\"===(N=String.fromCharCode(x))&&(N="");else if(N=x+"",k){var P=S-N.length;if(P>0){var W=Array(P+1).join("0");N=x<0?"-"+W+N.slice(1):W+N}}b.push(N)}}else{b=[];for(var A=0;A<m.length;A++)b.push.apply(b,v(m[A],!1))}for(A=0;A<b.length;A++)for(f=0;f<l.length;f++){var R=o+b[A]+l[f];(!e||y||R)&&i.push(R)}}return i}}}),A=(t,e)=>{var n;Object.entries(null!=(n=e.i.t)?n:{}).map((([n,[i]])=>{if(31&i||32&i){const i=t[n],s=function(t,e){for(;t;){const n=Object.getOwnPropertyDescriptor(t,e);if(null==n?void 0:n.get)return n;t=Object.getPrototypeOf(t)}}(Object.getPrototypeOf(t),n)||Object.getOwnPropertyDescriptor(t,n);s&&Object.defineProperty(t,n,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),t[n]=e.o.has(n)?e.o.get(n):i}}))},R=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},C=(t,e)=>e in t,z=(t,e)=>(0,console.error)(t,e),L=new Map,_="undefined"!=typeof window?window:{},D=_.HTMLElement||class{},T={l:0,h:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,i)=>t.addEventListener(e,n,i),rel:(t,e,n,i)=>t.removeEventListener(e,n,i),ce:(t,e)=>new CustomEvent(t,e)},F=(()=>{try{return!!_.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),U=!!F&&(()=>!!_.document&&Object.getOwnPropertyDescriptor(_.document.adoptedStyleSheets,"length").writable)(),Z=!1,G=[],I=[],V=(t,e)=>n=>{t.push(n),Z||(Z=!0,e&&4&T.l?B(q):T.raf(q))},H=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){z(t)}t.length=0},q=()=>{H(G),H(I),(Z=G.length>0)&&T.raf(q)},B=t=>Promise.resolve(void 0).then(t),J=V(I,!0),Y=t=>{const e=new URL(t,T.h);return e.origin!==_.location.origin?e.href:e.pathname},K=t=>T.h=t,Q=t=>"object"==(t=typeof t)||"function"===t,X=((t,e,n)=>(n=null!=t?b($(t)):{},((t,e,n,i)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let n of y(e))O.call(t,n)||undefined===n||w(t,n,{get:()=>e[n],enumerable:!(i=g(e,n))||i.enumerable});return t})(w(n,"default",{value:t,enumerable:!0}),t)))(W()),tt=t=>{if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},et={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},nt=t=>t.replace(/[[\]\\-]/g,"\\$&"),it=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),st=t=>t.join(""),rt=(t,e)=>{const n=e;if("["!==t.charAt(n))throw Error("not in a brace expression");const i=[],s=[];let r=n+1,o=!1,l=!1,h=!1,f=!1,c=n,u="";t:for(;r<t.length;){const e=t.charAt(r);if("!"!==e&&"^"!==e||r!==n+1){if("]"===e&&o&&!h){c=r+1;break}if(o=!0,"\\"!==e||h){if("["===e&&!h)for(const[e,[o,h,f]]of Object.entries(et))if(t.startsWith(e,r)){if(u)return["$.",!1,t.length-n,!0];r+=e.length,f?s.push(o):i.push(o),l=l||h;continue t}h=!1,u?(e>u?i.push(nt(u)+"-"+nt(e)):e===u&&i.push(nt(e)),u="",r++):t.startsWith("-]",r+1)?(i.push(nt(e+"-")),r+=2):t.startsWith("-",r+1)?(u=e,r+=2):(i.push(nt(e)),r++)}else h=!0,r++}else f=!0,r++}if(c<r)return["",!1,0,!1];if(!i.length&&!s.length)return["$.",!1,t.length-n,!0];if(0===s.length&&1===i.length&&/^\\?.$/.test(i[0])&&!f){const t=2===i[0].length?i[0].slice(-1):i[0];return[it(t),!1,c-n,!1]}const a="["+(f?"^":"")+st(i)+"]",p="["+(f?"":"^")+st(s)+"]";return[i.length&&s.length?"("+a+"|"+p+")":i.length?a:p,l,c-n,!0]},ot=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),lt=new Set(["!","?","+","*","@"]),ht=t=>lt.has(t),ft="(?!\\.)",ct=new Set(["[","."]),ut=new Set(["..","."]),at=new Set("().*{}+?[]^$\\!"),pt=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),dt="[^/]",vt=dt+"*?",mt=dt+"+?",bt=class b{constructor(a,p,d={}){k(this,u),((t,e,n)=>{((t,e,n)=>{e in t?w(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,e+"",n)})(this,"type"),k(this,t),k(this,e),k(this,n,!1),k(this,i,[]),k(this,s),k(this,r),k(this,o),k(this,l,!1),k(this,h),k(this,f),k(this,c,!1),this.type=a,a&&x(this,e,!0),x(this,s,p),x(this,t,M(this,s)?M(M(this,s),t):this),x(this,h,M(this,t)===this?d:M(M(this,t),h)),x(this,o,M(this,t)===this?[]:M(M(this,t),o)),"!"!==a||M(M(this,t),l)||M(this,o).push(this),x(this,r,M(this,s)?M(M(this,s),i).length:0)}get hasMagic(){if(void 0!==M(this,e))return M(this,e);for(const t of M(this,i))if("string"!=typeof t&&(t.type||t.hasMagic))return x(this,e,!0);return M(this,e)}toString(){return void 0!==M(this,f)?M(this,f):x(this,f,this.type?this.type+"("+M(this,i).map((t=>t+"")).join("|")+")":M(this,i).map((t=>t+"")).join(""))}push(...t){for(const e of t)if(""!==e){if("string"!=typeof e&&!(e instanceof b&&M(e,s)===this))throw Error("invalid part: "+e);M(this,i).push(e)}}toJSON(){var e;const n=null===this.type?M(this,i).slice().map((t=>"string"==typeof t?t:t.toJSON())):[this.type,...M(this,i).map((t=>t.toJSON()))];return this.isStart()&&!this.type&&n.unshift([]),this.isEnd()&&(this===M(this,t)||M(M(this,t),l)&&"!"===(null==(e=M(this,s))?void 0:e.type))&&n.push({}),n}isStart(){var e;if(M(this,t)===this)return!0;if(!(null==(e=M(this,s))?void 0:e.isStart()))return!1;if(0===M(this,r))return!0;const n=M(this,s);for(let t=0;t<M(this,r);t++){const e=M(n,i)[t];if(!(e instanceof b&&"!"===e.type))return!1}return!0}isEnd(){var e,n,o;if(M(this,t)===this)return!0;if("!"===(null==(e=M(this,s))?void 0:e.type))return!0;if(!(null==(n=M(this,s))?void 0:n.isEnd()))return!1;if(!this.type)return null==(o=M(this,s))?void 0:o.isEnd();const l=M(this,s)?M(M(this,s),i).length:0;return M(this,r)===l-1}copyIn(t){this.push("string"==typeof t?t:t.clone(this))}clone(t){const e=new b(this.type,t);for(const t of M(this,i))e.copyIn(t);return e}static fromGlob(t,e={}){var n;const i=new b(null,void 0,e);return N(n=b,p,d).call(n,t,i,0,e),i}toMMPattern(){if(this!==M(this,t))return M(this,t).toMMPattern();const n=""+this,[i,s,r,o]=this.toRegExpSource();if(!(r||M(this,e)||M(this,h).nocase&&!M(this,h).nocaseMagicOnly&&n.toUpperCase()!==n.toLowerCase()))return s;const l=(M(this,h).nocase?"i":"")+(o?"u":"");return Object.assign(RegExp(`^${i}$`,l),{_src:i,_glob:n})}get options(){return M(this,h)}toRegExpSource(r){var o;const f=null!=r?r:!!M(this,h).dot;if(M(this,t)===this&&N(this,u,a).call(this),!this.type){const h=this.isStart()&&this.isEnd(),c=M(this,i).map((t=>{var i;const[s,o,l,f]="string"==typeof t?N(i=b,p,m).call(i,t,M(this,e),h):t.toRegExpSource(r);return x(this,e,M(this,e)||l),x(this,n,M(this,n)||f),s})).join("");let u="";if(this.isStart()&&"string"==typeof M(this,i)[0]&&(1!==M(this,i).length||!ut.has(M(this,i)[0]))){const t=ct,e=f&&t.has(c.charAt(0))||c.startsWith("\\.")&&t.has(c.charAt(2))||c.startsWith("\\.\\.")&&t.has(c.charAt(4)),n=!f&&!r&&t.has(c.charAt(0));u=e?"(?!(?:^|/)\\.\\.?(?:$|/))":n?ft:""}let a="";return this.isEnd()&&M(M(this,t),l)&&"!"===(null==(o=M(this,s))?void 0:o.type)&&(a="(?:$|\\/)"),[u+c+a,ot(c),x(this,e,!!M(this,e)),M(this,n)]}const d="*"===this.type||"+"===this.type,w="!"===this.type?"(?:(?!(?:":"(?:";let g=N(this,u,v).call(this,f);if(this.isStart()&&this.isEnd()&&!g&&"!"!==this.type){const t=""+this;return x(this,i,[t]),this.type=null,x(this,e,void 0),[t,ot(""+this),!1,!1]}let y=!d||r||f?"":N(this,u,v).call(this,!0);y===g&&(y=""),y&&(g=`(?:${g})(?:${y})*?`);let $="";return $="!"===this.type&&M(this,c)?(this.isStart()&&!f?ft:"")+mt:w+g+("!"===this.type?"))"+(!this.isStart()||f||r?"":ft)+vt+")":"@"===this.type?")":"?"===this.type?")?":"+"===this.type&&y?")":"*"===this.type&&y?")?":")"+this.type),[$,ot(g),x(this,e,!!M(this,e)),M(this,n)]}};t=new WeakMap,e=new WeakMap,n=new WeakMap,i=new WeakMap,s=new WeakMap,r=new WeakMap,o=new WeakMap,l=new WeakMap,h=new WeakMap,f=new WeakMap,c=new WeakMap,u=new WeakSet,a=function(){if(this!==M(this,t))throw Error("should only call on root");if(M(this,l))return this;let e;for(x(this,l,!0);e=M(this,o).pop();){if("!"!==e.type)continue;let t=e,n=M(t,s);for(;n;){for(let s=M(t,r)+1;!n.type&&s<M(n,i).length;s++)for(const t of M(e,i)){if("string"==typeof t)throw Error("string part in extglob AST??");t.copyIn(M(n,i)[s])}t=n,n=M(t,s)}}return this},p=new WeakSet,d=function(t,n,s,r){var o,l;let h=!1,f=!1,u=-1,a=!1;if(null===n.type){let e=s,i="";for(;e<t.length;){const s=t.charAt(e++);if(h||"\\"===s)h=!h,i+=s;else if(f)e===u+1?"^"!==s&&"!"!==s||(a=!0):"]"!==s||e===u+2&&a||(f=!1),i+=s;else if("["!==s)if(r.noext||!ht(s)||"("!==t.charAt(e))i+=s;else{n.push(i),i="";const l=new bt(s,n);e=N(o=bt,p,d).call(o,t,l,e,r),n.push(l)}else f=!0,u=e,a=!1,i+=s}return n.push(i),e}let v=s+1,m=new bt(null,n);const b=[];let w="";for(;v<t.length;){const e=t.charAt(v++);if(h||"\\"===e)h=!h,w+=e;else if(f)v===u+1?"^"!==e&&"!"!==e||(a=!0):"]"!==e||v===u+2&&a||(f=!1),w+=e;else if("["!==e)if(ht(e)&&"("===t.charAt(v)){m.push(w),w="";const n=new bt(e,m);m.push(n),v=N(l=bt,p,d).call(l,t,n,v,r)}else if("|"!==e){if(")"===e)return""===w&&0===M(n,i).length&&x(n,c,!0),m.push(w),w="",n.push(...b,m),v;w+=e}else m.push(w),w="",b.push(m),m=new bt(null,n);else f=!0,u=v,a=!1,w+=e}return n.type=null,x(n,e,void 0),x(n,i,[t.substring(s-1)]),v},v=function(t){return M(this,i).map((e=>{if("string"==typeof e)throw Error("string type in extglob ast??");const[i,s,r,o]=e.toRegExpSource(t);return x(this,n,M(this,n)||o),i})).filter((t=>!(this.isStart()&&this.isEnd()&&!t))).join("|")},m=function(t,e,n=!1){let i=!1,s="",r=!1;for(let o=0;o<t.length;o++){const l=t.charAt(o);if(i)i=!1,s+=(at.has(l)?"\\":"")+l;else if("\\"!==l){if("["===l){const[n,i,l,h]=rt(t,o);if(l){s+=n,r=r||i,o+=l-1,e=e||h;continue}}"*"!==l?"?"!==l?s+=pt(l):(s+=dt,e=!0):(s+=n&&"*"===t?mt:vt,e=!0)}else o===t.length-1?s+="\\\\":i=!0}return[s,ot(t),!!e,r]},k(bt,p);var wt=bt,gt=(t,e,n={})=>(tt(e),!(!n.nocomment&&"#"===e.charAt(0))&&new Vt(e,n).match(t)),yt=/^\*+([^+@!?\*\[\(]*)$/,$t=t=>e=>!e.startsWith(".")&&e.endsWith(t),Ot=t=>e=>e.endsWith(t),jt=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),St=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),Et=/^\*+\.\*+$/,Mt=t=>!t.startsWith(".")&&t.includes("."),kt=t=>"."!==t&&".."!==t&&t.includes("."),xt=/^\.\*+$/,Nt=t=>"."!==t&&".."!==t&&t.startsWith("."),Pt=/^\*+$/,Wt=t=>0!==t.length&&!t.startsWith("."),At=t=>0!==t.length&&"."!==t&&".."!==t,Rt=/^\?+([^+@!?\*\[\(]*)?$/,Ct=([t,e=""])=>{const n=Dt([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},zt=([t,e=""])=>{const n=Tt([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},Lt=([t,e=""])=>{const n=Tt([t]);return e?t=>n(t)&&t.endsWith(e):n},_t=([t,e=""])=>{const n=Dt([t]);return e?t=>n(t)&&t.endsWith(e):n},Dt=([t])=>{const e=t.length;return t=>t.length===e&&!t.startsWith(".")},Tt=([t])=>{const e=t.length;return t=>t.length===e&&"."!==t&&".."!==t},Ft="object"==typeof process&&process?"object"==typeof process.env&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";gt.sep="win32"===Ft?"\\":"/";var Ut=Symbol("globstar **");gt.GLOBSTAR=Ut,gt.filter=(t,e={})=>n=>gt(n,t,e);var Zt=(t,e={})=>Object.assign({},t,e);gt.defaults=t=>{if(!t||"object"!=typeof t||!Object.keys(t).length)return gt;const e=gt;return Object.assign(((n,i,s={})=>e(n,i,Zt(t,s))),{Minimatch:class extends e.Minimatch{constructor(e,n={}){super(e,Zt(t,n))}static defaults(n){return e.defaults(Zt(t,n)).Minimatch}},AST:class extends e.AST{constructor(e,n,i={}){super(e,n,Zt(t,i))}static fromGlob(n,i={}){return e.AST.fromGlob(n,Zt(t,i))}},unescape:(n,i={})=>e.unescape(n,Zt(t,i)),escape:(n,i={})=>e.escape(n,Zt(t,i)),filter:(n,i={})=>e.filter(n,Zt(t,i)),defaults:n=>e.defaults(Zt(t,n)),makeRe:(n,i={})=>e.makeRe(n,Zt(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,Zt(t,i)),match:(n,i,s={})=>e.match(n,i,Zt(t,s)),sep:e.sep,GLOBSTAR:Ut})};var Gt=(t,e={})=>(tt(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,X.default)(t));gt.braceExpand=Gt,gt.makeRe=(t,e={})=>new Vt(t,e).makeRe(),gt.match=(t,e,n={})=>{const i=new Vt(e,n);return t=t.filter((t=>i.match(t))),i.options.nonull&&!t.length&&t.push(e),t};var It=/[?*]|[+@!]\(.*?\)|\[|\]/,Vt=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){tt(t),this.options=e=e||{},this.pattern=t,this.platform=e.platform||Ft,this.isWindows="win32"===this.platform,this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||!1===e.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=void 0!==e.windowsNoMagicRoot?e.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const e of t)if("string"!=typeof e)return!0;return!1}debug(...t){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...t)=>console.error(...t)),this.debug(this.pattern,this.globSet);const n=this.globSet.map((t=>this.slashSplit(t)));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((t=>{if(this.isWindows&&this.windowsNoMagicRoot){const e=!(""!==t[0]||""!==t[1]||"?"!==t[2]&&It.test(t[2])||It.test(t[3])),n=/^[a-z]:/i.test(t[0]);if(e)return[...t.slice(0,4),...t.slice(4).map((t=>this.parse(t)))];if(n)return[t[0],...t.slice(1).map((t=>this.parse(t)))]}return t.map((t=>this.parse(t)))}));if(this.debug(this.pattern,i),this.set=i.filter((t=>-1===t.indexOf(!1))),this.isWindows)for(let t=0;t<this.set.length;t++){const e=this.set[t];""===e[0]&&""===e[1]&&"?"===this.globParts[t][2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])&&(e[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let e=0;e<t.length;e++)for(let n=0;n<t[e].length;n++)"**"===t[e][n]&&(t[e][n]="*");const{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=e>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((t=>{let e=-1;for(;-1!==(e=t.indexOf("**",e+1));){let n=e;for(;"**"===t[n+1];)n++;n!==e&&t.splice(e,n-e)}return t}))}levelOneOptimize(t){return t.map((t=>0===(t=t.reduce(((t,e)=>{const n=t[t.length-1];return"**"===e&&"**"===n?t:".."===e&&n&&".."!==n&&"."!==n&&"**"!==n?(t.pop(),t):(t.push(e),t)}),[])).length?[""]:t))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){const i=t[n];1===n&&""===i&&""===t[0]||"."!==i&&""!==i||(e=!0,t.splice(n,1),n--)}"."!==t[0]||2!==t.length||"."!==t[1]&&""!==t[1]||(e=!0,t.pop())}let n=0;for(;-1!==(n=t.indexOf("..",n+1));){const i=t[n-1];i&&"."!==i&&".."!==i&&"**"!==i&&(e=!0,t.splice(n-1,2),n-=2)}}while(e);return 0===t.length?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let n of t){let i=-1;for(;-1!==(i=n.indexOf("**",i+1));){let s=i;for(;"**"===n[s+1];)s++;s>i&&n.splice(i+1,s-i);const r=n[i+2],o=n[i+3];if(".."!==n[i+1])continue;if(!r||"."===r||".."===r||!o||"."===o||".."===o)continue;e=!0,n.splice(i,1);const l=n.slice(0);l[i]="**",t.push(l),i--}if(!this.preserveMultipleSlashes){for(let t=1;t<n.length-1;t++){const i=n[t];1===t&&""===i&&""===n[0]||"."!==i&&""!==i||(e=!0,n.splice(t,1),t--)}"."!==n[0]||2!==n.length||"."!==n[1]&&""!==n[1]||(e=!0,n.pop())}let s=0;for(;-1!==(s=n.indexOf("..",s+1));){const t=n[s-1];t&&"."!==t&&".."!==t&&"**"!==t&&(e=!0,n.splice(s-1,2,...1===s&&"**"===n[s+1]?["."]:[]),0===n.length&&n.push(""),s-=2)}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let n=e+1;n<t.length;n++){const i=this.partsMatch(t[e],t[n],!this.preserveMultipleSlashes);i&&(t[e]=i,t[n]=[])}return t.filter((t=>t.length))}partsMatch(t,e,n=!1){let i=0,s=0,r=[],o="";for(;i<t.length&&s<e.length;)if(t[i]===e[s])r.push("b"===o?e[s]:t[i]),i++,s++;else if(n&&"**"===t[i]&&e[s]===t[i+1])r.push(t[i]),i++;else if(n&&"**"===e[s]&&t[i]===e[s+1])r.push(e[s]),s++;else if("*"!==t[i]||!e[s]||!this.options.dot&&e[s].startsWith(".")||"**"===e[s]){if("*"!==e[s]||!t[i]||!this.options.dot&&t[i].startsWith(".")||"**"===t[i])return!1;if("a"===o)return!1;o="b",r.push(e[s]),i++,s++}else{if("b"===o)return!1;o="a",r.push(t[i]),i++,s++}return t.length===e.length&&r}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=!1,n=0;for(let i=0;i<t.length&&"!"===t.charAt(i);i++)e=!e,n++;n&&(this.pattern=t.slice(n)),this.negate=e}matchOne(t,e,n=!1){const i=this.options;if(this.isWindows){const n="string"==typeof t[0]&&/^[a-z]:$/i.test(t[0]),i=!n&&""===t[0]&&""===t[1]&&"?"===t[2]&&/^[a-z]:$/i.test(t[3]),s="string"==typeof e[0]&&/^[a-z]:$/i.test(e[0]),r=i?3:n?0:void 0,o=!s&&""===e[0]&&""===e[1]&&"?"===e[2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])?3:s?0:void 0;if("number"==typeof r&&"number"==typeof o){const[n,i]=[t[r],e[o]];n.toLowerCase()===i.toLowerCase()&&(e[o]=n,o>r?e=e.slice(o):r>o&&(t=t.slice(r)))}}const{optimizationLevel:s=1}=this.options;s>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var r=0,o=0,l=t.length,h=e.length;r<l&&o<h;r++,o++){this.debug("matchOne loop");var f=e[o],c=t[r];if(this.debug(e,f,c),!1===f)return!1;if(f===Ut){this.debug("GLOBSTAR",[e,f,c]);var u=r,a=o+1;if(a===h){for(this.debug("** at the end");r<l;r++)if("."===t[r]||".."===t[r]||!i.dot&&"."===t[r].charAt(0))return!1;return!0}for(;u<l;){var p=t[u];if(this.debug("\nglobstar while",t,u,e,a,p),this.matchOne(t.slice(u),e.slice(a),n))return this.debug("globstar found match!",u,l,p),!0;if("."===p||".."===p||!i.dot&&"."===p.charAt(0)){this.debug("dot detected!",t,u,e,a);break}this.debug("globstar swallow a segment, and continue"),u++}return!(!n||(this.debug("\n>>> no match, partial?",t,u,e,a),u!==l))}let s;if("string"==typeof f?(s=c===f,this.debug("string match",f,c,s)):(s=f.test(c),this.debug("pattern match",f,c,s)),!s)return!1}if(r===l&&o===h)return!0;if(r===l)return n;if(o===h)return r===l-1&&""===t[r];throw Error("wtf?")}braceExpand(){return Gt(this.pattern,this.options)}parse(t){tt(t);const e=this.options;if("**"===t)return Ut;if(""===t)return"";let n,i=null;(n=t.match(Pt))?i=e.dot?At:Wt:(n=t.match(yt))?i=(e.nocase?e.dot?St:jt:e.dot?Ot:$t)(n[1]):(n=t.match(Rt))?i=(e.nocase?e.dot?zt:Ct:e.dot?Lt:_t)(n):(n=t.match(Et))?i=e.dot?kt:Mt:(n=t.match(xt))&&(i=Nt);const s=wt.fromGlob(t,this.options).toMMPattern();return i&&"object"==typeof s&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,n=e.noglobstar?"[^/]*?":e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=new Set(e.nocase?["i"]:[]);let s=t.map((t=>{const e=t.map((t=>{if(t instanceof RegExp)for(const e of t.flags.split(""))i.add(e);return"string"==typeof t?(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"))(t):t===Ut?Ut:t._src}));return e.forEach(((t,i)=>{const s=e[i+1],r=e[i-1];t===Ut&&r!==Ut&&(void 0===r?void 0!==s&&s!==Ut?e[i+1]="(?:\\/|"+n+"\\/)?"+s:e[i]=n:void 0===s?e[i-1]=r+"(?:\\/|"+n+")?":s!==Ut&&(e[i-1]=r+"(?:\\/|\\/"+n+"\\/)"+s,e[i+1]=Ut))})),e.filter((t=>t!==Ut)).join("/")})).join("|");const[r,o]=t.length>1?["(?:",")"]:["",""];s="^"+r+s+o+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=RegExp(s,[...i].join(""))}catch(t){this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;const n=this.options;this.isWindows&&(t=t.split("\\").join("/"));const i=this.slashSplit(t);this.debug(this.pattern,"split",i);const s=this.set;this.debug(this.pattern,"set",s);let r=i[i.length-1];if(!r)for(let t=i.length-2;!r&&t>=0;t--)r=i[t];for(let t=0;t<s.length;t++){const o=s[t];let l=i;if(n.matchBase&&1===o.length&&(l=[r]),this.matchOne(l,o,e))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate}static defaults(t){return gt.defaults(t).Minimatch}};gt.AST=wt,gt.Minimatch=Vt,gt.escape=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),gt.unescape=ot,((t,e)=>{for(var n in e)w(t,n,{get:e[n],enumerable:!0})})({},{err:()=>qt,map:()=>Bt,ok:()=>Ht,unwrap:()=>Yt,unwrapErr:()=>Kt});var Ht=t=>({isOk:!0,isErr:!1,value:t}),qt=t=>({isOk:!1,isErr:!0,value:t});function Bt(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>Ht(t))):Ht(n)}if(t.isErr)return qt(t.value);throw"should never get here"}var Jt,Yt=t=>{if(t.isOk)return t.value;throw t.value},Kt=t=>{if(t.isErr)return t.value;throw t.value};function Qt(){const t=this.attachShadow({mode:"open"});void 0===Jt&&(Jt=null),Jt&&(U?t.adoptedStyleSheets.push(Jt):t.adoptedStyleSheets=[...t.adoptedStyleSheets,Jt])}function Xt(t,e,n){let i,s=0,r=[];for(;s<t.length;s++){if(i=t[s],i["s-sr"]&&(!e||i["s-hn"]===e)&&(void 0===n||te(i)===n)&&(r.push(i),void 0!==n))return r;r=[...r,...Xt(i.childNodes,e,n)]}return r}var te=t=>"string"==typeof t["s-sn"]?t["s-sn"]:1===t.nodeType&&t.getAttribute("slot")||void 0;var ee=new WeakMap,ne=t=>"sc-"+t.u,ie=(t,e,...n)=>{let i=null,s=null,r=!1,o=!1;const l=[],h=e=>{for(let n=0;n<e.length;n++)i=e[n],Array.isArray(i)?h(i):null!=i&&"boolean"!=typeof i&&((r="function"!=typeof t&&!Q(i))&&(i+=""),r&&o?l[l.length-1].p+=i:l.push(r?se(null,i):i),o=r)};if(h(n),e){e.key&&(s=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}if("function"==typeof t)return t(null===e?{}:e,l,oe);const f=se(t,null);return f.v=e,l.length>0&&(f.m=l),f.$=s,f},se=(t,e)=>({l:0,O:t,p:e,j:null,m:null,v:null,$:null}),re={},oe={forEach:(t,e)=>t.map(le).forEach(e),map:(t,e)=>t.map(le).map(e).map(he)},le=t=>({vattrs:t.v,vchildren:t.m,vkey:t.$,vname:t.S,vtag:t.O,vtext:t.p}),he=t=>{if("function"==typeof t.vtag){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),ie(t.vtag,e,...t.vchildren||[])}const e=se(t.vtag,t.vtext);return e.v=t.vattrs,e.m=t.vchildren,e.$=t.vkey,e.S=t.vname,e},fe=t=>{const e=(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t);return RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${e}))(${e}\\b)`,"g")};fe("::slotted"),fe(":host"),fe(":host-context");var ce,ue=(t,e)=>null==t||Q(t)?t:4&e?"false"!==t&&(""===t||!!t):t,ae=(t,e,n,i,s,r)=>{if(n===i)return;let o=C(t,e),l=e.toLowerCase();if("class"===e){const e=t.classList,s=de(n);let r=de(i);e.remove(...s.filter((t=>t&&!r.includes(t)))),e.add(...r.filter((t=>t&&!s.includes(t))))}else if("style"===e){for(const e in n)i&&null!=i[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in i)n&&i[e]===n[e]||(e.includes("-")?t.style.setProperty(e,i[e]):t.style[e]=i[e])}else if("key"===e);else if(t.__lookupSetter__(e)||"o"!==e[0]||"n"!==e[1]){const l=Q(i);if(o||l&&null!==i)try{if(t.tagName.includes("-"))t[e]!==i&&(t[e]=i);else{const s=null==i?"":i;"list"===e?o=!1:null!=n&&t[e]==s||("function"==typeof t.__lookupSetter__(e)?t[e]=s:t.setAttribute(e,s))}}catch(t){}null==i||!1===i?!1===i&&""!==t.getAttribute(e)||t.removeAttribute(e):(!o||4&r||s)&&!l&&1===t.nodeType&&t.setAttribute(e,i=!0===i?"":i)}else if(e="-"===e[2]?e.slice(3):C(_,l)?l.slice(2):l[2]+e.slice(3),n||i){const s=e.endsWith(ve);e=e.replace(me,""),n&&T.rel(t,e,n,s),i&&T.ael(t,e,i,s)}},pe=/\s/,de=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(pe):[]),ve="Capture",me=RegExp(ve+"$"),be=(t,e,n)=>{const i=11===e.j.nodeType&&e.j.host?e.j.host:e.j,s=t&&t.v||{},r=e.v||{};for(const t of we(Object.keys(s)))t in r||ae(i,t,s[t],void 0,n,e.l);for(const t of we(Object.keys(r)))ae(i,t,s[t],r[t],n,e.l)};function we(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var ge=!1,ye=(t,e,n)=>{const i=e.m[n];let s,r,o=0;if(null!==i.p)s=i.j=_.document.createTextNode(i.p);else{if(!_.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.");if(s=i.j=_.document.createElement(i.O),be(null,i,ge),i.m){const e="template"===i.O?s.content:s;for(o=0;o<i.m.length;++o)r=ye(t,i,o),r&&e.appendChild(r)}}return s["s-hn"]=ce,s},$e=(t,e,n,i,s,r)=>{let o,l=t;for(l.shadowRoot&&l.tagName===ce&&(l=l.shadowRoot),"template"===n.O&&(l=l.content);s<=r;++s)i[s]&&(o=ye(null,n,s),o&&(i[s].j=o,Ee(l,o,e)))},Oe=(t,e,n)=>{for(let i=e;i<=n;++i){const e=t[i];if(e){const t=e.j;t&&t.remove()}}},je=(t,e,n=!1)=>t.O===e.O&&(n?(n&&!t.$&&e.$&&(t.$=e.$),!0):t.$===e.$),Se=(t,e,n=!1)=>{const i=e.j=t.j,s=t.m,r=e.m,o=e.p;null===o?(be(t,e,ge),null!==s&&null!==r?((t,e,n,i,s=!1)=>{let r,o,l=0,h=0,f=0,c=0,u=e.length-1,a=e[0],p=e[u],d=i.length-1,v=i[0],m=i[d];const b="template"===n.O?t.content:t;for(;l<=u&&h<=d;)if(null==a)a=e[++l];else if(null==p)p=e[--u];else if(null==v)v=i[++h];else if(null==m)m=i[--d];else if(je(a,v,s))Se(a,v,s),a=e[++l],v=i[++h];else if(je(p,m,s))Se(p,m,s),p=e[--u],m=i[--d];else if(je(a,m,s))Se(a,m,s),Ee(b,a.j,p.j.nextSibling),a=e[++l],m=i[--d];else if(je(p,v,s))Se(p,v,s),Ee(b,p.j,a.j),p=e[--u],v=i[++h];else{for(f=-1,c=l;c<=u;++c)if(e[c]&&null!==e[c].$&&e[c].$===v.$){f=c;break}f>=0?(o=e[f],o.O!==v.O?r=ye(e&&e[h],n,f):(Se(o,v,s),e[f]=void 0,r=o.j),v=i[++h]):(r=ye(e&&e[h],n,h),v=i[++h]),r&&Ee(a.j.parentNode,r,a.j)}l>u?$e(t,null==i[d+1]?null:i[d+1].j,n,i,h,d):h>d&&Oe(e,l,u)})(i,s,e,r,n):null!==r?(null!==t.p&&(i.textContent=""),$e(i,null,e,r,0,r.length-1)):!n&&null!==s&&Oe(s,0,s.length-1)):t.p!==o&&(i.data=o)},Ee=(t,e,n)=>{if("string"==typeof e["s-sn"]){t.insertBefore(e,n);const{slotNode:i}=function(t,e){var n;if(!(e=e||(null==(n=t["s-ol"])?void 0:n.parentElement)))return{slotNode:null,slotName:""};const i=t["s-sn"]=te(t)||"";return{slotNode:Xt(function(t,e){if("__"+e in t){const n=t["__"+e];return"function"!=typeof n?n:n.bind(t)}return"function"!=typeof t[e]?t[e]:t[e].bind(t)}(e,"childNodes"),e.tagName,i)[0],slotName:i}}(e);return i&&function(t){t.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1,composed:!1}))}(i),e}return t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n)},Me=(t,e,n=!1)=>{const i=t.$hostElement$,s=t.M||se(null,null),r=(t=>t&&t.O===re)(e)?e:ie(null,null,e);if(ce=i.tagName,n&&r.v)for(const t of Object.keys(r.v))i.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(r.v[t]=i[t]);r.O=null,r.l|=4,t.M=r,r.j=s.j=i.shadowRoot||i,Se(s,r,n)},ke=(t,e)=>{if(e&&!t.k&&e["s-p"]){const n=e["s-p"].push(new Promise((i=>t.k=()=>{e["s-p"].splice(n-1,1),i()})))}},xe=(t,e)=>{if(t.l|=16,4&t.l)return void(t.l|=512);ke(t,t.N);const n=()=>Ne(t,e);if(!e)return J(n);queueMicrotask((()=>{n()}))},Ne=(t,e)=>{const n=t.$hostElement$,i=n;if(!i)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let s;return s=_e(i,e?"componentWillLoad":"componentWillUpdate",void 0,n),s=Pe(s,(()=>_e(i,"componentWillRender",void 0,n))),Pe(s,(()=>Ae(t,i,e)))},Pe=(t,e)=>We(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),We=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,Ae=async(t,e,n)=>{var i;const s=t.$hostElement$,r=s["s-rc"];n&&(t=>{const e=t.i,n=t.$hostElement$,i=e.l,s=((t,e)=>{var n,i,s;const r=ne(e),o=L.get(r);if(!_.document)return r;if(t=11===t.nodeType?t:_.document,o)if("string"==typeof o){let s,l=ee.get(t=t.head||t);if(l||ee.set(t,l=new Set),!l.has(r)){s=_.document.createElement("style"),s.innerHTML=o;const h=null!=(n=T.P)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=_.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=h&&s.setAttribute("nonce",h),!(1&e.l))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(s,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(F){const e=new(null!=(i=t.defaultView)?i:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(o),U?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.innerHTML=o+e.innerHTML:t.prepend(s)}else t.append(s);1&e.l&&t.insertBefore(s,null),4&e.l&&(s.innerHTML+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),l&&l.add(r)}}else{let e=ee.get(t);if(e||ee.set(t,e=new Set),!e.has(r)){const n=null!=(s=t.defaultView)?s:t.ownerDocument.defaultView;let i;if(o.constructor===n.CSSStyleSheet)i=o;else{i=new n.CSSStyleSheet;for(let t=0;t<o.cssRules.length;t++)i.insertRule(o.cssRules[t].cssText,t)}U?t.adoptedStyleSheets.push(i):t.adoptedStyleSheets=[...t.adoptedStyleSheets,i],e.add(r)}}return r})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&i&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(t);Re(t,e,s,n),r&&(r.map((t=>t())),s["s-rc"]=void 0);{const e=null!=(i=s["s-p"])?i:[],n=()=>Ce(t);0===e.length?n():(Promise.all(e).then(n),t.l|=4,e.length=0)}},Re=(t,e,n,i)=>{try{e=e.render(),t.l&=-17,t.l|=2,Me(t,e,i)}catch(e){z(e,t.$hostElement$)}return null},Ce=t=>{const e=t.$hostElement$,n=e,i=t.N;_e(n,"componentDidRender",void 0,e),64&t.l?_e(n,"componentDidUpdate",void 0,e):(t.l|=64,De(e),_e(n,"componentDidLoad",void 0,e),t.W(e),i||Le()),t.k&&(t.k(),t.k=void 0),512&t.l&&B((()=>xe(t,!1))),t.l&=-517},ze=t=>{var e;{const n=R(t),i=null==(e=null==n?void 0:n.$hostElement$)?void 0:e.isConnected;return i&&2==(18&n.l)&&xe(n,!1),i}},Le=()=>{B((()=>(t=>{const e=T.ce("appload",{detail:{namespace:"mb-crossword"}});return t.dispatchEvent(e),e})(_)))},_e=(t,e,n,i)=>{if(t&&t[e])try{return t[e](n)}catch(t){z(t,i)}},De=t=>t.classList.add("hydrated"),Te=(t,e,n,i)=>{const s=R(t);if(!s)return;const r=t,o=s.o.get(e),l=s.l,h=r;if(!((n=ue(n,i.t[e][0]))===o||Number.isNaN(o)&&Number.isNaN(n)||(s.o.set(e,n),2!=(18&l)))){if(h.componentShouldUpdate&&!1===h.componentShouldUpdate(n,o,e))return;xe(s,!1)}},Fe=(t,e)=>{var n,i;const s=t.prototype;if(e.t){const r=Object.entries(null!=(n=e.t)?n:{});r.map((([t,[n]])=>{if(31&n||32&n){const{get:i,set:r}=Object.getOwnPropertyDescriptor(s,t)||{};i&&(e.t[t][0]|=2048),r&&(e.t[t][0]|=4096),Object.defineProperty(s,t,{get(){return i?i.apply(this):((t,e)=>R(this).o.get(e))(0,t)},configurable:!0,enumerable:!0}),Object.defineProperty(s,t,{set(i){const s=R(this);if(s){if(r)return void 0===(32&n?this[t]:s.$hostElement$[t])&&s.o.get(t)&&(i=s.o.get(t)),r.call(this,ue(i,n)),void Te(this,t,i=32&n?this[t]:s.$hostElement$[t],e);Te(this,t,i,e)}}})}}));{const n=new Map;s.attributeChangedCallback=function(t,i,o){T.jmp((()=>{var l;const h=n.get(t),f=R(this);if(this.hasOwnProperty(h),s.hasOwnProperty(h)&&"number"==typeof this[h]&&this[h]==o)return;if(null==h){const n=null==f?void 0:f.l;if(f&&n&&!(8&n)&&o!==i){const s=this,r=null==(l=e.A)?void 0:l[t];null==r||r.forEach((e=>{const[[r,l]]=Object.entries(e);null!=s[r]&&(128&n||1&l)&&s[r].call(s,o,i,t)}))}return}const c=r.find((([t])=>t===h));c&&4&c[1][0]&&(o=null!==o&&"false"!==o);const u=Object.getOwnPropertyDescriptor(s,h);o==this[h]||u.get&&!u.set||(this[h]=o)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(i=e.A)?i:{}),...r.filter((([t,e])=>31&e[0])).map((([t,e])=>{const i=e[1]||t;return n.set(i,t),i}))]))}}return t},Ue=(t,e)=>{const n={l:e[0],u:e[1]};n.t=e[2];const i=t.prototype.connectedCallback,s=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const n={l:0,$hostElement$:t,i:e,o:new Map,R:new Map};n.C=new Promise((t=>n.W=t)),t["s-p"]=[],t["s-rc"]=[];const i=n;t.__stencil__getHostRef=()=>i,512&e.l&&A(t,n)})(this,n)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!R(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&T.l)){const e=R(t);if(!e)return;const n=e.i,i=()=>{};if(1&e.l)(null==e?void 0:e.L)||(null==e?void 0:e.C)&&e.C.then((()=>{}));else{e.l|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){ke(e,e.N=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&e in t&&t[e]!==Object.prototype[e]){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let i;if(!(32&e.l)&&(e.l|=32,i=t.constructor,customElements.whenDefined(t.localName).then((()=>e.l|=128)),i&&i.style)){let t;"string"==typeof i.style&&(t=i.style);const e=ne(n);if(!L.has(e)){const i=()=>{};((t,e,n)=>{let i=L.get(t);F&&n?(i=i||new CSSStyleSheet,"string"==typeof i?i=e:i.replaceSync(e)):i=e,L.set(t,i)})(e,t,!!(1&n.l)),i()}}const s=e.N,r=()=>xe(e,!0);s&&s["s-rc"]?s["s-rc"].push(r):r()})(t,e,n)}i()}})(this),i&&i.call(this)},disconnectedCallback(){(async t=>{ee.has(t)&&ee.delete(t),t.shadowRoot&&ee.has(t.shadowRoot)&&ee.delete(t.shadowRoot)})(this),s&&s.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${n.u}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else Qt.call(this,n)}}),t.is=n.u,Fe(t,n)},Ze=t=>T.P=t,Ge=t=>Object.assign(T,t);function Ie(t,e){Me({$hostElement$:e},t)}function Ve(t){return t}class He{x;y;get 0(){return this.x}set 0(t){this.x=t}get 1(){return this.y}set 1(t){this.y=t}get xy(){return[this.x,this.y]}*[Symbol.iterator](){yield this.x,yield this.y}constructor(t,e){this.x=t,this.y=e}static from(t){if("number"==typeof t)return new He(t,t);if(Array.isArray(t))return new He(t[0],t[1]);if("object"==typeof t&&"number"==typeof t.x&&"number"==typeof t.y)return new He(t.x,t.y);throw Error("Wrong Vec2 source")}}function qe(t,e){return new He(t%e,Math.floor(t/e))}function Be(t,e){return t.y*e+t.x}function Je(t){if(1!==t.key.length)return!1;const e=t.key.toLowerCase();return/[0-9a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u024F]/.test(e)}export{D as H,He as V,qe as Vec2fromIndex,ze as f,Y as getAssetPath,ie as h,Be as indexFromXY,Je as isKeyboardEventLetter,Ue as p,Ie as render,K as setAssetPath,Ze as setNonce,Ge as setPlatformOptions,Ve as t}
1
+ var t,e,n,i,s,r,o,l,h,u,c,f,a,p,d,v,w,m=Object.create,b=Object.defineProperty,g=Object.getOwnPropertyDescriptor,y=Object.getOwnPropertyNames,$=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty,j=t=>{throw TypeError(t)},S=(t,e)=>function(){return e||(0,t[y(t)[0]])((e={exports:{}}).exports,e),e.exports},E=(t,e,n)=>e.has(t)||j("Cannot "+n),M=(t,e,n)=>(E(t,e,"read from private field"),n?n.call(t):e.get(t)),k=(t,e,n)=>e.has(t)?j("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),x=(t,e,n)=>(E(t,e,"write to private field"),e.set(t,n),n),N=(t,e,n)=>(E(t,e,"access private method"),n),P=S({"node_modules/balanced-match/index.js"(t,e){function n(t,e,n){t instanceof RegExp&&(t=i(t,n)),e instanceof RegExp&&(e=i(e,n));var r=s(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function i(t,e){var n=e.match(t);return n?n[0]:null}function s(t,e,n){var i,s,r,o,l,h=n.indexOf(t),u=n.indexOf(e,h+1),c=h;if(h>=0&&u>0){if(t===e)return[h,u];for(i=[],r=n.length;c>=0&&!l;)c==h?(i.push(c),h=n.indexOf(t,c+1)):1==i.length?l=[i.pop(),u]:((s=i.pop())<r&&(r=s,o=u),u=n.indexOf(e,c+1)),c=h<u&&h>=0?h:u;i.length&&(l=[r,o])}return l}e.exports=n,n.range=s}}),W=S({"node_modules/brace-expansion/index.js"(t,e){var n=P();e.exports=function(t){return t?("{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2)),v(function(t){return t.split("\\\\").join(i).split("\\{").join(s).split("\\}").join(r).split("\\,").join(o).split("\\.").join(l)}(t),!0).map(u)):[]};var i="\0SLASH"+Math.random()+"\0",s="\0OPEN"+Math.random()+"\0",r="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",l="\0PERIOD"+Math.random()+"\0";function h(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function u(t){return t.split(i).join("\\").split(s).join("{").split(r).join("}").split(o).join(",").split(l).join(".")}function c(t){if(!t)return[""];var e=[],i=n("{","}",t);if(!i)return t.split(",");var s=i.body,r=i.post,o=i.pre.split(",");o[o.length-1]+="{"+s+"}";var l=c(r);return r.length&&(o[o.length-1]+=l.shift(),o.push.apply(o,l)),e.push.apply(e,o),e}function f(t){return"{"+t+"}"}function a(t){return/^-?0\d/.test(t)}function p(t,e){return t<=e}function d(t,e){return t>=e}function v(t,e){var i=[],s=n("{","}",t);if(!s)return[t];var o=s.pre,l=s.post.length?v(s.post,!1):[""];if(/\$$/.test(s.pre))for(var u=0;u<l.length;u++)i.push(R=o+"{"+s.body+"}"+l[u]);else{var w,m,b=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),y=b||g,$=s.body.indexOf(",")>=0;if(!y&&!$)return s.post.match(/,(?!,).*\}/)?v(t=s.pre+"{"+s.body+r+s.post):[t];if(y)w=s.body.split(/\.\./);else if(1===(w=c(s.body)).length&&1===(w=v(w[0],!1).map(f)).length)return l.map((function(t){return s.pre+w[0]+t}));if(y){var O=h(w[0]),j=h(w[1]),S=Math.max(w[0].length,w[1].length),E=3==w.length?Math.abs(h(w[2])):1,M=p;j<O&&(E*=-1,M=d);var k=w.some(a);m=[];for(var x=O;M(x,j);x+=E){var N;if(g)"\\"===(N=String.fromCharCode(x))&&(N="");else if(N=x+"",k){var P=S-N.length;if(P>0){var W=Array(P+1).join("0");N=x<0?"-"+W+N.slice(1):W+N}}m.push(N)}}else{m=[];for(var A=0;A<w.length;A++)m.push.apply(m,v(w[A],!1))}for(A=0;A<m.length;A++)for(u=0;u<l.length;u++){var R=o+m[A]+l[u];(!e||y||R)&&i.push(R)}}return i}}}),A=(t,e)=>{var n;Object.entries(null!=(n=e.i.t)?n:{}).map((([n,[i]])=>{if(31&i||32&i){const i=t[n],s=function(t,e){for(;t;){const n=Object.getOwnPropertyDescriptor(t,e);if(null==n?void 0:n.get)return n;t=Object.getPrototypeOf(t)}}(Object.getPrototypeOf(t),n)||Object.getOwnPropertyDescriptor(t,n);s&&Object.defineProperty(t,n,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),t[n]=e.o.has(n)?e.o.get(n):i}}))},R=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},C=(t,e)=>e in t,z=(t,e)=>(0,console.error)(t,e),L=new Map,_="undefined"!=typeof window?window:{},D=_.HTMLElement||class{},F={l:0,h:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,i)=>t.addEventListener(e,n,i),rel:(t,e,n,i)=>t.removeEventListener(e,n,i),ce:(t,e)=>new CustomEvent(t,e)},T=(()=>{try{return!!_.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),Z=!!T&&(()=>!!_.document&&Object.getOwnPropertyDescriptor(_.document.adoptedStyleSheets,"length").writable)(),U=!1,G=[],I=[],V=(t,e)=>n=>{t.push(n),U||(U=!0,e&&4&F.l?B(q):F.raf(q))},H=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){z(t)}t.length=0},q=()=>{H(G),H(I),(U=G.length>0)&&F.raf(q)},B=t=>Promise.resolve(void 0).then(t),J=V(I,!0),Y=t=>{const e=new URL(t,F.h);return e.origin!==_.location.origin?e.href:e.pathname},K=t=>F.h=t,Q=t=>"object"==(t=typeof t)||"function"===t,X=((t,e,n)=>(n=null!=t?m($(t)):{},((t,e,n,i)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let n of y(e))O.call(t,n)||undefined===n||b(t,n,{get:()=>e[n],enumerable:!(i=g(e,n))||i.enumerable});return t})(b(n,"default",{value:t,enumerable:!0}),t)))(W()),tt=t=>{if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},et={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},nt=t=>t.replace(/[[\]\\-]/g,"\\$&"),it=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),st=t=>t.join(""),rt=(t,e)=>{const n=e;if("["!==t.charAt(n))throw Error("not in a brace expression");const i=[],s=[];let r=n+1,o=!1,l=!1,h=!1,u=!1,c=n,f="";t:for(;r<t.length;){const e=t.charAt(r);if("!"!==e&&"^"!==e||r!==n+1){if("]"===e&&o&&!h){c=r+1;break}if(o=!0,"\\"!==e||h){if("["===e&&!h)for(const[e,[o,h,u]]of Object.entries(et))if(t.startsWith(e,r)){if(f)return["$.",!1,t.length-n,!0];r+=e.length,u?s.push(o):i.push(o),l=l||h;continue t}h=!1,f?(e>f?i.push(nt(f)+"-"+nt(e)):e===f&&i.push(nt(e)),f="",r++):t.startsWith("-]",r+1)?(i.push(nt(e+"-")),r+=2):t.startsWith("-",r+1)?(f=e,r+=2):(i.push(nt(e)),r++)}else h=!0,r++}else u=!0,r++}if(c<r)return["",!1,0,!1];if(!i.length&&!s.length)return["$.",!1,t.length-n,!0];if(0===s.length&&1===i.length&&/^\\?.$/.test(i[0])&&!u){const t=2===i[0].length?i[0].slice(-1):i[0];return[it(t),!1,c-n,!1]}const a="["+(u?"^":"")+st(i)+"]",p="["+(u?"":"^")+st(s)+"]";return[i.length&&s.length?"("+a+"|"+p+")":i.length?a:p,l,c-n,!0]},ot=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),lt=new Set(["!","?","+","*","@"]),ht=t=>lt.has(t),ut="(?!\\.)",ct=new Set(["[","."]),ft=new Set(["..","."]),at=new Set("().*{}+?[]^$\\!"),pt=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),dt="[^/]",vt=dt+"*?",wt=dt+"+?",mt=class m{constructor(a,p,d={}){k(this,f),((t,e,n)=>{((t,e,n)=>{e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,e+"",n)})(this,"type"),k(this,t),k(this,e),k(this,n,!1),k(this,i,[]),k(this,s),k(this,r),k(this,o),k(this,l,!1),k(this,h),k(this,u),k(this,c,!1),this.type=a,a&&x(this,e,!0),x(this,s,p),x(this,t,M(this,s)?M(M(this,s),t):this),x(this,h,M(this,t)===this?d:M(M(this,t),h)),x(this,o,M(this,t)===this?[]:M(M(this,t),o)),"!"!==a||M(M(this,t),l)||M(this,o).push(this),x(this,r,M(this,s)?M(M(this,s),i).length:0)}get hasMagic(){if(void 0!==M(this,e))return M(this,e);for(const t of M(this,i))if("string"!=typeof t&&(t.type||t.hasMagic))return x(this,e,!0);return M(this,e)}toString(){return void 0!==M(this,u)?M(this,u):x(this,u,this.type?this.type+"("+M(this,i).map((t=>t+"")).join("|")+")":M(this,i).map((t=>t+"")).join(""))}push(...t){for(const e of t)if(""!==e){if("string"!=typeof e&&!(e instanceof m&&M(e,s)===this))throw Error("invalid part: "+e);M(this,i).push(e)}}toJSON(){var e;const n=null===this.type?M(this,i).slice().map((t=>"string"==typeof t?t:t.toJSON())):[this.type,...M(this,i).map((t=>t.toJSON()))];return this.isStart()&&!this.type&&n.unshift([]),this.isEnd()&&(this===M(this,t)||M(M(this,t),l)&&"!"===(null==(e=M(this,s))?void 0:e.type))&&n.push({}),n}isStart(){var e;if(M(this,t)===this)return!0;if(!(null==(e=M(this,s))?void 0:e.isStart()))return!1;if(0===M(this,r))return!0;const n=M(this,s);for(let t=0;t<M(this,r);t++){const e=M(n,i)[t];if(!(e instanceof m&&"!"===e.type))return!1}return!0}isEnd(){var e,n,o;if(M(this,t)===this)return!0;if("!"===(null==(e=M(this,s))?void 0:e.type))return!0;if(!(null==(n=M(this,s))?void 0:n.isEnd()))return!1;if(!this.type)return null==(o=M(this,s))?void 0:o.isEnd();const l=M(this,s)?M(M(this,s),i).length:0;return M(this,r)===l-1}copyIn(t){this.push("string"==typeof t?t:t.clone(this))}clone(t){const e=new m(this.type,t);for(const t of M(this,i))e.copyIn(t);return e}static fromGlob(t,e={}){var n;const i=new m(null,void 0,e);return N(n=m,p,d).call(n,t,i,0,e),i}toMMPattern(){if(this!==M(this,t))return M(this,t).toMMPattern();const n=""+this,[i,s,r,o]=this.toRegExpSource();if(!(r||M(this,e)||M(this,h).nocase&&!M(this,h).nocaseMagicOnly&&n.toUpperCase()!==n.toLowerCase()))return s;const l=(M(this,h).nocase?"i":"")+(o?"u":"");return Object.assign(RegExp(`^${i}$`,l),{_src:i,_glob:n})}get options(){return M(this,h)}toRegExpSource(r){var o;const u=null!=r?r:!!M(this,h).dot;if(M(this,t)===this&&N(this,f,a).call(this),!this.type){const h=this.isStart()&&this.isEnd(),c=M(this,i).map((t=>{var i;const[s,o,l,u]="string"==typeof t?N(i=m,p,w).call(i,t,M(this,e),h):t.toRegExpSource(r);return x(this,e,M(this,e)||l),x(this,n,M(this,n)||u),s})).join("");let f="";if(this.isStart()&&"string"==typeof M(this,i)[0]&&(1!==M(this,i).length||!ft.has(M(this,i)[0]))){const t=ct,e=u&&t.has(c.charAt(0))||c.startsWith("\\.")&&t.has(c.charAt(2))||c.startsWith("\\.\\.")&&t.has(c.charAt(4)),n=!u&&!r&&t.has(c.charAt(0));f=e?"(?!(?:^|/)\\.\\.?(?:$|/))":n?ut:""}let a="";return this.isEnd()&&M(M(this,t),l)&&"!"===(null==(o=M(this,s))?void 0:o.type)&&(a="(?:$|\\/)"),[f+c+a,ot(c),x(this,e,!!M(this,e)),M(this,n)]}const d="*"===this.type||"+"===this.type,b="!"===this.type?"(?:(?!(?:":"(?:";let g=N(this,f,v).call(this,u);if(this.isStart()&&this.isEnd()&&!g&&"!"!==this.type){const t=""+this;return x(this,i,[t]),this.type=null,x(this,e,void 0),[t,ot(""+this),!1,!1]}let y=!d||r||u?"":N(this,f,v).call(this,!0);y===g&&(y=""),y&&(g=`(?:${g})(?:${y})*?`);let $="";return $="!"===this.type&&M(this,c)?(this.isStart()&&!u?ut:"")+wt:b+g+("!"===this.type?"))"+(!this.isStart()||u||r?"":ut)+vt+")":"@"===this.type?")":"?"===this.type?")?":"+"===this.type&&y?")":"*"===this.type&&y?")?":")"+this.type),[$,ot(g),x(this,e,!!M(this,e)),M(this,n)]}};t=new WeakMap,e=new WeakMap,n=new WeakMap,i=new WeakMap,s=new WeakMap,r=new WeakMap,o=new WeakMap,l=new WeakMap,h=new WeakMap,u=new WeakMap,c=new WeakMap,f=new WeakSet,a=function(){if(this!==M(this,t))throw Error("should only call on root");if(M(this,l))return this;let e;for(x(this,l,!0);e=M(this,o).pop();){if("!"!==e.type)continue;let t=e,n=M(t,s);for(;n;){for(let s=M(t,r)+1;!n.type&&s<M(n,i).length;s++)for(const t of M(e,i)){if("string"==typeof t)throw Error("string part in extglob AST??");t.copyIn(M(n,i)[s])}t=n,n=M(t,s)}}return this},p=new WeakSet,d=function(t,n,s,r){var o,l;let h=!1,u=!1,f=-1,a=!1;if(null===n.type){let e=s,i="";for(;e<t.length;){const s=t.charAt(e++);if(h||"\\"===s)h=!h,i+=s;else if(u)e===f+1?"^"!==s&&"!"!==s||(a=!0):"]"!==s||e===f+2&&a||(u=!1),i+=s;else if("["!==s)if(r.noext||!ht(s)||"("!==t.charAt(e))i+=s;else{n.push(i),i="";const l=new mt(s,n);e=N(o=mt,p,d).call(o,t,l,e,r),n.push(l)}else u=!0,f=e,a=!1,i+=s}return n.push(i),e}let v=s+1,w=new mt(null,n);const m=[];let b="";for(;v<t.length;){const e=t.charAt(v++);if(h||"\\"===e)h=!h,b+=e;else if(u)v===f+1?"^"!==e&&"!"!==e||(a=!0):"]"!==e||v===f+2&&a||(u=!1),b+=e;else if("["!==e)if(ht(e)&&"("===t.charAt(v)){w.push(b),b="";const n=new mt(e,w);w.push(n),v=N(l=mt,p,d).call(l,t,n,v,r)}else if("|"!==e){if(")"===e)return""===b&&0===M(n,i).length&&x(n,c,!0),w.push(b),b="",n.push(...m,w),v;b+=e}else w.push(b),b="",m.push(w),w=new mt(null,n);else u=!0,f=v,a=!1,b+=e}return n.type=null,x(n,e,void 0),x(n,i,[t.substring(s-1)]),v},v=function(t){return M(this,i).map((e=>{if("string"==typeof e)throw Error("string type in extglob ast??");const[i,s,r,o]=e.toRegExpSource(t);return x(this,n,M(this,n)||o),i})).filter((t=>!(this.isStart()&&this.isEnd()&&!t))).join("|")},w=function(t,e,n=!1){let i=!1,s="",r=!1;for(let o=0;o<t.length;o++){const l=t.charAt(o);if(i)i=!1,s+=(at.has(l)?"\\":"")+l;else if("\\"!==l){if("["===l){const[n,i,l,h]=rt(t,o);if(l){s+=n,r=r||i,o+=l-1,e=e||h;continue}}"*"!==l?"?"!==l?s+=pt(l):(s+=dt,e=!0):(s+=n&&"*"===t?wt:vt,e=!0)}else o===t.length-1?s+="\\\\":i=!0}return[s,ot(t),!!e,r]},k(mt,p);var bt=mt,gt=(t,e,n={})=>(tt(e),!(!n.nocomment&&"#"===e.charAt(0))&&new Vt(e,n).match(t)),yt=/^\*+([^+@!?\*\[\(]*)$/,$t=t=>e=>!e.startsWith(".")&&e.endsWith(t),Ot=t=>e=>e.endsWith(t),jt=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),St=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),Et=/^\*+\.\*+$/,Mt=t=>!t.startsWith(".")&&t.includes("."),kt=t=>"."!==t&&".."!==t&&t.includes("."),xt=/^\.\*+$/,Nt=t=>"."!==t&&".."!==t&&t.startsWith("."),Pt=/^\*+$/,Wt=t=>0!==t.length&&!t.startsWith("."),At=t=>0!==t.length&&"."!==t&&".."!==t,Rt=/^\?+([^+@!?\*\[\(]*)?$/,Ct=([t,e=""])=>{const n=Dt([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},zt=([t,e=""])=>{const n=Ft([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},Lt=([t,e=""])=>{const n=Ft([t]);return e?t=>n(t)&&t.endsWith(e):n},_t=([t,e=""])=>{const n=Dt([t]);return e?t=>n(t)&&t.endsWith(e):n},Dt=([t])=>{const e=t.length;return t=>t.length===e&&!t.startsWith(".")},Ft=([t])=>{const e=t.length;return t=>t.length===e&&"."!==t&&".."!==t},Tt="object"==typeof process&&process?"object"==typeof process.env&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";gt.sep="win32"===Tt?"\\":"/";var Zt=Symbol("globstar **");gt.GLOBSTAR=Zt,gt.filter=(t,e={})=>n=>gt(n,t,e);var Ut=(t,e={})=>Object.assign({},t,e);gt.defaults=t=>{if(!t||"object"!=typeof t||!Object.keys(t).length)return gt;const e=gt;return Object.assign(((n,i,s={})=>e(n,i,Ut(t,s))),{Minimatch:class extends e.Minimatch{constructor(e,n={}){super(e,Ut(t,n))}static defaults(n){return e.defaults(Ut(t,n)).Minimatch}},AST:class extends e.AST{constructor(e,n,i={}){super(e,n,Ut(t,i))}static fromGlob(n,i={}){return e.AST.fromGlob(n,Ut(t,i))}},unescape:(n,i={})=>e.unescape(n,Ut(t,i)),escape:(n,i={})=>e.escape(n,Ut(t,i)),filter:(n,i={})=>e.filter(n,Ut(t,i)),defaults:n=>e.defaults(Ut(t,n)),makeRe:(n,i={})=>e.makeRe(n,Ut(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,Ut(t,i)),match:(n,i,s={})=>e.match(n,i,Ut(t,s)),sep:e.sep,GLOBSTAR:Zt})};var Gt=(t,e={})=>(tt(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,X.default)(t));gt.braceExpand=Gt,gt.makeRe=(t,e={})=>new Vt(t,e).makeRe(),gt.match=(t,e,n={})=>{const i=new Vt(e,n);return t=t.filter((t=>i.match(t))),i.options.nonull&&!t.length&&t.push(e),t};var It=/[?*]|[+@!]\(.*?\)|\[|\]/,Vt=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){tt(t),this.options=e=e||{},this.pattern=t,this.platform=e.platform||Tt,this.isWindows="win32"===this.platform,this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||!1===e.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=void 0!==e.windowsNoMagicRoot?e.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const e of t)if("string"!=typeof e)return!0;return!1}debug(...t){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...t)=>console.error(...t)),this.debug(this.pattern,this.globSet);const n=this.globSet.map((t=>this.slashSplit(t)));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((t=>{if(this.isWindows&&this.windowsNoMagicRoot){const e=!(""!==t[0]||""!==t[1]||"?"!==t[2]&&It.test(t[2])||It.test(t[3])),n=/^[a-z]:/i.test(t[0]);if(e)return[...t.slice(0,4),...t.slice(4).map((t=>this.parse(t)))];if(n)return[t[0],...t.slice(1).map((t=>this.parse(t)))]}return t.map((t=>this.parse(t)))}));if(this.debug(this.pattern,i),this.set=i.filter((t=>-1===t.indexOf(!1))),this.isWindows)for(let t=0;t<this.set.length;t++){const e=this.set[t];""===e[0]&&""===e[1]&&"?"===this.globParts[t][2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])&&(e[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let e=0;e<t.length;e++)for(let n=0;n<t[e].length;n++)"**"===t[e][n]&&(t[e][n]="*");const{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=e>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((t=>{let e=-1;for(;-1!==(e=t.indexOf("**",e+1));){let n=e;for(;"**"===t[n+1];)n++;n!==e&&t.splice(e,n-e)}return t}))}levelOneOptimize(t){return t.map((t=>0===(t=t.reduce(((t,e)=>{const n=t[t.length-1];return"**"===e&&"**"===n?t:".."===e&&n&&".."!==n&&"."!==n&&"**"!==n?(t.pop(),t):(t.push(e),t)}),[])).length?[""]:t))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){const i=t[n];1===n&&""===i&&""===t[0]||"."!==i&&""!==i||(e=!0,t.splice(n,1),n--)}"."!==t[0]||2!==t.length||"."!==t[1]&&""!==t[1]||(e=!0,t.pop())}let n=0;for(;-1!==(n=t.indexOf("..",n+1));){const i=t[n-1];i&&"."!==i&&".."!==i&&"**"!==i&&(e=!0,t.splice(n-1,2),n-=2)}}while(e);return 0===t.length?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let n of t){let i=-1;for(;-1!==(i=n.indexOf("**",i+1));){let s=i;for(;"**"===n[s+1];)s++;s>i&&n.splice(i+1,s-i);const r=n[i+2],o=n[i+3];if(".."!==n[i+1])continue;if(!r||"."===r||".."===r||!o||"."===o||".."===o)continue;e=!0,n.splice(i,1);const l=n.slice(0);l[i]="**",t.push(l),i--}if(!this.preserveMultipleSlashes){for(let t=1;t<n.length-1;t++){const i=n[t];1===t&&""===i&&""===n[0]||"."!==i&&""!==i||(e=!0,n.splice(t,1),t--)}"."!==n[0]||2!==n.length||"."!==n[1]&&""!==n[1]||(e=!0,n.pop())}let s=0;for(;-1!==(s=n.indexOf("..",s+1));){const t=n[s-1];t&&"."!==t&&".."!==t&&"**"!==t&&(e=!0,n.splice(s-1,2,...1===s&&"**"===n[s+1]?["."]:[]),0===n.length&&n.push(""),s-=2)}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let n=e+1;n<t.length;n++){const i=this.partsMatch(t[e],t[n],!this.preserveMultipleSlashes);i&&(t[e]=i,t[n]=[])}return t.filter((t=>t.length))}partsMatch(t,e,n=!1){let i=0,s=0,r=[],o="";for(;i<t.length&&s<e.length;)if(t[i]===e[s])r.push("b"===o?e[s]:t[i]),i++,s++;else if(n&&"**"===t[i]&&e[s]===t[i+1])r.push(t[i]),i++;else if(n&&"**"===e[s]&&t[i]===e[s+1])r.push(e[s]),s++;else if("*"!==t[i]||!e[s]||!this.options.dot&&e[s].startsWith(".")||"**"===e[s]){if("*"!==e[s]||!t[i]||!this.options.dot&&t[i].startsWith(".")||"**"===t[i])return!1;if("a"===o)return!1;o="b",r.push(e[s]),i++,s++}else{if("b"===o)return!1;o="a",r.push(t[i]),i++,s++}return t.length===e.length&&r}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=!1,n=0;for(let i=0;i<t.length&&"!"===t.charAt(i);i++)e=!e,n++;n&&(this.pattern=t.slice(n)),this.negate=e}matchOne(t,e,n=!1){const i=this.options;if(this.isWindows){const n="string"==typeof t[0]&&/^[a-z]:$/i.test(t[0]),i=!n&&""===t[0]&&""===t[1]&&"?"===t[2]&&/^[a-z]:$/i.test(t[3]),s="string"==typeof e[0]&&/^[a-z]:$/i.test(e[0]),r=i?3:n?0:void 0,o=!s&&""===e[0]&&""===e[1]&&"?"===e[2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])?3:s?0:void 0;if("number"==typeof r&&"number"==typeof o){const[n,i]=[t[r],e[o]];n.toLowerCase()===i.toLowerCase()&&(e[o]=n,o>r?e=e.slice(o):r>o&&(t=t.slice(r)))}}const{optimizationLevel:s=1}=this.options;s>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var r=0,o=0,l=t.length,h=e.length;r<l&&o<h;r++,o++){this.debug("matchOne loop");var u=e[o],c=t[r];if(this.debug(e,u,c),!1===u)return!1;if(u===Zt){this.debug("GLOBSTAR",[e,u,c]);var f=r,a=o+1;if(a===h){for(this.debug("** at the end");r<l;r++)if("."===t[r]||".."===t[r]||!i.dot&&"."===t[r].charAt(0))return!1;return!0}for(;f<l;){var p=t[f];if(this.debug("\nglobstar while",t,f,e,a,p),this.matchOne(t.slice(f),e.slice(a),n))return this.debug("globstar found match!",f,l,p),!0;if("."===p||".."===p||!i.dot&&"."===p.charAt(0)){this.debug("dot detected!",t,f,e,a);break}this.debug("globstar swallow a segment, and continue"),f++}return!(!n||(this.debug("\n>>> no match, partial?",t,f,e,a),f!==l))}let s;if("string"==typeof u?(s=c===u,this.debug("string match",u,c,s)):(s=u.test(c),this.debug("pattern match",u,c,s)),!s)return!1}if(r===l&&o===h)return!0;if(r===l)return n;if(o===h)return r===l-1&&""===t[r];throw Error("wtf?")}braceExpand(){return Gt(this.pattern,this.options)}parse(t){tt(t);const e=this.options;if("**"===t)return Zt;if(""===t)return"";let n,i=null;(n=t.match(Pt))?i=e.dot?At:Wt:(n=t.match(yt))?i=(e.nocase?e.dot?St:jt:e.dot?Ot:$t)(n[1]):(n=t.match(Rt))?i=(e.nocase?e.dot?zt:Ct:e.dot?Lt:_t)(n):(n=t.match(Et))?i=e.dot?kt:Mt:(n=t.match(xt))&&(i=Nt);const s=bt.fromGlob(t,this.options).toMMPattern();return i&&"object"==typeof s&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,n=e.noglobstar?"[^/]*?":e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=new Set(e.nocase?["i"]:[]);let s=t.map((t=>{const e=t.map((t=>{if(t instanceof RegExp)for(const e of t.flags.split(""))i.add(e);return"string"==typeof t?(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"))(t):t===Zt?Zt:t._src}));return e.forEach(((t,i)=>{const s=e[i+1],r=e[i-1];t===Zt&&r!==Zt&&(void 0===r?void 0!==s&&s!==Zt?e[i+1]="(?:\\/|"+n+"\\/)?"+s:e[i]=n:void 0===s?e[i-1]=r+"(?:\\/|"+n+")?":s!==Zt&&(e[i-1]=r+"(?:\\/|\\/"+n+"\\/)"+s,e[i+1]=Zt))})),e.filter((t=>t!==Zt)).join("/")})).join("|");const[r,o]=t.length>1?["(?:",")"]:["",""];s="^"+r+s+o+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=RegExp(s,[...i].join(""))}catch(t){this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;const n=this.options;this.isWindows&&(t=t.split("\\").join("/"));const i=this.slashSplit(t);this.debug(this.pattern,"split",i);const s=this.set;this.debug(this.pattern,"set",s);let r=i[i.length-1];if(!r)for(let t=i.length-2;!r&&t>=0;t--)r=i[t];for(let t=0;t<s.length;t++){const o=s[t];let l=i;if(n.matchBase&&1===o.length&&(l=[r]),this.matchOne(l,o,e))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate}static defaults(t){return gt.defaults(t).Minimatch}};gt.AST=bt,gt.Minimatch=Vt,gt.escape=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),gt.unescape=ot,((t,e)=>{for(var n in e)b(t,n,{get:e[n],enumerable:!0})})({},{err:()=>qt,map:()=>Bt,ok:()=>Ht,unwrap:()=>Yt,unwrapErr:()=>Kt});var Ht=t=>({isOk:!0,isErr:!1,value:t}),qt=t=>({isOk:!1,isErr:!0,value:t});function Bt(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>Ht(t))):Ht(n)}if(t.isErr)return qt(t.value);throw"should never get here"}var Jt,Yt=t=>{if(t.isOk)return t.value;throw t.value},Kt=t=>{if(t.isErr)return t.value;throw t.value};function Qt(t){const e={mode:"open"};e.delegatesFocus=!!(16&t.l);const n=this.attachShadow(e);void 0===Jt&&(Jt=null),Jt&&(Z?n.adoptedStyleSheets.push(Jt):n.adoptedStyleSheets=[...n.adoptedStyleSheets,Jt])}function Xt(t,e,n){let i,s=0,r=[];for(;s<t.length;s++){if(i=t[s],i["s-sr"]&&(!e||i["s-hn"]===e)&&(void 0===n||te(i)===n)&&(r.push(i),void 0!==n))return r;r=[...r,...Xt(i.childNodes,e,n)]}return r}var te=t=>"string"==typeof t["s-sn"]?t["s-sn"]:1===t.nodeType&&t.getAttribute("slot")||void 0;var ee=new WeakMap,ne=t=>"sc-"+t.u,ie=(t,e,...n)=>{let i=null,s=null,r=!1,o=!1;const l=[],h=e=>{for(let n=0;n<e.length;n++)i=e[n],Array.isArray(i)?h(i):null!=i&&"boolean"!=typeof i&&((r="function"!=typeof t&&!Q(i))&&(i+=""),r&&o?l[l.length-1].p+=i:l.push(r?se(null,i):i),o=r)};if(h(n),e){e.key&&(s=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}if("function"==typeof t)return t(null===e?{}:e,l,oe);const u=se(t,null);return u.v=e,l.length>0&&(u.m=l),u.$=s,u},se=(t,e)=>({l:0,O:t,p:e,j:null,m:null,v:null,$:null}),re={},oe={forEach:(t,e)=>t.map(le).forEach(e),map:(t,e)=>t.map(le).map(e).map(he)},le=t=>({vattrs:t.v,vchildren:t.m,vkey:t.$,vname:t.S,vtag:t.O,vtext:t.p}),he=t=>{if("function"==typeof t.vtag){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),ie(t.vtag,e,...t.vchildren||[])}const e=se(t.vtag,t.vtext);return e.v=t.vattrs,e.m=t.vchildren,e.$=t.vkey,e.S=t.vname,e},ue=t=>{const e=(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t);return RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${e}))(${e}\\b)`,"g")};ue("::slotted"),ue(":host"),ue(":host-context");var ce,fe=(t,e)=>null==t||Q(t)?t:4&e?"false"!==t&&(""===t||!!t):t,ae=(t,e,n,i,s,r)=>{if(n===i)return;let o=C(t,e),l=e.toLowerCase();if("class"===e){const e=t.classList,s=de(n);let r=de(i);e.remove(...s.filter((t=>t&&!r.includes(t)))),e.add(...r.filter((t=>t&&!s.includes(t))))}else if("style"===e){for(const e in n)i&&null!=i[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in i)n&&i[e]===n[e]||(e.includes("-")?t.style.setProperty(e,i[e]):t.style[e]=i[e])}else if("key"===e);else if("ref"===e)i&&i(t);else if(t.__lookupSetter__(e)||"o"!==e[0]||"n"!==e[1]){const l=Q(i);if(o||l&&null!==i)try{if(t.tagName.includes("-"))t[e]!==i&&(t[e]=i);else{const s=null==i?"":i;"list"===e?o=!1:null!=n&&t[e]==s||("function"==typeof t.__lookupSetter__(e)?t[e]=s:t.setAttribute(e,s))}}catch(t){}null==i||!1===i?!1===i&&""!==t.getAttribute(e)||t.removeAttribute(e):(!o||4&r||s)&&!l&&1===t.nodeType&&t.setAttribute(e,i=!0===i?"":i)}else if(e="-"===e[2]?e.slice(3):C(_,l)?l.slice(2):l[2]+e.slice(3),n||i){const s=e.endsWith(ve);e=e.replace(we,""),n&&F.rel(t,e,n,s),i&&F.ael(t,e,i,s)}},pe=/\s/,de=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(pe):[]),ve="Capture",we=RegExp(ve+"$"),me=(t,e,n)=>{const i=11===e.j.nodeType&&e.j.host?e.j.host:e.j,s=t&&t.v||{},r=e.v||{};for(const t of be(Object.keys(s)))t in r||ae(i,t,s[t],void 0,n,e.l);for(const t of be(Object.keys(r)))ae(i,t,s[t],r[t],n,e.l)};function be(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var ge=!1,ye=(t,e,n)=>{const i=e.m[n];let s,r,o=0;if(null!==i.p)s=i.j=_.document.createTextNode(i.p);else{if(!_.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.");if(s=i.j=_.document.createElement(i.O),me(null,i,ge),i.m){const e="template"===i.O?s.content:s;for(o=0;o<i.m.length;++o)r=ye(t,i,o),r&&e.appendChild(r)}}return s["s-hn"]=ce,s},$e=(t,e,n,i,s,r)=>{let o,l=t;for(l.shadowRoot&&l.tagName===ce&&(l=l.shadowRoot),"template"===n.O&&(l=l.content);s<=r;++s)i[s]&&(o=ye(null,n,s),o&&(i[s].j=o,Me(l,o,e)))},Oe=(t,e,n)=>{for(let i=e;i<=n;++i){const e=t[i];if(e){const t=e.j;Ee(e),t&&t.remove()}}},je=(t,e,n=!1)=>t.O===e.O&&(n?(n&&!t.$&&e.$&&(t.$=e.$),!0):t.$===e.$),Se=(t,e,n=!1)=>{const i=e.j=t.j,s=t.m,r=e.m,o=e.p;null===o?(me(t,e,ge),null!==s&&null!==r?((t,e,n,i,s=!1)=>{let r,o,l=0,h=0,u=0,c=0,f=e.length-1,a=e[0],p=e[f],d=i.length-1,v=i[0],w=i[d];const m="template"===n.O?t.content:t;for(;l<=f&&h<=d;)if(null==a)a=e[++l];else if(null==p)p=e[--f];else if(null==v)v=i[++h];else if(null==w)w=i[--d];else if(je(a,v,s))Se(a,v,s),a=e[++l],v=i[++h];else if(je(p,w,s))Se(p,w,s),p=e[--f],w=i[--d];else if(je(a,w,s))Se(a,w,s),Me(m,a.j,p.j.nextSibling),a=e[++l],w=i[--d];else if(je(p,v,s))Se(p,v,s),Me(m,p.j,a.j),p=e[--f],v=i[++h];else{for(u=-1,c=l;c<=f;++c)if(e[c]&&null!==e[c].$&&e[c].$===v.$){u=c;break}u>=0?(o=e[u],o.O!==v.O?r=ye(e&&e[h],n,u):(Se(o,v,s),e[u]=void 0,r=o.j),v=i[++h]):(r=ye(e&&e[h],n,h),v=i[++h]),r&&Me(a.j.parentNode,r,a.j)}l>f?$e(t,null==i[d+1]?null:i[d+1].j,n,i,h,d):h>d&&Oe(e,l,f)})(i,s,e,r,n):null!==r?(null!==t.p&&(i.textContent=""),$e(i,null,e,r,0,r.length-1)):!n&&null!==s&&Oe(s,0,s.length-1)):t.p!==o&&(i.data=o)},Ee=t=>{t.v&&t.v.ref&&t.v.ref(null),t.m&&t.m.map(Ee)},Me=(t,e,n)=>{if("string"==typeof e["s-sn"]){t.insertBefore(e,n);const{slotNode:i}=function(t,e){var n;if(!(e=e||(null==(n=t["s-ol"])?void 0:n.parentElement)))return{slotNode:null,slotName:""};const i=t["s-sn"]=te(t)||"";return{slotNode:Xt(function(t,e){if("__"+e in t){const n=t["__"+e];return"function"!=typeof n?n:n.bind(t)}return"function"!=typeof t[e]?t[e]:t[e].bind(t)}(e,"childNodes"),e.tagName,i)[0],slotName:i}}(e);return i&&function(t){t.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1,composed:!1}))}(i),e}return t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n)},ke=(t,e,n=!1)=>{const i=t.$hostElement$,s=t.M||se(null,null),r=(t=>t&&t.O===re)(e)?e:ie(null,null,e);if(ce=i.tagName,n&&r.v)for(const t of Object.keys(r.v))i.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(r.v[t]=i[t]);r.O=null,r.l|=4,t.M=r,r.j=s.j=i.shadowRoot||i,Se(s,r,n)},xe=(t,e)=>{if(e&&!t.k&&e["s-p"]){const n=e["s-p"].push(new Promise((i=>t.k=()=>{e["s-p"].splice(n-1,1),i()})))}},Ne=(t,e)=>{if(t.l|=16,4&t.l)return void(t.l|=512);xe(t,t.N);const n=()=>Pe(t,e);if(!e)return J(n);queueMicrotask((()=>{n()}))},Pe=(t,e)=>{const n=t.$hostElement$,i=n;if(!i)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let s;return s=De(i,e?"componentWillLoad":"componentWillUpdate",void 0,n),s=We(s,(()=>De(i,"componentWillRender",void 0,n))),We(s,(()=>Re(t,i,e)))},We=(t,e)=>Ae(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),Ae=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,Re=async(t,e,n)=>{var i;const s=t.$hostElement$,r=s["s-rc"];n&&(t=>{const e=t.i,n=t.$hostElement$,i=e.l,s=((t,e)=>{var n,i,s;const r=ne(e),o=L.get(r);if(!_.document)return r;if(t=11===t.nodeType?t:_.document,o)if("string"==typeof o){let s,l=ee.get(t=t.head||t);if(l||ee.set(t,l=new Set),!l.has(r)){s=_.document.createElement("style"),s.innerHTML=o;const h=null!=(n=F.P)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=_.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=h&&s.setAttribute("nonce",h),!(1&e.l))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(s,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(T){const e=new(null!=(i=t.defaultView)?i:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(o),Z?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.innerHTML=o+e.innerHTML:t.prepend(s)}else t.append(s);1&e.l&&t.insertBefore(s,null),4&e.l&&(s.innerHTML+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),l&&l.add(r)}}else{let e=ee.get(t);if(e||ee.set(t,e=new Set),!e.has(r)){const n=null!=(s=t.defaultView)?s:t.ownerDocument.defaultView;let i;if(o.constructor===n.CSSStyleSheet)i=o;else{i=new n.CSSStyleSheet;for(let t=0;t<o.cssRules.length;t++)i.insertRule(o.cssRules[t].cssText,t)}Z?t.adoptedStyleSheets.push(i):t.adoptedStyleSheets=[...t.adoptedStyleSheets,i],e.add(r)}}return r})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&i&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(t);Ce(t,e,s,n),r&&(r.map((t=>t())),s["s-rc"]=void 0);{const e=null!=(i=s["s-p"])?i:[],n=()=>ze(t);0===e.length?n():(Promise.all(e).then(n),t.l|=4,e.length=0)}},Ce=(t,e,n,i)=>{try{e=e.render(),t.l&=-17,t.l|=2,ke(t,e,i)}catch(e){z(e,t.$hostElement$)}return null},ze=t=>{const e=t.$hostElement$,n=e,i=t.N;De(n,"componentDidRender",void 0,e),64&t.l?De(n,"componentDidUpdate",void 0,e):(t.l|=64,Fe(e),De(n,"componentDidLoad",void 0,e),t.W(e),i||_e()),t.k&&(t.k(),t.k=void 0),512&t.l&&B((()=>Ne(t,!1))),t.l&=-517},Le=t=>{var e;{const n=R(t),i=null==(e=null==n?void 0:n.$hostElement$)?void 0:e.isConnected;return i&&2==(18&n.l)&&Ne(n,!1),i}},_e=()=>{B((()=>(t=>{const e=F.ce("appload",{detail:{namespace:"mb-crossword"}});return t.dispatchEvent(e),e})(_)))},De=(t,e,n,i)=>{if(t&&t[e])try{return t[e](n)}catch(t){z(t,i)}},Fe=t=>t.classList.add("hydrated"),Te=(t,e,n,i)=>{const s=R(t);if(!s)return;const r=t,o=s.o.get(e),l=s.l,h=r;if(!((n=fe(n,i.t[e][0]))===o||Number.isNaN(o)&&Number.isNaN(n))){if(s.o.set(e,n),i.A){const t=i.A[e];t&&t.map((t=>{try{const[[i,r]]=Object.entries(t);(128&l||1&r)&&(h?h[i](n,o,e):s.R.push((()=>{s.C[i](n,o,e)})))}catch(t){z(t,r)}}))}if(2==(18&l)){if(h.componentShouldUpdate&&!1===h.componentShouldUpdate(n,o,e))return;Ne(s,!1)}}},Ze=(t,e)=>{var n,i;const s=t.prototype;{t.watchers&&!e.A&&(e.A=t.watchers),t.deserializers&&!e.L&&(e.L=t.deserializers),t.serializers&&!e._&&(e._=t.serializers);const r=Object.entries(null!=(n=e.t)?n:{});r.map((([t,[n]])=>{if(31&n||32&n){const{get:i,set:r}=Object.getOwnPropertyDescriptor(s,t)||{};i&&(e.t[t][0]|=2048),r&&(e.t[t][0]|=4096),Object.defineProperty(s,t,{get(){return i?i.apply(this):((t,e)=>R(this).o.get(e))(0,t)},configurable:!0,enumerable:!0}),Object.defineProperty(s,t,{set(i){const s=R(this);if(s){if(r)return void 0===(32&n?this[t]:s.$hostElement$[t])&&s.o.get(t)&&(i=s.o.get(t)),r.call(this,fe(i,n)),void Te(this,t,i=32&n?this[t]:s.$hostElement$[t],e);Te(this,t,i,e)}}})}}));{const n=new Map;s.attributeChangedCallback=function(t,i,o){F.jmp((()=>{var l;const h=n.get(t),u=R(this);if(this.hasOwnProperty(h),s.hasOwnProperty(h)&&"number"==typeof this[h]&&this[h]==o)return;if(null==h){const n=null==u?void 0:u.l;if(u&&n&&!(8&n)&&o!==i){const s=this,r=null==(l=e.A)?void 0:l[t];null==r||r.forEach((e=>{const[[r,l]]=Object.entries(e);null!=s[r]&&(128&n||1&l)&&s[r].call(s,o,i,t)}))}return}const c=r.find((([t])=>t===h));c&&4&c[1][0]&&(o=null!==o&&"false"!==o);const f=Object.getOwnPropertyDescriptor(s,h);o==this[h]||f.get&&!f.set||(this[h]=o)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(i=e.A)?i:{}),...r.filter((([t,e])=>31&e[0])).map((([t,e])=>{const i=e[1]||t;return n.set(i,t),i}))]))}}return t},Ue=(t,e)=>{const n={l:e[0],u:e[1]};n.t=e[2],n.A=t.A,n.L=t.L,n._=t._;const i=t.prototype.connectedCallback,s=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const n={l:0,$hostElement$:t,i:e,o:new Map,D:new Map};n.F=new Promise((t=>n.W=t)),t["s-p"]=[],t["s-rc"]=[];const i=n;t.__stencil__getHostRef=()=>i,512&e.l&&A(t,n)})(this,n)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!R(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&F.l)){const e=R(t);if(!e)return;const n=e.i,i=()=>{};if(1&e.l)(null==e?void 0:e.C)||(null==e?void 0:e.F)&&e.F.then((()=>{}));else{e.l|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){xe(e,e.N=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&e in t&&t[e]!==Object.prototype[e]){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let i;if(!(32&e.l)&&(e.l|=32,i=t.constructor,customElements.whenDefined(t.localName).then((()=>e.l|=128)),i&&i.style)){let t;"string"==typeof i.style&&(t=i.style);const e=ne(n);if(!L.has(e)){const i=()=>{};((t,e,n)=>{let i=L.get(t);T&&n?(i=i||new CSSStyleSheet,"string"==typeof i?i=e:i.replaceSync(e)):i=e,L.set(t,i)})(e,t,!!(1&n.l)),i()}}const s=e.N,r=()=>Ne(e,!0);s&&s["s-rc"]?s["s-rc"].push(r):r()})(t,e,n)}i()}})(this),i&&i.call(this)},disconnectedCallback(){(async t=>{ee.has(t)&&ee.delete(t),t.shadowRoot&&ee.has(t.shadowRoot)&&ee.delete(t.shadowRoot)})(this),s&&s.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${n.u}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else Qt.call(this,n)}}),t.is=n.u,Ze(t,n)},Ge=t=>F.P=t,Ie=t=>Object.assign(F,t);function Ve(t,e){ke({$hostElement$:e},t)}function He(t){return t}class qe{x;y;get 0(){return this.x}set 0(t){this.x=t}get 1(){return this.y}set 1(t){this.y=t}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}get xy(){return[this.x,this.y]}*[Symbol.iterator](){yield this.x,yield this.y}constructor(t,e){this.x=t,this.y=e}add(t){return new qe(this.x+t.x,this.y+t.y)}eq(t){return this.x===t.x&&this.y===t.y}clone(){return new qe(this.x,this.y)}static from(t){if("number"==typeof t)return new qe(t,t);if(Array.isArray(t))return new qe(t[0]??0,t[1]??0);if("object"==typeof t&&"number"==typeof t.x&&"number"==typeof t.y)return new qe(t.x,t.y);throw Error("Wrong Vec2 source")}}function Be(t,e){return new qe(t%e,Math.floor(t/e))}function Je(t,e){return t.y*e+t.x}function Ye(t){if(1!==t.key.length)return!1;const e=t.key.toLowerCase();return/[0-9a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u024F]/.test(e)}function Ke(t){if(1!==t.data.length)return!1;const e=t.data.toLowerCase();return/[0-9a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u024F]/.test(e)}export{D as H,qe as V,Be as Vec2fromIndex,Le as f,Y as getAssetPath,ie as h,Je as indexFromXY,Ke as isInputEventLetter,Ye as isKeyboardEventLetter,Ue as p,Ve as render,K as setAssetPath,Ge as setNonce,Ie as setPlatformOptions,He as t}
@@ -1 +1 @@
1
- import{h as t,t as i,p as s,H as e,Vec2fromIndex as r,V as n,f as l,isKeyboardEventLetter as o,indexFromXY as h}from"./index.js";function c({isCurrent:i,word:s,onPointerDown:e}){return t("p",{onPointerDown:e,part:"clue",class:{"--current":i}},s.clue)}function a({data:i,isInCurrentClue:s,isSelected:e}){return t("div",{part:"cell",class:{"--blocked":i.isBlocked,"--in-current-clue":s,"--selected":e}},t("div",{class:"_inner",style:{position:"absolute",width:"100%"}},i.value))}const d=s(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}init=!0;data;hWords=[];vWords=[];currentClueId=null;currentClue=null;isFocused=!1;selectedCell=null;componentWillLoad(){this.init&&this.data&&this.initGame()}get allWords(){return[...this.hWords,...this.vWords]}async initGame(t=this.data){if(!t.words)throw Error("Words definition missing");this.hWords=[],this.vWords=[],t.words.forEach(((t,i)=>{const s=Math.random();void 0===t.id&&(t.id=`${s}_${i}`),"horizontal"===t.orientation&&(this.hWords=[...this.hWords,t]),"vertical"===t.orientation&&(this.vWords=[...this.vWords,t])})),this.buildBoard()}boardWidth=0;boardHeight=0;cells=[];buildBoard(){let t=0,i=0;this.allWords.forEach((s=>{"horizontal"===s.orientation&&(t=Math.max(t,s.x+s.word.length),i=Math.max(i,s.y+1)),"vertical"===s.orientation&&(t=Math.max(t,s.x+1),i=Math.max(i,s.y+s.word.length))}));const s=Array(i*t).fill(null).map(((i,s)=>{const[e,n]=r(s,t);return{index:s,x:e,y:n,value:null,isCurrent:!1,isInCurrentWord:!1,isBlocked:!0}}));this.allWords.forEach((i=>{if("horizontal"===i.orientation)for(let e=0;e<i.word.length;e++){const r=n.from(i),l=h(new n(r.x+e,r.y),t);s[l].isBlocked=!1}if("vertical"===i.orientation)for(let e=0;e<i.word.length;e++){const r=n.from(i),l=h(new n(r.x,r.y+e),t);s[l].isBlocked=!1}})),this.cells=s,this.boardWidth=t,this.boardHeight=i}isInClue(t,i=this.currentClue){return null!==i&&(t.x===i.x||t.y===i.y)&&("horizontal"===i.orientation?!(t.y!==i.y||t.x<i.x||t.x>=i.x+i.word.length):"vertical"===i.orientation?!(t.x!==i.x||t.y<i.y||t.y>=i.y+i.word.length):void 0)}isSelectedCell(t){return!!this.selectedCell&&t.x===this.selectedCell.x&&t.y===this.selectedCell.y}getNextClueId(){if(!this.currentClueId)return this.allWords[0]?.id??null;const t=this.allWords.findIndex((t=>t.id===this.currentClueId));return t<0?this.allWords[0]?.id??null:this.allWords[t+1]?.id??null}getPrevClueId(){if(!this.currentClueId)return this.allWords[0]?.id??null;const t=this.allWords.findIndex((t=>t.id===this.currentClueId));return t<0?this.allWords[0]?.id??null:this.allWords[t-1]?.id??null}inputLetter(t){this.selectedCell&&(this.selectedCell.value=t,this.selectNextCell(),l(this))}selectNextCell(){if(!this.selectedCell||!this.currentClue)return;const t=this.currentClue.orientation;if(function(t,i){const s=[t.x+("horizontal"===t.orientation?t.word.length-1:0),t.y+("vertical"===t.orientation?t.word.length-1:0)];return i.x===s[0]&&i.y===s[1]}(this.currentClue,this.selectedCell)){const t=this.getNextClueId();this.selectClue(t||(this.hWords[0]?.id??this.vWords[0]?.id))}else"horizontal"===t&&this.selectCellByXY(new n(this.selectedCell.x+1,this.selectedCell.y)),"vertical"===t&&this.selectCellByXY(new n(this.selectedCell.x,this.selectedCell.y+1))}onFocusin(){this.isFocused=!0,this.currentClueId||(this.currentClueId=this.allWords[0]?.id??null)}onFocusOut(){this.isFocused=!1}selectClue(t,{row:i,col:s}={}){if(!t)return;this.currentClueId=t;const e=this.allWords.find((i=>i.id===t));e||(this.currentClueId=null,this.currentClue=null),this.currentClue=e;const r=[e.x,e.y];void 0!==i&&"vertical"===e.orientation&&i>=e.y&&i<e.y+e.word.length&&(r[1]=i),void 0!==s&&"horizontal"===e.orientation&&s>=e.x&&s<e.x+e.word.length&&(r[0]=s),this.selectCellByXY(n.from(r))}selectCellByXY(t){const i=h(t,this.boardWidth);this.selectedCell=this.cells[i]??null}findNonblockedCell(t,i){const s=new n(t[0]+i[0],t[1]+i[1]),e=this.boardWidth*this.boardHeight;let r=0;for(;this.isCellBlocked(s)&&r<e;)r++,s[0]+=i[0],s[1]+=i[1],s[0]<0&&(s[0]=this.boardWidth-1),s[0]>=this.boardWidth&&(s[0]=0),s[1]<0&&(s[1]=this.boardHeight-1),s[1]>=this.boardHeight&&(s[1]=0);return s}isCellBlocked(t){const i=this.cells[h(t,this.boardWidth)];return i?.isBlocked??!0}selectClueByXY(t){const i=this.allWords.filter((i=>this.isInClue(t,i)));if(!i.length)return;const s=i.find((t=>t.orientation===this.currentClue?.orientation));this.selectClue(s?.id??i[0].id,{row:t.y,col:t.x})}onKeyPress(t){if(console.log(t),"Tab"===t.key){const i=t.shiftKey?this.getPrevClueId():this.getNextClueId();i&&(t.preventDefault(),this.selectClue(i))}if(o(t)&&this.inputLetter(t.key.toLowerCase()[0]),this.selectedCell)switch(t.key){case"ArrowLeft":return this.selectClueByXY(this.findNonblockedCell(new n(this.selectedCell.x,this.selectedCell.y),new n(-1,0))),void t.preventDefault();case"ArrowRight":return this.selectClueByXY(this.findNonblockedCell(new n(this.selectedCell.x,this.selectedCell.y),new n(1,0))),void t.preventDefault();case"ArrowUp":return this.selectClueByXY(this.findNonblockedCell(new n(this.selectedCell.x,this.selectedCell.y),new n(0,-1))),void t.preventDefault();case"ArrowDown":return this.selectClueByXY(this.findNonblockedCell(new n(this.selectedCell.x,this.selectedCell.y),new n(0,1))),void t.preventDefault()}}render(){return t("div",{key:"e298ac6f3a1d95bc41c4854b39600f8ac7f1696d",part:"main",class:{"--focused":this.isFocused},onFocusin:this.onFocusin.bind(this),onFocusout:this.onFocusOut.bind(this),tabIndex:0,onKeyDown:this.onKeyPress.bind(this)},t("div",{key:"74be935779266effb4605f2aa5883bf564610bc0",part:"clues"},t("div",{key:"125d8938e4f084562b54794158074bdaeda722b5",part:"clue-list"},this.hWords.map((i=>t(c,{word:i,isCurrent:i.id===this.currentClueId,onPointerDown:()=>this.selectClue(i.id)})))),t("div",{key:"4469227db5156a2d0b30e4dc7ef9ea8f8a1fc3bc",part:"clue-list"},this.vWords.map((i=>t(c,{word:i,isCurrent:i.id===this.currentClueId,onPointerDown:()=>this.selectClue(i.id)}))))),t("div",{key:"965b2e99d1fbf273907f722e8b15749fbd728070",part:"board",style:{"--test":"12","grid-template-columns":`repeat(${this.boardWidth}, 1fr)`}},this.cells.map((i=>{const s=this.isInClue(i),e=this.isSelectedCell(i);return t(a,{isInCurrentClue:s,isSelected:e,data:i})}))),t("div",{key:"3d97bcc65c5eb1d25b60aa5183a7c63f6eecebf9",part:"preview"},"Tu bedzie podgląd: ",this.currentClueId))}static get style(){return'*[part=main]{display:grid;grid-template-areas:"clues board";grid-template-columns:1fr 1fr}*[part=main].--focused{background:lightgrey}[part=clues]{grid-area:clues;display:grid;grid-template-columns:1fr 1fr}[part=clue].--current{background:lightcyan}[part=board]{grid-area:board;display:grid}[part=cell]{aspect-ratio:1;background:#d9d9d9;position:relative;container-type:size}[part=cell]:nth-child(2n){background:#999}[part=cell].--blocked{background:black}[part=cell].--in-current-clue{box-shadow:inset 0 0 2px 2px lightblue}[part=cell].--selected{background:lightblue}[part=cell] ._inner{position:absolute;top:0;left:0;right:0;bottom:0;display:grid;place-content:center;text-transform:uppercase;font-size:80cqh}[part=preview]{display:none}'}},[513,"mb-crossword",{init:[4],data:[16],hWords:[32],vWords:[32],currentClueId:[32],currentClue:[32],isFocused:[32],selectedCell:[32],boardWidth:[32],boardHeight:[32],cells:[32],initGame:[64]}]);function u(){"undefined"!=typeof customElements&&["mb-crossword"].forEach((t=>{"mb-crossword"===t&&(customElements.get(i(t))||customElements.define(i(t),d))}))}u();const p=d,f=u;export{p as MbCrossword,f as defineCustomElement}
1
+ import{h as t,t as e,p as i,H as r,Vec2fromIndex as s,V as l,f as o,isInputEventLetter as a,indexFromXY as c}from"./index.js";function n({isCurrent:e,word:i,onPointerDown:r,preview:s,showPreview:l}){return t("p",{onPointerDown:r,part:"clue",class:{"--current":e}},i.clue,l&&t("span",{class:"preview"},s))}function h({data:e,isInCurrentClue:i,isSelected:r,isSpecial:s,onPointerDown:l}){return t("div",{onPointerDown:l,part:"cell",class:{"--blocked":e.isBlocked,"--in-current-clue":i,"--selected":r,"--alt":!((e.x+e.y)%2),"--special":s},style:{"--x":""+e.x,"--y":""+e.y}},t("div",{class:"_inner",style:{position:"absolute",width:"100%"}},e.value))}const d=i(class extends r{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}init=!0;data;showCluePreview=!0;textInput;hWords=[];vWords=[];currentClueId=null;currentClue=null;isFocused=!1;selectedCell=null;componentWillLoad(){console.log("componentWillLoad",this.init,this.data),this.init&&this.data&&this.initGame()}watchData(){this.init&&this.data&&this.initGame()}get allWords(){return[...this.hWords,...this.vWords]}async initGame(t=this.data){if(console.log("initGame"),!t.words)throw Error("Words definition missing");this.hWords=[],this.vWords=[],t.words.forEach(((t,e)=>{const i=Math.random();void 0===t.id&&(t.id=`${i}_${e}`),"horizontal"===t.orientation&&(this.hWords=[...this.hWords,t]),"vertical"===t.orientation&&(this.vWords=[...this.vWords,t])})),this.specialBorders=t.specialBorders??[],this.specialCells=t.specialCells??[],this.labels=t.labels??[],this.buildBoard()}async checkAnswer(){const t=this.cells.filter((t=>!t.isBlocked));return console.log(t),t.forEach((t=>{console.log(`${t.value} === ${t.answer}`,`${t.x},${t.y}`,t.value===t.answer)})),t.every((t=>t.value===t.answer))}specialBorders=[];specialCells=[];labels=[];boardWidth=0;boardHeight=0;cells=[];buildBoard(){let t=0,e=0;this.allWords.forEach((i=>{"horizontal"===i.orientation&&(t=Math.max(t,i.x+i.word.length),e=Math.max(e,i.y+1)),"vertical"===i.orientation&&(t=Math.max(t,i.x+1),e=Math.max(e,i.y+i.word.length))}));const i=Array(e*t).fill(null).map(((e,i)=>{const[r,l]=s(i,t);return{index:i,x:r,y:l,value:null,isCurrent:!1,isInCurrentWord:!1,isBlocked:!0}}));this.allWords.forEach((e=>{if("horizontal"===e.orientation)for(let r=0;r<e.word.length;r++){const s=l.from(e),o=c(new l(s.x+r,s.y),t);i[o].isBlocked=!1,i[o].answer=e.word[r]}if("vertical"===e.orientation)for(let r=0;r<e.word.length;r++){const s=l.from(e),o=c(new l(s.x,s.y+r),t);i[o].isBlocked=!1,i[o].answer=e.word[r]}})),this.cells=i,this.boardWidth=t,this.boardHeight=e}getClueById(t){return this.allWords.find((e=>e.id===t))??null}isInClue(t,e=this.currentClue){return null!==e&&(t.x===e.x||t.y===e.y)&&("horizontal"===e.orientation?!(t.y!==e.y||t.x<e.x||t.x>=e.x+e.word.length):"vertical"===e.orientation?!(t.x!==e.x||t.y<e.y||t.y>=e.y+e.word.length):void 0)}isSelectedCell(t){return!!this.selectedCell&&t.x===this.selectedCell.x&&t.y===this.selectedCell.y}getNextClueId(){if(!this.currentClueId)return this.allWords[0]?.id??null;const t=this.allWords.findIndex((t=>t.id===this.currentClueId));return t<0?this.allWords[0]?.id??null:this.allWords[t+1]?.id??null}getPrevClueId(){if(!this.currentClueId)return this.allWords[0]?.id??null;const t=this.allWords.findIndex((t=>t.id===this.currentClueId));return t<0?this.allWords[0]?.id??null:this.allWords[t-1]?.id??null}inputLetter(t){this.selectedCell&&(this.selectedCell.value=t,this.selectNextCell(),o(this))}backspace(){this.selectedCell&&(this.selectedCell.value?(this.selectedCell.value="",this.selectPrevCell()):(this.selectPrevCell(),this.selectedCell.value=""),o(this))}selectNextCell(){if(!this.selectedCell||!this.currentClue)return;const t=this.currentClue.orientation;if(function(t,e){return u(t).eq(l.from(e))}(this.currentClue,this.selectedCell)){const t=this.getNextClueId(),e=this.getClueById(t);return e?void this.selectClueByXY(l.from(e)):void 0}"horizontal"===t&&this.selectClueByXY(new l(this.selectedCell.x+1,this.selectedCell.y)),"vertical"===t&&this.selectClueByXY(new l(this.selectedCell.x,this.selectedCell.y+1))}selectPrevCell(){if(!this.selectedCell||!this.currentClue)return;const t=this.currentClue.orientation;if(function(t,e){return l.from(t).eq(l.from(e))}(this.currentClue,this.selectedCell)){const t=this.getPrevClueId(),e=this.getClueById(t);if(e){const t=u(e);return console.log(t),void this.selectClueByXY(t)}}"horizontal"===t&&this.selectClueByXY(new l(this.selectedCell.x-1,this.selectedCell.y)),"vertical"===t&&this.selectClueByXY(new l(this.selectedCell.x,this.selectedCell.y-1))}onFocusin(){this.isFocused=!0,this.currentClueId||(this.currentClueId=this.allWords[0]?.id??null),this.textInput.focus()}onFocusOut(){this.isFocused=!1}selectClue(t,{row:e,col:i}={}){if(!t)return;this.currentClueId=t;const r=this.allWords.find((e=>e.id===t));r||(this.currentClueId=null,this.currentClue=null),this.currentClue=r;const s=[r.x,r.y];void 0!==e&&"vertical"===r.orientation&&e>=r.y&&e<r.y+r.word.length&&(s[1]=e),void 0!==i&&"horizontal"===r.orientation&&i>=r.x&&i<r.x+r.word.length&&(s[0]=i),this.selectCellByXY(l.from(s))}selectCellByXY(t){const e=c(t,this.boardWidth);this.selectedCell=this.cells[e]??null}findNonblockedCell(t,e){const i=new l(t[0]+e[0],t[1]+e[1]),r=this.boardWidth*this.boardHeight;let s=0;for(;this.isCellBlocked(i)&&s<r;)s++,i[0]+=e[0],i[1]+=e[1],i[0]<0&&(i[0]=this.boardWidth-1),i[0]>=this.boardWidth&&(i[0]=0),i[1]<0&&(i[1]=this.boardHeight-1),i[1]>=this.boardHeight&&(i[1]=0);return i}isCellBlocked(t){const e=this.cells[c(t,this.boardWidth)];return e?.isBlocked??!0}selectClueByXY(t){const e=this.allWords.filter((e=>this.isInClue(t,e)));if(e.length)if(this.selectedCell&&2===e.length&&t.eq(l.from(this.selectedCell))){const i=e.find((t=>t.orientation!==this.currentClue?.orientation));this.selectClue(i?.id??e[0].id,{row:t.y,col:t.x})}else{const i=e.find((t=>t.orientation===this.currentClue?.orientation));this.selectClue(i?.id??e[0].id,{row:t.y,col:t.x})}}getCluePreview(t){if(!t)return"_";const e=Array(t.word.length).fill("_");for(let i=0;i<t.word.length;i++){const r=new l(t.x,t.y).add("vertical"===t.orientation?new l(0,1*i):new l(1*i,0)),s=this.cells[c(r,this.boardWidth)];s.value&&(e[i]=s.value)}return e.join("")}onKeyPress(t){if(console.log(t),"Tab"===t.key){const e=t.shiftKey?this.getPrevClueId():this.getNextClueId();e&&(t.preventDefault(),this.selectClue(e))}if(this.selectedCell)switch(t.key){case"ArrowLeft":return this.selectClueByXY(this.findNonblockedCell(new l(this.selectedCell.x,this.selectedCell.y),new l(-1,0))),void t.preventDefault();case"ArrowRight":return this.selectClueByXY(this.findNonblockedCell(new l(this.selectedCell.x,this.selectedCell.y),new l(1,0))),void t.preventDefault();case"ArrowUp":return this.selectClueByXY(this.findNonblockedCell(new l(this.selectedCell.x,this.selectedCell.y),new l(0,-1))),void t.preventDefault();case"ArrowDown":return this.selectClueByXY(this.findNonblockedCell(new l(this.selectedCell.x,this.selectedCell.y),new l(0,1))),void t.preventDefault();case"Backspace":console.log("BACKSPACE!"),this.backspace()}}onInput(t){a(t)&&this.inputLetter(t.data.toLowerCase()[0]),this.textInput.value=""}render(){const e=!!this.vWords.length,i=!!this.hWords.length,r=i&&e;return t("div",{key:"87d88806305c6102eeb76c3984d4b9c2ad2d9759",part:"main",class:{"--focused":this.isFocused},onFocusin:this.onFocusin.bind(this),onFocusout:this.onFocusOut.bind(this)},t("input",{key:"49cdb053a4d2c4ad2c7eb881488b18c68e31fe65",type:"text",class:"dummy",ref:t=>this.textInput=t,onKeyDown:this.onKeyPress.bind(this),onInput:this.onInput.bind(this)}),t("div",{key:"0ca71a907f70e17a6d2d10bff9462bd0b2284007",part:"clues",class:{twoLists:r,oneList:!r}},i?t("div",{part:"clue-list"},this.hWords.map((e=>{const i=e.id===this.currentClueId;return t(n,{showPreview:this.showCluePreview,preview:this.getCluePreview(e),word:e,isCurrent:i,onPointerDown:()=>this.selectClue(e.id)})}))):"",e?t("div",{part:"clue-list"},this.vWords.map((e=>{const i=e.id===this.currentClueId;return t(n,{showPreview:this.showCluePreview,preview:this.getCluePreview(e),word:e,isCurrent:i,onPointerDown:()=>this.selectClue(e.id)})}))):""),t("div",{key:"ea16dca25fe7884d25f9748f98740ad83e25293e",part:"board",style:{"--board-width":""+this.boardWidth,"grid-template-columns":`repeat(${this.boardWidth}, 1fr)`,aspectRatio:""+this.boardWidth/this.boardHeight}},this.cells.filter((t=>!t.isBlocked)).map((e=>{const i=this.isInClue(e),r=this.isSelectedCell(e),s=this.specialCells.some((t=>t.x===e.x&&t.y===e.y));return t(h,{isSpecial:s,onPointerDown:()=>this.selectClueByXY(l.from(e)),isInCurrentClue:i,isSelected:r,data:e})})),this.specialBorders.map(((e,i)=>t("div",{key:i,part:"special-border",class:{top:!!(4096&e.border),right:!!(256&e.border),bottom:!!(16&e.border),left:!!(1&e.border)},style:{"--x":""+e.x,"--y":""+e.y}}))),this.labels.map((e=>t("div",{part:"label",style:{"--x":""+e.x,"--y":""+e.y},onPointerDown:()=>this.selectClue(e.clueId)},t("div",{class:"_inner"},e.text))))),t("div",{key:"d391413e7be3dee148f2f5e6d8fbf22742278a0c",part:"preview"},"Tu bedzie podgląd: ",this.currentClueId))}static get delegatesFocus(){return!0}static get watchers(){return{data:[{watchData:0}]}}static get style(){return'*[part=main]{position:relative;display:grid;grid-template-areas:"board" "clues";grid-template-columns:1fr}@media (min-width: 768px){*[part=main]{grid-template-areas:"clues board" "clues .";grid-template-columns:1fr 1fr}}*[part=main].--focused{background:lightgrey}*[part=main] input.dummy{pointer-events:none;opacity:0.2;z-index:100;grid-area:board;border:none}[part=clues]{grid-area:clues;display:grid;grid-template-columns:1fr 1fr;gap:16px}[part=clues].oneList{grid-template-columns:1fr}[part=clue].--current{background:var(--clue-current-background, lightcyan);position:sticky;bottom:0;left:0;right:0}[part=clue] .preview{font-weight:bold;letter-spacing:0.2em;text-align:center;display:block;text-transform:uppercase}[part=board]{grid-area:board;display:block;position:relative;container-type:size;background:var(--board-background, darkgoldenrod);--cell-border-width:2px;--cell-width-temp:calc((100cqw - var(--cell-border-width)) / var(--board-width, 10));--cell-width:var(--cell-width-temp);--cell-width:round(var(--cell-width-temp), 1px)}[part=cell]{display:block;color:var(--cell-color, #11138d);width:calc(var(--cell-width) - var(--cell-border-width));aspect-ratio:1;background:var(--cell-background, #d9d9d9);position:absolute;container-type:size;top:calc(var(--y, 0) * var(--cell-width));left:calc(var(--x, 0) * var(--cell-width));border:var(--cell-border-width) solid var(--cell-border-color, red)}[part=cell].--alt{background:var(--cell-background-alt, #999)}[part=cell].--in-current-clue{box-shadow:inset 0 0 2px 2px var(--cell-selected-background, lightblue)}[part=cell].--selected{background:var(--cell-selected-background, lightblue)}[part=cell].--special{background:var(--cell-special-background, lightgreen)}[part=cell] ._inner{position:absolute;top:0;left:0;right:0;bottom:0;display:grid;place-content:center;text-transform:uppercase;font-size:80cqh}[part=preview]{display:none}[part=special-border]{display:block;background:black;position:absolute;z-index:100;--s-border:max(2px, var(--cell-border-width))}[part=special-border].left,[part=special-border].right{width:var(--s-border);height:calc(var(--cell-width) - var(--cell-border-width));top:calc(var(--y, 0) * var(--cell-width) + var(--cell-border-width))}[part=special-border].left{left:calc(var(--x, 0) * var(--cell-width) - var(--s-border) / 2)}[part=special-border].right{left:calc((var(--x, 0) + 1) * var(--cell-width) - var(--s-border) / 2)}[part=special-border].top,[part=special-border].bottom{width:calc(var(--cell-width) - var(--cell-border-width));height:var(--s-border);left:calc(var(--x, 0) * var(--cell-width) + var(--cell-border-width))}[part=special-border].top{top:calc(var(--y, 0) * var(--cell-width))}[part=special-border].bottom{top:calc((var(--y, 0) + 1) * var(--cell-width))}[part=label]{display:grid;place-content:center;position:absolute;container-type:size;top:calc(var(--y, 0) * var(--cell-width));left:calc(var(--x, 0) * var(--cell-width));width:calc(var(--cell-width) - var(--cell-border-width));aspect-ratio:1}[part=label] ._inner{position:absolute;top:0;left:0;right:0;bottom:0;display:grid;place-content:center;text-transform:uppercase;font-size:60cqh}'}},[529,"mb-crossword",{init:[4],data:[16],showCluePreview:[4,"show-clue-preview"],hWords:[32],vWords:[32],currentClueId:[32],currentClue:[32],isFocused:[32],selectedCell:[32],specialBorders:[32],specialCells:[32],labels:[32],boardWidth:[32],boardHeight:[32],cells:[32],initGame:[64],checkAnswer:[64]},void 0,{data:[{watchData:0}]}]);function u(t){return new l(t.x+("horizontal"===t.orientation?t.word.length-1:0),t.y+("vertical"===t.orientation?t.word.length-1:0))}function p(){"undefined"!=typeof customElements&&["mb-crossword"].forEach((t=>{"mb-crossword"===t&&(customElements.get(e(t))||customElements.define(e(t),d))}))}p();const w=d,v=p;export{w as MbCrossword,v as defineCustomElement}
@@ -1,5 +1,5 @@
1
1
  const NAMESPACE = 'mb-crossword';
2
- const BUILD = /* mb-crossword */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: false, state: true, updatable: true};
2
+ const BUILD = /* mb-crossword */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
3
3
 
4
4
  /*
5
5
  Stencil Client Platform v4.41.0 | MIT Licensed | https://stenciljs.com
@@ -1846,6 +1846,9 @@ var globalStyleSheet;
1846
1846
  function createShadowRoot(cmpMeta) {
1847
1847
  var _a;
1848
1848
  const opts = { mode: "open" };
1849
+ {
1850
+ opts.delegatesFocus = !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */);
1851
+ }
1849
1852
  const shadowRoot = this.attachShadow(opts);
1850
1853
  if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported()) != null ? _a : null;
1851
1854
  if (globalStyleSheet) {
@@ -2194,7 +2197,11 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
2194
2197
  }
2195
2198
  }
2196
2199
  }
2197
- } else if (memberName === "key") ; else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
2200
+ } else if (memberName === "key") ; else if (memberName === "ref") {
2201
+ if (newValue) {
2202
+ newValue(elm);
2203
+ }
2204
+ } else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
2198
2205
  if (memberName[2] === "-") {
2199
2206
  memberName = memberName.slice(3);
2200
2207
  } else if (isMemberInElement(win, ln)) {
@@ -2355,6 +2362,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
2355
2362
  const vnode = vnodes[index];
2356
2363
  if (vnode) {
2357
2364
  const elm = vnode.$elm$;
2365
+ nullifyVNodeRefs(vnode);
2358
2366
  if (elm) {
2359
2367
  elm.remove();
2360
2368
  }
@@ -2484,6 +2492,12 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
2484
2492
  elm.data = text;
2485
2493
  }
2486
2494
  };
2495
+ var nullifyVNodeRefs = (vNode) => {
2496
+ {
2497
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
2498
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
2499
+ }
2500
+ };
2487
2501
  var insertBefore = (parent, newNode, reference, isInitialLoad) => {
2488
2502
  if (typeof newNode["s-sn"] === "string") {
2489
2503
  parent.insertBefore(newNode, reference);
@@ -2707,6 +2721,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
2707
2721
  `Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`
2708
2722
  );
2709
2723
  }
2724
+ const elm = hostRef.$hostElement$ ;
2710
2725
  const oldVal = hostRef.$instanceValues$.get(propName);
2711
2726
  const flags = hostRef.$flags$;
2712
2727
  const instance = hostRef.$lazyInstance$ ;
@@ -2717,6 +2732,27 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
2717
2732
  const didValueChange = newVal !== oldVal && !areBothNaN;
2718
2733
  if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
2719
2734
  hostRef.$instanceValues$.set(propName, newVal);
2735
+ if (cmpMeta.$watchers$) {
2736
+ const watchMethods = cmpMeta.$watchers$[propName];
2737
+ if (watchMethods) {
2738
+ watchMethods.map((watcher) => {
2739
+ try {
2740
+ const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
2741
+ if (flags & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */) {
2742
+ if (!instance) {
2743
+ hostRef.$fetchedCbList$.push(() => {
2744
+ hostRef.$lazyInstance$[watchMethodName](newVal, oldVal, propName);
2745
+ });
2746
+ } else {
2747
+ instance[watchMethodName](newVal, oldVal, propName);
2748
+ }
2749
+ }
2750
+ } catch (e) {
2751
+ consoleError(e, elm);
2752
+ }
2753
+ });
2754
+ }
2755
+ }
2720
2756
  if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
2721
2757
  if (instance.componentShouldUpdate) {
2722
2758
  if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
@@ -2733,6 +2769,17 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
2733
2769
  var _a, _b;
2734
2770
  const prototype = Cstr.prototype;
2735
2771
  if (cmpMeta.$members$ || BUILD.propChangeCallback) {
2772
+ {
2773
+ if (Cstr.watchers && !cmpMeta.$watchers$) {
2774
+ cmpMeta.$watchers$ = Cstr.watchers;
2775
+ }
2776
+ if (Cstr.deserializers && !cmpMeta.$deserializers$) {
2777
+ cmpMeta.$deserializers$ = Cstr.deserializers;
2778
+ }
2779
+ if (Cstr.serializers && !cmpMeta.$serializers$) {
2780
+ cmpMeta.$serializers$ = Cstr.serializers;
2781
+ }
2782
+ }
2736
2783
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
2737
2784
  members.map(([memberName, [memberFlags]]) => {
2738
2785
  if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
@@ -2893,6 +2940,11 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2893
2940
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
2894
2941
  }
2895
2942
  if (!Cstr.isProxied) {
2943
+ {
2944
+ cmpMeta.$watchers$ = Cstr.watchers;
2945
+ cmpMeta.$serializers$ = Cstr.serializers;
2946
+ cmpMeta.$deserializers$ = Cstr.deserializers;
2947
+ }
2896
2948
  proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
2897
2949
  Cstr.isProxied = true;
2898
2950
  }
@@ -2908,6 +2960,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2908
2960
  {
2909
2961
  hostRef.$flags$ &= -9 /* isConstructingInstance */;
2910
2962
  }
2963
+ {
2964
+ hostRef.$flags$ |= 128 /* isWatchReady */;
2965
+ }
2911
2966
  endNewInstance();
2912
2967
  {
2913
2968
  fireConnectedCallback(hostRef.$lazyInstance$, elm);
@@ -3030,6 +3085,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
3030
3085
  let hasSlotRelocation = false;
3031
3086
  lazyBundles.map((lazyBundle) => {
3032
3087
  lazyBundle[1].map((compactMeta) => {
3088
+ var _a2, _b, _c;
3033
3089
  const cmpMeta = {
3034
3090
  $flags$: compactMeta[0],
3035
3091
  $tagName$: compactMeta[1],
@@ -3042,6 +3098,11 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
3042
3098
  {
3043
3099
  cmpMeta.$members$ = compactMeta[2];
3044
3100
  }
3101
+ {
3102
+ cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
3103
+ cmpMeta.$serializers$ = (_b = compactMeta[5]) != null ? _b : {};
3104
+ cmpMeta.$deserializers$ = (_c = compactMeta[6]) != null ? _c : {};
3105
+ }
3045
3106
  const tagName = transformTag(cmpMeta.$tagName$);
3046
3107
  const HostElement = class extends HTMLElement {
3047
3108
  ["s-p"];
@@ -13,6 +13,18 @@ class Vec2 {
13
13
  set 1(y) {
14
14
  this.y = y;
15
15
  }
16
+ get width() {
17
+ return this.x;
18
+ }
19
+ set width(x) {
20
+ this.x = x;
21
+ }
22
+ get height() {
23
+ return this.y;
24
+ }
25
+ set height(y) {
26
+ this.y = y;
27
+ }
16
28
  get xy() {
17
29
  return [this.x, this.y];
18
30
  }
@@ -24,12 +36,21 @@ class Vec2 {
24
36
  this.x = x;
25
37
  this.y = y;
26
38
  }
39
+ add(v) {
40
+ return new Vec2(this.x + v.x, this.y + v.y);
41
+ }
42
+ eq(v) {
43
+ return this.x === v.x && this.y === v.y;
44
+ }
45
+ clone() {
46
+ return new Vec2(this.x, this.y);
47
+ }
27
48
  static from(source) {
28
49
  if (typeof source === 'number') {
29
50
  return new Vec2(source, source);
30
51
  }
31
52
  if (Array.isArray(source)) {
32
- return new Vec2(source[0], source[1]);
53
+ return new Vec2(source[0] ?? 0, source[1] ?? 0);
33
54
  }
34
55
  if (typeof source === 'object' && typeof source.x === 'number' && typeof source.y === 'number') {
35
56
  return new Vec2(source.x, source.y);
@@ -52,5 +73,11 @@ function isKeyboardEventLetter(event) {
52
73
  const key = event.key.toLowerCase();
53
74
  return /[0-9a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u024F]/.test(key);
54
75
  }
76
+ function isInputEventLetter(event) {
77
+ if (event.data.length !== 1)
78
+ return false;
79
+ const key = event.data.toLowerCase();
80
+ return /[0-9a-zA-Z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u024F]/.test(key);
81
+ }
55
82
 
56
- export { Vec2fromIndex as V, Vec2 as a, indexFromXY as b, isKeyboardEventLetter as i };
83
+ export { Vec2fromIndex as V, Vec2 as a, indexFromXY as b, isKeyboardEventLetter as c, isInputEventLetter as i };
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- export { V as Vec2fromIndex, b as indexFromXY, i as isKeyboardEventLetter } from './index-0i8AYf_G.js';
1
+ export { V as Vec2fromIndex, b as indexFromXY, i as isInputEventLetter, c as isKeyboardEventLetter } from './index-Dn3GSx6U.js';
@@ -1,11 +1,11 @@
1
- import { b as bootstrapLazy } from './index-B4XIBYtu.js';
2
- export { s as setNonce } from './index-B4XIBYtu.js';
1
+ import { b as bootstrapLazy } from './index-BGHKtxML.js';
2
+ export { s as setNonce } from './index-BGHKtxML.js';
3
3
  import { g as globalScripts } from './app-globals-DQuL1Twl.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["mb-crossword",[[513,"mb-crossword",{"init":[4],"data":[16],"hWords":[32],"vWords":[32],"currentClueId":[32],"currentClue":[32],"isFocused":[32],"selectedCell":[32],"boardWidth":[32],"boardHeight":[32],"cells":[32],"initGame":[64]}]]]], options);
8
+ return bootstrapLazy([["mb-crossword",[[529,"mb-crossword",{"init":[4],"data":[16],"showCluePreview":[4,"show-clue-preview"],"hWords":[32],"vWords":[32],"currentClueId":[32],"currentClue":[32],"isFocused":[32],"selectedCell":[32],"specialBorders":[32],"specialCells":[32],"labels":[32],"boardWidth":[32],"boardHeight":[32],"cells":[32],"initGame":[64],"checkAnswer":[64]},null,{"data":[{"watchData":0}]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };