// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark

part of 'order_form_bloc.dart';

// **************************************************************************
// FreezedGenerator
// **************************************************************************

T _$identity<T>(T value) => value;

final _privateConstructorUsedError = UnsupportedError(
  'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models',
);

/// @nodoc
mixin _$OrderFormEvent {
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String customerName) customerNameChanged,
    required TResult Function(PaymentMethod payment) paymentMethodChanged,
    required TResult Function(Customer? customer) customerChanged,
    required TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )
    createOrderWithPayment,
    required TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )
    createOrder,
    required TResult Function(String orderId, List<ProductQuantity> items)
    addItemOrder,
  }) => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String customerName)? customerNameChanged,
    TResult? Function(PaymentMethod payment)? paymentMethodChanged,
    TResult? Function(Customer? customer)? customerChanged,
    TResult? Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrderWithPayment,
    TResult? Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrder,
    TResult? Function(String orderId, List<ProductQuantity> items)?
    addItemOrder,
  }) => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String customerName)? customerNameChanged,
    TResult Function(PaymentMethod payment)? paymentMethodChanged,
    TResult Function(Customer? customer)? customerChanged,
    TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrderWithPayment,
    TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrder,
    TResult Function(String orderId, List<ProductQuantity> items)? addItemOrder,
    required TResult orElse(),
  }) => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_CustomerNameChanged value) customerNameChanged,
    required TResult Function(_PaymentMethodChanged value) paymentMethodChanged,
    required TResult Function(_CustomerChanged value) customerChanged,
    required TResult Function(_CreateOrderWithPayment value)
    createOrderWithPayment,
    required TResult Function(_CreateOrder value) createOrder,
    required TResult Function(_AddItemOrder value) addItemOrder,
  }) => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_CustomerNameChanged value)? customerNameChanged,
    TResult? Function(_PaymentMethodChanged value)? paymentMethodChanged,
    TResult? Function(_CustomerChanged value)? customerChanged,
    TResult? Function(_CreateOrderWithPayment value)? createOrderWithPayment,
    TResult? Function(_CreateOrder value)? createOrder,
    TResult? Function(_AddItemOrder value)? addItemOrder,
  }) => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_CustomerNameChanged value)? customerNameChanged,
    TResult Function(_PaymentMethodChanged value)? paymentMethodChanged,
    TResult Function(_CustomerChanged value)? customerChanged,
    TResult Function(_CreateOrderWithPayment value)? createOrderWithPayment,
    TResult Function(_CreateOrder value)? createOrder,
    TResult Function(_AddItemOrder value)? addItemOrder,
    required TResult orElse(),
  }) => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class $OrderFormEventCopyWith<$Res> {
  factory $OrderFormEventCopyWith(
    OrderFormEvent value,
    $Res Function(OrderFormEvent) then,
  ) = _$OrderFormEventCopyWithImpl<$Res, OrderFormEvent>;
}

/// @nodoc
class _$OrderFormEventCopyWithImpl<$Res, $Val extends OrderFormEvent>
    implements $OrderFormEventCopyWith<$Res> {
  _$OrderFormEventCopyWithImpl(this._value, this._then);

  // ignore: unused_field
  final $Val _value;
  // ignore: unused_field
  final $Res Function($Val) _then;

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
}

/// @nodoc
abstract class _$$CustomerNameChangedImplCopyWith<$Res> {
  factory _$$CustomerNameChangedImplCopyWith(
    _$CustomerNameChangedImpl value,
    $Res Function(_$CustomerNameChangedImpl) then,
  ) = __$$CustomerNameChangedImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String customerName});
}

/// @nodoc
class __$$CustomerNameChangedImplCopyWithImpl<$Res>
    extends _$OrderFormEventCopyWithImpl<$Res, _$CustomerNameChangedImpl>
    implements _$$CustomerNameChangedImplCopyWith<$Res> {
  __$$CustomerNameChangedImplCopyWithImpl(
    _$CustomerNameChangedImpl _value,
    $Res Function(_$CustomerNameChangedImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({Object? customerName = null}) {
    return _then(
      _$CustomerNameChangedImpl(
        null == customerName
            ? _value.customerName
            : customerName // ignore: cast_nullable_to_non_nullable
                  as String,
      ),
    );
  }
}

/// @nodoc

class _$CustomerNameChangedImpl
    with DiagnosticableTreeMixin
    implements _CustomerNameChanged {
  const _$CustomerNameChangedImpl(this.customerName);

  @override
  final String customerName;

  @override
  String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
    return 'OrderFormEvent.customerNameChanged(customerName: $customerName)';
  }

  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
    properties
      ..add(DiagnosticsProperty('type', 'OrderFormEvent.customerNameChanged'))
      ..add(DiagnosticsProperty('customerName', customerName));
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$CustomerNameChangedImpl &&
            (identical(other.customerName, customerName) ||
                other.customerName == customerName));
  }

  @override
  int get hashCode => Object.hash(runtimeType, customerName);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$CustomerNameChangedImplCopyWith<_$CustomerNameChangedImpl> get copyWith =>
      __$$CustomerNameChangedImplCopyWithImpl<_$CustomerNameChangedImpl>(
        this,
        _$identity,
      );

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String customerName) customerNameChanged,
    required TResult Function(PaymentMethod payment) paymentMethodChanged,
    required TResult Function(Customer? customer) customerChanged,
    required TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )
    createOrderWithPayment,
    required TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )
    createOrder,
    required TResult Function(String orderId, List<ProductQuantity> items)
    addItemOrder,
  }) {
    return customerNameChanged(customerName);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String customerName)? customerNameChanged,
    TResult? Function(PaymentMethod payment)? paymentMethodChanged,
    TResult? Function(Customer? customer)? customerChanged,
    TResult? Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrderWithPayment,
    TResult? Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrder,
    TResult? Function(String orderId, List<ProductQuantity> items)?
    addItemOrder,
  }) {
    return customerNameChanged?.call(customerName);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String customerName)? customerNameChanged,
    TResult Function(PaymentMethod payment)? paymentMethodChanged,
    TResult Function(Customer? customer)? customerChanged,
    TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrderWithPayment,
    TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrder,
    TResult Function(String orderId, List<ProductQuantity> items)? addItemOrder,
    required TResult orElse(),
  }) {
    if (customerNameChanged != null) {
      return customerNameChanged(customerName);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_CustomerNameChanged value) customerNameChanged,
    required TResult Function(_PaymentMethodChanged value) paymentMethodChanged,
    required TResult Function(_CustomerChanged value) customerChanged,
    required TResult Function(_CreateOrderWithPayment value)
    createOrderWithPayment,
    required TResult Function(_CreateOrder value) createOrder,
    required TResult Function(_AddItemOrder value) addItemOrder,
  }) {
    return customerNameChanged(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_CustomerNameChanged value)? customerNameChanged,
    TResult? Function(_PaymentMethodChanged value)? paymentMethodChanged,
    TResult? Function(_CustomerChanged value)? customerChanged,
    TResult? Function(_CreateOrderWithPayment value)? createOrderWithPayment,
    TResult? Function(_CreateOrder value)? createOrder,
    TResult? Function(_AddItemOrder value)? addItemOrder,
  }) {
    return customerNameChanged?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_CustomerNameChanged value)? customerNameChanged,
    TResult Function(_PaymentMethodChanged value)? paymentMethodChanged,
    TResult Function(_CustomerChanged value)? customerChanged,
    TResult Function(_CreateOrderWithPayment value)? createOrderWithPayment,
    TResult Function(_CreateOrder value)? createOrder,
    TResult Function(_AddItemOrder value)? addItemOrder,
    required TResult orElse(),
  }) {
    if (customerNameChanged != null) {
      return customerNameChanged(this);
    }
    return orElse();
  }
}

