(function (_, kotlin_kotlin) { 'use strict'; //region block: imports var protoOf = kotlin_kotlin.$_$.ed; var objectMeta = kotlin_kotlin.$_$.dd; var setMetadataFor = kotlin_kotlin.$_$.fd; var classMeta = kotlin_kotlin.$_$.qb; var VOID = kotlin_kotlin.$_$.f; var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.v; var Unit_instance = kotlin_kotlin.$_$.m5; var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.a2; var throwUninitializedPropertyAccessException = kotlin_kotlin.$_$.wj; var startsWith = kotlin_kotlin.$_$.lg; var last = kotlin_kotlin.$_$.l8; var removeLastOrNull = kotlin_kotlin.$_$.j9; var equals = kotlin_kotlin.$_$.ub; var indexOf = kotlin_kotlin.$_$.a8; var reverse = kotlin_kotlin.$_$.n9; var asList = kotlin_kotlin.$_$.ak; var emptyList = kotlin_kotlin.$_$.n7; var ArrayList_init_$Create$ = kotlin_kotlin.$_$.m; var Exception_init_$Create$ = kotlin_kotlin.$_$.n1; var contains = kotlin_kotlin.$_$.af; var IndexOutOfBoundsException_init_$Create$ = kotlin_kotlin.$_$.d2; var interfaceMeta = kotlin_kotlin.$_$.dc; //endregion //region block: pre-declaration setMetadataFor(XmlPullParserConstants, 'XmlPullParserConstants', objectMeta); setMetadataFor(ParserEvent, 'ParserEvent', classMeta, VOID, VOID, ParserEvent); setMetadataFor(Companion, 'Companion', objectMeta); setMetadataFor(XmlPullParserFactory, 'XmlPullParserFactory', classMeta, VOID, VOID, XmlPullParserFactory); setMetadataFor(XmlPullParserJsImpl, 'XmlPullParserJsImpl', classMeta, VOID, VOID, XmlPullParserJsImpl); setMetadataFor(XmlSerializer, 'XmlSerializer', interfaceMeta); //endregion function XmlPullParserConstants() { this.i7d_1 = 0; this.j7d_1 = 1; this.k7d_1 = 2; this.l7d_1 = 3; this.m7d_1 = 4; this.n7d_1 = 5; this.o7d_1 = 10; this.p7d_1 = 6; this.q7d_1 = 'http://xmlpull.org/v1/doc/features.html#process-namespaces'; this.r7d_1 = 'http://xmlpull.org/v1/doc/properties.html#xmldecl-standalone'; this.s7d_1 = 'http://xmlpull.org/v1/doc/properties.html#xmldecl-version'; } var XmlPullParserConstants_instance; function XmlPullParserConstants_getInstance() { return XmlPullParserConstants_instance; } function ParserEvent() { this.t7d_1 = null; this.u7d_1 = -1; this.v7d_1 = -1; } function setInputString(_this__u8e3s4, xmlString) { return _this__u8e3s4.w7d(xmlString); } function Companion() { this.x7d_1 = 'http://xmlpull.org/v1/doc/features.html#validation'; this.y7d_1 = 'http://xmlpull.org/v1/doc/features.html#process-namespaces'; } protoOf(Companion).z7d = function () { return new XmlPullParserFactory(); }; var Companion_instance; function Companion_getInstance() { return Companion_instance; } function XmlPullParserFactory() { var tmp = this; // Inline function 'kotlin.collections.mutableMapOf' call tmp.a7e_1 = LinkedHashMap_init_$Create$(); } protoOf(XmlPullParserFactory).b7e = function (name, state) { // Inline function 'kotlin.collections.set' call this.a7e_1.s(name, state); }; protoOf(XmlPullParserFactory).c7e = function (awareness) { this.b7e('http://xmlpull.org/v1/doc/features.html#process-namespaces', awareness); }; protoOf(XmlPullParserFactory).d7e = function () { var xpp = new XmlPullParserJsImpl(); // Inline function 'kotlin.collections.forEach' call // Inline function 'kotlin.collections.iterator' call var tmp0_iterator = this.a7e_1.q2().w(); while (tmp0_iterator.f()) { var element = tmp0_iterator.e(); // Inline function 'com.ustadmobile.xmlpullparserkmp.XmlPullParserFactory.newPullParser.' call xpp.b7e(element.s2(), element.t2()); } return xpp; }; protoOf(XmlPullParserFactory).n7e = function () { throw IllegalStateException_init_$Create$('Not available on Javascript yet'); }; function _get_treeWalker__49d1m1($this) { var tmp = $this.e7e_1; if (!(tmp == null)) return tmp; else { throwUninitializedPropertyAccessException('treeWalker'); } } function _get_document__ux3svk($this) { var tmp = $this.f7e_1; if (!(tmp == null)) return tmp; else { throwUninitializedPropertyAccessException('document'); } } function isProp($this, ns1, prop, ns2) { if (!startsWith(ns1, 'http://xmlpull.org/v1/doc/')) return false; var tmp; if (prop) { // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call tmp = ns1.substring(42) === ns2; } else { // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call tmp = ns1.substring(40) === ns2; } return tmp; } function logParserEvents($this) { $l$loop: while (!(XmlPullParserJsImpl$logParserEvents$lambda($this)() == null)) { var tmp0_safe_receiver = $this.i7e_1; var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.nodeType; if ((tmp1_safe_receiver == null ? null : tmp1_safe_receiver) === Node.TEXT_NODE) { // Inline function 'kotlin.apply' call var this_0 = new ParserEvent(); // Inline function 'kotlin.contracts.contract' call // Inline function 'com.ustadmobile.xmlpullparserkmp.XmlPullParserJsImpl.logParserEvents.' call this_0.t7d_1 = $this.i7e_1; var tmp = this_0; tmp.v7d_1 = 4; this_0.u7d_1 = $this.h7e_1.u() + 1 | 0; $this.g7e_1.j1(this_0); } // Inline function 'kotlin.apply' call var this_1 = new ParserEvent(); // Inline function 'kotlin.contracts.contract' call // Inline function 'com.ustadmobile.xmlpullparserkmp.XmlPullParserJsImpl.logParserEvents.' call this_1.t7d_1 = $this.i7e_1; var tmp_0 = this_1; tmp_0.v7d_1 = 2; this_1.u7d_1 = $this.h7e_1.u() + 1 | 0; $this.g7e_1.j1(this_1); var tmp2_safe_receiver = $this.i7e_1; if ((tmp2_safe_receiver == null ? null : tmp2_safe_receiver.hasChildNodes()) === false) { // Inline function 'kotlin.apply' call var this_2 = new ParserEvent(); // Inline function 'kotlin.contracts.contract' call // Inline function 'com.ustadmobile.xmlpullparserkmp.XmlPullParserJsImpl.logParserEvents.' call this_2.t7d_1 = $this.i7e_1; var tmp_1 = this_2; tmp_1.v7d_1 = 3; this_2.u7d_1 = $this.h7e_1.u() + 1 | 0; $this.g7e_1.j1(this_2); } var tmp_2; if ($this.h7e_1.d1()) { tmp_2 = true; } else { var tmp3_safe_receiver = $this.i7e_1; tmp_2 = (tmp3_safe_receiver == null ? null : tmp3_safe_receiver.hasChildNodes()) === true; } if (tmp_2) { var tmp4_safe_receiver = $this.i7e_1; if (tmp4_safe_receiver == null) null; else { // Inline function 'kotlin.let' call // Inline function 'kotlin.contracts.contract' call // Inline function 'com.ustadmobile.xmlpullparserkmp.XmlPullParserJsImpl.logParserEvents.' call $this.h7e_1.j1(tmp4_safe_receiver); } } var currentParentNode = last($this.h7e_1); if (equals(currentParentNode.lastChild, $this.i7e_1)) { // Inline function 'kotlin.apply' call var this_3 = new ParserEvent(); // Inline function 'kotlin.contracts.contract' call // Inline function 'com.ustadmobile.xmlpullparserkmp.XmlPullParserJsImpl.logParserEvents.' call this_3.t7d_1 = currentParentNode; var tmp_3 = this_3; tmp_3.v7d_1 = 3; this_3.u7d_1 = $this.h7e_1.x(currentParentNode) + 1 | 0; $this.g7e_1.j1(this_3); removeLastOrNull($this.h7e_1); var tmp_4; var tmp5_safe_receiver = currentParentNode.parentNode; if (!((tmp5_safe_receiver == null ? null : tmp5_safe_receiver.nextSibling) == null)) { var tmp6_safe_receiver = currentParentNode.parentNode; tmp_4 = equals(tmp6_safe_receiver == null ? null : tmp6_safe_receiver.lastChild, currentParentNode); } else { tmp_4 = false; } if (tmp_4) { // Inline function 'kotlin.apply' call var this_4 = new ParserEvent(); // Inline function 'kotlin.contracts.contract' call // Inline function 'com.ustadmobile.xmlpullparserkmp.XmlPullParserJsImpl.logParserEvents.' call this_4.t7d_1 = currentParentNode.parentNode; var tmp_5 = this_4; tmp_5.v7d_1 = 3; this_4.u7d_1 = indexOf($this.h7e_1, currentParentNode.parentNode) + 1 | 0; $this.g7e_1.j1(this_4); removeLastOrNull($this.h7e_1); } } } $l$loop_0: while (!(XmlPullParserJsImpl$logParserEvents$lambda_0($this)() == null)) { // Inline function 'kotlin.apply' call var this_5 = new ParserEvent(); // Inline function 'kotlin.contracts.contract' call // Inline function 'com.ustadmobile.xmlpullparserkmp.XmlPullParserJsImpl.logParserEvents.' call this_5.t7d_1 = $this.k7e_1; var tmp_6 = this_5; tmp_6.v7d_1 = 3; this_5.u7d_1 = $this.h7e_1.u() + 1 | 0; $this.g7e_1.j1(this_5); } // Inline function 'kotlin.apply' call var this_6 = new ParserEvent(); // Inline function 'kotlin.contracts.contract' call // Inline function 'com.ustadmobile.xmlpullparserkmp.XmlPullParserJsImpl.logParserEvents.' call this_6.t7d_1 = _get_treeWalker__49d1m1($this).root; var tmp_7 = this_6; tmp_7.v7d_1 = 0; $this.g7e_1.d2(0, this_6); // Inline function 'kotlin.apply' call var this_7 = new ParserEvent(); // Inline function 'kotlin.contracts.contract' call // Inline function 'com.ustadmobile.xmlpullparserkmp.XmlPullParserJsImpl.logParserEvents.' call this_7.t7d_1 = _get_treeWalker__49d1m1($this).root; var tmp_8 = this_7; tmp_8.v7d_1 = 1; $this.g7e_1.j1(this_7); reverse($this.g7e_1); } function getAttributes($this) { var tmp0_safe_receiver = getCurrentEventElement$default($this); var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.attributes; var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : asList(tmp1_safe_receiver); var tmp; if (tmp2_elvis_lhs == null) { // Inline function 'kotlin.collections.listOf' call tmp = emptyList(); } else { tmp = tmp2_elvis_lhs; } return tmp; } function getCurrentEventElement($this, event) { var mElement = event == null ? $this.j7e_1 : event; var tmp2_safe_receiver = mElement == null ? null : mElement.t7d_1; if (tmp2_safe_receiver == null) null; else tmp2_safe_receiver.appendChild(_get_document__ux3svk($this).createTextNode('text')); var tmp4_safe_receiver = mElement == null ? null : mElement.t7d_1; var tmp5_safe_receiver = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.lastChild; return tmp5_safe_receiver == null ? null : tmp5_safe_receiver.parentElement; } function getCurrentEventElement$default($this, event, $super) { event = event === VOID ? null : event; return getCurrentEventElement($this, event); } function XmlPullParserJsImpl$setInput$lambda(it) { return NodeFilter.FILTER_ACCEPT; } function XmlPullParserJsImpl$logParserEvents$lambda(this$0) { return function () { this$0.i7e_1 = _get_treeWalker__49d1m1(this$0).nextNode(); return this$0.i7e_1; }; } function XmlPullParserJsImpl$logParserEvents$lambda_0(this$0) { return function () { this$0.k7e_1 = removeLastOrNull(this$0.h7e_1); return this$0.k7e_1; }; } function XmlPullParserJsImpl() { var tmp = this; // Inline function 'kotlin.collections.mutableListOf' call tmp.g7e_1 = ArrayList_init_$Create$(); var tmp_0 = this; // Inline function 'kotlin.collections.mutableListOf' call tmp_0.h7e_1 = ArrayList_init_$Create$(); this.i7e_1 = null; this.j7e_1 = null; this.k7e_1 = null; this.l7e_1 = false; this.m7e_1 = true; } protoOf(XmlPullParserJsImpl).w7d = function (content) { this.f7e_1 = (new DOMParser()).parseFromString(content, 'text/' + (startsWith(content, '' call if ((element.name === name ? true : contains(element.name, name)) ? element.namespaceURI == null ? true : element.namespaceURI == namespace : false) { tmp$ret$1 = element; break $l$block; } } tmp$ret$1 = null; } var tmp1_safe_receiver = tmp$ret$1; tmp = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.value; } return tmp; }; protoOf(XmlPullParserJsImpl).e = function () { this.j7e_1 = removeLastOrNull(this.g7e_1); var tmp0_safe_receiver = this.j7e_1; var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.v7d_1; return tmp1_elvis_lhs == null ? -1 : tmp1_elvis_lhs; }; function XmlSerializer() { } //region block: init XmlPullParserConstants_instance = new XmlPullParserConstants(); Companion_instance = new Companion(); //endregion //region block: exports _.$_$ = _.$_$ || {}; _.$_$.a = XmlPullParserFactory; _.$_$.b = XmlSerializer; _.$_$.c = setInputString; _.$_$.d = XmlPullParserConstants_instance; _.$_$.e = Companion_instance; //endregion return _; }(module.exports, require('./kotlin-kotlin-stdlib.js'))); //# sourceMappingURL=xmlpullparserkmp.js.map