//go:build !no_gotd_slices
// +build !no_gotd_slices

// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// ChatReactionsClassArray is adapter for slice of ChatReactionsClass.
type ChatReactionsClassArray []ChatReactionsClass

// Sort sorts slice of ChatReactionsClass.
func ( ChatReactionsClassArray) ( func(,  ChatReactionsClass) bool) ChatReactionsClassArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of ChatReactionsClass.
func ( ChatReactionsClassArray) ( func(,  ChatReactionsClass) bool) ChatReactionsClassArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of ChatReactionsClass.
func ( ChatReactionsClassArray) ( func( ChatReactionsClass) bool) ChatReactionsClassArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( ChatReactionsClassArray) () ( ChatReactionsClass,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( ChatReactionsClassArray) () ( ChatReactionsClass,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *ChatReactionsClassArray) () ( ChatReactionsClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  ChatReactionsClass
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *ChatReactionsClassArray) () ( ChatReactionsClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// AsChatReactionsAll returns copy with only ChatReactionsAll constructors.
func ( ChatReactionsClassArray) () ( ChatReactionsAllArray) {
	for ,  := range  {
		,  := .(*ChatReactionsAll)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsChatReactionsSome returns copy with only ChatReactionsSome constructors.
func ( ChatReactionsClassArray) () ( ChatReactionsSomeArray) {
	for ,  := range  {
		,  := .(*ChatReactionsSome)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// ChatReactionsAllArray is adapter for slice of ChatReactionsAll.
type ChatReactionsAllArray []ChatReactionsAll

// Sort sorts slice of ChatReactionsAll.
func ( ChatReactionsAllArray) ( func(,  ChatReactionsAll) bool) ChatReactionsAllArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of ChatReactionsAll.
func ( ChatReactionsAllArray) ( func(,  ChatReactionsAll) bool) ChatReactionsAllArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of ChatReactionsAll.
func ( ChatReactionsAllArray) ( func( ChatReactionsAll) bool) ChatReactionsAllArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( ChatReactionsAllArray) () ( ChatReactionsAll,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( ChatReactionsAllArray) () ( ChatReactionsAll,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *ChatReactionsAllArray) () ( ChatReactionsAll,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  ChatReactionsAll
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *ChatReactionsAllArray) () ( ChatReactionsAll,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// ChatReactionsSomeArray is adapter for slice of ChatReactionsSome.
type ChatReactionsSomeArray []ChatReactionsSome

// Sort sorts slice of ChatReactionsSome.
func ( ChatReactionsSomeArray) ( func(,  ChatReactionsSome) bool) ChatReactionsSomeArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of ChatReactionsSome.
func ( ChatReactionsSomeArray) ( func(,  ChatReactionsSome) bool) ChatReactionsSomeArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of ChatReactionsSome.
func ( ChatReactionsSomeArray) ( func( ChatReactionsSome) bool) ChatReactionsSomeArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( ChatReactionsSomeArray) () ( ChatReactionsSome,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( ChatReactionsSomeArray) () ( ChatReactionsSome,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *ChatReactionsSomeArray) () ( ChatReactionsSome,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  ChatReactionsSome
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *ChatReactionsSomeArray) () ( ChatReactionsSome,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}