abstract class _CustomerNameChanged implements OrderFormEvent {
  const factory _CustomerNameChanged(final String customerName) =
      _$CustomerNameChangedImpl;

  String get customerName;

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$CustomerNameChangedImplCopyWith<_$CustomerNameChangedImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$PaymentMethodChangedImplCopyWith<$Res> {
  factory _$$PaymentMethodChangedImplCopyWith(
    _$PaymentMethodChangedImpl value,
    $Res Function(_$PaymentMethodChangedImpl) then,
  ) = __$$PaymentMethodChangedImplCopyWithImpl<$Res>;
  @useResult
  $Res call({PaymentMethod payment});

  $PaymentMethodCopyWith<$Res> get payment;
}

/// @nodoc
class __$$PaymentMethodChangedImplCopyWithImpl<$Res>
    extends _$OrderFormEventCopyWithImpl<$Res, _$PaymentMethodChangedImpl>
    implements _$$PaymentMethodChangedImplCopyWith<$Res> {
  __$$PaymentMethodChangedImplCopyWithImpl(
    _$PaymentMethodChangedImpl _value,
    $Res Function(_$PaymentMethodChangedImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({Object? payment = null}) {
    return _then(
      _$PaymentMethodChangedImpl(
        null == payment
            ? _value.payment
            : payment // ignore: cast_nullable_to_non_nullable
                  as PaymentMethod,
      ),
    );
  }

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @override
  @pragma('vm:prefer-inline')
  $PaymentMethodCopyWith<$Res> get payment {
    return $PaymentMethodCopyWith<$Res>(_value.payment, (value) {
      return _then(_value.copyWith(payment: value));
    });
  }
}

/// @nodoc

class _$PaymentMethodChangedImpl
    with DiagnosticableTreeMixin
    implements _PaymentMethodChanged {
  const _$PaymentMethodChangedImpl(this.payment);

  @override
  final PaymentMethod payment;

  @override
  String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
    return 'OrderFormEvent.paymentMethodChanged(payment: $payment)';
  }

  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
    properties
      ..add(DiagnosticsProperty('type', 'OrderFormEvent.paymentMethodChanged'))
      ..add(DiagnosticsProperty('payment', payment));
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$PaymentMethodChangedImpl &&
            (identical(other.payment, payment) || other.payment == payment));
  }

  @override
  int get hashCode => Object.hash(runtimeType, payment);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$PaymentMethodChangedImplCopyWith<_$PaymentMethodChangedImpl>
  get copyWith =>
      __$$PaymentMethodChangedImplCopyWithImpl<_$PaymentMethodChangedImpl>(
        this,
        _$identity,
      );

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String customerName) customerNameChanged,
    required TResult Function(PaymentMethod payment) paymentMethodChanged,
    required TResult Function(Customer? customer) customerChanged,
    required TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )
    createOrderWithPayment,
    required TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )
    createOrder,
    required TResult Function(String orderId, List<ProductQuantity> items)
    addItemOrder,
  }) {
    return paymentMethodChanged(payment);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String customerName)? customerNameChanged,
    TResult? Function(PaymentMethod payment)? paymentMethodChanged,
    TResult? Function(Customer? customer)? customerChanged,
    TResult? Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrderWithPayment,
    TResult? Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrder,
    TResult? Function(String orderId, List<ProductQuantity> items)?
    addItemOrder,
  }) {
    return paymentMethodChanged?.call(payment);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String customerName)? customerNameChanged,
    TResult Function(PaymentMethod payment)? paymentMethodChanged,
    TResult Function(Customer? customer)? customerChanged,
    TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrderWithPayment,
    TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrder,
    TResult Function(String orderId, List<ProductQuantity> items)? addItemOrder,
    required TResult orElse(),
  }) {
    if (paymentMethodChanged != null) {
      return paymentMethodChanged(payment);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_CustomerNameChanged value) customerNameChanged,
    required TResult Function(_PaymentMethodChanged value) paymentMethodChanged,
    required TResult Function(_CustomerChanged value) customerChanged,
    required TResult Function(_CreateOrderWithPayment value)
    createOrderWithPayment,
    required TResult Function(_CreateOrder value) createOrder,
    required TResult Function(_AddItemOrder value) addItemOrder,
  }) {
    return paymentMethodChanged(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_CustomerNameChanged value)? customerNameChanged,
    TResult? Function(_PaymentMethodChanged value)? paymentMethodChanged,
    TResult? Function(_CustomerChanged value)? customerChanged,
    TResult? Function(_CreateOrderWithPayment value)? createOrderWithPayment,
    TResult? Function(_CreateOrder value)? createOrder,
    TResult? Function(_AddItemOrder value)? addItemOrder,
  }) {
    return paymentMethodChanged?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_CustomerNameChanged value)? customerNameChanged,
    TResult Function(_PaymentMethodChanged value)? paymentMethodChanged,
    TResult Function(_CustomerChanged value)? customerChanged,
    TResult Function(_CreateOrderWithPayment value)? createOrderWithPayment,
    TResult Function(_CreateOrder value)? createOrder,
    TResult Function(_AddItemOrder value)? addItemOrder,
    required TResult orElse(),
  }) {
    if (paymentMethodChanged != null) {
      return paymentMethodChanged(this);
    }
    return orElse();
  }
}

abstract class _PaymentMethodChanged implements OrderFormEvent {
  const factory _PaymentMethodChanged(final PaymentMethod payment) =
      _$PaymentMethodChangedImpl;

