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.e258d74f.chunk.js.map

1 lines
14 KiB

{"version":3,"sources":["Action.js","App.js","ACTWebsocket.js","serviceWorker.js","index.js"],"names":["gcdOverrides","Set","ogcdOverrides","Action","_ref","action_id","_React$useState","React","useState","_React$useState2","Object","slicedToArray","apiData","setApiData","useEffect","current","asyncToGenerator","regenerator_default","a","mark","_callee","data","wrap","_context","prev","next","fetch","concat","mode","sent","json","stop","undefined","Icon","react_default","createElement","className","has","ActionCategory","ID","src","alt","Name","App","props","_this","classCallCheck","this","possibleConstructorReturn","getPrototypeOf","call","state","me","actionlist","actionindex","lastAddedTimestamp","lastAddedAction","listenActWebSocket","callback","url","URLSearchParams","window","location","search","wsUri","get","ws","WebSocket","onerror","onmessage","e","m","send","obj","JSON","parse","msgtype","msg","code","substring","handleLogEvent","bind","assertThisInitialized","charID","setState","log","split","parseInt","action","index","setTimeout","purgeAction","slice","actions","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","Symbol","iterator","done","value","push","Action_Action","key","err","return","Component","Boolean","hostname","match","ReactDOM","render","src_App","document","getElementById","navigator","serviceWorker","ready","then","registration","unregister"],"mappings":"mUAGMA,SAAe,IAAIC,IAAI,CAC5B,MACA,MACA,MACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,KACA,SAGKC,EAAgB,IAAID,IAAI,CAC7B,KACA,IACA,MAGc,SAASE,EAATC,GAA+B,IAAbC,EAAaD,EAAbC,UAAaC,EACfC,IAAMC,WADSC,EAAAC,OAAAC,EAAA,EAAAD,CAAAJ,EAAA,GACtCM,EADsCH,EAAA,GAC7BI,EAD6BJ,EAAA,GAmB7C,OAhBAF,IAAMO,UAAU,WACf,IAAIC,GAAU,EAUd,OATKL,OAAAM,EAAA,EAAAN,CAAAO,EAAAC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,EAAD,CAAQC,IAAKjB,EAAOC,MAAOpF,UAAWmF,EAAOA,WAJnD,MAAAkB,GAAAX,GAAA,EAAAC,EAAAU,EAAA,YAAAZ,GAAA,MAAAI,EAAAS,QAAAT,EAAAS,SAAA,WAAAZ,EAAA,MAAAC,GAOR,OAAO9D,EAAAhB,EAAAiB,cAAA,OAAKC,UAAU,WAAWyD,UAhEjBtF,IAAMqG,WEOJC,QACW,cAA7BhD,OAAOC,SAASgD,UAEe,UAA7BjD,OAAOC,SAASgD,UAEhBjD,OAAOC,SAASgD,SAASC,MACvB,2DCZNC,IAASC,OAAO/E,EAAAhB,EAAAiB,cAAC+E,EAAD,MAASC,SAASC,eAAe,SD2H3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAMC,KAAK,SAAAC,GACjCA,EAAaC","file":"static/js/main.e258d74f.chunk.js","sourcesContent":["import React from 'react'\r\nimport './css/Action.css'\r\n\r\nconst gcdOverrides = new Set([\r\n\t15997, //standard step\r\n\t15998, //technical step\r\n\t15999, \r\n\t16000,\r\n\t16001,\r\n\t16002, //step actions\r\n\t16003, //standard finish\r\n\t16004, //technical finish\r\n\t16191, //single standard finish\r\n\t16192, //double standard finish (WHY IS IT LIKE THIS)\r\n\t16193, //single technical finish\r\n\t16194, //double technical finish\r\n\t16195, //triple technical finish\r\n\t16196, //quadruple technical finish\r\n\t7418, //flamethrower\r\n\t16483 //tsubame-gaeshi\r\n])\r\n\r\nconst ogcdOverrides = new Set([\r\n\t3559, //bard WM\r\n\t116, //bard AP\r\n\t114 //bard MB\r\n])\r\n\r\nexport default function Action({ action_id }) {\r\n\tconst [apiData, setApiData] = React.useState()\r\n\t\r\n\tReact.useEffect(() => {\r\n\t\tlet current = true\r\n\t\tvoid (async () => {\r\n\t\t\tconst data = await (\r\n\t\t\t\tawait fetch(`https://xivapi.com/Action/${action_id}`, { mode: 'cors' })\r\n\t\t\t).json()\r\n\t\t\tif (current) {\r\n\t\t\t\tsetApiData(data)\r\n\t\t\t}\r\n\t\t})()\r\n\r\n\t\treturn () => {\r\n\t\t\tcurrent = false\r\n\t\t}\r\n\t}, [action_id])\r\n\t\r\n\tif (apiData === undefined || !apiData.Icon) {\r\n\t\treturn null\r\n\t}\r\n\t\r\n\treturn (\r\n\t\t<img\r\n\t\t\tclassName={(gcdOverrides.has(action_id) || (!ogcdOverrides.has(action_id) && apiData.ActionCategory.ID !== 4)) ? 'action-icon gcd' : 'action-icon ogcd'}\r\n\t\t\tsrc={`https://xivapi.com/${apiData.Icon}`}\r\n\t\t\talt={apiData.Name || ''}\r\n\t\t/>\r\n\t)\r\n}\r\n","import React from 'react'\r\nimport listenActWebSocket from './ACTWebsocket'\r\nimport './css/App.css'\r\nimport Action from './Action'\r\n\r\nclass App extends React.Component {\r\n\tstate = {\r\n\t\tme: 0,\r\n\t\tactionlist: [],\r\n\t\tactionindex: 1,\r\n\t\tlastAddedTimestamp: '',\n\t\tlastAddedAction: -1,\r\n\t}\r\n\t\r\n\tconstructor(props) {\r\n\t\tsuper(props)\r\n\t\t\r\n\t\tlistenActWebSocket(this.handleLogEvent.bind(this))\r\n\t}\r\n\t\r\n\thandleLogEvent(data) {\r\n\t\tif(data.charID) {\r\n\t\t\tthis.setState({me: data.charID})\r\n\t\t\treturn\r\n\t\t} //the ME data we need\r\n\t\t\r\n\t\tconst me = this.state.me\r\n\t\t\r\n\t\tif(me === 0) return //we need data on the character first\r\n\t\t\r\n\t\tlet log = data.split('|')\r\n\t\t\r\n\t\tif(parseInt(log[2],16) !== me) return //we only care about our actions\r\n\t\t\r\n\t\tconst action = parseInt(log[4],16)\r\n\t\t\r\n\t\tif(action <= 8) return //things we don't care about i.e. sprint auto-attacks\r\n\t\t\r\n\t\tif(this.state.lastAddedTimestamp === log[1] && this.state.lastAddedAction === action) return //no double aoe stuff\r\n\t\t\r\n\t\tconst index = this.state.actionindex\r\n\t\t\r\n\t\tthis.setState((state) => {\r\n\t\t\tconst actionindex = (state.actionindex >= 32)?1:state.actionindex+1\r\n\t\t\tconst lastAddedTimestamp = log[1]\n\t\t\tconst lastAddedAction = action\r\n\t\t\tconst actionlist = state.actionlist.concat({index,action});\r\n\t\t\t\r\n\t\t\treturn {actionindex,lastAddedTimestamp,lastAddedAction,actionlist}\r\n\t\t})\r\n\t\t\r\n\t\tsetTimeout(this.purgeAction.bind(this), 10000)\r\n\t}\r\n\t\r\n\tpurgeAction() {\r\n\t\tthis.setState((state) => {\r\n\t\t\tconst actionlist = state.actionlist.slice(1)\r\n\t\t\t\r\n\t\t\treturn {actionlist}\r\n\t\t})\r\n\t}\r\n\t\r\n\trender() {\r\n\t\tlet actions = []\r\n\t\t\r\n\t\tfor (const action of this.state.actionlist) {\r\n\t\t\tactions.push(<Action key={action.index} action_id={action.action} />)\r\n\t\t}\r\n\t\t\r\n\t\treturn <div className=\"actions\">{actions}</div>\r\n\t}\r\n}\r\n\r\nexport default App;\r\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.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://bit.ly/CRA-PWA\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.1/8 is considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\nexport function register(config) {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n console.log(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl, config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.log(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl, config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl)\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (\r\n response.status === 404 ||\r\n (contentType != null && contentType.indexOf('javascript') === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister();\r\n });\r\n }\r\n}\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport './css/index.css';\r\nimport App from './App';\r\nimport * as serviceWorker from './serviceWorker';\r\n\r\nReactDOM.render(<App />, document.getElementById('root'));\r\n\r\n// If you want your app to work offline and load faster, you can change\r\n// unregister() to register() below. Note this comes with some pitfalls.\r\n// Learn more about service workers: https://bit.ly/CRA-PWA\r\nserviceWorker.unregister();\r\n"],"sourceRoot":""}