//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{}
)

// InputChatThemeClassArray is adapter for slice of InputChatThemeClass.
type InputChatThemeClassArray []InputChatThemeClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputChatTheme returns copy with only InputChatTheme constructors.
func ( InputChatThemeClassArray) () ( InputChatThemeArray) {
	for ,  := range  {
		,  := .(*InputChatTheme)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputChatThemeUniqueGift returns copy with only InputChatThemeUniqueGift constructors.
func ( InputChatThemeClassArray) () ( InputChatThemeUniqueGiftArray) {
	for ,  := range  {
		,  := .(*InputChatThemeUniqueGift)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputChatThemeArray is adapter for slice of InputChatTheme.
type InputChatThemeArray []InputChatTheme

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputChatThemeUniqueGiftArray is adapter for slice of InputChatThemeUniqueGift.
type InputChatThemeUniqueGiftArray []InputChatThemeUniqueGift

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}