  PaymentMethod get payment;

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$PaymentMethodChangedImplCopyWith<_$PaymentMethodChangedImpl>
  get copyWith => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$CustomerChangedImplCopyWith<$Res> {
  factory _$$CustomerChangedImplCopyWith(
    _$CustomerChangedImpl value,
    $Res Function(_$CustomerChangedImpl) then,
  ) = __$$CustomerChangedImplCopyWithImpl<$Res>;
  @useResult
  $Res call({Customer? customer});

  $CustomerCopyWith<$Res>? get customer;
}

/// @nodoc
class __$$CustomerChangedImplCopyWithImpl<$Res>
    extends _$OrderFormEventCopyWithImpl<$Res, _$CustomerChangedImpl>
    implements _$$CustomerChangedImplCopyWith<$Res> {
  __$$CustomerChangedImplCopyWithImpl(
    _$CustomerChangedImpl _value,
    $Res Function(_$CustomerChangedImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({Object? customer = freezed}) {
    return _then(
      _$CustomerChangedImpl(
        freezed == customer
            ? _value.customer
            : customer // ignore: cast_nullable_to_non_nullable
                  as Customer?,
      ),
    );
  }

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @override
  @pragma('vm:prefer-inline')
  $CustomerCopyWith<$Res>? get customer {
    if (_value.customer == null) {
      return null;
    }

    return $CustomerCopyWith<$Res>(_value.customer!, (value) {
      return _then(_value.copyWith(customer: value));
    });
  }
}

/// @nodoc

class _$CustomerChangedImpl
    with DiagnosticableTreeMixin
    implements _CustomerChanged {
  const _$CustomerChangedImpl(this.customer);

  @override
  final Customer? customer;

  @override
  String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
    return 'OrderFormEvent.customerChanged(customer: $customer)';
  }

  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
    properties
      ..add(DiagnosticsProperty('type', 'OrderFormEvent.customerChanged'))
      ..add(DiagnosticsProperty('customer', customer));
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$CustomerChangedImpl &&
            (identical(other.customer, customer) ||
                other.customer == customer));
  }

  @override
  int get hashCode => Object.hash(runtimeType, customer);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$CustomerChangedImplCopyWith<_$CustomerChangedImpl> get copyWith =>
      __$$CustomerChangedImplCopyWithImpl<_$CustomerChangedImpl>(
        this,
        _$identity,
      );

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String customerName) customerNameChanged,
    required TResult Function(PaymentMethod payment) paymentMethodChanged,
    required TResult Function(Customer? customer) customerChanged,
    required TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )
    createOrderWithPayment,
    required TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )
    createOrder,
    required TResult Function(String orderId, List<ProductQuantity> items)
    addItemOrder,
  }) {
    return customerChanged(customer);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String customerName)? customerNameChanged,
    TResult? Function(PaymentMethod payment)? paymentMethodChanged,
    TResult? Function(Customer? customer)? customerChanged,
    TResult? Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrderWithPayment,
    TResult? Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrder,
    TResult? Function(String orderId, List<ProductQuantity> items)?
    addItemOrder,
  }) {
    return customerChanged?.call(customer);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String customerName)? customerNameChanged,
    TResult Function(PaymentMethod payment)? paymentMethodChanged,
    TResult Function(Customer? customer)? customerChanged,
    TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrderWithPayment,
    TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrder,
    TResult Function(String orderId, List<ProductQuantity> items)? addItemOrder,
    required TResult orElse(),
  }) {
    if (customerChanged != null) {
      return customerChanged(customer);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_CustomerNameChanged value) customerNameChanged,
    required TResult Function(_PaymentMethodChanged value) paymentMethodChanged,
    required TResult Function(_CustomerChanged value) customerChanged,
    required TResult Function(_CreateOrderWithPayment value)
    createOrderWithPayment,
    required TResult Function(_CreateOrder value) createOrder,
    required TResult Function(_AddItemOrder value) addItemOrder,
  }) {
    return customerChanged(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_CustomerNameChanged value)? customerNameChanged,
    TResult? Function(_PaymentMethodChanged value)? paymentMethodChanged,
    TResult? Function(_CustomerChanged value)? customerChanged,
    TResult? Function(_CreateOrderWithPayment value)? createOrderWithPayment,
    TResult? Function(_CreateOrder value)? createOrder,
    TResult? Function(_AddItemOrder value)? addItemOrder,
  }) {
    return customerChanged?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_CustomerNameChanged value)? customerNameChanged,
    TResult Function(_PaymentMethodChanged value)? paymentMethodChanged,
    TResult Function(_CustomerChanged value)? customerChanged,
    TResult Function(_CreateOrderWithPayment value)? createOrderWithPayment,
    TResult Function(_CreateOrder value)? createOrder,
    TResult Function(_AddItemOrder value)? addItemOrder,
    required TResult orElse(),
  }) {
    if (customerChanged != null) {
      return customerChanged(this);
    }
    return orElse();
  }
}

abstract class _CustomerChanged implements OrderFormEvent {
  const factory _CustomerChanged(final Customer? customer) =
      _$CustomerChangedImpl;

