Komponent 0.0.4 with minimize

This commit is contained in:
2017-07-22 13:31:15 +02:00
parent 1cf9f2598e
commit 584874a7ac
21 changed files with 117 additions and 49565 deletions

View File

@@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="Gradle: nl.astraeus:komp:0.0.1-SNAPSHOT">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/nl.astraeus/komp/0.0.1-SNAPSHOT/70b9337fd9e82adb2031645d963fe8414285fe4/komp-0.0.1-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="Gradle: nl.astraeus:komp:0.0.4-SNAPSHOT">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/nl.astraeus/komp/0.0.4-SNAPSHOT/b88123c896040e776bd78687c4f6f9b531c65535/komp-0.0.4-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,11 +1,11 @@
<component name="libraryTable">
<library name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-js:1.1.1">
<library name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-js:1.1.4-eap-11">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.1.1/260a9dc3039aee5efea1d57a6a8ee1707361ed5/kotlin-stdlib-js-1.1.1.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.1.4-eap-11/fce562fb9acf253e2a7f6118f9545919e450d03e/kotlin-stdlib-js-1.1.4-eap-11.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.1.1/2ad00bdfade81168ba4b90b6a892545a5267bf85/kotlin-stdlib-js-1.1.1-sources.jar!/" />
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.1.4-eap-11/fbbb8562bff1e98fc3c5e52185e0bc98c3fd5648/kotlin-stdlib-js-1.1.4-eap-11-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -5,6 +5,7 @@
<content url="file://$MODULE_DIR$/../..">
<excludeFolder url="file://$MODULE_DIR$/../../.gradle" />
<excludeFolder url="file://$MODULE_DIR$/../../build" />
<excludeFolder url="file://$MODULE_DIR$/../../out" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />

View File

@@ -12,24 +12,28 @@
<option name="sourceMap" value="true" />
<option name="metaInfo" value="true" />
<option name="target" value="v5" />
<option name="moduleKind" value="plain" />
<option name="main" value="call" />
<option name="languageVersion" value="1.1" />
<option name="apiVersion" value="1.1" />
<option name="suppressWarnings" value="true" />
<option name="pluginClasspaths">
<array />
</option>
<option name="coroutinesWarn" value="true" />
<option name="pluginOptions">
<array />
</option>
<option name="pluginClasspaths">
<array />
</option>
<option name="freeArgs">
<list>
<option value="inlining" />
</list>
</option>
<option name="suppressWarnings" value="true" />
<option name="coroutinesWarn" value="true" />
</compilerArguments>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/../../web/js/kotlin" />
<output url="file://$MODULE_DIR$/../../out/production/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$/../../src/main">
<sourceFolder url="file://$MODULE_DIR$/../../src/main/java" isTestSource="false" />
@@ -38,8 +42,8 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-js:1.1.1" level="project" />
<orderEntry type="library" name="Gradle: nl.astraeus:komp:0.0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-js:1.1.4-eap-11" level="project" />
<orderEntry type="library" name="Gradle: nl.astraeus:komp:0.0.4-SNAPSHOT" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlinx:kotlinx-html-js:0.6.2" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlinx:kotlinx-html-common:0.6.2" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-common:1.1.0" level="project" />

View File

@@ -9,23 +9,27 @@
<option name="noStdlib" value="true" />
<option name="metaInfo" value="true" />
<option name="target" value="v5" />
<option name="moduleKind" value="plain" />
<option name="main" value="call" />
<option name="languageVersion" value="1.1" />
<option name="apiVersion" value="1.1" />
<option name="pluginClasspaths">
<array />
</option>
<option name="coroutinesWarn" value="true" />
<option name="pluginOptions">
<array />
</option>
<option name="pluginClasspaths">
<array />
</option>
<option name="freeArgs">
<list>
<option value="inlining" />
</list>
</option>
<option name="coroutinesWarn" value="true" />
</compilerArguments>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output-test url="file://$MODULE_DIR$/../../build/classes/test" />
<output-test url="file://$MODULE_DIR$/../../out/test/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$/../../src/test">
<sourceFolder url="file://$MODULE_DIR$/../../src/test/java" isTestSource="true" />
@@ -35,8 +39,8 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="komp-todo_main" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-js:1.1.1" level="project" />
<orderEntry type="library" name="Gradle: nl.astraeus:komp:0.0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-js:1.1.4-eap-11" level="project" />
<orderEntry type="library" name="Gradle: nl.astraeus:komp:0.0.4-SNAPSHOT" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlinx:kotlinx-html-js:0.6.2" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlinx:kotlinx-html-common:0.6.2" level="project" />
<orderEntry type="library" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib-common:1.1.0" level="project" />

