(function(t){function e(e){for(var n,o,s=e[0],u=e[1],l=e[2],h=0,g=[];h=5&&!t.$store.keepPlaying?r("transition",{attrs:{name:"victory"}},[r("div",{staticClass:"victory"},[r("h1",[t._v("You Win!")]),r("h2",[t._v("Congratulations, you beat the game in:"),r("br"),t._v(t._s(t.formatTime(t.$store.timePlayed)))]),r("h3",[t._v("You can keep going if you'd like, but things might get weird")]),r("button",{on:{click:t.keepGoing}},[t._v("Keep Going")])])]):t.$store.started?r("div",{attrs:{id:"app"}},[r("Header"),r("Town"),r("Dream",{ref:"dream"})],1):r("transition",{attrs:{name:"app"}},[r("div",{staticClass:"welcome",on:{click:t.start}},[r("img",{attrs:{src:"assets/logo.png",alt:"Dream Hero"}})])])},o=[],s=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"header"},[r("h2",[t._v("Dream Hero")]),r("h2",[t._v(t._s(t.formatWhole(t.$store.points)))]),t.$store.dreaming?r("h2",{staticStyle:{color:"var(--hi-color)"}},[t._v("+"+t._s(t.formatWhole(t.$store.tempPoints)))]):t._e(),t.$store.dreaming?r("h2",{staticStyle:{color:"var(--hi-color)"}},[t._v("Cycle "+t._s(t.$store.cycle+1))]):t._e(),t._m(0)])},u=[function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("a",{attrs:{href:"https://discord.gg/WzejVAx",target:"_blank"}},[r("img",{attrs:{src:"assets/discord.png"}})])}],l={name:"Header"},c=l,h=(r("e65f"),r("a96e")),g=Object(h["a"])(c,s,u,!1,null,"220c9fd4",null),p=g.exports,m=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("transition",{attrs:{name:"town"}},[this.$store.dreaming?t._e():r("div",{staticClass:"town-container"},[r("panZoom",{on:{init:t.onInit}},[r("div",{staticClass:"town"},[r("h1",{staticClass:"background"},[t._v("World Map")]),r("div",{class:{building:!0,highlight:t.$store.tutorialOne},staticStyle:{top:"500px",left:"700px"},on:{click:function(e){return t.$actions.openBuilding("Cot")}}},[t._v(" Cot ")]),t.$store.tutorialOne?t._e():r("div",{staticClass:"building",staticStyle:{top:"200px",left:"600px"},on:{click:function(e){return t.$actions.openBuilding("Bank")}}},[t._v(" Bank ")]),t.$store.tutorialOne?t._e():r("div",{staticClass:"building",staticStyle:{top:"800px",left:"200px"},on:{click:function(e){return t.$actions.openBuilding("Apothecary")}}},[t._v(" Apothecary ")]),t.$store.tutorialOne?t._e():r("div",{staticClass:"building",staticStyle:{top:"750px",left:"800px"},on:{click:function(e){return t.$actions.openBuilding("Armory")}}},[t._v(" Armory ")])])]),r("Modal",{attrs:{show:""!==t.$store.openBuilding},on:{close:t.$actions.closeBuilding}},[r("div",{staticStyle:{position:"relative"},attrs:{slot:"header"},slot:"header"},[r("img",{staticClass:"header",attrs:{src:"assets/"+t.buildingInfo.background+".png",alt:"$store.openBuilding"}}),r("div",{staticClass:"header-enemies"},t._l(t.buildingInfo.enemies,(function(t){return r("img",{key:t,attrs:{src:"assets/"+t+".png",alt:t}})})),0),r("h3",[t._v(t._s(t.$store.openBuilding))])]),r("div",{attrs:{slot:"body"},slot:"body"},["Cot"===t.$store.openBuilding?r("div",{staticStyle:{display:"flex","margin-bottom":"8px","border-bottom":"solid 2px var(--fg-color)","padding-bottom":"8px"}},[r("span",{staticStyle:{"flex-grow":"1"}},[t._v("I'm feeling tired...")]),r("button",{staticStyle:{float:"right"},on:{click:function(e){return t.$actions.startDream()}}},[t._v("Dream")])]):t._e(),!t.$store.tutorialOne&&t.upgradeInfo?r("div",{staticStyle:{display:"flex"}},[r("span",{staticStyle:{"flex-grow":"1"}},[t._v(t._s(t.upgradeInfo.description))]),r("button",{staticStyle:{float:"right","margin-left":"4px"},attrs:{disabled:t.$store.points.lt(t.upgradeInfo.cost)},on:{click:function(e){return t.upgradeBuilding()}}},[t._v(" Cost: "+t._s(t.formatWhole(t.upgradeInfo.cost))+" ")])]):r("div",[t._v(" You've fully upgraded this! ")])]),r("div",{staticStyle:{"margin-bottom":"-24px"},attrs:{slot:"footer"},slot:"footer"})])],1)])},f=[],d=(r("984a"),r("086c"),function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("transition",{attrs:{name:"modal"}},[t.show?r("div",{staticClass:"modal-mask"},[r("div",{staticClass:"modal-wrapper",on:{click:function(e){return e.target!==e.currentTarget?null:t.$emit("close")}}},[r("div",{staticClass:"modal-container"},[r("div",{staticClass:"modal-header"},[t._t("header",[t._v(" default header ")])],2),r("div",{staticClass:"modal-body"},[t._t("body",[t._v(" default body ")])],2),r("div",{staticClass:"modal-footer"},[t._t("footer",[r("button",{staticClass:"modal-default-button",on:{click:function(e){return t.$emit("close")}}},[t._v(" Close ")])])],2)])])]):t._e()])}),y=[],v={name:"Modal",props:{show:Boolean}},b=v,M=(r("4ffa"),Object(h["a"])(b,d,y,!1,null,"475ebd39",null)),w=M.exports,N=r("1a86"),_=r("7071"),x=r.n(_),$={name:"Town",components:{Modal:w},computed:{buildingInfo:function(){return this.$store.openBuilding&&N["a"].buildingInfo[this.$store.openBuilding]},upgradeInfo:function(){if(!this.$store.openBuilding)return null;var t=N["a"].buildingInfo[this.$store.openBuilding],e=t.upgrades[this.$store.upgrades[this.$store.openBuilding]];return!e&&t.infinite&&(e={description:t.infinite.description,cost:x.a.times(t.infinite.base,x.a.pow(t.infinite.r,this.$store.upgrades[this.$store.openBuilding]))}),e}},methods:{onInit:function(t){t.setTransformOrigin(null)},upgradeBuilding:function(){var t,e=N["a"].buildingInfo[this.$store.openBuilding];this.$store.upgrades[this.$store.openBuilding]in e.upgrades?t=e.upgrades[this.$store.upgrades[this.$store.openBuilding]].cost:e.infinite&&(t=x.a.times(e.infinite.base,x.a.pow(e.infinite.r,this.$store.upgrades[this.$store.openBuilding]))),t.lte(this.$store.points)&&(this.$store.points=this.$store.points.sub(t),this.$store.upgrades[this.$store.openBuilding]++)}}},A=$,F=(r("11b9"),Object(h["a"])(A,m,f,!1,null,"8caad2ae",null)),I=F.exports,S=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("scroll",{ref:"scroll",staticClass:"dream"},[t._l(t.$store.path,(function(t,e){return r("Floor",{key:e,attrs:{index:e}})})),t.$store.upgrades.Cot>=1?r("div",{staticClass:"endAtLoop",on:{click:t.toggleEndAtLoop}},[t.$store.endAtLoop?r("h2",[t._v("Waking up at end of this sleep cycle")]):r("h2",[t._v("Entering deeper sleep at end of this sleep cycle")]),r("span",[t._v("Click to toggle")])]):t._e(),r("Modal",{attrs:{show:t.$store.endingDream},on:{close:t.$actions.endDream}},[r("h3",{attrs:{slot:"header"},slot:"header"},[t._v("Time to wake up")]),r("div",{attrs:{slot:"body"},slot:"body"},["death"===t.$store.endingDreamStatus?r("span",[t._v(" Unfortunately, your dream has met an untimely end. You will only receive a portion of your coins:"),r("br"),t._v("+"+t._s(t.formatWhole(t.$store.tempPoints.pow(.8)))+" ")]):"floor"===t.$store.endingDreamStatus?r("span",[t._v(" You wake up early, avoiding potential death at the cost of some of your potential coins:"),r("br"),t._v("+"+t._s(t.formatWhole(t.$store.tempPoints.pow(.9)))+" ")]):r("span",[t._v(" You wake up feeling refreshed, with a heavier wallet:"),r("br"),t._v("+"+t._s(t.formatWhole(t.$store.tempPoints))+" ")])]),r("div",{attrs:{slot:"footer"},slot:"footer"},[r("button",{on:{click:t.$actions.endDream}},[t._v("Wake Up")])])])],2)},k=[],P=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:{tile:!0,blur:t.$store.position=2&&t.$store.position===t.index?"70%":"85%"}},t._l(t.$store.path[t.index].actions,(function(t,e){return r("ActionPreview",{key:e,attrs:{action:t,index:e}})})),1),r("span",{staticClass:"endAtFloor",style:{width:t.$store.upgrades.Cot>=2&&t.$store.position===t.index?"15%":"0%"},on:{click:t.toggleEndAtFloor}},[t._v(" Wake up early:"),r("br"),r("b",[t._v(t._s(t.$store.endAtFloor?"On":"Off"))])]),r("Action",{attrs:{tile:t.$store.path[t.index]}}),r("div",{staticClass:"actionProgress"},[r("div",{staticClass:"actionProgress-fill",style:{width:100*t.$store.actionProgress/t.getActionDuration()+"%"}})])],1)},C=[],O=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"action",style:{backgroundImage:"url(assets/"+t.tile.type+".png)"}},[r("img",{staticClass:"shake left",attrs:{src:"assets/hero.png",alt:"hero"}}),r("div",{staticClass:"health left"},[r("span",{style:{color:t.$store.hp.gt(t.getMaxHealth())?"var(--raised-color)":""}},[t._v(t._s(t.formatWhole(t.$store.hp)))]),r("div",{staticClass:"health-fill",style:{width:100*t.$store.hp/t.getMaxHealth()+"%"}})]),r("div",{staticClass:"shake right"},["gold"===t.tile.actions[t.$store.currentAction].type?r("img",{attrs:{src:"assets/"+(t.tile.actions[t.$store.currentAction].image||"gold")+".png",alt:t.tile.actions[t.$store.currentAction].image||"gold"}}):"enemy"===t.tile.actions[t.$store.currentAction].type?r("img",{attrs:{src:"assets/"+t.tile.actions[t.$store.currentAction].enemy+".png",alt:t.tile.actions[t.$store.currentAction].enemy}}):"potion"===t.tile.actions[t.$store.currentAction].type?r("img",{attrs:{src:"assets/potion.png",alt:"potion"}}):"gear"===t.tile.actions[t.$store.currentAction].type?r("img",{attrs:{src:"assets/shield.png",alt:"shield"}}):t._e()]),"gold"===t.tile.actions[t.$store.currentAction].type?r("span",{staticClass:"amount right"},[t._v(" "+t._s(t.formatWhole(t.tile.actions[t.$store.currentAction].amount))+" ")]):t._e(),"enemy"===t.tile.actions[t.$store.currentAction].type?r("div",{staticClass:"health right"},[r("span",[t._v(t._s(t.formatWhole(t.tile.actions[t.$store.currentAction].hp)))]),r("div",{staticClass:"health-fill",style:{width:100*t.tile.actions[t.$store.currentAction].hp/t.tile.actions[t.$store.currentAction].maxHp+"%"}})]):t._e()])},E=[],q={name:"Action",props:{tile:Object}},D=q,T=(r("67d0"),Object(h["a"])(D,O,E,!1,null,"17a74b01",null)),B=T.exports,L=function(){var t=this,e=t.$createElement,r=t._self._c||e;return"enemy"===t.action.type?r("img",{class:{actionPreview:!0,active:t.index===t.$store.currentAction},attrs:{src:"assets/"+t.action.enemy+".png",alt:t.action.enemy}}):"gold"===t.action.type?r("div",{staticClass:"amount-container"},[r("img",{staticClass:"actionPreview",class:{actionPreview:!0,active:t.index===t.$store.currentAction},attrs:{src:"assets/"+(t.action.image||"gold")+".png",alt:t.action.image||"gold"}}),r("span",{staticClass:"amount"},[t._v(t._s(t.formatWhole(t.action.amount)))])]):"potion"===t.action.type?r("img",{class:{actionPreview:!0,active:t.index===t.$store.currentAction},attrs:{src:"assets/potion.png",alt:"potion"}}):"gear"===t.action.type?r("img",{class:{actionPreview:!0,active:t.index===t.$store.currentAction},attrs:{src:"assets/shield.png",alt:"shield"}}):t._e()},j=[],W={name:"ActionPreview",props:{action:Object,index:Number}},V=W,z=(r("e4fe"),Object(h["a"])(V,L,j,!1,null,"ea9eb416",null)),Y=z.exports,H={name:"Floor",props:{index:Number},components:{Action:B,ActionPreview:Y},methods:{toggleEndAtFloor:function(){this.$store.endAtFloor=!this.$store.endAtFloor}}},G=H,Z=(r("d041"),Object(h["a"])(G,P,C,!1,null,"a47d5598",null)),U=Z.exports,J={name:"Dream",components:{Floor:U,Modal:w},methods:{toggleEndAtLoop:function(){this.$store.endAtLoop=!this.$store.endAtLoop}}},X=J,K=(r("589a"),Object(h["a"])(X,S,k,!1,null,"5add287c",null)),Q=K.exports,R={name:"App",components:{Header:p,Town:I,Dream:Q},methods:{start:function(){this.$store.started=!0},keepGoing:function(){this.$store.keepPlaying=!0}}},tt=R,et=(r("6b0b"),Object(h["a"])(tt,a,o,!1,null,null,null)),rt=et.exports,nt=r("7e8b"),it=r("5de0"),at=r.n(it);r("899a"),r("3a31"),r("383a"),r("f54c"),r("6d01"),r("4f04");function ot(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=t.log10().floor(),i=t.div(x.a.pow(10,n));return 10===i.toStringWithDecimalPlaces(e)&&(i=new x.a(1),n=n.add(1)),n=st(n),r?i.toStringWithDecimalPlaces(e)+"e"+n:"e"+n}function st(t,e){if(null===t||void 0===t)return"NaN";if(t.mag<.001)return(0).toFixed(e);if(null===e||void 0===e){if(t.layer>1){var r=new x.a(t);r.mag=Math.floor(t.mag);var n=new x.a(t);return n.layer=0,n.mag=t.mag-r.mag,r.floor().toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")+n.toStringWithDecimalPlaces(2).substr(1)}return t.floor().toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")}return t.toStringWithDecimalPlaces(e).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")}function ut(t,e){return null===t||void 0===t?"NaN":t.eq(0)?(0).toFixed(e):t.mag<.001?t.toExponential(e):t.toStringWithDecimalPlaces(e)}function lt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(t=new x.a(t),isNaN(t.sign)||isNaN(t.layer)||isNaN(t.mag))return"NaN";if(t.sign<0)return"-"+lt(t.neg(),e);if(t.mag===Number.POSITIVE_INFINITY)return"Infinity";if(t.gte("eeee1000")){var r=t.slog();return r.gte(1e6)?"F"+lt(r.floor()):x.a.pow(10,r.sub(r.floor())).toStringWithDecimalPlaces(3)+"F"+st(r.floor(),0)}return t.gte("1e100000")?ot(t,0,!1):t.gte("1e1000")?ot(t,0):t.gte(1e6)?ot(t,e):t.gte(1e3)?st(t,0):ut(t,e)}function ct(t){return t=new x.a(t).floor(),t.gte(1e6)||t.lte(.98)&&!t.eq(0)?lt(t,2):lt(t,0)}function ht(t){return t<60?lt(t)+"s":t<3600?ct(Math.floor(t/60))+"m "+lt(t%60)+"s":t<86400?ct(Math.floor(t/3600))+"h "+ct(Math.floor(t/60)%60)+"m "+lt(t%60)+"s":t<31536e3?ct(Math.floor(t/84600)%365)+"d "+ct(Math.floor(t/3600)%24)+"h "+ct(Math.floor(t/60)%60)+"m "+lt(t%60)+"s":ct(Math.floor(t/31536e3))+"y "+ct(Math.floor(t/84600)%365)+"d "+ct(Math.floor(t/3600)%24)+"h "+ct(Math.floor(t/60)%60)+"m "+lt(t%60)+"s"}window.format=lt,window.formatWhole=ct,window.formatTime=ht,window.regularFormat=ut,window.commaFormat=st,window.exponentialFormat=ot;var gt="thepaperpilot-dream",pt={timePlayed:0,keepPlaying:!1,points:new x.a(0),tempPoints:new x.a(0),dreaming:!1,autoSave:!0,openBuilding:"",tutorialOne:!0,path:new Array(10).fill(0).map((function(){return{actions:new Array(100).fill(0).map((function(){return{type:"",enemy:"",maxHp:new x.a(0),hp:new x.a(0),attackDuration:0,damage:new x.a(0),progress:0}})),type:""}})),currentAction:0,actionProgress:-1,attackProgress:0,cycle:0,currentTime:performance.now(),hp:new x.a(0),paused:!1,upgrades:{Cot:0,Bank:0,Apothecary:0,Armory:0},gearLevel:0,started:!1,endAtLoop:!1,endAtFloor:!1,endingDream:!1,endingDreamStatus:"death"};function mt(t,e){for(var r in e)null==e[r]?void 0===t[r]&&(t[r]=null):Array.isArray(e[r])?void 0===t[r]?t[r]=e[r]:mt(e[r],t[r]):e[r]instanceof x.a?void 0==t[r]?t[r]=e[r]:t[r]=new x.a(t[r]):e[r]&&"object"===Object(n["a"])(e[r])?void 0==t[r]||"object"!==Object(n["a"])(t[r])?t[r]=e[r]:mt(e[r],t[r]):void 0==t[r]&&(t[r]=e[r])}var ft=localStorage.getItem(gt);null==ft?ft=pt:(ft=Object.assign({},pt,JSON.parse(atob(ft))),mt(ft,pt));var dt=window.player=i["a"].observable(ft);function yt(){return x.a.times(1,x.a.pow(.95,dt.gearLevel)).clamp(Number.MIN_VALUE,Number.MAX_VALUE).toNumber()}function vt(){var t=x.a.add(2,dt.gearLevel).pow(2);return dt.hp.gt(Mt())&&(t=t.times(2)),t}function bt(){return x.a.times(2,x.a.pow(.98,dt.gearLevel)).clamp(Number.MIN_VALUE,Number.MAX_VALUE).toNumber()}function Mt(t){return new x.a(25).times(x.a.add(1,t||dt.gearLevel).pow(2))}function wt(){return!!dt.dreaming&&("enemy"===dt.path[dt.position].actions[dt.currentAction].type&&!(dt.actionProgress=1&&t.push("city"),dt.upgrades["Apothecary"]>=1&&t.push("savanna"),dt.upgrades["Armory"]>=1&&t.push("graveyard"),dt.path=new Array(10).fill(0).map((function(){return{type:t[Math.floor(Math.random()*t.length)]}})),dt.position=0,dt.tempPoints=new x.a(0),dt.gearLevel=dt.upgrades.Armory,dt.hp=Mt(),this.startLoop(),dt.dreaming=!0},endDream:function(){var t=1;"death"===dt.endingDreamStatus?t=.8:"floor"===dt.endingDreamStatus&&(t=.9),dt.points=dt.points.add(dt.tempPoints.pow(t)),dt.dreaming=!1,dt.endingDream=!1},startLoop:function(){dt.cycle++,dt.position=-1,dt.path.forEach((function(t){t.actions=new Array(dt.cycle+1).fill(0).map((function(){return _t[t.type][Math.floor(Math.random()*_t[t.type].length)](dt.cycle)}))})),window.vue.$root.$children[0].$refs.dream.$refs.scroll.$el.scrollTo({top:0,behavior:"smooth"}),this.nextFloor()},nextFloor:function(){if(dt.position=dt.position+1,dt.position>=10)dt.upgrades.Cot>=1&&!dt.endAtLoop?this.startLoop():(dt.endingDreamStatus="loop",dt.endingDream=!0,dt.position=dt.points-1,dt.currentAction=dt.currentAction-1);else{dt.currentAction=-1;var t=window.vue.$root.$children[0].$refs.dream.$refs.scroll.$el.children[dt.position].offsetTop-250;window.vue.$root.$children[0].$refs.dream.$refs.scroll.$el.scrollTo({top:t,behavior:"smooth"}),this.nextAction()}},nextAction:function(){dt.currentAction++,dt.currentAction>=dt.path[dt.position].actions.length?dt.upgrades.Cot<2||!dt.endAtFloor?this.nextFloor():(dt.endingDreamStatus="floor",dt.endingDream=!0,dt.currentAction=dt.currentAction-1):(dt.actionProgress=0,dt.attackProgress=0)},openBuilding:function(t){dt.openBuilding=t},closeBuilding:function(){dt.openBuilding=""}};function $t(t){var e=(t-dt.currentTime)/1e3;if(e>0&&!dt.paused&&dt.started&&(dt.cycle<5||dt.keepPlaying)&&(dt.timePlayed+=e,dt.dreaming&&!dt.endingDream))if(dt.actionProgress+=e,wt()){dt.attackProgress+=e,dt.path[dt.position].actions[dt.currentAction].progress+=e;var r=!0;dt.attackProgress>=yt()&&(dt.attackProgress=0,dt.path[dt.position].actions[dt.currentAction].hp=dt.path[dt.position].actions[dt.currentAction].hp.sub(vt()),dt.path[dt.position].actions[dt.currentAction].hp.lte(0)&&(xt.nextAction(),r=!1)),r&&dt.path[dt.position].actions[dt.currentAction].progress>=dt.path[dt.position].actions[dt.currentAction].attackDuration&&(dt.path[dt.position].actions[dt.currentAction].progress=0,dt.hp=dt.hp.sub(dt.path[dt.position].actions[dt.currentAction].damage),dt.hp.lte(0)&&(dt.endingDream=!0,dt.endingDreamStatus="death"))}else if(dt.actionProgress>=bt()){switch(dt.path[dt.position].actions[dt.currentAction].type){case"gold":dt.tempPoints=dt.tempPoints.add(dt.path[dt.position].actions[dt.currentAction].amount);break;case"gear":var n=dt.gearLevel;dt.gearLevel+=dt.path[dt.position].actions[dt.currentAction].amount*dt.upgrades.Armory,dt.hp=dt.hp.add(Mt().sub(Mt(n)));break;case"potion":dt.hp=dt.hp.add(Mt().times(.25).times(dt.upgrades.Apothecary+1));break}xt.nextAction()}dt.currentTime=t,requestAnimationFrame($t)}i["a"].prototype.$actions=xt,i["a"].prototype.format=lt,i["a"].prototype.formatWhole=ct,i["a"].prototype.formatTime=ht,i["a"].config.productionTip=!1,i["a"].use(nt["a"]),i["a"].use(at.a,{name:"scroll"}),window.vue=new i["a"]({render:function(t){return t(rt)}}).$mount("#app"),$t(performance.now())},"67d0":function(t,e,r){"use strict";r("c991")},"6b0b":function(t,e,r){"use strict";r("ca07")},"6cb0":function(t,e,r){},7071:function(t,e,r){"use strict";var n,i,a=r("2749").default;function o(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function s(t){return(s="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(t){return a(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":a(t)})(t)}r("984a"),r("086c"),r("6d01"),r("2ecd3"),r("26d3"),r("597a"),r("3945"),r("4f78"),r("2d60"),r("ba05"),r("3a31"),r("29d6"),r("7298"),r("8d2f"),r("1d99"),r("f4ea"),r("f54c"),r("383a"),r("93cf"),r("4f04"),r("060b"),r("949e"),r("3f02"),function(a,o){"object"===s(e)&&"undefined"!=typeof t?t.exports=o():(n=o,i="function"===typeof n?n.call(e,r,e,t):n,void 0===i||(t.exports=i))}(0,(function(){var t=Math.log10(9e15),e=function(){for(var t=[],e=-323;e<=308;e++)t.push(Number("1e"+e));return function(e){return t[e+323]}}(),r=function(t){return l.fromValue_noAlloc(t)},n=function(t,e,r){return l.fromComponents(t,e,r)},i=function(t,e,r){return l.fromComponents_noNormalize(t,e,r)},a=function(t,e){var r=e+1,n=Math.ceil(Math.log10(Math.abs(t))),i=Math.round(t*Math.pow(10,r-n))*Math.pow(10,n-r);return parseFloat(i.toFixed(Math.max(r-n,0)))},s=function(t){return Math.sign(t)*Math.log10(Math.abs(t))},u=function(t){var e,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e-10;if(!Number.isFinite(t))return t;if(0===t)return t;if(1===t)return.5671432904097838;e=t<10?0:Math.log(t)-Math.log(Math.log(t));for(var i=0;i<100;++i){if(r=(t*Math.exp(-e)+e*e)/(e+1),Math.abs(r-e)1&&void 0!==arguments[1]?arguments[1]:2,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i(1,0,1);return r(t).tetrate(e,n)},l.iteratedexp=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i(1,0,1);return r(t).iteratedexp(e,n)},l.iteratedlog=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return r(t).iteratedlog(e,n)},l.layeradd10=function(t,e){return r(t).layeradd10(e)},l.layeradd=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return r(t).layeradd(e,n)},l.slog=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return r(t).slog(e)},l.lambertw=function(t){return r(t).lambertw()},l.ssqrt=function(t){return r(t).ssqrt()},l.pentate=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i(1,0,1);return r(t).pentate(e,n)},l.affordGeometricSeries=function(t,e,n,i){return this.affordGeometricSeries_core(r(t),r(e),r(n),i)},l.sumGeometricSeries=function(t,e,n,i){return this.sumGeometricSeries_core(t,r(e),r(n),i)},l.affordArithmeticSeries=function(t,e,n,i){return this.affordArithmeticSeries_core(r(t),r(e),r(n),r(i))},l.sumArithmeticSeries=function(t,e,n,i){return this.sumArithmeticSeries_core(r(t),r(e),r(n),r(i))},l.efficiencyOfPurchase=function(t,e,n){return this.efficiencyOfPurchase_core(r(t),r(e),r(n))},l.randomDecimalForTesting=function(t){if(20*Math.random()<1)return i(0,0,0);var e=Math.random()>.5?1:-1;if(20*Math.random()<1)return i(e,0,1);var r=Math.floor(Math.random()*(t+1)),a=0===r?616*Math.random()-308:16*Math.random();Math.random()>.9&&(a=Math.trunc(a));var o=Math.pow(10,a);return Math.random()>.9&&(o=Math.trunc(o)),n(e,r,o)},l.affordGeometricSeries_core=function(t,e,r,n){var i=e.mul(r.pow(n));return l.floor(t.div(i).mul(r.sub(1)).add(1).log10().div(r.log10()))},l.sumGeometricSeries_core=function(t,e,r,n){return e.mul(r.pow(n)).mul(l.sub(1,r.pow(t))).div(l.sub(1,r))},l.affordArithmeticSeries_core=function(t,e,r,n){var i=e.add(n.mul(r)).sub(r.div(2)),a=i.pow(2);return i.neg().add(a.add(r.mul(t).mul(2)).sqrt()).div(r).floor()},l.sumArithmeticSeries_core=function(t,e,r,n){var i=e.add(n.mul(r));return t.div(2).mul(i.mul(2).plus(t.sub(1).mul(r)))},l.efficiencyOfPurchase_core=function(t,e,r){return t.div(e).add(t.div(r))},l.prototype.normalize=function(){if(0===this.sign||0===this.mag&&0===this.layer)return this.sign=0,this.mag=0,this.layer=0,this;if(0===this.layer&&this.mag<0&&(this.mag=-this.mag,this.sign=-this.sign),0===this.layer&&this.mag<1/9e15)return this.layer+=1,this.mag=Math.log10(this.mag),this;var e=Math.abs(this.mag),r=Math.sign(this.mag);if(e>=9e15)return this.layer+=1,this.mag=r*Math.log10(e),this;for(;e0;)this.layer-=1,0===this.layer?this.mag=Math.pow(10,this.mag):(this.mag=r*Math.pow(10,e),e=Math.abs(this.mag),r=Math.sign(this.mag));return 0===this.layer&&(this.mag<0?(this.mag=-this.mag,this.sign=-this.sign):0===this.mag&&(this.sign=0)),this},l.prototype.fromComponents=function(t,e,r){return this.sign=t,this.layer=e,this.mag=r,this.normalize(),this},l.prototype.fromComponents_noNormalize=function(t,e,r){return this.sign=t,this.layer=e,this.mag=r,this},l.prototype.fromMantissaExponent=function(t,e){return this.layer=1,this.sign=Math.sign(t),t=Math.abs(t),this.mag=e+Math.log10(t),this.normalize(),this},l.prototype.fromMantissaExponent_noNormalize=function(t,e){return this.fromMantissaExponent(t,e),this},l.prototype.fromDecimal=function(t){return this.sign=t.sign,this.layer=t.layer,this.mag=t.mag,this},l.prototype.fromNumber=function(t){return this.mag=Math.abs(t),this.sign=Math.sign(t),this.layer=0,this.normalize(),this},l.prototype.fromString=function(t){var e=(t=t.replace(",","")).split("^^^");if(2===e.length){var i=parseFloat(e[0]),a=parseFloat(e[1]),o=1;if(2===(c=e[1].split(";")).length&&(o=parseFloat(c[1]),isFinite(o)||(o=1)),isFinite(i)&&isFinite(a)){var u=l.pentate(i,a,o);return this.sign=u.sign,this.layer=u.layer,this.mag=u.mag,this}}var c,h=t.split("^^");if(2===h.length&&(i=parseFloat(h[0]),a=parseFloat(h[1]),2===(c=h[1].split(";")).length&&(o=parseFloat(c[1]),isFinite(o)||(o=1)),isFinite(i)&&isFinite(a)))return u=l.tetrate(i,a,o),this.sign=u.sign,this.layer=u.layer,this.mag=u.mag,this;var g,p=t.split("^");if(2===p.length){i=parseFloat(p[0]);var m=parseFloat(p[1]);if(isFinite(i)&&isFinite(m))return u=l.pow(i,m),this.sign=u.sign,this.layer=u.layer,this.mag=u.mag,this}if(2===(g=(t=t.trim().toLowerCase()).split("pt")).length&&(i=10,a=parseFloat(g[0]),g[1]=g[1].replace("(",""),g[1]=g[1].replace(")",""),o=parseFloat(g[1]),isFinite(o)||(o=1),isFinite(i)&&isFinite(a)))return u=l.tetrate(i,a,o),this.sign=u.sign,this.layer=u.layer,this.mag=u.mag,this;if(2===(g=t.split("p")).length&&(i=10,a=parseFloat(g[0]),g[1]=g[1].replace("(",""),g[1]=g[1].replace(")",""),o=parseFloat(g[1]),isFinite(o)||(o=1),isFinite(i)&&isFinite(a)))return u=l.tetrate(i,a,o),this.sign=u.sign,this.layer=u.layer,this.mag=u.mag,this;var f=t.split("e"),d=f.length-1;if(0===d){var y=parseFloat(t);if(isFinite(y))return this.fromNumber(y)}else if(1===d&&(y=parseFloat(t),isFinite(y)&&0!==y))return this.fromNumber(y);var v=t.split("e^");if(2===v.length){this.sign=1,"-"==v[0].charAt(0)&&(this.sign=-1);for(var b="",M=0;M=43&&w<=57||101===w))return this.layer=parseFloat(b),this.mag=parseFloat(v[1].substr(M+1)),this.normalize(),this;b+=v[1].charAt(M)}}if(d<1)return this.sign=0,this.layer=0,this.mag=0,this;var N=parseFloat(f[0]);if(0===N)return this.sign=0,this.layer=0,this.mag=0,this;if(m=parseFloat(f[f.length-1]),d>=2){var _=parseFloat(f[f.length-2]);isFinite(_)&&(m*=Math.sign(_),m+=s(_))}if(isFinite(N))if(1===d)this.sign=Math.sign(N),this.layer=1,this.mag=m+Math.log10(Math.abs(N));else{if(this.sign=Math.sign(N),this.layer=d,2===d)return u=l.mul(n(1,2,m),r(N)),this.sign=u.sign,this.layer=u.layer,this.mag=u.mag,this;this.mag=m}else this.sign="-"===f[0]?-1:1,this.layer=d,this.mag=m;return this.normalize(),this},l.prototype.fromValue=function(t){return o(t,l)?this.fromDecimal(t):"number"==typeof t?this.fromNumber(t):"string"==typeof t?this.fromString(t):(this.sign=0,this.layer=0,this.mag=0,this)},l.prototype.toNumber=function(){return Number.isFinite(this.layer)?0===this.layer?this.sign*this.mag:1===this.layer?this.sign*Math.pow(10,this.mag):this.mag>0?this.sign>0?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:0:Number.NaN},l.prototype.mantissaWithDecimalPlaces=function(t){return isNaN(this.m)?Number.NaN:0===this.m?0:a(this.m,t)},l.prototype.magnitudeWithDecimalPlaces=function(t){return isNaN(this.mag)?Number.NaN:0===this.mag?0:a(this.mag,t)},l.prototype.toString=function(){return 0===this.layer?this.mag<1e21&&this.mag>1e-7||0===this.mag?(this.sign*this.mag).toString():this.m+"e"+this.e:1===this.layer?this.m+"e"+this.e:this.layer<=5?(-1===this.sign?"-":"")+"e".repeat(this.layer)+this.mag:(-1===this.sign?"-":"")+"(e^"+this.layer+")"+this.mag},l.prototype.toExponential=function(t){return 0===this.layer?(this.sign*this.mag).toExponential(t):this.toStringWithDecimalPlaces(t)},l.prototype.toFixed=function(t){return 0===this.layer?(this.sign*this.mag).toFixed(t):this.toStringWithDecimalPlaces(t)},l.prototype.toPrecision=function(t){return this.e<=-7?this.toExponential(t-1):t>this.e?this.toFixed(t-this.exponent-1):this.toExponential(t-1)},l.prototype.valueOf=function(){return this.toString()},l.prototype.toJSON=function(){return this.toString()},l.prototype.toStringWithDecimalPlaces=function(t){return 0===this.layer?this.mag<1e21&&this.mag>1e-7||0===this.mag?(this.sign*this.mag).toFixed(t):a(this.m,t)+"e"+a(this.e,t):1===this.layer?a(this.m,t)+"e"+a(this.e,t):this.layer<=5?(-1===this.sign?"-":"")+"e".repeat(this.layer)+a(this.mag,t):(-1===this.sign?"-":"")+"(e^"+this.layer+")"+a(this.mag,t)},l.prototype.abs=function(){return i(0===this.sign?0:1,this.layer,this.mag)},l.prototype.neg=function(){return i(-this.sign,this.layer,this.mag)},l.prototype.negate=function(){return this.neg()},l.prototype.negated=function(){return this.neg()},l.prototype.sign=function(){return this.sign},l.prototype.sgn=function(){return this.sign},l.prototype.round=function(){return this.mag<0?l.dZero:0===this.layer?n(this.sign,0,Math.round(this.mag)):this},l.prototype.floor=function(){return this.mag<0?l.dZero:0===this.layer?n(this.sign,0,Math.floor(this.mag)):this},l.prototype.ceil=function(){return this.mag<0?l.dZero:0===this.layer?n(this.sign,0,Math.ceil(this.mag)):this},l.prototype.trunc=function(){return this.mag<0?l.dZero:0===this.layer?n(this.sign,0,Math.trunc(this.mag)):this},l.prototype.add=function(t){var e,a,o=r(t);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(o.layer))return o;if(0===this.sign)return o;if(0===o.sign)return this;if(this.sign===-o.sign&&this.layer===o.layer&&this.mag===o.mag)return i(0,0,0);if(this.layer>=2||o.layer>=2)return this.maxabs(o);if(l.cmpabs(this,o)>0?(e=this,a=o):(e=o,a=this),0===e.layer&&0===a.layer)return r(e.sign*e.mag+a.sign*a.mag);var s=e.layer*Math.sign(e.mag),u=a.layer*Math.sign(a.mag);if(s-u>=2)return e;if(0===s&&-1===u){if(Math.abs(a.mag-Math.log10(e.mag))>17)return e;var c=Math.pow(10,Math.log10(e.mag)-a.mag),h=a.sign+e.sign*c;return n(Math.sign(h),1,a.mag+Math.log10(Math.abs(h)))}return 1===s&&0===u?Math.abs(e.mag-Math.log10(a.mag))>17?e:(c=Math.pow(10,e.mag-Math.log10(a.mag)),h=a.sign+e.sign*c,n(Math.sign(h),1,Math.log10(a.mag)+Math.log10(Math.abs(h)))):Math.abs(e.mag-a.mag)>17?e:(c=Math.pow(10,e.mag-a.mag),h=a.sign+e.sign*c,n(Math.sign(h),1,a.mag+Math.log10(Math.abs(h))))},l.prototype.plus=function(t){return this.add(t)},l.prototype.sub=function(t){return this.add(r(t).neg())},l.prototype.subtract=function(t){return this.sub(t)},l.prototype.minus=function(t){return this.sub(t)},l.prototype.mul=function(t){var e,a,o=r(t);if(!Number.isFinite(this.layer))return this;if(!Number.isFinite(o.layer))return o;if(0===this.sign||0===o.sign)return i(0,0,0);if(this.layer===o.layer&&this.mag===-o.mag)return i(this.sign*o.sign,0,1);if(this.layer>o.layer||this.layer==o.layer&&Math.abs(this.mag)>Math.abs(o.mag)?(e=this,a=o):(e=o,a=this),0===e.layer&&0===a.layer)return r(e.sign*a.sign*e.mag*a.mag);if(e.layer>=3||e.layer-a.layer>=2)return n(e.sign*a.sign,e.layer,e.mag);if(1===e.layer&&0===a.layer)return n(e.sign*a.sign,1,e.mag+Math.log10(a.mag));if(1===e.layer&&1===a.layer)return n(e.sign*a.sign,1,e.mag+a.mag);if(2===e.layer&&1===a.layer){var s=n(Math.sign(e.mag),e.layer-1,Math.abs(e.mag)).add(n(Math.sign(a.mag),a.layer-1,Math.abs(a.mag)));return n(e.sign*a.sign,s.layer+1,s.sign*s.mag)}if(2===e.layer&&2===a.layer)return s=n(Math.sign(e.mag),e.layer-1,Math.abs(e.mag)).add(n(Math.sign(a.mag),a.layer-1,Math.abs(a.mag))),n(e.sign*a.sign,s.layer+1,s.sign*s.mag);throw Error("Bad arguments to mul: "+this+", "+t)},l.prototype.multiply=function(t){return this.mul(t)},l.prototype.times=function(t){return this.mul(t)},l.prototype.div=function(t){var e=r(t);return this.mul(e.recip())},l.prototype.divide=function(t){return this.div(t)},l.prototype.divideBy=function(t){return this.div(t)},l.prototype.dividedBy=function(t){return this.div(t)},l.prototype.recip=function(){return 0===this.mag?l.dNaN:0===this.layer?n(this.sign,0,1/this.mag):n(this.sign,this.layer,-this.mag)},l.prototype.reciprocal=function(){return this.recip()},l.prototype.reciprocate=function(){return this.recip()},l.prototype.cmp=function(t){var e=r(t);return this.sign>e.sign?1:this.sign0?this.layer:-this.layer,i=e.mag>0?e.layer:-e.layer;return n>i?1:ne.mag?1:this.mag0?e:this},l.prototype.clamp=function(t,e){return this.max(t).min(e)},l.prototype.clampMin=function(t){return this.max(t)},l.prototype.clampMax=function(t){return this.min(t)},l.prototype.cmp_tolerance=function(t,e){var n=r(t);return this.eq_tolerance(n,e)?0:this.cmp(n)},l.prototype.compare_tolerance=function(t,e){return this.cmp_tolerance(t,e)},l.prototype.eq_tolerance=function(t,e){var n=r(t);if(null==e&&(e=1e-7),this.sign!==n.sign)return!1;if(Math.abs(this.layer-n.layer)>1)return!1;var i=this.mag,a=n.mag;return this.layer>n.layer&&(a=s(a)),this.layer0?n(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):n(1,0,Math.log10(this.mag))},l.prototype.log10=function(){return this.sign<=0?l.dNaN:this.layer>0?n(Math.sign(this.mag),this.layer-1,Math.abs(this.mag)):n(this.sign,0,Math.log10(this.mag))},l.prototype.log=function(t){return t=r(t),this.sign<=0||t.sign<=0||1===t.sign&&0===t.layer&&1===t.mag?l.dNaN:0===this.layer&&0===t.layer?n(this.sign,0,Math.log(this.mag)/Math.log(t.mag)):l.div(this.log10(),t.log10())},l.prototype.log2=function(){return this.sign<=0?l.dNaN:0===this.layer?n(this.sign,0,Math.log2(this.mag)):1===this.layer?n(Math.sign(this.mag),0,3.321928094887362*Math.abs(this.mag)):2===this.layer?n(Math.sign(this.mag),1,Math.abs(this.mag)+.5213902276543247):n(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))},l.prototype.ln=function(){return this.sign<=0?l.dNaN:0===this.layer?n(this.sign,0,Math.log(this.mag)):1===this.layer?n(Math.sign(this.mag),0,2.302585092994046*Math.abs(this.mag)):2===this.layer?n(Math.sign(this.mag),1,Math.abs(this.mag)+.36221568869946325):n(Math.sign(this.mag),this.layer-1,Math.abs(this.mag))},l.prototype.logarithm=function(t){return this.log(t)},l.prototype.pow=function(t){var e=this,n=r(t);if(0===e.sign)return e;if(1===e.sign&&0===e.layer&&1===e.mag)return e;if(0===n.sign)return i(1,0,1);if(1===n.sign&&0===n.layer&&1===n.mag)return e;var a=e.absLog10().mul(n).pow10();return-1===this.sign&&n.toNumber()%2==1?a.neg():a},l.prototype.pow10=function(){if(!Number.isFinite(this.layer)||!Number.isFinite(this.mag))return l.dNaN;var t=this;if(0===t.layer){var e=Math.pow(10,t.sign*t.mag);if(Number.isFinite(e)&&Math.abs(e)>.1)return n(1,0,e);if(0===t.sign)return l.dOne;t=i(t.sign,t.layer+1,Math.log10(t.mag))}return t.sign>0&&t.mag>0?n(t.sign,t.layer+1,t.mag):t.sign<0&&t.mag>0?n(-t.sign,t.layer+1,-t.mag):l.dOne},l.prototype.pow_base=function(t){return r(t).pow(this)},l.prototype.root=function(t){var e=r(t);return this.pow(e.recip())},l.prototype.factorial=function(){return this.mag<0?this.toNumber().add(1).gamma():0===this.layer?this.add(1).gamma():1===this.layer?l.exp(l.mul(this,l.ln(this).sub(1))):l.exp(this)},l.prototype.gamma=function(){if(this.mag<0)return this.recip();if(0===this.layer){if(this.lt(i(1,0,24)))return r(function(t){if(!isFinite(t))return t;if(t<-50)return t===Math.trunc(t)?Number.NEGATIVE_INFINITY:0;for(var e=1;t<10;)e*=t,++t;var r=.9189385332046727;r+=(.5+(t-=1))*Math.log(t),r-=t;var n=t*t,i=t;return r+=1/(12*i),r+=1/(360*(i*=n)),r+=1/(1260*(i*=n)),r+=1/(1680*(i*=n)),r+=1/(1188*(i*=n)),r+=691/(360360*(i*=n)),r+=7/(1092*(i*=n)),r+=3617/(122400*(i*=n)),Math.exp(r)/e}(this.sign*this.mag));var t=this.mag-1,e=.9189385332046727;e+=(t+.5)*Math.log(t);var n=t*t,a=t,o=12*a,s=1/o,u=(e-=t)+s;if(u===e)return l.exp(e);if((u=(e=u)-(s=1/(o=360*(a*=n))))===e)return l.exp(e);e=u;var c=1/(o=1260*(a*=n));return e+=c,e-=c=1/(o=1680*(a*=n)),l.exp(e)}return 1===this.layer?l.exp(l.mul(this,l.ln(this).sub(1))):l.exp(this)},l.prototype.lngamma=function(){return this.gamma().ln()},l.prototype.exp=function(){return this.mag<0?l.dOne:0===this.layer&&this.mag<=709.7?r(Math.exp(this.sign*this.mag)):0===this.layer?n(1,1,this.sign*Math.log10(Math.E)*this.mag):1===this.layer?n(1,2,this.sign*(Math.log10(.4342944819032518)+this.mag)):n(1,this.layer+1,this.sign*this.mag)},l.prototype.sqr=function(){return this.pow(2)},l.prototype.sqrt=function(){if(0===this.layer)return r(Math.sqrt(this.sign*this.mag));if(1===this.layer)return n(1,2,Math.log10(this.mag)-.3010299956639812);var t=l.div(i(this.sign,this.layer-1,this.mag),i(1,0,2));return t.layer+=1,t.normalize(),t},l.prototype.cube=function(){return this.pow(3)},l.prototype.cbrt=function(){return this.pow(1/3)},l.prototype.tetrate=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i(1,0,1);if(t===Number.POSITIVE_INFINITY){var n=l.ln(this).neg();return n.lambertw().div(n)}if(t<0)return l.iteratedlog(e,this,-t);e=r(e);var a=t-(t=Math.trunc(t));0!==a&&(e.eq(l.dOne)?(++t,e=new l(a)):e=this.eq(10)?e.layeradd10(a):e.layeradd(a,this));for(var o=0;o3)return i(e.sign,e.layer+(t-o-1),e.mag);if(o>100)return e}return e},l.prototype.iteratedexp=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i(1,0,1);return this.tetrate(t,e)},l.prototype.iteratedlog=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(e<0)return l.tetrate(t,-e,this);t=r(t);var n=r(this),i=e-(e=Math.trunc(e));if(n.layer-t.layer>3){var a=Math.min(e,n.layer-t.layer-3);e-=a,n.layer-=a}for(var o=0;o100)return n}return i>0&&i<1&&(n=t.eq(10)?n.layeradd10(-i):n.layeradd(-i,t)),n},l.prototype.slog=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;if(this.mag<0)return l.dNegOne;t=r(t);var e=0,n=r(this);if(n.layer-t.layer>3){var i=n.layer-t.layer-3;e+=i,n.layer-=i}for(var a=0;a<100;++a)if(n.lt(l.dZero))n=l.pow(t,n),e-=1;else{if(n.lte(l.dOne))return r(e+n.toNumber()-1);e+=1,n=l.log(n,t)}return r(e)},l.prototype.layeradd10=function(t){t=l.fromValue_noAlloc(t).toNumber();var e,n=r(this);if(t>=1&&(t-=e=Math.trunc(t),n.layer+=e),t<=-1&&(t-=e=Math.trunc(t),n.layer+=e,n.layer<0))for(var i=0;i<100;++i){if(n.layer++,n.mag=Math.log10(n.mag),!isFinite(n.mag))return n;if(n.layer>=0)break}if(t>0){for(var a=0;Number.isFinite(n.mag)&&n.mag<10;)n.mag=Math.pow(10,n.mag),++a;for(n.mag>1e10&&(n.mag=Math.log10(n.mag),n.layer++),(o=Math.log10(Math.log(1e10)/Math.log(n.mag),10))0;)n.mag=Math.log10(n.mag),--a}else if(t<0){for(a=0;Number.isFinite(n.mag)&&n.mag<10;)n.mag=Math.pow(10,n.mag),++a;var o;for(n.mag>1e10&&(n.mag=Math.log10(n.mag),n.layer++),(o=Math.log10(1/Math.log10(n.mag)))>t&&(n.mag=1e10,n.layer--,t-=o),n.mag=Math.pow(n.mag,Math.pow(10,t));a>0;)n.mag=Math.log10(n.mag),--a}for(;n.layer<0;)n.layer++,n.mag=Math.log10(n.mag);return n.normalize(),n},l.prototype.layeradd=function(t,e){var r=this.slog(e).toNumber()+t;return r>=0?l.tetrate(e,r):Number.isFinite(r)?r>=-1?l.log(l.tetrate(e,r+1),e):void l.log(l.log(l.tetrate(e,r+2),e),e):l.dNaN},l.prototype.lambertw=function(){if(this.lt(-.3678794411710499))throw Error("lambertw is unimplemented for results less than -1, sorry!");return this.mag<0?r(u(this.toNumber())):0===this.layer?r(u(this.sign*this.mag)):1===this.layer||2===this.layer?c(this):this.layer>=3?i(this.sign,this.layer-1,this.mag):void 0};var c=function(t){var e,r,n,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e-10;if(!Number.isFinite(t.mag))return t;if(0===t)return t;if(1===t)return.5671432904097838;l.abs(t),e=l.ln(t);for(var o=0;o<100;++o){if(r=l.exp(-e),n=e.sub(t.mul(r)),i=e.sub(n.div(e.add(1).sub(e.add(2).mul(n).div(l.mul(2,e).add(2))))),l.abs(i.sub(e)).lt(l.abs(i).mul(a)))return i;e=i}throw Error("Iteration failed to converge: "+t)};return l.prototype.ssqrt=function(){if(1==this.sign&&this.layer>=3)return i(this.sign,this.layer-1,this.mag);var t=this.ln();return t.div(t.lambertw())},l.prototype.pentate=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i(1,0,1);e=r(e);var n=t-(t=Math.trunc(t));0!==n&&(e.eq(l.dOne)?(++t,e=new l(n)):e=this.eq(10)?e.layeradd10(n):e.layeradd(n,this));for(var a=0;a10)return e}return e},l.prototype.sin=function(){return this.mag<0?this:0===this.layer?r(Math.sin(this.sign*this.mag)):i(0,0,0)},l.prototype.cos=function(){return this.mag<0?l.dOne:0===this.layer?r(Math.cos(this.sign*this.mag)):i(0,0,0)},l.prototype.tan=function(){return this.mag<0?this:0===this.layer?r(Math.tan(this.sign*this.mag)):i(0,0,0)},l.prototype.asin=function(){return this.mag<0?this:0===this.layer?r(Math.asin(this.sign*this.mag)):i(Number.NaN,Number.NaN,Number.NaN)},l.prototype.acos=function(){return this.mag<0?r(Math.acos(this.toNumber())):0===this.layer?r(Math.acos(this.sign*this.mag)):i(Number.NaN,Number.NaN,Number.NaN)},l.prototype.atan=function(){return this.mag<0?this:0===this.layer?r(Math.atan(this.sign*this.mag)):r(Math.atan(1/0*this.sign))},l.prototype.sinh=function(){return this.exp().sub(this.negate().exp()).div(2)},l.prototype.cosh=function(){return this.exp().add(this.negate().exp()).div(2)},l.prototype.tanh=function(){return this.sinh().div(this.cosh())},l.prototype.asinh=function(){return l.ln(this.add(this.sqr().add(1).sqrt()))},l.prototype.acosh=function(){return l.ln(this.add(this.sqr().sub(1).sqrt()))},l.prototype.atanh=function(){return this.abs().gte(1)?i(Number.NaN,Number.NaN,Number.NaN):l.ln(this.add(1).div(r(1).sub(this))).div(2)},l.prototype.ascensionPenalty=function(t){return 0===t?this:this.root(l.pow(10,t))},l.prototype.egg=function(){return this.add(9)},l.prototype.lessThanOrEqualTo=function(t){return this.cmp(t)<1},l.prototype.lessThan=function(t){return this.cmp(t)<0},l.prototype.greaterThanOrEqualTo=function(t){return this.cmp(t)>-1},l.prototype.greaterThan=function(t){return this.cmp(t)>0},l}();return l.dZero=i(0,0,0),l.dOne=i(1,0,1),l.dNegOne=i(-1,0,1),l.dTwo=i(1,0,2),l.dTen=i(1,0,10),l.dNaN=i(Number.NaN,Number.NaN,Number.NaN),l.dInf=i(1,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l.dNegInf=i(-1,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),l.dNumberMax=n(1,0,Number.MAX_VALUE),l.dNumberMin=n(1,0,Number.MIN_VALUE),l}))},"8c8f":function(t,e,r){},a031:function(t,e,r){},bba9:function(t,e,r){},c991:function(t,e,r){},ca07:function(t,e,r){},cb11:function(t,e,r){},d041:function(t,e,r){"use strict";r("8c8f")},e4fe:function(t,e,r){"use strict";r("bba9")},e65f:function(t,e,r){"use strict";r("6cb0")}}); //# sourceMappingURL=app.2e06b19f.js.map