pacman-contribution-graph 1.0.13 â 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -9
- package/dist/pacman-contribution-graph.min.js +1 -1
- package/package.json +44 -26
- package/.prettierrc +0 -8
- package/.vscode/extensions.json +0 -5
- package/.vscode/settings.json +0 -6
- package/assets/packman-demo.png +0 -0
- package/dist/pacman-contribution-graph.js +0 -1769
- package/dist/pacman-contribution-graph.js.map +0 -1
- package/embeded/canvas.html +0 -41
- package/embeded/svg.html +0 -18
- package/github-action/action.yml +0 -16
- package/github-action/dist/index.js +0 -26901
- package/github-action/package.json +0 -14
- package/github-action/pnpm-lock.yaml +0 -77
- package/github-action/src/index.js +0 -47
- package/index.html +0 -528
- package/server/api/contributions/route.ts.z +0 -31
- package/server/page.zts.z +0 -13
- package/src/assets/images/ghosts/blinky.png +0 -0
- package/src/assets/images/ghosts/clyde.png +0 -0
- package/src/assets/images/ghosts/inky.png +0 -0
- package/src/assets/images/ghosts/pinky.png +0 -0
- package/src/assets/images/ghosts/scared.png +0 -0
- package/src/assets/sounds/pacman_beginning.wav +0 -0
- package/src/assets/sounds/pacman_chomp.wav +0 -0
- package/src/assets/sounds/pacman_death.wav +0 -0
- package/src/assets/sounds/pacman_eatghost.wav +0 -0
- package/src/canvas.ts +0 -244
- package/src/constants.ts +0 -102
- package/src/game.ts +0 -231
- package/src/grid.ts +0 -127
- package/src/index.ts +0 -48
- package/src/movement/ghosts-movement.ts +0 -187
- package/src/movement/movement-utils.ts +0 -40
- package/src/movement/pacman-movement.ts +0 -223
- package/src/music-player.ts +0 -119
- package/src/store.ts +0 -23
- package/src/svg.ts +0 -254
- package/src/types.ts +0 -72
- package/src/utils.ts +0 -81
- package/tsconfig.json +0 -11
- package/webpack.common.js +0 -19
- package/webpack.dev.js +0 -23
- package/webpack.prod.js +0 -18
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Pac-Man Contribution Graph Game
|
|
1
|
+
# đģ Pac-Man Contribution Graph Game
|
|
2
2
|
|
|
3
3
|
Transform your GitHub or GitLab contribution graph into an interactive Pac-Man game! This JavaScript library offers a unique and engaging way to visualize your coding activity over the past year.
|
|
4
4
|
|
|
@@ -8,22 +8,24 @@ Transform your GitHub or GitLab contribution graph into an interactive Pac-Man g
|
|
|
8
8
|
<img alt="pacman contribution graph" src="https://raw.githubusercontent.com/abozanona/abozanona/output/pacman-contribution-graph.svg">
|
|
9
9
|
</picture>
|
|
10
10
|
|
|
11
|
-
## Features
|
|
11
|
+
## đŽ Features
|
|
12
12
|
|
|
13
13
|
Elevate your GitHub profile with the Pac-Man Contribution Graph Game and add a playful touch to your coding journey!
|
|
14
14
|
|
|
15
15
|
- **Contribution Visualization**: Converts your GitHub or GitLab contribution data into a colorful grid.
|
|
16
|
-
- **
|
|
16
|
+
- **Pac-Man Gameplay**: Classic Pac-Man mechanics where commits are edible dots
|
|
17
17
|
- **Multiple Themes**: Choose between different themes, such as GitHub Dark and GitLab Dark.
|
|
18
18
|
- **Customizable Settings**: Adjust game speed, sound preferences, and output format (Canvas or SVG).
|
|
19
|
+
- **GitHub Integration**: Automatically fetches your contribution data via GraphQL API
|
|
20
|
+
- **GitHub Action**: Easy to add to your profile or website README
|
|
19
21
|
|
|
20
|
-
## Demo
|
|
22
|
+
## đšī¸ Demo
|
|
21
23
|
|
|
22
24
|
Experience the game firsthand:
|
|
23
25
|
|
|
24
26
|
**Live Demo**: [Pac-Man Contribution Game](https://abozanona.github.io/pacman-contribution-graph/)
|
|
25
27
|
|
|
26
|
-
## Installation
|
|
28
|
+
## đ§ Installation
|
|
27
29
|
|
|
28
30
|
To integrate the Pac-Man Contribution Graph into your project, you can install it via npm:
|
|
29
31
|
|
|
@@ -37,7 +39,7 @@ Alternatively, include it directly in your HTML using jsDelivr:
|
|
|
37
39
|
<script src="https://cdn.jsdelivr.net/npm/pacman-contribution-graph@1.0.10/dist/index.min.js"></script>
|
|
38
40
|
```
|
|
39
41
|
|
|
40
|
-
## Usage
|
|
42
|
+
## đ§Š Usage
|
|
41
43
|
|
|
42
44
|
Here's how to set up and run the Pac-Man Contribution Graph:
|
|
43
45
|
|
|
@@ -132,7 +134,48 @@ To showcase the Pac-Man game on your GitHub profile, follow these steps:
|
|
|
132
134
|
|
|
133
135
|
For a detailed guide, refer to the blog post: [Integrate Pac-Man Contribution Graph into Your GitHub Profile](https://abozanona.me/integrate-pacman-contribution-graph-into-github/)
|
|
134
136
|
|
|
135
|
-
##
|
|
137
|
+
## âŗ Run the Workflow Manually
|
|
138
|
+
|
|
139
|
+
Once you have everything set up:
|
|
140
|
+
|
|
141
|
+
- Go to the "Actions" tab in your repository
|
|
142
|
+
- Click "Update Pac-Man Contribution"
|
|
143
|
+
- Click "Run workflow" > "Run workflow"
|
|
144
|
+
|
|
145
|
+
This will start the SVG generation process and you will then be able to see the animation working in your README!
|
|
146
|
+
This implementation will allow your Pac-Man contribution graph to be automatically updated every day, keeping it always up to date with your latest contributions.
|
|
147
|
+
|
|
148
|
+
## đ¯ How it Works
|
|
149
|
+
|
|
150
|
+
The application uses your GitHub contribution data to:
|
|
151
|
+
|
|
152
|
+
1. Create a grid where each cell represents a day of contribution
|
|
153
|
+
2. Use the contribution intensity levels provided by the GitHub API:
|
|
154
|
+
|
|
155
|
+
- NONE: Days with no contributions (empty spaces in the game)
|
|
156
|
+
- FIRST_QUARTILE: Days with few contributions (small points, 1 point in the game)
|
|
157
|
+
- SECOND_QUARTILE: Days with moderate contributions (medium points, 2 points)
|
|
158
|
+
- THIRD_QUARTILE: Days with many contributions (large points, 5 points)
|
|
159
|
+
- FOURTH_QUARTILE: Days with exceptional contributions (power pellets that activate ghost-eating mode)
|
|
160
|
+
|
|
161
|
+
These levels are relative to each user's contribution pattern and are automatically calculated by GitHub, so the density of elements in the game will reflect each user's unique profile.
|
|
162
|
+
|
|
163
|
+
3. Pac-Man navigates the grid using pathfinding algorithms
|
|
164
|
+
4. Ghosts chase Pac-Man with unique behaviors (as in the original game)
|
|
165
|
+
5. All gameplay is recorded and exported as an animated SVG
|
|
166
|
+
|
|
167
|
+
## đģ Ghosts Personalities
|
|
168
|
+
|
|
169
|
+
Each ghost has been given new looks and personalities that are true to the original game.
|
|
170
|
+
|
|
171
|
+
| Ghost | Preview | Behavior |
|
|
172
|
+
| :----------------: | :-----------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
173
|
+
| **Blinky** (red) | <p align="center"><img src="assets/gifs/red_flip.gif" height="40" alt="Blinky"></p> | An aggressive stalker who targets Pac-Man directly. He gets faster when there are only a few dots left on the map, which players call "Elroy mode". |
|
|
174
|
+
| **Pinky** (pink) | <p align="center"><img src="assets/gifs/pink_flip.gif" height="40" alt="Pinky"></p> | Strategist who tries to ambush Pac-Man by positioning himself 4 spaces ahead of his current direction. He specializes in traps and ambushes. |
|
|
175
|
+
| **Inky** (cyan) | <p align="center"><img src="assets/gifs/cyan_flip.gif" height="40" alt="Inky"></p> | Unpredictable and complex. Uses Blinky's position as a reference for his movement, calculating a vector that passes through Pac-Man and then doubling that distance. |
|
|
176
|
+
| **Clyde** (orange) | <p align="center"><img src="assets/gifs/orange_flip.gif" height="40" alt="Clyde"></p> | Shy and erratic. Chases Pac-Man when he is far away, but when he gets closer than 8 spaces away, he runs away to his corner. This "shy" behavior makes him less predictable. |
|
|
177
|
+
|
|
178
|
+
## đ¤ Contributing
|
|
136
179
|
|
|
137
180
|
Contributions are welcome! To contribute:
|
|
138
181
|
|
|
@@ -142,10 +185,17 @@ Contributions are welcome! To contribute:
|
|
|
142
185
|
4. Push to the branch: `git push origin feature-name`.
|
|
143
186
|
5. Submit a pull request.
|
|
144
187
|
|
|
145
|
-
## Acknowledgements
|
|
188
|
+
## đ Acknowledgements
|
|
146
189
|
|
|
147
190
|
Inspired by the [snk](https://github.com/Platane/snk) project, which turns your GitHub contribution graph into a snake game. Special thanks to all contributors and the open-source community for their support.
|
|
148
191
|
|
|
149
|
-
## Online tools that use Pac-Man Contribution Graph Game
|
|
192
|
+
## đ Online tools that use Pac-Man Contribution Graph Game
|
|
150
193
|
|
|
151
194
|
- Profile Readme Generator: [Website](https://profile-readme-generator.com/) âĸ [Pull Request](https://github.com/maurodesouza/profile-readme-generator/pull/98)
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
<p align="center">
|
|
199
|
+
These ghosts work hard! Leave a cuddle before you leave.<br>
|
|
200
|
+
<img src="assets/gifs/pink_pet_cafune.gif" alt="Ghost being petted" height="80">
|
|
201
|
+
</p>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var t={d:(n,e)=>{for(var a in e)t.o(e,a)&&!t.o(n,a)&&Object.defineProperty(n,a,{enumerable:!0,get:e[a]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n)},n={};t.d(n,{C:()=>K});const e=52,a="yellow",o="#80808064",i=["blinky","clyde","inky","pinky"],r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],c=200,s={github:{textColor:"#586069",gridBackground:"#ffffff",contributionBoxColor:"#9be9a8",emptyContributionBoxColor:"#ebedf0",wallColor:"#000000"},"github-dark":{textColor:"#8b949e",gridBackground:"#0d1117",contributionBoxColor:"#26a641",emptyContributionBoxColor:"#161b22",wallColor:"#FFFFFF"},gitlab:{textColor:"#626167",gridBackground:"#ffffff",contributionBoxColor:"#7992f5",emptyContributionBoxColor:"#ececef",wallColor:"#000000"},"gitlab-dark":{textColor:"#999999",gridBackground:"#1f1f1f",contributionBoxColor:"#2e7db1",emptyContributionBoxColor:"#2d2d2d",wallColor:"#FFFFFF"}},l={blinky:{imgDate:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAfUlEQVQ4T+2TUQ7AIAhDy/0PzQIRAqxmLtnn/DJPWypBAVkKKOMCyOQN7IRElLrcnIrDLNK4wVtxNbkb6Hq+jOcSbim6QVzKEstkw92gxVeFrMpqokix4wA+NvCOnvfArvcEbHoe2G9QmmhDMUc65p3xYC6q3zQPxtdl3NgF5QpL/b/rs3IAAAAASUVORK5CYIIA"},clyde:{imgDate:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAgUlEQVQ4T+2T0Q6AIAhFLx9sH1MfTIPCAeLKrcd8PHqP4JBQLN7BFacNlHkAs+AQcqIueBs2mVWjgtWwl4yCdrd/pHYLLlVEgR2yK0wy4SoI5TcGXU4wM+AEJQfwsUCuXngDOR4rqKbngf0C94gyFHmkbd4rbkxD/pv2jfR1Ky7sBNrzXbHpnBX+AAAAAElFTkSuQmCC"},inky:{imgDate:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAg0lEQVQ4T+WTWxKAIAhFuQvK/a+jFoT5QAVxypn+6vMEx6sDIO/jk12OAMs1WDVOXV3UBW+bRVbTFMFu8yCZBExH/g26VHCXI0AJpKgdUCUrTlkwxE+FECdzS7HiJemXgvyeO29gE7jD8wDVFX4vSLNtR1q2z+OVlaZxTaXYrq7HbxYBS8VgMVrqzkEAAAAASUVORK5CYIIA"},pinky:{imgDate:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAhklEQVQ4T+2T0Q2AIAwF281wC50Qt9DNagoptqVESfyUz4N3vJCCECxaD4o47gt6bsAo2IWUqAnehkUmbYpgNqwlvSCnur+dtnnAuYUVyCGJimTAi8DUzwmwOoGI7hYjDgAfC/jqiTfg47ZBND0P7BeoR+Sh8CMt8x5xYSWkv2nbcF834swuA/9u49Yy5bgAAAAASUVORK5CYIIA"},scared:{imgDate:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAeUlEQVQ4T82TUQ6AMAhD7UX0/sdyF0GREVmDmTN+bH9r6Bs0A0t2VpFULwDrrfBkZFcA3YC3ZodViAFGzQHyP0B2w2NrB0/1AoDbHwLoQ5/nrw1OBuD5e/crbM9Aiz35njHWzpSB/m3+0r40mV41M8U19WJe3Uw/tQOKt08pUUbBEQAAAABJRU5ErkJgggAA"}},u={horizontal:Array(53).fill(null).map((()=>Array(8).fill({active:!1,id:""}))),vertical:Array(53).fill(null).map((()=>Array(8).fill({active:!1,id:""})))},h=(t,n,e,a)=>{"horizontal"===e?t>=0&&t<u.horizontal.length&&n>=0&&n<u.horizontal[0].length&&(u.horizontal[t][n]={active:!0,id:a}):t>=0&&t<u.vertical.length&&n>=0&&n<u.vertical[0].length&&(u.vertical[t][n]={active:!0,id:a})};var d,m=function(t,n,e,a){return new(e||(e=Promise))((function(o,i){function r(t){try{s(a.next(t))}catch(t){i(t)}}function c(t){try{s(a.throw(t))}catch(t){i(t)}}function s(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(r,c)}s((a=a.apply(t,n||[])).next())}))};!function(t){t.DEFAULT="https://cdn.jsdelivr.net/npm/pacman-contribution-graph/src/assets/sounds/pacman_chomp.wav",t.BEGINNING="https://cdn.jsdelivr.net/npm/pacman-contribution-graph/src/assets/sounds/pacman_beginning.wav",t.GAME_OVER="https://cdn.jsdelivr.net/npm/pacman-contribution-graph/src/assets/sounds/pacman_death.wav",t.EAT_GHOST="https://cdn.jsdelivr.net/npm/pacman-contribution-graph/src/assets/sounds/pacman_eatghost.wav"}(d||(d={}));class g{constructor(){this.sounds=new Map,this.currentSource=null,this.defaultSource=null,this.isMuted=!1,this.audioContext=new AudioContext}static getInstance(){return g.instance||(g.instance=new g),g.instance}preloadSounds(){return m(this,void 0,void 0,(function*(){for(const t of Object.values(d)){const n=yield fetch(t),e=yield n.arrayBuffer(),a=yield this.audioContext.decodeAudioData(e);this.sounds.set(t,a)}}))}play(t){return m(this,void 0,void 0,(function*(){if(this.isMuted)return;if(this.currentSource)try{this.currentSource.stop()}catch(t){}const n=this.sounds.get(t);if(n)return this.currentSource=this.audioContext.createBufferSource(),this.currentSource.buffer=n,this.currentSource.connect(this.audioContext.destination),this.isMuted||this.currentSource.start(),new Promise((t=>{this.currentSource.onended=()=>{this.currentSource=null,t()}}));console.error(`Sound ${t} not found`)}))}startDefaultSound(){if(this.defaultSource)try{this.defaultSource.stop()}catch(t){}const t=this.sounds.get(d.DEFAULT);t?(this.defaultSource=this.audioContext.createBufferSource(),this.defaultSource.buffer=t,this.defaultSource.loop=!0,this.defaultSource.connect(this.audioContext.destination),this.isMuted||this.defaultSource.start()):console.error("Default sound not found")}stopDefaultSound(){if(this.defaultSource){try{this.defaultSource.stop()}catch(t){}this.defaultSource=null}}mute(){this.isMuted=!0,this.currentSource&&this.currentSource.disconnect(),this.defaultSource&&this.defaultSource.disconnect()}unmute(){this.isMuted=!1,this.currentSource&&this.currentSource.connect(this.audioContext.destination),this.defaultSource&&this.defaultSource.connect(this.audioContext.destination)}}var f=function(t,n,e,a){return new(e||(e=Promise))((function(o,i){function r(t){try{s(a.next(t))}catch(t){i(t)}}function c(t){try{s(a.throw(t))}catch(t){i(t)}}function s(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(r,c)}s((a=a.apply(t,n||[])).next())}))};const p=t=>{var n;return null!==(n=s[t.config.gameTheme])&&void 0!==n?n:s.github},y={},x=(t,n)=>{if(!y[t]){const e=new Image;e.src=n,y[t]=e}return y[t]},v=t=>{const n=t.config.canvas.getContext("2d");n.fillStyle=p(t).gridBackground,n.fillRect(0,0,t.config.canvas.width,t.config.canvas.height);for(let i=0;i<e;i++)for(let e=0;e<7;e++){const r=t.grid[i][e].intensity;if(r>0){const e=r<.2?.3:r,i=(a=p(t).contributionBoxColor,o=e,`rgba(${parseInt(a.slice(1,3),16)}, ${parseInt(a.slice(3,5),16)}, ${parseInt(a.slice(5,7),16)}, ${o})`);n.fillStyle=i}else n.fillStyle=p(t).emptyContributionBoxColor;n.beginPath(),t.config.canvas.getContext("2d").roundRect(22*i,22*e+15,20,20,5),n.fill()}var a,o;n.fillStyle=p(t).wallColor;for(let t=0;t<=e;t++)for(let e=0;e<=7;e++)u.horizontal[t][e].active&&n.fillRect(22*t-2,22*e-2+15,22,2),u.vertical[t][e].active&&n.fillRect(22*t-2,22*e-2+15,2,22);n.fillStyle=p(t).textColor,n.font="10px Arial",n.textAlign="center";let i="";for(let a=0;a<e;a++)if(t.monthLabels[a]!==i){const e=22*a+10;n.fillText(t.monthLabels[a],e,10),i=t.monthLabels[a]}},A=t=>{const n=t.config.canvas.getContext("2d"),e=22*t.pacman.x+10,i=22*t.pacman.y+10+15;t.pacman.deadRemainingDuration?n.fillStyle=o:t.pacman.powerupRemainingDuration?n.fillStyle="red":n.fillStyle=a;const r=t.pacmanMouthOpen?.35*Math.PI:.1*Math.PI;let c,s;switch(t.pacman.direction){case"up":c=1.5*Math.PI+r,s=1.5*Math.PI-r;break;case"down":c=.5*Math.PI+r,s=.5*Math.PI-r;break;case"left":c=Math.PI+r,s=Math.PI-r;break;default:c=0+r,s=2*Math.PI-r}n.beginPath(),n.arc(e,i,10,c,s),n.lineTo(e,i),n.fill()},b=t=>{t.ghosts.forEach((n=>{const e=22*n.x,a=22*n.y+15,o=t.config.canvas.getContext("2d");n.scared?o.drawImage(x("scared",l.scared.imgDate),e,a,20,20):o.drawImage(x(n.name,l[n.name].imgDate),e,a,20,20)}))},w=t=>{t.config.enableSounds&&t.config.canvas.addEventListener("click",(function(n){const e=t.config.canvas.getBoundingClientRect(),a=n.clientX-e.left,o=n.clientY-e.top,i=t.config.canvas.width-30-10;a>=i&&a<=i+this.width&&o>=10&&o<=10+this.height&&(g.getInstance().isMuted?g.getInstance().unmute():g.getInstance().mute())}))},C=(t,n)=>[[-1,0],[1,0],[0,-1],[0,1]].filter((([a,o])=>{const i=t+a,r=n+o;return!(i<0||i>=e||r<0||r>=7||(-1===a?u.vertical[t][n].active:1===a?u.vertical[t+1][n].active:-1===o?u.horizontal[t][n].active:1===o&&u.horizontal[t][n+1].active))})),L=(t,n,e,a)=>Math.sqrt(Math.pow(e-t,2)+Math.pow(a-n,2)),M=(t,n,e,a)=>{if(t===e&&n===a)return null;const o=[{x:t,y:n,path:[]}],i=new Set;for(i.add(`${t},${n}`);o.length>0;){const t=o.shift(),{x:n,y:r,path:c}=t,s=C(n,r);for(const[t,l]of s){const s=n+t,u=r+l,h=`${s},${u}`;if(i.has(h))continue;i.add(h);const d=[...c,{x:s,y:u}];if(s===e&&u===a)return d.length>0?d[0]:null;o.push({x:s,y:u,path:d})}}return null},S=(t,n)=>{const{pacman:e}=n;let a=[0,0];switch(t.name){case"blinky":default:return{x:e.x,y:e.y};case"pinky":a=$(n);const o=4;let i={x:e.x+a[0]*o,y:e.y+a[1]*o};return i.x=Math.min(Math.max(i.x,0),51),i.y=Math.min(Math.max(i.y,0),6),i;case"inky":const r=n.ghosts.find((t=>"blinky"===t.name));a=$(n);let c={x:e.x+2*a[0],y:e.y+2*a[1]};return r&&(c={x:c.x+(c.x-r.x),y:c.y+(c.y-r.y)}),c.x=Math.min(Math.max(c.x,0),51),c.y=Math.min(Math.max(c.y,0),6),c;case"clyde":return L(t.x,t.y,e.x,e.y)>8?{x:e.x,y:e.y}:{x:0,y:6}}},$=t=>{switch(t.pacman.direction){case"right":return[1,0];case"left":return[-1,0];case"up":return[0,-1];case"down":return[0,1];default:return[0,0]}},D=(t,n)=>{const e=t+Math.floor(17*Math.random())-8,a=n+Math.floor(17*Math.random())-8;return{x:Math.max(0,Math.min(e,51)),y:Math.max(0,Math.min(a,6))}},z=t=>{t.ghosts.forEach((n=>{n.scared||Math.random()<.15?((t,n)=>{(!t.target||t.x===t.target.x&&t.y===t.target.y)&&(t.target=D(t.x,t.y));const e=C(t.x,t.y);if(0===e.length)return;const a=t.target.x-t.x,o=t.target.y-t.y;let i=e.filter((t=>{if(Math.random()<.3)return!0;const n=t[0],e=t[1];return a>0&&n>0||a<0&&n<0||o>0&&e>0||o<0&&e<0}));0===i.length&&(i=e);const[r,c]=i[Math.floor(Math.random()*i.length)];n.pacman.powerupRemainingDuration&&Math.random()<.5||(t.x+=r,t.y+=c)})(n,t):((t,n)=>{const e=S(t,n);t.target=e;const a=M(t.x,t.y,e.x,e.y);a&&(t.x=a.x,t.y=a.y)})(n,t)}))},k=t=>{const n=new Map,a=!!t.pacman.powerupRemainingDuration;if(t.ghosts.forEach((t=>{if(!t.scared)for(let a=-5;a<=5;a++)for(let o=-5;o<=5;o++){const i=t.x+a,r=t.y+o;if(i>=0&&i<e&&r>=0&&r<7){const t=`${i},${r}`,e=15-(Math.abs(a)+Math.abs(o));if(e>0){const a=n.get(t)||0;n.set(t,Math.max(a,e))}}}})),a)for(const[t,e]of n.entries())n.set(t,e/5);return n},I=(t,n)=>{var e;(e=t.pacman).recentPositions||(e.recentPositions=[]),t.pacman.recentPositions.push(`${n.x},${n.y}`),t.pacman.recentPositions.length>5&&t.pacman.recentPositions.shift();const a=n.x-t.pacman.x,o=n.y-t.pacman.y;a>0?t.pacman.direction="right":a<0?t.pacman.direction="left":o>0?t.pacman.direction="down":o<0&&(t.pacman.direction="up"),t.pacman.x=n.x,t.pacman.y=n.y},B=t=>{t.pacman.powerupRemainingDuration=15,t.ghosts.forEach((t=>t.scared=!0))},T=t=>{if(t.pacman.deadRemainingDuration)return;const n=!!t.pacman.powerupRemainingDuration,a=t.ghosts.filter((t=>t.scared));let o=null;if(o=n&&a.length>0?(t=>{const n=t.ghosts.filter((t=>t.scared));return 0===n.length?null:n.reduce(((n,e)=>{const a=L(e.x,e.y,t.pacman.x,t.pacman.y);return a<n.distance?{x:e.x,y:e.y,distance:a}:n}),{x:t.pacman.x,y:t.pacman.y,distance:1/0})})(t):(t=>{let n=[];for(let a=0;a<e;a++)for(let e=0;e<7;e++)if(t.grid[a][e].intensity>0){const o=L(a,e,t.pacman.x,t.pacman.y),i=t.grid[a][e].intensity/(o+1);n.push({x:a,y:e,value:i})}return 0===n.length?null:(n.sort(((t,n)=>n.value-t.value)),n[0])})(t),!o)return;const i=((t,n)=>{var e;const a=[{x:t.pacman.x,y:t.pacman.y,path:[],score:0}],o=new Set;o.add(`${t.pacman.x},${t.pacman.y}`);const i=k(t);for(;a.length>0;){a.sort(((t,n)=>n.score-t.score));const r=a.shift(),{x:c,y:s,path:l}=r;if(c===n.x&&s===n.y)return l.length>0?l[0]:null;const u=C(c,s);for(const[r,h]of u){const u=c+r,d=s+h,m=`${u},${d}`;if(!o.has(m)){const r=[...l,{x:u,y:d}],c=i.get(m)||0,s=t.grid[u][d].intensity,h=L(u,d,n.x,n.y);let g=0;(null===(e=t.pacman.recentPositions)||void 0===e?void 0:e.includes(m))&&(g+=100),a.push({x:u,y:d,path:r,score:s-c-h/10-g}),o.add(m)}}}return null})(t,o);i?I(t,i):(t=>{const n=C(t.pacman.x,t.pacman.y);if(0===n.length)return;const e=n.reduce(((n,[e,a])=>{const o=t.pacman.x+e,i=t.pacman.y+a;let r=1/0;return t.ghosts.forEach((t=>{if(!t.scared){const n=L(t.x,t.y,o,i);r=Math.min(r,n)}})),r>n.distance?{dx:e,dy:a,distance:r}:n}),{dx:0,dy:0,distance:-1/0}),a=t.pacman.x+e.dx,o=t.pacman.y+e.dy;I(t,{x:a,y:o})})(t),(t=>{t.grid[t.pacman.x][t.pacman.y].intensity>0&&(t.pacman.totalPoints+=t.grid[t.pacman.x][t.pacman.y].commitsCount,t.pacman.points++,t.config.pointsIncreasedCallback(t.pacman.totalPoints),t.grid[t.pacman.x][t.pacman.y].intensity=0,t.pacman.points>=30&&B(t))})(t)},E=t=>{const n=10,e=t,a=2*Math.PI-t;return`M 10,10\n L ${n+n*Math.cos(e)},${n+n*Math.sin(e)}\n A 10,10 0 1,1 ${n+n*Math.cos(a)},${n+n*Math.sin(a)}\n Z`},F=(t,n,e)=>t.gameHistory.map((a=>{const o=a.grid[n][e];if(o>0){const n=o<.2?.3:o;return i=p(t).contributionBoxColor,r=n,3===(i=i.replace(/^#/,"")).length&&(i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]),`#${i}${Math.round(255*r).toString(16).padStart(2,"0")}`}var i,r;return p(t).emptyContributionBoxColor})),R=t=>{switch(t){case"blinky":return"gb";case"clyde":return"gc";case"inky":return"gi";case"pinky":return"gp";case"scared":return"gs";default:return t}},P=(t,n)=>{if(t.gameHistory.length!==n.length)throw new Error("The length of changingValues must match the length of gameHistory");const e=t.gameHistory.length;let a=[],o=[],i=null,r=null;return n.forEach(((t,n)=>{t!==i&&(null!==i&&null!==r&&n-1!==r&&(a.push(Number(((n-1e-6)/(e-1)).toFixed(6))),o.push(i)),a.push(Number((n/(e-1)).toFixed(6))),o.push(t),i=t,r=n)})),1!==a[a.length-1]&&(a.push(1),o.push(i)),{keyTimes:a.join(";"),values:o.join(";")}},O=t=>{let n='<svg width="1144" height="174" xmlns="http://www.w3.org/2000/svg">';n+=`<desc>Generated with https://github.com/abozanona/pacman-contribution-graph on ${new Date}</desc>`,n+=`<rect width="100%" height="100%" fill="${p(t).gridBackground}"/>`,n+=`<defs>\n\t\t<symbol id="${R("blinky")}" viewBox="0 0 100 100">\n <image href="${l.blinky.imgDate}" width="100" height="100"/>\n\t\t</symbol>\n\t\t<symbol id="${R("clyde")}" viewBox="0 0 100 100">\n <image href="${l.clyde.imgDate}" width="100" height="100"/>\n\t\t</symbol>\n\t\t<symbol id="${R("inky")}" viewBox="0 0 100 100">\n <image href="${l.inky.imgDate}" width="100" height="100"/>\n\t\t</symbol>\n\t\t<symbol id="${R("pinky")}" viewBox="0 0 100 100">\n <image href="${l.pinky.imgDate}" width="100" height="100"/>\n\t\t</symbol>\n\t\t<symbol id="${R("scared")}" viewBox="0 0 100 100">\n <image href="${l.scared.imgDate}" width="100" height="100"/>\n\t\t</symbol>\n\t</defs>`;let i="";for(let a=0;a<e;a++)t.monthLabels[a]!==i&&(n+=`<text x="${22*a+10}" y="10" text-anchor="middle" font-size="10" fill="${p(t).textColor}">${t.monthLabels[a]}</text>`,i=t.monthLabels[a]);for(let a=0;a<e;a++)for(let e=0;e<7;e++){const o=22*a,i=22*e+15,r=P(t,F(t,a,e));n+=`<rect id="c-${a}-${e}" x="${o}" y="${i}" width="20" height="20" rx="5" fill="${p(t).emptyContributionBoxColor}">\n <animate attributeName="fill" dur="${t.gameHistory.length*c}ms" repeatCount="indefinite" \n values="${r.values}" \n keyTimes="${r.keyTimes}"/>\n </rect>`}for(let a=0;a<e;a++)for(let e=0;e<7;e++)u.horizontal[a][e].active&&(n+=`<rect id="wh-${a}-${e}" x="${22*a-2}" y="${22*e-2+15}" width="22" height="2" rx="5" fill="${p(t).wallColor}"></rect>`),u.vertical[a][e].active&&(n+=`<rect id="wv-${a}-${e}" x="${22*a-2}" y="${22*e-2+15}" width="2" height="22" rx="5" fill="${p(t).wallColor}"></rect>`);const r=P(t,(t=>t.gameHistory.map((t=>t.pacman.deadRemainingDuration?o:t.pacman.powerupRemainingDuration?"red":a)))(t)),s=P(t,(t=>t.gameHistory.map((t=>`${22*t.pacman.x},${22*t.pacman.y+15}`)))(t)),h=P(t,(t=>t.gameHistory.map((t=>{switch(t.pacman.direction){case"right":default:return"0 10 10";case"left":return"180 10 10";case"up":return"270 10 10";case"down":return"90 10 10"}})))(t));return n+=`<path id="pacman" d="${E(.55)}"\n >\n\t\t<animate attributeName="fill" dur="${t.gameHistory.length*c}ms" repeatCount="indefinite"\n keyTimes="${r.keyTimes}"\n values="${r.values}"/>\n <animateTransform attributeName="transform" type="translate" dur="${t.gameHistory.length*c}ms" repeatCount="indefinite"\n keyTimes="${s.keyTimes}"\n values="${s.values}"\n additive="sum"/>\n <animateTransform attributeName="transform" type="rotate" dur="${t.gameHistory.length*c}ms" repeatCount="indefinite"\n keyTimes="${h.keyTimes}"\n values="${h.values}"\n additive="sum"/>\n <animate attributeName="d" dur="0.5s" repeatCount="indefinite"\n values="${E(.55)};${E(.05)};${E(.55)}"/>\n </path>`,t.ghosts.forEach(((e,a)=>{const o=P(t,((t,n)=>t.gameHistory.map((t=>{const e=t.ghosts[n];return`${22*e.x},${22*e.y+15}`})))(t,a)),i=P(t,((t,n)=>t.gameHistory.map((t=>{const e=t.ghosts[n];return"#"+(e.scared?R("scared"):R(e.name))})))(t,a));n+=`<use id="ghost${a}" width="20" height="20" href="#ghost-${e.name}">\n <animateTransform attributeName="transform" type="translate" dur="${t.gameHistory.length*c}ms" repeatCount="indefinite"\n keyTimes="${o.keyTimes}"\n values="${o.values}"/>\n <animate attributeName="href" dur="${t.gameHistory.length*c}ms" repeatCount="indefinite"\n keyTimes="${i.keyTimes}"\n values="${i.values}"/>\n </use>`})),n+="</svg>",n};var N=function(t,n,e,a){return new(e||(e=Promise))((function(o,i){function r(t){try{s(a.next(t))}catch(t){i(t)}}function c(t){try{s(a.throw(t))}catch(t){i(t)}}function s(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(r,c)}s((a=a.apply(t,n||[])).next())}))};const U=t=>{t.ghosts=[],t.ghosts.push({x:23,y:3,name:i[0],scared:!1,target:void 0}),t.ghosts.push({x:24,y:3,name:i[1],scared:!1,target:void 0}),t.ghosts.push({x:27,y:3,name:i[2],scared:!1,target:void 0}),t.ghosts.push({x:28,y:3,name:i[3],scared:!1,target:void 0}),"canvas"==t.config.outputFormat&&b(t)},V=t=>N(void 0,void 0,void 0,(function*(){if(t.frameCount++,t.frameCount%t.config.gameSpeed==0)if(t.pacman.deadRemainingDuration&&(t.pacman.deadRemainingDuration--,t.pacman.deadRemainingDuration||(U(t),"canvas"==t.config.outputFormat&&g.getInstance().play(d.GAME_OVER).then((()=>g.getInstance().startDefaultSound())))),t.pacman.powerupRemainingDuration&&(t.pacman.powerupRemainingDuration--,t.pacman.powerupRemainingDuration||(t.ghosts.forEach((t=>t.scared=!1)),t.pacman.points=0)),t.grid.some((t=>t.some((t=>t.intensity>0)))))T(t),H(t),t.pacman.deadRemainingDuration||(z(t),H(t)),t.pacmanMouthOpen=!t.pacmanMouthOpen,t.gameHistory.push({pacman:Object.assign({},t.pacman),ghosts:t.ghosts.map((t=>Object.assign({},t))),grid:t.grid.map((t=>[...t.map((t=>t.intensity))]))}),"canvas"==t.config.outputFormat&&v(t),"canvas"==t.config.outputFormat&&A(t),"canvas"==t.config.outputFormat&&b(t),"canvas"==t.config.outputFormat&&(t=>{if(!t.config.enableSounds)return;const n=t.config.canvas.getContext("2d"),e=t.config.canvas.width-30-10;n.fillStyle=`rgba(0, 0, 0, ${g.getInstance().isMuted?.3:.5})`,n.beginPath(),n.moveTo(e+10,20),n.lineTo(e+20,15),n.lineTo(e+20,35),n.lineTo(e+10,30),n.closePath(),n.fill(),g.getInstance().isMuted?(n.strokeStyle="rgba(255, 0, 0, 0.6)",n.lineWidth=3,n.beginPath(),n.moveTo(e+25,15),n.lineTo(e+5,35),n.stroke()):(n.strokeStyle="rgba(0, 0, 0, 0.4)",n.lineWidth=2,n.beginPath(),n.arc(e+25,25,5,0,2*Math.PI),n.stroke(),n.beginPath(),n.arc(e+25,25,8,0,2*Math.PI),n.stroke())})(t);else{if("canvas"==t.config.outputFormat&&(clearInterval(t.gameInterval),"canvas"==t.config.outputFormat&&((t=>{const n=t.config.canvas.getContext("2d");n.fillStyle=p(t).textColor,n.font="20px Arial",n.textAlign="center",n.fillText("Game Over",t.config.canvas.width/2,t.config.canvas.height/2)})(t),g.getInstance().play(d.BEGINNING).then((()=>g.getInstance().stopDefaultSound())))),"svg"==t.config.outputFormat){const n=O(t);t.config.svgCallback(n)}t.config.gameOverCallback()}else t.gameHistory.push({pacman:Object.assign({},t.pacman),ghosts:t.ghosts.map((t=>Object.assign({},t))),grid:t.grid.map((t=>[...t.map((t=>t.intensity))]))})})),H=t=>{t.pacman.deadRemainingDuration||t.ghosts.forEach(((n,e)=>{n.x===t.pacman.x&&n.y===t.pacman.y&&(t.pacman.powerupRemainingDuration&&n.scared?(Q(t,e),t.pacman.points+=10,"canvas"==t.config.outputFormat&&g.getInstance().play(d.EAT_GHOST)):(t.pacman.points=0,t.pacman.powerupRemainingDuration=0,t.pacman.deadRemainingDuration=10,"canvas"==t.config.outputFormat&&g.getInstance().play(d.GAME_OVER).then((()=>g.getInstance().stopDefaultSound()))))}))},Q=(t,n)=>{let a,o;do{a=Math.floor(Math.random()*e),o=Math.floor(7*Math.random())}while(Math.abs(a-t.pacman.x)<=2&&Math.abs(o-t.pacman.y)<=2||0===t.grid[a][o].intensity);t.ghosts[n]={x:a,y:o,name:i[n%i.length],scared:!1,target:void 0}},j=(t,n,a,o,i)=>{"horizontal"==a?(h(t,n,"horizontal",i),"x"==o?h(e-t-1,n,"horizontal",i):"y"==o?h(t,7-n,"horizontal",i):"xy"==o&&(h(e-t-1,n,"horizontal",i),h(t,7-n,"horizontal",i),h(e-t-1,7-n,"horizontal",i))):(h(t,n,"vertical",i),"x"==o?h(e-t,n,"vertical",i):"y"==o?h(t,7-n-1,"vertical",i):"xy"==o&&(h(e-t,n,"vertical",i),h(t,7-n-1,"vertical",i),h(e-t,7-n-1,"vertical",i)))},G={frameCount:0,contributions:[],pacman:{x:0,y:0,direction:"right",points:0,totalPoints:0,deadRemainingDuration:0,powerupRemainingDuration:0,recentPositions:[]},ghosts:[],grid:[],monthLabels:[],pacmanMouthOpen:!0,gameInterval:0,gameHistory:[],config:void 0};class K{constructor(t){this.store=structuredClone(G),this.conf=Object.assign({},t),j(0,2,"horizontal","xy","L1"),j(1,2,"horizontal","xy","L1"),j(4,0,"vertical","x","L2"),j(4,1,"vertical","x","L2"),j(4,2,"vertical","x","L2"),j(4,3,"vertical","x","L2"),j(4,4,"vertical","x","L2"),j(3,3,"horizontal","x","L3"),j(2,3,"horizontal","x","L3"),j(4,5,"horizontal","x","L4"),j(6,4,"vertical","x","L5"),j(6,3,"vertical","x","L5"),j(6,2,"vertical","x","L5"),j(6,2,"horizontal","x","L6"),j(7,2,"horizontal","x","L6"),j(8,2,"horizontal","x","L6"),j(9,2,"horizontal","x","L6"),j(13,2,"horizontal","xy","L7"),j(14,2,"horizontal","xy","L7"),j(15,2,"horizontal","xy","L7"),j(16,2,"horizontal","xy","L7"),j(17,2,"horizontal","xy","L7"),j(18,2,"horizontal","xy","L7"),j(16,2,"vertical","xy","L8"),j(8,1,"horizontal","x","L9"),j(9,1,"horizontal","x","L9"),j(10,1,"horizontal","x","L9"),j(11,1,"horizontal","x","L9"),j(12,1,"vertical","x","L10"),j(12,3,"vertical","x","L10"),j(11,4,"horizontal","x","L11"),j(10,4,"horizontal","x","L11"),j(9,4,"horizontal","x","L11"),j(8,4,"horizontal","x","L11"),j(8,4,"vertical","x","L12"),j(8,5,"vertical","x","L12"),j(8,6,"vertical","x","L12"),j(23,2,"horizontal","x","L13"),j(24,2,"horizontal","x","L13"),j(23,4,"horizontal","x","L13"),j(24,4,"horizontal","x","L13"),j(25,4,"horizontal","x","L13"),j(23,2,"vertical","x","L14"),j(23,3,"vertical","x","L14"),j(26,4,"vertical","x","L15"),j(26,5,"vertical","x","L15"),j(23,6,"horizontal","x","L16"),j(24,6,"horizontal","x","L16"),j(25,6,"horizontal","x","L16"),j(26,0,"vertical","x","L17"),j(24,1,"vertical","x","L18"),j(23,1,"horizontal","x","L18"),j(22,1,"horizontal","x","L18"),j(21,1,"horizontal","x","L18"),j(21,1,"vertical","x","L18"),j(21,2,"vertical","x","L18"),j(21,3,"vertical","x","L18"),j(20,4,"horizontal","x","L18"),j(19,4,"horizontal","x","L18"),j(19,3,"vertical","x","L18"),j(18,3,"horizontal","x","L18"),j(22,5,"vertical","x","L19"),j(21,5,"horizontal","x","L19"),j(20,5,"horizontal","x","L19"),j(20,5,"vertical","x","L19"),j(1,6,"horizontal","x","L20"),j(2,6,"horizontal","x","L20"),j(3,5,"vertical","x","L20"),j(3,4,"vertical","x","L20"),j(5,6,"horizontal","x","L21"),j(6,6,"horizontal","x","L21")}start(){return t=this,n=void 0,o=function*(){switch(this.store.config=Object.assign(Object.assign({},{platform:"github",username:"",canvas:void 0,outputFormat:"svg",svgCallback:t=>{},gameOverCallback:()=>()=>{},gameTheme:"github",gameSpeed:1,enableSounds:!1,pointsIncreasedCallback:t=>{}}),this.conf),this.conf.platform){case"gitlab":this.store.contributions=yield(t=this.store,f(void 0,void 0,void 0,(function*(){const n=yield fetch(`https://v0-new-project-q1hhrdodoye-abozanona-gmailcoms-projects.vercel.app/api/contributions?username=${t.config.username}`),e=yield n.json();return Object.entries(e).map((([t,n])=>({date:new Date(t),count:Number(n)})))})));break;case"github":this.store.contributions=yield(t=>f(void 0,void 0,void 0,(function*(){var n;const e=[];let a=!1,o=1;do{try{const i={};(null===(n=t.config.githubSettings)||void 0===n?void 0:n.accessToken)&&(i.Authorization="Bearer "+t.config.githubSettings.accessToken);const r=yield fetch(`https://api.github.com/search/commits?q=author:${t.config.username}&sort=author-date&order=desc&page=${o}&per_page=1000`,{headers:i}),c=yield r.json();a=0===c.items.length,e.push(...c.items),o++}catch(t){a=!0}}while(!a);return Array.from(e.reduce(((t,n)=>{const e=n.commit.committer.date.split("T")[0],a=new Date(e),o=(t.get(e)||{count:0}).count+1;return t.set(e,{date:a,count:o})}),new Map).values())})))(this.store)}var t;(t=>{N(void 0,void 0,void 0,(function*(){"canvas"==t.config.outputFormat&&(t.config.canvas=t.config.canvas,(t=>{t.config.canvas.width=1144,t.config.canvas.height=174})(t),w(t)),t.frameCount=0,t.ghosts.forEach((t=>t.scared=!1)),(t=>{t.pacman.points=0,t.pacman.totalPoints=0,t.grid=Array.from({length:e},(()=>Array.from({length:7},(()=>({commitsCount:0,intensity:0}))))),t.monthLabels=Array(e).fill("");let n=1;const a=new Date,o=new Date(a);o.setDate(a.getDate()-a.getDay()),t.contributions.forEach((a=>{const i=new Date(a.date),r=i.getDay(),c=Math.floor((+o-+i)/6048e5);c>=0&&c<e&&r>=0&&r<7&&(t.grid[51-c][r]={commitsCount:a.count,intensity:0},a.count>n&&(n=a.count))}));for(let a=0;a<e;a++)for(let e=0;e<7;e++)t.grid[a][e].commitsCount>0&&(t.grid[a][e].intensity=t.grid[a][e].commitsCount/n);for(let n=0;n<e;n++){const e=51-n,a=new Date(o);a.setDate(a.getDate()-7*e),t.monthLabels[n]=r[a.getMonth()]}})(t),"canvas"==t.config.outputFormat&&v(t),"canvas"==t.config.outputFormat&&(t.config.enableSounds||g.getInstance().mute(),yield g.getInstance().preloadSounds(),g.getInstance().startDefaultSound(),yield g.getInstance().play(d.BEGINNING));const n=()=>t.grid.some((t=>t.some((t=>t.intensity>0))));if(n()&&((t=>{t.pacman={x:0,y:0,direction:"right",points:0,totalPoints:0,deadRemainingDuration:0,powerupRemainingDuration:0,recentPositions:[]},"canvas"==t.config.outputFormat&&A(t)})(t),U(t)),"svg"==t.config.outputFormat){for(;n();)yield V(t);yield V(t)}else clearInterval(t.gameInterval),t.gameInterval=setInterval((()=>N(void 0,void 0,void 0,(function*(){return yield V(t)}))),c)}))})(this.store)},new((a=void 0)||(a=Promise))((function(e,i){function r(t){try{s(o.next(t))}catch(t){i(t)}}function c(t){try{s(o.throw(t))}catch(t){i(t)}}function s(t){var n;t.done?e(t.value):(n=t.value,n instanceof a?n:new a((function(t){t(n)}))).then(r,c)}s((o=o.apply(t,n||[])).next())}));var t,n,a,o}stop(){var t;t=this.store,N(void 0,void 0,void 0,(function*(){clearInterval(t.gameInterval)}))}}var Y=n.C;export{Y as PacmanRenderer};
|
|
1
|
+
var t={d:(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{C:()=>At});const n={frameCount:0,contributions:[],pacman:{x:0,y:0,direction:"right",points:0,totalPoints:0,deadRemainingDuration:0,powerupRemainingDuration:0,recentPositions:[]},ghosts:[],grid:[],monthLabels:[],pacmanMouthOpen:!0,gameInterval:0,gameHistory:[],config:void 0,useGithubThemeColor:!0},a=53,o="yellow",i={github:{textColor:"#57606a",gridBackground:"#ffffff",wallColor:"#000000",intensityColors:["#ebedf0","#9be9a8","#40c463","#30a14e","#216e39"]},"github-dark":{textColor:"#8b949e",gridBackground:"#0d1117",wallColor:"#ffffff",intensityColors:["#161b22","#0e4429","#006d32","#26a641","#39d353"]},gitlab:{textColor:"#626167",gridBackground:"#ffffff",wallColor:"#000000",intensityColors:["#ececef","#d2dcff","#7992f5","#4e65cd","#303470"]},"gitlab-dark":{textColor:"#999999",gridBackground:"#1f1f1f",wallColor:"#ffffff",intensityColors:["#2a2a3d","#4a5bdc","#2e3dbf","#1b2e8a","#0f1a4e"]}},r={blinky:{up:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABiklEQVR4nIXSO2sVURQF4G8mMwa8QU2KxFcjCoIgacR/oCBYCP4fsTEIBkWwEK21UAQLIdjYaKEiJIXBXhNBCFaSeDP3zLa4mdyj5rHgwNmPtffZ62z+Q4miKHlWs3yALwUvKYphbC8UjDN3nIUB/SCCSDRnWKiZVxTFrvxp5kMRHbEltaTODuIED3YkT3FnUy+uS815qQkzMSJOxAWpuSo1A72Y4f5f5DFuBpE+vmsmZ9ukF9Eu/xwV+Pw1TEYcOtum9GmxCaLmdl7jeRDp968mcnQFMqS02bSkMV5tS36UBL6t7ixO6o/uK6sKymM0Q9l5NKC/Ldb3lWGrqenRCw73hr61H9viDujjKbztnLnae50uF4sl1nf91/2xvt9q7YuyEwKCNg+2DFoGue/fnHLoGwbyZQ/akqqkykkFZW6XmNy6VJdYyhPP8eE07/PCl1kqqbbMI3BrjY1rvMH4SW4kmou86Eac5UmiOcUcxq/wep2NirugYh4TXfOah6izUauax5leB2vuwR+e2vAshd8i9AAAAABJRU5ErkJggg==",down:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABmUlEQVR4nHXTT0tUYRQG8N97/TOloSYpYv/BNlLYqqJli1Z9gz5SOwkKgpDaRBS5CKJ2fYFWrsyNZWKSOYliw8y9p8XMHa+Tc+ByOec8z/M+7z3nJidHwhtc7ORreIjog29H1iYunmc5iPIpyGd5h0cd8ZNPvcLzXmJBXq1N8/g/kSSlyywFkdPMaVZJ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K68g3MW7t7m1+BzN/KYOYCECA0wABwc2H8K5lyBTsGLECfhtHc52KvJhCASMNIgVSq+afAR2kKCf/nHKk/yrgBI8x4SKQTXfq8cyyvEnBWtQWp1ybDcBa45qDzwxkgF4humvWt1CwCOmPaKuS/SAEcADpr+ESI3RwTAFZmmArtfji6fl8r3VFrRAehO64wTfZif8G++2lTps3Z7Q50/rJek2lNxIsB3g+JU35h8fmA4XQbM2fLD65sLWC634BQQFYQ7O/PDWzmJnXZZA4+4GKzfent9qwWeoKlD7CDSvRCkCp5Rq0crtQSK1jzWOvKsaFT0ZY5S/AWqkD0QparkoAAAAAElFTkSuQmCC"},eyes:{up:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAj0lEQVR4nO2RsQ7CMAxE79K6aQCJbuztb8Af8P8rX8HaYzCChgbanZ5kyYqezjkb2MR3K02eOUdzJiBwhBCsgPWE7RcmD9YfBsCgp9zdS5Kul/Mpn50z95tzdSkAAKSYZp/7ZDzKF6XYxIUUvw12bbvKAF1VMQCvXUhSydXIjDk2kcDkjL4kF1k+4xrmH/UA3stP0Iur7f8AAAAASUVORK5CYII=",down:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAm0lEQVR4nO2Ryw3CQAxE35jdEBFRAycEpUAJ9A81EBIlcMjPgazEHUbyxX47I3vhLwBiDDydUpxnQt8zgG2+kQeD1A2cTJo3JIqVzV29jod9NrCX82m3xLRt27wHTYlmY+SjquslRpJ9ZVAmDKC/wf0K0lQAuFtWddn0a88ZgAwoKKx7MdRnShxdF5hAHIc5t+Q3rp2BoRT2c3oBFX9xUA7hwq8AAAAASUVORK5CYII=",left:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAuUlEQVR4nO2PvRIBQRCEu+fOIaD8RkoRKCGZwNt4fwKFcutnW2LP1tWdF6CjmdmveruBvxgGSSqOJKvgmE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W48o1FS3S7UxVfSdTYa0lXotKFQAiyp8IxmW98EAz88LBgtpnBaovU6G9kdoAZ4jaKdBnuAbgxAJTuvMEajgHXts1nzcJWLKyQ1YN2vANCqXCRQ1j5ezaNJKlosB6NrEltIbsKJ5zLXrp8rrr44ml1gyWiaSunfPs4tz54p3MAq32bZ6MljxdXr59ZvTR7NJ0kBtrQEQ7nlN09IVS7mkn/mOnp778olH3nw7t1/ZQs3f5q3bNuynIE4tIbc8MU/iqnFW8GOAztKmU3jht869XdOIYRMZyuFzy/H+jO/Ctl1wN+MdRZTiRU7cPbLth4UNDnF1T1dpczZ75vbM4lgZPaxYGSkN30VI6TgUH4FK9xNevpd2iL307J/jIzRmHySyldvo4HmZ08iWu8lIiTFxBS57ArRg6/ip6/C4VKapy9/Rug+m8gzXYzOX2DcGIYSU1uvPHTta8aN4dDcd3Q81U5wl8PI718wkl2A4eRFQg+4W+LosRhH1xZ5dPo9hAJhw8DMh4ytLdI5Ft3ShfuCDC/N/AMdtzXsl7IlxgAAAABJRU5ErkJggg=="}},s={horizontal:Array(54).fill(null).map((()=>Array(8).fill({active:!1,id:""}))),vertical:Array(54).fill(null).map((()=>Array(8).fill({active:!1,id:""})))},c=(t,e,n,a,o)=>{"horizontal"===n?t>=0&&t<s.horizontal.length&&e>=0&&e<s.horizontal[0].length&&(s.horizontal[t][e]={active:!0,id:a,color:o}):t>=0&&t<s.vertical.length&&e>=0&&e<s.vertical[0].length&&(s.vertical[t][e]={active:!0,id:a,color:o})},l=(t,e)=>[[-1,0],[1,0],[0,-1],[0,1]].filter((([n,o])=>{const i=t+n,r=e+o;return!(i<0||i>=a||r<0||r>=7||(-1===n?s.vertical[t][e].active:1===n?s.vertical[t+1][e].active:-1===o?s.horizontal[t][e].active:1===o&&s.horizontal[t][e+1].active))})),A={getValidMoves:l,calculateDistance:(t,e,n,a)=>Math.sqrt(Math.pow(n-t,2)+Math.pow(a-e,2)),findNextStepDijkstra(t,e){var n;if(t.x===e.x&&t.y===e.y)return null;const a=[Object.assign(Object.assign({},t),{cost:0,path:[]})],o=new Set([`${t.x},${t.y}`]);for(;a.length;){a.sort(((t,e)=>t.cost-e.cost));const{x:t,y:i,cost:r,path:s}=a.shift();for(const[c,A]of l(t,i)){const l=t+c,u=i+A,d=`${l},${u}`;if(o.has(d))continue;o.add(d);const h=r+1,g=[...s,{x:l,y:u}];if(l===e.x&&u===e.y)return null!==(n=g[0])&&void 0!==n?n:null;a.push({x:l,y:u,cost:h,path:g})}}return null}},u={blinky:{x:50,y:0},pinky:{x:0,y:0},inky:{x:50,y:6},clyde:{x:0,y:6}};let d="scatter",h=0,g=0;const m=t=>{switch(t.direction){case"up":t.direction="down";break;case"down":t.direction="up";break;case"left":t.direction="right";break;case"right":t.direction="left"}},f=(t,e)=>{if(!t.justReleasedFromHouse)return t.respawnCounter&&t.respawnCounter>0?(t.respawnCounter--,void(0===t.respawnCounter&&t.originalName&&(t.name=t.originalName,t.inHouse=!1,t.scared=e.pacman.powerupRemainingDuration>0))):("up"===t.direction&&t.y<=3?(t.direction="down",t.y=3):"down"===t.direction&&t.y>=3&&(t.direction="up",t.y=3),"up"===t.direction?t.y-=1:t.y+=1,void((t.y<3||t.y>=4)&&(t.y=(t.direction,3),t.direction="up"===t.direction?"down":"up")));26===t.x?(t.y=2,t.direction="up",t.inHouse=!1,t.justReleasedFromHouse=!1):t.x<26?(t.x+=1,t.direction="right"):t.x>26&&(t.x-=1,t.direction="left")},p=(t,e)=>{const n=u[t.name]||u.blinky;t.target=n;const a=w(t.x,t.y,n.x,n.y,t.direction);a&&(t.x=a.x,t.y=a.y,a.direction&&(t.direction=a.direction))},y=(t,e)=>{(!t.target||t.x===t.target.x&&t.y===t.target.y)&&(t.target=b(t.x,t.y));const n=v(t);if(0===n.length)return;const a=t.target.x-t.x,o=t.target.y-t.y;let i=n;if(Math.random()<.5);else{const t=n.filter((t=>{const e=t[0],n=t[1];return a>0&&e>0||a<0&&e<0||o>0&&n>0||o<0&&n<0}));t.length>0&&(i=t)}const[r,s]=i[Math.floor(Math.random()*i.length)];e.pacman.powerupRemainingDuration&&Math.random()<.6||(r>0?t.direction="right":r<0?t.direction="left":s>0?t.direction="down":s<0&&(t.direction="up"),t.x+=r,t.y+=s)},v=t=>A.getValidMoves(t.x,t.y).filter((e=>{const[n,a]=e;return!("right"===t.direction&&n<0||"left"===t.direction&&n>0||"up"===t.direction&&a>0||"down"===t.direction&&a<0)})),x=(t,e)=>{const n={x:26,y:3};if(Math.abs(t.x-n.x)<=1&&Math.abs(t.y-n.y)<=1)return t.x=n.x,t.y=n.y,t.inHouse=!0,void(t.respawnCounter=1);const a=A.findNextStepDijkstra({x:t.x,y:t.y},n);if(a){const e=a.x-t.x,n=a.y-t.y;e>0?t.direction="right":e<0?t.direction="left":n>0?t.direction="down":n<0&&(t.direction="up"),t.x=a.x,t.y=a.y}else{const e=w(t.x,t.y,n.x,n.y,t.direction);e&&(t.x=e.x,t.y=e.y,e.direction&&(t.direction=e.direction))}},C=(t,e)=>{if("eyes"===t.name)return void x(t);const n=S(t,e);t.target=n;const a=w(t.x,t.y,n.x,n.y,t.direction);a&&(t.x=a.x,t.y=a.y,a.direction&&(t.direction=a.direction))},w=(t,e,n,a,o)=>{if(t===n&&e===a)return null;const i=[{x:t,y:e,path:[],direction:o||"right"}],r=new Set;for(r.add(`${t},${e}`);i.length>0;){const t=i.shift(),{x:e,y:o,path:s,direction:c}=t,l=A.getValidMoves(e,o),u=l.filter((t=>{const[e,n]=t;return!c||!("right"===c&&e<0||"left"===c&&e>0||"up"===c&&n>0||"down"===c&&n<0)||1===l.length}));for(const[t,l]of u){const A=e+t,u=o+l,d=`${A},${u}`;if(r.has(d))continue;let h;r.add(d),h=t>0?"right":t<0?"left":l>0?"down":l<0?"up":c;const g=[...s,{x:A,y:u,pathDirection:h}];if(A===n&&u===a)return g.length>0?{x:g[0].x,y:g[0].y,direction:g[0].pathDirection}:null;i.push({x:A,y:u,path:g,direction:h})}}const s=A.getValidMoves(t,e);if(s.length>0){const[n,a]=s[Math.floor(Math.random()*s.length)];let i=o;return n>0?i="right":n<0?i="left":a>0?i="down":a<0&&(i="up"),{x:t+n,y:e+a,direction:i}}return null},S=(t,e)=>{const{pacman:n}=e;let a=R(e),o=1;if("blinky"===t.name){const t=371,e=(t-g)/t;if(e>.7&&(o=1.2),e>.9&&(o=1.4),Math.random()<.8*o)return{x:n.x,y:n.y}}switch(t.name){case"blinky":default:return{x:n.x,y:n.y};case"pinky":const o=4;let i=n.x,r=n.y;return"up"===n.direction?(i=n.x-4,r=n.y-4):(i=n.x+a[0]*o,r=n.y+a[1]*o),i=Math.min(Math.max(i,0),52),r=Math.min(Math.max(r,0),6),{x:i,y:r};case"inky":const s=e.ghosts.find((t=>"blinky"===t.name));let c={x:n.x+2*a[0],y:n.y+2*a[1]};if("up"===n.direction&&(c.x=n.x-2,c.y=n.y-2),s){const t=c.x-s.x,e=c.y-s.y;c={x:c.x+t,y:c.y+e}}return c.x=Math.min(Math.max(c.x,0),52),c.y=Math.min(Math.max(c.y,0),6),c;case"clyde":return A.calculateDistance(t.x,t.y,n.x,n.y)<8?u.clyde:{x:n.x,y:n.y}}},R=t=>{switch(t.pacman.direction){case"right":return[1,0];case"left":return[-1,0];case"up":return[0,-1];case"down":return[0,1];default:return[0,0]}},b=(t,e)=>{const n=t+Math.floor(17*Math.random())-8,a=e+Math.floor(17*Math.random())-8;return{x:Math.max(0,Math.min(n,52)),y:Math.max(0,Math.min(a,6))}},B=t=>{g=(t=>{let e=0;for(let n=0;n<a;n++)for(let a=0;a<7;a++)"NONE"!==t.grid[n][a].level&&e++;return e})(t),(t=>{t.pacman.powerupRemainingDuration>0||(h++,h>=5*("scatter"===d?7:20)&&(d="scatter"===d?"chase":"scatter",h=0,t.ghosts.forEach((t=>{t.inHouse||"eyes"===t.name||t.scared||m(t)}))))})(t);for(const e of t.ghosts)e.inHouse?f(e,t):("eyes"===e.name&&(e.scared=!1),e.scared?y(e,t):"eyes"===e.name?x(e):"scatter"===d?p(e):C(e,t))};var E;!function(t){t.CONSERVATIVE="conservador",t.AGGRESSIVE="aggressive",t.OPPORTUNISTIC="opportunistic"}(E||(E={}));const D=(t,e)=>Math.floor((e.getTime()-t.getTime())/6048e5),I=t=>new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())),M=t=>{var e;return null!==(e=i[t.config.gameTheme])&&void 0!==e?e:i.github},T=t=>{switch(t){case"NONE":default:return 0;case"FIRST_QUARTILE":return 1;case"SECOND_QUARTILE":return 2;case"THIRD_QUARTILE":return 3;case"FOURTH_QUARTILE":return 4}},k=(t,e)=>{const n=e/4;return 0===t?"NONE":t<n?"FIRST_QUARTILE":t<2*n?"SECOND_QUARTILE":t<3*n?"THIRD_QUARTILE":"FOURTH_QUARTILE"},U=t=>{const e=I(new Date),n=new Date(e);n.setUTCDate(e.getUTCDate()-365),n.setUTCDate(n.getUTCDate()-n.getUTCDay());const a=Array.from({length:53},(()=>Array.from({length:7},(()=>({commitsCount:0,color:M(t).intensityColors[0],level:"NONE"})))));t.contributions.forEach((o=>{const i=I(new Date(o.date));if(i<n||i>e)return;const r=i.getUTCDay(),s=D(n,i);if(s>=0&&s<53){const e=M(t);a[s][r]={commitsCount:o.count,color:e.intensityColors[T(o.level)],level:o.level}}})),t.grid=a},z=M,O=U,N=t=>{const e=[];for(let n=0;n<a;n++)for(let a=0;a<7;a++){const o=t.grid[n][a];if("NONE"!==o.level){const i=A.calculateDistance(n,a,t.pacman.x,t.pacman.y),r=o.commitsCount/(i+1);e.push({x:n,y:a,value:r})}}return e.sort(((t,e)=>e.value-t.value)),0===e.length?{x:t.pacman.x,y:t.pacman.y,value:0}:e[0]},P=t=>{const e=new Map,n=!!t.pacman.powerupRemainingDuration;if(t.ghosts.forEach((t=>{if(!t.scared)for(let n=-5;n<=5;n++)for(let o=-5;o<=5;o++){const i=t.x+n,r=t.y+o;if(i>=0&&i<a&&r>=0&&r<7){const t=`${i},${r}`,a=15-(Math.abs(n)+Math.abs(o));if(a>0){const n=e.get(t)||0;e.set(t,Math.max(n,a))}}}})),n)for(const[t,n]of e.entries())e.set(t,n/5);return e},Q=(t,e)=>{var n;(n=t.pacman).recentPositions||(n.recentPositions=[]),t.pacman.recentPositions.push(`${e.x},${e.y}`),t.pacman.recentPositions.length>5&&t.pacman.recentPositions.shift();const a=e.x-t.pacman.x,o=e.y-t.pacman.y;t.pacman.direction=a>0?"right":a<0?"left":o>0?"down":o<0?"up":t.pacman.direction,t.pacman.x=e.x,t.pacman.y=e.y},V=t=>{t.pacman.powerupRemainingDuration=15,t.ghosts.forEach((t=>t.scared=!0))},H=t=>{if(t.pacman.deadRemainingDuration)return;const e=!!t.pacman.powerupRemainingDuration,n=t.ghosts.filter((t=>t.scared));let a;try{if(e&&n.length>0){const e=(t=>{const e=t.ghosts.filter((t=>t.scared));return 0===e.length?null:e.reduce(((e,n)=>{const a=A.calculateDistance(n.x,n.y,t.pacman.x,t.pacman.y);return a<e.distance?{x:n.x,y:n.y,distance:a}:e}),{x:t.pacman.x,y:t.pacman.y,distance:1/0})})(t);a=null!=e?e:N(t)}else t.pacman.target?t.pacman.x===t.pacman.target.x&&t.pacman.y===t.pacman.target.y?(a=N(t),t.pacman.target=a):a=t.pacman.target:(a=N(t),t.pacman.target=a);a||(a={x:t.pacman.x,y:t.pacman.y});const o=((t,e)=>{var n;const a=[{x:t.pacman.x,y:t.pacman.y,path:[],score:0}],o=new Set([`${t.pacman.x},${t.pacman.y}`]),i=P(t);let r=.5,s=.5;switch(t.config.playerStyle){case E.CONSERVATIVE:r=3,s=.1;break;case E.AGGRESSIVE:r=.3,s=2;break;case E.OPPORTUNISTIC:default:r=.8,s=.8}let c=1/0;t.ghosts.forEach((e=>{if(!e.scared){const n=A.calculateDistance(t.pacman.x,t.pacman.y,e.x,e.y);c=Math.min(c,n)}}));const l=t.config.playerStyle===E.CONSERVATIVE?5:7,u=c<l;for(t.config.playerStyle===E.CONSERVATIVE&&u&&(r*=5);a.length>0;){a.sort(((t,e)=>e.score-t.score));const c=a.shift(),{x:l,y:u,path:d}=c;if(l===e.x&&u===e.y){if(d.length>0){let e=0,n=0;return d.forEach((a=>{const o=`${a.x},${a.y}`,c=i.get(o)||0,l=t.grid[a.x][a.y].commitsCount;e-=c*r,n+=l*s})),d[0]}return null}for(const[c,h]of A.getValidMoves(l,u)){const g=l+c,m=u+h,f=`${g},${m}`;if(!o.has(f)){const c=[...d,{x:g,y:m}],l=i.get(f)||0,u=t.grid[g][m].commitsCount,h=A.calculateDistance(g,m,e.x,e.y),p=(null===(n=t.pacman.recentPositions)||void 0===n?void 0:n.includes(f))?100:0;let y,v,x;t.config.playerStyle===E.CONSERVATIVE?(y=(15-l)*r,l>=5?y-=100:y+=50,v=u*s,x=5*y+v+-h/10-p):(y=(15-l)*r,v=u*s,x=y+v+-h/10-p),a.push({x:g,y:m,path:c,score:x}),o.add(f)}}}return null})(t,a);o?Q(t,o):(t=>{const e=A.getValidMoves(t.pacman.x,t.pacman.y);if(0===e.length)return;const n=e.reduce(((e,[n,a])=>{const o=t.pacman.x+n,i=t.pacman.y+a;let r=1/0;return t.ghosts.forEach((t=>{if(!t.scared){const e=A.calculateDistance(t.x,t.y,o,i);r=Math.min(r,e)}})),r>e.distance?{dx:n,dy:a,distance:r}:e}),{dx:0,dy:0,distance:-1/0});Q(t,{x:t.pacman.x+n.dx,y:t.pacman.y+n.dy})})(t),(t=>{const e=t.grid[t.pacman.x][t.pacman.y];if("NONE"!==e.level){t.pacman.totalPoints+=e.commitsCount,t.pacman.points++,t.config.pointsIncreasedCallback(t.pacman.totalPoints);const n=z(t);"FOURTH_QUARTILE"===e.level&&V(t),e.level="NONE",e.color=n.intensityColors[0],e.commitsCount=0}})(t)}catch(t){console.error("Error in movePacman:",t)}};var L,F=function(t,e,n,a){return new(n||(n=Promise))((function(o,i){function r(t){try{c(a.next(t))}catch(t){i(t)}}function s(t){try{c(a.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}c((a=a.apply(t,e||[])).next())}))};!function(t){t.DEFAULT="https://cdn.jsdelivr.net/npm/pacman-contribution-graph/src/assets/sounds/pacman_chomp.wav",t.BEGINNING="https://cdn.jsdelivr.net/npm/pacman-contribution-graph/src/assets/sounds/pacman_beginning.wav",t.GAME_OVER="https://cdn.jsdelivr.net/npm/pacman-contribution-graph/src/assets/sounds/pacman_death.wav",t.EAT_GHOST="https://cdn.jsdelivr.net/npm/pacman-contribution-graph/src/assets/sounds/pacman_eatghost.wav"}(L||(L={}));class Y{constructor(){this.sounds=new Map,this.currentSource=null,this.defaultSource=null,this.isMuted=!1,this.audioContext=new AudioContext}static getInstance(){return Y.instance||(Y.instance=new Y),Y.instance}preloadSounds(){return F(this,void 0,void 0,(function*(){for(const t of Object.values(L)){const e=yield fetch(t),n=yield e.arrayBuffer(),a=yield this.audioContext.decodeAudioData(n);this.sounds.set(t,a)}}))}play(t){return F(this,void 0,void 0,(function*(){if(this.isMuted)return;if(this.currentSource)try{this.currentSource.stop()}catch(t){}const e=this.sounds.get(t);if(e)return this.currentSource=this.audioContext.createBufferSource(),this.currentSource.buffer=e,this.currentSource.connect(this.audioContext.destination),this.isMuted||this.currentSource.start(),new Promise((t=>{this.currentSource.onended=()=>{this.currentSource=null,t()}}));console.error(`Sound ${t} not found`)}))}startDefaultSound(){if(this.defaultSource)try{this.defaultSource.stop()}catch(t){}const t=this.sounds.get(L.DEFAULT);t?(this.defaultSource=this.audioContext.createBufferSource(),this.defaultSource.buffer=t,this.defaultSource.loop=!0,this.defaultSource.connect(this.audioContext.destination),this.isMuted||this.defaultSource.start()):console.error("Default sound not found")}stopDefaultSound(){if(this.defaultSource){try{this.defaultSource.stop()}catch(t){}this.defaultSource=null}}mute(){this.isMuted=!0,this.currentSource&&this.currentSource.disconnect(),this.defaultSource&&this.defaultSource.disconnect()}unmute(){this.isMuted=!1,this.currentSource&&this.currentSource.connect(this.audioContext.destination),this.defaultSource&&this.defaultSource.connect(this.audioContext.destination)}}const j=t=>t.deadRemainingDuration?"#80808064":t.powerupRemainingDuration?"red":o,G={},K=(t,e)=>{if(!G[t]){const n=new Image;n.src=e,G[t]=n}return G[t]},J=t=>{const e=t.config.canvas.getContext("2d");e.fillStyle=z(t).gridBackground,e.fillRect(0,0,t.config.canvas.width,t.config.canvas.height);for(let n=0;n<a;n++)for(let a=0;a<7;a++){if("NONE"!==t.grid[n][a].level){const o=t.grid[n][a].color;e.fillStyle=o}else e.fillStyle=z(t).intensityColors[0];e.beginPath(),t.config.canvas.getContext("2d").roundRect(22*n,22*a+15,20,20,5),e.fill()}e.fillStyle=z(t).wallColor;for(let t=0;t<=a;t++)for(let n=0;n<=7;n++)s.horizontal[t][n].active&&e.fillRect(22*t-2,22*n-2+15,22,2),s.vertical[t][n].active&&e.fillRect(22*t-2,22*n-2+15,2,22);e.fillStyle=z(t).textColor,e.font="10px Arial",e.textAlign="center";let n="";for(let o=0;o<a;o++)if(t.monthLabels[o]!==n){const a=22*o+10;e.fillText(t.monthLabels[o],a,10),n=t.monthLabels[o]}},q=t=>{t.config.enableSounds&&t.config.canvas.addEventListener("click",(function(e){const n=t.config.canvas.getBoundingClientRect(),a=e.clientX-n.left,o=e.clientY-n.top,i=t.config.canvas.width-30-10;a>=i&&a<=i+this.width&&o>=10&&o<=10+this.height&&(Y.getInstance().isMuted?Y.getInstance().unmute():Y.getInstance().mute())}))},W=t=>{const e=10,n=t,a=2*Math.PI-t;return`M 10,10\n L ${e+e*Math.cos(n)},${e+e*Math.sin(n)}\n A 10,10 0 1,1 ${e+e*Math.cos(a)},${e+e*Math.sin(a)}\n Z`},X=(t,e,n)=>t.gameHistory.map((t=>t.grid[e][n].color)),Z=(t,e)=>{if(t.gameHistory.length!==e.length)throw new Error(`The amount of values (${e.length}) does not match the size of the game history (${t.gameHistory.length})`);const n=t.gameHistory.length;if(0===n)return{keyTimes:"0;1",values:e[0]||"#000;#000"};let a=[],o=[],i=null,r=null;return e.forEach(((t,e)=>{t!==i&&(null!==i&&null!==r&&e-1!==r&&(a.push(Number(((e-1e-6)/(n-1)).toFixed(6))),o.push(i)),a.push(Number((e/(n-1)).toFixed(6))),o.push(t),i=t,r=e)})),0!==a.length&&1===a[a.length-1]||(0===a.length?(a.push(0,1),o.push(e[0]||"#000",e[e.length-1]||"#000")):(a.push(1),o.push(i||e[e.length-1]||"#000"))),{keyTimes:a.join(";"),values:o.join(";")}},$=t=>{const e=200*t.gameHistory.length;let n='<svg width="1166" height="184" xmlns="http://www.w3.org/2000/svg">';n+=`<desc>Generated with pacman-contribution-graph on ${new Date}</desc>`,n+=`<metadata>\n\t\t<info>\n\t\t\t<frames>${t.gameHistory.length}</frames>\n\t\t\t<frameRate>5</frameRate>\n\t\t\t<durationMs>${e}</durationMs>\n\t\t\t<generatedOn>${(new Date).toISOString()}</generatedOn>\n\t\t</info>\n\t</metadata>`,n+=`<rect width="100%" height="100%" fill="${z(t).gridBackground}"/>`,n+=(()=>{let t="<defs>";return["blinky","inky","pinky","clyde"].forEach((e=>{["up","down","left","right"].forEach((n=>{const a=r[e];n in a&&(t+=`\n <symbol id="ghost-${e}-${n}" viewBox="0 0 20 20">\n <image href="${a[n]}" width="20" height="20"/>\n </symbol>\n `)}))})),t+=`\n <symbol id="ghost-scared" viewBox="0 0 20 20">\n <image href="${r.scared.imgDate}" width="20" height="20"/>\n </symbol>`,["up","down","left","right"].forEach((e=>{r.eyes&&e in r.eyes?t+=`\n <symbol id="ghost-eyes-${e}" viewBox="0 0 20 20">\n <image href="${r.eyes[e]}" width="20" height="20"/>\n </symbol>\n `:(console.warn(`Imagem para eyes-${e} nÃŖo encontrada, usando placeholder`),t+=`\n <symbol id="ghost-eyes-${e}" viewBox="0 0 20 20">\n <circle cx="10" cy="10" r="${20/3}" fill="white"/>\n </symbol>\n `)})),t+="</defs>",t})();let i="";for(let e=0;e<a;e++)t.monthLabels[e]!==i&&(n+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${z(t).textColor}">${t.monthLabels[e]}</text>`,i=t.monthLabels[e]);for(let o=0;o<a;o++)for(let a=0;a<7;a++){const i=22*o,r=22*a+15,s=Z(t,X(t,o,a));n+=`<rect id="c-${o}-${a}" x="${i}" y="${r}" width="20" height="20" rx="5" fill="${z(t).intensityColors[0]}">\n\t\t\t\t<animate attributeName="fill" dur="${e}ms" repeatCount="indefinite" \n\t\t\t\t\tvalues="${s.values}" \n\t\t\t\t\tkeyTimes="${s.keyTimes}"/>\n\t\t\t</rect>`}for(let e=0;e<a;e++)for(let a=0;a<7;a++)s.horizontal[e][a].active&&(n+=`<rect id="wh-${e}-${a}" x="${22*e-2}" y="${22*a-2+15}" width="22" height="2" rx="5" fill="${z(t).wallColor}"></rect>`),s.vertical[e][a].active&&(n+=`<rect id="wv-${e}-${a}" x="${22*e-2}" y="${22*a-2+15}" width="2" height="22" rx="5" fill="${z(t).wallColor}"></rect>`);const c=Z(t,t.gameHistory.map((t=>j(t.pacman)))),l=Z(t,(t=>t.gameHistory.map((t=>`${22*t.pacman.x},${22*t.pacman.y+15}`)))(t)),A=Z(t,(t=>t.gameHistory.map((t=>{switch(t.pacman.direction){case"right":default:return"0 10 10";case"left":return"180 10 10";case"up":return"270 10 10";case"down":return"90 10 10"}})))(t));return n+=`<path id="pacman" d="${W(.55)}" fill="${o}">\n\t\t<animate attributeName="fill" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${c.keyTimes}"\n\t\t\tvalues="${c.values}"/>\n\t\t<animateTransform attributeName="transform" type="translate" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${l.keyTimes}"\n\t\t\tvalues="${l.values}"\n\t\t\tadditive="sum"/>\n\t\t<animateTransform attributeName="transform" type="rotate" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${A.keyTimes}"\n\t\t\tvalues="${A.values}"\n\t\t\tadditive="sum"/>\n\t\t<animate attributeName="d" dur="0.5s" repeatCount="indefinite"\n\t\t\tvalues="${W(.55)};${W(.05)};${W(.55)}"/>\n\t</path>`,t.ghosts.forEach(((a,o)=>{const i=Z(t,((t,e)=>t.gameHistory.map((t=>{if(e>=t.ghosts.length)return"0,0";const n=t.ghosts[e];return`${22*n.x},${22*n.y+15}`})))(t,o));n+=`<g id="ghost${o}" transform="translate(0,0)">\n\t\t\t<animateTransform attributeName="transform" type="translate" \n\t\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${i.keyTimes}"\n\t\t\t\tvalues="${i.values}"\n\t\t\t\tadditive="replace"/>`;const r=function(t,e){const n={};["blinky-up","blinky-down","blinky-left","blinky-right","inky-up","inky-down","inky-left","inky-right","pinky-up","pinky-down","pinky-left","pinky-right","clyde-up","clyde-down","clyde-left","clyde-right","eyes-up","eyes-down","eyes-left","eyes-right","scared"].forEach((t=>{n[t]=[{time:0,visible:!1}]}));const a=t.ghosts[e];if(!a)return n;const o=a.scared?"scared":"eyes"===a.name?`eyes-${a.direction||"right"}`:`${a.name}-${a.direction||"right"}`;n[o]=[{time:0,visible:!0}];let i=o;return t.gameHistory.forEach(((a,o)=>{if(e>=a.ghosts.length)return;const r=a.ghosts[e],s=o/(t.gameHistory.length-1),c=r.scared?"scared":"eyes"===r.name?`eyes-${r.direction||"right"}`:`${r.name}-${r.direction||"right"}`;c!==i&&(n[i].push({time:s,visible:!1}),n[c]||(n[c]=[{time:0,visible:!1}]),n[c].push({time:s,visible:!0}),i=c)})),n[i].push({time:1,visible:!0}),Object.keys(n).forEach((t=>{t!==i&&n[t].length>0&&n[t][n[t].length-1].time<1&&n[t].push({time:1,visible:!1})})),n}(t,o);for(const[t,a]of Object.entries(r)){if(0===a.length)continue;const o=`#ghost-${t}`,i=a.map((t=>t.time)).join(";"),r=a.map((t=>t.visible?"visible":"hidden")).join(";"),s=a[0].visible?"visible":"hidden";n+=`<use href="${o}" width="20" height="20" visibility="${s}">\n\t\t\t\t<animate attributeName="visibility" \n\t\t\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${i}"\n\t\t\t\t\tvalues="${r}" />\n\t\t\t</use>`}n+="</g>"})),n+="</svg>",n};var _=function(t,e,n,a){return new(n||(n=Promise))((function(o,i){function r(t){try{c(a.next(t))}catch(t){i(t)}}function s(t){try{c(a.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}c((a=a.apply(t,e||[])).next())}))};const tt=t=>{t.ghosts=[{x:26,y:2,name:"blinky",direction:"left",scared:!1,target:void 0,inHouse:!1,respawnCounter:0,freezeCounter:0,justReleasedFromHouse:!1},{x:25,y:3,name:"inky",direction:"up",scared:!1,target:void 0,inHouse:!0,respawnCounter:0,freezeCounter:10,justReleasedFromHouse:!1},{x:26,y:3,name:"pinky",direction:"down",scared:!1,target:void 0,inHouse:!0,respawnCounter:0,freezeCounter:20,justReleasedFromHouse:!1},{x:27,y:3,name:"clyde",direction:"up",scared:!1,target:void 0,inHouse:!0,respawnCounter:0,freezeCounter:30,justReleasedFromHouse:!1}],t.ghosts.forEach((t=>{t.justReleasedFromHouse=!1,t.respawnCounter=0,t.inHouse&&("inky"===t.name?t.direction="up":"pinky"===t.name?t.direction="down":"clyde"===t.name&&(t.direction="up"))}))},et=t=>_(void 0,void 0,void 0,(function*(){var e;if(t.frameCount++,t.frameCount%t.config.gameSpeed!=0)return void nt(t);if(t.pacman.deadRemainingDuration>0&&(t.pacman.deadRemainingDuration--,0===t.pacman.deadRemainingDuration&&((t=>{t.pacman.x=27,t.pacman.y=7,t.pacman.direction="right",t.pacman.recentPositions=[]})(t),tt(t))),t.pacman.powerupRemainingDuration>0&&(t.pacman.powerupRemainingDuration--,0===t.pacman.powerupRemainingDuration&&(t.ghosts.forEach((t=>{"eyes"!==t.name&&(t.scared=!1)})),t.pacman.points=0)),t.ghosts.forEach((e=>{e.inHouse&&e.respawnCounter&&e.respawnCounter>0&&(e.respawnCounter--,0===e.respawnCounter&&(e.name=e.originalName||(t=>{const e=["blinky","inky","pinky","clyde"];return e[t%e.length]})(t.ghosts.indexOf(e)),e.inHouse=!1,e.scared=t.pacman.powerupRemainingDuration>0,e.justReleasedFromHouse=!0)),e.freezeCounter&&(e.freezeCounter--,0===e.freezeCounter&&ot(t,e.name))})),!t.grid.some((t=>t.some((t=>t.commitsCount>0))))){if("svg"===t.config.outputFormat){const e=$(t);t.config.svgCallback(e)}return"canvas"==t.config.outputFormat&&((t=>{const e=t.config.canvas.getContext("2d");e.fillStyle=z(t).textColor,e.font="20px Arial",e.textAlign="center",e.fillText("Game Over",t.config.canvas.width/2,t.config.canvas.height/2)})(t),Y.getInstance().play(L.BEGINNING).then((()=>Y.getInstance().stopDefaultSound()))),void t.config.gameOverCallback()}H(t);const n=null===(e=t.grid[t.pacman.x])||void 0===e?void 0:e[t.pacman.y];n&&"FOURTH_QUARTILE"===n.level&&0===t.pacman.powerupRemainingDuration&&(t.pacman.powerupRemainingDuration=30,t.ghosts.forEach((t=>{"eyes"!==t.name&&(t.scared=!0)}))),at(t),0===t.pacman.deadRemainingDuration&&(B(t),at(t)),t.pacmanMouthOpen=!t.pacmanMouthOpen,nt(t),"canvas"==t.config.outputFormat&&J(t),"canvas"==t.config.outputFormat&&(t=>{const e=t.config.canvas.getContext("2d"),n=22*t.pacman.x+10,a=22*t.pacman.y+10+15;e.fillStyle=j(t.pacman);const o=t.pacmanMouthOpen?.35*Math.PI:.1*Math.PI;let i,r;switch(t.pacman.direction){case"up":i=1.5*Math.PI+o,r=1.5*Math.PI-o;break;case"down":i=.5*Math.PI+o,r=.5*Math.PI-o;break;case"left":i=Math.PI+o,r=Math.PI-o;break;default:i=0+o,r=2*Math.PI-o}e.beginPath(),e.arc(n,a,10,i,r),e.lineTo(n,a),e.fill()})(t),"canvas"==t.config.outputFormat&&(t=>{t.ghosts.forEach((e=>{const n=22*e.x,a=22*e.y+15,o=t.config.canvas.getContext("2d");if(e.scared)"imgDate"in r.scared&&o.drawImage(K("scared",r.scared.imgDate),n,a,20,20);else{const t=r[e.name][e.direction];o.drawImage(K(e.name+"-"+e.direction,t),n,a,20,20)}}))})(t),"canvas"==t.config.outputFormat&&(t=>{if(!t.config.enableSounds)return;const e=t.config.canvas.getContext("2d"),n=t.config.canvas.width-30-10;e.fillStyle=`rgba(0, 0, 0, ${Y.getInstance().isMuted?.3:.5})`,e.beginPath(),e.moveTo(n+10,20),e.lineTo(n+20,15),e.lineTo(n+20,35),e.lineTo(n+10,30),e.closePath(),e.fill(),Y.getInstance().isMuted?(e.strokeStyle="rgba(255, 0, 0, 0.6)",e.lineWidth=3,e.beginPath(),e.moveTo(n+25,15),e.lineTo(n+5,35),e.stroke()):(e.strokeStyle="rgba(0, 0, 0, 0.4)",e.lineWidth=2,e.beginPath(),e.arc(n+25,25,5,0,2*Math.PI),e.stroke(),e.beginPath(),e.arc(n+25,25,8,0,2*Math.PI),e.stroke())})(t)})),nt=t=>{t.gameHistory.push({pacman:Object.assign({},t.pacman),ghosts:t.ghosts.map((t=>Object.assign({},t))),grid:t.grid.map((t=>t.map((t=>Object.assign({},t)))))})},at=t=>{t.pacman.deadRemainingDuration||t.ghosts.forEach((e=>{"eyes"!==e.name&&e.x===t.pacman.x&&e.y===t.pacman.y&&(t.pacman.powerupRemainingDuration&&e.scared?(e.originalName=e.name,e.name="eyes",e.scared=!1,e.target={x:26,y:3},t.pacman.points+=10):(t.pacman.points=0,t.pacman.powerupRemainingDuration=0,0===t.pacman.deadRemainingDuration&&(t.pacman.deadRemainingDuration=10,function(t){t.deathCount=(t.deathCount||0)+1}(t))))}))},ot=(t,e)=>{const n=t.ghosts.find((t=>t.name===e&&t.inHouse));n&&(n.justReleasedFromHouse=!0,n.y=2,n.direction="up")},it=t=>_(void 0,void 0,void 0,(function*(){"canvas"==t.config.outputFormat&&(t.config.canvas=t.config.canvas,(t=>{t.config.canvas.width=1166,t.config.canvas.height=174})(t),q(t)),t.frameCount=0,t.gameHistory=[],t.ghosts.forEach((t=>t.scared=!1)),t.grid=(t=>(U(t),t.grid))(t);const e=()=>t.grid.some((t=>t.some((t=>t.commitsCount>0))));if(e()&&((t=>{t.pacman={x:0,y:0,direction:"right",points:0,totalPoints:0,deadRemainingDuration:0,powerupRemainingDuration:0,recentPositions:[]}})(t),tt(t)),"canvas"==t.config.outputFormat&&J(t),"canvas"==t.config.outputFormat&&(t.config.enableSounds||Y.getInstance().mute(),yield Y.getInstance().preloadSounds(),Y.getInstance().startDefaultSound(),yield Y.getInstance().play(L.BEGINNING)),"svg"===t.config.outputFormat){for(;e();)yield et(t);yield et(t)}else clearInterval(t.gameInterval),t.gameInterval=setInterval((()=>et(t)),200)}));var rt=function(t,e,n,a){return new(n||(n=Promise))((function(o,i){function r(t){try{c(a.next(t))}catch(t){i(t)}}function s(t){try{c(a.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}c((a=a.apply(t,e||[])).next())}))};const st=t=>rt(void 0,void 0,void 0,(function*(){var e;return(null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken)?yield(t=>rt(void 0,void 0,void 0,(function*(){var e;const n=yield fetch("https://api.github.com/graphql",{method:"POST",headers:{Authorization:`Bearer ${null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify({query:"\n\t\tquery ($login: String!) {\n\t\t\tuser(login: $login) {\n\t\t\t\tcontributionsCollection {\n\t\t\t\t\tcontributionCalendar {\n\t\t\t\t\t\tweeks {\n\t\t\t\t\t\t\tcontributionDays {\n\t\t\t\t\t\t\t\tdate\n\t\t\t\t\t\t\t\tcontributionCount\n\t\t\t\t\t\t\t\tcolor\n\t\t\t\t\t\t\t\tcontributionLevel\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t",variables:{login:t.config.username}})});if(!n.ok)throw new Error(`GitHub GraphQL request failed: ${n.status} ${n.statusText}`);return(yield n.json()).data.user.contributionsCollection.contributionCalendar.weeks.map((t=>t.contributionDays)).reduce(((t,e)=>t.concat(e)),[]).map((e=>{const n=e.contributionLevel,a=M(t);return{date:new Date(e.date),count:e.contributionCount,color:a.intensityColors[T(n)],level:n}}))})))(t):yield(t=>rt(void 0,void 0,void 0,(function*(){var e,n;const a=[];let o=!1,i=1;do{try{const r={};(null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken)&&(r.Authorization="Bearer "+t.config.githubSettings.accessToken);const s=yield fetch(`https://api.github.com/search/commits?q=author:${t.config.username}&sort=author-date&order=desc&page=${i}&per_page=100`,{headers:r}),c=yield s.json();o=!c.items||0===c.items.length,a.push(...null!==(n=c.items)&&void 0!==n?n:[]),i++}catch(t){o=!0}}while(!o);const r=Array.from(a.reduce(((t,e)=>{var n,a,o,i;const r=null===(a=null===(n=e.commit.author)||void 0===n?void 0:n.date)||void 0===a?void 0:a.split("T")[0],s=(null===(i=null===(o=e.commit.committer)||void 0===o?void 0:o.date)||void 0===i?void 0:i.split("T")[0])||r,c=(t.get(s)||{count:0}).count+1;return t.set(s,{date:new Date(s),count:c,color:"",level:"NONE"})}),new Map).values()),s=Math.max(...r.map((t=>t.count)).filter((t=>t>0)));return r.map((e=>{const n=k(e.count,s),a=M(t);return{date:new Date(e.date),count:e.count,color:a.intensityColors[T(n)],level:n}}))})))(t)})),ct=t=>{return e=void 0,n=void 0,o=function*(){const e=yield fetch(`https://v0-new-project-q1hhrdodoye-abozanona-gmailcoms-projects.vercel.app/api/contributions?username=${t.config.username}`),n=yield e.json(),a=Object.entries(n).map((([t,e])=>({date:new Date(t),count:Number(e),color:"",level:"NONE"}))),o=Math.max(...a.map((t=>t.count)).filter((t=>t>0)));return a.map((e=>{const n=k(e.count,o),a=M(t);return{date:new Date(e.date),count:e.count,color:a.intensityColors[T(n)],level:n}}))},new((a=void 0)||(a=Promise))((function(t,i){function r(t){try{c(o.next(t))}catch(t){i(t)}}function s(t){try{c(o.throw(t))}catch(t){i(t)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof a?n:new a((function(t){t(n)}))).then(r,s)}c((o=o.apply(e,n||[])).next())}));var e,n,a,o},lt=(t,e,n,o,i)=>{"horizontal"==n?(c(t,e,"horizontal",i),"x"==o?c(a-t-1,e,"horizontal",i):"y"==o?c(t,7-e,"horizontal",i):"xy"==o&&(c(a-t-1,e,"horizontal",i),c(t,7-e,"horizontal",i),c(a-t-1,7-e,"horizontal",i))):(c(t,e,"vertical",i),"x"==o?c(a-t,e,"vertical",i):"y"==o?c(t,7-e-1,"vertical",i):"xy"==o&&(c(a-t,e,"vertical",i),c(t,7-e-1,"vertical",i),c(a-t,7-e-1,"vertical",i)))};class At{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,i=function*(){const t={platform:"github",username:"",canvas:void 0,outputFormat:"svg",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",gameSpeed:1,enableSounds:!1,pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""},playerStyle:E.OPPORTUNISTIC};switch(this.store=JSON.parse(JSON.stringify(n)),this.store.config=Object.assign(Object.assign({},t),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield ct(this.store);break;case"github":this.store.contributions=yield st(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return lt(0,2,"horizontal","xy","L1"),lt(1,2,"horizontal","xy","L1"),lt(4,1,"vertical","x","L2"),lt(4,2,"vertical","x","L2"),lt(4,3,"vertical","x","L2"),lt(4,4,"vertical","x","L2"),lt(3,3,"horizontal","x","L3"),lt(2,3,"horizontal","x","L3"),lt(4,5,"horizontal","x","L4"),lt(6,4,"vertical","x","L5"),lt(6,3,"vertical","x","L5"),lt(6,2,"vertical","x","L5"),lt(6,2,"horizontal","x","L6"),lt(7,2,"horizontal","x","L6"),lt(8,2,"horizontal","x","L6"),lt(9,2,"horizontal","x","L6"),lt(13,2,"horizontal","xy","L7"),lt(14,2,"horizontal","xy","L7"),lt(15,2,"horizontal","xy","L7"),lt(16,2,"horizontal","xy","L7"),lt(17,2,"horizontal","xy","L7"),lt(18,2,"horizontal","xy","L7"),lt(16,2,"vertical","xy","L8"),lt(8,1,"horizontal","x","L9"),lt(9,1,"horizontal","x","L9"),lt(10,1,"horizontal","x","L9"),lt(11,1,"horizontal","x","L9"),lt(12,1,"vertical","x","L10"),lt(12,3,"vertical","x","L10"),lt(11,4,"horizontal","x","L11"),lt(10,4,"horizontal","x","L11"),lt(9,4,"horizontal","x","L11"),lt(8,4,"horizontal","x","L11"),lt(8,4,"vertical","x","L12"),lt(8,5,"vertical","x","L12"),lt(23,1,"horizontal","x","L18"),lt(22,1,"horizontal","x","L18"),lt(21,1,"horizontal","x","L18"),lt(21,1,"vertical","x","L18"),lt(21,2,"vertical","x","L18"),lt(21,3,"vertical","x","L18"),lt(20,4,"horizontal","x","L18"),lt(19,4,"horizontal","x","L18"),lt(19,3,"vertical","x","L18"),lt(18,3,"horizontal","x","L18"),lt(22,5,"vertical","x","L19"),lt(21,5,"horizontal","x","L19"),lt(20,5,"horizontal","x","L19"),lt(20,5,"vertical","x","L19"),lt(1,6,"horizontal","x","L20"),lt(2,6,"horizontal","x","L20"),lt(3,4,"vertical","x","L20"),lt(5,6,"horizontal","x","L21"),lt(6,6,"horizontal","x","L21"),c(25,2,"horizontal","GH_TOP"),c(27,2,"horizontal","GH_TOP"),c(25,4,"horizontal","GH_BOTTOM"),c(26,4,"horizontal","GH_BOTTOM"),c(27,4,"horizontal","GH_BOTTOM"),c(25,3,"vertical","GH_LEFT"),c(28,3,"vertical","GH_RIGHT"),c(25,2,"vertical","GH_LEFT"),c(28,2,"vertical","GH_RIGHT"),O(this.store),(t=>{const e=I(new Date),n=new Date(e);n.setUTCDate(e.getUTCDate()-365),n.setUTCDate(n.getUTCDate()-n.getUTCDay());const o=D(n,e)+1,i=Array(o).fill("");let r="";for(let t=0;t<o;t++){const e=new Date(n);e.setUTCDate(e.getUTCDate()+7*t);const a=e.toLocaleString("default",{month:"short"});a!==r&&(i[t]=a,r=a)}t.monthLabels=o>a?i.slice(o-a):i})(this.store),yield it(this.store),this.store},new((o=void 0)||(o=Promise))((function(n,a){function r(t){try{c(i.next(t))}catch(t){a(t)}}function s(t){try{c(i.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(r,s)}c((i=i.apply(t,e||[])).next())}));var t,e,o,i}stop(){var t;t=this.store,_(void 0,void 0,void 0,(function*(){clearInterval(t.gameInterval)}))}}var ut=e.C;export{ut as PacmanRenderer};
|
package/package.json
CHANGED
|
@@ -1,27 +1,45 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
2
|
+
"name": "pacman-contribution-graph",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Generates a pacman game from a github or gitlab user contributions grid",
|
|
5
|
+
"repository": "github:abozanona/pacman-contribution-graph",
|
|
6
|
+
"homepage": "https://abozanona.github.io/pacman-contribution-graph/",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/pacman-contribution-graph.min.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/pacman-contribution-graph.min.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist/pacman-contribution-graph.min.js",
|
|
18
|
+
"dist/index.d.ts",
|
|
19
|
+
"action.yml"
|
|
20
|
+
],
|
|
21
|
+
"keywords": [
|
|
22
|
+
"github",
|
|
23
|
+
"pacman",
|
|
24
|
+
"svg",
|
|
25
|
+
"contribution-graph",
|
|
26
|
+
"animation",
|
|
27
|
+
"game",
|
|
28
|
+
"actions"
|
|
29
|
+
],
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"prettier": "^3.4.2",
|
|
32
|
+
"terser": "^5.37.0",
|
|
33
|
+
"ts-loader": "^9.5.2",
|
|
34
|
+
"typescript": "^4.9.5",
|
|
35
|
+
"webpack": "^5.97.1",
|
|
36
|
+
"webpack-cli": "^6.0.1",
|
|
37
|
+
"webpack-merge": "^6.0.1"
|
|
38
|
+
},
|
|
39
|
+
"author": "abozanona",
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "webpack --config webpack.prod.js",
|
|
42
|
+
"dev": "webpack --progress --config webpack.dev.js",
|
|
43
|
+
"build-action": "pnpm run --prefix ./github-action build"
|
|
44
|
+
}
|
|
45
|
+
}
|
package/.prettierrc
DELETED
package/.vscode/extensions.json
DELETED
package/.vscode/settings.json
DELETED
package/assets/packman-demo.png
DELETED
|
Binary file
|