Test Branch for this ACTWebSocket overlay updated for EW release. See below for the temporary link until the main project is updated:
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
SkillDisplay/static/js/main.330ea6cd.chunk.js

2 lines
3.1 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{15:function(t,e,n){},16:function(t,e,n){},17:function(t,e,n){},18:function(t,e,n){"use strict";n.r(e);var a=n(0),i=n.n(a),o=n(8),r=n.n(o),c=(n(15),n(1)),s=n(2),u=n(5),d=n(4),l=n(3),h=n(6);n(16),n(17);var f=[15997,15998,15999,16e3,16001,16002,16003,16004,16191,16192,16193,16194,16195,16196,7418,16483],m=[3559,116,114],v=function(t){function e(t){var n;Object(c.a)(this,e),(n=Object(u.a)(this,Object(d.a)(e).call(this,t))).state={xivapi_data:[]};var a="https://xivapi.com/Action/"+t.action_id;return fetch(a,{mode:"cors"}).then(function(t){return t.json()}).then(function(t){n.setState({xivapi_data:t})}),n}return Object(h.a)(e,t),Object(s.a)(e,[{key:"isGCD",value:function(){return-1!==f.indexOf(this.props.action_id)||-1===m.indexOf(this.props.action_id)&&4!==this.state.xivapi_data.ActionCategory.ID}},{key:"render",value:function(){if(this.state.xivapi_data.Icon){var t=this.isGCD()?"action-icon gcd":"action-icon ogcd",e="https://xivapi.com"+this.state.xivapi_data.Icon;return i.a.createElement("img",{className:t,src:e,alt:""})}return null}}]),e}(i.a.Component),p=function(t){function e(t){var n;return Object(c.a)(this,e),(n=Object(u.a)(this,Object(d.a)(e).call(this,t))).state={me:0,actionlist:[],actionindex:1,lastAddedTimestamp:""},function t(e){var n=new URLSearchParams(window.location.search),a="".concat(n.get("HOST_PORT"),"BeforeLogLineRead")||!1,i=new WebSocket(a);i.onerror=function(){return t()},i.onmessage=function(t,n){if("."===t.data)return i.send(".");var a=JSON.parse(t.data);if("SendCharName"===a.msgtype)return e(a.msg);if("Chat"===a.msgtype){var o=a.msg.substring(0,2);if("21"===o||"22"===o)return e(a.msg)}}}(n.handleLogEvent.bind(Object(l.a)(n))),n}return Object(h.a)(e,t),Object(s.a)(e,[{key:"handleLogEvent",value:function(t){if(t.charID)this.setState({me:t.charID});else{var e=this.state.me;if(0!==e){var n=t.split("|");if(parseInt(n[2],16)===e){var a=parseInt(n[4],16);if(!(a<=8)&&this.state.lastAddedTimestamp!==n[1]){var i=this.state.actionindex;this.setState(function(t){return{actionindex:t.actionindex>=32?1:t.actionindex+1,lastAddedTimestamp:n[1],actionlist:t.actionlist.concat({index:i,action:a})}}),setTimeout(this.purgeAction.bind(this),1e4)}}}}}},{key:"purgeAction",value:function(){this.setState(function(t){return{actionlist:t.actionlist.slice(1)}})}},{key:"render",value:function(){var t=[],e=!0,n=!1,a=void 0;try{for(var o,r=this.state.actionlist[Symbol.iterator]();!(e=(o=r.next()).done);e=!0){var c=o.value;t.push(i.a.createElement(v,{key:c.index,action_id:c.action}))}}catch(s){n=!0,a=s}finally{try{e||null==r.return||r.return()}finally{if(n)throw a}}return i.a.createElement("div",{className:"actions"},t)}}]),e}(i.a.Component);Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));r.a.render(i.a.createElement(p,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(function(t){t.unregister()})},9:function(t,e,n){t.exports=n(18)}},[[9,1,2]]]);
//# sourceMappingURL=main.330ea6cd.chunk.js.map