pre-mortem 0.1.9 → 0.2.2

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,5 +1,5 @@
1
- var m = Object.defineProperty;
2
- var b = (r, t, e) => t in r ? m(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
1
+ var f = Object.defineProperty;
2
+ var b = (r, t, e) => t in r ? f(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
3
  var l = (r, t, e) => b(r, typeof t != "symbol" ? t + "" : t, e);
4
4
  import c from "matter-js";
5
5
  var g = /* @__PURE__ */ ((r) => (r.BOOTSTRAP = "bootstrap", r.VC = "vc", r.SLACKER = "slacker", r.CONTROL_FREAK = "control_freak", r.PRIMA_DONNA = "prima_donna", r.QUIET_QUITTER = "quiet_quitter", r.SLACK_SPAMMER = "slack_spammer", r))(g || {});
@@ -168,7 +168,7 @@ const p = {
168
168
  label: s
169
169
  };
170
170
  if (e === "vc") {
171
- const n = i.w, u = i.h, h = Math.random() * 15, d = Math.random() * 15, a = (Math.random() - 0.5) * 20, f = [
171
+ const n = i.w, u = i.h, h = Math.random() * 15, d = Math.random() * 15, a = (Math.random() - 0.5) * 20, m = [
172
172
  { x: 0 + a, y: h },
173
173
  // TL
174
174
  { x: n + a, y: d },
@@ -178,9 +178,9 @@ const p = {
178
178
  { x: 0, y: u }
179
179
  // BL
180
180
  ];
181
- return c.Bodies.fromVertices(r, t, [f], o);
181
+ return c.Bodies.fromVertices(r, t, [m], o);
182
182
  } else if (e === "slacker" || e === "control_freak" || e === "prima_donna" || e === "quiet_quitter" || e === "slack_spammer") {
183
- const n = "https://raw.githubusercontent.com/Booby-Boobs/pre-mortem/main/public/", u = {
183
+ const n = "https://raw.githubusercontent.com/Booby-Boobs/Pre-Mortem/main/public/", u = {
184
184
  slacker: `${n}slacker.png`,
185
185
  control_freak: `${n}control-freak.png`,
186
186
  prima_donna: `${n}prima-donna.png`,
@@ -386,8 +386,8 @@ TO AI`, author: "- Board" }
386
386
  `);
387
387
  h.forEach((d, a) => t.fillText(d, 0, a * 50)), t.font = 'italic 700 24px "Inter", sans-serif', t.fillStyle = "rgba(255, 255, 255, 0.04)", t.fillText(this.currentQuote.author, 0, h.length * 50 + 10), t.restore(), t.beginPath(), t.setLineDash([]), t.lineWidth = 1, t.strokeStyle = "rgba(255, 50, 50, 0.2)", t.strokeRect(u.x, u.y, u.w, u.h), t.font = 'bold 13px "Inter", sans-serif', t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = "#FFFFFF", this.engine.world.bodies.forEach((d) => {
388
388
  if (!d.label || d.label.includes("Body") || d.isStatic) return;
389
- const a = d.gameData, f = a && a.vested;
390
- t.save(), t.translate(d.position.x, d.position.y), t.rotate(d.angle), f ? (t.shadowColor = "#00ff7f", t.shadowBlur = 10, t.fillStyle = "#00ff7f", t.fillText(d.label + " ✓", 0, 0)) : (t.shadowColor = "black", t.shadowBlur = 4, t.fillStyle = "#FFFFFF", t.fillText(d.label, 0, 0)), t.restore();
389
+ const a = d.gameData, m = a && a.vested;
390
+ t.save(), t.translate(d.position.x, d.position.y), t.rotate(d.angle), m ? (t.shadowColor = "#00ff7f", t.shadowBlur = 10, t.fillStyle = "#00ff7f", t.fillText(d.label + " ✓", 0, 0)) : (t.shadowColor = "black", t.shadowBlur = 4, t.fillStyle = "#FFFFFF", t.fillText(d.label, 0, 0)), t.restore();
391
391
  });
392
392
  });
393
393
  }
@@ -746,23 +746,23 @@ class k {
746
746
  <strong style="color: #ff4444; font-size: 13px;">TOXIC (Risk: 1/15)</strong>
747
747
  <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 5px;">
748
748
  <div class="uj-legend-mini">
749
- <img src="./slacker.png" style="width: 30px; height: auto;">
749
+ <img src="https://raw.githubusercontent.com/Booby-Boobs/Pre-Mortem/main/public/slacker.png" style="width: 30px; height: auto;">
750
750
  <span>Slacker</span>
751
751
  </div>
752
752
  <div class="uj-legend-mini">
753
- <img src="./control-freak.png" style="width: 30px; height: auto;">
753
+ <img src="https://raw.githubusercontent.com/Booby-Boobs/Pre-Mortem/main/public/control-freak.png" style="width: 30px; height: auto;">
754
754
  <span>Control Freak</span>
755
755
  </div>
756
756
  <div class="uj-legend-mini">
757
- <img src="./prima-donna.png" style="width: 30px; height: auto;">
757
+ <img src="https://raw.githubusercontent.com/Booby-Boobs/Pre-Mortem/main/public/prima-donna.png" style="width: 30px; height: auto;">
758
758
  <span>Prima Donna</span>
759
759
  </div>
760
760
  <div class="uj-legend-mini">
761
- <img src="./quet-quitter.png" style="width: 30px; height: auto;">
761
+ <img src="https://raw.githubusercontent.com/Booby-Boobs/Pre-Mortem/main/public/quet-quitter.png" style="width: 30px; height: auto;">
762
762
  <span>Quiet Quitter</span>
763
763
  </div>
764
764
  <div class="uj-legend-mini">
765
- <img src="./slack-spammer.png" style="width: 30px; height: auto;">
765
+ <img src="https://raw.githubusercontent.com/Booby-Boobs/Pre-Mortem/main/public/slack-spammer.png" style="width: 30px; height: auto;">
766
766
  <span>Spammer</span>
767
767
  </div>
768
768
  </div>
@@ -1,4 +1,4 @@
1
- (function(p,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("matter-js")):typeof define=="function"&&define.amd?define(["exports","matter-js"],o):(p=typeof globalThis<"u"?globalThis:p||self,o(p.PreMortem={},p.Matter))})(this,function(p,o){"use strict";var E=Object.defineProperty;var C=(p,o,d)=>o in p?E(p,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):p[o]=d;var l=(p,o,d)=>C(p,typeof o!="symbol"?o+"":o,d);var d=(c=>(c.BOOTSTRAP="bootstrap",c.VC="vc",c.SLACKER="slacker",c.CONTROL_FREAK="control_freak",c.PRIMA_DONNA="prima_donna",c.QUIET_QUITTER="quiet_quitter",c.SLACK_SPAMMER="slack_spammer",c))(d||{});const f={bootstrap:{w:132,h:44,color:"#555555",density:.005,friction:.8,restitution:0,label:"Refactoring",possibleLabels:["Refactoring","Unit Tests","Bug Fixes","User Support","Documentation","Security Audit","Compliance","Cleanup","Optimization","CI/CD Pipeline","Code Review","DB Tuning","API Design","Accessibility","Localization","Error Logs","Backups","Legacy Code","Hiring","Customer Love","Bossware","YAML Hell","DNS Propagation","Regex","npm audit","GDPR / SOC2","Migration","Certificate Expiry","On-Call","Technical Debt","Works on my machine","Yak Shaving"]},vc:{w:120,h:40,color:"#FF00FF",density:5e-4,friction:.3,restitution:.6,label:"AI Blockchain",possibleLabels:["GenAI","Blockchain","Web3","Metaverse","NFTs","Viral Growth","Pivot","Synergy","Disruption","Thought Leader","Influencers","Hyper-Scale","Quantum","Big Data","Growth Hack","Paradigm Shift","10x Engineer","Visionary","Series B Pitch","Exit Strategy","Vibe Coding","Founder Mode","Prompt Engineering","AGI","AI Wrapper","Unlimited PTO","Radical Candor","Community Led","Pre-Revenue","Fractional CxO"]},slacker:{w:64,h:64,color:"#FFFFFF",density:.01,friction:1,restitution:.1,label:"The Slacker",possibleLabels:["The Slacker"]},control_freak:{w:64,h:64,color:"#FF0000",density:.012,friction:.5,restitution:.2,label:"Control Freak",possibleLabels:["Control Freak"]},prima_donna:{w:56,h:56,color:"#FFFF00",density:.008,friction:.1,restitution:1.2,label:"Prima Donna",possibleLabels:["Prima Donna"]},quiet_quitter:{w:48,h:48,color:"#00FFFF",density:.005,friction:.01,restitution:.9,label:"Quiet Quitter",possibleLabels:["Quiet Quitter"]},slack_spammer:{w:60,h:60,color:"#00FF00",density:.01,friction:.4,restitution:.4,label:"Slack Spammer",possibleLabels:["Slack Spammer"]}},y=c=>{const t=f[c].possibleLabels||[];return t[Math.floor(Math.random()*t.length)]},v=(c,t,e)=>{const i=f[e],s=y(e),a={density:i.density,friction:i.friction,restitution:i.restitution,render:{fillStyle:i.color,strokeStyle:"#000",lineWidth:2},label:s};if(e==="vc"){const n=i.w,g=i.h,u=Math.random()*15,h=Math.random()*15,r=(Math.random()-.5)*20,m=[{x:0+r,y:u},{x:n+r,y:h},{x:n,y:g},{x:0,y:g}];return o.Bodies.fromVertices(c,t,[m],a)}else if(e==="slacker"||e==="control_freak"||e==="prima_donna"||e==="quiet_quitter"||e==="slack_spammer"){const n="https://raw.githubusercontent.com/Booby-Boobs/pre-mortem/main/public/",g={slacker:`${n}slacker.png`,control_freak:`${n}control-freak.png`,prima_donna:`${n}prima-donna.png`,quiet_quitter:`${n}quet-quitter.png`,slack_spammer:`${n}slack-spammer.png`},u={...a,render:{sprite:{texture:g[e],xScale:i.w/512*2,yScale:i.h/512*2},lineWidth:3,strokeStyle:"#ffffff"}};return e==="quiet_quitter"?o.Bodies.circle(c,t,i.w/2,u):e==="control_freak"?o.Bodies.trapezoid(c,t,i.w,i.h,.5,u):e==="prima_donna"?o.Bodies.polygon(c,t,5,i.w/2,u):e==="slack_spammer"?o.Bodies.polygon(c,t,6,i.w/2,u):o.Bodies.rectangle(c,t,i.w,i.h,u)}else return o.Bodies.rectangle(c,t,i.w,i.h,a)};class w{constructor(t){l(this,"runway");l(this,"valuation",0);l(this,"stage");l(this,"status","playing");l(this,"lastPenaltyReason","");l(this,"config");l(this,"currentStageIndex",0);l(this,"listeners",[]);if(this.config=t,this.runway=t.initialRunway,!this.config.stages||this.config.stages.length===0)throw new Error("Game must have at least one stage defined.");this.config.stages.sort((e,i)=>e.threshold-i.threshold),this.currentStageIndex=0,this.stage=this.config.stages[0].name,this.checkStage()}setPaused(t){t?this.status==="playing"&&(this.status="paused"):this.status==="paused"&&(this.status="playing"),this.notify()}togglePause(){this.setPaused(this.status==="playing")}tick(t){if(this.status!=="playing")return;const e=Math.min(t,.1),i=this.getDynamicBurnRate();this.runway-=i*e,this.runway<=0&&(this.runway=0,this.status="bankrupt");const s=this.config.stages[this.config.stages.length-1];this.valuation>=s.threshold&&this.status==="playing"&&(this.status="exited"),this.checkStage(),this.notify()}getDynamicBurnRate(){return this.config.stages[this.currentStageIndex].burnRate}addValuation(t){this.valuation+=t,this.checkStage(),this.notify()}spendMoney(t){this.runway-=t,this.notify()}addMoney(t){this.runway+=t,this.notify()}setCollapsed(){this.status==="playing"&&(this.status="collapsed",this.notify())}getNextStageThreshold(){return this.currentStageIndex<this.config.stages.length-1?this.config.stages[this.currentStageIndex+1].threshold:this.config.stages[this.config.stages.length-1].threshold}penalty(t,e){this.runway-=t,this.lastPenaltyReason=e,this.runway<0&&(this.runway=0,this.status="bankrupt"),this.notify("penalty")}checkStage(){let t=0;for(let e=0;e<this.config.stages.length&&this.valuation>=this.config.stages[e].threshold;e++)t=e;if(t!==this.currentStageIndex){if(t>this.currentStageIndex){const e=this.config.stages[t].fundingBonus||0;e>0&&(this.addMoney(e),this.notify("funding:"+e))}this.currentStageIndex=t,this.stage=this.config.stages[t].name}}subscribe(t){this.listeners.push(t)}notify(t){this.listeners.forEach(e=>e(t))}isPlaying(){return this.status==="playing"}isBankrupt(){return this.status==="bankrupt"}}class b{constructor(t,e={}){l(this,"engine");l(this,"render");l(this,"runner");l(this,"container");l(this,"width");l(this,"height");l(this,"mouseConstraint");l(this,"currentQuote",null);l(this,"chaosTimer",1e4);l(this,"chaosInterval",9e4);l(this,"onCrisis");l(this,"gameState");l(this,"spawnVertical",!1);this.container=t,this.width=e.width||t.clientWidth||800,this.height=e.height||t.clientHeight||600,this.onCrisis=e.onCrisis,this.chaosInterval=e.chaosInterval||9e4,this.chaosTimer=e.chaosInterval?e.chaosInterval:1e4;const i=[{name:"Seed Round",threshold:0,burnRate:2e3},{name:"Series A",threshold:1e8,burnRate:1e4,fundingBonus:25e4},{name:"Series B",threshold:25e7,burnRate:25e3,fundingBonus:5e5},{name:"Series C",threshold:5e8,burnRate:5e4,fundingBonus:1e6},{name:"Series D",threshold:7e8,burnRate:75e3,fundingBonus:2e6},{name:"Series E",threshold:85e7,burnRate:1e5,fundingBonus:5e6},{name:"Unicorn Status",threshold:1e9,burnRate:15e4,fundingBonus:1e7}];this.gameState=new w({initialRunway:e.initialRunway||2e5,stages:e.stages||i}),this.engine=o.Engine.create(),this.render=o.Render.create({element:this.container,engine:this.engine,options:{width:this.width,height:this.height,wireframes:!1,background:"#1a1a1a"}}),this.runner=o.Runner.create(),this.initWorld(),this.initMouse(),this.initRenderLoop(),this.initGameLoop(),this.initControls(),this.gameState.subscribe(()=>{this.gameState.status==="paused"?this.runner.enabled=!1:this.gameState.status==="playing"&&(this.runner.enabled=!0)})}initControls(){window.addEventListener("keydown",t=>{(t.key==="r"||t.key==="R")&&this.gameState.isPlaying()&&this.rotateHeldBody()})}rotateHeldBody(){const t=this.mouseConstraint.body;t&&o.Body.rotate(t,45*(Math.PI/180))}initWorld(){const{width:t,height:e}=this,i=60,s=o.Bodies.rectangle(t/2,e-i/2,t,i,{isStatic:!0,render:{fillStyle:"#333"}});o.Composite.add(this.engine.world,[s])}initMouse(){const t=o.Mouse.create(this.render.canvas);this.mouseConstraint=o.MouseConstraint.create(this.engine,{mouse:t,constraint:{stiffness:.2,render:{visible:!1}}}),o.Composite.add(this.engine.world,this.mouseConstraint),this.render.mouse=t}start(){o.Render.run(this.render),o.Runner.run(this.runner,this.engine)}stop(){o.Render.stop(this.render),o.Runner.stop(this.runner)}initRenderLoop(){o.Events.on(this.render,"afterRender",()=>{const t=this.render.context,e=this.width/2,i=400,s=700,a=100,n={x:e-i/2,y:a,w:i,h:this.height-a},g={x:e-s/2,y:a-50,w:s,h:this.height-a+100};if(t.beginPath(),t.setLineDash([10,10]),t.lineWidth=2,t.strokeStyle="rgba(255, 255, 255, 0.3)",t.strokeRect(n.x,n.y,n.w,n.h),t.font='10px "Inter", sans-serif',t.fillStyle="rgba(255, 255, 255, 0.3)",t.textAlign="center",t.fillText("ACCURATE VALUATION ZONE",e,n.y-15),!this.currentQuote){const h=[{text:`WE ARE A
1
+ (function(p,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("matter-js")):typeof define=="function"&&define.amd?define(["exports","matter-js"],o):(p=typeof globalThis<"u"?globalThis:p||self,o(p.PreMortem={},p.Matter))})(this,function(p,o){"use strict";var E=Object.defineProperty;var C=(p,o,d)=>o in p?E(p,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):p[o]=d;var l=(p,o,d)=>C(p,typeof o!="symbol"?o+"":o,d);var d=(c=>(c.BOOTSTRAP="bootstrap",c.VC="vc",c.SLACKER="slacker",c.CONTROL_FREAK="control_freak",c.PRIMA_DONNA="prima_donna",c.QUIET_QUITTER="quiet_quitter",c.SLACK_SPAMMER="slack_spammer",c))(d||{});const m={bootstrap:{w:132,h:44,color:"#555555",density:.005,friction:.8,restitution:0,label:"Refactoring",possibleLabels:["Refactoring","Unit Tests","Bug Fixes","User Support","Documentation","Security Audit","Compliance","Cleanup","Optimization","CI/CD Pipeline","Code Review","DB Tuning","API Design","Accessibility","Localization","Error Logs","Backups","Legacy Code","Hiring","Customer Love","Bossware","YAML Hell","DNS Propagation","Regex","npm audit","GDPR / SOC2","Migration","Certificate Expiry","On-Call","Technical Debt","Works on my machine","Yak Shaving"]},vc:{w:120,h:40,color:"#FF00FF",density:5e-4,friction:.3,restitution:.6,label:"AI Blockchain",possibleLabels:["GenAI","Blockchain","Web3","Metaverse","NFTs","Viral Growth","Pivot","Synergy","Disruption","Thought Leader","Influencers","Hyper-Scale","Quantum","Big Data","Growth Hack","Paradigm Shift","10x Engineer","Visionary","Series B Pitch","Exit Strategy","Vibe Coding","Founder Mode","Prompt Engineering","AGI","AI Wrapper","Unlimited PTO","Radical Candor","Community Led","Pre-Revenue","Fractional CxO"]},slacker:{w:64,h:64,color:"#FFFFFF",density:.01,friction:1,restitution:.1,label:"The Slacker",possibleLabels:["The Slacker"]},control_freak:{w:64,h:64,color:"#FF0000",density:.012,friction:.5,restitution:.2,label:"Control Freak",possibleLabels:["Control Freak"]},prima_donna:{w:56,h:56,color:"#FFFF00",density:.008,friction:.1,restitution:1.2,label:"Prima Donna",possibleLabels:["Prima Donna"]},quiet_quitter:{w:48,h:48,color:"#00FFFF",density:.005,friction:.01,restitution:.9,label:"Quiet Quitter",possibleLabels:["Quiet Quitter"]},slack_spammer:{w:60,h:60,color:"#00FF00",density:.01,friction:.4,restitution:.4,label:"Slack Spammer",possibleLabels:["Slack Spammer"]}},y=c=>{const t=m[c].possibleLabels||[];return t[Math.floor(Math.random()*t.length)]},v=(c,t,e)=>{const i=m[e],s=y(e),a={density:i.density,friction:i.friction,restitution:i.restitution,render:{fillStyle:i.color,strokeStyle:"#000",lineWidth:2},label:s};if(e==="vc"){const n=i.w,g=i.h,u=Math.random()*15,h=Math.random()*15,r=(Math.random()-.5)*20,f=[{x:0+r,y:u},{x:n+r,y:h},{x:n,y:g},{x:0,y:g}];return o.Bodies.fromVertices(c,t,[f],a)}else if(e==="slacker"||e==="control_freak"||e==="prima_donna"||e==="quiet_quitter"||e==="slack_spammer"){const n="https://raw.githubusercontent.com/Booby-Boobs/Pre-Mortem/main/public/",g={slacker:`${n}slacker.png`,control_freak:`${n}control-freak.png`,prima_donna:`${n}prima-donna.png`,quiet_quitter:`${n}quet-quitter.png`,slack_spammer:`${n}slack-spammer.png`},u={...a,render:{sprite:{texture:g[e],xScale:i.w/512*2,yScale:i.h/512*2},lineWidth:3,strokeStyle:"#ffffff"}};return e==="quiet_quitter"?o.Bodies.circle(c,t,i.w/2,u):e==="control_freak"?o.Bodies.trapezoid(c,t,i.w,i.h,.5,u):e==="prima_donna"?o.Bodies.polygon(c,t,5,i.w/2,u):e==="slack_spammer"?o.Bodies.polygon(c,t,6,i.w/2,u):o.Bodies.rectangle(c,t,i.w,i.h,u)}else return o.Bodies.rectangle(c,t,i.w,i.h,a)};class w{constructor(t){l(this,"runway");l(this,"valuation",0);l(this,"stage");l(this,"status","playing");l(this,"lastPenaltyReason","");l(this,"config");l(this,"currentStageIndex",0);l(this,"listeners",[]);if(this.config=t,this.runway=t.initialRunway,!this.config.stages||this.config.stages.length===0)throw new Error("Game must have at least one stage defined.");this.config.stages.sort((e,i)=>e.threshold-i.threshold),this.currentStageIndex=0,this.stage=this.config.stages[0].name,this.checkStage()}setPaused(t){t?this.status==="playing"&&(this.status="paused"):this.status==="paused"&&(this.status="playing"),this.notify()}togglePause(){this.setPaused(this.status==="playing")}tick(t){if(this.status!=="playing")return;const e=Math.min(t,.1),i=this.getDynamicBurnRate();this.runway-=i*e,this.runway<=0&&(this.runway=0,this.status="bankrupt");const s=this.config.stages[this.config.stages.length-1];this.valuation>=s.threshold&&this.status==="playing"&&(this.status="exited"),this.checkStage(),this.notify()}getDynamicBurnRate(){return this.config.stages[this.currentStageIndex].burnRate}addValuation(t){this.valuation+=t,this.checkStage(),this.notify()}spendMoney(t){this.runway-=t,this.notify()}addMoney(t){this.runway+=t,this.notify()}setCollapsed(){this.status==="playing"&&(this.status="collapsed",this.notify())}getNextStageThreshold(){return this.currentStageIndex<this.config.stages.length-1?this.config.stages[this.currentStageIndex+1].threshold:this.config.stages[this.config.stages.length-1].threshold}penalty(t,e){this.runway-=t,this.lastPenaltyReason=e,this.runway<0&&(this.runway=0,this.status="bankrupt"),this.notify("penalty")}checkStage(){let t=0;for(let e=0;e<this.config.stages.length&&this.valuation>=this.config.stages[e].threshold;e++)t=e;if(t!==this.currentStageIndex){if(t>this.currentStageIndex){const e=this.config.stages[t].fundingBonus||0;e>0&&(this.addMoney(e),this.notify("funding:"+e))}this.currentStageIndex=t,this.stage=this.config.stages[t].name}}subscribe(t){this.listeners.push(t)}notify(t){this.listeners.forEach(e=>e(t))}isPlaying(){return this.status==="playing"}isBankrupt(){return this.status==="bankrupt"}}class b{constructor(t,e={}){l(this,"engine");l(this,"render");l(this,"runner");l(this,"container");l(this,"width");l(this,"height");l(this,"mouseConstraint");l(this,"currentQuote",null);l(this,"chaosTimer",1e4);l(this,"chaosInterval",9e4);l(this,"onCrisis");l(this,"gameState");l(this,"spawnVertical",!1);this.container=t,this.width=e.width||t.clientWidth||800,this.height=e.height||t.clientHeight||600,this.onCrisis=e.onCrisis,this.chaosInterval=e.chaosInterval||9e4,this.chaosTimer=e.chaosInterval?e.chaosInterval:1e4;const i=[{name:"Seed Round",threshold:0,burnRate:2e3},{name:"Series A",threshold:1e8,burnRate:1e4,fundingBonus:25e4},{name:"Series B",threshold:25e7,burnRate:25e3,fundingBonus:5e5},{name:"Series C",threshold:5e8,burnRate:5e4,fundingBonus:1e6},{name:"Series D",threshold:7e8,burnRate:75e3,fundingBonus:2e6},{name:"Series E",threshold:85e7,burnRate:1e5,fundingBonus:5e6},{name:"Unicorn Status",threshold:1e9,burnRate:15e4,fundingBonus:1e7}];this.gameState=new w({initialRunway:e.initialRunway||2e5,stages:e.stages||i}),this.engine=o.Engine.create(),this.render=o.Render.create({element:this.container,engine:this.engine,options:{width:this.width,height:this.height,wireframes:!1,background:"#1a1a1a"}}),this.runner=o.Runner.create(),this.initWorld(),this.initMouse(),this.initRenderLoop(),this.initGameLoop(),this.initControls(),this.gameState.subscribe(()=>{this.gameState.status==="paused"?this.runner.enabled=!1:this.gameState.status==="playing"&&(this.runner.enabled=!0)})}initControls(){window.addEventListener("keydown",t=>{(t.key==="r"||t.key==="R")&&this.gameState.isPlaying()&&this.rotateHeldBody()})}rotateHeldBody(){const t=this.mouseConstraint.body;t&&o.Body.rotate(t,45*(Math.PI/180))}initWorld(){const{width:t,height:e}=this,i=60,s=o.Bodies.rectangle(t/2,e-i/2,t,i,{isStatic:!0,render:{fillStyle:"#333"}});o.Composite.add(this.engine.world,[s])}initMouse(){const t=o.Mouse.create(this.render.canvas);this.mouseConstraint=o.MouseConstraint.create(this.engine,{mouse:t,constraint:{stiffness:.2,render:{visible:!1}}}),o.Composite.add(this.engine.world,this.mouseConstraint),this.render.mouse=t}start(){o.Render.run(this.render),o.Runner.run(this.runner,this.engine)}stop(){o.Render.stop(this.render),o.Runner.stop(this.runner)}initRenderLoop(){o.Events.on(this.render,"afterRender",()=>{const t=this.render.context,e=this.width/2,i=400,s=700,a=100,n={x:e-i/2,y:a,w:i,h:this.height-a},g={x:e-s/2,y:a-50,w:s,h:this.height-a+100};if(t.beginPath(),t.setLineDash([10,10]),t.lineWidth=2,t.strokeStyle="rgba(255, 255, 255, 0.3)",t.strokeRect(n.x,n.y,n.w,n.h),t.font='10px "Inter", sans-serif',t.fillStyle="rgba(255, 255, 255, 0.3)",t.textAlign="center",t.fillText("ACCURATE VALUATION ZONE",e,n.y-15),!this.currentQuote){const h=[{text:`WE ARE A
2
2
  FAMILY`,author:"- CEO"},{text:`CHANGE THE
3
3
  WORLD`,author:"- Founder"},{text:`DISRUPT
4
4
  EVERYTHING`,author:"- VC"},{text:`MOVE FAST
@@ -8,7 +8,7 @@ PTO`,author:"- Recruiter"},{text:`VISIONARY
8
8
  LEADER`,author:"- LinkedIn"},{text:`10X
9
9
  GROWTH`,author:"- Investor"},{text:`PIVOT
10
10
  TO AI`,author:"- Board"}];this.currentQuote=h[Math.floor(Math.random()*h.length)]}t.save(),t.translate(e,n.y+n.h/3),t.rotate(-Math.PI/12),t.textAlign="center",t.textBaseline="middle",t.font='900 48px "Inter", sans-serif',t.fillStyle="rgba(255, 255, 255, 0.05)";const u=this.currentQuote.text.split(`
11
- `);u.forEach((h,r)=>t.fillText(h,0,r*50)),t.font='italic 700 24px "Inter", sans-serif',t.fillStyle="rgba(255, 255, 255, 0.04)",t.fillText(this.currentQuote.author,0,u.length*50+10),t.restore(),t.beginPath(),t.setLineDash([]),t.lineWidth=1,t.strokeStyle="rgba(255, 50, 50, 0.2)",t.strokeRect(g.x,g.y,g.w,g.h),t.font='bold 13px "Inter", sans-serif',t.textAlign="center",t.textBaseline="middle",t.fillStyle="#FFFFFF",this.engine.world.bodies.forEach(h=>{if(!h.label||h.label.includes("Body")||h.isStatic)return;const r=h.gameData,m=r&&r.vested;t.save(),t.translate(h.position.x,h.position.y),t.rotate(h.angle),m?(t.shadowColor="#00ff7f",t.shadowBlur=10,t.fillStyle="#00ff7f",t.fillText(h.label+" ✓",0,0)):(t.shadowColor="black",t.shadowBlur=4,t.fillStyle="#FFFFFF",t.fillText(h.label,0,0)),t.restore()})})}initGameLoop(){o.Events.on(this.runner,"afterUpdate",()=>{if(!this.gameState.isPlaying())return;const t=this.runner.delta;this.gameState.tick(t/1e3),this.gameState.valuation>=1e6&&(this.chaosTimer-=t,this.chaosTimer<=0&&(this.triggerChaosEvent(),this.chaosTimer=this.chaosInterval));const e=this.width/2,i=400,s=700;this.engine.world.bodies.forEach(a=>{if(a.isStatic)return;const n=a.gameData;if(Math.abs(a.position.x-e)>s/2||a.position.y>this.height+50){o.Composite.remove(this.engine.world,a);const u=["VC Scolding!","Server Outage!","GDPR Violation!","TechCrunch Hit Piece!","IP Lawsuit!"];this.gameState.penalty(5e4,u[Math.floor(Math.random()*u.length)]);return}if(n&&!n.vested){const u=a.speed<.15&&Math.abs(a.angularVelocity)<.05,h=Math.abs(a.position.x-e)<i/2;u&&h?(n.vestTimer+=this.runner.delta,n.vestTimer>1e3&&(n.vested=!0,this.gameState.addValuation(n.value))):n.vestTimer=0}})})}triggerChaosEvent(){var e,i,s,a,n;switch(Math.floor(Math.random()*5)){case 0:(e=this.onCrisis)==null||e.call(this,"STRATEGIC PIVOT","CEO: 'We are pivoting to AI!' (Gravity Shift)"),this.engine.world.gravity.x=.2,setTimeout(()=>{this.engine.world.gravity.x=0},5e3);break;case 1:(i=this.onCrisis)==null||i.call(this,"THE BIG REORG","HR: 'New Org Chart Announced!' (No Friction)"),this.engine.world.bodies.forEach(r=>{r.isStatic||(r.oldFriction=r.friction,r.friction=0,r.frictionStatic=0)}),setTimeout(()=>{this.engine.world.bodies.forEach(r=>{r.isStatic||(r.friction=r.oldFriction||.1,r.frictionStatic=.5)})},5e3);break;case 2:(s=this.onCrisis)==null||s.call(this,"LEGACY DEPRECATION","CTO: 'Deprecating v1 API!' (Ghost Blocks)");const g=this.engine.world.bodies.filter(r=>!r.isStatic);if(g.length>3){const r=g[Math.floor(Math.random()*g.length)];r.isSensor=!0,setTimeout(()=>{r.isSensor=!1},4e3)}break;case 3:(a=this.onCrisis)==null||a.call(this,"FEATURE CREEP","PM: 'Just one more feature...' (1.2x Scaling)"),this.engine.world.bodies.forEach(r=>{r.isStatic||o.Body.scale(r,1.2,1.2)});break;case 4:(n=this.onCrisis)==null||n.call(this,"VIRAL SPIKE","DevOps: 'Traffic Spike!' (Earthquake)");let u=0;const h=setInterval(()=>{this.engine.world.bodies.forEach(r=>{r.isStatic||o.Body.applyForce(r,r.position,{x:(Math.random()-.5)*.05,y:(Math.random()-.5)*.05})}),++u>20&&clearInterval(h)},100);break}}toggleRotation(){this.spawnVertical=!this.spawnVertical}spawnBlock(t){if(!this.gameState.isPlaying())return;if(Math.random()<1/15){const a=[d.SLACKER,d.CONTROL_FREAK,d.PRIMA_DONNA,d.QUIET_QUITTER,d.SLACK_SPAMMER];t=a[Math.floor(Math.random()*a.length)]}t===d.BOOTSTRAP?this.gameState.spendMoney(5e3):t===d.VC&&this.gameState.addMoney(75e3);const e=this.width/2+(Math.random()-.5)*40,i=v(e,S,t);let s=this.spawnVertical?90*(Math.PI/180):0;t===d.VC&&(s+=(Math.random()-.5)*(30*(Math.PI/180))),o.Body.setAngle(i,s),i.gameData={type:t,value:t===d.VC?5e7:t===d.BOOTSTRAP?5e6:0,vested:!1,vestTimer:0},o.Composite.add(this.engine.world,i)}}const S=100;class x{constructor(t,e){l(this,"container");l(this,"options");l(this,"hudElement");this.container=t,this.options=e,this.initStyles(),this.createHUD(),this.createControls(),this.createLegend(),this.createSystemButtons(),this.options.gameState.subscribe(i=>{if(this.updateHUD(),i==="penalty")this.showToast(`-${this.options.gameState.lastPenaltyReason}`,"danger");else if(i!=null&&i.startsWith("funding:")){const s=i.split(":")[1];this.showToast(`+$${parseInt(s).toLocaleString()} Series Funding!`,"info")}}),this.updateHUD()}initStyles(){const t=document.createElement("style");t.textContent=`
11
+ `);u.forEach((h,r)=>t.fillText(h,0,r*50)),t.font='italic 700 24px "Inter", sans-serif',t.fillStyle="rgba(255, 255, 255, 0.04)",t.fillText(this.currentQuote.author,0,u.length*50+10),t.restore(),t.beginPath(),t.setLineDash([]),t.lineWidth=1,t.strokeStyle="rgba(255, 50, 50, 0.2)",t.strokeRect(g.x,g.y,g.w,g.h),t.font='bold 13px "Inter", sans-serif',t.textAlign="center",t.textBaseline="middle",t.fillStyle="#FFFFFF",this.engine.world.bodies.forEach(h=>{if(!h.label||h.label.includes("Body")||h.isStatic)return;const r=h.gameData,f=r&&r.vested;t.save(),t.translate(h.position.x,h.position.y),t.rotate(h.angle),f?(t.shadowColor="#00ff7f",t.shadowBlur=10,t.fillStyle="#00ff7f",t.fillText(h.label+" ✓",0,0)):(t.shadowColor="black",t.shadowBlur=4,t.fillStyle="#FFFFFF",t.fillText(h.label,0,0)),t.restore()})})}initGameLoop(){o.Events.on(this.runner,"afterUpdate",()=>{if(!this.gameState.isPlaying())return;const t=this.runner.delta;this.gameState.tick(t/1e3),this.gameState.valuation>=1e6&&(this.chaosTimer-=t,this.chaosTimer<=0&&(this.triggerChaosEvent(),this.chaosTimer=this.chaosInterval));const e=this.width/2,i=400,s=700;this.engine.world.bodies.forEach(a=>{if(a.isStatic)return;const n=a.gameData;if(Math.abs(a.position.x-e)>s/2||a.position.y>this.height+50){o.Composite.remove(this.engine.world,a);const u=["VC Scolding!","Server Outage!","GDPR Violation!","TechCrunch Hit Piece!","IP Lawsuit!"];this.gameState.penalty(5e4,u[Math.floor(Math.random()*u.length)]);return}if(n&&!n.vested){const u=a.speed<.15&&Math.abs(a.angularVelocity)<.05,h=Math.abs(a.position.x-e)<i/2;u&&h?(n.vestTimer+=this.runner.delta,n.vestTimer>1e3&&(n.vested=!0,this.gameState.addValuation(n.value))):n.vestTimer=0}})})}triggerChaosEvent(){var e,i,s,a,n;switch(Math.floor(Math.random()*5)){case 0:(e=this.onCrisis)==null||e.call(this,"STRATEGIC PIVOT","CEO: 'We are pivoting to AI!' (Gravity Shift)"),this.engine.world.gravity.x=.2,setTimeout(()=>{this.engine.world.gravity.x=0},5e3);break;case 1:(i=this.onCrisis)==null||i.call(this,"THE BIG REORG","HR: 'New Org Chart Announced!' (No Friction)"),this.engine.world.bodies.forEach(r=>{r.isStatic||(r.oldFriction=r.friction,r.friction=0,r.frictionStatic=0)}),setTimeout(()=>{this.engine.world.bodies.forEach(r=>{r.isStatic||(r.friction=r.oldFriction||.1,r.frictionStatic=.5)})},5e3);break;case 2:(s=this.onCrisis)==null||s.call(this,"LEGACY DEPRECATION","CTO: 'Deprecating v1 API!' (Ghost Blocks)");const g=this.engine.world.bodies.filter(r=>!r.isStatic);if(g.length>3){const r=g[Math.floor(Math.random()*g.length)];r.isSensor=!0,setTimeout(()=>{r.isSensor=!1},4e3)}break;case 3:(a=this.onCrisis)==null||a.call(this,"FEATURE CREEP","PM: 'Just one more feature...' (1.2x Scaling)"),this.engine.world.bodies.forEach(r=>{r.isStatic||o.Body.scale(r,1.2,1.2)});break;case 4:(n=this.onCrisis)==null||n.call(this,"VIRAL SPIKE","DevOps: 'Traffic Spike!' (Earthquake)");let u=0;const h=setInterval(()=>{this.engine.world.bodies.forEach(r=>{r.isStatic||o.Body.applyForce(r,r.position,{x:(Math.random()-.5)*.05,y:(Math.random()-.5)*.05})}),++u>20&&clearInterval(h)},100);break}}toggleRotation(){this.spawnVertical=!this.spawnVertical}spawnBlock(t){if(!this.gameState.isPlaying())return;if(Math.random()<1/15){const a=[d.SLACKER,d.CONTROL_FREAK,d.PRIMA_DONNA,d.QUIET_QUITTER,d.SLACK_SPAMMER];t=a[Math.floor(Math.random()*a.length)]}t===d.BOOTSTRAP?this.gameState.spendMoney(5e3):t===d.VC&&this.gameState.addMoney(75e3);const e=this.width/2+(Math.random()-.5)*40,i=v(e,S,t);let s=this.spawnVertical?90*(Math.PI/180):0;t===d.VC&&(s+=(Math.random()-.5)*(30*(Math.PI/180))),o.Body.setAngle(i,s),i.gameData={type:t,value:t===d.VC?5e7:t===d.BOOTSTRAP?5e6:0,vested:!1,vestTimer:0},o.Composite.add(this.engine.world,i)}}const S=100;class x{constructor(t,e){l(this,"container");l(this,"options");l(this,"hudElement");this.container=t,this.options=e,this.initStyles(),this.createHUD(),this.createControls(),this.createLegend(),this.createSystemButtons(),this.options.gameState.subscribe(i=>{if(this.updateHUD(),i==="penalty")this.showToast(`-${this.options.gameState.lastPenaltyReason}`,"danger");else if(i!=null&&i.startsWith("funding:")){const s=i.split(":")[1];this.showToast(`+$${parseInt(s).toLocaleString()} Series Funding!`,"info")}}),this.updateHUD()}initStyles(){const t=document.createElement("style");t.textContent=`
12
12
  .uj-hud {
13
13
  position: absolute;
14
14
  top: 20px; /* Restored to top */
@@ -237,23 +237,23 @@ TO AI`,author:"- Board"}];this.currentQuote=h[Math.floor(Math.random()*h.length)
237
237
  <strong style="color: #ff4444; font-size: 13px;">TOXIC (Risk: 1/15)</strong>
238
238
  <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 5px;">
239
239
  <div class="uj-legend-mini">
240
- <img src="./slacker.png" style="width: 30px; height: auto;">
240
+ <img src="https://raw.githubusercontent.com/Booby-Boobs/Pre-Mortem/main/public/slacker.png" style="width: 30px; height: auto;">
241
241
  <span>Slacker</span>
242
242
  </div>
243
243
  <div class="uj-legend-mini">
244
- <img src="./control-freak.png" style="width: 30px; height: auto;">
244
+ <img src="https://raw.githubusercontent.com/Booby-Boobs/Pre-Mortem/main/public/control-freak.png" style="width: 30px; height: auto;">
245
245
  <span>Control Freak</span>
246
246
  </div>
247
247
  <div class="uj-legend-mini">
248
- <img src="./prima-donna.png" style="width: 30px; height: auto;">
248
+ <img src="https://raw.githubusercontent.com/Booby-Boobs/Pre-Mortem/main/public/prima-donna.png" style="width: 30px; height: auto;">
249
249
  <span>Prima Donna</span>
250
250
  </div>
251
251
  <div class="uj-legend-mini">
252
- <img src="./quet-quitter.png" style="width: 30px; height: auto;">
252
+ <img src="https://raw.githubusercontent.com/Booby-Boobs/Pre-Mortem/main/public/quet-quitter.png" style="width: 30px; height: auto;">
253
253
  <span>Quiet Quitter</span>
254
254
  </div>
255
255
  <div class="uj-legend-mini">
256
- <img src="./slack-spammer.png" style="width: 30px; height: auto;">
256
+ <img src="https://raw.githubusercontent.com/Booby-Boobs/Pre-Mortem/main/public/slack-spammer.png" style="width: 30px; height: auto;">
257
257
  <span>Spammer</span>
258
258
  </div>
259
259
  </div>
@@ -326,7 +326,7 @@ TO AI`,author:"- Board"}];this.currentQuote=h[Math.floor(Math.random()*h.length)
326
326
  </div>
327
327
  </div>
328
328
  </div>
329
- `,this.container.appendChild(e),this.populateGlossaryLists();const i=()=>{if(e.remove(),t){this.options.gameState.setPaused(!1);const s=document.getElementById("uj-btn-pause");s&&(s.innerText="⏸ PAUSE")}};document.getElementById("uj-glossary-close").onclick=i,e.onclick=s=>{s.target===e&&i()}}populateGlossaryLists(){var i,s;const t=document.getElementById("uj-solid-list"),e=document.getElementById("uj-hype-list");t&&e&&((i=f[d.BOOTSTRAP].possibleLabels)==null||i.forEach(a=>{const n=document.createElement("li");n.textContent=a,t.appendChild(n)}),(s=f[d.VC].possibleLabels)==null||s.forEach(a=>{const n=document.createElement("li");n.textContent=a,e.appendChild(n)}))}createHUD(){this.hudElement=document.createElement("div"),this.hudElement.className="uj-hud",this.container.appendChild(this.hudElement)}updateHUD(){const t=this.options.gameState,e=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}),i=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:"compact",maximumFractionDigits:1}),a=t.isBankrupt()?"uj-stat-value danger":"uj-stat-value",n=t.getNextStageThreshold(),g=n>0?`<small style="font-size:12px; opacity:0.7">Next: ${i.format(n)}</small>`:"";this.hudElement.innerHTML=`
329
+ `,this.container.appendChild(e),this.populateGlossaryLists();const i=()=>{if(e.remove(),t){this.options.gameState.setPaused(!1);const s=document.getElementById("uj-btn-pause");s&&(s.innerText="⏸ PAUSE")}};document.getElementById("uj-glossary-close").onclick=i,e.onclick=s=>{s.target===e&&i()}}populateGlossaryLists(){var i,s;const t=document.getElementById("uj-solid-list"),e=document.getElementById("uj-hype-list");t&&e&&((i=m[d.BOOTSTRAP].possibleLabels)==null||i.forEach(a=>{const n=document.createElement("li");n.textContent=a,t.appendChild(n)}),(s=m[d.VC].possibleLabels)==null||s.forEach(a=>{const n=document.createElement("li");n.textContent=a,e.appendChild(n)}))}createHUD(){this.hudElement=document.createElement("div"),this.hudElement.className="uj-hud",this.container.appendChild(this.hudElement)}updateHUD(){const t=this.options.gameState,e=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}),i=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:"compact",maximumFractionDigits:1}),a=t.isBankrupt()?"uj-stat-value danger":"uj-stat-value",n=t.getNextStageThreshold(),g=n>0?`<small style="font-size:12px; opacity:0.7">Next: ${i.format(n)}</small>`:"";this.hudElement.innerHTML=`
330
330
  <div class="uj-stat-label">Stage</div>
331
331
  <div class="uj-stat-value">${t.stage}</div>
332
332
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pre-mortem",
3
- "version": "0.1.9",
3
+ "version": "0.2.2",
4
4
  "description": "The Exit Simulator: A satirical startup physics game",
5
5
  "main": "dist/pre-mortem.umd.js",
6
6
  "module": "dist/pre-mortem.mjs",