1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9874],{29874:(e,i,s)=>{s.r(i),s.d(i,{SettingsPanel:()=>B});var t=s(95155),n=s(96795),l=s(12115),d=s(80100),a=s(36910),r=s(65198),o=s(9192),c=s(51152),h=s(53878);function m({id:e,value:i,onChange:s}){let l=(0,n.Z)(),a="selectionActions"===e,m=(0,r.hI)(i),x=a?[m.find(e=>"NONE"!==e.button)??m[0]??{button:"NONE",modifier:"NONE",trigger:"press",holdMs:300}]:(0,r.HN)(i),u=a?"Selection button":"Exit grenade mode buttons",p=e=>s(JSON.stringify(e)),g=(e,i)=>p(x.map((s,t)=>t===e?{...s,...i}:s));return(0,t.jsx)("div",{className:h.BN,children:(0,t.jsxs)("div",{className:"space-y-4",children:[a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,t.jsx)("div",{className:"w-[160px]",children:(0,t.jsx)(d.K,{noPad:!0,setting:{id:e,label:u,type:"button",editable:!0,default:"NONE",options:["NONE",...r.B7]},value:x[0].button,onChange:e=>g(0,{button:String(e)})})}),(0,t.jsx)("div",{className:"w-[160px]",children:(0,t.jsx)(d.K,{noPad:!0,setting:{id:`${e}-0-modifier`,label:"Selection modifier",type:"button",editable:!0,default:"NONE",options:["NONE",...r.B7]},value:x[0].modifier,onChange:e=>g(0,{modifier:String(e)}),disabled:"NONE"===x[0].button})})]}),(0,t.jsx)("div",{className:h.Zv,children:"Choose the button that equips a grenade. For a combination, hold the modifier before pressing the selection button."})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-1.5 flex-1",children:[(0,t.jsx)("p",{id:`${e}-label`,className:"text-sm font-semibold text-foreground leading-none",children:u}),(0,t.jsx)("p",{id:`${e}-hint`,className:"text-sm text-muted-foreground max-w-[90%]",children:"Select the buttons that switch from a grenade to a weapon or another item."})]}),(0,t.jsx)("div",{role:"group","aria-labelledby":`${e}-label`,"aria-describedby":`${e}-hint`,className:"grid grid-cols-2 sm:grid-cols-4 gap-4 pt-2",children:r.B7.map(i=>{let s=x.some(e=>e.button===i);return(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(o.S,{id:`${e}-${i}`,checked:s,disabled:!s&&x.length>=r.IX,onCheckedChange:e=>p(!0===e?[...x,{button:i,modifier:"NONE",trigger:"press",holdMs:300}]:x.filter(e=>e.button!==i))}),(0,t.jsx)("label",{htmlFor:`${e}-${i}`,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:(0,c.k8)(i,l)})]},i)})})]}),a&&x.map((i,s)=>{let n=a?"Selection":(0,c.k8)(i.button,l),r="NONE"===i.button,o=(t,n,l,d={})=>({id:`${e}-${s}-${t}`,label:n,type:l,default:i[t],editable:!0,...d});return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex flex-wrap gap-4",children:(0,t.jsx)("div",{className:"w-[200px]",children:(0,t.jsx)(d.K,{noPad:!0,setting:o("trigger",`${n} activation`,"list",{options:["Press","Hold"]}),value:+("hold"===i.trigger),onChange:e=>g(s,{trigger:1===Number(e)?"hold":"press"}),disabled:r})})}),(0,t.jsx)(d.K,{noPad:!0,setting:o("holdMs",`${n} hold time (ms)`,"slider",{min:100,max:1e3}),value:i.holdMs,onChange:e=>g(s,{holdMs:Number(e)}),disabled:r||"hold"!==i.trigger})]},a?e:`${i.button}-${s}`)})]})})}function x({mod:e,values:i,onChange:s}){let n=(n,l=!1)=>{let a=e.settings.find(e=>e.id===n);return a?(0,t.jsx)(d.K,{setting:a,value:i[n]??a.default,allSettings:i,onChange:e=>s(n,e),disabled:l||!!a.dependsOn&&!a.dependsOn(i)},n):null};return(0,t.jsxs)("div",{className:"flex flex-col",children:[n("active"),(0,t.jsx)(m,{id:"selectionActions",value:i.selectionActions,onChange:e=>s("selectionActions",e)}),n("throwButton"),(0,t.jsx)(m,{id:"exitActions",value:i.exitActions,onChange:e=>s("exitActions",e)}),n("afterThrow"),n("autoThrow"),n("cookTime",!i.autoThrow),n("ping"),n("pingTrigger",!i.ping),["pingCondition","pingButton","pingPattern","pingPress","pingGap"].map(e=>n(e,!i.ping))]})}var u=s(42450),p=s(99412),g=s(89239),j=s(60529),f=s(33807),N=s(66609),v=s(35942),b=s(29991),y=s(35789),S=s(92219),w=s(94917);let A=(e,i)=>{let s;if("list"!==e.type||!e.optionDescriptions)return null;let n="number"==typeof i?i:Number(i??0),d="all"===e.calloutMode||e.optionDescriptions.length<=3;return(0,t.jsx)("div",{className:h.Zv,children:d?e.optionDescriptions.map((e,i)=>(0,t.jsxs)(l.Fragment,{children:[i>0&&(0,t.jsx)("div",{className:"mt-3"}),(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:e.title}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground leading-relaxed",children:e.description})]},i)):(s=e.optionDescriptions[n])?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:s.title}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground leading-relaxed",children:s.description})]}):null})},F=y.w3.filter(e=>"single"!==e),C=(e,i)=>{if(!e)return{};let s={};
1return e.settings.forEach(e=>{s[e.id]=i?.[e.id]??e.default}),s},M=e=>{let i=Number(e);return Number.isInteger(i)&&i>=1&&i<=4?i:1},O=(e,i,s)=>{if("keyboard"!==e)return i.map(e=>(0,t.jsx)(b.eb,{value:e,children:(0,c.kX)(e,s)},e));let n=c.hE.filter(e=>i.includes(e)),l=c.GB.filter(e=>i.includes(e));return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(b.s3,{children:[(0,t.jsx)(b.TR,{children:"Modifiers"}),n.map(e=>(0,t.jsx)(b.eb,{value:e,children:(0,c.kX)(e,s)},e))]}),(0,t.jsx)(b.mi,{}),(0,t.jsxs)(b.s3,{children:[(0,t.jsx)(b.TR,{children:"Keys"}),l.map(e=>(0,t.jsx)(b.eb,{value:e,children:(0,c.kX)(e,s)},e))]})]})},B=({isOpen:e,mod:i,onClose:s})=>{var o;let m,B,{config:P,updateModSettings:H,updateModHandler:$}=(0,u.U)(),k=(0,n.Z)(),[E,D]=(0,l.useState)(()=>C(i,i?P.mods[i.id]?.settings:void 0)),[T,J]=(0,l.useState)(()=>i?.dynamicHandler?P.mods[i.id]?.handler||i.dynamicHandler:null);if(!i)return null;let K=(e,s)=>{D(t=>{let n={...t,[e]:s},l=i.settings.find(i=>i.id===e);return l?.onChangeHook&&Object.assign(n,l.onChangeHook(s,t)),n})},I=(e,i)=>{J(s=>s?{...s,[e]:i}:s)},q=i.settings.filter(e=>!e.hideInUI&&(!e.hideWhenDisabled||!e.dependsOn||!!e.dependsOn(E))),R=T?.trigger==="hold",z=T?c.vl[T.device]:[],V=i.dynamicHandler?i.settings.find(e=>"active"===e.id):null,Z=i.dynamicHandler?q.filter(e=>"active"!==e.id):q,_="ScopeAssist"===i.id,G=!!P.core.system.weaponProfiles.enabled,W=e=>{let s="AutoSprint"===i.id&&"direction"===e.id?"as-direction":"AutoSprint"===i.id&&"mode"===e.id?"as-mode":"AutoSprint"===i.id&&"active"===e.id?"as-active":"HairTrigger"===i.id&&"threshold"===e.id?"ht-threshold":"HairTrigger"===i.id&&"active"===e.id?"ht-active":null,n=A(e,E[e.id]??e.default);return(0,t.jsxs)("div",{className:h.Fy,...s?{"data-onboarding":s}:{},children:[(0,t.jsx)(d.K,{setting:e,value:E[e.id]??e.default,allSettings:E,onChange:i=>K(e.id,i),noPad:!0,disabled:!!e.dependsOn&&!e.dependsOn(E)}),n]},e.id)},X=_?q.filter(e=>"profile1"===e.id||"profile1Mode"===e.id):[],U=_?q.filter(e=>"profile2"===e.id||"profile2Mode"===e.id):[],L=_?q.filter(e=>"scopeDelay"===e.id||"quickScopeDelay"===e.id||"shotHold"===e.id):[],Q=(e,i,s)=>{let n;if(!i)return null;let l=!!E[i.id],d=s?M(E[s.id]??s.default):1;return(0,t.jsxs)("section",{className:h.Kh,children:[(0,t.jsx)("h3",{className:h.s8,children:e}),(0,t.jsxs)("div",{className:h.Fy,children:[W(i),G?(0,t.jsxs)("div",{className:h.dF,children:[(0,t.jsxs)("p",{className:"text-sm font-medium text-foreground",children:[(0,t.jsx)("strong",{children:"Weapon Profiles"})," active"]}),(0,t.jsxs)("p",{className:"mt-1 text-sm text-muted-foreground leading-relaxed",children:[(0,t.jsx)("strong",{children:"Scope Assist"})," mode is selected per weapon in ",(0,t.jsx)("strong",{children:"Weapon Profiles"}),". Profile active only controls whether ",(0,t.jsx)("strong",{children:"Scope Assist"})," can run on this profile."]})]}):s?(0,t.jsxs)("div",{className:`${h.Fy} ${l?"":"opacity-50"}`,"aria-disabled":!l||void 0,children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"flex justify-between items-start gap-4",children:(0,t.jsxs)("div",{className:"space-y-1.5 flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-semibold text-foreground leading-none",children:s.label}),s.hint&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground max-w-[90%]",children:s.hint})]})}),(0,t.jsx)("div",{className:"mt-2 w-[200px] max-w-full",children:(0,t.jsx)(S.Y,{value:d,onChange:e=>K(s.id,Number(e)),options:[...w.tS],displayValueMap:w.Md,selectedDisplayValueMap:w.Md,disabled:!l,contentClassName:"w-[220px]",contentAlign:"start"})})]}),(n=[{title:"Auto Scope",description:"Holding Fire also holds ADS immediately."},{title:"ADS Auto Fire",description:"Holding Fire also holds ADS, and holding ADS also holds Fire. If Rapid Fire is active, ADS-triggered Fire pulses instead of holding."},{title:"Scoped Fire",description:"Holding Fire blocks the first shot, holds ADS, waits, then allows Fire."},{title:"Quick Scope",description:"Pressing Fire runs one ADS, delay, Fire shot sequence."}][d-1])?(0,t.jsxs)("div",{className:h.Zv,children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:n.title}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground leading-relaxed",children:n.description})]}):null]}):null]})]})},Y="AutoLean"===i.id||"SniperBreath"===i.id;return(0,t.jsx)(p.cj,{open:e,onOpenChange:e=>!e&&s(),children:(0,t.jsxs)(p.h,{"aria-describedby":Y?`${i.id}-description`:void 0,className:"w-full sm:max-w-2xl bg-background border-l border-border flex flex-col p-0 gap-0 shadow-lg h-full overflow-hidden",children:[(0,t.jsx)(p.Fm,{className:h.m4,children:(0,t.jsx)(p.qp,{className:"text-xl font-bold tracking-tight text-foreground text-left",children:i.name})}),(0,t.jsx)(v.F,{className:"flex-1 min-h-0",children:(0,t.jsxs)("div",{className:`${h.Q} ${h.Fy}`,children:[Y&&(0,t.jsxs)("div",{id:`${i.id}-description`,className:h.dF,children:[(0,t.jsx)("strong",{children:"Sniper Breath"})," holds Sprint while aiming. If Sprint shares an ",(0,t.jsx)("strong",{children:"Auto Lean"})," button, the mods can interfere. Use separate bindings or enable only one mod."]}),(0,t.jsx)(a.p,{modId:i.id}),i.dynamicHandler&&T?(0,t.jsxs)("div",{className:h.Fy,children:[V&&(0,t.jsx)("div",{..."AutoSprint"===i.id?{"data-onboarding":"as-active"}:"HairTrigger"===i.id?{"data-onboarding":"ht-active"}:{},children:(0,t.jsx)(d.K,{setting:V,value:E[V.id]??V.default,allSettings:E,onChange:e=>K(V.id,e),noPad:!0})}),(0,t.jsxs)("section",{className:h.Kh,children:[(0,t.jsx)("h3",{className:h.s8,children:"Handler"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-4",children:(0,t.jsxs)("div",{className:"w-[160px] space-y-2",children:[(0,t.jsx)(f.J,{htmlFor:"settings-input-source",children:"Input source"}),(0,t.jsxs)(b.l6,{value:T.device,onValueChange:e=>{J(i=>{if(!i)return i;let s=(0,c.rM)(i.primaryButton),t=c.vl[e].includes(s)?s:"gamepad"===e?"PS5_UP":"KEY_A",n=i.secondaryButton?(0,c.rM)(i.secondaryButton):void 0,l=n&&c.vl[e].includes(n)?n:void 0;return{...i,device:e,primaryButton:t,secondaryButton:l}})},children:[(0,t.jsx)(b.bq,{id:"settings-input-source",size:"sm",className:"w-[160px]",children:(0,t.jsx)(b.yv,{})}),(0,t.jsx)(b.gC,{className:h.e6,position:"popper",align:"start",children:c.J3.map(e=>(0,t.jsx)(b.eb,{value:e,children:c.eI[e]},e))})]})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,t.jsxs)("div",{className:"w-[160px] space-y-2",children:[(0,t.jsx)(f.J,{htmlFor:"settings-primary-button",children:"Primary button"}),(0,t.jsxs)(b.l6,{value:(0,c.rM)(T.primaryButton),onValueChange:e=>I("primaryButton",e),children:[(0,t.jsx)(b.bq,{id:"settings-primary-button",size:"sm",className:"w-[160px]",children:(0,t.jsx)(b.yv,{})}),(0,t.jsx)(b.gC,{className:h.e6,position:"popper",align:"start",children:O(T.device,z,k)})]})]}),(0,t.jsxs)("div",{className:"w-[160px] space-y-2",children:[(0,t.jsx)(f.J,{htmlFor:"settings-secondary-button",children:"Secondary button"}),(0,t.jsxs)(b.l6,{value:(0,c.rM)(T.secondaryButton||"NONE"),onValueChange:e=>I("secondaryButton","NONE"===e?void 0:e),children:[(0,t.jsx)(b.bq,{id:"settings-secondary-button",size:"sm",className:"w-[160px]",children:(0,t.jsx)(b.yv,{})}),(0,t.jsxs)(b.gC,{className:h.e6,position:"popper",align:"start",children:[(0,t.jsx)(b.eb,{value:"NONE",children:"None"}),O(T.device,z.filter(e=>e!==(0,c.rM)(T.primaryButton)),k)]})]})]})]}),(0,t.jsx)("div",{className:h.Zv,children:(o=T.device,m=T.secondaryButton?{title:null,body:"Hold Primary, then press Secondary to activate."}:"keyboard"===o?{title:"Optional",body:"Add Secondary to build a shortcut. For combinations like Alt + F, put Alt in Primary and F in Secondary."}:{title:"Optional",body:"Add a second button to create a combination. Hold Primary and press Secondary to activate."},(0,t.jsxs)(t.Fragment,{children:[m.title&&(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:m.title}),(0,t.jsx)("p",{className:m.title?"mt-1 text-sm text-muted-foreground leading-relaxed":"",children:m.body})]}))}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,t.jsxs)("div",{className:"w-[160px] space-y-2",children:[(0,t.jsx)(f.J,{htmlFor:"settings-execution",children:"Execution"}),(0,t.jsxs)(b.l6,{value:T.execution,onValueChange:e=>{J(i=>i?{...i,execution:e,trigger:"while-held"===e?"held":"held"===i.trigger?"tap":i.trigger}:i)}
1,children:[(0,t.jsx)(b.bq,{id:"settings-execution",size:"sm",className:"w-[160px]",children:(0,t.jsx)(b.yv,{})}),(0,t.jsx)(b.gC,{className:h.e6,position:"popper",align:"start",children:F.map(e=>(0,t.jsx)(b.eb,{value:e,children:y.jr[e]},e))})]})]}),(0,t.jsxs)("div",{className:"w-[160px] space-y-2",children:[(0,t.jsx)(f.J,{htmlFor:"settings-trigger",children:"Trigger"}),(0,t.jsxs)(b.l6,{value:T.trigger,onValueChange:e=>{J(i=>i?{...i,trigger:e,execution:"held"===e?"while-held":"while-held"===i.execution?"loop":i.execution}:i)},children:[(0,t.jsx)(b.bq,{id:"settings-trigger",size:"sm",className:"w-[160px]",children:(0,t.jsx)(b.yv,{})}),(0,t.jsx)(b.gC,{className:h.e6,position:"popper",align:"start",children:y.y$.map(e=>(0,t.jsx)(b.eb,{value:e,disabled:"while-held"===T.execution&&"held"!==e,children:y.B7[e]},e))})]})]}),R&&(0,t.jsxs)("div",{className:"w-[100px] space-y-2",children:[(0,t.jsx)(f.J,{htmlFor:"settings-hold-time",children:"Hold time (ms)"}),(0,t.jsx)(j.p,{id:"settings-hold-time",type:"number",className:"h-8 w-[100px]",min:50,step:10,value:String(T.holdMs||y.Jb),onChange:e=>I("holdMs",Number(e.target.value)||y.Jb)})]})]}),(0,t.jsx)("div",{className:h.Zv,children:(B="loop"===T.execution?{title:null,body:"Press the button to turn the mod on or off. It stays active until you press again."}:{title:null,body:"The mod is active only while you hold the button. Releasing it stops it."},(0,t.jsxs)(t.Fragment,{children:[B.title&&(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:B.title}),(0,t.jsx)("p",{className:B.title?"mt-1 text-sm text-muted-foreground leading-relaxed":"",children:B.body})]}))})]}),Z.length>0&&(0,t.jsxs)("section",{className:h.Kh,children:[(0,t.jsx)("h3",{className:h.s8,children:"Mod Settings"}),(0,t.jsx)("div",{className:h.Fy,children:Z.map(e=>{let s="AutoSprint"===i.id&&"direction"===e.id?"as-direction":"AutoSprint"===i.id&&"mode"===e.id?"as-mode":"HairTrigger"===i.id&&"threshold"===e.id?"ht-threshold":null;return(0,t.jsxs)("div",{className:h.Fy,...s?{"data-onboarding":s}:{},children:[(0,t.jsx)(d.K,{setting:e,value:E[e.id]??e.default,allSettings:E,onChange:i=>K(e.id,i),noPad:!0,disabled:!!e.dependsOn&&!e.dependsOn(E)}),A(e,E[e.id]??e.default)]},e.id)})})]})]}):q.length>0?_?(0,t.jsxs)("div",{className:h.Fy,children:[Q("Profile 1",X.find(e=>"profile1"===e.id),X.find(e=>"profile1Mode"===e.id)),Q("Profile 2",U.find(e=>"profile2"===e.id),U.find(e=>"profile2Mode"===e.id)),(0,t.jsxs)("section",{className:h.Kh,children:[(0,t.jsx)("h3",{className:h.s8,children:"Global settings"}),(0,t.jsx)("div",{className:"flex flex-col",children:L.map(W)})]})]}):(0,t.jsx)("div",{className:h.Fy,children:"GrenadeAssist"===i.id?(0,t.jsx)(x,{mod:i,values:E,onChange:K}):q.map(W)}):(0,t.jsxs)("div",{className:"py-20 text-center space-y-2",children:[(0,t.jsx)("p",{className:"text-sm font-semibold text-foreground",children:"No Parameters"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"This mod has no adjustable settings."})]})]})}),(0,t.jsxs)(p.XW,{className:h.WF,children:[(0,t.jsx)(g.$,{variant:"outline",size:"sm",onClick:()=>{D(C(i,void 0)),i.dynamicHandler&&J(i.dynamicHandler),N.oR.info("Restored to default values")},children:"Reset"}),(0,t.jsx)(g.$,{size:"sm",onClick:()=>{if("GrenadeAssist"===i.id){let e=(0,r.pJ)(E);if(e)return void N.oR.error(e);let t=(0,r.vS)(E);return H(i.id,{...E,...t,selectionActions:JSON.stringify(t.selectionActions.length?t.selectionActions:(0,r.hI)(E.selectionActions).slice(0,1)),exitActions:JSON.stringify(t.exitActions)}),void s()}let e="ScopeAssist"===i.id?{...E,profile1Mode:M(E.profile1Mode),profile2Mode:M(E.profile2Mode)}:E;if(H(i.id,e),i.dynamicHandler&&T){let e={...T,primaryButton:(0,c.rM)(T.primaryButton),secondaryButton:T.secondaryButton?(0,c.rM)(T.secondaryButton):void 0,holdMs:"hold"===T.trigger?T.holdMs||y.Jb:void 0};$(i.id,e)}s()},..."AutoSprint"===i.id?{"data-onboarding":"as-save"}:"HairTrigger"===i.id?{"data-onboarding":"ht-save"}:{},children:"Save"})]})]})})}}}]);
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.