1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1b6e232f-95c1-54d9-a718-3839a4bbec81")}catch(e){}}(); 3import { o as __toESM } from "./rolldown-runtime.D1cXj70v.js"; 4import { dt as require_react } from "./vendor~index~newNavigation~AccountTierManagementPage~AdminContainer~AISystemPromptManager~C~h0mf93xb.B-8UGg7U.js"; 5//#region client/utils/hooks/useSelect.ts 6var import_react = /* @__PURE__ */ __toESM(require_react()); 7var useSelect = (input) => { 8 const cleanInitialValue = input.initialValue ?? null; 9 const [value, setValue] = (0, import_react.useState)(cleanInitialValue); 10 const [isDirty, setDirty] = (0, import_react.useState)(!!cleanInitialValue); 11 (0, import_react.useEffect)(() => setValue(cleanInitialValue), [setValue, (cleanInitialValue || "").toString()]); 12 const errorText = (0, import_react.useMemo)(() => !isDirty ? "" : !value && input.emptyErrorText ? input.emptyErrorText : "", [ 13 isDirty, 14 value, 15 input.emptyErrorText 16 ]); 17 const handleChange = (0, import_react.useCallback)((e) => { 18 setDirty(true); 19 setValue(e.target.value); 20 }, [setDirty, setValue]); 21 const handleInvalid = (0, import_react.useCallback)((e) => { 22 e.preventDefault(); 23 setDirty(true); 24 }, [setDirty]); 25 const handleBlur = (0, import_react.useCallback)(() => { 26 setDirty(true); 27 }, [setDirty]); 28 const reset = (0, import_react.useCallback)(() => { 29 setValue(cleanInitialValue); 30 setDirty(!!cleanInitialValue); 31 }, [ 32 setValue, 33 setDirty, 34 cleanInitialValue 35 ]); 36 return { 37 value, 38 setValue, 39 isDirty, 40 setDirty, 41 isValid: !!value, 42 reset, 43 selectProps: { 44 value, 45 onChange: handleChange, 46 onBlur: handleBlur, 47 onInvalid: handleInvalid 48 }, 49 formControlProps: { error: !!errorText }, 50 formHelperTextProps: { children: errorText || " " } 51 }; 52}; 53//#endregion 54export { useSelect as t }; 55 56//# sourceMappingURL=useSelect.CxxP5PE_.js.map 57//# debugId=1b6e232f-95c1-54d9-a718-3839a4bbec81
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.