View File

@@ -2,7 +2,7 @@ group 'nl.astraeus'
version '0.0.1-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.1.1'
ext.kotlin_version = '1.1.4-eap-11'
repositories {
maven {
@@ -19,7 +19,14 @@ buildscript {
}
allprojects {
ext {
kotlin_version = '1.1.4-eap-11'
}
}
apply plugin: 'kotlin2js'
apply plugin: 'kotlin-dce-js'
repositories {
maven {
@@ -30,7 +37,7 @@ repositories {
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
compile "nl.astraeus:komp:0.0.1-SNAPSHOT"
compile "nl.astraeus:komp:0.0.4-SNAPSHOT"
}
compileKotlin2Js {
@@ -42,6 +49,7 @@ compileKotlin2Js {
compileKotlin2Js.kotlinOptions.verbose = true
}
/*
compileKotlin2Js.doLast {
configurations.compile.each { File file ->
copy {
@@ -56,3 +64,4 @@ compileKotlin2Js.doLast {
}
}
}
*/

View File

@@ -1,6 +1,6 @@
#Sun Apr 02 11:44:12 CEST 2017
#Sat Jul 22 12:44:21 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip

32
minimize.gradle Normal file
View File

@@ -0,0 +1,32 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "com.eriwen:gradle-js-plugin:1.12.1"
}
}
plugins {
id "com.eriwen.gradle.js" version "2.14.1"
}
// Create new CombineJsTasks if you have multiple sets of JS files
task combineKotlinJs(type: com.eriwen.gradle.js.tasks.CombineJsTask) {
source = [
"${projectDir}/web/js/kotlin/min/kotlin.js",
"${projectDir}/web/js/kotlin/min/kotlinx-html-js.js",
"${projectDir}/web/js/kotlin/min/komp.js",
"${projectDir}/web/js/kotlin/min/komp-todo.js"
]
dest = file("${projectDir}/web/js/generated/todo.all.js")
}
minifyJs {
source = combineKotlinJs
dest = file("${projectDir}/web/js/generated/todo.all.min.js")
closure {
warningLevel = 'QUIET'
compilerOptions.languageIn = "ECMASCRIPT5"
}
}

View File

@@ -2,8 +2,7 @@ package nl.astraeus.komp.todo
import kotlinx.html.*
import kotlinx.html.js.*
import nl.astraeus.komp.HtmlComponent
import nl.astraeus.komp.Komp
import nl.astraeus.komp.Komponent
import org.w3c.dom.HTMLElement
import org.w3c.dom.HTMLInputElement
import org.w3c.dom.events.Event
@@ -28,7 +27,7 @@ enum class Selection(val title: String) {
COMPLETED("Completed")
}
class TodoApp: HtmlComponent() {
class TodoApp: Komponent() {
val todoList: MutableList<Todo> = ArrayList()
var selected: Selection = Selection.ALL
@@ -212,5 +211,5 @@ class TodoApp: HtmlComponent() {
}
fun main(args: Array<String>) {
Komp.create(document.body!!, TodoApp(), true)
Komponent.create(document.body!!, TodoApp(), true)
}

View File

@@ -12,9 +12,6 @@
<p>Compare other javascript MVC* frameworks with <a href="http://todomvc.com">TodoMVC</a></p>
</footer>
<script src="js/kotlin/kotlin.js" ></script>
<script src="js/kotlin/kotlinx-html-js.js" ></script>
<script src="js/kotlin/komp.js" ></script>
<script src="js/kotlin/komp-todo.js" ></script>
<script src="js/generated/todo.all.min.js" ></script>
</body>
</html>

20
web/index_dev.html Normal file
View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Komp-Todo</title>
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<footer class="info">
<p>Double-click to edit a todo</p>
<p>Compare other javascript MVC* frameworks with <a href="http://todomvc.com">TodoMVC</a></p>
</footer>
<script src="js/kotlin/dependencies/kotlin.js" ></script>
<script src="js/kotlin/dependencies/kotlinx-html-js.js" ></script>
<script src="js/kotlin/dependencies/komp.js" ></script>
<script src="js/kotlin/komp-todo.js" ></script>
</body>
</html>

View File

@@ -11,7 +11,7 @@ this['komp-todo'] = function (_, Kotlin, $module$komp, $module$kotlinx_html_js)
'use strict';
var Enum = Kotlin.kotlin.Enum;
var ArrayList_init = Kotlin.kotlin.collections.ArrayList_init_mqih57$;
var HtmlComponent = $module$komp.nl.astraeus.komp.HtmlComponent;
var Komponent = $module$komp.nl.astraeus.komp.Komponent;
var h1 = $module$kotlinx_html_js.kotlinx.html.h1_vmej1w$;
var set_id = $module$kotlinx_html_js.kotlinx.html.set_id_ueiko3$;
var set_onKeyPressFunction = $module$kotlinx_html_js.kotlinx.html.js.set_onKeyPressFunction_pszlq2$;
@@ -35,10 +35,9 @@ this['komp-todo'] = function (_, Kotlin, $module$komp, $module$kotlinx_html_js)
var footer = $module$kotlinx_html_js.kotlinx.html.footer_780ap1$;
var section_0 = $module$kotlinx_html_js.kotlinx.html.js.section_ceckl$;
var ArrayList_init_0 = Kotlin.kotlin.collections.ArrayList_init_ww73n8$;
var komp_0 = $module$komp.nl.astraeus.komp;
Selection.prototype = Object.create(Enum.prototype);
Selection.prototype.constructor = Selection;
TodoApp.prototype = Object.create(HtmlComponent.prototype);
TodoApp.prototype = Object.create(Komponent.prototype);
TodoApp.prototype.constructor = TodoApp;
function Todo(dataId, title, completed, editing) {
if (completed === void 0)
@@ -105,7 +104,7 @@ this['komp-todo'] = function (_, Kotlin, $module$komp, $module$kotlinx_html_js)
}
Selection.valueOf_61zpoe$ = Selection$valueOf;
function TodoApp() {
HtmlComponent.call(this);
Komponent.call(this);
this.todoList = ArrayList_init_0();
this.selected = Selection$ALL_getInstance();
}
@@ -169,7 +168,7 @@ this['komp-todo'] = function (_, Kotlin, $module$komp, $module$kotlinx_html_js)
this.refresh();
};
TodoApp.prototype.refresh = function () {
HtmlComponent.prototype.refresh.call(this);
Komponent.prototype.refresh.call(this);
var inputBox = document.getElementById('todo_input');
if (Kotlin.isType(inputBox, HTMLInputElement)) {
inputBox.focus();
@@ -367,11 +366,11 @@ this['komp-todo'] = function (_, Kotlin, $module$komp, $module$kotlinx_html_js)
TodoApp.$metadata$ = {
kind: Kotlin.Kind.CLASS,
simpleName: 'TodoApp',
interfaces: [HtmlComponent]
interfaces: [Komponent]
};
function main(args) {
var tmp$;
komp_0.Komp.create_og2ns8$((tmp$ = document.body) != null ? tmp$ : Kotlin.throwNPE(), new TodoApp(), true);
Komponent.Companion.create_nkol39$((tmp$ = document.body) != null ? tmp$ : Kotlin.throwNPE(), new TodoApp(), true);
}
var package$nl = _.nl || (_.nl = {});
var package$astraeus = package$nl.astraeus || (package$nl.astraeus = {});
@@ -390,9 +389,9 @@ this['komp-todo'] = function (_, Kotlin, $module$komp, $module$kotlinx_html_js)
package$todo.Selection = Selection;
package$todo.TodoApp = TodoApp;
package$todo.main_kand9s$ = main;
Kotlin.defineModule('komp-todo', _);
main([]);
Kotlin.defineModule('komp-todo', _);
return _;
}(typeof this['komp-todo'] === 'undefined' ? {} : this['komp-todo'], kotlin, komp, this['kotlinx-html-js']);
//@ sourceMappingURL=komp-todo.js.map
//# sourceMappingURL=komp-todo.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
// Kotlin.kotlin_module_metadata(1, "komp-todo", "H4sIAAAAAAAAAI1XSVPjRhSWJVmWnrdGbEbMhAyzLzCOJ5XKpJIDeFwFlKkkQFJzFXZjZGTJabVZ/sD8gDnNT+E0xznnHyWvZXkTyDZV1mt1f2/ttwjJfASSKVmlL/p/g7/UrTFaf9Yl8ynkQLvwuet4ILcDE0AmEqi6RFKW9kVHfAh7B0sgey7odsCZTXsBqBd+p2uSERyfKSILJvnWkAXTW1gZys7R6y5lTod63HaTtGyhlgED2J7nc5s7vpcEfwb5IVxp+p0k3HMoDHEqpwFPAv4Eq6D4rAXK1bsGZNHgM591bK9BpzsqFExEJ0nBNhTHFCjX52y64B3YHAWk4TO/xx2PBrFoThXxGGCkMsmuMiyM2ZU+c1wazHY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mZmSu8qe6aIaZEyXMURQO1FtmelsRMuj9LMHQ1YgMHm7pw7+ha204aBzfFCzoZ8YZtvwr3MWplK7GV2PsScndWdaeJTrIWxJiOk2CdwyGZ7Iwp4ZvZA4ZqedRfNv5m2GfsxV3YqUorbHyySLQoqMqfQG4o8yxL7pw5/y1kfSDgWg04Axgca95TJvGz5wz4UuMs9CuoHUT2YI812G9Tmwenhby0wDn4+ft9unbZ+BOVUSJGb/i2oHZvbhx0xn9BuymkHtP0g8KiNrtOOy4UcTeCbgwEYPyEq8LFIQQ8jGxCvC5vabshnmh2Yx0Nun3k0OtHsTidSqojigjydM+eg0BIUSg5awA4Sm8wOfnOx4DaSoQu7olWxS/khp/2wTc85yIfIKe6L0fACxxH1O5SB+e70uN3yaD+yejyG09dmntrdg/FZeeTbJMpGmCwhpLwVx8UUnh94rnOJJip9W9yDzbroRZMx+9b6N5+d7aDqMlGqOTwt4LpAVFwLqkdUIUZMIaZmRGVSjHErMSXxvhVRiaxVhbYCwW9lnZDNGLUVadrGkzVyB5/r5C4+K+QrPN0g92LUTkQr5HGEfoqIGnmGO9vkeYzYq+Zqd2qbpFGTGtZekbyu6ZZiSQ2tcfeLnsMCru/pn/JVZW+0rTTUfdAlSyUaMmgnMe1JuoE/wJ+JbPUV/Z98Vd9D/L6kS6NXY/YVktePVRPXxf0dlFoS0sbSLR3dL+NqJVqtitWJMdr5+Kl0EsNxa3W8ZYw4cSnM+CtfLaHo8n7uqESqkYcqqSHdPFLJffGO+1/H+zJS82iD1Kdxyb5KHiCtHunkoTh/t4HIR7jawpg9iWO21biD+yXyIpawi1TB95fxez2SVCKvpjWiyesCJ6wvkkosymysfhFTSsL/x76HarqyNPzCDTFbl7XeWtxKalGnqZXj+tgV5bHbC/8HWmK8ePANAAA=");

View File

@@ -1,110 +0,0 @@
if (typeof kotlin === 'undefined') {
throw new Error("Error loading module 'komp'. Its dependency 'kotlin' was not found. Please, check whether 'kotlin' is loaded prior to 'komp'.");
}
if (typeof this['kotlinx-html-js'] === 'undefined') {
throw new Error("Error loading module 'komp'. Its dependency 'kotlinx-html-js' was not found. Please, check whether 'kotlinx-html-js' is loaded prior to 'komp'.");
}
var komp = function (_, Kotlin, $module$kotlinx_html_js) {
'use strict';
var TagConsumer = $module$kotlinx_html_js.kotlinx.html.TagConsumer;
var get_create = $module$kotlinx_html_js.kotlinx.html.dom.get_create_4wc2mh$;
var HashMap_init = Kotlin.kotlin.collections.HashMap_init_q3lmfv$;
function include($receiver, component) {
var tmp$;
var result = component.render_q0cphf$(Kotlin.isType(tmp$ = $receiver.consumer, TagConsumer) ? tmp$ : Kotlin.throwCCE());
component.element = result;
Komp_getInstance().define_eho435$(result, component);
}
function HtmlComponent() {
this.element = null;
}
HtmlComponent.prototype.create = function () {
var elem = this.element;
if (elem != null) {
Komp_getInstance().remove_lt8gi4$(elem);
}
elem = this.render_q0cphf$(get_create(document));
Komp_getInstance().define_eho435$(elem, this);
this.element = elem;
return elem;
};
HtmlComponent.prototype.refresh = function () {
Komp_getInstance().refresh_y4uc7f$(this.element);
};
HtmlComponent.$metadata$ = {
kind: Kotlin.Kind.CLASS,
simpleName: 'HtmlComponent',
interfaces: []
};
function Komp() {
Komp_instance = this;
this.elements_0 = HashMap_init();
}
Komp.prototype.define_eho435$ = function (element, component) {
this.elements_0.put_xwzc9p$(element, component);
};
Komp.prototype.create_og2ns8$ = function (parent, component, insertAsFirst) {
if (insertAsFirst === void 0)
insertAsFirst = false;
var element = component.create();
if (insertAsFirst && parent.childElementCount > 0) {
parent.insertBefore(element, parent.firstChild);
}
else {
parent.appendChild(element);
}
this.elements_0.put_xwzc9p$(element, component);
};
Komp.prototype.remove_lt8gi4$ = function (element) {
this.elements_0.remove_11rb$(element);
};
Komp.prototype.remove = function (component) {
var tmp$_0;
tmp$_0 = this.elements_0.entries.iterator();
while (tmp$_0.hasNext()) {
var tmp$ = tmp$_0.next();
var key = tmp$.key;
var value = tmp$.value;
if (Kotlin.equals(value, component)) {
this.elements_0.remove_11rb$(key);
}
}
};
Komp.prototype.refresh_ap2bc9$ = function (component) {
this.refresh_y4uc7f$(component.element);
};
Komp.prototype.refresh_y4uc7f$ = function (element) {
if (element != null) {
var comp = this.elements_0.get_11rb$(element);
if (Kotlin.isType(element, HTMLElement) && comp != null) {
var parent = element.parentElement;
var newElement = comp.create();
parent != null ? parent.replaceChild(newElement, element) : null;
}
}
};
Komp.$metadata$ = {
kind: Kotlin.Kind.OBJECT,
simpleName: 'Komp',
interfaces: []
};
var Komp_instance = null;
function Komp_getInstance() {
if (Komp_instance === null) {
new Komp();
}
return Komp_instance;
}
var package$nl = _.nl || (_.nl = {});
var package$astraeus = package$nl.astraeus || (package$nl.astraeus = {});
var package$komp = package$astraeus.komp || (package$astraeus.komp = {});
package$komp.include_dqcce7$ = include;
package$komp.HtmlComponent = HtmlComponent;
Object.defineProperty(package$komp, 'Komp', {
get: Komp_getInstance
});
Kotlin.defineModule('komp', _);
return _;
}(typeof komp === 'undefined' ? {} : komp, kotlin, this['kotlinx-html-js']);
//@ sourceMappingURL=komp.js.map

View File

@@ -1 +0,0 @@
// Kotlin.kotlin_module_metadata(1, "komp", "H4sIAAAAAAAAAI1WS3PjRBCWJVkatR+ZKC+vkiW7oQjLQhZXlqJYCg7ZDVQwhKp9QO1VUSa2HHlkRnKSvXLgwHFPOfErOPgXcOcXQY9iy7YSWdZBNZru6a+7p/trKfZDUGzFaVyT/8ZPaWhN1u+JYn8EVTDOwzjwOajdyAZQqQI6UWjJMa4J6idq/5bhLxVUHgBxo1i4bBCBfh72+lA7invBC1yFnPE4taUd8HdgsoD15K4WijZol0890E7DHlSO3hz/9N1IZniCuTEDU7AzwaIO6L9wH7cF46dMAPFCHg16uDJvTF+B3kFIqLxx2y/GMv1H6QsZ4UVQ8cIgYF7sowLA8SB2TwJ27PbB6LtColpe6nLN5xET8UH0vS+iGMznYRgwl4Nxys58zqQnvfCCyfSA0Yp+dnsMdC7fps+9YHDKQDv84Vf7z9Ikd/guURUMolKtoeC+jmudlpO1iVKDEnyb1MJ9QgH3pbyWyClKKnQZd6rUTiQqXWlIyzpdw68luj7Sd0a79/HLph8ku1X6sKE49501+sBRm/BYba7uG7SBa21IlGuiDi1155DsNrR9tVl+rrQMWkGh1SK0Kg8crbfWaV3u7FfpkkNs3cZ1s3a0+6pCDUdvlJrW2z/qaGvn7xL5R23UEzsqUVsPEkuAcBvJ+RHsPsEA7uFqGS1vjjSMaY1W/QY7/aajbzJGbG3TrWmNI/M9qZIVm5BtWyfk0Raa2Jo2/WqNrjr1G+eTt9akb3/XhwTrWQcFO+NzWE/Ltcqu+kz4snjcIK8J9mA1PQAu52HsygLLU9+F2qQdsOzz9D6GeqqnxyyK8xS/hI2pTqqgw2eh6LncYzbNlp48J296DDDTunkAT2BpulWvOmK+4QPYmSTEC0U4iLFhokw255r4EGACmedXE5an/Cqf+QGLikNOTpjnHRHyMDfkTPKvcpO/BVbKQLYudaRUGVpKSqPd3wZMvAN14OcneC1Fq0gGcoUfIUXl6X8F97K0R3zeRWILC67mGTjZk9aYSQty981MmSWEbbALSav2+i2G0yXDydPa0NLk6Q3QZbHdTtFjvMRx7OaJCC+RdPPifoadlnFBG4hgEfxPgKYwhnB5m+Vmdx9WplDMy1CcFyZnE8j4om+HKK9rYrCGBOGf+V5CEgVm7wo4umgvEvAXUzUlZ6gce8konwuYqcR0WObl6lOwU30swZgJnk+UMrGZ4lvAoaVMBubrN6Cc6Of04viXxg8XYvMJeeWpv4YnxVwHgKkR+D/hews1y1P0IZOo4siTErw5dDt47Hoov5R/ULdlWRplsdeZDzUzwroXuSNMTqZMHAbOGuYWhHJX2XvRQqmbub6+CPESYj//+r6GzayH4MZ4VyeDuGiYHML2nR021QgLOPwIC3zWgzxfP8P2GeNZEUOywRGfG5ns/5lRB+VLdtIumLszbDyKaR5CJne63+sXIMg2TPwqdweyHHOMfwuNbAmYOBYjny/Cfs4oBmdp5N+edG+vG/0PIllWXv0MAAA=");

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long