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.
1 lines
13 KiB
1 lines
13 KiB
{"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","console","log","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","charID","charName","code","substring","handleLogEvent","bind","assertThisInitialized","split","parseInt","action","index","addActionToOverlay","setTimeout","purgeAction","slice","actions","id","push","src_Action","key","Boolean","hostname","match","ReactDOM","render","src_App","document","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"qQA4CeA,cApCd,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,QAAQC,IAAIH,GAEZI,MAAMJ,EAAW,CAAEK,KAAM,SACvBC,KAAK,SAAAC,GAAQ,OAAIA,EAASC,SAC1BF,KAAK,SAAAG,GAASlB,EAAKmB,SAAS,CAACX,YAAaU,MAT1BlB,uFAalB,OAAkE,IAA9DC,OAAOmB,oBAAoBjB,KAAKI,MAAMC,aAAaa,uCAOvD,OAAqD,IAA7ClB,KAAKI,MAAMC,YAAYc,eAAeC,oCAI9C,GAAGpB,KAAKI,MAAMC,YAAYgB,KAAM,CAC/B,IAAMC,EAAUtB,KAAKuB,QAAQ,kBAAkB,mB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,EAAK6C,cACxBpD,QAAQC,IAAIM,EAAK6C,QAIlB,IAAM1B,EAAKlC,KAAKI,MAAM8B,GAEtB,GAAU,IAAPA,EAAH,CAEA,IAAIzB,EAAMM,EAAKoD,MAAM,KAErB,GAAGC,SAAS3D,EAAI,GAAG,MAAQyB,EAA3B,CAEA,IAAMmC,EAASD,SAAS3D,EAAI,GAAG,IAE/B,GAAc,IAAX4D,EAAH,CAEA,IAAMC,EAAQtE,KAAKI,MAAMgC,YAEzBpC,KAAKuE,mBAAmB,CAACD,QAAMD,WAE/BrE,KAAKgB,SAAS,SAACZ,GAGd,MAAO,CAACgC,YAFahC,EAAMgC,aAAe,GAAI,EAAEhC,EAAMgC,YAAY,KAKnEoC,WAAWxE,KAAKyE,YAAYR,KAAKjE,MAAO,8CAIxCA,KAAKgB,SAAS,SAACZ,GAGd,MAAO,CAAC+B,WAFW/B,EAAM+B,WAAWuC,MAAM,uCAO3C,IAAIC,EAAU,GAId,IAAK,IAAMC,KAFXpE,QAAQC,IAAIT,KAAKI,MAAM+B,YAENnC,KAAKI,MAAM+B,WAAY,CACvC,IAAMkC,EAASrE,KAAKI,MAAM+B,WAAWyC,GACrCD,EAAQE,KAAKpD,EAAAC,EAAAC,cAACmD,EAAD,CAAQC,IAAKV,EAAOC,MAAO/D,UAAW8D,EAAOA,UAG3D,OAAO5C,EAAAC,EAAAC,cAAA,OAAKC,UAAU,WAAW+C,UAvEjB5C,IAAMC,WEOJgD,QACW,cAA7BvC,OAAOC,SAASuC,UAEe,UAA7BxC,OAAOC,SAASuC,UAEhBxC,OAAOC,SAASuC,SAASC,MACvB,2DCZNC,IAASC,OAAO3D,EAAAC,EAAAC,cAAC0D,EAAD,MAASC,SAASC,eAAe,SD2H3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAM9E,KAAK,SAAA+E,GACjCA,EAAaC","file":"static/js/main.2e1acc3f.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\tconsole.log(actionUrl)\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 <img className={classes} src={img} alt='' />\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\tconsole.log(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 === 7) return //auto-attack\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(<Action key={action.index} action_id={action.action} />)\n\t\t}\n\t\t\n\t\treturn <div className=\"actions\">{actions}</div>\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\tconsole.log(obj.msg.charID)\r\n\t\t\tconsole.log(obj.msg.charName)\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(<App />, 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":""} |