import{jsxs as a,jsx as t}from"react/jsx-runtime";import{L as l}from"./label-DMnntKPk.js";import{I as m}from"./input-qMvM9qch.js";import{S as h}from"./switch-C-6z1FXy.js";import{T as u}from"./textarea-DGUf1VTd.js";import{MaskSelect as v}from"./MaskSelect-db8-mWU9.js";import"@radix-ui/react-label";import"./utils-CMbmcP35.js";import"clsx";import"tailwind-merge";import"react";import"@radix-ui/react-switch";import"./select-DfhewM4T.js";import"@radix-ui/react-select";import"lucide-react";function j({formData:c,onFieldChange:i,masks:s,idPrefix:o="",itemName:p,isLoadingItemName:d,onItemIdBlur:n}){const r=e=>o?`${o}_${e}`:e;return a("div",{className:"grid gap-4 py-4",children:[a("div",{className:"space-y-2",children:[t(l,{htmlFor:r("name"),children:"Template Name *"}),t(m,{id:r("name"),value:c.name,onChange:e=>i("name",e.target.value),placeholder:"e.g., Legendary Sword +12"})]}),a("div",{className:"grid grid-cols-2 gap-4",children:[a("div",{className:"space-y-2",children:[t(l,{htmlFor:r("item_id"),children:"Item ID *"}),t(m,{id:r("item_id"),type:"number",value:c.item_id,onChange:e=>i("item_id",e.target.value),onBlur:n,placeholder:"2000"})]}),a("div",{className:"space-y-2",children:[t(l,{htmlFor:r("item_name"),children:"Item Name"}),t(m,{id:r("item_name"),value:p||c.item_name,onChange:e=>i("item_name",e.target.value),placeholder:d?"Loading...":"Auto-detected from Item ID",disabled:d})]})]}),a("div",{className:"grid grid-cols-2 gap-4",children:[a("div",{className:"space-y-2",children:[t(l,{htmlFor:r("count"),children:"Count *"}),t(m,{id:r("count"),type:"number",value:c.count,onChange:e=>i("count",e.target.value),placeholder:"1"})]}),a("div",{className:"space-y-2",children:[t(l,{htmlFor:r("proctype"),children:"Proctype"}),t(m,{id:r("proctype"),type:"number",value:c.proctype,onChange:e=>i("proctype",e.target.value),placeholder:"0"})]})]}),a("div",{className:"space-y-2",children:[t(l,{htmlFor:r("octet"),children:"Octet (Hex Data)"}),t(u,{id:r("octet"),value:c.octet,onChange:e=>i("octet",e.target.value),placeholder:"01000000e82100006400000001000000e921000087000000",className:"font-mono text-xs",rows:3}),t("p",{className:"text-xs text-muted-foreground",children:"Enter hex/octet data for item attributes"})]}),a("div",{className:"grid grid-cols-2 gap-4",children:[a("div",{className:"space-y-2",children:[t(l,{htmlFor:r("mask"),children:"Mask"}),t(v,{id:r("mask"),value:c.mask,onValueChange:e=>i("mask",e),masks:s})]}),a("div",{className:"space-y-2",children:[t(l,{htmlFor:r("protect_type"),children:"Protect Type"}),t(m,{id:r("protect_type"),type:"number",value:c.protect_type,onChange:e=>i("protect_type",e.target.value),placeholder:"0"})]})]}),a("div",{className:"flex items-center gap-2",children:[t(h,{id:r("is_active"),checked:c.is_active,onCheckedChange:e=>i("is_active",e)}),t(l,{htmlFor:r("is_active"),children:"Active"})]})]})}export{j as ItemTemplateFormFields};
