pacman-contribution-graph 3.2.1 → 3.2.4
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{Lc:()=>O,b9:()=>K,Cf:()=>Ot,rn:()=>ft,OJ:()=>te});const n=53,o=200,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"]}},a=(t,e)=>Math.floor((e.getTime()-t.getTime())/6048e5),r=t=>new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())),s=t=>{var e;return null!==(e=i[t.config.gameTheme])&&void 0!==e?e:i.github},l=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}},c=(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=r(new Date),n=new Date(e);n.setUTCDate(e.getUTCDate()-365),n.setUTCDate(n.getUTCDate()-n.getUTCDay());const o=Array.from({length:53},(()=>Array.from({length:7},(()=>({commitsCount:0,color:s(t).intensityColors[0],level:"NONE"})))));t.contributions.forEach((i=>{const c=r(new Date(i.date));if(c<n||c>e)return;const u=c.getUTCDay(),d=a(n,c);if(d>=0&&d<53){const e=s(t);o[d][u]={commitsCount:i.count,color:e.intensityColors[l(i.level)],level:i.level}}})),t.grid=o},d=s,A=u,h=t=>{const e=r(new Date),o=new Date(e);o.setUTCDate(e.getUTCDate()-365),o.setUTCDate(o.getUTCDate()-o.getUTCDay());const i=a(o,e)+1,s=Array(i).fill("");let l="";for(let t=0;t<i;t++){const e=new Date(o);e.setUTCDate(e.getUTCDate()+7*t);const n=e.toLocaleString("default",{month:"short"});n!==l&&(s[t]=n,l=n)}t.monthLabels=i>n?s.slice(i-n):s},m=t=>(u(t),t.grid);var g=function(t,e,n,o){return new(n||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}))};const f=t=>g(void 0,void 0,void 0,(function*(){var e;return(null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken)?yield(t=>g(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,o=s(t);return{date:new Date(e.date),count:e.contributionCount,color:o.intensityColors[l(n)],level:n}}))})))(t):yield(t=>g(void 0,void 0,void 0,(function*(){var e,n;const o=[];let i=!1,a=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=${a}&per_page=100`,{headers:r}),l=yield s.json();i=!l.items||0===l.items.length,o.push(...null!==(n=l.items)&&void 0!==n?n:[]),a++}catch(t){i=!0}}while(!i);const r=Array.from(o.reduce(((t,e)=>{var n,o,i,a;const r=null===(o=null===(n=e.commit.author)||void 0===n?void 0:n.date)||void 0===o?void 0:o.split("T")[0],s=(null===(a=null===(i=e.commit.committer)||void 0===i?void 0:i.date)||void 0===a?void 0:a.split("T")[0])||r,l=(t.get(s)||{count:0}).count+1;return t.set(s,{date:new Date(s),count:l,color:"",level:"NONE"})}),new Map).values()),u=Math.max(...r.map((t=>t.count)).filter((t=>t>0)));return r.map((e=>{const n=c(e.count,u),o=s(t);return{date:new Date(e.date),count:e.count,color:o.intensityColors[l(n)],level:n}}))})))(t)})),y=t=>{return e=void 0,n=void 0,i=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(),o=Object.entries(n).map((([t,e])=>({date:new Date(t),count:Number(e),color:"",level:"NONE"}))),i=Math.max(...o.map((t=>t.count)).filter((t=>t>0)));return o.map((e=>{const n=c(e.count,i),o=s(t);return{date:new Date(e.date),count:e.count,color:o.intensityColors[l(n)],level:n}}))},new((o=void 0)||(o=Promise))((function(t,a){function r(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(r,s)}l((i=i.apply(e,n||[])).next())}));var e,n,o,i},x=.21,p=7.4,v=t=>22*t,b=t=>22*t+15,C=(t,e,n)=>{var o,i;const a=t.gameHistory.length,r=null!==(i=null===(o=t.initialColors[e])||void 0===o?void 0:o[n])&&void 0!==i?i:"#ebedf0",s=t.brickEvents.filter((t=>t.x===e&&t.y===n));if(0===s.length)return{keyTimes:"0;1",values:`${r};${r}`};const l=[0],c=[r];for(const t of s){const e=Number((t.frameIndex/Math.max(a-1,1)).toFixed(4));e!==l[l.length-1]?(l.push(e),c.push(t.color)):c[c.length-1]=t.color}return 1!==l[l.length-1]&&(l.push(1),c.push(c[c.length-1])),{keyTimes:l.join(";"),values:c.join(";")}},w=(t,e)=>{var n,o,i,a;const r=t.gameHistory.length;if(0===r){const t=null!==(n=e[0])&&void 0!==n?n:"0,0";return{keyTimes:"0;1",values:`${t};${t}`}}const s=[],l=[];let c=null,u=null;return e.forEach(((t,e)=>{t!==c&&(null!==c&&null!==u&&e-1!==u&&(s.push(Number(((e-1)/(r-1)).toFixed(4))),l.push(c)),s.push(Number((e/(r-1)).toFixed(4))),l.push(t),c=t,u=e)})),0!==s.length&&1===s[s.length-1]||(0===s.length?(s.push(0,1),l.push(null!==(o=e[0])&&void 0!==o?o:"0,0",null!==(i=e[e.length-1])&&void 0!==i?i:"0,0")):(s.push(1),l.push(null!==(a=null!=c?c:e[e.length-1])&&void 0!==a?a:"0,0"))),{keyTimes:s.join(";"),values:l.join(";")}},B=t=>{const e=t.gameHistory.length*o/2,i=d(t);let a='<svg width="1166" height="209" xmlns="http://www.w3.org/2000/svg">';a+=`<desc>Generated with breakout-contribution-graph on ${new Date}</desc>`,a+=`<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>`,a+=`<rect width="100%" height="100%" fill="${i.gridBackground}"/>`;let r="";for(let e=0;e<n;e++)t.monthLabels[e]!==r&&(a+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${i.textColor}">${t.monthLabels[e]}</text>`,r=t.monthLabels[e]);for(let o=0;o<n;o++)for(let n=0;n<7;n++){const r=v(o),s=b(n),l=C(t,o,n);a+=`<rect id="c-${o}-${n}" x="${r}" y="${s}" width="20" height="20" rx="3" fill="${i.intensityColors[0]}">\n\t\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${e}ms" repeatCount="indefinite"\n\t\t\t\t\tvalues="${l.values}" keyTimes="${l.keyTimes}"/>\n\t\t\t</rect>`}const s=Math.round(4.62),l=w(t,(t=>t.gameHistory.map((t=>`${v(t.ball.x)},${b(t.ball.y)}`)))(t));a+=`<circle id="ball" cx="0" cy="0" r="${s}" fill="${i.wallColor}" stroke="#aaaaaa" stroke-width="1">\n\t\t<animateTransform attributeName="transform" type="translate"\n\t\t\tcalcMode="linear"\n\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${l.keyTimes}"\n\t\t\tvalues="${l.values}"/>\n\t</circle>`;const c=b(p),u=Math.round(152),A=Math.round(11),h=w(t,(t=>t.gameHistory.map((t=>`${v(t.paddle.x)},0`)))(t));return a+=`<rect id="paddle" x="0" y="${c}" width="${u}" height="${A}" rx="3" fill="${i.wallColor}">\n\t\t<animateTransform attributeName="transform" type="translate"\n\t\t\tcalcMode="linear"\n\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${h.keyTimes}"\n\t\t\tvalues="${h.values}"/>\n\t</rect>`,a+="</svg>",a};const M=20/22,E=["NONE","FIRST_QUARTILE","SECOND_QUARTILE","THIRD_QUARTILE","FOURTH_QUARTILE"],k=t=>{const e=E.indexOf(t);return E[Math.max(0,e-1)]},T=t=>{var e,o;t.frameCount++;const{ball:i,paddle:a,grid:r}=t,s=Math.hypot(i.dx,i.dy),l=Math.ceil(s/x),c=1/l;for(let s=0;s<l;s++){i.x+=i.dx*c,i.y+=i.dy*c,i.x-x<=0&&(i.x=x,i.dx=Math.abs(i.dx)),i.x+x>=n&&(i.x=52.79,i.dx=-Math.abs(i.dx)),i.y-x<=0&&(i.y=x,i.dy=Math.abs(i.dy));const s=a.x,l=a.x+7;if(i.dy>0&&i.y+x>=p&&i.y-x<7.9&&i.x>=s-x&&i.x<=l+x){i.y=7.19;const e=s+3.5,n=Math.max(-1,Math.min(1,(i.x-e)/3.5)),o=Math.hypot(i.dx,i.dy),a=65*n*(Math.PI/180);i.dx=o*Math.sin(a),i.dy=-o*Math.cos(a),t.bouncesSinceTargetSet++,t.bouncesSinceTargetSet>=5&&(t.targetBrick=S(t),t.bouncesSinceTargetSet=0)}i.y>8.4&&(i.x=26.5,i.y=5.9,i.dy=-Math.abs(i.dy));const u=Math.max(0,Math.floor(i.x-x)),A=Math.min(52,Math.floor(i.x+x)),h=Math.max(0,Math.floor(i.y-x)),m=Math.min(6,Math.floor(i.y+x));let g=!1,f=!1;const y=d(t);for(let n=u;n<=A;n++)for(let a=h;a<=m;a++){if(0===r[n][a].commitsCount)continue;const s=Math.max(n,Math.min(n+M,i.x)),l=Math.max(a,Math.min(a+M,i.y));if(Math.pow(i.x-s,2)+Math.pow(i.y-l,2)>=.04409999999999999)continue;const c=r[n][a].level,u=k(c);if(r[n][a].level=u,"NONE"===u)r[n][a].commitsCount=0,r[n][a].color=y.intensityColors[0],(null===(e=t.targetBrick)||void 0===e?void 0:e.cx)===n&&(null===(o=t.targetBrick)||void 0===o?void 0:o.cy)===a&&(t.targetBrick=S(t),t.bouncesSinceTargetSet=0);else{const t=E.indexOf(u);r[n][a].color=y.intensityColors[t]}t.brickEvents.push({frameIndex:t.gameHistory.length,x:n,y:a,color:r[n][a].color});const d=x-Math.abs(i.x-s),A=x-Math.abs(i.y-l);d<=A?(i.x+=i.dx<0?d:-d,g=!0):(i.y+=i.dy<0?A:-A,f=!0),t.framesSinceLastBrickHit=0,t.config.pointsIncreasedCallback(I(t))}g&&(i.dx=-i.dx),f&&(i.dy=-i.dy)}if(i.dy>0&&t.targetBrick){const e=t.targetBrick,o=(p-i.y)/i.dy;let r=i.x+i.dx*o;r=Math.abs((r%106+106)%106),r>n&&(r=106-r);const s=e.cx+.5,l=e.cy+.5,c=p-l,u=s-r,d=Math.atan2(u,Math.max(c,.5))*(180/Math.PI),A=r-Math.max(-65,Math.min(65,d))/65*3.5,h=Math.max(0,Math.min(46,A-3.5));a.x<h-2?a.x+=2:a.x>h+2?a.x-=2:a.x=h}else if(i.dy>0){const t=a.x+3.5;t<i.x-.5?a.x=Math.min(a.x+2,46):t>i.x+.5&&(a.x=Math.max(a.x-2,0))}R(t)},R=t=>{t.gameHistory.push({ball:Object.assign({},t.ball),paddle:Object.assign({},t.paddle)})},I=t=>{let e=0;return t.grid.forEach((t=>t.forEach((t=>{0===t.commitsCount&&e++})))),e},S=t=>{var e,o;const i=[];for(let a=0;a<n;a++)for(let n=0;n<7;n++)(null===(o=null===(e=t.grid[a])||void 0===e?void 0:e[n])||void 0===o?void 0:o.commitsCount)>0&&i.push({cx:a,cy:n});return 0===i.length?null:i[Math.floor(Math.random()*i.length)]},D=t=>{return e=void 0,n=void 0,i=function*(){if(t.frameCount=0,t.framesSinceLastBrickHit=0,t.gameHistory=[],t.brickEvents=[],t.grid=m(t),t.initialColors=t.grid.map((t=>t.map((t=>t.color)))),0===t.grid.reduce(((t,e)=>t+e.filter((t=>t.commitsCount>0)).length),0)){const e=B(t);return t.config.svgCallback(e),void t.config.gameOverCallback()}for((t=>{t.ball={x:26.5,y:5.9,dx:.75,dy:-.95}})(t),(t=>{t.paddle={x:23,width:7}})(t),t.targetBrick=S(t),t.bouncesSinceTargetSet=0;t.grid.some((t=>t.some((t=>t.commitsCount>0))))&&t.frameCount<3e3;)T(t),t.frameCount%200==0&&t.grid.reduce(((t,e)=>t+e.filter((t=>t.commitsCount>0)).length),0);const e=B(t);t.config.svgCallback(e),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:I(t),steps:t.frameCount,ghostsEaten:0}),t.config.gameOverCallback()},new((o=void 0)||(o=Promise))((function(t,a){function r(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(r,s)}l((i=i.apply(e,n||[])).next())}));var e,n,o,i},N={frameCount:0,contributions:[],ball:{x:0,y:0,dx:0,dy:0},paddle:{x:0,width:7},grid:[],monthLabels:[],framesSinceLastBrickHit:0,targetBrick:null,bouncesSinceTargetSet:0,gameHistory:[],initialColors:[],brickEvents:[],config:void 0};class O{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,o=function*(){switch(this.store=JSON.parse(JSON.stringify(N)),this.store.config=Object.assign(Object.assign({},{platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""}}),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return A(this.store),h(this.store),yield D(this.store),this.store},new((n=void 0)||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}));var t,e,n,o}stop(){this.store}}const U=t=>22*t,H=t=>22*t+15,F=(t,e,n)=>{var o,i;const a=t.gameHistory.length,r=null!==(i=null===(o=t.initialColors[e])||void 0===o?void 0:o[n])&&void 0!==i?i:"#ebedf0",s=t.cellEvents.filter((t=>t.x===e&&t.y===n));if(0===s.length)return{keyTimes:"0;1",values:`${r};${r}`};const l=[0],c=[r];for(const t of s){const e=Number((t.frameIndex/Math.max(a-1,1)).toFixed(4));e!==l[l.length-1]?(l.push(e),c.push(t.color)):c[c.length-1]=t.color}return 1!==l[l.length-1]&&(l.push(1),c.push(c[c.length-1])),{keyTimes:l.join(";"),values:c.join(";")}},z=t=>{const e=t.gameHistory.length,i=Math.max(e*o/2,1e3),a=d(t),r=H(10.5);let s='<svg width="1166" height="259" xmlns="http://www.w3.org/2000/svg">';s+=`<desc>Generated with galaga-contribution-graph on ${new Date}</desc>`,s+='<rect width="100%" height="100%" fill="#000000"/>';{let t=12345;const e=()=>(t=1664525*t+1013904223>>>0,t/4294967295);for(let t=0;t<120;t++){const t=(1166*e()).toFixed(1),n=(.4+1.6*e()).toFixed(1),o=(.3+.7*e()).toFixed(2),i=Math.floor(2500+5500*e());s+=`<circle cx="${t}" cy="0" r="${n}" fill="white" opacity="${o}"><animate attributeName="cy" from="-2" to="261" dur="${i}ms" begin="-${Math.floor(e()*i)}ms" repeatCount="indefinite"/></circle>`}}let l="";for(let e=0;e<n;e++)t.monthLabels[e]!==l&&(s+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="#aaaaaa">${t.monthLabels[e]}</text>`,l=t.monthLabels[e]);const c=a.intensityColors[0];for(let e=0;e<n;e++)for(let n=0;n<7;n++){const o=U(e),a=H(n),r=F(t,e,n);s+=`<rect x="${o}" y="${a}" width="20" height="20" rx="3" fill="transparent">\n\t\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${i}ms" repeatCount="indefinite"\n\t\t\t\t\tvalues="${r.values.split(";").map((t=>t===c?"transparent":t)).join(";")}" keyTimes="${r.keyTimes}"/>\n\t\t\t</rect>`}if(e>=2){const n=(t=>{const e=[],n=new Map;for(let o=0;o<t.gameHistory.length;o++){const i=t.gameHistory[o].bullets.filter((t=>t.active)),a=new Set(i.map((t=>t.id)));for(const[t,i]of n)a.has(t)||(e.push({id:t,x:i.x,startFrame:i.startFrame,endFrame:o-1,yPositions:i.yPositions}),n.delete(t));for(const t of i)n.has(t.id)?n.get(t.id).yPositions.push(t.y):n.set(t.id,{x:t.x,startFrame:o,yPositions:[t.y]})}for(const[o,i]of n)e.push({id:o,x:i.x,startFrame:i.startFrame,endFrame:t.gameHistory.length-1,yPositions:i.yPositions});return e})(t);for(const t of n){const n=U(t.x),o=Number((t.startFrame/(e-1)).toFixed(4)),a=Number((Math.min(t.endFrame+1,e-1)/(e-1)).toFixed(4));let r,l;o<=0&&a>=1?(r="0;1",l="1;1"):o<=0?(r=`0;${a};${a};1`,l="1;1;0;0"):a>=1?(r=`0;${o};${o};1`,l="0;0;1;1"):(r=`0;${o};${o};${a};${a};1`,l="0;0;1;1;0;0");const c=[],u=[],d=H(t.yPositions[0]).toFixed(1),A=H(t.yPositions[t.yPositions.length-1]).toFixed(1);t.startFrame>0&&(c.push(0),u.push(`${n.toFixed(1)},${d}`));for(let o=0;o<t.yPositions.length;o++){const i=t.startFrame+o,a=Number((i/(e-1)).toFixed(4)),r=H(t.yPositions[o]).toFixed(1);0!==c.length&&a===c[c.length-1]||(c.push(a),u.push(`${n.toFixed(1)},${r}`))}1!==c[c.length-1]&&(c.push(1),u.push(`${n.toFixed(1)},${A}`)),s+=`<image x="-5" y="-13" width="10" height="13" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAACACAMAAACMX59YAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAByUExURQAAAP////7+/gBE/wBE/wBE/wBE/wBE/wBE/gBE/gBE/wBE/wBE/gBE/wBE/wBE/gBE/gBE/+cgMfUeJf8AAP8AAP4AAP4AAABE/wBE/hhW/y9m/y9n/yNd/4Sl/73O/7zO//8cHP4cHP8AAP4AAP///6QdcYAAAAAYdFJOUwAAAGbHk4W9hb1genq/3RYcHJPF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wtDIrCL/JGvSI+ReIgAAAAAElFTkSuQmCC" opacity="0" preserveAspectRatio="xMidYMid meet">\n\t\t\t\t<animate attributeName="opacity" calcMode="discrete" dur="${i}ms" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${r}" values="${l}"/>\n\t\t\t\t<animateTransform attributeName="transform" type="translate" calcMode="linear"\n\t\t\t\t\tdur="${i}ms" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${c.join(";")}" values="${u.join(";")}"/>\n\t\t\t</image>`}}if(e>=2)for(const n of t.explosionEvents){const t=(U(n.x)+10).toFixed(1),o=(H(n.y)+10).toFixed(1),a=Number((n.frameIndex/(e-1)).toFixed(4)),r=Number((Math.min(n.frameIndex+7,e-1)/(e-1)).toFixed(4));if(r<=a)continue;const l=`0;${a};${a};${r};1`,c="0;0;1;0;0",u=`${i}ms`;s+=`<circle cx="${t}" cy="${o}" r="2" fill="none" stroke="${n.color}" stroke-width="3" opacity="0">\n\t\t\t\t<animate attributeName="r" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="2;2;2;20;20"/>\n\t\t\t\t<animate attributeName="stroke-width" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="3;3;3;0;0"/>\n\t\t\t\t<animate attributeName="opacity" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="${c}"/>\n\t\t\t</circle>`;const d=[{dx:0,dy:-11},{dx:0,dy:11},{dx:-11,dy:0},{dx:11,dy:0}];for(const{dx:e,dy:i}of d){const a=(Number(t)+e).toFixed(1),r=(Number(o)+i).toFixed(1);s+=`<circle cx="${t}" cy="${o}" r="2.5" fill="${n.color}" opacity="0">\n\t\t\t\t\t<animate attributeName="cx" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="${t};${t};${t};${a};${a}"/>\n\t\t\t\t\t<animate attributeName="cy" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="${o};${o};${o};${r};${r}"/>\n\t\t\t\t\t<animate attributeName="r" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="2.5;2.5;2.5;0;0"/>\n\t\t\t\t\t<animate attributeName="opacity" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="${c}"/>\n\t\t\t\t</circle>`}}const u=t.gameHistory.map((t=>`${U(t.ship.x).toFixed(1)},${r.toFixed(1)}`)),A=((t,e)=>{var n,o,i,a;const r=t.gameHistory.length;if(0===r){const t=null!==(n=e[0])&&void 0!==n?n:"0,0";return{keyTimes:"0;1",values:`${t};${t}`}}const s=[],l=[];let c=null,u=null;return e.forEach(((t,e)=>{t!==c&&(null!==c&&null!==u&&e-1!==u&&(s.push(Number(((e-1)/(r-1)).toFixed(4))),l.push(c)),s.push(Number((e/(r-1)).toFixed(4))),l.push(t),c=t,u=e)})),0!==s.length&&1===s[s.length-1]||(0===s.length?(s.push(0,1),l.push(null!==(o=e[0])&&void 0!==o?o:"0,0",null!==(i=e[e.length-1])&&void 0!==i?i:"0,0")):(s.push(1),l.push(null!==(a=null!=c?c:e[e.length-1])&&void 0!==a?a:"0,0"))),{keyTimes:s.join(";"),values:l.join(";")}})(t,u);return s+=`<image x="-16" y="-35" width="32" height="35" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABGCAYAAAB8MJLDAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfqBQgWJQn/24JaAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI2LTA1LTA4VDIyOjM1OjQ2KzAwOjAwKpfJ5AAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNi0wNS0wOFQyMjozNTo0NiswMDowMFvKcVgAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjYtMDUtMDhUMjI6Mzc6MDkrMDA6MDB6KP6pAAANdklEQV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cul8ee/dUyG6hUVe00SGOY2EaTjVAABnJ2zdN7tn3e0HUkYvu8piFcWnl+wbfPN5tN6LoOTdPgeV6OxV6ALIula0VMKZUbGAWL2dgiBiB3m3DOC1nsEslyqVQCY6yQxaapLNu2jTiOc6wOW0rWTwJZFucP2p8jXLSXh7lrv2RMbMgqOmeY22eZ2rbdtYZWLCPv5TRN0W63c8wYQxAEksXeniwX1bxt23LrmuA4jnMchiEYYzkOgkByu91GmqY5FuP/vSz+kxXbtvEfwITwAX3FN6kAAAAASUVORK5CYII=" preserveAspectRatio="xMidYMid meet">\n\t\t<animateTransform attributeName="transform" type="translate" calcMode="linear"\n\t\t\tdur="${i}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${A.keyTimes}"\n\t\t\tvalues="${A.values}"/>\n\t</image>`,s+="</svg>",s};const V=["NONE","FIRST_QUARTILE","SECOND_QUARTILE","THIRD_QUARTILE","FOURTH_QUARTILE"],L=t=>{const e=V.indexOf(t);return V[Math.max(0,e-1)]},Q=()=>Math.floor(5*Math.random())+4,j=t=>t.grid.some((t=>t.some((t=>t.commitsCount>0)))),P=(t,e=-1)=>{const o=Math.round(t.ship.x-.5),i=e=>t.grid[e].reduce(((t,e)=>{var n;return t+(null!==(n={NONE:0,FIRST_QUARTILE:1,SECOND_QUARTILE:2,THIRD_QUARTILE:3,FOURTH_QUARTILE:4}[e.level])&&void 0!==n?n:0)}),0);for(let t=3;t<=n;t++){let a=-1,r=0;for(let s=-t;s<=t;s++){const t=o+s;if(t<0||t>=n)continue;if(t===e)continue;const l=i(t);l>r&&(r=l,a=t)}if(-1!==a)return a}for(let o=0;o<n;o++)if(o!==e&&t.grid[o].some((t=>t.commitsCount>0)))return o;return Math.floor(26.5)},Y=t=>{var e;t.frameCount++;const{grid:o,ship:i}=t,a=d(t);for(const e of t.bullets){if(!e.active)continue;if(e.y-=.6,e.y<-1){e.active=!1;continue}const i=Math.round(e.x-.5),r=Math.floor(e.y);if(i>=0&&i<n&&r>=0&&r<7&&o[i][r].commitsCount>0){const n=o[i][r].color,s=L(o[i][r].level);o[i][r].level=s,o[i][r].color=a.intensityColors[V.indexOf(s)],"NONE"===s&&(o[i][r].commitsCount=0,t.explosionEvents.push({frameIndex:t.gameHistory.length,x:i,y:r,color:n})),t.cellEvents.push({frameIndex:t.gameHistory.length,x:i,y:r,color:o[i][r].color}),t.config.pointsIncreasedCallback(t.cellEvents.length),e.active=!1}}t.bullets=t.bullets.filter((t=>t.active)),(null===(e=o[t.currentTargetCol])||void 0===e?void 0:e.some((t=>t.commitsCount>0)))||(t.currentTargetCol=P(t),t.framesShootingAtTarget=0);const r=t.currentTargetCol,s=r+.5,l=s-i.x;Math.abs(l)>.4?i.x+=.4*Math.sign(l):i.x=s,i.x=Math.max(.8,Math.min(52.2,i.x));const c=Math.abs(i.x-s)<.5,u=o[r].some((t=>t.commitsCount>0));c&&u&&(t.framesShootingAtTarget>=t.framesAllowedForTarget?(t.currentTargetCol=P(t,r),t.framesShootingAtTarget=0,t.framesAllowedForTarget=Q()):(t.frameCount%2==0&&t.bullets.length<10&&t.bullets.push({id:t.nextBulletId++,x:s,y:9.5,active:!0}),t.framesShootingAtTarget++)),(t=>{t.gameHistory.push({ship:{x:t.ship.x},bullets:t.bullets.map((t=>Object.assign({},t)))})})(t)},G=t=>{return e=void 0,n=void 0,i=function*(){if(t.frameCount=0,t.nextBulletId=0,t.gameHistory=[],t.cellEvents=[],t.explosionEvents=[],t.bullets=[],t.grid=m(t),t.initialColors=t.grid.map((t=>t.map((t=>t.color)))),!j(t)){const e=z(t);return t.config.svgCallback(e),void t.config.gameOverCallback()}for(t.ship={x:26.5},t.currentTargetCol=P(t),t.framesShootingAtTarget=0,t.framesAllowedForTarget=Q();j(t)&&t.frameCount<3e3;)Y(t);const e=z(t);t.config.svgCallback(e),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.cellEvents.length,steps:t.frameCount,ghostsEaten:0}),t.config.gameOverCallback()},new((o=void 0)||(o=Promise))((function(t,a){function r(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(r,s)}l((i=i.apply(e,n||[])).next())}));var e,n,o,i},J={frameCount:0,nextBulletId:0,contributions:[],ship:{x:0},bullets:[],grid:[],monthLabels:[],gameHistory:[],initialColors:[],cellEvents:[],explosionEvents:[],currentTargetCol:-1,framesShootingAtTarget:0,framesAllowedForTarget:4,config:void 0};class K{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,o=function*(){switch(this.store=JSON.parse(JSON.stringify(J)),this.store.config=Object.assign(Object.assign({},{platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""}}),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return A(this.store),h(this.store),yield G(this.store),this.store},new((n=void 0)||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}));var t,e,n,o}stop(){this.store}}const W="yellow",$={blinky:{up:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABiklEQVR4nIXSO2sVURQF4G8mMwa8QU2KxFcjCoIgacR/oCBYCP4fsTEIBkWwEK21UAQLIdjYaKEiJIXBXhNBCFaSeDP3zLa4mdyj5rHgwNmPtffZ62z+Q4miKHlWs3yALwUvKYphbC8UjDN3nIUB/SCCSDRnWKiZVxTFrvxp5kMRHbEltaTODuIED3YkT3FnUy+uS815qQkzMSJOxAWpuSo1A72Y4f5f5DFuBpE+vmsmZ9ukF9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ZsAAAAASUVORK5CYII=",down:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACZ0lEQVR4nHWRy4vNYRjHP8/ze885c+GIuTSZxriMS6KkKeQSK0lRDAsbthaTzSyUqYlhxYIsJkTNiGYh+RMYKRFTM5Fxq8ll3BriMOac3+95LM45GYOn3sX79n2/l+cL/58e4CkwAtwFwr9A8tfNOQJsernr2toFtauyFPIgORp7tw68TT6PAgcA+zcBdD7be6O7pXYDVNbgkVsRJEruPR6/puH85hsfyO0uk0gJgOOdT3b1d7csbctLQVRjDXhZxrHgMQH041Cov7jx+kdye0TERERw90PDOy6fXr5yXyxfRcVRomnmzADHqiTWT4Mhc7H1ch72q7sDNC+qnI/FFkslyhwB8d+f3SBL8RTAq5otDysA11IMicSQClE6BI4CS7yYUoB6h2MKxyOYC1JItEGyeSAC6B7c2Tdhhy3xN/7nnHD3jrz7xJQ3c7cuS5L99wsKdxRoakrXVzhu1JTilt1nAI+gYlrVATQ1NxgsUyA/GSfgwBdYvB4ihVfPgRQgCuOgjSDV4O9AIlFsEmBCAfEIUOBsQsNIUajpFPCmALHDSWgag+wPkFPANyAogAbABcDBc2q396HFtYJZFBMc/S5htL0UL7ZYEBUxBUyBxA085Sb510rKIICn3fTHWNBvo4FM0aFn3PTnWPCUW0k2VmDWjFSGKCHdemXL0IMXvUYFyM9Xurh39aCcWziQez8AlWDjD3VZ3+pBHX8USGcB6gDab23r+by9dt09oErg4HDb1ck1M5feLK2RaqIzI3v7JxeEuj4gPU9nX3rc1j+RRq6Wy+kCaqeUdQaYMa28C2XCYpH0iKC/AKR7DJ4ZSbreAAAAAElFTkSuQmCC",left:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACnklEQVR4nG2TTYiVZRTHf+c8z/vee+emNVycYBocHAqGEN3IgEgg7bIZBir72CW2aNEERZiK6Ci4sNrooi9q02KaZhYubNGuhVEkLcqmLkhpwgwqRG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Mpn50z95tzdSkAAKSYZp/7ZDzKF6XYxIUUvw12bbvKAF1VMQCvXUhSydXIjDk2kcDkjL4kF1k+4xrmH/UA3stP0Iur7f8AAAAASUVORK5CYII=",down:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAm0lEQVR4nO2Ryw3CQAxE35jdEBFRAycEpUAJ9A81EBIlcMjPgazEHUbyxX47I3vhLwBiDDydUpxnQt8zgG2+kQeD1A2cTJo3JIqVzV29jod9NrCX82m3xLRt27wHTYlmY+SjquslRpJ9ZVAmDKC/wf0K0lQAuFtWddn0a88ZgAwoKKx7MdRnShxdF5hAHIc5t+Q3rp2BoRT2c3oBFX9xUA7hwq8AAAAASUVORK5CYII=",left:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAuUlEQVR4nO2PvRIBQRCEu+fOIaD8RkoRKCGZwNt4fwKFcutnW2LP1tWdF6CjmdmveruBvxgGSSqOJKvgmEnM6CWYxS7hkYSVbuWdABIC9pTkI2cAeHiv3WazDPsiazWeFczDS0buQQLl0CfnrmHOb10LDHkoJxtV1cXZubyohCyyH36tVuji8vvHwJI6DltMhzNM2jqpUJqmaEdMD8YV5h3l0vHNrAf9zrjV/ARQpLrPYmYBZrWpfkwv2KllZq2VZYMAAAAASUVORK5CYII=",right:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAArklEQVR4nO2RsQrCMBCGv0vaUq2gIlJxEBEX6eLi5jv4/g8h0qViIpxT27S0i3M/COTCx5/cBSYAiIxBA8a8IcfEIhiRjmh7tQHi3pkAVnqpIfs4sbX8KIrdmGc6qfJCBETA+XlzZeWc73r1etIJgHXw7KjZV957Btn0A8K+26bf7vMd88izmbnl+UpVtVRVrVSvnJeLICAFkiRu51WqHjlkd05bAC7Gpv9+4wT8AASmiluJhbS5AAAAAElFTkSuQmCC"},scared:{imgDate:"data:image/png;base64,i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fuCDC/N/AMdtzXsl7IlxgAAAABJRU5ErkJggg=="}},q={horizontal:Array(54).fill(null).map((()=>Array(8).fill({active:!1,id:""}))),vertical:Array(54).fill(null).map((()=>Array(8).fill({active:!1,id:""})))},X=(t,e,n,o,i)=>{"horizontal"===n?t>=0&&t<q.horizontal.length&&e>=0&&e<q.horizontal[0].length&&(q.horizontal[t][e]={active:!0,id:o,color:i}):t>=0&&t<q.vertical.length&&e>=0&&e<q.vertical[0].length&&(q.vertical[t][e]={active:!0,id:o,color:i})},Z=(t,e)=>[[-1,0],[1,0],[0,-1],[0,1]].filter((([o,i])=>{const a=t+o,r=e+i;return!(a<0||a>=n||r<0||r>=7||(-1===o?q.vertical[t][e].active:1===o?q.vertical[t+1][e].active:-1===i?q.horizontal[t][e].active:1===i&&q.horizontal[t][e+1].active))})),_={getValidMoves:Z,calculateDistance:(t,e,n,o)=>Math.sqrt(Math.pow(n-t,2)+Math.pow(o-e,2)),findNextStepDijkstra(t,e){if(t.x===e.x&&t.y===e.y)return null;const n=[Object.assign(Object.assign({},t),{cost:0,path:[]})],o=new Set([`${t.x},${t.y}`]);for(;n.length;){n.sort(((t,e)=>t.cost-e.cost));const{x:t,y:i,cost:a,path:r}=n.shift();for(const[s,l]of Z(t,i)){const c=t+s,u=i+l,d=`${c},${u}`;if(o.has(d))continue;o.add(d);const A=[...r,{x:c,y:u}];if(c===e.x&&u===e.y)return A.length>0?A[0]:null;n.push({x:c,y:u,cost:a+1,path:A})}}return null}},tt={blinky:{x:50,y:0},pinky:{x:0,y:0},inky:{x:50,y:6},clyde:{x:0,y:6}};let et="scatter",nt=0,ot=0;const it=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"}},at=(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")},rt=(t,e)=>{const n=tt[t.name]||tt.blinky;t.target=n;const o=dt(t.x,t.y,n.x,n.y,t.direction);o&&(t.x=o.x,t.y=o.y,o.direction&&(t.direction=o.direction))},st=(t,e)=>{(!t.target||t.x===t.target.x&&t.y===t.target.y)&&(t.target=mt(t.x,t.y));const n=lt(t);if(0===n.length)return;const o=t.target.x-t.x,i=t.target.y-t.y;let a=n;if(Math.random()<.5);else{const t=n.filter((t=>{const e=t[0],n=t[1];return o>0&&e>0||o<0&&e<0||i>0&&n>0||i<0&&n<0}));t.length>0&&(a=t)}const[r,s]=a[Math.floor(Math.random()*a.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)},lt=t=>_.getValidMoves(t.x,t.y).filter((e=>{const[n,o]=e;return!("right"===t.direction&&n<0||"left"===t.direction&&n>0||"up"===t.direction&&o>0||"down"===t.direction&&o<0)})),ct=(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 o=_.findNextStepDijkstra({x:t.x,y:t.y},n);if(o){const e=o.x-t.x,n=o.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=o.x,t.y=o.y}else{const e=dt(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))}},ut=(t,e)=>{if("eyes"===t.name)return void ct(t);const n=At(t,e);t.target=n;const o=dt(t.x,t.y,n.x,n.y,t.direction);o&&(t.x=o.x,t.y=o.y,o.direction&&(t.direction=o.direction))},dt=(t,e,n,o,i)=>{if(t===n&&e===o)return null;const a=[{x:t,y:e,path:[],direction:i||"right"}],r=new Set;for(r.add(`${t},${e}`);a.length>0;){const t=a.shift(),{x:e,y:i,path:s,direction:l}=t,c=_.getValidMoves(e,i),u=c.filter((t=>{const[e,n]=t;return!l||!("right"===l&&e<0||"left"===l&&e>0||"up"===l&&n>0||"down"===l&&n<0)||1===c.length}));for(const[t,c]of u){const u=e+t,d=i+c,A=`${u},${d}`;if(r.has(A))continue;let h;r.add(A),h=t>0?"right":t<0?"left":c>0?"down":c<0?"up":l;const m=[...s,{x:u,y:d,pathDirection:h}];if(u===n&&d===o)return m.length>0?{x:m[0].x,y:m[0].y,direction:m[0].pathDirection}:null;a.push({x:u,y:d,path:m,direction:h})}}const s=_.getValidMoves(t,e);if(s.length>0){const[n,o]=s[Math.floor(Math.random()*s.length)];let a=i;return n>0?a="right":n<0?a="left":o>0?a="down":o<0&&(a="up"),{x:t+n,y:e+o,direction:a}}return null},At=(t,e)=>{const{pacman:n}=e;let o=ht(e),i=1;if("blinky"===t.name){const t=371,e=(t-ot)/t;if(e>.7&&(i=1.2),e>.9&&(i=1.4),Math.random()<.8*i)return{x:n.x,y:n.y}}switch(t.name){case"blinky":default:return{x:n.x,y:n.y};case"pinky":const i=4;let a=n.x,r=n.y;return"up"===n.direction?(a=n.x-4,r=n.y-4):(a=n.x+o[0]*i,r=n.y+o[1]*i),a=Math.min(Math.max(a,0),52),r=Math.min(Math.max(r,0),6),{x:a,y:r};case"inky":const s=e.ghosts.find((t=>"blinky"===t.name));let l={x:n.x+2*o[0],y:n.y+2*o[1]};if("up"===n.direction&&(l.x=n.x-2,l.y=n.y-2),s){const t=l.x-s.x,e=l.y-s.y;l={x:l.x+t,y:l.y+e}}return l.x=Math.min(Math.max(l.x,0),52),l.y=Math.min(Math.max(l.y,0),6),l;case"clyde":return _.calculateDistance(t.x,t.y,n.x,n.y)<8?tt.clyde:{x:n.x,y:n.y}}},ht=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]}},mt=(t,e)=>{const n=t+Math.floor(17*Math.random())-8,o=e+Math.floor(17*Math.random())-8;return{x:Math.max(0,Math.min(n,52)),y:Math.max(0,Math.min(o,6))}},gt=t=>{ot=(t=>{let e=0;for(let o=0;o<n;o++)for(let n=0;n<7;n++)"NONE"!==t.grid[o][n].level&&e++;return e})(t),(t=>{t.pacman.powerupRemainingDuration>0||(nt++,nt>=5*("scatter"===et?7:20)&&(et="scatter"===et?"chase":"scatter",nt=0,t.ghosts.forEach((t=>{t.inHouse||"eyes"===t.name||t.scared||it(t)}))))})(t);for(const e of t.ghosts)e.inHouse?at(e,t):("eyes"===e.name&&(e.scared=!1),e.scared?st(e,t):"eyes"===e.name?ct(e):"scatter"===et?rt(e):ut(e,t))};var ft;!function(t){t.CONSERVATIVE="conservative",t.AGGRESSIVE="aggressive",t.OPPORTUNISTIC="opportunistic"}(ft||(ft={}));const yt=t=>{const e=[];for(let o=0;o<n;o++)for(let n=0;n<7;n++){const i=t.grid[o][n];if("NONE"!==i.level){const a=_.calculateDistance(o,n,t.pacman.x,t.pacman.y),r=i.commitsCount/(a+1);e.push({x:o,y:n,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]},xt=t=>{const e=new Map,o=!!t.pacman.powerupRemainingDuration;if(t.ghosts.forEach((t=>{if(!t.scared)for(let o=-5;o<=5;o++)for(let i=-5;i<=5;i++){const a=t.x+o,r=t.y+i;if(a>=0&&a<n&&r>=0&&r<7){const t=`${a},${r}`,n=15-(Math.abs(o)+Math.abs(i));if(n>0){const o=e.get(t)||0;e.set(t,Math.max(o,n))}}}})),o)for(const[t,n]of e.entries())e.set(t,n/5);return e},pt=(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 o=e.x-t.pacman.x,i=e.y-t.pacman.y;t.pacman.direction=o>0?"right":o<0?"left":i>0?"down":i<0?"up":t.pacman.direction,t.pacman.x=e.x,t.pacman.y=e.y},vt=t=>{t.pacman.powerupRemainingDuration=15,t.ghosts.forEach((t=>{"eyes"!==t.name&&(t.scared=!0)}))},bt=t=>{if(t.pacman.deadRemainingDuration)return;const e=!!t.pacman.powerupRemainingDuration,n=t.ghosts.filter((t=>t.scared));let o;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 o=_.calculateDistance(n.x,n.y,t.pacman.x,t.pacman.y);return o<e.distance?{x:n.x,y:n.y,distance:o}:e}),{x:t.pacman.x,y:t.pacman.y,distance:1/0})})(t);o=null!=e?e:yt(t)}else t.pacman.target?t.pacman.x===t.pacman.target.x&&t.pacman.y===t.pacman.target.y?(o=yt(t),t.pacman.target=o):o=t.pacman.target:(o=yt(t),t.pacman.target=o);o||(o={x:t.pacman.x,y:t.pacman.y});const i=((t,e)=>{var n;const o=[{x:t.pacman.x,y:t.pacman.y,path:[],score:0}],i=new Set([`${t.pacman.x},${t.pacman.y}`]),a=xt(t);let r=.5,s=.5;switch(t.config.playerStyle){case ft.CONSERVATIVE:r=3,s=.1;break;case ft.AGGRESSIVE:r=.3,s=2;break;case ft.OPPORTUNISTIC:default:r=.8,s=.8}let l=1/0;t.ghosts.forEach((e=>{if(!e.scared){const n=_.calculateDistance(t.pacman.x,t.pacman.y,e.x,e.y);l=Math.min(l,n)}}));const c=t.config.playerStyle===ft.CONSERVATIVE?5:7,u=l<c;for(t.config.playerStyle===ft.CONSERVATIVE&&u&&(r*=5);o.length>0;){o.sort(((t,e)=>e.score-t.score));const l=o.shift(),{x:c,y:u,path:d}=l;if(c===e.x&&u===e.y){if(d.length>0){let e=0,n=0;return d.forEach((o=>{const i=`${o.x},${o.y}`,l=a.get(i)||0,c=t.grid[o.x][o.y].commitsCount;e-=l*r,n+=c*s})),d[0]}return null}for(const[l,A]of _.getValidMoves(c,u)){const h=c+l,m=u+A,g=`${h},${m}`;if(!i.has(g)){const l=[...d,{x:h,y:m}],c=a.get(g)||0,u=t.grid[h][m].commitsCount,A=_.calculateDistance(h,m,e.x,e.y),f=(null===(n=t.pacman.recentPositions)||void 0===n?void 0:n.includes(g))?100:0;let y,x,p;t.config.playerStyle===ft.CONSERVATIVE?(y=(15-c)*r,c>=5?y-=100:y+=50,x=u*s,p=5*y+x+-A/10-f):(y=(15-c)*r,x=u*s,p=y+x+-A/10-f),o.push({x:h,y:m,path:l,score:p}),i.add(g)}}}return null})(t,o);i?pt(t,i):(t=>{const e=_.getValidMoves(t.pacman.x,t.pacman.y);if(0===e.length)return;const n=e.reduce(((e,[n,o])=>{const i=t.pacman.x+n,a=t.pacman.y+o;let r=1/0;return t.ghosts.forEach((t=>{if(!t.scared){const e=_.calculateDistance(t.x,t.y,i,a);r=Math.min(r,e)}})),r>e.distance?{dx:n,dy:o,distance:r}:e}),{dx:0,dy:0,distance:-1/0});pt(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=d(t);"FOURTH_QUARTILE"===e.level&&vt(t),e.level="NONE",e.color=n.intensityColors[0],e.commitsCount=0}})(t)}catch(t){console.error("Error in movePacman:",t)}},Ct=t=>{const e=10,n=t,o=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(o)},${e+e*Math.sin(o)}\n Z`},wt=(t,e,n)=>t.gameHistory.map((t=>t.grid[e][n].color)),Bt=(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 o=[],i=[],a=null,r=null;return e.forEach(((t,e)=>{t!==a&&(null!==a&&null!==r&&e-1!==r&&(o.push(Number(((e-1/40)/(n-1)).toFixed(4))),i.push(a)),o.push(Number((e/(n-1)).toFixed(4))),i.push(t),a=t,r=e)})),0!==o.length&&1===o[o.length-1]||(0===o.length?(o.push(0,1),i.push(e[0]||"#000",e[e.length-1]||"#000")):(o.push(1),i.push(a||e[e.length-1]||"#000"))),{keyTimes:o.join(";"),values:i.join(";")}},Mt=t=>{const e=t.gameHistory.length*o;let i='<svg width="1166" height="184" xmlns="http://www.w3.org/2000/svg">';i+=`<desc>Generated with pacman-contribution-graph on ${new Date}</desc>`,i+=`<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>`,i+=`<rect width="100%" height="100%" fill="${d(t).gridBackground}"/>`,i+=(()=>{let t="<defs>";return["blinky","inky","pinky","clyde"].forEach((e=>{["up","down","left","right"].forEach((n=>{const o=$[e];n in o&&(t+=`\n <symbol id="ghost-${e}-${n}" viewBox="0 0 20 20">\n <image href="${o[n]}" width="20" height="20"/>\n </symbol>\n `)}))})),t+=`\n <symbol id="ghost-scared" viewBox="0 0 20 20">\n <image href="${$.scared.imgDate}" width="20" height="20"/>\n </symbol>`,["up","down","left","right"].forEach((e=>{$.eyes&&e in $.eyes?t+=`\n <symbol id="ghost-eyes-${e}" viewBox="0 0 20 20">\n <image href="${$.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 a="";for(let e=0;e<n;e++)t.monthLabels[e]!==a&&(i+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${d(t).textColor}">${t.monthLabels[e]}</text>`,a=t.monthLabels[e]);for(let o=0;o<n;o++)for(let n=0;n<7;n++){const a=22*o,r=22*n+15,s=Bt(t,wt(t,o,n));i+=`<rect id="c-${o}-${n}" x="${a}" y="${r}" width="20" height="20" rx="5" fill="${d(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<7;e++){let o=null;for(let a=0;a<=n;a++){let r=a<n&&q.horizontal[a][e].active;r&&null===o&&(o=a),r&&a!==n||null===o||(i+=`<rect id="wh-${o}-${e}" x="${22*o-2}" y="${22*e-2+15}" width="${22*(a-o)}" height="2" fill="${d(t).wallColor}"></rect>`,o=null)}}for(let e=0;e<n;e++){let n=null;for(let o=0;o<=7;o++){let a=o<7&&q.vertical[e][o].active;a&&null===n&&(n=o),a&&7!==o||null===n||(i+=`<rect id="wv-${e}-${n}" x="${22*e-2}" y="${22*n-2+15}" width="2" height="${22*(o-n)}" fill="${d(t).wallColor}"></rect>`,n=null)}}const r=Bt(t,t.gameHistory.map((t=>{return(e=t.pacman).deadRemainingDuration?"#80808064":e.powerupRemainingDuration?"red":W;var e}))),s=Bt(t,(t=>t.gameHistory.map((t=>`${22*t.pacman.x},${22*t.pacman.y+15}`)))(t)),l=Bt(t,(t=>t.gameHistory.map(((e,n)=>{const o=Math.min(n+1,t.gameHistory.length-1);return(t=>{switch(t){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.gameHistory[o].pacman.direction)})))(t));return i+=`<path id="pacman" d="${Ct(.55)}" fill="${W}">\n\t\t<animate attributeName="fill" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${r.keyTimes}"\n\t\t\tvalues="${r.values}"/>\n\t\t<animateTransform attributeName="transform" type="translate" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${s.keyTimes}"\n\t\t\tvalues="${s.values}"\n\t\t\tadditive="sum"/>\n\t\t<animateTransform attributeName="transform" type="rotate" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${l.keyTimes}"\n\t\t\tvalues="${l.values}"\n\t\t\tcalcMode="discrete"\n\t\t\tadditive="sum"/>\n\t\t<animate attributeName="d" dur="0.5s" repeatCount="indefinite"\n\t\t\tvalues="${Ct(.55)};${Ct(.05)};${Ct(.55)}"/>\n\t</path>`,t.ghosts.forEach(((n,o)=>{const a=Bt(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));i+=`<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="${a.keyTimes}"\n\t\t\t\tvalues="${a.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 o=t.ghosts[e];if(!o)return n;const i=o.scared?"scared":"eyes"===o.name?`eyes-${o.direction||"right"}`:`${o.name}-${o.direction||"right"}`;n[i]=[{time:0,visible:!0}];let a=i;return t.gameHistory.forEach(((o,i)=>{if(e>=o.ghosts.length)return;const r=o.ghosts[e],s=i/(t.gameHistory.length-1),l=r.scared?"scared":"eyes"===r.name?`eyes-${r.direction||"right"}`:`${r.name}-${r.direction||"right"}`;l!==a&&(n[a].push({time:s,visible:!1}),n[l]||(n[l]=[{time:0,visible:!1}]),n[l].push({time:s,visible:!0}),a=l)})),n[a].push({time:1,visible:!0}),Object.keys(n).forEach((t=>{t!==a&&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,n]of Object.entries(r)){if(0===n.length)continue;const o=`#ghost-${t}`,a=n.map((t=>t.time.toFixed(4))).join(";"),r=n.map((t=>t.visible?"visible":"hidden")).join(";"),s=n[0].visible?"visible":"hidden";i+=`<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="${a}"\n\t\t\t\t\tvalues="${r}" />\n\t\t\t</use>`}i+="</g>"})),i+="</svg>",i};var Et=function(t,e,n,o){return new(n||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}))};const kt=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"))}))},Tt=t=>Et(void 0,void 0,void 0,(function*(){var e,n;if(t.frameCount++,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),kt(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&&St(t,e.name))})),!t.grid.some((t=>t.some((t=>t.commitsCount>0))))){const n=Mt(t);return t.config.svgCallback(n),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.pacman.totalPoints,steps:t.aliveSteps,ghostsEaten:null!==(e=t.pacman.ghostsEaten)&&void 0!==e?e:0}),void t.config.gameOverCallback()}bt(t),It(t),0===t.pacman.deadRemainingDuration&&(gt(t),It(t)),t.pacmanMouthOpen=!t.pacmanMouthOpen,0===t.pacman.deadRemainingDuration&&t.aliveSteps++,t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.pacman.totalPoints,steps:t.aliveSteps,ghostsEaten:null!==(n=t.pacman.ghostsEaten)&&void 0!==n?n:0}),Rt(t)})),Rt=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)))))})},It=t=>{t.pacman.deadRemainingDuration||t.ghosts.forEach((e=>{var n;"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.ghostsEaten=(null!==(n=t.pacman.ghostsEaten)&&void 0!==n?n:0)+1):(t.pacman.points=0,t.pacman.powerupRemainingDuration=0,0===t.pacman.deadRemainingDuration&&(t.pacman.deadRemainingDuration=10)))}))},St=(t,e)=>{const n=t.ghosts.find((t=>t.name===e&&t.inHouse));n&&(n.justReleasedFromHouse=!0,n.y=2,n.direction="up")},Dt={frameCount:0,aliveSteps:0,contributions:[],pacman:{x:0,y:0,direction:"right",points:0,totalPoints:0,deadRemainingDuration:0,powerupRemainingDuration:0,recentPositions:[],ghostsEaten:0},ghosts:[],grid:[],monthLabels:[],pacmanMouthOpen:!0,gameInterval:0,gameHistory:[],config:void 0,useGithubThemeColor:!0},Nt=(t,e,o,i,a)=>{"horizontal"==o?(X(t,e,"horizontal",a),"x"==i?X(n-t-1,e,"horizontal",a):"y"==i?X(t,7-e,"horizontal",a):"xy"==i&&(X(n-t-1,e,"horizontal",a),X(t,7-e,"horizontal",a),X(n-t-1,7-e,"horizontal",a))):(X(t,e,"vertical",a),"x"==i?X(n-t,e,"vertical",a):"y"==i?X(t,7-e-1,"vertical",a):"xy"==i&&(X(n-t,e,"vertical",a),X(t,7-e-1,"vertical",a),X(n-t,7-e-1,"vertical",a)))};class Ot{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,o=function*(){const t={platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""},playerStyle:ft.OPPORTUNISTIC};switch(this.store=JSON.parse(JSON.stringify(Dt)),this.store.config=Object.assign(Object.assign({},t),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return Nt(0,2,"horizontal","xy","L1"),Nt(1,2,"horizontal","xy","L1"),Nt(4,1,"vertical","x","L2"),Nt(4,2,"vertical","x","L2"),Nt(4,3,"vertical","x","L2"),Nt(4,4,"vertical","x","L2"),Nt(3,3,"horizontal","x","L3"),Nt(2,3,"horizontal","x","L3"),Nt(4,5,"horizontal","x","L4"),Nt(6,4,"vertical","x","L5"),Nt(6,3,"vertical","x","L5"),Nt(6,2,"vertical","x","L5"),Nt(6,2,"horizontal","x","L6"),Nt(7,2,"horizontal","x","L6"),Nt(8,2,"horizontal","x","L6"),Nt(9,2,"horizontal","x","L6"),Nt(13,2,"horizontal","xy","L7"),Nt(14,2,"horizontal","xy","L7"),Nt(15,2,"horizontal","xy","L7"),Nt(16,2,"horizontal","xy","L7"),Nt(17,2,"horizontal","xy","L7"),Nt(18,2,"horizontal","xy","L7"),Nt(16,2,"vertical","xy","L8"),Nt(8,1,"horizontal","x","L9"),Nt(9,1,"horizontal","x","L9"),Nt(10,1,"horizontal","x","L9"),Nt(11,1,"horizontal","x","L9"),Nt(12,1,"vertical","x","L10"),Nt(12,3,"vertical","x","L10"),Nt(11,4,"horizontal","x","L11"),Nt(10,4,"horizontal","x","L11"),Nt(9,4,"horizontal","x","L11"),Nt(8,4,"horizontal","x","L11"),Nt(8,4,"vertical","x","L12"),Nt(8,5,"vertical","x","L12"),Nt(23,1,"horizontal","x","L18"),Nt(22,1,"horizontal","x","L18"),Nt(21,1,"horizontal","x","L18"),Nt(21,1,"vertical","x","L18"),Nt(21,2,"vertical","x","L18"),Nt(21,3,"vertical","x","L18"),Nt(20,4,"horizontal","x","L18"),Nt(19,4,"horizontal","x","L18"),Nt(19,3,"vertical","x","L18"),Nt(18,3,"horizontal","x","L18"),Nt(22,5,"vertical","x","L19"),Nt(21,5,"horizontal","x","L19"),Nt(20,5,"horizontal","x","L19"),Nt(20,5,"vertical","x","L19"),Nt(1,6,"horizontal","x","L20"),Nt(2,6,"horizontal","x","L20"),Nt(3,4,"vertical","x","L20"),Nt(5,6,"horizontal","x","L21"),Nt(6,6,"horizontal","x","L21"),X(25,2,"horizontal","GH_TOP"),X(27,2,"horizontal","GH_TOP"),X(25,4,"horizontal","GH_BOTTOM"),X(26,4,"horizontal","GH_BOTTOM"),X(27,4,"horizontal","GH_BOTTOM"),X(25,3,"vertical","GH_LEFT"),X(28,3,"vertical","GH_RIGHT"),X(25,2,"vertical","GH_LEFT"),X(28,2,"vertical","GH_RIGHT"),A(this.store),h(this.store),yield(e=this.store,Et(void 0,void 0,void 0,(function*(){e.frameCount=0,e.aliveSteps=0,e.gameHistory=[],e.ghosts.forEach((t=>t.scared=!1)),e.grid=m(e);const t=()=>e.grid.some((t=>t.some((t=>t.commitsCount>0))));for(t()&&((t=>{t.pacman={x:0,y:0,direction:"right",points:0,totalPoints:0,deadRemainingDuration:0,powerupRemainingDuration:0,recentPositions:[],ghostsEaten:0}})(e),kt(e));t();)yield Tt(e);yield Tt(e)}))),this.store;var e},new((n=void 0)||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}));var t,e,n,o}stop(){var t;t=this.store,Et(void 0,void 0,void 0,(function*(){clearInterval(t.gameInterval)}))}}const Ut=["#e74c3c","#f1c40f","#2ecc71","#3498db","#9b59b6","#e67e22"],Ht=t=>22*t+10,Ft=t=>22*t+15+10,zt=(t,e,n)=>{0===t.keyTimes.length||e!==t.keyTimes[t.keyTimes.length-1]?(t.keyTimes.push(e),t.values.push(n)):t.values[t.values.length-1]=n},Vt=t=>(1!==t.keyTimes[t.keyTimes.length-1]&&(t.keyTimes.push(1),t.values.push(t.values[t.values.length-1])),{keyTimes:t.keyTimes.join(";"),values:t.values.join(";")}),Lt=(t,e)=>Number((t/Math.max(e-1,1)).toFixed(4)),Qt=(t,e,n,o)=>{var i,a;const r=t.gameHistory.length,s=null!==(a=null===(i=t.initialColors[e])||void 0===i?void 0:i[n])&&void 0!==a?a:o,l=t.cellEvents.filter((t=>t.x===e&&t.y===n));if(0===l.length)return{keyTimes:"0;1",values:`${s};${s}`};const c={keyTimes:[0],values:[s]};for(const t of l){const e=Lt(t.frameIndex,r);zt(c,e,t.color)}return Vt(c)},jt=t=>{var e,i,a,r,s,l,c,u,A;const h=t.gameHistory.length,m=`${Math.max(h*o/6,1e3)}ms`,g=d(t),f=g.intensityColors[0];let y='<svg width="1166" height="249" xmlns="http://www.w3.org/2000/svg">';y+=`<desc>Generated with puzzle-bobble-contribution-graph on ${new Date}</desc>`,y+=`<rect width="100%" height="100%" fill="${g.gridBackground}"/>`;let x="";for(let e=0;e<n;e++)t.monthLabels[e]!==x&&(y+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${g.textColor}">${t.monthLabels[e]}</text>`,x=t.monthLabels[e]);for(let e=0;e<n;e++)for(let n=0;n<7;n++){const o=Ht(e),i=Ft(n),a=Qt(t,e,n,f);y+=`<circle cx="${o}" cy="${i}" r="9" fill="${f}">\n\t\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${m}" repeatCount="indefinite"\n\t\t\t\t\tvalues="${a.values}" keyTimes="${a.keyTimes}"/>\n\t\t\t</circle>`}if(h>=2){const n=(t=>{const e=[],n=new Map;for(let o=0;o<t.gameHistory.length;o++){const i=t.gameHistory[o].activeBubble;for(const[t,a]of n)i&&i.id===t||(e.push({id:t,colorIndex:a.colorIndex,startFrame:a.startFrame,endFrame:o-1,xPositions:a.xs,yPositions:a.ys}),n.delete(t));if(i&&i.active)if(n.has(i.id)){const t=n.get(i.id);t.xs.push(i.x),t.ys.push(i.y)}else n.set(i.id,{colorIndex:i.colorIndex,startFrame:o,xs:[i.x],ys:[i.y]})}for(const[o,i]of n)e.push({id:o,colorIndex:i.colorIndex,startFrame:i.startFrame,endFrame:t.gameHistory.length-1,xPositions:i.xs,yPositions:i.ys});return e})(t);for(const t of n){const n=Number((t.startFrame/(h-1)).toFixed(4)),o=Number((Math.min(t.endFrame+1,h-1)/(h-1)).toFixed(4)),i=null!==(e=Ut[t.colorIndex])&&void 0!==e?e:Ut[0];let a,r;n<=0&&o>=1?(a="0;1",r="1;1"):n<=0?(a=`0;${o};${o};1`,r="1;1;0;0"):o>=1?(a=`0;${n};${n};1`,r="0;0;1;1"):(a=`0;${n};${n};${o};${o};1`,r="0;0;1;1;0;0");const s=[],l=[],c=t.xPositions[0].toFixed(1),u=t.yPositions[0].toFixed(1);t.startFrame>0&&(s.push(0),l.push(`${c},${u}`));for(let e=0;e<t.xPositions.length;e++){const n=t.startFrame+e,o=Number((n/(h-1)).toFixed(4)),i=t.xPositions[e].toFixed(1),a=t.yPositions[e].toFixed(1);0!==s.length&&o===s[s.length-1]||(s.push(o),l.push(`${i},${a}`))}if(1!==s[s.length-1]){const e=t.xPositions[t.xPositions.length-1].toFixed(1),n=t.yPositions[t.yPositions.length-1].toFixed(1);s.push(1),l.push(`${e},${n}`)}y+=`<circle cx="0" cy="0" r="9" fill="${i}" opacity="0" stroke="white" stroke-width="1" stroke-opacity="0.4">\n\t\t\t\t<animate attributeName="opacity" calcMode="discrete" dur="${m}" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${a}" values="${r}"/>\n\t\t\t\t<animateTransform attributeName="transform" type="translate" calcMode="linear"\n\t\t\t\t\tdur="${m}" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${s.join(";")}" values="${l.join(";")}"/>\n\t\t\t</circle>`}}if(h>=2)for(const e of t.popEvents){const t=Number((e.frameIndex/(h-1)).toFixed(4)),n=Number((Math.min(e.frameIndex+8,h-1)/(h-1)).toFixed(4));if(n<=t)continue;const o=`0;${t};${t};${n};1`,i="0;0;1;0;0";for(const{x:t,y:n}of e.cells)y+=`<circle cx="${Ht(t).toFixed(1)}" cy="${Ft(n).toFixed(1)}" r="4" fill="none" stroke="${e.color}" stroke-width="2" opacity="0">\n\t\t\t\t\t<animate attributeName="r" calcMode="linear" dur="${m}" repeatCount="indefinite" keyTimes="${o}" values="4;4;4;20;20"/>\n\t\t\t\t\t<animate attributeName="stroke-width" calcMode="linear" dur="${m}" repeatCount="indefinite" keyTimes="${o}" values="2;2;2;0;0"/>\n\t\t\t\t\t<animate attributeName="opacity" calcMode="linear" dur="${m}" repeatCount="indefinite" keyTimes="${o}" values="${i}"/>\n\t\t\t\t</circle>`}if(h>=2){const e=169,n=583..toFixed(1),o=(e+30).toFixed(1),d={keyTimes:[],values:[]};for(let e=0;e<t.gameHistory.length;e++){const i=Lt(e,h),a=(90-t.gameHistory[e].cannon.angleDeg).toFixed(1);zt(d,i,`${a} ${n} ${o}`)}const f=Vt(d),x=22,p=Number(n),v=Number(o),b=v-x,C={keyTimes:[],values:[]};for(let e=0;e<t.gameHistory.length;e++){const n=Lt(e,h),o=t.gameHistory[e].currentBubbleColorIndex;zt(C,n,null!==(i=Ut[o])&&void 0!==i?i:Ut[0])}const w=Vt(C);y+=`<circle cx="${n}" cy="${o}" r="10" fill="${null!==(s=Ut[null!==(r=null===(a=t.gameHistory[0])||void 0===a?void 0:a.currentBubbleColorIndex)&&void 0!==r?r:0])&&void 0!==s?s:Ut[0]}" stroke="white" stroke-width="2">\n\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${m}" repeatCount="indefinite"\n\t\t\t\tvalues="${w.values}" keyTimes="${w.keyTimes}"/>\n\t\t\t<animateTransform attributeName="transform" type="rotate" calcMode="linear"\n\t\t\t\tdur="${m}" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${f.keyTimes}" values="${f.values}"/>\n\t\t</circle>`,y+=`<line x1="${p}" y1="${v}" x2="${p}" y2="${b}" stroke="#cccccc" stroke-width="6" stroke-linecap="round">\n\t\t\t<animateTransform attributeName="transform" type="rotate" calcMode="linear"\n\t\t\t\tdur="${m}" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${f.keyTimes}" values="${f.values}"/>\n\t\t</line>`;const B={keyTimes:[],values:[]};for(let e=0;e<t.gameHistory.length;e++){const n=Lt(e,h),o=t.gameHistory[e].nextBubbleColorIndex;zt(B,n,null!==(l=Ut[o])&&void 0!==l?l:Ut[0])}const M=Vt(B),E=(Number(n)+28).toFixed(1),k=o,T=null!==(A=Ut[null!==(u=null===(c=t.gameHistory[0])||void 0===c?void 0:c.nextBubbleColorIndex)&&void 0!==u?u:0])&&void 0!==A?A:Ut[0];y+=`<text x="${E}" y="${(Number(o)-16).toFixed(1)}" text-anchor="middle" font-size="8" fill="${g.textColor}" opacity="0.8">NEXT</text>`,y+=`<circle cx="${E}" cy="${k}" r="9" fill="${T}" stroke="white" stroke-width="1" stroke-opacity="0.5">\n\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${m}" repeatCount="indefinite"\n\t\t\t\tvalues="${M.values}" keyTimes="${M.keyTimes}"/>\n\t\t</circle>`}return y+="</svg>",y};const Pt=t=>22*t+10,Yt=t=>22*t+15+10,Gt=t=>Math.round((t-10)/22),Jt=t=>Math.round((t-15-10)/22),Kt=t=>t.grid.some((t=>t.some((t=>t.commitsCount>0)))),Wt=(t,e,o,i)=>{var a,r,s;const l=new Set,c=[],u=[{x:e,y:o}];for(;u.length;){const{x:e,y:o}=u.pop(),d=`${e},${o}`;if(l.has(d))continue;if(e<0||e>=n||o<0||o>=7)continue;const A=null===(a=t.grid[e])||void 0===a?void 0:a[o];A&&0!==A.commitsCount&&(null!==(s=null===(r=t.cellBubbleColors[e])||void 0===r?void 0:r[o])&&void 0!==s?s:-1)===i&&(l.add(d),c.push({x:e,y:o}),u.push({x:e-1,y:o},{x:e+1,y:o},{x:e,y:o-1},{x:e,y:o+1}))}return c},$t=(t,e,o,i)=>{var a,r,s,l;const c=o*Math.PI/180;let u=10*Math.cos(c),d=-10*Math.sin(c),A=t,h=e;for(let t=0;t<2e3;t++){if(A+=u,h+=d,A<9&&(A=9,u=Math.abs(u)),A>1157&&(A=1157,u=-Math.abs(u)),h<0)return null;const t=Gt(A),e=Jt(h);if(!(e<0||e>=7||t<0||t>=n)){for(const[o,s]of[[0,0],[1,0],[-1,0],[0,1],[0,-1]]){const l=t+o,c=e+s;if(!(l<0||l>=n||c<0||c>=7)&&(null===(r=null===(a=i.grid[l])||void 0===a?void 0:a[c])||void 0===r?void 0:r.commitsCount)>0){const t=Pt(l),e=Yt(c);if(Math.hypot(A-t,h-e)<20)return{col:Math.max(0,Math.min(52,Gt(A))),row:Math.max(0,Math.min(6,Jt(h)))}}}if(0===e&&0===(null===(l=null===(s=i.grid[t])||void 0===s?void 0:s[0])||void 0===l?void 0:l.commitsCount))return{col:Math.max(0,Math.min(52,t)),row:0}}}return null},qt=t=>{t.gameHistory.push({cannon:Object.assign({},t.cannon),activeBubble:t.activeBubble?Object.assign({},t.activeBubble):null,nextBubbleColorIndex:t.nextBubbleColorIndex,currentBubbleColorIndex:t.currentBubbleColorIndex})},Xt=t=>{var e,o,i,a,r,s,l;if(t.frameCount++,!t.activeBubble){-1===t.cannonTargetAngle&&(t.cannonTargetAngle=((t,e,o,i)=>{var a,r,s,l,c,u,d,A,h,m,g,f,y,x;const p=1664525*t.nextBubbleId+1013904223>>>0,v=[],b=[],C=[],w=[[-1,0],[1,0],[0,-1],[0,1],[-1,1],[0,1],[1,1],[-1,2],[0,2],[1,2]];for(let e=12;e<=168;e+=2){const o=$t(583,199,e,t);if(!o)continue;if((null!==(s=null===(r=null===(a=t.grid[o.col])||void 0===a?void 0:a[o.row])||void 0===r?void 0:r.commitsCount)&&void 0!==s?s:0)>0)continue;let h=!1,m=!1,g=0;for(const[e,a]of w){const r=o.col+e,s=o.row+a;if(!(r<0||r>=n||s<0||s>=7)&&0!==(null!==(u=null===(c=null===(l=t.grid[r])||void 0===l?void 0:l[s])||void 0===c?void 0:c.commitsCount)&&void 0!==u?u:0)&&(m=!0,(null!==(A=null===(d=t.cellBubbleColors[r])||void 0===d?void 0:d[s])&&void 0!==A?A:-1)===i)){h=!0;const e=Wt(t,r,s,i).length+1;e>g&&(g=e)}}g>=3?v.push({angleDeg:e,score:g}):h?b.push(e):m&&C.push(e)}if(v.length>0){const t=Math.max(...v.map((t=>t.score))),e=v.filter((e=>e.score===t));return e[p%e.length].angleDeg}if(b.length>0)return b[p%b.length];if(C.length>0)return C[p%C.length];let B=90,M=1/0;for(let e=12;e<=168;e+=2){const o=$t(583,199,e,t);if(!o)continue;if((null!==(g=null===(m=null===(h=t.grid[o.col])||void 0===h?void 0:h[o.row])||void 0===m?void 0:m.commitsCount)&&void 0!==g?g:0)>0)continue;const i=Pt(o.col),a=Yt(o.row);let r=1/0;for(let e=0;e<n;e++)for(let n=0;n<7;n++)if((null!==(x=null===(y=null===(f=t.grid[e])||void 0===f?void 0:f[n])||void 0===y?void 0:y.commitsCount)&&void 0!==x?x:0)>0){const t=Math.hypot(i-Pt(e),a-Yt(n));t<r&&(r=t)}r<M&&(M=r,B=e)}return B})(t,0,0,t.nextBubbleColorIndex));const i=t.cannonTargetAngle;t.currentBubbleColorIndex=t.nextBubbleColorIndex;const a=i-t.cannon.angleDeg;if(!(Math.abs(a)<=6))return t.cannon.angleDeg+=6*Math.sign(a),t.cannon.angleDeg=Math.max(10,Math.min(170,t.cannon.angleDeg)),void qt(t);t.cannon.angleDeg=i;const r=t.nextBubbleColorIndex;t.currentBubbleColorIndex=r,t.cannonTargetAngle=-1;const s=new Set;for(let i=0;i<n;i++)for(let n=0;n<7;n++)t.grid[i][n].commitsCount>0&&s.add(null!==(o=null===(e=t.cellBubbleColors[i])||void 0===e?void 0:e[n])&&void 0!==o?o:0);const l=[...s];if(l.length>0){const e=1664525*t.frameCount+1013904223>>>0;t.nextBubbleColorIndex=l[e%l.length]}const c=t.cannon.angleDeg*Math.PI/180;return t.activeBubble={id:t.nextBubbleId++,x:583,y:199,vx:10*Math.cos(c),vy:-10*Math.sin(c),colorIndex:r,active:!0},void qt(t)}const c=t.activeBubble;if(c.x+=c.vx,c.y+=c.vy,c.x<9&&(c.x=9,c.vx=Math.abs(c.vx)),c.x>1157&&(c.x=1157,c.vx=-Math.abs(c.vx)),c.y<0||c.y>209)return t.activeBubble=null,t.cannonTargetAngle=-1,void qt(t);let u=!1,A=-1,h=-1;const m=Gt(c.x),g=Jt(c.y);t:for(let e=-1;e<=1;e++)for(let o=-1;o<=1;o++){const l=m+e,d=g+o;if(l<0||l>=n||d<0||d>=7)continue;const f=Pt(l),y=Yt(d);if(Math.hypot(c.x-f,c.y-y)<18){if((null===(a=null===(i=t.grid[l])||void 0===i?void 0:i[d])||void 0===a?void 0:a.commitsCount)>0){if(0===(null===(s=null===(r=t.grid[m])||void 0===r?void 0:r[g])||void 0===s?void 0:s.commitsCount)&&m>=0&&m<n&&g>=0&&g<7)A=m,h=g;else for(const[e,o]of[[0,1],[-1,0],[1,0],[0,-1]]){const i=l+e,a=d+o;if(i>=0&&i<n&&a>=0&&a<7&&0===t.grid[i][a].commitsCount){A=i,h=a;break}}u=!0;break t}if(0===d){A=l,h=0,u=!0;break t}}}if(!u&&g<=0&&m>=0&&m<n&&(A=m,h=0,u=!0),u&&A>=0&&h>=0){A=Math.max(0,Math.min(52,A)),h=Math.max(0,Math.min(6,h));const e=d(t).intensityColors[0],n=null!==(l=Ut[c.colorIndex])&&void 0!==l?l:Ut[0];t.grid[A][h]={commitsCount:1,color:n,level:"FIRST_QUARTILE"},t.cellBubbleColors[A][h]=c.colorIndex,t.cellEvents.push({frameIndex:t.gameHistory.length,x:A,y:h,color:n});const o=Wt(t,A,h,c.colorIndex);if(o.length>=3){const i=n;for(const{x:n,y:i}of o)t.grid[n][i]={commitsCount:0,color:e,level:"NONE"},t.cellBubbleColors[n][i]=-1,t.cellEvents.push({frameIndex:t.gameHistory.length,x:n,y:i,color:e});t.popEvents.push({frameIndex:t.gameHistory.length,cells:o,color:i}),t.config.pointsIncreasedCallback(t.cellEvents.length)}t.activeBubble=null,t.cannonTargetAngle=-1}qt(t)},Zt=t=>{return e=void 0,o=void 0,a=function*(){var e,o,i;t.frameCount=0,t.nextBubbleId=0,t.gameHistory=[],t.cellEvents=[],t.popEvents=[],t.activeBubble=null,t.grid=m(t);const a=d(t).intensityColors[0],r=[];for(let e=0;e<n;e++)for(let n=0;n<7;n++)t.grid[e][n].commitsCount>0&&r.push({x:e,y:n});const s=r.length<=50?2:r.length<=150?3:r.length<=250?4:r.length<=350?5:6;let l=2654435761*r.length>>>0;const c=()=>(l=Math.imul(l,1664525)+1013904223>>>0,l/4294967296);t.cellBubbleColors=Array.from({length:n},(()=>new Array(7).fill(-1)));for(const{x:e,y:n}of r)t.cellBubbleColors[e][n]=Math.floor(c()*s);for(let n=0;n<3;n++){const n=t.cellBubbleColors.map((t=>[...t]));for(const{x:i,y:a}of r){const r=new Array(s).fill(0);let l=0;for(const[t,s]of[[-1,0],[1,0],[0,-1],[0,1],[-1,-1],[1,-1],[-1,1],[1,1]]){const c=null!==(o=null===(e=n[i+t])||void 0===e?void 0:e[a+s])&&void 0!==o?o:-1;c>=0&&(r[c]++,l++)}if(l>0){const e=Math.max(...r);e>=.5*l&&(t.cellBubbleColors[i][a]=r.indexOf(e))}}}for(const{x:e,y:n}of r){const o=t.cellBubbleColors[e][n];t.grid[e][n]=Object.assign(Object.assign({},t.grid[e][n]),{color:Ut[o]})}t.initialColors=t.grid.map((t=>t.map((t=>t.commitsCount>0?t.color:a))));const u=[...new Set(r.map((({x:e,y:n})=>t.cellBubbleColors[e][n])))];if(t.nextBubbleColorIndex=null!==(i=u[Math.floor(c()*u.length)])&&void 0!==i?i:0,!Kt(t)){const e=jt(t);return t.config.svgCallback(e),void t.config.gameOverCallback()}for(t.cannon={angleDeg:90},t.cannonTargetAngle=-1,t.currentBubbleColorIndex=t.nextBubbleColorIndex;Kt(t)&&t.frameCount<5e3;)Xt(t);const A=jt(t);t.config.svgCallback(A),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.cellEvents.length,steps:t.frameCount,ghostsEaten:0}),t.config.gameOverCallback()},new((i=void 0)||(i=Promise))((function(t,n){function r(t){try{l(a.next(t))}catch(t){n(t)}}function s(t){try{l(a.throw(t))}catch(t){n(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(r,s)}l((a=a.apply(e,o||[])).next())}));var e,o,i,a},_t={frameCount:0,nextBubbleId:0,nextBubbleColorIndex:0,currentBubbleColorIndex:0,cannonTargetAngle:-1,contributions:[],cannon:{angleDeg:90},activeBubble:null,grid:[],monthLabels:[],gameHistory:[],initialColors:[],cellBubbleColors:[],cellEvents:[],popEvents:[],config:void 0};class te{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,o=function*(){switch(this.store=JSON.parse(JSON.stringify(_t)),this.store.config=Object.assign(Object.assign({},{platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""}}),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return A(this.store),h(this.store),yield Zt(this.store),this.store},new((n=void 0)||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}));var t,e,n,o}stop(){this.store}}var ee=e.Lc,ne=e.b9,oe=e.Cf,ie=e.rn,ae=e.OJ;export{ee as BreakoutRenderer,ne as GalagaRenderer,oe as PacmanRenderer,ie as PlayerStyle,ae as PuzzleBobbleRenderer};
|
|
1
|
+
var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{Lc:()=>O,b9:()=>K,Cf:()=>Ot,rn:()=>ft,OJ:()=>te});const n=53,o=200,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"]}},a=(t,e)=>Math.floor((e.getTime()-t.getTime())/6048e5),r=t=>new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())),s=t=>{var e;return null!==(e=i[t.config.gameTheme])&&void 0!==e?e:i.github},l=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}},c=(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=r(new Date),n=new Date(e);n.setUTCDate(e.getUTCDate()-365),n.setUTCDate(n.getUTCDate()-n.getUTCDay());const o=Array.from({length:53},(()=>Array.from({length:7},(()=>({commitsCount:0,color:s(t).intensityColors[0],level:"NONE"})))));t.contributions.forEach((i=>{const c=r(new Date(i.date));if(c<n||c>e)return;const u=c.getUTCDay(),d=a(n,c);if(d>=0&&d<53){const e=s(t);o[d][u]={commitsCount:i.count,color:e.intensityColors[l(i.level)],level:i.level}}})),t.grid=o},d=s,A=u,h=t=>{const e=r(new Date),o=new Date(e);o.setUTCDate(e.getUTCDate()-365),o.setUTCDate(o.getUTCDate()-o.getUTCDay());const i=a(o,e)+1,s=Array(i).fill("");let l="";for(let t=0;t<i;t++){const e=new Date(o);e.setUTCDate(e.getUTCDate()+7*t);const n=e.toLocaleString("default",{month:"short"});n!==l&&(s[t]=n,l=n)}t.monthLabels=i>n?s.slice(i-n):s},m=t=>(u(t),t.grid);var g=function(t,e,n,o){return new(n||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}))};const f=t=>g(void 0,void 0,void 0,(function*(){var e;return(null===(e=t.config.githubSettings)||void 0===e?void 0:e.accessToken)?yield(t=>g(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,o=s(t);return{date:new Date(e.date),count:e.contributionCount,color:o.intensityColors[l(n)],level:n}}))})))(t):yield(t=>g(void 0,void 0,void 0,(function*(){var e,n;const o=[];let i=!1,a=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=${a}&per_page=100`,{headers:r}),l=yield s.json();i=!l.items||0===l.items.length,o.push(...null!==(n=l.items)&&void 0!==n?n:[]),a++}catch(t){i=!0}}while(!i);const r=Array.from(o.reduce(((t,e)=>{var n,o,i,a;const r=null===(o=null===(n=e.commit.author)||void 0===n?void 0:n.date)||void 0===o?void 0:o.split("T")[0],s=(null===(a=null===(i=e.commit.committer)||void 0===i?void 0:i.date)||void 0===a?void 0:a.split("T")[0])||r,l=(t.get(s)||{count:0}).count+1;return t.set(s,{date:new Date(s),count:l,color:"",level:"NONE"})}),new Map).values()),u=Math.max(...r.map((t=>t.count)).filter((t=>t>0)));return r.map((e=>{const n=c(e.count,u),o=s(t);return{date:new Date(e.date),count:e.count,color:o.intensityColors[l(n)],level:n}}))})))(t)})),y=t=>{return e=void 0,n=void 0,i=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(),o=Object.entries(n).map((([t,e])=>({date:new Date(t),count:Number(e),color:"",level:"NONE"}))),i=Math.max(...o.map((t=>t.count)).filter((t=>t>0)));return o.map((e=>{const n=c(e.count,i),o=s(t);return{date:new Date(e.date),count:e.count,color:o.intensityColors[l(n)],level:n}}))},new((o=void 0)||(o=Promise))((function(t,a){function r(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(r,s)}l((i=i.apply(e,n||[])).next())}));var e,n,o,i},x=.21,v=7.4,p=t=>22*t,b=t=>22*t+15,C=(t,e,n)=>{var o,i;const a=t.gameHistory.length,r=null!==(i=null===(o=t.initialColors[e])||void 0===o?void 0:o[n])&&void 0!==i?i:"#ebedf0",s=t.brickEvents.filter((t=>t.x===e&&t.y===n));if(0===s.length)return{keyTimes:"0;1",values:`${r};${r}`};const l=[0],c=[r];for(const t of s){const e=Number((t.frameIndex/Math.max(a-1,1)).toFixed(4));e!==l[l.length-1]?(l.push(e),c.push(t.color)):c[c.length-1]=t.color}return 1!==l[l.length-1]&&(l.push(1),c.push(c[c.length-1])),{keyTimes:l.join(";"),values:c.join(";")}},w=(t,e)=>{var n,o,i,a;const r=t.gameHistory.length;if(0===r){const t=null!==(n=e[0])&&void 0!==n?n:"0,0";return{keyTimes:"0;1",values:`${t};${t}`}}const s=[],l=[];let c=null,u=null;return e.forEach(((t,e)=>{t!==c&&(null!==c&&null!==u&&e-1!==u&&(s.push(Number(((e-1)/(r-1)).toFixed(4))),l.push(c)),s.push(Number((e/(r-1)).toFixed(4))),l.push(t),c=t,u=e)})),0!==s.length&&1===s[s.length-1]||(0===s.length?(s.push(0,1),l.push(null!==(o=e[0])&&void 0!==o?o:"0,0",null!==(i=e[e.length-1])&&void 0!==i?i:"0,0")):(s.push(1),l.push(null!==(a=null!=c?c:e[e.length-1])&&void 0!==a?a:"0,0"))),{keyTimes:s.join(";"),values:l.join(";")}},B=t=>{const e=t.gameHistory.length*o/2,i=d(t);let a='<svg width="1166" height="209" xmlns="http://www.w3.org/2000/svg">';a+=`<desc>Generated with breakout-contribution-graph on ${new Date}</desc>`,a+=`<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>`,a+=`<rect width="100%" height="100%" fill="${i.gridBackground}"/>`;let r="";for(let e=0;e<n;e++)t.monthLabels[e]!==r&&(a+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${i.textColor}">${t.monthLabels[e]}</text>`,r=t.monthLabels[e]);for(let o=0;o<n;o++)for(let n=0;n<7;n++){const r=p(o),s=b(n),l=C(t,o,n);a+=`<rect id="c-${o}-${n}" x="${r}" y="${s}" width="20" height="20" rx="3" fill="${i.intensityColors[0]}">\n\t\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${e}ms" repeatCount="indefinite"\n\t\t\t\t\tvalues="${l.values}" keyTimes="${l.keyTimes}"/>\n\t\t\t</rect>`}const s=Math.round(4.62),l=w(t,(t=>t.gameHistory.map((t=>`${p(t.ball.x)},${b(t.ball.y)}`)))(t));a+=`<circle id="ball" cx="0" cy="0" r="${s}" fill="${i.wallColor}" stroke="#aaaaaa" stroke-width="1">\n\t\t<animateTransform attributeName="transform" type="translate"\n\t\t\tcalcMode="linear"\n\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${l.keyTimes}"\n\t\t\tvalues="${l.values}"/>\n\t</circle>`;const c=b(v),u=Math.round(152),A=Math.round(11),h=w(t,(t=>t.gameHistory.map((t=>`${p(t.paddle.x)},0`)))(t));return a+=`<rect id="paddle" x="0" y="${c}" width="${u}" height="${A}" rx="3" fill="${i.wallColor}">\n\t\t<animateTransform attributeName="transform" type="translate"\n\t\t\tcalcMode="linear"\n\t\t\tdur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${h.keyTimes}"\n\t\t\tvalues="${h.values}"/>\n\t</rect>`,a+="</svg>",a};const M=20/22,E=["NONE","FIRST_QUARTILE","SECOND_QUARTILE","THIRD_QUARTILE","FOURTH_QUARTILE"],k=t=>{const e=E.indexOf(t);return E[Math.max(0,e-1)]},T=t=>{var e,o;t.frameCount++;const{ball:i,paddle:a,grid:r}=t,s=Math.hypot(i.dx,i.dy),l=Math.ceil(s/x),c=1/l;for(let s=0;s<l;s++){i.x+=i.dx*c,i.y+=i.dy*c,i.x-x<=0&&(i.x=x,i.dx=Math.abs(i.dx)),i.x+x>=n&&(i.x=52.79,i.dx=-Math.abs(i.dx)),i.y-x<=0&&(i.y=x,i.dy=Math.abs(i.dy));const s=a.x,l=a.x+7;if(i.dy>0&&i.y+x>=v&&i.y-x<7.9&&i.x>=s-x&&i.x<=l+x){i.y=7.19;const e=s+3.5,n=Math.max(-1,Math.min(1,(i.x-e)/3.5)),o=Math.hypot(i.dx,i.dy),a=65*n*(Math.PI/180);i.dx=o*Math.sin(a),i.dy=-o*Math.cos(a),t.bouncesSinceTargetSet++,t.bouncesSinceTargetSet>=5&&(t.targetBrick=S(t),t.bouncesSinceTargetSet=0)}i.y>8.4&&(i.x=26.5,i.y=5.9,i.dy=-Math.abs(i.dy));const u=Math.max(0,Math.floor(i.x-x)),A=Math.min(52,Math.floor(i.x+x)),h=Math.max(0,Math.floor(i.y-x)),m=Math.min(6,Math.floor(i.y+x));let g=!1,f=!1;const y=d(t);for(let n=u;n<=A;n++)for(let a=h;a<=m;a++){if(0===r[n][a].commitsCount)continue;const s=Math.max(n,Math.min(n+M,i.x)),l=Math.max(a,Math.min(a+M,i.y));if(Math.pow(i.x-s,2)+Math.pow(i.y-l,2)>=.04409999999999999)continue;const c=r[n][a].level,u=k(c);if(r[n][a].level=u,"NONE"===u)r[n][a].commitsCount=0,r[n][a].color=y.intensityColors[0],(null===(e=t.targetBrick)||void 0===e?void 0:e.cx)===n&&(null===(o=t.targetBrick)||void 0===o?void 0:o.cy)===a&&(t.targetBrick=S(t),t.bouncesSinceTargetSet=0);else{const t=E.indexOf(u);r[n][a].color=y.intensityColors[t]}t.brickEvents.push({frameIndex:t.gameHistory.length,x:n,y:a,color:r[n][a].color});const d=x-Math.abs(i.x-s),A=x-Math.abs(i.y-l);d<=A?(i.x+=i.dx<0?d:-d,g=!0):(i.y+=i.dy<0?A:-A,f=!0),t.framesSinceLastBrickHit=0,t.config.pointsIncreasedCallback(I(t))}g&&(i.dx=-i.dx),f&&(i.dy=-i.dy)}if(i.dy>0&&t.targetBrick){const e=t.targetBrick,o=(v-i.y)/i.dy;let r=i.x+i.dx*o;r=Math.abs((r%106+106)%106),r>n&&(r=106-r);const s=e.cx+.5,l=e.cy+.5,c=v-l,u=s-r,d=Math.atan2(u,Math.max(c,.5))*(180/Math.PI),A=r-Math.max(-65,Math.min(65,d))/65*3.5,h=Math.max(0,Math.min(46,A-3.5));a.x<h-2?a.x+=2:a.x>h+2?a.x-=2:a.x=h}else if(i.dy>0){const t=a.x+3.5;t<i.x-.5?a.x=Math.min(a.x+2,46):t>i.x+.5&&(a.x=Math.max(a.x-2,0))}R(t)},R=t=>{t.gameHistory.push({ball:Object.assign({},t.ball),paddle:Object.assign({},t.paddle)})},I=t=>{let e=0;return t.grid.forEach((t=>t.forEach((t=>{0===t.commitsCount&&e++})))),e},S=t=>{var e,o;const i=[];for(let a=0;a<n;a++)for(let n=0;n<7;n++)(null===(o=null===(e=t.grid[a])||void 0===e?void 0:e[n])||void 0===o?void 0:o.commitsCount)>0&&i.push({cx:a,cy:n});return 0===i.length?null:i[Math.floor(Math.random()*i.length)]},D=t=>{return e=void 0,n=void 0,i=function*(){if(t.frameCount=0,t.framesSinceLastBrickHit=0,t.gameHistory=[],t.brickEvents=[],t.grid=m(t),t.initialColors=t.grid.map((t=>t.map((t=>t.color)))),0===t.grid.reduce(((t,e)=>t+e.filter((t=>t.commitsCount>0)).length),0)){const e=B(t);return t.config.svgCallback(e),void t.config.gameOverCallback()}for((t=>{t.ball={x:26.5,y:5.9,dx:.75,dy:-.95}})(t),(t=>{t.paddle={x:23,width:7}})(t),t.targetBrick=S(t),t.bouncesSinceTargetSet=0;t.grid.some((t=>t.some((t=>t.commitsCount>0))))&&t.frameCount<3e3;)T(t),t.frameCount%200==0&&t.grid.reduce(((t,e)=>t+e.filter((t=>t.commitsCount>0)).length),0);const e=B(t);t.config.svgCallback(e),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:I(t),steps:t.frameCount,ghostsEaten:0}),t.config.gameOverCallback()},new((o=void 0)||(o=Promise))((function(t,a){function r(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(r,s)}l((i=i.apply(e,n||[])).next())}));var e,n,o,i},N={frameCount:0,contributions:[],ball:{x:0,y:0,dx:0,dy:0},paddle:{x:0,width:7},grid:[],monthLabels:[],framesSinceLastBrickHit:0,targetBrick:null,bouncesSinceTargetSet:0,gameHistory:[],initialColors:[],brickEvents:[],config:void 0};class O{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,o=function*(){switch(this.store=JSON.parse(JSON.stringify(N)),this.store.config=Object.assign(Object.assign({},{platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""}}),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return A(this.store),h(this.store),yield D(this.store),this.store},new((n=void 0)||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}));var t,e,n,o}stop(){this.store}}const U=t=>22*t,H=t=>22*t+15,F=(t,e,n)=>{var o,i;const a=t.gameHistory.length,r=null!==(i=null===(o=t.initialColors[e])||void 0===o?void 0:o[n])&&void 0!==i?i:"#ebedf0",s=t.cellEvents.filter((t=>t.x===e&&t.y===n));if(0===s.length)return{keyTimes:"0;1",values:`${r};${r}`};const l=[0],c=[r];for(const t of s){const e=Number((t.frameIndex/Math.max(a-1,1)).toFixed(4));e!==l[l.length-1]?(l.push(e),c.push(t.color)):c[c.length-1]=t.color}return 1!==l[l.length-1]&&(l.push(1),c.push(c[c.length-1])),{keyTimes:l.join(";"),values:c.join(";")}},z=t=>{const e=t.gameHistory.length,i=Math.max(e*o/2,1e3),a=d(t),r=H(10.5);let s='<svg width="1166" height="259" xmlns="http://www.w3.org/2000/svg">';s+=`<desc>Generated with galaga-contribution-graph on ${new Date}</desc>`,s+='<rect width="100%" height="100%" fill="#000000"/>';{let t=12345;const e=()=>(t=1664525*t+1013904223>>>0,t/4294967295);for(let t=0;t<120;t++){const t=(1166*e()).toFixed(1),n=(.4+1.6*e()).toFixed(1),o=(.3+.7*e()).toFixed(2),i=Math.floor(2500+5500*e());s+=`<circle cx="${t}" cy="0" r="${n}" fill="white" opacity="${o}"><animate attributeName="cy" from="-2" to="261" dur="${i}ms" begin="-${Math.floor(e()*i)}ms" repeatCount="indefinite"/></circle>`}}let l="";for(let e=0;e<n;e++)t.monthLabels[e]!==l&&(s+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="#aaaaaa">${t.monthLabels[e]}</text>`,l=t.monthLabels[e]);const c=a.intensityColors[0];for(let e=0;e<n;e++)for(let n=0;n<7;n++){const o=U(e),a=H(n),r=F(t,e,n);s+=`<rect x="${o}" y="${a}" width="20" height="20" rx="3" fill="transparent">\n\t\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${i}ms" repeatCount="indefinite"\n\t\t\t\t\tvalues="${r.values.split(";").map((t=>t===c?"transparent":t)).join(";")}" keyTimes="${r.keyTimes}"/>\n\t\t\t</rect>`}if(e>=2){const n=(t=>{const e=[],n=new Map;for(let o=0;o<t.gameHistory.length;o++){const i=t.gameHistory[o].bullets.filter((t=>t.active)),a=new Set(i.map((t=>t.id)));for(const[t,i]of n)a.has(t)||(e.push({id:t,x:i.x,startFrame:i.startFrame,endFrame:o-1,yPositions:i.yPositions}),n.delete(t));for(const t of i)n.has(t.id)?n.get(t.id).yPositions.push(t.y):n.set(t.id,{x:t.x,startFrame:o,yPositions:[t.y]})}for(const[o,i]of n)e.push({id:o,x:i.x,startFrame:i.startFrame,endFrame:t.gameHistory.length-1,yPositions:i.yPositions});return e})(t);for(const t of n){const n=U(t.x),o=Number((t.startFrame/(e-1)).toFixed(4)),a=Number((Math.min(t.endFrame+1,e-1)/(e-1)).toFixed(4));let r,l;o<=0&&a>=1?(r="0;1",l="1;1"):o<=0?(r=`0;${a};${a};1`,l="1;1;0;0"):a>=1?(r=`0;${o};${o};1`,l="0;0;1;1"):(r=`0;${o};${o};${a};${a};1`,l="0;0;1;1;0;0");const c=[],u=[],d=H(t.yPositions[0]).toFixed(1),A=H(t.yPositions[t.yPositions.length-1]).toFixed(1);t.startFrame>0&&(c.push(0),u.push(`${n.toFixed(1)},${d}`));for(let o=0;o<t.yPositions.length;o++){const i=t.startFrame+o,a=Number((i/(e-1)).toFixed(4)),r=H(t.yPositions[o]).toFixed(1);0!==c.length&&a===c[c.length-1]||(c.push(a),u.push(`${n.toFixed(1)},${r}`))}1!==c[c.length-1]&&(c.push(1),u.push(`${n.toFixed(1)},${A}`)),s+=`<image x="-5" y="-13" width="10" height="13" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAACACAMAAACMX59YAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAByUExURQAAAP////7+/gBE/wBE/wBE/wBE/wBE/wBE/gBE/gBE/wBE/wBE/gBE/wBE/wBE/gBE/gBE/+cgMfUeJf8AAP8AAP4AAP4AAABE/wBE/hhW/y9m/y9n/yNd/4Sl/73O/7zO//8cHP4cHP8AAP4AAP///6QdcYAAAAAYdFJOUwAAAGbHk4W9hb1genq/3RYcHJPFhb2FvbKPFBsAAAABYktHRAH/Ai3eAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAB3RJTUUH6gUIFjcZmpji7QAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyNi0wNS0wOFQyMjo1NToyNSswMDowMDWlEL0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjYtMDUtMDhUMjI6NTU6MjUrMDA6MDBE+KgBAAAAKHRFWHRkYXRlOnRpbWVzdGFtcAAyMDI2LTA1LTA4VDIyOjU1OjI1KzAwOjAwE+2J3gAAAk5JREFUaN7tVotWwyAMnahzvp2PSXxMZ/P/3+ggECija1N2ZDvuWmm17W1y82IyyeH0LIPzyXBMdQYXR4IjwZFATDAD0NoeYE/mT30pITBfNK/ZNx2TyAX3acvjL4QE2r/HFxIXptGHmUEkIkkXx0CmwczIl6KD4OqaccPnWx8BXtc/d9GDN/Twepmc6S5A7x1z3iCgDKJfoFxI7kEI7nrdYkGfWXQZE3DW5e2HrGM5C0Anj3aoATmCyH8XAr5B/05oxRpsYGcEvQ5vJwiFxzUAkDAlBUrpndWAshg09NsCO9TgPxEIamE8wZ5rMIzg7b2FD7t+CgiWJxl8lRJ8DyFwJbdUJ0rFLysm6AsjFFowVgMYQlBswX4TtLcSYAiUD59qhzEJGGwSmF5r80CFFAgW+JZND3ZO5zINYDgBbBFRjbdAV63GLQSqjwAghJMJXB4os7bL2e9C9iWVewlUN8H9g8OcYC8fVxY/qxhPc3rOH4T8Bvq5CUC/vgh26zEBYxQBugOrWVCNYOEVwKAE1nAB2YYxBBh/HQ8uCvUJFi7+VARIVwfmAqcBhmQWWoB1XdhFGNGFcb0cZBjjrszRLLWgkgbovJB2JJfKXIljUjlSEev0RJuArIF0vC84/AYNLX/sQtRIxoRxj4qpXkfiaeIm/J+HcbEDDSiRMRoQNV3AA8yDcgJM/G+EPdE3VUpFd5INV9+JXFMykLmAfjIjmyK0wLUj5NYkJKBx0sKrWIMEchGxsgVNsQVNCYEfLGEySrd5xSK6LArjdUwtDIrCL/JGvSI+ReIgAAAAAElFTkSuQmCC" opacity="0" preserveAspectRatio="xMidYMid meet">\n\t\t\t\t<animate attributeName="opacity" calcMode="discrete" dur="${i}ms" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${r}" values="${l}"/>\n\t\t\t\t<animateTransform attributeName="transform" type="translate" calcMode="linear"\n\t\t\t\t\tdur="${i}ms" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${c.join(";")}" values="${u.join(";")}"/>\n\t\t\t</image>`}}if(e>=2)for(const n of t.explosionEvents){const t=(U(n.x)+10).toFixed(1),o=(H(n.y)+10).toFixed(1),a=Number((n.frameIndex/(e-1)).toFixed(4)),r=Number((Math.min(n.frameIndex+7,e-1)/(e-1)).toFixed(4));if(r<=a)continue;const l=`0;${a};${a};${r};1`,c="0;0;1;0;0",u=`${i}ms`;s+=`<circle cx="${t}" cy="${o}" r="2" fill="none" stroke="${n.color}" stroke-width="3" opacity="0">\n\t\t\t\t<animate attributeName="r" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="2;2;2;20;20"/>\n\t\t\t\t<animate attributeName="stroke-width" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="3;3;3;0;0"/>\n\t\t\t\t<animate attributeName="opacity" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="${c}"/>\n\t\t\t</circle>`;const d=[{dx:0,dy:-11},{dx:0,dy:11},{dx:-11,dy:0},{dx:11,dy:0}];for(const{dx:e,dy:i}of d){const a=(Number(t)+e).toFixed(1),r=(Number(o)+i).toFixed(1);s+=`<circle cx="${t}" cy="${o}" r="2.5" fill="${n.color}" opacity="0">\n\t\t\t\t\t<animate attributeName="cx" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="${t};${t};${t};${a};${a}"/>\n\t\t\t\t\t<animate attributeName="cy" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="${o};${o};${o};${r};${r}"/>\n\t\t\t\t\t<animate attributeName="r" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="2.5;2.5;2.5;0;0"/>\n\t\t\t\t\t<animate attributeName="opacity" calcMode="linear" dur="${u}" repeatCount="indefinite" keyTimes="${l}" values="${c}"/>\n\t\t\t\t</circle>`}}const u=t.gameHistory.map((t=>`${U(t.ship.x).toFixed(1)},${r.toFixed(1)}`)),A=((t,e)=>{var n,o,i,a;const r=t.gameHistory.length;if(0===r){const t=null!==(n=e[0])&&void 0!==n?n:"0,0";return{keyTimes:"0;1",values:`${t};${t}`}}const s=[],l=[];let c=null,u=null;return e.forEach(((t,e)=>{t!==c&&(null!==c&&null!==u&&e-1!==u&&(s.push(Number(((e-1)/(r-1)).toFixed(4))),l.push(c)),s.push(Number((e/(r-1)).toFixed(4))),l.push(t),c=t,u=e)})),0!==s.length&&1===s[s.length-1]||(0===s.length?(s.push(0,1),l.push(null!==(o=e[0])&&void 0!==o?o:"0,0",null!==(i=e[e.length-1])&&void 0!==i?i:"0,0")):(s.push(1),l.push(null!==(a=null!=c?c:e[e.length-1])&&void 0!==a?a:"0,0"))),{keyTimes:s.join(";"),values:l.join(";")}})(t,u);return s+=`<image x="-16" y="-35" width="32" height="35" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABGCAYAAAB8MJLDAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfqBQgWJQn/24JaAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI2LTA1LTA4VDIyOjM1OjQ2KzAwOjAwKpfJ5AAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNi0wNS0wOFQyMjozNTo0NiswMDowMFvKcVgAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjYtMDUtMDhUMjI6Mzc6MDkrMDA6MDB6KP6pAAANdklEQVR42u2cW6wdVRnH/2vNfc++HYFKe7S0FQEDaEKjlEhaHyRi0xJJrCKpDyZo0EQu8kBTSwhJjSca0fhQNVFiYiMJiQqxtEAoD4fQRHIk1YJFsWAqtJyc0rP3zJ7Zc1uzfNhnrTN7z+zL2WdTovglO/md6VzWrPn+6/vWreCcw/d9nD9/HoIXFxdz7HkeGo1GjlutVhc3m80cu64Lx3Fy7DhOF7uum+Nms4lWq5XjRqPRxZ7n5XhxcRG+7+f4/Pnzkonv+yCEAEDnwPuMaRAEAADDMDCICSHQ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=" preserveAspectRatio="xMidYMid meet">\n\t\t<animateTransform attributeName="transform" type="translate" calcMode="linear"\n\t\t\tdur="${i}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${A.keyTimes}"\n\t\t\tvalues="${A.values}"/>\n\t</image>`,s+="</svg>",s};const V=["NONE","FIRST_QUARTILE","SECOND_QUARTILE","THIRD_QUARTILE","FOURTH_QUARTILE"],L=t=>{const e=V.indexOf(t);return V[Math.max(0,e-1)]},Q=()=>Math.floor(5*Math.random())+4,j=t=>t.grid.some((t=>t.some((t=>t.commitsCount>0)))),Y=(t,e=-1)=>{const o=Math.round(t.ship.x-.5),i=e=>t.grid[e].reduce(((t,e)=>{var n;return t+(null!==(n={NONE:0,FIRST_QUARTILE:1,SECOND_QUARTILE:2,THIRD_QUARTILE:3,FOURTH_QUARTILE:4}[e.level])&&void 0!==n?n:0)}),0);for(let t=3;t<=n;t++){let a=-1,r=0;for(let s=-t;s<=t;s++){const t=o+s;if(t<0||t>=n)continue;if(t===e)continue;const l=i(t);l>r&&(r=l,a=t)}if(-1!==a)return a}for(let o=0;o<n;o++)if(o!==e&&t.grid[o].some((t=>t.commitsCount>0)))return o;return Math.floor(26.5)},P=t=>{var e;t.frameCount++;const{grid:o,ship:i}=t,a=d(t);for(const e of t.bullets){if(!e.active)continue;if(e.y-=.6,e.y<-1){e.active=!1;continue}const i=Math.round(e.x-.5),r=Math.floor(e.y);if(i>=0&&i<n&&r>=0&&r<7&&o[i][r].commitsCount>0){const n=o[i][r].color,s=L(o[i][r].level);o[i][r].level=s,o[i][r].color=a.intensityColors[V.indexOf(s)],"NONE"===s&&(o[i][r].commitsCount=0,t.explosionEvents.push({frameIndex:t.gameHistory.length,x:i,y:r,color:n})),t.cellEvents.push({frameIndex:t.gameHistory.length,x:i,y:r,color:o[i][r].color}),t.config.pointsIncreasedCallback(t.cellEvents.length),e.active=!1}}t.bullets=t.bullets.filter((t=>t.active)),(null===(e=o[t.currentTargetCol])||void 0===e?void 0:e.some((t=>t.commitsCount>0)))||(t.currentTargetCol=Y(t),t.framesShootingAtTarget=0);const r=t.currentTargetCol,s=r+.5,l=s-i.x;Math.abs(l)>.4?i.x+=.4*Math.sign(l):i.x=s,i.x=Math.max(.8,Math.min(52.2,i.x));const c=Math.abs(i.x-s)<.5,u=o[r].some((t=>t.commitsCount>0));c&&u&&(t.framesShootingAtTarget>=t.framesAllowedForTarget?(t.currentTargetCol=Y(t,r),t.framesShootingAtTarget=0,t.framesAllowedForTarget=Q()):(t.frameCount%2==0&&t.bullets.length<10&&t.bullets.push({id:t.nextBulletId++,x:s,y:9.5,active:!0}),t.framesShootingAtTarget++)),(t=>{t.gameHistory.push({ship:{x:t.ship.x},bullets:t.bullets.map((t=>Object.assign({},t)))})})(t)},G=t=>{return e=void 0,n=void 0,i=function*(){if(t.frameCount=0,t.nextBulletId=0,t.gameHistory=[],t.cellEvents=[],t.explosionEvents=[],t.bullets=[],t.grid=m(t),t.initialColors=t.grid.map((t=>t.map((t=>t.color)))),!j(t)){const e=z(t);return t.config.svgCallback(e),void t.config.gameOverCallback()}for(t.ship={x:26.5},t.currentTargetCol=Y(t),t.framesShootingAtTarget=0,t.framesAllowedForTarget=Q();j(t)&&t.frameCount<3e3;)P(t);const e=z(t);t.config.svgCallback(e),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.cellEvents.length,steps:t.frameCount,ghostsEaten:0}),t.config.gameOverCallback()},new((o=void 0)||(o=Promise))((function(t,a){function r(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(r,s)}l((i=i.apply(e,n||[])).next())}));var e,n,o,i},J={frameCount:0,nextBulletId:0,contributions:[],ship:{x:0},bullets:[],grid:[],monthLabels:[],gameHistory:[],initialColors:[],cellEvents:[],explosionEvents:[],currentTargetCol:-1,framesShootingAtTarget:0,framesAllowedForTarget:4,config:void 0};class K{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,o=function*(){switch(this.store=JSON.parse(JSON.stringify(J)),this.store.config=Object.assign(Object.assign({},{platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""}}),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return A(this.store),h(this.store),yield G(this.store),this.store},new((n=void 0)||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}));var t,e,n,o}stop(){this.store}}const W="yellow",$={blinky:{up:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABiklEQVR4nIXSO2sVURQF4G8mMwa8QU2KxFcjCoIgacR/oCBYCP4fsTEIBkWwEK21UAQLIdjYaKEiJIXBXhNBCFaSeDP3zLa4mdyj5rHgwNmPtffZ62z+Q4miKHlWs3yALwUvKYphbC8UjDN3nIUB/SCCSDRnWKiZVxTFrvxp5kMRHbEltaTODuIED3YkT3FnUy+uS815qQkzMSJOxAWpuSo1A72Y4f5f5DFuBpE+vmsmZ9ukF9Eu/xwV+Pw1TEYcOtum9GmxCaLmdl7jeRDp968mcnQFMqS02bSkMV5tS36UBL6t7ixO6o/uK6sKymM0Q9l5NKC/Ldb3lWGrqenRCw73hr61H9viDujjKbztnLnae50uF4sl1nf91/2xvt9q7YuyEwKCNg+2DFoGue/fnHLoGwbyZQ/akqqkykkFZW6XmNy6VJdYyhPP8eE07/PCl1kqqbbMI3BrjY1rvMH4SW4kmou86Eac5UmiOcUcxq/wep2NirugYh4TXfOah6izUauax5leB2vuwR+e2vAshd8i9AAAAABJR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wHTYlmY+SjquslRpJ9ZVAmDKC/wf0K0lQAuFtWddn0a88ZgAwoKKx7MdRnShxdF5hAHIc5t+Q3rp2BoRT2c3oBFX9xUA7hwq8AAAAASUVORK5CYII=",left:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAuUlEQVR4nO2PvRIBQRCEu+fOIaD8RkoRKCGZwNt4fwKFcutnW2LP1tWdF6CjmdmveruBvxgGSSqOJKvgmEnM6CWYxS7hkYSVbuWdABIC9pTkI2cAeHiv3WazDPsiazWeFczDS0buQQLl0CfnrmHOb10LDHkoJxtV1cXZubyohCyyH36tVuji8vvHwJI6DltMhzNM2jqpUJqmaEdMD8YV5h3l0vHNrAf9zrjV/ARQpLrPYmYBZrWpfkwv2KllZq2VZYMAAAAASUVORK5CYII=",right:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAArklEQVR4nO2RsQrCMBCGv0vaUq2gIlJxEBEX6eLi5jv4/g8h0qViIpxT27S0i3M/COTCx5/cBSYAiIxBA8a8IcfEIhiRjmh7tQHi3pkAVnqpIfs4sbX8KIrdmGc6qfJCBETA+XlzZeWc73r1etIJgHXw7KjZV957Btn0A8K+26bf7vMd88izmbnl+UpVtVRVrVSvnJeLICAFkiRu51WqHjlkd05bAC7Gpv9+4wT8AASmiluJhbS5AAAAAElFTkSuQmCC"},scared:{imgDate:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADCklEQVR4nFWSX2hbZRjGf993vnN60qSNXWva6JpR7f5km7qrWrVUXYt2HdOCk2FBoQiDsivxRmU3XggiKIIIuxgOpxeyKsL8A8IoaJVNrMy4Mant2qZbMxKX5k/TmJ6cfJ8Xyao+8PK8F89z8bzPK7gDIcHo+t42GGbwmzk8vwJCIi2HH4d7KfxcAgFCbGkFANIB7cH2l3exc+IVCHfRtn8Mzb/IJ6YQpSxzp94h9enSHY9CyLq5Z3If8ddO0xrrpwr4/B/tDz2PDbj37EW5x1k5PYeQSIyBHcfjxN84QzDWz0a1jNY+1n/MFqC1z0a1TKhnkH0nP2L7xE6MQSAkPH7lPJG9R6j4FXzlstkwBQADlBscAKiWabGbWZ39hJm+lxRGg59PgdFUpdrWDf1xWCvBpV8AG548CIEAXEiAl5aKmtF42RsYgyK4x8EKtSOFZMPo8SfggxfqJ7CPgAjA9Ov1JIffh2/PC0lYSJy2KKHdjmLw0gJN4W48o1FS3S7UxVfSdTYa0lXotKFQAiyp8IxmW98EAz88LBgtpnBaovU6G9kdoAZ4jaKdBnuAbgxAJTuvMEajgHXts1nzcJWLKyQ1YN2vANCqXCRQ1j5ezaNJKlosB6NrEltIbsKJ5zLXrp8rrr44ml1gyWiaSunfPs4tz54p3MAq32bZ6MljxdXr59ZvTR7NJ0kBtrQEQ7nlN09IVS7mkn/mOnp778olH3nw7t1/ZQs3f5q3bNuynIE4tIbc8MU/iqnFW8GOAztKmU3jht869XdOIYRMZyuFzy/H+jO/Ctl1wN+MdRZTiRU7cPbLth4UNDnF1T1dpczZ75vbM4lgZPaxYGSkN30VI6TgUH4FK9xNevpd2iL307J/jIzRmHySyldvo4HmZ08iWu8lIiTFxBS57ArRg6/ip6/C4VKapy9/Rug+m8gzXYzOX2DcGIYSU1uvPHTta8aN4dDcd3Q81U5wl8PI718wkl2A4eRFQg+4W+LosRhH1xZ5dPo9hAJhw8DMh4ytLdI5Ft3ShfuCDC/N/AMdtzXsl7IlxgAAAABJRU5ErkJggg=="}},X={horizontal:Array(54).fill(null).map((()=>Array(8).fill({active:!1,id:""}))),vertical:Array(54).fill(null).map((()=>Array(8).fill({active:!1,id:""})))},q=(t,e,n,o,i)=>{"horizontal"===n?t>=0&&t<X.horizontal.length&&e>=0&&e<X.horizontal[0].length&&(X.horizontal[t][e]={active:!0,id:o,color:i}):t>=0&&t<X.vertical.length&&e>=0&&e<X.vertical[0].length&&(X.vertical[t][e]={active:!0,id:o,color:i})},Z=(t,e)=>[[-1,0],[1,0],[0,-1],[0,1]].filter((([o,i])=>{const a=t+o,r=e+i;return!(a<0||a>=n||r<0||r>=7||(-1===o?X.vertical[t][e].active:1===o?X.vertical[t+1][e].active:-1===i?X.horizontal[t][e].active:1===i&&X.horizontal[t][e+1].active))})),_={getValidMoves:Z,calculateDistance:(t,e,n,o)=>Math.sqrt(Math.pow(n-t,2)+Math.pow(o-e,2)),findNextStepDijkstra(t,e){if(t.x===e.x&&t.y===e.y)return null;const n=[Object.assign(Object.assign({},t),{cost:0,path:[]})],o=new Set([`${t.x},${t.y}`]);for(;n.length;){n.sort(((t,e)=>t.cost-e.cost));const{x:t,y:i,cost:a,path:r}=n.shift();for(const[s,l]of Z(t,i)){const c=t+s,u=i+l,d=`${c},${u}`;if(o.has(d))continue;o.add(d);const A=[...r,{x:c,y:u}];if(c===e.x&&u===e.y)return A.length>0?A[0]:null;n.push({x:c,y:u,cost:a+1,path:A})}}return null}},tt={blinky:{x:50,y:0},pinky:{x:0,y:0},inky:{x:50,y:6},clyde:{x:0,y:6}};let et="scatter",nt=0,ot=0;const it=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"}},at=(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")},rt=(t,e)=>{const n=tt[t.name]||tt.blinky;t.target=n;const o=dt(t.x,t.y,n.x,n.y,t.direction);o&&(t.x=o.x,t.y=o.y,o.direction&&(t.direction=o.direction))},st=(t,e)=>{var n,o,i,a,r,s,l,c;const u=.5,d=null!==(n=t.subX)&&void 0!==n?n:0,A=null!==(o=t.subY)&&void 0!==o?o:0;if(0!==d||0!==A){const n=d>0?1:d<0?-1:0,o=A>0?1:A<0?-1:0;return t.subX=d+n*u,t.subY=A+o*u,(null!==(i=t.subX)&&void 0!==i?i:0)>=1?(t.x+=1,t.subX=0):(null!==(a=t.subX)&&void 0!==a?a:0)<=-1&&(t.x-=1,t.subX=0),(null!==(r=t.subY)&&void 0!==r?r:0)>=1?(t.y+=1,t.subY=0):(null!==(s=t.subY)&&void 0!==s?s:0)<=-1&&(t.y-=1,t.subY=0),void(0===(null!==(l=t.subX)&&void 0!==l?l:0)&&0===(null!==(c=t.subY)&&void 0!==c?c:0)&&0===e.pacman.powerupRemainingDuration&&(t.scared=!1))}if(0===e.pacman.powerupRemainingDuration)return void(t.scared=!1);(!t.target||t.x===t.target.x&&t.y===t.target.y)&&(t.target=mt(t.x,t.y));const h=lt(t);if(0===h.length)return;const m=t.target.x-t.x,g=t.target.y-t.y;let f=h;if(Math.random()<.5);else{const t=h.filter((t=>{const e=t[0],n=t[1];return m>0&&e>0||m<0&&e<0||g>0&&n>0||g<0&&n<0}));t.length>0&&(f=t)}const[y,x]=f[Math.floor(Math.random()*f.length)];y>0?t.direction="right":y<0?t.direction="left":x>0?t.direction="down":x<0&&(t.direction="up"),t.subX=y*u,t.subY=x*u},lt=t=>_.getValidMoves(t.x,t.y).filter((e=>{const[n,o]=e;return!("right"===t.direction&&n<0||"left"===t.direction&&n>0||"up"===t.direction&&o>0||"down"===t.direction&&o<0)})),ct=(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 o=_.findNextStepDijkstra({x:t.x,y:t.y},n);if(o){const e=o.x-t.x,n=o.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=o.x,t.y=o.y}else{const e=dt(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))}},ut=(t,e)=>{if("eyes"===t.name)return void ct(t);const n=At(t,e);t.target=n;const o=dt(t.x,t.y,n.x,n.y,t.direction);o&&(t.x=o.x,t.y=o.y,o.direction&&(t.direction=o.direction))},dt=(t,e,n,o,i)=>{if(t===n&&e===o)return null;const a=[{x:t,y:e,path:[],direction:i||"right"}],r=new Set;for(r.add(`${t},${e}`);a.length>0;){const t=a.shift(),{x:e,y:i,path:s,direction:l}=t,c=_.getValidMoves(e,i),u=c.filter((t=>{const[e,n]=t;return!l||!("right"===l&&e<0||"left"===l&&e>0||"up"===l&&n>0||"down"===l&&n<0)||1===c.length}));for(const[t,c]of u){const u=e+t,d=i+c,A=`${u},${d}`;if(r.has(A))continue;let h;r.add(A),h=t>0?"right":t<0?"left":c>0?"down":c<0?"up":l;const m=[...s,{x:u,y:d,pathDirection:h}];if(u===n&&d===o)return m.length>0?{x:m[0].x,y:m[0].y,direction:m[0].pathDirection}:null;a.push({x:u,y:d,path:m,direction:h})}}const s=_.getValidMoves(t,e);if(s.length>0){const[n,o]=s[Math.floor(Math.random()*s.length)];let a=i;return n>0?a="right":n<0?a="left":o>0?a="down":o<0&&(a="up"),{x:t+n,y:e+o,direction:a}}return null},At=(t,e)=>{const{pacman:n}=e;let o=ht(e),i=1;if("blinky"===t.name){const t=371,e=(t-ot)/t;if(e>.7&&(i=1.2),e>.9&&(i=1.4),Math.random()<.8*i)return{x:n.x,y:n.y}}switch(t.name){case"blinky":default:return{x:n.x,y:n.y};case"pinky":const i=4;let a=n.x,r=n.y;return"up"===n.direction?(a=n.x-4,r=n.y-4):(a=n.x+o[0]*i,r=n.y+o[1]*i),a=Math.min(Math.max(a,0),52),r=Math.min(Math.max(r,0),6),{x:a,y:r};case"inky":const s=e.ghosts.find((t=>"blinky"===t.name));let l={x:n.x+2*o[0],y:n.y+2*o[1]};if("up"===n.direction&&(l.x=n.x-2,l.y=n.y-2),s){const t=l.x-s.x,e=l.y-s.y;l={x:l.x+t,y:l.y+e}}return l.x=Math.min(Math.max(l.x,0),52),l.y=Math.min(Math.max(l.y,0),6),l;case"clyde":return _.calculateDistance(t.x,t.y,n.x,n.y)<8?tt.clyde:{x:n.x,y:n.y}}},ht=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]}},mt=(t,e)=>{const n=t+Math.floor(17*Math.random())-8,o=e+Math.floor(17*Math.random())-8;return{x:Math.max(0,Math.min(n,52)),y:Math.max(0,Math.min(o,6))}},gt=t=>{ot=(t=>{let e=0;for(let o=0;o<n;o++)for(let n=0;n<7;n++)"NONE"!==t.grid[o][n].level&&e++;return e})(t),(t=>{t.pacman.powerupRemainingDuration>0||(nt++,nt>=5*("scatter"===et?7:20)&&(et="scatter"===et?"chase":"scatter",nt=0,t.ghosts.forEach((t=>{t.inHouse||"eyes"===t.name||t.scared||it(t)}))))})(t);for(const e of t.ghosts)e.inHouse?at(e,t):("eyes"===e.name&&(e.scared=!1),e.scared?st(e,t):"eyes"===e.name?ct(e):"scatter"===et?rt(e):ut(e,t))};var ft;!function(t){t.CONSERVATIVE="conservative",t.AGGRESSIVE="aggressive",t.OPPORTUNISTIC="opportunistic"}(ft||(ft={}));const yt=t=>{const e=[];for(let o=0;o<n;o++)for(let n=0;n<7;n++){const i=t.grid[o][n];if("NONE"!==i.level){const a=_.calculateDistance(o,n,t.pacman.x,t.pacman.y),r=i.commitsCount/(a+1);e.push({x:o,y:n,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]},xt=t=>{const e=new Map,o=!!t.pacman.powerupRemainingDuration;if(t.ghosts.forEach((t=>{if(!t.scared)for(let o=-5;o<=5;o++)for(let i=-5;i<=5;i++){const a=t.x+o,r=t.y+i;if(a>=0&&a<n&&r>=0&&r<7){const t=`${a},${r}`,n=15-(Math.abs(o)+Math.abs(i));if(n>0){const o=e.get(t)||0;e.set(t,Math.max(o,n))}}}})),o)for(const[t,n]of e.entries())e.set(t,n/5);return e},vt=(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 o=e.x-t.pacman.x,i=e.y-t.pacman.y;t.pacman.direction=o>0?"right":o<0?"left":i>0?"down":i<0?"up":t.pacman.direction,t.pacman.x=e.x,t.pacman.y=e.y},pt=t=>{t.pacman.powerupRemainingDuration=15,t.ghosts.forEach((t=>{"eyes"!==t.name&&(t.scared=!0)}))},bt=t=>{if(t.pacman.deadRemainingDuration)return;const e=!!t.pacman.powerupRemainingDuration,n=t.ghosts.filter((t=>t.scared));let o;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 o=_.calculateDistance(n.x,n.y,t.pacman.x,t.pacman.y);return o<e.distance?{x:n.x,y:n.y,distance:o}:e}),{x:t.pacman.x,y:t.pacman.y,distance:1/0})})(t);o=null!=e?e:yt(t)}else t.pacman.target?t.pacman.x===t.pacman.target.x&&t.pacman.y===t.pacman.target.y?(o=yt(t),t.pacman.target=o):o=t.pacman.target:(o=yt(t),t.pacman.target=o);o||(o={x:t.pacman.x,y:t.pacman.y});const i=((t,e)=>{var n;const o=[{x:t.pacman.x,y:t.pacman.y,path:[],score:0}],i=new Set([`${t.pacman.x},${t.pacman.y}`]),a=xt(t);let r=.5,s=.5;switch(t.config.playerStyle){case ft.CONSERVATIVE:r=3,s=.1;break;case ft.AGGRESSIVE:r=.3,s=2;break;case ft.OPPORTUNISTIC:default:r=.8,s=.8}let l=1/0;t.ghosts.forEach((e=>{if(!e.scared){const n=_.calculateDistance(t.pacman.x,t.pacman.y,e.x,e.y);l=Math.min(l,n)}}));const c=t.config.playerStyle===ft.CONSERVATIVE?5:7,u=l<c;for(t.config.playerStyle===ft.CONSERVATIVE&&u&&(r*=5);o.length>0;){o.sort(((t,e)=>e.score-t.score));const l=o.shift(),{x:c,y:u,path:d}=l;if(c===e.x&&u===e.y){if(d.length>0){let e=0,n=0;return d.forEach((o=>{const i=`${o.x},${o.y}`,l=a.get(i)||0,c=t.grid[o.x][o.y].commitsCount;e-=l*r,n+=c*s})),d[0]}return null}for(const[l,A]of _.getValidMoves(c,u)){const h=c+l,m=u+A,g=`${h},${m}`;if(!i.has(g)){const l=[...d,{x:h,y:m}],c=a.get(g)||0,u=t.grid[h][m].commitsCount,A=_.calculateDistance(h,m,e.x,e.y),f=(null===(n=t.pacman.recentPositions)||void 0===n?void 0:n.includes(g))?100:0;let y,x,v;t.config.playerStyle===ft.CONSERVATIVE?(y=(15-c)*r,c>=5?y-=100:y+=50,x=u*s,v=5*y+x+-A/10-f):(y=(15-c)*r,x=u*s,v=y+x+-A/10-f),o.push({x:h,y:m,path:l,score:v}),i.add(g)}}}return null})(t,o);i?vt(t,i):(t=>{const e=_.getValidMoves(t.pacman.x,t.pacman.y);if(0===e.length)return;const n=e.reduce(((e,[n,o])=>{const i=t.pacman.x+n,a=t.pacman.y+o;let r=1/0;return t.ghosts.forEach((t=>{if(!t.scared){const e=_.calculateDistance(t.x,t.y,i,a);r=Math.min(r,e)}})),r>e.distance?{dx:n,dy:o,distance:r}:e}),{dx:0,dy:0,distance:-1/0});vt(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=d(t);"FOURTH_QUARTILE"===e.level&&pt(t),e.level="NONE",e.color=n.intensityColors[0],e.commitsCount=0}})(t)}catch(t){console.error("Error in movePacman:",t)}},Ct=t=>{const e=10,n=t,o=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(o)},${e+e*Math.sin(o)}\n Z`},wt=(t,e,n)=>t.gameHistory.map((t=>t.grid[e][n].color)),Bt=(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 o=[],i=[],a=null,r=null;return e.forEach(((t,e)=>{t!==a&&(null!==a&&null!==r&&e-1!==r&&(o.push(Number(((e-1/40)/(n-1)).toFixed(4))),i.push(a)),o.push(Number((e/(n-1)).toFixed(4))),i.push(t),a=t,r=e)})),0!==o.length&&1===o[o.length-1]||(0===o.length?(o.push(0,1),i.push(e[0]||"#000",e[e.length-1]||"#000")):(o.push(1),i.push(a||e[e.length-1]||"#000"))),{keyTimes:o.join(";"),values:i.join(";")}},Mt=t=>{const e=t.gameHistory.length*o;let i='<svg width="1166" height="184" xmlns="http://www.w3.org/2000/svg">';i+=`<desc>Generated with pacman-contribution-graph on ${new Date}</desc>`,i+=`<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>`,i+=`<rect width="100%" height="100%" fill="${d(t).gridBackground}"/>`,i+=(()=>{let t="<defs>";return["blinky","inky","pinky","clyde"].forEach((e=>{["up","down","left","right"].forEach((n=>{const o=$[e];n in o&&(t+=`\n <symbol id="ghost-${e}-${n}" viewBox="0 0 20 20">\n <image href="${o[n]}" width="20" height="20"/>\n </symbol>\n `)}))})),t+=`\n <symbol id="ghost-scared" viewBox="0 0 20 20">\n <image href="${$.scared.imgDate}" width="20" height="20"/>\n </symbol>`,["up","down","left","right"].forEach((e=>{$.eyes&&e in $.eyes?t+=`\n <symbol id="ghost-eyes-${e}" viewBox="0 0 20 20">\n <image href="${$.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 a="";for(let e=0;e<n;e++)t.monthLabels[e]!==a&&(i+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${d(t).textColor}">${t.monthLabels[e]}</text>`,a=t.monthLabels[e]);for(let o=0;o<n;o++)for(let n=0;n<7;n++){const a=22*o,r=22*n+15,s=Bt(t,wt(t,o,n));i+=`<rect id="c-${o}-${n}" x="${a}" y="${r}" width="20" height="20" rx="5" fill="${d(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<7;e++){let o=null;for(let a=0;a<=n;a++){let r=a<n&&X.horizontal[a][e].active;r&&null===o&&(o=a),r&&a!==n||null===o||(i+=`<rect id="wh-${o}-${e}" x="${22*o-2}" y="${22*e-2+15}" width="${22*(a-o)}" height="2" fill="${d(t).wallColor}"></rect>`,o=null)}}for(let e=0;e<n;e++){let n=null;for(let o=0;o<=7;o++){let a=o<7&&X.vertical[e][o].active;a&&null===n&&(n=o),a&&7!==o||null===n||(i+=`<rect id="wv-${e}-${n}" x="${22*e-2}" y="${22*n-2+15}" width="2" height="${22*(o-n)}" fill="${d(t).wallColor}"></rect>`,n=null)}}const r=Bt(t,t.gameHistory.map((t=>{return(e=t.pacman).deadRemainingDuration?"#80808064":e.powerupRemainingDuration?"red":W;var e}))),s=Bt(t,(t=>t.gameHistory.map((t=>`${22*t.pacman.x},${22*t.pacman.y+15}`)))(t)),l=Bt(t,(t=>t.gameHistory.map(((e,n)=>{const o=Math.min(n+1,t.gameHistory.length-1);return(t=>{switch(t){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.gameHistory[o].pacman.direction)})))(t));return i+=`<path id="pacman" d="${Ct(.55)}" fill="${W}">\n\t\t<animate attributeName="fill" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${r.keyTimes}"\n\t\t\tvalues="${r.values}"/>\n\t\t<animateTransform attributeName="transform" type="translate" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${s.keyTimes}"\n\t\t\tvalues="${s.values}"\n\t\t\tadditive="sum"/>\n\t\t<animateTransform attributeName="transform" type="rotate" dur="${e}ms" repeatCount="indefinite"\n\t\t\tkeyTimes="${l.keyTimes}"\n\t\t\tvalues="${l.values}"\n\t\t\tcalcMode="discrete"\n\t\t\tadditive="sum"/>\n\t\t<animate attributeName="d" dur="0.5s" repeatCount="indefinite"\n\t\t\tvalues="${Ct(.55)};${Ct(.05)};${Ct(.55)}"/>\n\t</path>`,t.ghosts.forEach(((n,o)=>{const a=Bt(t,((t,e)=>t.gameHistory.map((t=>{var n,o;if(e>=t.ghosts.length)return"0,0";const i=t.ghosts[e];return`${22*(i.x+(null!==(n=i.subX)&&void 0!==n?n:0))},${22*(i.y+(null!==(o=i.subY)&&void 0!==o?o:0))+15}`})))(t,o));i+=`<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="${a.keyTimes}"\n\t\t\t\tvalues="${a.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 o=t.ghosts[e];if(!o)return n;const i=o.scared?"scared":"eyes"===o.name?`eyes-${o.direction||"right"}`:`${o.name}-${o.direction||"right"}`;n[i]=[{time:0,visible:!0}];let a=i;return t.gameHistory.forEach(((o,i)=>{if(e>=o.ghosts.length)return;const r=o.ghosts[e],s=i/(t.gameHistory.length-1),l=r.scared?"scared":"eyes"===r.name?`eyes-${r.direction||"right"}`:`${r.name}-${r.direction||"right"}`;l!==a&&(n[a].push({time:s,visible:!1}),n[l]||(n[l]=[{time:0,visible:!1}]),n[l].push({time:s,visible:!0}),a=l)})),n[a].push({time:1,visible:!0}),Object.keys(n).forEach((t=>{t!==a&&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,n]of Object.entries(r)){if(0===n.length)continue;const o=`#ghost-${t}`,a=n.map((t=>t.time.toFixed(4))).join(";"),r=n.map((t=>t.visible?"visible":"hidden")).join(";"),s=n[0].visible?"visible":"hidden";i+=`<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="${a}"\n\t\t\t\t\tvalues="${r}" />\n\t\t\t</use>`}i+="</g>"})),i+="</svg>",i};var Et=function(t,e,n,o){return new(n||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}))};const kt=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"))}))},Tt=t=>Et(void 0,void 0,void 0,(function*(){var e,n;if(t.frameCount++,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),kt(t))),t.pacman.powerupRemainingDuration>0&&(t.pacman.powerupRemainingDuration--,0===t.pacman.powerupRemainingDuration&&(t.ghosts.forEach((t=>{var e,n;"eyes"!==t.name&&0===(null!==(e=t.subX)&&void 0!==e?e:0)&&0===(null!==(n=t.subY)&&void 0!==n?n:0)&&(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&&St(t,e.name))})),!t.grid.some((t=>t.some((t=>t.commitsCount>0))))){const n=Mt(t);return t.config.svgCallback(n),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.pacman.totalPoints,steps:t.aliveSteps,ghostsEaten:null!==(e=t.pacman.ghostsEaten)&&void 0!==e?e:0}),void t.config.gameOverCallback()}bt(t),It(t),0===t.pacman.deadRemainingDuration&&(gt(t),It(t)),t.pacmanMouthOpen=!t.pacmanMouthOpen,0===t.pacman.deadRemainingDuration&&t.aliveSteps++,t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.pacman.totalPoints,steps:t.aliveSteps,ghostsEaten:null!==(n=t.pacman.ghostsEaten)&&void 0!==n?n:0}),Rt(t)})),Rt=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)))))})},It=t=>{t.pacman.deadRemainingDuration||t.ghosts.forEach((e=>{var n;"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},e.subX=0,e.subY=0,t.pacman.points+=10,t.pacman.ghostsEaten=(null!==(n=t.pacman.ghostsEaten)&&void 0!==n?n:0)+1):(t.pacman.points=0,t.pacman.powerupRemainingDuration=0,0===t.pacman.deadRemainingDuration&&(t.pacman.deadRemainingDuration=10)))}))},St=(t,e)=>{const n=t.ghosts.find((t=>t.name===e&&t.inHouse));n&&(n.justReleasedFromHouse=!0,n.y=2,n.direction="up")},Dt={frameCount:0,aliveSteps:0,contributions:[],pacman:{x:0,y:0,direction:"right",points:0,totalPoints:0,deadRemainingDuration:0,powerupRemainingDuration:0,recentPositions:[],ghostsEaten:0},ghosts:[],grid:[],monthLabels:[],pacmanMouthOpen:!0,gameInterval:0,gameHistory:[],config:void 0,useGithubThemeColor:!0},Nt=(t,e,o,i,a)=>{"horizontal"==o?(q(t,e,"horizontal",a),"x"==i?q(n-t-1,e,"horizontal",a):"y"==i?q(t,7-e,"horizontal",a):"xy"==i&&(q(n-t-1,e,"horizontal",a),q(t,7-e,"horizontal",a),q(n-t-1,7-e,"horizontal",a))):(q(t,e,"vertical",a),"x"==i?q(n-t,e,"vertical",a):"y"==i?q(t,7-e-1,"vertical",a):"xy"==i&&(q(n-t,e,"vertical",a),q(t,7-e-1,"vertical",a),q(n-t,7-e-1,"vertical",a)))};class Ot{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,o=function*(){const t={platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""},playerStyle:ft.OPPORTUNISTIC};switch(this.store=JSON.parse(JSON.stringify(Dt)),this.store.config=Object.assign(Object.assign({},t),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return Nt(0,2,"horizontal","xy","L1"),Nt(1,2,"horizontal","xy","L1"),Nt(4,1,"vertical","x","L2"),Nt(4,2,"vertical","x","L2"),Nt(4,3,"vertical","x","L2"),Nt(4,4,"vertical","x","L2"),Nt(3,3,"horizontal","x","L3"),Nt(2,3,"horizontal","x","L3"),Nt(4,5,"horizontal","x","L4"),Nt(6,4,"vertical","x","L5"),Nt(6,3,"vertical","x","L5"),Nt(6,2,"vertical","x","L5"),Nt(6,2,"horizontal","x","L6"),Nt(7,2,"horizontal","x","L6"),Nt(8,2,"horizontal","x","L6"),Nt(9,2,"horizontal","x","L6"),Nt(13,2,"horizontal","xy","L7"),Nt(14,2,"horizontal","xy","L7"),Nt(15,2,"horizontal","xy","L7"),Nt(16,2,"horizontal","xy","L7"),Nt(17,2,"horizontal","xy","L7"),Nt(18,2,"horizontal","xy","L7"),Nt(16,2,"vertical","xy","L8"),Nt(8,1,"horizontal","x","L9"),Nt(9,1,"horizontal","x","L9"),Nt(10,1,"horizontal","x","L9"),Nt(11,1,"horizontal","x","L9"),Nt(12,1,"vertical","x","L10"),Nt(12,3,"vertical","x","L10"),Nt(11,4,"horizontal","x","L11"),Nt(10,4,"horizontal","x","L11"),Nt(9,4,"horizontal","x","L11"),Nt(8,4,"horizontal","x","L11"),Nt(8,4,"vertical","x","L12"),Nt(8,5,"vertical","x","L12"),Nt(23,1,"horizontal","x","L18"),Nt(22,1,"horizontal","x","L18"),Nt(21,1,"horizontal","x","L18"),Nt(21,1,"vertical","x","L18"),Nt(21,2,"vertical","x","L18"),Nt(21,3,"vertical","x","L18"),Nt(20,4,"horizontal","x","L18"),Nt(19,4,"horizontal","x","L18"),Nt(19,3,"vertical","x","L18"),Nt(18,3,"horizontal","x","L18"),Nt(22,5,"vertical","x","L19"),Nt(21,5,"horizontal","x","L19"),Nt(20,5,"horizontal","x","L19"),Nt(20,5,"vertical","x","L19"),Nt(1,6,"horizontal","x","L20"),Nt(2,6,"horizontal","x","L20"),Nt(3,4,"vertical","x","L20"),Nt(5,6,"horizontal","x","L21"),Nt(6,6,"horizontal","x","L21"),q(25,2,"horizontal","GH_TOP"),q(27,2,"horizontal","GH_TOP"),q(25,4,"horizontal","GH_BOTTOM"),q(26,4,"horizontal","GH_BOTTOM"),q(27,4,"horizontal","GH_BOTTOM"),q(25,3,"vertical","GH_LEFT"),q(28,3,"vertical","GH_RIGHT"),q(25,2,"vertical","GH_LEFT"),q(28,2,"vertical","GH_RIGHT"),A(this.store),h(this.store),yield(e=this.store,Et(void 0,void 0,void 0,(function*(){e.frameCount=0,e.aliveSteps=0,e.gameHistory=[],e.ghosts.forEach((t=>t.scared=!1)),e.grid=m(e);const t=()=>e.grid.some((t=>t.some((t=>t.commitsCount>0))));for(t()&&((t=>{t.pacman={x:0,y:0,direction:"right",points:0,totalPoints:0,deadRemainingDuration:0,powerupRemainingDuration:0,recentPositions:[],ghostsEaten:0}})(e),kt(e));t();)yield Tt(e);yield Tt(e)}))),this.store;var e},new((n=void 0)||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}));var t,e,n,o}stop(){var t;t=this.store,Et(void 0,void 0,void 0,(function*(){clearInterval(t.gameInterval)}))}}const Ut=["#e74c3c","#f1c40f","#2ecc71","#3498db","#9b59b6","#e67e22"],Ht=t=>22*t+10,Ft=t=>22*t+15+10,zt=(t,e,n)=>{0===t.keyTimes.length||e!==t.keyTimes[t.keyTimes.length-1]?(t.keyTimes.push(e),t.values.push(n)):t.values[t.values.length-1]=n},Vt=t=>(1!==t.keyTimes[t.keyTimes.length-1]&&(t.keyTimes.push(1),t.values.push(t.values[t.values.length-1])),{keyTimes:t.keyTimes.join(";"),values:t.values.join(";")}),Lt=(t,e)=>Number((t/Math.max(e-1,1)).toFixed(4)),Qt=(t,e,n,o)=>{var i,a;const r=t.gameHistory.length,s=null!==(a=null===(i=t.initialColors[e])||void 0===i?void 0:i[n])&&void 0!==a?a:o,l=t.cellEvents.filter((t=>t.x===e&&t.y===n));if(0===l.length)return{keyTimes:"0;1",values:`${s};${s}`};const c={keyTimes:[0],values:[s]};for(const t of l){const e=Lt(t.frameIndex,r);zt(c,e,t.color)}return Vt(c)},jt=t=>{var e,i,a,r,s,l,c,u,A;const h=t.gameHistory.length,m=`${Math.max(h*o/6,1e3)}ms`,g=d(t),f=g.intensityColors[0];let y='<svg width="1166" height="249" xmlns="http://www.w3.org/2000/svg">';y+=`<desc>Generated with puzzle-bobble-contribution-graph on ${new Date}</desc>`,y+=`<rect width="100%" height="100%" fill="${g.gridBackground}"/>`;let x="";for(let e=0;e<n;e++)t.monthLabels[e]!==x&&(y+=`<text x="${22*e+10}" y="10" text-anchor="middle" font-size="10" fill="${g.textColor}">${t.monthLabels[e]}</text>`,x=t.monthLabels[e]);for(let e=0;e<n;e++)for(let n=0;n<7;n++){const o=Ht(e),i=Ft(n),a=Qt(t,e,n,f);y+=`<circle cx="${o}" cy="${i}" r="9" fill="${f}">\n\t\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${m}" repeatCount="indefinite"\n\t\t\t\t\tvalues="${a.values}" keyTimes="${a.keyTimes}"/>\n\t\t\t</circle>`}if(h>=2){const n=(t=>{const e=[],n=new Map;for(let o=0;o<t.gameHistory.length;o++){const i=t.gameHistory[o].activeBubble;for(const[t,a]of n)i&&i.id===t||(e.push({id:t,colorIndex:a.colorIndex,startFrame:a.startFrame,endFrame:o-1,xPositions:a.xs,yPositions:a.ys}),n.delete(t));if(i&&i.active)if(n.has(i.id)){const t=n.get(i.id);t.xs.push(i.x),t.ys.push(i.y)}else n.set(i.id,{colorIndex:i.colorIndex,startFrame:o,xs:[i.x],ys:[i.y]})}for(const[o,i]of n)e.push({id:o,colorIndex:i.colorIndex,startFrame:i.startFrame,endFrame:t.gameHistory.length-1,xPositions:i.xs,yPositions:i.ys});return e})(t);for(const t of n){const n=Number((t.startFrame/(h-1)).toFixed(4)),o=Number((Math.min(t.endFrame+1,h-1)/(h-1)).toFixed(4)),i=null!==(e=Ut[t.colorIndex])&&void 0!==e?e:Ut[0];let a,r;n<=0&&o>=1?(a="0;1",r="1;1"):n<=0?(a=`0;${o};${o};1`,r="1;1;0;0"):o>=1?(a=`0;${n};${n};1`,r="0;0;1;1"):(a=`0;${n};${n};${o};${o};1`,r="0;0;1;1;0;0");const s=[],l=[],c=t.xPositions[0].toFixed(1),u=t.yPositions[0].toFixed(1);t.startFrame>0&&(s.push(0),l.push(`${c},${u}`));for(let e=0;e<t.xPositions.length;e++){const n=t.startFrame+e,o=Number((n/(h-1)).toFixed(4)),i=t.xPositions[e].toFixed(1),a=t.yPositions[e].toFixed(1);0!==s.length&&o===s[s.length-1]||(s.push(o),l.push(`${i},${a}`))}if(1!==s[s.length-1]){const e=t.xPositions[t.xPositions.length-1].toFixed(1),n=t.yPositions[t.yPositions.length-1].toFixed(1);s.push(1),l.push(`${e},${n}`)}y+=`<circle cx="0" cy="0" r="9" fill="${i}" opacity="0" stroke="white" stroke-width="1" stroke-opacity="0.4">\n\t\t\t\t<animate attributeName="opacity" calcMode="discrete" dur="${m}" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${a}" values="${r}"/>\n\t\t\t\t<animateTransform attributeName="transform" type="translate" calcMode="linear"\n\t\t\t\t\tdur="${m}" repeatCount="indefinite"\n\t\t\t\t\tkeyTimes="${s.join(";")}" values="${l.join(";")}"/>\n\t\t\t</circle>`}}if(h>=2)for(const e of t.popEvents){const t=Number((e.frameIndex/(h-1)).toFixed(4)),n=Number((Math.min(e.frameIndex+8,h-1)/(h-1)).toFixed(4));if(n<=t)continue;const o=`0;${t};${t};${n};1`,i="0;0;1;0;0";for(const{x:t,y:n}of e.cells)y+=`<circle cx="${Ht(t).toFixed(1)}" cy="${Ft(n).toFixed(1)}" r="4" fill="none" stroke="${e.color}" stroke-width="2" opacity="0">\n\t\t\t\t\t<animate attributeName="r" calcMode="linear" dur="${m}" repeatCount="indefinite" keyTimes="${o}" values="4;4;4;20;20"/>\n\t\t\t\t\t<animate attributeName="stroke-width" calcMode="linear" dur="${m}" repeatCount="indefinite" keyTimes="${o}" values="2;2;2;0;0"/>\n\t\t\t\t\t<animate attributeName="opacity" calcMode="linear" dur="${m}" repeatCount="indefinite" keyTimes="${o}" values="${i}"/>\n\t\t\t\t</circle>`}if(h>=2){const e=169,n=583..toFixed(1),o=(e+30).toFixed(1),d={keyTimes:[],values:[]};for(let e=0;e<t.gameHistory.length;e++){const i=Lt(e,h),a=(90-t.gameHistory[e].cannon.angleDeg).toFixed(1);zt(d,i,`${a} ${n} ${o}`)}const f=Vt(d),x=22,v=Number(n),p=Number(o),b=p-x,C={keyTimes:[],values:[]};for(let e=0;e<t.gameHistory.length;e++){const n=Lt(e,h),o=t.gameHistory[e].currentBubbleColorIndex;zt(C,n,null!==(i=Ut[o])&&void 0!==i?i:Ut[0])}const w=Vt(C);y+=`<circle cx="${n}" cy="${o}" r="10" fill="${null!==(s=Ut[null!==(r=null===(a=t.gameHistory[0])||void 0===a?void 0:a.currentBubbleColorIndex)&&void 0!==r?r:0])&&void 0!==s?s:Ut[0]}" stroke="white" stroke-width="2">\n\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${m}" repeatCount="indefinite"\n\t\t\t\tvalues="${w.values}" keyTimes="${w.keyTimes}"/>\n\t\t\t<animateTransform attributeName="transform" type="rotate" calcMode="linear"\n\t\t\t\tdur="${m}" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${f.keyTimes}" values="${f.values}"/>\n\t\t</circle>`,y+=`<line x1="${v}" y1="${p}" x2="${v}" y2="${b}" stroke="#cccccc" stroke-width="6" stroke-linecap="round">\n\t\t\t<animateTransform attributeName="transform" type="rotate" calcMode="linear"\n\t\t\t\tdur="${m}" repeatCount="indefinite"\n\t\t\t\tkeyTimes="${f.keyTimes}" values="${f.values}"/>\n\t\t</line>`;const B={keyTimes:[],values:[]};for(let e=0;e<t.gameHistory.length;e++){const n=Lt(e,h),o=t.gameHistory[e].nextBubbleColorIndex;zt(B,n,null!==(l=Ut[o])&&void 0!==l?l:Ut[0])}const M=Vt(B),E=(Number(n)+28).toFixed(1),k=o,T=null!==(A=Ut[null!==(u=null===(c=t.gameHistory[0])||void 0===c?void 0:c.nextBubbleColorIndex)&&void 0!==u?u:0])&&void 0!==A?A:Ut[0];y+=`<text x="${E}" y="${(Number(o)-16).toFixed(1)}" text-anchor="middle" font-size="8" fill="${g.textColor}" opacity="0.8">NEXT</text>`,y+=`<circle cx="${E}" cy="${k}" r="9" fill="${T}" stroke="white" stroke-width="1" stroke-opacity="0.5">\n\t\t\t<animate attributeName="fill" calcMode="discrete" dur="${m}" repeatCount="indefinite"\n\t\t\t\tvalues="${M.values}" keyTimes="${M.keyTimes}"/>\n\t\t</circle>`}return y+="</svg>",y};const Yt=t=>22*t+10,Pt=t=>22*t+15+10,Gt=t=>Math.round((t-10)/22),Jt=t=>Math.round((t-15-10)/22),Kt=t=>t.grid.some((t=>t.some((t=>t.commitsCount>0)))),Wt=(t,e,o,i)=>{var a,r,s;const l=new Set,c=[],u=[{x:e,y:o}];for(;u.length;){const{x:e,y:o}=u.pop(),d=`${e},${o}`;if(l.has(d))continue;if(e<0||e>=n||o<0||o>=7)continue;const A=null===(a=t.grid[e])||void 0===a?void 0:a[o];A&&0!==A.commitsCount&&(null!==(s=null===(r=t.cellBubbleColors[e])||void 0===r?void 0:r[o])&&void 0!==s?s:-1)===i&&(l.add(d),c.push({x:e,y:o}),u.push({x:e-1,y:o},{x:e+1,y:o},{x:e,y:o-1},{x:e,y:o+1}))}return c},$t=(t,e,o,i)=>{var a,r,s,l;const c=o*Math.PI/180;let u=10*Math.cos(c),d=-10*Math.sin(c),A=t,h=e;for(let t=0;t<2e3;t++){if(A+=u,h+=d,A<9&&(A=9,u=Math.abs(u)),A>1157&&(A=1157,u=-Math.abs(u)),h<0)return null;const t=Gt(A),e=Jt(h);if(!(e<0||e>=7||t<0||t>=n)){for(const[o,s]of[[0,0],[1,0],[-1,0],[0,1],[0,-1]]){const l=t+o,c=e+s;if(!(l<0||l>=n||c<0||c>=7)&&(null===(r=null===(a=i.grid[l])||void 0===a?void 0:a[c])||void 0===r?void 0:r.commitsCount)>0){const t=Yt(l),e=Pt(c);if(Math.hypot(A-t,h-e)<20)return{col:Math.max(0,Math.min(52,Gt(A))),row:Math.max(0,Math.min(6,Jt(h)))}}}if(0===e&&0===(null===(l=null===(s=i.grid[t])||void 0===s?void 0:s[0])||void 0===l?void 0:l.commitsCount))return{col:Math.max(0,Math.min(52,t)),row:0}}}return null},Xt=t=>{t.gameHistory.push({cannon:Object.assign({},t.cannon),activeBubble:t.activeBubble?Object.assign({},t.activeBubble):null,nextBubbleColorIndex:t.nextBubbleColorIndex,currentBubbleColorIndex:t.currentBubbleColorIndex})},qt=t=>{var e,o,i,a,r,s,l;if(t.frameCount++,!t.activeBubble){-1===t.cannonTargetAngle&&(t.cannonTargetAngle=((t,e,o,i)=>{var a,r,s,l,c,u,d,A,h,m,g,f,y,x;const v=1664525*t.nextBubbleId+1013904223>>>0,p=[],b=[],C=[],w=[[-1,0],[1,0],[0,-1],[0,1],[-1,1],[0,1],[1,1],[-1,2],[0,2],[1,2]];for(let e=12;e<=168;e+=2){const o=$t(583,199,e,t);if(!o)continue;if((null!==(s=null===(r=null===(a=t.grid[o.col])||void 0===a?void 0:a[o.row])||void 0===r?void 0:r.commitsCount)&&void 0!==s?s:0)>0)continue;let h=!1,m=!1,g=0;for(const[e,a]of w){const r=o.col+e,s=o.row+a;if(!(r<0||r>=n||s<0||s>=7)&&0!==(null!==(u=null===(c=null===(l=t.grid[r])||void 0===l?void 0:l[s])||void 0===c?void 0:c.commitsCount)&&void 0!==u?u:0)&&(m=!0,(null!==(A=null===(d=t.cellBubbleColors[r])||void 0===d?void 0:d[s])&&void 0!==A?A:-1)===i)){h=!0;const e=Wt(t,r,s,i).length+1;e>g&&(g=e)}}g>=3?p.push({angleDeg:e,score:g}):h?b.push(e):m&&C.push(e)}if(p.length>0){const t=Math.max(...p.map((t=>t.score))),e=p.filter((e=>e.score===t));return e[v%e.length].angleDeg}if(b.length>0)return b[v%b.length];if(C.length>0)return C[v%C.length];let B=90,M=1/0;for(let e=12;e<=168;e+=2){const o=$t(583,199,e,t);if(!o)continue;if((null!==(g=null===(m=null===(h=t.grid[o.col])||void 0===h?void 0:h[o.row])||void 0===m?void 0:m.commitsCount)&&void 0!==g?g:0)>0)continue;const i=Yt(o.col),a=Pt(o.row);let r=1/0;for(let e=0;e<n;e++)for(let n=0;n<7;n++)if((null!==(x=null===(y=null===(f=t.grid[e])||void 0===f?void 0:f[n])||void 0===y?void 0:y.commitsCount)&&void 0!==x?x:0)>0){const t=Math.hypot(i-Yt(e),a-Pt(n));t<r&&(r=t)}r<M&&(M=r,B=e)}return B})(t,0,0,t.nextBubbleColorIndex));const i=t.cannonTargetAngle;t.currentBubbleColorIndex=t.nextBubbleColorIndex;const a=i-t.cannon.angleDeg;if(!(Math.abs(a)<=6))return t.cannon.angleDeg+=6*Math.sign(a),t.cannon.angleDeg=Math.max(10,Math.min(170,t.cannon.angleDeg)),void Xt(t);t.cannon.angleDeg=i;const r=t.nextBubbleColorIndex;t.currentBubbleColorIndex=r,t.cannonTargetAngle=-1;const s=new Set;for(let i=0;i<n;i++)for(let n=0;n<7;n++)t.grid[i][n].commitsCount>0&&s.add(null!==(o=null===(e=t.cellBubbleColors[i])||void 0===e?void 0:e[n])&&void 0!==o?o:0);const l=[...s];if(l.length>0){const e=1664525*t.frameCount+1013904223>>>0;t.nextBubbleColorIndex=l[e%l.length]}const c=t.cannon.angleDeg*Math.PI/180;return t.activeBubble={id:t.nextBubbleId++,x:583,y:199,vx:10*Math.cos(c),vy:-10*Math.sin(c),colorIndex:r,active:!0},void Xt(t)}const c=t.activeBubble;if(c.x+=c.vx,c.y+=c.vy,c.x<9&&(c.x=9,c.vx=Math.abs(c.vx)),c.x>1157&&(c.x=1157,c.vx=-Math.abs(c.vx)),c.y<0||c.y>209)return t.activeBubble=null,t.cannonTargetAngle=-1,void Xt(t);let u=!1,A=-1,h=-1;const m=Gt(c.x),g=Jt(c.y);t:for(let e=-1;e<=1;e++)for(let o=-1;o<=1;o++){const l=m+e,d=g+o;if(l<0||l>=n||d<0||d>=7)continue;const f=Yt(l),y=Pt(d);if(Math.hypot(c.x-f,c.y-y)<18){if((null===(a=null===(i=t.grid[l])||void 0===i?void 0:i[d])||void 0===a?void 0:a.commitsCount)>0){if(0===(null===(s=null===(r=t.grid[m])||void 0===r?void 0:r[g])||void 0===s?void 0:s.commitsCount)&&m>=0&&m<n&&g>=0&&g<7)A=m,h=g;else for(const[e,o]of[[0,1],[-1,0],[1,0],[0,-1]]){const i=l+e,a=d+o;if(i>=0&&i<n&&a>=0&&a<7&&0===t.grid[i][a].commitsCount){A=i,h=a;break}}u=!0;break t}if(0===d){A=l,h=0,u=!0;break t}}}if(!u&&g<=0&&m>=0&&m<n&&(A=m,h=0,u=!0),u&&A>=0&&h>=0){A=Math.max(0,Math.min(52,A)),h=Math.max(0,Math.min(6,h));const e=d(t).intensityColors[0],n=null!==(l=Ut[c.colorIndex])&&void 0!==l?l:Ut[0];t.grid[A][h]={commitsCount:1,color:n,level:"FIRST_QUARTILE"},t.cellBubbleColors[A][h]=c.colorIndex,t.cellEvents.push({frameIndex:t.gameHistory.length,x:A,y:h,color:n});const o=Wt(t,A,h,c.colorIndex);if(o.length>=3){const i=n;for(const{x:n,y:i}of o)t.grid[n][i]={commitsCount:0,color:e,level:"NONE"},t.cellBubbleColors[n][i]=-1,t.cellEvents.push({frameIndex:t.gameHistory.length,x:n,y:i,color:e});t.popEvents.push({frameIndex:t.gameHistory.length,cells:o,color:i}),t.config.pointsIncreasedCallback(t.cellEvents.length)}t.activeBubble=null,t.cannonTargetAngle=-1}Xt(t)},Zt=t=>{return e=void 0,o=void 0,a=function*(){var e,o,i;t.frameCount=0,t.nextBubbleId=0,t.gameHistory=[],t.cellEvents=[],t.popEvents=[],t.activeBubble=null,t.grid=m(t);const a=d(t).intensityColors[0],r=[];for(let e=0;e<n;e++)for(let n=0;n<7;n++)t.grid[e][n].commitsCount>0&&r.push({x:e,y:n});const s=r.length<=50?2:r.length<=150?3:r.length<=250?4:r.length<=350?5:6;let l=2654435761*r.length>>>0;const c=()=>(l=Math.imul(l,1664525)+1013904223>>>0,l/4294967296);t.cellBubbleColors=Array.from({length:n},(()=>new Array(7).fill(-1)));for(const{x:e,y:n}of r)t.cellBubbleColors[e][n]=Math.floor(c()*s);for(let n=0;n<3;n++){const n=t.cellBubbleColors.map((t=>[...t]));for(const{x:i,y:a}of r){const r=new Array(s).fill(0);let l=0;for(const[t,s]of[[-1,0],[1,0],[0,-1],[0,1],[-1,-1],[1,-1],[-1,1],[1,1]]){const c=null!==(o=null===(e=n[i+t])||void 0===e?void 0:e[a+s])&&void 0!==o?o:-1;c>=0&&(r[c]++,l++)}if(l>0){const e=Math.max(...r);e>=.5*l&&(t.cellBubbleColors[i][a]=r.indexOf(e))}}}for(const{x:e,y:n}of r){const o=t.cellBubbleColors[e][n];t.grid[e][n]=Object.assign(Object.assign({},t.grid[e][n]),{color:Ut[o]})}t.initialColors=t.grid.map((t=>t.map((t=>t.commitsCount>0?t.color:a))));const u=[...new Set(r.map((({x:e,y:n})=>t.cellBubbleColors[e][n])))];if(t.nextBubbleColorIndex=null!==(i=u[Math.floor(c()*u.length)])&&void 0!==i?i:0,!Kt(t)){const e=jt(t);return t.config.svgCallback(e),void t.config.gameOverCallback()}for(t.cannon={angleDeg:90},t.cannonTargetAngle=-1,t.currentBubbleColorIndex=t.nextBubbleColorIndex;Kt(t)&&t.frameCount<5e3;)qt(t);const A=jt(t);t.config.svgCallback(A),t.config.gameStatsCallback&&t.config.gameStatsCallback({totalScore:t.cellEvents.length,steps:t.frameCount,ghostsEaten:0}),t.config.gameOverCallback()},new((i=void 0)||(i=Promise))((function(t,n){function r(t){try{l(a.next(t))}catch(t){n(t)}}function s(t){try{l(a.throw(t))}catch(t){n(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(r,s)}l((a=a.apply(e,o||[])).next())}));var e,o,i,a},_t={frameCount:0,nextBubbleId:0,nextBubbleColorIndex:0,currentBubbleColorIndex:0,cannonTargetAngle:-1,contributions:[],cannon:{angleDeg:90},activeBubble:null,grid:[],monthLabels:[],gameHistory:[],initialColors:[],cellBubbleColors:[],cellEvents:[],popEvents:[],config:void 0};class te{constructor(t){this.conf=Object.assign({},t)}start(){return t=this,e=void 0,o=function*(){switch(this.store=JSON.parse(JSON.stringify(_t)),this.store.config=Object.assign(Object.assign({},{platform:"github",username:"",svgCallback:t=>{},gameOverCallback:()=>{},gameTheme:"github",pointsIncreasedCallback:t=>{},githubSettings:{accessToken:""}}),this.conf),this.store.config.platform){case"gitlab":this.store.contributions=yield y(this.store);break;case"github":this.store.contributions=yield f(this.store);break;default:throw new Error(`Unsupported platform: ${this.store.config.platform}`)}return A(this.store),h(this.store),yield Zt(this.store),this.store},new((n=void 0)||(n=Promise))((function(i,a){function r(t){try{l(o.next(t))}catch(t){a(t)}}function s(t){try{l(o.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}l((o=o.apply(t,e||[])).next())}));var t,e,n,o}stop(){this.store}}var ee=e.Lc,ne=e.b9,oe=e.Cf,ie=e.rn,ae=e.OJ;export{ee as BreakoutRenderer,ne as GalagaRenderer,oe as PacmanRenderer,ie as PlayerStyle,ae as PuzzleBobbleRenderer};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pacman-contribution-graph",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.4",
|
|
4
4
|
"description": "Generates a pacman game from a github or gitlab user contributions grid",
|
|
5
5
|
"repository": "github:abozanona/pacman-contribution-graph",
|
|
6
6
|
"homepage": "https://abozanona.github.io/pacman-contribution-graph/",
|