{"version":3,"file":"vue-form-control.mjs","names":["update:modelValue","update:errors","pattern","patternFactory","minLengthFactory","maxLengthFactory","update:masked","update:typed","update:unmasked","update:modelValue","modelValue"],"sources":["../src/schemes/autocomplete.ts","../src/schemes/textinput.ts","../src/schemes/imask.ts","../src/logger.ts","../src/injections.ts","../src/composables/node.tsx","../src/composables/number.ts","../src/composables/autocompletable.ts","../src/composables/textable.ts","../src/composables/imask.ts","../src/composables/textinput.tsx","../src/components/VTextareaAutosize/VTextareaAutosize.tsx","../src/composables/textarea.tsx","../src/composables/selector.ts","../src/composables/selector-item-group.tsx","../src/composables/selector-item.tsx","../src/composables/boundable-input.ts","../src/composables/date-input.ts","../src/composables/file.tsx","../src/composables/wrapper.ts","../src/composables/group.ts","../src/composables/form.ts","../src/directives/imask.ts","../src/service.ts","../src/plugin.ts"],"sourcesContent":["export const FORM_AUTO_COMPLETES = [\n  'off',\n  'on',\n  'name',\n  'honorific-prefix',\n  'given-name',\n  'additional-name',\n  'family-name',\n  'honorific-suffix',\n  'nickname',\n  'email',\n  'username',\n  'new-password',\n  'current-password',\n  'one-time-code',\n  'organization-title',\n  'organization',\n  'street-address',\n  'address-line1',\n  'address-line2',\n  'address-line3',\n  'address-level4',\n  'address-level3',\n  'address-level2',\n  'address-level1',\n  'country',\n  'country-name',\n  'postal-code',\n  'cc-name',\n  'cc-given-name',\n  'cc-additional-name',\n  'cc-family-name',\n  'cc-number',\n  'cc-exp',\n  'cc-exp-month',\n  'cc-exp-year',\n  'cc-csc',\n  'cc-type',\n  'transaction-currency',\n  'transaction-amount',\n  'language',\n  'bday',\n  'bday-day',\n  'bday-month',\n  'bday-year',\n  'sex',\n  'tel',\n  'tel-country-code',\n  'tel-national',\n  'tel-area-code',\n  'tel-local',\n  'tel-extension',\n  'impp',\n  'url',\n  'photo',\n] as const;\n\nexport type FormAutoComplete = (typeof FORM_AUTO_COMPLETES)[number];\n","import {\n  nilToEmptyString,\n  removeSpace,\n  toHalfWidth,\n  toSingleSpace,\n} from '@fastkit/helpers';\n\nexport const TEXT_INPUT_TYPES = [\n  'color',\n  'date',\n  'datetime-local',\n  'email',\n  'month',\n  'number',\n  'password',\n  'search',\n  'tel',\n  'text',\n  'time',\n  'url',\n] as const;\n\nexport type TextInputType = (typeof TEXT_INPUT_TYPES)[number];\n\nexport const TEXT_INPUT_MODES = [\n  'decimal',\n  'email',\n  'none',\n  'numeric',\n  'search',\n  'tel',\n  'text',\n  'url',\n] as const;\n\nexport type TextInputMode = (typeof TEXT_INPUT_MODES)[number];\n\nexport type TextFinalizer = (value?: string | null) => string | Promise<string>;\n\nfunction defineFinalizers<T extends string>(\n  finalizers: Record<T, TextFinalizer>,\n) {\n  return finalizers;\n}\n\nexport const BUILTIN_TEXT_FINALIZERS = defineFinalizers({\n  trim: (v) => nilToEmptyString(v).trim(),\n  removeSpace: (v) => removeSpace(v),\n  upper: (v) => nilToEmptyString(v).toUpperCase(),\n  lower: (v) => nilToEmptyString(v).toLowerCase(),\n  halfWidth: toHalfWidth,\n  singleSpace: toSingleSpace,\n  // kana: xxx,\n});\n\nexport type BuiltinTextFinalizerName = keyof typeof BUILTIN_TEXT_FINALIZERS;\n","import type {\n  MaskedFunction,\n  MaskedRegExp,\n  MaskedEnum,\n  MaskedRange,\n  Masked,\n  InputMask,\n  MaskedDynamic,\n  FactoryOpts,\n  MaskedDynamicOptions,\n  AppendFlags,\n} from 'imask';\n\nexport type IMaskEventType = 'accept' | 'complete';\n\nexport type AnyMaskedOptions = FactoryOpts;\n\nexport type IMaskEvent = CustomEvent<InputMask>;\n\nexport function createIMaskEvent(\n  type: IMaskEventType,\n  eventInitDict?: CustomEventInit<InputMask>,\n): IMaskEvent {\n  return new CustomEvent<InputMask>(type, eventInitDict);\n}\n\nexport type IMaskTypedValue = string | number | Date;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\ntype IMaskRawInput = RegExp | Function | string;\n\nfunction isRawType(source: unknown): source is IMaskRawInput {\n  const t = typeof source;\n  return t === 'string' || t === 'function' || source instanceof RegExp;\n}\n\ntype DynamicMaskedMeta = {\n  /** Metadata assigned to dynamic mask options. */\n  meta?: any;\n};\n\ntype AnyMaskedOptionsWithMeta = AnyMaskedOptions & DynamicMaskedMeta;\n\ntype AnyMaskedWithMeta = Masked & DynamicMaskedMeta;\n\ntype MaskedDynamicWithMeta = Omit<\n  MaskedDynamic,\n  'currentMask' | 'compiledMasks'\n> & {\n  currentMask?: AnyMaskedWithMeta;\n  compiledMasks: AnyMaskedWithMeta[];\n};\n\nexport type MaskedDynamicOptionsWithMeta = Omit<\n  MaskedDynamicOptions,\n  'mask' | 'dispatch'\n> & {\n  mask: AnyMaskedOptionsWithMeta[];\n  dispatch?: (\n    value: string,\n    masked: MaskedDynamicWithMeta,\n    flags: AppendFlags,\n  ) => Masked;\n};\n\nexport type IMaskInput =\n  | Exclude<AnyMaskedOptions, MaskedDynamicOptions>\n  | IMaskRawInput\n  | Masked<any>\n  | MaskedFunction\n  | MaskedRegExp\n  | MaskedEnum\n  | MaskedRange\n  | MaskedDynamicOptionsWithMeta\n  | false\n  | null\n  | undefined\n  | void;\n\nexport function resolveIMaskInput(\n  source?: IMaskInput,\n): AnyMaskedOptions | undefined {\n  if (isRawType(source)) {\n    return <AnyMaskedOptions>{ mask: source };\n  }\n  if (source) {\n    return source as AnyMaskedOptions;\n  }\n}\n","import { TinyLogger, createTinyError } from '@fastkit/tiny-logger';\n\nconst name = 'vue-form-control';\n\nexport const logger = new TinyLogger(name);\n\nexport const VueFormControlError = createTinyError(name);\n","import { InjectionKey, inject } from 'vue';\nimport type { FormNodeControl } from './composables/node';\nimport type { FormSelectorControl } from './composables/selector';\nimport type { FormSelectorItemGroupControl } from './composables/selector-item-group';\nimport type { FormNodeWrapper } from './composables/wrapper';\nimport type { FormGroupControl } from './composables/group';\nimport type { VueForm } from './composables/form';\nimport type { VueFormService } from './service';\nimport { VueFormControlError } from './logger';\n\nexport const FormNodeInjectionKey: InjectionKey<FormNodeControl | null> =\n  Symbol('FormNodeControl');\n\nexport const FormSelectorInjectionKey: InjectionKey<FormSelectorControl | null> =\n  Symbol('FormSelectorControl');\n\nexport const FormSelectorItemGroupInjectionKey: InjectionKey<FormSelectorItemGroupControl | null> =\n  Symbol('FormSelectorItemGroupControl');\n\nexport const FormNodeWrapperInjectionKey: InjectionKey<FormNodeWrapper | null> =\n  Symbol('FormNodeWrapper');\n\nexport function useParentFormNodeWrapper() {\n  return inject(FormNodeWrapperInjectionKey, null);\n}\n\nexport const FormGroupInjectionKey: InjectionKey<FormGroupControl | null> =\n  Symbol('FormGroupControl');\n\nexport function useParentFormGroup() {\n  return inject(FormGroupInjectionKey, null);\n}\n\nexport const FormInjectionKey: InjectionKey<VueForm | null> = Symbol('VueForm');\n\nexport function useParentForm() {\n  return inject(FormInjectionKey, null);\n}\n\nexport const FormServiceInjectionKey: InjectionKey<VueFormService> =\n  Symbol('VueFormService');\n\nexport function useVueForm() {\n  const service = inject(FormServiceInjectionKey);\n  if (!service) {\n    throw new VueFormControlError('missing provided VueFormService');\n  }\n  return service;\n}\n","import {\n  Prop,\n  PropType,\n  ExtractPropTypes,\n  SetupContext,\n  WritableComputedRef,\n  ComputedRef,\n  computed,\n  ref,\n  shallowRef,\n  Ref,\n  watch,\n  provide,\n  inject,\n  onBeforeMount,\n  onMounted,\n  onBeforeUnmount,\n  getCurrentInstance,\n  ComponentInternalInstance,\n  VNodeArrayChildren,\n  markRaw,\n  nextTick,\n} from 'vue';\n\nimport {\n  VerifiableRule,\n  VerifiableRuleOrFn,\n  resolveVerifiableRule,\n  ValidationError,\n  validate,\n  required as requiredRule,\n  type Rule,\n} from '@fastkit/rules';\nimport {\n  RecursiveArray,\n  flattenRecursiveArray,\n  toInt,\n  mixin,\n  Mixin,\n  arrayRemove,\n} from '@fastkit/helpers';\nimport {\n  createPropsOptions,\n  DefineSlotsType,\n  cleanupEmptyVNodeChild,\n} from '@fastkit/vue-utils';\nimport {\n  FormNodeInjectionKey,\n  useParentForm,\n  useParentFormGroup,\n  useParentFormNodeWrapper,\n  useVueForm,\n} from '../injections';\nimport type { VueForm } from './form';\nimport type { FormGroupControl } from './group';\nimport type { FormNodeWrapper } from './wrapper';\nimport type { VueFormService } from '../service';\n\nexport type RecursiveVerifiableRuleOrFn = RecursiveArray<VerifiableRuleOrFn>;\n\nexport type RecursiveVerifiableRuleOrFnArray = Exclude<\n  RecursiveVerifiableRuleOrFn,\n  VerifiableRuleOrFn\n>;\n\nconst rulesToArray = (\n  rules: RecursiveVerifiableRuleOrFn | undefined,\n  shallowCopy: boolean = false,\n): RecursiveVerifiableRuleOrFnArray => {\n  if (!rules) return [];\n\n  return Array.isArray(rules) ? (shallowCopy ? rules.slice() : rules) : [rules];\n};\n\nconst rulesHasChanged = (\n  currentRules: VerifiableRule[],\n  beforeRules: VerifiableRule[],\n) => {\n  if (currentRules.length !== beforeRules.length) {\n    return true;\n  }\n  for (let i = 0, l = currentRules.length; i < l; i++) {\n    const ar = currentRules[i];\n    const br = beforeRules[i];\n    if (ar !== br) return true;\n  }\n  return false;\n};\n\n/**\n * Merge two specified recursive rule specifications into a single array and return it.\n *\n * @param baseRules - Base rules\n * @param mergeRules - Merge rules\n * @returns Array of merged rules\n */\nexport function mergeFormNodeRules(\n  baseRules: RecursiveVerifiableRuleOrFn | undefined,\n  mergeRules: RecursiveVerifiableRuleOrFn | undefined,\n): RecursiveVerifiableRuleOrFnArray {\n  const _mergeRules = rulesToArray(mergeRules);\n  if (!baseRules) return _mergeRules;\n  const _baseRules = rulesToArray(baseRules);\n  return [..._baseRules, ..._mergeRules];\n}\n\nexport type FormNodeType = string | number | symbol;\n\nexport interface FormNodeError extends Omit<ValidationError, '$$symbol'> {}\n\nexport type FormNodeErrors = FormNodeError[];\n\nexport function toFormNodeError(\n  source: string | ValidationError | FormNodeError,\n): FormNodeError {\n  if (typeof source === 'string') {\n    return {\n      name: source,\n      message: source,\n    };\n  }\n  return source;\n}\n\n/**\n * Validation Timing\n *\n * - `always` Always validate\n * - `touch` Once touched, always validated thereafter.\n * - `blur` Once the focus is removed from the element at least once, subsequent validations will always be performed.\n * - `change` Once the value is changed at least once, subsequent validations will always be performed.\n * - `manual` Validation is not performed automatically. Only manual validation through programming is possible.\n *\n */\nexport type ValidateTiming = 'always' | 'touch' | 'blur' | 'change' | 'manual';\n\nexport type ValidationResult = ValidationError[] | null;\n\ntype ValidateResolver = (result: ValidationResult) => void;\n\nconst HAS_REQUIRED_RULE_RE = /(^|:)required($|:)/;\n\nfunction cheepDeepEqual(a: any, b: any) {\n  return toCompareValue(a) === toCompareValue(b);\n}\n\nfunction toCompareValue(source: any): any {\n  if (source && typeof source === 'object') {\n    return JSON.stringify(source);\n  }\n  return source;\n}\n\nfunction cheepClone<T = any>(source: T): T {\n  if (source && typeof source === 'object') {\n    return JSON.parse(JSON.stringify(source));\n  }\n  return source;\n}\n\nexport type FormNodeStateExtension = (\n  nodeControl: FormNodeControl,\n  computedValue: boolean,\n) => boolean;\n\nexport interface FormNodeStateExtensions {\n  disabled?: FormNodeStateExtension;\n  readonly?: FormNodeStateExtension;\n  viewonly?: FormNodeStateExtension;\n  canOperation?: FormNodeStateExtension;\n}\n\nexport interface FormNodeControlBaseOptions {\n  nodeType?: FormNodeType;\n  requiredFactory?: () => Rule<any> | undefined;\n  defaultValidateTiming?: ValidateTiming;\n  validationValue?: () => any;\n  stateExtensions?: FormNodeStateExtensions;\n  /** Add a custom error message */\n  errorMessages?: () => string | string[] | undefined;\n}\n\nexport interface FormNodeControlOptions<\n  T = any,\n  D = T,\n  Required extends Prop<any> = BooleanConstructor,\n> extends FormNodeControlBaseOptions {\n  modelValue?: Prop<T, D>;\n  required?: Required;\n  shallow?: boolean;\n}\n\nexport type FormNodeErrorSlotsSource = {\n  /** Error message */\n  error?: (error: FormNodeError) => any;\n} & {\n  /** Error messages per validation rule */\n  [K in `error:${string}`]: (error: FormNodeError) => any;\n};\n\nexport type FormNodeErrorSlots = DefineSlotsType<FormNodeErrorSlotsSource>;\n\nexport function createFormNodeProps<\n  T,\n  D = T,\n  Required extends Prop<any> = PropType<boolean>,\n>(options: FormNodeControlOptions<T, D, Required> = {}) {\n  const { modelValue, defaultValidateTiming, required = Boolean } = options;\n  return {\n    ...createPropsOptions({\n      /**\n       * form node name\n       *\n       * This is set as is for input elements.\n       */\n      name: String,\n      /**\n       * Tag string for node searching\n       */\n      tag: String,\n      /** model value */\n      modelValue: modelValue || {},\n      /**\n       * Tab index\n       *\n       * @default 0\n       *\n       * @see https://developer.mozilla.org/docs/Web/HTML/Global_attributes/tabindex\n       */\n      tabindex: {\n        type: [String, Number],\n        default: 0,\n      },\n      /** Automatic focus */\n      autofocus: Boolean,\n      /** disabled state */\n      disabled: Boolean,\n      /** read-only state */\n      readonly: Boolean,\n      /** view-only state */\n      viewonly: Boolean,\n      /**\n       * Spell Check Settings\n       *\n       * @see https://developer.mozilla.org/docs/Web/HTML/Global_attributes/spellcheck\n       */\n      spellcheck: Boolean,\n      /** required */\n      required,\n      /** clearable */\n      clearable: Boolean,\n      /**\n       * Validation Timing\n       *\n       * - `always` Always validate\n       * - `touch` Once touched, always validated thereafter.\n       * - `blur` Once the focus is removed from the element at least once, subsequent validations will always be performed.\n       * - `change` Once the value is changed at least once, subsequent validations will always be performed.\n       * - `manual` Validation is not performed automatically. Only manual validation through programming is possible.\n       *\n       * @see {@link ValidateTiming}\n       */\n      validateTiming: {\n        type: String as PropType<ValidateTiming>,\n        default: defaultValidateTiming || 'touch',\n      },\n      /**\n       * List of validation rules\n       */\n      rules: {\n        type: [Array, Object] as PropType<RecursiveVerifiableRuleOrFn>,\n        default: () => [],\n      },\n      /**\n       * Validation dependencies\n       *\n       * In vue-form-control, validation is performed again whenever the input value or related values change. However, if the validation condition references values from other nodes or external reactive values that are not included in the node, those changes cannot be detected.\n       * By registering a function that returns such external reactive values, validation can be automatically triggered.\n       */\n      validationDeps: Function as PropType<\n        (nodeControl: FormNodeControl) => any\n      >,\n      /** Force an error state. */\n      error: Boolean,\n      /** List of error messages. */\n      errorMessages: [String, Array] as PropType<string | string[]>,\n      /**\n       * Display error messages on this node itself\n       *\n       * If `true`, attempts to render errors for this node itself; if `false`, delegates error message display to the associated form group or wrapper.\n       *\n       * @default `false` if a parent group or wrapper exists and the `collectErrorMessages` setting is enabled; otherwise, `true`.\n       */\n      showOwnErrors: {\n        type: Boolean,\n        default: undefined,\n      },\n      /**\n       * Detach and become independent from the parent node\n       *\n       * By default, the form node inherits the state of the form node existing in the parent tree and notifies the parent node of its own validation status, among other things. This option disables that behavior, allowing this node and its descendants to be detached from the parent node.\n       */\n      detach: Boolean,\n    }),\n  };\n}\n\nexport type FormNodeProps = ExtractPropTypes<\n  ReturnType<typeof createFormNodeProps>\n>;\n\nexport function createFormNodeEmits<T, D = T>(\n  options: FormNodeControlOptions<T, D> = {},\n) {\n  return {\n    /**\n     * Update Model Values\n     */\n    'update:modelValue': (value: T | D) => true,\n    /**\n     * Updating error content.\n     * @param errors - List of error contents.\n     */\n    'update:errors': (errors: FormNodeError[]) => true,\n    /**\n     * Update Model Values\n     */\n    change: (value: T | D) => true,\n    /**\n     * Focus on an element.\n     * @param ev - FocusEvent\n     */\n    focus: (ev: FocusEvent) => true,\n    /**\n     * The focus is removed from an element.\n     * @param ev - FocusEvent\n     */\n    blur: (ev: FocusEvent) => true,\n  };\n}\n\nclass Wrapper<T, D = T> {\n  // wrapped has no explicit return type so we can infer it\n  wrapped(options: FormNodeControlOptions<T, D>) {\n    return createFormNodeEmits<T, D>(options);\n  }\n}\n\nexport interface FormNodeEmitOptions<T, D = T> extends ReturnType<\n  Wrapper<T, D>['wrapped']\n> {}\n\nexport function createFormNodeSettings<T, D = T>(\n  options: FormNodeControlOptions<T, D>,\n) {\n  const props = createFormNodeProps<T, D>(options);\n  const emits = createFormNodeEmits<T, D>(options);\n  return { options, props, emits };\n}\n\nexport type FormNodeContext<T, D = T> = SetupContext<FormNodeEmitOptions<T, D>>;\n\n/**\n * Source code for rendering error messages of form nodes\n */\nexport interface FormNodeErrorMessageSource {\n  /** Render error message */\n  render: (slotsOverrides?: FormNodeErrorSlotsSource) => VNodeArrayChildren;\n  /**\n   * Error object\n   *\n   * @see {@link FormNodeError}\n   */\n  error: FormNodeError;\n  /**\n   * Node holding the error\n   *\n   * @see {@link FormNodeControl}\n   */\n  node: FormNodeControl;\n  /**\n   * Automatically generated key\n   *\n   * Can be safely used as the key for the vnode when rendering in lists, etc.\n   */\n  key: string;\n}\n\nlet _mountedId = 0;\n\n/**\n * Base class for all form nodes\n */\nexport class FormNodeControl<\n  T = any,\n  D = T,\n  Required extends Prop<any> = BooleanConstructor,\n> {\n  readonly _props: FormNodeProps;\n\n  readonly _service: VueFormService;\n\n  readonly nodeType?: FormNodeType;\n\n  readonly __multiple: boolean;\n\n  protected _isMounted = ref(false);\n\n  protected _mountedId = ref<number>();\n\n  protected _ctx: FormNodeContext<T, D>;\n\n  protected _parentNode: FormNodeControl | null;\n\n  protected _parentForm: VueForm | null;\n\n  protected _parentFormGroup: FormGroupControl | null;\n\n  protected _parentFormNodeWrapper: FormNodeWrapper | null;\n\n  protected _booted = ref(false);\n\n  protected _name: ComputedRef<string | undefined>;\n\n  protected _value: Ref<T | D>;\n\n  protected _initialValue: Ref<T | D>;\n\n  protected _focused = ref(false);\n\n  protected _children: Ref<FormNodeControl[]> = ref([]);\n\n  protected _invalidChildren: ComputedRef<FormNodeControl[]>;\n\n  protected _finalizePromise: Ref<(() => Promise<void>) | null> = ref(null);\n\n  protected _validationErrors: Ref<ValidationError[]> = ref([]);\n\n  protected _validateResolvers: ValidateResolver[] = [];\n\n  protected _lastValidateValueChanged = true;\n\n  protected _validating = ref(false);\n\n  protected _validateRequestId = 0;\n\n  protected _isDestroyed = false;\n\n  protected _dirty: ComputedRef<boolean>;\n\n  protected _touched = ref(false);\n\n  protected _shouldValidate = ref(false);\n\n  protected _currentValue: WritableComputedRef<T | D>;\n\n  protected _errorMessages: ComputedRef<string[]>;\n\n  protected _errors: ComputedRef<FormNodeError[]>;\n\n  protected _resolvedErrorMessages: ComputedRef<FormNodeErrorMessageSource[]>;\n\n  protected _errorCount: ComputedRef<number>;\n\n  protected _isDisabled: ComputedRef<boolean>;\n\n  protected _isReadonly: ComputedRef<boolean>;\n\n  protected _isViewonly: ComputedRef<boolean>;\n\n  protected _canOperation: ComputedRef<boolean>;\n\n  protected _rules: ComputedRef<VerifiableRule[]>;\n\n  protected _hasRequired: ComputedRef<boolean>;\n\n  protected _tabindex: ComputedRef<number>;\n\n  protected _cii: ComponentInternalInstance | null = null;\n\n  protected _validationValueGetter?: () => any;\n\n  protected _shouldSkipValidation = false;\n\n  protected _stateExtensions: FormNodeStateExtensions;\n\n  protected _requiredFactory: () => Rule<any> | undefined;\n\n  /**\n   * Root service of `vue-form-control`\n   *\n   * @see {@link VueFormService}\n   */\n  get service() {\n    return this._service;\n  }\n\n  /**\n   * form node name\n   *\n   * This is set as is for input elements.\n   */\n  get name(): string | undefined {\n    return this._name.value;\n  }\n\n  /**\n   * Tag string for node searching\n   */\n  get tag(): string | undefined {\n    return this._props.tag;\n  }\n\n  /** Parent node */\n  get parentNode(): FormNodeControl | null {\n    return this._parentNode;\n  }\n\n  /** Parent form group */\n  get parentFormGroup(): FormGroupControl | null {\n    return this._parentFormGroup;\n  }\n\n  /** Parent form node wrapper */\n  get parentFormNodeWrapper(): FormNodeWrapper | null {\n    return this._parentFormNodeWrapper;\n  }\n\n  /** Parent form */\n  get parentForm(): VueForm | null {\n    return this._parentForm;\n  }\n\n  /** Automatic focus */\n  get autofocus(): boolean {\n    return this._props.autofocus;\n  }\n\n  /**\n   * Detached and independent from the parent node\n   */\n  get detached(): boolean {\n    return this._props.detach;\n  }\n\n  /**\n   * Component created\n   *\n   * @remarks\n   * Please be aware that it may not have been mounted yet.\n   */\n  get booted(): boolean {\n    return this._booted.value;\n  }\n\n  /** Component mounted */\n  get isMounted(): boolean {\n    return this._isMounted.value;\n  }\n\n  /** If already mounted, its unique ID. */\n  get mountedId(): number | undefined {\n    return this._mountedId.value;\n  }\n\n  /** If already mounted, its unique ID. */\n  get mountedNodeId(): string | undefined {\n    const { mountedId } = this;\n    return mountedId ? `_vfc-node-${mountedId}` : undefined;\n  }\n\n  /** Finalizing the value adjustment process */\n  get isFinalizing(): boolean {\n    return !!this._finalizePromise.value;\n  }\n\n  /** Validating the value */\n  get validating(): boolean {\n    return this._validating.value;\n  }\n\n  /**\n   * Pending processing\n   *\n   * This is marked as `true` during the validation and finalization process of the value\n   */\n  get pending(): boolean {\n    return this.validating || this.isFinalizing;\n  }\n\n  /** Current input value */\n  get value(): T | D {\n    return this._currentValue.value;\n  }\n\n  set value(value) {\n    this._currentValue.value = value;\n  }\n\n  /** Value used for validation */\n  get validationValue(): any {\n    if (this._validationValueGetter) {\n      return this._validationValueGetter();\n    }\n    return this.value;\n  }\n\n  /** In focus */\n  get focused(): boolean {\n    return this._focused.value;\n  }\n\n  /**\n   * Initial value before commit\n   *\n   * This value, once initialized with the value passed when the FormNode is instantiated, will not be modified from within the vue-form-control package internals.\n   * Calling the commit series of methods from the application side updates the value to its state at that moment.\n   *\n   * @see {@link FormNodeControl.commitSelfValue commitSelfValue}\n   * @see {@link FormNodeControl.commitValue commitValue}\n   * @see {@link FormNodeControl.commitSelf commitSelf}\n   * @see {@link FormNodeControl.commit commit}\n   */\n  get initialValue(): T | D {\n    return this._initialValue.value;\n  }\n\n  /**\n   * The changes to the input value have not been committed yet\n   *\n   * @see {@link FormNodeControl.initialValue initialValue}\n   */\n  get dirty(): boolean {\n    return this._dirty.value;\n  }\n\n  /**\n   * The input value has not been changed from its initial value\n   */\n  get pristine(): boolean {\n    return !this.dirty;\n  }\n\n  /**\n   * Touched the elements of this node at least once\n   */\n  get touched(): boolean {\n    return this._touched.value;\n  }\n\n  set touched(touched) {\n    if (this._touched.value !== touched) {\n      this._touched.value = touched;\n      if (\n        (touched && this.validateTimingIsTouch) ||\n        this.validateTimingIsAlways\n      ) {\n        this.validateSelf();\n      }\n    }\n  }\n\n  /**\n   * Not touched the elements of this node yet.\n   */\n  get untouched(): boolean {\n    return !this.touched;\n  }\n\n  /**\n   * The list of FormNode instances directly belonging to this node as children\n   */\n  get children(): FormNodeControl[] {\n    return this._children.value;\n  }\n\n  /**\n   * The list of FormNode instances directly belonging to itself, and possessing one or more errors\n   */\n  get invalidChildren(): FormNodeControl[] {\n    return this._invalidChildren.value;\n  }\n\n  /**\n   * The list of validation errors for the value within itself\n   */\n  get validationErrors(): ValidationError[] {\n    return this._validationErrors.value;\n  }\n\n  /**\n   * The list of all errors within itself\n   *\n   * This is a merged list of error messages injected through properties and its own `validationErrors`.\n   *\n   * @remarks\n   * This list does not include error information specified with the `error` attribute.\n   */\n  get errors(): FormNodeError[] {\n    return this._errors.value;\n  }\n\n  /**\n   * Source code for all collected error messages\n   *\n   * This list is generated based on the setting of {@link FormNodeControl.showOwnErrors showOwnErrors}.\n   *\n   * @see {@link FormNodeErrorMessageSource}\n   */\n  get errorMessages(): FormNodeErrorMessageSource[] {\n    return this._resolvedErrorMessages.value;\n  }\n\n  /**\n   * Source code for the first error message among all collected messages\n   *\n   * This list is generated based on the setting of {@link FormNodeControl.showOwnErrors showOwnErrors}.\n   *\n   * @see {@link FormNodeErrorMessageSource}\n   */\n  get firstErrorMessage(): FormNodeErrorMessageSource | undefined {\n    return this.errorMessages[0];\n  }\n\n  /**\n   * Whether itself has one or more errors\n   *\n   * @remarks\n   * This also takes into consideration the configuration of the `error` property.\n   */\n  get hasMyError(): boolean {\n    return this.errorCount > 0;\n  }\n\n  /**\n   * The number of errors it possesses\n   */\n  get errorCount(): number {\n    return this._errorCount.value;\n  }\n\n  /**\n   * Either itself or the parent node has one or more errors.\n   */\n  get hasError(): boolean {\n    return this.hasMyError || (!this.detached && !!this.parentNode?.hasMyError);\n  }\n\n  /**\n   * Either itself or the parent node is in a disabled state.\n   */\n  get isDisabled(): boolean {\n    return this._isDisabled.value;\n  }\n\n  /**\n   * Either itself or the parent node is in a read-only state.\n   */\n  get isReadonly(): boolean {\n    return this._isReadonly.value;\n  }\n\n  /**\n   * Either itself or the parent node is in a view-only state.\n   */\n  get isViewonly(): boolean {\n    return this._isViewonly.value;\n  }\n\n  /**\n   * Operable\n   */\n  get canOperation(): boolean {\n    return this._canOperation.value;\n  }\n\n  /**\n   * Validation Timing\n   *\n   *@see {@link ValidateTiming}\n   */\n  get validateTiming(): ValidateTiming {\n    return this._props.validateTiming;\n  }\n\n  /**\n   * Always perform value validation.\n   */\n  get validateTimingIsAlways(): boolean {\n    return this.validateTiming === 'always';\n  }\n\n  /**\n   * Perform value validation only when the elements of this node have been touched at least once.\n   */\n  get validateTimingIsTouch(): boolean {\n    return this.validateTiming === 'touch';\n  }\n\n  /**\n   * Perform value validation when focus is removed from the elements of this node.\n   */\n  get validateTimingIsBlur(): boolean {\n    return this.validateTiming === 'blur';\n  }\n\n  /**\n   * Perform value validation when the input value changes.\n   */\n  get validateTimingIsChange(): boolean {\n    return this.validateTiming === 'change';\n  }\n\n  /**\n   * Value validation is manually performed on the application side.\n   */\n  get validateTimingIsManual(): boolean {\n    return this.validateTiming === 'manual';\n  }\n\n  /**\n   * The list of all rules, including those specified in the properties under 'rules' and others calculated from values related to rule logic.\n   */\n  get rules(): VerifiableRule[] {\n    return this._rules.value;\n  }\n\n  /**\n   * Input is required\n   *\n   * @remarks\n   * This checks whether there is at least one 'required' rule in the 'required' setting or within the specified 'rules'.\n   */\n  get isRequired(): boolean {\n    return this._hasRequired.value;\n  }\n\n  /**\n   * The component has been destroyed\n   */\n  get isDestroyed(): boolean {\n    return this._isDestroyed;\n  }\n\n  /**\n   * There is at least one node in an error state among the nodes directly under this node\n   */\n  get hasInvalidChild(): boolean {\n    return this.invalidChildren.length > 0;\n  }\n\n  /**\n   * Either this node or one of its descendants has an error\n   */\n  get invalid(): boolean {\n    return this.hasMyError || this.hasInvalidChild;\n  }\n\n  /**\n   * This node and none of its descendants have an error\n   */\n  get valid(): boolean {\n    return !this.invalid;\n  }\n\n  /**\n   * Tab index\n   *\n   * When the node is disabled, it is forcibly set to `-1`.\n   */\n  get tabindex(): number {\n    return this._tabindex.value;\n  }\n\n  /**\n   * Spell Check Settings\n   *\n   * @see https://developer.mozilla.org/docs/Web/HTML/Global_attributes/spellcheck\n   */\n  get spellcheck(): boolean {\n    return this._props.spellcheck;\n  }\n\n  /**\n   * The input value should be validated\n   *\n   * This varies based on the specified `validateTiming` and the user's interaction status.\n   */\n  get shouldValidate(): boolean {\n    return this._shouldValidate.value;\n  }\n\n  /**\n   * The form to which this node belongs is currently executing an asynchronous submission action\n   *\n   * @remarks\n   * If the `detach` option is set, this will always be `false`.\n   */\n  get sending(): boolean {\n    return (\n      (!this.detached && !!this._parentForm && this._parentForm.sending) ||\n      false\n    );\n  }\n\n  /**\n   * The current Vue instance initializing this node\n   */\n  get currentInstance(): ComponentInternalInstance | null {\n    return this._cii;\n  }\n\n  /**\n   * The host element of the current Vue instance initializing this node\n   */\n  get currentEl(): HTMLElement | null {\n    const { currentInstance } = this;\n    return currentInstance && (currentInstance.vnode.el as HTMLElement | null);\n  }\n\n  /**\n   * Multiple input mode\n   */\n  get multiple(): boolean {\n    return this.__multiple;\n  }\n\n  /**\n   * Display error messages on this node itself\n   */\n  get showOwnErrors(): boolean {\n    const { showOwnErrors } = this._props;\n    if (showOwnErrors === false) return false;\n    if (showOwnErrors) return true;\n    if (this.parentFormGroup?.collectErrorMessages) {\n      return false;\n    }\n    return !this.parentFormNodeWrapper?.collectErrorMessages;\n  }\n\n  /**\n   * Whether to temporarily skip validation.\n   * Useful for internal operations where validation is not needed.\n   */\n  get shouldSkipValidation(): boolean {\n    return (\n      (this._shouldSkipValidation ||\n        this._resetGuard ||\n        (!this.detached && this.parentNode?.shouldSkipValidation)) ??\n      false\n    );\n  }\n\n  readonly shallow: boolean;\n\n  constructor(\n    props: FormNodeProps,\n    ctx: FormNodeContext<T, D>,\n    options: FormNodeControlOptions<T, D, Required>,\n  ) {\n    markRaw(this);\n\n    this.shallow = options?.shallow ?? false;\n    this._value = options?.shallow ? shallowRef(null as any) : ref(null as any);\n    this._initialValue = options?.shallow\n      ? shallowRef(null as any)\n      : ref(null as any);\n    this._props = props;\n    this._service = useVueForm();\n    this._ctx = ctx;\n\n    const { nodeType, stateExtensions } = options;\n\n    this.__multiple = (props as any).multiple || false;\n    this._name = computed(() => props.name);\n    this.nodeType = nodeType;\n    this._requiredFactory = options.requiredFactory || (() => requiredRule);\n    this._validationValueGetter = options.validationValue;\n    this._stateExtensions = stateExtensions || {};\n\n    const parentNode = useParentFormNode();\n    const parentFormNodeWrapper = useParentFormNodeWrapper();\n    const parentFormGroup = useParentFormGroup();\n    const parentForm = useParentForm();\n\n    this._parentNode = parentNode;\n    this._parentFormNodeWrapper = parentFormNodeWrapper;\n    this._parentFormGroup = parentFormGroup;\n    this._parentForm = parentForm;\n\n    this._dirty = computed(\n      () => !cheepDeepEqual(this.value, this.initialValue),\n    );\n\n    onMounted(() => {\n      this._isMounted.value = true;\n      this._mountedId.value = ++_mountedId;\n      this._cii = getCurrentInstance();\n    });\n\n    provide(FormNodeInjectionKey, this);\n\n    this._currentValue = computed<T | D>({\n      get: () => this._value.value,\n      set: (value) => {\n        this.setValue(value as T | D);\n      },\n    });\n\n    this._errorMessages = computed(() => {\n      const { errorMessages = [] } = props;\n      const messages = Array.isArray(errorMessages)\n        ? errorMessages\n        : [errorMessages];\n\n      // @NOTE \"Without delay, the form node's state cannot be referenced by the options user.\"\n      if (!this.booted) return messages;\n\n      const moreMessages = options.errorMessages?.();\n      if (moreMessages) {\n        if (Array.isArray(moreMessages)) {\n          messages.push(...moreMessages);\n        } else {\n          messages.push(moreMessages);\n        }\n      }\n      return messages;\n    });\n\n    this._errors = computed(() => [\n      ...this._errorMessages.value.map(toFormNodeError),\n      ...this.validationErrors,\n    ]);\n\n    this._resolvedErrorMessages = computed(() =>\n      this.showOwnErrors\n        ? this.errors.map((error, index) =>\n            this._createFormNodeErrorMessageSource(error, index),\n          )\n        : [],\n    );\n\n    this._invalidChildren = computed(() =>\n      this.children.filter((node) => node.invalid),\n    );\n\n    this._errorCount = computed(() => {\n      const baseCount = props.error ? 1 : 0;\n      return this.errors.length + baseCount;\n    });\n\n    this._isDisabled = computed(() => {\n      const isDisabled =\n        props.disabled ||\n        (!this.detached && !!parentNode && parentNode.isDisabled) ||\n        this.sending;\n\n      const { disabled } = this._stateExtensions;\n      return disabled ? disabled(this, isDisabled) : isDisabled;\n    });\n\n    this._isReadonly = computed(() => {\n      const isReadonly =\n        props.readonly ||\n        (!this.detached && !!parentNode && parentNode.isReadonly);\n      const { readonly: readonlyFn } = this._stateExtensions;\n      return readonlyFn ? readonlyFn(this, isReadonly) : isReadonly;\n    });\n\n    this._isViewonly = computed(() => {\n      const isViewonly =\n        props.viewonly ||\n        (!this.detached && !!parentNode && parentNode.isViewonly);\n      const { viewonly: viewonlyFn } = this._stateExtensions;\n      return viewonlyFn ? viewonlyFn(this, isViewonly) : isViewonly;\n    });\n\n    this._canOperation = computed(() => {\n      const canOperation =\n        !this.isDisabled && !this.isReadonly && !this.isViewonly;\n\n      const { canOperation: canOperationFn } = this._stateExtensions;\n      return canOperationFn ? canOperationFn(this, canOperation) : canOperation;\n    });\n\n    this._rules = computed(() => this._resolveRules());\n\n    this._hasRequired = computed(\n      () => !!this._props.required || !!this.hasRequiredRule(),\n    );\n\n    this._tabindex = computed(() =>\n      this.isDisabled ? -1 : toInt(props.tabindex),\n    );\n\n    (\n      [\n        '_syncValueFromProps',\n        'focus',\n        'blur',\n        'validateSelf',\n        'validate',\n      ] as const\n    ).forEach((fn) => {\n      const _fn = this[fn];\n      this[fn] = _fn.bind(this) as any;\n    });\n\n    this.setShouldValidate(this.validateTimingIsAlways);\n\n    watch(() => props.modelValue, this._syncValueFromProps, {\n      immediate: true,\n    });\n    this._initialValue.value = this.shallow\n      ? this._value.value\n      : (cheepClone(this._value.value) as any);\n\n    watch(\n      () => props.validateTiming,\n      () => {\n        if (\n          this.validateTimingIsAlways ||\n          (this.touched && this.validateTimingIsTouch) ||\n          (this.dirty && this.validateTimingIsChange)\n        ) {\n          this.validateSelf();\n        }\n      },\n      { immediate: true },\n    );\n\n    const onValidateValueChange = () => {\n      this._lastValidateValueChanged = true;\n      if (this.shouldSkipValidation) return;\n\n      if (\n        this.shouldValidate ||\n        (this.isMounted && this.validateTimingIsChange) ||\n        this.validateTimingIsAlways\n      ) {\n        this.validateSelf();\n      }\n    };\n\n    watch(() => this.validationValue, onValidateValueChange, {\n      immediate: true,\n    });\n\n    watch(\n      () => this.value,\n      (value) => {\n        // onValidateValueChange();\n        this._ctx.emit('change', value as any);\n      },\n      { immediate: true },\n    );\n\n    watch(\n      () =>\n        props.validationDeps && props.validationDeps(this as FormNodeControl),\n      onValidateValueChange,\n      // { deep: true },\n    );\n\n    watch(\n      () => this.errors,\n      (errors) => {\n        ctx.emit('update:errors', errors);\n      },\n      { immediate: true },\n    );\n\n    parentFormNodeWrapper?.__joinFromNode(this);\n\n    if (!this.detached) {\n      parentFormGroup?.__joinFromNode(this);\n      parentNode?._joinFromNode(this);\n    }\n\n    watch(\n      () => props.detach,\n      (detached) => {\n        if (detached) {\n          parentFormGroup?.__leaveFromNode(this);\n          parentNode?._leaveFromNode(this);\n        } else {\n          parentFormGroup?.__joinFromNode(this);\n          parentNode?._joinFromNode(this);\n        }\n      },\n    );\n\n    watch(\n      () => this.rules,\n      (currentRules, beforeRules) => {\n        if (this.shouldValidate && rulesHasChanged(currentRules, beforeRules)) {\n          this.validateSelf(true);\n        }\n      },\n    );\n\n    onBeforeMount(() => {\n      this._booted.value = true;\n    });\n\n    onBeforeUnmount(() => {\n      this.clearValidateResolvers();\n      parentNode?._leaveFromNode(this);\n      parentFormGroup?.__leaveFromNode(this);\n      parentFormNodeWrapper?.__leaveFromNode(this);\n      this._finalizePromise.value = null;\n      this.resetSelfValidates();\n      this._parentNode = null;\n      this._parentFormNodeWrapper = null;\n      this._parentFormGroup = null;\n      this._parentForm = null;\n      this._cii = null;\n      this._isDestroyed = true;\n      delete (this as any)._props;\n      delete (this as any)._ctx;\n      delete (this as any)._service;\n      delete (this as any)._requiredFactory;\n    });\n\n    (['focusHandler', 'blurHandler'] as const).forEach((fn) => {\n      this[fn] = this[fn].bind(this);\n    });\n  }\n\n  /** @internal */\n  _createFormNodeErrorMessageSource(\n    error: FormNodeError,\n    index: number,\n    slotsOverrides?: FormNodeErrorSlotsSource,\n  ): FormNodeErrorMessageSource {\n    return {\n      render: (_slotsOverrides) =>\n        this.renderErrorSource(error, {\n          ...slotsOverrides,\n          ..._slotsOverrides,\n        }),\n      error,\n      node: this,\n      key: `${String(this.nodeType)}:${this.name}:${this.tag}:${\n        error.name\n      }:${index}`,\n    };\n  }\n\n  protected hasRequiredRule() {\n    return this.findRule(HAS_REQUIRED_RULE_RE);\n  }\n\n  /**\n   * Recursively searches and retrieves the FormNode belonging to this node.\n   *\n   * @param predicate - Predicate executed recursively on descendant elements\n   */\n  findNodeRecursive(\n    predicate: (node: FormNodeControl) => unknown,\n  ): FormNodeControl | undefined {\n    for (const child of this.children) {\n      if (predicate(child)) return child;\n      const hit = child.findNodeRecursive(predicate);\n      if (hit) return hit;\n    }\n  }\n\n  /**\n   * Recursively retrieves all FormNodes belonging to this node.\n   *\n   * @param predicate - Predicate executed recursively on descendant elements\n   */\n  filterNodesRecursive(\n    predicate: (node: FormNodeControl) => unknown,\n  ): FormNodeControl[] {\n    const hits: FormNodeControl[] = [];\n    for (const child of this.children) {\n      if (predicate(child)) hits.push(child);\n      hits.push(...child.filterNodesRecursive(predicate));\n    }\n    return hits;\n  }\n\n  /**\n   * Search for a node within this node that matches the specified name\n   *\n   * @param name Node name\n   */\n  findNodeByName(name: string): FormNodeControl | undefined {\n    return this.findNodeRecursive((node) => node.name === name);\n  }\n\n  /**\n   * Search for a node within this node that matches the specified tag\n   *\n   * @param tag Tag string\n   */\n  findNodeByTag(tag: string): FormNodeControl | undefined {\n    return this.findNodeRecursive((node) => node.tag === tag);\n  }\n\n  protected _getContextOrDie() {\n    const { _ctx } = this;\n    if (!_ctx) throw new Error('missing form node context');\n    return _ctx;\n  }\n\n  /**\n   * Render the specified error source as a `VNodeArrayChildren`\n   *\n   * @param errorSource - string or FormNodeError\n   */\n  renderErrorSource(\n    errorSource: string | FormNodeError,\n    slotsOverrides?: FormNodeErrorSlotsSource,\n  ): VNodeArrayChildren {\n    const { slots } = this._getContextOrDie();\n    const error =\n      typeof errorSource === 'string'\n        ? toFormNodeError(errorSource)\n        : errorSource;\n    if (slotsOverrides) {\n      const slot =\n        slotsOverrides[`error:${error.name}`] || slotsOverrides.error;\n      const message = cleanupEmptyVNodeChild(slot?.(error));\n      if (message) return message;\n    }\n    const slot = slots[`error:${error.name}`] || slots.error;\n    if (slot) {\n      const message = cleanupEmptyVNodeChild(slot?.(error));\n      if (message) return message;\n    }\n    return (\n      cleanupEmptyVNodeChild(this.service.resolveErrorMessage(error, this)) || [\n        error.message,\n      ]\n    );\n  }\n\n  protected _finalize(): Promise<void> {\n    return Promise.resolve();\n  }\n\n  /**\n   * Finalize the input value\n   */\n  finalize(): Promise<void> {\n    const getter = this._finalizePromise.value;\n    if (getter) return getter();\n    const promise = this._finalize().finally(() => {\n      this._finalizePromise.value = null;\n    });\n    this._finalizePromise.value = () => promise;\n    return promise;\n  }\n\n  /**\n   * Ensure that the input value is finalized\n   */\n  ensureFinalized(): Promise<void> {\n    const currentFinalize = this._finalizePromise.value?.();\n    return currentFinalize || this.finalize();\n  }\n\n  /**\n   * Ensure that the value of the self-node and all its child nodes is finalized\n   */\n  async finalizeAll(): Promise<void> {\n    await Promise.all([\n      this.ensureFinalized(),\n      ...this.children.map((node) => node.ensureFinalized()),\n    ]);\n  }\n\n  /**\n   * Set the value\n   *\n   * @param value - value\n   */\n  setValue(value: T | D): boolean {\n    if (this.shallow) {\n      this._value.value = value;\n      this._ctx.emit('update:modelValue', value);\n      return true;\n    }\n\n    if (!cheepDeepEqual(this._value.value, value)) {\n      const v = cheepClone(value);\n      this._value.value = v as any;\n      this._ctx.emit('update:modelValue', v as any);\n      return true;\n    }\n    return false;\n  }\n\n  protected _syncValueFromProps(value: any) {\n    const safeValue = this.safeModelValue(value);\n    this._value.value = this.shallow\n      ? safeValue\n      : (cheepClone(safeValue) as any);\n  }\n\n  protected _resolveRules(): VerifiableRule[] {\n    const { rules: propRules, required } = this._props;\n    const rules = flattenRecursiveArray(propRules).map(resolveVerifiableRule);\n\n    if (required) {\n      const requiredRule = this._requiredFactory();\n      requiredRule && rules.unshift(requiredRule);\n    }\n\n    rules.sort((a, b) => {\n      const { $name: an } = a;\n      const { $name: bn } = b;\n      if (an === 'required') return -1;\n      if (bn === 'required') return 1;\n      return 0;\n    });\n    return rules;\n  }\n\n  /**\n   * Set the validation execution necessity\n   *\n   * @param shouldValidate - The input value should be validated\n   */\n  setShouldValidate(shouldValidate: boolean): void {\n    if (this.shouldValidate !== shouldValidate) {\n      this._shouldValidate.value = shouldValidate;\n    }\n  }\n\n  /**\n   * Retrieve the default value when there is no input value\n   */\n  emptyValue(): T | D {\n    return null as unknown as T | D;\n  }\n\n  /**\n   * If the specified value is nullable, return `emptyValue`; otherwise, return the specified value as is\n   *\n   * @param value - Any value\n   */\n  safeModelValue(value: any): T | D {\n    if (value == null) {\n      return this.emptyValue();\n    }\n    return value;\n  }\n\n  /**\n   * Find and retrieve a rule corresponding to the specified name or a name matching the regular expression\n   *\n   * @param ruleName - Name or regular expression\n   */\n  findRule(ruleName: string | RegExp): VerifiableRule | undefined {\n    return this.rules.find((r) => {\n      const { $name } = r;\n      return typeof ruleName === 'string'\n        ? ruleName === $name\n        : ruleName.test($name);\n    });\n  }\n\n  /**\n   * Reset the input value of this node to the initial value or the value at the last commit, whichever is applicable\n   *\n   * @see {@link FormNodeControl.initialValue initialValue}\n   *\n   * @remarks\n   * This method does not reset the validation state. Typically, consider using {@link FormNodeControl.resetSelf resetSelf}.\n   */\n  resetSelfValue(): void {\n    this.value = cheepClone(this.initialValue);\n  }\n\n  /**\n   * Reset the input value of this node and all its descendant nodes to the initial value or the value at the last commit, whichever is applicable\n   *\n   * @see {@link FormNodeControl.resetSelfValue resetSelfValue}\n   *\n   * @remarks\n   * This method does not reset the validation state. Typically, consider using {@link FormNodeControl.resetSelf reset}.\n   */\n  resetValue(): void {\n    this.resetSelfValue();\n    this.children.forEach((child) => child.resetValue());\n  }\n\n  /**\n   * Set the current input value as the initial value for this node.\n   *\n   * @remarks\n   * This method does not reset the validation state. Typically, consider using {@link FormNodeControl.commitSelf commitSelf}.\n   */\n  commitSelfValue(): void {\n    this._initialValue.value = cheepClone(this.value);\n  }\n\n  /**\n   * Set the current input value as the initial value for this node and all its descendant nodes\n   *\n   * @remarks\n   * This method does not reset the validation state. Typically, consider using {@link FormNodeControl.commit commit}.\n   */\n  commitValue(): void {\n    this.commitSelfValue();\n    this.children.forEach((child) => child.commitValue());\n  }\n\n  private _resetGuard: boolean = false;\n\n  /**\n   * Reset the validation state of this node\n   *\n   * @remarks\n   * This method does not perform a reset on descendant nodes. Typically, consider using {@link FormNodeControl.resetValidates resetValidates}.\n   */\n  resetSelfValidates(): void {\n    this._validationErrors.value = [];\n    this._lastValidateValueChanged = true;\n    this.touched = false;\n    this.setShouldValidate(false);\n    this._resetGuard = true;\n    nextTick(() => {\n      if (this.isDestroyed) return;\n      this.setShouldValidate(this.validateTimingIsAlways);\n      this._resetGuard = false;\n      if (this.validateTimingIsAlways) {\n        this.validateSelf();\n      }\n    });\n  }\n\n  /**\n   * Reset the validation state of this node and all its descendant nodes\n   */\n  resetValidates(): void {\n    this.resetSelfValidates();\n    this.children.forEach((child) => child.resetValidates());\n  }\n\n  /**\n   * Reset the input value of this node to the initial value and reset the validation state\n   *\n   * @remarks\n   * This method does not reset the state of descendant nodes. Typically, consider using {@link FormNodeControl.reset reset}.\n   */\n  resetSelf(): void {\n    this.resetSelfValue();\n    this.resetSelfValidates();\n  }\n\n  /**\n   * Execute any process while skipping ongoing asynchronous validation, if any\n   *\n   * @param fn - The function to be executed\n   */\n  skipValidation(fn: (...args: any) => any): Promise<void> {\n    return new Promise<void>((resolve, reject) => {\n      try {\n        this._shouldSkipValidation = true;\n        fn();\n        setTimeout(() => {\n          this._shouldSkipValidation = false;\n          resolve();\n        });\n      } catch (_err) {\n        this._shouldSkipValidation = false;\n        reject(_err);\n      }\n    });\n  }\n\n  /**\n   * Reset the input value of this node and all its descendant nodes to the initial value and reset the validation state\n   */\n  reset(): Promise<void> {\n    return this.skipValidation(() => this.resetValue()).then(() => {\n      this.resetValidates();\n    });\n  }\n\n  /**\n   * Clear the input value of this node\n   */\n  clearSelf(): void {\n    this.value = this.emptyValue() as any;\n  }\n\n  /**\n   * Clear the input value of this node and all its descendant nodes\n   */\n  clear(): void {\n    this.clearSelf();\n    this.children.forEach((child) => child.clear());\n  }\n\n  /**\n   * Set the current input value of this node as the initial value and reset the validation state\n   *\n   * @remarks\n   * This method does not reset the state of descendant nodes. Typically, consider using {@link FormNodeControl.commit commit}.\n   */\n  commitSelf(): void {\n    this.commitSelfValue();\n    this.resetSelfValidates();\n  }\n\n  /**\n   * Set the current input value as the initial value for this node and all its descendant nodes, and reset the validation state\n   */\n  commit(): void {\n    this.commitValue();\n    this.resetValidates();\n  }\n\n  focus(opts?: FocusOptions): void {}\n\n  blur(): void {}\n\n  protected _forceFinalize(): boolean | undefined {\n    return undefined;\n  }\n\n  /**\n   * Execute validation for this node and all its descendant nodes, and retrieve the validation results\n   *\n   * @param force - Force execution\n   * @param forceFinalize - Always finalize the value before validation\n   *\n   * @returns If validation is successful, return `true`.\n   */\n  async validate(\n    force?: boolean,\n    forceFinalize: boolean | undefined = this._forceFinalize(),\n  ): Promise<boolean> {\n    await Promise.all([\n      this.validateSelf(force, forceFinalize),\n      this.validateChildren(force, forceFinalize),\n    ]);\n    return this.valid;\n  }\n\n  /**\n   * Validate all nodes belonging to this node\n   *\n   * @remarks\n   * Typically, consider using {@link FormNodeControl.validate validate}.\n   *\n   * @param force - Force execution\n   * @param forceFinalize - Always finalize the value before validation\n   */\n  validateChildren(\n    force?: boolean,\n    forceFinalize: boolean | undefined = this._forceFinalize(),\n  ): Promise<boolean[]> {\n    return Promise.all(\n      this.children.map((node) => node.validate(force, forceFinalize)),\n    );\n  }\n\n  protected _allowFinalize(): boolean {\n    return true;\n  }\n\n  /**\n   * Validate the input value of this node\n   *\n   * This method usually cancels execution and returns the previous result in the following conditions:\n   *\n   * - The value for validation has not changed since the last validation.\n   * - Currently, asynchronous validation is in progress.\n   *\n   * If you want to ignore this and force validation, specify `true` for the `force` argument\n   *\n   * @param force - Force execution\n   * @param forceFinalize - Always finalize the value before validation\n   *\n   * @returns Validation result (either the list of validation errors or null).\n   *\n   * @remarks\n   * This method does not perform a reset on descendant nodes. Typically, consider using {@link FormNodeControl.validate validate}.\n   */\n  validateSelf(\n    force?: boolean,\n    forceFinalize: boolean | undefined = this._forceFinalize(),\n  ): Promise<ValidationResult> {\n    return new Promise(async (resolve) => {\n      this.setShouldValidate(true);\n      if (!force && !this._lastValidateValueChanged && !this.validating) {\n        resolve(this.validationErrors);\n        return;\n      }\n\n      this._validateResolvers.push(resolve);\n\n      if (!force && !this._lastValidateValueChanged) {\n        return;\n      }\n\n      this._validateRequestId++;\n      const requestId = this._validateRequestId;\n      this._validating.value = true;\n\n      const { rules } = this;\n\n      const currentFinalizePromise = this._finalizePromise.value?.();\n      if (currentFinalizePromise) {\n        await currentFinalizePromise;\n      } else if (forceFinalize || !this.focused) {\n        await this.finalize();\n      }\n\n      const result = (await validate(this.validationValue, rules)) || [];\n\n      if (this.isDestroyed) {\n        result.length = 0;\n      }\n      if (requestId !== this._validateRequestId) {\n        return;\n      }\n      const { validationErrors } = this;\n      validationErrors.splice(0, validationErrors.length, ...result);\n      this._lastValidateValueChanged = false;\n      this._validating.value = false;\n      this.resolveValidateResolvers();\n    });\n  }\n\n  private resolveValidateResolvers(): void {\n    this._validateResolvers.forEach((resolver) =>\n      resolver(this.validationErrors),\n    );\n    this.clearValidateResolvers();\n  }\n\n  private clearValidateResolvers(): void {\n    this._validateResolvers = [];\n  }\n\n  /** @internal */\n  _joinFromNode(node: FormNodeControl): void {\n    const { children } = this;\n    if (!children.includes(node)) {\n      children.push(node);\n    }\n  }\n\n  /** @internal */\n  _leaveFromNode(node: FormNodeControl): void {\n    arrayRemove(this.children, node);\n  }\n\n  focusHandler(ev: FocusEvent): void {\n    const before = this.focused;\n    this._focused.value = true;\n    this._touched.value = true;\n\n    if (\n      (!before && this.validateTimingIsTouch) ||\n      this.validateTimingIsAlways\n    ) {\n      this.validateSelf();\n    }\n    this._ctx.emit('focus', ev);\n  }\n\n  blurHandler(ev: FocusEvent): void {\n    if (!this._ctx) return;\n    const before = this.focused;\n    this._focused.value = false;\n    if ((before && this.validateTimingIsBlur) || this.validateTimingIsAlways) {\n      this.validateSelf();\n    }\n    this._ctx.emit('blur', ev);\n  }\n\n  /**\n   * Scroll to the visible position of the host element of this node\n   *\n   * @param options - options\n   */\n  scrollIntoView(options?: ScrollIntoViewOptions): void {\n    const { currentEl } = this;\n    currentEl && this.service.scrollToElement(currentEl, options);\n  }\n\n  /**\n   * Generate a Proxy instance that extends the interface for this node.\n   *\n   * @param trait - trait object\n   * @returns Mixed-in Proxy\n   */\n  extend<U extends object>(trait: U): Mixin<this, U> {\n    return mixin(this, trait);\n  }\n}\n\nexport function useParentFormNode() {\n  return inject(FormNodeInjectionKey, null);\n}\n\nexport function useFormNodeControl<T = any, D = T>(\n  props: FormNodeProps,\n  ctx: FormNodeContext<T, D>,\n  opts: FormNodeControlOptions<T, D>,\n) {\n  const control = new FormNodeControl<T, D>(props, ctx, opts);\n  return control;\n}\n","import { ExtractPropTypes, SetupContext, ComputedRef, computed } from 'vue';\nimport { createPropsOptions } from '@fastkit/vue-utils';\nimport { toInt, toNumber } from '@fastkit/helpers';\nimport { notLessThan, notGreaterThan, multipleOf } from '@fastkit/rules';\nimport {\n  createFormNodeProps,\n  FormNodeControl,\n  createFormNodeEmits,\n  FormNodeContext,\n  FormNodeControlBaseOptions,\n} from './node';\n\nconst minValue = notLessThan.fork({ name: 'min' });\nconst maxValue = notGreaterThan.fork({ name: 'max' });\nconst stepValue = multipleOf.fork({ name: 'step' });\n\nexport function createNumberInputNodeProps() {\n  return {\n    ...createFormNodeProps({\n      modelValue: Number,\n    }),\n    ...createPropsOptions({\n      value: String,\n      /** minimum value */\n      min: [String, Number],\n      /** greatest value */\n      max: [String, Number],\n      /** Input Value Steps */\n      step: {\n        type: [String, Number],\n        default: 1,\n      },\n      /** placeholder */\n      placeholder: String,\n    }),\n  };\n}\nexport type NumberInputNodeProps = ExtractPropTypes<\n  ReturnType<typeof createNumberInputNodeProps>\n>;\n\nexport function createNumberInputNodeEmits() {\n  return {\n    ...createFormNodeEmits({ modelValue: Number }),\n  };\n}\n\nexport function createNumberInputNodeSettings() {\n  const props = createNumberInputNodeProps();\n  const emits = createNumberInputNodeEmits();\n  return { props, emits };\n}\n\nexport interface NumberInputNodeEmitOptions extends ReturnType<\n  typeof createNumberInputNodeEmits\n> {}\n\nexport type NumberInputNodeContext = SetupContext<NumberInputNodeEmitOptions>;\n\nexport interface NumberInputNodeControlOptions extends FormNodeControlBaseOptions {}\n\nexport class NumberInputNodeControl extends FormNodeControl<number, undefined> {\n  readonly _props: NumberInputNodeProps;\n\n  protected _min: ComputedRef<number | undefined>;\n\n  protected _max: ComputedRef<number | undefined>;\n\n  protected _step: ComputedRef<number>;\n\n  get min() {\n    return this._min.value;\n  }\n\n  get max() {\n    return this._max.value;\n  }\n\n  get step() {\n    return this._step.value;\n  }\n\n  get placeholder() {\n    return this._props.placeholder;\n  }\n\n  constructor(\n    props: NumberInputNodeProps,\n    ctx: NumberInputNodeContext,\n    options: NumberInputNodeControlOptions = {},\n  ) {\n    super(props, ctx as unknown as FormNodeContext<number, undefined>, {\n      ...options,\n      modelValue: Number,\n    });\n    this._props = props;\n\n    this._min = computed(() => {\n      const { min } = props;\n      return min == null ? undefined : toInt(min);\n    });\n\n    this._max = computed(() => {\n      const { max } = props;\n      return max == null ? undefined : toInt(max);\n    });\n\n    this._step = computed(() => toNumber(props.step));\n  }\n\n  emptyValue() {\n    return undefined;\n  }\n\n  protected _resolveRules() {\n    const rules = super._resolveRules();\n    const { min, max, step } = this;\n    if (min != null) {\n      rules.push(minValue(min));\n    }\n    if (max != null) {\n      rules.push(maxValue(max));\n    }\n    rules.push(stepValue(step));\n    return rules;\n  }\n}\n\nexport function useNumberInputNodeControl(\n  props: NumberInputNodeProps,\n  ctx: NumberInputNodeContext,\n  options?: NumberInputNodeControlOptions,\n) {\n  const control = new NumberInputNodeControl(props, ctx, options);\n  return control;\n}\n","import { ExtractPropTypes, computed, PropType } from 'vue';\nimport { createPropsOptions } from '@fastkit/vue-utils';\nimport { FormNodeControlBaseOptions } from './node';\nimport { FormAutoComplete } from '../schemes';\n\nlet _defaultAutocomplete: FormAutoComplete | boolean | undefined;\n\n/**\n * Sets the default value for text input autocomplete.\n *\n * @param defaultAutocomplete - default value\n */\nexport function registerAutocompleteDefault(\n  defaultAutocomplete: FormAutoComplete | boolean | undefined,\n) {\n  _defaultAutocomplete = defaultAutocomplete;\n}\n\nexport function createAutocompletableInputProps() {\n  return {\n    ...createPropsOptions({\n      /**\n       * The HTML autocomplete attribute lets web developers specify what if any permission the [user agent](https://developer.mozilla.org/docs/Glossary/User_agent) has to provide automated assistance in filling out form field values, as well as guidance to the browser as to the type of information expected in the field.\n       *\n       * @see https://developer.mozilla.org/docs/Web/HTML/Attributes/autocomplete\n       */\n      autocomplete: {\n        type: [String, Boolean] as PropType<FormAutoComplete | boolean>,\n        default: () => _defaultAutocomplete,\n      },\n    }),\n  };\n}\nexport type AutocompletableInputProps = ExtractPropTypes<\n  ReturnType<typeof createAutocompletableInputProps>\n>;\n\nexport interface AutocompletableInputControlOptions extends FormNodeControlBaseOptions {}\n\nexport function createAutocompletableInputControl(\n  props: AutocompletableInputProps,\n) {\n  const computedAutocomplete = computed(() => {\n    let result: FormAutoComplete | undefined;\n    const autocomplete = props.autocomplete ?? _defaultAutocomplete;\n    if (typeof autocomplete === 'boolean') {\n      result = autocomplete ? 'on' : 'off';\n    } else {\n      result = autocomplete;\n    }\n    return result;\n  });\n  return {\n    computedAutocomplete,\n  };\n}\n\nexport type AutocompletableInputControl = ReturnType<\n  typeof createAutocompletableInputControl\n>;\n","import {\n  ExtractPropTypes,\n  SetupContext,\n  ComputedRef,\n  computed,\n  PropType,\n} from 'vue';\nimport { createPropsOptions } from '@fastkit/vue-utils';\nimport { toInt, nilToEmptyString } from '@fastkit/helpers';\nimport {\n  minLength as minLengthFactory,\n  maxLength as maxLengthFactory,\n  pattern as patternFactory,\n} from '@fastkit/rules';\nimport {\n  createFormNodeProps,\n  FormNodeControl,\n  createFormNodeEmits,\n  FormNodeContext,\n  FormNodeControlBaseOptions,\n} from './node';\nimport {\n  createAutocompletableInputProps,\n  createAutocompletableInputControl,\n  AutocompletableInputControl,\n} from './autocompletable';\n\nimport {\n  FormAutoCapitalize,\n  TextFinalizer,\n  BuiltinTextFinalizerName,\n  BUILTIN_TEXT_FINALIZERS,\n  FormAutoComplete,\n} from '../schemes';\nimport { logger } from '../logger';\n\nexport type TextableFinalizerSpec =\n  | TextFinalizer\n  | BuiltinTextFinalizerName\n  | (TextFinalizer | BuiltinTextFinalizerName)[];\n\nfunction resolveTextableFinalizerSpec(\n  raw?: TextableFinalizerSpec,\n): TextFinalizer[] | undefined {\n  if (!raw) return;\n  if (!Array.isArray(raw)) raw = [raw];\n  return raw.map((row) =>\n    typeof row === 'string' ? BUILTIN_TEXT_FINALIZERS[row] : row,\n  );\n}\n\nasync function finalizeValue(\n  value: string | null | undefined,\n  finalizers: TextFinalizer[],\n) {\n  let result: string = nilToEmptyString(value);\n  for (const finalizer of finalizers) {\n    result = await finalizer(result);\n  }\n  return result;\n}\n\nexport function createTextableProps() {\n  return {\n    ...createFormNodeProps<any>({\n      modelValue: {\n        type: String,\n        default: '',\n      },\n      defaultValidateTiming: 'blur',\n    }),\n    ...createAutocompletableInputProps(),\n    ...createPropsOptions({\n      /** Minimum number of characters */\n      minlength: [String, Number],\n      /** maximum number of characters */\n      maxlength: [String, Number],\n      /** input pattern */\n      pattern: [String, RegExp],\n      /** placeholder */\n      placeholder: String,\n      /**\n       * Perform capitalization of the input string's first letter when it is entered/edited by the user.\n       *\n       * @see https://developer.mozilla.org/docs/Web/HTML/Global_attributes/autocapitalize\n       */\n      autocapitalize: String as PropType<FormAutoCapitalize>,\n      /**\n       * Text correction settings.\n       */\n      finalizers: [String, Array, Function] as PropType<TextableFinalizerSpec>,\n      /**\n       * Character counter.\n       */\n      counter: [Boolean, String, Number] as PropType<boolean | string | number>,\n      /**\n       * Calculation logic for performing custom character count.\n       */\n      counterValue: Function as PropType<(value: string) => number>,\n      /** Limit the input value based on the maximum character count. */\n      limit: Boolean,\n    }),\n  };\n}\n\nexport interface TextableCounterSettings {\n  maxlength: number;\n  counterValue: (value: string) => number;\n}\n\nexport interface TextableCounterResult {\n  length: number;\n  maxlength: number;\n}\n\nexport type TextableProps = ExtractPropTypes<\n  ReturnType<typeof createTextableProps>\n>;\n\nexport function createTextableEmits() {\n  return {\n    ...createFormNodeEmits({ modelValue: String }),\n  };\n}\n\nexport function createTextableSettings() {\n  const props = createTextableProps();\n  const emits = createTextableEmits();\n  return { props, emits };\n}\n\nexport interface TextableEmitOptions extends ReturnType<\n  typeof createTextableEmits\n> {}\n\nexport type TextableContext = SetupContext<TextableEmitOptions>;\n\nexport interface TextableControlOptions extends FormNodeControlBaseOptions {}\n\nexport class TextableControl extends FormNodeControl<string> {\n  readonly _props: TextableProps;\n\n  protected _minlength: ComputedRef<number | undefined>;\n\n  protected _maxlength: ComputedRef<number | undefined>;\n\n  protected _autocompletable: AutocompletableInputControl;\n\n  protected _finalizers: ComputedRef<TextFinalizer[] | undefined>;\n\n  protected _counterSettings: ComputedRef<TextableCounterSettings | undefined>;\n\n  protected _counterResult: ComputedRef<TextableCounterResult | undefined>;\n\n  protected _maxlengthLimit: ComputedRef<number | undefined>;\n\n  /** Minimum number of characters */\n  get minlength(): number | undefined {\n    return this._minlength.value;\n  }\n\n  /** maximum number of characters */\n  get maxlength(): number | undefined {\n    return this._maxlength.value;\n  }\n\n  /** input pattern */\n  get pattern(): string | RegExp | undefined {\n    return this._props.pattern;\n  }\n\n  /** placeholder */\n  get placeholder(): string | undefined {\n    return this._props.placeholder;\n  }\n\n  /**\n   * The HTML autocomplete attribute lets web developers specify what if any permission the [user agent](https://developer.mozilla.org/docs/Glossary/User_agent) has to provide automated assistance in filling out form field values, as well as guidance to the browser as to the type of information expected in the field.\n   *\n   * @see https://developer.mozilla.org/docs/Web/HTML/Attributes/autocomplete\n   */\n  get autocomplete(): FormAutoComplete | undefined {\n    return this._autocompletable.computedAutocomplete.value;\n  }\n\n  /**\n   * Perform capitalization of the input string's first letter when it is entered/edited by the user.\n   *\n   * @see https://developer.mozilla.org/docs/Web/HTML/Global_attributes/autocapitalize\n   */\n  get autocapitalize(): FormAutoCapitalize | undefined {\n    return this._props.autocapitalize;\n  }\n\n  /**\n   * Text correction settings.\n   *\n   * @see {@link TextFinalizer}\n   */\n  get finalizers(): TextFinalizer[] | undefined {\n    return this._finalizers?.value;\n  }\n\n  /**\n   * Character count setting\n   *\n   * @see {@link TextableCounterSettings}\n   */\n  get counterSettings(): TextableCounterSettings | undefined {\n    return this._counterSettings.value;\n  }\n\n  /**\n   * Character count result\n   *\n   * @see {@link TextableCounterResult}\n   */\n  get counterResult(): TextableCounterResult | undefined {\n    return this._counterResult.value;\n  }\n\n  /**\n   * The maximum number of characters derived from `maxlength` and `counterSettings`\n   */\n  get maxlengthLimit(): number | undefined {\n    return this._maxlengthLimit.value;\n  }\n\n  constructor(\n    props: TextableProps,\n    ctx: TextableContext,\n    options: TextableControlOptions = {},\n  ) {\n    super(props, ctx as unknown as FormNodeContext<string>, {\n      ...options,\n      modelValue: String,\n    });\n    this._props = props;\n\n    this._autocompletable = createAutocompletableInputControl(props);\n\n    this._minlength = computed(() => {\n      const { minlength } = props;\n      return minlength == null ? undefined : toInt(minlength);\n    });\n\n    this._maxlength = computed(() => {\n      const { maxlength } = props;\n      return maxlength == null ? undefined : toInt(maxlength);\n    });\n\n    this._finalizers = computed(() =>\n      resolveTextableFinalizerSpec(props.finalizers),\n    );\n    this._counterSettings = computed(() => {\n      let { counter } = props;\n      const maxlength = this._maxlength.value;\n      if (counter === true) {\n        if (maxlength == null) {\n          if (__PLUGBOY_DEV__) {\n            logger.warn(\n              'When setting the counter, you need to set the maxlength.',\n            );\n          }\n          return;\n        }\n        counter = maxlength;\n      }\n      if (!counter) {\n        return;\n      }\n      counter = toInt(counter);\n      return {\n        maxlength: counter,\n        counterValue: props.counterValue || ((value: string) => value.length),\n      };\n    });\n\n    this._counterResult = computed(() => {\n      const { counterSettings } = this;\n      if (!counterSettings) return;\n      return {\n        length: this.validationValue.length,\n        maxlength: counterSettings.maxlength,\n      };\n    });\n\n    this._maxlengthLimit = computed(() => {\n      if (!props.limit) return;\n      return (\n        this.maxlength ||\n        (this.counterSettings && this.counterSettings.maxlength)\n      );\n    });\n  }\n\n  emptyValue() {\n    return '';\n  }\n\n  /**\n   * @override\n   */\n  blurHandler(ev: FocusEvent) {\n    this.finalize();\n    super.blurHandler(ev);\n  }\n\n  protected async _finalize() {\n    if (this.shouldSkipValidation) return;\n    const { finalizers } = this;\n    if (!finalizers) return;\n\n    const currentValue = this.value;\n    const finalizedValue = await finalizeValue(currentValue, finalizers);\n    if (currentValue !== this.value) return;\n\n    this.value = finalizedValue;\n  }\n\n  protected _resolveRules() {\n    const rules = super._resolveRules();\n    if (!this.booted) return rules;\n    const { pattern, minlength, maxlength } = this;\n    if (pattern != null) {\n      rules.push(patternFactory(pattern));\n    }\n    if (minlength != null) {\n      rules.push(minLengthFactory(minlength));\n    }\n    if (maxlength != null) {\n      rules.push(maxLengthFactory(maxlength));\n    }\n    return rules;\n  }\n\n  protected _setTextValue(value: string) {\n    const { maxlengthLimit } = this;\n    if (maxlengthLimit) {\n      value = value.slice(0, maxlengthLimit);\n    }\n    this.value = value;\n  }\n}\n\nexport function useTextableControl(\n  props: TextableProps,\n  ctx: TextableContext,\n  options?: TextableControlOptions,\n) {\n  const control = new TextableControl(props, ctx, options);\n  return control;\n}\n","import {\n  ref,\n  Ref,\n  watch,\n  onMounted,\n  onUnmounted,\n  PropType,\n  ExtractPropTypes,\n  computed,\n  toRaw,\n} from 'vue';\nimport type { InputMask, Masked, MaskedDynamicOptions } from 'imask';\nimport IMask, { MaskedDynamic, PIPE_TYPE } from 'imask';\nimport {\n  IMaskInput,\n  resolveIMaskInput,\n  IMaskEvent,\n  createIMaskEvent,\n  MaskedDynamicOptionsWithMeta,\n  AnyMaskedOptions,\n} from '../schemes';\n\nexport type { AnyMaskedOptions } from '../schemes';\n\nexport type { InputMask as IMaskInstance } from 'imask';\n\nexport function createMaskedOptions<\n  Opts extends\n    | Omit<Exclude<AnyMaskedOptions, MaskedDynamicOptions>, 'dispatch'>\n    | MaskedDynamicOptionsWithMeta,\n>(options: Opts): Opts {\n  return options;\n}\n\nexport function createMaskControlProps() {\n  return {\n    /** Text Mask Settings */\n    mask: {} as PropType<IMaskInput>,\n  };\n}\n\n// export type IMaskInstance = InputMask;\n\nexport type IMaskControlProps = ExtractPropTypes<\n  ReturnType<typeof createMaskControlProps>\n>;\n\ntype IMaskPipeTypeMap = typeof PIPE_TYPE;\nexport type IMaskPipeType = IMaskPipeTypeMap[keyof IMaskPipeTypeMap];\ntype IMaskPipeValue = string | number | null | undefined;\n\nexport function useIMaskControl(\n  props: IMaskControlProps,\n  opts: {\n    el: Ref<HTMLInputElement | null>;\n    onAccept?: (ev: IMaskEvent) => void;\n    onAcceptDynamicMeta?: (meta?: any) => void;\n    onComplete?: (ev: IMaskEvent) => void;\n  },\n) {\n  const { el, onAccept, onAcceptDynamicMeta, onComplete } = opts;\n  const maskInput = computed(() => resolveIMaskInput(toRaw(props.mask)));\n  const inputMask: Ref<InputMask | null> = ref(null);\n  const staticMask: Ref<Masked | null> = ref(null);\n  const masked = ref<string>('');\n  const unmasked = ref<string>('');\n  const typed = ref<string | number | Date | undefined>();\n  let $el: HTMLInputElement | undefined;\n  let $masked: string | undefined;\n  let $unmasked: string | undefined;\n  let $typed: string | number | Date | undefined;\n\n  const pipe = (\n    value: IMaskPipeValue,\n    from: IMaskPipeType = PIPE_TYPE.MASKED,\n  ): string => {\n    const _value =\n      value == null ? '' : typeof value === 'number' ? String(value) : value;\n\n    const masked = staticMask.value;\n    if (!masked) return _value;\n    return masked.runIsolated((m) => {\n      m[from] = _value;\n      return m[PIPE_TYPE.MASKED];\n    });\n  };\n\n  function _onAccept() {\n    const _inputMask = inputMask.value;\n    if (!_inputMask) return;\n\n    const ev = createIMaskEvent('accept', { detail: _inputMask });\n    $typed = typed.value = _inputMask.typedValue;\n    $unmasked = unmasked.value = _inputMask.unmaskedValue;\n    $masked = masked.value = _inputMask.value;\n    if (onAccept) onAccept(ev);\n    if (onAcceptDynamicMeta) {\n      const { masked } = _inputMask;\n      if (masked instanceof MaskedDynamic) {\n        if (masked.currentMask) {\n          onAcceptDynamicMeta((masked.currentMask as any).meta);\n        }\n      }\n    }\n  }\n\n  function _onComplete() {\n    const _inputMask = inputMask.value;\n    if (!_inputMask) return;\n    const ev = createIMaskEvent('complete', { detail: _inputMask });\n    if (onComplete) onComplete(ev);\n  }\n\n  function _initStaticMask() {\n    const $props = maskInput.value;\n    if (!$props || !$props.mask) return;\n    staticMask.value = toRaw(IMask.createMask<any>($props));\n  }\n\n  _initStaticMask();\n\n  function _initMask() {\n    const _el = el.value;\n    if (!_el) return;\n    $el = _el;\n    const $props = maskInput.value;\n\n    if (!$el || !$props || !$props.mask) return;\n\n    inputMask.value = toRaw(IMask($el, $props))\n      .on('accept', _onAccept)\n      .on('complete', _onComplete);\n    _onAccept();\n  }\n\n  function _destroyMask() {\n    if (inputMask.value) {\n      inputMask.value.destroy();\n      inputMask.value = null;\n    }\n    if (staticMask.value) {\n      staticMask.value = null;\n    }\n  }\n\n  onMounted(_initMask);\n  onUnmounted(_destroyMask);\n\n  watch(unmasked, () => {\n    if (inputMask.value && $unmasked !== unmasked.value) {\n      $unmasked = inputMask.value.unmaskedValue = unmasked.value;\n    }\n  });\n\n  watch(masked, () => {\n    if (inputMask.value && $masked !== masked.value) {\n      $masked = inputMask.value.value = masked.value;\n    }\n  });\n\n  watch(typed, () => {\n    if (\n      inputMask.value &&\n      $typed !== typed.value &&\n      typed.value !== undefined\n    ) {\n      $typed = inputMask.value.typedValue = typed.value as any;\n    }\n  });\n\n  watch([el, maskInput], () => {\n    const $newEl = el.value;\n    const $props = maskInput.value;\n    if (!$props || !$props.mask || $newEl !== $el) {\n      _destroyMask();\n    }\n    if (!$props || !$props.mask) {\n      return;\n    }\n\n    _initStaticMask();\n\n    if ($newEl) {\n      if (!inputMask.value) {\n        _initMask();\n      } else {\n        inputMask.value.updateOptions($props as any);\n      }\n    }\n  });\n\n  return {\n    maskInput,\n    inputMask,\n    staticMask,\n    masked,\n    unmasked,\n    typed,\n    pipe,\n  };\n}\n\nexport type IMaskControl = ReturnType<typeof useIMaskControl>;\n","import {\n  PropType,\n  ExtractPropTypes,\n  SetupContext,\n  ComputedRef,\n  computed,\n  InputHTMLAttributes,\n  ref,\n  watch,\n  onMounted,\n} from 'vue';\nimport { createPropsOptions } from '@fastkit/vue-utils';\nimport {\n  createTextableProps,\n  createTextableEmits,\n  TextableControl,\n  TextableControlOptions,\n  TextableContext,\n} from './textable';\nimport {\n  TextInputType,\n  TextInputMode,\n  IMaskTypedValue,\n  IMaskEvent,\n} from '../schemes';\nimport { createMaskControlProps, IMaskInstance } from './imask';\nimport {\n  useIMaskControl,\n  IMaskControl,\n  type AnyMaskedOptions,\n  type IMaskPipeType,\n} from './imask';\n\nexport type TextInputMaskModel = 'masked' | 'typed' | 'unmasked';\n\nconst IMASK_PIPE_TYPE_MAP: Record<TextInputMaskModel, IMaskPipeType> = {\n  masked: 'value',\n  typed: 'typedValue',\n  unmasked: 'unmaskedValue',\n};\n\nexport type TextInputListItemValue = string | number;\n\nexport interface TextInputListItem {\n  value: TextInputListItemValue;\n  label?: string;\n}\n\nexport type RawTextInputListItem = TextInputListItemValue | TextInputListItem;\n\nexport type TextInputListSpec = string | RawTextInputListItem[];\n\nexport interface TextInputListDetails {\n  id: string;\n  items?: TextInputListItem[];\n}\n\nexport function createTextInputNodeProps() {\n  return {\n    ...createTextableProps(),\n    ...createMaskControlProps(),\n    ...createPropsOptions({\n      /**\n       * Input type\n       *\n       * @default \"text\"\n       */\n      type: {\n        type: String as PropType<TextInputType>,\n        default: 'text',\n      },\n      /**\n       * Enumerated attribute that hints at the type of data that might be entered by the user while editing the element or its contents.\n       *\n       * @see https://developer.mozilla.org/docs/Web/HTML/Global_attributes/inputmode\n       */\n      inputmode: String as PropType<TextInputMode>,\n      /**\n       * The synchronization method for utilizing the masked modelValue.\n       *\n       * Typically, when using the mask option, the masked and formatted value is sent along with the event. By enabling this setting, it becomes possible to synchronize unmasked values or resolved values of types.\n       */\n      maskModel: {\n        type: String as PropType<TextInputMaskModel>,\n        default: 'masked',\n      },\n      /**\n       * The ID of the datalist, or a list of its items.\n       *\n       * @see {@link https://developer.mozilla.org/docs/Web/HTML/Element/datalist}\n       */\n      list: [String, Array] as PropType<TextInputListSpec>,\n    }),\n  };\n}\n\nexport type TextInputNodeProps = ExtractPropTypes<\n  ReturnType<typeof createTextInputNodeProps>\n>;\n\nexport function createTextInputNodeEmits() {\n  return {\n    ...createTextableEmits(),\n    /**\n     * 'accept' event fired on input when mask value has changed\n     *\n     * @see https://imask.js.org/guide.html\n     */\n    acceptMask: (ev: IMaskEvent) => true,\n    /**\n     * Metadata event when the applied mask is changed in dynamic mask settings.\n     */\n    acceptDynamicMaskMeta: (meta?: any) => true,\n    /**\n     * 'complete' event fired when the value is completely filled\n     *\n     * @see https://imask.js.org/guide.html\n     */\n    completeMask: (ev: IMaskEvent) => true,\n    /**\n     * Updating the masked value.\n     *\n     * @param maskedValue - Masked value\n     */\n    'update:masked': (maskedValue: string) => true,\n    /**\n     * Updating the normalized value with the specified type.\n     *\n     * @param typedValue - Normalized value with the specified type\n     */\n    'update:typed': (typedValue: IMaskTypedValue | undefined) => true,\n    /**\n     * Updating the unmasked value.\n     *\n     * @param unmaskedValue - unmasked value\n     */\n    'update:unmasked': (unmaskedValue: string) => true,\n  };\n}\n\nexport type TextInputNodeEmits = ReturnType<typeof createTextInputNodeEmits>;\n\nexport function createTextInputNodeSettings() {\n  const props = createTextInputNodeProps();\n  const emits = createTextInputNodeEmits();\n  return { props, emits };\n}\n\nexport interface TextInputNodeEmitOptions extends ReturnType<\n  typeof createTextInputNodeEmits\n> {}\n\nexport type TextInputNodeContext = SetupContext<TextInputNodeEmitOptions>;\n\nexport interface TextInputNodeControlOptions extends TextableControlOptions {}\n\nexport class TextInputNodeControl extends TextableControl {\n  readonly _props: TextInputNodeProps;\n\n  protected _inputElement = ref<HTMLInputElement | null>(null);\n\n  protected readonly _getMaskInput: () => AnyMaskedOptions | undefined;\n\n  protected readonly _getMask: () => IMaskInstance | null;\n\n  readonly mask: IMaskControl;\n\n  protected _passwordVisibility = ref(false);\n\n  protected _maskedValue: ComputedRef<string>;\n\n  protected _list: ComputedRef<TextInputListDetails | undefined>;\n\n  /**\n   * Input type\n   *\n   * @see {@link TextInputType}\n   */\n  get type(): TextInputType {\n    return this._props.type;\n  }\n\n  /**\n   * Enumerated attribute that hints at the type of data that might be entered by the user while editing the element or its contents.\n   *\n   * @see https://developer.mozilla.org/docs/Web/HTML/Global_attributes/inputmode\n   */\n  get inputmode(): TextInputMode | undefined {\n    return this._props.inputmode;\n  }\n\n  /**\n   * `<input />` Element\n   */\n  get inputElement(): HTMLInputElement | null {\n    return this._inputElement.value;\n  }\n\n  /**\n   * Show password\n   */\n  get isVisiblePassword(): boolean {\n    return this._passwordVisibility.value;\n  }\n\n  /**\n   * Masked text\n   */\n  get maskedValue(): string {\n    return this._maskedValue.value;\n  }\n\n  /**\n   * Use the unmasked value\n   */\n  get useUnmaskedValue(): boolean {\n    return this._props.maskModel === 'unmasked';\n  }\n\n  /**\n   * Use the type-corrected value\n   */\n  get useTypedValue(): boolean {\n    return this._props.maskModel === 'typed';\n  }\n\n  /**\n   * datalist\n   *\n   * @see {@link TextInputListDetails}\n   */\n  get datalist(): TextInputListDetails | undefined {\n    return this._list.value;\n  }\n\n  constructor(\n    props: TextInputNodeProps,\n    ctx: TextInputNodeContext,\n    options: TextInputNodeControlOptions = {},\n  ) {\n    super(props, ctx as unknown as TextableContext, {\n      ...options,\n    });\n    this._props = props;\n\n    const { emit } = ctx;\n    const el = ref<null | HTMLInputElement>(null);\n    this._inputElement = el;\n\n    this._handleNodeInput = this._handleNodeInput.bind(this);\n\n    const imask = useIMaskControl(props, {\n      el,\n      onAccept: (ev) => {\n        const { masked, unmasked, typed } = imask;\n        emit('acceptMask', ev);\n\n        const bucket = this.useUnmaskedValue\n          ? unmasked\n          : this.useTypedValue\n            ? typed\n            : masked;\n\n        const { value } = bucket;\n\n        if (this.setValue(value as any)) {\n          emit('update:masked', masked.value);\n          emit('update:unmasked', unmasked.value);\n          emit('update:typed', typed.value);\n        }\n      },\n      onAcceptDynamicMeta: (meta) => {\n        ctx.emit('acceptDynamicMaskMeta', meta);\n      },\n      onComplete: (ev) => {\n        emit('completeMask', ev);\n      },\n    });\n\n    this.mask = imask;\n\n    const { maskInput, masked, unmasked, typed, inputMask } = imask;\n\n    this._maskedValue = computed(() => {\n      const from = IMASK_PIPE_TYPE_MAP[props.maskModel];\n      return imask.pipe(this.value, from);\n    });\n    this._getMaskInput = () => maskInput.value;\n    this._getMask = () => inputMask.value;\n    this.focus = this.focus.bind(this);\n    this.blur = this.blur.bind(this);\n\n    watch(this._value, (v) => {\n      if (!this._getMaskInput()) return;\n\n      const bucket = this.useUnmaskedValue\n        ? unmasked\n        : this.useTypedValue\n          ? typed\n          : masked;\n\n      bucket.value = v || '';\n    });\n\n    this._list = computed<TextInputListDetails | undefined>(() => {\n      const { list } = props;\n      if (!list) return;\n\n      if (typeof list === 'string') {\n        return {\n          id: list,\n        };\n      }\n      return {\n        id: `_vfc-list-${this.mountedId}`,\n        items: list.map((row) =>\n          typeof row === 'object' ? row : { value: row },\n        ),\n      };\n    });\n\n    /**\n     * @TODO ちゃんとする\n     */\n    onMounted(() => {\n      if (props.autofocus) {\n        setTimeout(() => {\n          this.focus();\n        }, 250);\n      }\n    });\n\n    this.togglePasswordVisibility = this.togglePasswordVisibility.bind(this);\n  }\n\n  emptyValue() {\n    return '';\n  }\n\n  /**\n   * Set the visibility state of the password\n   *\n   * @param visibility - Password visibility state\n   */\n  setPasswordVisibility(visibility: boolean): void {\n    this._passwordVisibility.value = visibility;\n  }\n\n  /**\n   * Toggle the visibility state of the password\n   */\n  togglePasswordVisibility(): void {\n    this.setPasswordVisibility(!this.isVisiblePassword);\n  }\n\n  protected _handleNodeInput(ev: Event) {\n    this._setTextValue((ev.target as unknown as HTMLInputElement).value);\n  }\n\n  createInputElement(\n    override: Pick<InputHTMLAttributes, 'class' | 'type'> = {},\n  ) {\n    let type = override.type || this.type;\n    if (type === 'password' && this.isVisiblePassword) {\n      type = 'text';\n    }\n    const { datalist } = this;\n\n    const maskInput = this._getMaskInput();\n\n    const attrs: InputHTMLAttributes = {\n      id: this.mountedNodeId,\n      class: override.class,\n      list: datalist?.id,\n      type,\n      inputmode: this.inputmode,\n      name: this.name,\n      tabindex: this.tabindex,\n      readonly: this.isReadonly,\n      disabled: this.isDisabled || this.isViewonly,\n      placeholder: this.placeholder,\n      autocomplete: this.autocomplete,\n      autocapitalize: this.autocapitalize,\n      spellcheck: this.spellcheck,\n      maxlength: this.maxlength,\n      onFocus: this.focusHandler,\n      onBlur: this.blurHandler,\n    };\n\n    if (!maskInput) {\n      attrs.value = this.value;\n      attrs.onInput = this._handleNodeInput;\n    } else if (!this.isMounted) {\n      attrs.value = this.value;\n    } else {\n      const mask = this._getMask();\n      attrs.value = mask?.masked?.value;\n    }\n    const el = <input {...attrs} ref={this._inputElement} />;\n    return el;\n  }\n\n  createDatalist() {\n    const { datalist } = this;\n    if (!datalist || !datalist.items) return;\n\n    return (\n      <datalist id={datalist.id}>\n        {datalist.items.map((item) => (\n          <option value={item.value}>{item.label}</option>\n        ))}\n      </datalist>\n    );\n  }\n\n  focus(opts?: FocusOptions) {\n    if (this.isDisabled) return;\n    this.inputElement?.focus(opts);\n  }\n\n  blur() {\n    this.inputElement?.blur();\n  }\n}\n\nexport function useTextInputNodeControl(\n  props: TextInputNodeProps,\n  ctx: TextInputNodeContext,\n  options?: TextInputNodeControlOptions,\n) {\n  const control = new TextInputNodeControl(props, ctx, options);\n  return control;\n}\n","import {\n  defineComponent,\n  computed,\n  ref,\n  Fragment,\n  reactive,\n  watch,\n  watchEffect,\n  nextTick,\n} from 'vue';\nimport {\n  BooleanishPropOption,\n  NumberishPropOption,\n  resolveNumberish,\n} from '@fastkit/vue-utils';\nimport { ownerWindow } from '@fastkit/dom';\nimport { debounce } from '@fastkit/debounce';\nimport { logger } from '../../logger';\n\nfunction getStyleValue(\n  computedStyle: CSSStyleDeclaration,\n  property: keyof CSSStyleDeclaration,\n) {\n  return parseInt(computedStyle[property] as any, 10) || 0;\n}\n\nexport interface VTextareaAutosizeRef {\n  value: string;\n  focus(opts?: FocusOptions): void;\n  blur(): void;\n}\n\nexport const VTextareaAutosize = defineComponent({\n  name: 'VTextareaAutosize',\n  inheritAttrs: false,\n  props: {\n    autocomplete: String,\n    autofocus: BooleanishPropOption,\n    disabled: BooleanishPropOption,\n    form: String,\n    maxlength: NumberishPropOption,\n    minlength: NumberishPropOption,\n    name: String,\n    placeholder: String,\n    readonly: BooleanishPropOption,\n    required: BooleanishPropOption,\n    // rows: NumberishPropOption,\n    modelValue: {\n      type: String,\n      default: '',\n    },\n    minRows: NumberishPropOption,\n    maxRows: NumberishPropOption,\n  },\n  emits: {\n    input: (event: InputEvent) => true,\n    'update:modelValue': (modelValue: string) => true,\n    focus: (event: FocusEvent) => true,\n    blur: (event: FocusEvent) => true,\n  },\n  setup(props, ctx) {\n    const inputRef = ref<HTMLTextAreaElement | null>(null);\n    const shadowRef = ref<HTMLTextAreaElement | null>(null);\n    const currentValue = ref(props.modelValue);\n    const minRows = computed(() => resolveNumberish(props.minRows, 1));\n    const maxRows = computed(() => resolveNumberish(props.maxRows));\n    const placeholder = computed(() => props.placeholder);\n    const renders = ref(0);\n    const state = reactive<{\n      fallbackRows?: number;\n      overflow?: boolean;\n      outerHeightStyle?: number;\n    }>({\n      fallbackRows: minRows.value,\n    });\n    const value = computed({\n      get: () => currentValue.value,\n      set: (_value) => {\n        if (currentValue.value !== _value) {\n          currentValue.value = _value;\n          ctx.emit('update:modelValue', _value);\n        }\n      },\n    });\n\n    const syncHeight = () => {\n      const input = inputRef.value;\n      if (!input) return;\n\n      const containerWindow = ownerWindow(input);\n      const computedStyle = containerWindow.getComputedStyle(input);\n\n      // If input's width is shrunk and it's not visible, don't sync height.\n      if (computedStyle.width === '0px') {\n        return;\n      }\n\n      const inputShallow = shadowRef.value;\n      if (!inputShallow) return;\n\n      inputShallow.style.width = computedStyle.width;\n      inputShallow.value = input.value || placeholder.value || 'x';\n      if (inputShallow.value.slice(-1) === '\\n') {\n        // Certain fonts which overflow the line height will cause the textarea\n        // to report a different scrollHeight depending on whether the last line\n        // is empty. Make it non-empty to avoid this issue.\n        inputShallow.value += ' ';\n      }\n\n      // const boxSizing = computedStyle.boxSizing;\n      const padding =\n        getStyleValue(computedStyle, 'paddingBottom') +\n        getStyleValue(computedStyle, 'paddingTop');\n      const border =\n        getStyleValue(computedStyle, 'borderBottomWidth') +\n        getStyleValue(computedStyle, 'borderTopWidth');\n      const verticalPadding = padding + border;\n\n      // The height of the inner content\n      const innerHeight = inputShallow.scrollHeight;\n\n      // Measure height of a textarea with a single row\n      inputShallow.value = 'x';\n      const singleRowHeight = inputShallow.scrollHeight - verticalPadding;\n\n      // The height of the outer content\n      let outerHeight = innerHeight;\n\n      if (minRows.value) {\n        outerHeight = Math.max(\n          Number(minRows.value) * singleRowHeight + verticalPadding,\n          outerHeight,\n        );\n      }\n      if (maxRows.value) {\n        outerHeight = Math.min(\n          Number(maxRows.value) * singleRowHeight + verticalPadding,\n          outerHeight,\n        );\n      }\n      outerHeight = Math.max(outerHeight, singleRowHeight);\n\n      // // Take the box sizing into account for applying this value as a style.\n      // const outerHeightStyle =\n      //   outerHeight + (boxSizing === 'border-box' ? padding + border : 0);\n      const outerHeightStyle = outerHeight; // ↑ (*1) I think this logic is wrong\n      const overflow = Math.abs(outerHeight - innerHeight) <= 1;\n\n      if (\n        renders.value < 20 &&\n        ((outerHeightStyle > 0 &&\n          Math.abs((state.outerHeightStyle || 0) - outerHeightStyle) > 1) ||\n          state.overflow !== overflow)\n      ) {\n        renders.value++;\n        state.overflow = overflow;\n        state.outerHeightStyle = outerHeightStyle;\n        state.fallbackRows = undefined;\n        return;\n      }\n\n      if (__PLUGBOY_DEV__) {\n        if (renders.value === 20) {\n          logger.error(\n            [\n              'vue-form-control: Too many re-renders. The layout is unstable.',\n              'VTextareaAutosize limits the number of renders to prevent an infinite loop.',\n            ].join('\\n'),\n          );\n        }\n      }\n    };\n\n    watch(\n      [() => minRows.value, () => maxRows.value, () => props.placeholder],\n      syncHeight,\n    );\n\n    watchEffect(() => {\n      const input = inputRef.value;\n      if (!input) return;\n      const handleResize = debounce(() => {\n        renders.value = 0;\n        syncHeight();\n      });\n      const containerWindow = ownerWindow(input);\n      containerWindow.addEventListener('resize', handleResize);\n      const resizeObserver = new ResizeObserver(handleResize);\n      resizeObserver.observe(input);\n\n      return () => {\n        handleResize.clear();\n        containerWindow.removeEventListener('resize', handleResize);\n        if (resizeObserver) {\n          resizeObserver.disconnect();\n        }\n      };\n    });\n\n    watch(\n      () => props.modelValue,\n      (v) => {\n        renders.value = 0;\n        currentValue.value = v;\n        nextTick(syncHeight);\n      },\n    );\n\n    const handleInput = (event: InputEvent) => {\n      renders.value = 0;\n      value.value = (event.target as HTMLTextAreaElement).value;\n\n      syncHeight();\n\n      ctx.emit('input', event);\n    };\n\n    const focus = (opts?: FocusOptions) => {\n      const input = inputRef.value;\n      if (!input) return;\n      input.focus(opts);\n    };\n\n    const blur = () => {\n      const input = inputRef.value;\n      if (!input) return;\n      input.blur();\n    };\n\n    return {\n      value,\n      handleInput,\n      inputRef: () => inputRef,\n      shadowRef: () => shadowRef,\n      state,\n      focus,\n      blur,\n    };\n  },\n  render() {\n    return (\n      <Fragment>\n        <textarea\n          {...this.$attrs}\n          value={this.value}\n          onInput={this.handleInput}\n          autocomplete={this.autocomplete}\n          autofocus={this.autofocus}\n          disabled={this.disabled}\n          form={this.form}\n          maxlength={this.maxlength}\n          minlength={this.minlength}\n          name={this.name}\n          placeholder={this.placeholder}\n          readonly={this.readonly}\n          required={this.required}\n          rows={this.state.fallbackRows}\n          ref={this.inputRef()}\n          style={{\n            ...(this.$attrs.style as any),\n\n            height: this.state.outerHeightStyle\n              ? `${this.state.outerHeightStyle}px`\n              : undefined,\n            // Need a large enough difference to allow scrolling.\n            // This prevents infinite rendering loop.\n            overflow: this.state.overflow ? 'hidden' : undefined,\n          }}\n          onFocus={(ev) => this.$emit('focus', ev)}\n          onBlur={(ev) => this.$emit('blur', ev)}\n        />\n        <textarea\n          {...this.$attrs}\n          arria-hidden\n          readonly\n          ref={this.shadowRef()}\n          tabindex={-1}\n          style={{\n            // padding: '0', // ← (*1) It seems okay not to reset the padding.\n            // Visibility needed to hide the extra text area on iPads\n            visibility: 'hidden',\n            // Remove from the content flow\n            position: 'absolute',\n            // Ignore the scrollbar width\n            overflow: 'hidden',\n            height: 0,\n            top: 0,\n            left: 0,\n            // Create a new layer, increase the isolation of the computed values\n            transform: 'translateZ(0)',\n          }}\n        />\n      </Fragment>\n    );\n  },\n});\n","import {\n  ExtractPropTypes,\n  SetupContext,\n  ref,\n  TextareaHTMLAttributes,\n  PropType,\n  ComputedRef,\n  computed,\n  VNode,\n} from 'vue';\nimport {\n  createPropsOptions,\n  NumberishPropOption,\n  resolveNumberish,\n} from '@fastkit/vue-utils';\nimport {\n  createTextableProps,\n  createTextableEmits,\n  TextableControl,\n  TextableControlOptions,\n  TextableContext,\n} from './textable';\nimport { createMaskControlProps } from './imask';\nimport {\n  VTextareaAutosize,\n  VTextareaAutosizeRef,\n} from '../components/VTextareaAutosize';\n\nexport interface TextareaAutosizeSettings {\n  minRows?: number;\n  maxRows?: number;\n}\n\nexport type RawTextareaAutosizeSettings =\n  undefined | boolean | TextareaAutosizeSettings;\n\nfunction resolveRawTextareaAutosizeSettings(\n  raw: RawTextareaAutosizeSettings,\n): TextareaAutosizeSettings | undefined {\n  if (!raw) return;\n  return typeof raw === 'boolean' ? {} : raw;\n}\n\nexport function createTextareaNodeProps(\n  options: TextareaNodeControlOptions = {},\n) {\n  return {\n    ...createTextableProps(),\n    ...createMaskControlProps(),\n    ...createPropsOptions({\n      /** Automatically adjust the height of the box based on the number of input lines. */\n      autosize: [Boolean, Object] as PropType<RawTextareaAutosizeSettings>,\n      /** Size (number of lines) of the input box. */\n      rows: {\n        ...NumberishPropOption,\n        default: options.defaultRows,\n      },\n    }),\n  };\n}\n\nexport type TextareaNodeProps = ExtractPropTypes<\n  ReturnType<typeof createTextareaNodeProps>\n>;\n\nexport function createTextareaNodeEmits() {\n  return {\n    ...createTextableEmits(),\n  };\n}\n\nexport function createTextareaNodeSettings(\n  options?: TextareaNodeControlOptions,\n) {\n  const props = createTextareaNodeProps(options);\n  const emits = createTextareaNodeEmits();\n  return { props, emits };\n}\n\nexport interface TextareaNodeEmitOptions extends ReturnType<\n  typeof createTextareaNodeEmits\n> {}\n\nexport type TextareaNodeContext = SetupContext<TextareaNodeEmitOptions>;\n\nexport interface TextareaNodeControlOptions extends TextableControlOptions {\n  defaultRows?: number;\n}\n\nexport class TextareaNodeControl extends TextableControl {\n  readonly _props: TextareaNodeProps;\n\n  protected _inputElement = ref<\n    HTMLTextAreaElement | VTextareaAutosizeRef | null\n  >(null);\n\n  protected _autosize: ComputedRef<TextareaAutosizeSettings | undefined>;\n\n  protected _rows: ComputedRef<number | undefined>;\n\n  /**\n   * `<textarea />` element or `<VTextareaAutosizeRef />`\n   */\n  get inputElement(): HTMLTextAreaElement | VTextareaAutosizeRef | null {\n    return this._inputElement.value;\n  }\n\n  /**\n   * Auto-sizing setting\n   *\n   * @see {@link TextareaAutosizeSettings}\n   */\n  get autosizeSettings(): TextareaAutosizeSettings | undefined {\n    return this._autosize.value;\n  }\n\n  /** Size (number of lines) of the input box. */\n  get rows(): number | undefined {\n    return this._rows.value;\n  }\n\n  constructor(\n    props: TextareaNodeProps,\n    ctx: TextareaNodeContext,\n    options: TextareaNodeControlOptions = {},\n  ) {\n    super(props, ctx as unknown as TextableContext, {\n      ...options,\n    });\n    this._props = props;\n\n    const el = ref<null | HTMLTextAreaElement | VTextareaAutosizeRef>(null);\n    this._inputElement = el;\n\n    this._autosize = computed(() =>\n      resolveRawTextareaAutosizeSettings(props.autosize),\n    );\n\n    this._rows = computed(() =>\n      resolveNumberish(props.rows || options.defaultRows),\n    );\n\n    this.focus = this.focus.bind(this);\n    this.blur = this.blur.bind(this);\n  }\n\n  emptyValue() {\n    return '';\n  }\n\n  createInputElement(override: Pick<TextareaHTMLAttributes, 'class'> = {}) {\n    const { autosizeSettings } = this;\n    const attrs: TextareaHTMLAttributes = {\n      id: this.mountedNodeId,\n      class: override.class,\n      name: this.name,\n      tabindex: this.tabindex,\n      readonly: this.isReadonly,\n      disabled: this.isDisabled || this.isViewonly,\n      placeholder: this.placeholder,\n      autocomplete: this.autocomplete,\n      autocapitalize: this.autocapitalize,\n      spellcheck: this.spellcheck,\n      rows: this.rows,\n      maxlength: this.maxlength,\n      onFocus: this.focusHandler,\n      onBlur: this.blurHandler,\n      value: this.value,\n      onInput: (ev) => {\n        this._setTextValue((ev.target as unknown as HTMLTextAreaElement).value);\n      },\n    };\n    let el: VNode;\n    if (autosizeSettings) {\n      el = (\n        <VTextareaAutosize\n          {...attrs}\n          {...autosizeSettings}\n          modelValue={attrs.value as string}\n          ref={this._inputElement}\n        />\n      );\n    } else {\n      attrs.rows = this.rows;\n      el = <textarea {...attrs} ref={this._inputElement} />;\n    }\n    return el;\n  }\n\n  focus(opts?: FocusOptions) {\n    if (this.isDisabled) return;\n    const { inputElement } = this;\n    inputElement && inputElement.focus(opts);\n  }\n\n  blur() {\n    const { inputElement } = this;\n    inputElement && inputElement.blur();\n  }\n}\n\nexport function useTextareaNodeControl(\n  props: TextareaNodeProps,\n  ctx: TextareaNodeContext,\n  options?: TextareaNodeControlOptions,\n) {\n  const control = new TextareaNodeControl(props, ctx, options);\n  return control;\n}\n","import {\n  ExtractPropTypes,\n  SetupContext,\n  PropType,\n  provide,\n  inject,\n  watch,\n  computed,\n  ComputedRef,\n  onBeforeUnmount,\n  ref,\n  Ref,\n  VNodeChild,\n} from 'vue';\nimport {\n  createPropsOptions,\n  VNodeChildOrSlot,\n  TypedSlot,\n  resolveVNodeChildOrSlot,\n} from '@fastkit/vue-utils';\nimport { IN_WINDOW, isPromise, arrayRemove } from '@fastkit/helpers';\nimport {\n  FormNodeType,\n  createFormNodeProps,\n  FormNodeControl,\n  createFormNodeEmits,\n  FormNodeContext,\n  FormNodeControlBaseOptions,\n} from './node';\nimport type { FormSelectorItemControl } from './selector-item';\nimport { FormSelectorInjectionKey } from '../injections';\n\nexport const DEFAULT_FORM_SELECTOR_GROUP_ID = '__default__';\n\nexport interface FormSelectorItem {\n  /** selection value */\n  value: string | number;\n  /** label */\n  label: VNodeChildOrSlot<FormSelectorControl>;\n  /** disabled state */\n  disabled?: boolean;\n}\n\nexport interface FormSelectorGroup {\n  /** Group ID */\n  id: string | number;\n  /** label */\n  label: VNodeChildOrSlot<FormSelectorControl>;\n  /** disabled state */\n  disabled?: boolean;\n  /** List of choices */\n  items: FormSelectorItem[];\n}\n\nexport interface ResolvedFormSelectorItem extends Omit<\n  FormSelectorItem,\n  'label'\n> {\n  label: TypedSlot<FormSelectorControl>;\n}\n\nexport interface ResolvedFormSelectorGroup extends Omit<\n  FormSelectorGroup,\n  'label'\n> {\n  label: TypedSlot<FormSelectorControl>;\n  items: ResolvedFormSelectorItem[];\n}\n\nexport type FormSelectorValue =\n  undefined | string | number | (string | number)[];\n\nconst modelValue = [String, Number, Array] as PropType<FormSelectorValue>;\n\n// export type FormSelectorItems = FormSelectorItem[];\nexport type FormSelectorItemOrGroups = (FormSelectorItem | FormSelectorGroup)[];\n\nexport type RawFormSelectorItems =\n  | FormSelectorItemOrGroups\n  | ((\n      selectorControl: FormSelectorControl,\n    ) => Promise<FormSelectorItemOrGroups>);\n\n/** Guard function context */\nexport interface FormSelectorGuardContext {\n  /** @see {@link FormSelectorItemControl} */\n  item: FormSelectorItemControl;\n  /** @see {@link FormSelectorControl} */\n  selector: FormSelectorControl;\n  /** Choice click event */\n  event: PointerEvent;\n  /** Accept changes */\n  accept: () => void;\n}\n\n/**\n * Handler to guard changes in selection state\n *\n * @param ctx - Guard function context\n *\n * @see {@link FormSelectorGuardContext}\n */\nexport type FormSelectorGuard = (\n  ctx: FormSelectorGuardContext,\n) => boolean | void | Promise<boolean | void>;\n\nexport function createFormSelectorProps(\n  options: FormSelectorControlOptions = {},\n) {\n  const {\n    defaultMultiple = false,\n    defaultPreserveOrder = false,\n    defaultValidateTiming,\n  } = options;\n  return {\n    ...createFormNodeProps({\n      defaultValidateTiming,\n      modelValue,\n    }),\n    ...createPropsOptions({\n      /**\n       * Multiple selection mode\n       */\n      multiple: {\n        type: Boolean,\n        default: defaultMultiple,\n      },\n      /**\n       * List of selection items, group list, or asynchronous loader\n       *\n       * @see {@link RawFormSelectorItems}\n       */\n      items: {\n        type: [Array, Function] as PropType<RawFormSelectorItems>,\n        default: () => [],\n      },\n      /**\n       * When true, maintains items order. When false (default), maintains user selection order.\n       */\n      preserveOrder: {\n        type: Boolean,\n        default: defaultPreserveOrder,\n      },\n      /**\n       * Handler before a clickable option is clicked and the selection state is changed.\n       *\n       * - If `false` is returned, the operation will be canceled.\n       * - When passing an asynchronous process, all options will remain inactive until the process is completed.\n       *\n       * @see {@link FormSelectorGuard}\n       */\n      onClickItem: Function as PropType<FormSelectorGuard>,\n    }),\n  };\n}\n\nexport type FormSelectorProps = ExtractPropTypes<\n  ReturnType<typeof createFormSelectorProps>\n>;\n\nexport function createFormSelectorEmits() {\n  return {\n    ...createFormNodeEmits({ modelValue }),\n  };\n}\n\nexport function createFormSelectorSettings(\n  options?: FormSelectorControlOptions,\n) {\n  const props = createFormSelectorProps(options);\n  const emits = createFormSelectorEmits();\n  return { props, emits };\n}\n\nexport interface FormSelectorEmitOptions extends ReturnType<\n  typeof createFormSelectorEmits\n> {}\n\nexport type FormSelectorContext = SetupContext<FormSelectorEmitOptions>;\n\nexport interface FormSelectorControlOptions extends FormNodeControlBaseOptions {\n  defaultMultiple?: boolean;\n  defaultPreserveOrder?: boolean;\n  onSelectItem?: (item: FormSelectorItemControl, ev: PointerEvent) => any;\n  onCancelSelect?: (item: FormSelectorItemControl, ev: PointerEvent) => any;\n}\n\nexport type FormSelectorLoadState = 'ready' | 'loading' | 'error';\n\nexport class FormSelectorControl extends FormNodeControl<FormSelectorValue> {\n  readonly _props: FormSelectorProps;\n\n  readonly parentNodeType?: FormNodeType;\n\n  /**\n   * When true, maintains items order. When false (default), maintains user selection order.\n   */\n  readonly preserveOrder: boolean;\n\n  protected _items: Ref<FormSelectorItemControl[]> = ref([]);\n\n  protected _itemsLoadState = ref<FormSelectorLoadState>('ready');\n\n  protected _propGroups: Ref<ResolvedFormSelectorGroup[]> = ref([]);\n\n  protected _loadedItems: ComputedRef<ResolvedFormSelectorItem[]>;\n\n  protected _selectedPropItems: ComputedRef<ResolvedFormSelectorItem[]>;\n\n  protected _selectedValues: ComputedRef<(string | number)[]>;\n\n  protected _selectedItems: ComputedRef<FormSelectorItemControl[]>;\n\n  protected _guardingItem: Ref<(() => FormSelectorItemControl) | undefined>;\n\n  protected onSelectItem?: (\n    item: FormSelectorItemControl,\n    ev: PointerEvent,\n  ) => any;\n\n  protected onCancelSelect?: (\n    item: FormSelectorItemControl,\n    ev: PointerEvent,\n  ) => any;\n\n  /**\n   * List of selection item nodes\n   *\n   * @see {@link FormSelectorItemControl}\n   */\n  get items(): FormSelectorItemControl[] {\n    return this._items.value;\n  }\n\n  /**\n   * Item currently undergoing selection guard process\n   *\n   * @see {@link FormSelectorItemControl}\n   */\n  get guardingItem(): FormSelectorItemControl | undefined {\n    return this._guardingItem.value?.();\n  }\n\n  /**\n   * In the process of selection guard\n   */\n  get isGuardInProgress(): boolean {\n    return !!this.guardingItem;\n  }\n\n  /**\n   * Not selected any\n   */\n  get notSelected(): boolean {\n    return this.selectedValues.length === 0;\n  }\n\n  /**\n   * Selected all items, including those in a disabled state\n   */\n  get allSelected(): boolean {\n    return this.selectedValues.length === this.items.length;\n  }\n\n  /**\n   * One or more items, including those in a disabled state, are selected, but not all of them\n   */\n  get indeterminate(): boolean {\n    return !this.notSelected && !this.allSelected;\n  }\n\n  /**\n   * List of selection groups resolved from properties\n   *\n   * @see {@link ResolvedFormSelectorGroup}\n   */\n  get propGroups(): ResolvedFormSelectorGroup[] {\n    return this._propGroups.value;\n  }\n\n  /**\n   * List of loaded items\n   *\n   * @see {@link ResolvedFormSelectorItem}\n   */\n  get loadedItems(): ResolvedFormSelectorItem[] {\n    return this._loadedItems.value;\n  }\n\n  /**\n   * List of selected property-specified items\n   *\n   * @see {@link ResolvedFormSelectorItem}\n   */\n  get selectedPropItems(): ResolvedFormSelectorItem[] {\n    return this._selectedPropItems.value;\n  }\n\n  /**\n   * List of selected values\n   */\n  get selectedValues(): (string | number)[] {\n    return this._selectedValues.value;\n  }\n\n  /**\n   * List of selected item nodes\n   */\n  get selectedItems(): FormSelectorItemControl[] {\n    return this._selectedItems.value;\n  }\n\n  /**\n   * Loading state of selection items\n   *\n   * @see {@link FormSelectorLoadState}\n   */\n  get itemsLoadState(): FormSelectorLoadState {\n    return this._itemsLoadState.value;\n  }\n\n  /**\n   * Loading items\n   */\n  get itemsLoading(): boolean {\n    return this.itemsLoadState === 'loading';\n  }\n\n  /**\n   * Items loaded\n   */\n  get itemsReady(): boolean {\n    return this.itemsLoadState === 'ready';\n  }\n\n  /**\n   * Failed to load items\n   */\n  get itemsLoadFailed(): boolean {\n    return this.itemsLoadState === 'error';\n  }\n\n  get isDisabled(): boolean {\n    return super.isDisabled || this.itemsLoading;\n  }\n\n  constructor(\n    props: FormSelectorProps,\n    ctx: FormSelectorContext,\n    options: FormSelectorControlOptions = {},\n  ) {\n    super(props, ctx as unknown as FormNodeContext<FormSelectorValue>, {\n      ...options,\n      modelValue,\n    });\n    this._props = props;\n    this.preserveOrder =\n      props.preserveOrder ?? options.defaultPreserveOrder ?? false;\n\n    this._guardingItem = ref();\n    this.onSelectItem = options.onSelectItem;\n    this.onCancelSelect = options.onCancelSelect;\n\n    this._selectedValues = computed(() => this._safeMultipleValues());\n\n    this._selectedItems = computed(() => {\n      const { selectedValues } = this;\n      const items: FormSelectorItemControl[] = [];\n      const { items: _items } = this;\n      selectedValues.forEach((value) => {\n        const hit = _items.find((item) => item.propValue === value);\n        if (hit) items.push(hit);\n      });\n      return items;\n    });\n\n    (\n      [\n        '_syncValueForChoices',\n        'getItems',\n        'getItemValues',\n        'sortValues',\n        'selectAll',\n        'unselectAll',\n        'isNotSelected',\n        'isAllSelected',\n        'isIndeterminate',\n        'toggle',\n      ] as const\n    ).forEach((fn) => {\n      this[fn] = (this[fn] as any).bind(this);\n    });\n\n    this._loadedItems = computed(() =>\n      this.propGroups.map((group) => group.items).flat(),\n    );\n\n    this._selectedPropItems = computed(() => {\n      const { selectedValues, loadedItems } = this;\n      if (this.preserveOrder) {\n        return loadedItems.filter(\n          ({ value }) => value != null && selectedValues.includes(value),\n        );\n      }\n      // preserveOrder が false の場合、選択値の順序を保持\n      const result: ResolvedFormSelectorItem[] = [];\n      selectedValues.forEach((selectedValue) => {\n        const item = loadedItems.find(({ value }) => value === selectedValue);\n        if (item) {\n          result.push(item);\n        }\n      });\n      return result;\n    });\n\n    watch(\n      () => props.items,\n      () => {\n        this.loadItems();\n      },\n      { immediate: true },\n    );\n\n    watch(\n      () => this._value.value,\n      (_value) => {\n        this._syncValueForChoices();\n      },\n      { immediate: true },\n    );\n\n    onBeforeUnmount(() => {\n      delete this.onSelectItem;\n      delete this.onCancelSelect;\n      this._propGroups.value = [];\n      this.clearGuard();\n    });\n\n    provide(FormSelectorInjectionKey, this);\n  }\n\n  emptyValue() {\n    return this.multiple ? [] : undefined;\n  }\n\n  private _setPropItems(itemOrGroups: FormSelectorItemOrGroups) {\n    const groups: ResolvedFormSelectorGroup[] = [];\n    let defaultGroup: ResolvedFormSelectorGroup | undefined;\n\n    itemOrGroups.forEach((itemOrGroup) => {\n      if ('items' in itemOrGroup) {\n        groups.push({\n          ...itemOrGroup,\n          label: resolveVNodeChildOrSlot(itemOrGroup.label),\n          items: itemOrGroup.items.map((item) => ({\n            ...item,\n            label: resolveVNodeChildOrSlot(item.label),\n          })),\n        });\n        return;\n      }\n\n      if (!defaultGroup) {\n        defaultGroup = {\n          id: DEFAULT_FORM_SELECTOR_GROUP_ID,\n          label: () => undefined,\n          items: [],\n        };\n        groups.push(defaultGroup);\n      }\n\n      defaultGroup.items.push({\n        ...itemOrGroup,\n        label: resolveVNodeChildOrSlot(itemOrGroup.label),\n      });\n    });\n    this._propGroups.value = groups.filter((group) => !!group.items.length);\n    this._itemsLoadState.value = 'ready';\n  }\n\n  /**\n   * Render selected property-specified items\n   *\n   * @param options - Options\n   */\n  renderSelectedPropItems(options?: {\n    /**\n     * Fallback specification for loading.\n     */\n    loading?: () => VNodeChild;\n    /**\n     * Fallback specification when nothing is selected\n     */\n    empty?: () => VNodeChild;\n    /**\n     * Separator for items when multiple selections are allowed\n     */\n    separator?: VNodeChild | (() => VNodeChild);\n    /**\n     * Renderer for customizing item rendering\n     * @param item - Item\n     * @param index - Index\n     */\n    item?: (item: ResolvedFormSelectorItem, index: number) => VNodeChild;\n  }): VNodeChild {\n    if (this.itemsLoading) {\n      return options?.loading ? options.loading() : [];\n    }\n    const { selectedPropItems } = this;\n    if (!selectedPropItems.length) {\n      return options?.empty ? options.empty() : [];\n    }\n\n    const children: VNodeChild[] = [];\n    const separator = options?.separator ?? ', ';\n    selectedPropItems.forEach((item, index) => {\n      if (index > 0) {\n        children.push(\n          typeof separator === 'function' ? separator() : separator,\n        );\n      }\n      const child = options?.item\n        ? options.item(item, index)\n        : item.label(this);\n      children.push(child);\n    });\n    return children;\n  }\n\n  /**\n   * Load items\n   */\n  loadItems(): void {\n    const { items } = this._props;\n\n    if (typeof items !== 'function') {\n      this._setPropItems(items);\n      return;\n    }\n\n    this._setPropItems([]);\n    this._itemsLoadState.value = 'loading';\n\n    if (!IN_WINDOW) return;\n\n    items(this)\n      .then((result) => {\n        if (this._props?.items !== items) return;\n        this._setPropItems(result);\n      })\n      .catch((_err) => {\n        if (this._props?.items !== items) return;\n        this._itemsLoadState.value = 'error';\n      });\n  }\n\n  protected _reCalcValues(changedSelectorItem?: FormSelectorItemControl) {\n    if (this.multiple) {\n      const values: (string | number)[] = [];\n      const currentValues = this._safeMultipleValues();\n      const usedValues: (string | number)[] = [];\n\n      // Get all valid values from items\n      this.items.forEach((item) => {\n        const { propValue } = item;\n        if (propValue != null) {\n          usedValues.push(propValue);\n        }\n      });\n\n      if (!this.preserveOrder) {\n        // preserveOrder=false: preserve existing order\n\n        // 1. Add existing values that are currently selected, preserving their order\n        currentValues.forEach((value) => {\n          if (usedValues.includes(value)) {\n            const matchedItem = this.items.find(\n              (itemControl) => itemControl.propValue === value,\n            );\n            if (matchedItem?.selected) {\n              values.push(value);\n            }\n          }\n        });\n\n        // 2. Add newly selected values that weren't in the original order\n        this.items.forEach((item) => {\n          const { propValue } = item;\n          if (\n            item.selected &&\n            propValue != null &&\n            !values.includes(propValue)\n          ) {\n            values.push(propValue);\n          }\n        });\n\n        // 3. Add unmounted values to the end\n        currentValues.forEach((v) => {\n          if (!usedValues.includes(v) && !values.includes(v)) {\n            values.push(v);\n          }\n        });\n\n        this._currentValue.value = values;\n      } else {\n        // preserveOrder=true: use items order (original behavior)\n        this.items.forEach((item) => {\n          const { propValue } = item;\n          if (\n            item.selected &&\n            propValue != null &&\n            !values.includes(propValue)\n          ) {\n            values.push(propValue);\n          }\n        });\n        currentValues.forEach((v) => {\n          if (!usedValues.includes(v)) {\n            values.push(v);\n          }\n        });\n        this._currentValue.value = values;\n      }\n    } else {\n      if (changedSelectorItem) {\n        if (changedSelectorItem.selected) {\n          this._currentValue.value = changedSelectorItem.propValue;\n          return;\n        }\n      }\n      let value: string | number | undefined;\n      for (const item of this.items) {\n        if (item.selected) {\n          value = item.propValue;\n          break;\n        }\n      }\n      this._currentValue.value = value;\n    }\n  }\n\n  safeModelValue(\n    value: any,\n  ): undefined | string | number | (string | number)[] {\n    if (value == null) {\n      return this.emptyValue();\n    }\n    return this.multiple\n      ? this._safeMultipleValues(value)\n      : this._safeSingleValue(value);\n  }\n\n  protected _safeMultipleValues(_value = this.value): (string | number)[] {\n    const values: (string | number)[] = Array.isArray(_value)\n      ? _value\n      : _value == null\n        ? []\n        : [_value];\n\n    // preserveOrder が true の場合は、loadedItems の順序に従って並び替える\n    if (this.preserveOrder && this._loadedItems?.value) {\n      const loadedValues = this._loadedItems.value.map((item) => item.value);\n      return loadedValues.filter((value) => values.includes(value));\n    }\n\n    return values;\n  }\n\n  protected _safeSingleValue(_value = this.value): string | number | undefined {\n    const value = Array.isArray(_value) ? _value[0] : _value;\n    return value;\n  }\n\n  protected _syncValueForChoices(exclude?: FormSelectorItemControl) {\n    if (this.multiple) {\n      const { selectedValues } = this;\n\n      this.items.forEach((item) => {\n        if (item === exclude) return;\n        const { propValue } = item;\n        const newValue =\n          propValue != null && selectedValues.includes(propValue);\n        if (newValue !== item.selected) {\n          item._setValueSilent(newValue);\n        }\n      });\n    } else {\n      const value = this._safeSingleValue();\n      this.items.forEach((item) => {\n        if (item === exclude) return;\n        const { propValue } = item;\n        const newValue = propValue === value;\n        if (newValue !== item.selected) {\n          item._setValueSilent(newValue);\n        }\n      });\n    }\n  }\n\n  /**\n   * Get the list of mounted selection nodes\n   *\n   * @param groupId - Group ID (for filtering)\n   * @param ignoreDisabled - Ignore disabled items\n   *\n   * @see {@link FormSelectorItemControl}\n   */\n  getItems(\n    groupId?: string | number | (string | number)[],\n    ignoreDisabled?: boolean,\n  ): FormSelectorItemControl[] {\n    let { items } = this;\n    if (groupId) {\n      const filter = Array.isArray(groupId) ? groupId : [groupId];\n      items = items.filter(\n        ({ groupId: _groupId }) =>\n          _groupId != null && filter.includes(_groupId),\n      );\n    }\n    return ignoreDisabled ? items.filter((item) => !item.isDisabled) : items;\n  }\n\n  /**\n   * Get the list of values of mounted selection nodes\n   *\n   * @param groupId - Group ID (for filtering)\n   * @param ignoreDisabled - Ignore disabled items\n   */\n  getItemValues(\n    groupId?: string | number | (string | number)[],\n    ignoreDisabled?: boolean,\n  ): (string | number)[] {\n    const items = this.getItems(groupId, ignoreDisabled);\n    const values: (string | number)[] = [];\n    items.forEach((item) => {\n      if (item.propValue != null) {\n        values.push(item.propValue);\n      }\n    });\n    return values;\n  }\n\n  /**\n   * Sort the list of values in the order of currently mounted items\n   * @param values - List of values to be sorted\n   * @returns Sorted list of values\n   */\n  sortValues(values: (string | number)[]): (string | number)[] {\n    const itemValues = this.getItemValues();\n    return values.sort((a, b) => {\n      const ai = itemValues.indexOf(a);\n      const bi = itemValues.indexOf(b);\n      if (ai < bi) return -1;\n      if (ai > bi) return 1;\n      return 0;\n    });\n  }\n\n  /**\n   * Select all items\n   *\n   * @param groupId - Group ID (for filtering)\n   * @param deselectOtherGroups - Deselect items other than those in the specified group\n   */\n  selectAll(\n    groupId?: string | number | (string | number)[],\n    deselectOtherGroups?: boolean,\n  ): void {\n    if (!this.multiple) return;\n    if (groupId == null || deselectOtherGroups) {\n      this.value = this.getItemValues(groupId, true);\n      return;\n    }\n    const values = [...this.selectedValues];\n    const itemValues = this.getItemValues(groupId, true);\n    itemValues.forEach((value) => {\n      if (!values.includes(value)) {\n        values.push(value);\n      }\n    });\n    // Execute select all: sets values according to items order regardless of preserveOrder\n    this.value = this.sortValues(values);\n  }\n\n  /**\n   * Deselect items\n   *\n   * @param groupId - Group ID (for filtering)\n   */\n  unselectAll(groupId?: string | number | (string | number)[]): void {\n    if (!this.multiple) return;\n    if (groupId == null) {\n      this.value = [];\n      return;\n    }\n    const itemValues = this.getItemValues(groupId);\n    this.value = this.selectedValues.filter(\n      (value) => !itemValues.includes(value),\n    );\n  }\n\n  /**\n   * Check if it is not selected\n   *\n   * @param groupId - Group ID (for filtering)\n   */\n  isNotSelected(groupId?: string | number | (string | number)[]): boolean {\n    if (groupId == null) {\n      return this.notSelected;\n    }\n    const { selectedValues } = this;\n    const itemValues = this.getItemValues(groupId);\n    return itemValues.every((value) => !selectedValues.includes(value));\n  }\n\n  /**\n   * Check if all are selected\n   *\n   * @param groupId - Group ID (for filtering)\n   */\n  isAllSelected(groupId?: string | number | (string | number)[]): boolean {\n    if (groupId == null) {\n      return this.allSelected;\n    }\n    const { selectedValues } = this;\n    const itemValues = this.getItemValues(groupId, true);\n    return itemValues.every((value) => selectedValues.includes(value));\n  }\n\n  /**\n   * Check if the selection is in a partial state\n   *\n   * @param groupId - Group ID (for filtering)\n   */\n  isIndeterminate(groupId?: string | number | (string | number)[]): boolean {\n    if (groupId == null) {\n      return this.indeterminate;\n    }\n    const values = this.selectedValues;\n    const itemValues = this.getItemValues(groupId, true);\n    const selectedValues = values.filter((value) => itemValues.includes(value));\n    const { length: selectedLength } = selectedValues;\n    return selectedLength > 0 && selectedLength < itemValues.length;\n  }\n\n  /**\n   * Toggle the selection state\n   *\n   * - If there is at least one unselected item, select all.\n   * - If all are selected, deselect all.\n   *\n   * @param groupId - Group ID (for filtering)\n   *\n   */\n  toggle(groupId?: string | number | (string | number)[]): void {\n    if (groupId == null || !this.multiple) {\n      if (this.allSelected) {\n        this.value = this.multiple ? [] : undefined;\n      } else {\n        const itemValues = this.getItemValues(undefined, true);\n        this.value = this.multiple ? itemValues : itemValues[0];\n      }\n      return;\n    }\n\n    if (this.isAllSelected(groupId)) {\n      this.unselectAll(groupId);\n    } else {\n      this.selectAll(groupId);\n    }\n  }\n\n  handleSelectItem(item: FormSelectorItemControl, ev: PointerEvent) {\n    this.onSelectItem && this.onSelectItem(item, ev);\n  }\n\n  clearGuard() {\n    this._guardingItem.value = undefined;\n  }\n\n  handleClickItem(item: FormSelectorItemControl, ev: PointerEvent) {\n    let accepted = false;\n    const accept = () => {\n      if (accepted) return;\n      accepted = true;\n      if (this.multiple) {\n        item.toggle();\n      } else if (!item.selected) {\n        item.select();\n        this.handleSelectItem(item, ev);\n      } else {\n        this.onCancelSelect?.(item, ev);\n      }\n    };\n\n    const { onClickItem } = this._props;\n    if (!onClickItem) {\n      return accept();\n    }\n\n    const result = onClickItem({\n      item,\n      selector: this,\n      event: ev,\n      accept,\n    });\n    if (isPromise(result)) {\n      this._guardingItem.value = () => item;\n      result\n        .then((_result) => {\n          this.clearGuard();\n          if (_result !== false) accept();\n        })\n        .catch((err) => {\n          this.clearGuard();\n          throw err;\n        });\n    } else if (result !== false) accept();\n  }\n\n  /**\n   * Check if the specified value is selected\n   *\n   * @param value - Value to check\n   */\n  isSelected(value: string | number): boolean {\n    return this.selectedValues.includes(value);\n  }\n\n  /** @private */\n  _joinFromSelectorItem(item: FormSelectorItemControl) {\n    const { items } = this;\n    if (!items.includes(item)) {\n      items.push(item);\n      this._syncValueForChoices();\n    }\n  }\n\n  /** @private */\n  _leaveFromSelectorItem(item: FormSelectorItemControl) {\n    arrayRemove(this.items, item);\n  }\n\n  /** @private */\n  _itemValueChangeHandler(changedSelectorItem: FormSelectorItemControl) {\n    this._reCalcValues(changedSelectorItem);\n  }\n}\n\nexport function useParentFormSelector() {\n  return inject(FormSelectorInjectionKey, null);\n}\n\nexport function useFormSelectorControl(\n  props: FormSelectorProps,\n  ctx: FormSelectorContext,\n  options?: FormSelectorControlOptions,\n) {\n  const control = new FormSelectorControl(props, ctx, options);\n  return control;\n}\n","import {\n  ExtractPropTypes,\n  SetupContext,\n  ComputedRef,\n  computed,\n  provide,\n  inject,\n  onBeforeUnmount,\n} from 'vue';\nimport { createPropsOptions } from '@fastkit/vue-utils';\nimport { FormNodeType, FormNodeControlBaseOptions } from './node';\nimport { FormSelectorControl, useParentFormSelector } from './selector';\nimport { FormSelectorItemGroupInjectionKey } from '../injections';\n\nexport function createFormSelectorItemGroupProps() {\n  return {\n    ...createPropsOptions({\n      /** disabled state */\n      disabled: Boolean,\n      /** Group ID */\n      groupId: {\n        type: [String, Number],\n        required: true,\n      },\n    }),\n  };\n}\n\nexport type FormSelectorItemGroupProps = ExtractPropTypes<\n  ReturnType<typeof createFormSelectorItemGroupProps>\n>;\n\nexport type FormSelectorItemGroupContext = SetupContext;\n\nexport interface FormSelectorItemGroupControlOptions extends FormNodeControlBaseOptions {\n  parentNodeType?: FormNodeType;\n}\n\n/**\n * Selection group node\n */\nexport class FormSelectorItemGroupControl {\n  readonly _props: FormSelectorItemGroupProps;\n\n  readonly parentNodeType?: FormNodeType;\n\n  protected _parentSelector: FormSelectorControl | null = null;\n\n  readonly groupId!: string | number;\n\n  protected _notSelected: ComputedRef<boolean>;\n\n  protected _allSelected: ComputedRef<boolean>;\n\n  protected _indeterminate: ComputedRef<boolean>;\n\n  /**\n   * Selector node\n   *\n   * @see {@link FormSelectorControl}\n   */\n  get parentSelector(): FormSelectorControl {\n    const { _parentSelector } = this;\n    if (!_parentSelector) {\n      throw new Error('missing parent selector.');\n    }\n    return _parentSelector;\n  }\n\n  /**\n   * Disabled state\n   */\n  get isDisabled(): boolean {\n    return this.parentSelector.isDisabled || this._props.disabled;\n  }\n\n  /**\n   * No items in this group are selected\n   */\n  get isNotSelected(): boolean {\n    return this._notSelected.value;\n  }\n\n  /**\n   * All items in this group are selected\n   */\n  get isAllSelected(): boolean {\n    return this._allSelected.value;\n  }\n\n  /**\n   * One or more items in this group are selected, but not all of them\n   */\n  get isIndeterminate(): boolean {\n    return this._indeterminate.value;\n  }\n\n  /**\n   * The parent selector is in multiple selection mode\n   */\n  get multiple(): boolean {\n    return this.parentSelector.multiple;\n  }\n\n  constructor(\n    props: FormSelectorItemGroupProps,\n    ctx: FormSelectorItemGroupContext,\n    options: FormSelectorItemGroupControlOptions = {},\n  ) {\n    this._props = props;\n    this.parentNodeType = options.parentNodeType;\n    this.groupId = props.groupId;\n\n    const parentSelector = useParentFormSelector();\n    if (\n      !parentSelector ||\n      (!!this.parentNodeType && this.parentNodeType !== parentSelector.nodeType)\n    ) {\n      throw new Error('missing parent selector.');\n    }\n\n    this._parentSelector = parentSelector;\n\n    this._notSelected = computed(() =>\n      parentSelector.isNotSelected(this.groupId),\n    );\n\n    this._allSelected = computed(() =>\n      parentSelector.isAllSelected(this.groupId),\n    );\n\n    this._indeterminate = computed(() =>\n      parentSelector.isIndeterminate(this.groupId),\n    );\n\n    onBeforeUnmount(() => {\n      this._parentSelector = null;\n      delete (this as any)._props;\n    });\n\n    provide(FormSelectorItemGroupInjectionKey, this);\n  }\n\n  /**\n   * Toggle the selection state of this group\n   *\n   * - If there is at least one unselected item, select all.\n   * - If all are selected, deselect all.\n   */\n  toggle(): void {\n    return this.parentSelector.toggle(this.groupId);\n  }\n\n  /**\n   * Select all items in this group\n   */\n  selectAll(): void {\n    return this.parentSelector.selectAll(this.groupId);\n  }\n\n  /**\n   * Deselect all items in this group\n   */\n  unselectAll(): void {\n    return this.parentSelector.unselectAll(this.groupId);\n  }\n}\n\nexport function useParentFormSelectorItemGroup(\n  parentSelector: FormSelectorControl,\n) {\n  const groupControl = inject(FormSelectorItemGroupInjectionKey, null);\n  if (!groupControl || groupControl.parentSelector !== parentSelector)\n    return null;\n  return groupControl;\n}\n\nexport function useFormSelectorItemGroupControl(\n  props: FormSelectorItemGroupProps,\n  ctx: FormSelectorItemGroupContext,\n  options?: FormSelectorItemGroupControlOptions,\n) {\n  const control = new FormSelectorItemGroupControl(props, ctx, options);\n  return control;\n}\n","import {\n  ExtractPropTypes,\n  SetupContext,\n  onBeforeUnmount,\n  watch,\n  InputHTMLAttributes,\n  ComputedRef,\n  computed,\n  Slot,\n} from 'vue';\nimport { createPropsOptions } from '@fastkit/vue-utils';\nimport {\n  FormNodeType,\n  createFormNodeProps,\n  FormNodeControl,\n  createFormNodeEmits,\n  FormNodeContext,\n  FormNodeControlBaseOptions,\n} from './node';\nimport { FormSelectorControl, useParentFormSelector } from './selector';\nimport {\n  FormSelectorItemGroupControl,\n  useParentFormSelectorItemGroup,\n} from './selector-item-group';\n\nexport function createFormSelectorItemProps() {\n  return {\n    ...createFormNodeProps({\n      modelValue: Boolean,\n      defaultValidateTiming: 'change',\n    }),\n    ...createPropsOptions({\n      /** selection value */\n      value: {\n        type: [String, Number],\n        // default: '',\n      },\n    }),\n  };\n}\n\nexport type FormSelectorItemProps = ExtractPropTypes<\n  ReturnType<typeof createFormSelectorItemProps>\n>;\n\nexport function createFormSelectorItemEmits() {\n  return {\n    ...createFormNodeEmits({ modelValue: Boolean }),\n  };\n}\n\nexport function createFormSelectorItemSettings() {\n  const props = createFormSelectorItemProps();\n  const emits = createFormSelectorItemEmits();\n  return { props, emits };\n}\n\nexport type FormSelectorItemInputType = 'checkbox' | 'radio';\n\nexport interface FormSelectorItemEmitOptions extends ReturnType<\n  typeof createFormSelectorItemEmits\n> {}\n\nexport type FormSelectorItemContext = SetupContext<FormSelectorItemEmitOptions>;\n\nexport interface FormSelectorItemControlOptions extends FormNodeControlBaseOptions {\n  parentNodeType?: FormNodeType;\n}\n\nexport class FormSelectorItemControl extends FormNodeControl<boolean> {\n  readonly _props: FormSelectorItemProps;\n\n  readonly parentNodeType?: FormNodeType;\n\n  protected _parentSelector: FormSelectorControl | null = null;\n\n  protected _groupControl: FormSelectorItemGroupControl | null = null;\n\n  readonly propValue?: string | number;\n\n  // readonly group?: string | number;\n  protected _multiple: ComputedRef<boolean>;\n\n  protected _hasValue: ComputedRef<boolean>;\n\n  protected _defaultSlot: ComputedRef<Slot>;\n\n  /**\n   * Selector node\n   *\n   * @see {@link FormSelectorControl}\n   */\n  get parentSelector(): FormSelectorControl | null {\n    return this._parentSelector;\n  }\n\n  /**\n   * The parent selector is currently executing the selection guard process for this item\n   */\n  get isGuardInProgress(): boolean {\n    return this.parentSelector?.guardingItem === this;\n  }\n\n  /**\n   * Selection group node\n   *\n   * @see {@link FormSelectorItemGroupControl}\n   */\n  get groupControl(): FormSelectorItemGroupControl | null {\n    return this._groupControl;\n  }\n\n  /**\n   * Selection group ID\n   */\n  get groupId(): string | number | null {\n    const { groupControl } = this;\n    if (!groupControl) return null;\n    return groupControl.groupId;\n  }\n\n  /**\n   * Selection state\n   */\n  get selected() {\n    return this._currentValue.value;\n  }\n\n  set selected(selected) {\n    if (typeof selected !== 'boolean') {\n      selected = selected === this.propValue;\n    }\n    if (this._currentValue.value !== selected) {\n      this._currentValue.value = selected;\n    }\n  }\n\n  /**\n   * The parent selector is in multiple selection mode\n   */\n  get multiple() {\n    return this._multiple.value;\n  }\n\n  /**\n   * Input type\n   *\n   * @see {@link FormSelectorItemInputType}\n   */\n  get inputType(): FormSelectorItemInputType {\n    return this.multiple ? 'checkbox' : 'radio';\n  }\n\n  /** Has a value */\n  get hasValue() {\n    return this._hasValue.value;\n  }\n\n  renderDefaultSlot() {\n    return this._defaultSlot.value(this);\n  }\n\n  constructor(\n    props: FormSelectorItemProps,\n    ctx: FormSelectorItemContext,\n    options: FormSelectorItemControlOptions = {},\n  ) {\n    super(props, ctx as unknown as FormNodeContext<boolean>, {\n      ...options,\n      modelValue: Boolean,\n    });\n    this._props = props;\n\n    (\n      [\n        '_valueChangeHandler',\n        'handleChange',\n        'handleClickInputElement',\n        'handleClickElement',\n      ] as const\n    ).forEach((fn) => {\n      const _fn = this[fn] as any;\n      this[fn] = _fn.bind(this);\n    });\n\n    this.parentNodeType = options.parentNodeType;\n    this.propValue = props.value;\n    // this.group = props.group;\n\n    this._name = computed(() => {\n      if (props.name) return props.name;\n      if (this.parentSelector) return this.parentSelector.name;\n      return undefined;\n    });\n\n    this._multiple = computed(() => {\n      if (this._parentSelector) {\n        return this._parentSelector.multiple;\n      }\n      return false;\n    });\n    this._hasValue = computed(() => {\n      const { propValue } = this;\n      return propValue != null && propValue !== '';\n    });\n    this._defaultSlot = computed(() => ctx.slots.default || (() => []));\n\n    const { _name } = this;\n    this._name = computed(() => {\n      const name = _name.value;\n      if (name != null) return name;\n      const { parentSelector } = this;\n      if (!parentSelector) return;\n      const parentName = parentSelector.name;\n      if (parentName == null) return;\n      return parentSelector.multiple ? `${parentName}[]` : parentName;\n    });\n\n    const { _isDisabled } = this;\n    this._isDisabled = computed(\n      () =>\n        _isDisabled.value ||\n        !!this.groupControl?.isDisabled ||\n        !!this.parentSelector?.isGuardInProgress,\n    );\n\n    watch(() => this._value.value, this._valueChangeHandler, {\n      immediate: true,\n    });\n\n    if (this.parentNodeType) {\n      const parentSelector = useParentFormSelector();\n\n      if (parentSelector && parentSelector.nodeType === this.parentNodeType) {\n        this._parentSelector = parentSelector;\n        parentSelector._joinFromSelectorItem(this);\n\n        this._groupControl = useParentFormSelectorItemGroup(parentSelector);\n\n        onBeforeUnmount(() => {\n          parentSelector._leaveFromSelectorItem(this);\n          this._parentSelector = null;\n          this._groupControl = null;\n        });\n      }\n    }\n  }\n\n  emptyValue() {\n    return false;\n  }\n\n  protected _valueChangeHandler(value: boolean) {\n    if (this._parentSelector) {\n      this._parentSelector &&\n        this._parentSelector._itemValueChangeHandler(this);\n    } else if (value && !this.multiple && this.currentEl && this.name) {\n      const query = `input[name=\"${this.name}\"]`;\n      const myInput = this.currentEl.querySelector(query);\n      if (!myInput) return;\n      const siblings: NodeListOf<HTMLInputElement> =\n        document.querySelectorAll(query);\n      siblings.forEach((sibling) => {\n        if (sibling === myInput) return;\n        sibling.checked = false;\n        sibling.dispatchEvent(new Event('change'));\n      });\n    }\n  }\n\n  /** Select */\n  select(): void {\n    this.value = true;\n  }\n\n  /** Deselect */\n  unselect(): void {\n    this.value = false;\n  }\n\n  /** Toggle selection state */\n  toggle(): void {\n    this.value = !this.value;\n  }\n\n  /** @internal */\n  _setValueSilent(value: boolean): void {\n    this._value.value = value;\n  }\n\n  createInputElement(\n    override: Pick<InputHTMLAttributes, 'id' | 'class'> & {\n      type?: FormSelectorItemInputType;\n    } = {},\n  ) {\n    return (\n      <input\n        id={override.id}\n        class={override.class}\n        type={override.type || this.inputType}\n        name={this.name}\n        tabindex={this.tabindex}\n        onFocus={this.focusHandler}\n        onBlur={this.blurHandler}\n        readonly={this.isReadonly}\n        disabled={!this.canOperation || this.isViewonly}\n        // v-model={this.selected}\n        checked={this.selected}\n        value={this.propValue}\n        onChange={this.handleChange}\n        onClick={this.handleClickInputElement}\n      />\n    );\n  }\n\n  handleChange(ev: Event): void {\n    this.selected = (ev.target as HTMLInputElement).checked;\n  }\n\n  handleClickInputElement(ev: PointerEvent): void {\n    if (this.canOperation && this.selected) {\n      this.parentSelector && this.parentSelector.handleSelectItem(this, ev);\n    }\n  }\n\n  handleClickElement(ev: PointerEvent): void {\n    if (this.canOperation) {\n      this.parentSelector && this.parentSelector.handleClickItem(this, ev);\n    }\n  }\n\n  /**\n   * @override\n   */\n  focusHandler(ev: FocusEvent): void {\n    super.focusHandler(ev);\n    this.parentSelector?.focusHandler(ev);\n  }\n\n  /**\n   * @override\n   */\n  blurHandler(ev: FocusEvent): void {\n    super.blurHandler(ev);\n    this.parentSelector?.blurHandler(ev);\n  }\n}\n\nexport function useFormSelectorItemControl(\n  props: FormSelectorItemProps,\n  ctx: FormSelectorItemContext,\n  options?: FormSelectorItemControlOptions,\n) {\n  const control = new FormSelectorItemControl(props, ctx, options);\n  return control;\n}\n","import {\n  ExtractPropTypes,\n  SetupContext,\n  PropType,\n  Ref,\n  ref,\n  computed,\n  ComputedRef,\n  WritableComputedRef,\n  watch,\n} from 'vue';\nimport { createPropsOptions } from '@fastkit/vue-utils';\nimport { createRule, isEmpty } from '@fastkit/rules';\nimport {\n  createFormNodeProps,\n  FormNodeControl,\n  createFormNodeEmits,\n  FormNodeControlBaseOptions,\n} from './node';\n\nexport type BoundableValue = number | string;\n\n/**\n * Required criteria for Boundable inputs\n *\n * - `start` Input of start value is mandatory\n * - `end` Input of end value is mandatory\n * - `any` At least one input is required\n * - `both` Both inputs are mandatory\n */\nexport type BoundableRequiredConstraints = 'start' | 'end' | 'any' | 'both';\n\n/**\n * Specify of Required criteria for Boundable inputs\n */\nexport type BoundableRequiredConstraintsSpec =\n  boolean | BoundableRequiredConstraints;\n\nexport const boundableRequired = createRule<BoundableRequiredConstraints>({\n  name: 'boundable:required',\n  validate: (value, type) => {\n    if (value == null) return false;\n    if (Array.isArray(value)) {\n      const [start, end] = value;\n      const startIsEmpty = isEmpty(start);\n      const endIsEmpty = isEmpty(end);\n      if ((type === 'start' || type === 'both') && startIsEmpty) {\n        return false;\n      }\n      if ((type === 'end' || type === 'both') && endIsEmpty) {\n        return false;\n      }\n      if (type === 'any' && startIsEmpty && endIsEmpty) {\n        return false;\n      }\n      return true;\n    }\n    return !isEmpty(value);\n  },\n  message: (value, { constraints: type }) => {\n    if (!Array.isArray(value)) {\n      return 'The input is required.';\n    }\n    if (type === 'start') {\n      return 'The input of the start value is required.';\n    }\n    if (type === 'end') {\n      return 'The input of the end value is required.';\n    }\n    if (type === 'any') {\n      return 'Either input is required.';\n    }\n    const [start] = value;\n    if (isEmpty(start)) {\n      return 'The start value is not entered.';\n    }\n    return 'The end value is not entered.';\n  },\n  constraints: 'any',\n});\n\nexport const boundableMin = createRule<BoundableValue>({\n  name: 'boundableMin',\n  validate: (value, min) => {\n    if (value == null) return true;\n    if (Array.isArray(value)) {\n      return value.every((_value) => _value >= min);\n    }\n    return value >= min;\n  },\n  message: (value, { constraints: min }) => {\n    if (min != null) {\n      return `Must be greater than ${min}.`;\n    }\n    throw new Error('The constraint settings are incorrect.');\n  },\n  constraints: 0,\n});\n\nexport const boundableMax = createRule<BoundableValue>({\n  name: 'boundableMax',\n  validate: (value, max) => {\n    if (value == null) return true;\n    if (Array.isArray(value)) {\n      return value.every((_value) => _value <= max);\n    }\n    return value <= max;\n  },\n  message: (value, { constraints: max }) => {\n    if (max != null) {\n      return `Must be ${max} or less.`;\n    }\n    throw new Error('The constraint settings are incorrect.');\n  },\n  constraints: Infinity,\n});\n\nexport interface BoundableInputControlPropsOptions<\n  T extends BoundableValue = BoundableValue,\n  D extends T | null = null,\n  DS extends T | null = null,\n  DE extends T | null = null,\n  Min extends T | null = null,\n  Max extends T | null = null,\n> extends Pick<FormNodeControlBaseOptions, 'defaultValidateTiming'> {\n  type: PropType<T>;\n  defaultValue?: D;\n  defaultStartValue?: DS;\n  defaultEndValue?: DE;\n  defaultMin?: Min;\n  defaultMax?: Max;\n  range?: boolean;\n}\n\nconst REQUIRED_PROP_OPTIONS = {\n  type: [Boolean, String] as PropType<boolean | BoundableRequiredConstraints>,\n  default: false,\n} as const;\n\nexport function createBoundableInputProps<\n  T extends BoundableValue = BoundableValue,\n  D extends T | null = null,\n  DS extends T | null = null,\n  DE extends T | null = null,\n  Min extends T | null = null,\n  Max extends T | null = null,\n>(options: BoundableInputControlPropsOptions<T, D, DS, DE, Min, Max>) {\n  const {\n    type,\n    defaultValue = null as D,\n    defaultStartValue = null as DS,\n    defaultEndValue = null as DE,\n    defaultMin = null as Min,\n    defaultMax = null as Max,\n    range,\n  } = options;\n\n  return {\n    ...createFormNodeProps({\n      ...options,\n      required: REQUIRED_PROP_OPTIONS,\n    }),\n    ...createPropsOptions({\n      modelValue: {\n        type,\n        default: defaultValue,\n      } as {\n        type: PropType<T | D>;\n        default: null;\n      },\n      ...(undefined as unknown as {\n        /**\n         * Required condition\n         *\n         * @default false\n         *\n         * @see {@link BoundableRequiredConstraints}\n         */\n        required: typeof REQUIRED_PROP_OPTIONS;\n      }),\n      startValue: {\n        type,\n        default: defaultStartValue,\n      } as {\n        type: PropType<T | DS>;\n        default: null;\n      },\n      endValue: {\n        type,\n        default: defaultEndValue,\n      } as {\n        type: PropType<T | DE>;\n        default: null;\n      },\n      min: {\n        type,\n        default: defaultMin,\n      } as {\n        type: PropType<T | Min>;\n        default: null;\n      },\n      max: {\n        type,\n        default: defaultMax,\n      } as {\n        type: PropType<T | Max>;\n        default: null;\n      },\n      startName: String,\n      endName: String,\n      range: {\n        type: Boolean,\n        default: range,\n      },\n    }),\n  };\n}\n\nexport function createBoundableInputEmits<\n  T extends BoundableValue = BoundableValue,\n  D extends T | null = null,\n  DS extends T | null = null,\n  DE extends T | null = null,\n  Min extends T | null = null,\n  Max extends T | null = null,\n>(_options: BoundableInputControlPropsOptions<T, D, DS, DE, Min, Max>) {\n  return {\n    ...createFormNodeEmits<T, D>(),\n    'update:startValue': (value: T | DS) => true,\n    'update:endValue': (value: T | DE) => true,\n  };\n}\n\nexport function createBoundableInputSettings<\n  T extends BoundableValue = BoundableValue,\n  D extends T | null = null,\n  DS extends T | null = null,\n  DE extends T | null = null,\n  Min extends T | null = null,\n  Max extends T | null = null,\n>(options: BoundableInputControlPropsOptions<T, D, DS, DE, Min, Max>) {\n  const props = createBoundableInputProps(options);\n  const emits = createBoundableInputEmits(options);\n  return { props, emits };\n}\n\ninterface ResolvedProps<\n  T extends BoundableValue = BoundableValue,\n  MV extends T | null = T | null,\n  SV extends T | null = T | null,\n  EV extends T | null = T | null,\n  Min extends T | null = null,\n  Max extends T | null = null,\n> {\n  readonly modelValue: MV;\n  readonly required: BoundableRequiredConstraintsSpec;\n  readonly startValue: SV;\n  readonly endValue: EV;\n  readonly min: Min;\n  readonly max: Max;\n  readonly startName?: string;\n  readonly endName?: string;\n  readonly range: boolean;\n}\n\nexport type BoundableInputProps<\n  T extends BoundableValue = BoundableValue,\n  MV extends T | null = T | null,\n  SV extends T | null = T | null,\n  EV extends T | null = T | null,\n  Min extends T | null = null,\n  Max extends T | null = null,\n> = ExtractPropTypes<\n  Omit<ReturnType<typeof createFormNodeProps>, 'modelValue' | 'required'>\n> &\n  ResolvedProps<T, MV, SV, EV, Min, Max>;\n\ninterface ResolvedEmits<\n  T extends BoundableValue = BoundableValue,\n  MV extends T | null = T | null,\n  SV extends T | null = T | null,\n  EV extends T | null = T | null,\n> {\n  'update:modelValue': (value: MV) => boolean;\n  'update:startValue': (value: SV) => boolean;\n  'update:endValue': (value: EV) => boolean;\n  change: (value: MV) => boolean;\n}\n\nexport type BoundableInputEmits<\n  T extends BoundableValue = BoundableValue,\n  MV extends T | null = T | null,\n  SV extends T | null = T | null,\n  EV extends T | null = T | null,\n> = Omit<\n  ReturnType<typeof createFormNodeEmits>,\n  'update:modelValue' | 'change'\n> &\n  ResolvedEmits<T, MV, SV, EV>;\n\nexport type BoundableInputContext<\n  T extends BoundableValue = BoundableValue,\n  MV extends T | null = T | null,\n  SV extends T | null = T | null,\n  EV extends T | null = T | null,\n> = SetupContext<BoundableInputEmits<T, MV, SV, EV>>;\n\nexport interface BoundableInputControlOptions<\n  T extends BoundableValue = BoundableValue,\n  MV extends T | null = T | null,\n  SV extends T | null = T | null,\n  EV extends T | null = T | null,\n  Min extends T | null = null,\n  Max extends T | null = null,\n>\n  extends\n    Omit<BoundableInputControlPropsOptions<T, MV, SV, EV, Min, Max>, 'type'>,\n    Pick<FormNodeControlBaseOptions, 'nodeType'> {}\n\nexport class BoundableInputControl<\n  T extends BoundableValue = BoundableValue,\n  MV extends T | null = T | null,\n  SV extends T | null = T | null,\n  EV extends T | null = T | null,\n  Min extends T | null = null,\n  Max extends T | null = null,\n> extends FormNodeControl<MV, MV, typeof REQUIRED_PROP_OPTIONS> {\n  readonly _props: BoundableInputProps<T, MV, SV, EV, Min, Max>;\n\n  protected _boundableOptions: BoundableInputControlOptions<\n    T,\n    MV,\n    SV,\n    EV,\n    Min,\n    Max\n  >;\n\n  protected _startValue: Ref<SV>;\n\n  protected _endValue: Ref<EV>;\n\n  protected _initialStartValue: Ref<SV>;\n\n  protected _initialEndValue: Ref<EV>;\n\n  protected _currentStartValue: WritableComputedRef<SV>;\n\n  protected _currentEndValue: WritableComputedRef<EV>;\n\n  protected _startName: ComputedRef<string | undefined>;\n\n  protected _endName: ComputedRef<string | undefined>;\n\n  protected _isRange: Ref<boolean>;\n\n  protected _min: Ref<Min>;\n\n  protected _max: Ref<Max>;\n\n  get isRange() {\n    return this._isRange.value;\n  }\n\n  get startName() {\n    return this._startName.value;\n  }\n\n  get endName() {\n    return this._endName.value;\n  }\n\n  get startValue() {\n    return this._currentStartValue.value;\n  }\n\n  set startValue(startValue) {\n    this._currentStartValue.value = startValue;\n  }\n\n  get endValue() {\n    return this._currentEndValue.value;\n  }\n\n  set endValue(endValue) {\n    this._currentEndValue.value = endValue;\n  }\n\n  get validationValue() {\n    if (!this.isMounted) {\n      return super.validationValue;\n    }\n\n    if (this._validationValueGetter) {\n      return this._validationValueGetter();\n    }\n    if (this.isRange) {\n      return [this.startValue, this.endValue];\n    }\n    return this.value;\n  }\n\n  get initialStartValue() {\n    return this._initialStartValue.value;\n  }\n\n  get initialEndValue() {\n    return this._initialEndValue.value;\n  }\n\n  get min() {\n    return this._min.value;\n  }\n\n  get max() {\n    return this._max.value;\n  }\n\n  constructor(\n    props: BoundableInputProps<T, MV, SV, EV, Min, Max>,\n    ctx: BoundableInputContext<T, MV, SV, EV>,\n    options: BoundableInputControlOptions<T, MV, SV, EV, Min, Max>,\n  ) {\n    super(props, ctx, {\n      ...options,\n      requiredFactory: () => {\n        const { required } = props;\n        return required\n          ? boundableRequired(required === true ? 'any' : required)\n          : undefined;\n      },\n    });\n\n    this._props = props;\n    this._boundableOptions = options;\n    this._isRange = ref(props.range);\n    this._startName = computed(() => props.startName);\n    this._endName = computed(() => props.endName);\n    this._startValue = ref(props.startValue) as Ref<SV>;\n    this._endValue = ref(props.endValue) as Ref<EV>;\n    this._initialStartValue = ref(props.startValue) as Ref<SV>;\n    this._initialEndValue = ref(props.endValue) as Ref<EV>;\n    this._min = ref(props.min) as Ref<Min>;\n    this._max = ref(props.max) as Ref<Max>;\n\n    this._currentStartValue = computed({\n      get: () => this._startValue.value,\n      set: (value) => {\n        if (this._startValue.value === value) return;\n        this._startValue.value = value;\n        ctx.emit('update:startValue', value);\n      },\n    });\n\n    this._currentEndValue = computed({\n      get: () => this._endValue.value,\n      set: (value) => {\n        if (this._endValue.value === value) return;\n        this._endValue.value = value;\n        ctx.emit('update:endValue', value);\n      },\n    });\n\n    watch(\n      () => props.startValue,\n      (value) => {\n        this._startValue.value = value;\n      },\n    );\n\n    watch(\n      () => props.endValue,\n      (value) => {\n        this._endValue.value = value;\n      },\n    );\n\n    watch(\n      () => props.min,\n      (min) => {\n        this._min.value = min;\n      },\n    );\n\n    watch(\n      () => props.max,\n      (max) => {\n        this._max.value = max;\n      },\n    );\n  }\n\n  commitSelfValue() {\n    super.commitSelfValue();\n    this._initialStartValue.value = this.startValue;\n    this._initialEndValue.value = this.endValue;\n  }\n\n  resetSelfValue() {\n    super.resetSelfValue();\n    this.startValue = this._initialStartValue.value;\n    this.endValue = this._initialEndValue.value;\n  }\n\n  emptyStartValue() {\n    return (this._boundableOptions.defaultStartValue || null) as SV;\n  }\n\n  emptyEndValue() {\n    return (this._boundableOptions.defaultStartValue || null) as EV;\n  }\n\n  clearSelf() {\n    super.clearSelf();\n    this.startValue = this.emptyStartValue();\n    this.endValue = this.emptyEndValue();\n  }\n\n  protected _resolveRules() {\n    if (!this.isMounted) return [];\n    const rules = super._resolveRules();\n    const { min, max } = this;\n    min && rules.push(boundableMin(min));\n    max && rules.push(boundableMax(max));\n\n    rules.sort((a, b) => {\n      const { $name: an } = a;\n      const { $name: bn } = b;\n      if (an === boundableRequired.$name) return -1;\n      if (bn === boundableRequired.$name) return 1;\n      return 0;\n    });\n\n    return rules;\n  }\n}\n\nexport function useBoundableInputControl<\n  T extends BoundableValue = BoundableValue,\n  MV extends T | null = T | null,\n  SV extends T | null = T | null,\n  EV extends T | null = T | null,\n  Min extends T | null = null,\n  Max extends T | null = null,\n>(\n  props: BoundableInputProps<T, MV, SV, EV, Min, Max>,\n  ctx: BoundableInputContext<T, MV, SV, EV>,\n  options: BoundableInputControlOptions<T, MV, SV, EV, Min, Max>,\n) {\n  const control = new BoundableInputControl<T, MV, SV, EV, Min, Max>(\n    props,\n    ctx,\n    options,\n  );\n  return control;\n}\n","import { PropType, ComputedRef, computed } from 'vue';\nimport {\n  BoundableInputControlPropsOptions,\n  createBoundableInputProps,\n  createBoundableInputEmits,\n  BoundableInputControlOptions,\n  BoundableInputProps,\n  BoundableInputContext,\n  BoundableInputControl,\n} from './boundable-input';\n\ntype DateInputValue = string;\n\nconst DEFAULT_FORMAT: Intl.DateTimeFormatOptions = {\n  year: 'numeric',\n  month: '2-digit',\n  day: '2-digit',\n};\n\nexport interface DateInputNodeControlPropsOptions<\n  D extends DateInputValue | null = null,\n  DS extends DateInputValue | null = null,\n  DE extends DateInputValue | null = null,\n  Min extends DateInputValue | null = null,\n  Max extends DateInputValue | null = null,\n> extends Omit<\n  BoundableInputControlPropsOptions<DateInputValue, D, DS, DE, Min, Max>,\n  'type'\n> {\n  omitEndYearFormat?: boolean;\n}\n\nexport type DateInputFormat =\n  Intl.DateTimeFormatOptions | ((value: DateInputValue) => string);\n\ntype FormatLocales = string | string[];\n\nexport function createDateInputNodeProps<\n  D extends DateInputValue | null = null,\n  DS extends DateInputValue | null = null,\n  DE extends DateInputValue | null = null,\n  Min extends DateInputValue | null = null,\n  Max extends DateInputValue | null = null,\n>(options: DateInputNodeControlPropsOptions<D, DS, DE, Min, Max> = {}) {\n  const { omitEndYearFormat = true } = options;\n  return {\n    ...createBoundableInputProps({ type: String, ...options }),\n    /**\n     * {@link Intl.DateTimeFormatOptions}\n     */\n    format: Object as PropType<Intl.DateTimeFormatOptions>,\n    /**\n     * Omit the western calendar year of the end date.\n     */\n    omitEndYearFormat: {\n      type: Boolean,\n      default: omitEndYearFormat,\n    },\n    /**\n     * Format locales\n     */\n    formatLocales: [String, Array, Function] as PropType<\n      FormatLocales | (() => FormatLocales)\n    >,\n  };\n}\n\nexport function createDateInputNodeEmits<\n  D extends DateInputValue | null = null,\n  DS extends DateInputValue | null = null,\n  DE extends DateInputValue | null = null,\n  Min extends DateInputValue | null = null,\n  Max extends DateInputValue | null = null,\n>(options?: DateInputNodeControlPropsOptions<D, DS, DE, Min, Max>) {\n  return createBoundableInputEmits({\n    type: String,\n    ...options,\n  });\n}\n\nexport function createDateInputNodeSettings<\n  D extends DateInputValue | null = null,\n  DS extends DateInputValue | null = null,\n  DE extends DateInputValue | null = null,\n  Min extends DateInputValue | null = null,\n  Max extends DateInputValue | null = null,\n>(options: DateInputNodeControlPropsOptions<D, DS, DE, Min, Max>) {\n  const props = createDateInputNodeProps(options);\n  const emits = createDateInputNodeEmits(options);\n  return { props, emits };\n}\n\nexport interface DateInputNodeControlOptions<\n  MV extends DateInputValue | null = DateInputValue | null,\n  SV extends DateInputValue | null = DateInputValue | null,\n  EV extends DateInputValue | null = DateInputValue | null,\n  Min extends DateInputValue | null = null,\n  Max extends DateInputValue | null = null,\n> extends BoundableInputControlOptions<DateInputValue, MV, SV, EV, Min, Max> {\n  /**\n   * {@link Intl.DateTimeFormatOptions}\n   */\n  format?: Intl.DateTimeFormatOptions;\n  /**\n   * Format locales\n   *\n   * Used when {@link Intl.DateTimeFormatOptions} is specified in format prop.\n   */\n  formatLocales?: FormatLocales | (() => FormatLocales);\n}\n\nexport type DateInputNodeProps<\n  MV extends DateInputValue | null = DateInputValue | null,\n  SV extends DateInputValue | null = DateInputValue | null,\n  EV extends DateInputValue | null = DateInputValue | null,\n  Min extends DateInputValue | null = null,\n  Max extends DateInputValue | null = null,\n> = BoundableInputProps<DateInputValue, MV, SV, EV, Min, Max> & {\n  readonly format?: Intl.DateTimeFormatOptions;\n  readonly omitEndYearFormat: boolean;\n  readonly formatLocales?: FormatLocales | (() => FormatLocales);\n};\n\nexport type DateInputNodeContext<\n  MV extends DateInputValue | null = DateInputValue | null,\n  SV extends DateInputValue | null = DateInputValue | null,\n  EV extends DateInputValue | null = DateInputValue | null,\n> = BoundableInputContext<DateInputValue, MV, SV, EV>;\n\nexport class DateInputNodeControl<\n  MV extends DateInputValue | null = DateInputValue | null,\n  SV extends DateInputValue | null = DateInputValue | null,\n  EV extends DateInputValue | null = DateInputValue | null,\n  Min extends DateInputValue | null = null,\n  Max extends DateInputValue | null = null,\n> extends BoundableInputControl<DateInputValue, MV, SV, EV, Min, Max> {\n  readonly _props: DateInputNodeProps<MV, SV, EV, Min, Max>;\n\n  protected _formatLocales: ComputedRef<string | string[] | undefined>;\n\n  protected _formatOptions: ComputedRef<Intl.DateTimeFormatOptions>;\n\n  protected _omitYearFormatOptions: ComputedRef<Intl.DateTimeFormatOptions>;\n\n  protected _formatter: ComputedRef<Intl.DateTimeFormat>;\n\n  protected _omitYearFormatter: ComputedRef<Intl.DateTimeFormat>;\n\n  protected _formattedValue: ComputedRef<string>;\n\n  protected _formattedStartValue: ComputedRef<string>;\n\n  protected _formattedEndValue: ComputedRef<string>;\n\n  protected _isAnySelected: ComputedRef<boolean>;\n\n  get formatLocales() {\n    return this._formatLocales.value;\n  }\n\n  get formatOptions() {\n    return this._formatOptions.value;\n  }\n\n  get omitYearFormatOptions() {\n    return this._omitYearFormatOptions.value;\n  }\n\n  get formatter() {\n    return this._formatter.value;\n  }\n\n  get omitYearFormatter() {\n    return this._omitYearFormatter.value;\n  }\n\n  get formattedValue() {\n    return this._formattedValue.value;\n  }\n\n  get formattedStartValue() {\n    return this._formattedStartValue.value;\n  }\n\n  get formattedEndValue() {\n    return this._formattedEndValue.value;\n  }\n\n  get isAnySelected() {\n    return this._isAnySelected.value;\n  }\n\n  get omitEndYearFormat() {\n    return this._props.omitEndYearFormat;\n  }\n\n  constructor(\n    props: DateInputNodeProps<MV, SV, EV, Min, Max>,\n    ctx: DateInputNodeContext<MV, SV, EV>,\n    options: DateInputNodeControlOptions<MV, SV, EV, Min, Max>,\n  ) {\n    super(props, ctx, options);\n\n    this._props = props;\n\n    this._formatLocales = computed(() => {\n      const locales = props.formatLocales || options.formatLocales;\n      return typeof locales === 'function' ? locales() : locales;\n    });\n\n    this._formatOptions = computed(\n      () => props.format || options.format || DEFAULT_FORMAT,\n    );\n\n    this._omitYearFormatOptions = computed(() => {\n      const _options: Intl.DateTimeFormatOptions = {\n        ...this.formatOptions,\n      };\n      delete _options.year;\n      return _options;\n    });\n\n    this._formatter = computed(\n      () => new Intl.DateTimeFormat(this.formatLocales, this.formatOptions),\n    );\n\n    this._omitYearFormatter = computed(\n      () =>\n        new Intl.DateTimeFormat(this.formatLocales, this.omitYearFormatOptions),\n    );\n\n    this._formattedValue = computed(() => {\n      const { value } = this;\n      return value ? this.formatValue(value) : '';\n    });\n\n    this._formattedStartValue = computed(() => {\n      const { startValue } = this;\n      return startValue ? this.formatValue(startValue) : '';\n    });\n\n    this._formattedEndValue = computed(() => {\n      const { startValue, endValue, omitEndYearFormat } = this;\n      if (!endValue) return '';\n      if (!startValue || !omitEndYearFormat) return this.formatValue(endValue);\n      const startDt = startValue && new Date(startValue);\n      const endDt = endValue && new Date(endValue);\n      const isSameYear = startDt.getFullYear() === endDt.getFullYear();\n      return isSameYear\n        ? this.omitYearFormatValue(endDt)\n        : this.formatValue(endDt);\n    });\n\n    this._isAnySelected = computed(() =>\n      this.isRange ? !!this.startValue || !!this.endValue : !!this.value,\n    );\n  }\n\n  formatValue(value: DateInputValue | Date) {\n    const dt = value instanceof Date ? value : new Date(value);\n    return this.formatter.format(dt);\n  }\n\n  formatValueToParts(value: DateInputValue | Date) {\n    const dt = value instanceof Date ? value : new Date(value);\n    return this.formatter.formatToParts(dt);\n  }\n\n  omitYearFormatValue(value: DateInputValue | Date) {\n    const dt = value instanceof Date ? value : new Date(value);\n    return this.omitYearFormatter.format(dt);\n  }\n\n  omitYearFormatValueToParts(value: DateInputValue | Date) {\n    const dt = value instanceof Date ? value : new Date(value);\n    return this.omitYearFormatter.formatToParts(dt);\n  }\n}\n\nexport function useDateInputNodeControl<\n  MV extends DateInputValue | null = DateInputValue | null,\n  SV extends DateInputValue | null = DateInputValue | null,\n  EV extends DateInputValue | null = DateInputValue | null,\n  Min extends DateInputValue | null = null,\n  Max extends DateInputValue | null = null,\n>(\n  props: DateInputNodeProps<MV, SV, EV, Min, Max>,\n  ctx: DateInputNodeContext<MV, SV, EV>,\n  options: DateInputNodeControlOptions<MV, SV, EV, Min, Max>,\n) {\n  const control = new DateInputNodeControl<MV, SV, EV, Min, Max>(\n    props,\n    ctx,\n    options,\n  );\n  return control;\n}\n","import {\n  ExtractPropTypes,\n  SetupContext,\n  ref,\n  mergeProps,\n  watch,\n  computed,\n  type ComputedRef,\n  type InputHTMLAttributes,\n  type PropType,\n} from 'vue';\nimport { createPropsOptions } from '@fastkit/vue-utils';\nimport {\n  createFormNodeProps,\n  FormNodeControl,\n  createFormNodeEmits,\n  FormNodeContext,\n  FormNodeControlBaseOptions,\n} from './node';\n\nconst modelValue = Array as PropType<File[]>;\n\nexport interface FileInputNodeControlOptions extends FormNodeControlBaseOptions {\n  defaultMultiple?: boolean;\n}\n\nexport interface FileInputNodeFile extends Pick<\n  File,\n  'name' | 'type' | 'size' | 'lastModified'\n> {\n  readonly _file: File;\n  readonly truncatedName: string;\n  readonly readableSize: string;\n}\n\nfunction humanReadableFileSize(\n  bytes: number,\n  base: 1000 | 1024 = 1000,\n): string {\n  if (bytes < base) {\n    return `${bytes} B`;\n  }\n\n  const prefix = base === 1024 ? ['Ki', 'Mi', 'Gi'] : ['k', 'M', 'G'];\n  let unit = -1;\n  while (Math.abs(bytes) >= base && unit < prefix.length - 1) {\n    bytes /= base;\n    ++unit;\n  }\n  return `${bytes.toFixed(1)} ${prefix[unit]}B`;\n}\n\nfunction truncateText(str: string, truncateLength: number) {\n  if (str.length < Number(truncateLength)) return str;\n  const charsKeepOneSide = Math.floor((Number(truncateLength) - 1) / 2);\n  return `${str.slice(0, charsKeepOneSide)}…${str.slice(str.length - charsKeepOneSide)}`;\n}\n\nfunction createFileInputNodeFile(\n  file: File,\n  truncateLength: number,\n): FileInputNodeFile {\n  const { name, size, type, lastModified } = file;\n  const truncatedName = truncateText(name, truncateLength);\n  const readableSize = humanReadableFileSize(size);\n\n  return {\n    _file: file,\n    name,\n    size,\n    type,\n    lastModified,\n    truncatedName,\n    readableSize,\n  };\n}\n\nexport interface FileInputNodeSelectionContext {\n  files: FileInputNodeFile[];\n  totalSize: number;\n  totalReadableSize: string;\n}\n\nexport function createFileInputNodeProps(\n  options: FileInputNodeControlOptions = {},\n) {\n  const { defaultMultiple, defaultValidateTiming = 'change' } = options;\n  return {\n    ...createFormNodeProps({\n      ...options,\n      defaultValidateTiming,\n      modelValue,\n    }),\n    ...createPropsOptions({\n      /**\n       * Defines the file types that the file input field accepts.\n       *\n       * @example \".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n       *\n       * @see https://developer.mozilla.org/docs/Web/HTML/Reference/Elements/input/file#accept\n       */\n      accept: String,\n      /**\n       * When the `accept` attribute indicates that the input is intended for image\n       * or video data, specifies which camera to use for capturing the data.\n       *\n       * @see https://developer.mozilla.org/docs/Web/HTML/Reference/Elements/input/file#capture\n       */\n      capture: String as PropType<InputHTMLAttributes['capture']>,\n      /**\n       * Allows selecting multiple files.\n       *\n       * @see https://developer.mozilla.org/docs/Web/HTML/Reference/Elements/input/file#multiple\n       */\n      multiple: {\n        type: Boolean,\n        default: defaultMultiple,\n      },\n      /**\n       * The number of characters after which the file name will be truncated.\n       *\n       * @default 22\n       */\n      truncateLength: {\n        type: [Number, String],\n        default: 22,\n      },\n      /** placeholder */\n      placeholder: String,\n    }),\n  };\n}\nexport type FileInputNodeProps = ExtractPropTypes<\n  ReturnType<typeof createFileInputNodeProps>\n>;\n\nexport function createFileInputNodeEmits(\n  options?: FileInputNodeControlOptions,\n) {\n  return {\n    ...createFormNodeEmits({ ...options, modelValue }),\n  };\n}\n\nexport function createFileInputNodeSettings(\n  options?: FileInputNodeControlOptions,\n) {\n  const props = createFileInputNodeProps(options);\n  const emits = createFileInputNodeEmits();\n  return { props, emits };\n}\n\nexport interface FileInputNodeEmits extends ReturnType<\n  typeof createFileInputNodeEmits\n> {}\n\nexport type FileInputNodeContext = SetupContext<FileInputNodeEmits>;\n\nexport class FileInputNodeControl extends FormNodeControl<File[], File[]> {\n  readonly _props: FileInputNodeProps;\n\n  protected _inputElement = ref<HTMLInputElement | null>(null);\n\n  protected _files: ComputedRef<FileInputNodeFile[]>;\n\n  protected _selectionContext: ComputedRef<FileInputNodeSelectionContext>;\n\n  /**\n   * `<input />` Element\n   */\n  get inputElement(): HTMLInputElement | null {\n    return this._inputElement.value;\n  }\n\n  get multiple() {\n    return this._props.multiple;\n  }\n\n  get accept() {\n    return this._props.accept;\n  }\n\n  get capture() {\n    return this._props.capture;\n  }\n\n  get truncateLength() {\n    return Number(this._props.truncateLength);\n  }\n\n  get files(): FileInputNodeFile[] {\n    return this._files.value;\n  }\n\n  get selectionContext(): FileInputNodeSelectionContext {\n    return this._selectionContext.value;\n  }\n\n  get placeholder() {\n    return this._props.placeholder;\n  }\n\n  constructor(\n    props: FileInputNodeProps,\n    ctx: FileInputNodeContext,\n    options: FileInputNodeControlOptions = {},\n  ) {\n    super(props, ctx as unknown as FormNodeContext<File[], File[]>, {\n      ...options,\n      modelValue,\n      shallow: true,\n    });\n    this._props = props;\n\n    this._handleNodeChange = this._handleNodeChange.bind(this);\n\n    this._files = computed(() => {\n      return (this.value || []).map((_file) => {\n        return createFileInputNodeFile(_file, this.truncateLength);\n      });\n    });\n\n    this._selectionContext = computed(() => {\n      const { files } = this;\n      const totalSize = files.reduce((bytes, { size = 0 }) => bytes + size, 0);\n      const totalReadableSize = humanReadableFileSize(totalSize);\n      return {\n        files,\n        totalSize,\n        totalReadableSize,\n      };\n    });\n\n    watch(\n      () => props.modelValue,\n      (newValue) => {\n        const { inputElement } = this;\n        if (!inputElement) return;\n\n        const hasModelReset = !Array.isArray(newValue) || !newValue.length;\n        if (hasModelReset) {\n          inputElement.value = '';\n        }\n      },\n    );\n  }\n\n  emptyValue() {\n    return [];\n  }\n\n  protected _handleNodeChange(ev: Event) {\n    const input = ev.target as HTMLInputElement;\n    const files = Array.from(input.files ?? []);\n    this.value = this.multiple ? files : files.slice(0, 1);\n    // input.value = '';\n  }\n\n  createInputElement(override: Omit<InputHTMLAttributes, 'type'> = {}) {\n    const attrs: InputHTMLAttributes = {\n      id: this.mountedNodeId,\n      class: override.class,\n      type: 'file',\n      name: this.name,\n      accept: this.accept,\n      capture: this.capture,\n      multiple: this.multiple,\n      tabindex: this.tabindex,\n      readonly: this.isReadonly,\n      disabled: this.isDisabled || this.isViewonly,\n      onFocus: this.focusHandler,\n      onBlur: this.blurHandler,\n      onChange: this._handleNodeChange,\n    };\n\n    const el = (\n      <input {...mergeProps(attrs as any, override)} ref={this._inputElement} />\n    );\n    return el;\n  }\n\n  focus(opts?: FocusOptions) {\n    if (this.isDisabled) return;\n    this.inputElement?.focus(opts);\n  }\n\n  blur() {\n    this.inputElement?.blur();\n  }\n}\n\nexport function useFileInputNodeControl(\n  props: FileInputNodeProps,\n  ctx: FileInputNodeContext,\n  options?: FileInputNodeControlOptions,\n) {\n  const control = new FileInputNodeControl(props, ctx, options);\n  return control;\n}\n","import {\n  ExtractPropTypes,\n  PropType,\n  SetupContext,\n  computed,\n  ComputedRef,\n  onBeforeUnmount,\n  VNodeChild,\n  Ref,\n  ref,\n  provide,\n  markRaw,\n} from 'vue';\nimport {\n  createPropsOptions,\n  VNodeChildOrSlot,\n  resolveVNodeChildOrSlots,\n  TypedSlot,\n  cleanupEmptyVNodeChild,\n  DefineSlotsType,\n} from '@fastkit/vue-utils';\nimport { arrayRemove, mixin, Mixin } from '@fastkit/helpers';\nimport {\n  FormNodeControl,\n  FormNodeErrorSlots,\n  FormNodeErrorSlotsSource,\n  FormNodeErrorMessageSource,\n} from './node';\nimport type { VueFormService } from '../service';\nimport { useVueForm, FormNodeWrapperInjectionKey } from '../injections';\n\nconst EMPTY_MESSAGE = '\\xa0'; // for keep height\n\nexport type RequiredChipSource = (() => VNodeChild) | string | boolean;\n\nexport type FormNodeWrapperHinttip = boolean | string | (() => VNodeChild);\n\nexport type FormNodeWrapperHinttipDelay = 'click' | number;\n\nexport type FormNodeWrapperSlots = DefineSlotsType<\n  {\n    /** label */\n    label?: (wrapper: FormNodeWrapper) => any;\n    /** hint message */\n    hint?: (wrapper: FormNodeWrapper) => any;\n    /** Elements to be added to the information message */\n    infoAppends?: (wrapper: FormNodeWrapper) => any;\n  } & FormNodeErrorSlots\n>;\n\nexport function createFormNodeWrapperProps() {\n  return {\n    ...createPropsOptions({\n      /**\n       * Instance of FormNodeControl\n       *\n       * When this setting is applied, the state and error messages will always refer to the state of this node. If not set, it will attempt to compute them from descendant nodes.\n       */\n      nodeControl: {} as PropType<FormNodeControl>,\n      /** label */\n      label: {} as PropType<VNodeChildOrSlot>,\n      /** hint message */\n      hint: {} as PropType<VNodeChildOrSlot>,\n      /** Settings for displaying hint as tips */\n      hinttip: [Boolean, String, Function] as PropType<FormNodeWrapperHinttip>,\n      /** hint tip Display Delay */\n      hinttipDelay: [String, Number] as PropType<FormNodeWrapperHinttipDelay>,\n      /** Elements to be added to the information message */\n      infoAppends: {} as PropType<VNodeChildOrSlot>,\n      /** Hide information */\n      hiddenInfo: Boolean,\n      /** Chip(required) display settings */\n      requiredChip: {} as PropType<RequiredChipSource>,\n      /**\n       * Collect the error messages of all nodes belonging to this node\n       *\n       * By default, a node attempts to render error messages on its own, but enabling this setting allows the parent wrapper to manage the rendering of error messages.\n       * If you want to exclude a specific node from this configuration, enable the `showOwnErrors` setting for that node.\n       *\n       * @default true\n       */\n      collectErrorMessages: {\n        type: Boolean,\n        default: true,\n      },\n    }),\n  };\n}\n\nexport type FormNodeWrapperProps = ExtractPropTypes<\n  ReturnType<typeof createFormNodeWrapperProps>\n>;\n\nexport function createFormNodeWrapperEmits() {\n  return {\n    clickLabel: (ev: PointerEvent, wrapper: FormNodeWrapper) => true,\n  };\n}\n\nexport type FormNodeWrapperEmitOptions = ReturnType<\n  typeof createFormNodeWrapperEmits\n>;\n\nexport function createFormNodeWrapperSettings() {\n  const props = createFormNodeWrapperProps();\n  const emits = createFormNodeWrapperEmits();\n  return { props, emits };\n}\n\nexport type FormNodeWrapperContext = SetupContext<FormNodeWrapperEmitOptions>;\n\nexport interface FormNodeWrapperOptions {\n  hinttipPrepend?: () => VNodeChild;\n}\n\n/**\n * Form node wrapper\n */\nexport class FormNodeWrapper {\n  readonly _props: FormNodeWrapperProps;\n\n  readonly _service: VueFormService;\n\n  protected _ctx: FormNodeWrapperContext | undefined;\n\n  protected _allNodes: Ref<FormNodeControl[]> = ref([]);\n\n  protected _labelSlot: ComputedRef<TypedSlot<FormNodeWrapper> | undefined>;\n\n  protected _hintSlot: ComputedRef<TypedSlot<FormNodeWrapper> | undefined>;\n\n  protected _hinttip: ComputedRef<VNodeChild>;\n\n  protected _hinttipDelay: ComputedRef<FormNodeWrapperHinttipDelay | undefined>;\n\n  protected _hinttipPrepend?: () => VNodeChild;\n\n  protected _infoAppendsSlot: ComputedRef<\n    TypedSlot<FormNodeWrapper> | undefined\n  >;\n\n  protected _validating: ComputedRef<boolean>;\n\n  protected _pending: ComputedRef<boolean>;\n\n  protected _focused: ComputedRef<boolean>;\n\n  protected _dirty: ComputedRef<boolean>;\n\n  protected _disabled: ComputedRef<boolean>;\n\n  protected _readonly: ComputedRef<boolean>;\n\n  protected _viewonly: ComputedRef<boolean>;\n\n  protected _touched: ComputedRef<boolean>;\n\n  protected _required: ComputedRef<boolean>;\n\n  protected _invalid: ComputedRef<boolean>;\n\n  protected _resolvedErrorMessages: ComputedRef<FormNodeErrorMessageSource[]>;\n\n  /**\n   * Root service of `vue-form-control`\n   *\n   * @see {@link VueFormService}\n   */\n  get service(): VueFormService {\n    return this._service;\n  }\n\n  /**\n   * Instance of FormNodeControl\n   *\n   * When this setting is applied, the state and error messages will always refer to the state of this node. If not set, it will attempt to compute them from descendant nodes.\n   */\n  get nodeControl(): FormNodeControl | undefined {\n    return this._props.nodeControl;\n  }\n\n  /**\n   * List of all nodes belonging to this wrapper\n   *\n   * This list is a reactive list, and depending on usage, it may contain a large number of nodes.\n   * Please be aware that complex operations using this list can lead to performance issues.\n   */\n  get allNodes() {\n    return this._allNodes.value;\n  }\n\n  /**\n   * At least one of the associated nodes is validating the value\n   */\n  get validating() {\n    return this._validating.value;\n  }\n\n  /**\n   * Pending processing\n   *\n   * This is marked as `true` during the validation and finalization process of the value\n   */\n  get pending() {\n    return this._pending.value;\n  }\n\n  /**\n   * One of the associated nodes is currently focused\n   */\n  get focused() {\n    return this._focused.value;\n  }\n\n  /**\n   * The changes to the input value have not been committed yet\n   *\n   * @see {@link FormNodeControl.initialValue initialValue}\n   */\n  get dirty() {\n    return this._dirty.value;\n  }\n\n  /**\n   * The input value has not been changed from its initial value\n   */\n  get pristine() {\n    return !this.dirty;\n  }\n\n  /**\n   * All associated nodes are disabled\n   */\n  get isDisabled() {\n    return this._disabled.value;\n  }\n\n  /**\n   * All associated nodes are read-only\n   */\n  get isReadonly() {\n    return this._readonly.value;\n  }\n\n  /**\n   * All associated nodes are view-only\n   */\n  get isViewonly() {\n    return this._viewonly.value;\n  }\n\n  /**\n   * All associated nodes are operable\n   */\n  get canOperation() {\n    return !this.isDisabled && !this.isReadonly && !this.isViewonly;\n  }\n\n  /**\n   * One of the associated nodes has already been touched\n   */\n  get touched() {\n    return this._touched.value;\n  }\n\n  /**\n   * None of the associated nodes has been touched yet\n   */\n  get untouched() {\n    return !this.touched;\n  }\n\n  /**\n   * One of the associated nodes requires input\n   */\n  get isRequired() {\n    return this._required.value;\n  }\n\n  /**\n   * There is an error in the input value of one of the associated nodes\n   */\n  get invalid() {\n    return this._invalid.value;\n  }\n\n  /**\n   * No errors in the input values of all associated nodes\n   */\n  get valid() {\n    return !this.invalid;\n  }\n\n  /**\n   * Collect the error messages of all nodes belonging to this node\n   */\n  get collectErrorMessages() {\n    return this._props.collectErrorMessages;\n  }\n\n  /**\n   * Source code for all collected error messages\n   *\n   * This list is generated based on the setting of {@link FormNodeControl.showOwnErrors showOwnErrors}.\n   *\n   * @see {@link FormNodeErrorMessageSource}\n   */\n  get errorMessages(): FormNodeErrorMessageSource[] {\n    return this._resolvedErrorMessages.value;\n  }\n\n  /**\n   * Source code for the first error message among all collected messages\n   *\n   * This list is generated based on the setting of {@link FormNodeControl.showOwnErrors showOwnErrors}.\n   *\n   * @see {@link FormNodeErrorMessageSource}\n   */\n  get firstErrorMessage(): FormNodeErrorMessageSource | undefined {\n    return this.errorMessages[0];\n  }\n\n  get labelSlot() {\n    return this._labelSlot.value;\n  }\n\n  get hintSlot() {\n    return this._hintSlot.value;\n  }\n\n  get infoAppendsSlot() {\n    return this._infoAppendsSlot.value;\n  }\n\n  get hinttipDelay() {\n    return this._hinttipDelay.value;\n  }\n\n  constructor(\n    props: FormNodeWrapperProps,\n    ctx: FormNodeWrapperContext,\n    options: FormNodeWrapperOptions = {},\n  ) {\n    markRaw(this);\n\n    this._props = props;\n    this._service = useVueForm();\n    const { slots } = ctx;\n\n    this._ctx = ctx;\n\n    this._labelSlot = computed(() =>\n      resolveVNodeChildOrSlots(props.label, slots.label),\n    );\n\n    this._hintSlot = computed(() =>\n      resolveVNodeChildOrSlots(props.hint, slots.hint),\n    );\n\n    this._hinttipPrepend = options.hinttipPrepend;\n\n    this._hinttip = computed(() => {\n      const { hinttip } = props;\n      if (!hinttip) return;\n      if (typeof hinttip === 'function') return hinttip();\n      const children: VNodeChild[] = [];\n      if (this._hinttipPrepend) {\n        children.push(this._hinttipPrepend());\n      }\n      if (typeof hinttip !== 'boolean') {\n        children.push(hinttip);\n      }\n      return children;\n    });\n\n    this._hinttipDelay = computed(() => {\n      const { hinttipDelay } = props;\n      return hinttipDelay == null ? 500 : hinttipDelay;\n    });\n\n    this._infoAppendsSlot = computed(() =>\n      resolveVNodeChildOrSlots(props.infoAppends, slots.infoAppends),\n    );\n\n    const hasTrueFromControlOrChildren = <\n      P extends\n        | 'validating'\n        | 'pending'\n        | 'focused'\n        | 'dirty'\n        | 'touched'\n        | 'isRequired'\n        | 'invalid',\n    >(\n      prop: P,\n    ): boolean => {\n      const nc = props.nodeControl;\n      if (nc) return nc[prop];\n      return this.allNodes.some((node) => node[prop]);\n    };\n\n    const everyTrueFromControlOrChildren = <\n      P extends 'isDisabled' | 'isReadonly' | 'isViewonly',\n    >(\n      prop: P,\n    ): boolean => {\n      const nc = props.nodeControl;\n      if (nc) return nc[prop];\n      return this.allNodes.every((node) => node[prop]);\n    };\n\n    this._validating = computed(() =>\n      hasTrueFromControlOrChildren('validating'),\n    );\n    this._pending = computed(() => hasTrueFromControlOrChildren('pending'));\n    this._focused = computed(() => hasTrueFromControlOrChildren('focused'));\n    this._dirty = computed(() => hasTrueFromControlOrChildren('dirty'));\n    this._touched = computed(() => hasTrueFromControlOrChildren('touched'));\n\n    this._disabled = computed(() =>\n      everyTrueFromControlOrChildren('isDisabled'),\n    );\n    this._readonly = computed(() =>\n      everyTrueFromControlOrChildren('isReadonly'),\n    );\n    this._viewonly = computed(() =>\n      everyTrueFromControlOrChildren('isViewonly'),\n    );\n    this._required = computed(() => hasTrueFromControlOrChildren('isRequired'));\n    this._invalid = computed(() => hasTrueFromControlOrChildren('invalid'));\n\n    this._resolvedErrorMessages = computed(() => {\n      const nc = props.nodeControl;\n      if (nc) return nc.errorMessages;\n\n      const messages: FormNodeErrorMessageSource[] = [];\n      for (const node of this.allNodes) {\n        if (\n          !node.showOwnErrors &&\n          !node.parentFormGroup?.collectErrorMessages\n        ) {\n          node.errors.forEach((error) => {\n            messages.push(\n              node._createFormNodeErrorMessageSource(\n                error,\n                messages.length + 1,\n                ctx.slots as any,\n              ),\n            );\n          });\n        }\n      }\n      return messages;\n    });\n\n    onBeforeUnmount(() => {\n      delete this._ctx;\n      delete (this as any)._props;\n      delete (this as any)._service;\n    });\n\n    provide(FormNodeWrapperInjectionKey, this);\n  }\n\n  renderLabel() {\n    const { labelSlot: slot } = this;\n    return (slot && cleanupEmptyVNodeChild(slot(this))) || undefined;\n  }\n\n  renderHint(allowNotFocused?: boolean) {\n    if (!allowNotFocused && !this.focused) return;\n    const { hintSlot: slot } = this;\n    return (slot && cleanupEmptyVNodeChild(slot(this))) || undefined;\n  }\n\n  renderInfoAppends() {\n    const { infoAppendsSlot: slot } = this;\n    return (slot && cleanupEmptyVNodeChild(slot(this))) || undefined;\n  }\n\n  protected _getContextOrDie() {\n    const { _ctx } = this;\n    if (!_ctx) throw new Error('missing form wrapper context');\n    return _ctx;\n  }\n\n  renderFirstError(slotsOverrides?: FormNodeErrorSlotsSource) {\n    if (!this.canOperation) {\n      return;\n    }\n    return this.firstErrorMessage?.render(slotsOverrides);\n  }\n\n  renderMessage(allowNotFocused?: boolean) {\n    if (!this.canOperation) return EMPTY_MESSAGE;\n    const error = this.renderFirstError();\n    if (error) return error;\n    return (\n      (!this._hinttip.value && this.renderHint(allowNotFocused)) ||\n      EMPTY_MESSAGE\n    );\n  }\n\n  renderHinttip():\n    | {\n        tip: VNodeChild;\n        hint: VNodeChild;\n      }\n    | undefined {\n    const { value: hinttip } = this._hinttip;\n    if (!hinttip) {\n      return;\n    }\n    const hint = this.renderHint(true);\n    if (!hint) return;\n\n    return {\n      tip: hinttip,\n      hint,\n    };\n  }\n\n  /** @internal */\n  __joinFromNode(node: FormNodeControl) {\n    const { allNodes } = this;\n    if (!allNodes.includes(node)) {\n      allNodes.push(node);\n    }\n  }\n\n  /** @internal */\n  __leaveFromNode(node: FormNodeControl) {\n    arrayRemove(this.allNodes, node);\n  }\n\n  /**\n   * Generate a Proxy instance that extends the interface for this wrapper.\n   *\n   * @param trait - trait object\n   * @returns Mixed-in Proxy\n   */\n  extend<U extends object>(trait: U): Mixin<this, U> {\n    return mixin(this, trait);\n  }\n}\n\nexport function useFormNodeWrapper(\n  props: FormNodeWrapperProps,\n  ctx: FormNodeWrapperContext,\n  options?: FormNodeWrapperOptions,\n) {\n  const control = new FormNodeWrapper(props, ctx, options);\n  return control;\n}\n","import {\n  ExtractPropTypes,\n  SetupContext,\n  provide,\n  ref,\n  Ref,\n  computed,\n  ComputedRef,\n} from 'vue';\nimport { arrayRemove } from '@fastkit/helpers';\nimport { createPropsOptions } from '@fastkit/vue-utils';\nimport {\n  createFormNodeProps,\n  FormNodeControl,\n  createFormNodeEmits,\n  FormNodeContext,\n  FormNodeControlBaseOptions,\n} from './node';\nimport { FormGroupInjectionKey } from '../injections';\n\nexport function createFormGroupProps() {\n  return {\n    ...createFormNodeProps(),\n    ...createPropsOptions({\n      /**\n       * Collect the error messages of all nodes belonging to this node\n       *\n       * By default, a node attempts to render error messages on its own, but enabling this setting allows the parent group to manage the rendering of error messages.\n       * If you want to exclude a specific node from this configuration, enable the `showOwnErrors` setting for that node.\n       */\n      collectErrorMessages: Boolean,\n      /**\n       * Auto scroll to the location of the form when invalid input is detected in the validation on submission\n       */\n      disableAutoScroll: Boolean,\n    }),\n  };\n}\n\nexport type FormGroupProps = ExtractPropTypes<\n  ReturnType<typeof createFormGroupProps>\n>;\n\nexport function createFormGroupEmits() {\n  return createFormNodeEmits();\n}\n\nexport function createFormGroupSettings() {\n  const props = createFormGroupProps();\n  const emits = createFormGroupEmits();\n  return { props, emits };\n}\n\nexport interface FormGroupEmitOptions extends ReturnType<\n  typeof createFormGroupEmits\n> {}\n\nexport type FormGroupContext = SetupContext<FormGroupEmitOptions>;\n\nexport interface FormGroupOptions extends FormNodeControlBaseOptions {}\n\nexport class FormGroupControl extends FormNodeControl {\n  readonly _props: FormGroupProps;\n\n  protected _allNodes: Ref<FormNodeControl[]> = ref([]);\n\n  protected _allInvalidNodes: ComputedRef<FormNodeControl[]>;\n\n  /**\n   * All nodes in an error state belonging recursively to this group\n   */\n  get allInvalidNodes() {\n    return this._allInvalidNodes.value;\n  }\n\n  /**\n   * Collect the error messages of all nodes belonging to this node\n   */\n  get collectErrorMessages() {\n    return this._props.collectErrorMessages;\n  }\n\n  /**\n   * Auto scroll to the location of the form when invalid input is detected in the validation on submission\n   */\n  get disableAutoScroll() {\n    return this._props.disableAutoScroll;\n  }\n\n  /**\n   * List of all nodes belonging to this group\n   *\n   * This list is a reactive list, and depending on usage, it may contain a large number of nodes.\n   * Please be aware that complex operations using this list can lead to performance issues.\n   */\n  get allNodes() {\n    return this._allNodes.value;\n  }\n\n  constructor(\n    props: FormGroupProps,\n    ctx: FormGroupContext,\n    options: FormGroupOptions = {},\n  ) {\n    super(props, ctx as unknown as FormNodeContext<{}>, {\n      ...options,\n    });\n    this._props = props;\n\n    this._allInvalidNodes = computed(() =>\n      this.allNodes.filter((node) => node.hasMyError),\n    );\n\n    const { _resolvedErrorMessages } = this;\n\n    this._resolvedErrorMessages = computed(() => {\n      if (!this.showOwnErrors) return [];\n      const messages = _resolvedErrorMessages.value.slice();\n      const { allInvalidNodes } = this;\n      for (const node of allInvalidNodes) {\n        if (!node.showOwnErrors) {\n          node.errors.forEach((error) => {\n            messages.push(\n              node._createFormNodeErrorMessageSource(\n                error,\n                messages.length + 1,\n                ctx.slots as any,\n              ),\n            );\n          });\n        }\n      }\n      return messages;\n    });\n\n    provide(FormGroupInjectionKey, this);\n  }\n\n  /** @internal */\n  __joinFromNode(node: FormNodeControl) {\n    const { allNodes } = this;\n    if (!allNodes.includes(node)) {\n      allNodes.push(node);\n    }\n  }\n\n  /** @internal */\n  __leaveFromNode(node: FormNodeControl) {\n    arrayRemove(this.allNodes, node);\n  }\n\n  /**\n   * Recursively retrieve the leading node in an error state within this group\n   */\n  findFirstInvalidNode() {\n    return this.findNodeRecursive((node) => node.invalid);\n  }\n\n  /**\n   * Scroll to the position of the leading node in an error state within this group\n   */\n  scrollToFirstInvalidNode() {\n    this.findFirstInvalidNode()?.scrollIntoView();\n  }\n\n  protected dispatchAutoScroll() {\n    !this.disableAutoScroll && this.scrollToFirstInvalidNode();\n  }\n\n  protected _forceFinalize() {\n    return true;\n  }\n\n  /**\n   * Validate the values of this group and all descendant nodes. If there is one or more errors, scroll to the top error node\n   *\n   * If `disableAutoScroll` is set, scrolling will not be performed.\n   */\n  async validateAndScroll(): Promise<boolean> {\n    const valid = await this.validate();\n    if (!valid) {\n      this.dispatchAutoScroll();\n    }\n    return valid;\n  }\n}\n\nexport function useFormGroup(\n  props: FormGroupProps,\n  ctx: FormGroupContext,\n  options?: FormGroupOptions,\n) {\n  const control = new FormGroupControl(props, ctx, options);\n  return control;\n}\n","import {\n  ExtractPropTypes,\n  SetupContext,\n  provide,\n  PropType,\n  ComputedRef,\n  computed,\n  ref,\n  Ref,\n  onBeforeUnmount,\n  watch,\n} from 'vue';\nimport { createPropsOptions } from '@fastkit/vue-utils';\nimport { isPromise } from '@fastkit/helpers';\nimport {\n  createFormGroupProps,\n  createFormGroupEmits,\n  FormGroupOptions,\n  FormGroupControl,\n} from './group';\nimport { FormInjectionKey } from '../injections';\n\n/**\n * Form action context\n */\nexport interface FormActionContext {\n  /** Control for form element */\n  form: VueForm;\n  /** Action has been canceled */\n  get canceled(): boolean;\n  /** Submit event object */\n  get event(): Event;\n  /**\n   * Cancel the action\n   *\n   * Currently, this method simply sets the `canceled` property of the context to `false`.\n   * This specification is subject to change in the future.\n   */\n  cancel: () => void;\n}\n\nexport type FormActionHandler = (ctx: FormActionContext) => any;\n\n/**\n * @deprecated\n * This type has been changed to {@link FormActionHandler}. It will be deprecated in future releases.\n */\nexport type FormFunctionableAction = FormActionHandler;\n\nexport type FormAction = string | FormActionHandler;\n\nexport interface FormInvalidSubmissionAcceptorContext {\n  /** Form control */\n  readonly form: VueForm;\n  /**\n   * Accepted\n   */\n  get accepted(): boolean;\n  /**\n   * Accept submission\n   */\n  accept(): void;\n}\n\nexport type FormInvalidSubmissionAcceptor = (\n  payload: FormInvalidSubmissionAcceptorContext,\n) => void;\n\nexport type FormAcceptInvalidSubmissionSpec =\n  boolean | FormInvalidSubmissionAcceptor;\n\nexport interface FormOptions extends FormGroupOptions {}\n\nexport function createFormProps(options: FormOptions = {}) {\n  return {\n    ...createFormGroupProps(),\n    ...createPropsOptions({\n      /**\n       * Do not perform default HTML validation when submitting the form\n       *\n       * @default true\n       */\n      novalidate: {\n        type: Boolean,\n        default: true,\n      },\n      /**\n       * Action settings for form submission\n       *\n       * Set the destination URL or callback handler\n       */\n      action: [String, Function] as PropType<FormAction>,\n      /**\n       * Automatic validation on transmission\n       *\n       * If this setting is enabled, all validation will be done before transmission and the transmission process will be canceled if there are invalid entries\n       *\n       * @default true\n       */\n      autoValidate: {\n        type: Boolean,\n        default: true,\n      },\n      /**\n       * Form is sending\n       */\n      sending: Boolean,\n      /**\n       * Accept invalid values during form submission\n       *\n       * @default false\n       */\n      acceptInvalidSubmission: {\n        type: [Boolean, Function] as PropType<FormAcceptInvalidSubmissionSpec>,\n        default: false,\n      },\n    }),\n  };\n}\n\nexport type FormProps = ExtractPropTypes<ReturnType<typeof createFormProps>>;\n\nexport function createFormEmits() {\n  return {\n    ...createFormGroupEmits(),\n    /**\n     * Form Submission\n     *\n     * This event is notified when the validation is complete and before the action is called\n     *\n     * @param form - VueForm instance\n     * @param ev - Event\n     */\n    submit: (form: VueForm, ev: Event) => true,\n    /**\n     * Updating sending status\n     *\n     * @param sending - sending status\n     * @param form - VueForm instance\n     */\n    'update:sending': (sending: boolean, form: VueForm) => true,\n    /**\n     * The form action has been finished\n     *\n     * @param actionContext - Form action context\n     */\n    finishAction: (actionContext: FormActionContext) => true,\n    /**\n     * Failed automatic validation\n     *\n     * @param form - VueForm instance\n     */\n    autoValidationFailed: (form: VueForm) => true,\n  };\n}\n\nexport type FormEmits = ReturnType<typeof createFormEmits>;\n\nexport function createFormSettings(options?: FormOptions) {\n  const props = createFormProps(options);\n  const emits = createFormEmits();\n  return { props, emits };\n}\n\nexport interface FormEmitOptions extends ReturnType<typeof createFormEmits> {}\n\nexport type FormContext = SetupContext<FormEmitOptions>;\n\n/**\n * Option to check the submittability of the form\n */\nexport interface PrepareFormSubmissionOptions {\n  /** Skip operability check */\n  skipOperationCheck?: boolean;\n  /** Skip in-progress check during submission */\n  skipSendingCheck?: boolean;\n  /** Skip validation */\n  skipValidation?: boolean;\n}\n\n/**\n * Dispatch option for form action\n */\nexport interface DispatchFormActionOptions extends PrepareFormSubmissionOptions {\n  /** Submit event object */\n  event?: Event;\n}\n\ninterface ComputedFormAttributes {\n  ref: Ref<HTMLFormElement | null>;\n  action: string | undefined;\n  spellcheck: boolean;\n  onSubmit: (ev: Event) => void;\n  novalidate: boolean;\n  'aria-disabled': boolean;\n}\n\n/**\n * Control for form element\n */\nexport class VueForm extends FormGroupControl {\n  readonly _props: FormProps;\n\n  protected _formContext: FormContext;\n\n  protected _nativeAction: ComputedRef<string | undefined>;\n\n  protected _fnAction: ComputedRef<FormActionHandler | undefined>;\n\n  protected _formRef = ref<HTMLFormElement | null>(null);\n\n  protected _actionPromise = ref<Promise<any> | null>(null);\n\n  protected _sending: ComputedRef<boolean>;\n\n  protected _formAttrs: ComputedRef<ComputedFormAttributes>;\n\n  /**\n   * Do not perform default HTML validation when submitting the form\n   */\n  get novalidate() {\n    return this._props.novalidate;\n  }\n\n  get nativeAction() {\n    return this._nativeAction.value;\n  }\n\n  /**\n   * Executing asynchronous submission action\n   */\n  get sending() {\n    return this._sending.value;\n  }\n\n  /**\n   * Automatic validation on transmission\n   *\n   * If this setting is enabled, all validation will be done before transmission and the transmission process will be canceled if there are invalid entries\n   *\n   * @default true\n   */\n  get autoValidate() {\n    return this._props.autoValidate;\n  }\n\n  /**\n   * Attributes to apply to the form element\n   */\n  get formAttrs() {\n    return this._formAttrs.value;\n  }\n\n  constructor(props: FormProps, ctx: FormContext, options: FormOptions = {}) {\n    super(props, ctx, {\n      ...options,\n    });\n    this._props = props;\n    this._formContext = ctx;\n    this._nativeAction = computed(() => {\n      if (typeof props.action === 'string') return props.action;\n      return undefined;\n    });\n    this._fnAction = computed(() => {\n      if (typeof props.action === 'function') return props.action;\n      return undefined;\n    });\n    this._sending = computed(\n      () => props.sending || this._actionPromise.value !== null,\n    );\n    this._formAttrs = computed(() => ({\n      ref: this._formRef,\n      action: this.nativeAction,\n      spellcheck: this.spellcheck,\n      onSubmit: this.handleSubmit,\n      novalidate: this._props.novalidate,\n      'aria-disabled': this.isDisabled,\n    }));\n\n    onBeforeUnmount(() => {\n      this._actionPromise.value = null;\n      delete (this as any)._formContext;\n    });\n\n    (['submit', 'handleSubmit'] as const).forEach((fn) => {\n      const _fn = this[fn];\n      this[fn] = _fn.bind(this) as any;\n    });\n\n    watch(\n      () => this._sending.value,\n      (sending) => {\n        ctx.emit('update:sending', sending, this);\n      },\n    );\n\n    provide(FormInjectionKey, this);\n  }\n\n  /**\n   * Generates SubmitEvent and dispatches it to the form element\n   *\n   * - If `preventDefault()` is called by the event handler, the sending process is canceled\n   */\n  submit() {\n    const form = this._formRef.value;\n    if (!form) return;\n    const ev = new SubmitEvent('submit', {\n      cancelable: true,\n      bubbles: true,\n    });\n    if (form.dispatchEvent(ev)) {\n      form.submit();\n    }\n  }\n\n  /**\n   * Returns `true` if the form is in a submittable state after performing state checks and validation\n   *\n   * @param options - PrepareFormSubmissionOptions\n   * @returns `true` if submission is possible\n   */\n  async prepareFormSubmission(\n    options: PrepareFormSubmissionOptions = {},\n  ): Promise<boolean> {\n    const { skipSendingCheck, skipOperationCheck, skipValidation } = options;\n\n    if (\n      (!skipSendingCheck && this.sending) ||\n      (!skipOperationCheck && !this.canOperation)\n    ) {\n      return false;\n    }\n\n    if (!skipValidation && this.autoValidate) {\n      const valid = await this.validate();\n      if (!valid) {\n        let { acceptInvalidSubmission } = this._props;\n        if (typeof acceptInvalidSubmission === 'function') {\n          let accepted = false;\n\n          const ctx: FormInvalidSubmissionAcceptorContext = {\n            form: this,\n            get accepted() {\n              return accepted;\n            },\n            accept() {\n              accepted = false;\n            },\n          };\n          acceptInvalidSubmission(ctx);\n          acceptInvalidSubmission = accepted;\n        }\n        if (!acceptInvalidSubmission) {\n          this._formContext?.emit('autoValidationFailed', this);\n          this.dispatchAutoScroll();\n          return false;\n        }\n      }\n    }\n\n    return true;\n  }\n\n  protected _dispatchAction(\n    options: DispatchFormActionOptions = {},\n  ): Promise<void> {\n    const fn = this._fnAction.value;\n    if (!fn) return Promise.resolve();\n\n    const {\n      event = new SubmitEvent('submit', {\n        cancelable: true,\n        bubbles: true,\n      }),\n    } = options;\n\n    let canceled = false;\n\n    const ctx: FormActionContext = {\n      form: this,\n      get canceled() {\n        return canceled;\n      },\n      get event() {\n        return event;\n      },\n      cancel: () => {\n        canceled = true;\n      },\n    };\n\n    const result = fn(ctx);\n    if (ctx.canceled || !isPromise(result)) {\n      this._formContext?.emit('finishAction', ctx);\n      return Promise.resolve();\n    }\n    this._actionPromise.value = result;\n    return result.finally(() => {\n      this._actionPromise.value = null;\n      this._formContext?.emit('finishAction', ctx);\n    });\n  }\n\n  /**\n   * Dispatch the specified action function\n   *\n   * @param options - Dispatch option for form action\n   */\n  async dispatchAction(options: DispatchFormActionOptions = {}): Promise<void> {\n    const submittable = await this.prepareFormSubmission(options);\n    if (!submittable) return;\n    return this._dispatchAction(options);\n  }\n\n  /**\n   * Handler for form element submission\n   *\n   * @param ev - Submit event object\n   */\n  handleSubmit(ev: Event) {\n    ev.preventDefault();\n    this.prepareFormSubmission().then((submittable) => {\n      if (!submittable) return;\n      this._formContext.emit('submit', this, ev);\n      this._dispatchAction({\n        event: ev,\n      });\n    });\n  }\n}\n\nexport function useForm(\n  props: FormProps,\n  ctx: FormContext,\n  options?: FormOptions,\n) {\n  const control = new VueForm(props, ctx, options);\n  return control;\n}\n","import { DirectiveBinding, ObjectDirective } from 'vue';\nimport IMask, { InputMask } from 'imask';\nimport {\n  createIMaskEvent,\n  IMaskEventType,\n  IMaskInput,\n  resolveIMaskInput,\n} from '../schemes';\n\ntype AnyMaskedOptions = any;\nexport type IMaskDirectiveBindingValue = IMaskInput;\n\nexport type IMaskDirectiveBinding =\n  DirectiveBinding<IMaskDirectiveBindingValue>;\n\nexport interface IMaskElement extends HTMLInputElement {\n  maskRef?: InputMask<any>;\n}\n\nexport type IMaskDirective = ObjectDirective<\n  IMaskElement,\n  IMaskDirectiveBindingValue\n>;\n\nfunction fireEvent(\n  el: IMaskElement,\n  type: IMaskEventType,\n  inputMask?: InputMask<any>,\n) {\n  const ev = createIMaskEvent(type, {\n    bubbles: true,\n    cancelable: true,\n    detail: inputMask,\n  });\n\n  el.dispatchEvent(ev);\n}\n\nfunction initMask(el: IMaskElement, opts: AnyMaskedOptions) {\n  el.maskRef = IMask(el, opts)\n    .on('accept', () => fireEvent(el, 'accept', el.maskRef))\n    .on('complete', () => fireEvent(el, 'complete', el.maskRef));\n}\n\nfunction destroyMask(el: IMaskElement) {\n  if (el.maskRef) {\n    el.maskRef.destroy();\n    delete el.maskRef;\n  }\n}\n\nexport const imaskDirective: IMaskDirective = {\n  beforeMount(el, { value: options }) {\n    const _options = resolveIMaskInput(options);\n    _options && initMask(el, _options);\n  },\n  updated(el, { value: options }) {\n    const _options = resolveIMaskInput(options);\n    if (_options) {\n      if (el.maskRef) {\n        el.maskRef.updateOptions(_options as any);\n        if (el.value !== el.maskRef.value) (el.maskRef as any)._onChange();\n      } else initMask(el, _options);\n    } else {\n      destroyMask(el);\n    }\n  },\n  unmounted(el) {\n    destroyMask(el);\n  },\n};\n\nexport function imaskDirectiveArgument(\n  bindingValue?: IMaskDirectiveBindingValue,\n): [IMaskDirective, IMaskDirectiveBindingValue] {\n  return [imaskDirective, bindingValue];\n}\n","import type { FormNodeError, FormNodeControl } from './composables/node';\nimport type { FormAutoComplete } from './schemes';\nimport { registerAutocompleteDefault } from './composables/autocompletable';\n\nexport type FormErrorMessageResolver = (\n  error: FormNodeError,\n  node?: FormNodeControl,\n) => string | void;\n\n/**\n * Scroll option for the form element\n */\nexport interface VueFormScrollOptions {\n  /**\n   * Default scroll option\n   *\n   * @see {@link ScrollIntoViewOptions}\n   */\n  options?: ScrollIntoViewOptions;\n  /**\n   * Scroll handler function\n   *\n   * @param element - Scroll target element\n   * @param options - Scroll option\n   * @returns When canceling the default scroll and implementing custom scrolling within the application, return a truthy value.\n   */\n  fn?: (element: HTMLElement, options?: ScrollIntoViewOptions) => void;\n}\n\nexport interface VueFormServiceOptions {\n  errorMessageResolvers?: FormErrorMessageResolver[];\n  /**\n   * Scroll option for the form element\n   *\n   * @see {@link VueFormScrollOptions}\n   */\n  scroll?: VueFormScrollOptions;\n  /**\n   * Default value for text input autocomplete.\n   *\n   * @see {@link FormAutoComplete}\n   */\n  defaultAutocomplete?: FormAutoComplete | boolean | undefined;\n}\n\n/**\n * Root service of `vue-form-control`\n */\nexport class VueFormService {\n  readonly errorMessageResolvers: FormErrorMessageResolver[] = [];\n\n  /**\n   * Scroll option for the form element\n   *\n   * @see {@link VueFormScrollOptions}\n   */\n  readonly scroll?: VueFormScrollOptions;\n\n  constructor(options: VueFormServiceOptions = {}) {\n    const { errorMessageResolvers, scroll } = options;\n    errorMessageResolvers &&\n      this.errorMessageResolvers.push(...errorMessageResolvers);\n    this.scroll = scroll;\n\n    registerAutocompleteDefault(options.defaultAutocomplete);\n  }\n\n  addMessageResolver(\n    resolvers: FormErrorMessageResolver | FormErrorMessageResolver[],\n  ) {\n    if (!Array.isArray(resolvers)) resolvers = [resolvers];\n    this.errorMessageResolvers.push(...resolvers);\n  }\n\n  resolveErrorMessage(\n    error: FormNodeError,\n    node?: FormNodeControl,\n  ): string | void {\n    for (const resolver of this.errorMessageResolvers) {\n      const result = resolver(error, node);\n      if (result) return result;\n    }\n  }\n\n  scrollToElement(element: HTMLElement, options?: ScrollIntoViewOptions) {\n    const { scroll } = this;\n    const _options: ScrollIntoViewOptions = {\n      behavior: 'smooth',\n      ...scroll?.options,\n      ...options,\n    };\n    const fn = scroll?.fn;\n\n    if (fn?.(element, _options)) {\n      return;\n    }\n    return element.scrollIntoView(_options);\n  }\n}\n","import { App } from 'vue';\nimport { onAppUnmount } from '@fastkit/vue-utils';\nimport { VueFormService, VueFormServiceOptions } from './service';\nimport { FormServiceInjectionKey } from './injections';\n\ndeclare module 'vue' {\n  export interface ComponentCustomProperties {\n    $form: VueFormService;\n  }\n}\n\nexport class VueFormPlugin {\n  static install(app: App, opts?: VueFormServiceOptions) {\n    const $form = new VueFormService(opts);\n    app.provide(FormServiceInjectionKey, $form);\n    app.config.globalProperties.$form = $form;\n\n    onAppUnmount(app, () => {\n      delete (app.config.globalProperties as any).$form;\n    });\n  }\n}\n\nexport function installVueFormPlugin(app: App, opts?: VueFormServiceOptions) {\n  return app.use(VueFormPlugin, opts);\n}\n"],"mappings":";;;;;;;;;;;AAAA,MAAa,sBAAsB;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;AChDA,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAIA,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAMA,SAAS,iBACP,YACA;CACA,OAAO;AACT;AAEA,MAAa,0BAA0B,iBAAiB;CACtD,OAAO,MAAM,iBAAiB,CAAC,CAAC,CAAC,KAAK;CACtC,cAAc,MAAM,YAAY,CAAC;CACjC,QAAQ,MAAM,iBAAiB,CAAC,CAAC,CAAC,YAAY;CAC9C,QAAQ,MAAM,iBAAiB,CAAC,CAAC,CAAC,YAAY;CAC9C,WAAW;CACX,aAAa;AAEf,CAAC;;;AClCD,SAAgB,iBACd,MACA,eACY;CACZ,OAAO,IAAI,YAAuB,MAAM,aAAa;AACvD;AAOA,SAAS,UAAU,QAA0C;CAC3D,MAAM,IAAI,OAAO;CACjB,OAAO,MAAM,YAAY,MAAM,cAAc,kBAAkB;AACjE;AA6CA,SAAgB,kBACd,QAC8B;CAC9B,IAAI,UAAU,MAAM,GAClB,OAAyB,EAAE,MAAM,OAAO;CAE1C,IAAI,QACF,OAAO;AAEX;;;ACtFA,MAAM,OAAO;AAEb,MAAa,SAAS,IAAI,WAAW,IAAI;AAEzC,MAAa,sBAAsB,gBAAgB,IAAI;;;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