Files
mybb-april-fools/dist/april-fools.min.js
T

1 line
54 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(()=>{"use strict";var __webpack_modules__={525:(e,t,i)=>{i.d(t,{Z:()=>n});const n='<button class="april-fools__button">🎉</button> '},554:(e,t,i)=>{i.d(t,{Z:()=>n});const n='<style class="april-fools__styles">.april-fools__button{position:fixed;bottom:.2rem;right:.2rem;padding:0;font-size:3rem;border:0 solid;background:transparent none;opacity:.3;transition:.4s all;cursor:pointer}.april-fools__button:hover{opacity:1}.april-fools__joke-row{border-bottom:1px solid #000}.april-fools__joke-row:first-of-type{border-top:1px solid #000}.april-fools__joke{display:flex;flex-flow:row wrap;padding:10px;opacity:.5;justify-content:space-between;align-items:center;gap:1ch;cursor:pointer}.april-fools__joke:hover{text-shadow:0 0 #000}.april-fools__joke:before{display:block;content:"";flex:0 0 2ch;text-align:center;content:"✔";opacity:0}input.april-fools__joke-input:checked+.april-fools__joke{opacity:1}input.april-fools__joke-input:checked+.april-fools__joke:before{opacity:1}.april-fools__joke .april-fools__joke-title{flex:1 auto;font-weight:700}.april-fools__joke .april-fools__joke-description{flex:1 auto;text-align:right}.april-fools__joke .april-fools__joke-chance{flex:0 0 4ch;text-align:right}.april-fools__content .april-fools__reset-button{display:block;margin:10px auto}</style> '},95:(e,t,i)=>{i.d(t,{Z:()=>n});const n='<div class="april-fools__content"> <div class="april-fools__jokes"></div> <button class="april-fools__reset-button"> Вернуться к настройкам форума (страница будет перезагружена!) </button> </div> <template class="april-fools__template" id="april-fools__window-row"> <div class="april-fools__joke-row"> <input type="checkbox" class="april-fools__joke-input" name="april-fools__joke-${joke.id}" id="april-fools__joke-${joke.id}" style="display:none"/> <label class="april-fools__joke" for="april-fools__joke-${joke.id}"> <p class="april-fools__joke-title">${joke.title}</p> <p class="april-fools__joke-description">${joke.description}</p> <p class="april-fools__joke-chance">${joke.settings.chance}%</p> </label> </div> </template> '},562:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{d:()=>JokerUI});var jquery__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(311),jquery__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__),_html_button_html__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(525),_html_styles_html__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(554),_html_window_html__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(95);class JokerUI{constructor(e){this.joker=e,jquery__WEBPACK_IMPORTED_MODULE_0___default()('link[rel="stylesheet"]').eq(0).before(_html_styles_html__WEBPACK_IMPORTED_MODULE_1__.Z);e=this.button;e.hide(),e.mybbModal({title:"Настройки первоапрельских шуток",content:()=>this.render(),closer:!0,noscroll:!0,escClose:!0})}get button(){let e=jquery__WEBPACK_IMPORTED_MODULE_0___default()(".april-fools__button");return e=0===e.length?jquery__WEBPACK_IMPORTED_MODULE_0___default()(_html_button_html__WEBPACK_IMPORTED_MODULE_2__.Z).appendTo("body"):e}show(){this.button.show()}render(){const result=jquery__WEBPACK_IMPORTED_MODULE_0___default()("<div></div>").html(_html_window_html__WEBPACK_IMPORTED_MODULE_3__.Z),row_template=jquery__WEBPACK_IMPORTED_MODULE_0___default()("#april-fools__window-row",result).html(),joke_container=jquery__WEBPACK_IMPORTED_MODULE_0___default()(".april-fools__jokes",result);for(const joke of Object.values(this.joker.jokes)){const row=jquery__WEBPACK_IMPORTED_MODULE_0___default()(eval("`"+row_template+"`"));jquery__WEBPACK_IMPORTED_MODULE_0___default()('input[type="checkbox"]',row).prop("checked",joke.settings.enabled).on("click",e=>this.joker.toggleJoke(joke.id,e.currentTarget.checked)),joke_container.append(row)}return jquery__WEBPACK_IMPORTED_MODULE_0___default()("button",result).on("click",async()=>{await this.joker.clearUserStates(),window.location.reload()}),jquery__WEBPACK_IMPORTED_MODULE_0___default()(".april-fools__content",result)}}},311:e=>{e.exports=jQuery},442:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.bubbleCursor=function(e){let t,i,n,s=e&&e.element,o=s||document.body,r=window.innerWidth,a=window.innerHeight,l={x:r/2,y:r/2},c=[],h=[];const d=window.matchMedia("(prefers-reduced-motion: reduce)");function u(){if(d.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");t=document.createElement("canvas"),i=t.getContext("2d"),t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",s?(t.style.position="absolute",o.appendChild(t),t.width=o.clientWidth,t.height=o.clientHeight):(t.style.position="fixed",document.body.appendChild(t),t.width=r,t.height=a),o.addEventListener("mousemove",f),o.addEventListener("touchmove",g,{passive:!0}),o.addEventListener("touchstart",g,{passive:!0}),window.addEventListener("resize",p),m()}function p(e){r=window.innerWidth,a=window.innerHeight,s?(t.width=o.clientWidth,t.height=o.clientHeight):(t.width=r,t.height=a)}function g(t){if(0<t.touches.length)for(let e=0;e<t.touches.length;e++)A(t.touches[e].clientX,t.touches[e].clientY,h[Math.floor(Math.random()*h.length)])}function f(e){var t;s?(t=o.getBoundingClientRect(),l.x=e.clientX-t.left,l.y=e.clientY-t.top):(l.x=e.clientX,l.y=e.clientY),A(l.x,l.y)}function A(e,t,i){c.push(new _(e,t,i))}function m(){if(0!=c.length){i.clearRect(0,0,r,a);for(let e=0;e<c.length;e++)c[e].update(i);for(let e=c.length-1;0<=e;e--)c[e].lifeSpan<0&&c.splice(e,1);0==c.length&&i.clearRect(0,0,r,a)}n=requestAnimationFrame(m)}function w(){t.remove(),cancelAnimationFrame(n),o.removeEventListener("mousemove",f),o.removeEventListener("touchmove",g),o.removeEventListener("touchstart",g),window.addEventListener("resize",p)}function _(e,t,i){var n=Math.floor(60*Math.random()+60);this.initialLifeSpan=n,this.lifeSpan=n,this.velocity={x:(Math.random()<.5?-1:1)*(Math.random()/10),y:-1*Math.random()-.4},this.position={x:e,y:t},this.canv=i,this.baseDimension=4,this.update=function(e){this.position.x+=this.velocity.x,this.position.y+=this.velocity.y,this.velocity.x+=2*(Math.random()<.5?-1:1)/75,this.velocity.y-=Math.random()/600,this.lifeSpan--;var t=.2+(this.initialLifeSpan-this.lifeSpan)/this.initialLifeSpan;e.fillStyle="#e6f1f7",e.strokeStyle="#3a92c5",e.beginPath(),e.arc(this.position.x-this.baseDimension/2*t,this.position.y-this.baseDimension/2,this.baseDimension*t,0,2*Math.PI),e.stroke(),e.fill(),e.closePath()}}return d.onchange=()=>{(d.matches?w:u)()},u(),{destroy:w}},t.clockCursor=function(e){let t,o,r,i=e&&e.element,n=i||document.body,a=window.innerWidth,l=window.innerHeight,c={x:a/2,y:a/2};const W=e&&e.dateColor||"blue",T=e&&e.faceColor||"black",Y=e&&e.secondsColor||"red",H=e&&e.minutesColor||"black",P=e&&e.hoursColor||"black",h=.4;var e=new Date,F=e.getDate(),U=e.getYear()+1900;const s=(" "+["SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"][e.getDay()]+" "+F+" "+["JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"][e.getMonth()]+" "+U).split(""),d=["3","4","5","6","7","8","9","10","11","12","1","2"],u=d.length,p=["•","•","•"],g=["•","•","•","•"],f=["•","•","•","•","•"],A=360/u,m=360/s.length,w=45/6.5,_=[],v=[],y=[],x=[],b=[],E=[],M=[],C=[],k=[];var j=parseInt(s.length+u+p.length+g.length+f.length)+1;const L=window.matchMedia("(prefers-reduced-motion: reduce)");function B(){if(L.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");t=document.createElement("canvas"),o=t.getContext("2d"),t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",i?(t.style.position="absolute",n.appendChild(t),t.width=n.clientWidth,t.height=n.clientHeight):(t.style.position="fixed",document.body.appendChild(t),t.width=a,t.height=l),o.font="10px sans-serif",o.textAlign="center",o.textBaseline="middle";for(let e=0;e<j;e++)_[e]=0,v[e]=0,y[e]=0,x[e]=0;for(let e=0;e<s.length;e++)k[e]={color:W,value:s[e]};for(let e=0;e<d.length;e++)C[e]={color:T,value:d[e]};for(let e=0;e<p.length;e++)M[e]={color:P,value:p[e]};for(let e=0;e<g.length;e++)E[e]={color:H,value:g[e]};for(let e=0;e<f.length;e++)b[e]={color:Y,value:f[e]};n.addEventListener("mousemove",S),n.addEventListener("touchmove",D,{passive:!0}),n.addEventListener("touchstart",D,{passive:!0}),window.addEventListener("resize",R),O()}function R(e){a=window.innerWidth,l=window.innerHeight,i?(t.width=n.clientWidth,t.height=n.clientHeight):(t.width=a,t.height=l)}function D(e){var t;0<e.touches.length&&(i?(t=n.getBoundingClientRect(),c.x=e.touches[0].clientX-t.left,c.y=e.touches[0].clientY-t.top):(c.x=e.touches[0].clientX,c.y=e.touches[0].clientY))}function S(e){var t;i?(t=n.getBoundingClientRect(),c.x=e.clientX-t.left,c.y=e.clientY-t.top):(c.x=e.clientX,c.y=e.clientY)}function O(){y[0]=Math.round(_[0]+=(c.y-_[0])*h),x[0]=Math.round(v[0]+=(c.x-v[0])*h);for(let e=1;e<j;e++)y[e]=Math.round(_[e]+=(y[e-1]-_[e])*h),x[e]=Math.round(v[e]+=(x[e-1]-v[e])*h),_[e-1]>=l-80&&(_[e-1]=l-80),v[e-1]>=a-80&&(v[e-1]=a-80);o.clearRect(0,0,a,l);var e=new Date,t=e.getSeconds(),i=Math.PI*(t-15)/30,t=e.getMinutes(),n=Math.PI*(t-15)/30,t=e.getHours(),s=Math.PI*(t-3)/6+Math.PI*parseInt(e.getMinutes())/360;for(let e=0;e<k.length;e++)k[e].y=_[e]+67.5*Math.sin(-i+e*m*Math.PI/180),k[e].x=v[e]+67.5*Math.cos(-i+e*m*Math.PI/180),o.fillStyle=k[e].color,o.fillText(k[e].value,k[e].x,k[e].y);for(let e=0;e<C.length;e++)C[e].y=_[k.length+e]+45*Math.sin(e*A*Math.PI/180),C[e].x=v[k.length+e]+45*Math.cos(e*A*Math.PI/180),o.fillStyle=C[e].color,o.fillText(C[e].value,C[e].x,C[e].y);for(let e=0;e<M.length;e++)M[e].y=_[k.length+u+e]+0+e*w*Math.sin(s),M[e].x=v[k.length+u+e]+0+e*w*Math.cos(s),o.fillStyle=M[e].color,o.fillText(M[e].value,M[e].x,M[e].y);for(let e=0;e<E.length;e++)E[e].y=_[k.length+u+M.length+e]+0+e*w*Math.sin(n),E[e].x=v[k.length+u+M.length+e]+0+e*w*Math.cos(n),o.fillStyle=E[e].color,o.fillText(E[e].value,E[e].x,E[e].y);for(let e=0;e<b.length;e++)b[e].y=_[k.length+u+M.length+E.length+e]+0+e*w*Math.sin(i),b[e].x=v[k.length+u+M.length+E.length+e]+0+e*w*Math.cos(i),o.fillStyle=b[e].color,o.fillText(b[e].value,b[e].x,b[e].y);r=requestAnimationFrame(O)}function I(){t.remove(),cancelAnimationFrame(r),n.removeEventListener("mousemove",S),n.removeEventListener("touchmove",D),n.removeEventListener("touchstart",D),window.addEventListener("resize",R)}return L.onchange=()=>{(L.matches?I:B)()},B(),{destroy:I}},t.emojiCursor=function(e){const t=e&&e.emoji||["😀","😂","😆","😊"];let i=e&&e.element,n=i||document.body,s=window.innerWidth,o=window.innerHeight;const r={x:s/2,y:s/2},a={x:s/2,y:s/2};let l=0;const c=[],h=[];let d,u,p;const g=window.matchMedia("(prefers-reduced-motion: reduce)");function f(){if(g.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");d=document.createElement("canvas"),u=d.getContext("2d"),d.style.top="0px",d.style.left="0px",d.style.pointerEvents="none",i?(d.style.position="absolute",n.appendChild(d),d.width=n.clientWidth,d.height=n.clientHeight):(d.style.position="fixed",document.body.appendChild(d),d.width=s,d.height=o),u.font="21px serif",u.textBaseline="middle",u.textAlign="center",t.forEach(e=>{var t=u.measureText(e),i=document.createElement("canvas"),n=i.getContext("2d");i.width=t.width,i.height=2*t.actualBoundingBoxAscent,n.textAlign="center",n.font="21px serif",n.textBaseline="middle",n.fillText(e,i.width/2,t.actualBoundingBoxAscent),h.push(i)}),n.addEventListener("mousemove",w,{passive:!0}),n.addEventListener("touchmove",m,{passive:!0}),n.addEventListener("touchstart",m,{passive:!0}),window.addEventListener("resize",A),v()}function A(e){s=window.innerWidth,o=window.innerHeight,i?(d.width=n.clientWidth,d.height=n.clientHeight):(d.width=s,d.height=o)}function m(t){if(0<t.touches.length)for(let e=0;e<t.touches.length;e++)_(t.touches[e].clientX,t.touches[e].clientY,h[Math.floor(Math.random()*h.length)])}function w(e){e.timeStamp-l<16||window.requestAnimationFrame(()=>{if(i){const t=n.getBoundingClientRect();r.x=e.clientX-t.left,r.y=e.clientY-t.top}else r.x=e.clientX,r.y=e.clientY;1<Math.hypot(r.x-a.x,r.y-a.y)&&(_(r.x,r.y,h[Math.floor(Math.random()*t.length)]),a.x=r.x,a.y=r.y,l=e.timeStamp)})}function _(e,t,i){c.push(new x(e,t,i))}function v(){if(0!=c.length){u.clearRect(0,0,s,o);for(let e=0;e<c.length;e++)c[e].update(u);for(let e=c.length-1;0<=e;e--)c[e].lifeSpan<0&&c.splice(e,1);0==c.length&&u.clearRect(0,0,s,o)}p=requestAnimationFrame(v)}function y(){d.remove(),cancelAnimationFrame(p),n.removeEventListener("mousemove",w),n.removeEventListener("touchmove",m),n.removeEventListener("touchstart",m),window.addEventListener("resize",A)}function x(e,t,i){var n=Math.floor(60*Math.random()+80);this.initialLifeSpan=n,this.lifeSpan=n,this.velocity={x:(Math.random()<.5?-1:1)*(Math.random()/2),y:.4*Math.random()+.8},this.position={x:e,y:t},this.canv=i,this.update=function(e){this.position.x+=this.velocity.x,this.position.y+=this.velocity.y,this.lifeSpan--,this.velocity.y+=.05;var t=Math.max(this.lifeSpan/this.initialLifeSpan,0);e.drawImage(this.canv,this.position.x-this.canv.width/2*t,this.position.y-this.canv.height/2,this.canv.width*t,this.canv.height*t)}}return g.onchange=()=>{(g.matches?y:f)()},f(),{destroy:y}},t.fairyDustCursor=function(e){let t=e&&e.colors||["#D61C59","#E7D84B","#1B8798"],i=e&&e.element,n=i||document.body,s=window.innerWidth,o=window.innerHeight;const r={x:s/2,y:s/2},a={x:s/2,y:s/2},l=[],c=[];let h,d,u;const p=window.matchMedia("(prefers-reduced-motion: reduce)");function g(){if(p.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");h=document.createElement("canvas"),d=h.getContext("2d"),h.style.top="0px",h.style.left="0px",h.style.pointerEvents="none",i?(h.style.position="absolute",n.appendChild(h),h.width=n.clientWidth,h.height=n.clientHeight):(h.style.position="fixed",n.appendChild(h),h.width=s,h.height=o),d.font="21px serif",d.textBaseline="middle",d.textAlign="center",t.forEach(e=>{var t=d.measureText("*"),i=document.createElement("canvas"),n=i.getContext("2d");i.width=t.width,i.height=t.actualBoundingBoxAscent+t.actualBoundingBoxDescent,n.fillStyle=e,n.textAlign="center",n.font="21px serif",n.textBaseline="middle",n.fillText("*",i.width/2,t.actualBoundingBoxAscent),c.push(i)}),n.addEventListener("mousemove",m),n.addEventListener("touchmove",A,{passive:!0}),n.addEventListener("touchstart",A,{passive:!0}),window.addEventListener("resize",f),_()}function f(e){s=window.innerWidth,o=window.innerHeight,i?(h.width=n.clientWidth,h.height=n.clientHeight):(h.width=s,h.height=o)}function A(t){if(0<t.touches.length)for(let e=0;e<t.touches.length;e++)w(t.touches[e].clientX,t.touches[e].clientY,c[Math.floor(Math.random()*c.length)])}function m(e){window.requestAnimationFrame(()=>{if(i){const t=n.getBoundingClientRect();r.x=e.clientX-t.left,r.y=e.clientY-t.top}else r.x=e.clientX,r.y=e.clientY;1.5<Math.hypot(r.x-a.x,r.y-a.y)&&(w(r.x,r.y,c[Math.floor(Math.random()*t.length)]),a.x=r.x,a.y=r.y)})}function w(e,t,i){l.push(new y(e,t,i))}function _(){if(0!=l.length){d.clearRect(0,0,s,o);for(let e=0;e<l.length;e++)l[e].update(d);for(let e=l.length-1;0<=e;e--)l[e].lifeSpan<0&&l.splice(e,1);0==l.length&&d.clearRect(0,0,s,o)}u=requestAnimationFrame(_)}function v(){h.remove(),cancelAnimationFrame(u),n.removeEventListener("mousemove",m),n.removeEventListener("touchmove",A),n.removeEventListener("touchstart",A),window.addEventListener("resize",f)}function y(e,t,i){var n=Math.floor(30*Math.random()+60);this.initialLifeSpan=n,this.lifeSpan=n,this.velocity={x:(Math.random()<.5?-1:1)*(Math.random()/2),y:.7*Math.random()+.9},this.position={x:e,y:t},this.canv=i,this.update=function(e){this.position.x+=this.velocity.x,this.position.y+=this.velocity.y,this.lifeSpan--,this.velocity.y+=.02;var t=Math.max(this.lifeSpan/this.initialLifeSpan,0);e.drawImage(this.canv,this.position.x-this.canv.width/2*t,this.position.y-this.canv.height/2,this.canv.width*t,this.canv.height*t)}}return p.onchange=()=>{(p.matches?v:g)()},g(),{destroy:v}},t.followingDotCursor=function(e){let t,i,n=e&&e.element,s=n||document.body,o=window.innerWidth,r=window.innerHeight,a={x:o/2,y:o/2},l=new function(e,t,i,n){this.position={x:e,y:t},this.width=10,this.lag=10,this.moveTowards=function(e,t,i){this.position.x+=(e-this.position.x)/this.lag,this.position.y+=(t-this.position.y)/this.lag,i.fillStyle=c,i.beginPath(),i.arc(this.position.x,this.position.y,this.width,0,2*Math.PI),i.fill(),i.closePath()}}(o/2,r/2),c=e?.color||"#323232a6";const h=window.matchMedia("(prefers-reduced-motion: reduce)");function d(){if(h.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");t=document.createElement("canvas"),i=t.getContext("2d"),t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",n?(t.style.position="absolute",s.appendChild(t),t.width=s.clientWidth,t.height=s.clientHeight):(t.style.position="fixed",document.body.appendChild(t),t.width=o,t.height=r),s.addEventListener("mousemove",p),window.addEventListener("resize",u),g()}function u(e){o=window.innerWidth,r=window.innerHeight,n?(t.width=s.clientWidth,t.height=s.clientHeight):(t.width=o,t.height=r)}function p(e){var t;n?(t=s.getBoundingClientRect(),a.x=e.clientX-t.left,a.y=e.clientY-t.top):(a.x=e.clientX,a.y=e.clientY)}function g(){i.clearRect(0,0,o,r),l.moveTowards(a.x,a.y,i),requestAnimationFrame(g)}function f(){t.remove(),cancelAnimationFrame(g),s.removeEventListener("mousemove",p),window.addEventListener("resize",u)}return h.onchange=()=>{(h.matches?f:d)()},d(),{destroy:f}},t.ghostCursor=function(e){let t,i,n,s=e&&e.element,o=s||document.body,r=window.innerWidth,a=window.innerHeight,l={x:r/2,y:r/2},c=[],h=new Image;h.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAATCAYAAACk9eypAAAAAXNSR0IArs4c6QAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAhGVYSWZNTQAqAAAACAAFARIAAwAAAAEAAQAAARoABQAAAAEAAABKARsABQAAAAEAAABSASgAAwAAAAEAAgAAh2kABAAAAAEAAABaAAAAAAAAAEgAAAABAAAASAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAADKADAAQAAAABAAAAEwAAAAAChpcNAAAACXBIWXMAAAsTAAALEwEAmpwYAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpMwidZAAABqElEQVQoFY3SPUvDQBgH8BREpRHExYiDgmLFl6WC+AYmWeyLg4i7buJX8DMpOujgyxGvUYeCgzhUQUSKKLUS0+ZyptXh8Z5Ti621ekPyJHl+uftfomhaf9Ei5JyxXKfynyEA6EYcLHpwyflT958GAQ7DTABNHd8EbtDbEH2BD5QEQmi2mM8P/Iq+A0SzszEg+3sPjDnDdVEtQKQbMUidHD3xVzf6A9UDEmEm+8h9KTqTVUjT+vB53aHrCbAPiceYq1dQI1Aqv4EhMll0jzv+Y0yiRgCnLRSYyDQHVoqUXe4uKL9l+L7GXC4vkMhE6eW/AOJs9k583ORDUyXMZ8F5SVHVVnllmPNKSFagAJ5DofaqGXw/gHBYg51dIldkmknY3tguv3jOtHR4+MqAzaraJXbEhqHhcQlwGSOi5pytVQHZLN5s0WNe8HPrLYlFsO20RPHkImxsbmHdLJFI76th7Z4SeuF53hTeFLvhRCJRCTKZKxgdnRDbW+iozFJbBMw14/ElwGYc0egMBMFzT21f5Rog33Z7dX02GBm7WV5ZfT5Nn5bE3zuCDe9UxdTpNvK+5AAAAABJRU5ErkJggg==";const d=window.matchMedia("(prefers-reduced-motion: reduce)");function u(){if(d.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");t=document.createElement("canvas"),i=t.getContext("2d"),t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",s?(t.style.position="absolute",o.appendChild(t),t.width=o.clientWidth,t.height=o.clientHeight):(t.style.position="fixed",document.body.appendChild(t),t.width=r,t.height=a),o.addEventListener("mousemove",f),o.addEventListener("touchmove",g,{passive:!0}),o.addEventListener("touchstart",g,{passive:!0}),window.addEventListener("resize",p),m()}function p(e){r=window.innerWidth,a=window.innerHeight,s?(t.width=o.clientWidth,t.height=o.clientHeight):(t.width=r,t.height=a)}function g(t){if(0<t.touches.length)for(let e=0;e<t.touches.length;e++)A(t.touches[e].clientX,t.touches[e].clientY,h)}function f(e){var t;s?(t=o.getBoundingClientRect(),l.x=e.clientX-t.left,l.y=e.clientY-t.top):(l.x=e.clientX,l.y=e.clientY),A(l.x,l.y,h)}function A(e,t,i){c.push(new _(e,t,i))}function m(){if(0!=c.length){i.clearRect(0,0,r,a);for(let e=0;e<c.length;e++)c[e].update(i);for(let e=c.length-1;0<=e;e--)c[e].lifeSpan<0&&c.splice(e,1);0==c.length&&i.clearRect(0,0,r,a)}n=requestAnimationFrame(m)}function w(){t.remove(),cancelAnimationFrame(n),o.removeEventListener("mousemove",f),o.removeEventListener("touchmove",g),o.removeEventListener("touchstart",g),window.addEventListener("resize",p)}function _(e,t,i){this.initialLifeSpan=40,this.lifeSpan=40,this.position={x:e,y:t},this.image=i,this.update=function(e){this.lifeSpan--;var t=Math.max(this.lifeSpan/this.initialLifeSpan,0);e.globalAlpha=t,e.drawImage(this.image,this.position.x,this.position.y)}}return d.onchange=()=>{(d.matches?w:u)()},u(),{destroy:w}},t.rainbowCursor=function(e){let t,r,i,n=e&&e.element,s=n||document.body,a=window.innerWidth,l=window.innerHeight,c={x:a/2,y:a/2},h=[];const o=e?.length||20,d=e?.colors||["#FE0000","#FD8C00","#FFE500","#119F0B","#0644B3","#C22EDC"],u=e?.size||3;let p=!1;const g=window.matchMedia("(prefers-reduced-motion: reduce)");function f(){if(g.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");t=document.createElement("canvas"),r=t.getContext("2d"),t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",n?(t.style.position="absolute",s.appendChild(t),t.width=s.clientWidth,t.height=s.clientHeight):(t.style.position="fixed",document.body.appendChild(t),t.width=a,t.height=l),s.addEventListener("mousemove",m),window.addEventListener("resize",A),w()}function A(e){a=window.innerWidth,l=window.innerHeight,n?(t.width=s.clientWidth,t.height=s.clientHeight):(t.width=a,t.height=l)}function m(e){if(n){const t=s.getBoundingClientRect();c.x=e.clientX-t.left,c.y=e.clientY-t.top}else c.x=e.clientX,c.y=e.clientY;if(!1===p){p=!0;for(let e=0;e<o;e++)t=c.x,i=c.y,h.push(new v(t,i))}var t,i}function w(){{r.clearRect(0,0,a,l),r.lineJoin="round";let n=[],s=c.x,o=c.y;h.forEach(function(e,t,i){t=i[t+1]||i[0];e.position.x=s,e.position.y=o,n.push({x:s,y:o}),s+=.4*(t.position.x-e.position.x),o+=.4*(t.position.y-e.position.y)}),d.forEach((e,i)=>{r.beginPath(),r.strokeStyle=e,n.length&&r.moveTo(n[0].x,n[0].y+i*(u-1)),n.forEach((e,t)=>{0!==t&&r.lineTo(e.x,e.y+i*u)}),r.lineWidth=u,r.lineCap="round",r.stroke()})}i=requestAnimationFrame(w)}function _(){t.remove(),cancelAnimationFrame(i),s.removeEventListener("mousemove",m),window.addEventListener("resize",A)}function v(e,t){this.position={x:e,y:t}}return g.onchange=()=>{(g.matches?_:f)()},f(),{destroy:_}},t.snowflakeCursor=function(e){let t,s,i,n=e&&e.element,o=n||document.body,r=["❄️"],a=window.innerWidth,l=window.innerHeight,c={x:a/2,y:a/2},h=[],d=[];const u=window.matchMedia("(prefers-reduced-motion: reduce)");function p(){if(u.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");t=document.createElement("canvas"),s=t.getContext("2d"),t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",n?(t.style.position="absolute",o.appendChild(t),t.width=o.clientWidth,t.height=o.clientHeight):(t.style.position="fixed",document.body.appendChild(t),t.width=a,t.height=l),s.font="12px serif",s.textBaseline="middle",s.textAlign="center",r.forEach(e=>{var t=s.measureText(e),i=document.createElement("canvas"),n=i.getContext("2d");i.width=t.width,i.height=2*t.actualBoundingBoxAscent,n.textAlign="center",n.font="12px serif",n.textBaseline="middle",n.fillText(e,i.width/2,t.actualBoundingBoxAscent),d.push(i)}),o.addEventListener("mousemove",A),o.addEventListener("touchmove",f,{passive:!0}),o.addEventListener("touchstart",f,{passive:!0}),window.addEventListener("resize",g),w()}function g(e){a=window.innerWidth,l=window.innerHeight,n?(t.width=o.clientWidth,t.height=o.clientHeight):(t.width=a,t.height=l)}function f(t){if(0<t.touches.length)for(let e=0;e<t.touches.length;e++)m(t.touches[e].clientX,t.touches[e].clientY,d[Math.floor(Math.random()*d.length)])}function A(e){var t;n?(t=o.getBoundingClientRect(),c.x=e.clientX-t.left,c.y=e.clientY-t.top):(c.x=e.clientX,c.y=e.clientY),m(c.x,c.y,d[Math.floor(Math.random()*r.length)])}function m(e,t,i){h.push(new v(e,t,i))}function w(){if(0!=h.length){s.clearRect(0,0,a,l);for(let e=0;e<h.length;e++)h[e].update(s);for(let e=h.length-1;0<=e;e--)h[e].lifeSpan<0&&h.splice(e,1);0==h.length&&s.clearRect(0,0,a,l)}i=requestAnimationFrame(w)}function _(){t.remove(),cancelAnimationFrame(i),o.removeEventListener("mousemove",A),o.removeEventListener("touchmove",f),o.removeEventListener("touchstart",f),window.addEventListener("resize",g)}function v(e,t,i){var n=Math.floor(60*Math.random()+80);this.initialLifeSpan=n,this.lifeSpan=n,this.velocity={x:(Math.random()<.5?-1:1)*(Math.random()/2),y:1+Math.random()},this.position={x:e,y:t},this.canv=i,this.update=function(e){this.position.x+=this.velocity.x,this.position.y+=this.velocity.y,this.lifeSpan--,this.velocity.x+=2*(Math.random()<.5?-1:1)/75,this.velocity.y-=Math.random()/300;var t=Math.max(this.lifeSpan/this.initialLifeSpan,0),i=2*this.lifeSpan*.0174533;e.translate(this.position.x,this.position.y),e.rotate(i),e.drawImage(this.canv,-this.canv.width/2*t,-this.canv.height/2,this.canv.width*t,this.canv.height*t),e.rotate(-i),e.translate(-this.position.x,-this.position.y)}}return u.onchange=()=>{(u.matches?_:p)()},p(),{destroy:_}},t.springyEmojiCursor=function(e){let s,o,n,r,a=e&&e.emoji||"🤪",l=e&&e.element,c=l||document.body,h=window.innerWidth,d=window.innerHeight,u={x:h/2,y:h/2},p=[];const g=window.matchMedia("(prefers-reduced-motion: reduce)");function t(){if(g.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");s=document.createElement("canvas"),o=s.getContext("2d"),s.style.top="0px",s.style.left="0px",s.style.pointerEvents="none",l?(s.style.position="absolute",c.appendChild(s),s.width=c.clientWidth,s.height=c.clientHeight):(s.style.position="fixed",document.body.appendChild(s),s.width=h,s.height=d),o.font="16px serif",o.textBaseline="middle",o.textAlign="center";var e=o.measureText(a),t=document.createElement("canvas"),i=t.getContext("2d");t.width=e.width,t.height=2*e.actualBoundingBoxAscent,i.textAlign="center",i.font="16px serif",i.textBaseline="middle",i.fillText(a,t.width/2,e.actualBoundingBoxAscent),r=t;let n=0;for(n=0;n<7;n++)p[n]=new y(r);c.addEventListener("mousemove",m),c.addEventListener("touchmove",A,{passive:!0}),c.addEventListener("touchstart",A,{passive:!0}),window.addEventListener("resize",f),w()}function f(e){h=window.innerWidth,d=window.innerHeight,l?(s.width=c.clientWidth,s.height=c.clientHeight):(s.width=h,s.height=d)}function A(e){var t;0<e.touches.length&&(l?(t=c.getBoundingClientRect(),u.x=e.touches[0].clientX-t.left,u.y=e.touches[0].clientY-t.top):(u.x=e.touches[0].clientX,u.y=e.touches[0].clientY))}function m(e){var t;l?(t=c.getBoundingClientRect(),u.x=e.clientX-t.left,u.y=e.clientY-t.top):(u.x=e.clientX,u.y=e.clientY)}function w(){s.width=s.width,p[0].position.x=u.x,p[0].position.y=u.y;for(let e=1;e<7;e++){var t=new _(0,0);0<e&&v(e-1,e,t),e<6&&v(e+1,e,t);var i=new _(10*-p[e].velocity.x,10*-p[e].velocity.y),t=new _(+(t.X+i.X),+(t.Y+i.Y)+50);p[e].velocity.x+=.01*t.X,p[e].velocity.y+=.01*t.Y,Math.abs(p[e].velocity.x)<.1&&Math.abs(p[e].velocity.y)<.1&&Math.abs(t.X)<.1&&Math.abs(t.Y)<.1&&(p[e].velocity.x=0,p[e].velocity.y=0),p[e].position.x+=p[e].velocity.x,p[e].position.y+=p[e].velocity.y,i=s.clientHeight,t=s.clientWidth,p[e].position.y>=i-11-1&&(0<p[e].velocity.y&&(p[e].velocity.y=.7*-p[e].velocity.y),p[e].position.y=i-11-1),p[e].position.x>=t-11&&(0<p[e].velocity.x&&(p[e].velocity.x=.7*-p[e].velocity.x),p[e].position.x=t-11-1),p[e].position.x<0&&(p[e].velocity.x<0&&(p[e].velocity.x=.7*-p[e].velocity.x),p[e].position.x=0),p[e].draw(o)}n=requestAnimationFrame(w)}function i(){s.remove(),cancelAnimationFrame(n),c.removeEventListener("mousemove",m),c.removeEventListener("touchmove",A),c.removeEventListener("touchstart",A),window.addEventListener("resize",f)}function _(e,t){this.X=e,this.Y=t}function v(e,t,i){var n=p[e].position.x-p[t].position.x,e=p[e].position.y-p[t].position.y,t=Math.sqrt(n*n+e*e);10<t&&(i.X+=n/t*(n=10*(t-10)),i.Y+=e/t*n)}function y(e){this.position={x:u.x,y:u.y},this.velocity={x:0,y:0},this.canv=e,this.draw=function(e){e.drawImage(this.canv,this.position.x-this.canv.width/2,this.position.y-this.canv.height/2,this.canv.width,this.canv.height)}}return g.onchange=()=>{(g.matches?i:t)()},t(),{destroy:i}},t.textFlag=function(e){let t,s,o,i=e||{},n=e&&e.element,r=n||document.body,a=i.text?" "+e.text:" Your Text Here",l=i.font||"monospace",c=i.textSize||12,h=c+"px "+l,d=i.gap||c+2,u=0,p=[],g=window.innerWidth,f=window.innerHeight,A={x:g/2,y:g/2};for(let e=0;e<a.length;e++)p[e]={letter:a.charAt(e),x:g/2,y:g/2};e?.size;const m=window.matchMedia("(prefers-reduced-motion: reduce)");function w(){if(m.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");t=document.createElement("canvas"),s=t.getContext("2d"),t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",n?(t.style.position="absolute",r.appendChild(t),t.width=r.clientWidth,t.height=r.clientHeight):(t.style.position="fixed",document.body.appendChild(t),t.width=g,t.height=f),r.addEventListener("mousemove",v),window.addEventListener("resize",_),y()}function _(e){g=window.innerWidth,f=window.innerHeight,n?(t.width=r.clientWidth,t.height=r.clientHeight):(t.width=g,t.height=f)}function v(e){var t;n?(t=r.getBoundingClientRect(),A.x=e.clientX-t.left,A.y=e.clientY-t.top):(A.x=e.clientX,A.y=e.clientY)}function y(){s.clearRect(0,0,g,f),u+=.15;var e=2*Math.cos(u),t=5*Math.sin(u);for(let e=p.length-1;0<e;e--)p[e].x=p[e-1].x+d,p[e].y=p[e-1].y,s.font=h,s.fillText(p[e].letter,p[e].x,p[e].y);var i=p[0].x,n=p[0].y;i+=(A.x-i)/5+e+2,n+=(A.y-n)/5+t,p[0].x=i,p[0].y=n,o=requestAnimationFrame(y)}function x(){t.remove(),cancelAnimationFrame(o),r.removeEventListener("mousemove",v),window.addEventListener("resize",_)}return m.onchange=()=>{(m.matches?x:w)()},w(),{destroy:x}},t.trailingCursor=function(e){let t,o,i,s=e&&e.element,r=s||document.body,a=window.innerWidth,l=window.innerHeight,c={x:a/2,y:a/2},h=[];const d=e?.particles||15,u=e?.rate||.4,n=e?.baseImageSrc||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAATCAYAAACk9eypAAAAAXNSR0IArs4c6QAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAhGVYSWZNTQAqAAAACAAFARIAAwAAAAEAAQAAARoABQAAAAEAAABKARsABQAAAAEAAABSASgAAwAAAAEAAgAAh2kABAAAAAEAAABaAAAAAAAAAEgAAAABAAAASAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAADKADAAQAAAABAAAAEwAAAAAChpcNAAAACXBIWXMAAAsTAAALEwEAmpwYAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpMwidZAAABqElEQVQoFY3SPUvDQBgH8BREpRHExYiDgmLFl6WC+AYmWeyLg4i7buJX8DMpOujgyxGvUYeCgzhUQUSKKLUS0+ZyptXh8Z5Ti621ekPyJHl+uftfomhaf9Ei5JyxXKfynyEA6EYcLHpwyflT958GAQ7DTABNHd8EbtDbEH2BD5QEQmi2mM8P/Iq+A0SzszEg+3sPjDnDdVEtQKQbMUidHD3xVzf6A9UDEmEm+8h9KTqTVUjT+vB53aHrCbAPiceYq1dQI1Aqv4EhMll0jzv+Y0yiRgCnLRSYyDQHVoqUXe4uKL9l+L7GXC4vkMhE6eW/AOJs9k583ORDUyXMZ8F5SVHVVnllmPNKSFagAJ5DofaqGXw/gHBYg51dIldkmknY3tguv3jOtHR4+MqAzaraJXbEhqHhcQlwGSOi5pytVQHZLN5s0WNe8HPrLYlFsO20RPHkImxsbmHdLJFI76th7Z4SeuF53hTeFLvhRCJRCTKZKxgdnRDbW+iozFJbBMw14/ElwGYc0egMBMFzT21f5Rog33Z7dX02GBm7WV5ZfT5Nn5bE3zuCDe9UxdTpNvK+5AAAAABJRU5ErkJggg==";let p=!1,g=new Image;g.src=n;const f=window.matchMedia("(prefers-reduced-motion: reduce)");function A(){if(f.matches)return console.log("This browser has prefers reduced motion turned on, so the cursor did not init");t=document.createElement("canvas"),o=t.getContext("2d"),t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",s?(t.style.position="absolute",r.appendChild(t),t.width=r.clientWidth,t.height=r.clientHeight):(t.style.position="fixed",document.body.appendChild(t),t.width=a,t.height=l),r.addEventListener("mousemove",w),window.addEventListener("resize",m),_()}function m(e){a=window.innerWidth,l=window.innerHeight,s?(t.width=r.clientWidth,t.height=r.clientHeight):(t.width=a,t.height=l)}function w(e){if(s){const t=r.getBoundingClientRect();c.x=e.clientX-t.left,c.y=e.clientY-t.top}else c.x=e.clientX,c.y=e.clientY;if(!1===p){p=!0;for(let e=0;e<d;e++)t=c.x,i=c.y,n=g,h.push(new y(t,i,n))}var t,i,n}function _(){{o.clearRect(0,0,a,l);let n=c.x,s=c.y;h.forEach(function(e,t,i){t=i[t+1]||i[0];e.position.x=n,e.position.y=s,e.move(o),n+=(t.position.x-e.position.x)*u,s+=(t.position.y-e.position.y)*u})}i=requestAnimationFrame(_)}function v(){t.remove(),cancelAnimationFrame(i),r.removeEventListener("mousemove",w),window.addEventListener("resize",m)}function y(e,t,i){this.position={x:e,y:t},this.image=i,this.move=function(e){e.drawImage(this.image,this.position.x,this.position.y)}}return f.onchange=()=>{(f.matches?v:A)()},A(),{destroy:v}}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];return void 0!==t||(t=__webpack_module_cache__[e]={exports:{}},__webpack_modules__[e](t,t.exports,__webpack_require__)),t.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var i in t)__webpack_require__.o(t,i)&&!__webpack_require__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};(()=>{class s{constructor(){this.enabled=!0,this.chance=20}}class o{get settings(){return this._settings}set settings(e){for(const n of Object.entries(e)){var t=n[0],i=n[1];switch(t){case"name":case"title":this.title=i;break;case"description":this.description=i;break;default:this._settings[t]=i}}}check(e){return Math.random()<.01*e}enable(){this.settings.enabled=!0}disable(){this.settings.enabled=!1}toggle(e=null){this.settings.enabled=null===e?!this.settings.enabled:e}}class i extends o{}var e=__webpack_require__(562);class n{constructor(){this.ui=new e.d(this),this.core_settings=new t,this.jokes={}}check(e){return Math.random()<.01*e}add(e){this.jokes[e.id]=e}addCustom(e,t,i=null){var n=new class extends o{constructor(){super(...arguments),this.id=e,this.title="Пользовательская шутка",this.description="Для шутки не определено описание",this._settings=new s}start(){t.call(this,this.settings)}};return n.settings=i,this.add(n),n}get settings(){var e={};e.core=this.core_settings;for(const n of Object.entries(this.jokes)){var t=n[0],i=n[1];e[t]=i.settings}return e}set settings(e){for(const n of Object.entries(e)){var t=n[0],i=n[1],t="core"===t?this.core_settings:this.jokes[t].settings;Object.assign(t,i)}}enable(){this.core_settings.enabled=!0}disable(){this.core_settings.enabled=!1}enableAll(){for(const e of Object.keys(this.jokes))this.jokes[e].enable()}disableAll(){for(const e of Object.keys(this.jokes))this.jokes[e].disable()}toggleJoke(e,t){e=this.jokes[e];e.settings.enabled=t,e instanceof i&&!t&&e.stop(),this.saveUserStates()}saveUserStates(){var e={};for(const t of Object.keys(this.jokes))e[t]=this.jokes[t].settings.enabled;fetch("/api.php?"+$.param({method:"storage.set",user_id:window.UserID,key:"april-fools",token:window.ForumAPITicket,value:JSON.stringify(e),timer:1440}))}async loadUserStates(){var e=await(await fetch("/api.php?"+$.param({method:"storage.get",user_id:window.UserID,key:"april-fools"}))).json();if(!e.error){var t=JSON.parse(e.response.storage.data["april-fools"]);for(const i of Object.keys(this.jokes))this.jokes[i].settings.enabled=t[i]}}async clearUserStates(){await fetch("/api.php?"+$.param({method:"storage.delete",user_id:window.UserID,key:"april-fools",token:window.ForumAPITicket}))}start(e,t=!1){e in this.jokes&&(e=this.jokes[e],t||e.settings.enabled&&this.check(e.settings.chance))&&e.start()}startAll(e=!1){for(const t of Object.keys(this.jokes))this.start(t,e)}regularCheck(){var e,t;return!!this.core_settings.enabled&&(0<=this.core_settings.testers.indexOf(window.UserID)||(e=(t=new Date).getMonth()+1,t=t.getDate(),4===e&&1===t&&this.check(this.core_settings.chance)))}async regularStart(){this.regularCheck()&&(await this.loadUserStates(),this.ui.show(),this.startAll())}}class t{constructor(){this.chance=100,this.enabled=!0,this.testers=[]}}var r,a=__webpack_require__(311),l=__webpack_require__.n(a);i;class c{constructor(){this.enabled=!1,this.chance=1,this.directions=["top","left","bottom","left"],this.force=.5,this.selector="[id^=pun]",this.interval=100}}function h(e){return l()(e).find("*").contents().filter((e,t)=>t.nodeType===Node.TEXT_NODE)}o;class d{constructor(){this.enabled=!0,this.chance=20,this.selector=".post-content"}}o;class u{constructor(){this.enabled=!1,this.chance=30}}o;class p{constructor(){this.enabled=!0,this.chance=30,this.selector='img[src*="/avatars/"]',this.variant_chance=20,this.variants={"sepia({0}%)":100,"saturate({0}%)":100,"hue-rotate({0}deg)":360,"invert({0}%)":100}}}o;class g{constructor(){this.enabled=!0,this.chance=20,this.selector=".pa-author a"}}o;class f{constructor(){this.enabled=!0,this.chance=20,this.selector=".post-content",this.shuffle_chance=50}}const A=__webpack_require__(442);i;(a=r=r||{}).Rainbow="rainbow",a.FairyDust="fairy_dust",a.SpringyEmoji="springy_emoji",a.Emoji="emoji",a.Ghost="ghost",a.Trailing="trailing",a.TextFlag="text_flag",a.FollowingDot="following_dot",a.Bubbles="bubbles",a.Snowflake="snowflake",a.Clock="clock";class m{constructor(){this.enabled=!0,this.chance=100,this.effects={[r.Rainbow]:new class extends w{constructor(){super(...arguments),this.length=20,this.size=3,this.colors=["#9400D3","#4B0082","#0000FF","#00FF00","#FFFF00","#FF7F00","#FF0000"]}},[r.SpringyEmoji]:new class extends w{constructor(){super(...arguments),this.emoji="🤪"}},[r.Emoji]:new class extends w{constructor(){super(...arguments),this.emoji=["🔥","🐬","🦆"]}},[r.FairyDust]:new class extends w{constructor(){super(...arguments),this.colors=["#ff0000","#00ff00","#0000ff"]}},[r.Ghost]:new w,[r.Trailing]:new class extends w{constructor(){super(...arguments),this.particles=15,this.rate=.4,this.baseImageSrc=null}},[r.TextFlag]:new class extends w{constructor(){super(...arguments),this.text="С днём смеха!",this.color="#000000",this.font="monospace",this.textSize=12,this.gap=14,this.size=3}},[r.FollowingDot]:new class extends w{constructor(){super(...arguments),this.color="#323232a6"}},[r.Bubbles]:new w,[r.Snowflake]:new class extends w{constructor(){super(...arguments),this.weight=0}},[r.Clock]:new class extends w{constructor(){super(...arguments),this.dateColor="blue",this.faceColor="black",this.secondsColor="red",this.minutesColor="black",this.hoursColor="black"}}}}}class w{constructor(){this.enabled=!0,this.weight=50}}o;class _{constructor(){this.enabled=!0,this.chance=100,this.gender_resolver=null,this.rude=!1,this.change_frequency=5,this.schemas={"{adj} {noun}{p}":10,"{noun} {adj}{p}":3,"{adj}, {adj} {noun}{p}":10,"{adj} и очень {adj} {noun}{p}":10,"{adj} {noun} {verb}{p}":10,"{adj} {noun} {adv} {verb}{p}":5,"{adj} {noun} {verb} {place}{p}":5,"{adj} {noun} {adv} {verb} {place}{p}":5},this.variants={adj:{},noun:{},verb:{},place:{},adv:{},p:{"":new v({weight:10}),".":new v({weight:10}),"...":new v({weight:5}),"!":new v({weight:5}),"!!!":new v({weight:2}),"?":new v({weight:2}),"?!":new v({weight:1})}}}}class v{constructor(e=new Object){this.weight=10,this.enabled=!0,this.rude=!1,this.gender=null;for(const t of Object.entries(e))t[0]in this&&(this[t[0]]=t[1])}}function y(i,e){const n={};return e.split(",").map(e=>e.trim()).forEach(e=>{var t=e.replace(/[^А-ЯЁа-яёA-Za-z\- ]/g,"");""!==t&&(n[t]=new v({gender:i,rude:0<=e.indexOf("$"),enabled:e.indexOf("!")<0,weight:10*(0<=e.indexOf("$")?.5:1)*(0<=e.indexOf("%")?.5:1)*(0<=e.indexOf("^")?2:1)}))}),n}window.BuildStupdiTitleVariant=y,window.AprilJokes=(e=>{const t=new n;return e.forEach(e=>{t.add(new e)}),$(()=>t.regularStart()),t})([class extends i{constructor(){super(...arguments),this.id="shake",this.title="Форумо-трясение",this.description="Страница форума начинает трястись",this._settings=new c,this.data_name="april-fools-shake"}rand(e){return e+this.settings.force*(2*Math.random()-1)}start(){this.items=l()(this.settings.selector),this.items.each((e,t)=>{let i={};this.settings.directions.forEach(e=>{i[e]=parseInt(l()(t).css("margin-"+e))}),l()(t).data(this.data_name,i)}),this.interval_id=setInterval(()=>{this.items.each((e,t)=>{var i=l()(t).data(this.data_name);for(const n of Object.entries(i))l()(t).css("margin-"+n[0],this.rand(n[1]))})},this.settings.interval)}stop(){clearInterval(this.interval_id),this.items.each((e,t)=>{let i={};this.settings.directions.forEach(e=>{l()(t).css("margin-"+e,i[e])}),l()(t).data(this.data_name,i)})}},class extends o{constructor(){super(...arguments),this.id="humanitarian_hell",this.title="Ад гуманитария",this.description='Все "тся" заменяются на "ться", а все "ться" на "тся"',this._settings=new d}processText(e){return e.replace(/(ть?ся)/g,function(e){return 0<e.indexOf("ь")?"тся":"ться"})}start(){h(this.settings.selector).each((e,t)=>{t.textContent=this.processText(t.textContent)})}},class extends o{constructor(){super(...arguments),this.id="mirror",this.title="Зеркало",this.description="Элементы форума отражаются (по крайней мере, пытаются)",this._settings=new u}start(){l()(".post, .post h3, .post-links, .post-author, .post-content").css("transform","scaleX(-1)").css("-moz-transform","scaleX(-1)").css("-moz-transform","scaleX(-1)").css("filter","FlipH").css("-ms-filter",'"FlipH"'),l()(".post-links, .post-links ul, .post h3 span").css("margin-left","0"),l()(".post h3 span").css("margin-right","25em")}},class extends o{constructor(){super(...arguments),this.id="carnival",this.title="Карнавал",this.description="Аватарки приобретают интересные цвета",this._settings=new p}start(){l()(this.settings.selector).each((e,t)=>{var i=[];for(const n of Object.entries(this.settings.variants))this.check(this.settings.variant_chance)&&i.push(n[0].replace("{0}",Math.round(Math.random()*n[1]).toString()));0<i.length&&l()(t).css({filter:i.join(" ")})})}},class extends o{constructor(){super(...arguments),this.id="crazy_letters",this.title="Мама, Я сОшЛа С уМа!",this.description="иМеНа ЗаБоРчИкОм",this._settings=new g}start(){l()(this.settings.selector).each((e,t)=>{var i=l()(this).text();let n="";for(let e=0;e<i.length;e++)n+=i[e][e%2?"toLowerCase":"toUpperCase"]();l()(this).text(n)})}},class extends o{constructor(){super(...arguments),this.id="letter_chaos",this.title="Буквенный хаос",this.description="Все буквы в словах, кроме первой и последней, перемешены",this._settings=new f,this.punctuationSymbols=null}shuffleLetters(e){if(e.length<3||!this.check(this.settings.shuffle_chance))return e;var e=e.split(""),t=e.slice(1,-1);for(let e=t.length-1;0<e;e--){var i=Math.floor(Math.random()*(e+1));[t[e],t[i]]=[t[i],t[e]]}return[e[0],...t,e[e.length-1]].join("")}processNode(e){e.textContent=null==(e=e.textContent)?void 0:e.replace(/([А-Яа-яA-Za-z]+)/gm,(e,t)=>this.shuffleLetters(t))}start(){h(this.settings.selector).each((e,t)=>this.processNode(t))}},class extends i{constructor(){super(...arguments),this.id="cursor_effects",this.title="Красивый курсор",this.description="Эффекты, следующие за курсором",this._settings=new m}enableAll(){for(const e of Object.keys(this.settings.effects))this.settings.effects[e].enabled=!0}disableAll(){for(const e of Object.keys(this.settings.effects))this.settings.effects[e].enabled=!1}weight(e){e=this.settings.effects[e];return e.enabled?e.weight:0}getRandomEffect(){var e=Object.values(r).map(e=>e),t=e.reduce((e,t)=>e+this.weight(t),0),i=Math.random()*t;let n=0;for(const s of e)if(i<=(n+=this.weight(s)))return s;throw new Error("Тебя быть тут не должно...")}start(){var e=this.getRandomEffect(),t=this.settings.effects[e];this.active_cursor_effect=function(e,t){switch(e){case r.Rainbow:return A.rainbowCursor(t);case r.FairyDust:return A.fairyDustCursor(t);case r.SpringyEmoji:return A.springyEmojiCursor(t);case r.Emoji:return A.emojiCursor(t);case r.Ghost:return A.ghostCursor(t);case r.Trailing:return A.trailingCursor(t);case r.TextFlag:return A.textFlag(t);case r.FollowingDot:return A.followingDotCursor(t);case r.Bubbles:return A.bubbleCursor(t);case r.Snowflake:return A.snowflakeCursor(t);case r.Clock:return A.clockCursor(t)}}(e,t)}stop(){this.active_cursor_effect.destroy()}},class extends o{constructor(){super(...arguments),this.id="stupid_title",this.title="Глупые статусы",this.description="Каждому пользователю даётся новый глупый статус",this._settings=new _,this.loadedGenders=null,this.variantsGenerated=!1,this.seed=0}async loadGenders(){var e=l()(".pa-author a").map((e,t)=>t.innerText).toArray().reduce((e,t)=>(e.indexOf(t)<0&&e.push(t),e),[]),e="/api.php?"+l().param({method:"users.get",fields:"username,sex",username:e}),e=await(await fetch(e)).json();this.loadedGenders={},e.error||e.response.users.forEach(e=>{"0"!==e.sex&&(this.loadedGenders[e.username]="1"===e.sex)})}resolveGender(e){return null!==this.settings.gender_resolver?!!this.settings.gender_resolver.call(this,e):e in this.loadedGenders?!!this.loadedGenders[e]:(this.resetSeed(),"m"===this.selectRandom(e,{m:1,f:1}))}async start(){var e;this.variantsGenerated||((e=this.settings.variants).adj=Object.assign(Object.assign(Object.assign({},y(!0,"адекватный,$адский,активный,алчный,%ангельский,банальный,безнадёжный,$бесполезный,былой,верный,виртуальный,вкусный,воспитанный,выгодный,выходной,гигантский,$глупый,гордый,грамотный,громадный,грубый,далекий,двуличный,деятельный,доброжелательный,$жалкий,жёсткий,жестокий,$жирный,заинтересованный,запасной,застенчивый,знакомый,иностранный,истинный,конструктивный,креативный,ласковый,любимый,мелочный,^мирный,мстительный,небесный,невозможный,независимый,низкий,нужный,объективный,обыкновенный,опрятный,^оригинальный,особенный,острый,откровенный,открытый,пестрый,повседневный,подземный,пожилой,показательный,последний,посторонний,провинциальный,пышный,робкий,родной,самовлюблённый,северный,седой,семейный,серьёзный,сногсшибательный,^солнечный,спокойный,суровый,терпеливый,уверенный в себе,ударный,^удачливый,формальный,хладнокровный,целый,чистый,чрезвычайный,чужой,южный")),y(!1,"адекватная,$адская,активная,алчная,%ангельская,банальная,безнадёжная,$бесполезная,былая,верная,виртуальная,вкусная,воспитанная,выгодная,выходная,гигантская,$глупая,гордая,грамотная,громадная,грубая,далекая,двуличная,деятельная,доброжелательная,$жалкая,жёсткая,жестокая,$жирная,заинтересованная,запасная,застенчивая,знакомая,иностранная,истинная,конструктивная,креативная,ласковая,любимая,мелочная,^мирная,мстительная,небесная,невозможная,независимая,низкая,нужная,объективная,обыкновенная,опрятная,^оригинальная,особенная,острая,откровенная,открытая,пестрая,повседневная,подземная,пожилая,показательная,последняя,посторонняя,провинциальная,пышная,робкая,родная,самовлюблённая,северная,седая,семейная,серьезная,сногсшибательная,^солнечная,спокаяная,суровая,терпеливая,уверенная в себе,ударная,^удачливая,формальная,хладнокровная,целая,чистая,чрезвычайная,чужая,южная")),e.adj),e.noun=Object.assign(Object.assign(Object.assign({},y(!0,"актёр,$балбес,бард,басурманин,борец,бродяга,бруталище,волк,дворф,%дед,%дедушка,джентльмен,диван,динозавр,дракон,ёж,%ёжик,жук,зайц,$злоумышленник,зомби,карасик,кентавр,кит,кот,кролик,кулак,лев,ледник,лесоруб,%мальчег,мальчик,манекен,массажист,мачо,монах,монстр,наследник,ниндзя,носорог,одиночка,организм,орёл,отец,принц,проказник,пузырь,$раб,рыцарь,спортсмен,сурикат,сын,%сынок,тигр,товарищ,хоббит,эльф")),y(!1,"актриса,акула,$бабка,бабочка,%бабушка,бактерия,белочка,бусинка,валькирия,$ведьма,волторна,волчица,горгулья,дворфиха,девочка,деревяшка,детка,%деффачка,%дочка,дочь,заноза,$злоумышленница,знаменитость,каруселька,килька,конфетка,косточка,кошка,красотка,крышка,леди,$личинка,львица,мать,машина,милашка,монашка,мышь,наследница,орлица,панда,пиранья,принцесса,простуда,$рабыня,русалочка,рыбка,рыбка,скамеечка,спортсменка,тигрица,травка,черепашка,чертовка,эльфийка")),e.noun),e.verb=Object.assign(Object.assign(Object.assign(Object.assign({},y(null,"бежит,берёт и делает,болеет,встаёт,говорит,думает,забывает,замирает,заходит,идёт,%имеет план и придерживается его,ловит,меняется,молчит,нарушает,оглядывается,орёт,освобождает,отвечает,отказаться куда-то идти,отказывается,отказывается вставать,отказывается что-то делать,оформляет,плывёт,поглядывает,поздравляет,поздравляет,получает,прибывает,приказывает,просыпается,прощает,работает,радуется,скрывается,снимает,снимает,снимается в сериале,снимается в фильме,собирается,соединяет,спрашивает,тянет,указывает,учит,читает,что-то скрывает,чувствует опасность,шепчет")),y(!0,"взял и сделал,додумался,женился,женится,заработался,не спал,не успел,обиделся,познал дзен,присел,проснулся,скрылся,смог,успел")),y(!1,"взяла и сделала,выходит замуж,вышла замуж,додумалась,заработалась,не спала,не успела,обиделась,познала дзен,присела,проснулась,скрылась,смогла,успела")),e.verb),e.place=Object.assign(Object.assign({},y(null,"в джунглях,в квартире,в космосе,в лесу,в очереди,в пустыне,в театре,%в тёплой и уютной квартире,в филармонии,где-то,на заснеженной вершине,на конференции,на пляже,на форуме,под водой,под дождём,%под проливным дождём")),e.place),e.adv=Object.assign(Object.assign({},y(null,"безрассудно,быстро,внезапно,вновь,$грубо,грустно,медленно,%молниеносно,немедленно,опять,осмысленно,позже,предсказуемо,расчётливо,регулярно,счастливо,уже,уныло")),e.adv),this.variantsGenerated=!0),await this.loadGenders();const n={};l()(".post-author").each((e,t)=>{var i=l()(".pa-author a",t).text();i&&(i in n||(this.resetSeed(),n[i]=this.generatePhrase(i)),l()(".pa-title",t).text(n[i]))})}prng(i,e,t){let n=3735928559^e,s=1103547991^e;for(let e=0,t;e<i.length;e++)t=i.charCodeAt(e),n=Math.imul(n^t,2654435761),s=Math.imul(s^t,1597334677);n=Math.imul(n^n>>>16,2246822507)^Math.imul(s^s>>>13,3266489909);e=4294967296*(2097151&(s=Math.imul(s^s>>>16,2246822507)^Math.imul(n^n>>>13,3266489909)))+(n>>>0);return Math.floor(Math.pow(Math.sin(e),2)*t)%t}resetSeed(){var e=new Date,t=60*e.getUTCHours()+e.getUTCMinutes();0===this.settings.change_frequency?this.seed=60*t+e.getUTCSeconds():this.seed=Math.floor(t/this.settings.change_frequency)}selectRandom(e,i){var t=Object.keys(i),n=t.reduce((e,t)=>e+i[t],0),s=this.prng(e,this.seed++,n);let o=0;for(const r of t)if(s<=(o+=i[r]))return r;throw new Error("Тебя быть тут не должно...")}buildVariants(e,t){var i={},e=this.settings.variants[e];for(const o of Object.entries(e)){var n=o[0],s=o[1];!s.enabled||s.gender===!t||!this.settings.rude&&s.rude||(i[n]=s.weight)}return i}capitalizeFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}generatePhrase(i){const n=this.resolveGender(i);var e=this.selectRandom(i,this.settings.schemas);return this.capitalizeFirst(e.replace(/\{(.+?)\}/g,(e,t)=>{t=this.buildVariants(t,n);return this.selectRandom(i,t)}))}}])})()})();