package androidx.lifecycle; import b.i.a.f.e.o.f; import d0.z.d.m; import kotlin.coroutines.CoroutineContext; import kotlinx.coroutines.CoroutineDispatcher; import kotlinx.coroutines.CoroutineScope; import s.a.a.n; import s.a.h1; import s.a.k0; import s.a.u; /* compiled from: ViewModel.kt */ public final class ViewModelKt { private static final String JOB_KEY = "androidx.lifecycle.ViewModelCoroutineScope.JOB_KEY"; public static final CoroutineScope getViewModelScope(ViewModel viewModel) { m.checkNotNullParameter(viewModel, "$this$viewModelScope"); CoroutineScope coroutineScope = (CoroutineScope) viewModel.getTag(JOB_KEY); if (coroutineScope != null) { return coroutineScope; } u d = f.d(null, 1); CoroutineDispatcher coroutineDispatcher = k0.a; Object tagIfAbsent = viewModel.setTagIfAbsent(JOB_KEY, new CloseableCoroutineScope(CoroutineContext.Element.a.plus((h1) d, n.f3791b.H()))); m.checkNotNullExpressionValue(tagIfAbsent, "setTagIfAbsent(\n …Main.immediate)\n )"); return (CoroutineScope) tagIfAbsent; } }