asdf-games/node_modules/budo/build/bundled-livereload-client.js

1 line
22 KiB
JavaScript
Raw Normal View History

!function(){function e(t,r,n){function o(i,s){if(!r[i]){if(!t[i]){var u="function"==typeof require&&require;if(!s&&u)return u(i,!0);if(a)return a(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var h=r[i]={exports:{}};t[i][0].call(h.exports,function(e){var r=t[i][1][e];return o(r||e)},h,h.exports,e,t,r,n)}return r[i].exports}for(var a="function"==typeof require&&require,i=0;i<n.length;i++)o(n[i]);return o}return e}()({1:[function(e,t,r){function n(){window.location.reload(!0)}var o=e("reload-css"),a=e("./error-popup");t.exports=function(){function e(){return m&&v?void console.warn("[budo] LiveReload disconnected. You may need to generate and trust a self-signed certificate, see here:\nhttps://github.com/mattdesl/budo/blob/master/docs/command-line-usage.md#ssl-on-ios"):v?void console.warn("[budo] LiveReload disconnected. Please reload the page to retry."):c>=u?void console.warn("[budo] LiveReload disconnected, exceeded retry count. Please reload the page to retry."):(h||(h=!0,console.warn("[budo] LiveReload disconnected, retrying...")),c++,clearTimeout(i),void(i=setTimeout(t,s)))}function t(){g&&(g.onclose=function(){},g.close()),g=r()}function r(){var t=v?"wss://":"ws://",r=t+d+"/livereload",i=new window.WebSocket(r);return i.onmessage=function(e){var t;try{t=JSON.parse(e.data)}catch(t){return void console.warn("Error parsing LiveReload server data: "+e.data)}"reload"===t.event?/^\.?css$/i.test(t.ext)?o(t.url):n():"error-popup"===t.event&&(t.message?a.show(t.message):a.hide()),b.forEach(function(e){e(t)})},i.onclose=function(t){1e3!==t.code&&1001!==t.code&&e()},i.onopen=function(){h&&(h=!1,c=0,console.warn("[budo] LiveReload reconnected.")),y.length&&1===i.readyState&&(y.forEach(function(e){i.send(e)}),y.length=0)},i.onerror=function(){return!1},i}var i,s=1e3,u=50,c=0,h=!1,l=document.location.protocol,f=document.location.hostname,p=document.location.port,d=f+":"+p,m=/(iOS|iPhone|iPad|iPod)/i.test(navigator.userAgent),v=/^https:/i.test(l),y=[],g=r(),b=[];return{send:function(e){e=JSON.stringify(e),g&&1===g.readyState?g.send(e):y.push(e)},listen:function(e){if("function"!=typeof e)throw new TypeError("cb must be a function!");b.push(e)},removeListener:function(e){var t=b.indexOf(e);-1!==t&&b.splice(t,1)},showError:function(e){a.show(e)},clearError:function(){a.hide()},reloadPage:n,reloadCSS:o}}(),window["budo-livereload"]=t.exports},{"./error-popup":2,"reload-css":7}],2:[function(e,t,r){function n(){var e=document.querySelector(".budo-error-handler-legacy-popup-element");e&&e.parentElement&&e.parentElement.removeChild(e)}function o(){s&&s.parentNode&&s.parentNode.removeChild(s),u&&u.parentNode&&u.parentNode.removeChild(u),s=null,u=null;var e=document.querySelector(".budo-error-handler-popup-element");e&&e.parentElement&&e.parentElement.removeChild(e),n()}function a(e){o();var t=document.createElement("div");t.className="budo-error-handler-popup-element";var r=document.createElement("pre");r.textContent=e,i(t,{position:"fixed",top:"0",left:"0",width:"100%",zIndex:"100000000",padding:"0",margin:"0","box-sizing":"border-box",background:"transparent",display:"block",overflow:"initial"}),i(r,{padding:"20px",overflow:"initial",zIndex:"100000000","box-sizing":"border-box",background:"#fff",display:"block","font-size":"12px","font-weight":"normal","font-family":"monospace","word-wrap":"break-word","white-space":"pre-wrap",color:"#ff0000",margin:"10px",border:"1px dashed hsla(0, 0%, 50%, 0.25)",borderRadius:"5px",boxShadow:"0px 10px 20px rgba(0, 0, 0, 0.2)"}),t.appendChild(r),document.body.appendChild(t),u=r,s=t}function i(e,t){for(var r in t)t.hasOwnProperty(r)&&(e.style[r]=t[r]);return t}var s,u;t.exports.hide=o,t.exports.show=a},{}],3:[function(e,t,r){(function(e){!function(n){function o(e){throw new RangeError(U[e])}function a(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function i(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),e=e.replace(k,"."),n+a(e.split("."),t).join(".")}function s(e){for(var t,r,n=[],o=0,a=e.length;o<a;)t=e.charCodeAt(o++),t>=55296&&t