1 line
54 KiB
JavaScript
1 line
54 KiB
JavaScript
(()=>{"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,o=e&&e.element,s=o||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",o?(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=r,t.height=a),s.addEventListener("mousemove",f),s.addEventListener("touchmove",g,{passive:!0}),s.addEventListener("touchstart",g,{passive:!0}),window.addEventListener("resize",p),m()}function p(e){r=window.innerWidth,a=window.innerHeight,o?(t.width=s.clientWidth,t.height=s.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;o?(t=s.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),s.removeEventListener("mousemove",f),s.removeEventListener("touchmove",g),s.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,s,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 o=(" "+["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/o.length,w=45/6.5,_=[],v=[],y=[],x=[],E=[],b=[],M=[],C=[],k=[];var j=parseInt(o.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"),s=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),s.font="10px sans-serif",s.textAlign="center",s.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<o.length;e++)k[e]={color:W,value:o[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++)b[e]={color:H,value:g[e]};for(let e=0;e<f.length;e++)E[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),I()}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 I(){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);s.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(),o=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),s.fillStyle=k[e].color,s.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),s.fillStyle=C[e].color,s.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(o),M[e].x=v[k.length+u+e]+0+e*w*Math.cos(o),s.fillStyle=M[e].color,s.fillText(M[e].value,M[e].x,M[e].y);for(let e=0;e<b.length;e++)b[e].y=_[k.length+u+M.length+e]+0+e*w*Math.sin(n),b[e].x=v[k.length+u+M.length+e]+0+e*w*Math.cos(n),s.fillStyle=b[e].color,s.fillText(b[e].value,b[e].x,b[e].y);for(let e=0;e<E.length;e++)E[e].y=_[k.length+u+M.length+b.length+e]+0+e*w*Math.sin(i),E[e].x=v[k.length+u+M.length+b.length+e]+0+e*w*Math.cos(i),s.fillStyle=E[e].color,s.fillText(E[e].value,E[e].x,E[e].y);r=requestAnimationFrame(I)}function O(){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?O:B)()},B(),{destroy:O}},t.emojiCursor=function(e){const t=e&&e.emoji||["😀","😂","😆","😊"];let i=e&&e.element,n=i||document.body,o=window.innerWidth,s=window.innerHeight;const r={x:o/2,y:o/2},a={x:o/2,y:o/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=o,d.height=s),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){o=window.innerWidth,s=window.innerHeight,i?(d.width=n.clientWidth,d.height=n.clientHeight):(d.width=o,d.height=s)}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,o,s);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,o,s)}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,o=window.innerWidth,s=window.innerHeight;const r={x:o/2,y:o/2},a={x:o/2,y:o/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=o,h.height=s),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){o=window.innerWidth,s=window.innerHeight,i?(h.width=n.clientWidth,h.height=n.clientHeight):(h.width=o,h.height=s)}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,o,s);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,o,s)}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,o=n||document.body,s=window.innerWidth,r=window.innerHeight,a={x:s/2,y:s/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()}}(s/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",o.appendChild(t),t.width=o.clientWidth,t.height=o.clientHeight):(t.style.position="fixed",document.body.appendChild(t),t.width=s,t.height=r),o.addEventListener("mousemove",p),window.addEventListener("resize",u),g()}function u(e){s=window.innerWidth,r=window.innerHeight,n?(t.width=o.clientWidth,t.height=o.clientHeight):(t.width=s,t.height=r)}function p(e){var t;n?(t=o.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,s,r),l.moveTowards(a.x,a.y,i),requestAnimationFrame(g)}function f(){t.remove(),cancelAnimationFrame(g),o.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,o=e&&e.element,s=o||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",o?(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=r,t.height=a),s.addEventListener("mousemove",f),s.addEventListener("touchmove",g,{passive:!0}),s.addEventListener("touchstart",g,{passive:!0}),window.addEventListener("resize",p),m()}function p(e){r=window.innerWidth,a=window.innerHeight,o?(t.width=s.clientWidth,t.height=s.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;o?(t=s.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),s.removeEventListener("mousemove",f),s.removeEventListener("touchmove",g),s.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,o=n||document.body,a=window.innerWidth,l=window.innerHeight,c={x:a/2,y:a/2},h=[];const s=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",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),o.addEventListener("mousemove",m),window.addEventListener("resize",A),w()}function A(e){a=window.innerWidth,l=window.innerHeight,n?(t.width=o.clientWidth,t.height=o.clientHeight):(t.width=a,t.height=l)}function m(e){if(n){const t=o.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<s;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=[],o=c.x,s=c.y;h.forEach(function(e,t,i){t=i[t+1]||i[0];e.position.x=o,e.position.y=s,n.push({x:o,y:s}),o+=.4*(t.position.x-e.position.x),s+=.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),o.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,o,i,n=e&&e.element,s=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"),o=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),o.font="12px serif",o.textBaseline="middle",o.textAlign="center",r.forEach(e=>{var t=o.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)}),s.addEventListener("mousemove",A),s.addEventListener("touchmove",f,{passive:!0}),s.addEventListener("touchstart",f,{passive:!0}),window.addEventListener("resize",g),w()}function g(e){a=window.innerWidth,l=window.innerHeight,n?(t.width=s.clientWidth,t.height=s.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=s.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){o.clearRect(0,0,a,l);for(let e=0;e<h.length;e++)h[e].update(o);for(let e=h.length-1;0<=e;e--)h[e].lifeSpan<0&&h.splice(e,1);0==h.length&&o.clearRect(0,0,a,l)}i=requestAnimationFrame(w)}function _(){t.remove(),cancelAnimationFrame(i),s.removeEventListener("mousemove",A),s.removeEventListener("touchmove",f),s.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 o,s,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");o=document.createElement("canvas"),s=o.getContext("2d"),o.style.top="0px",o.style.left="0px",o.style.pointerEvents="none",l?(o.style.position="absolute",c.appendChild(o),o.width=c.clientWidth,o.height=c.clientHeight):(o.style.position="fixed",document.body.appendChild(o),o.width=h,o.height=d),s.font="16px serif",s.textBaseline="middle",s.textAlign="center";var e=s.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?(o.width=c.clientWidth,o.height=c.clientHeight):(o.width=h,o.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(){o.width=o.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=o.clientHeight,t=o.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(s)}n=requestAnimationFrame(w)}function i(){o.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,o,s,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"),o=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(){o.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,o.font=h,o.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,s=requestAnimationFrame(y)}function x(){t.remove(),cancelAnimationFrame(s),r.removeEventListener("mousemove",v),window.addEventListener("resize",_)}return m.onchange=()=>{(m.matches?x:w)()},w(),{destroy:x}},t.trailingCursor=function(e){let t,s,i,o=e&&e.element,r=o||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"),s=t.getContext("2d"),t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",o?(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,o?(t.width=r.clientWidth,t.height=r.clientHeight):(t.width=a,t.height=l)}function w(e){if(o){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 _(){{s.clearRect(0,0,a,l);let n=c.x,o=c.y;h.forEach(function(e,t,i){t=i[t+1]||i[0];e.position.x=n,e.position.y=o,e.move(s),n+=(t.position.x-e.position.x)*u,o+=(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 o{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={chance:10,enabled:!0}}start(){t.call(this,this.settings)}};return Object.assign(n.settings,null!=i?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 s,r=__webpack_require__(311),a=__webpack_require__.n(r);i;class l{constructor(){this.enabled=!1,this.chance=1,this.directions=["top","left","bottom","left"],this.force=.5,this.selector="[id^=pun]",this.interval=100}}function c(e){return a()(e).find("*").contents().filter((e,t)=>t.nodeType===Node.TEXT_NODE)}o;class h{constructor(){this.enabled=!0,this.chance=20,this.selector=".post-content"}}o;class d{constructor(){this.enabled=!1,this.chance=30}}o;class u{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 p{constructor(){this.enabled=!0,this.chance=20,this.selector=".pa-author a"}}o;class g{constructor(){this.enabled=!0,this.chance=20,this.selector=".post-content",this.shuffle_chance=50}}const f=__webpack_require__(442);i;(r=s=s||{}).Rainbow="rainbow",r.FairyDust="fairy_dust",r.SpringyEmoji="springy_emoji",r.Emoji="emoji",r.Ghost="ghost",r.Trailing="trailing",r.TextFlag="text_flag",r.FollowingDot="following_dot",r.Bubbles="bubbles",r.Snowflake="snowflake",r.Clock="clock";class A{constructor(){this.enabled=!0,this.chance=100,this.effects={[s.Rainbow]:new class extends m{constructor(){super(...arguments),this.length=20,this.size=3,this.colors=["#9400D3","#4B0082","#0000FF","#00FF00","#FFFF00","#FF7F00","#FF0000"]}},[s.SpringyEmoji]:new class extends m{constructor(){super(...arguments),this.emoji="🤪"}},[s.Emoji]:new class extends m{constructor(){super(...arguments),this.emoji=["🔥","🐬","🦆"]}},[s.FairyDust]:new class extends m{constructor(){super(...arguments),this.colors=["#ff0000","#00ff00","#0000ff"]}},[s.Ghost]:new m,[s.Trailing]:new class extends m{constructor(){super(...arguments),this.particles=15,this.rate=.4,this.baseImageSrc=null}},[s.TextFlag]:new class extends m{constructor(){super(...arguments),this.text="С днём смеха!",this.color="#000000",this.font="monospace",this.textSize=12,this.gap=14,this.size=3}},[s.FollowingDot]:new class extends m{constructor(){super(...arguments),this.color="#323232a6"}},[s.Bubbles]:new m,[s.Snowflake]:new class extends m{constructor(){super(...arguments),this.weight=0}},[s.Clock]:new class extends m{constructor(){super(...arguments),this.dateColor="blue",this.faceColor="black",this.secondsColor="red",this.minutesColor="black",this.hoursColor="black"}}}}}class m{constructor(){this.enabled=!0,this.weight=50}}o;class w{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:Object.assign(Object.assign({},v(!0,"жесткий,^удачливый,низкий,знакомый,откровенный,^мирный,грамотный,вкусный,виртуальный,пышный,провинциальный,$жирный,заинтересованный,объективный,^оригинальный,пожилой,чистый,особенный,выгодный,громадный,обыкновенный,чужой,ударный,^солнечный,истинный,посторонний,южный,седой,$бесполезный,острый,пестрый,формальный,повседневный,невозможный,$жалкий,целый,$глупый,последний,выходной,серьезный,подземный,небесный,любимый,былой,семейный,далекий,северный,суровый,гигантский,иностранный,родной,конструктивный,показательный,нужный,чрезвычайный,гордый,банальный,открытый,независимый,запасной,мстительный,грубый,алчный,мелочный,хладнокровный,спокойный,терпеливый,креативный,активный,адекватный,застенчивый,опрятный,безнадёжный,уверенный в себе,доброжелательный,ласковый,робкий,воспитанный,самовлюблённый,деятельный,двуличный,верный")),v(!1,"жесткая,^удачливая,низкая,знакомая,откровенная,^мирная,грамотная,вкусная,виртуальная,пышная,провинциальная,$жирная,заинтересованная,объективная,^оригинальная,пожилая,чистая,особенная,выгодная,громадная,обыкновенная,чужая,ударная,^солнечная,истинная,посторонняя,южная,седая,$бесполезная,острая,пестрая,формальная,повседневная,невозможная,$жалкая,целая,$глупая,последняя,выходная,серьезная,подземная,небесная,любимая,былая,семейная,далекая,северная,суровая,гигантская,иностранная,родная,конструктивная,показательная,нужная,чрезвычайная,гордая,банальная,открытая,независимая,запасная,мстительная,грубая,алчная,мелочная,хладнокровная,спокаяная,терпеливая,креативная,активная,адекватная,застенчивая,опрятная,безнадёжная,уверенная в себе,доброжелательная,ласковая,робкая,воспитанная,самовлюблённая,деятельная,двуличная,верная")),noun:Object.assign(Object.assign(Object.assign({},v(null,"")),v(!0,"орёл, ниндзя, манекен, пузырь, бродяга, рыцарь, кентавр, зайц, диван, наследник, сын, джентльмен, басурманин, карасик, $злоумышленник, $раб, хоббит, одиночка, отец, кролик, бруталище, дворф, актёр, %дед, спортсмен, $балбес, %мальчег, лев, ёж, организм, монах, хоббит, борец, тигр, монстр, массажист, мачо, эльф, ледник, жук, кот, зомби, проказник, дракон, носорог, волк, лесоруб, кит, %дедушка, динозавр, бард, кулак, принц, %сынок, мальчик, товарищ, ёжик, сурикат")),v(!1,"заноза, волторна, $личинка, детка, %бабушка, простуда, черепашка, мышь, волчица, деревяшка, пиранья, каруселька, красотка, леди, %дочка, орлица, принцесса, $ведьма, травка, актриса, наследница, %деффачка, горгулья, белочка, акула, машинка, конфетка, знаменитость, косточка, спортсменка, панда, мать, львица, эльфийка, $злоумышленница, чертовка, дворфиха, кошка, $рабыня, скамеечка, дочь, монашка, бактерия, рыбка, бусинка, $бабка, девочка, валькирия, килька, бабочка, милашка, крышка, тигрица, рыбка, русалочка")),verb:Object.assign(Object.assign(Object.assign({},v(null,"встаёт, снимает, приказывает, указывает, собирается, чувствует опасность, орёт, болеет, поздравляет, освобождает, поздравляет, бежит, берёт и делает, молчит, радуется, прощает, читает, снимает, снимается в фильме, что-то скрывает, думает, имеет план и придерживается его, тянет, работает, меняется, ловит, отказаться куда-то идти, заходит, замирает, оформляет, нарушает, отказывается что-то делать, шепчет, снимается в сериале, скрывается, учит, спрашивает, идёт, отказывается вставать, прибывает, отказывается, забывает, получает, плывёт, отвечает, поглядывает, говорит, просыпается, соединяет, оглядывается")),v(!0,"женится, женился, успел, не успел, смог, скрылся, заработался, познал дзен, присел, обиделся, проснулся, взял и сделал, додумался, не спал")),v(!1,"выходит замуж, вышла замуж, успела, не успела, смогла, скрылась, заработалась, познала дзен, присела, обиделась, проснулась, взяла и сделала, додумалась, не спала")),place:Object.assign({},v(null,"где-то, в пустыне, на пляже, под дождём, %под проливным дождём, в квартире, %в тёплой и уютной квартире, в космосе, в театре, в филармонии, на заснеженной вершине, на конференции, на форуме, в очереди, в лесу, в джунглях, под водой")),adv:Object.assign({},v(null,"счастливо, уныло, грустно, позже, немедленно, регулярно, вновь, опять, уже, внезапно, предсказуемо, медленно, быстро, %молниеносно, $грубо, безрассудно, осмысленно, расчётливо")),p:{"":new _({weight:10}),".":new _({weight:10}),"...":new _({weight:5}),"!":new _({weight:5}),"!!!":new _({weight:2}),"?":new _({weight:2}),"?!":new _({weight:1})}}}}class _{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 v(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 _({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=v,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 l,this.data_name="april-fools-shake"}rand(e){return e+this.settings.force*(2*Math.random()-1)}start(){this.items=a()(this.settings.selector),this.items.each((e,t)=>{let i={};this.settings.directions.forEach(e=>{i[e]=parseInt(a()(t).css("margin-"+e))}),a()(t).data(this.data_name,i)}),this.interval_id=setInterval(()=>{this.items.each((e,t)=>{var i=a()(t).data(this.data_name);for(const n of Object.entries(i))a()(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=>{a()(t).css("margin-"+e,i[e])}),a()(t).data(this.data_name,i)})}},class extends o{constructor(){super(...arguments),this.id="humanitarian_hell",this.title="Ад гуманитария",this.description='Все "тся" заменяются на "ться", а все "ться" на "тся"',this.settings=new h}processText(e){return e.replace(/(ть?ся)/g,function(e){return 0<e.indexOf("ь")?"тся":"ться"})}start(){c(this.settings.selector).each((e,t)=>{var i=a()(t).html();a()(t).html(this.processText(i))})}},class extends o{constructor(){super(...arguments),this.id="mirror",this.title="Зеркало",this.description="Элементы форума отражаются (по крайней мере, пытаются)",this.settings=new d}start(){a()(".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"'),a()(".post-links, .post-links ul, .post h3 span").css("margin-left","0"),a()(".post h3 span").css("margin-right","25em")}},class extends o{constructor(){super(...arguments),this.id="carnival",this.title="Карнавал",this.description="Аватарки приобретают интересные цвета",this.settings=new u}start(){a()(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&&a()(t).css({filter:i.join(" ")})})}},class extends o{constructor(){super(...arguments),this.id="crazy_letters",this.title="Мама, Я сОшЛа С уМа!",this.description="иМеНа ЗаБоРчИкОм",this.settings=new p}start(){a()(this.settings.selector).each((e,t)=>{var i=a()(this).text();let n="";for(let e=0;e<i.length;e++)n+=i[e][e%2?"toLowerCase":"toUpperCase"]();a()(this).text(n)})}},class extends o{constructor(){super(...arguments),this.id="letter_chaos",this.title="Буквенный хаос",this.description="Все буквы в словах, кроме первой и последней, перемешены.",this.settings=new g,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,this.shuffleLetters)}start(){c(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 A}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(s).map(e=>e),t=e.reduce((e,t)=>e+this.weight(t),0),i=Math.random()*t;let n=0;for(const o of e)if(i<=(n+=this.weight(o)))return o;throw new Error("Тебя быть тут не должно...")}start(){var e=this.getRandomEffect(),t=this.settings.effects[e];this.active_cursor_effect=function(e,t){switch(e){case s.Rainbow:return f.rainbowCursor(t);case s.FairyDust:return f.fairyDustCursor(t);case s.SpringyEmoji:return f.springyEmojiCursor(t);case s.Emoji:return f.emojiCursor(t);case s.Ghost:return f.ghostCursor(t);case s.Trailing:return f.trailingCursor(t);case s.TextFlag:return f.textFlag(t);case s.FollowingDot:return f.followingDotCursor(t);case s.Bubbles:return f.bubbleCursor(t);case s.Snowflake:return f.snowflakeCursor(t);case s.Clock:return f.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 w,this.loadedGenders=null,this.seed=0}async loadGenders(){var e=a()(".pa-author a").map((e,t)=>t.innerText).toArray().reduce((e,t)=>(e.indexOf(t)<0&&e.push(t),e),[]),e="/api.php?"+a().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(){await this.loadGenders();const n={};a()(".post-author").each((e,t)=>{var i=a()(".pa-author a",t).text();i&&(i in n||(this.resetSeed(),n[i]=this.generatePhrase(i)),a()(".pa-title",t).text(n[i]))})}prng(i,e,t){let n=3735928559^e,o=1103547991^e;for(let e=0,t;e<i.length;e++)t=i.charCodeAt(e),n=Math.imul(n^t,2654435761),o=Math.imul(o^t,1597334677);n=Math.imul(n^n>>>16,2246822507)^Math.imul(o^o>>>13,3266489909);e=4294967296*(2097151&(o=Math.imul(o^o>>>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),o=this.prng(e,this.seed++,n);let s=0;for(const r of t)if(o<=(s+=i[r]))return r;throw new Error("Тебя быть тут не должно...")}buildVariants(e,t){var i={},e=this.settings.variants[e];for(const s of Object.entries(e)){var n=s[0],o=s[1];!o.enabled||o.gender===!t||!this.settings.rude&&o.rude||(i[n]=o.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)}))}}])})()})(); |