{"version":3,"sources":["Action.js","App.js","ACTWebsocket.js","serviceWorker.js","index.js"],"names":["Action","props","_this","Object","classCallCheck","this","possibleConstructorReturn","getPrototypeOf","call","state","xivapi_data","actionUrl","action_id","fetch","mode","then","response","json","data","setState","getOwnPropertyNames","length","ActionCategory","ID","Icon","classes","isGCD","img","react_default","a","createElement","className","src","alt","React","Component","App","me","actionlist","actionindex","listenActWebSocket","callback","url","URLSearchParams","window","location","search","wsUri","concat","get","undefined","ws","WebSocket","onerror","onmessage","e","m","send","obj","JSON","parse","msgtype","msg","code","substring","handleLogEvent","bind","assertThisInitialized","charID","log","split","parseInt","action","index","addActionToOverlay","setTimeout","purgeAction","slice","actions","id","console","push","src_Action","key","Boolean","hostname","match","ReactDOM","render","src_App","document","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"qQA0CeA,cAlCd,SAAAA,EAAYC,GAAO,IAAAC,EAAAC,OAAAC,EAAA,EAAAD,CAAAE,KAAAL,IAClBE,EAAAC,OAAAG,EAAA,EAAAH,CAAAE,KAAAF,OAAAI,EAAA,EAAAJ,CAAAH,GAAAQ,KAAAH,KAAMJ,KALPQ,MAAQ,CACPC,YAAa,IAMb,IAAMC,EAAY,6BAA6BV,EAAMW,UAHnC,OAKlBC,MAAMF,EAAW,CAAEG,KAAM,SACvBC,KAAK,SAAAC,GAAQ,OAAIA,EAASC,SAC1BF,KAAK,SAAAG,GAAShB,EAAKiB,SAAS,CAACT,YAAaQ,MAP1BhB,uFAWlB,OAAkE,IAA9DC,OAAOiB,oBAAoBf,KAAKI,MAAMC,aAAaW,uCAOvD,OAAqD,IAA7ChB,KAAKI,MAAMC,YAAYY,eAAeC,oCAI9C,GAAGlB,KAAKI,MAAMC,YAAYc,KAAM,CAC/B,IAAMC,EAAUpB,KAAKqB,QAAQ,kBAAkB,mBACzCC,EAAM,qBAAqBtB,KAAKI,MAAMC,YAAYc,KACxD,OAAOI,EAAAC,EAAAC,cAAA,OAAKC,UAAWN,EAASO,IAAKL,E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,EAAI,GAAG,IAE/B,KAAGG,GAAU,GAAb,CAEA,IAAMC,EAAQpE,KAAKI,MAAM8B,YAEzBlC,KAAKqE,mBAAmB,CAACD,QAAMD,WAE/BnE,KAAKc,SAAS,SAACV,GAGd,MAAO,CAAC8B,YAFa9B,EAAM8B,aAAe,GAAI,EAAE9B,EAAM8B,YAAY,KAKnEoC,WAAWtE,KAAKuE,YAAYV,KAAK7D,MAAO,+CAIxCA,KAAKc,SAAS,SAACV,GAGd,MAAO,CAAC6B,WAFW7B,EAAM6B,WAAWuC,MAAM,uCAO3C,IAAIC,EAAU,GAId,IAAK,IAAMC,KAFXC,QAAQX,IAAIhE,KAAKI,MAAM6B,YAENjC,KAAKI,MAAM6B,WAAY,CACvC,IAAMkC,EAASnE,KAAKI,MAAM6B,WAAWyC,GACrCD,EAAQG,KAAKrD,EAAAC,EAAAC,cAACoD,EAAD,CAAQC,IAAKX,EAAOC,MAAO7D,UAAW4D,EAAOA,UAG3D,OAAO5C,EAAAC,EAAAC,cAAA,OAAKC,UAAU,WAAW+C,UAtEjB5C,IAAMC,WEOJiD,QACW,cAA7BxC,OAAOC,SAASwC,UAEe,UAA7BzC,OAAOC,SAASwC,UAEhBzC,OAAOC,SAASwC,SAASC,MACvB,2DCZNC,IAASC,OAAO5D,EAAAC,EAAAC,cAAC2D,EAAD,MAASC,SAASC,eAAe,SD2H3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAM/E,KAAK,SAAAgF,GACjCA,EAAaC","file":"static/js/main.5483062e.chunk.js","sourcesContent":["import React from 'react'\r\nimport './css/Action.css'\r\n\r\nclass Action extends React.Component {\r\n\tstate = {\r\n\t\txivapi_data: []\r\n\t}\r\n\t\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t\t\r\n\t\tconst actionUrl = \"https://xivapi.com/Action/\"+props.action_id;\r\n\t\t\r\n\t\tfetch(actionUrl, { mode: 'cors' })\r\n\t\t\t.then(response => response.json())\r\n\t\t\t.then(data => {this.setState({xivapi_data: data})})\r\n\t}\r\n\t\r\n\tshouldComponentUpdate() {\r\n\t\tif (Object.getOwnPropertyNames(this.state.xivapi_data).length === 0) {\r\n\t\t\treturn false\r\n\t\t}\r\n\t\treturn true\r\n\t}\r\n\t\r\n\tisGCD() {\r\n\t\treturn (this.state.xivapi_data.ActionCategory.ID !== 4)\r\n\t}\r\n\t\r\n\trender() {\r\n\t\tif(this.state.xivapi_data.Icon) {\r\n\t\t\tconst classes = this.isGCD()?'action-icon gcd':'action-icon ogcd'\r\n\t\t\tconst img = \"https://xivapi.com\"+this.state.xivapi_data.Icon\r\n\t\t\treturn \r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null\r\n\t\t}\r\n }\r\n}\r\n\r\nexport default Action","import React from 'react'\nimport listenActWebSocket from './ACTWebsocket'\nimport './css/App.css'\nimport Action from './Action'\n\nclass App extends React.Component {\n\tstate = {\n\t\tme: 0,\n\t\tactionlist: [],\n\t\tactionindex: 1\n\t}\n\t\n\tconstructor(props) {\n\t\tsuper(props)\n\t\t\n\t\tlistenActWebSocket(this.handleLogEvent.bind(this))\n\t}\n\t\n\taddActionToOverlay(action_id) {\n\t\tthis.setState((state) => {\n\t\t\tconst actionlist = state.actionlist.concat(action_id);\n\t\t\n\t\t\treturn {actionlist}\n\t\t})\n\t}\n\t\n\thandleLogEvent(data) {\n\t\tif(data.charID) {\n\t\t\tthis.setState({me: data.charID})\n\t\t\treturn\n\t\t} //the ME data we need\n\t\t\n\t\tconst me = this.state.me\n\t\t\n\t\tif(me === 0) return //we need data on the character first\n\t\t\n\t\tlet log = data.split('|')\n\t\t\n\t\tif(parseInt(log[2],16) !== me) return //we only care about our actions\n\t\t\n\t\tconst action = parseInt(log[4],16)\n\t\t\n\t\tif(action <= 8) return //things we don't care about\n\t\t\n\t\tconst index = this.state.actionindex\n\t\t\n\t\tthis.addActionToOverlay({index,action})\n\t\t\n\t\tthis.setState((state) => {\n\t\t\tconst actionindex = (state.actionindex >= 32)?1:state.actionindex+1\n\t\t\t\n\t\t\treturn {actionindex}\n\t\t})\n\t\t\n\t\tsetTimeout(this.purgeAction.bind(this), 10000)\n\t}\n\t\n\tpurgeAction() {\n\t\tthis.setState((state) => {\n\t\t\tconst actionlist = state.actionlist.slice(1)\n\t\t\t\n\t\t\treturn {actionlist}\n\t\t})\n\t}\n\t\n\trender() {\n\t\tlet actions = []\n\t\t\n\t\tconsole.log(this.state.actionlist)\n\t\t\n\t\tfor (const id in this.state.actionlist) {\n\t\t\tconst action = this.state.actionlist[id]\n\t\t\tactions.push()\n\t\t}\n\t\t\n\t\treturn
{actions}
\n\t}\n}\n\nexport default App;\n","export default function listenActWebSocket(callback) {\r\n\tconst url = new URLSearchParams(window.location.search)\r\n\tconst wsUri = `${url.get('HOST_PORT')}BeforeLogLineRead` || undefined\r\n\tconst ws = new WebSocket(wsUri)\r\n\tws.onerror = () => listenActWebSocket()\r\n\tws.onmessage = function (e, m) { //PING\r\n\t\tif (e.data === '.') return ws.send('.') //PONG\r\n\t\t\r\n\t\tconst obj = JSON.parse(e.data)\r\n\t\tif(obj.msgtype === 'SendCharName')\r\n\t\t{\r\n\t\t\treturn callback(obj.msg)\r\n\t\t}\r\n\t\telse if(obj.msgtype === 'Chat')\r\n\t\t{\r\n\t\t\tconst code = obj.msg.substring(0, 2) //first 2 numbers POG\r\n\r\n\t\t\tif(code === '21' || code === '22') return callback(obj.msg) //NetworkAbility or NetworkAoeAbility\r\n\t\t}\r\n\t}\r\n}","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './css/index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}