(function (_, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core, kotlin_kotlin) {
  'use strict';
  //region block: imports
  var SupervisorJob = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.e2;
  var Dispatchers_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.v;
  var protoOf = kotlin_kotlin.$_$.wc;
  var cancel = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.h2;
  var AutoCloseable = kotlin_kotlin.$_$.oh;
  var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.z1;
  var classMeta = kotlin_kotlin.$_$.lb;
  var setMetadataFor = kotlin_kotlin.$_$.xc;
  var VOID = kotlin_kotlin.$_$.f;
  var Unit_instance = kotlin_kotlin.$_$.m5;
  var isInterface = kotlin_kotlin.$_$.gc;
  var THROW_CCE = kotlin_kotlin.$_$.hi;
  var HashMap_init_$Create$ = kotlin_kotlin.$_$.p;
  var LinkedHashSet_init_$Create$ = kotlin_kotlin.$_$.x;
  //endregion
  //region block: pre-declaration
  setMetadataFor(CloseableCoroutineScope, 'CloseableCoroutineScope', classMeta, VOID, [AutoCloseable, CoroutineScope]);
  setMetadataFor(ViewModel, 'ViewModel', classMeta, VOID, [AutoCloseable]);
  //endregion
  function get_viewModelScope(_this__u8e3s4) {
    var scope = _this__u8e3s4.rm7('moe.tlaster.precompose.viewmodel.ViewModelCoroutineScope.JOB_KEY');
    if (!(scope == null)) {
      return scope;
    }
    return _this__u8e3s4.sm7('moe.tlaster.precompose.viewmodel.ViewModelCoroutineScope.JOB_KEY', new CloseableCoroutineScope(SupervisorJob().lj(Dispatchers_getInstance().t12().n12())));
  }
  function CloseableCoroutineScope(context) {
    this.tm7_1 = context;
  }
  protoOf(CloseableCoroutineScope).cq = function () {
    return this.tm7_1;
  };
  protoOf(CloseableCoroutineScope).n = function () {
    cancel(this.tm7_1);
  };
  function ViewModel_init_$Init$($this) {
    ViewModel.call($this);
    return $this;
  }
  function disposeWithRuntimeException($this, obj) {
    if (isInterface(obj, AutoCloseable)) {
      obj.n();
    }
  }
  protoOf(ViewModel).um7 = function () {
  };
  protoOf(ViewModel).n1 = function () {
    this.nm7_1 = true;
    // Inline function 'kotlin.let' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp0_iterator = this.om7_1.p2().w();
    while (tmp0_iterator.f()) {
      var value = tmp0_iterator.e();
      disposeWithRuntimeException(this, value);
    }
    this.om7_1.n1();
    // Inline function 'kotlin.let' call
    // Inline function 'kotlin.contracts.contract' call
    var tmp0_iterator_0 = this.pm7_1.w();
    while (tmp0_iterator_0.f()) {
      var value_0 = tmp0_iterator_0.e();
      disposeWithRuntimeException(this, value_0);
    }
    this.pm7_1.n1();
    this.um7();
  };
  protoOf(ViewModel).sm7 = function (key, newValue) {
    // Inline function 'kotlin.also' call
    // Inline function 'kotlin.collections.getOrPut' call
    var this_0 = this.om7_1;
    var value = this_0.q(key);
    var tmp;
    if (value == null) {
      // Inline function 'moe.tlaster.precompose.viewmodel.ViewModel.setTagIfAbsent.<anonymous>' call
      var answer = !(newValue == null) ? newValue : THROW_CCE();
      this_0.s(key, answer);
      tmp = answer;
    } else {
      tmp = value;
    }
    var this_1 = tmp;
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'moe.tlaster.precompose.viewmodel.ViewModel.setTagIfAbsent.<anonymous>' call
    if (this.nm7_1) {
      disposeWithRuntimeException(this, this_1);
    }
    var tmp_0 = this_1;
    return !(tmp_0 == null) ? tmp_0 : THROW_CCE();
  };
  protoOf(ViewModel).rm7 = function (key) {
    var tmp = this.om7_1.q(key);
    return (tmp == null ? true : !(tmp == null)) ? tmp : THROW_CCE();
  };
  protoOf(ViewModel).n = function () {
    this.n1();
  };
  function ViewModel() {
    this.nm7_1 = false;
    var tmp = this;
    // Inline function 'kotlin.collections.hashMapOf' call
    tmp.om7_1 = HashMap_init_$Create$();
    var tmp_0 = this;
    // Inline function 'kotlin.collections.linkedSetOf' call
    tmp_0.pm7_1 = LinkedHashSet_init_$Create$();
    this.qm7_1 = 8;
  }
  //region block: exports
  _.$_$ = _.$_$ || {};
  _.$_$.a = ViewModel_init_$Init$;
  _.$_$.b = ViewModel;
  _.$_$.c = get_viewModelScope;
  //endregion
  return _;
}(module.exports, require('./kotlinx-coroutines-core.js'), require('./kotlin-kotlin-stdlib.js')));

//# sourceMappingURL=precompose-precompose-viewmodel.js.map