  Customer? get customer;

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$CustomerChangedImplCopyWith<_$CustomerChangedImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$CreateOrderWithPaymentImplCopyWith<$Res> {
  factory _$$CreateOrderWithPaymentImplCopyWith(
    _$CreateOrderWithPaymentImpl value,
    $Res Function(_$CreateOrderWithPaymentImpl) then,
  ) = __$$CreateOrderWithPaymentImplCopyWithImpl<$Res>;
  @useResult
  $Res call({List<ProductQuantity> items, OrderType orderType, Table? table});

  $TableCopyWith<$Res>? get table;
}

/// @nodoc
class __$$CreateOrderWithPaymentImplCopyWithImpl<$Res>
    extends _$OrderFormEventCopyWithImpl<$Res, _$CreateOrderWithPaymentImpl>
    implements _$$CreateOrderWithPaymentImplCopyWith<$Res> {
  __$$CreateOrderWithPaymentImplCopyWithImpl(
    _$CreateOrderWithPaymentImpl _value,
    $Res Function(_$CreateOrderWithPaymentImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? items = null,
    Object? orderType = null,
    Object? table = freezed,
  }) {
    return _then(
      _$CreateOrderWithPaymentImpl(
        items: null == items
            ? _value._items
            : items // ignore: cast_nullable_to_non_nullable
                  as List<ProductQuantity>,
        orderType: null == orderType
            ? _value.orderType
            : orderType // ignore: cast_nullable_to_non_nullable
                  as OrderType,
        table: freezed == table
            ? _value.table
            : table // ignore: cast_nullable_to_non_nullable
                  as Table?,
      ),
    );
  }

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @override
  @pragma('vm:prefer-inline')
  $TableCopyWith<$Res>? get table {
    if (_value.table == null) {
      return null;
    }

    return $TableCopyWith<$Res>(_value.table!, (value) {
      return _then(_value.copyWith(table: value));
    });
  }
}

/// @nodoc

class _$CreateOrderWithPaymentImpl
    with DiagnosticableTreeMixin
    implements _CreateOrderWithPayment {
  const _$CreateOrderWithPaymentImpl({
    required final List<ProductQuantity> items,
    required this.orderType,
    this.table,
  }) : _items = items;

  final List<ProductQuantity> _items;
  @override
  List<ProductQuantity> get items {
    if (_items is EqualUnmodifiableListView) return _items;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableListView(_items);
  }

  @override
  final OrderType orderType;
  @override
  final Table? table;

  @override
  String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
    return 'OrderFormEvent.createOrderWithPayment(items: $items, orderType: $orderType, table: $table)';
  }

  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
    properties
      ..add(
        DiagnosticsProperty('type', 'OrderFormEvent.createOrderWithPayment'),
      )
      ..add(DiagnosticsProperty('items', items))
      ..add(DiagnosticsProperty('orderType', orderType))
      ..add(DiagnosticsProperty('table', table));
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$CreateOrderWithPaymentImpl &&
            const DeepCollectionEquality().equals(other._items, _items) &&
            (identical(other.orderType, orderType) ||
                other.orderType == orderType) &&
            (identical(other.table, table) || other.table == table));
  }

  @override
  int get hashCode => Object.hash(
    runtimeType,
    const DeepCollectionEquality().hash(_items),
    orderType,
    table,
  );

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$CreateOrderWithPaymentImplCopyWith<_$CreateOrderWithPaymentImpl>
  get copyWith =>
      __$$CreateOrderWithPaymentImplCopyWithImpl<_$CreateOrderWithPaymentImpl>(
        this,
        _$identity,
      );

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String customerName) customerNameChanged,
    required TResult Function(PaymentMethod payment) paymentMethodChanged,
    required TResult Function(Customer? customer) customerChanged,
    required TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )
    createOrderWithPayment,
    required TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )
    createOrder,
    required TResult Function(String orderId, List<ProductQuantity> items)
    addItemOrder,
  }) {
    return createOrderWithPayment(items, orderType, table);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String customerName)? customerNameChanged,
    TResult? Function(PaymentMethod payment)? paymentMethodChanged,
    TResult? Function(Customer? customer)? customerChanged,
    TResult? Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrderWithPayment,
    TResult? Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrder,
    TResult? Function(String orderId, List<ProductQuantity> items)?
    addItemOrder,
  }) {
    return createOrderWithPayment?.call(items, orderType, table);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String customerName)? customerNameChanged,
    TResult Function(PaymentMethod payment)? paymentMethodChanged,
    TResult Function(Customer? customer)? customerChanged,
    TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrderWithPayment,
    TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrder,
    TResult Function(String orderId, List<ProductQuantity> items)? addItemOrder,
    required TResult orElse(),
  }) {
    if (createOrderWithPayment != null) {
      return createOrderWithPayment(items, orderType, table);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_CustomerNameChanged value) customerNameChanged,
    required TResult Function(_PaymentMethodChanged value) paymentMethodChanged,
    required TResult Function(_CustomerChanged value) customerChanged,
    required TResult Function(_CreateOrderWithPayment value)
    createOrderWithPayment,
    required TResult Function(_CreateOrder value) createOrder,
    required TResult Function(_AddItemOrder value) addItemOrder,
  }) {
    return createOrderWithPayment(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_CustomerNameChanged value)? customerNameChanged,
    TResult? Function(_PaymentMethodChanged value)? paymentMethodChanged,
    TResult? Function(_CustomerChanged value)? customerChanged,
    TResult? Function(_CreateOrderWithPayment value)? createOrderWithPayment,
    TResult? Function(_CreateOrder value)? createOrder,
    TResult? Function(_AddItemOrder value)? addItemOrder,
  }) {
    return createOrderWithPayment?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_CustomerNameChanged value)? customerNameChanged,
    TResult Function(_PaymentMethodChanged value)? paymentMethodChanged,
    TResult Function(_CustomerChanged value)? customerChanged,
    TResult Function(_CreateOrderWithPayment value)? createOrderWithPayment,
    TResult Function(_CreateOrder value)? createOrder,
    TResult Function(_AddItemOrder value)? addItemOrder,
    required TResult orElse(),
  }) {
    if (createOrderWithPayment != null) {
      return createOrderWithPayment(this);
    }
    return orElse();
  }
}

abstract class _CreateOrderWithPayment implements OrderFormEvent {
  const factory _CreateOrderWithPayment({
    required final List<ProductQuantity> items,
    required final OrderType orderType,
    final Table? table,
  }) = _$CreateOrderWithPaymentImpl;

  List<ProductQuantity> get items;
  OrderType get orderType;
  Table? get table;

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$CreateOrderWithPaymentImplCopyWith<_$CreateOrderWithPaymentImpl>
  get copyWith => throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$CreateOrderImplCopyWith<$Res> {
  factory _$$CreateOrderImplCopyWith(
    _$CreateOrderImpl value,
    $Res Function(_$CreateOrderImpl) then,
  ) = __$$CreateOrderImplCopyWithImpl<$Res>;
  @useResult
  $Res call({List<ProductQuantity> items, OrderType orderType, Table? table});

  $TableCopyWith<$Res>? get table;
}

/// @nodoc
class __$$CreateOrderImplCopyWithImpl<$Res>
    extends _$OrderFormEventCopyWithImpl<$Res, _$CreateOrderImpl>
    implements _$$CreateOrderImplCopyWith<$Res> {
  __$$CreateOrderImplCopyWithImpl(
    _$CreateOrderImpl _value,
    $Res Function(_$CreateOrderImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? items = null,
    Object? orderType = null,
    Object? table = freezed,
  }) {
    return _then(
      _$CreateOrderImpl(
        items: null == items
            ? _value._items
            : items // ignore: cast_nullable_to_non_nullable
                  as List<ProductQuantity>,
        orderType: null == orderType
            ? _value.orderType
            : orderType // ignore: cast_nullable_to_non_nullable
                  as OrderType,
        table: freezed == table
            ? _value.table
            : table // ignore: cast_nullable_to_non_nullable
                  as Table?,
      ),
    );
  }

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @override
  @pragma('vm:prefer-inline')
  $TableCopyWith<$Res>? get table {
    if (_value.table == null) {
      return null;
    }

    return $TableCopyWith<$Res>(_value.table!, (value) {
      return _then(_value.copyWith(table: value));
    });
  }
}

/// @nodoc

class _$CreateOrderImpl with DiagnosticableTreeMixin implements _CreateOrder {
  const _$CreateOrderImpl({
    required final List<ProductQuantity> items,
    required this.orderType,
    this.table,
  }) : _items = items;

