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.
2 lines
101 KiB
2 lines
101 KiB
(this.webpackJsonpngsplanner=this.webpackJsonpngsplanner||[]).push([[0],{112:function(e,t,a){},113:function(e,t,a){},114:function(e,t,a){},197:function(e,t){},199:function(e,t){},207:function(e,t,a){"use strict";a.r(t);var i=a(1),c=a.n(i),s=a(22),n=a.n(s),l=(a(112),a(16)),r=a(7),d=a(27),j=a(2),o=(a(113),a(114),a(52)),b=a.n(o),h=a(19),u=a(10),O=a.n(u),g=(a(37),a(0));var m=function(e){var t,a=e.GetData("class",void 0,void 0,null!==(t=e.useIDs)&&void 0!==t&&t),i=a[e.name];return Object(g.jsx)(O.a,{style:{height:8},showLoadingAnimation:!0,ready:"no data"!==a,type:"textRow",rows:1,children:i?Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("img",{alt:"",src:""+i.icon}),!e.hideName&&i.name]}):Object(g.jsx)(g.Fragment,{})})},p=a(210);function x(e){return e&&e.length>0?e.includes("http")?e:""+e:"/icons/nicodotpng.png.png"}var f=a(23),v=a(20);function S(e){var t=e.PANELPATHWBUILD,a=e.build,i=e.GetData,c=a.data&&"{"===a.data[0]?JSON.parse(a.data):{};return Object(g.jsxs)("div",{children:[Object(g.jsx)("br",{}),Object(g.jsx)(f.a,{to:null===t||void 0===t?void 0:t.replace(":BUILDID",a.id),children:Object(g.jsxs)("div",{className:"build",children:[Object(g.jsxs)("div",{className:"buildID",children:["#",a.id]}),Object(g.jsxs)("h2",{className:"buildTitle",children:["\xa0",a.build_name]})," ",Object(g.jsxs)("div",{className:"buildAuthor",children:["(Created by ",Object(g.jsx)("img",{className:"buildAvatar",alt:""}),a.creator,")"]}),Object(g.jsxs)("div",{className:"buildLikes",children:[Object(g.jsx)(p.a,{}),a.likes]}),Object(g.jsx)("br",{}),Object(g.jsxs)("div",{className:"buildClass",children:[Object(g.jsx)(m,{GetData:i,name:a.class1,useIDs:!0,hideName:!0}),Object(g.jsx)("sub",{children:null===c||void 0===c?void 0:c.level})]}),Object(g.jsxs)("div",{className:"buildClass",children:[Object(g.jsx)(m,{GetData:i,name:a.class2,useIDs:!0,hideName:!0}),Object(g.jsx)("sub",{children:null===c||void 0===c?void 0:c.secondaryLevel})]}),Object(g.jsx)("div",{className:"buildData",children:a.created_on}),Object(g.jsx)("br",{}),Object(g.jsxs)("div",{className:"equipPalette buildPalette",children:[Object(g.jsx)("div",{className:"equipPaletteSlot",children:Object(g.jsx)("div",{className:"equipPaletteSlotWrapper r"+i("weapon",c.weaponBaseName,"rarity"),children:Object(g.jsx)("img",{className:"buildImage",alt:"",src:x(i("weapon_existence_data",c.weaponExistenceID,"icon",!0))})})}),Object(g.jsx)("div",{className:"equipPaletteSlot",children:Object(g.jsx)("div",{className:"equipPaletteSlotWrapper r"+i("armor",c.armor1Name,"rarity"),children:Object(g.jsx)("img",{className:"buildImage",alt:"",src:x(i("armor",c.armor1Name,"icon"))})})}),Object(g.jsx)("div",{className:"equipPaletteSlot",children:Object(g.jsx)("div",{className:"equipPaletteSlotWrapper r"+i("armor",c.armor2Name,"rarity"),children:Object(g.jsx)("img",{className:"buildImage",alt:"",src:x(i("armor",c.armor2Name,"icon"))})})}),Object(g.jsx)("div",{className:"equipPaletteSlot",children:Object(g.jsx)("div",{className:"equipPaletteSlotWrapper r"+i("armor",c.armor3Name,"rarity"),children:Object(g.jsx)("img",{className:"buildImage",alt:"",src:x(i("armor",c.armor3Name,"icon"))})})})]})]})}),Object(g.jsx)("br",{}),Object(g.jsx)("br",{}),Object(g.jsx)("hr",{})]})}var N=function(e){var t=e.GetData,a=e.BACKENDURL,c=e.PANELPATHWBUILD,s=Object(i.useState)([]),n=Object(j.a)(s,2),l=n[0],r=n[1],d=Object(i.useState)("date_updated"),o=Object(j.a)(d,2),b=o[0],h=o[1],u=Object(i.useState)(""),m=Object(j.a)(u,2),p=m[0],x=m[1],f=Object(i.useState)("author"),N=Object(j.a)(f,2),y=N[0],k=N[1],D=Object(i.useState)(0),C=Object(j.a)(D,2),E=C[0],P=C[1],A=Object(i.useState)(!1),T=Object(j.a)(A,2),z=T[0],w=T[1];return Object(i.useEffect)((function(){w(!1),P(0),v.get("".concat(a,"/getBuilds?sort_type=").concat(b).concat(""!==y?"&filter_type=".concat(y):"").concat(""!==y?"&filter=".concat(encodeURI(p)):"").concat(0!==E?"&offset=".concat(E):"")).then((function(e){r(e.data)})).catch((function(e){})).finally((function(){w(!0)}))}),[a,b,y,p,E]),Object(g.jsx)(g.Fragment,{children:Object(g.jsxs)("div",{className:"box skillTreeBox",children:[Object(g.jsx)("div",{className:"boxTitleBar",children:Object(g.jsx)("h1",{children:"Builds List"})}),Object(g.jsxs)("div",{className:"itemBar",children:[Object(g.jsxs)("div",{className:"itemBarSort",children:["Sort By:",Object(g.jsx)("select",{className:"itemBarForm",value:b,onChange:function(e){h(e.currentTarget.value)},children:[{name:"Last Updated",value:"date_updated"},{name:"Alphabetical",value:"alphabetical"},{name:"Creation Time",value:"date_created"},{name:"Popularity",value:"popularity"},{name:"Editor's Choice",value:"editors_choice"},{name:"Author",value:"author"}].map((function(e){return Object(g.jsx)("option",{value:e.value,children:e.name},e)}))})]}),Object(g.jsxs)("div",{className:"itemBarSort",children:[Object(g.jsx)("label",{for:"filterForm",children:"Filter By: "}),Object(g.jsx)("select",{className:"itemBarForm",id:"filterForm",value:y,onChange:function(e){k(e.currentTarget.value)},children:[{name:"Author",value:"author"},{name:"Build Name",value:"build"},{name:"Editor's Choice",value:"editors_choice"},{name:"Class",value:"class1"},{name:"Sub-Class",value:"class2"}].map((function(e){return Object(g.jsx)("option",{value:e.value,children:e.name},e)}))})]}),Object(g.jsx)("div",{className:"itemBarFilter",children:Object(g.jsx)("input",{className:"itemBarForm",type:"text",placeholder:"Filter",value:p,onChange:function(e){x(e.currentTarget.value)}})})]}),Object(g.jsx)(O.a,{showLoadingAnimation:!0,ready:z,type:"media",rows:32,children:l.map((function(e){return Object(g.jsx)(S,{PANELPATHWBUILD:c,GetData:t,build:e})}))})]})})},y=a(212),k=a(213),D=a(214),C=a(215),E=a(216),P=a(13);function A(e){var t=Object(i.useRef)(null),a=Object(i.useState)(0),c=Object(j.a)(a,2),s=c[0],n=c[1],r=Object(i.useState)(0),d=Object(j.a)(r,2),o=d[0],b=d[1];return Object(i.useEffect)((function(){n(e.gridSizeX*e.gridDimensionsX+e.gridPaddingX*(e.gridDimensionsX-1)),b(e.gridSizeY*Math.ceil(e.gridDimensionsY/2)+e.halflineheight*Math.ceil((e.gridDimensionsY-1)/2)+e.gridPaddingY*(e.gridDimensionsY-1))}),[e.halflineheight,e.skillLines,e.gridSizeX,e.gridSizeY,e.gridPaddingX,e.gridPaddingY,e.gridDimensionsX,e.gridDimensionsY]),Object(i.useEffect)((function(){var a=t.current.getContext("2d");a.clearRect(0,0,s,o),a.fillStyle="rgba(100,100,100,0.5)",a.strokeStyle=e.strokeStyle,a.lineWidth=e.lineWidth,a.setLineDash(e.lineDash);var i,c=0,n=Object(l.a)(e.skillLines);try{for(n.s();!(i=n.n()).done;){var r,d=i.value,j=0,b=Object(l.a)(d.split(""));try{for(b.s();!(r=b.n()).done;){var h=r.value,u=0!==j?e.gridPaddingX*j:0,O=0!==c?e.gridPaddingY*c:0;switch(h){case"\u2500":a.beginPath(),a.moveTo(j*e.gridSizeX+u-e.gridPaddingX,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX+e.gridPaddingX,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.stroke();break;case"\u2502":a.beginPath(),a.moveTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O-e.gridPaddingY),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+e.gridSizeY+e.gridPaddingY),a.stroke();break;case"\u2514":a.beginPath(),a.moveTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O-e.gridPaddingY),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX+e.gridPaddingX,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.stroke();break;case"\u250c":a.beginPath(),a.moveTo(j*e.gridSizeX+u+e.gridSizeX+e.gridPaddingX,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+e.gridSizeY+e.gridPaddingY),a.stroke();break;case"\u2518":a.beginPath(),a.moveTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O-e.gridPaddingY),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u-e.gridPaddingX,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.stroke();break;case"\u2510":a.beginPath(),a.moveTo(j*e.gridSizeX+u-e.gridPaddingX,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+e.gridSizeY+e.gridPaddingY),a.stroke();break;case"\u251c":a.beginPath(),a.moveTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O-e.gridPaddingY),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX+e.gridPaddingX,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.stroke(),a.beginPath(),a.moveTo(j*e.gridSizeX+u+e.gridSizeX+e.gridPaddingX,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+e.gridSizeY+e.gridPaddingY),a.stroke();break;case"\u2524":a.beginPath(),a.moveTo(j*e.gridSizeX+u-e.gridPaddingX,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+e.gridSizeY+e.gridPaddingY),a.stroke(),a.beginPath(),a.moveTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O-e.gridPaddingY),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u-e.gridPaddingX,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.stroke();break;case"\u252c":a.beginPath(),a.moveTo(j*e.gridSizeX+u-e.gridPaddingX,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+e.gridSizeY+e.gridPaddingY),a.stroke(),a.beginPath(),a.moveTo(j*e.gridSizeX+u+e.gridSizeX+e.gridPaddingX,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+e.gridSizeY+e.gridPaddingY),a.stroke();break;case"\u2534":a.beginPath(),a.moveTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O-e.gridPaddingY),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX+e.gridPaddingX,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.stroke(),a.beginPath(),a.moveTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O-e.gridPaddingY),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u-e.gridPaddingX,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.stroke();break;case"\u253c":a.beginPath(),a.moveTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O-e.gridPaddingY),a.lineTo(j*e.gridSizeX+u+e.gridSizeX/2,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+e.gridSizeY+e.gridPaddingY),a.moveTo(j*e.gridSizeX+u-e.gridPaddingX,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.lineTo(j*e.gridSizeX+u+e.gridSizeX+e.gridPaddingX,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O+(c%2===1?e.halflineheight:e.gridSizeY)/2),a.stroke();break;case"\u25a1":a.clearRect(j*e.gridSizeX+u,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O,e.gridSizeX,c%2===1?e.halflineheight:e.gridSizeY),a.fillRect(j*e.gridSizeX+u,Math.ceil(c/2)*e.gridSizeY+Math.ceil((c-1)/2)*e.halflineheight+O,e.gridSizeX,c%2===1?e.halflineheight:e.gridSizeY)}j++}}catch(g){b.e(g)}finally{b.f()}c++}}catch(g){n.e(g)}finally{n.f()}}),[s,o,e.gridSizeX,e.gridSizeY,e.gridPaddingX,e.gridPaddingY,e.lineDash,e.lineWidth,e.skillLines,e.strokeStyle,e.halflineheight]),Object(g.jsx)("canvas",{width:s,height:o,ref:t,style:e.style,className:e.className,children:e.children})}function T(e){var t=e.GetData,a=Object(i.useState)([]),c=Object(j.a)(a,2),s=c[0],n=c[1];return Object(i.useEffect)((function(){n(t("class_skill"))}),[e.cl,t]),Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("select",{onChange:function(t){e.callback(t.currentTarget.value,Number(e.x),Number(e.y))},style:{position:"absolute",left:e.ADJUSTMENT[0]+(e.x*e.gridSizeX+e.padX+e.gridSizeX/2),top:e.ADJUSTMENT[1]+(e.y/2*e.gridSizeY+(e.y/2-1)*e.halflineheight+e.padY+(0===e.y?e.halflineheight:e.gridSizeY)/2)},value:e.defaultValue,children:[" ","\u2500","\u2502","\u25a1","\u250c","\u2514","\u2510","\u2518","\u252c","\u2534","\u251c","\u2524","\u253c"].map((function(e){return Object(g.jsx)("option",{value:e,children:e},e)}))}),"\u25a1"===e.defaultValue&&Object(g.jsx)("select",{style:{width:"64px",position:"absolute",left:e.ADJUSTMENT[0]+(e.x*e.gridSizeX+e.padX+e.gridSizeX/2),top:e.ADJUSTMENT[1]+(e.y/2*e.gridSizeY+(e.y/2-1)*e.halflineheight+e.padY+(0===e.y?e.halflineheight:e.gridSizeY)/2)+28},onChange:function(t){e.skillCallback(e.x,e.y,t.currentTarget.value)},value:e.skill.split(",")[2],children:[""].concat(Object(P.a)(Object.keys(s).filter((function(t){return s[t].class_id===e.cl})))).map((function(e){return Object(g.jsx)("option",{value:s[e]?s[e].id:"",children:s[e]?s[e].name:""},e)}))})]})}var z=a(20),w=a.n(z);function _(e){var t,a,s=e.GetData,n=Object(i.useMemo)((function(){return[-32,32]}),[]),l=Object(i.useState)(!0),r=Object(j.a)(l,2),d=r[0],o=r[1],b=Object(i.useState)({}),h=Object(j.a)(b,2),u=h[0],O=h[1],m=Object(i.useState)({}),p=Object(j.a)(m,2),x=p[0],f=p[1],v=Object(i.useState)(-1),S=Object(j.a)(v,2),N=S[0],y=S[1],k=Object(i.useState)("#000000"),D=Object(j.a)(k,2),C=D[0],E=D[1],z=Object(i.useState)(3),_=Object(j.a)(z,2),M=_[0],L=_[1],G=Object(i.useState)(6),F=Object(j.a)(G,2),I=F[0],R=F[1],Y=Object(i.useState)(6),X=Object(j.a)(Y,2),B=X[0],U=X[1],W=Object(i.useState)(80),H=Object(j.a)(W,2),K=H[0],q=H[1],V=Object(i.useState)(60),J=Object(j.a)(V,2),Q=J[0],Z=J[1],$=Object(i.useState)(10),ee=Object(j.a)($,2),te=ee[0],ae=ee[1],ie=Object(i.useState)(10),ce=Object(j.a)(ie,2),se=ce[0],ne=ce[1],le=Object(i.useState)([]),re=Object(j.a)(le,2),de=re[0],je=re[1],oe=Object(i.useState)([]),be=Object(j.a)(oe,2),he=be[0],ue=be[1],Oe=Object(i.useState)([]),ge=Object(j.a)(Oe,2),me=ge[0],pe=ge[1],xe=Object(i.useState)([]),fe=Object(j.a)(xe,2),ve=fe[0],Se=fe[1],Ne=Object(i.useState)(""),ye=Object(j.a)(Ne,2),ke=ye[0],De=ye[1],Ce=Object(i.useState)(!1),Ee=Object(j.a)(Ce,2),Pe=Ee[0],Ae=Ee[1],Te=Object(i.useState)(60),ze=Object(j.a)(Te,2),we=ze[0],_e=ze[1],Me=Object(i.useCallback)((function(e,t){var a=ve.filter((function(a){return Number(a.split(",")[0])===Number(e)&&Number(a.split(",")[1])===Number(t)}));return a.length>0?a[0]:""}),[ve]);return Object(i.useEffect)((function(){O(s("class",void 0,void 0,!0)),f(s("skill_tree_data",void 0,void 0,!0))}),[s]),Object(i.useEffect)((function(){for(var e=!1,t=0,a=Object.keys(x);t<a.length;t++){var i=a[t];if(Number(x[i].class_id)===Number(N)){var c,s,n=null===(c=x[i].data)||void 0===c?void 0:c.split(","),l=null===(s=x[i].skill_data)||void 0===s?void 0:s.split(";");ue(n),Se(l),R(n[0].length),U(n.length),E(x[i].line_color),L(x[i].line_width),q(x[i].gridsizex),Z(x[i].gridsizey),ae(x[i].gridpaddingx),ne(x[i].gridpaddingy),_e(x[i].halflineheight),e=!0}}e||(ue([]),Se([]),R(6),U(6))}),[x,N]),Object(i.useEffect)((function(){d&&(y(Number(Object.keys(u)[0])),o(!1))}),[u,d]),Object(i.useEffect)((function(){for(var e=Object(P.a)(he);e.length<B;)e.push(" ".repeat(I));for(var t=0;t<e.length;t++)e[t].length<I&&(e[t]+=" ".repeat(I-e[t].length));pe(e)}),[I,B,he]),Object(i.useEffect)((function(){for(var e=[],t=0;t<me.length;t++)for(var a=0;a<me[t].length;a++){var i=0!==a?te*a:0,c=0!==t?se*t:0;t<B&&a<I&&e.push(Object(g.jsx)(T,{GetData:s,cl:Number(N),defaultValue:me[t][a],callback:function(e,t,a){var i=Object(P.a)(me),c=i[a].split(""),s=Object(P.a)(ve);if(c[t]=e,"\u25a1"!==e)for(var n in s){var l=s[n].split(",");if(Number(l[0])===Number(t)&&Number(l[1])===Number(a)){s[n]="",Se(s);break}}i[a]=c.join(""),ue(i)},skill:Me(a,t),skillCallback:function(e,t,a){var i=Object(P.a)(ve),c=!1,s=e+","+t+","+a;for(var n in i){var l=i[n].split(",");if(Number(l[0])===Number(e)&&Number(l[1])===Number(t)){i[n]=s,c=!0;break}}c||i.push(s),Se(i)},ADJUSTMENT:n,x:a,y:t,gridSizeX:K,gridSizeY:Q,padX:i,padY:c,halflineheight:we}))}je(e)}),[me,K,Q,te,se,N,B,I,ve,we,s,n,Me]),Object(g.jsx)(g.Fragment,{children:Pe?Object(g.jsx)("img",{src:"/spinner.gif",alt:""}):Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("h2",{children:ke}),Object(g.jsx)("label",{htmlFor:"classSelect",children:"Class Select:"}),Object(g.jsxs)("select",{id:"classSelect",value:Number.isNaN(Number(N))?"?":N,onChange:function(e){y(Number(e.currentTarget.value))},children:[Object(g.jsx)("option",{value:""}),Object.keys(u).map((function(e){return Object(g.jsx)("option",{value:e,children:e+" - "+u[e].name},u[e].name)}))]}),Object(g.jsx)("br",{}),Object(g.jsx)("br",{}),(null===(t=e.GetData("class",void 0,void 0,!0)[N])||void 0===t?void 0:t.name)&&Object(g.jsx)("button",{onClick:function(){Ae(!0),w.a.post(e.BACKENDURL+"/saveskilltree",{pass:e.password,data:me.slice(0,B).map((function(e){return e.slice(0,I)})).join(","),skill_data:ve.join(";"),line_color:C,line_width:M,gridsizex:K,gridsizey:Q,gridpaddingx:te,gridpaddingy:se,halflineheight:we,class_id:N}).then((function(t){"OK!"===t.data&&(De(Object(g.jsx)("span",{style:{color:"green"},children:"Successfully saved skill tree for "+e.GetData("class",void 0,void 0,!0)[N].name+"!"})),e.setUpdate(!0))})).catch((function(e){De(Object(g.jsx)("span",{style:{color:"red"},children:e.message}))})).then((function(){Ae(!1)}))},children:"Save "+(null===(a=e.GetData("class",void 0,void 0,!0)[N])||void 0===a?void 0:a.name)+" Skill Tree"}),Object(g.jsxs)("div",{style:{width:"800px",position:"relative",left:"300px"},children:[Object(g.jsx)(A,{strokeStyle:C,lineWidth:M,lineDash:[],gridDimensionsX:I,gridDimensionsY:B,gridSizeX:K,gridSizeY:Q,gridPaddingX:te,gridPaddingY:se,skillLines:me,halflineheight:we}),de.map((function(e,t){return Object(g.jsx)(c.a.Fragment,{children:e},t)})),Object(g.jsx)("br",{}),Object(g.jsx)("hr",{}),Object(g.jsx)("br",{}),Object(g.jsx)("label",{htmlFor:"lineColor",children:"Line Color:"}),Object(g.jsx)("input",{type:"color",id:"lineColor",value:C,onChange:function(e){E(e.currentTarget.value)}}),Object(g.jsx)("br",{}),Object(g.jsx)("label",{htmlFor:"lineWidth",children:"Line Width:"}),Object(g.jsx)("input",{type:"number",id:"lineWidth",value:M,onChange:function(e){L(e.currentTarget.value)}}),Object(g.jsx)("br",{}),Object(g.jsx)("label",{htmlFor:"gridSizeX",children:"Grid Size X:"}),Object(g.jsx)("input",{type:"number",id:"gridSizeX",value:I,onChange:function(e){R(e.currentTarget.value)}}),Object(g.jsx)("br",{}),Object(g.jsx)("label",{htmlFor:"gridSizeY",children:"Grid Size Y:"}),Object(g.jsx)("input",{type:"number",id:"gridSizeY",value:B,onChange:function(e){U(e.currentTarget.value)}}),Object(g.jsx)("br",{}),Object(g.jsx)("label",{htmlFor:"subrowHeight",children:"Sub-row Height:"}),Object(g.jsx)("input",{type:"number",id:"subrowHeight",value:we,onChange:function(e){_e(e.currentTarget.value)}}),Object(g.jsx)("br",{}),Object(g.jsx)("label",{htmlFor:"boxSizeX",children:"Box Size X:"}),Object(g.jsx)("input",{type:"number",id:"boxSizeX",value:K,onChange:function(e){q(e.currentTarget.value)}}),Object(g.jsx)("br",{}),Object(g.jsx)("label",{htmlFor:"boxSizeY",children:"Box Size Y:"}),Object(g.jsx)("input",{type:"number",id:"boxSizeY",value:Q,onChange:function(e){Z(e.currentTarget.value)}}),Object(g.jsx)("br",{}),Object(g.jsx)("label",{htmlFor:"gridPaddingX",children:"Grid Padding X:"}),Object(g.jsx)("input",{type:"number",id:"gridPaddingX",value:te,onChange:function(e){ae(e.currentTarget.value)}}),Object(g.jsx)("br",{}),Object(g.jsx)("label",{htmlFor:"gridPaddingY",children:"Grid Padding Y:"}),Object(g.jsx)("input",{type:"number",id:"gridPaddingY",value:se,onChange:function(e){ne(e.currentTarget.value)}}),Object(g.jsx)("br",{})]})]})})}var M=a(105),L=a(6),G=a(28),F=a(20),I=a(70);var R=function(e){var t=e.BACKENDURL,a=e.LOGGEDINUSER,c=e.LOGGEDINHASH,s=Object(i.useState)(void 0),n=Object(j.a)(s,2),l=n[0],r=n[1],d=Object(i.useState)(void 0),o=Object(j.a)(d,2),b=o[0],h=o[1],u=Object(i.useState)(!0),m=Object(j.a)(u,2),p=m[0],v=m[1];return Object(i.useEffect)((function(){F.post(t+"/validUser",{username:a,password:c,recoveryhash:I.get("userID")}).then((function(e){e.data.verified&&(r(e.data.avatar),h(a))})).catch((function(e){})).finally((function(){v(!1)}))}),[t,a,c]),Object(g.jsx)("header",{children:Object(g.jsxs)("div",{className:"headerWrapper",children:[Object(g.jsx)("div",{className:"logo",children:Object(g.jsxs)("a",{href:".",children:[Object(g.jsx)("img",{alt:"",src:"/icons/logo_sm.png"}),"\u2003NGS",Object(g.jsx)("span",{children:"planner"})]})}),Object(g.jsxs)("div",{className:"navigation",children:[Object(g.jsxs)("ul",{children:[Object(g.jsx)("li",{className:"headerMenuItem",children:Object(g.jsx)(f.a,{to:"/builds",children:"Builds"})}),Object(g.jsx)("li",{className:"headerMenuItem",children:Object(g.jsx)("a",{href:".",children:"Guides"})}),Object(g.jsx)("li",{className:"headerMenuItem",children:Object(g.jsx)("a",{href:".",children:"Blog"})}),Object(g.jsx)("li",{className:"headerMenuItem",children:Object(g.jsx)("a",{href:".",children:"About"})})]}),Object(g.jsx)("section",{className:"miniNav",children:Object(g.jsx)("a",{href:".",children:"\u2630"})})]}),Object(g.jsxs)("div",{className:"rightNav",children:[Object(g.jsx)("section",{className:"loginNav",children:Object(g.jsx)("a",{href:".",children:Object(g.jsxs)(O.a,{style:{width:240,height:42},showLoadingAnimation:!0,ready:!p,type:"media",rows:1,children:[Object(g.jsx)("img",{alt:".",src:x(l)})," ",null!==b&&void 0!==b?b:"Guest"," \u2003 ",Object(g.jsx)("span",{className:"dotMenu",children:"\xb7\xb7\xb7"})]})})}),Object(g.jsx)("section",{className:"miniNav",children:Object(g.jsx)("a",{href:".",children:Object(g.jsx)(O.a,{style:{width:42,height:42},showLoadingAnimation:!0,ready:!p,type:"round",rows:1,children:Object(g.jsx)("img",{alt:".",src:x(l)})})})})]})]})})},Y=a(211),X=a(41),B=a.n(X),U=a(217);function W(e){return Object(g.jsx)(U.a,Object(r.a)(Object(r.a)({className:"xTooltip",fade:!0,placement:"bottom"},e),{},{children:e.children}))}function H(e){return Object(i.useEffect)((function(){var e=setTimeout((function(){document.getElementById("editBoxInput").focus(),document.getElementById("editBoxInput").select()}),100);return function(){clearTimeout(e)}}),[e.edit]),Object(g.jsx)("input",{id:"editBoxInput",type:e.type,max:"number"===e.type?20:void 0,min:"number"===e.type?1:void 0,onKeyDown:function(t){("Enter"===t.key||"Escape"===t.key)&&e.setEdit(!1)},maxLength:e.maxlength?e.maxlength:20,onBlur:function(){e.setEdit(!1)},value:e.value,onChange:function(t){t.currentTarget.value.length>0?e.setName(t.currentTarget.value):e.setName(e.originalName)}})}function K(e){var t=Object(i.useState)(!1),a=Object(j.a)(t,2),c=a[0],s=a[1];return Object(i.useEffect)((function(){e.callback&&e.callback()}),[c,e]),Object(g.jsx)(g.Fragment,{children:Object(g.jsx)("div",{className:c?"editBoxActive":"editBox",onClick:function(e){s(!0)},children:c?Object(g.jsx)(H,{edit:c,maxlength:e.maxlength,type:e.type,setEdit:s,originalName:e.data,setName:e.setData,value:e.data}):Object(g.jsxs)(g.Fragment,{children:[e.prefix,e.data]})})})}function q(e){return Object(g.jsx)("li",{onClick:function(){e.onPageChange&&e.onPageChange(e.pageName),e.setCurrentPage(e.page)},className:e.currentPage===e.page?"selected":"unselected",children:e.pageDisplay?e.pageDisplay[e.page-1]:e.pageName?e.pageName:e.page})}function V(e){for(var t=[],a=0;a<e.pages;a++)t.push(Object(g.jsx)(q,{onPageChange:e.onPageChange,pageDisplay:e.pageDisplay,pageName:e.pageNames?e.pageNames[a]:void 0,currentPage:e.currentPage,setCurrentPage:e.setCurrentPage,page:a+1}));return void 0!==e.children&&t.push(Object(g.jsx)("li",{className:"pageControlDetails",children:e.children})),t.length>0&&Object(g.jsx)("ul",{className:"boxmenu",children:t.map((function(e,t){return Object(g.jsx)(c.a.Fragment,{children:e},t)}))})}function J(e){return Object(g.jsx)(g.Fragment,{children:Object(g.jsx)("div",{className:"editClass",onClick:function(){e.setClassNameSetter(e.editClass),e.setClassSelectWindowOpen(!0)},children:Object(g.jsx)(m,{GetData:e.GetData,name:e.name})})})}function Q(e){return Object(g.jsx)(B.a,{ariaHideApp:!1,isOpen:e.modalOpen,onRequestClose:function(){e.setModalOpen(!1)},shouldFocusAfterRender:!0,shouldCloseOnOverlayClick:!0,shouldCloseOnEsc:!0,className:"modal",overlayClassName:"modalOverlay",children:Object(g.jsxs)("div",{className:"box boxModal noSelect",children:[Object(g.jsxs)("div",{className:"boxTitleBar",children:[Object(g.jsx)("h1",{children:e.title}),e.showCloseButton&&Object(g.jsx)("div",{className:"boxExit",onClick:function(){e.setModalOpen(!1)}})]}),Object(g.jsx)(V,{onPageChange:e.onPageChange,pages:e.pageNames?e.pageNames.length:0,pageNames:e.pageNames,currentPage:e.page,setCurrentPage:e.setPage}),e.children]})})}function Z(e){var t=e.onModalOpen,a=Object(i.useState)([]),s=Object(j.a)(a,2),n=s[0],l=s[1],r=Object(i.useState)(1),d=Object(j.a)(r,2),o=d[0],b=d[1],h=Object(i.useState)(e.sortItems?e.sortItems[0]:""),u=Object(j.a)(h,2),O=u[0],m=u[1],p=Object(i.useState)(""),x=Object(j.a)(p,2),f=x[0],v=x[1];return Object(i.useEffect)((function(){e.dataFunction&&l(e.dataFunction())}),[e]),Object(i.useEffect)((function(){t&&t(b)}),[t]),Object(g.jsxs)(Q,{page:o,setPage:b,modalOpen:e.modalOpen,setModalOpen:e.setModalOpen,showCloseButton:!0,title:e.title,pageNames:e.pageNames,filter:!0,onPageChange:e.onPageChange,children:[(e.sortItems||e.filter)&&Object(g.jsxs)("div",{className:"itemBar",children:[Object(g.jsx)("div",{className:"itemBarSort",children:e.sortItems&&Object(g.jsx)("select",{className:"itemBarForm",value:O,onChange:function(e){m(e.currentTarget.value)},children:e.sortItems.map((function(e){return Object(g.jsx)("option",{value:e,children:e},e)}))})}),Object(g.jsx)("div",{className:"itemBarFilter",children:e.filter?Object(g.jsx)("input",{className:"itemBarForm",type:"text",placeholder:"Filter",value:f,onChange:function(e){v(e.currentTarget.value)}}):Object(g.jsx)(g.Fragment,{})})]}),Object(g.jsxs)("div",{className:"modalItemListContainer customScrollbar",children:[e.filter?n.filter((function(t){return e.filterFunction(o,t)})).filter((function(t){return e.searchFieldFunction(f,t)})).sort((function(t,a){return e.sortOrderFunction(O,t,a)})).map((function(t,a){return Object(g.jsx)(c.a.Fragment,{children:e.displayFunction(t)},a)})):n.map((function(t,a){return Object(g.jsx)(c.a.Fragment,{children:e.displayFunction(t)},a)})),e.children]}),e.footer]})}function $(e){return Object(g.jsx)("span",Object(r.a)(Object(r.a)({},e),{},{className:"skillLeftButton"}))}function ee(e){return Object(g.jsx)("span",Object(r.a)(Object(r.a)({},e),{},{className:"skillRightButton"}))}function te(e){var t=Object(i.useState)("Select Main Class"),a=Object(j.a)(t,2),c=a[0],s=a[1];return Object(i.useEffect)((function(){s(e.editClass?"Select Sub Class":"Select Main Class")}),[e.editClass]),Object(g.jsx)(Z,{title:c,modalOpen:e.modalOpen,setModalOpen:e.setModalOpen,GetData:e.GetData,pageNames:["Main Class","Sub-Class"],onPageChange:function(t){"Main Class"===t?e.setEditClass(0):e.setEditClass(1)},onModalOpen:function(t){t(e.editClass?2:1)},dataFunction:function(){var t=e.GetData("class");return Object.keys(t)},displayFunction:function(t){return Object(g.jsxs)("li",{className:e.class===t?"treeListMain":e.subClass===t?"treeListSub":"",onClick:function(){0===e.editClass?(e.setClassName(t),e.setSubClassName(e.subClass===t?e.class:e.subClass)):(e.setSubClassName(t),e.setClassName(e.class===t?e.subClass:e.class)),e.setModalOpen(!1)},children:[Object(g.jsx)("img",{alt:"",src:x(e.GetData("class",t,"icon"))})," ",e.GetData("class",t,"name")]})}})}function ae(e){var t;return void 0!==e[4]?(null===(t=e[4].special_name)||void 0===t?void 0:t.length)>0?e[4].special_name:e[1].name+" "+e[0].name:Object(g.jsx)(g.Fragment,{children:Object(g.jsx)("span",{className:"",children:"Select Weapon"})})}function ie(e){return Object(g.jsxs)("div",{className:e.className,style:{gridArea:(t=Number(e.skill[0]),a=Number(e.skill[1]),String.fromCharCode(Number(t)+"a".charCodeAt(0))+(a/2+1))},children:[Object(g.jsx)("img",{className:"skillIcon",alt:"",src:x(e.GetData("class_skill",e.skill[2],"icon",!0))}),Object(g.jsx)("span",{className:"skillAllocated",children:(e.skillPointData[e.page-1][e.boxId]?e.skillPointData[e.page-1][e.boxId]:0)+"/"+e.maxPoints}),Object(g.jsx)("em",{className:"skillName",children:"string"===typeof e.GetData("class_skill",e.skill[2],"name",!0)&&e.GetData("class_skill",e.skill[2],"name",!0)}),Object(g.jsxs)("div",{className:"skillButtons",children:[Object(g.jsx)($,{onClick:function(){var t=Object(P.a)(e.points),a=Object(P.a)(e.skillPointData);a[e.page-1][e.boxId]||(a[e.page-1][e.boxId]=0),a[e.page-1][e.boxId]>0&&(t[e.page-1]-=1,a[e.page-1][e.boxId]-=1,e.setPoints(t),e.setSkillPointData(a))}}),Object(g.jsx)(ee,{onClick:function(){var t=Object(P.a)(e.points),a=Object(P.a)(e.skillPointData);a[e.page-1][e.boxId]||(a[e.page-1][e.boxId]=0),a[e.page-1][e.boxId]<e.maxPoints&&(t[e.page-1]+=1,a[e.page-1][e.boxId]+=1,e.setPoints(t),e.setSkillPointData(a))}})]})]});var t,a}function ce(e){function t(t){for(var a=Object.keys(e.GetData("class_skill_data")),i=0,c=0;c<a.length;c++){var s=e.GetData("class_skill_data",a[c]);s&&Number(s.class_skill_id)===Number(t)&&s.level>i&&(i=s.level)}return i}return Object(g.jsx)(g.Fragment,{children:e.skillTreeSkillData&&e.skillTreeSkillData.map((function(a,i){var c=a.split(",");return""!==c[0]&&""!==c[1]&&""!==c[2]&&Object(g.jsx)(ie,{className:(c[2],e.skillPointData[e.page-1][c[0]+"_"+c[1]]===t(c[2])?"skillMaxed":e.skillPointData[e.page-1][c[0]+"_"+c[1]]>0?"skillActive":""),boxId:c[0]+"_"+c[1],skillPointData:e.skillPointData,setSkillPointData:e.setSkillPointData,page:e.page,cl:e.cl,maxPoints:t(c[2]),points:e.points,setPoints:e.setPoints,GetData:e.GetData,skill:c.map((function(e){return Number(e)}))},i)}))})}function se(e){var t=e.GetData,a=Object(i.useState)([]),c=Object(j.a)(a,2),s=c[0],n=c[1],r=Object(i.useState)([]),d=Object(j.a)(r,2),o=d[0],b=d[1],h=Object(i.useState)(""),u=Object(j.a)(h,2),O=u[0],m=u[1],p=Object(i.useState)(3),x=Object(j.a)(p,2),f=x[0],v=x[1],S=Object(i.useState)(6),N=Object(j.a)(S,2),y=N[0],k=N[1],D=Object(i.useState)(6),C=Object(j.a)(D,2),E=C[0],P=C[1],T=Object(i.useState)(171),z=Object(j.a)(T,2),w=z[0],_=z[1],M=Object(i.useState)(148),L=Object(j.a)(M,2),G=L[0],F=L[1],I=Object(i.useState)(10),R=Object(j.a)(I,2),Y=R[0],X=R[1],B=Object(i.useState)(48),U=Object(j.a)(B,2),W=U[0],H=U[1],K=Object(i.useState)(60),q=Object(j.a)(K,2),V=q[0],J=q[1];return Object(i.useEffect)((function(){if(Object.keys(t("skill_tree_data")).length>1){var a,i=Object(l.a)(t("skill_tree_data"));try{for(i.s();!(a=i.n()).done;){var c=a.value;if(c.class_id===t("class",e.cl,"id")){var s=c.data.split(","),r=c.skill_data.split(";");n(s),b(r),m(c.line_color),v(c.line_width),k(s[0].length),P(s.length),_(c.gridsizex),F(c.gridsizey),X(c.gridpaddingx),H(c.gridpaddingy),J(c.halflineheight);break}}}catch(d){i.e(d)}finally{i.f()}}}),[e.cl,t]),Object(g.jsx)("div",{className:"skillTreeContainer customScrollbar",children:Object(g.jsxs)("div",{style:{position:"relative"},children:[Object(g.jsx)(A,{style:{position:"absolute"},strokeStyle:O,lineWidth:f,lineDash:[],gridDimensionsX:y,gridDimensionsY:E,gridSizeX:w,gridSizeY:G,gridPaddingX:Y,gridPaddingY:W,skillLines:s,halflineheight:V}),Object(g.jsx)("div",{className:"skillTreeGrid",children:Object(g.jsx)(ce,{skillPointData:e.skillPointData,setSkillPointData:e.setSkillPointData,page:e.page,points:e.points,cl:e.cl,setPoints:e.setPoints,GetData:e.GetData,skillTreeSkillData:o})})]})})}function ne(e){var t=e.item,a=t.dmg_res,c=t.hp,s=t.hp_recovery,n=t.icon,l=t.name,r=t.potency,d=t.pp,o=t.pp_consumption,b=t.pp_recovery,h=t.weak_point_dmg,u=t.rarity,O=t.food_type,m=e.modifyPoints,p=Object(i.useState)(e.points),f=Object(j.a)(p,2),v=f[0],S=f[1],N=[{name:"Damage Resistance",icon:"",val:a},{name:"Health",icon:"",val:c},{name:"Health Recovery",icon:"",val:s},{name:"Potency",icon:"",val:r},{name:"Damage Resistance",icon:"",val:a},{name:"PP Boost",icon:"",val:d},{name:"PP Consumption Reduction",icon:"",val:o},{name:"PP Recovery",icon:"",val:b},{name:"Weak Point Damage",icon:"",val:h}];return Object(i.useEffect)((function(){S(e.points)}),[e.points]),Object(g.jsxs)("div",{onClick:function(e){e.stopPropagation(),m(l,1)},className:"itemWrapper".concat(v>0?"Active":""," r").concat(u),children:[Object(g.jsx)("div",{className:"itemImgWrapper",children:Object(g.jsx)("img",{alt:"",src:x(n)})}),Object(g.jsx)("div",{className:"itemNameWrapper ".concat(O),children:l}),Object(g.jsx)("div",{className:"itemRarityWrapper",children:"\xa0"}),Object(g.jsx)("div",{className:"itemPropertiesWrapper",children:N.filter((function(e){return e.val})).map((function(e){return Object(g.jsx)("span",{className:e.icon},e.name)}))}),Object(g.jsxs)("div",{className:"itemControlsWrapper",children:[Object(g.jsx)("span",{onClick:function(e){e.stopPropagation(),m(l,-1)},children:"-"}),Object(g.jsx)("span",{children:v}),Object(g.jsx)("span",{onClick:function(e){e.stopPropagation(),m(l,1)},children:"+"})]})]})}function le(e){var t=e.GetData,a=e.foodPointData,i=e.setFoodPointData,c=Object.keys(a).reduce((function(e,t){return a[t]+e}),0);function s(e,t){var s,n=Object(r.a)({},a);t+c<=10&&t+c>=0&&(n[e]=Math.min(Math.max((null!==(s=n[e])&&void 0!==s?s:0)+t,0),10),i(n))}return Object(g.jsx)(Z,{title:"Food Menu",modalOpen:e.foodMenuWindowOpen,setModalOpen:e.setFoodMenuWindowOpen,GetData:e.GetData,footer:Object(g.jsxs)(g.Fragment,{children:[Object(g.jsxs)("div",{className:"foodPoints",children:[Object(g.jsx)("div",{children:"Foods in Recipe"}),Object(g.jsx)("div",{children:c})]}),Object(g.jsxs)("div",{className:"foodConfirm",children:[Object(g.jsx)("div",{onClick:function(){e.setFoodMenuWindowOpen(!1)},children:"Confirm"}),Object(g.jsx)("div",{onClick:function(){e.setFoodMenuWindowOpen(!1),e.setFoodPointData(e.prevFoodPointData)},children:"Cancel"})]})]}),sortItems:["Standard Sort","Alphabetical","Food Name","Food Type","Popularity"],filter:!0,dataFunction:function(){return Object.keys(t("food")).map((function(e){return t("food")[e]}))},filterFunction:function(e,t){return t},searchFieldFunction:function(e,t){return!(e.length>0)||t.name.trim().toLowerCase().includes(e.toLowerCase())},sortOrderFunction:function(e,t,a){switch(e){case"Standard Sort":return a.id-t.id;case"Alphabetical":return t.name.localeCompare(a.name);case"Food Name":return t.name.substr(t.name.lastIndexOf(" ")).localeCompare(a.name.substr(a.name.lastIndexOf(" ")));case"Food Type":return 0!==t.food_type.localeCompare(a.food_type)?t.food_type.localeCompare(a.food_type):t.name.substr(t.name.lastIndexOf(" ")).localeCompare(a.name.substr(a.name.lastIndexOf(" ")));case"Popularity":return a.popularity-t.popularity;default:return 0}},displayFunction:function(e){var t;return Object(g.jsx)(ne,{modifyPoints:s,points:null!==(t=a[e.name])&&void 0!==t?t:0,item:e},e.name)}})}var re=function(e){var t,a,s=Object(L.h)().BUILDID,n=Object(L.f)(),d=Object(L.g)(),o=e.GetData,b=e.LOGGEDINUSER,u=e.LOGGEDINHASH,m=e.BACKENDURL,p=e.APP_TITLE,f=Object(i.useState)(1e3),v=Object(j.a)(f,2),S=v[0],N=v[1],y=Object(i.useState)(1e3),k=Object(j.a)(y,2),D=k[0],C=k[1],E=Object(i.useState)(1e3),A=Object(j.a)(E,2),T=A[0],z=A[1],_=Object(i.useState)(1e3),M=Object(j.a)(_,2),G=M[0],F=M[1],I=Object(i.useState)(1e3),R=Object(j.a)(I,2),X=R[0],U=R[1],H=Object(i.useState)("Player"),q=Object(j.a)(H,2),Q=q[0],$=q[1],ee=Object(i.useState)("Character"),ie=Object(j.a)(ee,2),ce=ie[0],ne=ie[1],re=Object(i.useState)("Ranger"),de=Object(j.a)(re,2),je=de[0],oe=de[1],be=Object(i.useState)("Force"),he=Object(j.a)(be,2),ue=he[0],Oe=he[1],ge=Object(i.useState)(20),me=Object(j.a)(ge,2),pe=me[0],xe=me[1],fe=Object(i.useState)(20),ve=Object(j.a)(fe,2),Se=ve[0],Ne=ve[1],ye=Object(i.useState)(1),ke=Object(j.a)(ye,2),De=ke[0],Ce=ke[1],Ee=Object(i.useState)(1),Pe=Object(j.a)(Ee,2),Ae=Pe[0],Te=Pe[1],ze=Object(i.useState)(1),we=Object(j.a)(ze,2),_e=we[0],Me=we[1],Le=Object(i.useState)(!1),Ge=Object(j.a)(Le,2),Fe=Ge[0],Ie=Ge[1],Re=Object(i.useState)(!1),Ye=Object(j.a)(Re,2),Xe=Ye[0],Be=Ye[1],Ue=Object(i.useState)(!1),We=Object(j.a)(Ue,2),He=We[0],Ke=We[1],qe=Object(i.useState)(1),Ve=Object(j.a)(qe,2),Je=Ve[0],Qe=Ve[1],Ze=Object(i.useState)(!1),$e=Object(j.a)(Ze,2),et=$e[0],tt=$e[1],at=Object(i.useState)(!1),it=Object(j.a)(at,2),ct=it[0],st=it[1],nt=Object(i.useState)(!1),lt=Object(j.a)(nt,2),rt=lt[0],dt=lt[1],jt=Object(i.useState)([]),ot=Object(j.a)(jt,2),bt=ot[0],ht=ot[1],ut=Object(i.useState)([]),Ot=Object(j.a)(ut,2),gt=Ot[0],mt=Ot[1],pt=Object(i.useState)([]),xt=Object(j.a)(pt,2),ft=xt[0],vt=xt[1],St=Object(i.useState)([]),Nt=Object(j.a)(St,2),yt=Nt[0],kt=Nt[1],Dt=Object(i.useState)(1),Ct=Object(j.a)(Dt,2),Et=Ct[0],Pt=Ct[1],At=Object(i.useState)(0),Tt=Object(j.a)(At,2),zt=Tt[0],wt=Tt[1],_t=Object(i.useState)([]),Mt=Object(j.a)(_t,2),Lt=Mt[0],Gt=Mt[1],Ft=Object(i.useState)([]),It=Object(j.a)(Ft,2),Rt=It[0],Yt=It[1],Xt=Object(i.useState)([]),Bt=Object(j.a)(Xt,2),Ut=Bt[0],Wt=Bt[1],Ht=Object(i.useState)([]),Kt=Object(j.a)(Ht,2),qt=Kt[0],Vt=Kt[1],Jt=Object(i.useState)({}),Qt=Object(j.a)(Jt,2),Zt=Qt[0],$t=Qt[1],ea=Object(i.useState)({}),ta=Object(j.a)(ea,2),aa=ta[0],ia=ta[1],ca=Object(i.useState)({}),sa=Object(j.a)(ca,2),na=sa[0],la=sa[1],ra=Object(i.useState)(!1),da=Object(j.a)(ra,2),ja=da[0],oa=da[1];function ba(e){return void 0!==e&&void 0!==e.rarity?" r"+e.rarity:""}return Object(i.useEffect)((function(){e.bp>1e3?(N(3e3),C(3e3),z(3e3),F(3e3),U(3e3)):(N(1e3),C(1e3),z(1e3),F(1e3),U(1e3))}),[e.bp]),Object(i.useEffect)((function(){for(var e=Object.keys(o("class")),t=[],a=[],i=0;i<e.length;i++)t.push(0),a.push({}),e[i]===je&&Qe(i+1);Gt(t),Yt(a)}),[je,o]),Object(i.useEffect)((function(){s?(oa(!1),w.a.get(m+"/getBuild?id="+s).then((function(t){var a;$(t.data.creator),ne(t.data.build_name),oe(o("class",t.data.class1,"name",!0)),Oe(o("class",t.data.class2,"name",!0));var i=JSON.parse(t.data.data);xe(i.level),Ne(i.secondaryLevel),Gt(i.points),Yt(i.skillPointData),$t(null!==(a=i.foodPointData)&&void 0!==a?a:{});var c=e.GetData("weapon_existence_data"),s=o("weapon_type",i.weaponType),n=o("weapon",i.weaponBaseName),l=o("potential",n.potential_id,void 0,!0),r=o("potential_data"),d=[];for(var j in r)j.includes(l.name)&&d.push(e.GetData("potential_data",j));var b=Array.isArray(c)?c.filter((function(e){return e.weapon_type_id===s.id&&e.weapon_id===n.id}))[0]:void 0;ht([s,n,l,d,b]),mt(o("armor",i.armor1Name)),vt(o("armor",i.armor2Name)),kt(o("armor",i.armor3Name))})).catch((function(e){console.log(e.message)})).finally((function(){oa(!0)}))):oa(!0)}),[s,o,m,e]),Object(i.useEffect)((function(){var e;la(null!==(e=function(e){var t={pp_consumption:"Rich",pp_recovery:"Light",weak_point_dmg:"Crisp",hp_recovery:"Robust"},a={potency:"Meat",pp:"Fruit",dmg_res:"Vegetable",hp:"Seafood"},i={};Object.keys(o("food_mult","0")).filter((function(e){return"id"!==e&&"amount"!==e})).forEach((function(e){i[e]={count:0}})),Object.keys(e).map((function(t){return Object(r.a)(Object(r.a)({},o("food",t)),{},{amount:e[t]})})).forEach((function(e){for(var t=0,a=Object.keys(e);t<a.length;t++){var c=a[t];c in i&&e[c]&&(i[c].count+=e.amount)}}));var c={};return Object.keys(i).filter((function(e){return i[e].count>0})).forEach((function(e){var s;return c[e]=Object(r.a)(Object(r.a)({},i[e]),{},{from:null!==(s=t[e])&&void 0!==s?s:a[e]})})),c}(Zt))&&void 0!==e?e:[])}),[Zt,o]),Object(g.jsxs)(g.Fragment,{children:[Object(g.jsxs)(h.a,{children:[Object(g.jsx)("title",{children:"".concat(ce," by ").concat(Q," - ").concat(p)}),Object(g.jsx)("meta",{property:"og:title",content:"If this works then this is awesome"}),Object(g.jsx)("meta",{property:"og:description",content:"If it doesn't work I hate life."}),Object(g.jsx)("meta",{property:"og:image",content:"http://projectdivar.com:3001/favicon.ico"})]}),Object(g.jsxs)("div",{className:"main",children:[Object(g.jsxs)("div",{className:"containerA",children:[Object(g.jsxs)("div",{className:"box basicInfoBox",children:[Object(g.jsx)("div",{className:"boxTitleBar",children:Object(g.jsx)("h1",{children:"Basic Information"})}),Object(g.jsxs)(O.a,{showLoadingAnimation:!0,ready:ja,type:"media",rows:12,children:[Object(g.jsxs)("div",{className:"basicInfo",children:[Object(g.jsx)("div",{style:{gridArea:"author"},children:"Author"}),Object(g.jsx)("div",{style:{gridArea:"build"},children:"Build Name"}),Object(g.jsx)("div",{style:{gridArea:"class"},onClick:function(){Be(!0)},children:"Class"}),Object(g.jsx)("div",{style:{gridArea:"subclass"},onClick:function(){Vt(Object(P.a)(Lt)),Wt(function(e){var t,a=[],i=Object(l.a)(e);try{for(i.s();!(t=i.n()).done;){var c=t.value;a.push(Object(r.a)({},c))}}catch(s){i.e(s)}finally{i.f()}return a}(Rt)),Ke(!0)},children:"Sub-Class"}),Object(g.jsx)("div",{style:{gridArea:"class2"},children:Object(g.jsx)(J,{editClass:0,setClassNameSetter:wt,GetData:e.GetData,setClassName:oe,name:je,setClassSelectWindowOpen:Be})}),Object(g.jsx)("div",{style:{gridArea:"subclass2"},children:Object(g.jsx)(J,{editClass:1,setClassNameSetter:wt,GetData:e.GetData,setClassName:Oe,name:ue,setClassSelectWindowOpen:Be})}),Object(g.jsx)("div",{style:{gridArea:"player",textAlign:"right"},children:Object(g.jsx)(K,{setData:$,data:Q})}),Object(g.jsx)("div",{style:{gridArea:"character",textAlign:"right"},children:Object(g.jsx)(K,{setData:ne,data:ce})}),Object(g.jsx)("div",{style:{gridArea:"classlv",textAlign:"right"},children:Object(g.jsx)(K,{prefix:"Lv.",setData:xe,data:pe,type:"number"})}),Object(g.jsx)("div",{style:{gridArea:"subclasslv",textAlign:"right"},children:Object(g.jsx)(K,{prefix:"Lv.",setData:Ne,data:Se,type:"number"})})]}),Object(g.jsxs)("div",{className:"statsInfo",children:[Object(g.jsx)("div",{style:{gridArea:"bp"},children:"Battle Power"}),Object(g.jsx)("div",{style:{gridArea:"hp"},children:"HP"}),Object(g.jsx)("div",{style:{gridArea:"pp"},children:"PP"}),Object(g.jsx)("div",{style:{gridArea:"atk"},children:"Attack"}),Object(g.jsx)("div",{style:{gridArea:"def"},children:"Defense"}),Object(g.jsx)("div",{style:{gridArea:"wepUp"},children:"Weapon Up"}),Object(g.jsx)("div",{style:{gridArea:"res"},children:"Ailment Resist."}),Object(g.jsx)("div",{style:{gridArea:"dmgRes",border:"0"},children:"Damage Resist."}),Object(g.jsx)("div",{style:{gridArea:"bp2"},children:e.bp}),Object(g.jsx)("div",{style:{gridArea:"hp2"},children:e.hp}),Object(g.jsx)("div",{style:{gridArea:"pp2"},children:e.pp}),Object(g.jsx)("div",{style:{gridArea:"atk2"},children:e.statDisplayAtk}),Object(g.jsx)("div",{style:{gridArea:"def2"},children:e.def}),Object(g.jsxs)("div",{style:{gridArea:"wepUp2",color:"#ffb74c"},children:[Object(g.jsx)("img",{alt:"",src:"/icons/mel.png"})," +",(100*e.weaponUp1).toFixed(1),"%",Object(g.jsx)("br",{}),Object(g.jsx)("img",{alt:"",src:"/icons/tec.png"})," +",(100*e.weaponUp3).toFixed(1),"%"]}),Object(g.jsxs)("div",{style:{gridArea:"res2"},children:[Object(g.jsx)("img",{alt:"",src:"/icons/status/burn.png"})," ",(100*e.burnResist).toFixed(1),"%",Object(g.jsx)("br",{}),Object(g.jsx)("img",{alt:"",src:"/icons/status/shock.png"})," ",(100*e.shockResist).toFixed(1),"%",Object(g.jsx)("br",{}),Object(g.jsx)("img",{alt:"",src:"/icons/status/panic.png"})," ",(100*e.panicResist).toFixed(1),"%",Object(g.jsx)("br",{}),Object(g.jsx)("img",{alt:"",src:"/icons/status/stun.png"})," ",(100*e.stunResist).toFixed(1),"%",Object(g.jsx)("br",{})]}),Object(g.jsxs)("div",{style:{gridArea:"dmgRes2",border:"0"},children:[(100*e.damageResist).toFixed(1),"%"]}),Object(g.jsx)("div",{style:{gridArea:"bpGraph"},children:Object(g.jsx)("div",{className:"barGraph",children:Object(g.jsx)("span",{className:"barOverlay",style:{background:"linear-gradient(90deg,transparent 0% "+e.bp/S*100+"%,black "+e.bp/S*100+"%)"},children:"\xa0"})})}),Object(g.jsx)("div",{style:{gridArea:"hpGraph"},children:Object(g.jsx)("div",{className:"barGraph",children:Object(g.jsx)("span",{className:"barOverlay",style:{background:"linear-gradient(90deg,transparent 0% "+e.hp/D*100+"%,black "+e.hp/D*100+"%)"},children:"\xa0"})})}),Object(g.jsx)("div",{style:{gridArea:"ppGraph"},children:Object(g.jsx)("div",{className:"barGraph",children:Object(g.jsx)("span",{className:"barOverlay",style:{background:"linear-gradient(90deg,transparent 0% "+e.pp/T*100+"%,black "+e.pp/T*100+"%)"},children:"\xa0"})})}),Object(g.jsx)("div",{style:{gridArea:"atkGraph"},children:Object(g.jsx)("div",{className:"barGraph",children:Object(g.jsx)("span",{className:"barOverlay",style:{background:"linear-gradient(90deg,transparent 0% "+e.statDisplayAtk/G*100+"%,black "+e.statDisplayAtk/G*100+"%)"},children:"\xa0"})})}),Object(g.jsx)("div",{style:{gridArea:"defGraph"},children:Object(g.jsx)("div",{className:"barGraph",children:Object(g.jsx)("span",{className:"barOverlay",style:{background:"linear-gradient(90deg,transparent 0% "+e.def/X*100+"%,black "+e.def/X*100+"%)"},children:"\xa0"})})}),Object(g.jsx)("div",{style:{gridArea:"wepUp3",color:"#ffb74c"},children:Object(g.jsxs)("div",{children:[Object(g.jsx)("img",{alt:"",src:"/icons/rng.png"})," +",(100*e.weaponUp2).toFixed(1),"%"]})}),Object(g.jsx)("div",{style:{gridArea:"res3"},children:Object(g.jsxs)("div",{children:[Object(g.jsx)("img",{alt:"",src:"/icons/status/freeze.png"})," ",(100*e.freezeResist).toFixed(1),"%",Object(g.jsx)("br",{}),Object(g.jsx)("img",{alt:"",src:"/icons/status/blind.png"})," ",(100*e.blindResist).toFixed(1),"%",Object(g.jsx)("br",{}),Object(g.jsx)("img",{alt:"",src:"/icons/status/poison.png"})," ",(100*e.poisonResist).toFixed(1),"%",Object(g.jsx)("br",{})]})})]}),Object(g.jsx)("section",{className:"saveControls",children:Object(g.jsx)("button",{onClick:function(){!function(){var t,a,i,c={level:pe,secondaryLevel:Se,weaponBaseName:null===(t=bt[1])||void 0===t?void 0:t.name,weaponType:null===(a=bt[0])||void 0===a?void 0:a.name,weaponExistenceID:null===(i=bt[4])||void 0===i?void 0:i.id,armor1Name:null===gt||void 0===gt?void 0:gt.name,armor2Name:null===ft||void 0===ft?void 0:ft.name,armor3Name:null===yt||void 0===yt?void 0:yt.name,points:Lt,skillPointData:Rt,foodPointData:Zt};w.a.post(m+"/submitBuild",{id:s,username:b,pass:u,creator:Q,build_name:ce,class1:je,class2:ue,data:JSON.stringify(c)}).then((function(t){var a=Object(L.e)(d.pathname,{path:e.path,exact:!0,strict:!1});n.push(a.path.replace("/:BUILDID","")+"/"+t.data.id)}))}()},children:"Save Build"})})]})]}),Object(g.jsxs)("div",{className:"box",children:[Object(g.jsx)("div",{className:"boxTitleBar",children:Object(g.jsx)("h1",{children:"Equip"})}),Object(g.jsxs)("div",{className:"equipPalette",children:[Object(g.jsxs)("div",{onClick:function(){tt(!0)},className:"equipPaletteSlot",children:[Object(g.jsx)("h3",{children:"Weapons"}),Object(g.jsx)("div",{className:"equipPaletteSlotWrapper"+ba(bt[1]),children:Object(g.jsxs)(O.a,{style:{width:52,height:48},showLoadingAnimation:!0,ready:ja,type:"rect",children:[Object(g.jsx)("span",{children:"1"}),Object(g.jsx)("img",{alt:"",className:"r4",src:x(null===(t=bt[4])||void 0===t?void 0:t.icon)})]})})]}),Object(g.jsxs)("div",{onClick:function(){Pt(1),st(!0)},className:"equipPaletteSlot"+ba(gt),children:[Object(g.jsx)("h3",{children:"Armor 1"}),Object(g.jsx)("div",{className:"equipPaletteSlotWrapper",children:Object(g.jsx)(O.a,{style:{width:52,height:48},showLoadingAnimation:!0,ready:ja,type:"rect",children:Object(g.jsx)("img",{alt:"",className:"r3",src:x(gt.icon)})})})]}),Object(g.jsxs)("div",{onClick:function(){Pt(2),st(!0)},className:"equipPaletteSlot"+ba(ft),children:[Object(g.jsx)("h3",{children:"Armor 2"}),Object(g.jsx)("div",{className:"equipPaletteSlotWrapper",children:Object(g.jsx)(O.a,{style:{width:52,height:48},showLoadingAnimation:!0,ready:ja,type:"rect",children:Object(g.jsx)("img",{alt:"",className:"r3",src:x(ft.icon)})})})]}),Object(g.jsxs)("div",{onClick:function(){Pt(3),st(!0)},className:"equipPaletteSlot"+ba(yt),children:[Object(g.jsx)("h3",{children:"Armor 3"}),Object(g.jsx)("div",{className:"equipPaletteSlotWrapper",children:Object(g.jsx)(O.a,{style:{width:52,height:48},showLoadingAnimation:!0,ready:ja,type:"rect",children:Object(g.jsx)("img",{alt:"",className:"r3",src:x(yt.icon)})})})]})]})]})]}),Object(g.jsx)("div",{className:"containerB",children:Object(g.jsxs)("div",{className:"box equipWindow",children:[Object(g.jsx)("div",{className:"boxTitleBar",children:Object(g.jsx)("h1",{children:"Equipped Weapon"})}),Object(g.jsxs)(O.a,{showLoadingAnimation:!0,ready:"no data"!==o(e)&&ja,type:"media",rows:12,children:[Object(g.jsxs)("div",{className:"equipNameWrapper",children:[Object(g.jsx)("div",{className:"equipName",children:Object(g.jsx)("h2",{className:"rifle",children:ae(bt)})}),Object(g.jsxs)("div",{className:"equipEnhancement editOverlayWrapper",children:[Object(g.jsx)("div",{className:"editOverlay",children:Object(g.jsxs)("p",{children:[Object(g.jsx)(Y.a,{})," Edit"]})}),"+40"]})]}),Object(g.jsxs)(V,{pages:3,currentPage:Ae,setCurrentPage:Te,children:[Object(g.jsx)(Y.a,{})," Edit Details"]}),1===Ae?Object(g.jsxs)(g.Fragment,{children:[Object(g.jsxs)("div",{className:"itemDetailsGridTop",children:[Object(g.jsxs)("div",{className:"itemDetailsIcon editOverlayWrapper"+ba(bt[1]),onClick:function(){tt(!0)},children:[Object(g.jsx)("div",{className:"editOverlay",children:Object(g.jsxs)("p",{children:[Object(g.jsx)(Y.a,{})," Edit"]})}),Object(g.jsx)("img",{alt:"",src:x(null===(a=bt[4])||void 0===a?void 0:a.icon)})]}),Object(g.jsx)("div",{className:"itemDetailsProperties",children:Object(g.jsxs)("div",{className:"itemDetailsPropertiesWrapper",children:[Object(g.jsx)("div",{style:{gridArea:"rarity"},children:"Rarity"}),Object(g.jsx)("div",{style:{gridArea:"stars"},className:ba(bt[1]),children:Object(g.jsx)("div",{className:"itemRarityWrapper",children:"-"})}),Object(g.jsx)("div",{style:{gridArea:"attack"},children:"Attack"}),Object(g.jsx)("div",{style:{gridArea:"attackDisplay"},children:"282"}),Object(g.jsx)("div",{style:{gridArea:"element"},children:"Element"}),Object(g.jsx)("div",{style:{gridArea:"elementDisplay"},children:"-"}),Object(g.jsx)("div",{style:{gridArea:"conditions"},children:"Equip Conditons"}),Object(g.jsx)("div",{style:{gridArea:"conditionsDisplay"},children:"Lv.15 (Current Lv.20)"})]})})]}),Object(g.jsxs)("div",{className:"itemDetailsGridBottom editOverlayWrapper",children:[Object(g.jsx)("div",{className:"editOverlay",onClick:function(){dt(!0)},children:Object(g.jsxs)("p",{children:[Object(g.jsx)(Y.a,{})," Edit"]})}),Object(g.jsx)("div",{className:"itemPotential",children:Object(g.jsx)("span",{className:"pot",children:"Soulspring Unit Lv.3"})}),Object(g.jsx)("div",{className:"itemFixa",children:Object(g.jsx)("span",{className:"fixa",children:"Fixa Attack Lv.3"})}),Object(g.jsxs)("div",{className:"itemDetailsAugment",children:[Object(g.jsx)("span",{className:"aug",children:"Augment"}),Object(g.jsxs)("div",{className:"itemDetailsAugmentWrapper",children:[Object(g.jsx)("div",{children:Object(g.jsx)("span",{children:"Precision III"})}),Object(g.jsx)("div",{}),Object(g.jsx)("div",{}),Object(g.jsx)("div",{})]})]})]})]}):2===Ae?Object(g.jsxs)("div",{className:"statsDetails",children:[Object(g.jsx)("div",{style:{gridArea:"enhance1"},children:"Enhancement Lv."}),Object(g.jsx)("div",{style:{gridArea:"variance1"},children:"Damage Adj."}),Object(g.jsx)("div",{style:{gridArea:"weaponup"},children:"Weapon Up"}),Object(g.jsx)("div",{style:{gridArea:"ailment1"},children:"Ailment Resist."}),Object(g.jsx)("div",{style:{gridArea:"class1"},children:"Available Classes"}),Object(g.jsx)("div",{style:{gridArea:"mw1"},children:"Multi-weapon"}),Object(g.jsx)("div",{style:{gridArea:"enhance2"},children:"40"}),Object(g.jsx)("div",{style:{gridArea:"variance2"},children:"75.0% ~ 100%"}),Object(g.jsx)("div",{style:{gridArea:"mel"},className:"mel",children:"9.9%"}),Object(g.jsxs)("div",{style:{gridArea:"ailment2"},children:[Object(g.jsx)("span",{className:"burn",children:"0.0%"}),Object(g.jsx)("br",{}),Object(g.jsx)("span",{className:"blind",children:"0.0%"}),Object(g.jsx)("br",{}),Object(g.jsx)("span",{className:"stun",children:"0.0%"})]}),Object(g.jsxs)("div",{style:{gridArea:"class2"},children:[Object(g.jsx)("img",{alt:"",src:x("icons/ra.png")})," ",Object(g.jsx)("img",{alt:"",src:x("icons/UINGSClassGu.png")})]}),Object(g.jsxs)("div",{style:{gridArea:"mw2"},children:[Object(g.jsx)("img",{alt:"",src:x("icons/NGSUIItemAssaultRifleMini.png")})," ",Object(g.jsx)("img",{alt:"",src:x("icons/NGSUIItemTalisMini.png")})]}),Object(g.jsx)("div",{style:{gridArea:"rng"},className:"rng",children:"9.9%"}),Object(g.jsxs)("div",{style:{gridArea:"ailment3"},children:[Object(g.jsx)("span",{className:"freeze",children:"0.0%"}),Object(g.jsx)("br",{}),Object(g.jsx)("span",{className:"panic",children:"0.0%"})]}),Object(g.jsx)("div",{style:{gridArea:"tec"},className:"tec",children:"9.9%"}),Object(g.jsxs)("div",{style:{gridArea:"ailment4"},children:[Object(g.jsx)("span",{className:"shock",children:"0.0%"}),Object(g.jsx)("br",{}),Object(g.jsx)("span",{className:"poison",children:"0.0%"})]})]}):3===Ae?Object(g.jsxs)("div",{className:"augmentDetails",children:[Object(g.jsx)("div",{className:"augmentDetailsListHeader",children:Object(g.jsx)("h3",{children:"Ability Details"})}),Object(g.jsx)("div",{className:"augmentDetailsStatsHeader",children:Object(g.jsx)("h3",{children:"Stat Adjustment"})}),Object(g.jsx)("div",{className:"augmentDetailsList customScrollbar noSelect",children:Object(g.jsxs)("ul",{children:[Object(g.jsx)("li",{className:"pot",children:"Dynamo Unit Lv.3"}),Object(g.jsx)("li",{className:"fixa",children:"Fixa Attack Lv.3"}),Object(g.jsx)("li",{className:"aug",children:"test"}),Object(g.jsx)("li",{className:"aug",children:"test"}),Object(g.jsx)("li",{className:"aug",children:"test"}),Object(g.jsx)("li",{className:"aug",children:"test"})]})}),Object(g.jsx)("div",{className:"augmentDetailsStats",children:Object(g.jsx)("table",{children:Object(g.jsxs)("tbody",{children:[Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"HP"}),Object(g.jsx)("td",{children:"+99"})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"PP"}),Object(g.jsx)("td",{children:"+9"})]})]})})})]}):Object(g.jsx)(g.Fragment,{children:"hi2"})]})]})}),Object(g.jsxs)("div",{className:"containerC",children:[Object(g.jsxs)("div",{className:"box",children:[Object(g.jsx)("div",{className:"boxTitleBar",children:Object(g.jsx)("h1",{children:"Current Effects"})}),Object(g.jsxs)(O.a,{showLoadingAnimation:!0,ready:"no data"!==o(e)&&ja,type:"media",rows:7,children:[Object(g.jsx)(V,{pages:2,currentPage:De,setCurrentPage:Ce}),1===De?Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("h3",{children:"Effect Name"}),Object(g.jsxs)("ul",{className:"infoBuffs",children:[Object(g.jsxs)("li",{onClick:function(){ia(Object(r.a)({},Zt)),Ie(!0)},children:["Food Boost Effect",Object(g.jsxs)("ul",{children:[0===Object.keys(na).length&&Object(g.jsx)("li",{children:"Add Quick Food"}),Object.keys(na).map((function(e){return Object(g.jsxs)("li",{children:[Object(g.jsx)("img",{alt:"",src:"https://i.imgur.com/TQ8EBW2.png"}),"\u2002[",na[e].from,"] ",e," +",na[e].count]})}))]})]}),Object(g.jsxs)("li",{children:["Shifta / Deband",Object(g.jsxs)("ul",{children:[Object(g.jsxs)("li",{children:[Object(g.jsx)("img",{alt:"",src:"https://i.imgur.com/VIYYNIm.png"}),"\u2002Potency +5.0%"]}),Object(g.jsxs)("li",{children:[Object(g.jsx)("img",{alt:"",src:"https://i.imgur.com/VIYYNIm.png"}),"\u2002Damage Resistance +10.0%"]})]})]}),Object(g.jsxs)("li",{children:["Region Mag Boost",Object(g.jsx)("ul",{children:Object(g.jsxs)("li",{children:[Object(g.jsx)("img",{alt:"",src:"https://i.imgur.com/N6M74Qr.png"}),"\u2002Potency +5.0%"]})})]})]})]}):Object(g.jsx)(g.Fragment,{})]})]}),Object(g.jsxs)("div",{className:"box",children:[Object(g.jsx)("div",{className:"boxTitleBar",children:Object(g.jsx)("h1",{children:"Damage Stats"})}),Object(g.jsxs)(O.a,{showLoadingAnimation:!0,ready:ja,type:"media",rows:6,children:[Object(g.jsx)(V,{pages:3,currentPage:_e,setCurrentPage:Me}),Object(g.jsx)("table",{children:Object(g.jsx)("tbody",{children:1===_e?Object(g.jsxs)(g.Fragment,{children:[Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Critical Hit Rate"}),Object(g.jsx)("td",{children:"5%"})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Critical Multiplier"}),Object(g.jsx)("td",{children:"120%"})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Midrange"}),Object(g.jsx)("td",{children:"126"})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Critical"}),Object(g.jsx)("td",{children:"152"})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Effective"}),Object(g.jsx)("td",{children:Object(g.jsx)("span",{className:"ye",children:"127"})})]})]}):Object(g.jsxs)(g.Fragment,{children:[Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Critical Hit Rate"}),Object(g.jsx)("td",{children:"-"})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Critical Multiplier"}),Object(g.jsx)("td",{children:"-"})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Midrange"}),Object(g.jsx)("td",{children:"-"})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Critical"}),Object(g.jsx)("td",{children:"-"})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"Effective"}),Object(g.jsx)("td",{children:Object(g.jsx)("span",{className:"ye",children:"-"})})]})]})})})]})]})]})]}),Object(g.jsx)(te,{class:je,subClass:ue,setClassName:oe,setEditClass:wt,editClass:zt,setSubClassName:Oe,modalOpen:Xe,setModalOpen:Be,GetData:e.GetData}),Object(g.jsx)(B.a,{ariaHideApp:!1,isOpen:He,onRequestClose:function(){Ke(!1)},shouldFocusAfterRender:!0,shouldCloseOnOverlayClick:!0,shouldCloseOnEsc:!0,className:"modal",overlayClassName:"modalOverlay",children:Object(g.jsxs)("div",{className:"box skillTreeBox",children:[Object(g.jsxs)("div",{className:"boxTitleBar",children:[Object(g.jsx)("h1",{children:"Class Skill Tree"}),Object(g.jsx)("div",{className:"boxExit",onClick:function(){Ke(!1)}})]}),Object(g.jsx)(V,{pages:Object.keys(e.GetData("class")).length,pageNames:Object.keys(e.GetData("class")).map((function(e){return e})),pageDisplay:Object.keys(e.GetData("class")).map((function(t){return Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("img",{className:"boxMenuClassIcon",alt:"",src:e.GetData("class",t,"icon")})," ",t]})})),currentPage:Je,setCurrentPage:Qe}),Object(g.jsx)(se,{skillPointData:Rt,setSkillPointData:Yt,page:Je,points:Lt,setPoints:Gt,GetData:e.GetData,cl:Object.keys(e.GetData("class"))[Je-1]}),Object(g.jsxs)("div",{className:"skillPoints",children:[Object(g.jsxs)("div",{children:["Your Skill Points",Object(g.jsx)("span",{children:20-Lt[Je-1]})]}),Object(g.jsxs)("div",{children:["SP",Object(g.jsx)("span",{}),Lt[Je-1]]})]}),Object(g.jsxs)("div",{onClick:function(){Ke(!1)},className:"skillConfirm",children:[Object(g.jsx)("div",{children:"Confirm"}),Object(g.jsx)("div",{onClick:function(){Gt(qt),Yt(Ut),Ke(!1)},children:"Cancel"})]})]})}),Object(g.jsx)(Z,{title:"Weapon Selection",modalOpen:et,setModalOpen:tt,GetData:e.GetData,pageNames:["All","Rifle","Launcher","Rod","Talis"],sortItems:["Standard Sort","Rarity","Attack","Potency"],filter:!0,dataFunction:function(){var t=e.GetData("weapon_existence_data");return Array.isArray(t)?t.map((function(t){var a=e.GetData("weapon_type",t.weapon_type_id,void 0,!0),i=e.GetData("weapon",t.weapon_id,void 0,!0),c=e.GetData("potential",i.potential_id,void 0,!0),s=e.GetData("potential_data"),n=[];for(var l in s)l.includes(c.name)&&n.push(e.GetData("potential_data",l));return[a,i,c,n,t]})):[]},filterFunction:function(e,t){switch(e){case 2:return"Assault Rifle"===t[0].name;case 3:return"Launcher"===t[0].name;case 4:return"Rod"===t[0].name;case 5:return"Talis"===t[0].name;default:return!0}},searchFieldFunction:function(e,t){return!(e.length>0)||(t[1].name.toLowerCase()+" "+t[0].name.toLowerCase()).includes(e.trim().toLowerCase())},sortOrderFunction:function(e,t,a){switch(e){case"Rarity":return a[1].rarity-t[1].rarity;case"Attack":return a[1].atk-t[1].atk;default:return 0}},displayFunction:function(e){var t;return Object(g.jsxs)("div",{className:"itemWrapper r"+e[1].rarity,onClick:function(){ht(e),tt(!1)},children:[Object(g.jsx)("div",{className:"itemImgWrapper",children:Object(g.jsx)("img",{alt:"",src:x(null===(t=e[4])||void 0===t?void 0:t.icon)})}),Object(g.jsx)("div",{className:"itemNameWrapper rifle",children:ae(e)}),Object(g.jsx)("div",{className:"itemRarityWrapper",children:"\xa0"}),Object(g.jsxs)("div",{className:"itemPropertiesWrapper",children:[Object(g.jsx)("span",{className:"atk",children:e[1].atk}),Object(g.jsx)("span",{className:"pot",id:"mouseover-tooltip"+e[0].id+"_"+e[1].id+"_"+e[2].id+"_"+e[3].id,children:e[2].name}),Object(g.jsx)(W,{target:"mouseover-tooltip"+e[0].id+"_"+e[1].id+"_"+e[2].id+"_"+e[3].id,children:Object(g.jsx)(g.Fragment,{children:e[3].map((function(e,t){return Object(g.jsxs)(c.a.Fragment,{children:[0!==t&&Object(g.jsx)("br",{}),e.name,": ",e.description?e.description.split("\\n").map((function(e,t){return Object(g.jsxs)(c.a.Fragment,{children:[e,Object(g.jsx)("br",{})," "]},t)})):Object(g.jsx)(c.a.Fragment,{},t)]},t)}))})})]})]})}}),Object(g.jsx)(Z,{title:"Armor Selection - Slot "+Et,modalOpen:ct,setModalOpen:st,GetData:e.GetData,pageNames:[],sortItems:["Standard Sort","Rarity","HP","PP","Melee Potency","Range Potency","Tech Potency"],filter:!0,dataFunction:function(){var t=e.GetData("armor");return"object"===typeof t&&null!==t?Object.keys(t).map((function(e){return t[e]})):[]},filterFunction:function(e,t){return t.slot===Et},searchFieldFunction:function(e,t){return!(e.length>0)||t.name.trim().toLowerCase().includes(e.toLowerCase())},sortOrderFunction:function(e,t,a){switch(e){case"Rarity":return a.rarity-t.rarity;case"HP":return a.hp-t.hp;case"PP":return a.pp-t.pp;case"Melee Potency":return a.mel_dmg-t.mel_dmg;case"Range Potency":return a.rng_dmg-t.rng_dmg;case"Tech Potency":return a.tec_dmg-t.tec_dmg;default:return 0}},displayFunction:function(e){return Object(g.jsxs)("div",{className:"itemWrapper r"+e.rarity,onClick:function(){switch(Et){case 1:mt(e);break;case 2:vt(e);break;case 3:kt(e);break;default:mt(e)}st(!1)},children:[Object(g.jsx)("div",{className:"itemImgWrapper",children:Object(g.jsx)("img",{alt:"",src:x(null===e||void 0===e?void 0:e.icon)})}),Object(g.jsx)("div",{className:"itemNameWrapper rifle",children:e.name}),Object(g.jsx)("div",{className:"itemRarityWrapper",style:{gridArea:"rarity"},children:"\xa0"}),Object(g.jsx)("div",{className:"itemPropertiesWrapper",children:Object(g.jsx)("span",{className:"atk",children:e.def})})]})}}),Object(g.jsx)(le,{GetData:e.GetData,foodMenuWindowOpen:Fe,setFoodMenuWindowOpen:Ie,foodPointData:Zt,setFoodPointData:$t,prevFoodPointData:aa}),Object(g.jsx)(B.a,{ariaHideApp:!1,isOpen:rt,onRequestClose:function(){dt(!1)},shouldFocusAfterRender:!0,shouldCloseOnOverlayClick:!0,shouldCloseOnEsc:!0,className:"modal",overlayClassName:"modalOverlayAugment",children:Object(g.jsxs)("div",{className:"augmentSelectorPopup",children:[Object(g.jsx)("div",{className:"box",children:Object(g.jsx)("div",{className:"boxTitleBar",children:Object(g.jsx)("h1",{children:"hi"})})}),Object(g.jsxs)("div",{className:"box equipWindow",children:[Object(g.jsx)("div",{className:"boxTitleBar",children:Object(g.jsx)("h1",{children:"Equipped Weapon"})}),Object(g.jsxs)("div",{className:"equipNameWrapper",children:[Object(g.jsx)("div",{className:"equipName",children:Object(g.jsx)("h2",{className:"rifle",children:ae(bt)})}),Object(g.jsxs)("div",{className:"equipEnhancement editOverlayWrapper",children:[Object(g.jsx)("div",{className:"editOverlay",children:Object(g.jsxs)("p",{children:[Object(g.jsx)(Y.a,{})," Edit"]})}),"+40"]})]}),Object(g.jsxs)("div",{className:"augmentDetails",children:[Object(g.jsx)("div",{className:"augmentDetailsListHeader",children:Object(g.jsx)("h3",{children:"Ability Details"})}),Object(g.jsx)("div",{className:"augmentDetailsStatsHeader",children:Object(g.jsx)("h3",{children:"Stat Adjustment"})}),Object(g.jsx)("div",{className:"augmentDetailsList customScrollbar noSelect",children:Object(g.jsxs)("ul",{children:[Object(g.jsx)("li",{className:"pot",children:"Dynamo Unit Lv.3"}),Object(g.jsx)("li",{className:"fixa",children:"Fixa Attack Lv.3"}),Object(g.jsx)("li",{className:"aug",children:"test"}),Object(g.jsx)("li",{className:"aug",children:"test"}),Object(g.jsx)("li",{className:"aug",children:"test"}),Object(g.jsx)("li",{className:"aug",children:"test"})]})}),Object(g.jsx)("div",{className:"augmentDetailsStats",children:Object(g.jsx)("table",{children:Object(g.jsxs)("tbody",{children:[Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"HP"}),Object(g.jsx)("td",{children:"+99"})]}),Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:"PP"}),Object(g.jsx)("td",{children:"+9"})]})]})})})]})]})]})})]})},de=a(29),je=a.n(de),oe=a(70),be=a(20),he=a(174),ue=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_GITPOD_WORKSPACE_URL||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_BACKENDURL||"https://projectdivar.com:4504",Oe="NGS Planner";function ge(e){return ue+(e.TESTMODE?"/test":"")}function me(e){return Object(g.jsx)(g.Fragment,{children:Object(g.jsxs)("div",{className:"box",children:[Object(g.jsx)("div",{className:"boxTitleBar",children:Object(g.jsx)("h1",{children:e.title})}),e.children]})})}function pe(e){return Object(g.jsx)("span",{className:e.classes,children:e.children})}function xe(e){var t=Object(i.useState)(e.value),a=Object(j.a)(t,2),c=a[0],s=a[1],n=Object(i.useState)(!1),l=Object(j.a)(n,2),r=l[0],d=l[1],o=Object(i.useState)(!1),b=Object(j.a)(o,2),h=b[0],u=b[1];function O(t){s(t.currentTarget.value),e.callback4&&e.callback4(t.currentTarget.value)}function m(t){e.callback?(u(!0),d(!1),e.callback(t.currentTarget.value).then((function(){d(!1)})).catch((function(){d(!0)})).then((function(){u(!1)}))):e.callback3&&e.callback3(t.currentTarget.value)}function p(t){e.callback2&&e.callback2(t,c)}return e.data?Object(g.jsxs)("select",{disabled:e.lockSubmission,className:r?"failedInput":h?"submitting":"",value:c,onKeyDown:function(e){p(e)},onChange:function(e){O(e)},onBlur:function(e){m(e)},children:[e.includeBlankValue&&Object(g.jsx)("option",{}),e.data.map((function(e){return Object(g.jsxs)("option",{value:e.id,children:[e.id," - ",e.name||e.username]},e.id)}))]}):Object(g.jsx)("input",{disabled:e.lockSubmission,className:r?"failedInput":h?"submitting":"",value:c,onKeyDown:function(e){p(e)},onChange:function(e){O(e)},onBlur:function(e){m(e)}})}function fe(e){var t={},a=e.TESTMODE;var s=Object(i.useState)([]),n=Object(j.a)(s,2),o=n[0],b=n[1],h=Object(i.useState)([]),u=Object(j.a)(h,2),O=u[0],m=u[1],p=Object(i.useState)(!1),x=Object(j.a)(p,2),f=x[0],v=x[1],S=Object(i.useReducer)((function(e,a){return"Clear"===a?t:(e[a.field]=a.value,e)}),t),N=Object(j.a)(S,2),D=N[0],C=N[1],E=Object(i.useState)(!1),P=Object(j.a)(E,2),A=P[0],T=P[1],z=Object(i.useState)([]),w=Object(j.a)(z,2),_=w[0],M=w[1],L=Object(i.useState)(!1),G=Object(j.a)(L,2),F=G[0],I=G[1],R=Object(i.useState)(!1),Y=Object(j.a)(R,2),X=Y[0],B=Y[1];return Object(i.useEffect)((function(){v(!0)}),[e.path,a]),Object(i.useEffect)((function(){var e,t=Object(l.a)(o);try{for(t.s();!(e=t.n()).done;){if("name"===e.value.name){I(!0);break}}}catch(a){t.e(a)}finally{t.f()}}),[o]),Object(i.useEffect)((function(){if(f){T(!0);var t={};be.get(e.BACKENDURL+e.path+"?pass="+e.password).then((function(a){var i=a.data.fields,c=a.data.rows;b(i.filter((function(e,t){return"id"!==e.name&&!(0===t&&"name"===e.name)})));var s=[];return i.filter((function(e){return"id"!==e.name&&e.name.includes("_id")})).forEach((function(a){s.push(be.get(e.BACKENDURL+"/"+a.name.replace("_id","")+"?pass="+e.password).then((function(e){t[a.name]=e.data.rows.sort((function(e,t){return t.id-e.id}))})))})),m(c),Promise.allSettled(s)})).then((function(){M(t),T(!1)})),v(!1)}}),[f,e.path,e.BACKENDURL,e.password]),Object(g.jsx)(g.Fragment,{children:A?Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Object(g.jsx)("img",{src:"/spinner.gif",alt:""})]}):Object(g.jsxs)(g.Fragment,{children:[" ",F&&Object(g.jsxs)("caption",{children:[Object(g.jsx)("label",{className:"buttonLabel",htmlFor:"uploads",children:"Import CSV"}),Object(g.jsx)("input",{onChange:function(t){var a=new FileReader;a.onload=function(t){var a=[];he(t.target.result,{columns:!0,skip_empty_lines:!0}).forEach((function(t){var i,c=Object(l.a)(o);try{for(c.s();!(i=c.n()).done;){var s=i.value;23!==s.dataTypeID&&701!==s.dataTypeID&&16!==s.dataTypeID||""!==t[s.name]||(t[s.name]=0)}}catch(n){c.e(n)}finally{c.f()}a.push(be.post(e.BACKENDURL+e.path,Object(r.a)(Object(r.a)({},t),{},{pass:e.password})))})),Promise.allSettled(a).then((function(){v(!0)}))},a.readAsText(t.target.files[0])},style:{opacity:0},id:"uploads",type:"file",accept:".txt,.csv"})]}),Object(g.jsx)("div",{children:Object(g.jsxs)("table",{children:[Object(g.jsx)("thead",{children:Object(g.jsxs)("tr",{children:[Object(g.jsx)("th",{className:"table-padding",children:Object(g.jsx)(y.a,{onClick:function(){!function(){if(!X){B(!0);var t,a=[],i=Object(l.a)(O);try{for(i.s();!(t=i.n()).done;){var c=t.value;document.getElementById("delete_"+c.id).checked&&a.push(be.delete(e.BACKENDURL+e.path,{data:{pass:e.password,id:c.id}}))}}catch(s){i.e(s)}finally{i.f()}Promise.allSettled(a).catch((function(e){alert(e.message)})).then((function(e){B(!1),v(!0)}))}}()},className:"trashButton"})}),o.map((function(e,t){return Object(g.jsx)(c.a.Fragment,{children:Object(g.jsx)("th",{scope:"col",className:"table-padding",children:e.name})},t)}))]})}),Object(g.jsxs)("tbody",{children:[Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{}),o.map((function(e,t){return Object(g.jsx)("td",{children:Object(g.jsx)(xe,{includeBlankValue:!0,data:_[e.name],callback4:function(t){C({field:e.name,value:t})}})},t)})),Object(g.jsxs)("td",{children:[Object(g.jsx)("input",{style:{display:"none"}}),Object(g.jsx)(k.a,{onClick:function(){X||(B(!0),be.post(e.BACKENDURL+e.path,Object(r.a)(Object(r.a)({},D),{},{pass:e.password})).then((function(){C("Clear"),v(!0)})).catch((function(e){alert(JSON.stringify(e.response.data))})).then((function(){B(!1)})))},className:"submitbutton"})]})]}),O.map((function(t){return Object(g.jsxs)("tr",{children:[Object(g.jsx)("td",{children:Object(g.jsx)("input",{id:"delete_"+t.id,type:"checkbox"})}),o.map((function(a,i){return Object(g.jsx)("td",{className:"table-padding table",children:Object(g.jsx)(xe,{lockSubmission:X,data:_[a.name],callback:function(i){return function(e,t,a,i){var c;return be.patch(t.BACKENDURL+t.path,(c={},Object(d.a)(c,a.name,"null"===e?null:e),Object(d.a)(c,"id",i.id),Object(d.a)(c,"pass",t.password),c))}(i,e,a,t)},callback2:function(e,t){if("Enter"!==e.key)return"Chill";e.currentTarget.blur()},value:String(t[a.name])})},t.id+"_"+i)}))]},t.id)}))]})]})})]})})}function ve(e){var t=Object(i.useState)(!0),a=Object(j.a)(t,2),s=a[0],n=a[1],l=Object(i.useState)(Object(g.jsx)("span",{style:{color:"black"}})),r=Object(j.a)(l,2),d=r[0],o=r[1],b=Object(i.useState)([]),h=Object(j.a)(b,2),u=h[0],O=h[1],m=Object(i.useState)(!0),p=Object(j.a)(m,2),x=p[0],f=p[1];return Object(i.useEffect)((function(){x&&(be.get(e.BACKENDURL+"/databases?pass="+e.password).then((function(e){O(e.data)})).catch((function(e){console.log(e.message)})).then((function(){n(!1)})),f(!1))}),[x,e.BACKENDURL,e.password]),Object(g.jsxs)(g.Fragment,{children:[s?Object(g.jsx)("img",{src:"/spinner.gif",alt:""}):Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("button",{className:"basichover",style:{backgroundColor:"navy"},onClick:function(){n(!0),o(Object(g.jsx)("span",{style:{color:"black"},children:"Uploading Test Database to Production..."})),be.post(e.BACKENDURL+"/databases/testtolive",{pass:e.password}).then((function(){o(Object(g.jsx)("span",{style:{color:"green"},children:"Success! Test Database is now live!"}))})).catch((function(e){o(Object(g.jsx)("span",{style:{color:"red"},children:e.message}))})).then((function(){n(!1)}))},children:"Apply TEST Database to LIVE Database"}),Object(g.jsx)("br",{}),Object(g.jsx)("br",{}),Object(g.jsx)("button",{className:"basichover",style:{backgroundColor:"maroon"},onClick:function(){n(!0),o(Object(g.jsx)("span",{style:{color:"black"},children:"Restoring Test Database using Live Database..."})),be.post(e.BACKENDURL+"/databases/livetotest",{pass:e.password}).then((function(){o(Object(g.jsx)("span",{style:{color:"green"},children:"Success! Live Database has been applied to the Test Database!"}))})).catch((function(e){o(Object(g.jsx)("span",{style:{color:"red"},children:e.message}))})).then((function(){n(!1)}))},children:"Reset TEST database using current LIVE Database"}),Object(g.jsx)("br",{}),Object(g.jsx)("br",{}),Object(g.jsx)("button",{className:"basichover",style:{backgroundColor:"darkgreen"},onClick:function(){n(!0),o(Object(g.jsx)("span",{style:{color:"black"},children:"Backing up the Live database..."})),be.post(e.BACKENDURL+"/databases/backup",{pass:e.password}).then((function(){o(Object(g.jsx)("span",{style:{color:"green"},children:"Success! Live Database has been saved!"}))})).catch((function(e){o(Object(g.jsx)("span",{style:{color:"red"},children:e.message}))})).then((function(){f(!0)}))},children:"Backup current LIVE Database"}),Object(g.jsx)("br",{}),Object(g.jsx)("br",{})]}),d,Object(g.jsx)("hr",{}),Object(g.jsx)("br",{}),Object(g.jsx)("br",{}),Object(g.jsx)("h2",{children:Object(g.jsx)("u",{children:"Current Databases"})}),Object(g.jsx)("br",{}),Object(g.jsx)("br",{}),Object(g.jsxs)("span",{style:{fontSize:"24px",top:"-16px",position:"relative",height:"64px",lineHeight:"64px",textAlign:"center"},children:[Object(g.jsx)(D.a,{className:"databaseIcon",style:{color:"green"}}),"Live Database"]}),"\xa0\xa0\xa0",Object(g.jsxs)("span",{style:{fontSize:"24px",top:"-16px",position:"relative",height:"64px",lineHeight:"64px",textAlign:"center"},children:[Object(g.jsx)(D.a,{className:"databaseIcon",style:{color:"red"}}),"Test Database"]}),Object(g.jsx)("br",{}),u.map((function(t,a){var i="";if("ngsplanner"!==t.datname&&"ngsplanner2"!==t.datname){var s=t.datname.replace("ngsplanner",""),l=new Date(s.slice(0,4),s.slice(4,6),s.slice(6,8),s.slice(8,10),s.slice(10,12),s.slice(12,14));return i=Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)(C.a,{className:"databaseIcon",style:{color:"blue"}}),"Backup from "+l]}),Object(g.jsxs)(c.a.Fragment,{children:[Object(g.jsxs)("span",{style:{fontSize:"24px",top:"-16px",position:"relative",height:"64px",lineHeight:"64px",textAlign:"center"},children:[i,Object(g.jsxs)("button",{style:{background:"blue"},onClick:function(){n(!0),be.post(e.BACKENDURL+"/databases/restorefrombackup",{database:t.datname,pass:e.password}).then((function(e){o(Object(g.jsx)("span",{style:{color:"green"},children:"Success! Database has been set to the state from "+l}))})).catch((function(e){o(Object(g.jsx)("span",{style:{color:"red"},children:e.message}))})).then((function(){n(!1)}))},children:[Object(g.jsx)(E.a,{})," Restore"]})]}),Object(g.jsx)("br",{})]},a)}return Object(g.jsx)(c.a.Fragment,{},a)}))]})}function Se(e){var t=Object(i.useState)(!1),a=Object(j.a)(t,2),s=a[0],n=a[1],l=Object(i.useState)(""),r=Object(j.a)(l,2),d=r[0],o=r[1],u=[{page:"Class",url:"/admin/class",table:"/class"},{page:"Class Data",url:"/admin/classdata",table:"/class_level_data"},{page:"Class-Weapon Compatibility",url:"/admin/classweaponcompatibility",table:"/class_weapon_type_data"},{page:"Class Skills",url:"/admin/classskills",table:"/class_skill"},{page:"Class Skill Data",url:"/admin/classskilldata",table:"/class_skill_data"},{hr:!0},{page:"Weapons",url:"/admin/weapons",table:"/weapon"},{page:"Weapon Existence Data",url:"/admin/weaponexistencedata",table:"/weapon_existence_data"},{page:"Weapon Types",url:"/admin/weapontypes",table:"/weapon_type"},{page:"Class-Weapon Compatibility",url:"/admin/classweaponcompatibility",table:"/class_weapon_type_data",duplicate:!0},{page:"Photon Arts",url:"/admin/photonarts",table:"/photon_art"},{hr:!0},{page:"Armor",url:"/admin/armor",table:"/armor"},{page:"Potentials",url:"/admin/potentials",table:"/potential"},{page:"Potential Data",url:"/admin/potentialdata",table:"/potential_data"},{hr:!0},{page:"Builds",url:"/admin/builds",table:"/builds"},{hr:!0},{page:"Skills",url:"/admin/skills",table:"/skill"},{page:"Skill Types",url:"/admin/skilltypes",table:"/skill_type"},{page:"Skill Data",url:"/admin/skilldata",table:"/skill_data"},{page:Object(g.jsx)("span",{style:{color:"gold"},children:"Skill Tree Editor"}),url:"/admin/skilltreeeditor",render:Object(g.jsx)(_,{setUpdate:e.setUpdate,password:d,BACKENDURL:ge(e),GetData:e.DATA})},{page:"Skill Tree Data",url:"/admin/skilltreedata",table:"/skill_tree_data"},{page:"Photon Arts",url:"/admin/photonarts",table:"/photon_art",duplicate:!0},{page:"Class Skills",url:"/admin/classskills",table:"/class_skill",duplicate:!0},{page:"Class Skill Data",url:"/admin/classskilldata",table:"/class_skill_data",duplicate:!0},{hr:!0},{page:"Augment Types",url:"/admin/augmenttypes",table:"/augment_type"},{page:"Augments",url:"/admin/augments",table:"/augment"},{page:"Elements",url:"/admin/elements",table:"/element"},{hr:!0},{page:"Enemy Data",url:"/admin/enemydata",table:"/enemy_data"},{hr:!0},{page:"Food",url:"/admin/food",table:"/food"},{page:"Food Multipliers",url:"/admin/foodmultipliers",table:"/food_mult"},{hr:!0},{page:"Roles",url:"/admin/roles",table:"/roles"},{page:"Users",url:"/admin/users",table:"/users"},{hr:!0},{page:"Misc. Site Data",url:"/admin/sitedata",table:"/site_data"},{page:"Database Audit",url:"/admin/database_audit",table:"/database_audit"}];return Object(g.jsx)("div",{className:"adminMain",children:s?Object(g.jsxs)(g.Fragment,{children:[Object(g.jsxs)("div",{className:"box boxAdminNav",children:[Object(g.jsx)("div",{className:"boxTitleBar",children:Object(g.jsx)("h1",{children:"Navigation"})}),Object(g.jsxs)("p",{children:["Testing Mode ",Object(g.jsxs)("span",{children:[Object(g.jsx)(b.a,{checked:e.TESTMODE,onChange:function(t){e.setTESTMODE(t.target.checked)}})," ",e.TESTMODE?Object(g.jsx)("b",{children:"ON"}):Object(g.jsx)("b",{children:"OFF"})]})]}),Object(g.jsx)("div",{className:"adminNavContainer customScrollbar",children:Object(g.jsxs)(pe,{classes:"adminNav",children:[u.map((function(e,t){return e.hr?Object(g.jsx)("hr",{},t):Object(g.jsxs)(c.a.Fragment,{children:[Object(g.jsx)(f.a,{to:""+e.url,children:e.page}),Object(g.jsx)("br",{})]},t)})),Object(g.jsx)(f.a,{to:"/admin/database_manager",children:"Database Manager"}),Object(g.jsx)("br",{})]})})]}),u.map((function(t,a){var i;return void 0===t.duplicate&&void 0===t.hr&&Object(g.jsx)(L.a,{path:""+t.url,children:Object(g.jsxs)("div",{className:"box boxAdminContent",children:[Object(g.jsx)("div",{className:"boxTitleBar",children:Object(g.jsx)("h1",{children:t.page})}),Object(g.jsxs)("div",{className:"adminContainer adminScrollbar",children:[Object(g.jsx)(h.a,{children:Object(g.jsx)("title",{children:"NGS Planner - Admin Panel: "+t.page})}),null!==(i=t.render)&&void 0!==i?i:Object(g.jsx)(fe,{TESTMODE:e.TESTMODE,password:d,BACKENDURL:ge(e),path:t.table})]})]})},a)})),Object(g.jsx)(L.a,{path:"/admin/database_manager",children:Object(g.jsxs)("div",{className:"box boxAdminContent",children:[Object(g.jsx)("div",{className:"boxTitleBar",children:Object(g.jsx)("h1",{children:"Database Editor"})}),Object(g.jsx)("div",{className:"adminContainer",children:Object(g.jsx)(ve,{password:d,BACKENDURL:ge(e)})})]})})]}):Object(g.jsx)("div",{className:"modalOverlay",children:Object(g.jsx)("div",{className:"modal",children:Object(g.jsxs)("div",{className:"box boxAdmin",children:[Object(g.jsx)("div",{className:"boxTitleBar",children:Object(g.jsx)("h1",{children:"Admin"})}),Object(g.jsx)("p",{}),Object(g.jsx)("input",{type:"password",value:d,onChange:function(e){o(e.currentTarget.value)},onKeyDown:function(t){"Enter"===t.key&&be.post(ge(e)+"/passwordcheck",{pass:d}).then((function(e){e.data.verified&&n(e.data.verified)})).catch((function(e){n(!1),o("")}))}})]})})})})}function Ne(e){var t=Object(i.useState)(e.value),a=Object(j.a)(t,2),c=a[0],s=a[1];return Object(i.useEffect)((function(){s(e.value)}),[e.value]),Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("input",{value:c,onChange:function(t){s(t.currentTarget.value),e.callback(t.currentTarget.value)}})," (",c,")",Object(g.jsx)("br",{})]})}function ye(e){var t=Object(i.useState)({}),a=Object(j.a)(t,2),c=a[0],s=a[1];Object(i.useEffect)((function(){be.get(e.BACKENDURL+"/augment").then((function(e){var t={};e.data.rows.forEach((function(e){t[e.name]=e})),s(t)}))}),[e.BACKENDURL]);var n={weapon:{augments:["1","2"]},armor1:{augments:["2"]},armor2:{augments:[]},armor3:{augments:[]}};Object(i.useEffect)((function(){if(Object.keys(c).length>0){for(var e=[{field:"variance",variable:0},{field:"mel_dmg",variable:0}],t=0,a=[n.weapon,n.armor1,n.armor2,n.armor3];t<a.length;t++){var i,s=a[t],r=Object(l.a)(e);try{for(r.s();!(i=r.n()).done;)for(var d=i.value,j=0;j<s.augments.length;j++){var o=c[s.augments[j]][d.field];d.variable+=o}}catch(b){r.e(b)}finally{r.f()}}G(e[0].variable)}}),[c,n.armor1,n.armor2,n.armor3,n.weapon]);var r=Object(i.useState)(0),d=Object(j.a)(r,2),o=d[0],b=d[1],h=Object(i.useState)(100),u=Object(j.a)(h,2),O=u[0],m=u[1],p=Object(i.useState)(1),x=Object(j.a)(p,2),f=x[0],v=x[1],S=Object(i.useState)(1),N=Object(j.a)(S,2),y=N[0],k=N[1];Object(i.useEffect)((function(){m(Number(f)+Number(y))}),[f,y]);var D=Object(i.useState)(1),C=Object(j.a)(D,2),E=C[0],P=C[1],A=Object(i.useState)(1),T=Object(j.a)(A,2),z=T[0],w=T[1],_=Object(i.useState)(1),M=Object(j.a)(_,2),L=M[0],G=M[1];Object(i.useEffect)((function(){P(Number(z)+Number(L))}),[z,L]);var F=Object(i.useState)(100),I=Object(j.a)(F,2),R=I[0],Y=I[1],X=Object(i.useState)(5),B=Object(j.a)(X,2),U=B[0],W=B[1],H=Object(i.useState)(1),K=Object(j.a)(H,2),q=K[0],V=K[1];Object(i.useEffect)((function(){b((Number(O)*Number(E)+Number(R)-Number(U))*Number(q)/5)}),[O,E,R,U,q]);var J=Object(i.useState)(1),Q=Object(j.a)(J,2),Z=Q[0],$=Q[1],ee=Object(i.useState)(1),te=Object(j.a)(ee,2),ae=te[0],ie=te[1],ce=Object(i.useState)(1.2),se=Object(j.a)(ce,2),ne=se[0],le=se[1],re=Object(i.useState)(1.1),de=Object(j.a)(re,2),je=de[0],oe=de[1],he=Object(i.useState)(1),ue=Object(j.a)(he,2),Oe=ue[0],ge=ue[1],me=Object(i.useState)(1),pe=Object(j.a)(me,2),xe=pe[0],fe=pe[1],ve=Object(i.useState)(1),Se=Object(j.a)(ve,2),ye=Se[0],ke=Se[1],De=Object(i.useState)(1),Ce=Object(j.a)(De,2),Ee=Ce[0],Pe=Ce[1],Ae=Object(i.useState)(1.1),Te=Object(j.a)(Ae,2),ze=Te[0],we=Te[1],_e=Object(i.useState)(1.2),Me=Object(j.a)(_e,2),Le=Me[0],Ge=Me[1],Fe=Object(i.useState)(1),Ie=Object(j.a)(Fe,2),Re=Ie[0],Ye=Ie[1],Xe=Object(i.useState)(1),Be=Object(j.a)(Xe,2),Ue=Be[0],We=Be[1],He=Object(i.useState)(1.05),Ke=Object(j.a)(He,2),qe=Ke[0],Ve=Ke[1],Je=Object(i.useState)(1),Qe=Object(j.a)(Je,2),Ze=Qe[0],$e=Qe[1],et=Object(i.useState)(1),tt=Object(j.a)(et,2),at=tt[0],it=tt[1],ct=Object(i.useState)(1),st=Object(j.a)(ct,2),nt=st[0],lt=st[1];return Object(i.useEffect)((function(){V(Number(Z)*Number(ae)*Number(ne)*Number(je)*Number(Oe)*Number(xe)*Number(ye)*Number(Ee)*Number(ze)*Number(Le)*Number(Re)*Number(Ue)*Number(qe)*Number(Ze)*Number(at)*Number(nt))}),[Z,ae,ne,je,Oe,xe,ye,Ee,ze,Le,Re,Ue,qe,Ze,at,nt]),Object(g.jsx)(g.Fragment,{children:Object(g.jsxs)("div",{style:{background:"rgba(200,255,200,1)"},children:["Weapon Total Atk:",Object(g.jsx)(Ne,{value:O,callback:function(e){m(e)}}),Object(g.jsxs)("ul",{children:[Object(g.jsxs)("li",{children:["\u25cfWeapon Base Atk:",Object(g.jsx)(Ne,{value:f,callback:function(e){v(e)}})]}),Object(g.jsxs)("li",{children:["\u25cfWeapon Enhance Lv:",Object(g.jsx)(Ne,{value:y,callback:function(e){k(e)}})]})]}),Object(g.jsx)("br",{}),Object(g.jsx)("br",{}),Object(g.jsx)("br",{}),"Damage Variance:",Object(g.jsx)(Ne,{value:E,callback:function(e){P(e)}}),Object(g.jsxs)("ul",{children:[Object(g.jsxs)("li",{children:["\u25cfWeapon Damage Variance:",Object(g.jsx)(Ne,{value:z,callback:function(e){w(e)}})]}),Object(g.jsxs)("li",{children:["\u25cfAugment Damage Variance:",Object(g.jsx)(Ne,{value:L,callback:function(e){G(e)}})]})]}),Object(g.jsx)("br",{}),Object(g.jsx)("br",{}),Object(g.jsx)("br",{}),"Base Attack:",Object(g.jsx)(Ne,{value:R,callback:function(e){Y(e)}}),"Enemy Defense:",Object(g.jsx)(Ne,{value:U,callback:function(e){W(e)}}),"Multipliers:",Object(g.jsx)(Ne,{value:q,callback:function(e){V(e)}}),Object(g.jsxs)("ul",{children:[Object(g.jsxs)("li",{children:["\u25cfAtk Mult:",Object(g.jsx)(Ne,{value:Z,callback:function(e){$(e)}})]}),Object(g.jsxs)("li",{children:["\u25cfPart Mult:",Object(g.jsx)(Ne,{value:ae,callback:function(e){ie(e)}})]}),Object(g.jsxs)("li",{children:["\u25cfElemental Weakness Mult:",Object(g.jsx)(Ne,{value:ne,callback:function(e){le(e)}})]}),Object(g.jsxs)("li",{children:["\u25cfMain Class Weapon Boost:",Object(g.jsx)(Ne,{value:je,callback:function(e){oe(e)}})]}),Object(g.jsxs)("li",{children:["\u25cfClass Skill Mult:",Object(g.jsx)(Ne,{value:Oe,callback:function(e){ge(e)}})]}),Object(g.jsxs)("li",{children:["\u25cfEquip Mult:",Object(g.jsx)(Ne,{value:xe,callback:function(e){fe(e)}})]}),Object(g.jsx)("li",{children:Object(g.jsxs)("ul",{children:[Object(g.jsxs)("li",{children:["\u25cfAugment Equip Mult:",Object(g.jsx)(Ne,{value:ye,callback:function(e){ke(e)}})]}),Object(g.jsxs)("li",{children:["\u25cfPotency Floor Equip Mult:",Object(g.jsx)(Ne,{value:Ee,callback:function(e){Pe(e)}})]}),Object(g.jsxs)("li",{children:["\u25cfElemental Weapon Equip Mult:",Object(g.jsx)(Ne,{value:ze,callback:function(e){we(e)}})]})]})}),Object(g.jsxs)("li",{children:["\u25cfCrit Mult:",Object(g.jsx)(Ne,{value:Le,callback:function(e){Ge(e)}})]}),Object(g.jsxs)("li",{children:["\u25cfAppropriate Distance:",Object(g.jsx)(Ne,{value:Re,callback:function(e){Ye(e)}})]}),Object(g.jsxs)("li",{children:["\u25cfFood Boost:",Object(g.jsx)(Ne,{value:Ue,callback:function(e){We(e)}})]}),Object(g.jsxs)("li",{children:["\u25cfField Effects:",Object(g.jsx)(Ne,{value:qe,callback:function(e){Ve(e)}})]}),Object(g.jsxs)("li",{children:["\u25cfStatus Ailments:",Object(g.jsx)(Ne,{value:Ze,callback:function(e){$e(e)}})]}),Object(g.jsxs)("li",{children:["\u25cfEnemy Correction Multiplier:",Object(g.jsx)(Ne,{value:at,callback:function(e){it(e)}})]}),Object(g.jsxs)("li",{children:["\u25cfHigh Level Enemy:",Object(g.jsx)(Ne,{value:nt,callback:function(e){lt(e)}})]})]}),Object(g.jsx)("br",{}),Object(g.jsx)("br",{}),Object(g.jsx)("br",{}),"Raw Dmg:",o]})})}function ke(e){var t;return Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("label",{className:"formField",for:e.field,children:e.label}),"toggle"===e.type?Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)(b.a,{id:e.field,checked:e.checked,onChange:e.onChange,disabled:e.loading})," ",Object(g.jsx)("label",{className:"formDescription",for:e.field,children:e.checked?Object(g.jsx)("b",{children:"YES"}):Object(g.jsx)("b",{children:"NO"})})]}):Object(g.jsx)("input",{type:null!==(t=e.type)&&void 0!==t?t:"text",disabled:e.loading,id:e.field,maxlength:e.maxlength,value:e.value,checked:e.checked,onChange:e.onChange,placeholder:e.placeholder})," ",Object(g.jsx)("label",{className:"formDescription",for:e.field,children:e.tooltip})]})}function De(e){be.post(ge(e)+"/validUser",{username:e.LOGGEDINUSER,password:e.LOGGEDINHASH,recoveryhash:oe.get("userID")}).then((function(t){t.data.verified&&e.history.push("/")})).catch((function(e){console.log(e.message)}))}function Ce(e){var t=function(){var e=new URLSearchParams(window.location.search);return Object.fromEntries(e.entries())}(),a=Object(i.useState)(""),c=Object(j.a)(a,2),s=c[0],n=c[1],l=Object(i.useState)(""),d=Object(j.a)(l,2),o=d[0],b=d[1],h=Object(i.useState)(!1),u=Object(j.a)(h,2),O=u[0],m=u[1],p=Object(i.useState)(""),x=Object(j.a)(p,2),f=x[0],v=x[1],S=Object(i.useState)(!1),N=Object(j.a)(S,2),y=N[0],k=N[1],D=Object(i.useState)(""),C=Object(j.a)(D,2),E=C[0],P=C[1],A=Object(L.f)();function T(){v(""),k(!0),be.post(ge(e)+"/validUser",{username:s,password:je()(o)}).then((function(t){t.data.verified?(e.setLOGGEDINUSER(s),e.setLOGGEDINHASH(je()(o)),oe.set("username",s,30,"d"),oe.set("password",je()(o),30,"d"),n(""),b(""),m(!1),A.push("/")):v("Could not authenticate!")})).catch((function(e){var t;v(null!==(t=null===e||void 0===e?void 0:e.message)&&void 0!==t?t:e)})).then((function(){k(!1)}))}function z(t){t.error?P(JSON.stringify(t)):t.profileObj.googleId&&t.profileObj.imageUrl&&t.profileObj.email&&t.profileObj.name&&t.tokenId&&be.post(ge(e)+"/registerUser",{username:t.profileObj.name,email:t.profileObj.email,password:t.tokenId,avatar:t.profileObj.imageUrl,userID:t.profileObj.googleId,recoveryhash:t.profileObj.googleId}).then((function(a){a.data.verified?(e.setLOGGEDINUSER(t.profileObj.name),e.setLOGGEDINHASH(t.tokenId),oe.set("username",t.profileObj.name,30,"d"),oe.set("password",t.tokenId,30,"d"),oe.set("userID",t.profileObj.googleId,30,"d"),n(""),b(""),m(!1),A.push("/")):(oe.remove("userID"),v("Could not authenticate!"))}))}function w(){var a=Object(i.useState)(!1),c=Object(j.a)(a,2),s=c[0],n=c[1],l=Object(L.f)();return Object(i.useEffect)((function(){t.code&&n(!0)}),[]),Object(i.useEffect)((function(){s&&(console.log("Attempting login..."),be.get(ge(e)+"/userData?token="+t.code).then((function(t){return e.setLOGGEDINUSER(t.data.username),e.setLOGGEDINHASH(t.data.token),console.log(t.data.token),oe.set("username",t.data.username,30,"d"),oe.set("password",t.data.token,30,"d"),oe.set("userID",t.data.id,30,"d"),console.log(oe.get("username")),console.log(oe.get("password")),console.log(oe.get("userID")),be.post(ge(e)+"/registerUser",{username:t.data.username,email:t.data.email,password:t.data.token,avatar:"https://cdn.discordapp.com/avatars/"+t.data.id+"/"+t.data.avatar+".png",userID:t.data.id,recoveryhash:t.data.id})})).then((function(e){l.push("/")})).catch((function(e){console.log(e.message)})))}),[s,l]),Object(g.jsx)(g.Fragment,{children:Object(g.jsx)("button",{onClick:function(){window.location.href=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_LOCAL_REDIRECT?"https://discord.com/api/oauth2/authorize?client_id=885738904685281291&redirect_uri=https%3A%2F%2Flocalhost%3A3000%23%2Flogin&response_type=code&scope=identify%20email":"https://discord.com/api/oauth2/authorize?client_id=885738904685281291&redirect_uri=https%3A%2F%2Fngsplanner.com%23%2Flogin&response_type=code&scope=identify%20email"},children:"Login"})})}return Object(i.useEffect)((function(){De(Object(r.a)(Object(r.a)({},e),{},{history:A}))}),[A,e]),Object(g.jsx)(g.Fragment,{children:Object(g.jsx)(me,{title:"Login Form",children:y?Object(g.jsx)("img",{src:"/spinner.gif",alt:"",style:{background:"linear-gradient(white,#bca9f5)",marginTop:"10px"}}):Object(g.jsxs)(g.Fragment,{children:[Object(g.jsxs)("div",{onKeyDown:function(e){"Enter"===e.key&&T()},children:[Object(g.jsx)("h3",{className:"formError",children:f}),Object(g.jsx)(ke,{field:"username",label:"Username: ",value:s,maxlength:20,onChange:function(e){n(e.currentTarget.value)},placeholder:"Username"}),Object(g.jsx)("br",{}),Object(g.jsx)(ke,{field:"password",label:"Password: ",type:"password",value:o,onChange:function(e){b(e.currentTarget.value)},placeholder:"Password"}),Object(g.jsx)("br",{}),Object(g.jsx)(ke,{field:"rememberMe",label:"Remember Me ",type:"toggle",checked:O,onChange:function(e){m(e.currentTarget.checked)}}),Object(g.jsx)("br",{}),Object(g.jsx)("button",{type:"submit",onClick:T,children:"Login"})]}),Object(g.jsx)("hr",{}),E,Object(g.jsx)("br",{}),Object(g.jsx)(M.GoogleLogin,{theme:"dark",clientId:"1081276553893-r50huhr0f9hkpcd7fdbb0oe4qcpglcpp.apps.googleusercontent.com",buttonText:"Login",onSuccess:z,onFailure:z,cookiePolicy:"single_host_origin"}),Object(g.jsx)(w,{})]})})})}function Ee(e){var t=Object(i.useState)(""),a=Object(j.a)(t,2),c=a[0],s=a[1],n=Object(i.useState)(""),l=Object(j.a)(n,2),d=l[0],o=l[1],b=Object(i.useState)(""),h=Object(j.a)(b,2),u=h[0],O=h[1],m=Object(i.useState)(""),p=Object(j.a)(m,2),x=p[0],f=p[1],v=Object(i.useState)(!1),S=Object(j.a)(v,2),N=S[0],y=S[1],k=Object(i.useState)(""),D=Object(j.a)(k,2),C=D[0],E=D[1],P=Object(i.useState)(!1),A=Object(j.a)(P,2),T=A[0],z=A[1],w=Object(L.f)();return Object(i.useEffect)((function(){De(Object(r.a)(Object(r.a)({},e),{},{history:w}))}),[w,e]),Object(g.jsx)(g.Fragment,{children:Object(g.jsx)(me,{title:"Registration Form",children:T?Object(g.jsx)("img",{src:"/spinner.gif",alt:"",style:{background:"linear-gradient(white,#bca9f5)",marginTop:"10px"}}):Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("h3",{className:"formError",children:C}),Object(g.jsx)(ke,{field:"username",label:"Username: ",value:c,maxlength:20,onChange:function(e){s(e.currentTarget.value)},placeholder:"Username",tooltip:"Enter a username (4-20 characters, a-z and _ only)"}),Object(g.jsx)("br",{}),Object(g.jsx)(ke,{field:"password",label:"Password: ",type:"password",value:d,onChange:function(e){o(e.currentTarget.value)},placeholder:"Password",tooltip:"Enter a password (6 or more characters)"}),Object(g.jsx)("br",{}),Object(g.jsx)(ke,{field:"password2",label:"Verify Password: ",type:"password",value:u,onChange:function(e){O(e.currentTarget.value)},placeholder:"Verify Password",tooltip:"Enter password again."}),Object(g.jsx)("br",{}),Object(g.jsx)(ke,{field:"email",label:"E-mail: ",type:"email",value:x,onChange:function(e){f(e.currentTarget.value)},placeholder:"email@example.com",tooltip:"This is used to send you password reset emails."}),Object(g.jsx)("br",{}),Object(g.jsx)(ke,{field:"rememberMe",label:"Remember Me ",type:"toggle",checked:N,onChange:function(e){y(e.currentTarget.checked)}}),Object(g.jsx)("br",{}),Object(g.jsx)("button",{type:"submit",onClick:function(){E(""),z(!0);try{if(c.length<4)throw new Error("Username must be at least 4 characters in length.");if(c.length>20)throw new Error("Username must be less than 21 characters in length.");if(d.length<6)throw new Error("Password must contain at least 6 characters.");if(d!==u)throw new Error("Password fields must match.");if(!x.includes("@"))throw new Error("Invalid E-mail.")}catch(a){var t;return E(null!==(t=null===a||void 0===a?void 0:a.message)&&void 0!==t?t:a),void z(!1)}be.post(ge(e)+"/register",{username:c,password:je()(d),email:x}).then((function(t){t.data.verified?(e.setLOGGEDINUSER(c),e.setLOGGEDINHASH(je()(d)),s(""),o(""),y(!1)):E("Could not authenticate!")})).catch((function(e){var t;E(null!==(t=null===e||void 0===e?void 0:e.message)&&void 0!==t?t:e)})).then((function(){z(!1)}))},children:"Login"})]})})})}var Pe=function(){var e=Object(i.useState)("Dudley"),t=Object(j.a)(e,1)[0],a=Object(i.useState)("Fatimah"),c=Object(j.a)(a,1)[0],s=Object(i.useState)("Ranger"),n=Object(j.a)(s,1)[0],l=Object(i.useState)("Force"),r=Object(j.a)(l,1)[0],d=Object(i.useState)(20),o=Object(j.a)(d,1)[0],b=Object(i.useState)(15),u=Object(j.a)(b,1)[0],O=Object(i.useState)(1330),m=Object(j.a)(O,1)[0],p=Object(i.useState)(388),x=Object(j.a)(p,1)[0],f=Object(i.useState)(154),v=Object(j.a)(f,1)[0],S=Object(i.useState)(282),y=Object(j.a)(S,1)[0],k=Object(i.useState)(650),D=Object(j.a)(k,1)[0],C=Object(i.useState)(282),E=Object(j.a)(C,2),P=E[0],A=E[1];Object(i.useEffect)((function(){A(Number(y)+Number(D))}),[y,D]);var T=Object(i.useState)(932),z=Object(j.a)(T,1)[0],w=Object(i.useState)(.317),_=Object(j.a)(w,1)[0],M=Object(i.useState)(.241),F=Object(j.a)(M,1)[0],I=Object(i.useState)(.241),Y=Object(j.a)(I,1)[0],X=Object(i.useState)(.18),B=Object(j.a)(X,1)[0],U=Object(i.useState)(0),W=Object(j.a)(U,1)[0],H=Object(i.useState)(0),K=Object(j.a)(H,1)[0],q=Object(i.useState)(0),V=Object(j.a)(q,1)[0],J=Object(i.useState)(0),Q=Object(j.a)(J,1)[0],Z=Object(i.useState)(0),$=Object(j.a)(Z,1)[0],ee=Object(i.useState)(0),te=Object(j.a)(ee,1)[0],ae=Object(i.useState)(0),ie=Object(j.a)(ae,1)[0],ce=Object(i.useState)(!1),se=Object(j.a)(ce,2),ne=se[0],le=se[1],de=Object(i.useState)(void 0),je=Object(j.a)(de,2),he=je[0],me=je[1],pe=Object(i.useState)({GetData:function(){}}),xe=Object(j.a)(pe,2),fe=xe[0],ve=xe[1],Ne=Object(i.useState)(!1),ke=Object(j.a)(Ne,2),De=ke[0],Pe=ke[1],Ae=Object(i.useState)(oe.get("username")),Te=Object(j.a)(Ae,2),ze=Te[0],we=Te[1],_e=Object(i.useState)(oe.get("password")),Me=Object(j.a)(_e,2),Le=Me[0],Ge=Me[1],Fe="/test/:BUILDID",Ie="/test";function Re(e,t,a,i){void 0===t&&(t=""),void 0===a&&(a="");var c=i?fe:he;return c&&void 0!==c?void 0!==c[e]?void 0!==c[e][t]?void 0!==c[e][t][a]?c[e][t][a]:c[e][t]:c[e]:c:"no data"}return Object(i.useEffect)((function(){De&&(Pe(!1),be.get(ge({TESTMODE:ne})+"/data").then((function(e){me(e.data)})),be.get(ge({TESTMODE:ne})+"/dataid").then((function(e){ve(e.data)})))}),[De,ne]),Object(i.useEffect)((function(){we(oe.get("username")),Ge(oe.get("password")),be.get(ge({TESTMODE:ne})+"/data").then((function(e){me(e.data)})),be.get(ge({TESTMODE:ne})+"/dataid").then((function(e){ve(e.data)}))}),[ne]),Object(g.jsx)(g.Fragment,{children:Object(g.jsx)(G.a,{children:Object(g.jsxs)(L.c,{children:[Object(g.jsxs)(L.a,{path:"/admin",children:[Object(g.jsx)(h.a,{children:Object(g.jsx)("title",{children:"NGS Planner - Admin Panel"})}),Object(g.jsx)(Se,{setUpdate:Pe,setTESTMODE:le,BACKENDURL:ue,TESTMODE:ne,DATA:Re})]}),Object(g.jsxs)(L.a,{path:Fe,children:[Object(g.jsx)(R,{LOGGEDINUSER:ze,LOGGEDINHASH:Le,BACKENDURL:ge(ue)}),Object(g.jsx)(re,{APP_TITLE:Oe,path:Fe,author:t,buildName:c,className:n,secondaryClassName:r,classLv:o,secondaryClassLv:u,bp:m,hp:x,pp:v,def:z,weaponUp1:_,weaponUp2:F,weaponUp3:Y,damageResist:B,burnResist:W,shockResist:K,panicResist:V,stunResist:Q,freezeResist:$,blindResist:te,poisonResist:ie,statDisplayAtk:P,GetData:Re,LOGGEDINUSER:ze,LOGGEDINHASH:Le,BACKENDURL:ge(ue)})]}),Object(g.jsxs)(L.a,{path:Ie,children:[Object(g.jsx)(R,{LOGGEDINUSER:ze,LOGGEDINHASH:Le,BACKENDURL:ge(ue)}),Object(g.jsx)(re,{APP_TITLE:Oe,path:Ie,author:t,buildName:c,className:n,secondaryClassName:r,classLv:o,secondaryClassLv:u,bp:m,hp:x,pp:v,def:z,weaponUp1:_,weaponUp2:F,weaponUp3:Y,damageResist:B,burnResist:W,shockResist:K,panicResist:V,stunResist:Q,freezeResist:$,blindResist:te,poisonResist:ie,statDisplayAtk:P,GetData:Re,LOGGEDINUSER:ze,LOGGEDINHASH:Le,BACKENDURL:ge(ue)})]}),Object(g.jsxs)(L.a,{path:"/login",children:[Object(g.jsx)(h.a,{children:Object(g.jsx)("title",{children:"NGS Planner - Login"})}),Object(g.jsx)(R,{LOGGEDINUSER:ze,LOGGEDINHASH:Le,BACKENDURL:ge(ue)}),Object(g.jsx)(Ce,{BACKENDURL:ue,TESTMODE:ne,LOGGEDINUSER:ze,LOGGEDINHASH:Le,setLOGGEDINHASH:Ge,setLOGGEDINUSER:we})]}),Object(g.jsxs)(L.a,{path:"/register",children:[Object(g.jsx)(h.a,{children:Object(g.jsx)("title",{children:"NGS Planner - Register"})}),Object(g.jsx)(R,{LOGGEDINUSER:ze,LOGGEDINHASH:Le,BACKENDURL:ge(ue)}),Object(g.jsx)(Ee,{BACKENDURL:ue,TESTMODE:ne,LOGGEDINUSER:ze,LOGGEDINHASH:Le,setLOGGEDINHASH:Ge,setLOGGEDINUSER:we})]}),Object(g.jsxs)(L.a,{path:"/builds",children:[Object(g.jsx)(h.a,{children:Object(g.jsx)("title",{children:"NGS Planner - Builds"})}),Object(g.jsx)(R,{LOGGEDINUSER:ze,LOGGEDINHASH:Le,BACKENDURL:ge(ue)}),Object(g.jsx)(N,{GetData:Re,BACKENDURL:ge(ue),PANELPATHWBUILD:Fe})]}),Object(g.jsx)(L.a,{path:"/formula",children:Object(g.jsx)(ye,{})}),Object(g.jsxs)(L.a,{path:"/",children:[Object(g.jsx)(h.a,{children:Object(g.jsx)("title",{children:Oe})}),Object(g.jsxs)("div",{className:"modalOverlaySplash",children:[Object(g.jsx)("div",{className:"modal",children:Object(g.jsxs)("div",{className:"box boxMisc",children:[Object(g.jsx)("div",{className:"boxTitleBar",children:Object(g.jsx)("h1",{children:Re("site_data","h1","data")})}),Object(g.jsx)("h2",{children:Re("site_data","h2","data")}),Object(g.jsxs)("p",{children:[Object(g.jsx)("img",{src:"/spinner.gif",alt:""}),Re("site_data","UNDER_CONSTRUCTION_TEXT","data")]}),Object(g.jsx)("br",{style:{clear:"both"}})]})}),Object(g.jsxs)("footer",{children:[Object(g.jsx)("a",{href:"https://github.com/sigonasr2/ngsplanner/",children:Object(g.jsx)("span",{className:"github",children:"\xa0"})}),Object(g.jsx)("a",{href:"https://twitter.com/ngsplanner",children:Object(g.jsx)("span",{className:"twitter",children:"@NGSPlanner"})})]})]})]})]})})})},Ae=function(e){e&&e instanceof Function&&a.e(3).then(a.bind(null,218)).then((function(t){var a=t.getCLS,i=t.getFID,c=t.getFCP,s=t.getLCP,n=t.getTTFB;a(e),i(e),c(e),s(e),n(e)}))};n.a.render(Object(g.jsx)(c.a.StrictMode,{children:Object(g.jsx)(Pe,{})}),document.getElementById("root")),Ae()}},[[207,1,2]]]);
|
|
//# sourceMappingURL=main.7a4f3a14.chunk.js.map
|