(function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core, kotlin_io_ktor_ktor_client_core, kotlin_io_ktor_ktor_http, kotlin_io_ktor_ktor_utils, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core) {
  'use strict';
  //region block: imports
  var imul = Math.imul;
  var protoOf = kotlin_kotlin.$_$.wc;
  var objectMeta = kotlin_kotlin.$_$.vc;
  var setMetadataFor = kotlin_kotlin.$_$.xc;
  var interfaceMeta = kotlin_kotlin.$_$.xb;
  var lazy = kotlin_kotlin.$_$.fj;
  var classMeta = kotlin_kotlin.$_$.lb;
  var VOID = kotlin_kotlin.$_$.f;
  var KProperty1 = kotlin_kotlin.$_$.vd;
  var getPropertyCallableRef = kotlin_kotlin.$_$.ub;
  var CoroutineImpl = kotlin_kotlin.$_$.va;
  var Unit_instance = kotlin_kotlin.$_$.m5;
  var THROW_CCE = kotlin_kotlin.$_$.hi;
  var FlowCollector = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.c1;
  var isInterface = kotlin_kotlin.$_$.gc;
  var HttpRequestBuilder = kotlin_io_ktor_ktor_client_core.$_$.j;
  var url = kotlin_io_ktor_ktor_client_core.$_$.n;
  var Companion_getInstance = kotlin_io_ktor_ktor_http.$_$.g;
  var HttpStatement = kotlin_io_ktor_ktor_client_core.$_$.q;
  var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.ha;
  var JsType_instance = kotlin_io_ktor_ktor_utils.$_$.b;
  var List = kotlin_kotlin.$_$.w5;
  var getKClass = kotlin_kotlin.$_$.e;
  var arrayOf = kotlin_kotlin.$_$.wi;
  var createKType = kotlin_kotlin.$_$.b;
  var createInvariantKTypeProjection = kotlin_kotlin.$_$.a;
  var typeInfoImpl = kotlin_io_ktor_ktor_utils.$_$.k;
  var emptyList = kotlin_kotlin.$_$.i7;
  var Exception = kotlin_kotlin.$_$.wh;
  var flow = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.n1;
  var PluginGeneratedSerialDescriptor = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.u2;
  var StringSerializer_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.w;
  var LongSerializer_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.v;
  var Long = kotlin_kotlin.$_$.ai;
  var UnknownFieldException_init_$Create$ = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.f;
  var typeParametersSerializers = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.p2;
  var GeneratedSerializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.q2;
  var throwMissingFieldException = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.z2;
  var objectCreate = kotlin_kotlin.$_$.uc;
  var getStringHashCode = kotlin_kotlin.$_$.vb;
  //endregion
  //region block: pre-declaration
  setMetadataFor(Companion, 'Companion', objectMeta);
  setMetadataFor(CentralAppConfigDbDataSource, 'CentralAppConfigDbDataSource', interfaceMeta);
  setMetadataFor(Companion_0, 'Companion', objectMeta);
  setMetadataFor(CentralAppConfigDbDataSourceHttp, 'CentralAppConfigDbDataSourceHttp', classMeta, VOID, [CentralAppConfigDbDataSource]);
  setMetadataFor(LearningSpaceDataSourceHttp$getAll$slambda, 'LearningSpaceDataSourceHttp$getAll$slambda', classMeta, CoroutineImpl, VOID, VOID, VOID, VOID, [1]);
  setMetadataFor(LearningSpaceDataSourceHttp, 'LearningSpaceDataSourceHttp', classMeta);
  setMetadataFor(Companion_1, 'Companion', objectMeta);
  setMetadataFor($serializer, '$serializer', objectMeta, VOID, [GeneratedSerializer]);
  setMetadataFor(LearningSpaceInfo, 'LearningSpaceInfo', classMeta, VOID, VOID, VOID, VOID, {0: $serializer_getInstance});
  //endregion
  function Companion() {
    this.wl1_1 = 'centralappconfig';
  }
  var Companion_instance;
  function Companion_getInstance_0() {
    return Companion_instance;
  }
  function CentralAppConfigDbDataSource() {
  }
  function Companion_0() {
    this.yl1_1 = 'learningspace';
  }
  var Companion_instance_0;
  function Companion_getInstance_1() {
    return Companion_instance_0;
  }
  function CentralAppConfigDbDataSourceHttp$learningSpaceDataSource$delegate$lambda(this$0) {
    return function () {
      return new LearningSpaceDataSourceHttp(this$0.zl1_1 + 'learningspace' + '/', this$0.al2_1);
    };
  }
  function CentralAppConfigDbDataSourceHttp(url, httpClient) {
    this.zl1_1 = url;
    this.al2_1 = httpClient;
    var tmp = this;
    tmp.bl2_1 = lazy(CentralAppConfigDbDataSourceHttp$learningSpaceDataSource$delegate$lambda(this));
  }
  protoOf(CentralAppConfigDbDataSourceHttp).xl1 = function () {
    // Inline function 'kotlin.getValue' call
    var this_0 = this.bl2_1;
    learningSpaceDataSource$factory();
    return this_0.t2();
  };
  function learningSpaceDataSource$factory() {
    return getPropertyCallableRef('learningSpaceDataSource', 1, KProperty1, function (receiver) {
      return receiver.xl1();
    }, null);
  }
  function LearningSpaceDataSourceHttp$getAll$slambda(this$0, resultContinuation) {
    this.kl2_1 = this$0;
    CoroutineImpl.call(this, resultContinuation);
  }
  protoOf(LearningSpaceDataSourceHttp$getAll$slambda).wl2 = function ($this$flow, $completion) {
    var tmp = this.xl2($this$flow, $completion);
    tmp.jd_1 = Unit_instance;
    tmp.kd_1 = null;
    return tmp.ud();
  };
  protoOf(LearningSpaceDataSourceHttp$getAll$slambda).he = function (p1, $completion) {
    return this.wl2((!(p1 == null) ? isInterface(p1, FlowCollector) : false) ? p1 : THROW_CCE(), $completion);
  };
  protoOf(LearningSpaceDataSourceHttp$getAll$slambda).ud = function () {
    var suspendResult = this.jd_1;
    $sm: do
      try {
        var tmp = this.hd_1;
        switch (tmp) {
          case 0:
            this.id_1 = 7;
            this.id_1 = 4;
            var tmp_0 = this;
            tmp_0.ml2_1 = this.kl2_1.zl2_1;
            var tmp_1 = this;
            tmp_1.nl2_1 = this.kl2_1.yl2_1 + 'getAll';
            var tmp_2 = this;
            tmp_2.ol2_1 = this.ml2_1;
            var tmp_3 = this;
            tmp_3.pl2_1 = this.ol2_1;
            var tmp_4 = this;
            var this_0 = new HttpRequestBuilder();
            url(this_0, this.nl2_1);
            tmp_4.ql2_1 = this_0;
            this.ql2_1.w38_1 = Companion_getInstance().l2x_1;
            var tmp_5 = this;
            tmp_5.rl2_1 = this.pl2_1;
            var tmp_6 = this;
            tmp_6.sl2_1 = this.ql2_1;
            this.hd_1 = 1;
            suspendResult = (new HttpStatement(this.sl2_1, this.rl2_1)).h3z(this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            this.tl2_1 = suspendResult;
            this.hd_1 = 2;
            var tmp_7 = this.tl2_1.e3c();
            var tmp_8 = JsType_instance;
            var tmp_9 = getKClass(List);
            var tmp_10;
            try {
              tmp_10 = createKType(getKClass(List), arrayOf([createInvariantKTypeProjection(createKType(getKClass(LearningSpaceInfo), arrayOf([]), false))]), false);
            } catch ($p) {
              var tmp_11;
              if ($p instanceof Error) {
                var cause = $p;
                tmp_11 = null;
              } else {
                throw $p;
              }
              tmp_10 = tmp_11;
            }

            suspendResult = tmp_7.h3b(typeInfoImpl(tmp_8, tmp_9, tmp_10), this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 2:
            var tmp_12 = this;
            tmp_12.ul2_1 = (!(suspendResult == null) ? isInterface(suspendResult, List) : false) ? suspendResult : THROW_CCE();
            this.hd_1 = 3;
            suspendResult = this.ll2_1.t1d(this.ul2_1, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 3:
            this.id_1 = 7;
            this.hd_1 = 6;
            continue $sm;
          case 4:
            this.id_1 = 7;
            var tmp_13 = this.kd_1;
            if (tmp_13 instanceof Exception) {
              this.vl2_1 = this.kd_1;
              this.hd_1 = 5;
              suspendResult = this.ll2_1.t1d(emptyList(), this);
              if (suspendResult === get_COROUTINE_SUSPENDED()) {
                return suspendResult;
              }
              continue $sm;
            } else {
              throw this.kd_1;
            }

          case 5:
            this.hd_1 = 6;
            continue $sm;
          case 6:
            this.id_1 = 7;
            return Unit_instance;
          case 7:
            throw this.kd_1;
        }
      } catch ($p) {
        var e = $p;
        if (this.id_1 === 7) {
          throw e;
        } else {
          this.hd_1 = this.id_1;
          this.kd_1 = e;
        }
      }
     while (true);
  };
  protoOf(LearningSpaceDataSourceHttp$getAll$slambda).xl2 = function ($this$flow, completion) {
    var i = new LearningSpaceDataSourceHttp$getAll$slambda(this.kl2_1, completion);
    i.ll2_1 = $this$flow;
    return i;
  };
  function LearningSpaceDataSourceHttp$getAll$slambda_0(this$0, resultContinuation) {
    var i = new LearningSpaceDataSourceHttp$getAll$slambda(this$0, resultContinuation);
    var l = function ($this$flow, $completion) {
      return i.wl2($this$flow, $completion);
    };
    l.$arity = 1;
    return l;
  }
  function LearningSpaceDataSourceHttp(url, httpClient) {
    this.yl2_1 = url;
    this.zl2_1 = httpClient;
  }
  protoOf(LearningSpaceDataSourceHttp).al3 = function () {
    return flow(LearningSpaceDataSourceHttp$getAll$slambda_0(this, null));
  };
  function Companion_1() {
  }
  var Companion_instance_1;
  function Companion_getInstance_2() {
    return Companion_instance_1;
  }
  function $serializer() {
    $serializer_instance = this;
    var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('com.ustadmobile.centralappconfigdb.model.LearningSpaceInfo', this, 4);
    tmp0_serialDesc.t4f('url', false);
    tmp0_serialDesc.t4f('name', false);
    tmp0_serialDesc.t4f('description', false);
    tmp0_serialDesc.t4f('lastModified', false);
    this.bl3_1 = tmp0_serialDesc;
  }
  protoOf($serializer).q44 = function () {
    return this.bl3_1;
  };
  protoOf($serializer).k4g = function () {
    // Inline function 'kotlin.arrayOf' call
    // Inline function 'kotlin.js.unsafeCast' call
    // Inline function 'kotlin.js.asDynamic' call
    return [StringSerializer_getInstance(), StringSerializer_getInstance(), StringSerializer_getInstance(), LongSerializer_getInstance()];
  };
  protoOf($serializer).s44 = function (decoder) {
    var tmp0_desc = this.bl3_1;
    var tmp1_flag = true;
    var tmp2_index = 0;
    var tmp3_bitMask0 = 0;
    var tmp4_local0 = null;
    var tmp5_local1 = null;
    var tmp6_local2 = null;
    var tmp7_local3 = new Long(0, 0);
    var tmp8_input = decoder.i48(tmp0_desc);
    if (tmp8_input.x48()) {
      tmp4_local0 = tmp8_input.s48(tmp0_desc, 0);
      tmp3_bitMask0 = tmp3_bitMask0 | 1;
      tmp5_local1 = tmp8_input.s48(tmp0_desc, 1);
      tmp3_bitMask0 = tmp3_bitMask0 | 2;
      tmp6_local2 = tmp8_input.s48(tmp0_desc, 2);
      tmp3_bitMask0 = tmp3_bitMask0 | 4;
      tmp7_local3 = tmp8_input.o48(tmp0_desc, 3);
      tmp3_bitMask0 = tmp3_bitMask0 | 8;
    } else
      while (tmp1_flag) {
        tmp2_index = tmp8_input.y48(tmp0_desc);
        switch (tmp2_index) {
          case -1:
            tmp1_flag = false;
            break;
          case 0:
            tmp4_local0 = tmp8_input.s48(tmp0_desc, 0);
            tmp3_bitMask0 = tmp3_bitMask0 | 1;
            break;
          case 1:
            tmp5_local1 = tmp8_input.s48(tmp0_desc, 1);
            tmp3_bitMask0 = tmp3_bitMask0 | 2;
            break;
          case 2:
            tmp6_local2 = tmp8_input.s48(tmp0_desc, 2);
            tmp3_bitMask0 = tmp3_bitMask0 | 4;
            break;
          case 3:
            tmp7_local3 = tmp8_input.o48(tmp0_desc, 3);
            tmp3_bitMask0 = tmp3_bitMask0 | 8;
            break;
          default:
            throw UnknownFieldException_init_$Create$(tmp2_index);
        }
      }
    tmp8_input.j48(tmp0_desc);
    return LearningSpaceInfo_init_$Create$(tmp3_bitMask0, tmp4_local0, tmp5_local1, tmp6_local2, tmp7_local3, null);
  };
  protoOf($serializer).cl3 = function (encoder, value) {
    var tmp0_desc = this.bl3_1;
    var tmp1_output = encoder.i48(tmp0_desc);
    tmp1_output.w49(tmp0_desc, 0, value.dl3_1);
    tmp1_output.w49(tmp0_desc, 1, value.el3_1);
    tmp1_output.w49(tmp0_desc, 2, value.fl3_1);
    tmp1_output.s49(tmp0_desc, 3, value.gl3_1);
    tmp1_output.j48(tmp0_desc);
  };
  protoOf($serializer).r44 = function (encoder, value) {
    return this.cl3(encoder, value instanceof LearningSpaceInfo ? value : THROW_CCE());
  };
  var $serializer_instance;
  function $serializer_getInstance() {
    if ($serializer_instance == null)
      new $serializer();
    return $serializer_instance;
  }
  function LearningSpaceInfo_init_$Init$(seen1, url, name, description, lastModified, serializationConstructorMarker, $this) {
    if (!(15 === (15 & seen1))) {
      throwMissingFieldException(seen1, 15, $serializer_getInstance().bl3_1);
    }
    $this.dl3_1 = url;
    $this.el3_1 = name;
    $this.fl3_1 = description;
    $this.gl3_1 = lastModified;
    return $this;
  }
  function LearningSpaceInfo_init_$Create$(seen1, url, name, description, lastModified, serializationConstructorMarker) {
    return LearningSpaceInfo_init_$Init$(seen1, url, name, description, lastModified, serializationConstructorMarker, objectCreate(protoOf(LearningSpaceInfo)));
  }
  function LearningSpaceInfo(url, name, description, lastModified) {
    this.dl3_1 = url;
    this.el3_1 = name;
    this.fl3_1 = description;
    this.gl3_1 = lastModified;
  }
  protoOf(LearningSpaceInfo).toString = function () {
    return 'LearningSpaceInfo(url=' + this.dl3_1 + ', name=' + this.el3_1 + ', description=' + this.fl3_1 + ', lastModified=' + this.gl3_1.toString() + ')';
  };
  protoOf(LearningSpaceInfo).hashCode = function () {
    var result = getStringHashCode(this.dl3_1);
    result = imul(result, 31) + getStringHashCode(this.el3_1) | 0;
    result = imul(result, 31) + getStringHashCode(this.fl3_1) | 0;
    result = imul(result, 31) + this.gl3_1.hashCode() | 0;
    return result;
  };
  protoOf(LearningSpaceInfo).equals = function (other) {
    if (this === other)
      return true;
    if (!(other instanceof LearningSpaceInfo))
      return false;
    var tmp0_other_with_cast = other instanceof LearningSpaceInfo ? other : THROW_CCE();
    if (!(this.dl3_1 === tmp0_other_with_cast.dl3_1))
      return false;
    if (!(this.el3_1 === tmp0_other_with_cast.el3_1))
      return false;
    if (!(this.fl3_1 === tmp0_other_with_cast.fl3_1))
      return false;
    if (!this.gl3_1.equals(tmp0_other_with_cast.gl3_1))
      return false;
    return true;
  };
  //region block: post-declaration
  protoOf($serializer).l4g = typeParametersSerializers;
  //endregion
  //region block: init
  Companion_instance = new Companion();
  Companion_instance_0 = new Companion_0();
  Companion_instance_1 = new Companion_1();
  //endregion
  //region block: exports
  _.$_$ = _.$_$ || {};
  _.$_$.a = CentralAppConfigDbDataSourceHttp;
  _.$_$.b = CentralAppConfigDbDataSource;
  _.$_$.c = Companion_instance;
  //endregion
  return _;
}(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlinx-coroutines-core.js'), require('./ktor-ktor-client-core.js'), require('./ktor-ktor-http.js'), require('./ktor-ktor-utils.js'), require('./kotlinx-serialization-kotlinx-serialization-core.js')));

//# sourceMappingURL=UstadMobile-lib-centralappconfigdb-common.js.map