  final List<ProductQuantity> _items;
  @override
  List<ProductQuantity> get items {
    if (_items is EqualUnmodifiableListView) return _items;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableListView(_items);
  }

  @override
  final OrderType orderType;
  @override
  final Table? table;

  @override
  String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
    return 'OrderFormEvent.createOrder(items: $items, orderType: $orderType, table: $table)';
  }

  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
    properties
      ..add(DiagnosticsProperty('type', 'OrderFormEvent.createOrder'))
      ..add(DiagnosticsProperty('items', items))
      ..add(DiagnosticsProperty('orderType', orderType))
      ..add(DiagnosticsProperty('table', table));
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$CreateOrderImpl &&
            const DeepCollectionEquality().equals(other._items, _items) &&
            (identical(other.orderType, orderType) ||
                other.orderType == orderType) &&
            (identical(other.table, table) || other.table == table));
  }

  @override
  int get hashCode => Object.hash(
    runtimeType,
    const DeepCollectionEquality().hash(_items),
    orderType,
    table,
  );

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$CreateOrderImplCopyWith<_$CreateOrderImpl> get copyWith =>
      __$$CreateOrderImplCopyWithImpl<_$CreateOrderImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String customerName) customerNameChanged,
    required TResult Function(PaymentMethod payment) paymentMethodChanged,
    required TResult Function(Customer? customer) customerChanged,
    required TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )
    createOrderWithPayment,
    required TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )
    createOrder,
    required TResult Function(String orderId, List<ProductQuantity> items)
    addItemOrder,
  }) {
    return createOrder(items, orderType, table);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String customerName)? customerNameChanged,
    TResult? Function(PaymentMethod payment)? paymentMethodChanged,
    TResult? Function(Customer? customer)? customerChanged,
    TResult? Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrderWithPayment,
    TResult? Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrder,
    TResult? Function(String orderId, List<ProductQuantity> items)?
    addItemOrder,
  }) {
    return createOrder?.call(items, orderType, table);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String customerName)? customerNameChanged,
    TResult Function(PaymentMethod payment)? paymentMethodChanged,
    TResult Function(Customer? customer)? customerChanged,
    TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrderWithPayment,
    TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrder,
    TResult Function(String orderId, List<ProductQuantity> items)? addItemOrder,
    required TResult orElse(),
  }) {
    if (createOrder != null) {
      return createOrder(items, orderType, table);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_CustomerNameChanged value) customerNameChanged,
    required TResult Function(_PaymentMethodChanged value) paymentMethodChanged,
    required TResult Function(_CustomerChanged value) customerChanged,
    required TResult Function(_CreateOrderWithPayment value)
    createOrderWithPayment,
    required TResult Function(_CreateOrder value) createOrder,
    required TResult Function(_AddItemOrder value) addItemOrder,
  }) {
    return createOrder(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_CustomerNameChanged value)? customerNameChanged,
    TResult? Function(_PaymentMethodChanged value)? paymentMethodChanged,
    TResult? Function(_CustomerChanged value)? customerChanged,
    TResult? Function(_CreateOrderWithPayment value)? createOrderWithPayment,
    TResult? Function(_CreateOrder value)? createOrder,
    TResult? Function(_AddItemOrder value)? addItemOrder,
  }) {
    return createOrder?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_CustomerNameChanged value)? customerNameChanged,
    TResult Function(_PaymentMethodChanged value)? paymentMethodChanged,
    TResult Function(_CustomerChanged value)? customerChanged,
    TResult Function(_CreateOrderWithPayment value)? createOrderWithPayment,
    TResult Function(_CreateOrder value)? createOrder,
    TResult Function(_AddItemOrder value)? addItemOrder,
    required TResult orElse(),
  }) {
    if (createOrder != null) {
      return createOrder(this);
    }
    return orElse();
  }
}

abstract class _CreateOrder implements OrderFormEvent {
  const factory _CreateOrder({
    required final List<ProductQuantity> items,
    required final OrderType orderType,
    final Table? table,
  }) = _$CreateOrderImpl;

  List<ProductQuantity> get items;
  OrderType get orderType;
  Table? get table;

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$CreateOrderImplCopyWith<_$CreateOrderImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$AddItemOrderImplCopyWith<$Res> {
  factory _$$AddItemOrderImplCopyWith(
    _$AddItemOrderImpl value,
    $Res Function(_$AddItemOrderImpl) then,
  ) = __$$AddItemOrderImplCopyWithImpl<$Res>;
  @useResult
  $Res call({String orderId, List<ProductQuantity> items});
}

/// @nodoc
class __$$AddItemOrderImplCopyWithImpl<$Res>
    extends _$OrderFormEventCopyWithImpl<$Res, _$AddItemOrderImpl>
    implements _$$AddItemOrderImplCopyWith<$Res> {
  __$$AddItemOrderImplCopyWithImpl(
    _$AddItemOrderImpl _value,
    $Res Function(_$AddItemOrderImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({Object? orderId = null, Object? items = null}) {
    return _then(
      _$AddItemOrderImpl(
        orderId: null == orderId
            ? _value.orderId
            : orderId // ignore: cast_nullable_to_non_nullable
                  as String,
        items: null == items
            ? _value._items
            : items // ignore: cast_nullable_to_non_nullable
                  as List<ProductQuantity>,
      ),
    );
  }
}

/// @nodoc

class _$AddItemOrderImpl with DiagnosticableTreeMixin implements _AddItemOrder {
  const _$AddItemOrderImpl({
    required this.orderId,
    required final List<ProductQuantity> items,
  }) : _items = items;

  @override
  final String orderId;
  final List<ProductQuantity> _items;
  @override
  List<ProductQuantity> get items {
    if (_items is EqualUnmodifiableListView) return _items;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableListView(_items);
  }

  @override
  String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
    return 'OrderFormEvent.addItemOrder(orderId: $orderId, items: $items)';
  }

  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
    properties
      ..add(DiagnosticsProperty('type', 'OrderFormEvent.addItemOrder'))
      ..add(DiagnosticsProperty('orderId', orderId))
      ..add(DiagnosticsProperty('items', items));
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$AddItemOrderImpl &&
            (identical(other.orderId, orderId) || other.orderId == orderId) &&
            const DeepCollectionEquality().equals(other._items, _items));
  }

