@ file : Opt In ( Experimental Time :: class ) Ċ Ċ package Ġio . nova foundation . nova . feature _ staking _ impl . presentation . validators . change . custom . search Ċ Ċ import Ġio . nova foundation . nova . common . address . Address Icon Generator Ċ import Ġio . nova foundation . nova . common . base . Base ViewModel Ċ import Ġio . nova foundation . nova . common . resources . ResourceManager Ċ import Ġio . nova foundation . nova . common . utils . in Background Ċ import Ġio . nova foundation . nova . common . utils . invoke Ċ import Ġio . nova foundation . nova . common . utils . toggle Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . R Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . domain . recommend ations . Validator Recommend ator Factory Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . domain . validators . current . search . Search Custom Validators Interactor Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . presentation . St aking Router Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . presentation . common . Setup St aking Process Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . presentation . common . Setup St aking Shared State Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . presentation . map pers . map Validator To Validator Details Parcel Model Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . presentation . map pers . map Validator To Validator Model Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . presentation . validators . change . Validator Model Ċ import Ġio . nova foundation . nova . feature _ staking _ impl . presentation . validators . change . set Custom Validators Ċ import Ġio . nova foundation . nova . feature _ wallet _ api . domain . Token UseCase Ċ import Ġio . nova foundation . nova . runtime . state . Single Asset Shared State Ċ import Ġio . nova foundation . nova . runtime . state . chain Ċ import Ġkotlinx . coroutines . async Ċ import Ġkotlinx . coroutines . flow . Mutable State Flow Ċ import Ġkotlinx . coroutines . flow . combine Ċ import Ġkotlinx . coroutines . flow . filter Is Instance Ċ import Ġkotlinx . coroutines . flow . first Ċ import Ġkotlinx . coroutines . flow . map Ċ import Ġkotlinx . coroutines . flow . map Latest Ċ import Ġkotlinx . coroutines . flow . onStart Ċ import Ġkotlinx . coroutines . launch Ċ import Ġkotlin . time . Experimental Time Ċ Ċ sealed Ġclass ĠSearch Validators State Ġ{ ĊĠĠĠ Ġobject ĠNo Input Ġ: ĠSearch Validators State () ĊĊĠĠĠ Ġobject ĠLoading Ġ: ĠSearch Validators State () ĊĊĠĠĠ Ġobject ĠNo Results Ġ: ĠSearch Validators State () ĊĊĠĠĠ Ġclass ĠSuccess ( val Ġvalidators : ĠList < Validator Model >, Ġval Ġheader Title : ĠString ) Ġ: ĠSearch Validators State () Ċ } Ċ Ċ class ĠSearch Custom Validators ViewModel ( ĊĠĠĠ Ġprivate Ġval Ġrouter : ĠSt aking Router , ĊĠĠĠ Ġprivate Ġval Ġaddress Icon Generator : ĠAddress Icon Generator , ĊĠĠĠ Ġprivate Ġval Ġinter actor : ĠSearch Custom Validators Interactor , ĊĠĠĠ Ġprivate Ġval Ġresource Manager : ĠResourceManager , ĊĠĠĠ Ġprivate Ġval Ġshared State Setup : ĠSetup St aking Shared State , ĊĠĠĠ Ġprivate Ġval Ġvalidator Recommend ator Factory : ĠValidator Recommend ator Factory , ĊĠĠĠ Ġprivate Ġval Ġsingle Asset Shared State : ĠSingle Asset Shared State , ĊĠĠĠ Ġtoken UseCase : ĠToken UseCase , Ċ ) Ġ: ĠBase ViewModel () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġconfirm Setup State Ġ= Ġshared State Setup . setup St aking Process ĊĠĠĠĠĠĠĠ Ġ. filter Is Instance < Setup St aking Process . Ready To Submit >() ĊĠĠĠĠĠĠĠ Ġ. share () ĊĊĠĠĠ Ġprivate Ġval Ġselected Validators Ġ= Ġconfirm Setup State ĊĠĠĠĠĠĠĠ Ġ. map Ġ{ Ġit . payload . validators . toSet () Ġ} ĊĠĠĠĠĠĠĠ Ġ. in Background () ĊĠĠĠĠĠĠĠ Ġ. share () ĊĊĠĠĠ Ġprivate Ġval Ġcurrent Token Flow Ġ= Ġtoken UseCase . current Token Flow () ĊĠĠĠĠĠĠĠ Ġ. share () ĊĊĠĠĠ Ġval Ġentered Query Ġ= ĠMutable State Flow ("") ĊĊĠĠĠ Ġprivate Ġval Ġall Elect ed Validators Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ Ġasync Ġ{ Ġvalidator Recommend ator Factory . create ( router . current Stack Entry Lifecycle ). available Validators . toSet () Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġval Ġfound Validators State Ġ= Ġentered Query ĊĠĠĠĠĠĠĠ Ġ. map Latest Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( it . isNotEmpty ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinter actor . search Validator ( it , Ġall Elect ed Validators () Ġ+ Ġselected Validators . first ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġnull ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ. in Background () ĊĠĠĠĠĠĠĠ Ġ. share () ĊĊĠĠĠ Ġprivate Ġval Ġselected Validator Models State Ġ= Ġcombine ( ĊĠĠĠĠĠĠĠ Ġselected Validators , ĊĠĠĠĠĠĠĠ Ġfound Validators State , ĊĠĠĠĠĠĠĠ Ġcurrent Token Flow ĊĠĠĠ Ġ) Ġ{ Ġselected Validators , Ġfound Validators , Ġtoken Ġ-> ĊĠĠĠĠĠĠĠ Ġval Ġchain Ġ= Ġsingle Asset Shared State . chain () ĊĊĠĠĠĠĠĠĠ Ġfound Validators ?. map Ġ{ Ġvalidator Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmap Validator To Validator Model ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġchain Ġ= Ġchain , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġvalidator Ġ= Ġvalidator , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġicon Generator Ġ= Ġaddress Icon Generator , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtoken Ġ= Ġtoken , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġis Checked Ġ= Ġvalidator Ġin Ġselected Validators ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ. in Background () ĊĠĠĠĠĠĠĠ Ġ. share () ĊĊĠĠĠ Ġval Ġscreen State Ġ= Ġselected Validator Models State . map Ġ{ Ġvalidators Ġ-> ĊĠĠĠĠĠĠĠ Ġwhen Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġvalidators Ġ== Ġnull Ġ-> ĠSearch Validators State . No Input ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġvalidators . isNull OrEmpty (). not () Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠSearch Validators State . Success ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġvalidators Ġ= Ġvalidators , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġheader Title Ġ= Ġresource Manager . getString ( R . string . common _ search _ results _ number , Ġvalidators . size ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġelse Ġ-> ĠSearch Validators State . No Results ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ. onStart Ġ{ Ġemit ( Search Validators State . Loading ) Ġ} ĊĠĠĠĠĠĠĠ Ġ. share () ĊĊĠĠĠ Ġfun Ġvalidator Clicked ( validator Model : ĠValidator Model ) Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( validator Model . validator . prefs !!. blocked ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġshow Error ( resource Manager . getString ( R . string . staking _ custom _ blocked _ warning )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġlaunch Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġnew Selected Ġ= Ġselected Validators . first (). toggle ( validator Model . validator ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġshared State Setup . set Custom Validators ( new Selected . toList ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġback Clicked () Ġ{ ĊĠĠĠĠĠĠĠ Ġrouter . back () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġdone Clicked () Ġ{ ĊĠĠĠĠĠĠĠ Ġrouter . back () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġvalidator Info Clicked ( validator Model : ĠValidator Model ) Ġ{ ĊĠĠĠĠĠĠĠ Ġrouter . open Validator Details ( map Validator To Validator Details Parcel Model ( validator Model . validator )) ĊĠĠĠ Ġ} Ċ } Ċ