!function(){function e(e){return u="https://www.nameshouts.com/api/names/"+e}function t(e,t,a){if("auto"==e){var o=new XMLHttpRequest;o.open("GET",t,!0),o.setRequestHeader("NS-API-KEY","SW27BxK23K0RQf7nOB32BxVdmXET98Au"),o.onload=function(){if(4===o.readyState)if(200===o.status){var e=JSON.parse(o.responseText).message[s[a]][0].path,t=new Audio(n+e+".mp3");t.playbackRate=.75;var r=document.getElementsByClassName("vocalizer");r[a].addEventListener("click",function(){t.play()},!1)}else console.error(o.statusText)},o.onerror=function(){console.error(o.statusText)},o.send(null)}else{var r=e,u=new Audio(r,function(){"Error!"}),c=document.getElementsByClassName("vocalizer");c[a].addEventListener("click",function(){u.play()},!1)}}for(var n="https://www.nameshouts.com/libs/media/",a=document.getElementsByClassName("vocalizer"),s=[],o=0;o<a.length;o++){var r=a[o].getAttribute("data-source");s[o]=a[o].innerHTML.toLowerCase().replace(/\W/g,"");var u=e(s[o]);t(r,u,o)}}();
!function(){function e(){var e=document.getElementsByTagName("script"),t=e.length-1,n=e[t],a=n.src;if(a){var s=document.createElement("link");s.rel="stylesheet",s.href=a.replace(".js",".css"),document.body.appendChild(s)}}function t(e){var t=u.classNameIO.exec(e);return t&&t[1]}function n(e,t,n){var a=new XMLHttpRequest;a.open("GET",e,!0),Object.keys(t).forEach(function(e){a.setRequestHeader(e,t[e])}),a.onload=function(){4===a.readyState&&(200===a.status?n(null,a.responseText):n(a.statusText))},a.onerror=function(){n(a.statusText)},a.send(null)}function a(e,t){var a=u.nameshouts.queryBase+e;n(a,{"NS-API-KEY":u.nameshouts.token},function(n,a){if(n)return t(n);var s=JSON.parse(a).message[e][0].path,o=u.nameshouts.mediaBase+s+".mp3";t(null,o)})}function s(e,t){var a=u.vocalizerIO.queryBase+e;n(a,{},function(e,n){return e?t(e):void t(null,n)})}function o(e,t){var n=new Audio(t);n.playbackRate=.75,e.addEventListener("click",function(){n.play()},!1)}function r(e,t){var n=e[0],r=e[1];if("ns"===n)a(r,function(e,n){return e?void console.log(e):void o(t,n)});else if("io"===n)s(r,function(e,n){return e?void console.log(e):void o(t,n)});else if("url"===n){var u=sourceType;o(t,u)}}var u={className:"vocalizer",classNameIO:/vocalizer-(.+)/,nameshouts:{queryBase:"https://www.nameshouts.com/api/names/",mediaBase:"https://www.nameshouts.com/libs/media/",token:"SW27BxK23K0RQf7nOB32BxVdmXET98Au"},vocalizerIO:{queryBase:"https://vocalizer.io/audio-url/"}};e();var c=document.getElementsByClassName(u.className);[].slice.call(c).forEach(function(e){var n,a=e.innerText.toLowerCase().replace(/\W/g,""),s=e.getAttribute("data-source")||"auto";if("auto"===s){var o=[].slice.call(e.classList).map(t).find(function(e){return e});n=o?["io",o]:["ns",a]}else n=["url",s];r(n,e)})}();
add vocalizer.io support