  @override
  int get hashCode => Object.hash(
    runtimeType,
    orderId,
    const DeepCollectionEquality().hash(_items),
  );

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$AddItemOrderImplCopyWith<_$AddItemOrderImpl> get copyWith =>
      __$$AddItemOrderImplCopyWithImpl<_$AddItemOrderImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String customerName) customerNameChanged,
    required TResult Function(PaymentMethod payment) paymentMethodChanged,
    required TResult Function(Customer? customer) customerChanged,
    required TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )
    createOrderWithPayment,
    required TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )
    createOrder,
    required TResult Function(String orderId, List<ProductQuantity> items)
    addItemOrder,
  }) {
    return addItemOrder(orderId, items);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String customerName)? customerNameChanged,
    TResult? Function(PaymentMethod payment)? paymentMethodChanged,
    TResult? Function(Customer? customer)? customerChanged,
    TResult? Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrderWithPayment,
    TResult? Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrder,
    TResult? Function(String orderId, List<ProductQuantity> items)?
    addItemOrder,
  }) {
    return addItemOrder?.call(orderId, items);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String customerName)? customerNameChanged,
    TResult Function(PaymentMethod payment)? paymentMethodChanged,
    TResult Function(Customer? customer)? customerChanged,
    TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrderWithPayment,
    TResult Function(
      List<ProductQuantity> items,
      OrderType orderType,
      Table? table,
    )?
    createOrder,
    TResult Function(String orderId, List<ProductQuantity> items)? addItemOrder,
    required TResult orElse(),
  }) {
    if (addItemOrder != null) {
      return addItemOrder(orderId, items);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(_CustomerNameChanged value) customerNameChanged,
    required TResult Function(_PaymentMethodChanged value) paymentMethodChanged,
    required TResult Function(_CustomerChanged value) customerChanged,
    required TResult Function(_CreateOrderWithPayment value)
    createOrderWithPayment,
    required TResult Function(_CreateOrder value) createOrder,
    required TResult Function(_AddItemOrder value) addItemOrder,
  }) {
    return addItemOrder(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(_CustomerNameChanged value)? customerNameChanged,
    TResult? Function(_PaymentMethodChanged value)? paymentMethodChanged,
    TResult? Function(_CustomerChanged value)? customerChanged,
    TResult? Function(_CreateOrderWithPayment value)? createOrderWithPayment,
    TResult? Function(_CreateOrder value)? createOrder,
    TResult? Function(_AddItemOrder value)? addItemOrder,
  }) {
    return addItemOrder?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(_CustomerNameChanged value)? customerNameChanged,
    TResult Function(_PaymentMethodChanged value)? paymentMethodChanged,
    TResult Function(_CustomerChanged value)? customerChanged,
    TResult Function(_CreateOrderWithPayment value)? createOrderWithPayment,
    TResult Function(_CreateOrder value)? createOrder,
    TResult Function(_AddItemOrder value)? addItemOrder,
    required TResult orElse(),
  }) {
    if (addItemOrder != null) {
      return addItemOrder(this);
    }
    return orElse();
  }
}

abstract class _AddItemOrder implements OrderFormEvent {
  const factory _AddItemOrder({
    required final String orderId,
    required final List<ProductQuantity> items,
  }) = _$AddItemOrderImpl;

  String get orderId;
  List<ProductQuantity> get items;

  /// Create a copy of OrderFormEvent
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$AddItemOrderImplCopyWith<_$AddItemOrderImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
mixin _$OrderFormState {
  PaymentMethod? get paymentMethod => throw _privateConstructorUsedError;
  String? get customerName => throw _privateConstructorUsedError;
  Customer? get customer => throw _privateConstructorUsedError;
  Option<Either<OrderFailure, Order>> get failureOrCreateOrder =>
      throw _privateConstructorUsedError;
  Option<Either<OrderFailure, Order>> get failureOrCreateOrderWithPayment =>
      throw _privateConstructorUsedError;
  Option<Either<OrderFailure, Order>> get failureOrAddItemOrder =>
      throw _privateConstructorUsedError;
  bool get isCreating => throw _privateConstructorUsedError;
  bool get isCreatingWithPayment => throw _privateConstructorUsedError;
  bool get isAddingItemOrder => throw _privateConstructorUsedError;

  /// Idempotency key untuk add item order.
  /// Di-generate saat user tap "Add Items", dipakai ulang saat retry,
  /// di-clear setelah sukses.
  String? get addItemIdempotencyKey => throw _privateConstructorUsedError;

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  $OrderFormStateCopyWith<OrderFormState> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class $OrderFormStateCopyWith<$Res> {
  factory $OrderFormStateCopyWith(
    OrderFormState value,
    $Res Function(OrderFormState) then,
  ) = _$OrderFormStateCopyWithImpl<$Res, OrderFormState>;
  @useResult
  $Res call({
    PaymentMethod? paymentMethod,
    String? customerName,
    Customer? customer,
    Option<Either<OrderFailure, Order>> failureOrCreateOrder,
    Option<Either<OrderFailure, Order>> failureOrCreateOrderWithPayment,
    Option<Either<OrderFailure, Order>> failureOrAddItemOrder,
    bool isCreating,
    bool isCreatingWithPayment,
    bool isAddingItemOrder,
    String? addItemIdempotencyKey,
  });

  $PaymentMethodCopyWith<$Res>? get paymentMethod;
  $CustomerCopyWith<$Res>? get customer;
}

/// @nodoc
class _$OrderFormStateCopyWithImpl<$Res, $Val extends OrderFormState>
    implements $OrderFormStateCopyWith<$Res> {
  _$OrderFormStateCopyWithImpl(this._value, this._then);

  // ignore: unused_field
  final $Val _value;
  // ignore: unused_field
  final $Res Function($Val) _then;

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? paymentMethod = freezed,
    Object? customerName = freezed,
    Object? customer = freezed,
    Object? failureOrCreateOrder = null,
    Object? failureOrCreateOrderWithPayment = null,
    Object? failureOrAddItemOrder = null,
    Object? isCreating = null,
    Object? isCreatingWithPayment = null,
    Object? isAddingItemOrder = null,
    Object? addItemIdempotencyKey = freezed,
  }) {
    return _then(
      _value.copyWith(
            paymentMethod: freezed == paymentMethod
                ? _value.paymentMethod
                : paymentMethod // ignore: cast_nullable_to_non_nullable
                      as PaymentMethod?,
            customerName: freezed == customerName
                ? _value.customerName
                : customerName // ignore: cast_nullable_to_non_nullable
                      as String?,
            customer: freezed == customer
                ? _value.customer
                : customer // ignore: cast_nullable_to_non_nullable
                      as Customer?,
            failureOrCreateOrder: null == failureOrCreateOrder
                ? _value.failureOrCreateOrder
                : failureOrCreateOrder // ignore: cast_nullable_to_non_nullable
                      as Option<Either<OrderFailure, Order>>,
            failureOrCreateOrderWithPayment:
                null == failureOrCreateOrderWithPayment
                ? _value.failureOrCreateOrderWithPayment
                : failureOrCreateOrderWithPayment // ignore: cast_nullable_to_non_nullable
                      as Option<Either<OrderFailure, Order>>,
            failureOrAddItemOrder: null == failureOrAddItemOrder
                ? _value.failureOrAddItemOrder
                : failureOrAddItemOrder // ignore: cast_nullable_to_non_nullable
                      as Option<Either<OrderFailure, Order>>,
            isCreating: null == isCreating
                ? _value.isCreating
                : isCreating // ignore: cast_nullable_to_non_nullable
                      as bool,
            isCreatingWithPayment: null == isCreatingWithPayment
                ? _value.isCreatingWithPayment
                : isCreatingWithPayment // ignore: cast_nullable_to_non_nullable
                      as bool,
            isAddingItemOrder: null == isAddingItemOrder
                ? _value.isAddingItemOrder
                : isAddingItemOrder // ignore: cast_nullable_to_non_nullable
                      as bool,
            addItemIdempotencyKey: freezed == addItemIdempotencyKey
                ? _value.addItemIdempotencyKey
                : addItemIdempotencyKey // ignore: cast_nullable_to_non_nullable
                      as String?,
          )
          as $Val,
    );
  }

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
  @override
  @pragma('vm:prefer-inline')
  $PaymentMethodCopyWith<$Res>? get paymentMethod {
    if (_value.paymentMethod == null) {
      return null;
    }

    return $PaymentMethodCopyWith<$Res>(_value.paymentMethod!, (value) {
      return _then(_value.copyWith(paymentMethod: value) as $Val);
    });
  }

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
  @override
  @pragma('vm:prefer-inline')
  $CustomerCopyWith<$Res>? get customer {
    if (_value.customer == null) {
      return null;
    }

    return $CustomerCopyWith<$Res>(_value.customer!, (value) {
      return _then(_value.copyWith(customer: value) as $Val);
    });
  }
}

