(function(){"use strict";var e={970:function(e,t,a){var n=a(9242),o=a(3396);function r(e,t,a,n,r,i){const s=(0,o.up)("AppHeader"),c=(0,o.up)("router-view"),l=(0,o.up)("AppFooter");return(0,o.wg)(),(0,o.iD)(o.HY,null,[(0,o.Wm)(s),(0,o.Wm)(c),(0,o.Wm)(l)],64)}const i={class:"header"},s={class:"header-wrapper container"},c=(0,o._)("div",{class:"logo-wrapper"},[(0,o._)("span",{class:"logo-wrapper__logo",translate:"no"},"Wavelovers")],-1),l={class:"menu-wrapper"},d={class:"navigation"},v={class:"navigation__item"},u=(0,o.Uk)("Home"),p={class:"navigation__item"},m=(0,o.Uk)("FAQ"),h={class:"navigation__item"},g=(0,o.Uk)("About"),f={class:"navigation__item"},b=(0,o.Uk)("Donate");function w(e,t,a,n,r,w){const W=(0,o.up)("router-link");return(0,o.wg)(),(0,o.iD)("header",i,[(0,o._)("div",s,[c,(0,o._)("nav",l,[(0,o._)("ul",d,[(0,o._)("li",v,[(0,o.Wm)(W,{to:"/",class:"navigation__link"},{default:(0,o.w5)((()=>[u])),_:1})]),(0,o._)("li",p,[(0,o.Wm)(W,{to:"/faq",class:"navigation__link"},{default:(0,o.w5)((()=>[m])),_:1})]),(0,o._)("li",h,[(0,o.Wm)(W,{to:"/about",class:"navigation__link"},{default:(0,o.w5)((()=>[g])),_:1})]),(0,o._)("li",f,[(0,o.Wm)(W,{to:"/donate",class:"navigation__link"},{default:(0,o.w5)((()=>[b])),_:1})])])])])])}var W=(0,o.aZ)({name:"AppHeader"}),y=a(89);const _=(0,y.Z)(W,[["render",w]]);var k=_;const V={class:"footer"},A=(0,o.uE)('',1),T=[A];function P(e,t,a,n,r,i){return(0,o.wg)(),(0,o.iD)("footer",V,T)}var G=(0,o.aZ)({name:"AppFooter"});const D=(0,y.Z)(G,[["render",P]]);var j=D,Z=(0,o.aZ)({name:"App",components:{AppHeader:k,AppFooter:j}});const x=(0,y.Z)(Z,[["render",r]]);var C=x,M=a(2483);const E={class:"page container"},L=(0,o._)("h1",{class:"visually-hidden"},"Wavelovers",-1);function O(e,t,a,n,r,i){const s=(0,o.up)("WaveloversApp");return(0,o.wg)(),(0,o.iD)("main",E,[L,(0,o.Wm)(s)])}const S={class:"wavelovers"},q=(0,o.Uk)("Loading..."),F=(0,o.Uk)("Press any gamepad's button or connect new gamepad.");function I(e,t,a,n,r,i){const s=(0,o.up)("PatternList"),c=(0,o.up)("MessageItem"),l=(0,o.up)("GamepadList");return(0,o.wg)(),(0,o.iD)("div",S,[e.patterns.length>0?((0,o.wg)(),(0,o.j4)(s,{key:0,patterns:e.patterns,mode:e.mode,isActive:e.isActive,onChange:e.change},null,8,["patterns","mode","isActive","onChange"])):((0,o.wg)(),(0,o.j4)(c,{key:1},{default:(0,o.w5)((()=>[q])),_:1})),e.gamepads.length>0?((0,o.wg)(),(0,o.j4)(l,{key:2,gamepads:e.gamepads},null,8,["gamepads"])):((0,o.wg)(),(0,o.j4)(c,{key:3},{default:(0,o.w5)((()=>[F])),_:1}))])}const N={class:"pattern-list"};function U(e,t,a,n,r,i){const s=(0,o.up)("PatternItem");return(0,o.wg)(),(0,o.iD)("div",N,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(e.patterns,((t,a)=>((0,o.wg)(),(0,o.j4)(s,{key:t.name,pattern:t,index:a,mode:e.mode,isActive:e.isActive,onChange:e.change},null,8,["pattern","index","mode","isActive","onChange"])))),128))])}var z=a(7139);const H=["textContent"],Q=["textContent"];function R(e,t,a,n,r,i){return(0,o.wg)(),(0,o.iD)("div",{onClick:t[0]||(t[0]=t=>e.change(e.index)),class:(0,z.C_)(["pattern-item",e.index===e.mode&&!0===e.isActive?"pattern-item_selected":""])},[(0,o._)("span",{class:"pattern-item__icon",textContent:(0,z.zw)(e.pattern.icon)},null,8,H),(0,o._)("span",{class:"pattern-item__name",textContent:(0,z.zw)(e.pattern.name)},null,8,Q)],2)}var B=(0,o.aZ)({name:"PatternItem",props:{pattern:{type:Object},index:{type:Number},mode:{type:Number},isActive:{type:Boolean}},methods:{change(e){this.$emit("change",e)}}});const Y=(0,y.Z)(B,[["render",R]]);var $=Y,K=(0,o.aZ)({name:"PatternList",props:{patterns:{type:Array},mode:{type:Number},isActive:{type:Boolean}},components:{PatternItem:$},methods:{change(e){this.$emit("change",e)}}});const J=(0,y.Z)(K,[["render",U]]);var X=J;const ee={class:"device-list"};function te(e,t,a,n,r,i){const s=(0,o.up)("GamepadItem");return(0,o.wg)(),(0,o.iD)("div",ee,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(e.gamepads,(e=>((0,o.wg)(),(0,o.j4)(s,{key:e.id,textContent:(0,z.zw)(e.unit.id)},null,8,["textContent"])))),128))])}const ae={class:"list-item"};function ne(e,t,a,n,r,i){return(0,o.wg)(),(0,o.iD)("div",ae)}var oe=(0,o.aZ)({name:"GamepadItem"});const re=(0,y.Z)(oe,[["render",ne]]);var ie=re,se=(0,o.aZ)({name:"GamepadList",props:{gamepads:{type:Array}},components:{GamepadItem:ie}});const ce=(0,y.Z)(se,[["render",te]]);var le=ce;const de={class:"message"};function ve(e,t,a,n,r,i){return(0,o.wg)(),(0,o.iD)("div",de,[(0,o._)("span",null,[(0,o.WI)(e.$slots,"default")])])}var ue=(0,o.aZ)({name:"MessageItem"});const pe=(0,y.Z)(ue,[["render",ve]]);var me=pe,he=a(2482);class ge{constructor(e){(0,he.Z)(this,"id",void 0),(0,he.Z)(this,"canVibrate",void 0),(0,he.Z)(this,"isVibrating",void 0),(0,he.Z)(this,"unit",void 0),(0,he.Z)(this,"pattern",void 0),this.unit=e,this.id=Date.now(),this.canVibrate=!!this.unit.vibrationActuator,this.isVibrating=!1,this.pattern=[]}update(){const e=navigator.getGamepads();this.unit=e[this.unit.index]}reset(){this.isVibrating=!1,this.unit.vibrationActuator.reset()}async vibrate(e){this.isVibrating=!0,this.pattern=e;while(!0===this.isVibrating)for(let e=0;esetTimeout(t,e)))}}var fe=(0,o.aZ)({name:"WaveloversApp",components:{PatternList:X,GamepadList:le,MessageItem:me},data:()=>({gamepads:[],patterns:[],isActive:!1,mode:0}),methods:{loadPatterns:async function(){const e="https://wavelovers.ru/assets/patterns.json";try{const t=await fetch(e);if(t.ok){let e=await t.json();this.patterns=e}else console.log("Connect to the Internet for download more patterns...")}catch(t){console.log(t)}},addEventListeners(){window.addEventListener("gamepadconnected",(e=>this.addGamepad(e))),window.addEventListener("gamepaddisconnected",(e=>this.deleteGamepad(e)))},addGamepad(e){const t=e;this.gamepads.length>=1||this.gamepads.push(new ge(t.gamepad))},deleteGamepad(e){this.gamepads.forEach(((t,a)=>{t.unit.id===e.gamepad.id&&this.gamepads.splice(a,1)}))},change(e){this.mode===e?(this.isActive=!this.isActive,this.reset()):(this.isActive=!0,this.mode=e),!0===this.isActive&&(this.reset(),this.vibrate())},vibrate(){this.gamepads.forEach((e=>{e.vibrate(this.patterns[this.mode].pattern)}))},reset(){this.gamepads.forEach((e=>{e.reset()}))}},mounted(){this.loadPatterns(),this.addEventListeners()}});const be=(0,y.Z)(fe,[["render",I]]);var we=be,We=(0,o.aZ)({name:"HomeView",components:{WaveloversApp:we}});const ye=(0,y.Z)(We,[["render",O]]);var _e=ye;function ke(e,t){e.map((e=>{const a=document.createElement(t);return Object.keys(e).forEach((t=>{a.setAttribute(t,e[t])})),a.setAttribute("data-vue-router-controlled",""),a})).forEach((e=>document.head.appendChild(e)))}function Ve(e,t,a){const n=e.matched.slice().reverse().find((e=>e.meta&&e.meta.title)),o=e.matched.slice().reverse().find((e=>e.meta&&e.meta.metaTags&&e.meta.linkTags));if(n&&(document.title=n.meta.title),Array.from(document.querySelectorAll("[data-vue-router-controlled]")).map((e=>{e.parentNode&&e.parentNode.removeChild(e)})),!o)return a();const r=o.meta.linkTags,i=o.meta.metaTags;return ke(r,"link"),ke(i,"meta"),a()}const Ae={update:Ve};var Te=Ae;const Pe=[{path:"/",name:"home",component:_e,meta:{title:"Wavelovers",metaTags:[{name:"description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона"},{name:"og:title",content:"Wavelovers"},{name:"og:description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."},{name:"og:url",content:"https://wavelovers.ru/"},{name:"twitter:title",content:"Wavelovers"},{name:"twitter:description",content:"Wavelovers. Use your device vibration correctly. Make a massager out of a gamepad."}],linkTags:[{name:"canonical",href:"https://wavelovers.ru/"}]}},{path:"/about",name:"about",component:()=>a.e(548).then(a.bind(a,2548)),meta:{title:"Wavelovers – About",metaTags:[{name:"description",content:"Wavelovers. Page with information about the project and data on donations."},{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, advertise, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, реклама"},{name:"og:title",content:"Wavelovers – About"},{name:"og:description",content:"Wavelovers. Page with information about the project and data on donations."},{name:"og:url",content:"https://wavelovers.ru/about"},{name:"twitter:title",content:"Wavelovers – About"},{name:"twitter:description",content:"Wavelovers. Page with information about the project and data on donations."}],linkTags:[{name:"canonical",href:"https://wavelovers.ru/about"}]}},{path:"/faq",name:"faq",component:()=>a.e(877).then(a.bind(a,877)),meta:{title:"Wavelovers – FAQ",metaTags:[{name:"description",content:"Wavelovers. Frequently asked questions page."},{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, FAQ, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, часто задаваемые вопросы"},{name:"og:title",content:"Wavelovers – FAQ"},{name:"og:description",content:"Wavelovers. Frequently asked questions page."},{name:"og:url",content:"https://wavelovers.ru/faq"},{name:"twitter:title",content:"Wavelovers – FAQ"},{name:"twitter:description",content:"Wavelovers. Frequently asked questions page."}],linkTags:[{name:"canonical",href:"https://wavelovers.ru/faq"}]}},{path:"/donate",name:"donate",component:()=>a.e(93).then(a.bind(a,93)),meta:{title:"Wavelovers – Donate",metaTags:[{name:"description",content:"Wavelovers. Donate to the author."},{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, Donate, Support, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, задонатить, пожертвовать, помочь, поблагодарить"},{name:"og:title",content:"Wavelovers – Donate"},{name:"og:description",content:"Wavelovers. Donate to the author."},{name:"og:url",content:"https://wavelovers.ru/donate"},{name:"twitter:title",content:"Wavelovers – Donate"},{name:"twitter:description",content:"Wavelovers. Donate to the author."}],linkTags:[{name:"canonical",href:"https://wavelovers.ru/donate"}]}},{path:"/404",name:"404",component:()=>a.e(437).then(a.bind(a,437)),meta:{title:"Wavelovers – 404 Page not found",metaTags:[{name:"description",content:"Wavelovers. Donate to the author."},{name:"keywords",content:"Wavelovers, Wave Lovers, Wavemaster, Wave Master, Vibration Master, Vibration, Gamepad, Gamepad Vibration, Vibrate Gamepad, Phone Vibration, Gamepad Tester, Phone Vibration Tester, Vibration Tester, Massager, Vibrator, Satisfyer, Womanizer, Relax, Donate, Support, геймпад, джойстик, вибратор, вибромассажер, вибро, вибромассажёр из геймпада, тестер вибрации геймпада, тестер вибрации телефона, задонатить, пожертвовать, помочь, поблагодарить"},{name:"og:title",content:"Wavelovers – 404 Page not found"},{name:"og:description",content:"Wavelovers. Donate to the author."},{name:"og:url",content:"https://wavelovers.ru/404"},{name:"twitter:title",content:"Wavelovers – 404 Page not found"},{name:"twitter:description",content:"Wavelovers. Donate to the author."}],linkTags:[{name:"canonical",href:"https://wavelovers.ru/404"}]}},{path:"/:catchAll(.*)",redirect:"/404"}],Ge=(0,M.p7)({history:(0,M.PO)("/"),routes:Pe});Ge.beforeEach(Te.update);var De=Ge;(0,n.ri)(C).use(De).mount("#app")}},t={};function a(n){var o=t[n];if(void 0!==o)return o.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,a),r.exports}a.m=e,function(){var e=[];a.O=function(t,n,o,r){if(!n){var i=1/0;for(d=0;d=r)&&Object.keys(a.O).every((function(e){return a.O[e](n[c])}))?n.splice(c--,1):(s=!1,r0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[n,o,r]}}(),function(){a.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return a.d(t,{a:t}),t}}(),function(){a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}}(),function(){a.f={},a.e=function(e){return Promise.all(Object.keys(a.f).reduce((function(t,n){return a.f[n](e,t),t}),[]))}}(),function(){a.u=function(e){return"js/"+e+"."+{93:"22832789",437:"c8edb1d9",548:"8603e4a4",877:"a8dd8d41"}[e]+".js"}}(),function(){a.miniCssF=function(e){}}(),function(){a.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="wavelovers:";a.l=function(n,o,r,i){if(e[n])e[n].push(o);else{var s,c;if(void 0!==r)for(var l=document.getElementsByTagName("script"),d=0;d