1"use strict";(self.webpackChunkretrograde_minis_website=self.webpackChunkretrograde_minis_website||[]).push([[293],{3293:(e,a,l)=>{l.r(a),l.d(a,{default:()=>jl});var s=l(5043),t=l(5464),n=l(6241),r=l(5877),i=l(1598),o=l(5529),c=l(1402),u=l(718),d=l(9760),m=l(579);const h=t.Ay.div` 2 display: flex; 3 flex-direction: row; 4 justify-content: space-around; 5 align-content: start; 6 align-items: space-around; 7 flex-wrap: wrap; 8 9 overflow-y: scroll; 10 height: 100%; 11 width: 100%; 12`;h.displayName="FrameListContainer";const p=(0,t.Ay)(r.A5)` 13 cursor: pointer; 14 height: 254px; 15 width: 254px; 16 margin-top: 4px; 17 18 label { 19 max-width: 70%; 20 padding-right: 20px; 21 z-index: 2; 22 position: absolute; 23 bottom: 0; 24 left: 0; 25 } 26 27 img { 28 position: absolute; 29 top: 0; 30 left: 0; 31 width: 250px; 32 height: 250px; 33 z-index: 1; 34 } 35 36 37 border-color: transparent; 38 border-style: solid; 39 border-width: 2px; 40 41 &.default:hover { 42 border-color: ${e=>e.disabled?"#333":r.fT}; 43 } 44 45 &.retro-terminal:hover { 46 border-color: ${e=>e.disabled?"#666":u.co}; 47 } 48 49 @media only screen and (max-width: ${e=>e.theme.mobileCutoffWidth}px) { 50 width: 254px; 51 52 label { 53 font-size: 0.9em; 54 } 55 } 56`;function V(e){let{setShowPremiumPopupFunc:a,setFrameValueFunc:l,partList:s,isPremiumUser:t,displayTheme:n,isLegendaryUser:r}=e;const i=s.map((e=>(0,m.jsxs)(p,{alt:"Select Frame Button",disabled:e.isLegendary&&!r,className:n?"retro-terminal":"default",onClick:()=>{e.isLegendary&&!r?a(d.$.LEGENDARY):l(e.value)},children:[(0,m.jsx)("label",{children:`${e.label} ${e.isLegendary?"\u25cf\u25cf":""}`}),(0,m.jsx)("img",{alt:e.label,src:e.isLegendary&&!r?e.restrictedPreviewImg:e.previewImg})]},`${e.value}-${e.label}`)));return(0,m.jsx)(h,{children:i})}p.displayName="FramePreview",V.defaultProps={isPremiumUser:!1,isLegendaryUser:!1};const g=V;var y=l(1608),N=l(5456),x=l(4053),f=l(1308),b=l(1738),v=l(3174),j=l(8680),C=l(7815);const L=`${x.A}/buttons/Color-Select-Icon.png`,T=`${x.A}/buttons/Color-Sample-Square-Glow.png`,S=`${x.A}/buttons/Color-Sample-Square.png`,O=`${x.A}/buttons/saveicon1.png`,A=`${x.A}/buttons/saveicon2.png`,w=`${x.A}/buttons/saveicon3.png`,E=`${x.A}/buttons/saveicon4.png`,k=(0,t.Ay)(r.A5)` 57 .range-wrapper { 58 width: 186px; 59 padding: 7px 0; 60 } 61 62 span.input-button { 63 color: ${e=>{let{disable:a}=e;return a?"#333":r.fT}}; 64 } 65 66 @media only screen and (max-width: ${e=>e.theme.mobileCutoffWidth}px) { 67 .range-wrapper { 68 width: 146px; 69 } 70 } 71`;k.displayName="InputRangeSelect";const $=(0,t.Ay)(v.Qr)` 72 &.default { 73 &[type=range]::-webkit-slider-runnable-track { 74 background-color: ${r.fT}; 75 } 76 77 &[type=range]::-moz-range-track { 78 background-color: ${r.fT}; 79 } 80 81 &[type=range]::-ms-track { 82 background-color: ${r.fT}; 83 } 84 } 85`;$.displayName="InputRange";const P=function(e){let{displayTheme:a,targetPartIsGlow:l,isGreenGlow:t}=e;const[n,r]=(0,s.useState)(null),{customColorIndex:i,selectorMin:o,sepiaMax:c,saturationMax:u,brightnessMax:d,hueMin:h,hueMax:p,invertMax:V,contrastMax:g,setColorValue:x,sepiaValue:P,setSepiaValue:R,saturationValue:B,setSaturationValue:F,brightnessValue:M,setBrightnessValue:W,hueValue:U,setHueValue:I,invertValue:H,setInvertValue:z,contrastValue:D,setContrastValue:G,tintValue:Y,savedTint1Value:Q,savedTint2Value:J,savedTint3Value:_,savedTint4Value:K,saveCustomColorValues:q,hexInputValue:Z,setHexInputValue:X,isHexInputValid:ee,setIsHexInputValid:ae,shouldConvertGlowValue:le,setShouldConvertGlowValue:se,setShouldConvertGreenGlowValue:te,getFilterFromHex:ne}=(0,s.useContext)(y.Q);let re,ie,oe,ce,ue=[],de=o;if(te(t),null!==n){switch(n){case"SEPIA":re=c,ie=P,oe=R,ce=e=>`sepia(${e}%) saturate(${B}%) brightness(${M}%) hue-rotate(${U}deg) invert(${H}%) contrast(${D}%)`;break;case"BRIGHTNESS":re=d,ie=M,oe=W,ce=e=>`sepia(${P}%) saturate(${B}%) brightness(${e}%) hue-rotate(${U}deg) invert(${H}%) contrast(${D}%)`;break;case"SATURATION":re=u,ie=B,oe=F,ce=e=>`sepia(${P}%) saturate(${e}%) brightness(${M}%) hue-rotate(${U}deg) invert(${H}%) contrast(${D}%)`;break;case"HUE":de=h,re=p,ie=U,oe=I,ce=e=>`sepia(${P}%) saturate(${B}%) brightness(${M}%) hue-rotate(${e}deg) invert(${H}%) contrast(${D}%)`;break;case"INVERT":re=V,ie=H,oe=z,ce=e=>`sepia(${P}%) saturate(${B}%) brightness(${M}%) hue-rotate(${U}deg) invert(${e}%) contrast(${D}%)`;break;case"CONTRAST":re=g,ie=D,oe=G,ce=e=>`sepia(${P}%) saturate(${B}%) brightness(${M}%) hue-rotate(${U}deg) invert(${H}%) contrast(${e}%)`}for(let e=de;e<=re;e+=1)ue.push((0,m.jsx)(v.Ok,{alt:`${n} Value ${e}`,src:l?T:S,className:e===ie?"is-selected":"",onClick:()=>{r(null),oe(e),x(i)},title:e,style:{filter:ce(e)}},`${n}-${e}`))}return(0,m.jsxs)(v.CB,{children:[null!==n?(0,m.jsxs)(f.A,{style:{zIndex:1e3},children:[(0,m.jsxs)(N.mF,{children:[(0,m.jsxs)("h2",{children:["SELECT ",n]}),(0,m.jsx)(N.Jn,{className:j.B.xButton,alt:"Close",onClick:()=>r(null)})]}),(0,m.jsx)(b.A,{children:ue})]}):null,(0,m.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"space-around",marginLeft:"10px"},children:[(0,m.jsxs)(v.Cc,{children:[(0,m.jsx)(v.po,{"aria-label":"Save Values to 'SAVED CUSTOM 1' slot",title:"Save Values to 'SAVED CUSTOM 1' slot",src:O,onClick:()=>
85{window.confirm("This will overwrite the current saved color values in CUSTOM SLOT 1.")&&q(1)},tintValue:Q}),(0,m.jsx)(v.po,{"aria-label":"Save Values to 'SAVED CUSTOM 2' slot",title:"Save Values to 'SAVED CUSTOM 2' slot",src:A,onClick:()=>{window.confirm("This will overwrite the current saved color values in CUSTOM SLOT 2.")&&q(2)},tintValue:J}),(0,m.jsx)(v.po,{"aria-label":"Save Values to 'SAVED CUSTOM 3' slot",title:"Save Values to 'SAVED CUSTOM 3' slot",src:w,onClick:()=>{window.confirm("This will overwrite the current saved color values in CUSTOM SLOT 3.")&&q(3)},tintValue:_}),(0,m.jsx)(v.po,{"aria-label":"Save Values to 'SAVED CUSTOM 4' slot",title:"Save Values to 'SAVED CUSTOM 4' slot",src:E,onClick:()=>{window.confirm("This will overwrite the current saved color values in CUSTOM SLOT 4.")&&q(4)},tintValue:K})]}),(0,m.jsxs)(k,{className:a?"retro-terminal":"default",disable:!ee,title:"Harness Math Magic to ATTEMPT to convert a hex color code to base or glow color filter values. Try repeatedly until desired result is achieved.",children:[(0,m.jsx)("label",{htmlFor:"convert-hex-input",children:"CONVERT HEX"}),(0,m.jsxs)("label",{children:["COLOR TYPE:",(0,m.jsx)("img",{alt:"Color Source",src:le?T:S,className:"part-color-preview",onClick:()=>se(!le),style:{cursor:"pointer"}})]}),(0,m.jsxs)("div",{className:"range-wrapper",style:{display:"flex",flexDirection:"column",gap:"5px"},children:[(0,m.jsxs)("div",{children:["Target: #",(0,m.jsx)($,{value:Z,onChange:e=>{X(e.target.value),ae(null!==(0,C.E)(e.target.value))},type:"text",minLength:3,maxLength:6,placeholder:"000000",style:{width:"35%"}})]}),(0,m.jsx)("span",{className:"input-button",onClick:()=>ee?ne():null,children:"CONVERT"})]})]})]}),(0,m.jsxs)("div",{style:{display:"flex",flexDirection:"row",rowGap:"5px",justifyContent:"space-around",flexWrap:"wrap"},children:[(0,m.jsxs)(k,{className:a?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"sepia-select",children:["SEPIA",(0,m.jsx)(v.xU,{alt:"CHOOSE COLOR OPTION",src:L,onClick:()=>{r("SEPIA")}})]}),(0,m.jsxs)("div",{className:"range-wrapper",children:[(0,m.jsx)($,{value:P,className:a?"retro-terminal":"default",onChange:e=>{R(e.target.value),x(i)},type:"range",targetPartIsGlow:l,min:o,max:c,tintValue:Y}),(0,m.jsx)($,{value:P,className:a?"retro-terminal":"default",onChange:e=>{R(e.target.value),x(i)},type:"number",min:o,max:c})]})]}),(0,m.jsxs)(k,{className:a?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"saturation-select",children:["SATURATION",(0,m.jsx)(v.xU,{alt:"CHOOSE COLOR OPTION",src:L,onClick:()=>{r("SATURATION")}})]}),(0,m.jsxs)("div",{className:"range-wrapper",children:[(0,m.jsx)($,{value:B,className:a?"retro-terminal":"default",onChange:e=>{F(e.target.value),x(i)},type:"range",targetPartIsGlow:l,min:o,max:u,tintValue:Y}),(0,m.jsx)($,{value:B,className:a?"retro-terminal":"default",onChange:e=>{F(e.target.value),x(i)},type:"number",min:o,max:u})]})]}),(0,m.jsxs)(k,{className:a?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"brightness-select",children:["BRIGHTNESS",(0,m.jsx)(v.xU,{alt:"CHOOSE COLOR OPTION",src:L,onClick:()=>{r("BRIGHTNESS")}})]}),(0,m.jsxs)("div",{className:"range-wrapper",children:[(0,m.jsx)($,{value:M,className:a?"retro-terminal":"default",onChange:e=>{W(e.target.value),x(i)},type:"range",targetPartIsGlow:l,min:o,max:d,tintValue:Y}),(0,m.jsx)($,{value:M,className:a?"retro-terminal":"default",onChange:e=>{W(e.target.value),x(i)},type:"number",min:o,max:d})]})]}),(0,m.jsxs)(k,{className:a?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"hue-select",children:["HUE",(0,m.jsx)(v.xU,{alt:"CHOOSE COLOR OPTION",src:L,onClick:()=>{r("HUE")}})]}),(0,m.jsxs)("div",{className:"range-wrapper",children:[(0,m.jsx)($,{value:U,className:a?"retro-terminal":"default",onChange:e=>{x(i),I(e.target.value)},type:"range",targetPartIsGlow:l,min:h,max:p,tintValue:Y}),(0,m.jsx)($,{value:U,className:a?"retro-terminal":"default",onChange:e=>{x(i),I(e.target.value)},type:"number",min:h,max:p})]})]}),(0,m.jsxs)(k,{className:a?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"invert-select",children:["INVERT",(0,m.jsx)(v.xU,{alt:"CHOOSE COLOR OPTION",src:L,onClick:()=>{r("INVERT")}})]}),(0,m.jsxs)("div",{className:"range-wrapper",children:[(0,m.jsx)($,{className:a?"retro-terminal":"default",value:H,onChange:e=>{z(e.target.value),x(i)},type:"range",targetPartIsGlow:l,min:o,max:V,tintValue:Y}),(0,m.jsx)($,{value:H,onChange:e=>{z(e.target.value),x(i)},type:"number",min:o,max:V})]})]}),(0,m.jsxs)(k,{className:a?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"contrast-select",children:["CONTRAST",(0,m.jsx)(v.xU,{alt:"CHOOSE COLOR OPTION",src:L,onClick:()=>{r("CONTRAST")}})]}),(0,m.jsxs)("div",{className:"range-wrapper",children:[(0,m.jsx)($,{className:a?"retro-terminal":"default",value:D,onChange:e=>{G(e.target.value),x(i)},type:"range",targetPartIsGlow:l,min:o,max:g,tintValue:Y}),(0,m.jsx)($,{value:D,onChange:e=>{G(e.target.value),x(i)},type:"number",min:o,max:g})]})]})]})]})};var R=l(1699),B=l(94),F=l(28),M=l(8459),W=l(2062),U=l(2411),I=l(8405),H=l(7284),z=l(7345),D=l(1274),G=l(86);const Y=function(e){var a;let{unit:l,brandList:t}=e;const{displayTheme:n}
85=(0,s.useContext)(F.m),[i,o]=(0,s.useState)(!1);let c=[];var u;return"NONE"!==l.skinValue&&null!==(a=t[l.brandValue][l.frameValue].skin[l.skinValue])&&void 0!==a&&a.originalArtCredit&&c.push((0,G.NR)({partLabel:"Body",originalArtCredit:null===(u=t[l.brandValue][l.frameValue].skin[l.skinValue])||void 0===u?void 0:u.originalArtCredit,displayTheme:n})),(0,m.jsxs)(s.Fragment,{children:[i?(0,m.jsxs)(f.A,{style:{zIndex:1e3},children:[(0,m.jsxs)(N.mF,{children:[(0,m.jsx)("h3",{children:"PART CREDITS"}),(0,m.jsx)(N.Jn,{className:j.B.xButton,alt:"Close",onClick:()=>o(!1)})]}),(0,m.jsx)(b.A,{children:c})]}):null,(0,m.jsx)(r.A5,{className:n?"retro-terminal":"default",disabled:0===c.length,children:(0,m.jsx)("label",{htmlFor:"part-credits",onClick:()=>o(0!==c.length),style:{cursor:"pointer"},children:"PART CREDITS"})})]})};var Q=l(6333),J=l(2823),_=l(3565),K=l(9426),q=l(4415),Z=l(3812),X=l(703);const ee=(0,s.createRef)(),ae=(0,s.createRef)();const le=function(e){let{unit:a,heroType:l,name:t,setShowPremiumPopupFunc:n}=e;const{fantasyNPCBrandList:i,fantasyHeroBrandList:o,unitBackgroundColor:c,unitBackgroundOpacity:u,unitTokenBorder:h,unitTokenBorderColor:p,unitTokenBorderPosition:V}=(0,s.useContext)(B.UnitContext),{user:g}=(0,s.useContext)(R.x),y=Object.assign({},i,o),N=g&&g.isPremiumUser,[x,f]=(0,s.useState)(!1),{height:b,width:v}=a.imageSize;async function j(e,a){let l=(0,Z.A2)({unit:e,brandList:y,layerOrder:a});const s=ee.current;var n=s.getContext("2d");let r;await(0,J.ph)({ctxObject:n,imageLayersArray:l,imageHeight:b,imageWidth:v,unitBackgroundColor:c,unitBackgroundOpacity:u,unitTokenBorder:h,unitTokenBorderColor:p,unitTokenBorderPosition:V}),r=await s.toDataURL("image/png"),ae.current.download=`Retrograde-Minis-${t}.png`,ae.current.href=r,navigator.clipboard.writeText((0,X.kO)(e)),ae.current.click(),n.clearRect(0,0,v,b),f(!1)}return(0,m.jsxs)(_.A,{children:[(0,m.jsx)(r.QB,{className:"default",title:"Export Currently Selected Hero Parts as PNG with currently applied color tints",onClick:x?()=>{}:()=>N?(f(!0),j(a,"NPC"===l?K.Vz:q._$)):n(d.$.PLUS_ONE),children:x?"Loading":"Export \u25cf"}),(0,m.jsx)("canvas",{ref:ee,height:b,width:v,crossOrigin:"anonymous"}),(0,m.jsx)("a",{ref:ae,target:"_blank",download:!0})]})};var se=l(6159),te=l.n(se),ne=l(2450);const re=(0,s.createRef)();const ie=function(e){let{unit:a,name:l,heroType:t,setShowPremiumPopupFunc:n,addColorList:i=!1}=e;const{user:o}=(0,s.useContext)(R.x),{fantasyNPCBrandList:c,fantasyHeroBrandList:u}=(0,s.useContext)(B.UnitContext),h=Object.assign({},c,u),p=o&&o.isLegendaryUser,[V,g]=(0,s.useState)(!1),y=a.imageSize;async function N(e,a){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],t=(0,Z.A2)({unit:e,brandList:h,layerOrder:a}),n=new(te());const r=n.folder(`${l}`);i&&n.file(`${l}/color-list.txt`,s?(0,X.LF)(e):(0,X.kO)(e));const o=re.current;let c=o.getContext("2d");await(0,J.Se)({ctxObject:c,canvas:o,zipObject:r,images:t,imageSize:y}),n.generateAsync({type:"blob"}).then((function(e){(0,ne.saveAs)(e,`Retrograde-Minis-${l}.zip`)}),(function(e){console.log(e)})),g(!1)}return(0,m.jsxs)(_.A,{children:[(0,m.jsx)(r.QB,{className:"default",title:"Export All Currently Selected Hero Parts as individual PNGs with currently applied color tints",onClick:V?()=>{}:()=>p?(g(!0),"NPC"===t?N(a,K.Vz,!0):N(a,q._$)):n(d.$.LEGENDARY),children:V?"Loading":i?"Export Zip /w Color List \u25cf\u25cf":"Export Zip \u25cf\u25cf"}),(0,m.jsx)("canvas",{ref:re,height:y.height,width:y.width,crossOrigin:"anonymous"})]})},oe=(0,s.createRef)();const ce=function(e){let{unit:a,name:l,heroType:t,setShowPremiumPopupFunc:n}=e;const{user:i}=(0,s.useContext)(R.x),{fantasyNPCBrandList:o,fantasyHeroBrandList:c}=(0,s.useContext)(B.UnitContext),u=Object.assign({},o,c),h=i&&i.isLegendaryUser,[p,V]=(0,s.useState)(!1);async function g(e,a){let{layerOrder:s,layerList:t,optionList:n}=a,r=(0,Z._J)({unit:e,brandList:u,optionList:n,layerList:t,layerOrder:s}),i=new(te());const o=i.folder(`${l}`),c=oe.current;let d=c.getContext("2d");await(0,J.Se)({ctxObject:d,canvas:c,zipObject:o,images:r,imageSize:e.imageSize}),i.generateAsync({type:"blob"}).then((function(e){(0,ne.saveAs)(e,`Retrograde-Minis-${l}.zip`)}),(function(e){console.log(e)})),V(!1)}return(0,m.jsxs)(_.A,{children:[(0,m.jsx)(r.QB,{className:"default",title:"Export All Possible Parts for this Hero as individual PNGs with currently applied color tints",onClick:p?()=>{}:()=>h?(V(!0),g(a,"NPC"===t?{layerOrder:K.Vz,layerList:K.B0,optionList:K.f3}:{layerOrder:q._$,layerList:q.uH,optionList:q.MN})):n(d.$.LEGENDARY),children:p?"Loading":"Export All \u25cf\u25cf"}),(0,m.jsx)("canvas",{ref:oe,height:a.imageSize.height,width:a.imageSize.width,crossOrigin:"anonymous"})]})};var ue=l(1439),de=l(9618);const me=function(e){let{unit:a,unitPreviewImage:l,name:t,setShowPremiumPopupFunc:n,type:i}=e;const{displayTheme:o}
85=(0,s.useContext)(F.m),[c,u]=(0,s.useState)(!1);return(0,m.jsxs)(s.Fragment,{children:[c?(0,m.jsxs)(f.A,{style:{zIndex:1e3},children:[(0,m.jsxs)(N.mF,{children:[(0,m.jsx)("h3",{children:"DOWNLOAD OPTIONS"}),(0,m.jsx)(N.Jn,{className:j.B.xButton,alt:"Close",onClick:()=>u(!1)})]}),(0,m.jsxs)(de.A,{children:[(0,m.jsx)(Q.A,{}),(0,m.jsx)(ue.A,{unitPreviewImage:l}),(0,m.jsxs)("span",{className:"buttons",children:[(0,m.jsx)(le,{unit:a,name:t,heroType:i,setShowPremiumPopupFunc:n}),(0,m.jsx)(ie,{unit:a,name:t,heroType:i,setShowPremiumPopupFunc:n}),(0,m.jsx)(ie,{unit:a,name:t,heroType:i,setShowPremiumPopupFunc:n,addColorList:!0}),(0,m.jsx)(ce,{unit:a,name:t,heroType:i,setShowPremiumPopupFunc:n})]})]})]}):null,(0,m.jsx)(r.QB,{className:o?"retro-terminal":"default",onClick:()=>u(!0),style:{cursor:"pointer"},children:(0,m.jsx)("label",{htmlFor:"download-modal-button",children:"DOWNLOAD"})})]})};var he=l(2437);const pe=`${x.A}/buttons/back_arrow_white.png`,Ve=`${x.A}/buttons/Color-Sample-Orb-Glow.png`,ge=`${x.A}/buttons/Color-Sample-Orb.png`,ye=`${x.A}/buttons/Color-Sample-Square-Glow-18.png`,Ne=`${x.A}/buttons/Color-Sample-Square-18.png`,xe=(0,t.Ay)(n.cw)` 86 align-items: center; 87 overflow-y: unset; 88 justify-content: space-around; 89 margin-right: 10px; 90 91 ${e=>{let{noFrameSelected:a}=e;return a?`\n height: 440px;\n\n @media only screen and (max-width: ${e=>{let{theme:a}=e;return a.tabletCutoffWidth}}px) {\n height: 820px;\n }\n\n @media only screen and (max-width: ${e=>{let{theme:a}=e;return a.mobileCutoffWidth}}px) {\n height: 950px;\n }\n `:"\n padding: 5px 0 10px;\n block-size: fit-content;\n "}} 92`;xe.displayName="FantasyHeroUnitContainer";const fe=U.A.legendaryTier.orb,be=U.A.legendaryTier.alt;let ve="";const je=e=>!e.isPremium,Ce=e=>!e.isLegendary;const Le=function(e){let{setShowPremiumPopupFunc:a,unitCategory:l,isSubCategory:t}=e;const[u,h]=(0,s.useState)(!1),[p,V]=(0,s.useState)(!1),[N,x]=(0,s.useState)(!1),[f,b]=(0,s.useState)(!1),[v,C]=(0,s.useState)(!1),[L,T]=(0,s.useState)(!1),[S,O]=(0,s.useState)(!1),[A,w]=(0,s.useState)(!1),[E,k]=(0,s.useState)(!1),[$,U]=(0,s.useState)(!1),[G,Q]=(0,s.useState)(!1),[J,_]=(0,s.useState)(!1),[K,q]=(0,s.useState)(!1),[Z,X]=(0,s.useState)(!1),[ee,ae]=(0,s.useState)(!1),[le,se]=(0,s.useState)(!1),[te,ne]=(0,s.useState)(!1),[re,ie]=(0,s.useState)(0),[oe,ce]=(0,s.useState)(0),[ue,de]=(0,s.useState)(Object.assign({},JSON.parse(l.partList[0].defaultValues),{frameValue:null,brandValue:l.title}));(0,s.useEffect)((()=>{var e,a;null!==(e=l.partList[null===ue||void 0===ue?void 0:ue.frameValue])&&void 0!==e&&e.label&&(0,he.s)(`unitState-${l.title}-${null===(a=l.partList[null===ue||void 0===ue?void 0:ue.frameValue])||void 0===a?void 0:a.label}`,ue)}),[ue,l]);const{user:Le}=(0,s.useContext)(R.x),{addUnit:Te,fantasyHeroBrandList:Se}=(0,s.useContext)(B.UnitContext),{displayTheme:Oe}=(0,s.useContext)(F.m),{colorValue:Ae,displayCustomControls:we,tintValue:Ee,handleColorOptionChange:ke,getColorTint:$e}=(0,s.useContext)(y.Q),Pe=Le&&Le.isPremiumUser,Re=Le&&Le.isLegendaryUser;if(t&&(ve+=" sub-category"),null===ue.frameValue)return(0,m.jsxs)(n.sc,{className:ve,isExpanded:u,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,children:[(0,m.jsxs)(n.IA,{onClick:()=>h(!u),title:l.description,children:[(0,m.jsx)(n.xA,{children:l.title}),(0,m.jsx)(D.A,{isExpanded:u,image:u?l.activeImage:l.inactiveImage,alt:l.title,borderSecondaryColor:l.borderSecondaryColor}),(0,m.jsx)(n.I1,{src:fe,alt:"Units Rarity",title:be})]}),(0,m.jsx)(i.A,{children:(0,m.jsx)(xe,{className:ve,themeBackgroun
92dPrimaryColor:Oe?l.retroTerminalBackgroundColor:l.themeBackgroundPrimaryColor,themeBackgroundSecondaryColor:Oe?l.retroTerminalBackgroundSecondaryColor:l.themeBackgroundSecondaryColor,isExpanded:u,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,displayCustomControls:we,noFrameSelected:!0,children:(0,m.jsx)(g,{setShowPremiumPopupFunc:a,setFrameValueFunc:e=>Fe(e,"frameValue"),partList:l.partList,displayTheme:Oe,isPremiumUser:Pe,isLegendaryUser:Re})})})]});function Be(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=JSON.parse(e);const t=null===a?ue.frameValue:a;return Object.entries(s).forEach((e=>{let[a,n]=e;if("RANDOM"===n){const e=a.replace("Value","").replace(/[0-9]/g,"");let n=l.partList[t][e].filter(je).length;Pe&&(n=l.partList[t][e].filter(Ce).length),Re&&(n=l.partList[t][e].length),s[a]=n?(0,W.nd)(0,n-1):"NONE"}})),s}function Fe(e,a){if("frameValue"===a){if(null!==e){var s;const a=(0,he.w)(`unitState-${l.title}-${null===(s=l.partList[e])||void 0===s?void 0:s.label}`);return de(a?Object.assign({},a,{frameValue:e,brandValue:l.title}):Object.assign({},Be(l.partList[e].defaultValues,e),{frameValue:e,brandValue:l.title}))}return de(Object.assign({},{frameValue:e,brandValue:l.title}))}return de(Object.assign({},ue,{[a]:e}))}const Me=l.partList[ue.frameValue].skin.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Pe||e.isLegendary&&!Re,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),We=l.partList[ue.frameValue].face.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Pe||e.isLegendary&&!Re,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),Ue=l.partList[ue.frameValue].eyes.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Pe||e.isLegendary&&!Re,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),Ie=l.partList[ue.frameValue].hair.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Pe||e.isLegendary&&!Re,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),He=l.partList[ue.frameValue].facialHair.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Pe||e.isLegendary&&!Re,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),ze=l.partList[ue.frameValue].head.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Pe||e.isLegendary&&!Re,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),De=l.partList[ue.frameValue].chest.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Pe||e.isLegendary&&!Re,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),Ge=l.partList[ue.frameValue].legs.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Pe||e.isLegendary&&!Re,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),Ye=l.partList[ue.frameValue].leftArm.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Pe||e.isLegendary&&!Re,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),Qe=l.partList[ue.frameValue].rightArm.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Pe||e.isLegendary&&!Re,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),Je=l.partList[ue.frameValue].leftWeapon.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Pe||e.isLegendary&&!Re,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),_e=l.partList[ue.frameValue].rightWeapon.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Pe||e.isLegendary&&
92!Re,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),Ke=l.partList[ue.frameValue].accessory.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Pe||e.isLegendary&&!Re,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),qe=l.partList[ue.frameValue].templateList.map(((e,a)=>(0,m.jsx)("option",{value:a,disabled:e.isPremium&&!Pe||e.isLegendary&&!Re,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`template--${e.label}`))),Ze=l.partList[ue.frameValue].partList.map(((e,a)=>(0,m.jsx)("option",{value:a,children:e.label},`paint-${e.value}-${e.label}`))),Xe=M.A.map(((e,a)=>(0,m.jsx)("option",{value:a,children:e.label},`${e.value}-${e.label}`))),ea=!!l.partList[ue.frameValue].partList[oe].isGlow;return(0,m.jsxs)(n.sc,{className:ve,isExpanded:u,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,children:[(0,m.jsxs)(n.IA,{onClick:()=>h(!u),title:l.description,children:[(0,m.jsx)(n.xA,{children:l.title}),(0,m.jsx)(D.A,{isExpanded:u,image:u?l.activeImage:l.inactiveImage,alt:l.title,borderSecondaryColor:l.borderSecondaryColor}),(0,m.jsx)(n.I1,{src:fe,alt:"Units Rarity",title:be})]}),(0,m.jsx)(i.A,{children:(0,m.jsx)(xe,{className:ve,themeBackgroun
92dPrimaryColor:Oe?l.retroTerminalBackgroundColor:l.themeBackgroundPrimaryColor,themeBackgroundSecondaryColor:Oe?l.retroTerminalBackgroundSecondaryColor:l.themeBackgroundSecondaryColor,isExpanded:u,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,displayCustomControls:we,children:u?(0,m.jsxs)(r.be,{children:[(0,m.jsxs)("div",{className:"options-selectors",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)(r.A5,{className:Oe?"retro-terminal":"default",children:(0,m.jsxs)("label",{htmlFor:"frame-select",onClick:()=>{Fe(null,"frameValue"),ce(0)},style:{cursor:"pointer"},children:[(0,m.jsx)("img",{className:"back",alt:"Back",src:pe}),"\xa0Hero Select"]})}),"\xa0",(0,m.jsx)(Y,{unit:ue,brandList:Se})]}),(0,m.jsxs)(r.A5,{className:Oe?"retro-terminal":"default",children:[(0,m.jsx)("label",{style:{cursor:"pointer"},onClick:()=>a(d.$.PLUS_ONE),children:"\u25cf\xa0\xa0\xa0+1 Tier"}),(0,m.jsx)("label",{style:{cursor:"pointer"},onClick:()=>a(d.$.PLUS_TWO),children:"*\xa0\xa0\xa0+2 Tier"}),(0,m.jsx)("label",{style:{cursor:"pointer",borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px"},onClick:()=>a(d.$.LEGENDARY),children:"\u25cf\u25cf\xa0Legend Tier"})]}),(0,m.jsxs)(r.A5,{style:{marginRight:"auto",marginLeft:"10px"},className:Oe?"retro-terminal":"default",children:[(0,m.jsx)("label",{htmlFor:"template-select",children:"Template"}),(0,m.jsx)("select",{id:"template-select",name:"template",onChange:e=>(function(e){let a=Be(e);de(Object.assign({},{frameValue:ue.frameValue,brandValue:ue.brandValue},{skinTintValue:ue.skinTintValue,faceTintValue:ue.faceTintValue,eyesTintValue:ue.eyesTintValue,hairTintValue:ue.hairTintValue,facialHairTintValue:ue.facialHairTintValue,headTintValue:ue.headTintValue,chestTintValue:ue.chestTintValue,legsTintValue:ue.legsTintValue,rightArmTintValue:ue.rightArmTintValue,leftArmTintValue:ue.leftArmTintValue,rightWeaponTintValue:ue.rightWeaponTintValue,leftWeaponTintValue:ue.leftWeaponTintValue,accessory1TintValue:ue.accessory1TintValue,accessory2TintValue:ue.accessory2TintValue,accessory3TintValue:ue.accessory3TintValue,accessory4TintValue:ue.accessory4TintValue},a))}(l.partList[ue.frameValue].templateList[e.target.value].value),ie(e.target.value)),value:re,children:qe})]}),(0,m.jsx)(W.vH,{}),(0,m.jsxs)(r.A5,{disabled:!Me.length,className:Oe?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"skin-select",children:[(0,m.jsx)("span",{children:l.partList[ue.frameValue].labels.skin}),Me.length?(0,m.jsx)("img",{alt:`${l.partList[ue.frameValue].labels.skin} Color Preview`,src:l.partList[ue.frameValue].partList.filter((e=>"skin"===e.value))[0].isGlow?ye:Ne,className:"part-color-preview",style:{filter:ue.skinTintValue}}):null,(0,m.jsx)(j.A,{className:p?j.B.locked:j.B.unlocked,alt:"Option "+(p?"Locked":"Unlocked"),onClick:()=>V(!p)})]}),(0,m.jsx)("select",{id:"skin-select",name:"skin",onChange:e=>Fe(e.target.value,"skinValue"),value:ue.skinValue,disabled:!Me.length,children:Me})]}),(0,m.jsxs)(r.A5,{disabled:!We.length,className:Oe?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"face-select",children:[(0,m.jsx)("span",{children:l.partList[ue.frameValue].labels.face}),We.length?(0,m.jsx)("img",{alt:`${l.partList[ue.frameValue].labels.face} Color Preview`,src:l.partList[ue.frameValue].partList.filter((e=>"face"===e.value))[0].isGlow?ye:Ne,className:"part-color-preview",style:{filter:ue.faceTintValue}}):null,(0,m.jsx)(j.A,{className:N?j.B.locked:j.B.unlocked,alt:"Option "+(N?"Locked":"Unlocked"),onClick:()=>x(!N)})]}),(0,m.jsxs)("select",{id:"face-select",name:"face",onChange:e=>{return a={faceValue:e.target.value},de(Object.assign({},ue,a));var a},value:ue.faceValue,disabled:!We.length,children:[l.partList[ue.frameValue].removeNone&&l.partList[ue.frameValue].removeNone.face?null:(0,m.jsx)("option",{value:"NONE",children:"None"}),We]})]}),(0,m.jsxs)(r.A5,{disabled:!ze.length,className:Oe?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"head-select",children:[(0,m.jsx)("span",{children:l.partList[ue.frameValue].labels.head}),ze.length?(0,m.jsx)("img",{alt:`${l.partList[ue.frameValue].labels.head} Color Preview`,src:l.partList[ue.frameValue].partList.filter((e=>"head"===e.value))[0].isGlow?ye:Ne,className:"part-color-preview",style:{filter:ue.headTintValue}}):null,(0,m.jsx)(j.A,{className:S?j.B.locked:j.B.unlocked,alt:"Option "+(S?"Locked":"Unlocked"),onClick:()=>O(!S)})]}),(0,m.jsxs)("select",{id:"head-select",name:"head",onChange:e=>Fe(e.target.value,"headValue"),value:ue.headValue,disabled:!ze.length,children:[l.partList[ue.frameValue].removeNone&&l.partList[ue.frameValue].removeNone.head?null:(0,m.jsx)("option",{value:"NONE",children:"None"}),ze]})]}),(0,m.jsxs)(r.A5,{disabled:!Ue.length,className:Oe?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"eyes-select",children:[(0,m.jsx)("span",{children:l.partList[ue.frameValue].labels.eyes}),Ue.length?(0,m.jsx)("img",{alt:`${l.partList[ue.frameValue].labels.eyes} Color Preview`,src:l.partList[ue.frameValue].partList.filter((e=>"eyes"===e.value))[0].isGlow?ye:Ne,className:"part-color-preview",style:{filter:ue.eyesTintValue}}):null,(0,m.jsx)(j.A,{className:f?j.B.locked:j.B.unlocked,alt:"Option "+(f?"Locked":"Unlocked"),onClick:()=>b(!f)})]}),(0,m.jsxs)("select",{id:"eyes-select",name:"eyes",onChange:e=>Fe(e.target.value,"eyesValue"),value:ue.eyesValue,disabled:!Ue.length,children:[l.partList[ue.frameValue].removeNone&&l.partList[ue.frameValue].removeNone.eyes?null:(0,m.jsx)("option",{value:"NONE",children:"None"}),Ue]})]}),(0,m.jsxs)(r.A5,{disabled:!De.length,className:Oe?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"chest-select",children:[(0,m.jsx)("span",{children:l.partList[ue.frameValue].labels.chest}),De.length?(0,m.jsx)("img",{alt:`${l.partList[ue.frameValue].labels.chest} Color Preview`,src:l.partList[ue.frameValue].partList.filter((e=>"chest"===e.value))[0].isGlow?ye:Ne,className:"part-color-preview",style:{filter:ue.chestTintValue}}):null,(0,m.jsx)(j.A,{className:A?j.B.locked:j.B.unlocked,alt:"Option "+(A?"Locked":"Unlocked"),onClick:()=>w(!A)})]}),(0,m.jsxs)("select",{id:"chest-select",name:"chest",onChange:e=>Fe(e.target.value,"chestValue"),value:ue.chestValue,disabled:!De.length,children:[l.partList[ue.frameValue].removeNone&&l.partList[ue.frameValue].removeNone.chest?null:(0,m.jsx)("option",{value:"NONE",children:"None"}),De]})]}),(0,m.jsxs)(r.A5,{disabled:!Ge.length,className:Oe?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"legs-select",children:[(0,m.jsx)("span",{children:l.partList[ue.frameValue].labels.legs}),Ge.length?(0,m.jsx)("img",{alt:`${l.partList[ue.frameValue].labels.legs} Color Preview`,src:l.partList[ue.frameValue].partList.filter((e=>"legs"===e.value))[0].isGlow?ye:Ne,className:"part-color-preview",style:{filter:ue.legsTintValue}}):null,(0,m.jsx)(j.A,{className:E?j.B.locked:j.B.unlocked,alt:"Option "+(E?"
92Locked":"Unlocked"),onClick:()=>k(!E)})]}),(0,m.jsxs)("select",{id:"legs-select",name:"legs",onChange:e=>Fe(e.target.value,"legsValue"),value:ue.legsValue,disabled:!Ge.length,children:[l.partList[ue.frameValue].removeNone&&l.partList[ue.frameValue].removeNone.legs?null:(0,m.jsx)("option",{value:"NONE",children:"None"}),Ge]})]}),(0,m.jsxs)(r.A5,{disabled:!Ye.length,className:Oe?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"leftArm-select",children:[(0,m.jsx)("span",{children:l.partList[ue.frameValue].labels.leftArm}),Ye.length?(0,m.jsx)("img",{alt:`${l.partList[ue.frameValue].labels.leftArm} Color Preview`,src:l.partList[ue.frameValue].partList.filter((e=>"leftArm"===e.value))[0].isGlow?ye:Ne,className:"part-color-preview",style:{filter:ue.leftArmTintValue}}):null,(0,m.jsx)(j.A,{className:$?j.B.locked:j.B.unlocked,alt:"Option "+($?"Locked":"Unlocked"),onClick:()=>U(!$)})]}),(0,m.jsxs)("select",{id:"leftArm-select",name:"leftArm",onChange:e=>Fe(e.target.value,"leftArmValue"),value:ue.leftArmValue,disabled:!Ye.length,children:[l.partList[ue.frameValue].removeNone&&l.partList[ue.frameValue].removeNone.leftArm?null:(0,m.jsx)("option",{value:"NONE",children:"None"}),Ye]})]}),(0,m.jsxs)(r.A5,{disabled:!Qe.length,className:Oe?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"rightArm-select",children:[(0,m.jsx)("span",{children:l.partList[ue.frameValue].labels.rightArm}),Qe.length?(0,m.jsx)("img",{alt:`${l.partList[ue.frameValue].labels.rightArm} Color Preview`,src:l.partList[ue.frameValue].partList.filter((e=>"rightArm"===e.value))[0].isGlow?ye:Ne,className:"part-color-preview",style:{filter:ue.rightArmTintValue}}):null,(0,m.jsx)(j.A,{className:G?j.B.locked:j.B.unlocked,alt:"Option "+(G?"Locked":"Unlocked"),onClick:()=>Q(!G)})]}),(0,m.jsxs)("select",{id:"rightArm-select",name:"rightArm",onChange:e=>Fe(e.target.value,"rightArmValue"),value:ue.rightArmValue,disabled:!Qe.length,children:[l.partList[ue.frameValue].removeNone&&l.partList[ue.frameValue].removeNone.rightArm?null:(0,m.jsx)("option",{value:"NONE",children:"None"}),Qe]})]}),(0,m.jsxs)(r.A5,{disabled:!Ke.length,className:Oe?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"accessory-1-select",children:[(0,m.jsx)("span",{children:l.partList[ue.frameValue].labels.accessory1}),Ke.length?(0,m.jsx)("img",{alt:`${l.partList[ue.frameValue].labels.accessory1} Color Preview`,src:l.partList[ue.frameValue].partList.filter((e=>"accessory1"===e.value))[0].isGlow?ye:Ne,className:"part-color-preview",style:{filter:ue.accessory1TintValue}}):null,(0,m.jsx)(j.A,{className:Z?j.B.locked:j.B.unlocked,alt:"Option "+(Z?"Locked":"Unlocked"),onClick:()=>X(!Z)})]}),(0,m.jsxs)("select",{id:"accessory-1-select",name:"accessory1",onChange:e=>Fe(e.target.value,"accessory1Value"),value:ue.accessory1Value,disabled:!Ke.length,children:[l.partList[ue.frameValue].removeNone&&l.partList[ue.frameValue].removeNone.accessory1?null:(0,m.jsx)("option",{value:"NONE",children:"None"}),Ke]})]}),(0,m.jsxs)(r.A5,{disabled:!Ke.length,className:Oe?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"accessory-2-select",children:[(0,m.jsx)("span",{children:l.partList[ue.frameValue].labels.accessory2}),Ke.length?(0,m.jsx)("img",{alt:`${l.partList[ue.frameValue].labels.accessory2} Color Preview`,src:l.partList[ue.frameValue].partList.filter((e=>"accessory2"===e.value))[0].isGlow?ye:Ne,className:"part-color-preview",style:{filter:ue.accessory2TintValue}}):null,(0,m.jsx)(j.A,{className:ee?j.B.locked:j.B.unlocked,alt:"Option "+(ee?"Locked":"Unlocked"),onClick:()=>ae(!ee)})]}),(0,m.jsxs)("select",{id:"accessory-2-select",name:"accessory2",onChange:e=>Fe(e.target.value,"accessory2Value"),value:ue.accessory2Value,disabled:!Ke.length,children:[l.partList[ue.frameValue].removeNone&&l.partList[ue.frameValue].removeNone.accessory2?null:(0,m.jsx)("option",{value:"NONE",children:"None"}),Ke]})]}),(0,m.jsxs)(r.A5,{disabled:!Ke.length,className:Oe?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"accessory-3-select",children:[(0,m.jsx)("span",{children:l.partList[ue.frameValue].labels.accessory3}),Ke.length?(0,m.jsx)("img",{alt:`${l.partList[ue.frameValue].labels.accessory3} Color Preview`,src:l.partList[ue.frameValue].partList.filter((e=>"accessory3"===e.value))[0].isGlow?ye:Ne,className:"part-color-preview",style:{filter:ue.accessory3TintValue}}):null,(0,m.jsx)(j.A,{className:le?j.B.locked:j.B.unlocked,alt:"Option "+(le?"Locked":"Unlocked"),onClick:()=>se(!le)})]}),(0,m.jsxs)("select",{id:"accessory-3-select",name:"accessory3",onChange:e=>Fe(e.target.value,"accessory3Value"),value:ue.accessory3Value,disabled:!Ke.length,children:[l.partList[ue.frameValue].removeNone&&l.partList[ue.frameValue].removeNone.accessory3?null:(0,m.jsx)("option",{value:"NONE",children:"None"}),Ke]})]}),(0,m.jsxs)(r.A5,{disabled:!Ke.length,className:Oe?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"accessory-4-select",children:[(0,m.jsx)("span",{children:l.partList[ue.frameValue].labels.accessory4}),Ke.length?(0,m.jsx)("img",{alt:`${l.partList[ue.frameValue].labels.accessory4} Color Preview`,src:l.partList[ue.frameValue].partList.filter((e=>"accessory4"===e.value))[0].isGlow?ye:Ne,className:"part-color-preview",style:{filter:ue.accessory4TintValue}}):null,(0,m.jsx)(j.A,{className:te?j.B.locked:j.B.unlocked,alt:"Option "+(te?"Locked":"Unlocked"),onClick:()=>ne(!te)})]}),(0,m.jsxs)("select",{id:"accessory-4-select",name:"accessory4",onCh
92ange:e=>Fe(e.target.value,"accessory4Value"),value:ue.accessory4Value,disabled:!Ke.length,children:[l.partList[ue.frameValue].removeNone&&l.partList[ue.frameValue].removeNone.accessory4?null:(0,m.jsx)("option",{value:"NONE",children:"None"}),Ke]})]})]}),(0,m.jsxs)("div",{className:"display-controls",children:[(0,m.jsx)(o.A,{onContextMenu:e=>e.preventDefault(),imageSize:l.partList[ue.frameValue].imageSize,children:(0,m.jsx)(H.A,{children:(0,m.jsx)(c.A,{unit:ue,brandList:Se,isInCategory:!0})})}),(0,m.jsxs)(r.OT,{children:[(0,m.jsxs)(r.A5,{disabled:!Ie.length,className:Oe?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"hair-select",children:[(0,m.jsx)("span",{children:l.partList[ue.frameValue].labels.hair}),Ie.length?(0,m.jsx)("img",{alt:`${l.partList[ue.frameValue].labels.hair} Color Preview`,src:l.partList[ue.frameValue].partList.filter((e=>"hair"===e.value))[0].isGlow?ye:Ne,className:"part-color-preview",style:{filter:ue.hairTintValue}}):null,(0,m.jsx)(j.A,{className:v?j.B.locked:j.B.unlocked,alt:"Option "+(v?"Locked":"Unlocked"),onClick:()=>C(!v)})]}),(0,m.jsxs)("select",{id:"hair-select",name:"hair",onChange:e=>Fe(e.target.value,"hairValue"),value:ue.hairValue,disabled:!Ie.length,children:[l.partList[ue.frameValue].removeNone&&l.partList[ue.frameValue].removeNone.hair?null:(0,m.jsx)("option",{value:"NONE",children:"None"}),Ie]})]}),(0,m.jsxs)(r.A5,{disabled:!He.length,className:Oe?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"facialHair-select",children:[(0,m.jsx)("span",{children:l.partList[ue.frameValue].labels.facialHair}),He.length?(0,m.jsx)("img",{alt:`${l.partList[ue.frameValue].labels.facialHair} Color Preview`,src:l.partList[ue.frameValue].partList.filter((e=>"facialHair"===e.value))[0].isGlow?ye:Ne,className:"part-color-preview",style:{filter:ue.facialHairTintValue}}):null,(0,m.jsx)(j.A,{className:L?j.B.locked:j.B.unlocked,alt:"Option "+(L?"Locked":"Unlocked"),onClick:()=>T(!L)})]}),(0,m.jsxs)("select",{id:"facialHair-select",name:"facialHair",onChange:e=>Fe(e.target.value,"facialHairValue"),value:ue.facialHairValue,disabled:!He.length,children:[l.partList[ue.frameValue].removeNone&&l.partList[ue.frameValue].removeNone.facialHair?null:(0,m.jsx)("option",{value:"NONE",children:"None"}),He]})]}),(0,m.jsxs)(r.A5,{disabled:!Je.length,className:Oe?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"leftWeapon-select",children:[(0,m.jsx)("span",{children:l.partList[ue.frameValue].labels.leftWeapon}),Je.length?(0,m.jsx)("img",{alt:`${l.partList[ue.frameValue].labels.leftWeapon} Color Preview`,src:l.partList[ue.frameValue].partList.filter((e=>"leftWeapon"===e.value))[0].isGlow?ye:Ne,className:"part-color-preview",style:{filter:ue.leftWeaponTintValue}}):null,(0,m.jsx)(j.A,{className:J?j.B.locked:j.B.unlocked,alt:"Option "+(J?"Locked":"Unlocked"),onClick:()=>_(!J)})]}),(0,m.jsxs)("select",{id:"leftWeapon-select",name:"leftWeapon",onChange:e=>Fe(e.target.value,"leftWeaponValue"),value:ue.leftWeaponValue,disabled:!Je.length,children:[l.partList[ue.frameValue].removeNone&&l.partList[ue.frameValue].removeNone.leftWeapon?null:(0,m.jsx)("option",{value:"NONE",children:"None"}),Je]})]}),(0,m.jsxs)(r.A5,{disabled:!_e.length,className:Oe?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"rightWeapon-select",children:[(0,m.jsx)("span",{children:l.partList[ue.frameValue].labels.rightWeapon}),_e.length?(0,m.jsx)("img",{alt:`${l.partList[ue.frameValue].labels.rightWeapon} Color Preview`,src:l.partList[ue.frameValue].partList.filter((e=>"rightWeapon"===e.value))[0].isGlow?ye:Ne,className:"part-color-preview",style:{filter:ue.rightWeaponTintValue}}):null,(0,m.jsx)(j.A,{className:K?j.B.locked:j.B.unlocked,alt:"Option "+(K?"Locked":"Unlocked"),onClick:()=>q(!K)})]}),(0,m.jsxs)("select",{id:"rightWeapon-select",name:"rightWeapon",onChange:e=>Fe(e.target.value,"rightWeaponValue"),value:ue.rightWeaponValue,disabled:!_e.length,children:[l.partList[ue.frameValue].removeNone&&l.partList[ue.frameValue].removeNone.rightWeapon?null:(0,m.jsx)("option",{value:"NONE",children:"None"}),_e]})]}),(0,m.jsx)(r.QB,{className:Oe?"retro-terminal":"default",onClick:function(){return V(!1),x(!1),b(!1),C(!1),T(!1),O(!1),w(!1),k(!1),U(!1),Q(!1),_(!1),q(!1),X(!1),ae(!1),se(!1),ne(!1),de(Object.assign({},Be(l.partList[ue.frameValue].defaultValues),{frameValue:ue.frameValue,brandValue:l.title}))},children:"Reset"}),(0,m.jsx)(r.QB,{className:Oe?"retro-terminal":"default",onClick:function(){let e=l.partList[ue.frameValue].skin.filter(je).length,a=l.partList[ue.frameValue].face.filter(je).length,s=l.partList[ue.frameValue].hair.filter(je).length,t=l.partList[ue.frameValue].facialHair.filter(je).length,n=l.partList[ue.frameValue].head.filter(je).length,r=l.partList[ue.frameValue].chest.filter(je).length,i=l.partList[ue.frameValue].legs.filter(je).length,o=l.partList[ue.frameValue].leftArm.filter(je).length,c=l.partList[ue.frameValue].rightArm.filter(je).length,u=l.partList[ue.frameValue].leftWeapon.filter(je).length,d=l.partList[ue.frameValue].rightWeapon.filter(je).length;Pe&&(e=l.partList[ue.frameValue].skin.filter(Ce).length,a=l.partList[ue.frameValue].face.filter(Ce).length,s=l.partList[ue.frameValue].hair.filter(Ce).length,t=l.partList[ue.frameValue].facialHair.filter(Ce).length,n=l.partList[ue.frameValue].head.filter(Ce).length,r=l.partList[ue.frameValue].chest.filter(Ce).length,i=l.partList[ue.frameValue].legs.filter(Ce).length,o=l.partList[ue.frameValue].leftArm.filter(Ce).length,c=l.partList[ue.frameValue].rightArm.filter(Ce).length,u=l.partList[ue.frameValue].leftWeapon.filter(Ce).length,d=l.partList[ue.frameValue].rightWeapon.filter(Ce).length),Re&&(e=l.partList[ue.frameValue].skin.length,a=l.partList[ue.frameValue].face.length,s=l.partList[ue.frameValue].hair.length,t=l.partList[ue.frameValue].facialHair.length,n=l.partList[ue.frameValue].head.length,r=l.partList[ue.frameValue].chest.length,i=l.partList[ue.frameValue].legs.length,o=l.partList[ue.frameValue].leftArm.length,c=l.partList[ue.frameValue].rightArm.length,u=l.partList[ue.frameValue].leftWeapon.length,d=l.partList[ue.frameValue].rightWeapon.length);const m={skinValue:e?(0,W.nd)(0,e-1):"NONE",faceValue:a?(0,W.nd)(0,a-1):"NONE",hairValue:s&&(0,W.nd)(0,1)?(0,W.nd)(0,s-1):"NONE",facialHairValue:t&&(0,W.nd)(0,1)?(0,W.nd)(0,t-1):"NONE",headValue:n&&(0,W.nd)(0,1)?(0,W.nd)(0,n-1):"NONE",chestValue:r&&(0,W.nd)(0,1)?(0,W.nd)(0,r-1):"NONE",legsValue:i?(0,W.nd)(0,i-1):"NONE",leftArmValue:o&&(0,W.nd)(0,1)?(0,W.nd)(0,o-1):"NONE",rightArmValue:c&&(0,W.nd)(0,1)?(0,W.nd)(0,c-1):"NONE",leftWeaponValue:u&&(0,W.nd)(0,1)?(0,W.nd)(0,u-1):"NONE",rightWeaponValue:d&&(0,W.nd)(0,1)?(0,W.nd)(0,d-1):"NONE",brandValue:l.title};return l.partList[ue.frameValue].removeNone&&("NONE"===m.skinValue&&l.partList[ue.frameValue].removeNone.skin&&(m.skinValue=0),"NONE"===m.faceValue&&l.partList[ue.frameValue].removeNone.face&&(m.faceValue=0),"NONE"===m.hairValue&&l.partList[ue.frameValue].removeNone.hair&&(m.hairValue=0),"NONE"===m.facialHairValue&&l.partList[ue.frameValue].removeNone.facialHair&&(m.facialHairValue=0),"NONE"===m.headValue&&l.partList[ue.frameValue].removeNone.head&&(m.headValue=0),"NONE"===m.chestValue&&l.partList[ue.frameValue].removeNone.chest&&(m.chestValue=0),"NONE"===m.legsValue&&l.partList[ue.frameValue].removeNone.legs&&(m.legsValue=0),"NONE"===m.leftArmValue&&l.partList[ue.frameValue].removeNone.leftArm&&(m.leftArmValue=0),"NONE"===m.rightArmValue&&l.partList[ue.frameValue].removeNone.rightArm&&(m.rightArmValue=0),"NONE"===m.leftWeaponValue&&l.partList[ue.frameValue].removeNone.leftWeapon&&(m.leftWeaponValue=0),"NONE"===m.rightWeaponValue&&l.partList[ue.frameValue].removeNone.rightWeapon&&(m.rightWeaponValue=0)),p&&delete m.skinValue,N&&delete m.faceValue,v&&delete m.hairValue,L&&delete m.facialHairValue,S&&delete m.headValue,A&&delete m.chestValue,E&&delete m.legsValue,$&&delete m.leftArmValue,G&&delete m.rightArmValue,J&&delete m.leftWeaponValue,K&&delete m.rightWeaponValue,de(Object.assign({},ue,m))},children:"Random"}),(0,m.jsx)(me,{unit:{...ue,imageSize:l.partList[ue.frameValue].imageSize},unitPreviewImage:{src:l.partList[ue.frameValue].previewImg,imageHeight:l.partList[ue.frameValue].imageSize.height,imageWidth:l.partList[ue.frameValue].imageSize.width},name:`${l.title}-${l.partList[ue.frameValue].label}`,setShowPremiumPopupFunc:a,type:"BRANDED"}),(0,m.jsx)(r.QB,{className:Oe?"retro-terminal":"default",onClick:function(){const e=`FANTASY ${l.title} ${l.partList[ue.frameValue].label}`,a=[Object.assign({},ue,{imageSize:l.partList[ue.frameValue].imageSize})];let s="NONE"!==ue.skinValue?l.partList[ue.frameValue].skin[ue.skinValue].shadowDetail
92s:{size:z.O7.NONE,bottom:"0px",right:"0px"};return Te(Object.assign({variantsArray:a,currentVariant:0,id:`${e}-${Date.now()}`,shadowDetails:s,fantasyHeroUnit:!0,heroLabel:e}))},children:"Venture Forth"}),(0,m.jsx)(r.QB,{className:Oe?"retro-terminal":"default",onClick:function(){const e={},a=l.partList[ue.frameValue].partList[oe].value;let s=$e();switch(a){case"WEAPONS":e.rightWeaponTintValue=s,e.leftWeaponTintValue=s;break;case"BODY":e.skinTintValue=s,e.faceTintValue=s;break;case"ARMOR":e.headTintValue=s,e.chestTintValue=s,e.legsTintValue=s,e.rightArmTintValue=s,e.leftArmTintValue=s;break;case"ALLHAIR":e.hairTintValue=s,e.facialHairTintValue=s;break;case"ACCESSORIES":e.accessory1TintValue=s,e.accessory2TintValue=s,e.accessory3TintValue=s,e.accessory4TintValue=s;break;case"ALL":e.skinTintValue=s,e.faceTintValue=s,e.eyesTintValue=s,e.hairTintValue=s,e.facialHairTintValue=s,e.headTintValue=s,e.chestTintValue=s,e.legsTintValue=s,e.rightArmTintValue=s,e.leftArmTintValue=s,e.rightWeaponTintValue=s,e.leftWeaponTintValue=s,e.accessory1TintValue=s,e.accessory2TintValue=s,e.accessory3TintValue=s,e.accessory4TintValue=s;break;default:e[`${a}TintValue`]=s}return de(Object.assign({},ue,e))},children:"Apply Color"}),(0,m.jsx)(r.R2,{}),(0,m.jsxs)(r.A5,{className:Oe?"retro-terminal":"default",children:[(0,m.jsx)("label",{htmlFor:"color-select",children:"Color"}),(0,m.jsx)("select",{id:"color-select",name:"color",onChange:ke,value:Ae,children:Xe}),(0,m.jsx)(I.A,{tintValue:Ee,src:ea?Ve:ge,alt:"paint-preview"})]}),(0,m.jsxs)(r.A5,{className:Oe?"retro-terminal":"default",children:[(0,m.jsx)("label",{htmlFor:"part-select",children:"Color Target"}),(0,m.jsx)("select",{id:"part-select",name:"part",onChange:e=>ce(e.target.value),value:oe,children:Ze})]})]})]}),we?(0,m.jsx)(P,{displayTheme:Oe,targetPartIsGlow:ea}):null]}):null})})]})};var Te=l(1967),Se=l(9379);function Oe(e,a,l){(0,s.useEffect)((()=>{if(e.current&&a.current){const s={root:e.current,rootMargin:"0px",threshold:.1},t=new IntersectionObserver((e=>{e.every((e=>e.isIntersecting))&&l()}),s);return t.observe(a.current),()=>{t.disconnect()}}}),[e.current,a.current,l])}var Ae=l(2631);function we(e){return e.map((e=>{var a;return[e.variants[0].variant,...e.variants[0].unitNumber.split("+").map((e=>e.trim().toLowerCase())),e.variants[0].dateAdded,e.variants.some((e=>e.isGIF))?"gif":"",...null!==(a=e.variants[0].tags)&&void 0!==a?a:[]]})).reduce(((e,a)=>e.concat(JSON.parse(JSON.stringify(a)))),[]).filter(((e,a,l)=>l.indexOf(e)===a))}function Ee(e,a){return e.map((e=>{var l;return"tags"===a?["gif",...null!==(l=e.variants[0][a])&&void 0!==l?l:[]]:"unitNumber"===a?[...e.variants[0].unitNumber.split("+").map((e=>e.trim().toLowerCase()))]:[e.variants[0][a]]})).reduce(((e,a)=>e.concat(JSON.parse(JSON.stringify(a)))),[]).filter(((e,a,l)=>l.indexOf(e)===a)).sort(((e,a)=>e.localeCompare(a)))}function ke(e,a){return a.length?e.filter((e=>{if(0===a.length)return!0;let l=!1;return l=a.every((a=>{let l=!1;return l=function(e,a){var l;return e.variants[0].variant.toLowerCase()===a.toLowerCase()||e.variants[0].unitNumber.toLowerCase().split("+").map((e=>e.trim())).includes(a.toLowerCase())||e.variants[0].dateAdded===a||"gif"===a&&e.variants.some((e=>e.isGIF))||(null===(l=e.variants[0].tags)||void 0===l?void 0:l.includes(a.toLowerCase()))}(e,a),l})),l})):e}var $e=l(5528),Pe=l(910),Re=l(237);const Be=(0,t.Ay)(o.A)` 93 max-width: unset; 94 flex-direction: column; 95`;Be.displayName="MechSingleUnit";const Fe=t.Ay.div` 96 align-self: stretch; 97 align-items: center; 98 justify-content: center; 99 display: flex; 100 flex-wrap: wrap; 101 position: relative; 102`;Fe.displayName="UnitRow";const Me=function(e){var a,l,t,n,r;let{setShowPremiumPopupFunc:i,variantsArray:o,isFantasy:c=!1,isFree:d=!0}=e;
102const[h,p]=(0,s.useState)(!0),{user:V}=(0,s.useContext)(R.x),g=V&&V.isPremiumUser,y=V&&V.isLegendaryUser;let N=o[0].src;return o[0].legendary?y||(N=o[0].previewSrc):o[0].previewSrc&&(g||(N=o[0].previewSrc)),(0,m.jsxs)(Be,{onContextMenu:e=>e.preventDefault(),imageSize:(null===(a=o[0])||void 0===a?void 0:a.imageSize)||{height:o[0].height,width:o[0].width},isExtraSmall:o[0].isExtraSmall,children:[(0,m.jsxs)(Fe,{children:[h?(0,m.jsx)(Re.A,{}):null,o[0].isExtraSmall?(0,m.jsx)($e.zs,{src:N,alt:`${o[0].filePrefix}${o[0].unitNumber}-${o[0].variant}`,height:2*o[0].height,width:2*o[0].width,onLoad:()=>p(!1)}):(0,m.jsx)($e.Ay,{src:N,alt:`${o[0].filePrefix}${o[0].unitNumber}-${o[0].variant}`,onLoad:()=>p(!1),title:o[0].longDescription})]}),(0,m.jsx)(Fe,{children:(0,m.jsx)(Pe.A,{unit:o[0],setShowPremiumPopupFunc:i,isFree:d,isZIP:!0})}),o[0].longDescription?null:(0,m.jsx)(Fe,{children:(0,m.jsx)(u.A5,{className:c?"fantasy":"default",disabled:!1,children:(0,m.jsx)("label",{className:"long-text-display",htmlFor:"weapon-select",title:`Added on ${o[0].dateAdded}${null!==(l=o[0])&&void 0!==l&&null!==(t=l.tags)&&void 0!==t&&t.length?`\nTags: ${null===(n=o[0])||void 0===n||null===(r=n.tags)||void 0===r?void 0:r.join(", ")}`:""}`,children:`${o[0].variant} by ${o[0].unitNumber}`})})})]})},We=`${x.A}/buttons/d-arrow.png`,Ue=(0,t.Ay)(n.cw)` 103 height: 640px; 104`;Ue.displayName="FantasyTavernUnitContainer";const Ie=(0,t.Ay)(Ae.tI)` 105 display: flex; 106 flex-direction: row; 107 gap: 10px 10px; 108 flex-wrap: wrap; 109`;Ie.displayName="FantasyTypeAheadContainer";const He=(0,t.Ay)(r.A5)` 110 111 112 select { 113 border-color: ${e=>e.theme.categoryPrimaryColor}; 114 border-style: inset; 115 border-width: 4px; 116 background: ${`url(${We})`} right center no-repeat; 117 background-color: ${e=>e.theme.categorySecondaryColor}; 118 color: #FFF; 119 } 120 121 option { 122 color: #FFF; 123 background: ${e=>e.theme.categorySecondaryColor}; 124 } 125`;He.displayName="FantasySelectDropdown";const ze=function(e){let{setShowPremiumPopupFunc:a,unitCategory:l}=e;const[t,r]=(0,s.useState)(!1),[o,c]=(0,s.useState)(6),[u,d]=(0,s.use
125State)(l.defaultFilter||[]),[h,p]=(0,s.useState)(""),[V,g]=(0,s.useState)([]),[y,N]=(0,s.useState)([]),[x,f]=(0,s.useState)([]),[b,v]=(0,s.useState)([]),[C,L]=(0,s.useState)(!1),[T,S]=(0,s.useState)(1),O=(0,s.useRef)(null);let A=(0,s.useRef)(null);(0,s.useEffect)((()=>{g(we(l.unitList)),N(Ee(l.unitList,"variant")),f(Ee(l.unitList,"unitNumber")),v(Ee(l.unitList,"dateAdded"))}),[l.unitList]);const w=V.filter((e=>!u.includes(e))).filter((e=>0!==h.trim().length&&e.toLowerCase().includes(h.trim().toLowerCase()))).slice(0,5).map((e=>(0,m.jsx)("div",{onClick:()=>(S(1),C?d(u.concat(e)):(d([e]),L(!0)),p("")),children:e.toUpperCase()},e))),E=u.map((e=>(0,m.jsx)(Ae.$7,{filterText:e,removeFilterFunc:()=>(S(1),d(u.filter((a=>a!==e))))},e))),k=ke(l.unitList,u),$=k.slice(0,15*T);let P;return l.premium&&(P=U.A.themepackTier.orb),Oe(O,A,(function(){k.length>=15*T&&S(T+1)})),(0,m.jsxs)(n.sc,{className:"",isExpanded:t,numColumnsVisible:o,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,children:[(0,m.jsxs)(n.IA,{onClick:()=>r(!t),title:l.description,children:[(0,m.jsx)(n.xA,{className:"",children:l.title}),(0,m.jsx)(D.A,{className:"",isExpanded:t,image:t?l.activeImage:l.inactiveImage,alt:l.title,borderSecondaryColor:l.borderSecondaryColor}),P?(0,m.jsx)(n.I1,{src:P}):null]}),t&&!l.hideFilters?(0,m.jsxs)(Ae.ug,{children:[(0,m.jsxs)(Ie,{children:[(0,m.jsx)(He,{children:(0,m.jsxs)("select",{id:"name-select",name:"name-filters",value:"",onChange:e=>{S(1),C?d(u.concat(e.target.value)):(d([e.target.value]),L(!0))},children:[(0,m.jsx)("option",{value:"",defaultValue:!0,disabled:!0,hidden:!0,children:"Name"}),y.map((e=>(0,m.jsx)("option",{value:e,children:e.toUpperCase().substring(0,20)},`name-${e}`)))]})}),(0,m.jsx)(He,{children:(0,m.jsxs)("select",{id:"author-select",name:"author-filters",value:"",onChange:e=>{S(1),C?d(u.concat(e.target.value)):(d([e.target.value]),L(!0))},children:[(0,m.jsx)("option",{value:"",defaultValue:!0,disabled:!0,hidden:!0,children:"Author"}),x.map((e=>(0,m.jsx)("option",{value:e,children:e.toUpperCase().substring(0,20)},`author-${e}`)))]})}),(0,m.jsx)(He,{children:(0,m.jsxs)("select",{id:"date-select",name:"date-filters",value:"",onChange:e=>{S(1),C?d(u.concat(e.target.value)):(d([e.target.value]),L(!0))},children:[(0,m.jsx)("option",{value:"",defaultValue:!0,disabled:!0,hidden:!0,children:"Date"}),b.map((e=>(0,m.jsx)("option",{value:e,children:e.toUpperCase()},`date-${e}`)))]})}),(0,m.jsx)(Te.n3,{className:j.B.clearAllInactive,onClick:()=>{d([]),p(""),L(!0)},style:{alignSelf:"center"},role:"button",title:"Clear All Filters"}),(0,m.jsx)("input",{value:h,onChange:e=>p(e.target.value.toUpperCase()),maxLength:18,placeholder:"Barkeep! Do you know..."}),w.length?(0,m.jsx)(Ae.yp,{children:w}):null]}),(0,m.jsx)(Ae.vH,{}),E]}):null,(0,m.jsxs)(i.A,{children:[(0,m.jsx)(Ue,{className:"",themeBackgroun
125dPrimaryColor:l.themeBackgroundPrimaryColor,themeBackgroundSecondaryColor:l.themeBackgroundSecondaryColor,isExpanded:t,numColumnsVisible:o,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,ref:O,children:t?$.map(((e,t)=>(0,m.jsxs)(s.Fragment,{children:[l.isZipCategory?(0,m.jsx)(Me,{setShowPremiumPopupFunc:a,shadowDetails:e.shadowDetails,variantsArray:e.variants,isFantasy:!0,isFree:!1}):(0,m.jsx)(Se.A,{setShowPremiumPopupFunc:a,shadowDetails:e.shadowDetails,variantsArray:e.variants,isFantasy:!0},`${l.title}-${t}-unit.variants[0].src`),t===$.length-1?(0,m.jsx)("div",{ref:A},`${l.title}-intersection-observer`):null]},`${l.title}-${t}`))):null}),(0,m.jsx)(n.mi,{onClick:()=>c(6===o?3:o+1),isExpanded:t,className:6===o?j.B.lArrow:j.B.rArrow,alt:6===o?"Reset View Size":"Expand View Size",title:6===o?"Reset View Size":"Expand View Size"})]})]})};var De=l(1503);const Ge=(0,s.createRef)();const Ye=function(e){let{displayTheme:a,mechType:l,setShowPremiumPopupFunc:t,isLegendaryCategory:n=!1}=e;const{user:i}=(0,s.useContext)(R.x),{fantasyNPCBrandList:o,unitBackgroundColor:c,unitBackgroundOpacity:u,unitTokenBorder:h,unitTokenBorderColor:p,unitTokenBorderPosition:V}=(0,s.useContext)(B.UnitContext),[g,y]=(0,s.useState)(0),[N,x]=(0,s.useState)(Array(5).fill({camo1Value:"NONE",camo2Value:"NONE",camo3Value:"NONE",camo4Value:"NONE",camo1TintValue:"none",camo2TintValue:"none",camo3TintValue:"none",camo4TintValue:"none",chassisTintValue:"none",weaponTintValue:"none",secondaryWeaponTintValue:"none"})),[f,b]=(0,s.useState)(!1);(0,s.useEffect)((()=>{const e=document.cookie.split(";").filter((e=>e.trim().startsWith(`${l}CamoSettings=`)));e.length&&(5!==JSON.parse(e[0].split("=")[1]).length?x(JSON.parse(e[0].split("=")[1]).concat([{camo1Value:"NONE",camo2Value:"NONE",camo3Value:"NONE",camo4Value:"NONE",camo1TintValue:"none",camo2TintValue:"none",camo3TintValue:"none",camo4TintValue:"none",chassisTintValue:"none",weaponTintValue:"none",secondaryWeaponTintValue:"none"}])):x(JSON.parse(e[0].split("=")[1])))}),[l]);const v=i&&i.isPremiumUser,j=i&&i.isLegendaryUser;async function C(e,a,s){return new Promise((async(t,n)=>{let r;r=s?Object.assign({},JSON.parse(e.defaultValues)):Object.assign({},JSON.parse(e.defaultValues),N[g]);let i=(0,Z.e2)({unit:e,unitDefaults:r,layerOrder:K.Vz});Ge.current.height=e.imageSize.height,Ge.current.width=e.imageSize.width;const o=Ge.current;var d=o.getContext("2d");let m;d.clearRect(0,0,e.imageSize.width,e.imageSize.height),await(0,J.ph)({ctxObject:d,imageLayersArray:i,imageHeight:e.imageSize.height,imageWidth:e.imageSize.width,unitBackgroundColor:c,unitBackgroundOpacity:u,unitTokenBorder:h,unitTokenBorderColor:p,unitTokenBorderPosition:V}),m=await o.toDataURL("image/png"),a.file(`${l}-${e.label}.png`,m.substr(m.indexOf(",")+1),{base64:!0}),setTimeout((async()=>{d.clearRect(0,0,e.imageSize.width,e.imageSize.height),t()}),0)}))}async function L(e,a){let s=new(te());const t=s.folder(`${l}`);let n=[].concat(e.map((e=>()=>C(e,t,a))),e.filter((e=>!!e.defaultInactiveValues)).map((e=>()=>C(Object.assign({},e,{defaultValues:e.defaultInactiveValues,label:`${e.label}-Inactive`}),t,a))));await function(e){var a=Promise.resolve();return e.forEach((e=>{a=a.then(e)})),a}(n),s.generateAsync({type:"blob"}).then((function(e){(0,ne.saveAs)(e,`Retrograde-Minis-${l}.zip`)}),(function(e){console.log(e)})),b(!1)}async function T(e,a){let s=new(te()),t=e.map((e=>()=>async function(e,a,s){return new Promise((async(t,n)=>{let r;r=s?Object.assign({},JSON.parse(e.defaultValues)):Object.assign({},JSON.parse(e.defaultValues),N[g]);let i=(0,Z.e2)({unit:e,unitDefaults:r,layerOrder:K.Vz});const o=a.folder(`${l}-Parts/${l}-${e.label}`),c=Ge.current;let u=c.getContext("2d");await(0,J.Se)({ctxObject:u,canvas:c,zipObject:o,images:i,imageSize:e.imageSize}),setTimeout((async()=>{u.clearRect(0,0,e.imageSize.width,e.imageSize.height),t()}),0)}))}(e,s,a)));await function(e){var a=Promise.resolve();return e.forEach((e=>{a=a.then(e)})),a}(t),s.generateAsync({type:"blob"}).then((function(e){(0,ne.saveAs)(e,`Retrograde-Minis-${l}-Parts.zip`)}),(function(e){console.log(e)})),b(!1)}const S=N.map(((e,l)=>(0,m.jsx)(ra,{value:l,className:`${l===g?"selected ":""} ${a?"retro-terminal":"default"}`,onClick:()=>y(l)}
125,`camo-setting-option-${l}`)));return(0,m.jsxs)(_.A,{children:[(0,m.jsx)(r.QB,{className:a?"retro-terminal":"default",onClick:f?()=>{}:()=>n&&!j?t(d.$.LEGENDARY):v?(b(!0),L(o[l],!1)):t(d.$.PLUS_ONE),children:f?"Loading":"Export All \u25cf"+(n?"\u25cf":"")}),(0,m.jsx)(r.QB,{className:a?"retro-terminal":"default",onClick:f?()=>{}:()=>j?(b(!0),T(o[l],!1)):t(d.$.LEGENDARY),children:f?"Loading":"As Parts \u25cf\u25cf"}),(0,m.jsxs)(r.QB,{className:(a?"retro-terminal":"default")+" no-active",children:["W/ Saved Settings",(0,m.jsx)(na,{className:a?"retro-terminal":"default",children:S})]}),(0,m.jsx)(r.QB,{className:a?"retro-terminal":"default",onClick:f?()=>{}:()=>n&&!j?t(d.$.LEGENDARY):v?(b(!0),L(o[l],!0)):t(d.$.PLUS_ONE),children:f?"Loading":"W/ Default \u25cf"+(n?"\u25cf":"")}),(0,m.jsx)(r.QB,{className:a?"retro-terminal":"default",onClick:f?()=>{}:()=>j?(b(!0),T(o[l],!0)):t(d.$.LEGENDARY),children:f?"Loading":"As Parts \u25cf\u25cf"}),(0,m.jsx)("canvas",{ref:Ge})]})},Qe=t.Ay.div` 126 display: flex; 127 flex-direction: row; 128 justify-content: space-around; 129 align-content: start; 130 align-items: space-around; 131 flex-wrap: wrap; 132 133 overflow-y: scroll; 134 height: 100%; 135 width: 100%; 136`;Qe.displayName="FrameListContainer";const Je=(0,t.Ay)(r.A5)` 137 cursor: pointer; 138 height: ${e=>{let{size:a}=e;return a+4}}px; 139 width: ${e=>{let{size:a}=e;return a+4}}px; 140 margin-top: 4px; 141 142 label { 143 max-width: 70%; 144 padding-right: 20px; 145 z-index: 2; 146 position: absolute; 147 bottom: 0; 148 left: 0; 149 } 150 151 img { 152 position: absolute; 153 top: 0; 154 left: 0; 155 width: ${e=>{let{size:a}=e;return a}}px; 156 height: ${e=>{let{size:a}=e;return a}}px; 157 z-index: 1; 158 } 159 160 161 border-color: transparent; 162 border-style: solid; 163 border-width: 2px; 164 165 &.default:hover { 166 border-color: ${e=>e.disabled?"#333":r.fT}; 167 } 168 169 &.retro-terminal:hover { 170 border-color: ${e=>e.disabled?"#666":u.co}; 171 } 172 173 @media only screen and (max-width: ${e=>e.theme.mobileCutoffWidth}px) { 174 width: ${e=>{let{size:a}=e;return a+4}}px; 175 176 label { 177 font-size: 0.9em; 178 } 179 } 180`;function _e(e){let{setShowPremiumPopupFunc:a,setFrameValueFunc:l,partList:s,isPremiumUser:t,displayTheme:n,isLegendaryUser:r,npcCategory:i}=e;const o=s.map((e=>(0,m.jsxs)(Je,{alt:"Select Frame Button",disabled:e.isLegendary&&!r,className:n?"retro-terminal":"default",size:e.isLarge?200:150,onClick:()=>{e.isLegendary&&!r?a(d.$.LEGENDARY):l(e.value)},children:[(0,m.jsx)("label",{children:`${e.label} ${e.isLegendary?"\u25cf\u25cf":""}`}),(0,m.jsx)("img",{alt:e.label,src:e.isLegendary&&!r?e.restrictedPreviewImg:e.previewImg})]},`${e.value}-${e.label}`)));return(0,m.jsxs)(Qe,{children:[i?(0,m.jsx)(Ye,{displayTheme:n,mechType:i,setShowPremiumPopupFunc:a}):null,o]})}Je.displayName="FramePreview",_e.defaultProps={isPremiumUser:!1,isLegendaryUser:!1};const Ke=_e;var qe=l(3619),Ze=l(6184);const Xe=`${x.A}/buttons/back_arrow_white.png`,ea=`${x.A}/buttons/Color-Sample-Orb-Glow.png`,aa=`${x.A}/buttons/Color-Sample-Orb.png`,la=`${x.A}/buttons/Color-Sample-Square-Glow-18.png`,sa=`${x.A}/buttons/Color-Sample-Square-18.png`,ta=(0,t.Ay)(n.cw)` 181 align-items: center; 182 overflow-y: unset; 183 justify-content: space-around; 184 margin-right: 10px; 185 186 ${e=>{let{noFrameSelected:a}=e;return a?`\n height: 500px;\n\n @media only screen and (max-width: ${e=>{let{theme:a}=e;return a.tabletCutoffWidth}}px) {\n height: 1090px;\n }\n\n @media only screen and (max-width: ${e=>{let{theme:a}=e;return a.mobileCutoffWidth}}px) {\n height: 1192px;\n }\n `:"\n padding: 5px 0 10px;\n block-size: fit-content;\n "}} 187`;ta.displayName="FantasyNPCUnitContainer";const na=t.Ay.span` 188 padding-top: 6px; 189 padding-bottom: 6px; 190 margin-top: 2px; 191 display: flex; 192 flex-direction: row; 193 justify-content: space-around; 194 align-items: center; 195 196 &.retro-terminal { 197 background-color: transparent; 198 } 199 200 &.default { 201 background-color: ${r.fT}; 202 } 203`;
203na.displayName="CamoSettingsDisplay";const ra=t.Ay.span` 204 border: 2px solid; 205 cursor: pointer; 206 display: inline-block; 207 padding: 2px; 208 width: 8px; 209 height: 8px; 210 211 &.retro-terminal { 212 border-color: ${u.co}; 213 214 &.selected { 215 background-color: ${u.co}; 216 } 217 } 218 219 &.default { 220 border-color: #FFF; 221 222 &.selected { 223 background-color: #FFF; 224 } 225 } 226`;ra.displayName="CamoSettingOption";const ia=function(e){let{setShowPremiumPopupFunc:a,unitCategory:l,isSubCategory:t}=e;const[c,u]=(0,s.useState)(Array(5).fill({camo1Value:"NONE",camo2Value:"NONE",camo3Value:"NONE",camo4Value:"NONE",camo1TintValue:"none",camo2TintValue:"none",camo3TintValue:"none",camo4TintValue:"none",chassisTintValue:"none",weaponTintValue:"none",secondaryWeaponTintValue:"none"})),[h,p]=(0,s.useState)(0),[V,g]=(0,s.useState)(!1),[N,x]=(0,s.useState)(!1),[f,b]=(0,s.useState)(!1),[v,C]=(0,s.useState)(!1),[L,T]=(0,s.useState)(!1),[S,O]=(0,s.useState)(!1),[A,w]=(0,s.useState)(!1),[E,k]=(0,s.useState)(!1),[$,Y]=(0,s.useState)(0),[Q,J]=(0,s.useState)(0),[_,K]=(0,s.useState)(Object.assign({},JSON.parse(l.partList[0].defaultValues),{frameValue:null,brandValue:l.title}));(0,s.useEffect)((()=>{var e,a;null!==(e=l.partList[null===_||void 0===_?void 0:_.frameValue])&&void 0!==e&&e.label&&(0,he.s)(`unitState-${l.title}-${null===(a=l.partList[null===_||void 0===_?void 0:_.frameValue])||void 0===a?void 0:a.label}`,_)}),[_,l]);const{user:q}=(0,s.useContext)(R.x),{addUnit:Z,fantasyNPCBrandList:X}=(0,s.useContext)(B.UnitContext),{displayTheme:ee}=(0,s.useContext)(F.m),{colorValue:ae,displayCustomControls:le,tintValue:se,handleColorOptionChange:te,getColorTint:ne}=(0,s.useContext)(y.Q),re=q&&q.isPremiumUser,ie=q&&q.isLegendaryUser;let oe=U.A.mundaneTier.orb;const ce=U.A.mundaneTier.alt;let ue="";if(l.premium&&(oe=U.A.themepackTier.orb),t&&(ue+=" sub-category"),(0,s.useEffect)((()=>{const e=document.cookie.split(";").filter((e=>e.trim().startsWith(`${l.title}CamoSettings=`)));e.length&&(5!==JSON.parse(e[0].split("=")[1]).length?u(JSON.parse(e[0].split("=")[1]).concat([{camo1Value:"NONE",camo2Value:"NONE",camo3Value:"NONE",camo4Value:"NONE",camo1TintValue:"none",camo2TintValue:"none",camo3TintValue:"none",camo4TintValue:"none",chassisTintValue:"none",weaponTintValue:"none",secondaryWeaponTintValue:"none"}])):u(JSON.parse(e[0].split("=")[1])))}),[l.title]),null===_.frameValue)return(0,m.jsxs)(n.sc,{className:ue,isExpanded:V,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,children:[(0,m.jsxs)(n.IA,{className:ue,onClick:()=>g(!V),title:l.description,children:[(0,m.jsx)(D.A,{isExpanded:V,image:V?l.activeImage:l.inactiveImage,alt:l.title,borderSecondaryColor:l.borderSecondaryColor}),(0,m.jsx)(n.xA,{alt:l.label,className:ue,children:l.label}),(0,m.jsx)(n.I1,{src:oe,alt:"Units Rarity",title:ce})]}),(0,m.jsx)(i.A,{children:(0,m.jsx)(ta,{className:ue,themeBackgroun
226dPrimaryColor:ee?l.retroTerminalBackgroundColor:l.themeBackgroundPrimaryColor,themeBackgroundSecondaryColor:ee?l.retroTerminalBackgroundSecondaryColor:l.themeBackgroundSecondaryColor,isExpanded:V,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,displayCustomControls:le,noFrameSelected:!0,children:(0,m.jsx)(Ke,{setShowPremiumPopupFunc:a,setFrameValueFunc:e=>de(e,"frameValue"),partList:l.partList,isPremiumUser:re,isLegendaryUser:ie,displayTheme:ee,npcCategory:l.title,isLegendaryCategory:l.premium})})})]});function de(e,a){if("frameValue"===a){if(null!==e){var s;const a=(0,he.w)(`unitState-${l.title}-${null===(s=l.partList[e])||void 0===s?void 0:s.label}`);return K(a?Object.assign({},a,{frameValue:e,brandValue:l.title}):Object.assign({},JSON.parse(l.partList[e].defaultValues),{frameValue:e,brandValue:l.title},{camo1TintValue:M.A[l.defaultCamoIndex].value,camo2TintValue:M.A[l.defaultCamoIndex].value,camo3TintValue:M.A[l.defaultCamoIndex].value,camo4TintValue:M.A[l.defaultCamoIndex].value}))}return K(Object.assign({},{frameValue:e,brandValue:l.title}))}return K(Object.assign({},_,{[a]:e}))}function pe(e){return K(Object.assign({},_,e))}l.partList[_.frameValue].chassis.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!re||e.isLegendary&&!ie,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),l.partList[_.frameValue].weapon.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!re||e.isLegendary&&!ie,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`)));const Ve=l.partList[_.frameValue].secondaryWeapon.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!re||e.isLegendary&&!ie,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),ge=(l.partList[_.frameValue].camo.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!re||e.isLegendary&&!ie,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),l.partList[_.frameValue].partList.map(((e,a)=>(0,m.jsx)("option",{value:a,children:e.label},`paint-${e.value}-${e.label}`)))),ye=M.A.map(((e,a)=>(0,m.jsx)("option",{value:a,children:e.label},`${e.value}-${e.label}`))),Ne=c.map(((e,a)=>(0,m.jsx)(ra,{value:a,className:`${a===h?"selected ":""} ${ee?"retro-terminal":"default"}`,onClick:()=>p(a)},`camo-setting-option-${a}`))),xe=l.templateList.map(((e,a)=>(0,m.jsx)("option",{value:a,children:e.label},`template--${e.label}`))),fe=!!l.partList[_.frameValue].partList[$].isGlow;return(0,m.jsxs)(n.sc,{className:ue,isExpanded:V,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,children:[(0,m.jsxs)(n.IA,{className:ue,onClick:()=>g(!V),title:l.description,children:[(0,m.jsx)(D.A,{isExpanded:V,image:V?l.activeImage:l.inactiveImage,alt:l.title,borderSecondaryColor:l.borderSecondaryColor}),(0,m.jsx)(n.xA,{alt:l.label,className:ue,children:l.label}),(0,m.jsx)(n.I1,{src:oe,alt:"Units Rarity",title:ce})]}),(0,m.jsx)(i.A,{children:(0,m.jsx)(ta,{className:ue,themeBackgroun
226dPrimaryColor:ee?l.retroTerminalBackgroundColor:l.themeBackgroundPrimaryColor,themeBackgroundSecondaryColor:ee?l.retroTerminalBackgroundSecondaryColor:l.themeBackgroundSecondaryColor,isExpanded:V,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,displayCustomControls:le,children:V?(0,m.jsxs)(r.be,{children:[(0,m.jsxs)("div",{className:"options-selectors",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)(r.A5,{className:ee?"retro-terminal":"default",children:(0,m.jsxs)("label",{htmlFor:"frame-select",onClick:()=>{de(null,"frameValue"),Y(0)},style:{cursor:"pointer"},children:[(0,m.jsx)("img",{className:"back",alt:"Back",src:Xe}),"\xa0FRAME SELECT"]})}),"\xa0",(0,m.jsx)(G.Ay,{unit:_,brandList:X,isNPCCategory:!0})]}),(0,m.jsxs)(r.A5,{className:ee?"retro-terminal":"default",children:[(0,m.jsx)("label",{style:{cursor:"pointer"},onClick:()=>a(d.$.PLUS_ONE),children:"\u25cf\xa0\xa0\xa0+1 TIER"}),(0,m.jsx)("label",{style:{cursor:"pointer"},onClick:()=>a(d.$.PLUS_TWO),children:"*\xa0\xa0\xa0+2 TIER"}),(0,m.jsx)("label",{style:{cursor:"pointer",borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px"},onClick:()=>a(d.$.LEGENDARY),children:"\u25cf\u25cf\xa0LEGEND TIER"})]}),(0,m.jsxs)(r.A5,{className:ee?"retro-terminal":"default",children:[(0,m.jsx)("label",{htmlFor:"template-select",children:"CAMO TEMPLATES"}),(0,m.jsx)("select",{id:"template-select",name:"template",onChange:e=>(pe(l.templateList[e.target.value].value),J(e.target.value)),value:Q,children:xe})]}),(0,m.jsxs)(r.A5,{className:ee?"retro-terminal":"default",disabled:!Ve.length,children:[(0,m.jsxs)("label",{htmlFor:"secondary-weapon-select",children:[(0,m.jsx)("span",{children:l.partList[_.frameValue].labels.secondaryWeapon}),Ve.length?(0,m.jsx)("img",{alt:`${l.partList[_.frameValue].labels.secondaryWeapon} Color Preview`,src:l.partList[_.frameValue].partList.filter((e=>"secondaryWeapon"===e.value))[0].isGlow?la:sa,className:"part-color-preview",style:{filter:_.secondaryWeaponTintValue}}):null,(0,m.jsx)(j.A,{className:v?j.B.locked:j.B.unlocked,alt:"Option "+(v?"Locked":"Unlocked"),onClick:()=>C(!v)})]}),(0,m.jsxs)("select",{id:"secondary-weapon-select",name:"secondary weapon",onChange:e=>{l.partList[_.frameValue].secondaryWeaponSpecial?pe({[l.partList[_.frameValue].secondaryWeaponSpecial]:e.target.value,secondaryWeaponValue:e.target.value}):de(e.target.value,"secondaryWeaponValue")},value:_.secondaryWeaponValue,disabled:!Ve.length,children:[l.partList[_.frameValue].removeNone&&l.partList[_.frameValue].removeNone.secondaryWeapon?null:(0,m.jsx)("option",{value:"NONE",children:"NONE"}),Ve]})]}),(0,m.jsxs)(r.A5,{className:ee?"retro-terminal":"default",children:[(0,m.jsx)("label",{className:"clickable",onClick:()=>{window.confirm("This will overwrite the current saved camo settings.")&&function(){const e=c.map(((e,a)=>a===h?{camo1Value:_.camo1Value,camo2Value:_.camo2Value,camo3Value:_.camo3Value,camo4Value:_.camo4Value,camo1TintValue:_.camo1TintValue,camo2TintValue:_.camo2TintValue,camo3TintValue:_.camo3TintValue,camo4TintValue:_.camo4TintValue,chassisTintValue:_.chassisTintValue,weaponTintValue:_.weaponTintValue,secondaryWeaponTintValue:_.secondaryWeaponTintValue}:e));document.cookie=`${l.title}CamoSettings=false; expires=Thu, 01 Jan 1970 00:00:01 GMT;`,document.cookie=`${l.title}CamoSettings=${JSON.stringify(e)}; expires=Fri, 31 Dec 9999 23:59:59 GMT;`,u(e)}()},children:"SAVE SETTINGS"}),(0,m.jsx)(na,{className:ee?"retro-terminal":"default",children:Ne})]}),(0,m.jsx)(r.R2,{}),(0,m.jsx)(r.A5,{className:ee?"retro-terminal":"default",onClick:()=>function(){if(c[h])return pe(c[h])}(),disabled:!c[h],children:(0,m.jsx)("label",{className:"clickable",style:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomRightRadius:"10px",borderBottomLeftRadius:"10px",marginTop:"-13px"},children:"Apply Settings"})}),(0,m.jsx)(r.R2,{}),(0,m.jsx)(qe.A,{displayTheme:ee?"retro-terminal":"default",camoSettings:c[h],npcCategory:l.title,isFantasyTheme:!0}),(0,m.jsx)(Ze.A,{displayTheme:ee?"retro-terminal":"default",applyCamoSettingsFunc:pe,npcCategory:l.title,isFantasyTheme:!0}),(0,m.jsxs)(r.A5,{className:ee?"retro-terminal":"default",children:[(0,m.jsx)("label",{htmlFor:"color-select",children:"Color"}),(0,m.jsx)("select",{id:"color-select",name:"color",onChange:te,value:ae,children:ye}),(0,m.jsx)(I.A,{tintValue:se,src:fe?ea:aa,alt:"paint-preview"})]}),(0,m.jsxs)(r.A5,{className:ee?"retro-terminal":"default",children:[(0,m.jsx)("label",{htmlFor:"part-select",children:"Color Target"}),(0,m.jsx)("select",{id:"part-select",name:"part",onChange:e=>Y(e.target.value),value:$,children:ge})]})]}),(0,m.jsxs)("div",{className:"display-controls",children:[(0,m.jsx)(o.A,{onContextMenu:e=>e.preventDefault(),imageSize:l.partList[_.frameValue].imageSize,children:(0,m.jsx)(H.A,{children:(0,m.jsx)(De.A,{unit:_,brandList:X,isInCategory:!0})})}),(0,m.jsxs)(r.OT,{children:[(0,m.jsx)(r.QB,{className:ee?"retro-terminal":"default",onClick:function(){return x(!1),b(!1),C(!1),T(!1),O(!1),K(Object.assign({},JSON.parse(l.partList[_.frameValue].defaultValues),{frameValue:_.frameValue,brandValue:l.title}))},children:"Reset"}),(0,m.jsx)(r.QB,{className:ee?"retro-terminal":"default",onClick:function(){let e,a=l.partList[_.frameValue].chassis.filter((e=>!e.isPremium)).length,s=l.partList[_.frameValue].weapon.filter((e=>!e.isPremium)).length,t=l.partList[_.frameValue].secondaryWeapon.filter((e=>!e.isPremium)).length,n=l.partList[_.frameValue].camo.filter((e=>!e.isPremium)).length;re&&(a=l.partList[_.frameValue].chassis.filter((e=>!e.isLegendary)).length,s=l.partList[_.frameValue].weapon.filter((e=>!e.isLegendary)).length,t=l.partList[_.frameValue].secondaryWeapon.filter((e=>!e.isLegendary)).length,n=l.partList[_.frameValue].camo.filter((e=>!e.isLegendary)).length),ie&&(a=l.partList[_.frameValue].chassis.length,s=l.partList[_.frameValue].weapon.length,t=l.partList[_.frameValue].secondaryWeapon.length,n=l.partList[_.frameValue].camo.length),e=(0,W.nd)(0,a-1);const r={chassisValue:e,weaponValue:s&&(0,W.nd)(0,1)?(0,W.nd)(0,s-1):"NONE",secondaryWeaponValue:t&&(0,W.nd)(0,1)?(0,W.nd)(0,t-1):"NONE",camo1Value:n&&(0,W.nd)(0,1)?(0,W.nd)(0,n-1):"NONE",camo2Value:n>1&&(0,W.nd)(0,1)?(0,W.nd)(0,n-1):"NONE",camo3Value:n&&(0,W.nd)(0,1)?(0,W.nd)(0,n-1):"NONE",camo4Value:n>1&&(0,W.nd)(0,1)?(0,W.nd)(0,n-1):"NONE",brandValue:l.title};return l.partList[_.frameValue].removeNone&&("NONE"===r.chassisValue&&l.partList[_.frameValue].removeNone.chassis&&(r.chassisValue=0),"NONE"===r.weaponValue&&l.partList[_.frameValue].removeNone.weapon&&(r.weaponValue=0),"NONE"===r.secondaryWeaponValue&&l.partList[_.frameValue].removeNone.secondaryWeapon&&(r.secondaryWeaponValue=0),"NONE"===r.camo1Value&&l.partList[_.frameValue].removeNone.camo&&(r.camo1Value=0),"NONE"===r.camo2Value&&l.partList[_.frameValue].removeNone.camo&&(r.camo2Value=0)),N&&delete r.chassisValue,f&&delete r.weaponValue,v&&delete r.secondaryWeaponValue,
226L&&delete r.camo1Value,S&&delete r.camo2Value,A&&delete r.camo3Value,E&&delete r.camo4Value,K(Object.assign({},_,r))},children:"Random"}),(0,m.jsx)(me,{unit:{..._,imageSize:l.partList[_.frameValue].imageSize},unitPreviewImage:{src:l.partList[_.frameValue].previewImg,imageHeight:l.partList[_.frameValue].imageSize.height,imageWidth:l.partList[_.frameValue].imageSize.width},name:`${l.title}-${l.partList[_.frameValue].label}`,setShowPremiumPopupFunc:a,type:"NPC"}),(0,m.jsx)(r.QB,{className:ee?"retro-terminal":"default",onClick:function(){const e=`FANTASY NPC ${l.title} ${l.partList[_.frameValue].label}`,a=[Object.assign({},_,{imageSize:l.partList[_.frameValue].imageSize})];let s="NONE"!==_.chassisValue?l.partList[_.frameValue].chassis[_.chassisValue].shadowDetails:{size:z.O7.NONE,bottom:"0px",right:"0px"};return Z(Object.assign({variantsArray:a,currentVariant:0,id:`${e}-${Date.now()}`,shadowDetails:s,fantasyNPCUnit:!0,heroLabel:e}))},children:"Venture Forth"}),(0,m.jsx)(r.QB,{className:ee?"retro-terminal":"default",onClick:function(){const e={},a=l.partList[_.frameValue].partList[$].value;let s=ne();switch(a){case"BODY":e.chassisTintValue=s;break;case"WEAPONS":e.weaponTintValue=s,e.secondaryWeaponTintValue=s;break;case"ALL":e.chassisTintValue=s,e.weaponTintValue=s,e.secondaryWeaponTintValue=s,e.camo1TintValue=s,e.camo2TintValue=s,e.camo3TintValue=s,e.camo4TintValue=s;break;default:e[`${a}TintValue`]=s}return K(Object.assign({},_,e))},children:"Apply Color"}),(0,m.jsx)(r.R2,{})]})]}),le?(0,m.jsx)(P,{displayTheme:ee,targetPartIsGlow:fe,isGreenGlow:!0}):null]}):null})})]})};var oa=l(8928),ca=l(6315);const ua={unitDefaultValues:'{\n "chassisValue": "0",\n "legsValue": "0",\n "armLeftValue": "0",\n "armRightValue": "0",\n "stanceValue": "1H",\n "headValue": "0",\n "rearMountValue": "4",\n "weaponValue": "2",\n "secondaryWeaponValue": "0",\n "weaponSelectionValue": "2-1H",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitTypeGValues:'{\n "chassisValue": "0",\n "legsValue": "0",\n "armLeftValue": "0",\n "armRightValue": "0",\n "stanceValue": "1H",\n "headValue": "0",\n "rearMountValue": "NONE",\n "weaponValue": "NONE",\n "secondaryWeaponValue": "NONE",\n "weaponSelectionValue": "NONE",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',makeTemplateValues:function(e){return`{\n "chassisValue": "${e}",\n "legsValue": "${e}",\n "armLeftValue": "${e}",\n "armRightValue": "${e}",\n "stanceValue": "1H",\n "headValue": "${e}",\n "rearMountValue": "NONE",\n "weaponValue": "NONE",\n "secondaryWeaponValue": "NONE",\n "weaponSelectionValue": "NONE",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n }`}};var da=l(5478),ma=l(4669);const ha=`${x.A}/buttons/Color-Sample-Orb.png`,pa=`${x.A}/buttons/Color-Sample-Square-18.png`,Va=(0,t.Ay)(n.cw)` 227 padding: 5px 0 10px; 228 block-size: fit-content;
229 align-items: center; 230 overflow-y: unset; 231 justify-content: space-around; 232 margin-right: 10px; 233`;Va.displayName="MechGMSUnitContainer";const ga=U.A.mundaneTier.orb,ya=U.A.mundaneTier.alt,Na="seasonal-category mech-category",xa="unitState-GMS-SAG",fa=["1H","2H"],ba=[{label:"DEFAULT",value:ua.unitDefaultValues},{label:"[G]-TYPE",value:ua.unitTypeGValues},{label:"HA",value:ua.makeTemplateValues(1)},{label:"HORUS",value:ua.makeTemplateValues(2)},{label:"IPS-N",value:ua.makeTemplateValues(3)},{label:"SSC",value:ua.makeTemplateValues(4)}];const va=function(e){var a,l,t,r;let{setShowPremiumPopupFunc:c,unitCategory:d}=e;const[h,p]=(0,s.useState)(!1),[V,g]=(0,s.useState)(!1),[N,x]=(0,s.useState)(!1),[f,b]=(0,s.useState)(!1),[v,C]=(0,s.useState)(!1),[L,T]=(0,s.useState)(!1),[S,O]=(0,s.useState)(!1),[A,w]=(0,s.useState)(!1),[E,k]=(0,s.useState)(!1),[$,P]=(0,s.useState)(!1),[U,z]=(0,s.useState)(!1),[D,Y]=(0,s.useState)(!1),[Q,J]=(0,s.useState)(!1),[_,K]=(0,s.useState)(!1),[q,Z]=(0,s.useState)(0),[X,ee]=(0,s.useState)(0),ae=(0,he.w)(xa),[le,se]=(0,s.useState)(ae||JSON.parse(ua.unitDefaultValues));(0,s.useEffect)((()=>{(0,he.s)(xa,le)}),[le]);const{user:te}=(0,s.useContext)(R.x),{addUnit:ne,mechCustomPartList:re}=(0,s.useContext)(B.UnitContext),{displayTheme:ie}=(0,s.useContext)(F.m),{colorValue:oe,displayCustomControls:ce,tintValue:ue,handleColorOptionChange:de,getColorTint:me}=(0,s.useContext)(y.Q),pe=re.SAGARMATHA,Ve=te&&te.isPremiumUser;function ge(e,a){return se(Object.assign({},le,{[a]:e}))}const ye=pe.chassis.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Ve,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),Ne=pe.head.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Ve,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),xe=pe.legs.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Ve,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),fe=pe.arms.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Ve||e.disabled,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),be=pe.rearMount.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Ve,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),ve=[].concat(pe.weapon["1H"],pe.weapon["2H"]).map((e=>{var a;return(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Ve||e.disabled||"NONE"===le.armLeftValue&&"1H"!==e.value.split("-")[1]||"NONE"!==le.armLeftValue&&(null===(a=pe.arms[le.armLeftValue])||void 0===a?void 0:a.isMounted)&&"1H"!==e.value.split("-")[1],children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`)})),je=pe.secondaryWeapon.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Ve,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),Ce=pe.accessory.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!Ve,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),Le=pe.partList.map(((e,a)=>(0,m.jsx)("option",{value:a,children:e.label},`paint-${e.value}-${e.label}`))),Te=M.A.map(((e,a)=>(0,m.jsx)("option",{value:a,children:e.label},`${e.value}-${e.label}`))),Se=ba.map(((e,a)=>(0,m.jsx)("option",{value:a,children:e.label},`template--${e.label}`))),Oe="number"===typeof V;return(0,m.jsxs)(n.sc,{className:Na,isExpanded:h,numColumnsVisible:4,borderPrimaryColor:d.borderPrimaryColor,borderSecondaryColor:d.borderSecondaryColor,children:[(0,m.jsxs)(n.IA,{className:Na,onClick:()=>p(!h),title:d.description,children:[(0,m.jsx)(ma.m,{className:`${Na} ${d.logoImage||ga}`,alt:"Units Rarity",title:ya}),(0,m.jsx)(n.xA,{alt:d.label,className:Na,children:d.label})]}),(0,m.jsx)(i.A,{children:(0,m.jsx)(Va,{className:Na,themeBackgroun
233dPrimaryColor:ie?d.retroTerminalBackgroundColor:d.themeBackgroundPrimaryColor,themeBackgroundSecondaryColor:ie?d.retroTerminalBackgroundSecondaryColor:d.themeBackgroundSecondaryColor,isExpanded:h,numColumnsVisible:4,borderPrimaryColor:d.borderPrimaryColor,borderSecondaryColor:d.borderSecondaryColor,displayCustomControls:ce,children:h?(0,m.jsxs)(u.Dp,{children:[(0,m.jsxs)("div",{className:"options-selectors",children:[(0,m.jsxs)(u.A5,{className:ie?"retro-terminal":"default",disabled:Oe,children:[(0,m.jsx)("label",{htmlFor:"template-select",children:"TEMPLATE"}),(0,m.jsx)("select",{id:"template-select",name:"template",onChange:e=>{var a;return a=ba[e.target.value].value,se(JSON.parse(a)),Z(e.target.value)},value:q,disabled:Oe,children:Se})]}),(0,m.jsx)(G.Ay,{unit:le,brandList:pe,isCoreImageView:V,isCustomCategory:!0}),(0,m.jsxs)(u.A5,{className:ie?"retro-terminal":"default",disabled:Oe,children:[(0,m.jsxs)("label",{htmlFor:"head-select",children:[(0,m.jsx)("span",{children:"HEAD"}),(0,m.jsx)("img",{alt:"HEAD Color Preview",src:pa,style:{filter:le.headTintValue}}),(0,m.jsx)(j.A,{className:S?j.B.locked:j.B.unlocked,alt:"Option "+(S?"Locked":"Unlocked"),onClick:()=>O(!S)})]}),(0,m.jsxs)("select",{id:"head-select",name:"head",onChange:e=>ge(e.target.value,"headValue"),value:le.headValue,disabled:Oe,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),Ne]})]}),(0,m.jsxs)(u.A5,{className:ie?"retro-terminal":"default",disabled:"NONE"===le.armLeftValue||(null===(a=pe.arms[le.armLeftValue])||void 0===a?void 0:a.isMounted)||Oe,children:[(0,m.jsxs)("label",{htmlFor:"weapon-select",children:[(0,m.jsx)("span",{children:"MAIN WEAPON"}),(0,m.jsx)("img",{alt:"WEAPON Color Preview",src:pa,style:{filter:le.weaponTintValue}}),(0,m.jsx)(j.A,{className:A?j.B.locked:j.B.unlocked,alt:"Option "+(A?"Locked":"Unlocked"),onClick:()=>w(!A)})]}),(0,m.jsxs)("select",{id:"weapon-select",name:"weapon",onChange:function(e){const a=e.target.value.split("-"),l={weaponValue:a[0],stanceValue:a[1],weaponSelectionValue:e.target.value};return"1H"!==a[1]&&(l.secondaryWeaponValue="NONE"),se(Object.assign({},le,l))},value:le.weaponSelectionValue,disabled:"NONE"===le.armLeftValue||(null===(l=pe.arms[le.armLeftValue])||void 0===l?void 0:l.isMounted)||Oe,children:[(0,m.jsx)("option",{value:"NONE-1H",children:"NONE"}),ve]})]}),(0,m.jsxs)(u.A5,{className:ie?"retro-terminal":"default",disabled:Oe,children:[(0,m.jsxs)("label",{htmlFor:"chassis-select",children:[(0,m.jsx)("span",{children:"CHASSIS"}),(0,m.jsx)("img",{alt:"CHASSIS Color Preview",src:pa,style:{filter:le.chassisTintValue}}),(0,m.jsx)(j.A,{className:N?j.B.locked:j.B.unlocked,alt:"Option "+(N?"Locked":"Unlocked"),onClick:()=>x(!N)})]}),(0,m.jsxs)("select",{id:"chassis-select",name:"chassis",onChange:e=>ge(e.target.value,"chassisValue"),value:le.chassisValue,disabled:Oe,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),ye]})]}),(0,m.jsxs)(u.A5,{className:ie?"retro-terminal":"default",disabled:"1H"!==le.stanceValue||"NONE"===le.armRightValue||(null===(t=pe.arms[le.armRightValue])||void 0===t?void 0:t.isMounted)||Oe,children:[(0,m.jsxs)("label",{htmlFor:"secondary-weapon-select",children:[(0,m.jsx)("span",{children:"AUX WEAPON"}),(0,m.jsx)("img",{alt:"AUX WEAPON Color Preview",src:pa,style:{filter:le.secondaryWeaponTintValue}}),(0,m.jsx)(j.A,{className:E?j.B.locked:j.B.unlocked,alt:"Option "+(E?"Locked":"Unlocked"),onClick:()=>k(!E)})]}),(0,m.jsxs)("select",{id:"secondary-weapon-select",name:"secondary weapon",onChange:e=>ge(e.target.value,"secondaryWeaponValue"),value:le.secondaryWeaponValue,disabled:"1H"!==le.stanceValue||"NONE"===le.armRightValue||(null===(r=pe.arms[le.armRightValue])||void 0===r?void 0:r.isMounted)||Oe,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),je]})]}),(0,m.jsxs)(u.A5,{className:ie?"retro-terminal":"default",disabled:Oe,children:[(0,m.jsxs)("label",{htmlFor:"left-arm-select",children:[(0,m.jsx)("span",{children:"LEFT ARM"}),(0,m.jsx)("img",{alt:"LEFT ARM Color Preview",src:pa,style:{filter:le.armLeftTintValue}}),(0,m.jsx)(j.A,{className:v?j.B.locked:j.B.unlocked,alt:"Option "+(v?"Locked":"Unlocked"),onClick:()=>C(!v)})]}
233),(0,m.jsxs)("select",{id:"left-arm-select",name:"arm",onChange:function(e){var a;const l={armLeftValue:e.target.value};return("NONE"===e.target.value||null!==(a=pe.arms[e.target.value])&&void 0!==a&&a.isMounted)&&(l.weaponValue="NONE",l.secondaryWeaponValue="NONE",l.weaponSelectionValue="NONE-1H",l.stanceValue="1H"),se(Object.assign({},le,l))},value:le.armLeftValue,disabled:Oe,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),fe]})]}),(0,m.jsxs)(u.A5,{className:ie?"retro-terminal":"default",disabled:Oe,children:[(0,m.jsxs)("label",{htmlFor:"right-arm-select",children:[(0,m.jsx)("span",{children:"RIGHT ARM"}),(0,m.jsx)("img",{alt:"RIGHT ARM Color Preview",src:pa,style:{filter:le.armRightTintValue}}),(0,m.jsx)(j.A,{className:L?j.B.locked:j.B.unlocked,alt:"Option "+(L?"Locked":"Unlocked"),onClick:()=>T(!L)})]}),(0,m.jsxs)("select",{id:"right-arm-select",name:"arm",onChange:function(e){var a;const l={armRightValue:e.target.value};return("NONE"===e.target.value||null!==(a=pe.arms[e.target.value])&&void 0!==a&&a.isMounted)&&(l.weaponValue="NONE",l.secondaryWeaponValue="NONE",l.weaponSelectionValue="NONE-1H",l.stanceValue="1H"),se(Object.assign({},le,l))},value:le.armRightValue,disabled:Oe,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),fe]})]}),(0,m.jsxs)(u.A5,{className:ie?"retro-terminal":"default",disabled:Oe,children:[(0,m.jsxs)("label",{htmlFor:"legs-select",children:[(0,m.jsx)("span",{children:"LEGS"}),(0,m.jsx)("img",{alt:"LEGS Color Preview",src:pa,style:{filter:le.legsTintValue}}),(0,m.jsx)(j.A,{className:f?j.B.locked:j.B.unlocked,alt:"Option "+(f?"Locked":"Unlocked"),onClick:()=>b(!f)})]}),(0,m.jsx)("select",{id:"legs-select",name:"legs",onChange:e=>ge(e.target.value,"legsValue"),value:le.legsValue,disabled:Oe,children:xe})]}),(0,m.jsxs)(u.A5,{className:ie?"retro-terminal":"default",disabled:Oe,children:[(0,m.jsxs)("label",{htmlFor:"rear-mount-select",children:[(0,m.jsx)("span",{children:"REAR MOUNT"}),(0,m.jsx)("img",{alt:"REAR MOUNT Color Preview",src:pa,style:{filter:le.rearMountTintValue}}),(0,m.jsx)(j.A,{className:$?j.B.locked:j.B.unlocked,alt:"Option "+($?"Locked":"Unlocked"),onClick:()=>P(!$)})]}),(0,m.jsxs)("select",{id:"rear-mount-select",name:"rear mount",onChange:e=>ge(e.target.value,"rearMountValue"),value:le.rearMountValue,disabled:Oe,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),be]})]}),(0,m.jsxs)(u.A5,{className:ie?"retro-terminal":"default",disabled:Oe,children:[(0,m.jsxs)("label",{htmlFor:"accessory-1-select",children:[(0,m.jsx)("span",{children:"ACCESSORY 1"}),(0,m.jsx)("img",{alt:"ACCESSORY 1 Color Preview",src:pa,style:{filter:le.accessory1TintValue}}),(0,m.jsx)(j.A,{className:U?j.B.locked:j.B.unlocked,alt:"Option "+(U?"Locked":"Unlocked"),onClick:()=>z(!U)})]}),(0,m.jsxs)("select",{id:"accessory-1-select",name:"accessory1",onChange:e=>ge(e.target.value,"accessory1Value"),value:le.accessory1Value,disabled:Oe,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),Ce]})]}),(0,m.jsxs)(u.A5,{className:ie?"retro-terminal":"default",disabled:Oe,children:[(0,m.jsxs)("label",{htmlFor:"accessory-2-select",children:[(0,m.jsx)("span",{children:"ACCESSORY 2"}),(0,m.jsx)("img",{alt:"ACCESSORY 2 Color Preview",src:pa,style:{filter:le.accessory2TintValue}}),(0,m.jsx)(j.A,{className:D?j.B.locked:j.B.unlocked,alt:"Option "+(D?"Locked":"Unlocked"),onClick:()=>Y(!D)})]}),(0,m.jsxs)("select",{id:"accessory-2-select",name:"accessory2",onChange:e=>ge(e.target.value,"accessory2Value"),value:le.accessory2Value,disabled:Oe,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),Ce]})]}),(0,m.jsxs)(u.A5,{className:ie?"retro-terminal":"default",disabled:Oe,children:[(0,m.jsxs)("label",{htmlFor:"accessory-3-select",children:[(0,m.jsx)("span",{children:"ACCESSORY 3"}),(0,m.jsx)("img",{alt:"ACCESSORY 3 Color Preview",src:pa,style:{filter:le.accessory3TintValue}}),(0,m.jsx)(j.A,{className:Q?j.B.locked:j.B.unlocked,alt:"Option "+(Q?"Locked":"Unlocked"),onClick:()=>J(!Q)})]}),(0,m.jsxs)("select",{id:"accessory-3-select",name:"accessory3",onChange:e=>ge(e.target.value,"accessory3Value"),value:le.accessory3Value,disabled:Oe,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),Ce]})]}),(0,m.jsxs)(u.A5,{className:ie?"retro-terminal":"default",disabled:Oe,children:[(0,m.jsxs)("label",{htmlFor:"accessory-4-select",children:[(0,m.jsx)("span",{children:"ACCESSORY 4"}),(0,m.jsx)("img",{alt:"ACCESSORY 4 Color Preview",src:pa,style:{filter:le.accessory4TintValue}}),(0,m.jsx)(j.A,{className:_?j.B.locked:j.B.unlocked,alt:"Option "+(_?"Locked":"Unlocked"),onClick:()=>K(!_)})]}),(0,m.jsxs)("select",{id:"accessory-4-select",name:"accessory4",onCh
233ange:e=>ge(e.target.value,"accessory4Value"),value:le.accessory4Value,disabled:Oe,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),Ce]})]}),(0,m.jsxs)(u.A5,{className:ie?"retro-terminal":"default",disabled:Oe,children:[(0,m.jsx)("label",{htmlFor:"color-select",children:"COLOR"}),(0,m.jsx)("select",{id:"color-select",name:"color",onChange:de,value:oe,disabled:Oe,children:Te}),(0,m.jsx)(I.A,{tintValue:ue,src:ha,alt:"paint-preview"})]}),(0,m.jsxs)(u.A5,{className:ie?"retro-terminal":"default",disabled:Oe,children:[(0,m.jsx)("label",{htmlFor:"part-select",children:"COLOR TARGET"}),(0,m.jsx)("select",{id:"part-select",name:"part",onChange:e=>ee(e.target.value),value:X,disabled:Oe,children:Le})]})]}),(0,m.jsxs)("div",{className:"display-controls",children:[(0,m.jsx)(o.A,{onContextMenu:e=>e.preventDefault(),imageSize:pe.imageSize,children:(0,m.jsx)(H.A,{children:(0,m.jsx)(oa.A,{unit:Oe?Object.assign({},le,{viewCoreImage:V}):le,brandList:re,type:"SAGARMATHA",isInCategory:!0})})}),(0,m.jsxs)(u.OT,{children:[(0,m.jsx)(u.QB,{className:ie?"retro-terminal":"default",onClick:function(){return x(!1),b(!1),C(!1),T(!1),O(!1),w(!1),k(!1),P(!1),z(!1),Y(!1),J(!1),K(!1),g(!1),se(JSON.parse(ua.unitDefaultValues))},children:"RESET"}),(0,m.jsx)(u.QB,{className:ie?"retro-terminal":"default",onClick:function(){var e,a;const l=fa[(0,W.nd)(0,fa.length-1)];let s=(0,W.nd)(0,pe.weapon[l].length-1),t=pe.weapon[l][s].value,n=0,r=0;"1H"===l?(n=(0,W.nd)(0,pe.arms.length-1),r=(0,W.nd)(0,pe.arms.length-1)):(n=(0,W.nd)(0,pe.arms.filter((e=>!(null!==e&&void 0!==e&&e.isMounted))).length-1),r=(0,W.nd)(0,pe.arms.filter((e=>!(null!==e&&void 0!==e&&e.isMounted))).length-1)),pe.arms[r].disabled&&(r+=1),pe.arms[n].disabled&&(n+=1),null!==(e=pe.arms[r])&&void 0!==e&&e.isMounted&&(s="NONE",t="NONE-1H"),"0"===t&&(s="1",t=`1-${l}`);const i="1H"!==l||null!==(a=pe.arms[n])&&void 0!==a&&a.isMounted?"NONE":(0,W.nd)(0,pe.secondaryWeapon.length-1),o={chassisValue:(0,W.nd)(0,pe.chassis.length-1),legsValue:(0,W.nd)(0,pe.legs.length-1),armLeftValue:n,armRightValue:r,stanceValue:l,headValue:(0,W.nd)(0,pe.head.length-1),rearMountValue:(0,W.nd)(0,pe.rearMount.length-1),weaponValue:s,secondaryWeaponValue:i,weaponSelectionValue:t,accessory1Value:(0,W.nd)(0,1)?(0,W.nd)(0,pe.accessory.length-1):"NONE",accessory2Value:(0,W.nd)(0,1)?(0,W.nd)(0,pe.accessory.length-1):"NONE",accessory3Value:(0,W.nd)(0,1)?(0,W.nd)(0,pe.accessory.length-1):"NONE",accessory4Value:(0,W.nd)(0,1)?(0,W.nd)(0,pe.accessory.length-1):"NONE"};var c,u;return N&&delete o.chassisValue,S&&delete o.headValue,f&&delete o.legsValue,v&&delete o.armLeftValue,L&&delete o.armRightValue,A&&(delete o.weaponValue,delete o.stanceValue,delete o.weaponSelectionValue,("2H"===le.stanceValue||"heavy"===le.stanceValue)&&(delete o.secondaryWeaponValue,null!==(c=pe.arms[r])&&void 0!==c&&c.isMounted&&delete o.armRightValue,null!==(u=pe.arms[n])&&void 0!==u&&u.isMounted&&delete o.armLeftValue)),E&&delete o.secondaryWeaponValue,$&&delete o.rearMountValue,U&&delete o.accessory1Value,D&&delete o.accessory2Value,Q&&delete o.accessory3Value,_&&delete o.accessory4Value,se(Object.assign({},le,o))},disabled:Oe,children:"RANDOM"}),(0,m.jsx)(u.QB,{className:ie?"retro-terminal":"default",onClick:function(){const e={},a=pe.partList[X].value;let l=me();switch(a){case"BODY":e.chassisTintValue=l,e.legsTintValue=l,e.armLeftTintValue=l,e.armRightTintValue=l,e.headTintValue=l;break;case"WEAPONS":e.weaponTintValue=l,e.secondaryWeaponTintValue=l;break;case"ACCESSORIES":e.accessory1TintValue=l,e.accessory2TintValue=l,e.accessory3TintValue=l,e.accessory4TintValue=l;break;case"ALL":e.chassisTintValue=l,e.legsTintValue=l,e.armLeftTintValue=l,e.armRightTintValue=l,e.headTintValue=l,e.rearMountTintValue=l,e.weaponTintValue=l,e.secondaryWeaponTintValue=l,e.accessory1TintValue=l,e.accessory2TintValue=l,e.accessory3TintValue=l,e.accessory4TintValue=l;break;default:e[`${a}TintValue`]=l}return se(Object.assign({},le,e))},disabled:Oe,children:"APPLY COLOR"}),pe.coreImg?(0,m.jsx)(u.QB,{className:ie?"retro-terminal":"default",onClick:()=>{!1===V?g(0):V+1<pe.coreImg.length?g(V+1):g(!1)},children:`CORE VER. ${pe.coreImg.map(((e,a)=>V===a?"\u25a3":"\u2610")).join(" ")}`}):(0,m.jsx)(u.R2,{}),(0,m.jsx)(da.A,{displayTheme:ie?"retro-terminal":"default",unit:{...le,imageSize:pe.imageSize,type:"SAGARMATHA"},name:d.title,setShowPremiumPopupFunc:c,unitPreviewImage:{src:Oe?pe.coreImg[V].src:pe.previewImg,imageHeight:pe.imageSize.height,imageWidth:pe.imageSize.width,title:Oe?pe.coreImg[V].originalArtCredit.title:null},isCoreImageView:V,type:"CUSTOM"}),(0,m.jsx)(u.QB,{className:ie?"retro-terminal":"default",onClick:function(){const e=`\n MECH\n C-${pe.chassis[le.chassisValue].label}\n H-${"NONE"!==le.headValue?pe.head[le.headValue].label:"NONE"}\n LA-${"NONE"!==le.armLeftValue?pe.arms[le.armLeftValue].label:"NONE"}\n RA-${"NONE"!==le.armRightValue?pe.arms[le.armRightValue].label:"NONE"}\n L-${pe.legs[le.legsValue].label}\n R-${"NONE"!==le.rearMountValue?pe.rearMount[le.rearMountValue].label:"NONE"}\n P-${le.weaponSelectionValue}\n S-${"NONE"!==le.secondaryWeaponValue?pe.secondaryWeapon[le.secondaryWeaponValue].label:"NONE"}\n A1-${"NONE"!==le.accessory1Value?pe.accessory[le.accessory1Value].label:"NONE"}\n A2-${"NONE"!==le.accessory2Value?pe.accessory[le.accessory2Value].label:"NONE"}\n A3-${"NONE"!==le.accessory3Value?pe.accessory[le.accessory3Value].label:"NONE"}\n A4-${"NONE"!==le.accessory4Value?pe.accessory[le.accessory4Value].label:"NONE"}\n `,a=[Object.assign({},le,{imageSize:pe.imageSize,viewCoreImage:V})];return ne(Object.assign({variantsArray:a,currentVariant:0,id:`${e}-${Date.now()}
233`,shadowDetails:pe.legs[le.legsValue].shadowDetails,mechCustomSagUnit:!0,mechLabel:e,imageSize:pe.imageSize,type:"SAGARMATHA"}))},children:"FABRICATE"})]})]}),ce?(0,m.jsx)(ca.A,{displayTheme:ie}):null]}):null})})]})},ja={unitHardsuitLightValues:'{\n "chassisValue": "10",\n "headValue": "7",\n "armLeftValue": "2",\n "armRightValue": "2",\n "legsValue": "6",\n "stanceValue": "ARMLESS",\n "rearMountValue": "NONE",\n "weaponValue": "4",\n "weaponSelectionValue": "4-ARMLESS",\n "secondaryWeaponValue": "NONE",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitHardsuitHeavyValues:'{\n "chassisValue": "1",\n "headValue": "6",\n "armLeftValue": "1",\n "armRightValue": "1",\n "legsValue": "4",\n "stanceValue": "ARMLESS",\n "rearMountValue": "NONE",\n "weaponValue": "2",\n "weaponSelectionValue": "2-ARMLESS",\n "secondaryWeaponValue": "NONE",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitHardsuitAssaultValues:'{\n "chassisValue": "4",\n "headValue": "4",\n "armLeftValue": "2",\n "armRightValue": "2",\n "legsValue": "0",\n "stanceValue": "ARMLESS",\n "rearMountValue": "NONE",\n "weaponValue": "0",\n "weaponSelectionValue": "0-ARMLESS",\n "secondaryWeaponValue": "NONE",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitHardsuitMobilityValues:'{\n "chassisValue": "7",\n "headValue": "8",\n "armLeftValue": "2",\n "armRightValue": "2",\n "legsValue": "8",\n "stanceValue": "ARMLESS",\n "rearMountValue": "NONE",\n "weaponValue": "6",\n "weaponSelectionValue": "6-ARMLESS",\n "secondaryWeaponValue": "NONE",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitHardsuitStealthValues:'{\n "chassisValue": "7",\n "headValue": "9",\n "armLeftValue": "2",\n "armRightValue": "2",\n "legsValue": "13",\n "stanceValue": "ARMLESS",\n "rearMountValue": "NONE",\n "weaponValue": "9",\n "weaponSelectionValue": "9-ARMLESS",\n "secondaryWeaponValue": "NONE",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitSteubnerValues:'{\n "chassisValue": "1",\n "headValue": "3",\n "armLeftValue": "2",\n "armRightValue": "2",\n "legsValue": "14",\n "stanceValue": "ARMLESS",\n "rearMountValue": "NONE",\n "weaponValue": "10",\n "weaponSelectionValue": "10-ARMLESS",\n "secondaryWeaponValue": "2",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitRovackValues:'{\n "chassisValue": "7",\n "headValue": "2",\n "armLeftValue": "3",\n "armRightValue": "3",\n "legsValue": "11",\n "stanceValue": "ARMLESS",\n "rearMountValue": "NONE",\n "weaponValue": "8",\n "weaponSelectionValue": "8-ARMLESS",\n "secondaryWeaponValue": "NONE",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitArceoValues:'{\n "chassisValue": "7",\n "headValue": "0",\n "armLeftValue": "3",\n "armRightValue": "3",\n "legsValue": "10",\n "stanceValue": "ARM",\n "rearMountValue": "NONE",\n "weaponValue": "NONE",\n "weaponSelectionValue": "NONE-ARM",\n "secondaryWeaponValue": "0",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitBurvineValues:'{\n "chassisValue": "1",\n "headValue": "1",\n "armLeftValue": "1",\n "armRightValue": "1",\n "legsValue": "5",\n "stanceValue": "ARMLESS",\n "rearMountValue": "NONE",\n "weaponValue": "3",\n "weaponSelectionValue": "3-ARMLESS",\n "secondaryWeaponValue": "2",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitBolatbekValues:'{\n "chassisValue": "1",\n "headValue": "11",\n "armLeftValue": "1",\n "armRightValue": "1",\n "legsValue": "18",\n "stanceValue": "ARMLESS",\n "rearMountValue": "NONE",\n "weaponValue": "13",\n "weaponSelectionValue": "13-ARMLESS",\n "secondaryWeaponValue": "7",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitApolloValues:'{\n "chassisValue": "1",\n "headValue": "10",\n "armLeftValue": "1",\n "armRightValue": "1",\n "legsValue": "17",\n "stanceValue": "ARMLESS",\n "rearMountValue": "NONE",\n "weaponValue": "11",\n "weaponSelectionValue": "11-ARMLESS",\n "secondaryWeaponValue": "NONE",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitTreveValues:'{\n "chassisValue": "1",\n "headValue": "27",\n "armLeftValue": "1",\n "armRightValue": "1",\n "legsValue": "3",\n "stanceValue": "ARMLESS",\n "rearMountValue": "NONE",\n "weaponValue": "22",\n "weaponSelectionValue": "22-ARMLESS",\n "secondaryWeaponValue": "NONE",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitPamValues:'{\n "chassisValue": "1",\n "headValue": "26",\n "armLeftValue": "1",\n "armRightValue": "1",\n "legsValue": "2",\n "stanceValue": "ARMLESS",\n "rearMountValue": "NONE",\n "weaponValue": "20",\n "weaponSelectionValue": "20-ARMLESS",\n "secondaryWeaponValue": "NONE",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitCarlValues:'{\n "chassisValue": "1",\n "headValue": "12",\n "armLeftValue": "1",\n "armRightValue": "1",\n "legsValue": "19",\n "stanceValue": "ARMLESS",\n "rearMountValue": "NONE",\n "weaponValue": "14",\n "weaponSelectionValue": "14-ARMLESS",\n "secondaryWeaponValue": "NONE",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitGalfedValues:'{\n "chassisValue": "1",\n "headValue": "22",\n "armLeftValue": "1",\n "armRightValue": "1",\n "legsValue": "3",\n "stanceValue": "ARMLESS",\n "rearMountValue": "NONE",\n "weaponValue": "16",\n "weaponSelectionValue": "16-ARMLESS",\n "secondaryWeaponValue": "NONE",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitKarrakinKnightValues:'{\n "chassisValue": "1",\n "headValue": "24",\n "armLeftValue": "1",\n "armRightValue": "1",\n "legsValue": "23",\n "stanceValue": "ARMLESS",\n "rearMountValue": "NONE",\n "weaponValue": "19",\n "weaponSelectionValue": "19-ARMLESS",\n "secondaryWeaponValue": "NONE",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitKarrakinGeneralValues:'{\n "chassisValue": "1",\n "headValue": "23",\n "armLeftValue": "1",\n "armRightValue": "1",\n "legsValue": "22",\n "stanceValue": "ARMLESS",\n "rearMountValue": "NONE",\n "weaponValue": "18",\n "weaponSelectionValue": "18-ARMLESS",\n "secondaryWeaponValue": "NONE",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}',unitDroneValues:'{\n "chassisValue": "12",\n "headValue": "19",\n "armLeftValue": "4",\n "armRightValue": "4",\n "legsValue": "21",\n "stanceValue": "ARM",\n "rearMountValue": "NONE",\n "weaponValue": "NONE",\n "weaponSelectionValue": "NONE-ARM",\n "secondaryWeaponValue": "5",\n "accessory1Value": "NONE",\n "accessory2Value": "NONE",\n "accessory3Value": "NONE",\n "accessory4Value": "NONE",\n\n "chassisTintValue": "none",\n "legsTintValue": "none",\n "armLeftTintValue": "none",\n "armRightTintValue": "none",\n "headTintValue": "none",\n "rearMountTintValue": "none",\n "weaponTintValue": "none",\n "secondaryWeaponTintValue": "none",\n "accessory1TintValue": "none",\n "accessory2TintValue": "none",\n "accessory3TintValue": "none",\n "accessory4TintValue": "none"\n}'},Ca=`${x.A}/buttons/Color-Sample-Orb.png`,La=`${x.A}/buttons/Color-Sample-Square-18.png`,Ta=(0,t.Ay)(n.cw)` 234 padding: 5px 0 10px; 235 block-size: fit-content;
236 align-items: center; 237 overflow-y: unset; 238 justify-content: space-around; 239 margin-right: 10px; 240`;Ta.displayName="MechGMSUnitContainer";const Sa=U.A.mundaneTier.orb,Oa=U.A.mundaneTier.alt,Aa="seasonal-category mech-category",wa="unitState-PILOT-2-0",Ea=["ARM","ARMLESS"],ka=[{label:"HARDSUIT - LIGHT",value:ja.unitHardsuitLightValues},{label:"HARDSUIT - HEAVY",value:ja.unitHardsuitHeavyValues},{label:"HARDSUIT - ASSAULT",value:ja.unitHardsuitAssaultValues},{label:"HARDSUIT - MOBILITY",value:ja.unitHardsuitMobilityValues},{label:"HARDSUIT - STEALTH",value:ja.unitHardsuitStealthValues},{label:"KARRAKIN - KNIGHT",value:ja.unitKarrakinKnightValues},{label:"KARRAKIN - GENERAL",value:ja.unitKarrakinGeneralValues},{label:"APOLLO SHOWDOWN",value:ja.unitApolloValues},{label:"BANA ARCEO",value:ja.unitArceoValues},{label:"BOLATBEK VAIL",value:ja.unitBolatbekValues},{label:"CARL",value:ja.unitCarlValues},{label:"DRONE'S DAY OFF",value:ja.unitDroneValues},{label:"GALFED",value:ja.unitGalfedValues},{label:"HOYT BURVINE",value:ja.unitBurvineValues},{label:"MIRELLE ROVACK",value:ja.unitRovackValues},{label:"PAM",value:ja.unitPamValues},{label:"TR\xcaVE",value:ja.unitTreveValues},{label:"WAN JUN STEUBNER",value:ja.unitSteubnerValues}];const $a=function(e){let{setShowPremiumPopupFunc:a,unitCategory:l}=e;const[t,r]=(0,s.useState)(!1),[c,d]=(0,s.useState)(!1),[h,p]=(0,s.use
240State)(!1),[V,g]=(0,s.useState)(!1),[N,x]=(0,s.useState)(!1),[f,b]=(0,s.useState)(!1),[v,C]=(0,s.useState)(!1),[L,T]=(0,s.useState)(!1),[S,O]=(0,s.useState)(!1),[A,w]=(0,s.useState)(!1),[E,k]=(0,s.useState)(!1),[$,P]=(0,s.useState)(!1),[U,z]=(0,s.useState)(!1),[D,Y]=(0,s.useState)(!1),[Q,J]=(0,s.useState)(0),[_,K]=(0,s.useState)(0),q=(0,he.w)(wa),[Z,X]=(0,s.useState)(q||JSON.parse(ja.unitHardsuitLightValues));(0,s.useEffect)((()=>{(0,he.s)(wa,Z)}),[Z]);const{user:ee}=(0,s.useContext)(R.x),{addUnit:ae,mechCustomPartList:le}=(0,s.useContext)(B.UnitContext),{displayTheme:se}=(0,s.useContext)(F.m),{colorValue:te,displayCustomControls:ne,tintValue:re,handleColorOptionChange:ie,getColorTint:oe}=(0,s.useContext)(y.Q),ce=le["PILOT-2-0"],ue=ee&&ee.isPremiumUser;function de(e,a){return X(Object.assign({},Z,{[a]:e}))}const me=ce.chassis.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!ue,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),pe=ce.head.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!ue,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),Ve=ce.legs.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!ue,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),ge=ce.arms.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!ue||e.disabled,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),ye=ce.rearMount.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!ue,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),Ne=[].concat(ce.weapon.ARM,ce.weapon.ARMLESS).map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!ue||e.disabled,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),xe=ce.secondaryWeapon.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!ue,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),fe=ce.accessory.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!ue,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),be=ce.partList.map(((e,a)=>(0,m.jsx)("option",{value:a,children:e.label},`paint-${e.value}-${e.label}`))),ve=M.A.map(((e,a)=>(0,m.jsx)("option",{value:a,children:e.label},`${e.value}-${e.label}`))),je=ka.map(((e,a)=>(0,m.jsx)("option",{value:a,children:e.label},`template--${e.label}`))),Ce="number"===typeof c;return(0,m.jsxs)(n.sc,{className:Aa,isExpanded:t,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,children:[(0,m.jsxs)(n.IA,{className:Aa,onClick:()=>r(!t),title:l.description,children:[(0,m.jsx)(ma.m,{className:`${Aa} ${l.logoImage||Sa}`,alt:"Units Rarity",title:Oa}),(0,m.jsx)(n.xA,{alt:l.label,className:Aa,children:l.label})]}),(0,m.jsx)(i.A,{children:(0,m.jsx)(Ta,{className:Aa,themeBackgroun
240dPrimaryColor:se?l.retroTerminalBackgroundColor:l.themeBackgroundPrimaryColor,themeBackgroundSecondaryColor:se?l.retroTerminalBackgroundSecondaryColor:l.themeBackgroundSecondaryColor,isExpanded:t,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,displayCustomControls:ne,children:t?(0,m.jsxs)(u.Dp,{children:[(0,m.jsxs)("div",{className:"options-selectors",children:[(0,m.jsxs)(u.A5,{className:se?"retro-terminal":"default",disabled:Ce,children:[(0,m.jsx)("label",{htmlFor:"template-select",children:"TEMPLATE"}),(0,m.jsx)("select",{id:"template-select",name:"template",onChange:e=>{var a;return a=ka[e.target.value].value,X(JSON.parse(a)),J(e.target.value)},value:Q,disabled:Ce,children:je})]}),(0,m.jsx)(G.Ay,{unit:Z,brandList:ce,isCoreImageView:c,isCustomCategory:!0}),(0,m.jsxs)(u.A5,{className:se?"retro-terminal":"default",disabled:Ce,children:[(0,m.jsxs)("label",{htmlFor:"head-select",children:[(0,m.jsx)("span",{children:"HEAD"}),(0,m.jsx)("img",{alt:"HEAD Color Preview",src:La,style:{filter:Z.headTintValue}}),(0,m.jsx)(j.A,{className:v?j.B.locked:j.B.unlocked,alt:"Option "+(v?"Locked":"Unlocked"),onClick:()=>C(!v)})]}),(0,m.jsxs)("select",{id:"head-select",name:"head",onChange:e=>de(e.target.value,"headValue"),value:Z.headValue,disabled:Ce,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),pe]})]}),(0,m.jsxs)(u.A5,{className:se?"retro-terminal":"default",disabled:Ce,children:[(0,m.jsxs)("label",{htmlFor:"weapon-select",children:[(0,m.jsx)("span",{children:"JACKET"}),(0,m.jsx)("img",{alt:"JACKET Color Preview",src:La,style:{filter:Z.weaponTintValue}}),(0,m.jsx)(j.A,{className:L?j.B.locked:j.B.unlocked,alt:"Option "+(L?"Locked":"Unlocked"),onClick:()=>T(!L)})]}),(0,m.jsxs)("select",{id:"weapon-select",name:"weapon",onChange:function(e){const a=e.target.value.split("-"),l={weaponValue:a[0],stanceValue:a[1],weaponSelectionValue:e.target.value};return X(Object.assign({},Z,l))},value:Z.weaponSelectionValue,disabled:Ce,children:[(0,m.jsx)("option",{value:"NONE-ARM",children:"NONE"}),Ne]})]}),(0,m.jsxs)(u.A5,{className:se?"retro-terminal":"default",disabled:Ce,children:[(0,m.jsxs)("label",{htmlFor:"chassis-select",children:[(0,m.jsx)("span",{children:"TORSO"}),(0,m.jsx)("img",{alt:"TORSO Color Preview",src:La,style:{filter:Z.chassisTintValue}}),(0,m.jsx)(j.A,{className:h?j.B.locked:j.B.unlocked,alt:"Option "+(h?"Locked":"Unlocked"),onClick:()=>p(!h)})]}),(0,m.jsxs)("select",{id:"chassis-select",name:"chassis",onChange:e=>de(e.target.value,"chassisValue"),value:Z.chassisValue,disabled:Ce,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),me]})]}),(0,m.jsxs)(u.A5,{className:se?"retro-terminal":"default",disabled:Ce,children:[(0,m.jsxs)("label",{htmlFor:"secondary-weapon-select",children:[(0,m.jsx)("span",{children:"SHIRT"}),(0,m.jsx)("img",{alt:"SHIRT Color Preview",src:La,style:{filter:Z.secondaryWeaponTintValue}}),(0,m.jsx)(j.A,{className:S?j.B.locked:j.B.unlocked,alt:"Option "+(S?"Locked":"Unlocked"),onClick:()=>O(!S)})]}),(0,m.jsxs)("select",{id:"secondary-weapon-select",name:"secondary weapon",onChange:e=>de(e.target.value,"secondaryWeaponValue"),value:Z.secondaryWeaponValue,disabled:Ce,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),xe]})]}),(0,m.jsxs)(u.A5,{className:se?"retro-terminal":"default",disabled:Ce,children:[(0,m.jsxs)("label",{htmlFor:"left-arm-select",children:[(0,m.jsx)("span",{children:"LEFT ARM"}),(0,m.jsx)("img",{alt:"LEFT ARM Color Preview",src:La,style:{filter:Z.armLeftTintValue}}),(0,m.jsx)(j.A,{className:N?j.B.locked:j.B.unlocked,alt:"Option "+(N?"Locked":"Unlocked"),onClick:()=>x(!N)})]}),(0,m.jsxs)("select",{id:"left-arm-select",name:"arm",onChange:function(e){const a={armLeftValue:e.target.value};return X(Object.assign({},Z,a))},value:Z.armLeftValue,disabled:Ce,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),ge]})]}),(0,m.jsxs)(u.A5,{className:se?"retro-terminal":"default",disabled:Ce,children:[(0,m.jsxs)("label",{htmlFor:"right-arm-select",children:[(0,m.jsx)("span",{children:"RIGHT ARM"}),(0,m.jsx)("img",{alt:"RIGHT ARM Color Preview",src:La,style:{filter:Z.armRightTintValue}}),(0,m.jsx)(j.A,{className:f?j.B.locked:j.B.unlocked,alt:"Option "+(f?"Locked":"Unlocked"),onClick:()=>b(!f)})]}
240),(0,m.jsxs)("select",{id:"right-arm-select",name:"arm",onChange:function(e){const a={armRightValue:e.target.value};return X(Object.assign({},Z,a))},value:Z.armRightValue,disabled:Ce,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),ge]})]}),(0,m.jsxs)(u.A5,{className:se?"retro-terminal":"default",disabled:Ce,children:[(0,m.jsxs)("label",{htmlFor:"legs-select",children:[(0,m.jsx)("span",{children:"LEGS"}),(0,m.jsx)("img",{alt:"LEGS Color Preview",src:La,style:{filter:Z.legsTintValue}}),(0,m.jsx)(j.A,{className:V?j.B.locked:j.B.unlocked,alt:"Option "+(V?"Locked":"Unlocked"),onClick:()=>g(!V)})]}),(0,m.jsx)("select",{id:"legs-select",name:"legs",onChange:e=>de(e.target.value,"legsValue"),value:Z.legsValue,disabled:Ce,children:Ve})]}),(0,m.jsxs)(u.A5,{className:se?"retro-terminal":"default",disabled:!ye.length||Ce,children:[(0,m.jsxs)("label",{htmlFor:"rear-mount-select",children:[(0,m.jsx)("span",{children:"EMPTY"}),(0,m.jsx)("img",{alt:"REAR MOUNT Color Preview",src:La,style:{filter:Z.rearMountTintValue}}),(0,m.jsx)(j.A,{className:A?j.B.locked:j.B.unlocked,alt:"Option "+(A?"Locked":"Unlocked"),onClick:()=>w(!A)})]}),(0,m.jsxs)("select",{id:"rear-mount-select",name:"rear mount",onChange:e=>de(e.target.value,"rearMountValue"),value:Z.rearMountValue,disabled:!ye.length||Ce,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),ye]})]}),(0,m.jsxs)(u.A5,{className:se?"retro-terminal":"default",disabled:!fe.length||Ce,children:[(0,m.jsxs)("label",{htmlFor:"accessory-1-select",children:[(0,m.jsx)("span",{children:"EMPTY"}),(0,m.jsx)("img",{alt:"ACCESSORY 1 Color Preview",src:La,style:{filter:Z.accessory1TintValue}}),(0,m.jsx)(j.A,{className:E?j.B.locked:j.B.unlocked,alt:"Option "+(E?"Locked":"Unlocked"),onClick:()=>k(!E)})]}),(0,m.jsxs)("select",{id:"accessory-1-select",name:"accessory1",onChange:e=>de(e.target.value,"accessory1Value"),value:Z.accessory1Value,disabled:!fe.length||Ce,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),fe]})]}),(0,m.jsxs)(u.A5,{className:se?"retro-terminal":"default",disabled:!fe.length||Ce,children:[(0,m.jsxs)("label",{htmlFor:"accessory-2-select",children:[(0,m.jsx)("span",{children:"EMPTY"}),(0,m.jsx)("img",{alt:"ACCESSORY 2 Color Preview",src:La,style:{filter:Z.accessory2TintValue}}),(0,m.jsx)(j.A,{className:$?j.B.locked:j.B.unlocked,alt:"Option "+($?"Locked":"Unlocked"),onClick:()=>P(!$)})]}),(0,m.jsxs)("select",{id:"accessory-2-select",name:"accessory2",onChange:e=>de(e.target.value,"accessory2Value"),value:Z.accessory2Value,disabled:!fe.length||Ce,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),fe]})]}),(0,m.jsxs)(u.A5,{className:se?"retro-terminal":"default",disabled:!fe.length||Ce,children:[(0,m.jsxs)("label",{htmlFor:"accessory-3-select",children:[(0,m.jsx)("span",{children:"EMPTY"}),(0,m.jsx)("img",{alt:"ACCESSORY 3 Color Preview",src:La,style:{filter:Z.accessory3TintValue}}),(0,m.jsx)(j.A,{className:U?j.B.locked:j.B.unlocked,alt:"Option "+(U?"Locked":"Unlocked"),onClick:()=>z(!U)})]}),(0,m.jsxs)("select",{id:"accessory-3-select",name:"accessory3",onChange:e=>de(e.target.value,"accessory3Value"),value:Z.accessory3Value,disabled:!fe.length||Ce,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),fe]})]}),(0,m.jsxs)(u.A5,{className:se?"retro-terminal":"default",disabled:!fe.length||Ce,children:[(0,m.jsxs)("label",{htmlFor:"accessory-4-select",children:[(0,m.jsx)("span",{children:"EMPTY"}),(0,m.jsx)("img",{alt:"ACCESSORY 4 Color Preview",src:La,style:{filter:Z.accessory4TintValue}}),(0,m.jsx)(j.A,{className:D?j.B.locked:j.B.unlocked,alt:"Option "+(D?"Locked":"Unlocked"),onClick:()=>Y(!D)})]}),(0,m.jsxs)("select",{id:"accessory-4-select",name:"accessory4",onChange:e=>de(e.target.value,"accessory4Value"),value:Z.accessory4Value,disabled:!fe.length||Ce,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),fe]})]}),(0,m.jsxs)(u.A5,{className:se?"retro-terminal":"default",disabled:Ce,children:[(0,m.jsx)("label",{htmlFor:"color-select",children:"COLOR"}),(0,m.jsx)("select",{id:"color-select",name:"color",onChange:ie,value:te,disabled:Ce,children:ve}),(0,m.jsx)(I.A,{tintValue:re,src:Ca,alt:"paint-preview"})]}),(0,m.jsxs)(u.A5,{className:se?"retro-terminal":"default",disabled:Ce,children:[(0,m.jsx)("label",{htmlFor:"part-select",children:"COLOR TARGET"}),(0,m.jsx)("select",{id:"part-select",name:"part",onChange:e=>K(e.target.value),value:_,disabled:Ce,children:be})]})]}),(0,m.jsxs)("div",{className:"display-controls",children:[(0,m.jsx)(o.A,{onContextMenu:e=>e.preventDefault(),imageSize:ce.imageSize,children:(0,m.jsx)(H.A,{children:(0,m.jsx)(oa.A,{unit:Ce?Object.assign({},Z,{viewCoreImage:c}):Z,brandList:le,type:"PILOT-2-0",isInCategory:!0})})}),(0,m.jsxs)(u.OT,{children:[(0,m.jsx)(u.QB,{className:se?"retro-terminal":"default",onClick:function(){return p(!1),g(!1),x(!1),b(!1),C(!1),T(!1),O(!1),w(!1),k(!1),P(!1),z(!1),Y(!1),d(!1),X(JSON.parse(ja.unitHardsuitLightValues))},children:"RESET"}),(0,m.jsx)(u.QB,{className:se?"retro-terminal":"default",onClick:function(){var e;const a=Ea[(0,W.nd)(0,Ea.length-1)];let l=(0,W.nd)(0,ce.weapon[a].length-1),s=ce.weapon[a][l].value,t=0,n=0;"ARM"===a?(t=(0,W.nd)(0,ce.arms.length-1),n=(0,W.nd)(0,ce.arms.length-1)):(t=(0,W.nd)(0,ce.arms.filter((e=>!(null!==e&&void 0!==e&&e.isMounted))).length-1),n=(0,W.nd)(0,ce.arms.filter((e=>!(null!==e&&void 0!==e&&e.isMounted))).length-1)),ce.arms[n].disabled&&(n+=1),ce.arms[t].disabled&&(t+=1),null!==(e=ce.arms[n])&&void 0!==e&&e.isMounted&&(l="NONE",s="NONE-ARM"),"0"===s&&(l="1",s=`1-${a}`);const r="ARM"===a?(0,W.nd)(0,ce.secondaryWeapon.length-1):"NONE",i={chassisValue:(0,W.nd)(0,ce.chassis.length-1),legsValue:(0,W.nd)(0,ce.legs.length-1),armLeftValue:t,armRightValue:n,stanceValue:a,headValue:(0,W.nd)(0,ce.head.length-1),rearMountValue:(0,W.nd)(0,ce.rearMount.length-1),weaponValue:l,secondaryWeaponValue:r,weaponSelectionValue:s,accessory1Value:(0,W.nd)(0,1)?(0,W.nd)(0,ce.accessory.length-1):"NONE",accessory2Value:(0,W.nd)(0,1)?(0,W.nd)(0,ce.accessory.length-1):"NONE",accessory3Value:(0,W.nd)(0,1)?(0,W.nd)(0,ce.accessory.length-1):"NONE",accessory4Value:(0,W.nd)(0,1)?(0,W.nd)(0,ce.accessory.length-1):"NONE"};var o,c;return h&&delete i.chassisValue,v&&delete i.headValue,V&&delete i.legsValue,N&&delete i.armLeftValue,f&&delete i.armRightValue,L&&(delete i.weaponValue,delete i.stanceValue,delete i.weaponSelectionValue,"ARMLESS"===Z.stanceValue&&(delete i.secondaryWeaponValue,null!==(o=ce.arms[n])&&void 0!==o&&o.isMounted&&delete i.armRightValue,null!==(c=ce.arms[t])&&void 0!==c&&c.isMounted&&delete i.armLeftValue)),S&&delete i.secondaryWeaponValue,(A||0===ce.rearMount.length)&&delete i.rearMountValue,(E||0===ce.accessory.length)&&delete i.accessory1Value,($||0===ce.accessory.length)&&delete i.accessory2Value,(U||0===ce.accessory.length)&&delete i.accessory3Value,(D||0===ce.accessory.length)&&delete i.accessory4Value,X(Object.assign({},Z,i))},disabled:Ce,children:"RANDOM"}),(0,m.jsx)(u.QB,{className:se?"retro-terminal":"default",onClick:function(){const e={},a=ce.partList[_].value;let l=oe();switch(a){case"BODY":e.chassisTintValue=l,e.legsTintValue=l,e.armLeftTintValue=l,e.armRightTintValue=l,e.headTintValue=l;break;case"WEAPONS":e.weaponTintValue=l,e.secondaryWeaponTintValue=l;break;case"ACCESSORIES":e.accessory1TintValue=l,e.accessory2TintValue=l,e.accessory3TintValue=l,e.accessory4TintValue=l;break;case"ALL":e.chassisTintValue=l,e.legsTintValue=l,e.armLeftTintValue=l,e.armRightTintValue=l,e.headTintValue=l,e.rearMountTintValue=l,e.weaponTintValue=l,e.secondaryWeaponTintValue=l,e.accessory1TintValue=l,e.accessory2TintValue=l,e.accessory3TintValue=l,e.accessory4TintValue=l;break;default:e[`${a}TintValue`]=l}return X(Object.assign({},Z,e))},disabled:Ce,children:"APPLY COLOR"}),ce.coreImg?(0,m.jsx)(u.QB,{className:se?"retro-terminal":"default",onClick:()=>{!1===c?d(0):c+1<ce.coreImg.length?d(c+1):d(!1)},children:`CORE VER. ${ce.coreImg.map(((e,a)=>c===a?"\u25a3":"\u2610")).join(" ")}`}):(0,m.jsx)(u.R2,{}),(0,m.jsx)(da.A,{displayTheme:se?"retro-terminal":"default",unit:{...Z,imageSize:ce.imageSize,type:"PILOT-2-0"},name:l.title,setShowPremiumPopupFunc:a,unitPreviewImage:{src:Ce?ce.coreImg[c].src:ce.previewImg,imageHeight:ce.imageSize.height,imageWidth:ce.imageSize.width,title:Ce?ce.coreImg[c].originalArtCredit.title:null},isCoreImageView:c,type:"CUSTOM"}),(0,m.jsx)(u.QB,{className:se?"retro-terminal":"default",onClick:function(){const e=`\n MECH\n C-${ce.chassis[Z.chassisValue].label}\n H-${"NONE"!==Z.headValue?ce.head[Z.headValue].label:"NONE"}\n LA-${"NONE"!==Z.armLeftValue?ce.arms[Z.armLeftValue].label:"NONE"}\n RA-${"NONE"!==Z.armRightValue?ce.arms[Z.armRightValue].label:"NONE"}\n L-${ce.legs[Z.legsValue].label}\n R-${"NONE"!==Z.rearMountValue?ce.rearMount[Z.rearMountValue].label:"NONE"}\n P-${Z.weaponSelectionValue}\n S-${"NONE"!==Z.secondaryWeaponValue?ce.secondaryWeapon[Z.secondaryWeaponValue].label:"NONE"}\n A1-${"NONE"!==Z.accessory1Value?ce.accessory[Z.accessory1Value].label:"NONE"}\n A2-${"NONE"!==Z.accessory2Value?ce.accessory[Z.accessory2Value].label:"NONE"}\n A3-${"NONE"!==Z.accessory3Value?ce.accessory[Z.accessory3Value].label:"NONE"}\n A4-${"NONE"!==Z.accessory4Value?ce.accessory[Z.accessory4Value].label:"NONE"}\n `,a=[Object.assign({},Z,{imageSize:ce.imageSize,viewCoreImage:c})];return ae(Object.assign({variantsArray:a,currentVariant:0,id:`${e}-${Date.now()}
240`,shadowDetails:ce.legs[Z.legsValue].shadowDetails,mechCustomPilotUnit:!0,mechLabel:e,imageSize:ce.imageSize,type:"PILOT-2-0"}))},children:"FABRICATE"})]})]}),ne?(0,m.jsx)(ca.A,{displayTheme:se}):null]}):null})})]})};var Pa=l(5196);const Ra=`${x.A}/buttons/Color-Sample-Orb.png`,Ba=`${x.A}/buttons/Color-Sample-Square-18.png`,Fa=(0,t.Ay)(n.cw)` 241 padding: 5px 0 10px; 242 block-size: fit-content; 243 align-items: center; 244 overflow-y: unset; 245 justify-content: space-around; 246 margin-right: 10px; 247`;Fa.displayName="MechCustomPlusUnitContainer";const Ma=U.A.mundaneTier.orb,Wa=U.A.mundaneTier.alt,Ua="seasonal-category mech-category",Ia=["1H"];const Ha=function(e){let{setShowPremiumPopupFunc:a,unitCategory:l}=e;const[t,r]=(0,s.useState)(!1),[c,d]=(0,s.useState)(!1),[h,p]=(0,s.useState)(!1),[V,g]=(0,s.useState)(!1),[N,x]=(0,s.useState)(!1),[f,b]=(0,s.useState)(!1),[v,C]=(0,s.useState)(!1),[L,T]=(0,s.useState)(!1),[S,O]=(0,s.useState)(!1),[A,w]=(0,s.useState)(!1),[E,k]=(0,s.useState)(!1),[$,P]=(0,s.useState)(!1),[U,z]=(0,s.useState)(!1),[D,Y]=(0,s.useState)(0),Q=(0,he.w)("unitState-622"),{user:J}=(0,s.useContext)(R.x),{addUnit:_,mechCustomPartList:K}=(0,s.useContext)(B.UnitContext),{displayTheme:q}=(0,s.useContext)(F.m),{colorValue:Z,displayCustomControls:X,tintValue:ee,handleColorOptionChange:ae,getColorTint:le}=(0,s.useContext)(y.Q),se=K[622],[te,ne]=(0,s.useState)(Object.assign({},Q||JSON.parse(se.defaultValues),{frameValue:null,brandValue:l.title}));(0,s.useEffect)((()=>{(0,he.s)("unitState-622",te)}),[te]);const re=J&&J.isPremiumUser;function ie(e,a){return ne(Object.assign({},te,{[a]:e}))}const oe=se.chassis.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!re,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),ce=se.head.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!re,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),ue=se.legs.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!re,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),de=se.leftArm.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!re||e.disabled,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),me=se.rightArm.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!re||e.disabled,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),pe=se.rearMount.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!re,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),Ve=se.weapon["1H"].map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!re||e.disabled,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),ge=se.secondaryWeapon.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!re,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),ye=se.accessory.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!re,children:`${e.label} ${e.isPlusTwo?"*":""}`},`${e.value}-${e.label}`))),Ne=se.partList.map(((e,a)=>(0,m.jsx)("option",{value:a,children:e.label},`paint-${e.value}-${e.label}`))),xe=M.A.map(((e,a)=>(0,m.jsx)("option",{value:a,children:e.label},`${e.value}-${e.label}`)));return(0,m.jsxs)(n.sc,{className:Ua,isExpanded:t,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,children:[(0,m.jsxs)(n.IA,{className:Ua,onClick:()=>r(!t),title:l.description,children:[(0,m.jsx)(ma.m,{className:`${Ua} ${l.logoImage||Ma}`,alt:"Units Rarity",title:Wa}),(0,m.jsx)(n.xA,{alt:l.label,className:Ua,children:l.label})]}),(0,m.jsx)(i.A,{children:(0,m.jsx)(Fa,{className:Ua,themeBackgroun
247dPrimaryColor:q?l.retroTerminalBackgroundColor:l.themeBackgroundPrimaryColor,themeBackgroundSecondaryColor:q?l.retroTerminalBackgroundSecondaryColor:l.themeBackgroundSecondaryColor,isExpanded:t,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,displayCustomControls:X,children:t?(0,m.jsxs)(u.Dp,{children:[(0,m.jsxs)("div",{className:"options-selectors",children:[(0,m.jsx)(G.Ay,{unit:te,brandList:se,isCustomPlusCategory:!0}),(0,m.jsx)(u.R2,{}),(0,m.jsxs)(u.A5,{className:q?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"head-select",children:[(0,m.jsx)("span",{children:se.labels.head}),(0,m.jsx)("img",{alt:"HEAD Color Preview",src:Ba,style:{filter:te.headTintValue}}),(0,m.jsx)(j.A,{className:f?j.B.locked:j.B.unlocked,alt:"Option "+(f?"Locked":"Unlocked"),onClick:()=>b(!f)})]}),(0,m.jsxs)("select",{id:"head-select",name:"head",onChange:e=>ie(e.target.value,"headValue"),value:te.headValue,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),ce]})]}),(0,m.jsxs)(u.A5,{className:q?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"chassis-select",children:[(0,m.jsx)("span",{children:se.labels.chassis}),(0,m.jsx)("img",{alt:"CHASSIS Color Preview",src:Ba,style:{filter:te.chassisTintValue}}),(0,m.jsx)(j.A,{className:c?j.B.locked:j.B.unlocked,alt:"Option "+(c?"Locked":"Unlocked"),onClick:()=>d(!c)})]}),(0,m.jsxs)("select",{id:"chassis-select",name:"chassis",onChange:e=>ie(e.target.value,"chassisValue"),value:te.chassisValue,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),oe]})]}),(0,m.jsxs)(u.A5,{className:q?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"legs-select",children:[(0,m.jsx)("span",{children:se.labels.legs}),(0,m.jsx)("img",{alt:"LEGS Color Preview",src:Ba,style:{filter:te.legsTintValue}}),(0,m.jsx)(j.A,{className:h?j.B.locked:j.B.unlocked,alt:"Option "+(h?"Locked":"Unlocked"),onClick:()=>p(!h)})]}),(0,m.jsx)("select",{id:"legs-select",name:"legs",onChange:e=>ie(e.target.value,"legsValue"),value:te.legsValue,children:ue})]}),(0,m.jsxs)(u.A5,{className:q?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"rear-mount-select",children:[(0,m.jsx)("span",{children:se.labels.rearMount}),(0,m.jsx)("img",{alt:"REAR MOUNT Color Preview",src:Ba,style:{filter:te.rearMountTintValue}}),(0,m.jsx)(j.A,{className:S?j.B.locked:j.B.unlocked,alt:"Option "+(S?"Locked":"Unlocked"),onClick:()=>O(!S)})]}),(0,m.jsxs)("select",{id:"rear-mount-select",name:"rear mount",onChange:e=>ie(e.target.value,"rearMountValue"),value:te.rearMountValue,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),pe]})]}),(0,m.jsxs)(u.A5,{className:q?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"left-arm-select",children:[(0,m.jsx)("span",{children:se.labels.leftArm}),(0,m.jsx)("img",{alt:"LEFT ARM Color Preview",src:Ba,style:{filter:te.armLeftTintValue}}),(0,m.jsx)(j.A,{className:V?j.B.locked:j.B.unlocked,alt:"Option "+(V?"Locked":"Unlocked"),onClick:()=>g(!V)})]}),(0,m.jsxs)("select",{id:"left-arm-select",name:"left-arm",onChange:e=>ie(e.target.value,"armLeftValue"),value:te.armLeftValue,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),de]})]}),(0,m.jsxs)(u.A5,{className:q?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"right-arm-select",children:[(0,m.jsx)("span",{children:se.labels.rightArm}),(0,m.jsx)("img",{alt:"RIGHT ARM Color Preview",src:Ba,style:{filter:te.armRightTintValue}}),(0,m.jsx)(j.A,{className:N?j.B.locked:j.B.unlocked,alt:"Option "+(N?"Locked":"Unlocked"),onClick:()=>x(!N)})]}),(0,m.jsxs)("select",{id:"right-arm-select",name:"right-arm",onChange:e=>ie(e.target.value,"armRightValue"),value:te.armRightValue,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),me]})]}),(0,m.jsxs)(u.A5,{className:q?"retro-terminal":"default",disabled:"NONE"===te.armLeftValue,children:[(0,m.jsxs)("label",{htmlFor:"weapon-select",children:[(0,m.jsx)("span",{children:se.labels.weapon}),(0,m.jsx)("img",{alt:"WEAPON Color Preview",src:Ba,style:{filter:te.weaponTintValue}}),(0,m.jsx)(j.A,{className:v?j.B.locked:j.B.unlocked,alt:"Option "+(v?"Locked":"Unlocked"),onClick:()=>C(!v)})]}),(0,m.jsxs)("select",{id:"weapon-select",name:"weapon",onChange:e=>ie(e.target.value,"weaponValue"),value:te.weaponValue,disabled:"NONE"===te.armLeftValue,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),Ve]})]}),(0,m.jsxs)(u.A5,{className:q?"retro-terminal":"default",disabled:"1H"!==te.stanceValue,children:[(0,m.jsxs)("label",{htmlFor:"secondary-weapon-select",children:[(0,m.jsx)("span",{children:se.labels.secondaryWeapon}),(0,m.jsx)("img",{alt:"RIGHT WEAPON Color Preview",src:Ba,style:{filter:te.secondaryWeaponTintValue}}),(0,m.jsx)(j.A,{className:L?j.B.locked:j.B.unlocked,alt:"Option "+(L?"Locked":"Unlocked"),onClick:()=>T(!L)})]}),(0,m.jsxs)("select",{id:"secondary-weapon-select",name:"secondary weapon",onChange:e=>ie(e.target.value,"secondaryWeaponValue"),value:te.secondaryWeaponValue,disabled:"1H"!==te.stanceValue||"NONE"===te.armRightValue,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),ge]})]}),(0,m.jsxs)(u.A5,{className:q?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"accessory-1-select",children:[(0,m.jsx)("span",{children:se.labels.accessory1}),(0,m.jsx)("img",{alt:"ACCESSORY 1 Color Preview",src:Ba,style:{filter:te.accessory1TintValue}}),(0,m.jsx)(j.A,{className:A?j.B.locked:j.B.unlocked,alt:"Option "+(A?"Locked":"Unlocked"),onClick:()=>w(!A)})]}),(0,m.jsxs)("select",{id:"accessory-1-select",name:"accessory1",onChange:e=>ie(e.target.value,"accessory1Value"),value:te.accessory1Value,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),ye]})]}),(0,m.jsxs)(u.A5,{className:q?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"accessory-2-select",children:[(0,m.jsx)("span",{children:se.labels.accessory2}),(0,m.jsx)("img",{alt:"ACCESSORY 2 Color Preview",src:Ba,style:{filter:te.accessory2TintValue}}),(0,m.jsx)(j.A,{className:E?j.B.locked:j.B.unlocked,alt:"Option "+(E?"
247Locked":"Unlocked"),onClick:()=>k(!E)})]}),(0,m.jsxs)("select",{id:"accessory-2-select",name:"accessory2",onChange:e=>ie(e.target.value,"accessory2Value"),value:te.accessory2Value,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),ye]})]}),(0,m.jsxs)(u.A5,{className:q?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"accessory-3-select",children:[(0,m.jsx)("span",{children:se.labels.accessory3}),(0,m.jsx)("img",{alt:"ACCESSORY 3 Color Preview",src:Ba,style:{filter:te.accessory3TintValue}}),(0,m.jsx)(j.A,{className:$?j.B.locked:j.B.unlocked,alt:"Option "+($?"Locked":"Unlocked"),onClick:()=>P(!$)})]}),(0,m.jsxs)("select",{id:"accessory-3-select",name:"accessory3",onChange:e=>ie(e.target.value,"accessory3Value"),value:te.accessory3Value,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),ye]})]}),(0,m.jsxs)(u.A5,{className:q?"retro-terminal":"default",children:[(0,m.jsxs)("label",{htmlFor:"accessory-4-select",children:[(0,m.jsx)("span",{children:se.labels.accessory4}),(0,m.jsx)("img",{alt:"ACCESSORY 4 Color Preview",src:Ba,style:{filter:te.accessory4TintValue}}),(0,m.jsx)(j.A,{className:U?j.B.locked:j.B.unlocked,alt:"Option "+(U?"Locked":"Unlocked"),onClick:()=>z(!U)})]}),(0,m.jsxs)("select",{id:"accessory-4-select",name:"accessory4",onChange:e=>ie(e.target.value,"accessory4Value"),value:te.accessory4Value,children:[(0,m.jsx)("option",{value:"NONE",children:"NONE"}),ye]})]}),(0,m.jsxs)(u.A5,{className:q?"retro-terminal":"default",children:[(0,m.jsx)("label",{htmlFor:"color-select",children:"COLOR"}),(0,m.jsx)("select",{id:"color-select",name:"color",onChange:ae,value:Z,children:xe}),(0,m.jsx)(I.A,{tintValue:ee,src:Ra,alt:"paint-preview"})]}),(0,m.jsxs)(u.A5,{className:q?"retro-terminal":"default",children:[(0,m.jsx)("label",{htmlFor:"part-select",children:"COLOR TARGET"}),(0,m.jsx)("select",{id:"part-select",name:"part",onChange:e=>Y(e.target.value),value:D,children:Ne})]})]}),(0,m.jsxs)("div",{className:"display-controls",children:[(0,m.jsx)(o.A,{onContextMenu:e=>e.preventDefault(),imageSize:se.imageSize,children:(0,m.jsx)(H.A,{children:(0,m.jsx)(Pa.A,{unit:te,brandList:K[622],isInCategory:!0})})}),(0,m.jsxs)(u.OT,{children:[(0,m.jsx)(u.QB,{className:q?"retro-terminal":"default",onClick:function(){return d(!1),p(!1),g(!1),x(!1),b(!1),C(!1),T(!1),O(!1),w(!1),k(!1),P(!1),z(!1),ne(JSON.parse(se.defaultValues))},children:"RESET"}),(0,m.jsx)(u.QB,{className:q?"retro-terminal":"default",onClick:function(){const e=Ia[0];let a=(0,W.nd)(0,se.weapon[e].length-1),l=se.weapon[e][a].value,s=0,t=0;s=(0,W.nd)(0,se.leftArm.length-1),t=(0,W.nd)(0,se.rightArm.length-1),se.rightArm[t].disabled&&(t+=1),se.leftArm[s].disabled&&(s+=1),"0"===l&&(a="1",l=`1-${e}`);const n="1H"===e?(0,W.nd)(0,se.secondaryWeapon.length-1):"NONE",r={chassisValue:(0,W.nd)(0,se.chassis.length-1),legsValue:(0,W.nd)(0,se.legs.length-1),armLeftValue:s,armRightValue:t,stanceValue:e,headValue:(0,W.nd)(0,se.head.length-1),rearMountValue:(0,W.nd)(0,se.rearMount.length-1),weaponValue:a,secondaryWeaponValue:n,weaponSelectionValue:l,accessory1Value:(0,W.nd)(0,1)?(0,W.nd)(0,se.accessory.length-1):"NONE",accessory2Value:(0,W.nd)(0,1)?(0,W.nd)(0,se.accessory.length-1):"NONE",accessory3Value:(0,W.nd)(0,1)?(0,W.nd)(0,se.accessory.length-1):"NONE",accessory4Value:(0,W.nd)(0,1)?(0,W.nd)(0,se.accessory.length-1):"NONE"};return c&&delete r.chassisValue,f&&delete r.headValue,h&&delete r.legsValue,V&&delete r.armLeftValue,N&&delete r.armRightValue,v&&(delete r.weaponValue,delete r.stanceValue,delete r.weaponSelectionValue),L&&delete r.secondaryWeaponValue,S&&delete r.rearMountValue,A&&delete r.accessory1Value,E&&delete r.accessory2Value,$&&delete r.accessory3Value,U&&delete r.accessory4Value,ne(Object.assign({},te,r))},children:"RANDOM"}),(0,m.jsx)(u.QB,{className:q?"retro-terminal":"default",onClick:function(){const e={},a=se.partList[D].value;let l=le();switch(a){case"BODY":e.chassisTintValue=l,e.legsTintValue=l,e.armLeftTintValue=l,e.armRightTintValue=l,e.headTintValue=l;break;case"WEAPONS":e.weaponTintValue=l,e.secondaryWeaponTintValue=l;break;case"ACCESSORIES":e.accessory1TintValue=l,e.accessory2TintValue=l,e.accessory3TintValue=l,e.accessory4TintValue=l;break;case"rightArm":e.armRightTintValue=l;break;case"leftArm":e.armLeftTintValue=l;break;case"ALL":e.chassisTintValue=l,e.legsTintValue=l,e.armLeftTintValue=l,e.armRightTintValue=l,e.headTintValue=l,e.rearMountTintValue=l,e.weaponTintValue=l,e.secondaryWeaponTintValue=l,e.accessory1TintValue=l,e.accessory2TintValue=l,e.accessory3TintValue=l,e.accessory4TintValue=l;break;default:e[`${a}TintValue`]=l}return ne(Object.assign({},te,e))},children:"APPLY COLOR"}),(0,m.jsx)(da.A,{displayTheme:q?"retro-terminal":"default",unit:{...te,
247imageSize:se.imageSize},name:l.title,setShowPremiumPopupFunc:a,unitPreviewImage:{src:se.previewImg,imageHeight:se.imageSize.height,imageWidth:se.imageSize.width},type:"CUSTOM-PLUS"}),(0,m.jsx)(u.QB,{className:q?"retro-terminal":"default",onClick:function(){const e=`\n MECH\n C-${se.chassis[te.chassisValue].label}\n H-${"NONE"!==te.headValue?se.head[te.headValue].label:"NONE"}\n LA-${"NONE"!==te.armLeftValue?se.leftArm[te.armLeftValue].label:"NONE"}\n RA-${"NONE"!==te.armRightValue?se.rightArm[te.armRightValue].label:"NONE"}\n L-${se.legs[te.legsValue].label}\n R-${"NONE"!==te.rearMountValue?se.rearMount[te.rearMountValue].label:"NONE"}\n P-${te.weaponSelectionValue}\n S-${"NONE"!==te.secondaryWeaponValue?se.secondaryWeapon[te.secondaryWeaponValue].label:"NONE"}\n A1-${"NONE"!==te.accessory1Value?se.accessory[te.accessory1Value].label:"NONE"}\n A2-${"NONE"!==te.accessory2Value?se.accessory[te.accessory2Value].label:"NONE"}\n A3-${"NONE"!==te.accessory3Value?se.accessory[te.accessory3Value].label:"NONE"}\n A4-${"NONE"!==te.accessory4Value?se.accessory[te.accessory4Value].label:"NONE"}\n `,a=[Object.assign({},te,{imageSize:se.imageSize})];return _(Object.assign({variantsArray:a,currentVariant:0,id:`${e}-${Date.now()}`,shadowDetails:se.legs[te.legsValue].shadowDetails,mechCustomPlusUnit:!0,mechLabel:e,imageSize:se.imageSize}))},children:"FABRICATE"})]})]}),X?(0,m.jsx)(ca.A,{displayTheme:q}):null]}):null})})]})};var za=l(931);const Da=t.Ay.div` 248 display: flex; 249 flex-direction: row; 250 justify-content: space-around; 251 align-content: start; 252 align-items: space-around; 253 flex-wrap: wrap; 254 255 overflow-y: scroll; 256 height: 100%; 257 width: 100%; 258`;Da.displayName="FrameListContainer";const Ga=(0,t.Ay)(u.A5)` 259 cursor: pointer; 260 height: 424px; 261 width: 300px; 262 margin-top: 4px; 263 264 label { 265 //Clip Top Right Corner 266 clip-path: polygon(calc(100% - 10px) 0%,100% 10px,100% 100%,0% 100%,0% 0%); 267 max-width: 70%; 268 padding-right: 20px; 269 z-index: 2; 270 position: absolute; 271 bottom: 0; 272 left: 0; 273 } 274 275 img { 276 position: absolute; 277 top: 0; 278 left: 0; 279 width: 300px; 280 height: 424px; 281 z-index: 1; 282 } 283 284 285 border-color: transparent; 286 border-style: solid; 287 border-width: 2px; 288 289 &.default:hover { 290 clip-path: none; 291 border-color: ${e=>e.disabled?"#333":u.fT}; 292 } 293 294 &.retro-terminal:hover { 295 border-color: ${e=>e.disabled?"#666":u.co}; 296 } 297 298 @media only screen and (max-width: ${e=>e.theme.mobileCutoffWidth}px) { 299 width: 254px; 300 301 label { 302 font-size: 0.9em; 303 } 304 } 305`;function Ya(e){let{setShowPremiumPopupFunc:a,setFrameValueFunc:l,partList:s,isPremiumUser:t,isLegendaryUser:n,npcCategory:r,displayTheme:i,isLegendaryCategory:o}=e;const c=s.map((e=>(0,m.jsx)(Ga,{className:i?"retro-terminal":"default",alt:"Select Frame Button",disabled:!1,onClick:()=>{l(e.value)},children:(0,m.jsx)("img",{alt:e.label,src:e.thumbnailImg})},`${e.value}-${e.label}`)));return(0,m.jsx)(Da,{children:c})}Ga.displayName="FramePreview",Ya.defaultProps={isPremiumUser:!1,isLegendaryUser:!1,npcCategory:null,isLegendaryCategory:!1};const Qa=Ya,Ja=`${x.A}/buttons/back_arrow_white.png`,_a=`${x.A}/buttons/Color-Sample-Orb-Glow.png`,Ka=`${x.A}/buttons/Color-Sample-Orb.png`,qa=`${x.A}/buttons/Color-Sample-Square-Glow-18.png`,Za=`${x.A}/buttons/Color-Sample-Square-18.png`,Xa=(0,t.Ay)(n.cw)` 306 align-items: center; 307 overflow-y: unset; 308 justify-content: space-around; 309 margin-right: 10px; 310 311 ${e=>{let{noFrameSelected:a}=e;return a?`\n height: 500px;\n\n @media only screen and (max-width: ${e=>{let{theme:a}=e;return a.tabletCutoffWidth}}px) {\n height: 946px;\n }\n\n @media only screen and (max-width: ${e=>{let{theme:a}=e;return a.mobileCutoffWidth}}px) {\n height: 1177px;\n }\n `:"\n padding: 5px 0 10px;\n block-size: fit-content;\n "}} 312`;Xa.displayName="MechBrandedUnitContainer";const el=(0,t.Ay)(j.A)` 313 max-width: 100%; 314 margin-right: 15px; 315 cursor: pointer; 316 317 &.mech-category { 318 margin-left: 10px; 319 } 320 321 &.hide-image { 322 visibility: hidden; 323 } 324`;el.displayName="MechLogoSprite";const al=U.A.mundaneTier.orb,ll=U.A.mundaneTier.alt,sl="seasonal-category mech-category";const tl=function(e){let{setShowPremiumPopupFunc:a,unitCategory:l}=e;
324const[t,r]=(0,s.useState)(!1),[c,h]=(0,s.useState)(!1),[p,V]=(0,s.useState)(!1),[g,N]=(0,s.useState)(!1),[x,f]=(0,s.useState)(!1),[b,v]=(0,s.useState)(!1),[C,L]=(0,s.useState)(!1),[T,S]=(0,s.useState)(!1),[O,A]=(0,s.useState)(!1),[w,E]=(0,s.useState)(!1),[k,$]=(0,s.useState)(!1),[P,U]=(0,s.useState)(!1),[D,Y]=(0,s.useState)(0),[Q,J]=(0,s.useState)(Object.assign({},JSON.parse(l.partList[0].defaultValues),{frameValue:null,brandValue:l.title}));(0,s.useEffect)((()=>{var e,a;null!==(e=l.partList[null===Q||void 0===Q?void 0:Q.frameValue])&&void 0!==e&&e.label&&(0,he.s)(`unitState-${l.title}-${null===(a=l.partList[null===Q||void 0===Q?void 0:Q.frameValue])||void 0===a?void 0:a.label}`,Q)}),[Q,l]);const{user:_}=(0,s.useContext)(R.x),{addUnit:K,mechBrandedBrandList:q}=(0,s.useContext)(B.UnitContext),{displayTheme:Z}=(0,s.useContext)(F.m),{colorValue:X,displayCustomControls:ee,tintValue:ae,handleColorOptionChange:le,getColorTint:se}=(0,s.useContext)(y.Q),te=_&&_.isPremiumUser,ne=_&&_.isLegendaryUser;if(null===Q.frameValue)return(0,m.jsxs)(n.sc,{className:sl,isExpanded:t,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,children:[(0,m.jsxs)(n.IA,{className:sl,onClick:()=>r(!t),title:l.description,children:[(0,m.jsx)(el,{className:`${sl} ${l.logoImage||`${al} hide-image`}`,alt:"Units Rarity",title:ll}),(0,m.jsx)(n.xA,{alt:l.label,className:sl,children:l.label})]}),(0,m.jsx)(i.A,{children:(0,m.jsx)(Xa,{className:sl,themeBackgroun
324dPrimaryColor:"#FFF",themeBackgroundSecondaryColor:"#FFF",isExpanded:t,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,displayCustomControls:ee,noFrameSelected:!0,children:(0,m.jsx)(Qa,{setShowPremiumPopupFunc:a,setFrameValueFunc:e=>re(e,"frameValue"),partList:l.partList,isPremiumUser:te,isLegendaryUser:ne,displayTheme:Z})})})]});if(c){const e=(0,s.createRef)();return(0,m.jsxs)(n.sc,{className:sl,isExpanded:t,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,children:[(0,m.jsxs)(n.IA,{className:sl,onClick:()=>r(!t),title:l.description,children:[(0,m.jsx)(el,{className:`${sl} ${l.logoImage||`${al} hide-image`}`,alt:"Units Rarity",title:ll}),(0,m.jsx)(n.xA,{alt:l.label,className:sl,children:l.label})]}),(0,m.jsx)(i.A,{children:(0,m.jsx)(Xa,{className:sl,themeBackgroundPrimaryColor:"#FFF",themeBackgroundSecondaryColor:"#FFF",isExpanded:t,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,displayCustomControls:ee,children:(0,m.jsxs)("div",{children:[(0,m.jsx)(u.A5,{className:"default",children:(0,m.jsxs)("label",{htmlFor:"frame-select",onClick:()=>{V(!1),re(null,"frameValue"),Y(0)},style:{cursor:"pointer"},children:[(0,m.jsx)("img",{className:"back",alt:"Back",src:Ja}),"\xa0FRAME SELECT"]})}),(0,m.jsx)("img",{alt:`Full Size Image ${l.partList[Q.frameValue].label}`,src:l.partList[Q.frameValue].fullSizeImg,zipDownloadSrc:l.partList[Q.frameValue].zipDownloadSrc,setShowPremiumPopupFunc:a,isPremiumUser:te,isLegendaryUser:ne,displayTheme:Z,style:{maxWidth:"100%"}}),(0,m.jsxs)(u.OT,{children:[(0,m.jsx)(u.QB,{className:"default",onClick:()=>ne?void h(!1):a(d.$.LEGENDARY),children:"CUSTOMIZE MECH \u25cf\u25cf"}),(0,m.jsx)(u.QB,{className:"default",title:"Includes Mech Spite, COMP/CON PC & NPC .JSON Files",onClick:()=>{e.current.href=l.partList[Q.frameValue].zipDownloadSrc,e.current.click()},children:"DOWNLOAD CHARACTER"}),(0,m.jsx)("a",{ref:e,target:"_blank",download:!0,style:{display:"none"}})]})]})})})]})}function re(e,a){if("frameValue"===a){if(null!==e){var s;const a=(0,he.w)(`unitState-${l.title}-${null===(s=l.partList[e])||void 0===s?void 0:s.label}`);return h(!0),J(a?Object.assign({},a,{frameValue:e,brandValue:l.title}):Object.assign({},JSON.parse(l.partList[e].defaultValues),{frameValue:e,brandValue:l.title}))}return h(!1),J(Object.assign({},{frameValue:e,brandValue:l.title}))}return J(Object.assign({},Q,{[a]:e}))}function ie(e){return J(Object.assign({},Q,e))}const oe=l.partList[Q.frameValue].chassis.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!te||e.isLegendary&&!ne,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),ce=l.partList[Q.frameValue].head.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!te||e.isLegendary&&!ne,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),ue=l.partList[Q.frameValue].rearMount.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!te||e.isLegendary&&!ne,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),de=l.partList[Q.frameValue].weapon[Q.stanceValue].map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!te||e.isLegendary&&!ne,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),me=l.partList[Q.frameValue].secondaryWeapon.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!te||e.isLegendary&&!ne,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),pe=l.partList[Q.frameValue].accessory.map((e=>(0,m.jsx)("option",{value:e.value,disabled:e.isPremium&&!te||e.isLegendary&&!ne,children:`${e.label} ${e.isPlusTwo?"*":""}${e.isPremium?"\u25cf":""}${e.isLegendary?"\u25cf":""}`},`${e.value}-${e.label}`))),Ve=l.partList[Q.frameValue].partList.map(((e,a)=>(0,m.jsx)("option",{value:a,children:e.label},`paint-${e.value}-${e.label}`))),ge=M.A.map(((e,a)=>(0,m.jsx)("option",{value:a,children:e.label},`${e.value}-${e.label}`))),ye=!!l.partList[Q.frameValue].partList[D].isGlow,Ne="number"===typeof p;return(0,m.jsxs)(n.sc,{className:sl,isExpanded:t,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,children:[(0,m.jsxs)(n.IA,{className:sl,onClick:()=>r(!t),title:l.description,children:[(0,m.jsx)(el,{className:`${sl} ${l.logoImage||"hide-image"}`,alt:"Units Rarity",title:ll}),(0,m.jsx)(n.xA,{alt:l.label,className:sl,children:l.label})]}),(0,m.jsx)(i.A,{children:(0,m.jsx)(Xa,{className:sl,themeBackgroun
324dPrimaryColor:Z?l.retroTerminalBackgroundColor:l.themeBackgroundPrimaryColor,themeBackgroundSecondaryColor:Z?l.retroTerminalBackgroundSecondaryColor:l.themeBackgroundSecondaryColor,isExpanded:t,numColumnsVisible:4,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,displayCustomControls:ee,children:t?(0,m.jsxs)(u.sA,{children:[(0,m.jsxs)("div",{className:"options-selectors",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)(u.A5,{className:Z?"retro-terminal":"default",children:(0,m.jsxs)("label",{htmlFor:"frame-select",onClick:()=>{V(!1),re(null,"frameValue"),Y(0)},style:{cursor:"pointer"},children:[(0,m.jsx)("img",{className:"back",alt:"Back",src:Ja}),"\xa0FRAME SELECT"]})}),"\xa0",(0,m.jsx)(G.Ay,{unit:Q,brandList:q,isCoreImageView:p})]}),(0,m.jsxs)(u.A5,{className:Z?"retro-terminal":"default",children:[(0,m.jsx)("label",{style:{cursor:"pointer"},onClick:()=>a(d.$.PLUS_ONE),children:"\u25cf\xa0\xa0\xa0+1 TIER"}),(0,m.jsx)("label",{style:{cursor:"pointer"},onClick:()=>a(d.$.PLUS_TWO),children:"*\xa0\xa0\xa0+2 TIER"}),(0,m.jsx)("label",{style:{cursor:"pointer"},onClick:()=>a(d.$.LEGENDARY),children:"\u25cf\u25cf\xa0LEGEND TIER"})]}),(0,m.jsxs)(u.A5,{className:Z?"retro-terminal":"default",disabled:!ce.length||Ne,children:[(0,m.jsxs)("label",{htmlFor:"head-select",children:[(0,m.jsx)("span",{children:l.partList[Q.frameValue].labels.head}),l.partList[Q.frameValue].partList.filter((e=>"head"===e.value)).length<1||!ce.length||Ne?null:(0,m.jsx)("img",{alt:`${l.partList[Q.frameValue].labels.head} Color Preview`,src:l.partList[Q.frameValue].partList.filter((e=>"head"===e.value))[0].isGlow?qa:Za,className:"part-color-preview",style:{filter:Q.headTintValue}}),(0,m.jsx)(j.A,{className:x?j.B.locked:j.B.unlocked,alt:"Option "+(x?"Locked":"Unlocked"),onClick:()=>f(!x)})]}),(0,m.jsxs)("select",{id:"head-select",name:"head",onChange:e=>{if(l.partList[Q.frameValue].headSpecial)return ie({[l.partList[Q.frameValue].headSpecial]:e.target.value,headValue:e.target.value});if(l.partList[Q.frameValue].headTemplateSpecial){let a={};return l.partList[Q.frameValue].headTemplateSpecial.forEach((l=>{a[l]=e.target.value})),a.headValue=e.target.value,ie(a)}return re(e.target.value,"headValue")},value:Q.headValue,disabled:!ce.length||Ne,children:[l.partList[Q.frameValue].removeNone&&l.partList[Q.frameValue].removeNone.head?null:(0,m.jsx)("option",{value:"NONE",children:"NONE"}),ce]})]}),l.partList[Q.frameValue].rearMountsAreChassis?(0,m.jsxs)(u.A5,{className:Z?"retro-terminal":"default",disabled:!oe.length||Ne,children:[(0,m.jsxs)("label",{htmlFor:"chassis-select",children:[(0,m.jsx)("span",{children:l.partList[Q.frameValue].labels.chassis}),!oe.length||Ne?null:(0,m.jsx)("img",{alt:`${l.partList[Q.frameValue].labels.chassis} Color Preview`,src:l.partList[Q.frameValue].partList.filter((e=>"chassis"===e.value))[0].isGlow?qa:Za,className:"part-color-preview",style:{filter:Q.chassisTintValue}}),(0,m.jsx)(j.A,{className:g?j.B.locked:j.B.unlocked,alt:"Option "+(g?"Locked":"Unlocked"),onClick:()=>N(!g)})]}),(0,m.jsxs)("select",{id:"chassis-select",name:"chassis",onChange:l.partList[Q.frameValue].rearMountsAreChassisSpecial?e=>ie({[l.partList[Q.frameValue].rearMountsAreChassisSpecial]:e.target.value,weaponValue:"NONE",chassisValue:e.target.value}):e=>re(e.target.value,"chassisValue"),value:Q.chassisValue,disabled:!oe.length||Ne,children:[l.partList[Q.frameValue].chassisHasNone?(0,m.jsx)("option",{value:"NONE",children:"NONE"}):null,oe]})]}):(0,m.jsxs)(u.A5,{className:Z?"retro-terminal":"default",disabled:!ue.length||Ne,children:[(0,m.jsxs)("label",{htmlFor:"rear-mount-select",children:[(0,m.jsx)("span",{children:l.partList[Q.frameValue].labels.rearMount}),!ue.length||Ne?null:(0,m.jsx)("img",{alt:`${l.partList[Q.frameValue].labels.rearMount} Color Preview`,src:l.partList[Q.frameValue].partList.filter((e=>"rearMount"===e.value))[0].isGlow?qa:Za,className:"part-color-preview",style:{filter:Q.rearMountTintValue}}),(0,m.jsx)(j.A,{className:T?j.B.locked:j.B.unlocked,alt:"Option "+(T?"Locked":"Unlocked"),onClick:()=>S(!T)})]}),(0,m.jsxs)("select",{id:"rear-mount-select",name:"rear mount",onChange:e=>re(e.target.value,"rearMountValue"),value:Q.rearMountValue,disabled:!ue.length||Ne,children:[l.partList[Q.frameValue].removeNone&&l.partList[Q.frameValue].removeNone.rearMount?null:(0,m.jsx)("option",{value:"NONE",children:"NONE"}),ue]})]}),(0,m.jsxs)(u.A5,{className:Z?"retro-terminal":"default",disabled:!de.length||Ne,children:[(0,m.jsxs)("label",{htmlFor:"weapon-select",children:[(0,m.jsx)("span",{children:l.partList[Q.frameValue].labels.weapon}
324),!de.length||Ne?null:(0,m.jsx)("img",{alt:`${l.partList[Q.frameValue].labels.weapon} Color Preview`,src:l.partList[Q.frameValue].partList.filter((e=>"weapon"===e.value))[0].isGlow?qa:Za,className:"part-color-preview",style:{filter:Q.weaponTintValue}}),(0,m.jsx)(j.A,{className:b?j.B.locked:j.B.unlocked,alt:"Option "+(b?"Locked":"Unlocked"),onClick:()=>v(!b)})]}),(0,m.jsxs)("select",{id:"weapon-select",name:"weapon",onChange:l.partList[Q.frameValue].weaponSpecial?e=>ie({[l.partList[Q.frameValue].weaponSpecial]:e.target.value,weaponValue:e.target.value}):e=>re(e.target.value,"weaponValue"),value:Q.weaponValue,disabled:!de.length||Ne,children:[l.partList[Q.frameValue].removeNone&&l.partList[Q.frameValue].removeNone.weapon?null:(0,m.jsx)("option",{value:"NONE",children:"NONE"}),de]})]}),l.partList[Q.frameValue].secondaryWeaponIsChassisStanceSpecial?(0,m.jsxs)(u.A5,{className:Z?"retro-terminal":"default",disabled:!oe.length||Ne,children:[(0,m.jsxs)("label",{htmlFor:"chassis-select",children:[(0,m.jsx)("span",{children:l.partList[Q.frameValue].labels.chassis}),!oe.length||Ne?null:(0,m.jsx)("img",{alt:`${l.partList[Q.frameValue].labels.chassis} Color Preview`,src:l.partList[Q.frameValue].partList.filter((e=>"chassis"===e.value))[0].isGlow?qa:Za,className:"part-color-preview",style:{filter:Q.chassisTintValue}}),(0,m.jsx)(j.A,{className:g?j.B.locked:j.B.unlocked,alt:"Option "+(g?"Locked":"Unlocked"),onClick:()=>N(!g)})]}),(0,m.jsxs)("select",{id:"chassis-select",name:"chassis",onChange:e=>ie({weaponValue:"0",stanceValue:l.partList[Q.frameValue].chassis[e.target.value].label,chassisValue:e.target.value}),value:Q.chassisValue,disabled:!oe.length||Ne,children:[l.partList[Q.frameValue].chassisHasNone?(0,m.jsx)("option",{value:"NONE",children:"NONE"}):null,oe]})]}):l.partList[Q.frameValue].secondaryWeaponIsAccessory1?(0,m.jsxs)(u.A5,{className:Z?"retro-terminal":"default",disabled:!pe.length||Ne,children:[(0,m.jsxs)("label",{htmlFor:"accessory-1-select",children:[(0,m.jsx)("span",{children:l.partList[Q.frameValue].labels.accessory1}),!pe.length||Ne?null:(0,m.jsx)("img",{alt:`${l.partList[Q.frameValue].labels.accessory1} Color Preview`,src:l.partList[Q.frameValue].partList.filter((e=>"accessory1"===e.value))[0].isGlow?qa:Za,className:"part-color-preview",style:{filter:Q.accessory1TintValue}}),(0,m.jsx)(j.A,{className:O?j.B.locked:j.B.unlocked,alt:"Option "+(O?"Locked":"Unlocked"),onClick:()=>A(!O)})]}),(0,m.jsxs)("select",{id:"accessory-1-select",name:"accessory1",onChange:e=>re(e.target.value,"accessory1Value"),value:Q.accessory1Value,disabled:!pe.length||Ne,children:[l.partList[Q.frameValue].removeNone&&l.partList[Q.frameValue].removeNone.accessory1?null:(0,m.jsx)("option",{value:"NONE",children:"NONE"}),pe]})]}):(0,m.jsxs)(u.A5,{className:Z?"retro-terminal":"default",disabled:!me.length||Ne,children:[(0,m.jsxs)("label",{htmlFor:"secondary-weapon-select",children:[(0,m.jsx)("span",{children:l.partList[Q.frameValue].labels.secondaryWeapon}),!me.length||Ne?null:(0,m.jsx)("img",{alt:`${l.partList[Q.frameValue].labels.secondaryWeapon} Color Preview`,src:l.partList[Q.frameValue].partList.filter((e=>"secondaryWeapon"===e.value))[0].isGlow?qa:Za,className:"part-color-preview",style:{filter:Q.secondaryWeaponTintValue}}),(0,m.jsx)(j.A,{className:C?j.B.locked:j.B.unlocked,alt:"Option "+(C?"Locked":"Unlocked"),onClick:()=>L(!C)})]}),(0,m.jsxs)("select",{id:"secondary-weapon-select",name:"secondary weapon",onChange:e=>{l.partList[Q.frameValue].secondaryWeaponSpecial?ie({[l.partList[Q.frameValue].secondaryWeaponSpecial]:e.target.value,secondaryWeaponValue:e.target.value}):re(e.target.value,"secondaryWeaponValue")},value:Q.secondaryWeaponValue,disabled:!me.length||Ne,children:[l.partList[Q.frameValue].removeNone&&l.partList[Q.frameValue].removeNone.secondaryWeapon?null:(0,m.jsx)("option",{value:"NONE",children:"NONE"}),me]})]}),l.partList[Q.frameValue].accessory1IsSecondaryWeapon?(0,m.jsxs)(u.A5,{className:Z?"retro-terminal":"default",disabled:!me.length||Ne,children:[(0,m.jsxs)("label",{htmlFor:"secondary-weapon-select",children:[(0,m.jsx)("span",{children:l.partList[Q.frameValue].labels.secondaryWeapon}),!me.length||Ne?null:(0,m.jsx)("img",{alt:`${l.partList[Q.frameValue].labels.secondaryWeapon} Color Preview`,src:l.partList[Q.frameValue].partList.filter((e=>"secondaryWeapon"===e.value))[0].isGlow?qa:Za,className:"part-color-preview",style:{filter:Q.secondaryWeaponTintValue}}),(0,m.jsx)(j.A,{className:C?j.B.locked:j.B.unlocked,alt:"Option "+(C?"Locked":"Unlocked"),onClick:()=>L(!C)})]}),(0,m.jsxs)("select",{id:"secondary-weapon-select",name:"secondary weapon",onChange:e=>re(e.target.value,"secondaryWeaponValue"),value:Q.secondaryWeaponValue,disabled:!me.length||Ne,children:[l.partList[Q.frameValue].removeNone&&l.partList[Q.frameValue].removeNone.secondaryWeapon?null:(0,m.jsx)("option",{value:"NONE",children:"NONE"}),me]})]}):(0,m.jsxs)(u.A5,{className:Z?"retro-terminal":"default",disabled:!pe.length||Ne,children:[(0,m.jsxs)("label",{htmlFor:"accessory-1-select",children:[(0,m.jsx)("span",{children:l.partList[Q.frameValue].labels.accessory1}),!pe.length||Ne?null:(0,m.jsx)("img",{alt:`${l.partList[Q.frameValue].labels.accessory1} Color Preview`,src:l.partList[Q.frameValue].partList.filter((e=>"accessory1"===e.value))[0].isGlow?qa:Za,className:"part-color-preview",style:{filter:Q.accessory1TintValue}}),(0,m.jsx)(j.A,{className:O?j.B.locked:j.B.unlocked,alt:"Option "+(O?"Locked":"Unlocked"),onClick:()=>A(!O)})]}),(0,m.jsxs)("select",{id:"accessory-1-select",name:"accessory1",onChange:e=>re(e.target.value,"accessory1Value"),value:Q.accessory1Value,disabled:!pe.length||Ne,children:[l.partList[Q.frameValue].removeNone&&l.partList[Q.frameValue].removeNone.accessory1?null:(0,m.jsx)("option",{value:"NONE",children:"NONE"}),pe]})]}),l.partList[Q.frameValue].accessory2IsChassis?(0,m.jsxs)(u.A5,{className:Z?"retro-terminal":"default",disabled:!oe.length||Ne,children:[(0,m.jsxs)("label",{htmlFor:"chassis-select",children:[(0,m.jsx)("span",{children:l.partList[Q.frameValue].labels.chassis}),!oe.length||Ne?null:(0,m.jsx)("img",{alt:`${l.partList[Q.frameValue].labels.chassis} Color Preview`,src:l.partList[Q.frameValue].partList.filter((e=>"chassis"===e.value))[0].isGlow?qa:Za,className:"part-color-preview",style:{filter:Q.chassisTintValue}}),(0,m.jsx)(j.A,{className:g?j.B.locked:j.B.unlocked,alt:"Option "+(g?"Locked":"Unlocked"),onClick:()=>N(!g)})]}),(0,m.jsxs)("select",{id:"chassis-select",name:"chassis-select",onChange:e=>re(e.target.value,"chassisValue"),value:Q.chassisValue,disabled:!oe.length||Ne,children:[l.partList[Q.frameValue].chassisHasNone?(0,m.jsx)("option",{value:"NONE",children:"NONE"}):null,oe]})]}):(0,m.jsxs)(u.A5,{className:Z?"retro-terminal":"default",disabled:!pe.length||Ne,children:[(0,m.jsxs)("label",{htmlFor:"accessory-2-select",children:[(0,m.jsx)("span",{children:l.partList[Q.frameValue].labels.accessory2}),!pe.length||Ne?null:(0,m.jsx)("img",{alt:`${l.partList[Q.frameValue].labels.accessory2} Color Preview`,src:l.partList[Q.frameValue].partList.filter((e=>"accessory2"===e.value))[0].isGlow?qa:Za,className:"part-color-preview",style:{filter:Q.accessory2TintValue}}),(0,m.jsx)(j.A,{className:w?j.B.locked:j.B.unlocked,alt:"Option "+(w?"Locked":"Unlocked"),onClick:()=>E(!w)})]}),(0,m.jsxs)("select",{id:"accessory-2-select",name:"accessory2",onChange:e=>re(e.target.value,"accessory2Value"),value:Q.accessory2Value,disabled:!pe.length||Ne,children:[l.partList[Q.frameValue].removeNone&&l.partList[Q.frameValue].removeNone.accessory2?null:(0,m.jsx)("option",{value:"NONE",children:"NONE"}),pe]})]}),(0,m.jsxs)(u.A5,{className:Z?"retro-terminal":"default",disabled:!pe.length||Ne,children:[(0,m.jsxs)("label",{htmlFor:"accessory-3-select",children:[(0,m.jsx)("span",{children:l.partList[Q.frameValue].labels.accessory3}),!pe.length||Ne?null:(0,m.jsx)("img",{alt:`${l.partList[Q.frameValue].labels.accessory3} Color Preview`,src:l.partList[Q.frameValue].partList.filter((e=>"accessory3"===e.value))[0].isGlow?qa:Za,className:"part-color-preview",style:{filter:Q.accessory3TintValue}}),(0,m.jsx)(j.A,{className:k?j.B.locked:j.B.unlocked,alt:"Option "+(k?"Locked":"Unlocked"),onClick:()=>$(!k)})]}),(0,m.jsxs)("select",{id:"accessory-3-select",name:"accessory3",onChange:e=>re(e.target.value,"accessory3Value"),value:Q.accessory3Value,disabled:!pe.length||Ne,children:[l.partList[Q.frameValue].removeNone&&l.partList[Q.frameValue].removeNone.accessory3?null:(0,m.jsx)("option",{value:"NONE",children:"NONE"}),pe]})]}),(0,m.jsxs)(u.A5,{className:Z?"retro-terminal":"default",disabled:!pe.length||Ne,children:[(0,m.jsxs)("label",{htmlFor:"accessory-4-select",children:[(0,m.jsx)("span",{children:l.partList[Q.frameValue].labels.accessory4}),!pe.length||Ne?null:(0,m.jsx)("img",{alt:`${l.partList[Q.frameValue].labels.accessory4} Color Preview`,src:l.partList[Q.frameValue].partList.filter((e=>"accessory4"===e.value))[0].isGlow?qa:Za,className:"part-color-preview",style:{filter:Q.accessory4TintValue}}),(0,m.jsx)(j.A,{className:P?j.B.locked:j.B.unlocked,alt:"Option "+(P?"L
324ocked":"Unlocked"),onClick:()=>U(!P)})]}),(0,m.jsxs)("select",{id:"accessory-4-select",name:"accessory4",onChange:e=>re(e.target.value,"accessory4Value"),value:Q.accessory4Value,disabled:!pe.length||Ne,children:[l.partList[Q.frameValue].removeNone&&l.partList[Q.frameValue].removeNone.accessory4?null:(0,m.jsx)("option",{value:"NONE",children:"NONE"}),pe]})]}),(0,m.jsxs)(u.A5,{className:Z?"retro-terminal":"default",disabled:Ne,children:[(0,m.jsx)("label",{htmlFor:"color-select",children:"COLOR"}),(0,m.jsx)("select",{id:"color-select",name:"color",onChange:le,value:X,disabled:Ne,children:ge}),(0,m.jsx)(I.A,{tintValue:ae,src:ye?_a:Ka,alt:"paint-preview"})]}),(0,m.jsxs)(u.A5,{className:Z?"retro-terminal":"default",disabled:Ne,children:[(0,m.jsx)("label",{htmlFor:"part-select",children:"COLOR TARGET"}),(0,m.jsx)("select",{id:"part-select",name:"part",onChange:e=>Y(e.target.value),value:D,disabled:Ne,children:Ve})]})]}),(0,m.jsxs)("div",{className:"display-controls",children:[(0,m.jsx)(o.A,{onContextMenu:e=>e.preventDefault(),imageSize:l.partList[Q.frameValue].imageSize,children:(0,m.jsx)(H.A,{children:(0,m.jsx)(za.A,{unit:Ne?Object.assign({},Q,{viewCoreImage:p}):Q,brandList:q,isInCategory:!0})})}),(0,m.jsxs)(u.OT,{children:[(0,m.jsx)(u.QB,{className:Z?"retro-terminal":"default",onClick:function(){return N(!1),f(!1),v(!1),L(!1),S(!1),A(!1),E(!1),$(!1),U(!1),V(!1),J(Object.assign({},JSON.parse(l.partList[Q.frameValue].defaultValues),{frameValue:Q.frameValue,brandValue:l.title}))},children:"RESET"}),(0,m.jsx)(u.QB,{className:Z?"retro-terminal":"default",onClick:function(){const e=l.partList[Q.frameValue].secondaryWeaponIsChassisStanceSpecial,a=l.partList[Q.frameValue].hasMultipleStances;let s,t="1H",n=l.partList[Q.frameValue].chassis.filter((e=>!e.isPremium)).length;e&&(s=(0,W.nd)(0,n-1),t=l.partList[Q.frameValue].chassis[s].label),a&&(t=(0,W.nd)(0,Object.keys(l.partList[Q.frameValue].weapon).length-1));let r=l.partList[Q.frameValue].head.filter((e=>!e.isPremium)).length,i=l.partList[Q.frameValue].rearMount.filter((e=>!e.isPremium)).length,o=l.partList[Q.frameValue].weapon[t].filter((e=>!e.isPremium)).length,c=l.partList[Q.frameValue].secondaryWeapon.filter((e=>!e.isPremium)).length,u=l.partList[Q.frameValue].accessory.filter((e=>!e.isPremium)).length;te&&(n=l.partList[Q.frameValue].chassis.filter((e=>!e.isLegendary)).length,r=l.partList[Q.frameValue].head.filter((e=>!e.isLegendary)).length,i=l.partList[Q.frameValue].rearMount.filter((e=>!e.isLegendary)).length,o=l.partList[Q.frameValue].weapon[t].filter((e=>!e.isLegendary)).length,c=l.partList[Q.frameValue].secondaryWeapon.filter((e=>!e.isLegendary)).length,u=l.partList[Q.frameValue].accessory.filter((e=>!e.isLegendary)).length),ne&&(n=l.partList[Q.frameValue].chassis.length,r=l.partList[Q.frameValue].head.length,i=l.partList[Q.frameValue].rearMount.length,o=l.partList[Q.frameValue].weapon[t].length,c=l.partList[Q.frameValue].secondaryWeapon.length,u=l.partList[Q.frameValue].accessory.length),e||(s=(0,W.nd)(0,n-1));const d={chassisValue:s,headValue:r?(0,W.nd)(0,r-1):"NONE",rearMountValue:i&&(0,W.nd)(0,1)?(0,W.nd)(0,i-1):"NONE",weaponValue:o&&(0,W.nd)(0,1)?(0,W.nd)(0,o-1):"NONE",secondaryWeaponValue:c&&(0,W.nd)(0,1)?(0,W.nd)(0,c-1):"NONE",accessory1Value:u&&(0,W.nd)(0,1)?(0,W.nd)(0,u-1):"NONE",accessory2Value:u>1&&(0,W.nd)(0,1)?(0,W.nd)(0,u-1):"NONE",accessory3Value:u>1&&(0,W.nd)(0,1)?(0,W.nd)(0,u-1):"NONE",accessory4Value:u>1&&(0,W.nd)(0,1)?(0,W.nd)(0,u-1):"NONE",stanceValue:t,brandValue:l.title};return l.partList[Q.frameValue].removeNone&&("NONE"===d.chassisValue&&l.partList[Q.frameValue].removeNone.chassis&&(d.chassisValue=0),"NONE"===d.headValue&&l.partList[Q.frameValue].removeNone.head&&(d.headValue=0),"NONE"===d.rearMountValue&&l.partList[Q.frameValue].removeNone.rearMount&&(d.rearMountValue=0),"NONE"===d.weaponValue&&l.partList[Q.frameValue].removeNone.weapon&&(d.weaponValue=0),"NONE"===d.secondaryWeaponValue&&l.partList[Q.frameValue].removeNone.secondaryWeapon&&(d.secondaryWeaponValue=0),"NONE"===d.accessory1Value&&l.partList[Q.frameValue].removeNone.accessory&&(d.accessory1Value=0),"NONE"===d.accessory2Value&&l.partList[Q.frameValue].removeNone.accessory&&(d.accessory2Value=0),"NONE"===d.accessory3Value&&l.partList[Q.frameValue].removeNone.accessory&&(d.accessory3Value=0),"NONE"===d.accessory4Value&&l.partList[Q.frameValue].removeNone.accessory&&(d.accessory4Value=0)),g&&delete d.chassisValue,x&&delete d.headValue,b&&delete d.weaponValue,C&&delete d.secondaryWeaponValue,T&&delete d.rearMountValue,O&&delete d.accessory1Value,w&&delete d.accessory2Value,k&&delete d.accessory3Value,P&&delete d.accessory4Value,J(Object.assign({},Q,d))},disabled:Ne,children:"RANDOM"}),l.partList[Q.frameValue].coreImg?(0,m.jsx)(u.QB,{className:Z?"retro-terminal":"default",onClick:()=>{!1===p?V(0):p+1<l.partList[Q.frameValue].coreImg.length?V(p+1):V(!1)},children:`CORE VER. ${l.partList[Q.frameValue].coreImg.map(((e,a)=>p===a?"\u25a3":"\u2610")).join(" ")}`}):(0,m.jsx)(u.R2,{}),(0,m.jsx)(da.A,{displayTheme:Z?"retro-terminal":"default",unit:{...Q,imageSize:l.partList[Q.frameValue].imageSize},unitPreviewImage:{src:Ne?l.partList[Q.frameValue].coreImg[p].src:l.partList[Q.frameValue].previewImg,imageHeight:l.partList[Q.frameValue].imageSize.height,imageWidth:l.partList[Q.frameValue].imageSize.width,title:Ne?l.partList[Q.frameValue].coreImg[p].originalArtCredit.title:null},name:`${l.title}-${l.partList[Q.frameValue].label}`,type:"BRANDED",setShowPremiumPopupFunc:a,isCoreImageView:p}),(0,m.jsx)(u.QB,{className:Z?"retro-terminal":"default",onClick:function(){const e={},a=l.partList[Q.frameValue].partList[D].value;let s=se();switch(a){case"BODY":e.chassisTintValue=s,e.headTintValue=s;break;case"WEAPONS":e.weaponTintValue=s,e.secondaryWeaponTintValue=s;break;case"ACCESSORIES":e.accessory1TintValue=s,e.accessory2TintValue=s,e.accessory3TintValue=s,e.accessory4TintValue=s;break;case"ALL":e.chassisTintValue=s,e.headTintValue=s,e.rearMountTintValue=s,e.weaponTintValue=s,e.secondaryWeaponTintValue=s,e.accessory1TintValue=s,e.accessory2TintValue=s,e.accessory3TintValue=s,e.accessory4TintValue=s;break;default:e[`${a}TintValue`]=s}return J(Object.assign({},Q,e))},disabled:Ne,children:"APPLY COLOR"}),(0,m.jsx)(u.QB,{className:Z?"retro-terminal":"default",onClick:function(){const e=`MECH ${l.t
324itle} ${l.partList[Q.frameValue].label}`,a=[Object.assign({},Q,{imageSize:l.partList[Q.frameValue].imageSize,viewCoreImage:p})];let s="NONE"!==Q.chassisValue?l.partList[Q.frameValue].chassis[Q.chassisValue].shadowDetails:{size:z.O7.NONE,bottom:"0px",right:"0px"};return l.partList[Q.frameValue].rearMountsAreLegs&&(s=l.partList[Q.frameValue].rearMount[Q.rearMountValue].shadowDetails),K(Object.assign({variantsArray:a,currentVariant:0,id:`${e}-${Date.now()}`,shadowDetails:s,brandedMechUnit:!0,mechLabel:e,imageSize:l.partList[Q.frameValue].imageSize}))},children:"FABRICATE"})]})]}),ee?(0,m.jsx)(ca.A,{displayTheme:Z,targetPartIsGlow:ye}):null]}):null})})]})},nl=`${x.A}/buttons/d-arrow.png`,rl=t.Ay.div` 325 position: absolute; 326 display: flex; 327 flex-direction: column; 328 flex-wrap: wrap; 329 width: 258px; 330 margin-top: 125px; 331 margin-left: 2px; 332 z-index: 100; 333 334 div { 335 background: #FFF; 336 color: #000; 337 font-weight: bold; 338 padding: 10px 0px; 339 text-align: center; 340 width: 100%; 341 font-family: Arial, Helvetica, sans-serif; 342 343 &:first-child { 344 border-top-width: 2px; 345 } 346 &:last-child { 347 border-bottom-width: 2px; 348 } 349 } 350`;rl.displayName="FilterListWrapper";const il=(0,t.Ay)(Ae.tI)` 351 display: flex; 352 flex-direction: row; 353 gap: 10px 10px; 354 flex-wrap: wrap; 355 356 input { 357 font-weight: bold; 358 font-size: unset; 359 color: #000; 360 background: #FFF; 361 border: none; 362 margin-left: 5px; 363 font-family: Arial, Helvetica, sans-serif; 364 } 365`;il.displayName="MechTypeAheadContainer";const ol=(0,t.Ay)(u.A5)` 366 select { 367 border-color: #FFF; 368 border-style: solid; 369 border-width: 2px; 370 background: ${`url(${nl})`} right center no-repeat; 371 background-color: ${u.fT}; 372 color: #FFF; 373 } 374 375 option { 376 color: #000; 377 background: #FFF; 378 } 379`;ol.displayName="MechSelectDropdown";const cl=(0,t.Ay)(Ae.U7)` 380 background: #666; 381 font-family: Arial, Helvetica, sans-serif; 382 border: none; 383 384 //Clip Top Left & Bottom Right Corner 385 clip-path: polygon(7px 0%,100% 0%,100% calc(100% - 7px),calc(100% - 7px) 100%,0% 100%,0% 7px); 386`,ul=(0,t.Ay)(n.cw)` 387 height: 640px; 388`;function dl(e){let{filterText:a,removeFilterFunc:l}=e;return(0,m.jsx)(cl,{onClick:l,children:`${a.toUpperCase()} X`})}cl.displayName="MechFilterChipDiv";const ml=function(e){let{setShowPremiumPopupFunc:a,unitCategory:l}=e;const[t,r]=(0,s.useState)(!1),[o,c]=(0,s.useState)(6),[u,d]=(0,s.use
388State)(l.defaultFilter||[]),[h,p]=(0,s.useState)(""),[V,g]=(0,s.useState)([]),[y,N]=(0,s.useState)([]),[x,f]=(0,s.useState)([]),[b,v]=(0,s.useState)([]),[C,L]=(0,s.useState)([]),[T,S]=(0,s.useState)(!1),[O,A]=(0,s.useState)(1),w=(0,s.useRef)(null);let E=(0,s.useRef)(null);(0,s.useEffect)((()=>{g(we(l.unitList)),N(Ee(l.unitList,"variant")),f(Ee(l.unitList,"unitNumber")),v(Ee(l.unitList,"dateAdded")),L(Ee(l.unitList,"tags"))}),[l.unitList]);const k=V.filter((e=>!u.includes(e))).filter((e=>0!==h.trim().length&&e.toLowerCase().includes(h.trim().toLowerCase()))).slice(0,5).map((e=>(0,m.jsx)("div",{onClick:()=>(A(1),T?d(u.concat(e)):(d([e]),S(!0)),p("")),children:e.toUpperCase()},e))),$=u.map((e=>(0,m.jsx)(dl,{filterText:e,removeFilterFunc:()=>(A(1),d(u.filter((a=>a!==e))))},e))),P=ke(l.unitList,u),R=P.slice(0,15*O);let B="seasonal-category mech-category";return Oe(w,E,(function(){P.length>=15*O&&A(O+1)})),(0,m.jsxs)(n.sc,{className:B,isExpanded:t,numColumnsVisible:o,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,children:[(0,m.jsx)(n.IA,{onClick:()=>r(!t),children:(0,m.jsx)(n.xA,{alt:l.label,className:B,children:l.label})}),t?(0,m.jsxs)(Ae.ug,{children:[(0,m.jsxs)(il,{children:[(0,m.jsx)(ol,{children:(0,m.jsxs)("select",{id:"name-select",name:"name-filters",value:"",onChange:e=>{A(1),T?d(u.concat(e.target.value)):(d([e.target.value]),S(!0))},children:[(0,m.jsx)("option",{value:"",defaultValue:!0,disabled:!0,hidden:!0,children:"NAME"}),y.map((e=>(0,m.jsx)("option",{value:e,children:e.toUpperCase().substring(0,20)},`name-${e}`)))]})}),(0,m.jsx)(ol,{children:(0,m.jsxs)("select",{id:"author-select",name:"author-filters",value:"",onChange:e=>{A(1),T?d(u.concat(e.target.value)):(d([e.target.value]),S(!0))},children:[(0,m.jsx)("option",{value:"",defaultValue:!0,disabled:!0,hidden:!0,children:"AUTHOR"}),x.map((e=>(0,m.jsx)("option",{value:e,children:e.toUpperCase().substring(0,20)},`author-${e}`)))]})}),(0,m.jsx)(ol,{children:(0,m.jsxs)("select",{id:"date-select",name:"date-filters",value:"",onChange:e=>{A(1),T?d(u.concat(e.target.value)):(d([e.target.value]),S(!0))},children:[(0,m.jsx)("option",{value:"",defaultValue:!0,disabled:!0,hidden:!0,children:"DATE"}),b.map((e=>(0,m.jsx)("option",{value:e,children:e.toUpperCase()},`date-${e}`)))]})}),(0,m.jsx)(ol,{children:(0,m.jsxs)("select",{id:"tag-select",name:"tag-filters",onChange:e=>{A(1),T?d(u.concat(e.target.value)):(d([e.target.value]),S(!0))},value:"",children:[(0,m.jsx)("option",{value:"",defaultValue:!0,disabled:!0,hidden:!0,children:"TAG"}),C.map((e=>(0,m.jsx)("option",{value:e,children:e.toUpperCase()},`tag-${e}`)))]})}),(0,m.jsx)("input",{value:h,onChange:e=>p(e.target.value.toUpperCase()),maxLength:18,placeholder:"INSERT QUERY"}),k.length?(0,m.jsx)(rl,{children:k}):null,(0,m.jsx)(Te.n3,{className:j.B.clearAllInactive,onClick:()=>{d([]),p(""),S(!0)},role:"button",title:"Clear All Filters"})]}),(0,m.jsx)(Ae.vH,{}),$]}):null,(0,m.jsxs)(i.A,{children:[(0,m.jsx)(ul,{className:B,themeBackgroun
388dPrimaryColor:l.themeBackgroundPrimaryColor,themeBackgroundSecondaryColor:l.themeBackgroundSecondaryColor,isExpanded:t,numColumnsVisible:o,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,ref:w,children:t?R.map(((e,t)=>(0,m.jsxs)(s.Fragment,{children:[l.isZipCategory?(0,m.jsx)(Me,{setShowPremiumPopupFunc:a,shadowDetails:e.shadowDetails,variantsArray:e.variants}):(0,m.jsx)(Se.A,{setShowPremiumPopupFunc:a,shadowDetails:e.shadowDetails,variantsArray:e.variants},`${l.title}-${t}-unit.variants[0].src`),t===R.length-1?(0,m.jsx)("div",{ref:E},`${l.title}-intersection-observer`):null]},`${l.title}-${t}`))):null}),(0,m.jsx)(n.mi,{onClick:()=>c(6===o?3:o+1),isExpanded:t,className:6===o?j.B.lArrow:j.B.rArrow,alt:6===o?"Reset View Size":"Expand View Size",title:6===o?"Reset View Size":"Expand View Size"})]})]})};var hl=l(1204);const pl=`${x.A}/buttons/r-arrow.png`;function Vl(e){let{unitCategory:a,isMechParent:l,...t}=e;const[r,i]=(0,s.useState)(!1);return l?(0,m.jsxs)("div",{children:[(0,m.jsx)(n.sc,{className:"parent-category mech-category",isExpanded:r,borderPrimaryColor:a.borderPrimaryColor,borderSecondaryColor:a.borderSecondaryColor,children:(0,m.jsxs)(n.IA,{className:"mech-category",onClick:()=>i(!r),title:a.description,children:[(0,m.jsx)(n.I1,{className:"mech-category hide-image",src:pl,alt:"Parent Category",title:"Click to show sub-categories"}),(0,m.jsx)(n.xA,{alt:a.label,className:"mech-category",children:a.label})]})}),r?t.children:null]}):(0,m.jsxs)("div",{children:[(0,m.jsx)(n.sc,{className:"parent-category",isExpanded:r,borderPrimaryColor:a.borderPrimaryColor,borderSecondaryColor:a.borderSecondaryColor,children:(0,m.jsxs)(n.IA,{onClick:()=>i(!r),title:a.description,children:[(0,m.jsx)(n.xA,{children:a.title}),(0,m.jsx)(D.A,{isExpanded:r,image:r?a.activeImage:a.inactiveImage,alt:a.title})]})}),r?t.children:null]})}Vl.defaultProps={isMechParent:!1};const gl=Vl,yl=(0,t.Ay)(u.A5)` 389 visibility: hidden; 390 391 ${o.A}:hover & { 392 visibility: visible; 393 } 394`;const Nl=function(e){var a,l,t,n,r;let{setShowPremiumPopupFunc:i,variantsArray:o,isFantasy:c=!1,isFree:u=!0}=e;
394const[d,h]=(0,s.useState)(!0),{user:p}=(0,s.useContext)(R.x),V=p&&p.isPremiumUser,g=p&&p.isLegendaryUser;let y=o[0].src;return o[0].legendary?g||(y=o[0].previewSrc):o[0].previewSrc&&(V||(y=o[0].previewSrc)),(0,m.jsxs)(Be,{onContextMenu:e=>e.preventDefault(),imageSize:(null===(a=o[0])||void 0===a?void 0:a.imageSize)||{height:o[0].height,width:o[0].width},isExtraSmall:o[0].isExtraSmall,children:[(0,m.jsxs)(Fe,{children:[d?(0,m.jsx)(Re.A,{}):null,(0,m.jsx)($e.zs,{src:y,alt:`${o[0].filePrefix}${o[0].unitNumber}-${o[0].variant}`,height:o[0].height,width:o[0].width,onLoad:()=>h(!1)})]}),(0,m.jsx)(Fe,{children:(0,m.jsx)(Pe.A,{unit:o[0],setShowPremiumPopupFunc:i,isFree:u,isZIP:!0,isDirectDownload:!0})}),o[0].longDescription?null:(0,m.jsx)(Fe,{children:(0,m.jsx)(yl,{className:c?"fantasy":"default",disabled:!1,children:(0,m.jsx)("label",{className:"long-text-display",htmlFor:"weapon-select",title:`Added on ${o[0].dateAdded}${null!==(l=o[0])&&void 0!==l&&null!==(t=l.tags)&&void 0!==t&&t.length?`\nTags: ${null===(n=o[0])||void 0===n||null===(r=n.tags)||void 0===r?void 0:r.join(", ")}`:""}`,children:`${o[0].variant} from ${o[0].unitNumber}`})})})]})};const xl=function(e){let{setShowPremiumPopupFunc:a,unitCategory:l}=e;const{user:t}
394=(0,s.useContext)(R.x),[r,o]=(0,s.useState)(!1),[c,u]=(0,s.useState)(6),[h,p]=(0,s.useState)(l.defaultFilter||[]),[V,g]=(0,s.useState)(""),[y,N]=(0,s.useState)([]),[x,f]=(0,s.useState)([]),[b,v]=(0,s.useState)([]),[C,L]=(0,s.useState)(!1),[T,S]=(0,s.useState)(1),O=(0,s.useRef)(null),A=t&&t.isLegendaryUser;let w=(0,s.useRef)(null);(0,s.useEffect)((()=>{N(we(l.unitList)),f(Ee(l.unitList,"tags")),v(Ee(l.unitList,"unitNumber"))}),[l.unitList]);const E=y.filter((e=>!h.includes(e))).filter((e=>0!==V.trim().length&&e.toLowerCase().includes(V.trim().toLowerCase()))).slice(0,5).map((e=>(0,m.jsx)("div",{onClick:()=>(S(1),C?p(h.concat(e)):(p([e]),L(!0)),g("")),children:e.toUpperCase()},e))),k=h.map((e=>(0,m.jsx)(dl,{filterText:e,removeFilterFunc:()=>(S(1),p(h.filter((a=>a!==e))))},e))),$=ke(l.unitList,h),P=$.slice(0,15*T);let B="seasonal-category mech-category";return Oe(O,w,(function(){$.length>=15*T&&S(T+1)})),(0,m.jsxs)(n.sc,{className:B,isExpanded:r,numColumnsVisible:c,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,children:[(0,m.jsx)(n.IA,{onClick:()=>{if(!A)return a(d.$.LEGENDARY);o(!r)},children:(0,m.jsx)(n.xA,{alt:l.label,className:B,children:l.label})}),r?(0,m.jsxs)(Ae.ug,{children:[(0,m.jsxs)(il,{children:[(0,m.jsx)(ol,{children:(0,m.jsxs)("select",{id:"name-select",name:"name-filters",value:"",onChange:e=>{S(1),C?p(h.concat(e.target.value)):(p([e.target.value]),L(!0))},children:[(0,m.jsx)("option",{value:"",defaultValue:!0,disabled:!0,hidden:!0,children:"CATEGORY"}),x.map((e=>(0,m.jsx)("option",{value:e,children:e.toUpperCase().substring(0,20)},`name-${e}`)))]})}),(0,m.jsx)(ol,{children:(0,m.jsxs)("select",{id:"author-select",name:"author-filters",value:"",onChange:e=>{S(1),C?p(h.concat(e.target.value)):(p([e.target.value]),L(!0))},children:[(0,m.jsx)("option",{value:"",defaultValue:!0,disabled:!0,hidden:!0,children:"FRAME"}),b.map((e=>(0,m.jsx)("option",{value:e,children:e.toUpperCase().substring(0,20)},`author-${e}`)))]})}),(0,m.jsx)("input",{value:V,onChange:e=>g(e.target.value.toUpperCase()),maxLength:18,placeholder:"INSERT QUERY"}),E.length?(0,m.jsx)(rl,{children:E}):null,(0,m.jsx)(Te.n3,{className:j.B.clearAllInactive,onClick:()=>{p([]),g(""),L(!0)},role:"button",title:"Clear All Filters"})]}),(0,m.jsx)(Ae.vH,{}),k]}):null,(0,m.jsxs)(i.A,{children:[(0,m.jsx)(ul,{className:B,themeBackgroun
394dPrimaryColor:l.themeBackgroundPrimaryColor,themeBackgroundSecondaryColor:l.themeBackgroundSecondaryColor,isExpanded:r,numColumnsVisible:c,borderPrimaryColor:l.borderPrimaryColor,borderSecondaryColor:l.borderSecondaryColor,ref:O,children:r?P.map(((e,t)=>(0,m.jsxs)(s.Fragment,{children:[l.isZipCategory?(0,m.jsx)(Nl,{setShowPremiumPopupFunc:a,shadowDetails:e.shadowDetails,variantsArray:e.variants}):(0,m.jsx)(Se.A,{setShowPremiumPopupFunc:a,shadowDetails:e.shadowDetails,variantsArray:e.variants},`${l.title}-${t}-unit.variants[0].src`),t===P.length-1?(0,m.jsx)("div",{ref:w},`${l.title}-intersection-observer`):null]},`${l.title}-${t}`))):null}),(0,m.jsx)(n.mi,{onClick:()=>u(6===c?3:c+1),isExpanded:r,className:6===c?j.B.lArrow:j.B.rArrow,alt:6===c?"Reset View Size":"Expand View Size",title:6===c?"Reset View Size":"Expand View Size"})]})]})},fl=`${x.A}/background/noai.gif`,bl=t.Ay.div` 395 margin-right: auto; 396 padding-bottom: 40px; 397 position: relative; 398 text-align: center; 399 width: 230px; 400 min-width: 230px; 401 z-index: 20; 402 403 @media only screen and (max-width: ${e=>e.theme.mobileCutoffWidth}px) { 404 margin-right: 0; 405 margin-left: auto; 406 width: 100%; 407 padding-bottom: 100px; 408 } 409 410 @media print { 411 display: none; 412 } 413`;bl.displayName="UnitCategoriesWrapper";const vl=t.Ay.img` 414 position: fixed; 415 bottom: 10px; 416 left: 0; 417 z-index: -100; 418 filter: drop-shadow(-3px 3px 3px #000); 419 420 @media only screen and (max-width: ${e=>e.theme.tabletCutoffWidth}px) { 421 display: none; 422 } 423`;vl.displayName="BackgroundStaticStickyAnimation";const jl=function(e){let{...a}=e;const[l,t]=(0,s.useState)(!1),{currentSide:r}=(0,s.useContext)(F.m),{unitCategories:i,unitSearchCategory:o}=(0,s.useContext)(B.UnitContext),c=i.filter((e=>"mech"===r?e.mechCustomCategory||e.mechCustomSagCategory||e.mechCustomPilotCategory||e.mechCustomPlusCategory||e.mechBrandedCategory||e.mechZipBrandedCategory||e.mechParentCategory||e.mechSinglesCategory||e.mechFilterSinglesCategory:!e.mechCustomCategory&&!e.mechCustomSagCategory&&!e.mechCustomPilotCategory&&!e.mechCustomPlusCategory&&!e.mechBrandedCategory&&!e.mechZipBrandedCategory&&!e.mechParentCategory&&!e.mechSinglesCategory&&!e.mechFilterSinglesCategory)).map((e=>{if(e.subCategories){const a=e.subCategories.map((e=>{let a=n.Ay,l=!0;return e.mechNPCCategory&&(a=hl.Ay,l=!1),e.mechBrandedCategory&&(a=ma.A,l=!1),e.mechCustomPlusCategory&&(a=Ha),e.mechFilterSinglesCategory&&(a=ml,l=!1),e.mechFilterSinglesBulkCategory&&(a=xl,l=!1),e.fantasyHeroCategory&&(a=Le),e.fantasyNPCCategory&&(a=ia),(0,m.jsx)(a,{isSubCategory:l,setShowPremiumPopupFunc:t,unitCategory:e},e.title)}));return(0,m.jsx)(gl,{unitCategory:e,isMechParent:e.mechParentCategory,children:a},e.title)}let a=n.Ay;return e.mechCustomCategory&&(a=W.Ay),e.mechCustomSagCategory&&(a=va),e.mechCustomPilotCategory&&(a=$a),e.mechBrandedCategory&&(a=ma.A),e.mechZipBrandedCategory&&(a=tl),e.fantasyHeroCategory&&(a=Le),e.fantasyFilterSinglesCategory&&(a=ze),(0,m.jsx)(a,{setShowPremiumPopupFunc:t,unitCategory:e},e.title)}));return(0,m.jsxs)(bl,{children:[a.children,"mech"===r?null:(0,m.jsx)(Ae.Ay,{setShowPremiumPopupFunc:t,unitCategory:o},"Unit Search"),c,l?(0,m.jsx)(d.A,{closePremiumPopupFunc:()=>t(!1),version:l}):null,(0,m.jsx)(vl,{src:fl,alt:"no ai",title:"Absolutely no AI, LLMs or similar generative models of any kind were used in the creation of this site or it's content"})]})}}}]); 424//# sourceMappingURL=293.bf0b686e.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.