/// @nodoc
abstract class _$$OrderFormStateImplCopyWith<$Res>
    implements $OrderFormStateCopyWith<$Res> {
  factory _$$OrderFormStateImplCopyWith(
    _$OrderFormStateImpl value,
    $Res Function(_$OrderFormStateImpl) then,
  ) = __$$OrderFormStateImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call({
    PaymentMethod? paymentMethod,
    String? customerName,
    Customer? customer,
    Option<Either<OrderFailure, Order>> failureOrCreateOrder,
    Option<Either<OrderFailure, Order>> failureOrCreateOrderWithPayment,
    Option<Either<OrderFailure, Order>> failureOrAddItemOrder,
    bool isCreating,
    bool isCreatingWithPayment,
    bool isAddingItemOrder,
    String? addItemIdempotencyKey,
  });

  @override
  $PaymentMethodCopyWith<$Res>? get paymentMethod;
  @override
  $CustomerCopyWith<$Res>? get customer;
}

/// @nodoc
class __$$OrderFormStateImplCopyWithImpl<$Res>
    extends _$OrderFormStateCopyWithImpl<$Res, _$OrderFormStateImpl>
    implements _$$OrderFormStateImplCopyWith<$Res> {
  __$$OrderFormStateImplCopyWithImpl(
    _$OrderFormStateImpl _value,
    $Res Function(_$OrderFormStateImpl) _then,
  ) : super(_value, _then);

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? paymentMethod = freezed,
    Object? customerName = freezed,
    Object? customer = freezed,
    Object? failureOrCreateOrder = null,
    Object? failureOrCreateOrderWithPayment = null,
    Object? failureOrAddItemOrder = null,
    Object? isCreating = null,
    Object? isCreatingWithPayment = null,
    Object? isAddingItemOrder = null,
    Object? addItemIdempotencyKey = freezed,
  }) {
    return _then(
      _$OrderFormStateImpl(
        paymentMethod: freezed == paymentMethod
            ? _value.paymentMethod
            : paymentMethod // ignore: cast_nullable_to_non_nullable
                  as PaymentMethod?,
        customerName: freezed == customerName
            ? _value.customerName
            : customerName // ignore: cast_nullable_to_non_nullable
                  as String?,
        customer: freezed == customer
            ? _value.customer
            : customer // ignore: cast_nullable_to_non_nullable
                  as Customer?,
        failureOrCreateOrder: null == failureOrCreateOrder
            ? _value.failureOrCreateOrder
            : failureOrCreateOrder // ignore: cast_nullable_to_non_nullable
                  as Option<Either<OrderFailure, Order>>,
        failureOrCreateOrderWithPayment: null == failureOrCreateOrderWithPayment
            ? _value.failureOrCreateOrderWithPayment
            : failureOrCreateOrderWithPayment // ignore: cast_nullable_to_non_nullable
                  as Option<Either<OrderFailure, Order>>,
        failureOrAddItemOrder: null == failureOrAddItemOrder
            ? _value.failureOrAddItemOrder
            : failureOrAddItemOrder // ignore: cast_nullable_to_non_nullable
                  as Option<Either<OrderFailure, Order>>,
        isCreating: null == isCreating
            ? _value.isCreating
            : isCreating // ignore: cast_nullable_to_non_nullable
                  as bool,
        isCreatingWithPayment: null == isCreatingWithPayment
            ? _value.isCreatingWithPayment
            : isCreatingWithPayment // ignore: cast_nullable_to_non_nullable
                  as bool,
        isAddingItemOrder: null == isAddingItemOrder
            ? _value.isAddingItemOrder
            : isAddingItemOrder // ignore: cast_nullable_to_non_nullable
                  as bool,
        addItemIdempotencyKey: freezed == addItemIdempotencyKey
            ? _value.addItemIdempotencyKey
            : addItemIdempotencyKey // ignore: cast_nullable_to_non_nullable
                  as String?,
      ),
    );
  }
}

/// @nodoc

