/*! For license information please see CookieMonster.js.LICENSE.txt */ (()=>{var e={877:function(e){!function(t,o){"use strict";"object"!=typeof e.exports?o(t):e.exports=t.document?o(t):function(e){if(!e.document)throw new Error("jscolor needs a window with document");return o(e)}}("undefined"!=typeof window?window:this,(function(e){"use strict";var t,o,n,i,a=((i={initialized:!1,instances:[],readyQueue:[],register:function(){void 0!==e&&e.document&&e.document.addEventListener("DOMContentLoaded",i.pub.init,!1)},installBySelector:function(t,o){if(!(o=o?i.node(o):e.document))throw new Error("Missing root node");for(var n=o.querySelectorAll(t),a=new RegExp("(^|\\s)("+i.pub.lookupClass+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r-1},isButtonEmpty:function(e){switch(i.nodeName(e)){case"input":return!e.value||""===e.value.trim();case"button":return""===e.textContent.trim()}return null},isPassiveEventSupported:function(){var t=!1;try{var o=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassive",null,o),e.removeEventListener("testPassive",null,o)}catch(e){}return t}(),isColorAttrSupported:(n=e.document.createElement("input"),!(!n.setAttribute||(n.setAttribute("type","color"),"color"!=n.type.toLowerCase()))),dataProp:"_data_jscolor",setData:function(){var e=arguments[0];if(3===arguments.length){var t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={},o=arguments[2];return t[a=arguments[1]]=o,!0}if(2===arguments.length&&"object"==typeof arguments[1]){t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={};var n=arguments[1];for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return!0}throw new Error("Invalid arguments")},removeData:function(){var e=arguments[0];if(!e.hasOwnProperty(i.dataProp))return!0;for(var t=1;t=3&&(n=l[0].match(s))&&(i=l[1].match(s))&&(a=l[2].match(s)))return o.format="rgb",o.rgba=[parseFloat(n[1])||0,parseFloat(i[1])||0,parseFloat(a[1])||0,null],l.length>=4&&(r=l[3].match(s))&&(o.format="rgba",o.rgba[3]=parseFloat(r[1])||0),o}return!1},parsePaletteValue:function(e){var t=[];"string"==typeof e?e.replace(/#[0-9A-F]{3}([0-9A-F]{3})?|rgba?\(([^)]*)\)/gi,(function(e){t.push(e)})):Array.isArray(e)&&(t=e);for(var o=[],n=0;ns[n]&&-t[n]+e[n]+l[n]/2>s[n]/2&&e[n]+l[n]-d[n]>=0?e[n]+l[n]-d[n]:e[n],-t[a]+e[a]+l[a]+d[a]-p+p*r>s[a]?-t[a]+e[a]+l[a]/2>s[a]/2&&e[a]+l[a]-p-p*r>=0?e[a]+l[a]-p-p*r:e[a]+l[a]-p+p*r:e[a]+l[a]-p+p*r>=0?e[a]+l[a]-p+p*r:e[a]+l[a]-p-p*r];else var u=[e[n],e[a]+l[a]-p+p*r];var m=u[n],h=u[a],g=o.fixed?"fixed":"absolute",f=(u[0]+d[0]>e[0]||u[0]0?Math.ceil(l/o):0,i=Math.max(1,Math.floor((t-(o-1)*e.paletteSpacing)/o)),a=e.paletteHeight?Math.min(e.paletteHeight,i):i),n&&(r=n*a+(n-1)*e.paletteSpacing),{cols:o,rows:n,cellW:i,cellH:a,width:t,height:r}},getControlPadding:function(e){return Math.max(e.padding/2,2*e.pointerBorderWidth+e.pointerThickness-e.controlBorderWidth)},getPadYChannel:function(e){switch(e.mode.charAt(1).toLowerCase()){case"v":return"v"}return"s"},getSliderChannel:function(e){if(e.mode.length>2)switch(e.mode.charAt(2).toLowerCase()){case"s":return"s";case"v":return"v"}return null},triggerCallback:function(e,t){if(e[t]){var o=null;if("string"==typeof e[t])try{o=new Function(e[t])}catch(e){console.error(e)}else o=e[t];o&&o.call(e)}},triggerGlobal:function(e){for(var t=i.getInstances(),o=0;o0)for(var c=0;c=2&&"string"==typeof arguments[0]){try{if(!a(arguments[0],arguments[1]))return!1}catch(e){return console.warn(e),!1}return this.redraw(),this.exposeColor(),!0}if(1===arguments.length&&"object"==typeof arguments[0]){var e=arguments[0],t=!0;for(var o in e)if(e.hasOwnProperty(o))try{a(o,e[o])||(t=!1)}catch(e){console.warn(e),t=!1}return this.redraw(),this.exposeColor(),t}throw new Error("Invalid arguments")},this.channel=function(e,t){if("string"!=typeof e)throw new Error("Invalid value for channel name: "+e);if(void 0===t)return this.channels.hasOwnProperty(e.toLowerCase())?this.channels[e.toLowerCase()]:(console.warn("Getting unknown channel: "+e),!1);var o=!1;switch(e.toLowerCase()){case"r":o=this.fromRGBA(t,null,null,null);break;case"g":o=this.fromRGBA(null,t,null,null);break;case"b":o=this.fromRGBA(null,null,t,null);break;case"h":o=this.fromHSVA(t,null,null,null);break;case"s":o=this.fromHSVA(null,t,null,null);break;case"v":o=this.fromHSVA(null,null,t,null);break;case"a":o=this.fromHSVA(null,null,null,t);break;default:return console.warn("Setting unknown channel: "+e),!1}return!!o&&(this.redraw(),!0)},this.trigger=function(e){for(var t=i.strList(e),o=0;o127.5},this.hide=function(){p()&&(i.removeClass(n.targetElement,i.pub.activeClassName),i.picker.wrap.parentNode.removeChild(i.picker.wrap),delete i.picker.owner)},this.show=function(){l()},this.redraw=function(){p()&&l()},this.getFormat=function(){return this._currentFormat},this._setFormat=function(e){this._currentFormat=e.toLowerCase()},this.hasAlphaChannel=function(){return"auto"===this.alphaChannel?"any"===this.format.toLowerCase()||i.isAlphaFormat(this.getFormat())||void 0!==this.alpha||void 0!==this.alphaElement:this.alphaChannel},this.processValueInput=function(e){this.fromString(e)||this.exposeColor()},this.processAlphaInput=function(e){this.fromHSVA(null,null,null,parseFloat(e))||this.exposeColor()},this.exposeColor=function(e){var t=this.toString(),o=this.getFormat();if(i.setDataAttr(this.targetElement,"current-color",t),e&i.flags.leaveValue||!this.valueElement||("hex"!==o&&"hexa"!==o||(this.uppercase||(t=t.toLowerCase()),this.hash||(t=t.replace(/^#/,""))),this.setValueElementValue(t)),!(e&i.flags.leaveAlpha)&&this.alphaElement){var n=Math.round(100*this.channels.a)/100;this.setAlphaElementValue(n)}e&i.flags.leavePreview||!this.previewElement||((i.isTextInput(this.previewElement)||i.isButton(this.previewElement)&&!i.isButtonEmpty(this.previewElement))&&this.previewPosition,this.setPreviewElementBg(this.toRGBAString())),p()&&(s(),c(),d())},this.setPreviewElementBg=function(e){if(this.previewElement){var t=null,o=null;(i.isTextInput(this.previewElement)||i.isButton(this.previewElement)&&!i.isButtonEmpty(this.previewElement))&&(t=this.previewPosition,o=this.previewSize);var n=[];if(e){n.push({image:i.genColorPreviewGradient(e,t,o?o-i.pub.previewSeparator.length:null),position:"left top",size:"auto",repeat:t?"repeat-y":"repeat",origin:"padding-box"});var a=i.genColorPreviewCanvas("rgba(0,0,0,0)",t?{left:"right",right:"left"}[t]:null,o,!0);n.push({image:"url('"+a.canvas.toDataURL()+"')",position:(t||"left")+" top",size:a.width+"px "+a.height+"px",repeat:t?"repeat-y":"repeat",origin:"padding-box"})}else n.push({image:"none",position:"left top",size:"auto",repeat:"no-repeat",origin:"padding-box"});for(var r={image:[],position:[],size:[],repeat:[],origin:[]},l=0;l=0;h-=1){var g=m[h];if(g)if(i.pub.presets.hasOwnProperty(g)){for(var u in i.pub.presets[g])if(i.pub.presets[g].hasOwnProperty(u))try{a(u,i.pub.presets[g][u])}catch(e){console.warn(e)}}else console.warn("Unknown preset: %s",g)}var f=["preset"];for(var u in o)if(o.hasOwnProperty(u)&&-1===f.indexOf(u))try{a(u,o[u])}catch(e){console.warn(e)}if(void 0===this.container?this.container=e.document.body:this.container=i.node(this.container),!this.container)throw new Error("Cannot instantiate color picker without a container element");if(this.targetElement=i.node(t),!this.targetElement){if("string"==typeof t&&/^[a-zA-Z][\w:.-]*$/.test(t))throw new Error("If '"+t+"' is supposed to be an ID, please use '#"+t+"' or any valid CSS selector.");throw new Error("Cannot instantiate color picker without a target element")}if(this.targetElement.jscolor&&this.targetElement.jscolor instanceof i.pub)throw new Error("Color picker already installed on this element");if(this.targetElement.jscolor=this,i.addClass(this.targetElement,i.pub.className),i.instances.push(this),i.isButton(this.targetElement)&&("button"!==this.targetElement.type.toLowerCase()&&(this.targetElement.type="button"),i.isButtonEmpty(this.targetElement))){i.removeChildren(this.targetElement),this.targetElement.appendChild(e.document.createTextNode(" "));var C=i.getCompStyle(this.targetElement);(parseFloat(C["min-width"])||0)-1){var G=i.parseColorString(b);this._currentFormat=G?G.format:"hex"}else this._currentFormat=this.format.toLowerCase();this.processValueInput(b),void 0!==k&&this.processAlphaInput(k)}}).pub.className="jscolor",i.pub.activeClassName="jscolor-active",i.pub.looseJSON=!0,i.pub.presets={},i.pub.presets.default={},i.pub.presets.light={backgroundColor:"rgba(255,255,255,1)",controlBorderColor:"rgba(187,187,187,1)",buttonColor:"rgba(0,0,0,1)"},i.pub.presets.dark={backgroundColor:"rgba(51,51,51,1)",controlBorderColor:"rgba(153,153,153,1)",buttonColor:"rgba(240,240,240,1)"},i.pub.presets.small={width:101,height:101,padding:10,sliderSize:14,paletteCols:8},i.pub.presets.medium={width:181,height:101,padding:12,sliderSize:16,paletteCols:10},i.pub.presets.large={width:271,height:151,padding:12,sliderSize:24,paletteCols:15},i.pub.presets.thin={borderWidth:1,controlBorderWidth:1,pointerBorderWidth:1},i.pub.presets.thick={borderWidth:2,controlBorderWidth:2,pointerBorderWidth:2},i.pub.sliderInnerSpace=3,i.pub.chessboardSize=8,i.pub.chessboardColor1="#666666",i.pub.chessboardColor2="#999999",i.pub.previewSeparator=["rgba(255,255,255,.65)","rgba(128,128,128,.65)"],i.pub.init=function(){if(!i.initialized)for(e.document.addEventListener("mousedown",i.onDocumentMouseDown,!1),e.document.addEventListener("keyup",i.onDocumentKeyUp,!1),e.addEventListener("resize",i.onWindowResize,!1),e.addEventListener("scroll",i.onWindowScroll,!1),i.pub.install(),i.initialized=!0;i.readyQueue.length;)i.readyQueue.shift()()},i.pub.install=function(e){var t=!0;try{i.installBySelector("[data-jscolor]",e)}catch(e){t=!1,console.warn(e)}if(i.pub.lookupClass)try{i.installBySelector("input."+i.pub.lookupClass+", button."+i.pub.lookupClass,e)}catch(e){}return t},i.pub.ready=function(e){return"function"!=typeof e?(console.warn("Passed value is not a function"),!1):(i.initialized?e():i.readyQueue.push(e),!0)},i.pub.trigger=function(e){var t=function(){i.triggerGlobal(e)};i.initialized?t():i.pub.ready(t)},i.pub.hide=function(){i.picker&&i.picker.owner&&i.picker.owner.hide()},i.pub.chessboard=function(e){return e||(e="rgba(0,0,0,0)"),i.genColorPreviewCanvas(e).canvas.toDataURL()},i.pub.background=function(e){var t=[];t.push(i.genColorPreviewGradient(e));var o=i.genColorPreviewCanvas();return t.push(["url('"+o.canvas.toDataURL()+"')","left top","repeat"].join(" ")),t.join(", ")},i.pub.options={},i.pub.lookupClass="jscolor",i.pub.installByClassName=function(){return console.error('jscolor.installByClassName() is DEPRECATED. Use data-jscolor="" attribute instead of a class name.'+i.docsRef),!1},i.register(),i.pub);return void 0===e.jscolor&&(e.jscolor=e.JSColor=a),a}))}},t={};function o(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,o),a.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";let e={};function t(){e.WrinklerButtons&&Game.elderWrath?(l("PopAllNormalWrinklerButton").style.display="",l("PopFattestWrinklerButton").style.display=""):(l("PopAllNormalWrinklerButton").style.display="none",l("PopFattestWrinklerButton").style.display="none")}const n=["","","M","G","T","P","E","Z","Y"],i=["","","M","B","Tr","Quadr","Quint","Sext","Sept","Oct","Non","Dec","Undec","Duodec","Tredec","Quattuordec","Quindec","Sexdec","Septendec","Octodec","Novemdec","Vigint","Unvigint","Duovigint","Trevigint","Quattuorvigint"],a=["","K","M","B","T","Qa","Qi","Sx","Sp","Oc","No","De","UDe","DDe","TDe","QaDe","QiDe","SxDe","SpDe","ODe","NDe","Vi","UVi","DVi","TVi","QaVi","QiVi","SxVi","SpVi","OVi","NVi","Tr","UTr","DTr","TTr","QaTr","QiTr","SxTr","SpTr","OTr","NTr","Qaa","UQa","DQa","TQa","QaQa","QiQa","SxQa","SpQa","OQa","NQa","Qia","UQi","DQi","TQi","QaQi","QiQi","SxQi","SpQi","OQi","NQi","Sxa","USx","DSx","TSx","QaSx","QiSx","SxSx","SpSx","OSx","NSx","Spa","USp","DSp","TSp","QaSp","QiSp","SxSp","SpSp","OSp","NSp","Oco","UOc","DOc","TOc","QaOc","QiOc","SxOc","SpOc","OOc","NOc","Noa","UNo","DNo","TNo","QaNo","QiNo","SxNo","SpNo","ONo","NNo","Ct","UCt"];let r,s,c,d,p,u,m,h,g,f,C,y,b,k,G,v,w,x,T=[],M=[],S=[],P={};const B="CMText",E="CMBack",N="Blue",O="Green",F="Yellow",W="Orange",L="Red",A="Purple",j="Gray",D="Pink",H="Brown",U=[j,N,O,F,W,L,A,D,H],$=[["GoldCookTooltipPlaceholder","Calculated with Golden Switch off","200px"],["GoldCookDragonsFortuneTooltipPlaceholder","Calculated with Golden Switch off and at least one golden cookie on-screen","240px"],["PrestMaxTooltipPlaceholder","The MAX prestige is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg","320px"],["NextPrestTooltipPlaceholder","Calculated with cookies gained from wrinklers and Chocolate egg","200px"],["HeavenChipMaxTooltipPlaceholder","The MAX heavenly chips is calculated with the cookies gained from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and buying Chocolate egg","330px"],["ResetTooltipPlaceholder","The bonus income you would get from new prestige levels unlocked at 100% of its potential and from ascension achievements if you have the same buildings/upgrades after reset","370px"],["ChoEggTooltipPlaceholder","The amount of cookies you would get from popping all wrinklers with Skruuia god in Diamond slot, selling all stock market goods, selling all buildings with Earth Shatterer and Reality Bending auras, and then buying Chocolate egg","300px"],["ChainNextLevelPlaceholder","Cheated cookies might break this formula","250px"],["FavouriteSettingPlaceholder","Click to set this setting as favourite and show it in 'favourite' settings at the top of the Cookie Monster Settings","250px"]],R={};let I,z,V=0,_=-1,Q=[],X=1,q=1,Y=1;const K=[10,15,30,60,300,600,900,1800],J=[1,5,10,15,30],Z={Frenzy:F,"Dragon Harvest":H,"Elder frenzy":O,Clot:L,"Click frenzy":N,Dragonflight:D};let ee,te,oe,ne,ie,ae,re,le={},se="",ce=[];function de(t,o,r){const l=e.ScaleDecimals+1;if(t===1/0)return"Infinity";if(void 0===t)return"0";if(0===e.Scale)return P.Beautify(t,o);if(Number.isFinite(t)){if(t<0)return`-${de(Math.abs(t))}`;let s="";if(0===t)return t.toString();if(t>.001&&t=.01&&t=.01&&t=.01&&t315576e4)return"XX:XX:XX:XX:XX";c+=(i<10?"0":"")+i+":",c+=(a<10?"0":"")+a+":",c+=(r<10?"0":"")+r+":",c+=(l<10?"0":"")+l+":",c+=(s<10?"0":"")+s}else{if(n>7776e5)return o?"Over 9000 days!":">9000d";c+=i>0?i+(o?1===i?" year":" years":"y")+", ":"",c+=a>0?a+(o?1===a?" day":" days":"d")+", ":"",(c.length>0||r>0)&&(c+=r+(o?1===r?" hour":" hours":"h")+", "),(c.length>0||l>0)&&(c+=l+(o?1===l?" minute":" minutes":"m")+", "),c+=s+(o?1===s?" second":" seconds":"s")}return c}function ue(t){let o,n;return t<=0?(n=e.TimeFormat?"00:00:00:00:00":"Done!",o=O):(n=pe(t),o=t>300?L:t>60?W:F),{text:n,color:o}}let me,he,ge,fe,Ce,ye,be,ke,Ge,ve,we,xe,Te,Me,Se,Pe,Be,Ee,Ne,Oe,Fe,We,Le,Ae,je,De,He,Ue,$e,Re,Ie,ze,Ve,_e,Qe,Xe,qe=0,Ye=0,Ke=0,Je=0,Ze=0,et=0,tt=0,ot=0,nt=0,it=0,at=0,rt=0,lt=0,st=0,ct=0,dt=1,pt=1,ut=1,mt=0,ht=0,gt=0,ft=0,Ct={},yt={},bt={},kt=0,Gt=0,vt=[0,null],wt=0,xt=0,Tt={},Mt={},St={},Pt={},Bt={},Et=0,Nt=0,Ot=[],Ft=0,Wt=0,Lt=[],At=0,jt=0,Dt=[],Ht=0,Ut=0,$t=[],Rt=0,It=0,zt={},Vt={},_t=0,Qt=0,Xt=[],qt={},Yt=0,Kt={0:[0,0,0],1:[0,0,0],2:[0,0,0],3:[0,0,0],4:[0,0,0],5:[0,0,0],6:[0,0,0],7:[0,0,0],8:[0,0,0],9:[0,0,0],10:[0,0,0]},Jt=[],Zt=[],eo=[];function to(e){let t=0;return Game.dragonAuras[Ue].name!==e&&Game.dragonAuras[$e].name!==e||(t=1),"Reality Bending"!==Game.dragonAuras[Ue].name&&"Reality Bending"!==Game.dragonAuras[$e].name||(t+=.1),t}function oo(){let e=.25;return e*=1+to("Earth Shatterer"),e}function no(e,t){return void 0===_e[e]?void 0===t?1:t:_e[e]}function io(e){const t=Zt[e];return(1!==Game.ascensionMode||"prestige"!==t.pool&&"fortune"!==t.tier)&&t?t.bought:0}function ao(e){if(Game.hasGod){void 0===Jt.Temple.minigame&&(Jt.Temple.minigame=Game.Objects.Temple.minigame);const t=Jt.Temple.minigame.gods[e];if(Re===t.id)return 1;if(Ie===t.id)return 2;if(ze===t.id)return 3}return!1}function ro(e,t){let o=t;if(io("Season savings")&&(o*=.99),io("Santa's dominion")&&(o*=.99),io("Faberge egg")&&(o*=.99),io("Divine discount")&&(o*=.99),io("Fortune #100")&&(o*=.99),o*=1-.02*to("Fierce Hoarder"),Game.hasBuff("Everything must go")&&(o*=.95),Game.hasBuff("Crafty pixies")&&(o*=.98),Game.hasBuff("Nasty goblins")&&(o*=1.02),e.fortune&&io(e.fortune.name)&&(o*=.93),o*=no("buildingCost"),Jt.Temple.minigameLoaded){const e=ao("creation");1===e?o*=.93:2===e?o*=.95:3===e&&(o*=.98)}return o}function lo(e,t,o,n,i,a){const r=void 0===a?0:a;let l=i,s=o,c=0;-1===i&&(l=s),i||(l=Game.buyBulk);for(let o=0;o0&&(c+=o,s-=1)}return c}function so(){let t=Game.buyBulk;if(1===Game.buyMode?q=t:t=q,1===t?t=Ct:10===t?t=yt:100===t&&(t=bt),1===Game.buyMode?1===e.BuildColour?Object.keys(t).forEach((o=>{l(`productPrice${Game.Objects[o].id}`).style.color=e[`Colour${t[o].color}`]})):Object.keys(Game.Objects).forEach((e=>{l(`productPrice${Game.Objects[e].id}`).style.removeProperty("color")})):-1===Game.buyMode&&Object.keys(Ct).forEach((e=>{const t=Game.Objects[e];l(`productPrice${t.id}`).style.color="",l(`productPrice${t.id}`).innerHTML=de(lo(t,t.basePrice,t.amount,t.free,Game.buyBulk,1))})),1===Game.buyMode&&e.SortBuildings){let o;1===e.SortBuildings?(o=Object.keys(Ct).map((e=>{const t=Ct[e];return t.name=e,t.id=Game.Objects[e].id,t})),o.sort((function(e,t){return U.indexOf(e.color)>U.indexOf(t.color)?1:U.indexOf(e.color){const o=t[e];return o.name=e,o.id=Game.Objects[e].id,o})),o.sort((function(e,t){return U.indexOf(e.color)>U.indexOf(t.color)?1:U.indexOf(e.color){const t=Ct[e];return t.name=e,t.id=Game.Objects[e].id,t}));e.sort(((e,t)=>e.id-t.id));for(let t=0;t0){let e=0,t=0,o=0,n=0,i=0,a=0,r=0;Object.keys(Game.UpgradesInStore).forEach((s=>{const c=Game.UpgradesInStore[s];let d=!1;for(let e=0;eU.indexOf(t.color)?1:U.indexOf(e.color)e.price-t.price));const o=function(e,t){return e.findIndex((e=>e.name===t.name))};for(let e=0;e{let n,i=Game.buyBulk;1===Game.buyMode?X=i:i=X,1===i&&(i=Ct),10===i&&(i=yt),100===i&&(i=bt),t+=1,l("CMBotBar").firstChild.firstChild.childNodes[0].childNodes[t].childNodes[1].textContent=Game.Objects[o].amount,l("CMBotBar").firstChild.firstChild.childNodes[1].childNodes[t].textContent=de(i[o].bonus,2),l("CMBotBar").firstChild.firstChild.childNodes[2].childNodes[t].className=B+i[o].color,n=e.PPDisplayTime?pe(Math.round(i[o].pp)):de(Math.round(i[o].pp),2),l("CMBotBar").firstChild.firstChild.childNodes[2].childNodes[t].textContent=n;const a=ue((Game.Objects[o].bulkPrice-(Game.cookies+uo()))/po());l("CMBotBar").firstChild.firstChild.childNodes[3].childNodes[t].className=B+a.color,"Done!"===a.text&&Game.cookies{!Game.Tiers[e.tieredUpgrades[o].tier].special&&io(e.tieredUpgrades[o].name)&&(t*=2)})),Object.keys(e.synergies).forEach((o=>{if(io(e.synergies[o].name)){const n=e.synergies[o];n.buildingTie1.name===e.name?t*=1+.05*n.buildingTie2.amount:n.buildingTie2.name===e.name&&(t*=1+.001*n.buildingTie1.amount)}})),e.fortune&&io(e.fortune.name)&&(t*=1.07),e.grandma&&io(e.grandma.name)&&(t*=1+.01*Jt.Grandma.amount*(1/(e.id-1))),"object"==typeof e.tieredUpgrades.misfortune&&1===e.vanilla&&io(e.tieredUpgrades.misfortune.name))switch(Game.elderWrath){default:t*=1;break;case 1:t*=1.02;break;case 2:t*=1.04;break;case 3:t*=1.06}return t}function vo(e){const t=Game.Objects[e],o={};return"Cursor"===t.name?o.cps=function(e){let t=0;io("Thousand fingers")&&(t+=.1),io("Million fingers")&&(t*=5),io("Billion fingers")&&(t*=10),io("Trillion fingers")&&(t*=20),io("Quadrillion fingers")&&(t*=20),io("Quintillion fingers")&&(t*=20),io("Sextillion fingers")&&(t*=20),io("Septillion fingers")&&(t*=20),io("Octillion fingers")&&(t*=20),io("Nonillion fingers")&&(t*=20);let o=1,n=0;return Object.keys(Jt).forEach((e=>{"Cursor"!==Jt[e].name&&(n+=Jt[e].amount)})),t*=n,o*=Go(e),o*=Game.magicCpS("Cursor"),o*=no("cursorCps"),Game.ComputeCps(.1,io("Reinforced index finger")+io("Carpal tunnel prevention cream")+io("Ambidextrous"),t)*o}:"Grandma"===t.name?o.cps=function(e){let o=1;if(Object.keys(Game.GrandmaSynergies).forEach((e=>{io(Game.GrandmaSynergies[e])&&(o*=2)})),io("Bingo center/Research facility")&&(o*=4),io("Ritual rolling pins")&&(o*=2),io("Naughty list")&&(o*=2),io("Elderwort biscuits")&&(o*=1.02),o*=no("grandmaCps"),io("Cat ladies"))for(let e=0;e{"Grandma"!==Jt[e].name&&(i+=Jt[e].amount)})),o*=1+.01*to("Elder Battalion")*i,o*=Game.magicCpS(t.name),(t.baseCps+n)*o}:o.cps=function(e){let t=1;return t*=Go(e),t*=Game.magicCpS(e.name),e.baseCPS*t},o.baseCps=t.baseCps,o.name=t.name,o.tieredUpgrades=t.tieredUpgrades,o.synergies=t.synergies,o.fortune=t.fortune,o.grandma=t.grandma,o.baseCPS=t.baseCps,o.id=t.id,o.vanilla=t.vanilla,o}function wo(e){const t=Game.Upgrades[e],o={};return o.power=t.power,"function"==typeof o.power&&("Sugar crystal cookies"===t.name?o.power=function(){let e=5;return Object.keys(Jt).forEach((t=>{Jt[t].level>=10&&(e+=1)})),e}:o.power=function(){let e=2;if(io("Starlove")&&(e=3),Game.hasGod){const t=ao("seasons");1===t?e*=1.3:2===t?e*=1.2:3===t&&(e*=1.1)}return e}),o.pool=t.pool,o.name=t.name,o}function xo(){Le=Game.UpgradesOwned,Ae=Game.pledges,je=Game.AchievementsOwned,De=Game.heavenlyPower,He=Game.prestige,Object.keys(Game.Objects).forEach((e=>{const t=Game.Objects[e];let o=Jt[e];void 0===o&&(Jt[e]=vo(e),o=Jt[e],ho(e)),o.amount=t.amount,o.level=t.level,o.totalCookies=t.totalCookies,o.basePrice=t.basePrice,o.free=t.free,t.minigameLoaded&&("Temple"===t.name&&(Re=t.minigame.slot[0],Ie=t.minigame.slot[1],ze=t.minigame.slot[2]),o.minigameLoaded=t.minigameLoaded,o.minigame=t.minigame),Jt[e]=o})),Object.keys(Game.Upgrades).forEach((e=>{const t=Game.Upgrades[e];let o=Zt[e];void 0===o&&(Zt[e]=wo(e),o=Zt[e]),o.bought=t.bought,Zt[e]=o})),Object.keys(Game.Achievements).forEach((e=>{const t=Game.Achievements[e];let o=eo[e];void 0===o&&(eo[e]=ko(e),o=eo[e]),o.won=t.won,eo[e]=o})),bo(),Ue=qe,$e=Ye}function To(e){const t=document.createElement("div");return t.style.fontWeight="bold",t.id=`${e}Title`,t.className="CMTextBlue",t.textContent=e,t}function Mo(e){e.appendChild(To("Bonus Income"));const t=document.createElement("div");t.style.marginBottom="4px",t.style.color="white",t.id="CMTooltipIncome",e.appendChild(t),e.appendChild(To("Bonus Cookies per Click")),e.lastChild.style.display="none";const o=document.createElement("div");o.style.marginBottom="4px",o.style.color="white",o.style.display="none",o.id="CMTooltipCookiePerClick",e.appendChild(o),e.appendChild(To("Payback Period"));const n=document.createElement("div");n.style.marginBottom="4px",n.id="CMTooltipPP",e.appendChild(n),e.appendChild(To("Time Left"));const i=document.createElement("div");if(i.id="CMTooltipTime",e.appendChild(i),"b"===oe){e.appendChild(To("Production left till next achievement")),e.lastChild.id="CMTooltipProductionHeader";const t=document.createElement("div");t.id="CMTooltipProduction",e.appendChild(t)}}function So(e,t,o){let n=e,i=0;for(;n{void 0!==Game.buffs[t].multCpS&&(e*=Game.buffs[t].multCpS)})),e}function Bo(){null!==l("CMDispTooltipWarningParent")&&(0===e.ToolWarnPos?(l("CMDispTooltipWarningParent").style.top="auto",l("CMDispTooltipWarningParent").style.margin="4px -4px",l("CMDispTooltipWarningParent").style.padding="3px 4px"):(l("CMDispTooltipWarningParent").style.right="auto",l("CMDispTooltipWarningParent").style.margin="4px",l("CMDispTooltipWarningParent").style.padding="4px 3px"))}function Eo(){if(xo(),"none"!==l("tooltipAnchor").style.display&&l("CMTooltipArea")){l("CMTooltipArea").innerHTML="";const t=function(){l("tooltip").firstChild.style.paddingBottom="4px";const e=document.createElement("div");return e.style.border="1px solid",e.style.padding="4px",e.style.margin="0px -4px",e.id="CMTooltipBorder",e.className="CMTextGray",e}();l("CMTooltipArea").appendChild(t),"b"===oe?function(){if(1===e.TooltipBuildUpgrade&&1===Game.buyMode){let t;if(Mo(l("CMTooltipBorder")),1===Game.buyMode?Y=t:t=Y,1===Game.buyBulk?t=Ct:10===Game.buyBulk?t=yt:100===Game.buyBulk&&(t=bt),ee=Game.Objects[ne].bulkPrice,te=t[ne].bonus,1===e.TooltipBuildUpgrade&&1===Game.buyMode){l("CMTooltipIncome").textContent=de(te,2);const o=Math.round(te/Game.cookiesPs*1e4);Number.isFinite(o)&&0!==o?l("CMTooltipIncome").textContent+=` (${o/100}% of income)`:l("CMTooltipIncome").textContent+=` (<0${e.ScaleSeparator?",":"."}01% of income)`,l("CMTooltipBorder").className=B+t[ne].color,e.PPDisplayTime?l("CMTooltipPP").textContent=pe(t[ne].pp):l("CMTooltipPP").textContent=de(t[ne].pp,2),l("CMTooltipPP").className=B+t[ne].color;const n=ue((ee-(Game.cookies+uo()))/po());l("CMTooltipTime").textContent=n.text,"Done!"===n.text&&Game.cookiest.plantsById[t.plot[ne[1]][ne[0]][0]-1].mature,o=t.plantsById[t.plot[ne[1]][ne[0]][0]-1].name;l("CMTooltipBorder").appendChild(To("Reward (Current / Maximum)"));const n=document.createElement("div");n.id="CMTooltipPlantReward",l("CMTooltipBorder").appendChild(n),"Bakeberry"===o?l("CMTooltipPlantReward").textContent=`${e?de(Math.min(.03*Game.cookies,60*Game.cookiesPs*30)):"0"} / ${de(60*Game.cookiesPs*30)}`:"Chocoroot"===o||"White chocoroot"===o?l("CMTooltipPlantReward").textContent=`${e?de(Math.min(.03*Game.cookies,60*Game.cookiesPs*3)):"0"} / ${de(60*Game.cookiesPs*3)}`:"Queenbeet"===o?l("CMTooltipPlantReward").textContent=`${e?de(Math.min(.04*Game.cookies,60*Game.cookiesPs*60)):"0"} / ${de(60*Game.cookiesPs*60)}`:"Duketater"===o?l("CMTooltipPlantReward").textContent=`${e?de(Math.min(.08*Game.cookies,60*Game.cookiesPs*120)):"0"} / ${de(60*Game.cookiesPs*120)}`:l("CMTooltipArea").style.display="none"}else l("CMTooltipArea").style.display="none"}():"ha"===oe?function(){const{minigame:t}=Game.Objects.Farm;if(e.TooltipLump){l("CMTooltipBorder").appendChild(To("Cookies gained from harvesting:"));let e=0,o=0;Game.keys[16]&&Game.keys[17]&&(o=1);for(let n=0;n<6;n++)for(let i=0;i<6;i++)if(t.plot[n][i][0]>=1){const a=t.plot[n][i],r=t.plantsById[a[0]-1],l=r.name;let s=!0;o&&r.immortal&&(s=!1),a[1]0&&t=1?l("CMTimerBarGCMinBar").textContent=Math.ceil((Game.shimmerTypes.golden.minTime-Game.shimmerTypes.golden.time)/Game.fps):l("CMTimerBarGCMinBar").textContent="",Game.shimmerTypes.golden.minTime===Game.shimmerTypes.golden.maxTime?(l("CMTimerBarGCMinBar").style.borderTopRightRadius="10px",l("CMTimerBarGCMinBar").style.borderBottomRightRadius="10px"):(l("CMTimerBarGCMinBar").style.borderTopRightRadius="",l("CMTimerBarGCMinBar").style.borderBottomRightRadius=""),l("CMTimerBarGCBar").style.width=`${Math.round(Math.min(Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.minTime,Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)*t/Game.shimmerTypes.golden.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarGCBar").textContent=Math.ceil(Math.min(Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.minTime,Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps):l("CMTimerBarGCBar").textContent="",l("CMTimerBarGCTime").textContent=Math.ceil((Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps),n+=1),"christmas"===Game.season&&0===Game.shimmerTypes.reindeer.spawned?(l("CMTimerBarRen").style.display="",l("CMTimerBarRenMinBar").style.width=`${Math.round(Math.max(0,Game.shimmerTypes.reindeer.minTime-Game.shimmerTypes.reindeer.time)*t/Game.shimmerTypes.reindeer.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarRenMinBar").textContent=Math.ceil((Game.shimmerTypes.reindeer.minTime-Game.shimmerTypes.reindeer.time)/Game.fps):l("CMTimerBarRenMinBar").textContent="",l("CMTimerBarRenBar").style.width=`${Math.round(Math.min(Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.minTime,Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)*t/Game.shimmerTypes.reindeer.maxTime)}px`,e.TimerBarOverlay>=1?l("CMTimerBarRenBar").textContent=Math.ceil(Math.min(Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.minTime,Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps):l("CMTimerBarRenBar").textContent="",l("CMTimerBarRenTime").textContent=Math.ceil((Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps),n+=1):l("CMTimerBarRen").style.display="none";const i={};l("CMTimerBarBuffTimers").innerHTML="",Object.keys(Game.buffs).forEach((t=>{if(Game.buffs[t]){const a=mo(Game.buffs[t].name,Game.buffs[t].name,[{id:`${Game.buffs[t].name}Bar`}]);a.style.display="";let r="";r=void 0!==Z[Game.buffs[t].name]?Z[Game.buffs[t].name]:A,a.lastChild.children[1].className=E+r,a.lastChild.children[1].style.color="black",2===e.TimerBarOverlay?a.lastChild.children[1].textContent=`${Math.round(Game.buffs[t].time/Game.buffs[t].maxTime*100)}%`:a.lastChild.children[1].textContent="",a.lastChild.children[1].style.width=`${Math.round(Game.buffs[t].time*(o-8*Math.ceil(Game.buffs[t].time/Game.fps).toString().length)/Game.buffs[t].maxTime)}px`,a.lastChild.children[2].textContent=Math.ceil(Game.buffs[t].time/Game.fps),n+=1,i[Game.buffs[t].name]=a}})),Object.keys(i).forEach((e=>{l("CMTimerBarBuffTimers").appendChild(i[e])})),0!==n&&(l("CMTimerBar").style.height=12*n+2+"px"),re!==n&&(re=n,Co())}}(),go(),Eo(),function(){if(1===e.TooltipWrink&&1===V){let e=!1;Object.keys(Game.wrinklers).forEach((t=>{const o=Game.wrinklers[t];if(o.phase>0&&o.selected){if(e=!0,0===Q[t]||void 0===Q[t]){const e=document.createElement("div"),o=document.createElement("div");o.style.minWidth="120px",o.style.marginBottom="4px";const n=document.createElement("div");n.style.textAlign="center",n.id="CMTooltipWrinkler",o.appendChild(n),e.appendChild(o),Game.tooltip.draw(this,escape(e.innerHTML)),_=t,Q[t]=1}}else Q[t]=0})),e||Game.tooltip.hide()}}(),function(){if(1===e.TooltipWrink&&null!==l("CMTooltipWrinkler")){let{sucked:e}=Game.wrinklers[_],t=1.1;if(Game.Has("Sacrilegious corruption")&&(t*=1.05),1===Game.wrinklers[_].type&&(t*=3),e*=t,Game.Has("Wrinklerspawn")&&(e*=1.05),Jt.Temple.minigameLoaded){const t=Game.hasGod("scorn");1===t?e*=1.15:2===t?e*=1.1:3===t&&(e*=1.05)}l("CMTooltipWrinkler").textContent=de(e)}}(),e.UpStats&&"stats"===Game.onMenu&&(Game.drawT-1)%(5*Game.fps)!=0&&(Game.drawT-1)%Game.fps==0&&Game.UpdateMenu(),t(),e.Scale){let e=l("cookies").innerHTML.replace(/.*(?=
)/i,de(Game.cookies));Game.prefs.monospace&&(e=`${e}`),l("cookies").innerHTML=e}}function Oo(){me.addLatest(Game.computedMouseCps)}class Fo{constructor(e){this.maxLength=e,this.queue=[]}addLatest(e){this.queue.push(e)>this.maxLength&&this.queue.shift()}calcAverage(e){let t=e;t>this.maxLength&&(t=this.maxLength),t>this.queue.length&&(t=this.queue.length);let o=0;for(let e=this.queue.length-1;e>=0&&e>this.queue.length-1-t;e--)o+=this.queue[e];return 0===o?0:o/t}calcSum(e){let t=e;return t>this.maxLength&&(t=this.maxLength),t>this.queue.length&&(t=this.queue.length),0===t?0:this.queue.slice(-t).reduce(((e,t)=>e+t),0)}}function Wo(){const t=Math.floor(Date.now()/1e3);if(Game.T/Game.fps%1==0){let o=Game.cookies+Yt;Game.cpsSucked>0&&(o+=kt),Rt=Math.max(Game.cookiesEarned,o),o*=.05;const n=t-ke,i=Math.max(0,Game.cookies-Ge)/n,a=Math.max(0,kt-ve)/n,r=Math.max(0,vt[0]-we)/n,l=Math.max(0,o-ft)/n,s=(Game.cookieClicks-xe)/n;for(let e=0;e0&&(n=L),n}function Ao(t,o){Object.keys(t).forEach((n=>{if(e.PPRigidelMode&&1===o)t[n].color=j;else{t[n].color=Lo(t[n],Game.Objects[n].getSumPrice(o));for(let o=0;o{const i=Game.Objects[n].getSumPrice(o);Game.cookiesPs?t[n].pp=Math.max(i-(Game.cookies+uo()),0)/Game.cookiesPs+i/t[n].bonus:t[n].pp=i/t[n].bonus,e.PPRigidelMode&&1===o||Xt.push([t[n].pp,o])}))}function Do(){!function(){Qt=1/0,Xt=[],void 0===e.PPExcludeTop&&(e.PPExcludeTop=0),jo(Ct,1),jo(yt,10),jo(bt,100),Xt.sort(((e,t)=>e[0]-t[0]));let t=0;if(e.PPOnlyConsiderBuyable)for(;Xt[t][1]>Game.cookies&&(t+=1,Xt.length!==t+1););Qt=Xt[e.PPExcludeTop][t],Ao(Ct,1),Ao(yt,10),Ao(bt,100)}(),Object.keys(Tt).forEach((e=>{Game.cookiesPs?Tt[e].pp=Math.max(Game.Upgrades[e].getPrice()-(Game.cookies+uo()),0)/Game.cookiesPs+Game.Upgrades[e].getPrice()/Tt[e].bonus:Tt[e].pp=Game.Upgrades[e].getPrice()/Tt[e].bonus,Number.isNaN(Tt[e].pp)&&(Tt[e].pp=1/0),Tt[e].color=Lo(Tt[e],Game.Upgrades[e].getPrice())}))}function Ho(e,t,o,n,i){let a=o,r=0;for(let o=0;o{if(Game.Objects[e].minigameLoaded&&Game.Objects[e].minigame.effs){const o=Game.Objects[e].minigame.effs;Object.keys(o).forEach((e=>{t[e]?t[e]*=o[e]:t[e]=o[e]}))}})),_e=t,1!==Game.ascensionMode&&(e+=.01*parseFloat(He)*De*function(){let e=0;if(io("Heavenly chip secret")&&(e+=.05),io("Heavenly cookie stand")&&(e+=.2),io("Heavenly bakery")&&(e+=.25),io("Heavenly confectionery")&&(e+=.25),io("Heavenly key")&&(e+=.25),e*=1+.05*to("Dragon God"),io("Lucky digit")&&(e*=1.01),io("Lucky number")&&(e*=1.01),io("Lucky payout")&&(e*=1.01),Game.hasGod){const t=ao("creation");1===t?e*=.7:2===t?e*=.8:3===t&&(e*=.9)}return e}()),e*=no("cps"),io("Heralds")&&1!==Game.ascensionMode&&(e*=1+.01*Game.heralds),Object.keys(Game.cookieUpgrades).forEach((t=>{const o=Game.cookieUpgrades[t];io(o.name)&&("function"==typeof o.power?e*=1+.01*Zt[o.name].power(Zt[o.name]):e*=1+.01*o.power)})),io("Specialized chocolate chips")&&(e*=1.01),io("Designer cocoa beans")&&(e*=1.02),io("Underworld ovens")&&(e*=1.03),io("Exotic nuts")&&(e*=1.04),io("Arcane sugar")&&(e*=1.05),io("Increased merriness")&&(e*=1.15),io("Improved jolliness")&&(e*=1.15),io("A lump of coal")&&(e*=1.01),io("An itchy sweater")&&(e*=1.01),io("Santa's dominion")&&(e*=1.2),io("Fortune #100")&&(e*=1.01),io("Fortune #101")&&(e*=1.07),io("Dragon scale")&&(e*=1.03);let o=1;if(ao){let t=ao("asceticism");1===t?e*=1.15:2===t?e*=1.1:3===t&&(e*=1.05),t=ao("ages"),1===t?e*=1+.15*Math.sin(w/1e3/10800*Math.PI*2):2===t?e*=1+.15*Math.sin(w/1e3/43200*Math.PI*2):3===t&&(e*=1+.15*Math.sin(w/1e3/86400*Math.PI*2)),t=ao("decadence"),1===t?o*=.93:2===t?o*=.95:3===t&&(o*=.98),t=ao("industry"),1===t?o*=1.1:2===t?o*=1.06:3===t&&(o*=1.03),t=ao("labor"),1===t?o*=.97:2===t?o*=.98:3===t&&(o*=.99)}io("Santa's legacy")&&(e*=1+.03*(Game.santaLevel+1));const n=je/25;let i=1;if(io("Santa's milk and cookies")&&(i*=1.05),i*=1+.05*to("Breath of Milk"),ao){const e=ao("mother");1===e?i*=1.1:2===e?i*=1.05:3===e&&(i*=1.03)}i*=no("milk");let a=1;io("Kitten helpers")&&(a*=1+.1*n*i),io("Kitten workers")&&(a*=1+.125*n*i),io("Kitten engineers")&&(a*=1+.15*n*i),io("Kitten overseers")&&(a*=1+.175*n*i),io("Kitten managers")&&(a*=1+.2*n*i),io("Kitten accountants")&&(a*=1+.2*n*i),io("Kitten specialists")&&(a*=1+.2*n*i),io("Kitten experts")&&(a*=1+.2*n*i),io("Kitten consultants")&&(a*=1+.2*n*i),io("Kitten assistants to the regional manager")&&(a*=1+.175*n*i),io("Kitten marketeers")&&(a*=1+.15*n*i),io("Kitten analysts")&&(a*=1+.125*n*i),io("Kitten executives")&&(a*=1+.115*n*i),io("Kitten angels")&&(a*=1+.1*n*i),io("Fortune #103")&&(a*=1+.05*n*i),Object.keys(Jt).forEach((e=>{const t=Jt[e];let a=t.cps(t);1!==Game.ascensionMode&&(a*=(1+.01*t.level)*o),"Grandma"===t.name&&io("Milkhelp® lactose intolerance relief tablets")&&(a*=1+.05*n*i),Qe+=t.amount*a})),io('"egg"')&&(Qe+=9),e*=a;let r=1;if(io("Chicken egg")&&(r*=1.01),io("Duck egg")&&(r*=1.01),io("Turkey egg")&&(r*=1.01),io("Quail egg")&&(r*=1.01),io("Robin egg")&&(r*=1.01),io("Ostrich egg")&&(r*=1.01),io("Cassowary egg")&&(r*=1.01),io("Salmon roe")&&(r*=1.01),io("Frogspawn")&&(r*=1.01),io("Shark egg")&&(r*=1.01),io("Turtle egg")&&(r*=1.01),io("Ant larva")&&(r*=1.01),io("Century egg")){let e=10*Math.floor((w-Game.startDate)/1e3/10)/60/60/24;e=Math.min(e,100),ht=1+.1*(1-(1-e/100)**3),r*=ht}e*=r,io("Sugar baking")&&(e*=1+.01*Math.min(100,Game.lumps)),e*=1+to("Radiant Appetite");const l=Qe*e;Object.keys(Game.CpsAchievements).forEach((e=>{l>=Game.CpsAchievements[e].threshold&&Uo(Game.CpsAchievements[e].name)})),Xe=l;const{n:s}=Game.shimmerTypes.golden,c=to("Dragon's Fortune");for(let t=0;t{io(e[o])&&(t+=.1)}))}e*=t}if(io("Shimmering veil [off]")){let t=.5;io("Reinforced membrane")&&(t+=.1),e*=1+t}io("Magic shenanigans")&&(e*=1e3),io("Occult obstruction")&&(e*=0),Qe=Game.runModHookOnValue("cps",Qe),e*=Po(),Qe*=e}const Ro=["Fortune #001","Fortune #002","Fortune #003","Fortune #004","Fortune #005","Fortune #006","Fortune #007","Fortune #008","Fortune #009","Fortune #010","Fortune #011","Fortune #012","Fortune #013","Fortune #014","Fortune #015","Fortune #016","Fortune #017","Fortune #018","Fortune #100","Fortune #101","Fortune #102","Fortune #103","Fortune #104"],Io=["Skull cookies","Ghost cookies","Bat cookies","Slime cookies","Pumpkin cookies","Eyeball cookies","Spider cookies"],zo=["Christmas tree biscuits","Snowflake biscuits","Snowman biscuits","Holly biscuits","Candy cane biscuits","Bell biscuits","Present biscuits"],Vo=["Pure heart biscuits","Ardent heart biscuits","Sour heart biscuits","Weeping heart biscuits","Golden heart biscuits","Eternal heart biscuits","Prism heart biscuits"],_o=["Elderwort biscuits","Bakeberry cookies","Duketater cookies","Green yeast digestives","Wheat slims","Fern tea","Ichor syrup"];function Qo(e){return eo[e]?eo[e].won:0}function Xo(){let e=0;Object.keys(Game.GrandmaSynergies).forEach((t=>{io(Game.GrandmaSynergies[t])&&(e+=1)})),!Qo("Elder")&&e>=7&&Uo("Elder"),!Qo("Veteran")&&e>=14&&Uo("Veteran");let t=0,o=1,n=1,i=1e5;Object.keys(Jt).forEach((e=>{t+=Jt[e].amount,i=Math.min(Jt[e].amount,i),Qo("Mathematician")||Jt[e].amount=1&&Uo("One with everything"),1===o&&Uo("Mathematician"),1===n&&Uo("Base 10"),i>=100&&Uo("Centennial"),i>=150&&Uo("Centennial and a half"),i>=200&&Uo("Bicentennial"),i>=250&&Uo("Bicentennial and a half"),i>=300&&Uo("Tricentennial"),i>=350&&Uo("Tricentennial and a half"),i>=400&&Uo("Quadricentennial"),i>=450&&Uo("Quadricentennial and a half"),i>=500&&Uo("Quincentennial"),i>=550&&Uo("Quincentennial and a half"),i>=600&&Uo("Sexcentennial"),t>=100&&Uo("Builder"),t>=500&&Uo("Architect"),t>=1e3&&Uo("Engineer"),t>=2e3&&Uo("Lord of Constructs"),t>=4e3&&Uo("Grand design"),t>=8e3&&Uo("Ecumenopolis"),Le>=20&&Uo("Enhancer"),Le>=50&&Uo("Augmenter"),Le>=100&&Uo("Upgrader"),Le>=200&&Uo("Lord of Progress"),Le>=300&&Uo("The full picture"),Le>=400&&Uo("When there's nothing left to add"),t>=4e3&&Le>=300&&Uo("Polymath"),t>=8e3&&Le>=400&&Uo("Renaissance baker"),Jt.Cursor.amount+Jt.Grandma.amount>=777&&Uo("The elder scrolls");let a=!0;Object.keys(Io).forEach((e=>{io(Io[e])||(a=!1)})),a&&Uo("Spooky cookies");let r=!0;if(Object.keys(zo).forEach((e=>{io(zo[e])||(r=!1)})),r&&Uo("Let it snow"),io("Fortune cookies")){const e=Game.Tiers.fortune.upgrades;let t=0;Object.keys(e).forEach((o=>{io(e[o].name)&&(t+=1)})),t>=e.length&&Uo("O Fortuna")}}function qo(e){const t={};return Object.keys(Game.Objects).forEach((o=>{t[o]={},t[o].bonus=function(e,t){xo(),Jt[e].amount+=t;const o=Jt[e];"Cursor"===e?(o.amount>=1&&Uo("Click"),o.amount>=2&&Uo("Double-click"),o.amount>=50&&Uo("Mouse wheel"),o.amount>=100&&Uo("Of Mice and Men"),o.amount>=200&&Uo("The Digital"),o.amount>=300&&Uo("Extreme polydactyly"),o.amount>=400&&Uo("Dr. T"),o.amount>=500&&Uo("Thumbs, phalanges, metacarpals"),o.amount>=600&&Uo("With her finger and her thumb"),o.amount>=700&&Uo("Gotta hand it to you"),o.amount>=800&&Uo("The devil's workshop")):Object.keys(Game.Objects[o.name].tieredAchievs).forEach((e=>{o.amount>=Game.Tiers[Game.Objects[o.name].tieredAchievs[e].tier].achievUnlock&&Uo(Game.Objects[o.name].tieredAchievs[e].name)}));const n=je;return $o(),Xo(),n!==je&&$o(),Qe-Game.cookiesPs}(o,e),1!==e&&(Oe=1)})),t}function Yo(){Object.keys(Game.Objects).forEach((e=>{Ct[e].price=Ho(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,1),yt[e].price=Ho(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,10),bt[e].price=Ho(Game.Objects[e],Game.Objects[e].basePrice,Game.Objects[e].amount,Game.Objects[e].free,100)}))}function Ko(){Ct=qo(1),yt=qo(10),bt=qo(100),Tt=[],Object.keys(Game.Upgrades).forEach((t=>{const o=function(e){if("toggle"===Game.Upgrades[e].pool||0===Game.Upgrades[e].bought&&Game.Upgrades[e].unlocked&&"prestige"!==Game.Upgrades[e].pool){xo(),"Shimmering veil [on]"===Zt[e].name?Zt["Shimmering veil [off]"].bought=0:"Golden switch [on]"===Zt[e].name?Zt["Golden switch [off]"].bought=0:Zt[e].bought=(Zt[e].bought+1)%2,Zt[e],Game.CountsAsUpgradeOwned(Game.Upgrades[e].pool)&&(Le+=1),"Elder Pledge"===e?(Ae+=1,Ae>0&&Uo("Elder nap"),Ae>=5&&Uo("Elder slumber")):"Elder Covenant"===e?Uo("Elder calm"):"Prism heart biscuits"===e?Uo("Lovely cookies"):"Heavenly key"===e&&Uo("Wholesome");const t=je;$o(),Xo(),t!==je&&$o();const o=function(){let e=0;io("Thousand fingers")&&(e+=.1),io("Million fingers")&&(e*=5),io("Billion fingers")&&(e*=10),io("Trillion fingers")&&(e*=20),io("Quadrillion fingers")&&(e*=20),io("Quintillion fingers")&&(e*=20),io("Sextillion fingers")&&(e*=20),io("Septillion fingers")&&(e*=20),io("Octillion fingers")&&(e*=20),io("Nonillion fingers")&&(e*=20);let t=0;Object.keys(Jt).forEach((e=>{t+=Jt[e].amount})),t-=Jt.Cursor.amount,e*=t,io("Plastic mouse")&&(e+=.01*Qe),io("Iron mouse")&&(e+=.01*Qe),io("Titanium mouse")&&(e+=.01*Qe),io("Adamantium mouse")&&(e+=.01*Qe),io("Unobtainium mouse")&&(e+=.01*Qe),io("Eludium mouse")&&(e+=.01*Qe),io("Wishalloy mouse")&&(e+=.01*Qe),io("Fantasteel mouse")&&(e+=.01*Qe),io("Nevercrack mouse")&&(e+=.01*Qe),io("Armythril mouse")&&(e+=.01*Qe),io("Technobsidian mouse")&&(e+=.01*Qe),io("Plasmarble mouse")&&(e+=.01*Qe),io("Miraculite mouse")&&(e+=.01*Qe),io("Fortune #104")&&(e+=.01*Qe);let o=1;if(io("Santa's helpers")&&(o*=1.1),io("Cookie egg")&&(o*=1.1),io("Halo gloves")&&(o*=1.1),io("Dragon claw")&&(o*=1.03),io("Aura gloves")&&(o*=1+.05*Math.min(Game.Objects.Cursor.level,io("Luminous gloves")?20:10)),o*=no("click"),Jt.Temple.minigameLoaded&&ao){const e=ao("labor");1===e?o*=1.15:2===e?o*=1.1:3===e&&(o*=1.05)}Object.keys(Game.buffs).forEach((e=>{void 0!==Game.buffs[e].multClick&&(o*=Game.buffs[e].multClick)})),o*=1+.05*to("Dragon Cursor");let n=o*Game.ComputeCps(1,io("Reinforced index finger")+io("Carpal tunnel prevention cream")+io("Ambidextrous"),e);return n=Game.runModHookOnValue("cookiesPerClick",n),Game.hasBuff("Cursed finger")&&(n=Game.buffs["Cursed finger"].power),n}()-Game.computedMouseCps;return o?[Qe-Game.cookiesPs,o]:[Qe-Game.cookiesPs]}return[]}(t);"Elder Pledge"===t?(Tt[t]={bonus:Game.cookiesPs-Te},1===e.CalcWrink?Tt[t].bonus-=Me:2===e.CalcWrink&&(Tt[t].bonus-=Se),Number.isFinite(Tt[t].bonus)||(Tt[t].bonus=0)):(Tt[t]={},o[0]&&(Tt[t].bonus=o[0]),o[1]&&(Tt[t].bonusMouse=o[1]))}))}function Jo(e,t,o){let n=0,i=0,a=0,r=0,l=1+Math.max(0,Math.ceil(Math.log(Game.cookies)/Math.LN10)-10);for(;a0?e/=t:e=0,Ot=Jo(7,e,pt),Et=2*Ot[1]/pt,Nt=Ot[2]/60/60/6/dt,Lt=Jo(6,e,ut),Ft=2*Lt[1]/ut,Wt=Lt[2]/60/60/6/dt,Dt=Jo(7,7*e,pt),At=2*Dt[1]/pt,jt=Dt[2]/60/60/6/dt,$t=Jo(6,7*e,ut),Ht=2*$t[1]/ut,Ut=$t[2]/60/60/6/dt}function en(){const e=Math.floor(Date.now()/1e3);if(Game.T/Game.fps%1==0){const t=Game.HowMuchPrestige(Game.cookiesReset),o=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))-Math.floor(t),n=e-Ee,i=Math.max(0,o-Ne)/n;for(let e=0;e{e.push(Game.Upgrades[t])})),e.sort((function(e,t){return e.order>t.order?1:e.order{const o=e[t];if(0===o.bought){let e="";e+=function(e){let t="crate upgrade missing";"prestige"===e.pool&&(t+=" heavenly");let o=0;Game.prefs.crates||(o=1),o&&(t+=" noFrame");let{icon:n}=e;e.iconFunction&&(n=e.iconFunction());const i=`function() {return Game.crateTooltip(Game.UpgradesById[${e.id}], 'stats');}`;return`
\n\t
`}(o),"prestige"===o.pool?Pt+=e:"cookie"===o.pool?Bt+=e:"toggle"!==o.pool&&"unused"!==o.pool&&"debug"!==o.pool&&(St+=e)}}))}function on(){if("christmas"===Game.season){let e=60*Game.cookiesPs;Game.hasBuff("Elder frenzy")&&(e*=.5),Game.hasBuff("Frenzy")&&(e*=.75),gt=Math.max(25,e),Game.Has("Ho ho ho-flavored frosting")&&(gt*=2)}}function nn(){Ze=900*ct/.15,Ze*=dt;const e=Po();e>0?Ze/=e:Ze=0,et=pt*(.15*Ze)+13,tt=ut*(.15*Ze)+13,ot=7*Ze,nt=pt*(.15*ot)+13,it=ut*(.15*ot)+13,at=2*Ze,rt=.15*at,lt=0;let t=0,o=0;Object.keys(Game.Objects).forEach((e=>{Game.Objects[e].amount>t&&(t=Game.Objects[e].amount),Game.Objects[e].amount>0&&(o+=1)})),Object.keys(Game.Objects).forEach((e=>{(Game.Objects[e].amountlt&&(lt=2*Game.Objects[e].price,st=e)}))}function an(){let e=1,t=1,o=1;io("Green yeast digestives")&&(o*=1.01),io("Dragon fang")&&(o*=1.03),e*=1+.1*Game.auraMult("Ancestral Metamorphosis"),e*=Game.eff("goldenCookieGain"),t*=1+.1*Game.auraMult("Unholy Dominion"),t*=Game.eff("wrathCookieGain"),pt=o*e,ut=o*t,dt=1,0===Game.shimmerTypes.golden.n&&(dt*=1+1.23*Game.auraMult("Dragon's Fortune"))}function rn(){kt=0,Gt=0,vt=[0,null];for(let e=0;evt[0]&&(vt=[t,e]))}}function ln(){bo(),rn(),nn(),an(),Zo(),tn(),on(),he=new Fo(K[K.length-1]),ge=new Fo(K[K.length-1]),fe=new Fo(K[K.length-1]),Ce=new Fo(K[K.length-1]),ye=new Fo(J[J.length-1]),be=new Fo(5),me=new Fo(20*J[J.length-1]),en(),Wo(),Ko(),Yo(),Do()}const sn={CPSMode:1,AvgCPSHist:3,AvgClicksHist:0,CalcWrink:0,Scale:2,ScaleDecimals:2,ScaleSeparator:0,ScaleCutoff:999999,TimeFormat:0,DetailedTime:1,PPDisplayTime:0,BuildColour:1,PPOnlyConsiderBuyable:0,PPExcludeTop:0,PPRigidelMode:0,PPSecondsLowerLimit:0,ColourBlue:"#4bb8f0",ColourGreen:"#00ff00",ColourYellow:"#ffff00",ColourOrange:"#ff7f00",ColourRed:"#ff0000",ColourPurple:"#ff00ff",ColourGray:"#b3b3b3",ColourPink:"#ff1493",ColourBrown:"#8b4513",BotBar:1,TimerBar:1,TimerBarPos:0,TimerBarOverlay:2,UpBarColour:1,UpgradeBarFixedPos:1,SortBuildings:0,SortUpgrades:0,DragonAuraInfo:1,GrimoireBar:1,GCTimer:1,Favicon:1,WrinklerButtons:1,HideSectionsButtons:0,TooltipBuildUpgrade:1,TooltipAmor:0,ToolWarnLucky:1,ToolWarnLuckyFrenzy:1,ToolWarnConjure:1,ToolWarnConjureFrenzy:1,ToolWarnEdifice:1,ToolWarnUser:0,ToolWarnBon:1,ToolWarnPos:1,TooltipGrim:1,TooltipWrink:1,TooltipLump:1,TooltipPlots:1,TooltipPantheon:1,TooltipAscendButton:1,Stats:1,MissingUpgrades:1,MissingAchievements:0,UpStats:1,HeavenlyChipsTarget:1,ShowMissedGC:1,Title:1,GeneralSound:1,GCNotification:0,GCFlash:1,ColourGCFlash:"#ffffff",GCSound:1,GCVolume:100,GCSoundURL:"https://freesound.org/data/previews/66/66717_931655-lq.mp3",FortuneNotification:0,FortuneFlash:1,ColourFortuneFlash:"#ffffff",FortuneSound:1,FortuneVolume:100,FortuneSoundURL:"https://freesound.org/data/previews/174/174027_3242494-lq.mp3",SeaNotification:0,SeaFlash:1,ColourSeaFlash:"#ffffff",SeaSound:1,SeaVolume:100,SeaSoundURL:"https://www.freesound.org/data/previews/121/121099_2193266-lq.mp3",GardFlash:1,ColourGardFlash:"#ffffff",GardSound:1,GardVolume:100,GardSoundURL:"https://freesound.org/data/previews/103/103046_861714-lq.mp3",MagicNotification:0,MagicFlash:1,ColourMagicFlash:"#ffffff",MagicSound:1,MagicVolume:100,MagicSoundURL:"https://freesound.org/data/previews/221/221683_1015240-lq.mp3",WrinklerNotification:0,WrinklerFlash:1,ColourWrinklerFlash:"#ffffff",WrinklerSound:1,WrinklerVolume:100,WrinklerSoundURL:"https://freesound.org/data/previews/124/124186_8043-lq.mp3",WrinklerMaxNotification:0,WrinklerMaxFlash:1,ColourWrinklerMaxFlash:"#ffffff",WrinklerMaxSound:1,WrinklerMaxVolume:100,WrinklerMaxSoundURL:"https://freesound.org/data/previews/152/152743_15663-lq.mp3",BulkBuyBlock:0,FavouriteSettings:1,Header:{Favourite:1,Calculation:1,Notation:1,Colours:1,BarsDisplay:1,Tooltip:1,Statistics:1,Notification:1,NotificationGeneral:1,NotificationGC:1,NotificationFC:1,NotificationSea:1,NotificationGard:1,NotificationMagi:1,NotificationWrink:1,NotificationWrinkMax:1,Miscellaneous:1,Lucky:1,Chain:1,Spells:1,Garden:1,Prestige:1,Wrink:1,Sea:1,Misc:1,InfoTab:1}},cn=function(e){if(1===e){const e=function(){try{Notification.requestPermission().then()}catch(e){return!1}return!0};"Notification"in window?e()?Notification.requestPermission().then():Notification.requestPermission():console.log("This browser does not support notifications.")}};function dn(){1===e.BotBar?(l("CMBotBar").style.display="",go()):l("CMBotBar").style.display="none",Co()}function pn(){BeautifyAll(),Game.RefreshStore(),Game.RebuildUpgrades(),go(),so(),co()}function un(){1===e.Favicon&&y>0?zt.wrath?l("CMFavicon").href="https://aktanusa.github.io/CookieMonster/favicon/wrathCookie.ico":l("CMFavicon").href="https://aktanusa.github.io/CookieMonster/favicon/goldenCookie.ico":l("CMFavicon").href="https://orteil.dashnet.org/cookieclicker/favicon.ico"}class mn{constructor(e,t){this.type=e,this.group=t}}class hn extends mn{constructor(e,t,o,n,i,a=null){super(e,t),this.label=o,this.desc=n,this.toggle=i,a&&(this.func=a)}}class gn extends mn{constructor(e,t,o){super(e,t),this.desc=o}}class fn extends mn{constructor(e,t,o,n){super(e,t),this.label=o,this.desc=n;for(let e=0;e<101;e++)this.label[e]=`${e}%`}}class Cn extends mn{constructor(e,t,o,n,i,a){super(e,t),this.label=o,this.desc=n,this.min=i,this.max=a}}const yn={CPSMode:new hn("bool","Calculation",["Current cookies per second","Average cookies per second"],"Calculate times using current cookies per second or average cookies per second",!1),AvgCPSHist:new hn("bool","Calculation",["Average CPS in past 10s","Average CPS in past 15s","Average CPS in past 30s","Average CPS in past 1m","Average CPS in past 5m","Average CPS in past 10m","Average CPS in past 15m","Average CPS in past 30m"],"How much time average Cookies Per Second should consider",!1),AvgClicksHist:new hn("bool","Calculation",["Average clicks in past 1s","Average clicks in past 5s","Average clicks in past 10s","Average clicks in past 15s","Average clicks in past 30s"],"How much time average Cookie Clicks should consider",!1),CalcWrink:new hn("bool","Calculation",["Calculate with wrinklers OFF","Calculate with wrinklers ON","Calculate with single fattest wrinkler ON"],"Calculate times and average Cookies Per Second with (only the single non-shiny fattest) wrinklers",!0,(function(){Ve=!0})),Scale:new hn("bool","Notation",["Game's setting scale","Metric","Short scale","Short scale (Abbreviated)","Scientific notation","Engineering notation"],"Change how long numbers are formatted",!1,(function(){pn()})),ScaleDecimals:new hn("bool","Notation",["1 decimals","2 decimals","3 decimals"],'Set the number of decimals used when applicable. This only works with Cookie Monster scales and not with "Game\'s Setting Scale"',!1,(function(){pn()})),ScaleSeparator:new hn("bool","Notation",[". for decimals (standard)",". for thousands"],"Set the separator used for decimals and thousands",!1,(function(){pn()})),ScaleCutoff:new Cn("numscale","Notation","Notation cut-off point: ","The number from which Cookie Monster will start formatting numbers based on chosen scale. Standard is 999,999. Setting this above 999,999,999 might break certain notations",1,999999999),TimeFormat:new hn("bool","Notation",["Time XXd, XXh, XXm, XXs","Time XX:XX:XX:XX:XX"],"Change the time format",!1),DetailedTime:new hn("bool","Notation",["Detailed time OFF","Detailed time ON"],"Change how time is displayed in certain statistics and tooltips",!0,(function(){1===e.DetailedTime?Game.sayTime=z:Game.sayTime=P.sayTime})),PPDisplayTime:new hn("bool","Notation",["PP as value (standard)","PP as time unit"],"Display PP as calculated value or as approximate time unit. Note that PP does not translate directly into a time unit and this is therefore only an approximation.",!1),BuildColour:new hn("bool","Colours",["Building colours OFF","Building colours ON"],"Colour code buildings",!0,(function(){so()})),PPOnlyConsiderBuyable:new hn("bool","Colours",["Don't ignore non-buyable","Ignore non-buyable"],"Makes Cookie Monster label buildings and upgrades you can't buy right now red, useful in those situations where you just want to spend your full bank 'most optimally'",!0),PPExcludeTop:new hn("bool","Colours",["Don't ignore any","Ignore 1st best","Ignore 1st and 2nd best","Ignore 1st, 2nd and 3rd best"],"Makes Cookie Monster ignore the 1st, 2nd or 3rd best buildings in labeling and colouring PP values",!0),PPRigidelMode:new hn("bool","Colours",["Rigidel mode OFF","Rigidel mode ON"],'Makes Cookie Monster ignore all "buy 1" options when colouring PP in order to stay at a total building count ending in 10 for pantheon god Rigidel',!0),PPSecondsLowerLimit:new Cn("numscale","Colours","Lower limit for PP (in seconds): ",'If a building or upgrade costs less than the specified seconds of CPS it will also be considered optimal and label it as such ("PP is less than xx seconds of CPS"); setting to 0 ignores this option',0,1/0),ColourBlue:new gn("colour","Colours","Standard colour is blue. Used to show upgrades better than best PP building, for Click Frenzy bar, and for various labels"),ColourGreen:new gn("colour","Colours","Standard colour is green. Used to show best PP building, for Blood Frenzy bar, and for various labels"),ColourYellow:new gn("colour","Colours","Standard colour is yellow. Used to show buildings within the top 10 of PP, for Frenzy bar, and for various labels"),ColourOrange:new gn("colour","Colours","Standard colour is orange. Used to show buildings within the top 20 of PP, for Next Reindeer bar, and for various labels"),ColourRed:new gn("colour","Colours","Standard colour is Red. Used to show buildings within the top 30 of PP, for Clot bar, and for various labels"),ColourPurple:new gn("colour","Colours","Standard colour is purple. Used to show buildings outside of the top 30 of PP, for Next Cookie bar, and for various labels"),ColourGray:new gn("colour","Colours","Standard colour is gray. Used to show negative or infinity PP, and for Next Cookie/Next Reindeer bar"),ColourPink:new gn("colour","Colours","Standard colour is pink. Used for Dragonflight bar"),ColourBrown:new gn("colour","Colours","Standard colour is brown. Used for Dragon Harvest bar"),BotBar:new hn("bool","BarsDisplay",["Bottom bar OFF","Bottom bar ON"],"Building information",!0,(function(){dn()})),TimerBar:new hn("bool","BarsDisplay",["Timer bar OFF","Timer bar ON"],"Bar with timers for golden cookie, season popup, Frenzy (Normal, Clot, Elder), Click Frenzy",!0,(function(){yo()})),TimerBarPos:new hn("bool","BarsDisplay",["Timer bar position (top left)","Timer bar position (bottom)"],"Placement of the timer bar",!1,(function(){0===e.TimerBarPos?(l("CMTimerBar").style.width="30%",l("CMTimerBar").style.bottom="",l("game").insertBefore(l("CMTimerBar"),l("sectionLeft"))):(l("CMTimerBar").style.width="100%",l("CMTimerBar").style.bottom="0px",l("wrapper").appendChild(l("CMTimerBar"))),Co()})),TimerBarOverlay:new hn("bool","BarsDisplay",["Timer bar overlay OFF","Timer bar overlay only seconds","Timer bar overlay full"],"Overlay on timers displaying seconds and/or percentage left",!0),UpBarColour:new hn("bool","BarsDisplay",["Upgrade colours/bar OFF","Upgrade colours with bar ON","Upgrade colours without bar ON"],"Colour code upgrades and optionally add a counter bar",!1,(function(){1===e.UpBarColor?(l("CMUpgradeBar").style.display="",co()):2===e.UpBarColor?(l("CMUpgradeBar").style.display="none",co()):(l("CMUpgradeBar").style.display="none",Game.RebuildUpgrades())})),UpgradeBarFixedPos:new hn("bool","BarsDisplay",["Upgrade bar fixed position OFF","Upgrade bar fixed position ON"],"Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling",!0,(function(){1===e.UpgradeBarFixedPos?(l("CMUpgradeBar").style.position="sticky",l("CMUpgradeBar").style.top="0px"):l("CMUpgradeBar").style.position=""})),SortBuildings:new hn("bool","BarsDisplay",["Sort buildings: default","Sort buildings: PP of x1 purchase","Sort buildings: PP of selected bulk mode"],"Sort the display of buildings in either default order or by PP",!1,(function(){so()})),SortUpgrades:new hn("bool","BarsDisplay",["Sort upgrades: default","Sort upgrades: PP"],"Sort the display of upgrades in either default order or by PP",!1,(function(){co()})),DragonAuraInfo:new hn("bool","BarsDisplay",["Extra dragon aura info OFF","Extra dragon aura info ON"],"Shows information about changes in CPS and costs in the dragon aura interface.",!0),GrimoireBar:new hn("bool","BarsDisplay",["Grimoire magic meter timer OFF","Grimoire magic meter timer ON"],"A timer on how long before the Grimoire magic meter is full",!0),GCTimer:new hn("bool","BarsDisplay",["Golden cookie timer OFF","Golden cookie timer ON"],"A timer on the golden cookie when it has been spawned",!0,(function(){1===e.GCTimer?Object.keys(le).forEach((e=>{le[e].style.display="block",le[e].style.left=qt[e].l.style.left,le[e].style.top=qt[e].l.style.top})):Object.keys(le).forEach((e=>le[e].style.display="none"))})),Favicon:new hn("bool","BarsDisplay",["Favicon OFF","Favicon ON"],"Update favicon with golden/wrath cookie",!0,(function(){un()})),WrinklerButtons:new hn("bool","BarsDisplay",["Extra wrinkler buttons OFF","Extra wrinkler buttons ON"],"Show buttons for popping wrinklers at bottom of cookie section",!0,(function(){t()})),HideSectionsButtons:new hn("bool","BarsDisplay",["Hide buildings/upgrades button OFF","Hide buildings/upgrades button ON"],"Show buttons for hiding and showing the buildings and upgrades sections in the right column",!0,(function(){e.HideSectionsButtons?l("CMSectionHidButtons").style.display="":l("CMSectionHidButtons").style.display="none"})),TooltipBuildUpgrade:new hn("bool","Tooltip",["Building/upgrade tooltip information OFF","Building/upgrade tooltip information ON"],"Extra information in building/upgrade tooltips",!0),TooltipAmor:new hn("bool","Tooltip",["Buildings tooltip amortization information OFF","Buildings tooltip amortization information ON"],"Add amortization information to buildings tooltip",!0),ToolWarnLucky:new hn("bool","Tooltip",["Tooltip lucky warning OFF","Tooltip lucky warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards',!0),ToolWarnLuckyFrenzy:new hn("bool","Tooltip",["Tooltip lucky frenzy warning OFF","Tooltip lucky frenzy warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards',!0),ToolWarnConjure:new hn("bool","Tooltip",["Tooltip conjure warning OFF","Tooltip conjure warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards',!0),ToolWarnConjureFrenzy:new hn("bool","Tooltip",["Tooltip conjure frenzy warning OFF","Tooltip conjure frenzy warning ON"],'A warning when buying if it will put the bank under the amount needed for max "Conjure Baked Goods" rewards with Frenzy active',!0),ToolWarnEdifice:new hn("bool","Tooltip",["Tooltip edifice warning OFF","Tooltip edifice warning ON"],'A warning when buying if it will put the bank under the amount needed for "Spontaneous Edifice" to possibly give you your most expensive building',!0),ToolWarnUser:new Cn("numscale","Tooltip","Tooltip warning at x times CPS: ","Use this to show a customized warning if buying it will put the bank under the amount equal to value times cps; setting to 0 disables the function altogether",0,1/0),ToolWarnBon:new hn("bool","Tooltip",["Calculate tooltip warning with bonus CPS OFF","Calculate tooltip warning with bonus CPS ON"],"Calculate the warning with or without the bonus CPS you get from buying",!0),ToolWarnPos:new hn("bool","Tooltip",["Tooltip warning position (left)","Tooltip warning position (bottom)"],"Placement of the warning boxes",!1,(function(){Bo()})),TooltipGrim:new hn("bool","Tooltip",["Grimoire tooltip information OFF","Grimoire tooltip information ON"],"Extra information in tooltip for grimoire",!0),TooltipWrink:new hn("bool","Tooltip",["Wrinkler tooltip OFF","Wrinkler tooltip ON"],"Shows the amount of cookies a wrinkler will give when popping it",!0),TooltipLump:new hn("bool","Tooltip",["Sugar lump tooltip OFF","Sugar lump tooltip ON"],"Shows the current Sugar Lump type in Sugar lump tooltip.",!0),TooltipPlots:new hn("bool","Tooltip",["Garden plots tooltip OFF","Garden plots tooltip ON"],"Shows a tooltip for plants that have a cookie reward.",!0),TooltipPantheon:new hn("bool","Tooltip",["Pantheon tooltip OFF","Pantheon tooltip ON"],"Shows additional info in the pantheon tooltip",!0),TooltipAscendButton:new hn("bool","Tooltip",["Show Extra Info Ascend Tooltip OFF","Show Extra Info Ascend Tooltip ON"],"Shows additional info in the ascend tooltip",!0),Stats:new hn("bool","Statistics",["Statistics OFF","Statistics ON"],"Extra Cookie Monster statistics!",!0),MissingUpgrades:new hn("bool","Statistics",["Missing upgrades OFF","Missing upgrades ON"],"Shows missing upgrades in statistics menu",!0),MissingAchievements:new hn("bool","Statistics",["Missing Achievements OFF","Missing Normal Achievements ON"],"Shows missing normal achievements in statistics menu.",!1),UpStats:new hn("bool","Statistics",["Statistics update rate (default)","Statistics update rate (1s)"],"Default rate is once every 5 seconds",!1),HeavenlyChipsTarget:new Cn("numscale","Statistics","Heavenly chips target: ",'Use this to set a heavenly chips target that will be counted towards in the "prestige" statsistics sections',1,1/0),ShowMissedGC:new hn("bool","Statistics",["Missed GC OFF","Missed GC ON"],"Show a stat in the statistics screen that counts how many golden cookies you have missed",!0),Title:new hn("bool","NotificationGeneral",["Title OFF","Title ON","Title pinned tab highlight"],'Update title with colden cookie/season popup timers; pinned tab highlight only changes the title when a golden cookie/season popup spawns; "!" means that golden cookie/reindeer can spawn',!0),GeneralSound:new hn("bool","NotificationGeneral",["Consider game volume setting OFF","Consider game volume setting ON"],'Turning this toggle to "off" makes Cookie Monster no longer consider the volume setting of the base game, allowing mod notifications to play with base game volume turned down',!0),GCNotification:new hn("bool","NotificationGC",["Notification OFF","Notification ON"],"Create a notification when golden cookie spawns",!0,(function(){cn(e.GCNotification)})),GCFlash:new hn("bool","NotificationGC",["Flash OFF","Flash ON"],"Flash screen on golden cookie",!0),ColourGCFlash:new gn("colour","NotificationGC","The colour of the GC flash, standard colour is white"),GCSound:new hn("bool","NotificationGC",["Sound OFF","Sound ON"],"Play a sound on golden cookie",!0),GCVolume:new fn("vol","NotificationGC",[],"Volume"),GCSoundURL:new hn("url","NotificationGC","Sound URL:","URL of the sound to be played when a golden cookie spawns"),FortuneNotification:new hn("bool","NotificationFC",["Notification OFF","Notification ON"],"Create a notification when fortune cookie is on the ticker",!0,(function(){cn(e.FortuneNotification)})),FortuneFlash:new hn("bool","NotificationFC",["Flash OFF","Flash ON"],"Flash screen on fortune cookie spawn",!0),ColourFortuneFlash:new gn("colour","NotificationFC","The colour of the fortune flash, standard colour is white"),FortuneSound:new hn("bool","NotificationFC",["Sound OFF","Sound ON"],"Play a sound on fortune cookie spawn",!0),FortuneVolume:new fn("vol","NotificationFC",[],"Volume"),FortuneSoundURL:new hn("url","NotificationFC","Sound URL:","URL of the sound to be played when the ticker has a fortune cookie"),SeaNotification:new hn("bool","NotificationSea",["Notification OFF","Notification ON"],"Create a notification on season popup",!0,(function(){cn(e.SeaNotification)})),SeaFlash:new hn("bool","NotificationSea",["Flash OFF","Flash ON"],"Flash screen on season popup",!0),ColourSeaFlash:new gn("colour","NotificationSea","The colour of the season popup flash, standard colour is white"),SeaSound:new hn("bool","NotificationSea",["Sound OFF","Sound ON"],"Play a sound on season popup",!0),SeaVolume:new fn("vol","NotificationSea",[],"Volume"),SeaSoundURL:new hn("url","NotificationSea","Sound URL:","URL of the sound to be played when on season popup spawns"),GardFlash:new hn("bool","NotificationGard",["Garden Tick Flash OFF","Flash ON"],"Flash screen on garden tick",!0),ColourGardFlash:new gn("colour","NotificationGard","The colour of the garden flash, standard colour is white"),GardSound:new hn("bool","NotificationGard",["Sound OFF","Sound ON"],"Play a sound on garden tick",!0),GardVolume:new fn("vol","NotificationGard",[],"Volume"),GardSoundURL:new hn("url","NotificationGard","Garden Tick Sound URL:","URL of the sound to be played when the garden ticks"),MagicNotification:new hn("bool","NotificationMagi",["Notification OFF","Notification ON"],"Create a notification when magic reaches maximum",!0,(function(){cn(e.MagicNotification)})),MagicFlash:new hn("bool","NotificationMagi",["Flash OFF","Flash ON"],"Flash screen when magic reaches maximum",!0),ColourMagicFlash:new gn("colour","NotificationMagi","The colour of the magic flash, standard colour is white"),MagicSound:new hn("bool","NotificationMagi",["Sound OFF","Sound ON"],"Play a sound when magic reaches maximum",!0),MagicVolume:new fn("vol","NotificationMagi",[],"Volume"),MagicSoundURL:new hn("url","NotificationMagi","Sound URL:","URL of the sound to be played when magic reaches maxium"),WrinklerNotification:new hn("bool","NotificationWrink",["Notification OFF","Notification ON"],"Create a notification when a wrinkler appears",!0,(function(){cn(e.WrinklerNotification)})),WrinklerFlash:new hn("bool","NotificationWrink",["Flash OFF","Flash ON"],"Flash screen when a wrinkler appears",!0),ColourWrinklerFlash:new gn("colour","NotificationWrink","The colour of the wrinkler flash, standard colour is white"),WrinklerSound:new hn("bool","NotificationWrink",["Sound OFF","Sound ON"],"Play a sound when a wrinkler appears",!0),WrinklerVolume:new fn("vol","NotificationWrink",[],"Volume"),WrinklerSoundURL:new hn("url","NotificationWrink","Sound URL:","URL of the sound to be played when a wrinkler appears"),WrinklerMaxNotification:new hn("bool","NotificationWrinkMax",["Notification OFF","Notification ON"],"Create a notification when the maximum amount of wrinklers has appeared",!0,(function(){cn(e.WrinklerMaxNotification)})),WrinklerMaxFlash:new hn("bool","NotificationWrinkMax",["Flash OFF","Flash ON"],"Flash screen when the maximum amount of Wrinklers has appeared",!0),ColourWrinklerMaxFlash:new gn("colour","NotificationWrinkMax","The colour of the maximum wrinkler flash, standard colour is white"),WrinklerMaxSound:new hn("bool","NotificationWrinkMax",["Sound OFF","Sound ON"],"Play a sound when the maximum amount of wrinklers has appeared",!0),WrinklerMaxVolume:new fn("vol","NotificationWrinkMax",[],"Volume"),WrinklerMaxSoundURL:new hn("url","NotificationWrinkMax","Sound URL:","URL of the sound to be played when the maximum amount of wrinklers has appeared"),BulkBuyBlock:new hn("bool","Miscellaneous",["Block bulk buying OFF","Block bulk buying ON"],"Block clicking bulk buying when you can't buy all. This prevents buying 7 of a building when you are in buy-10 or buy-100 mode.",!0),FavouriteSettings:new hn("bool","Miscellaneous",["Favourite settings section OFF","Favourite settings section ON","Favourite settings section ON (Locked)"],"Show stars before each setting which allows selecting it for a 'favourites' section at the top of the Cookie Monster settings. Setting this to Locked removes the stars but shows the 'favourites' section",!0,(function(){Game.UpdateMenu()}))};function bn(){return JSON.stringify({favouriteSettings:ce,settings:e,version:"2.031.6"})}function kn(){if(Ke!==Game.dragonLevel||Ve){if(Game.dragonLevel<25&&Game.dragonLevels[Game.dragonLevel].buy.toString().includes("sacrifice")){let e=Game.dragonLevels[Game.dragonLevel].buy.toString().match(/Objects\[(.*)\]/)[1];const t=Game.dragonLevels[Game.dragonLevel].buy.toString().match(/sacrifice\((.*?)\)/)[1];if("i"!==e)if(e=e.replaceAll("'",""),Game.Objects[e].amount{if(e=n,Game.Objects[e].amount{Jt[e]=vo(e)})),Zt=[],Object.keys(Game.Upgrades).forEach((e=>{Zt[e]=wo(e)})),eo=[],Object.keys(Game.Achievements).forEach((e=>{eo[e]=ko(e)})),xo()}let wn=!1;function xn(t,o,n){(1===e[o]||n)&&3===t&&!1===wn||1===t?(l("CMFlashScreen").style.backgroundColor=e[`Colour${o}`],l("CMFlashScreen").style.opacity="0.5",3===t?(l("CMFlashScreen").style.display="inline",setTimeout((function(){xn(2,o,!0)}),1e3/Game.fps)):setTimeout((function(){xn(0,o,!0)}),1e3/Game.fps)):2===t?(l("CMFlashScreen").style.opacity="1",setTimeout((function(){xn(1,o,!0)}),1e3/Game.fps)):0===t&&(l("CMFlashScreen").style.display="none")}function Tn(t,o,n,i){if((1===e[o]||i)&&!1===wn){const o=new Audio(t);e.GeneralSound?o.volume=e[n]/100*(Game.volume/100):o.volume=e[n]/100,o.play()}}function Mn(t,o,n){1===e[t]&&"hidden"===document.visibilityState&&!1===wn&&new Notification(o,{body:n,badge:"https://orteil.dashnet.org/cookieclicker/favicon.ico"})}function Sn(){if(w=Date.now(),ae!==Game.OnAscend&&(ae=Game.OnAscend,Game.OnAscend?(l("game").style.bottom="0px",1===e.BotBar&&(l("CMBotBar").style.display="none"),1===e.TimerBar&&(l("CMTimerBar").style.display="none")):(dn(),yo()),fo()),!Game.OnAscend&&0===Game.AscendTimer){r!==Object.keys(Game.mods).length&&(vn(),ln(),r=Object.keys(Game.mods).length),Ve&&(Ko(),Game.Has("Golden switch [off]")?(xo(),Zt["Golden switch [off]"].bought=0,$o(),ct=Qe):ct=Game.cookiesPs,an(),nn(),tn(),Zo(),kn(),function(){for(let e=0;e<11;e+=1)for(let t=0;t<3;t+=1)Kt[e][t]=Gn(e,t)}(),on(),function(){let e=0;if(Game.Objects.Bank.minigameLoaded){const t=Game.Objects.Bank.minigame.goods;let o=0;Object.keys(t).forEach((e=>{const n=t[e];o+=n.stock*n.val})),e+=o*Game.cookiesPsRawHighest}e+=function(){let e=0;xo();let t=2;5!==Ue&&18!==Ue||(t-=1),5!==$e&&18!==$e||(t-=1),Ue=5,$e=18;for(let e=0;e{Jt[t].amount>0&&(e=t)})),Jt[e].amount-=1,We-=1}return Object.keys(Jt).forEach((t=>{const o=Jt[t];e+=lo(Game.Objects[o.name],Game.Objects[t].basePrice,o.amount,Game.Objects[t].free,o.amount)})),e}(),Yt=e}(),Ve=0);const t=Game.auraMult("Fierce Hoarder")>0;!Fe&&t?(Fe=!0,Oe=1):Fe&&!t&&(Fe=!1,Oe=1),Oe&&(Yo(),Oe=0),function(){rn(),Do(),function(){wt=0;let e=0;Object.keys(Game.wrinklers).forEach((t=>{2===Game.wrinklers[t].phase&&(e+=1)}));let t=1;if(Jt.Temple.minigameLoaded){const e=Game.hasGod("scorn");1===e?t*=1.15:2===e?t*=1.1:3===e&&(t*=1.05)}xt=e,wt=e*(.05*e*1.1)*(.05*Game.Has("Sacrilegious corruption")+1)*(.05*Game.Has("Wrinklerspawn")+1)*t}(),Wo(),en();const e=Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))+1)-(Game.cookiesEarned+Game.cookiesReset);_t=pe(e/po())}(),G=0,qt={},Object.keys(Game.shimmers).forEach((e=>{qt[Game.shimmers[e].id]=Game.shimmers[e],Game.shimmers[e].spawnLead&&"golden"===Game.shimmers[e].type&&(zt=Game.shimmers[e],G+=1)})),Object.keys(le).forEach((e=>{void 0===qt[e]&&(le[e].parentNode.removeChild(le[e]),delete le[e])})),y!==Game.shimmerTypes.golden.n?(y=Game.shimmerTypes.golden.n,y&&(b{void 0===le[Game.shimmers[t].id]&&function(t){const o=document.createElement("div");o.id=`GCTimer${t.id}`,o.style.width="96px",o.style.height="96px",o.style.position="absolute",o.style.zIndex="10000000001",o.style.textAlign="center",o.style.lineHeight="96px",o.style.fontFamily='"Kavoon", Georgia, serif',o.style.fontSize="35px",o.style.cursor="pointer",o.style.display="block",0===e.GCTimer&&(o.style.display="none"),o.style.left=t.l.style.left,o.style.top=t.l.style.top,o.onclick=function(){t.pop()},o.onmouseover=function(){t.l.style.filter="brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))",t.l.style.webkitFilter="brightness(125%) drop-shadow(0px 0px 3px rgba(255,255,255,1))"},o.onmouseout=function(){t.l.style.filter="",t.l.style.webkitFilter=""},le[t.id]=o,l("shimmers").appendChild(o)}(Game.shimmers[t])}))),un(),b=G,0===G&&(zt=0)):1===e.GCTimer&&y&&Object.keys(le).forEach((e=>{le[e].style.opacity=qt[e].l.style.opacity,le[e].style.transform=qt[e].l.style.transform,le[e].textContent=Math.ceil(qt[e].life/Game.fps)})),f!==(Game.TickerEffect&&"fortune"===Game.TickerEffect.type)&&(f=Game.TickerEffect&&"fortune"===Game.TickerEffect.type,f&&(xn(3,"FortuneFlash",!1),Tn(e.FortuneSoundURL,"FortuneSound","FortuneVolume",!1),Mn("FortuneNotification","Fortune Cookie found","A Fortune Cookie has appeared on the Ticker."))),g!==Game.shimmerTypes.reindeer.spawned&&(g=Game.shimmerTypes.reindeer.spawned,Object.keys(Game.shimmers).forEach((e=>{Game.shimmers[e].spawnLead&&"reindeer"===Game.shimmers[e].type&&(Vt=Game.shimmers[e])})),xn(3,"SeaFlash",!1),Tn(e.SeaSoundURL,"SeaSound","SeaVolume",!1),Mn("SeaNotification","Reindeer sighted!","A Reindeer has spawned. Click it now!")),Game.Objects.Farm.minigameLoaded&&C!==Game.Objects.Farm.minigame.nextStep&&(0!==C&&C0){let t=0;Object.keys(Game.wrinklers).forEach((e=>{2===Game.wrinklers[e].phase&&(t+=1)})),t>v?(v=t,t===Game.getWrinklersMax()&&e.WrinklerMaxFlash?xn(3,"WrinklerMaxFlash",!1):xn(3,"WrinklerFlash",!1),t===Game.getWrinklersMax()&&e.WrinklerMaxSound?Tn(e.WrinklerMaxSoundURL,"WrinklerMaxSound","WrinklerMaxVolume",!1):Tn(e.WrinklerSoundURL,"WrinklerSound","WrinklerVolume",!1),t===Game.getWrinklersMax()&&e.WrinklerMaxNotification?Mn("WrinklerMaxNotification","Maximum Wrinklers Reached","You have reached your maximum ammount of wrinklers"):Mn("WrinklerNotification","A Wrinkler appeared","A new wrinkler has appeared")):v=t}}()}}function Pn(){let t="";for(let o=0;o{void 0===e[t]?(o=!0,e[t]=sn[t]):"Header"===t&&Object.keys(sn.Header).forEach((n=>{void 0!==e[t][n]&&e[t][n]>-1&&e[t][n]<2||(o=!0,e[t][n]=sn[t][n])}))})),o&&Bn(),Sn(),Object.keys(sn).forEach((e=>{"Header"!==e&&void 0!==yn[e].func&&yn[e].func()}))}else En(sn);Game.UpdateMenu(),Pn()}function Nn(){Object.keys(Game.wrinklers).forEach((e=>{Game.wrinklers[e].sucked>0&&0===Game.wrinklers[e].type&&(Game.wrinklers[e].hp=0)}))}function On(t,o){if("b"===t){if(l("tooltip").innerHTML=Game.Objects[o].tooltip(),1===e.TooltipAmor){const e=Ho(Game.Objects[o],Game.Objects[o].basePrice,0,Game.Objects[o].free,Game.Objects[o].amount),t=e-Game.Objects[o].totalCookies;t>0&&(l("tooltip").innerHTML=l("tooltip").innerHTML.split("so far").join(`so far
${de(t)} ${1===Math.floor(t)?"cookie":"cookies"} left to amortize (${ue((e-Game.Objects[o].totalCookies)/(Game.Objects[o].storedTotalCps*Game.globalCpsMult)).text})`))}-1===Game.buyMode&&(l("tooltip").innerHTML=l("tooltip").innerHTML.split(de(Game.Objects[o].bulkPrice)).join(de((Game.Objects[o],Game.Objects[o].basePrice,Game.Objects[o].amount,Game.Objects[o].free,Game.buyBulk,1))))}else if("u"===t){if(!Game.UpgradesInStore[o])return"";l("tooltip").innerHTML=Game.crateTooltip(Game.UpgradesInStore[o],"store")}else"s"===t?l("tooltip").innerHTML=Game.lumpTooltip():"g"===t?l("tooltip").innerHTML=Game.Objects["Wizard tower"].minigame.spellTooltip(o)():"p"===t?l("tooltip").innerHTML=Game.ObjectsById[2].minigame.tileTooltip(o[0],o[1])():"ha"===t?l("tooltip").innerHTML=Game.ObjectsById[2].minigame.toolTooltip(1)():"wb"===t?l("tooltip").innerHTML="":"pag"===t?l("tooltip").innerHTML=Game.Objects.Temple.minigame.godTooltip(o)():"pas"===t&&(l("tooltip").innerHTML=Game.Objects.Temple.minigame.slotTooltip(o[0])());if("b"===t&&1===Game.buyMode||"u"===t||"s"===t||"g"===t||"p"===t&&!Game.keys[16]||"ha"===t||"wb"===t||"pag"===t||"pas"===t&&-1!==o[1]){const e=document.createElement("div");e.id="CMTooltipArea",l("tooltip").appendChild(e)}return oe=t,ne=o,Eo(),l("tooltip").innerHTML}function Fn(){Game.Objects["Wizard tower"].minigameLoaded&&Object.keys(Game.Objects["Wizard tower"].minigame.spellsById).forEach((e=>{null!==l(`grimoireSpell${e}`).onmouseover&&(M[e]=l(`grimoireSpell${e}`).onmouseover,l(`grimoireSpell${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return On("g",`${e}`)}),"this"),Game.tooltip.wobble()})}))}function Wn(){if(!m&&Game.Objects["Wizard tower"].minigameLoaded){const{minigame:t}=Game.Objects["Wizard tower"];p=t.draw,Game.Objects["Wizard tower"].minigame.draw=function(){p(),1===e.GrimoireBar&&t.magic1&&(e.Header[t]=0),Bn()}function $n(t,o){const n=document.createElement("div");n.className="title",n.style.padding="0px 16px",n.style.opacity="0.7",n.style.fontSize="17px",n.style.fontFamily='"Kavoon", Georgia, serif',n.appendChild(document.createTextNode(`${t} `));const i=document.createElement("span");return i.style.cursor="pointer",i.style.display="inline-block",i.style.height="14px",i.style.width="14px",i.style.borderRadius="7px",i.style.textAlign="center",i.style.backgroundColor="#C0C0C0",i.style.color="black",i.style.fontSize="13px",i.style.verticalAlign="middle",i.textContent=e.Header[o]?"-":"+",i.onclick=function(){Un(o),Game.UpdateMenu()},n.appendChild(i),n}function Rn(e,t,o,n){const i=document.createElement("div");i.className="listing";const a=document.createElement("b");if(a.textContent=t,i.appendChild(a),"withTooltip"===e){i.className="listing",i.appendChild(document.createTextNode(" "));const e=document.createElement("span");e.onmouseout=function(){Game.tooltip.hide()},e.onmouseover=function(){Game.tooltip.draw(this,escape(R[n].innerHTML))},e.style.cursor="default",e.style.display="inline-block",e.style.height="10px",e.style.width="10px",e.style.borderRadius="5px",e.style.textAlign="center",e.style.backgroundColor="#C0C0C0",e.style.color="black",e.style.fontSize="9px",e.style.verticalAlign="bottom",e.textContent="?",i.appendChild(e)}return i.appendChild(document.createTextNode(": ")),i.appendChild(o),i}function In(e){const t=document.createDocumentFragment();t.appendChild(document.createTextNode(`${e.length} `));const o=document.createElement("span");o.onmouseout=function(){Game.tooltip.hide()};const n=document.createElement("div"),i=document.createElement("div");i.style.minWidth="140px",i.style.marginBottom="4px";const a=document.createElement("div");return a.className="name",a.style.marginBottom="4px",a.style.textAlign="center",a.textContent="Missing",i.appendChild(a),Object.keys(e).forEach((t=>{const o=document.createElement("div");o.style.textAlign="center",o.appendChild(document.createTextNode(e[t])),i.appendChild(o)})),n.appendChild(i),o.onmouseover=function(){Game.tooltip.draw(this,escape(n.innerHTML))},o.style.cursor="default",o.style.display="inline-block",o.style.height="10px",o.style.width="10px",o.style.borderRadius="5px",o.style.textAlign="center",o.style.backgroundColor="#C0C0C0",o.style.color="black",o.style.fontSize="9px",o.style.verticalAlign="bottom",o.textContent="?",t.appendChild(o),t}function zn(t){const o=document.createElement("div");if(o.className="subsection",o.appendChild(t),o.appendChild($n("Lucky Cookies","Lucky")),e.Header.Lucky&&o.appendChild(function(){const e=Game.auraMult("Dragon's Fortune")?"GoldCookDragonsFortuneTooltipPlaceholder":"GoldCookTooltipPlaceholder",t=document.createElement("div");t.className="CMStatsLuckySection";const o=Game.cookies+uo(){Game.HasUnlocked(_o[e])||c.push(_o[e])})),0!==c.length&&e.appendChild(Rn("basic","Rare plant drops left to unlock",In(c))),e}())),o.appendChild($n("Prestige","Prestige")),e.Header.Prestige&&o.appendChild(function(){const t=document.createElement("div");t.className="CMStatsPrestigeSection";const o=Math.floor(Game.HowMuchPrestige(Rt+Game.cookiesReset+kt+(Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg")?ft:0)));t.appendChild(Rn("withTooltip","Prestige level (cur / max)",document.createTextNode(`${de(Game.prestige)} / ${de(o)}`),"PrestMaxTooltipPlaceholder"));const n=Math.max(0,Game.HowManyCookiesReset(o+1)-(Rt+Game.cookiesReset+kt+(Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg")&&ft?ft:0))),i=document.createDocumentFragment();i.appendChild(document.createTextNode(de(n)));const a=document.createElement("small");a.textContent=` (${pe(n/It,1)})`,i.appendChild(a),t.appendChild(Rn("withTooltip","Cookies to next level",i,"NextPrestTooltipPlaceholder")),t.appendChild(Rn("withTooltip","Heavenly chips (cur / max)",document.createTextNode(`${de(Game.heavenlyChips)} / ${de(o-Game.prestige+Game.heavenlyChips)}`),"HeavenChipMaxTooltipPlaceholder")),t.appendChild(Rn("basic","Heavenly chips per second (last 5 seconds)",document.createTextNode(de(mt,2))));const r=Number(e.HeavenlyChipsTarget);if(!Number.isNaN(r)){const e=r-Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned));e>0&&(t.appendChild(Rn("basic","Heavenly chips to target set in settings (cur)",document.createTextNode(de(e)))),t.appendChild(Rn("basic","Time till target (cur, current 5 second average)",document.createTextNode(pe(e/mt)))))}const l=function(e){let t=Game.cookiesPs;xo(),0===Zt["Heavenly key"].bought&&(Zt["Heavenly chip secret"].bought=1,Zt["Heavenly cookie stand"].bought=1,Zt["Heavenly bakery"].bought=1,Zt["Heavenly confectionery"].bought=1,Zt["Heavenly key"].bought=1,$o(),t=Qe,xo()),Rt>=1e6&&Uo("Sacrifice"),Rt>=1e9&&Uo("Oblivion"),Rt>=1e12&&Uo("From scratch"),Rt>=1e15&&Uo("Nihilism"),Rt>=1e18&&Uo("Dematerialize"),Rt>=1e21&&Uo("Nil zero zilch"),Rt>=1e24&&Uo("Transcendence"),Rt>=1e27&&Uo("Obliterate"),Rt>=1e30&&Uo("Negative void"),Rt>=1e33&&Uo("To crumbs, you say?"),Rt>=1e36&&Uo("You get nothing"),Rt>=1e39&&Uo("Humble rebeginnings"),Rt>=1e42&&Uo("The end of the world"),Rt>=1e45&&Uo("Oh, you're back"),Rt>=1e48&&Uo("Lazarus"),Rt>=1e51&&Uo("Smurf account"),Rt>=1e54&&Uo("If at first you don't succeed"),Zt["Heavenly chip secret"].bought=1,Zt["Heavenly cookie stand"].bought=1,Zt["Heavenly bakery"].bought=1,Zt["Heavenly confectionery"].bought=1,Zt["Heavenly key"].bought=1,He=e;const o=je;$o(),Xo(),o!==je&&$o();const n=Qe-t;return He=Game.prestige,n}(o),s=document.createDocumentFragment();s.appendChild(document.createTextNode(de(l)));const c=Math.round(l/Game.cookiesPs*1e4);if(Number.isFinite(c)&&0!==c){const e=document.createElement("small");e.textContent=` (${c/100}% of income)`,s.appendChild(e)}t.appendChild(Rn("withTooltip","Reset bonus income",s,"ResetTooltipPlaceholder"));const d=Math.floor(Game.HowMuchPrestige(Game.cookiesReset)),p=Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned)),u=p-d;if(!Game.Has("Lucky digit")){let e=7-p%10;e<0&&(e+=10);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(Rn("basic",'Next "Lucky Digit" (total / reset)',i))}if(!Game.Has("Lucky number")){let e=777-p%1e3;e<0&&(e+=1e3);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(Rn("basic",'Next "Lucky Number" (total / reset)',i))}if(!Game.Has("Lucky payout")){let e=777777-p%1e6;e<0&&(e+=1e6);const o=u+e,n=p+e,i=document.createDocumentFragment();i.appendChild(document.createTextNode(`${n.toLocaleString()} / ${o.toLocaleString()} (+${e})`)),t.appendChild(Rn("basic",'Next "Lucky Payout" (total / reset)',i))}return t}()),Game.cpsSucked>0&&(o.appendChild($n("Wrinklers","Wrink")),e.Header.Wrink)){const e=document.createDocumentFragment();e.appendChild(document.createTextNode(`${de(kt)} / ${de(Gt)} `));const t=document.createElement("a");t.textContent="Pop All Normal",t.className="option",t.onclick=function(){Nn()},e.appendChild(t),o.appendChild(Rn("basic","Rewards of Popping (All/Normal)",e));const n=document.createDocumentFragment();n.appendChild(document.createTextNode(`${de(vt[0])} `));const i=document.createElement("a");i.textContent="Pop Single Fattest",i.className="option",i.onclick=function(){null!==vt[1]&&(Game.wrinklers[vt[1]].hp=0)},n.appendChild(i),o.appendChild(Rn("basic",`Rewards of Popping Single Fattest Non-Shiny Wrinkler (id: ${null!==vt[1]?vt[1]:"None"})`,n))}if(o.appendChild(function(){const t=document.createElement("div");t.className="CMStatsSeasonSection";let o=!1;const n=[];Object.keys(Io).forEach((e=>{Game.Has(Io[e])||(n.push(Io[e]),o=!0)}));const i=[];Object.keys(zo).forEach((e=>{Game.Has(zo[e])||(i.push(zo[e]),o=!0)}));const a=[];Object.keys(Vo).forEach((e=>{Game.Has(Vo[e])||(a.push(Vo[e]),o=!0)}));const r=[];Object.keys(Game.eggDrops).forEach((e=>{Game.HasUnlocked(Game.eggDrops[e])||(r.push(Game.eggDrops[e]),o=!0)}));const l=[];Object.keys(Game.rareEggDrops).forEach((e=>{Game.HasUnlocked(Game.rareEggDrops[e])||(l.push(Game.rareEggDrops[e]),o=!0)}));const s=Game.HasUnlocked("Chocolate egg")&&!Game.Has("Chocolate egg"),c=Game.Has("Century egg");if(("christmas"===Game.season||o||s||c)&&(t.appendChild($n("Season Specials","Sea")),e.Header.Sea)){if(0!==n.length){t.appendChild(Rn("basic","Halloween cookies left to buy",In(n)));let e=.95;if(Game.HasAchiev("Spooky cookies")&&(e=.8),Game.Has("Starterror")&&(e*=.9),e*=1/Game.dropRateMult(),Game.hasGod){const t=Game.hasGod("seasons");1===t?e*=.9:2===t?e*=.95:3===t&&(e*=.97)}const o=n.length/7;t.appendChild(Rn("basic","Chance of receiving a cookie from wrinkler/shiny wrinkler",document.createTextNode(`${de((1-e)*o*100)}% / ${de((1-.9*e)*o*100)}%`)))}if(0!==i.length){t.appendChild(Rn("basic","Christmas cookies left to buy",In(i)));let e=.8;if(Game.HasAchiev("Let it snow")&&(e=.6),e*=1/Game.dropRateMult(),Game.Has("Starsnow")&&(e*=.95),Game.hasGod){const t=Game.hasGod("seasons");1===t?e*=.9:2===t?e*=.95:3===t&&(e*=.97)}const o=i.length/7;t.appendChild(Rn("basic","Chance of receiving a cookie from reindeer",document.createTextNode(`${de((1-e)*o*100)}%`)))}0!==a.length&&t.appendChild(Rn("basic","Valentine cookies left to buy",In(a)));const e=function(e){let t=e*(1/Game.dropRateMult());if(Game.HasAchiev("Hide & seek champion")&&(t*=.7),Game.Has("Omelette")&&(t*=.9),Game.Has("Starspawn")&&(t*=.9),Game.hasGod){const e=Game.hasGod("seasons");1===e?t*=.9:2===e?t*=.95:3===e&&(t*=.97)}const o=1-t,n=Game.eggDrops.length-r.length,i=Game.rareEggDrops.length-l.length,a=.9*o*(1-n/Game.eggDrops.length),s=.1*o*(1-i/Game.rareEggDrops.length),c=.9*o*(n/Game.eggDrops.length)+.1*o*(i/Game.rareEggDrops.length);return[a+.9*c*(1-n/Game.eggDrops.length),s+.1*c*(1-i/Game.rareEggDrops.length)]};0!==r.length&&(t.appendChild(Rn("basic","Normal easter eggs left to unlock",In(r))),t.appendChild(Rn("basic","Chance of receiving an egg from wrinkler/golden cookie",document.createTextNode(`${de(100*e(.98)[0])}% / ${de(100*e(.9)[0])}%`)))),0!==l.length&&(t.appendChild(Rn("basic","Rare easter eggs left to unlock",In(l))),t.appendChild(Rn("basic","Chance of receiving a rare egg from wrinkler/golden cookie",document.createTextNode(`${de(100*e(.98)[1])}% / ${de(100*e(.9)[1])}%`)))),"christmas"===Game.season&&t.appendChild(Rn("basic","Reindeer reward",document.createTextNode(de(gt)))),s&&t.appendChild(Rn("withTooltip","Chocolate egg cookies",document.createTextNode(de(ft)),"ChoEggTooltipPlaceholder")),c&&t.appendChild(Rn("basic","Century egg multiplier",document.createTextNode(Math.round(1e4*(ht-1))/100+"%")))}return t}()),o.appendChild($n("Miscellaneous","Misc")),e.Header.Misc){if(o.appendChild(Rn("basic",`Average cookies per second (past ${K[e.AvgCPSHist]<60?`${K[e.AvgCPSHist]} seconds`:K[e.AvgCPSHist]/60+(3===e.AvgCPSHist?" minute":" minutes")})`,document.createTextNode(de(po(),3)))),o.appendChild(Rn("basic",`Average cookie clicks per second (past ${J[e.AvgClicksHist]}${0===e.AvgClicksHist?" second":" seconds"})`,document.createTextNode(de(Mt,1)))),o.appendChild(Rn("basic",`Cookies from clicking (past ${J[e.AvgClicksHist]}${0===e.AvgClicksHist?" second":" seconds"})`,document.createTextNode(de(me.calcSum(Mt*J[e.AvgClicksHist]))))),Game.Has("Fortune cookies")){const e=[];Object.keys(Ro).forEach((t=>{Game.Has(Ro[t])||e.push(Ro[t])})),0!==e.length&&o.appendChild(Rn("basic","Fortune Upgrades Left to Buy",In(e)))}if(e.ShowMissedGC&&o.appendChild(Rn("basic","Missed golden cookies",document.createTextNode(de(Game.missedGoldenClicks)))),Game.prefs.autosave){const e=document.createElement("span");e.id="CMStatsAutosaveTimer",e.innerText=Game.sayTime(60*Game.fps-(Game.OnAscend?0:Game.T%(60*Game.fps)),4),o.appendChild(Rn("basic","Time till autosave",e))}}l("menu").insertBefore(o,l("menu").childNodes[2]),e.MissingUpgrades&&l("menu").childNodes.forEach((e=>{if(e.children[0])if("Prestige"===e.children[0].innerHTML&&Pt){const t=Pt.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesPrestigeTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing Prestige upgrades: ${t}/${Game.PrestigeUpgrades.length} (${Math.floor(t/Game.PrestigeUpgrades.length*100)}%)`,o.appendChild(n),e.appendChild(o);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=Pt,e.appendChild(i)}else if("Upgrades"===e.children[0].innerHTML){if(St){const t=St.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing normal upgrades: ${t}/${Game.UpgradesByPool[""].length+Game.UpgradesByPool.tech.length} (${Math.floor(t/(Game.UpgradesByPool[""].length+Game.UpgradesByPool.tech.length)*100)}%)`,o.appendChild(n),e.insertBefore(o,e.childNodes[3]);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=St,e.insertBefore(i,document.getElementById("CMMissingUpgradesTitle").nextSibling)}if(Bt){const t=Bt.match(new RegExp("div","g")||0).length/2,o=document.createElement("div");o.id="CMMissingUpgradesCookiesTitle",o.className="listing";const n=document.createElement("div");n.innerHTML=`Missing Cookie upgrades: ${t}/${Game.UpgradesByPool.cookie.length} (${Math.floor(t/Game.UpgradesByPool.cookie.length*100)}%)`,o.appendChild(n),e.appendChild(o);const i=document.createElement("div");i.className="listing crateBox",i.innerHTML=Bt,e.appendChild(i)}}})),e.MissingAchievements&&function(){let t;Object.values(document.querySelectorAll("div.title")).forEach((e=>{e.textContent.includes("Achievements")&&(t=e.parentElement.querySelectorAll("div.listing.crateBox")[0])})),e.MissingAchievements&&Object.values(t.children).forEach((e=>{if(!e.className.includes("enabled")){const t=e.onclick.toString().match(/(?<=\[).*(?=\])/g)[0],{icon:o}=Game.AchievementsById[t];e.style.backgroundPosition=`${48*-o[0]}px ${48*-o[1]}px`,e.onmouseover=function(){Game.mouseDown||(Game.setOnCrate(this),Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return function(e){const t=[];"shadow"===e.pool?t.push("Shadow Achievement","#9700cf"):t.push("Achievement",0),t.push("Locked",0);let o=0;(Game.Has("Neuromancy")||Game.sesame&&"debug"===e.pool)&&(o=1),o&&0===e.won?t.push("Click to win!","#00c462"):o&&e.won>0&&t.push("Click to lose!","#00c462");let{icon:n}=e;e.iconFunction&&(n=e.iconFunction());let{desc:i}=e;e.descFunc&&(i=e.descFunc("stats"));let a="";for(let e=0;e[${t[e]}]`);return a=a.substring(1),`
\n
\n
${e.name}
\n ${a}
${i}
\n ${Game.sesame?`
Id : ${e.id} | Order : ${Math.floor(e.order)}${e.tier?` | Tier : ${e.tier}`:""}
`:""}`}(Game.AchievementsById[t])}),"top"),Game.tooltip.wobble())}}}))}()}const Vn={Favourite:"Favourite Settings",Calculation:"Calculation",Notation:"Notation",Colours:"Colours and colour coding",BarsDisplay:"Infobars and visual settings",Tooltip:"Tooltips",Statistics:"Statistics",Notification:"Notifications",Miscellaneous:"Miscellaneous"},_n={NotificationGeneral:"General Notifications",NotificationGC:"Golden Cookie",NotificationFC:"Fortune Cookie",NotificationSea:"Season Special",NotificationGard:"Garden Tick",NotificationMagi:"Full Magic Bar",NotificationWrink:"Wrinkler",NotificationWrinkMax:"Maximum Wrinklers"};function Qn(t,o){const n=document.createElement("div");n.className="title",n.style.opacity="0.7",n.style.fontSize="17px",n.appendChild(document.createTextNode(`${o} `));const i=document.createElement("span");return i.style.cursor="pointer",i.style.display="inline-block",i.style.height="14px",i.style.width="14px",i.style.borderRadius="7px",i.style.textAlign="center",i.style.backgroundColor="#C0C0C0",i.style.color="black",i.style.fontSize="13px",i.style.verticalAlign="middle",i.textContent=e.Header[t]?"-":"+",i.onclick=function(){Un(t),Game.UpdateMenu()},n.appendChild(i),n}function Xn(t){const o=document.createElement("div");if(o.className="listing",1===e.FavouriteSettings&&o.appendChild(function(e){const t=document.createElement("a");return ce.includes(e)?(t.innerText="★",t.style.color="yellow"):t.innerText="☆",t.className="option",t.onclick=function(){!function(e){ce.includes(e)?ce=ce.filter((function(t){return t!==e})):ce.push(e)}(e),Bn(),Game.UpdateMenu()},t.onmouseover=function(){Game.tooltip.draw(this,escape(R.FavouriteSettingPlaceholder.innerHTML))},t.onmouseout=function(){Game.tooltip.hide()},t.appendChild(document.createTextNode(" ")),t}(t)),"bool"===yn[t].type){const n=document.createElement("a");yn[t].toggle&&0===e[t]?n.className="option off":n.className="option",n.id=Dn+t,n.onclick=function(){!function(t){e[t]+=1,e[t]===yn[t].label.length?(e[t]=0,yn[t].toggle&&(l(Dn+t).className="option off")):l(Dn+t).className="option",void 0!==yn[t].func&&yn[t].func(),l(Dn+t).innerHTML=yn[t].label[e[t]],Bn()}(t)},n.textContent=yn[t].label[e[t]],o.appendChild(n);const i=document.createElement("label");return i.textContent=yn[t].desc,i.style.lineHeight="1.6",o.appendChild(i),o}if("vol"===yn[t].type){const n=document.createElement("div");n.className="sliderBox";const i=document.createElement("div");i.style.float="left",i.innerHTML=yn[t].desc,n.appendChild(i);const a=document.createElement("div");a.id=`slider${t}right`,a.style.float="right",a.innerHTML=`${e[t]}%`,n.appendChild(a);const r=document.createElement("input");r.className="slider",r.id=`slider${t}`,r.style.clear="both",r.type="range",r.min="0",r.max="100",r.step="1",r.value=e[t],r.oninput=function(){Hn(t)},r.onchange=function(){Hn(t)},n.appendChild(r),o.appendChild(n);const l=document.createElement("a");return l.className="option",l.onclick=function(){Tn(e[t.replace("Volume","SoundURL")],t.replace("Volume","Sound"),t,!0)},l.textContent="Test sound",o.appendChild(l),o}if("url"===yn[t].type){const n=document.createElement("span");n.className="option",n.textContent=`${yn[t].label} `,n.style.lineHeight="1.6",o.appendChild(n);const i=document.createElement("input");i.id=Dn+t,i.className="option",i.type="text",i.readOnly=!0,i.setAttribute("value",e[t]),i.style.width="300px",o.appendChild(i),o.appendChild(document.createTextNode(" "));const a=document.createElement("input");a.id=`${Dn+t}Prompt`,a.className="option",a.type="text",a.setAttribute("value",e[t]);const r=document.createElement("a");r.className="option",r.onclick=function(){!function(e,t){Game.promptWrapL.className="framed";const o=e;Game.promptL.innerHTML=`${o}
`,Object.keys(t).forEach((e=>{const o=document.createElement("a");o.id=`promptOption${e}`,o.className="option",o.onclick=function(){PlaySound("snd/tick.mp3"),t[e][1]()},o.textContent=t[e][0],Game.promptL.children[1].appendChild(o)})),Game.promptAnchorL.style.display="block",Game.darkenL.style.display="block",Game.promptL.focus(),Game.promptOn=1,Game.UpdatePrompt()}(a.outerHTML,[["Save",function(){e[t]=l(`CMConfig${t}Prompt`).value,Bn(),Game.ClosePrompt(),Game.UpdateMenu()}],["Cancel",function(){Game.ClosePrompt()}]])},r.textContent="Edit",o.appendChild(r);const s=document.createElement("label");return s.textContent=yn[t].desc,s.style.lineHeight="1.6",o.appendChild(s),o}if("colour"===yn[t].type){const n=document.createElement("span");n.className="option";const i=document.createElement("input");i.id=t,i.style.width="65px",i.setAttribute("value",e[t]),n.appendChild(i),new An(i,{hash:!0,position:"right",onInput:function(){e[this.targetElement.id]=this.toHEXString(),Pn(),Bn(),Game.UpdateMenu()}});const a=document.createElement("label");if(a.textContent=yn[t].desc,a.style.lineHeight="1.6",n.appendChild(a),t.includes("Flash")){const e=document.createElement("a");e.className="option",e.onclick=function(){xn(3,t.replace("Colour",""),!0)},e.textContent="Test flash",n.appendChild(e)}return o.appendChild(n),jn().init(),o}if("numscale"===yn[t].type){const n=document.createElement("span");n.className="option",n.textContent=`${yn[t].label} `,n.style.lineHeight="1.6",o.appendChild(n);const i=document.createElement("input");i.id=Dn+t,i.className="option",i.type="number",i.value=e[t],i.min=yn[t].min,i.max=yn[t].max,i.oninput=function(){this.value>this.max&&console.log("TEST"),e[t]=this.value,Bn(),pn()},o.appendChild(i),o.appendChild(document.createTextNode(" "));const a=document.createElement("label");return a.textContent=yn[t].desc,a.style.lineHeight="1.6",o.appendChild(a),o}return o}function qn(t){if(1===e.TimerBar&&0===e.TimerBarPos){const e=parseInt(l("CMTimerBar").style.height,10);Game.mouseY-=e,t(),Game.mouseY+=e}else t()}function Yn(){P.Beautify=Beautify,Beautify=de,P.CalculateGains=Game.CalculateGains,Game.CalculateGains=function(){P.CalculateGains(),Ve=1},P.tooltip={},P.tooltip.draw=Game.tooltip.draw,P.tooltip.drawMod=new Function(`return ${Game.tooltip.draw.toString().split("this").join("Game.tooltip")}`)(),Game.tooltip.draw=function(e,t,o){P.tooltip.drawMod(e,t,o)},P.tooltip.update=Game.tooltip.update,P.tooltip.updateMod=new Function(`return ${Game.tooltip.update.toString().split("this.").join("Game.tooltip.")}`)(),Game.tooltip.update=function(){P.tooltip.updateMod(),function(){if("store"===Game.tooltip.origin){let t=0;1===e.ToolWarnLucky&&1===e.ToolWarnPos&&null!==l("CMDispTooltipWarningParent")&&(t=l("CMDispTooltipWarningParent").clientHeight-4),Game.tooltip.tta.style.top=`${Math.min(parseInt(Game.tooltip.tta.style.top,10),l("game").clientHeight+l("topBar").clientHeight-Game.tooltip.tt.clientHeight-t-46)}px`}}()},P.UpdateWrinklers=Game.UpdateWrinklers,Game.UpdateWrinklers=function(){qn(P.UpdateWrinklers)},P.UpdateSpecial=Game.UpdateSpecial,Game.UpdateSpecial=function(){qn(P.UpdateSpecial)},l("bigCookie").removeEventListener("click",Game.ClickCookie,!1),l("bigCookie").addEventListener("click",(function(){qn(Game.ClickCookie)}),!1),P.RebuildUpgrades=Game.RebuildUpgrades,Game.RebuildUpgrades=function(){P.RebuildUpgrades(),S=[],Object.keys(Game.UpgradesInStore).forEach((e=>{null!==l(`upgrade${e}`).onmouseover&&(S[e]=l(`upgrade${e}`).onmouseover,l(`upgrade${e}`).onmouseover=function(){Game.mouseDown||(Game.setOnCrate(this),Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return On("u",`${e}`)}),"store"),Game.tooltip.wobble())})})),Game.CalculateGains()},P.ClickProduct=Game.ClickProduct,Game.ClickProduct=function(t){(!e.BulkBuyBlock||Game.ObjectsById[t].bulkPrice-1;--e)if(Game.ObjectsById[e].amount>0){const o=Jt[Game.ObjectsById[e].name].name;Jt[o].amount-=1,We-=1,t=Jt[o].basePrice*Game.priceIncrease**Math.max(0,Jt[o].amount-1-Jt[o].free),t=Game.modifyBuildingPrice(Jt[o],t),t=Math.ceil(t);break}const o=je;return $o(),Xo(),o!==je&&$o(),[Qe-Game.cookiesPs,t]}(t),n=pe(o/(e+Game.cookiesPs)),i=de(e/Game.cookiesPs*100);l("dragonAuraInfo").style.minHeight="60px",l("dragonAuraInfo").style.margin="8px",l("dragonAuraInfo").appendChild(document.createElement("div")).className="line";const a=document.createElement("div");a.style.minWidth="200px",a.style.textAlign="center",a.textContent=`Picking this aura will change CPS by ${de(e)} (${i}% of current CPS).`,l("dragonAuraInfo").appendChild(a);const r=document.createElement("div");r.style.minWidth="200px",r.style.textAlign="center",r.textContent=`It will take ${n} to recover the cost.`,l("dragonAuraInfo").appendChild(r)}}(t)},P.ToggleSpecialMenu=Game.ToggleSpecialMenu,Game.ToggleSpecialMenu=function(e){P.ToggleSpecialMenu(e),function(){if(null!==(l("specialPopup").className.match(/onScreen/)&&l("specialPopup").children[0].style.background.match(/dragon/)))for(let e=0;e${Je}`,"this"),Game.tooltip.wobble()},l("specialPopup").children[e].onmouseout=function(){Game.tooltip.shouldHide=1})}()},P.UpdateMenu=Game.UpdateMenu,Game.UpdateMenu=function(){void 0!==jn().picker&&void 0!==jn().picker.owner||(P.UpdateMenu(),function(){const t=document.createElement("div");t.className="title","prefs"===Game.onMenu?(t.textContent="Cookie Monster Settings",function(t){const o=document.createDocumentFragment();o.appendChild(t),Object.keys(Vn).forEach((t=>{if("Favourite"===t){if(0!==ce.length&&e.FavouriteSettings>0&&(o.appendChild(Qn(t,Vn[t])),e.Header[t]))for(let e=0;e{const n=Qn(t,_n[t]);n.style.fontSize="15px",n.style.opacity="0.5",o.appendChild(n),e.Header[t]&&Object.keys(yn).forEach((e=>{yn[e].group===t&&o.appendChild(Xn(e))}))})):Object.keys(yn).forEach((e=>{yn[e].group===t&&o.appendChild(Xn(e))})))}));const n=document.createElement("div");n.className="listing";const i=document.createElement("a");i.className="option",i.onclick=function(){En(sn)},i.textContent="Restore Default",n.appendChild(i),o.appendChild(n),l("menu").childNodes[2].insertBefore(o,l("menu").childNodes[2].childNodes[l("menu").childNodes[2].childNodes.length-1])}(t)):"stats"===Game.onMenu?e.Stats&&(t.textContent="Cookie Monster Statistics",zn(t)):"log"===Game.onMenu&&(t.textContent="Cookie Monster ",function(t){const o=document.createElement("div");o.className="subsection";const n=document.createElement("span");if(n.style.cursor="pointer",n.style.display="inline-block",n.style.height="14px",n.style.width="14px",n.style.borderRadius="7px",n.style.textAlign="center",n.style.backgroundColor="#C0C0C0",n.style.color="black",n.style.fontSize="13px",n.style.verticalAlign="middle",n.textContent=e.Header.InfoTab?"-":"+",n.onclick=function(){Un("InfoTab"),Game.UpdateMenu()},t.appendChild(n),o.appendChild(t),e.Header.InfoTab){const e=document.createElement("div");e.innerHTML='
\n Cookie Monster\n offers a wide range of tools and statistics to enhance your game experience.\n It is not a cheat interface – although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.
\n Progess on new updates and all previous release notes can be found on the GitHub page linked above!
\n Please also report any bugs you may find over there!
\n
\n ',o.appendChild(e);const t=document.createElement("div");t.innerHTML='
\nThe latest update (v 2.031.6) has revamped the way PP is colourcoded. In the previous versions this was not always correct and we had some settings that made it even more incorrect. With this update Cookie Monster compares the PP of a building to all other possibilities (also buying 10 or 100) of a building and colors the PP accordingly.
\nThis means that if it is better to buy 10 of a building immediately rather than to buy in increments of 1 Cookie Monster will now show this! In this case the buy 1 option will be yellow, while the buy 10 option will be green.
\nThis also means that you will see some more diverse colors. Rather than coloring according to arbitrary "middle values" Cookie Monster now uses a top 10, 20 and 30. While this might take some getting used to we believe the new system is much better in conveying useful information to the user while also being more correct!
\n
\nThis update also implements the following functions:
\n- Added a tooltip displaying the reward to the extra pop wrinkler buttons
\n- Added tooltips to the Gods in the Pantheon
\n- The tooltip for Elder Pledge now displays correctly, although it takes some time to load after Cookie Monster has been loaded
\n- You can now test the volume and sound of notifications in the settings screen
\n- The bottom bar will now flicker less and each column has received a bit of padding
\n- Introduced new colour scheme for PP, see the explanation of colors in the Readme or the settings
\n- Added option to show buttons that can hide the upgrade and building section
\n- Added option to display PP as a time unit, note that these are only approximations. PP does not translate directly into time (the name is deceptive, we know...)
\n- Statistics page now shows chance for random drops when they have not been achieved
\n- In a later hotfix we have added a Rigidel mode that will colour all buy 1 options grey
\n
\nThis update fixes the following bugs:
\n- Incorrect amount for "required for max plant reward" in statistics page
\n- Fixed the tooltips of the \'?\' buttons in the statistics page not showing
\n- Fixed some unclear settings descriptions
\n
\nPlease submit any bug reports or feature requests to the GitHub page!\n
\n
\n',o.appendChild(t)}const i=l("menu").children[1];i.insertBefore(o,i.children[1])}(t))}())},P.sayTime=Game.sayTime,z=function(e,t){return Number.isNaN(e)||e<=0?P.sayTime(e,t):pe(e/Game.fps,1)},P.Logic=Game.Logic,Game.Logic=function(){P.Logic();let t="Cookie Clicker";"fools"===Game.season&&(t="Cookie Baker"),se=`${Game.OnAscend?"Ascending! ":""}${de(Game.cookies)} ${1===Game.cookies?"cookie":"cookies"} - ${t}`,function(){if(Game.OnAscend||0===e.Title)document.title=se;else if(1===e.Title){let e,t,o,n=!1,i=!1;e=zt?zt.wrath?`[W${Math.ceil(zt.life/Game.fps)}]`:`[G${Math.ceil(zt.life/Game.fps)}]`:Game.Has("Golden switch [off]")?"[GS]":`[${Number(l("CMTimerBarGCMinBar").textContent)<0?"!":""}${Math.ceil((Game.shimmerTypes.golden.maxTime-Game.shimmerTypes.golden.time)/Game.fps)}]`,f&&(n=!0,t="[F]"),"christmas"===Game.season&&(i=!0,o=g?`[R${Math.ceil(Vt.life/Game.fps)}]`:`[${Number(l("CMTimerBarRenMinBar").textContent)<0?"!":""}${Math.ceil((Game.shimmerTypes.reindeer.maxTime-Game.shimmerTypes.reindeer.time)/Game.fps)}]`);let a=se;"["===a.charAt(0)&&(a=a.substring(a.lastIndexOf("]")+1)),document.title=`${e+(n?t:"")+(i?o:"")} ${a}`}else if(2===e.Title){let e="",t=!1;zt&&(t=!0,zt.wrath?e+=`[W${Math.ceil(zt.life/Game.fps)}]`:e+=`[G${Math.ceil(zt.life/Game.fps)}]`),f&&(t=!0,e+="[F]"),"christmas"===Game.season&&g&&(e+=`[R${Math.ceil(Vt.life/Game.fps)}]`,t=!0),t&&(e+=" - ");let o="Cookie Clicker";"fools"===Game.season&&(o="Cookie Baker"),e+=o,document.title=e}}(),function(){const t=Math.max(0,Game.HowManyCookiesReset(Math.floor(Game.HowMuchPrestige(Game.cookiesReset+Game.cookiesEarned))+1)-(Game.cookiesEarned+Game.cookiesReset)),o=Game.sayTime((Date.now()-Game.startDate)/1e3*Game.fps,-1);let n="";n+=`You've been on this run for ${""===o?"not very long":o}.
`,n+='
',Game.prestige>0&&(n+=`Your prestige level is currently ${de(Game.prestige)}.
(CpS +${de(Game.prestige)}%)`,n+='
'),n+=Ne<1?"Ascending now would grant you no prestige.":Ne<2?"Ascending now would grant you
1 prestige level (+1% CpS)
and 1 heavenly chip to spend.":`Ascending now would grant you
${de(Ne)} prestige levels (+${de(Ne)}% CpS)
and ${de(Ne)} heavenly chips to spend.`,n+='
',n+=`You need ${de(t)} more cookies for the next level.
`,n+=e.TooltipAscendButton?`
It takes ${_t} to reach the next level and you were making ${de(mt,2)} chips on average in the last 5 seconds.
`:"",l("ascendTooltip").innerHTML=n}()}}function Kn(){vn(),nn(),ln(),r=Object.keys(Game.mods).length,x=document.createElement("style"),x.type="text/css",x.id="CMCSS",document.head.appendChild(x),function(){const e=document.createElement("div");e.id="CMBotBar",e.style.height="69px",e.style.width="100%",e.style.position="absolute",e.style.display="none",e.style.backgroundColour="#262224",e.style.backgroundImage="linear-gradient(to bottom, #4d4548, #000000)",e.style.borderTop="1px solid black",e.style.overflow="auto",e.style.textShadow="-1px 0 black, 0 1px black, 1px 0 black, 0 -1px black";const t=e.appendChild(document.createElement("table"));t.style.width="100%",t.style.textAlign="center",t.style.whiteSpace="nowrap";const o=t.appendChild(document.createElement("tbody")),n=function(e,t){const o=document.createElement("td");return o.style.textAlign="right",o.className=B+t,o.textContent=e,o},i=o.appendChild(document.createElement("tr"));i.style.fontWeight="bold",i.appendChild(n("CM 2.031.6",F)),o.appendChild(document.createElement("tr")).appendChild(n("Bonus Income",N)),o.appendChild(document.createElement("tr")).appendChild(n("Payback Period",N)),o.appendChild(document.createElement("tr")).appendChild(n("Time Left",N)),l("wrapper").appendChild(e),Object.keys(Game.Objects).forEach((e=>{ho(e)}))}(),function(){const e=document.createElement("div");e.id="CMTimerBar",e.style.position="absolute",e.style.display="none",e.style.height="0px",e.style.fontSize="10px",e.style.fontWeight="bold",e.style.backgroundColour="black";const t=mo("CMTimerBarGC","Next Cookie",[{id:"CMTimerBarGCMinBar",color:j},{id:"CMTimerBarGCBar",color:A}]);e.appendChild(t);const o=mo("CMTimerBarRen","Next Reindeer",[{id:"CMTimerBarRenMinBar",color:j},{id:"CMTimerBarRenBar",color:W}]);e.appendChild(o);const n=document.createElement("div");n.id="CMTimerBarBuffTimers",e.appendChild(n),l("wrapper").appendChild(e)}(),function(){const e=document.createElement("div");e.id="CMUpgradeBar",e.style.width="100%",e.style.backgroundColour="black",e.style.textAlign="center",e.style.fontWeight="bold",e.style.display="none",e.style.zIndex="21",e.onmouseout=function(){Game.tooltip.hide()};const t=document.createElement("div");t.appendChild(function(){const e=document.createElement("div");e.style.minWidth="330px",e.style.marginBottom="4px";const t=document.createElement("div");t.className="name",t.style.marginBottom="4px",t.textContent="Legend",e.appendChild(t);const o=function(e,t){const o=document.createElement("div");o.style.verticalAlign="middle";const n=document.createElement("span");return n.className=E+e,n.style.display="inline-block",n.style.height="10px",n.style.width="10px",n.style.marginRight="4px",o.appendChild(n),o.appendChild(document.createTextNode(t)),o};return e.appendChild(o(N,"Better than the best PP of a building option")),e.appendChild(o(O,"Same as the best PP building option")),e.appendChild(o(F,"Within the top 10 of PP for buildings")),e.appendChild(o(W,"Within the top 20 of PP for buildings")),e.appendChild(o(L,"Within the top 30 of PP for buildings")),e.appendChild(o(A,"Outside of the top 30 of PP for buildings")),e.appendChild(o(j,"Negative or infinity PP")),e}()),e.onmouseover=function(){Game.tooltip.draw(this,escape(t.innerHTML),"store")};const o=function(e,t){const o=document.createElement("span");return o.id=e,o.className=B+t,o.style.width="14.28571428571429%",o.style.display="inline-block",o.textContent="0",o};e.appendChild(o("CMUpgradeBarBlue",N)),e.appendChild(o("CMUpgradeBarGreen",O)),e.appendChild(o("CMUpgradeBarYellow",F)),e.appendChild(o("CMUpgradeBarOrange",W)),e.appendChild(o("CMUpgradeBarRed",L)),e.appendChild(o("CMUpgradeBarPurple",A)),e.appendChild(o("CMUpgradeBarGray",j)),l("upgrades").parentNode.insertBefore(e,l("upgrades").parentNode.childNodes[3])}(),function(){const e=document.createElement("div");e.id="CMFlashScreen",e.style.width="100%",e.style.height="100%",e.style.backgroundColor="white",e.style.display="none",e.style.zIndex="9999999999",e.style.position="absolute",l("wrapper").appendChild(e)}(),function(){const e=document.createElement("div");e.id="CMSectionHidButtons",e.style.textAlign="center";const t=document.createElement("a");t.className="option",t.onclick=function(){"flex"===l("upgrades").style.display?(l("upgrades").style.display="none",l("toggleUpgrades").style.display="none",l("techUpgrades").style.display="none",l("vaultUpgrades").style.display="none"):(l("upgrades").style.display="flex",0!==l("toggleUpgrades").children.length&&(l("toggleUpgrades").style.display="block"),0!==l("techUpgrades").children.length&&(l("techUpgrades").style.display="block"),0!==l("vaultUpgrades").children.length&&(l("vaultUpgrades").style.display="block"))},t.textContent="Hide/Show Upgrades",e.appendChild(t);const o=document.createElement("a");o.className="option",o.onclick=function(){"grid"===l("products").style.display?l("products").style.display="none":l("products").style.display="grid"},o.textContent="Hide/Show Buildings",e.appendChild(o),l("store").insertBefore(e,l("store").childNodes[2])}(),function(){const e=document.createElement("link");e.id="CMFavicon",e.rel="shortcut icon",e.href="https://orteil.dashnet.org/cookieclicker/favicon.ico",document.getElementsByTagName("head")[0].appendChild(e)}(),Object.keys($).forEach((e=>{!function(e,t,o){const n=document.createElement("div");n.id=e;const i=document.createElement("div");i.style.minWidth=o,i.style.marginBottom="4px";const a=document.createElement("div");a.style.textAlign="left",a.textContent=t,i.appendChild(a),n.appendChild(i),R[e]=n}($[e][0],$[e][1],$[e][2])})),function(){const e=document.createElement("a");e.id="PopAllNormalWrinklerButton",e.textContent="Pop All Normal",e.className="option",e.onclick=function(){Nn()},e.onmouseout=function(){Game.tooltip.shouldHide=1},e.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return On("wb","PopAll")}),"this"),Game.tooltip.wobble()},l("sectionLeftExtra").children[0].append(e);const t=document.createElement("a");t.id="PopFattestWrinklerButton",t.textContent="Pop Single Fattest",t.className="option",t.onclick=function(){null!==vt[1]&&(Game.wrinklers[vt[1]].hp=0)},t.onmouseout=function(){Game.tooltip.shouldHide=1},t.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return On("wb","PopFattest")}),"this"),Game.tooltip.wobble()},l("sectionLeftExtra").children[0].append(t)}(),l("products").style.display="grid",l("storeBulk").style.gridRow="1/1",l("upgrades").style.display="flex",l("upgrades").style["flex-wrap"]="wrap",Object.keys(Game.Objects).forEach((e=>{const t=Game.Objects[e];null!==l(`product${t.id}`).onmouseover&&(T[e]=l(`product${t.id}`).onmouseover,l(`product${t.id}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return On("b",`${e}`)}),"store"),Game.tooltip.wobble()})})),Game.canLumps()&&(s=l("lumps").onmouseover,l("lumps").onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return On("s","Lump")}),"this"),Game.tooltip.wobble()}),h=Game.LoadMinigames,Game.LoadMinigames=function(){h(),Game.Objects.Farm.minigameLoaded&&(l("gardenTool-1").onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return On("ha","HarvestAllButton")}),"this"),Game.tooltip.wobble()},Array.from(l("gardenPlot").children).forEach((e=>{const t=e.id.slice(-3);e.onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return On("p",[`${t[0]}`,`${t[2]}`])}),"this"),Game.tooltip.wobble()}}))),Fn(),function(){if(Game.Objects.Temple.minigameLoaded){for(let e=0;e<11;e+=1)l(`templeGod${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return On("pag",e)}),"this"),Game.tooltip.wobble()};for(let e=0;e<3;e+=1)l(`templeSlot${e}`).onmouseover=function(){Game.tooltip.dynamic=1,Game.tooltip.draw(this,(function(){return On("pas",[e,Game.Objects.Temple.minigame.slot[e]])}),"this"),Game.tooltip.wobble()}}}(),Ln()},Game.LoadMinigames(),l("backgroundLeftCanvas").onmouseover=function(){V=1},l("backgroundLeftCanvas").onmouseout=function(){V=0,Game.tooltip.hide(),Object.keys(Game.wrinklers).forEach((e=>{Q[e]=0}))},Yn(),Ln(),Game.CalculateGains(),En(),I=Game.OnAscend,Game.prefs.popups?Game.Popup("Cookie Monster version 2.031.6 loaded!"):Game.Notify("Cookie Monster version 2.031.6 loaded!","","",1,1),Game.Win("Third-party")}const Jn={init:function(){wn=!0;let e=!0;Game.version!==Number("2.031")&&(e=confirm("Cookie Monster version 2.031.6 is meant for Game version 2.031. Loading a different version may cause errors. Do you still want to load Cookie Monster?")),e&&(Kn(),Game.registerHook("draw",No),Game.registerHook("logic",Sn),Game.registerHook("click",Oo),wn=!1)},load:function(e){const t=JSON.parse(e);vn(),void 0!==t.favouriteSettings&&(ce=t.favouriteSettings),En(t.settings),"2.031.6"!==t.version&&(Game.prefs.popups?Game.Popup("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!"):Game.Notify("A new version of Cookie Monster has been loaded, check out the release notes in the info tab!","","",0,1))},save:bn};Game.registerMod("CookieMonster",Jn)})()})();