![shirito](/assets/img/avatar_default.png)
Hello, I'm adding the whole https://items.sp-tarkov.com code base as well as the drone pipeline to deploy it. Please **double check *thoroughly* every** to ensure it matches the server architecture and configuration. Reviewed-on: SPT-AKI/Website#9 Co-authored-by: shirito <shirito@noreply.dev.sp-tarkov.com> Co-committed-by: shirito <shirito@noreply.dev.sp-tarkov.com>
2 lines
17 KiB
JavaScript
2 lines
17 KiB
JavaScript
(this["webpackJsonpnew-item-finder-website"]=this["webpackJsonpnew-item-finder-website"]||[]).push([[0],{126:function(e,t,r){"use strict";r.r(t);var n,a=r(0),c=r.n(a),o=r(37),i=r.n(o),s=r(9),l=r(206),u=r(197),d=r(198),f=r(191),p=r(2),h=Object(f.a)((function(e){return{footerHolder:{display:"flex",flex:"0 1 3vh",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:"0 10vw 0 10vw"}}})),m=function(){var e=h();return Object(p.jsx)(u.a,{className:e.footerHolder,children:Object(p.jsx)(d.a,{children:"SPT-Aki \xa92021 Created by Rev and Shirito"})})},b=r(204),j=r(199),O=r(31),x=r(96),v=r.n(x),E=r(95),g=r.n(E);!function(e){e.LIGHT_MODE="light",e.DARK_MODE="dark"}(n||(n={}));var w,_=r(15),k=r.n(_),y=r(23),C=r(94),S=r.n(C),D=function(){var e=Object(y.a)(k.a.mark((function e(t,r){var n;return k.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat("http://ec2-54-95-229-197.ap-northeast-1.compute.amazonaws.com/","/api/search"),{mode:"cors",method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(r?{query:t,locale:r}:{query:t})});case 2:if(200!==(n=e.sent).status){e.next=9;break}return e.next=6,n.json();case 6:return e.abrupt("return",e.sent.items);case 9:n.status>=400&&console.error(n);case 10:return e.abrupt("return",[]);case 11:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),I=function(){var e=Object(y.a)(k.a.mark((function e(t,r){var n,a;return k.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat("http://ec2-54-95-229-197.ap-northeast-1.compute.amazonaws.com/","/api/item?id=").concat(t),r&&(n="".concat(n,"&locale=").concat(r)),e.next=4,fetch(n,{mode:"cors"});case 4:if(200!==(a=e.sent).status){e.next=11;break}return e.next=8,a.json();case 8:return e.abrupt("return",e.sent);case 11:a.status>=400&&console.error(a);case 12:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),R=function(){var e=Object(y.a)(k.a.mark((function e(t,r){var n,a;return k.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat("http://ec2-54-95-229-197.ap-northeast-1.compute.amazonaws.com/","/api/item/hierarchy?id=").concat(t),r&&(n="".concat(n,"&locale=").concat(r)),e.next=4,fetch(n,{mode:"cors"});case 4:if(200!==(a=e.sent).status){e.next=11;break}return e.next=8,a.json();case 8:return e.abrupt("return",e.sent);case 11:a.status>=400&&console.error(a);case 12:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),N=function(){var e=Object(y.a)(k.a.mark((function e(){var t;return k.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat("http://ec2-54-95-229-197.ap-northeast-1.compute.amazonaws.com/","/api/locales"),{mode:"cors"});case 2:if(200!==(t=e.sent).status){e.next=9;break}return e.next=6,t.json();case 6:return e.abrupt("return",e.sent);case 9:t.status>=400&&console.error(t);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();!function(e){e.PREFERED_COLOR_SCHEME="items.sp-tarkov.com-prefered-color-scheme",e.PREFERED_JSON_THEME="items.sp-tarkov.com-prefered-json-theme",e.PREFERED_LOCALE="items.sp-tarkov.com-prefered-locale"}(w||(w={}));var H=["apathy","apathy:inverted","ashes","bespin","brewer","bright:inverted","bright","chalk","codeschool","colors","eighties","embers","flat","google","grayscale","grayscale:inverted","greenscreen","harmonic","hopscotch","isotope","marrakesh","mocha","monokai","ocean","paraiso","pop","railscasts","rjv-default","shapeshifter","shapeshifter:inverted","solarized","summerfruit","summerfruit:inverted","threezerotwofour","tomorrow","tube","twilight"],T=localStorage.getItem(w.PREFERED_LOCALE),L=localStorage.getItem(w.PREFERED_JSON_THEME),P=localStorage.getItem(w.PREFERED_COLOR_SCHEME),A=S()((function(e){return{preferedLocale:T||"en",setPreferedLocale:function(t){localStorage.setItem(w.PREFERED_LOCALE,t),e((function(e){return{preferedLocale:t}}))},localesList:[],refreshLocalesList:function(){var t=Object(y.a)(k.a.mark((function t(){var r;return k.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,N();case 2:r=t.sent,e((function(e){return{localesList:r||[]}}));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),preferedJsonViewerTheme:L&&H.includes(L)?L:H[0],setPreferedJsonViewerTheme:function(t){localStorage.setItem(w.PREFERED_JSON_THEME,t),e((function(e){return{preferedJsonViewerTheme:t}}))},preferedColorScheme:P||n.DARK_MODE,setPreferedColorScheme:function(t){localStorage.setItem(w.PREFERED_COLOR_SCHEME,t),e((function(e){return{preferedColorScheme:t}}))},searchInput:"",setSearchInput:function(t){return e((function(e){return{searchInput:t}}))},desiredSearchInput:"",setDesiredSearchInput:function(t){return e((function(e){return{desiredSearchInput:t}}))},itemHierarchy:{},setHierarchy:function(t){return e((function(e){return{itemHierarchy:t}}))},selectedItem:Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_BACKEND_URL:"http://ec2-54-95-229-197.ap-northeast-1.compute.amazonaws.com/"}).REACT_APP_SEARCH_FAKE_DATA?JSON.parse(Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_BACKEND_URL:"http://ec2-54-95-229-197.ap-northeast-1.compute.amazonaws.com/"}).REACT_APP_SEARCH_FAKE_DATA):void 0,setSelectedItem:function(t){return e((function(e){return{selectedItem:t}}))}}})),M=Object(f.a)((function(e){return{buttonHolder:{display:"flex",alignItems:"center",justifyContent:"center",color:"primary",flexGrow:1},iconButton:{ml:1}}})),F=function(){var e=Object(O.a)(),t=M(),r=A(Object(a.useCallback)((function(e){return[e.preferedColorScheme,e.setPreferedColorScheme]}),[])),c=Object(s.a)(r,2),o=c[0],i=c[1];return Object(p.jsxs)(u.a,{className:t.buttonHolder,children:[e.palette.mode," mode",Object(p.jsx)(j.a,{className:t.iconButton,sx:{ml:1},onClick:function(){var e=o===n.LIGHT_MODE?n.DARK_MODE:n.LIGHT_MODE;i(e)},color:"inherit",children:"dark"===e.palette.mode?Object(p.jsx)(g.a,{}):Object(p.jsx)(v.a,{})})]})},G=r(200),J=r(190),K=r(194),B=Object(f.a)((function(e){return{localeHolder:{display:"flex",flexGrow:1,padding:"0 0.5vw 0 0.5vw"},select:{display:"flex",flexGrow:1}}})),z=function(){var e=B(),t=A(Object(a.useCallback)((function(e){return[e.preferedLocale,e.setPreferedLocale]}),[])),r=Object(s.a)(t,2),n=r[0],c=r[1],o=A(Object(a.useCallback)((function(e){return[e.localesList,e.refreshLocalesList]}),[])),i=Object(s.a)(o,2),l=i[0],d=i[1];return Object(a.useEffect)((function(){return d()}),[d]),Object(p.jsx)(p.Fragment,{children:Object(p.jsx)(u.a,{className:e.localeHolder,children:Object(p.jsx)(G.a,{fullWidth:!0,variant:"standard",children:Object(p.jsxs)(J.a,{displayEmpty:!0,className:e.select,labelId:"prefered-locale",value:l.length>0?n:"",onChange:function(e){e.target.value&&c(e.target.value)},children:[Object(p.jsx)(K.a,{disabled:!0,value:"",children:Object(p.jsx)("em",{children:"Language"})}),l.map((function(e,t){return Object(p.jsx)(K.a,{value:e,children:e},t)}))]})})})})},V=Object(f.a)((function(e){return{jsonHolder:{display:"flex",flexGrow:1,padding:"0 0.5vw 0 0.5vw"},select:{display:"flex",flexGrow:1}}})),W=function(){var e=V(),t=A(Object(a.useCallback)((function(e){return[e.preferedJsonViewerTheme,e.setPreferedJsonViewerTheme]}),[])),r=Object(s.a)(t,2),n=r[0],c=r[1];return Object(p.jsx)(p.Fragment,{children:Object(p.jsx)(u.a,{className:e.jsonHolder,children:Object(p.jsx)(G.a,{fullWidth:!0,variant:"standard",children:Object(p.jsxs)(J.a,{displayEmpty:!0,className:e.select,labelId:"react-json-view-theme",value:n,label:"JSON theme",onChange:function(e){e.target.value&&(c(e.target.value),localStorage.setItem(w.PREFERED_JSON_THEME,e.target.value))},children:[Object(p.jsx)(K.a,{disabled:!0,value:"",children:Object(p.jsx)("em",{children:"JSON theme"})}),H.map((function(e,t){return Object(p.jsx)(K.a,{value:e,children:e},t)}))]})})})})},U=Object(f.a)((function(e){return{form:{display:"flex",flexDirection:"row",flexGrow:1,justifyContent:"flex-end",height:"100%"}}})),q=function(){var e=U();return Object(p.jsx)(p.Fragment,{children:Object(p.jsxs)("form",{className:e.form,children:[Object(p.jsx)(F,{}),Object(p.jsx)(z,{}),Object(p.jsx)(W,{})]})})},Y=Object(f.a)((function(e){return{headerContainer:{display:"flex",flex:"0 1 3vh",flexDirection:"row",backgroundColor:e.palette.background.paper,alignItems:"center",padding:"0 10vw 0 10vw"},linksContainer:{display:"flex",flexGrow:2,flexDirection:"row",alignItems:"center",height:"100%"},formContainer:{display:"flex",flexGrow:1,flexDirection:"row",alignItems:"center",height:"100%"},link:{display:"flex",padding:"0 1vw 0 1vw",height:"100%",alignItems:"center",borderBottom:"1px solid transparent","&:hover":{borderBottom:"1px solid ".concat(e.palette.action.hover)}}}})),Q=function(){var e=Y();return Object(p.jsx)(p.Fragment,{children:Object(p.jsxs)(u.a,{className:e.headerContainer,children:[Object(p.jsxs)(u.a,{className:e.linksContainer,children:[Object(p.jsx)(b.a,{underline:"hover",color:"inherit",href:"https://www.sp-tarkov.com/",className:e.link,children:"Website"}),Object(p.jsx)(b.a,{underline:"hover",color:"inherit",href:"https://mods.sp-tarkov.com/",className:e.link,children:"Workshop"}),Object(p.jsx)(b.a,{underline:"hover",color:"inherit",href:"https://docs.sp-tarkov.com/",className:e.link,children:"Documentation"})]}),Object(p.jsx)(u.a,{className:e.formContainer,children:Object(p.jsx)(q,{})})]})})},X=r(195),Z=Object(f.a)((function(e){return{breadcrumbHolder:{display:"flex",flex:"0 1 3vh",flexDirection:"row",alignItems:"center",padding:"0 10vw 0 10vw",borderBottom:"1px solid ".concat(e.palette.background.paper)},breadcrumb:{display:"flex",flex:"0 1 3vh",flexDirection:"row",flexGrow:1},link:{color:e.palette.text.secondary,display:"flex",padding:"0 1vw 0 1vw",height:"100%",alignItems:"center",borderBottom:"1px solid transparent","&:hover":{color:e.palette.action.hover,cursor:"pointer"}},currentItem:{cursor:"default",borderBottom:"1px solid ".concat(e.palette.action.hover)}}})),$=function(){var e=Z(),t=A((function(e){return e.setSelectedItem})),r=A((function(e){return e.itemHierarchy})),n=A((function(e){return[e.searchInput,e.setSearchInput]})),c=Object(s.a)(n,2),o=c[0],i=c[1],l=A((function(e){return e.selectedItem})),f=Object(a.useState)([]),h=Object(s.a)(f,2),m=h[0],j=h[1];Object(a.useEffect)((function(){for(var e=[],t=null===l||void 0===l?void 0:l._id;t;){var n,a=r[t];e.push(a),t=null===a||void 0===a||null===(n=a.item)||void 0===n?void 0:n._parent}j(e.filter((function(e){return void 0!==e&&null!==e})).reverse())}),[l,r]);return Object(p.jsx)(u.a,{className:e.breadcrumbHolder,children:Object(p.jsxs)(X.a,{"aria-label":"breadcrumb",className:e.breadcrumb,children:[Object(p.jsx)(b.a,{underline:"hover",color:"inherit",href:"/",className:e.link,children:Object(p.jsx)(d.a,{variant:"body2",children:"Home"})},"home"),m.map((function(r,n){return function(r,n){return o===r.locale.Name||o===r.item._id||o===r.item._name?Object(p.jsx)(d.a,{variant:"body2",className:e.currentItem,children:r.locale.Name?r.locale.Name:r.item._name},r.item._id):Object(p.jsx)(b.a,{underline:"hover",color:"inherit",onClick:function(){i(r.item._id),t(void 0)},className:e.link,children:Object(p.jsx)(d.a,{variant:"body2",children:r.locale.Name?r.locale.Name:r.item._name})},n)}(r,n.toString())}))]})})},ee=r(81),te=r(205),re=r(189),ne=r(192),ae=r(97),ce=r.n(ae),oe=Object(f.a)((function(e){return{searchAreaHolder:{display:"flex",flexGrow:1,flexDirection:"column",background:e.palette.background.paper,padding:"2vh 2vw 2vh 2vw"},jsonHolder:{display:"flex",flexGrow:1,alignItems:"center",flexDirection:"column",background:e.palette.background.paper,maxHeight:"80vh"},autocomplete:{}}})),ie=function(){var e=oe(),t=A((function(e){return e.preferedLocale})),r=A(Object(a.useCallback)((function(e){return e.preferedJsonViewerTheme}),[])),n=A((function(e){return[e.searchInput,e.setSearchInput]})),c=Object(s.a)(n,2),o=c[0],i=c[1],l=Object(a.useState)(""),f=Object(s.a)(l,2),h=f[0],m=f[1],b=A((function(e){return e.setHierarchy})),j=A((function(e){return[e.selectedItem,e.setSelectedItem]})),O=Object(s.a)(j,2),x=O[0],v=O[1],E=Object(a.useState)([]),g=Object(s.a)(E,2),w=g[0],_=g[1],C=function(){var e=Object(y.a)(k.a.mark((function e(r){var n,a;return k.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,D(r,t);case 2:n=e.sent,a=null===n||void 0===n?void 0:n.map((function(e){return{id:e.item._id,name:e.locale.Name}})),_(a||[]);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),S=Object(a.useCallback)(function(){var e=Object(y.a)(k.a.mark((function e(r){var n,a,c,o;return k.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,I(r,t);case 2:if(!(n=e.sent)){e.next=16;break}return a=n.item,v(a),c={id:a._id,name:n.locale.Name},m(c.name),i(c.name),_([c]),e.next=12,R(a._id,t);case 12:o=e.sent,b(o||{}),e.next=19;break;case 16:v(void 0),m(""),i("");case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[]);Object(a.useEffect)((function(){o&&o.match(/([a-z0-9]{24})/)&&S(o)}),[S,o]);var N=function(){var e=Object(y.a)(k.a.mark((function e(t){return k.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&!(t.length<3)){e.next=4;break}return v(void 0),_([]),e.abrupt("return");case 4:if(t!==h&&t!==(null===x||void 0===x?void 0:x._id)){e.next=6;break}return e.abrupt("return");case 6:if(m(t),!t.match(/([a-z0-9]{24})/)){e.next=12;break}return e.next=10,S(t);case 10:e.next=14;break;case 12:return e.next=14,C(t);case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),H=Object(p.jsx)(te.a,{size:100});return H=void 0!==x?Object(p.jsx)(ce.a,{src:x,theme:r,style:{marginTop:"2vh",width:"100%",overflowY:"auto",display:"flex"}}):Object(p.jsx)(d.a,{children:"No data to display"}),Object(p.jsxs)(u.a,{className:e.searchAreaHolder,children:[Object(p.jsx)(re.a,{disablePortal:!0,options:w.map((function(e){return e.name})),isOptionEqualToValue:function(e,t){return e===t},className:e.autocomplete,getOptionLabel:function(e){return e},inputValue:o,onInputChange:function(){var e=Object(y.a)(k.a.mark((function e(t,r){return k.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return v(void 0),i(r),e.next=6,N(r.trim());case 6:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),value:o,onChange:function(){var e=Object(y.a)(k.a.mark((function e(t,r){var n;return k.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=5;break}if(!(n=w.find((function(e){return e.name===r})))){e.next=5;break}return e.next=5,S(n.id);case 5:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),renderInput:function(e){return Object(p.jsx)(ne.a,Object(ee.a)(Object(ee.a)({},e),{},{label:"Search by name or ID"}))}}),Object(p.jsx)(u.a,{className:e.jsonHolder,children:H})]})},se=Object(f.a)((function(e){return{container:{background:"background.default",display:"flex",flexDirection:"column",flexGrow:1,height:"100vh",maxheight:"100vh"},searchContainer:{display:"flex",flexDirection:"row",flexGrow:1,padding:"2vh 2vw 1vh 2vw"}}})),le=function(){var e=se();return Object(p.jsx)(p.Fragment,{children:Object(p.jsxs)(u.a,{className:e.container,children:[Object(p.jsx)(Q,{}),Object(p.jsx)($,{}),Object(p.jsx)(u.a,{className:e.searchContainer,children:Object(p.jsx)(ie,{})}),Object(p.jsx)(m,{})]})})},ue=r(187),de=r(188),fe=r(92),pe=r(52),he=r(44),me=r(186),be=r(48),je=Object(be.a)({mode:n.DARK_MODE,background:{default:fe.a[900],paper:"#121212"},text:{primary:pe.a.white,secondary:"#8894a2",disabled:he.a[100]},action:{hover:me.a[700]}}),Oe=r(43),xe=Object(be.a)({mode:n.LIGHT_MODE,background:{default:fe.a[100],paper:fe.a[300]},text:{primary:pe.a.black,secondary:Oe.a[500],disabled:fe.a[600]},action:{hover:Oe.a[500]}}),ve=r(98),Ee=function(){var e,t=Object(ue.a)("(prefers-color-scheme: dark)"),r=A((function(e){return[e.preferedColorScheme,e.setPreferedColorScheme]})),c=Object(s.a)(r,2),o=c[0],i=c[1];return Object(a.useEffect)((function(){var e=localStorage.getItem(w.PREFERED_COLOR_SCHEME);if(e)i(e);else{var r=t?n.DARK_MODE:n.LIGHT_MODE;i(r)}}),[t]),Object(p.jsx)(p.Fragment,{children:Object(p.jsxs)(l.a,{theme:(e=o===n.DARK_MODE?je:xe,Object(ve.a)({palette:e,components:{MuiLink:{styleOverrides:{root:{"&:hover":{textDecoration:"none"}}}},MuiInput:{styleOverrides:{root:{"&:before":{borderColor:"transparent"},"&:after":{borderColor:"transparent"},"&:hover:not(.Mui-disabled):before":{borderColor:e.action.hover}},input:{"&:focus":{backgroundColor:"transparent"}}}},MuiTextField:{styleOverrides:{root:{"& label.Mui-focused":{color:e.action.hover},"& .MuiFilledInput-underline:after":{borderBottomColor:e.action.hover}}}},MuiInputBase:{styleOverrides:{root:{"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"".concat(e.action.hover," !important")}}}},MuiFormLabel:{styleOverrides:{root:{"&.Mui-focused .MuiInputLabel":{color:e.action.hover}}}}}})),children:[Object(p.jsx)(de.a,{}),Object(p.jsx)(le,{})]})})},ge=function(e){e&&e instanceof Function&&r.e(3).then(r.bind(null,207)).then((function(t){var r=t.getCLS,n=t.getFID,a=t.getFCP,c=t.getLCP,o=t.getTTFB;r(e),n(e),a(e),c(e),o(e)}))};i.a.render(Object(p.jsx)(c.a.StrictMode,{children:Object(p.jsx)(Ee,{})}),document.getElementById("root")),ge()}},[[126,1,2]]]);
|
|
//# sourceMappingURL=main.4a751c81.chunk.js.map
|