class _$OrderFormStateImpl
    with DiagnosticableTreeMixin
    implements _OrderFormState {
  _$OrderFormStateImpl({
    this.paymentMethod,
    this.customerName,
    this.customer,
    required this.failureOrCreateOrder,
    required this.failureOrCreateOrderWithPayment,
    required this.failureOrAddItemOrder,
    this.isCreating = false,
    this.isCreatingWithPayment = false,
    this.isAddingItemOrder = false,
    this.addItemIdempotencyKey,
  });

  @override
  final PaymentMethod? paymentMethod;
  @override
  final String? customerName;
  @override
  final Customer? customer;
  @override
  final Option<Either<OrderFailure, Order>> failureOrCreateOrder;
  @override
  final Option<Either<OrderFailure, Order>> failureOrCreateOrderWithPayment;
  @override
  final Option<Either<OrderFailure, Order>> failureOrAddItemOrder;
  @override
  @JsonKey()
  final bool isCreating;
  @override
  @JsonKey()
  final bool isCreatingWithPayment;
  @override
  @JsonKey()
  final bool isAddingItemOrder;

  /// Idempotency key untuk add item order.
  /// Di-generate saat user tap "Add Items", dipakai ulang saat retry,
  /// di-clear setelah sukses.
  @override
  final String? addItemIdempotencyKey;

  @override
  String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
    return 'OrderFormState(paymentMethod: $paymentMethod, customerName: $customerName, customer: $customer, failureOrCreateOrder: $failureOrCreateOrder, failureOrCreateOrderWithPayment: $failureOrCreateOrderWithPayment, failureOrAddItemOrder: $failureOrAddItemOrder, isCreating: $isCreating, isCreatingWithPayment: $isCreatingWithPayment, isAddingItemOrder: $isAddingItemOrder, addItemIdempotencyKey: $addItemIdempotencyKey)';
  }

  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
    properties
      ..add(DiagnosticsProperty('type', 'OrderFormState'))
      ..add(DiagnosticsProperty('paymentMethod', paymentMethod))
      ..add(DiagnosticsProperty('customerName', customerName))
      ..add(DiagnosticsProperty('customer', customer))
      ..add(DiagnosticsProperty('failureOrCreateOrder', failureOrCreateOrder))
      ..add(
        DiagnosticsProperty(
          'failureOrCreateOrderWithPayment',
          failureOrCreateOrderWithPayment,
        ),
      )
      ..add(DiagnosticsProperty('failureOrAddItemOrder', failureOrAddItemOrder))
      ..add(DiagnosticsProperty('isCreating', isCreating))
      ..add(DiagnosticsProperty('isCreatingWithPayment', isCreatingWithPayment))
      ..add(DiagnosticsProperty('isAddingItemOrder', isAddingItemOrder))
      ..add(
        DiagnosticsProperty('addItemIdempotencyKey', addItemIdempotencyKey),
      );
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$OrderFormStateImpl &&
            (identical(other.paymentMethod, paymentMethod) ||
                other.paymentMethod == paymentMethod) &&
            (identical(other.customerName, customerName) ||
                other.customerName == customerName) &&
            (identical(other.customer, customer) ||
                other.customer == customer) &&
            (identical(other.failureOrCreateOrder, failureOrCreateOrder) ||
                other.failureOrCreateOrder == failureOrCreateOrder) &&
            (identical(
                  other.failureOrCreateOrderWithPayment,
                  failureOrCreateOrderWithPayment,
                ) ||
                other.failureOrCreateOrderWithPayment ==
                    failureOrCreateOrderWithPayment) &&
            (identical(other.failureOrAddItemOrder, failureOrAddItemOrder) ||
                other.failureOrAddItemOrder == failureOrAddItemOrder) &&
            (identical(other.isCreating, isCreating) ||
                other.isCreating == isCreating) &&
            (identical(other.isCreatingWithPayment, isCreatingWithPayment) ||
                other.isCreatingWithPayment == isCreatingWithPayment) &&
            (identical(other.isAddingItemOrder, isAddingItemOrder) ||
                other.isAddingItemOrder == isAddingItemOrder) &&
            (identical(other.addItemIdempotencyKey, addItemIdempotencyKey) ||
                other.addItemIdempotencyKey == addItemIdempotencyKey));
  }

  @override
  int get hashCode => Object.hash(
    runtimeType,
    paymentMethod,
    customerName,
    customer,
    failureOrCreateOrder,
    failureOrCreateOrderWithPayment,
    failureOrAddItemOrder,
    isCreating,
    isCreatingWithPayment,
    isAddingItemOrder,
    addItemIdempotencyKey,
  );

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
  @JsonKey(includeFromJson: false, includeToJson: false)
  @override
  @pragma('vm:prefer-inline')
  _$$OrderFormStateImplCopyWith<_$OrderFormStateImpl> get copyWith =>
      __$$OrderFormStateImplCopyWithImpl<_$OrderFormStateImpl>(
        this,
        _$identity,
      );
}

abstract class _OrderFormState implements OrderFormState {
  factory _OrderFormState({
    final PaymentMethod? paymentMethod,
    final String? customerName,
    final Customer? customer,
    required final Option<Either<OrderFailure, Order>> failureOrCreateOrder,
    required final Option<Either<OrderFailure, Order>>
    failureOrCreateOrderWithPayment,
    required final Option<Either<OrderFailure, Order>> failureOrAddItemOrder,
    final bool isCreating,
    final bool isCreatingWithPayment,
    final bool isAddingItemOrder,
    final String? addItemIdempotencyKey,
  }) = _$OrderFormStateImpl;

  @override
  PaymentMethod? get paymentMethod;
  @override
  String? get customerName;
  @override
  Customer? get customer;
  @override
  Option<Either<OrderFailure, Order>> get failureOrCreateOrder;
  @override
  Option<Either<OrderFailure, Order>> get failureOrCreateOrderWithPayment;
  @override
  Option<Either<OrderFailure, Order>> get failureOrAddItemOrder;
  @override
  bool get isCreating;
  @override
  bool get isCreatingWithPayment;
  @override
  bool get isAddingItemOrder;

  /// Idempotency key untuk add item order.
  /// Di-generate saat user tap "Add Items", dipakai ulang saat retry,
  /// di-clear setelah sukses.
  @override
  String? get addItemIdempotencyKey;

  /// Create a copy of OrderFormState
  /// with the given fields replaced by the non-null parameter values.
  @override
  @JsonKey(includeFromJson: false, includeToJson: false)
  _$$OrderFormStateImplCopyWith<_$OrderFormStateImpl> get copyWith =>
      throw _privateConstructorUsedError;
}
