import{jsx as e,jsxs as t}from"react/jsx-runtime";import{D as g,a as f,b as u,c as x,d as C,e as T}from"./dialog-BfGkTFdF.js";import{B as o}from"./button-BvFBRYHq.js";import{Loader2 as F}from"lucide-react";import{ItemTemplateFormFields as w}from"./ItemTemplateFormFields-BQAi_p7H.js";import"@radix-ui/react-dialog";import"./utils-CMbmcP35.js";import"clsx";import"tailwind-merge";import"@radix-ui/react-slot";import"class-variance-authority";import"./label-DMnntKPk.js";import"@radix-ui/react-label";import"./input-qMvM9qch.js";import"./switch-C-6z1FXy.js";import"react";import"@radix-ui/react-switch";import"./textarea-DGUf1VTd.js";import"./MaskSelect-db8-mWU9.js";import"./select-DfhewM4T.js";import"@radix-ui/react-select";function M({open:m,onOpenChange:r,mode:i,form:a,onSubmit:l,masks:p,itemName:n,isLoadingItemName:s,onItemIdBlur:c}){const d=(h,D)=>{a.setData(h,D)};return e(g,{open:m,onOpenChange:r,children:t(f,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[t(u,{children:[e(x,{children:i==="create"?"Create Item Template":"Edit Item Template"}),e(C,{children:i==="create"?"Create a new item template with hex/octet data for use in Shop, Voucher, and Events.":"Update the item template details."})]}),t("form",{onSubmit:l,children:[e(w,{formData:a.data,onFieldChange:d,masks:p,idPrefix:i,itemName:n,isLoadingItemName:s,onItemIdBlur:c}),t(T,{children:[e(o,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),t(o,{type:"submit",disabled:a.processing,children:[a.processing&&e(F,{className:"mr-2 h-4 w-4 animate-spin"}),i==="create"?"Create Template":"Update Template"]})]})]})]})})}export{M as ItemTemplateFormDialog};
