{"version":3,"file":"main.js","sources":["../../node_modules/@lernetz/ts-lib/src/core/lookup/LookupDict.ts","../../node_modules/@lernetz/ts-lib/src/core/js.ts","../../node_modules/@lernetz/ts-lib/src/core/lookup/LookupObject.ts","../../node_modules/tslib/tslib.es6.js","../../node_modules/@lernetz/ts-lib/src/core/view/Renderer.ts","../../node_modules/@lernetz/ts-lib/src/core/lang/Lang.ts","../../node_modules/@lernetz/ts-lib/src/core/signal/Signal.ts","../../node_modules/@lernetz/ts-lib/src/core/node/Node.ts","../../node_modules/@lernetz/ts-lib/src/core/view/expressions/Expression.ts","../../node_modules/@lernetz/ts-lib/src/core/view/expressions/AttributeExpression.ts","../../node_modules/@lernetz/ts-lib/src/core/view/expressions/CSSExpression.ts","../../node_modules/@lernetz/ts-lib/src/core/view/expressions/TextExpression.ts","../../node_modules/@lernetz/ts-lib/src/core/view/expressions/DataAttributeExpression.ts","../../node_modules/@lernetz/ts-lib/src/core/view/expressions/ViewDataExpression.ts","../../node_modules/@lernetz/ts-lib/src/core/view/expressions/ViewExpression.ts","../../node_modules/@lernetz/ts-lib/src/core/view/Template.ts","../../node_modules/@lernetz/ts-lib/src/core/model/Model.ts","../../node_modules/@lernetz/ts-lib/src/core/request/Request.ts","../../node_modules/@lernetz/ts-lib/src/core/ioc/IoC.ts","../../node_modules/@lernetz/ts-lib/src/core/model/Mapper.ts","../../node_modules/@lernetz/ts-lib/src/core/setup/Asset.ts","../../node_modules/@lernetz/ts-lib/src/core/setup/Setup.ts","../../node_modules/@lernetz/ts-lib/src/core/view/View.ts","../../node_modules/@lernetz/ts-lib/src/core/setup/register.ts","../../node_modules/@lernetz/ts-lib/src/components/Html.ts","../../node_modules/@lernetz/ts-lib/src/core/list/List.ts","../../node_modules/@lernetz/ts-lib/src/core/list/ModifiableList.ts","../../node_modules/@lernetz/ts-lib/src/core/list/ListRenderer.ts","../../node_modules/@lernetz/ts-lib/src/components/Repeat.ts","../../typescript/components/util/Image.ts","../../node_modules/@lernetz/ts-lib/src/components/Show.ts","../../typescript/components/util/BackgroundImage.ts","../../typescript/components/util/StaticImage.ts","../../node_modules/@lernetz/lernfragen/templates/choice-quiz.ts","../../node_modules/@lernetz/lernfragen/components/choice-quiz/Toggle.ts","../../node_modules/@lernetz/lernfragen/components/choice-quiz/TextChoice.ts","../../node_modules/@lernetz/lernfragen/components/choice-quiz/ChoiceQuiz.ts","../../node_modules/@lernetz/lernfragen/components/choice-quiz/MultipleChoiceQuiz.ts","../../node_modules/@lernetz/lernfragen/components/choice-quiz/SingleChoiceQuiz.ts","../../typescript/templates/components/quiz-overwrite.ts","../../typescript/components/quiz-overwrite/CustomizedSingleChoiceQuizView.ts","../../typescript/components/quiz-overwrite/CustomizedMultipleChoiceQuizView.ts","../../node_modules/@lernetz/lernfragen/components/cloze-quiz/SelectSpanChoice.ts","../../node_modules/@lernetz/lernfragen/templates/cloze-quiz.ts","../../node_modules/@lernetz/lernfragen/components/cloze-quiz/SelectSpan.ts","../../node_modules/@lernetz/lernfragen/components/cloze-quiz/SelectSpanPlaceholderChoice.ts","../../node_modules/@lernetz/lernfragen/components/cloze-quiz/TextSpan.ts","../../node_modules/@lernetz/lernfragen/components/cloze-quiz/ClozeQuiz.ts","../../node_modules/@lernetz/lernfragen/templates/hot-spot-quiz.ts","../../node_modules/@lernetz/lernfragen/components/hot-spot-quiz/RectangularHotSpotArea.ts","../../node_modules/@lernetz/lernfragen/components/hot-spot-quiz/Spot.ts","../../node_modules/@lernetz/lernfragen/components/hot-spot-quiz/HotSpotQuiz.ts","../../typescript/components/image/ImageModel.ts","../../typescript/templates/components/image.ts","../../typescript/components/quiz-overwrite/ClozeDropDown.ts","../../typescript/components/quiz-overwrite/CustomizedClozeQuizView.ts","../../typescript/components/util/Placeholder.ts","../../typescript/templates/components/storypage.ts","../../typescript/components/page/Page.ts","../../typescript/components/storypage/StoryPage.ts","../../typescript/templates/components/storytext.ts","../../typescript/components/storytext/StoryText.ts","../../typescript/templates/components/storyquiz.ts","../../typescript/components/services/AudioService.ts","../../typescript/components/storyquiz/StoryQuiz.ts","../../typescript/templates/components/storysolution.ts","../../typescript/components/storysolution/StorySolution.ts","../../typescript/templates/components/storyimage.ts","../../typescript/components/storyimage/StoryImage.ts","../../typescript/templates/components/chapter.ts","../../typescript/components/chapter/Chapter.ts","../../typescript/templates/components/footer.ts","../../typescript/components/footer/Footer.ts","../../node_modules/@lernetz/lernfragen/components/quiz/CanShowCorrectness.ts","../../node_modules/@lernetz/lernfragen/components/quiz/index.ts","../../node_modules/@lernetz/lernfragen/components/visitors/ShowCorrectnessOfGivenAnswersQuizVisitor.ts","../../typescript/components/quiz-overwrite/CustomizedShowCorrectnessOfGivenAnswerQuizVisitor.ts","../../typescript/templates/components/quizpresenter.ts","../../typescript/components/quizpresenter/QuizPresenter.ts","../../typescript/templates/components/util.ts","../../typescript/components/util/AudioPlayer.ts","../../typescript/templates/components/startpage.ts","../../typescript/components/startpage/StoryPreview.ts","../../typescript/templates/components/navigation.ts","../../typescript/components/navigation/Navigation.ts","../../typescript/templates/components/dropdown.ts","../../typescript/components/dropdown/DropDown.ts","../../typescript/components/startpage/StartPage.ts","../../typescript/templates/components/singlepage.ts","../../typescript/components/singlepage/SinglePage.ts","../../typescript/templates/components/elements.ts","../../typescript/components/elements/TitleElement.ts","../../typescript/components/elements/ParagraphElement.ts","../../typescript/components/elements/ImageElement.ts","../../typescript/components/elements/ResourceList.ts","../../typescript/components/elements/LinkItem.ts","../../typescript/components/elements/DownloadItem.ts","../../typescript/templates/components/site.ts","../../typescript/components/site/Site.ts","../../typescript/templates/components/solutioninput.ts","../../typescript/components/solutioninput/SolutionInputAnswer.ts","../../typescript/components/solutioninput/SolutionInput.ts","../../typescript/components/multiplechoicecorrect/ChoiceQuizCorrect.ts","../../typescript/components/multiplechoicecorrect/MultipleChoiceCorrectQuiz.ts","../../typescript/templates/components/postcard.ts","../../typescript/components/postcard/Postcard.ts","../../typescript/components/register.ts","../../typescript/Main.ts"],"sourcesContent":["\n/**\n * An interface for any source for the LookupDict\n */\nexport interface LookupSource {\n\tlookup( key:string ):any;\n}\n\n\n/**\n * This class provides a key:value lookup mechanism where multiple sources can be added.\n */\nclass LookupDict {\n\n\tprivate sources:LookupSource[] = [];\n\n\t/**\n\t * Adds a new source to the dictionary to search for keys\n\t */\n\tadd( source:LookupSource ) {\n\t\tthis.sources.push( source );\n\t}\n\n\n\t/**\n\t * Returns the value stored behind the given key in the first of all sources\n\t */\n\tget( key:string, fallback?:string ):any {\n\n\t\tvar result, i, s = this.sources;\n\n\t\t// loop over sources to find key.\n\t\tfor( i = 0; i < s.length; i++ ) {\n\t\t\tresult = s[ i ].lookup( key );\n\t\t\tif( result != null ) return result;\n\t\t}\n\n\t\t// if fallback is provided show that\n\t\tif( fallback !== undefined ) return fallback;\n\n\t\t// not found\n\t\treturn '!{' + key + '}';\n\t}\n}\n\n\n\nexport default LookupDict;\n","/**\n * A collection of js specific helper functions.\n */\n\n/***/\n\n\ntype baseTypes = \"Array\" | \"Object\" | \"String\" | \"Date\" | \"RegExp\" | \"Function\" | \"Boolean\" | \"Number\" | \"Null\" | \"Undefined\";\n\n\n/**\n * Checks if the given input is of any of the given types.\n */\nexport function isType( input:any, checkOn:baseTypes | Array ):boolean {\n\n\t// catch single string input\n\tvar types:Array = ( !Array.isArray( checkOn ) ) ? [ checkOn ] : checkOn;\n\n\t// test on object.\n\tif( types.indexOf( \"Object\" ) >= 0 ) {\n\t\tvar match = input && input.constructor == Object;\n\t\tif( match ) return match;\n\n\t\ttypes.splice( types.indexOf( \"Object\" ), 1 );\n\t}\n\n\t// test anything else\n\tvar inputType = Object.prototype.toString.call( input ).slice(8, -1);\n\treturn types.indexOf( inputType ) >= 0;\n}\n\n\n/**\n * Applies multiple mixins to the given [[extendedClass]].\n * @param extendedClass The object that should receive the mixins.\n */\nexport function mixin( extendedClass: any, mixins: any[] ) {\n\tmixins.forEach( baseCtor => {\n\t\tObject.getOwnPropertyNames( baseCtor.prototype ).forEach( name => {\n\t\t\textendedClass.prototype[name] = baseCtor.prototype[name];\n\t\t});\n\t});\n}\n\n\n/**\n * Merges multiple objects into one. No deep clone.\n * See [`Object.assign()` on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign).\n *\n * Note that in many cases, you can simply use [`...` spread syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax) instead:\n *\n * ```typescript\n * const foo = { foo: 'foo' };\n * const bar = { bar: 'bar' };\n * const foobar = { ...foo, ...bar };\n * ```\n */\nexport function assign( target:{} = {}, ...args:Object[] ) {\n\n\tvar copy = Object( target );\n\n\targs.forEach( ( source ) => {\n\t\tif( source ) {\n\t\t\tfor( var nextKey in source ) {\n\t\t\t\tif( source.hasOwnProperty( nextKey ) ) copy[ nextKey ] = source[ nextKey ];\n\t\t\t}\n\t\t}\n\t});\n\n\treturn copy;\n}\n\n\n/**\n * Shuffles an array.\n * Adapted from: http://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array\n */\nexport function shuffle(array) {\n\tvar i = array.length, t, randomIndex;\n\t// While there remain elements to shuffle...\n\twhile (0 !== i) {\n\t\t// Pick a remaining element...\n\t\trandomIndex = Math.floor(Math.random() * i);\n\t\ti -= 1;\n\t\t// And swap it with the current element.\n\t\tt = array[i];\n\t\tarray[i] = array[randomIndex];\n\t\tarray[randomIndex] = t;\n\t}\n\treturn array;\n}\n\n\n/**\n * Returns all properties including getter/setter recursive in prototype chain.\n */\nexport function getAccessorDescriptors( obj ):{[name:string]:PropertyDescriptor} {\n\tvar props = {};\n\twhile( obj ) {\n\t\tObject.getOwnPropertyNames( obj ).forEach( function( p ) {\n\t\t\tvar desc = Object.getOwnPropertyDescriptor( obj, p );\n\t\t\tif( desc && ( desc.set || desc.get ) ) props[ p ] = desc;\n\t\t});\n\t\tlet prototype = Object.getPrototypeOf( obj );\n\t\tobj = ( prototype !== Object.prototype ) ? prototype : undefined;\n\t}\n\n\treturn props;\n}\n","import { LookupSource } from './LookupDict';\nimport { isType } from '../js';\n\n/**\n * A lookup dictionary source that searches on an object for given keys.\n * It allows to search in nested objects too.\n */\nclass LookupObject implements LookupSource {\n\n\tprivate obj:Object;\n\n\tconstructor( obj:Object ) {\n\t\tthis.replace( obj );\n\t}\n\n\t/**\n\t * lookups in the object for the given key.\n\t */\n\tlookup( key:string ):any {\n\t\tvar keys = key.split( '.' );\n\t\treturn this.search( this.obj, keys );\n\t}\n\n\t/**\n\t * Adds a prefix to the search keys on this object\n\t */\n\tprefix( name:string ):void {\n\t\tvar temp = {};\n\t\ttemp[ name ] = this.obj;\n\t\tthis.obj = temp;\n\t}\n\n\treplace( obj:Object ) {\n\t\tthis.obj = ( isType( obj, 'Object' ) ) ? obj : {};\n\t}\n\n\t/**\n\t * Searches in the given object for the first key in the keys array.\n\t * If there are sub keys it digs deeper into object hierarchy.\n\t */\n\tprivate search = function( current:Object, keys:string[] ) {\n\n\t\tvar top = keys.shift();\n\n\t\t// there are sub keys to search\n\t\tif( keys.length > 0 ) {\n\t\t\treturn ( current[ top ] != undefined ) ? this.search( current[ top ], keys ) : undefined;\n\t\t} else {\n\t\t\treturn current[ top ];\n\t\t}\n\t};\n}\n\nexport default LookupObject;\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","\n/**\n* An interface of the complied template function containing also its source\n*/\ninterface CompliedTemplate {\n\t(...args ):any;\n}\n\ninterface TemplatePass {\n\tregex:RegExp;\n\tmapper:( match:string, inner:string ) => string;\n}\n\n\n/**\n *\n */\nclass Renderer {\n\n\tpublic context:any = { };\n\tpublic logging:boolean = false;\n\n\tpublic pass:TemplatePass = {\n\t\tregex:/\\[\\[([\\s\\S]+?)\\]\\]/g,\n\t\tmapper: function( match, inner ) {\n\t\t\treturn \"function() {\\n try { with( data ) {\\n return \" + inner + \" } } catch (error) { this.log( error ) } }.call( this )\";\n\t\t}\n\t};\n\n\tprivate cache:{} = {};\n\n\t/**\n\t* Renders the given data into the given template string\n\t*/\n\trender( template:string, data:any = {} ):any {\n\t\treturn this.compile(template)( data );\n\t}\n\n\t/**\n\t * Compiles a template string into a template function.\n\t */\n\tcompile( templateString:string, args:string[] = [ 'data' ] ):CompliedTemplate {\n\n\t\t// handle caching\n\t\tif( this.cache[ templateString ] ) return this.cache[ templateString ]\n\n\t\t// check if template is one single [[ .. ]] expression\n\t\tlet matches = templateString.match( /\\[\\[([\\s\\S]+?)\\]\\]/ );\n\t\tif( matches && matches[0] == templateString ) {\n\t\t\tvar source = this.parseValue( templateString );\n\t\t} else {\n\t\t\tvar source = this.parseString( templateString );\n\t\t}\n\n\t\tvar render = new Function( ...args, source ).bind( this.context );\n\n\t\t// store for caching\n\t\tthis.cache[ templateString ] = render;\n\n\t\treturn render;\n\t}\n\n\t/**\n\t\t* Turns the given template into a function body code.\n\t\t*/\n\tparseString( template:string ):string {\n\n\t\ttemplate = template.replace( this.pass.regex, ( match, inner:string ) => {\n\t\t\treturn \"' + this.empty( \" + this.pass.mapper( match, inner ) + \" ) + '\";\n\t\t});\n\n\t\treturn \"return '\" + template + \"';\";\n\t}\n\n\t/**\n\t* Turns the given template into a function body code.\n\t*/\n\tparseValue( template:string ):string {\n\t\t// simply return the inner template content\n\t\treturn template.replace( this.pass.regex, ( match, inner:string ) => {\n\t\t\treturn \"return \" + this.pass.mapper( match, inner ) + \";\";\n\t\t});\n\t}\n\n\t/**\n\t * Tests if the value of the template is empty or not\n\t */\n\tempty( data:any ):string {\n\t\treturn data || data === 0 ? data : '';\n\t}\n\n\t/**\n\t * Logs errors to the console\n\t */\n\tlog( ...params ) {\n\t\tif( !this.logging ) return;\n\n\t\tif( console ) {\n\t\t\t( console.trace ) ? console.trace( ...params ) : console.log( ...params );\n\t\t}\n\t}\n\n\t/**\n\t * Stops the debugger\n\t */\n\tdebug() {\n\t\tdebugger;\n\t}\n}\n\n\nexport var renderer = new Renderer();\nrenderer.context.empty = renderer.empty;\nrenderer.context.log = renderer.log.bind( renderer );\nrenderer.context.debug = renderer.debug;\n\n\nexport default Renderer;\n","import LookupDict from '../lookup/LookupDict';\nimport LookupObject from '../lookup/LookupObject';\nimport { renderer } from '../view/Renderer';\n\n/**\n * A class that handles translation lookups\n */\nclass Lang {\n\n\n\tprivate lookup:LookupDict;\n\n\tconstructor() {\n\t\tthis.lookup = new LookupDict();\n\t}\n\n\t/**\n\t * translates the given key.\n\t */\n\ttranslate( key:string, opts:{ data?:any, condition?:number } = {} ):any {\n\t\tif( key == undefined ) return '';\n\t\tvar def = this.lookup.get( key, key );\n\t\tif( opts.condition != undefined ) def = this.matchCondition( def, opts.condition );\n\t\tif( opts.data ) def = renderer.render( def, opts.data );\n\t\treturn def;\n\t}\n\n\tmatchCondition( value:string, num:number ) {\n\n\t\tvar parts = value.split( '|' );\n\n\t\t// check conditions\n\t\tvar found = this.parseConditions( parts, num )\n\t\tif( found ) return found.trim();\n\n\t\tif( parts.length == 1 ) return this.clearConditions( parts[0] );\n\n\t\t// check simple | split\n\t\treturn this.clearConditions( parts[ ( num == 1 ) ? 0 : 1 ] );\n\t}\n\n\tparseConditions( parts, number:number ):string {\n\t\t// loop over parts\n\t\tfor( var i = 0; i < parts.length; i++ ) {\n\t\t\tvar regex = /^[\\{\\[]([^\\[\\]\\{\\}]*)[\\}\\]](.*)/;\n\t\t\tvar match = regex.exec( parts[i] );\n\n\t\t\t// no proper condition\n\t\t\tif( match == null || match.length != 3 ) continue;\n\n\t\t\tvar value = match[2];\n\t\t\tvar condition = match[1];\n\t\t\tvar num = number;\n\n\t\t\t// range condition\n\t\t\tif( condition.indexOf( ',' ) > -1 ) {\n\n\t\t\t\tvar [ from , to ] = condition.split( ',' );\n\n\t\t\t\tif ( to == '*' && num >= parseInt( from ) ) {\n\t\t\t\t\treturn value;\n\t\t\t\t} else if ( from == '*' && num <= parseInt( to ) ) {\n\t\t\t\t\treturn value;\n\t\t\t\t} else if ( num >= parseInt( from ) && num <= parseInt( to ) ) {\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\n\t\t\t// exact condition\n\t\t\t} else if( parseInt( condition ) == num ) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t}\n\n\tclearConditions( s:string ):string {\n\t\treturn s.replace( /^[\\{\\[]([^\\[\\]\\{\\}]*)[\\}\\]]/, '' ).trim();\n\t}\n\n\tadd( object:Object ) {\n\t\tthis.lookup.add( new LookupObject( object ) );\n\t}\n}\n\n/**\n * Define singleton for Lang\n */\nvar lang = new Lang();\n\n/**\n * Add translation into context\n */\nrenderer.context.trans = lang.translate.bind( lang );\n\nexport default lang;\n","/**\n * This module contains the [[Observable]] interface and its principal implementation, [[Signal]].\n * See https://tc39.es/proposal-observable/ and https://rxjs.dev/ for more in-depth information\n * about observables.\n */\n\n\n/**\n * An [[Observer]] is a callback function that will receive `T` values from a [[Observable]]\n * after it has been [[subscribe]]d to it.\n */\nexport type Observer = (arg: T) => void;\n\n\n/**\n * A subscription gets returned to you when you [[Observable.subscribe]] an [[Observer]] to an [[Observable]].\n * It is via this object that you can [[unsubscribe]] the observer again.\n */\nexport interface Subscription {\n\n\t/**\n\t * Unsubscribes the observer from the [[Observable]] so it will no longer receive its values.\n\t */\n unsubscribe(): void;\n}\n\n\n/**\n * An [[Observable]] is a composable sequence of `T` values that will be *pushed* to observers\n * as they become available. This is the reverse of collections, which allow you to *pull* values\n * out of it via iteration.\n *\n * * `subscription = subscribe(observer)` to start receiving values.\n *\n * * `subscription.unsubscribe()` to stop receiving values.\n *\n * @example\n *\n * ```typescript\n * import {node} from '.../core/node/Node';\n *\n * const clicks = node(document.querySelector('#someElement')).clicks;\n * const subscription = clicks.subscribe(e => console.log('You clicked on ', e.target));\n * ...\n * subscription.unsubscribe();\n * ```\n *\n * @seealso https://tc39.es/proposal-observable/\n * @seealso https://rxjs.dev/\n */\nexport class Observable {\n\n private readonly subscribe_: (observer: Observer) => Subscription;\n\n\t/**\n\t * Initializes a new instance of the [[Observable]] class.\n\t *\n\t * @param subscribe The implementation of the [[subscribe]] method.\n\t */\n public constructor(subscribe: (observer: Observer) => Subscription) {\n this.subscribe_ = subscribe;\n }\n\n\t/**\n\t * Returns a new observable where all values of the original observable are delayed\n\t * as long as new values are pushed to observers. Once there hasn't been a new value for\n\t * `wait` milliseconds, the last value gets pushed.\n\t *\n\t * @param wait The number of milliseconds to wait after the last value before it is pushed.\n\t */\n public debounce(wait: number): Observable {\n return new Observable(observer => {\n let timeout;\n return this.subscribe(arg => {\n const later = () => {\n timeout = null;\n observer(arg);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n });\n });\n }\n\n\t/**\n\t * Gets a new observable containing only the values that fulfill the given predicate `fn`.\n\t * Think [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter).\n\t *\n\t * @param fn A predicate that specifies which values from the original observable to keep.\n\t */\n public filter(fn: (arg: T) => boolean): Observable {\n return new Observable(observer => {\n return this.subscribe(arg => {\n if (fn(arg)) {\n observer(arg);\n }\n });\n });\n }\n\n\t/**\n\t * Gets a new observable where each value has been transformed by the given function `fn`.\n\t * Think [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).\n\t *\n\t * @param fn A function that maps a value to another value.\n\t */\n public map(fn: (arg: T) => U): Observable {\n return new Observable(observer => {\n return this.subscribe(arg => {\n observer(fn(arg));\n });\n });\n }\n\n\t/**\n\t * Subscribes the given `observer` (a callback function) to this observable which will start\n\t * receiving its values. Returns a [[Subscription]] via which you can [[unsubscribe]] the observer.\n\t *\n\t * @param observer The callback function that should receive `T` values from this observable.\n\t */\n public subscribe(observer: Observer): Subscription {\n return this.subscribe_(observer);\n }\n}\n\n\n/**\n * A kind of [[Observable]] that can dispatch `T` values via [[Signal.dispatch]].\n */\nexport class Signal extends Observable {\n\n private observers_?: Observer[];\n\n\t/**\n\t * Initializes a new instance of the [[Signal]] class.\n\t */\n public constructor() {\n super(observer => {\n if (!this.observers_) {\n this.observers_ = [observer];\n }\n else if (this.observers_.indexOf(observer) < 0) {\n this.observers_.push(observer);\n }\n const observers = this.observers_;\n return {\n unsubscribe: () => {\n const index = observers.indexOf(observer);\n if (index >= 0) {\n observers.splice(index, 1);\n }\n }\n };\n });\n this.observers_ = [];\n }\n\n\t/**\n\t * Dispatches the given value `arg` to this signal's observers.\n\t *\n\t * @param arg The value to dispatch to observers.\n\t */\n public dispatch(arg: T) {\n if (this.observers_) {\n for (const observer of [...this.observers_]) {\n observer(arg);\n }\n }\n }\n}\n\n/**\n * Listens to an event target event and creates an observable instance\n * @param el the event target tzo listen to\n * @param event the name of the event to listen to\n */\nexport function observable( event:string, el:EventTarget ):Observable {\n\treturn new Observable( observer => {\n\t\tlet handler = ( event ) => observer( event );\n\t\tel.addEventListener( event, handler );\n\t\treturn {\n\t\t\tunsubscribe:() => {\n\t\t\t\tel.removeEventListener( event, handler );\n\t\t\t}\n\t\t}\n\t});\n}\n","import { Observable, observable } from \"../signal/Signal\";\nimport View from \"../view/View\";\n\n\nexport function node(html: string): NodeWrapper;\nexport function node(view: View): NodeWrapper;\nexport function node(native: Node): NodeWrapper;\nexport function node(arg: string | View | Node): NodeWrapper {\n\tif (typeof arg === 'string') {\n\n\t\t// wrap the content into new node because it can be one root node in template or its content\n\t\tlet temp = document.createElement('div' );\n\t\ttemp.innerHTML = arg;\n\n\t\t// If there is exactly one child the template has one root node - return this one.\n\t\t// otherwise if there are many or no children return the temp div as the root.\n\t\treturn new NodeWrapper( ( temp.children.length == 1 ) ? temp.children[0] : temp );\n\t}\n\telse if (arg instanceof Node) {\n\t\treturn new NodeWrapper( arg as Element );\n\t}\n\telse if ('node' in arg && arg['node'] instanceof Node) {\n\t\treturn new NodeWrapper( arg.node );\n\t}\n\telse {\n\t\treturn null;\n\t}\n}\n\n\nclass NodeWrapper {\n\n\tconstructor( public native:Element ) {}\n\n\tget clicks() {\n\t\treturn observable( 'click', this.native );\n\t}\n\tget scrolls() {\n\t\treturn observable( 'scroll', this.native );\n\t}\n\tget mouseleaves() {\n\t\treturn observable( 'mouseleave', this.native );\n\t}\n\tget mouseenters() {\n\t\treturn observable( 'mouseenter', this.native );\n\t}\n\tget mouseouts() {\n\t\treturn observable( 'mouseout', this.native );\n\t}\n\tget mouseovers() {\n\t\treturn observable( 'mouseover', this.native );\n\t}\n\tget mouseups() {\n\t\treturn observable( 'mouseup', this.native );\n\t}\n\tget mousedowns() {\n\t\treturn observable( 'mousedown', this.native );\n\t}\n\tget mousemoves() {\n\t\treturn observable( 'mousemove', this.native );\n\t}\n\tget keypresses() {\n\t\treturn observable( 'keypress', this.native );\n\t}\n\tget keydowns() {\n\t\treturn observable( 'keydown', this.native );\n\t}\n\tget keyups() {\n\t\treturn observable( 'keyup', this.native );\n\t}\n\tget focuses() {\n\t\treturn observable( 'focus', this.native );\n\t}\n\tget blurs() {\n\t\treturn observable( 'blur', this.native );\n\t}\n\tget changes() {\n\t\treturn observable( 'change', this.native );\n\t}\n\n\t/**\n\t * Removes all element within the native node\n\t */\n\tempty() {\n\t\tfor ( var i = this.native.children.length; i--; ) {\n\t\t\tthis.native.removeChild( this.native.children[i] );\n\t\t}\n\t}\n\n\t/**\n\t * Removes the given element from the dom.\n\t */\n\tremove() {\n\t\tif( this.native.parentElement ) this.native.parentElement.removeChild( this.native );\n\t}\n\n\t/**\n\t * Replaces this native node with the given newNode\n\t * @param newNode The new node to be place on position of the given existingNode\n\t */\n\treplace( newNode:Node ) {\n\t\tthis.native.parentNode.replaceChild( newNode, this.native );\n\t}\n\n\t/**\n\t * Prepends the given node to this node\n\t * @param node the new node to prepend\n\t */\n\tprepend( node:Node ) {\n\t\tthis.native.insertBefore( node, this.native.firstChild );\n\t}\n\n\n\t/**\n\t * Places a node at the given index\n\t * @param node The new node to place\n\t * @param index The index where to place the node\n\t */\n\tinsert( node:Node, index:number ) {\n\t\tthis.native.insertBefore( node, this.native.childNodes[ index ] );\n\t}\n\n\n\t/**\n\t * Check if the classname exists in the classlist of this node\n\t *\n\t * @param classname Classname to be checked\n\t * @return `true` if the class exists, `false` else\n\t */\n\thasClass( classname: string ): boolean {\n\t\treturn this.getClasses().indexOf( classname ) > -1;\n\t}\n\n\n\t/**\n\t * Adds a css class the the class list\n\t * @param name The name of the class to add\n\t */\n\taddClass( name:string ) {\n\t\tthis.setClasses( this.getClasses().concat( [ name ] ) );\n\t}\n\n\t/**\n\t * Removes a class from the list\n\t * @param name The css class to remove\n\t */\n\tremoveClass( name:string ) {\n\t\tthis.setClasses( this.getClasses().filter( current => name != current ) );\n\t}\n\n\t/**\n\t * Toggles a given class name on the node\n\t * @param name the name of the css class to toggle\n\t * @param force a flag to either force to add the class ( true ) or to remove the class (false)\n\t */\n\ttoggleClass( name:string, force?:boolean ) {\n\t\tif( force == undefined ) {\n\t\t\t( this.hasClass( name ) ) ? this.removeClass( name ) : this.addClass( name );\n\t\t} else {\n\t\t\t( force ) ? this.addClass( name ) : this.removeClass( name );\n\t\t}\n\t}\n\n\t/**\n\t * Helper function to set classes distinct\n\t */\n\tprivate setClasses( classList:string[] ) {\n\t\tlet distinct = classList.filter( ( name, index, list ) => name.length > 0 && list.indexOf( name ) === index );\n\t\tthis.native.setAttribute( 'class', distinct.join(' ') );\n\t}\n\n\tprivate getClasses():string[] {\n\t\tlet list = this.native.getAttribute('class');\n\t\treturn ( list ) ? list.split( ' ' ) : [];\n\t}\n\n\n\t/**\n\t * Returns the bounding box of this node including values for top, bottom, left, right relative to the current viewport\n\t */\n\trelativeBounds() {\n\t\tlet c = this.native.getBoundingClientRect();\n\t\tlet r = {  top: c.top, left: c.left, right: c.right, bottom: c.bottom, height: c.height, width: c.width };\n\n\t\tif ( r.height == undefined ) r.height = r.bottom - r.top;\n\t\tif ( r.width == undefined ) r.width = r.right - r.left;\n\n\t\treturn r;\n\t}\n\n\t/**\n\t * Returns the bounding box of this node including values for top, bottom, left, right in absolute document coordinates\n\t */\n\tabsoluteBounds() {\n\t\tlet box = this.relativeBounds();\n\n\t\tbox.top += document.body.scrollTop || document.documentElement.scrollTop;\n\t\tbox.bottom += document.body.scrollTop || document.documentElement.scrollTop;\n\t\tbox.left += document.body.scrollLeft || document.documentElement.scrollLeft;\n\t\tbox.right += document.body.scrollLeft || document.documentElement.scrollLeft;\n\n\t\treturn box;\n\t}\n}\n","import { renderer } from \"../Renderer\";\n\nabstract class Expression {\n\n\tprivate _template:string = \"\";\n\tprivate expressionContent:string;\n\n\tabstract update( data:any, attribute?:string );\n\n\t/**\n\t * Simple test if template has the given attribute in its brankets\n\t * @param name\n\t */\n\thasAttribute( name:string ) {\n\t\tif( name == undefined ) return true;\n\t\treturn this.expressionContent.indexOf( name ) >= 0;\n\t}\n\n\tset template( t:string ) {\n\t\tthis._template = t;\n\t\tthis.expressionContent = '';\n\t\tt.replace( renderer.pass.regex, ( match, inner ) => {\n\t\t\tthis.expressionContent += inner;\n\t\t\treturn '';\n\t\t});\n\t}\n\n\tget template():string {\n\t\treturn this._template;\n\t}\n}\n\nexport function hasExpression( string:string ):boolean {\n\trenderer.pass.regex.lastIndex = 0; // reset global regex\n\treturn renderer.pass.regex.test( string );\n}\nexport function snakeToCamel( string ):string {\n\treturn string.replace( /(\\-\\w)/g, match => match[1].toUpperCase() );\n}\n\nexport function camelToSnake( string ) {\n\treturn string.split(/(?=[A-Z])/).join('-').toLowerCase();\n}\n\nexport default Expression;\n","import Expression from './Expression';\nimport { renderer } from '../Renderer';\nimport { threadId } from 'worker_threads';\n\n\nclass AttributeExpression extends Expression {\n\n\tnode:Element;\n\tattribute:string;\n\ttemplate:string;\n\n\tconstructor( node:Element, attribute:string, template:string ) {\n\t\tsuper();\n\t\tthis.node = node;\n\t\tthis.attribute = attribute;\n\t\tthis.template = template;\n\t}\n\n\tgetValue( data ) {\n\t\treturn renderer.render( this.template, data );\n\t}\n\n\tupdate( data:any, name?:string ) {\n\n\t\t// handle input\n\t\tif( this.node instanceof HTMLInputElement && this.attribute == 'value' ) {\n\t\t\tthis.node.value = this.getValue( data );\n\t\t}\n\n\t\tthis.writeValue( this.getValue( data ) );\n\t}\n\n\twriteValue( value:string ) {\n\t\tthis.node.setAttribute( this.attribute, value );\n\t}\n}\n\nexport default AttributeExpression;\n","import AttributeExpression from './AttributeExpression';\nimport { renderer } from '../Renderer';\nimport { isType } from '../../js';\n\nclass CSSExpression extends AttributeExpression {\n\n\tvalue:string;\n\n\tconstructor( node:Element, template:string ) {\n\t\tsuper( node, 'class', template );\n\t}\n\n\tgetValue( data ) {\n\t\treturn this.template.replace( renderer.pass.regex, ( match ) => {\n\t\t\tlet value = renderer.render( match, data );\n\n\t\t\t// string value simple return\n\t\t\tif( isType( value, 'String' ) ) return value;\n\n\t\t\t// object syntax for classes; filter false values and return keys as string\n\t\t\tif( isType( value, 'Object' ) ) return Object.keys( value ).filter( key => value[key] ).join( ' ' );\n\n\t\t\t// for anything else return empty string\n\t\t\treturn '';\n\t\t});\n\t}\n\n\t/**\n\t * Cache value for css merging\n\t */\n\twriteValue( value:string ) {\n\t\tsuper.writeValue( value );\n\t\tthis.value = value;\n\t}\n}\n\nexport default CSSExpression;\n","import { renderer } from '../Renderer';\nimport Expression from './Expression';\n\nclass TextExpression extends Expression {\n\n\tnode:Node;\n\n\tconstructor( node:Node ) {\n\t\tsuper();\n\t\tthis.node = node;\n\t\tthis.template = node.nodeValue;\n\t}\n\n\tupdate( data:any, name?:string ) {\n\t\tthis.node.nodeValue = renderer.render( this.template, data );\n\t}\n}\n\nexport default TextExpression;\n","import Expression from './Expression';\nimport View from '../View';\nimport { renderer } from '../Renderer';\n\nclass DataAttributeExpression extends Expression {\n\n\ttarget:any;\n\tattribute:string;\n\n\tconstructor( target:any, attribute:string, template:string ) {\n\t\tsuper();\n\t\tthis.template = template;\n\t\tthis.attribute = attribute;\n\t\tthis.target = target;\n\t}\n\n\tupdate( data:any, attribute:string ) {\n\t\tthis.target[ this.attribute ] = renderer.render( this.template, data );\n\t}\n}\n\nexport default DataAttributeExpression;\n","import { renderer } from '../Renderer';\nimport View from '../View';\nimport Expression from './Expression';\nimport ViewExpression from './ViewExpression';\n\nclass ViewDataExpression extends Expression {\n\n\texpression:ViewExpression;\n\ttemplate:string;\n\n\tconstructor( target:ViewExpression, template:string ) {\n\t\tsuper();\n\t\tthis.template = template;\n\t\tthis.expression = target;\n\t}\n\n\tupdate( data:any ) {\n\n\t\t// rerender view\n\t\tthis.expression.renderView( data );\n\t}\n\n\tvalue( data:{} ) {\n\t\treturn renderer.render( this.template, data );\n\t}\n}\n\nexport default ViewDataExpression;\n","import { renderer } from '../Renderer';\nimport { ViewFactory, TemplateContext } from '../Template';\nimport AttributeExpression from './AttributeExpression';\nimport DataAttributeExpression from './DataAttributeExpression';\nimport Expression, { snakeToCamel, hasExpression } from './Expression';\nimport ViewDataExpression from './ViewDataExpression';\nimport { Observable, observable } from '../../signal/Signal';\nimport View from '../View';\nimport CSSExpression from './CSSExpression';\n\nclass ViewExpression extends Expression {\n\n\ttarget:Element;\n\tattributes:{[key:string]:string};\n\texpressions:Expression[];\n\tcontext:TemplateContext;\n\tcontent:string;\n\n\tconstructor( target:Element, context:TemplateContext ) {\n\t\tsuper();\n\t\tthis.target = target;\n\t\tthis.context = context;\n\t\tthis.expressions = [];\n\t\tthis.parseAttributes();\n\t\tthis.template = this.attributes['view'];\n\t\tthis.content = target.innerHTML;\n\t}\n\n\tupdate( data:any, attribute?:string ) {\n\n\t\t// check if we have an expression update of the view attribute\n\t\tif( super.hasAttribute( attribute ) ) {\n\t\t\t// reset if there is already a view rendered\n\t\t\tif( this.target['_lnview'] ) this.reset();\n\t\t\tthis.renderView( data );\n\t\t} else {\n\t\t\t// update expressions only\n\t\t\tthis.expressions.forEach( exp => {\n\t\t\t\tif( exp.hasAttribute( attribute ) ) exp.update( data, attribute );\n\t\t\t});\n\t\t}\n\t}\n\n\trenderView( data ) {\n\n\t\tlet node = this.target;\n\t\tlet cssExpression:CSSExpression;\n\n\t\tlet viewName = this.attributes['view'];\n\n\t\t// if viewname is expression evaluate and write back\n\t\tif( hasExpression( viewName ) ) {\n\t\t\tviewName = renderer.render( viewName, data );\n\t\t}\n\n\t\tnode.removeAttribute( 'view' );\n\t\tnode['_lnname'] = this.getViewName( viewName );\n\n\t\tlet view = this.context.childFactory( viewName );\n\n\t\t// set data if there is any\n\t\tif( this.attributes['data'] ) {\n\t\t\tlet dataExp = new ViewDataExpression( this, this.attributes['data'] );\n\t\t\tview.data = dataExp.value( data );\n\t\t\tthis.expressions.push( dataExp );\n\t\t\tnode.removeAttribute( 'data' );\n\t\t}\n\n\t\t// handle view attributes\n\t\tObject.keys( this.attributes ).forEach( name => {\n\n\t\t\t// ignore special view attribute\n\t\t\tif( name == 'view' || name == 'data' ) return;\n\n\t\t\tlet value = this.attributes[ name ];\n\n\t\t\t// handle events\n\t\t\tif( name.indexOf( 'on-' ) == 0 ) {\n\t\t\t\t// get signal name an subscribe\n\t\t\t\tlet signalName = snakeToCamel( name.replace( 'on-', '' ) );\n\n\t\t\t\t// look on data for signal\n\t\t\t\tif( view.data[ signalName ] instanceof Observable ) {\n\t\t\t\t\tsubscribeTo( view.data[ signalName ], value, data, this.context.view() );\n\t\t\t\t// otherwise register on node signal\n\t\t\t\t} else {\n\t\t\t\t\tsubscribeTo( observable( signalName, node ), value, data, this.context.view() );\n\t\t\t\t}\n\n\t\t\t\tnode.removeAttribute( name );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// helper function to create dataattribute expression\n\t\t\tvar expressions = this.expressions;\n\t\t\tfunction addAttributeExpression( property ) {\n\t\t\t\tlet dataExp = new DataAttributeExpression( view.data, property, value );\n\t\t\t\tdataExp.update( data, null );\n\t\t\t\texpressions.push( dataExp );\n\n\t\t\t\t// remove node attribute\n\t\t\t\tnode.removeAttribute( name );\n\t\t\t}\n\n\t\t\t// handle data-attributes\n\t\t\tif( name.indexOf( 'data-' ) == 0 ) {\n\t\t\t\taddAttributeExpression( snakeToCamel( name.substring( 5 ) ) );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// handle properties on view data\n\t\t\tvar propName = snakeToCamel( name );\n\t\t\tif( view.data instanceof Object && propName in view.data ) {\n\t\t\t\taddAttributeExpression( propName );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// handle class attribute\n\t\t\tif( name == 'class' ) {\n\t\t\t\tcssExpression = new CSSExpression( node, value );\n\t\t\t\tcssExpression.update( data );\n\t\t\t\tif( hasExpression( value ) ) this.expressions.push( cssExpression );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// handle regular node attributes\n\t\t\tif( hasExpression( value ) ) {\n\t\t\t\tlet expr = new AttributeExpression( node, name, value );\n\t\t\t\texpr.update( data );\n\t\t\t\tthis.expressions.push( expr );\n\t\t\t}\n\n\t\t});\n\n\t\tview.render( node );\n\t\tnode.setAttribute( 'view', node['_lnname'] );\n\n\t\t// if no outer expression, nothing to merge\n\t\tif( cssExpression ) {\n\t\t\tthis.mergeCSS( cssExpression, view );\n\t\t}\n\t}\n\n\tparseAttributes() {\n\t\tthis.attributes = {};\n\t\tfor (let i = 0; i < this.target.attributes.length; i++) {\n\t\t\tconst attr = this.target.attributes[i];\n this.attributes[ attr.name ] = attr.value;\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the view=\"...\" expression and all its sub expression have the attribute to update\n\t * @param name The name of the attribute to check if its in expressions\n\t */\n\thasAttribute( name?:string ) {\n\t\tif( super.hasAttribute( name ) ) return true;\n\t\treturn this.expressions.some( expr => expr.hasAttribute( name ) );\n\t}\n\n\n\t/**\n\t * Handles the merging of css from outer tenplate and inner view template on the same node\n\t * @param outer the outer cssexpression\n\t * @param view the inner view that maybe has a css experssion on root node\n\t */\n\tmergeCSS( outer:CSSExpression, view:View ) {\n\n\n\t\tlet innerClass = view.node.getAttribute( 'class' );\n\n\t\t// no change happend - nothing to merge\n\t\tif( innerClass == outer.value ) return;\n\n\t\t// search for inner cssexpression on root node.\n\t\tlet inner = view.template.expressions.filter( exp => exp instanceof CSSExpression && exp.node == view.node )[0] as CSSExpression;\n\t\tif( !inner ) {\n\t\t\t// if no expression was found but change in class -> static expression\n\t\t\tinner = new CSSExpression( view.node, '' );\n\t\t\tinner.value = innerClass;\n\t\t};\n\n\t\t// update mechanism to merge both\n\t\tfunction merge() {\n\t\t\tview.node.setAttribute( 'class', outer.value + ' ' + inner.value );\n\t\t}\n\n\t\t// handle update of one and the other\n\t\tinner.writeValue = function( value ) {\n\t\t\tinner.value = value;\n\t\t\tmerge();\n\t\t}\n\t\touter.writeValue = function( value ) {\n\t\t\touter.value = value;\n\t\t\tmerge();\n\t\t}\n\n\t\t// inital merge of both values.\n\t\tmerge();\n\t}\n\n\t/**\n\t * resets everything for a new rendering.\n\t */\n\treset() {\n\t\t// reset expresions\n\t\tthis.expressions = [];\n\n\t\t// reset attributes\n\t\tObject.keys( this.attributes ).forEach( attr => {\n\t\t\tthis.target.setAttribute( attr, this.attributes[ attr ] );\n\t\t});\n\n\t\t// clear content\n\t\tthis.target.innerHTML = this.content;\n\n\t}\n\n\tgetViewName( key:any ) {\n\t\tif( typeof key == 'string' ) return key;\n\t\tif( typeof key == 'function' ) return key.toString().match(/function\\s(.+)\\(/)[1];\n\t\tif( typeof key == 'object' && key !== null ) return key.constructor.toString().match(/function\\s(.+)\\(/)[1];\n\t\treturn '';\n\t}\n\n}\n\nexport default ViewExpression;\n\n\n/**\n * Helper function to subscribe to signals\n * @param observable the observable to subscribe\n * @param content the string content of the on-... attribute for the oberserver callback\n * @param data the data/viewModel to look callback functions\n */\nexport function subscribeTo( observable:Observable, content:string, data:{}, view:View ) {\n\t// check for valid observable\n\tif( !observable ) return;\n\n\t// event closure\n\tif( hasExpression( content ) ) {\n\n\t\tlet callback = renderer.compile( content, [ 'event','data','view' ] );\n\n\t\tobservable.subscribe( ( event ) => {\n\t\t\tcallback( event, data, view );\n\t\t});\n\n\t// viewModel function\n\t} else if( data[ content ] ) {\n\t\tobservable.subscribe( data[ content ].bind( data ) );\n\t}\n}\n\n","import { node } from '../node/Node';\nimport AttributeExpression from './expressions/AttributeExpression';\nimport CSSExpression from './expressions/CSSExpression';\nimport Expression, { hasExpression, snakeToCamel } from './expressions/Expression';\nimport TextExpression from './expressions/TextExpression';\nimport ViewExpression, { subscribeTo } from './expressions/ViewExpression';\nimport View from './View';\nimport { observable } from '../signal/Signal';\n\n\nexport interface ViewFactory {\n\t( type:string ):View;\n}\n\nexport interface TemplateContext {\n\tdata:() => {},\n\tchildFactory:( type:string ) => View,\n\tview:() => View,\n}\n\n\nclass Template {\n\n\tpublic root:Element;\n\n\tpublic context:TemplateContext;\n\n\tpublic expressions:Array = [];\n\tpublic content:string;\n\n\tconstructor( content:string ) {\n\t\tthis.content = content || '';\n\t}\n\n\trender( target?:Element ) {\n\n\t\t// if there a target node given\n\t\tif( target instanceof Element ) {\n\n\t\t\t// only render if there is content to render\n\t\t\tif( this.content != '' ) {\n\n\t\t\t\t// render temp node to copy inner html\n\t\t\t\tlet temp = node( this.content ).native;\n\t\t\t\ttarget.innerHTML = temp.innerHTML;\n\n\t\t\t\t// apply all attributes on target\n\t\t\t\tfor( let i = 0; i < temp.attributes.length; i++ ) {\n\t\t\t\t\tlet name = temp.attributes[i].name;\n\t\t\t\t\ttarget.setAttribute( name, temp.getAttribute( name ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\ttarget = node( this.content ).native;\n\t\t}\n\n\t\tthis.root = target;\n\n\t\tthis.root['_lnview'] = this.context.view();\n\t}\n\n\tprocessNode( node:Element|Text ) {\n\n\t\t// do not parse script tags\n\t\tif( node.nodeName.toLowerCase() == 'script' ) return;\n\n\t\tif( isText( node ) ) {\n\t\t\tthis.processTextNode( node );\n\t\t\treturn\n\t\t}\n\n\t\tif( node.getAttribute( 'view' ) ) {\n\t\t\tthis.processViewNode( node );\n\t\t\treturn;\n\t\t}\n\n\t\tthis.processAttributes( node );\n\t\tthis.processChildren( node );\n\n\t\tfunction isText( node:ChildNode ): node is Text {\n\t\t\treturn node.nodeType === 3 /* Node.TEXT_NODE */;\n\t\t}\n\t}\n\n\tprocessTextNode( node:Node ) {\n\t\tif( hasExpression( node.nodeValue ) ) {\n\t\t\tlet expr = new TextExpression( node );\n\t\t\tthis.expressions.push( expr );\n\t\t}\n\t}\n\n\tprocessViewNode( node:Element ) {\n\t\tlet expr = new ViewExpression( node, this.context );\n\t\tthis.expressions.push( expr );\n\t}\n\n\tprocessAttributes( node:Element ) {\n\n\t\tfor( let i = 0; i < node.attributes.length; i++ ) {\n\n\t\t\tlet name = node.attributes[i].name;\n\n\t\t\t// handle events\n\t\t\tif( name.indexOf( 'on-' ) == 0 ) {\n\n\t\t\t\t// get signal name an subscribe\n\t\t\t\tlet signalName = snakeToCamel( name.replace( 'on-', '' ) );\n\t\t\t\tsubscribeTo( observable( signalName, node ), node.getAttribute( name ), this.context.data(), this.context.view() );\n\n\t\t\t\t// remove attribute and adjust index so the next attribute won't be skipped\n\t\t\t\tnode.removeAttribute( name );\n\t\t\t\t--i;\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// handle attribute expressions\n\t\t\tif( hasExpression( node.getAttribute( name ) ) ) {\n\n\t\t\t\t// handle css special\n\t\t\t\tlet expr = ( name == 'class' ) ? new CSSExpression( node, node.getAttribute( name ) ) : new AttributeExpression( node, name, node.getAttribute( name ) );\n\t\t\t\tthis.expressions.push( expr );\n\t\t\t}\n\t\t}\n\t}\n\n\tprocessChildren( node:Element ) {\n\t\tfor (let i = 0; i < node.childNodes.length; i++) {\n\t\t\tthis.processNode( node.childNodes[i] );\n\t\t}\n\t}\n\n\n\tupdate( name?:string ) {\n\t\tthis.expressions.forEach( exp => {\n\t\t\tif( exp.hasAttribute( name ) ) exp.update( this.context.data(), name );\n\t\t});\n\t}\n\n\t/**\n\t * Returns the child view within this template.\n\t * @param name The view with the given name\n\t */\n\tfirst( name:string ) {\n\t\tvar node = this.root.querySelector( '[view=' + name + ']' );\n\t\treturn ( node && node[ '_lnview' ] ) ? node[ '_lnview' ] : null;\n\t}\n}\n\nexport default Template;\n\n\n\n\n\n\n\n\n","import { Observable, Signal } from '../signal/Signal';\nimport { isType } from '../js';\n\n\n/**\n * Checks whether the specified object implements [[AttributeChangeObservable]].\n *\n * @param obj The object that should be tested.\n */\nexport function isAttributeChangeObservable( obj:T ):obj is T&AttributeChangeObservable {\n\treturn obj && obj[ 'change' ] instanceof Observable;\n}\n\n\n/**\n * Describes the payload of the [[AttributeChangeObservable.change]] observable.\n */\nexport interface AttributeChange {\n\tname:string,\n\tnewValue:any,\n\toldValue:any\n}\n\n\n/**\n * Types that implement this interface publish all property value changes as an [[Observable]].\n *\n * @see Model is the main implementation of this interface inside the library.\n */\nexport interface AttributeChangeObservable {\n\n\t/**\n\t * Raised when a property's value has changed.\n\t *\n\t * @event\n\t */\n\tchange:Observable;\n}\n\n\n/**\n * A common model class that has getters and setters\n */\nclass Model implements AttributeChangeObservable {\n\n\tprivate _obj:Object;\n\n\t/**\n\t * Raised when a property's value has changed.\n\t *\n\t * @event\n\t */\n\tpublic change:Signal;\n\n\n\tconstructor( obj:Object = {} ) {\n\t\tthis._obj = obj;\n\t\tthis.change = new Signal();\n\t\tthis.generateAccessors();\n\t}\n\n\t/**\n\t * Returns the value of the model with the given key.\n\t * If the key does not exists the given optional fallback value is returned.\n\t * @param key The key on the model to lookup\n\t * @param fallback The fallback value when the key does not exists.\n\t */\n\tget( key:string, fallback:T = undefined ):T {\n\t\tvar value = this._obj[ key ];\n\t\treturn ( value !== undefined ) ? value : fallback;\n\t}\n\n\t/**\n\t * Sets the given value on the given key in the model.\n\t * @param key The key on the model to adjust its value\n\t * @param value The new value to set of the model\n\t */\n\tset( key:string, value:any ) {\n\n\t\tvar isNew = this._obj[ key ] == undefined;\n\t\tvar old = this._obj[ key ];\n\t\tif( old != value ) {\n\t\t\tthis._obj[ key ] = value;\n\t\t\tthis.change.dispatch( { name:key, newValue:value, oldValue: old } );\n\t\t}\n\t\tif( isNew ) this.generateAccessors();\n\t}\n\n\t/**\n\t * Return a clone of this object\n\t */\n\tpublic object():any{\n\t\tvar obj = {};\n\t\tfor( var attr in this._obj ){\n\t\t\tobj[attr] = this._obj[attr];\n\t\t}\n\t\treturn obj;\n\t}\n\n\t/**\n\t * Syncs the attributes of this model with the given object attributes\n\t * It only syncs builtin types. other types have to sync manually.\n\t */\n\tpublic sync( obj:any ) {\n\t\tfor( var property in obj ) {\n\t\t\tif( isType( obj[property], [ \"String\", \"Date\", \"Boolean\", \"Number\" ] ) ) {\n\t\t\t\tthis.set( property, obj[property] );\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate generateAccessors() {\n\n\t\tvar createProperty = ( name ) => {\n\t\t\tObject.defineProperty( this, name, {\n\t\t\t\tget() {\n\t\t\t\t\treturn this.get( name );\n\t\t\t\t},\n\t\t\t\tset( value ) {\n\t\t\t\t\tthis.set( name, value );\n\t\t\t\t},\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true\n\t\t\t});\n\t\t}\n\n\t\tfor( var attr in this._obj ){\n\t\t\tif( !( attr in this ) )\tcreateProperty( attr );\n\t\t}\n\t}\n}\n\nexport default Model;\n","import { Signal } from \"../signal/Signal\";\n\n\ninterface ProgressSignal {\n\tloaded:number,\n\ttotal:number\n}\n\n/**\n * HttpRequest Class\n */\n\nexport class HttpRequest {\n\n\tprotected _method:string = 'GET';\n\tprotected _url:string;\n\tprotected _headers:{} = null;\n\tprotected request:XMLHttpRequest;\n\n\t/** @event */\n\tpublic progress:Signal = new Signal();\n\n\n\t/**\n\t * Create a new instance with the given url\n\t * @param url\n\t */\n\tconstructor( url:string ) {\n\t\tthis._url = url;\n\n\t\tthis.request = new XMLHttpRequest();\n\t\tthis.request.onprogress = ( event ) => {\n\t\t\tthis.progress.dispatch( event );\n\t\t}\n\t}\n\n\t/**\n\t * Set the method for the request\n\t * @param method\n\t */\n\tpublic method( method:string ):HttpRequest {\n\t\tthis._method = method;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Set the headers for the request\n\t * @param headers\n\t */\n\tpublic headers( headers:{} ):HttpRequest {\n\t\tthis._headers = headers;\n\t\treturn this\n\t}\n\n\t/**\n\t * Send/Load the request without sending data\n\t */\n\tpublic load():Promise {\n\t\treturn this.sendRequest().then( this.parseJson );\n\t}\n\n\t/**\n\t * Send the request with the given data\n\t * @param data\n\t */\n\tpublic send( data:any ):Promise {\n\t\treturn this.sendRequest( data ).then( this.parseJson );\n\t}\n\n\tpublic url():string {\n\t\treturn this._url;\n\t}\n\n\t/**\n\t * Open and send the request with the given parameters\n\t * and data\n\t * @param data\n\t */\n\tprivate sendRequest( data:any = null ):Promise {\n\n\t\tvar request = this.request;\n\t\tvar promise = this.promise( request );\n\n\t\trequest.open( this._method, this._url );\n\n\t\tfor( var key in this._headers ){\n\t\t\trequest.setRequestHeader( key, this._headers[key] );\n\t\t}\n\n\t\trequest.send( data );\n\n\t\treturn promise;\n\t}\n\n\t/**\n\t * Create a promise with the request\n\t * The promise resolves in case of a successful request - jejects otherwise\n\t */\n\tprivate promise( request:XMLHttpRequest ) {\n\t\treturn new Promise( ( resolve, reject ) => {\n\n\t\t\tvar errorHandler = function() {\n\t\t\t\tRequest.error.dispatch( { error: request.statusText } );\n\t\t\t\treject( Error( request.statusText ) );\n\t\t\t}\n\n\t\t\trequest.onload = function() {\n\t\t\t\tif( request.status >= 200 && request.status < 300 ) {\n\t\t\t\t\tresolve( request.responseText );\n\t\t\t\t} else {\n\t\t\t\t\terrorHandler();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\trequest.onerror = errorHandler;\n\t\t});\n\t}\n\n\t/**\n\t * tries to parse response otherwise returns original string data\n\t */\n\tprivate parseJson( data:string ):string|{} {\n\t\ttry {\n\t\t\tdata = JSON.parse( data )\n\t\t\treturn data;\n\t\t} catch( e ) {\n\t\t\treturn data;\n\t\t}\n\t}\n}\n\ninterface ErrorSignal {\n\terror:string\n}\n\n/**\n * Static Request Class\n */\nexport class Request {\n\n\t/** @event */\n\tpublic static error:Signal = new Signal();\n\t/**\n\t * Creates a new post HttpRequest\n\t */\n\tpublic static post( url:string ):HttpRequest{\n\t\treturn new HttpRequest( url ).method( 'POST' );\n\t}\n\n\t/**\n\t * Creates a new get HttpRequest\n\t */\n\tpublic static get( url:string ):HttpRequest{\n\t\treturn new HttpRequest( url ).method( 'GET' );\n\t}\n\n\t/**\n\t * Creates a new put HttpRequest\n\t */\n\tpublic static put( url:string ):HttpRequest{\n\t\treturn new HttpRequest( url ).method( 'PUT' );\n\t}\n\n\t/**\n\t * Creates a new delete HttpRequest\n\t */\n\tpublic static delete( url:string ):HttpRequest{\n\t\treturn new HttpRequest( url ).method( 'DELETE' );\n\t}\n}\n\n\nexport default Request;\n","/**\n * A class to register closure functions under a given key\n * ...\n */\nclass IoC{\n\n\tprivate map:{ [index:string]: T };\n\n\tconstructor(){\n\t\tthis.map = {};\n\t}\n\n\t/**\n\t * Registers the given closure under the given key\n\t * @param key The key to register the closure\n\t * @param closure The closure function\n\t */\n\tpublic add( key:string, closure:T ){\n\t\tthis.map[ key ] = closure;\n\t}\n\n\t/**\n\t * Returns the registered closure under the given key\n\t * @param key The key of registerd closure to look for\n\t * @return The closure under the given key or undefined, if\n\t * the key does not exist\n\t */\n\tpublic get( key:string ):T{\n\t\tvar tmp = this.map[ key ];\n\t\ttmp = ( tmp ) ? tmp : this.map[ 'default' ];\n\n\t\tif( !tmp ) throw new Error( \"No key with name: '\" + key + \"' is registered and no default fallback is defined on ioc.\" );\n\n\t\treturn tmp;\n\t}\n\n\t/**\n\t * Returns this key is registered allready\n\t * @param key The key to check if it is registered allready\n\t */\n\tpublic has( key:string ):boolean{\n\t\treturn this.map[ key ] != undefined;\n\t}\n\n\t/**\n\t * Returns all registered keys\n\t * @return Array of all the registered keys\n\t */\n\tpublic keys():string[] {\n\t\treturn Object.keys( this.map );\n\t}\n\n\t/**\n\t * Creates an alias for an already registered closure\n\t * @param newName The alias name\n\t * @param oldName The name of the already registered function\n\t */\n\tpublic alias( newName:string, oldName:string ) {\n\t\tthis.map[ newName ] = this.map[ oldName ];\n\t}\n\n\t/**\n\t * Renames an already registered closure to a new name\n\t * @param newName The new name\n\t * @param oldName The old registered name\n\t */\n\tpublic rename( newName:string, oldName:string ) {\n\t\tthis.alias( newName, oldName );\n\t\tdelete this.map[ oldName ];\n\t}\n}\n\nexport default IoC;\n","import IoC from '../ioc/IoC';\nimport Model from './Model';\nimport { isType } from '../js';\n\nexport interface ModelConstructor {\n\tnew( json:Object ):T;\n}\n\nexport interface ModelFactoryFunction {\n\t( json:Object ):T\n}\n\nexport interface JsonFactoryFunction {\n\t( model:Model ):Object\n}\n\n/**\n * A class that helps to map models on a json structure\n */\nclass Mapper {\n\n\tpublic toModel:IoC = new IoC();\n\tpublic toJson:IoC = new IoC();\n\n\tpublic jsonLookup:( json:Object ) => string;\n\tpublic modelLookup:( model:Model ) => string;\n\n\n\tconstructor() {\n\n\t\t// setup default json to model conversion.\n\t\tthis.toModel.add( 'default', function( json:Object, data?:any ) {\n\t\t\treturn json;\n\t\t});\n\n\t\t// setup default model to json conversion\n\t\tthis.toJson.add( 'default', function( model:Model, data?:any ) {\n\t\t\treturn model;\n\t\t});\n\n\t\t// setup default lookup function for json\n\t\tthis.jsonLookup = function( json:Object ) {\n\t\t\treturn json[\"modelName\"];\n\t\t}\n\n\t\t// setup default lookup function for models\n\t\tthis.modelLookup = function( model:Model ) {\n\t\t\treturn ( model instanceof Model ) ? model.get( 'modelName' ) : 'default';\n\t\t}\n\t}\n\n\n\tpublic model( json:any ) {\n\n\t\t// if primitive type is given simply return it\n\t\tif( isType( json, [ \"String\", \"Date\", \"RegExp\", \"Function\", \"Boolean\", \"Number\", \"Null\", \"Undefined\" ] ) ) {\n\t\t\treturn json;\n\t\t}\n\n\t\t// if json array is given map each\n\t\tif( isType( json, \"Array\" ) ) {\n\t\t\treturn ( json as Array ).map( ( item ) => {\n\t\t\t\treturn this.model( item );\n\t\t\t});\n\t\t}\n\n\t\t// Object given make recursion over keys\n\t\tObject.keys( json ).forEach( ( name ) => {\n\t\t\tvar value = json[ name ];\n\n\t\t\t// only follow object or array references\n\t\t\tif( isType( value, [ \"Object\", \"Array\" ] ) ) json[ name ] = this.model( value );\n\t\t});\n\n\t\t// Finally turn object into model with ioc\n\t\treturn this.toModel.get( this.jsonLookup( json ) )( json );\n\t}\n\n\n\tpublic json( model:any ) {\n\n\t\t// if primitive type is given simply return it\n\t\tif( isType( model, [ \"String\", \"Date\", \"RegExp\", \"Function\", \"Boolean\", \"Number\", \"Null\", \"Undefined\" ] ) ) {\n\t\t\treturn model;\n\t\t}\n\n\t\t// if json array is given map each\n\t\tif( isType( model, \"Array\" ) ) {\n\t\t\treturn ( model as Array ).map( ( item ) => {\n\t\t\t\treturn this.json( item );\n\t\t\t});\n\t\t}\n\n\t\t// try to convert it with ioc\n\t\tmodel = this.toJson.get( this.modelLookup( model ) )( model );\n\n\t\t// if object given make recursion over keys\n\t\tObject.keys( model ).forEach( ( name ) => {\n\t\t\tmodel[ name ] = this.json( model[ name ] );\n\t\t});\n\n\t\t// any other types simply return\n\t\treturn model;\n\t}\n}\n\nexport var mapper = new Mapper();\n\nexport default Mapper;\n","\nexport interface AssetConfig {\n\turl: string,\n\ttype?: \"js\" | \"css\",\n}\n\nexport class Asset {\n\n\t// store which assets are already loaded.\n\tstatic promises:{ [index:string]: Promise } = {};\n\n\tconfig:AssetConfig;\n\n\n\tconstructor( config:AssetConfig ) {\n\t\tif( !config.type ) config.type = this.guessType( config.url );\n\t\tthis.config = config;\n\t}\n\n\n\tload():Promise {\n\n\t\t// if not loaded create promise\n\t\tif( !Asset.promises[ this.config.url ] ) {\n\t\t\t( this.config.type == \"js\" ) ? this.loadScript() : this.loadCSS();\n\t\t}\n\n\t\treturn Asset.promises[ this.config.url ];\n\t}\n\n\t/**\n\t * Loads a js file into dom\n\t */\n\tprivate loadScript() {\n\n\t\tvar url = this.config.url;\n\n\t\tAsset.promises[ url ] = new Promise( function( resolve, reject ) {\n\t\t\tvar element = document.createElement( 'script' );\n\t\t\telement.src = url;\n\t\t\telement.addEventListener( 'load', resolve );\n\t\t\telement.addEventListener( 'error', reject );\n\t\t\tdocument.body.appendChild( element );\n\t\t}).then( function( event:Event ) {\n\t\t\tthis.finalize( url );\n\t\t\treturn event;\n\t\t}.bind( this ));\n\t}\n\n\t/**\n\t * Loads a css file into the dom\n\t */\n\tprivate loadCSS() {\n\n\t\tvar url = this.config.url;\n\n\t\tAsset.promises[ url ] = new Promise( function( resolve, reject ) {\n\t\t\tvar element = document.createElement( 'link' );\n\t\t\telement.type = 'text/css';\n\t\t\telement.rel = 'stylesheet';\n\t\t\telement.href = url;\n\t\t\telement.addEventListener( 'load', resolve );\n\t\t\telement.addEventListener( 'error', reject );\n\t\t\tdocument.head.appendChild( element );\n\t\t}).then( function( event:Event ) {\n\t\t\tthis.finalize( url );\n\t\t\treturn event;\n\t\t}.bind( this ));\n\t}\n\n\tprivate finalize( url:string ) {\n\t\tAsset[ url ] = new Promise( function( resolve, reject ) { resolve() } );\n\t}\n\n\t/**\n\t * Guesses the type based on the given url\n\t */\n\tprivate guessType( url:string ):\"js\"|\"css\" {\n\n\t\tif( url.split('.').pop() == \"js\" ) return \"js\";\n\t\tif( url.split('.').pop() == \"css\" ) return \"css\";\n\n\t\treturn \"js\";\n\t}\n}\n\nexport default Asset;\n","import LookupObject from '../lookup/LookupObject';\nimport { HttpRequest } from '../request/Request';\nimport { mapper } from '../model/Mapper';\nimport Asset from './Asset';\nimport { renderer } from '../view/Renderer';\n\nexport interface SetupConfig {\n\troutes?:{ [key:string]:{ url:string, method?:string, headers?:string } },\n\tdata?:{ [key:string]:{} },\n\tassets?:{ [key:string]:{ url:string, type?:'js'|'css' } },\n}\n\n/**\n * A class that manages external routes, data and assets.\n */\nexport class Setup {\n\n\tprivate lookup:LookupObject;\n\n\tconstructor() {\n\t\tthis.lookup = new LookupObject( { data:{}, assets:{}, routes:{} } );\n\t}\n\n\tinit( data:SetupConfig ) {\n\t\tthis.lookup.replace( data );\n\t\tmapper.model( data.data );\n\t\trenderer.context.setup = this;\n\t}\n\n\t/**\n\t * Returns a request that can load an save data to the url defined in the configuration\n\t * @param key The key under the routes definition\n\t * @param urlParams The parameters for the url\n\t */\n\troute( key:string, urlParams:{} = {} ):HttpRequest {\n\n\t\tvar config = this.search( \"routes.\" + key );\n\t\tvar url = renderer.render( config.url, urlParams );\n\t\tvar request = new HttpRequest( url );\n\n\t\tif( config.method ) request.method( config.method );\n\t\tif( config.headers ) request.headers( config.headers );\n\n\t\treturn request;\n\t}\n\n\t/**\n\t * Returns any data that is defined under the data configuration\n\t */\n\tdata( key?:string ):any {\n\t\tif( key === undefined ) return this.search( 'data' );\n\t\treturn this.search( \"data.\" + key );\n\t}\n\n\t/**\n\t * Returns a asset loader that can load additional scripts and css files.\n\t */\n\tasset( key:string ):Asset {\n\t\treturn new Asset( this.search( \"assets.\" + key ) );\n\t}\n\n\tprivate search( key ):any {\n\t\tvar config = this.lookup.lookup( key );\n\t\tif( typeof config === 'undefined' ) throw new Error( \"Could not find definition for api with key: \" + key );\n\t\treturn config;\n\t}\n}\n\n\nexport var setup = new Setup();\nexport default Setup;\n","import Template from './Template';\nimport { isAttributeChangeObservable } from '../model/Model';\nimport { setup } from '../setup/Setup';\nimport { renderer } from './Renderer';\n\n\n/**\n * This is one of the three [[ViewRegistration]] forms. It's the simplest form when you already have\n * a view class whose constructor does not take any parameters.\n *\n * @example\n *\n *```typescript\n * import register from '.../core/setup/register';\n * class AppView extends View {\n * constructor() { ... }\n * ...\n * }\n * register(({ view }) => view('App', AppView));\n * // ^^^^^^^\n *```\n */\nexport interface ViewConstructor {\n\tnew( config:ViewConfig ):View;\n}\n\n\n/**\n * This is one of the three [[ViewRegistration]] forms. This allows you to specify some common aspects\n * of a `View` class (such as its HTML `template`) without actually writing one. This is mostly useful\n * for `View`s that only need a template but no further logic.\n *\n * @example\n *\n *```typescript\n * import register from '.../core/setup/register';\n * register(({ view }) => view('App', { template: `...`, ... }));\n * // ^^^^^^^^^^^^^^^^^^^^^^^^\n *```\n */\nexport interface ViewDefinition {\n\ttemplate:string;\n\tregistrations?:ViewRegistrations|ViewRegistrationMap;\n\tgetData?():TData;\n\tinit?( this: View ):void;\n\tupdate?( this:View, name?:string ):void;\n}\n\n\n/**\n * This is one of the three [[ViewRegistration]] forms. This allows you to specify how a `View`\n * class should be instantiated.\n */\nexport interface ViewFactory {\n\t( key:unknown ):View;\n}\n\n\n/**\n * This type represents view registrations. These can be passed e.g. to:\n *\n * * [[\"core/setup/register\".RegistrationsBuilder.view]]\n * * [[ViewRegistrationMap.set]]\n * * or be stored as the values in a [[ViewRegistrations]] object.\n */\nexport type ViewRegistration = ViewConstructor|ViewDefinition|ViewFactory;\n\nexport interface ViewRegistrations {\n\t[ name:string ]:ViewRegistration;\n}\n\nexport class ViewRegistrationMap {\n\n\tpublic static union( others:(ViewRegistrations|ViewRegistrationMap)[] ):ViewRegistrationMap {\n\t\tconst union = new ViewRegistrationMap();\n\t\tfor( const other of others ) {\n\t\t\tunion.merge( other );\n\t\t}\n\t\treturn union;\n\t}\n\n\tprivate readonly _map: Map;\n\n\tpublic constructor() {\n\t\tthis._map = new Map();\n\t}\n\n\tpublic forEach( callback:( registration:ViewRegistration, key:unknown ) => void ):void {\n\t\tthis._map.forEach( callback );\n\t}\n\n\tpublic get( key:unknown ):ViewRegistration {\n\t\t// also search if there is a constructor registration\n\t\treturn this._map.get( key ) || (typeof key === 'object' && this._map.get( key.constructor ) );\n\t}\n\n\tpublic has( key:unknown ):boolean {\n\t\treturn this._map.get( key ) != undefined;\n\t}\n\n\tpublic merge( registrations:ViewRegistrations|ViewRegistrationMap ):ViewRegistrationMap {\n\t\tif( registrations instanceof ViewRegistrationMap ) {\n\t\t\tregistrations.forEach( ( registration, key ) => this.set( key, registration ) );\n\t\t}\n\t\telse {\n\t\t\tfor( const key in registrations ) {\n\t\t\t\tthis.set( key, registrations[ key ] );\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\tpublic set( key:unknown, registration:ViewRegistration ):ViewRegistrationMap {\n\t\tthis._map.set( key, registration );\n\t\treturn this;\n\t}\n}\n\n/** @ignore */\nfunction convertToViewFactory( registration:ViewRegistration ):ViewFactory {\n\n\tif( isViewDefinition( registration ) ) {\n\t\tconst viewClass = class extends View {};\n\t\tif( registration.init ) {\n\t\t\tviewClass.prototype['init'] = registration.init;\n\t\t}\n\t\tif( registration.update ) {\n\t\t\tviewClass.prototype['update'] = registration.update;\n\t\t}\n\t\treturn () => new viewClass({ ...registration, data:registration.getData && registration.getData() });\n\t}\n\telse if( isViewConstructor( registration ) ) {\n\t\treturn () => new registration({});\n\t}\n\telse {\n\t\treturn registration;\n\t}\n\n\tfunction isViewDefinition( registration:ViewRegistration ):registration is ViewDefinition {\n\t\treturn typeof registration === 'object';\n\t}\n\n\tfunction isViewConstructor( registration:ViewConstructor|ViewFactory ):registration is ViewConstructor {\n\t\tfor ( let proto = Object.getPrototypeOf( registration ); proto; proto = Object.getPrototypeOf( proto ) ) {\n\t\t\tif( proto === View ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}\n\n\n/** @ignore */\nconst registrations = new ViewRegistrationMap();\n\n\n/**\n * @deprecated Use local view registrations instead, i.e. pass them either to a `View` constructor, or to the `scan` function.\n * @ignore\n */\nexport const ioc = new class {\n\n\t/** Deprecated. Use `ioc[name] = factory` instead.\n\t * @deprecated\n\t */\n\tpublic add( name:string, factory:ViewFactory ):void {\n\t\tregistrations.set( name, factory );\n\t}\n\n\t/** Deprecated. Use `ioc[name]` instead.\n\t * @deprecated\n\t*/\n\tpublic has( name:string ):boolean {\n\t\treturn registrations.has( name );\n\t}\n\n\t/** Deprecated. Use `name in ioc` instead.\n\t * @deprecated\n\t*/\n\tpublic get( name:string ):ViewRegistration {\n\t\treturn registrations.get( name );\n\t}\n};\n\n\n/**\n * Registers the `View` class specified by `constructor` under the given `key`\n * such that it can be instantiated in templates using e.g. `
`.\n *\n * ### Example:\n *\n * @example\n```typescript\n class Foo extends View { ... }\n register('Foo', Foo);\n```\n *\n * Once thus registered, you will be able to instantiate `Foo` in templates e.g. as follows:\n *\n```html\n
\n```\n *\n * @param key The key (e.g. a name) under which the ad-hoc `View` class should be registered.\n * @param constructorOrFactory The `View` class, or a parameterless closure (of type `ViewFactory`) that creates a `View` instance, to associate with `key`.\n *\n * @deprecated Use local view registrations instead, i.e. pass them either to a `View` constructor, or to the `scan` function.\n * @ignore\n */\nexport function register( key:unknown, constructorOrFactory:ViewConstructor|ViewFactory );\n\n/**\n * Registers an ad-hoc `View` class created from the specified `definition` under the given `key`\n * such that it can be instantiated in templates using e.g. `
`.\n *\n * For simple views, this overload can spare you the work of writing a full-blown class.\n *\n * ### Example:\n *\n * @example\n```typescript\n register('Foo', {\n template: `
Greetings, [[name]].
`,\n data: {\n name: 'stranger'\n }\n });\n```\n *\n * Once thus registered, you will be able to instantiate `Foo` in templates e.g. as follows:\n *\n```html\n
\n```\n *\n * ### Remarks:\n *\n * Note that data binding will not work for the above component because `data` is a plain object\n * whose properties will not dispatch `change` signals. If you want data binding to work,\n * set `data` to an instance of `Model` instead of a plain object.\n *\n * @param key The key (e.g. a name) under which the ad-hoc `View` class should be registered.\n * @param definition Definition of the ad-hoc `View` class. You must specify at least its `template`.\n *\n * @deprecated Use local view registrations instead, i.e. pass them either to a `View` constructor, or to the `scan` function.\n * @ignore\n */\nexport function register( key:unknown, definition:ViewDefinition );\n\n/**\n * Registers the specified view registrations.\n *\n * @param registrations The registrations to register.\n *\n * @deprecated Use local view registrations instead, i.e. pass them either to a `View` constructor, or to the `scan` function.\n * @ignore\n */\nexport function register( registrations:ViewRegistrationMap|ViewRegistrations ):void;\n\nexport function register( keyOrRegistrations:ViewRegistrationMap|ViewRegistrations|unknown, registration?:ViewRegistration ) {\n\n\tif( !registration ) {\n\t\tif( keyOrRegistrations instanceof ViewRegistrationMap ) {\n\t\t\tkeyOrRegistrations.forEach( ( registration, key ) => {\n\t\t\t\tregister( key, registration );\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tconst registrations = keyOrRegistrations;\n\t\t\tfor( const key in registrations ) {\n\t\t\t\tregister( key, registrations[ key ] );\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\tregistrations.set( keyOrRegistrations, registration );\n\t}\n}\n\nexport function scan( root:Element, ...registrations:(ViewRegistrations|ViewRegistrationMap)[] ) {\n\tvar temp = new View( { data:setup.data(), registrations: ViewRegistrationMap.union( registrations ) } );\n\ttemp.render( root );\n}\n\nexport interface ViewConfig {\n\tdata?:TData,\n\tregistrations?:ViewRegistrations|ViewRegistrationMap,\n\ttemplate?:string\n}\n\n/**\n * A common view class that has a container to render content/template into.\n */\nexport class View {\n\n\tprotected _data:TData;\n\n\tpublic template:Template;\n\tpublic parent:View<{}>;\n\tpublic readonly registrations:ViewRegistrations|ViewRegistrationMap;\n\n\tconstructor( config:ViewConfig ) {\n\n\t\tthis.registrations = config.registrations;\n\n\t\tthis.template = new Template( config.template );\n\t\tthis.template.context = {\n\t\t\tdata: () => this._data,\n\t\t\tchildFactory: this.createChild.bind( this ),\n\t\t\tview: () => this,\n\t\t}\n\n\t\tthis._data = config.data;\n\t}\n\n\n\t/**\n\t * Renders the view template.\n\t * If an empty target is given, the template is rendered into to given target.\n\t * If the target is not empty, the content of the target is used as the template.\n\t */\n\tpublic render( target?:Element ) {\n\n\t\t// do rendering of template\n\t\tthis.template.render( target );\n\t\tthis.template.processNode( this.template.root );\n\t\tthis.template.update();\n\n\t\t// register databinding if model is given\n\t\tif( isAttributeChangeObservable( this.data ) ) {\n\t\t\tthis.data.change.subscribe( ( change ) => {\n\t\t\t\tthis.update( change.name );\n\t\t\t});\n\t\t}\n\n\t\t// everything is ready now we can invoke view's init\n\t\tthis.init();\n\t}\n\n\t/**\n\t * The init function is automatically called after the render function.\n\t * So everything is rendered and the node is ready to be used.\n\t * Overwrite the init function for custom dom manipulations.\n\t */\n\tprotected init() {\n\n\t}\n\n\t/**\n\t * Returns the root node of the view\n\t */\n\tpublic get node():Element {\n\t\treturn this.template.root;\n\t}\n\n\t/**\n\t * Updates the view if data attribute has changed\n\t */\n\tpublic update( name?:string ) {\n\t\tthis.template.update( name );\n\t}\n\n\tpublic child( name:string ):T {\n\t\treturn this.template.first( name ) as T;\n\t}\n\n\tpublic createChild( type:unknown ) {\n\t\tvar view = convertToViewFactory( this.resolve( type ) )( type );\n\t\tview.parent = this;\n\t\treturn view;\n\t}\n\n\tset data( data:TData ) {\n\t\tthis._data = data;\n\t}\n\tget data():TData {\n\t\treturn this._data;\n\t}\n\n\tprivate resolve( type:unknown ):ViewRegistration {\n\t\ttry {\n\t\t\t// Recursive lookup is done in a separate method (`resolveRecursive`)...\n\t\t\treturn this.resolveRecursive( type );\n\t\t}\n\t\tcatch (e) {\n\t\t\t// ... so that we can throw an error that mentions the original `type`\n\t\t\t// instead of always \"default\" (which is the last thing a recursive\n\t\t\t// lookup would be looking for, but not informative at all):\n\t\t\trenderer.log( 'Registration ', type, ' not found in View', this );\n\t\t\tthrow new ViewRegistrationNotFoundError( type );\n\t\t}\n\t}\n\n\tprivate resolveRecursive( type:unknown ):ViewRegistration {\n\t\tlet local = this.getRegistration( type );\n\t\tif( local ) return local;\n\n\t\t// lookup parent view\n\t\tif( this.parent ) return this.parent.resolveRecursive( type );\n\n\t\t// lookup global registry\n\t\tlet global = registrations.get( type );\n\t\tif( global ) return global;\n\n\t\t// default lookup\n\t\tif( type !== 'default' ) return this.resolveRecursive( 'default' );\n\n\t\tthrow new ViewRegistrationNotFoundError( type );\n\t}\n\n\n\tprivate getRegistration( key:unknown ):ViewRegistration {\n\n\t\tif( !this.registrations ) return undefined;\n\n\t\tif( this.registrations instanceof ViewRegistrationMap ) {\n\t\t\treturn this.registrations.get( key );\n\t\t} else {\n\t\t\t// old object lookup case\n\t\t\treturn this.registrations[ key ];\n\t\t}\n\t}\n}\n\n\n/** @ignore */\nclass ViewRegistrationNotFoundError extends Error {\n\n\tpublic constructor( public readonly key:unknown ) {\n\t\tsuper( `There is no view registration for the given key ${JSON.stringify( key )}, nor is there a \"default\" fallback.` );\n\t}\n}\n\nexport default View;\n","/**\n * This module exports the convenience function [[register]] to help you define\n * model mappings and view registrations succinctly.\n */\n\n/****/\n\nimport { mapper, ModelConstructor, ModelFactoryFunction } from '../model/Mapper';\nimport { ViewRegistration, ViewRegistrationMap } from '../view/View';\n\n\n/**\n * This convenience method helps to configure model mappings and view registrations via a fluent API.\n *\n * @param callback This callback function will receive a `builder` object which provides various methods:\n *\n * * Specify how raw data (\"JSON\") is mapped to class instances using **`.model(...)`**.\n * (This will invoke the global `mapper.toModel.add` behind the curtains.)\n *\n * * Register views using `.model(...)`**`.view(...)`** (if you want to tie a view to a certain\n * type of model class) or using **`.view(...)`** (if you want e.g. named views).\n *\n * @returns An object that can be queried for the following:\n *\n * * **`.viewRegistrations`**. Note that these are not automatically registered. You need to pass these\n * registrations on either to a `View` instance (via the constructor) or to `scan`. (You *can* also\n * register these globally using `register` (from the `core/view/View` module), however that method\n * has been marked deprecated.)\n *\n * @example\n *```typescript\n * const {viewRegistrations} = register(({model, view}) => {\n * model('App\\\\Heading', Heading).view(HeadingView);\n * });\n *\n * scan(document.body, viewRegistrations);\n *```\n *\n * Then in your templates (assuming that there is a `heading` data property which was\n * mapped from a `{ modelName: \"App\\Heading\" }` JSON object), you can resolve `heading` to a `HeadingView`\n * as follows:\n *\n *```html\n *
\n *```\n */\nexport default function register( callback:( builder:RegistrationsBuilder ) => void ):Registrations {\n\tconst builder = new RegistrationsBuilderImpl();\n\n\t// This weird hack is needed such that destructuring of `builder`\n\t// won't lose the `this` binding to `builder`:\n\tcallback({\n\t\tmodel: builder.model.bind(builder),\n\t\tview: builder.view.bind(builder),\n\t});\n\n\treturn builder;\n}\n\n/**\n * The registrations produced (and returned) by [[register]].\n */\ninterface Registrations {\n\n\t/**\n\t * The view registrations defined. Note that these are not automatically registered for you.\n\t * You will need to pass them forward to e.g. [[\"core/view/View\".View]]'s constructor, or to\n\t * the [[\"core/view/View\".scan]] method.\n\t */\n\tviewRegistrations:ViewRegistrationMap;\n}\n\n/**\n * Provides various methods that can be used to specify model mappings and view registrations.\n * An instance of this type will be passed to the `callback` that you pass to [[register]].\n */\ninterface RegistrationsBuilder {\n\n\t/**\n\t * Use this method to create an association between a model class and a view registration.\n\t * @param constructor The model class that should be associated with a view registration.\n\t *\n\t * @example\n\t *\n\t *```typescript\n\t * class Image extends Model { ... }\n\t * class ImageView extends View { ... }\n\t * register(({ model }) => model(Image).view(ImageView));\n\t *```\n\t *\n\t * After this, you will be able to resolve `Image` models to `ImageView` instances\n\t * in your templates as follows:\n\t *\n\t *```html\n\t *
\n\t *```\n\t */\n\tmodel( constructor:ModelConstructor ):ModelViewAssociationBuilder;\n\n\t/**\n\t * Use this method to map raw data with the given `modelName` to a model class,\n\t * and optionally create an association between that model class and a view registration.\n\t *\n\t * @param name The `modelName` identifying data to be mapped to the model class.\n\t * @param constructor The model class that should be mapped to.\n\t *\n\t * @example\n\t *\n\t *```typescript\n\t * class Image extends Model { ... }\n\t * register(({ model }) => model('App\\\\Image', Image));\n\t *```\n\t *\n\t * or:\n\t *\n\t *```typescript\n\t * class Image extends Model { ... }\n\t * class ImageView extends View { ... }\n\t * register(({ model }) => model('App\\\\Image', Image).view(ImageView));\n\t *```\n\t *\n\t * This second form will allow you to resolve `Image` models to `ImageView` instances\n\t * in your templates as follows:\n\t *\n\t *```html\n\t *
\n\t *```\n\t */\n\tmodel( name:string, constructor:ModelConstructor ):ModelViewAssociationBuilder;\n\n\t/**\n\t * Use this method to map raw data with the given `modelName` to a model class,\n\t * and optionally create an association between that model class and a view registration.\n\t *\n\t * @param name The `modelName` identifying data to be mapped to the model class.\n\t * @param factory A closure function that should produce an model class (`T`) instance from\n\t * the raw data object it receives.\n\t *\n\t * @example\n\t *\n\t *```typescript\n\t * class Image extends Model { ... }\n\t * register(({ model }) => model('App\\\\Image', dto => new Image(dto, ...)));\n\t *```\n\t */\n\tmodel( name:string, factory:ModelFactoryFunction ):void;\n\n\t/**\n\t * Use this method to create a view registration under the given `key`. The key can be\n\t * anything: usually, you'll want to specify a string or a class constructor.\n\t *\n\t * @param key The key that identifies the view registration.\n\t * @param registration The view registration.\n\t *\n\t * @example\n\t *\n\t *```typescript\n\t * class App extends Model { ... }\n\t * class AppView extends View { ... }\n\t * register(({ view }) => view('App', AppView));\n\t *```\n\t *\n\t * or:\n\t *\n\t *```typescript\n\t * class App extends Model { ... }\n\t * register(({ view }) => view('App', { template: `...`, getData: () => new App(...) }));\n\t *```\n\t *\n\t * Both of the examples above will allow you to \"instantiate\" an `App` view in your templates\n\t * as follows:\n\t *\n\t *```html\n\t *
\n\t *```\n\t *\n\t * Note that the `key` need not be a string. You could also specify a model class instead:\n\t *\n\t *```typescript\n\t * class App extends Model { ... }\n\t * class AppView extends View { ... }\n\t * register(({ view }) => view(App, AppView));\n\t *```\n\t *\n\t * This is equivalent to the preferable `model(App).view(AppView)` and allows you to then\n\t * resolve an `App` model to an `AppView` in your templates as follows:\n\t *\n\t *```html\n\t *
\n\t *```\n\t */\n\tview( key:unknown, registration:ViewRegistration ):void;\n}\n\n/** @ignore */\ninterface ModelViewAssociationBuilder {\n\tview( registration:ViewRegistration ):void;\n}\n\n/** @ignore */\nclass RegistrationsBuilderImpl implements RegistrationsBuilder, Registrations {\n\n\tpublic readonly viewRegistrations:ViewRegistrationMap;\n\n\tpublic constructor() {\n\t\tthis.viewRegistrations = new ViewRegistrationMap();\n\t}\n\n\tpublic model( nameOrConstructor:string|ModelConstructor, constructorOrFactory?:ModelConstructor|ModelFactoryFunction ) {\n\n\t\tconst viewRegistrations = this.viewRegistrations;\n\n\t\tif( typeof nameOrConstructor === 'string' ) {\n\t\t\tif( isModelConstructor( constructorOrFactory ) ) {\n\t\t\t\tmapper.toModel.add( nameOrConstructor, dto => new constructorOrFactory( dto ) );\n\t\t\t\treturn {\n\t\t\t\t\tview( registration:ViewRegistration ):void {\n\t\t\t\t\t\tviewRegistrations.set( constructorOrFactory, registration );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmapper.toModel.add( nameOrConstructor, constructorOrFactory );\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn {\n\t\t\t\tview( registration:ViewRegistration ):void {\n\t\t\t\t\tviewRegistrations.set( nameOrConstructor, registration );\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tfunction isModelConstructor( fn:Function ): fn is ModelConstructor {\n\t\t\treturn !!fn.length;\n\t\t}\n\t}\n\n\tpublic view( key:unknown, registration:ViewRegistration ): void {\n\t\tthis.viewRegistrations.set( key, registration );\n\t}\n}\n","import View from '../core/view/View';\n\n/**\n * A helper view that simply renders html into the component node\n */\nexport class Html extends View {\n\n\tconstructor() {\n\t\tsuper( { template:'', data:'' } );\n\t}\n\n\tinit() {\n\t\tthis.node.innerHTML = this.data;\n\t}\n\n\tupdate() {\n\t\tthis.node.innerHTML = this.data;\n\t}\n}\n\n\nexport default Html;\n","import { Signal } from '../signal/Signal';\n\n\n/**\n * An interface that defines what is required as a source for the ListRenderer.\n */\nexport interface IList {\n\t/** @event */\n\tadded: Signal>;\n\t/** @event */\n\tfilled: Signal>;\n\t/** @event */\n\tremoved: Signal>;\n\t/** @event */\n\tsorted: Signal>;\n\tall(): T[];\n\tfill(data: T[]);\n}\n\n\n/**\n * Function interface for listeners on the 'add' Signal.\n */\nexport interface ListAddedListener {\n\tnewItem:T,\n\tindex?:number\n}\n\n/**\n * Function interface for listeners on the 'remove' Signal.\n */\nexport interface ListRemovedListener {\n\tremovedItem:T,\n\tindex:number\n}\n\n/**\n * Function interface for listeners on the 'filled' Signal.\n */\nexport interface ListFilledListener {\n\titems:T[]\n}\n\n\n/**\n * A generic representation of a list that throws event on add, remove and fill\n *\n */\nexport class List implements IList {\n\n\t/** @event */\n\tpublic added:Signal>;\n\t/** @event */\n\tpublic removed:Signal>;\n\t/** @event */\n\tpublic filled:Signal>;\n\t/** @event */\n\tpublic sorted:Signal>;\n\n\tprotected items:T[];\n\n\tconstructor( items?:T[] ) {\n\t\tthis.added = new Signal>();\n\t\tthis.removed = new Signal>();\n\t\tthis.filled = new Signal>();\n\t\tthis.sorted = new Signal>();\n\n\t\tthis.items = ( items ) ? items : [];\n\t}\n\n\t/**\n\t * Returns a copy of the internal array.\n\t */\n\tall():T[] {\n\t\treturn this.items.slice();\n\t}\n\n\t/**\n\t * Refill the list with items\n\t * @param items to fill the list with\n\t */\n\tfill( items:T[], silent:boolean = false ) {\n\t\tthis.items = items; // do not add the original array.\n\t\tif( !silent ) this.filled.dispatch( { items: items } );\n\t}\n\n\n\t/**\n\t * Adds an item to the list at the given index. If the index is outside of the array the item is appended at the end\n\t * @param item The item to be added\n\t * @param index The index at which the item is added.\n\t */\n\tadd( item:T, index:number ):number {\n\n\t\t// make sure index is in array length\n\t\tindex = Math.max( Math.min( index, this.items.length ), 0 );\n\n\t\tthis.items.splice( index, 0, item );\n\t\tthis.added.dispatch( { newItem: item, index: index } );\n\t\treturn index;\n\t}\n\n\t/**\n\t * Removes the item at the given index\n\t * @param index The index at which the item will be removed\n\t */\n\tremove( item:T ):boolean {\n\n\t\tvar index = this.index( item );\n\n\t\tif( index >= 0 ) return this.removeAt( index );\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Removes an item at the given index\n\t */\n\tremoveAt( index:number ):boolean {\n\n\t\tvar res = this.items.splice( index, 1 );\n\t\tvar item = res[0];\n\n\t\tif( item ) {\n\t\t\tthis.removed.dispatch( { removedItem: item, index: index } );\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Appends a new item to the list\n\t */\n\tappend( item:T ) {\n\t\tthis.add( item, this.items.length );\n\t}\n\n\t/**\n\t * Prepends a new item to the list\n\t */\n\tprepend( item:T ) {\n\t\tthis.add( item, 0 );\n\t}\n\n\t/**\n\t * Get the item with the given index\n\t * @param index The index of the item\n\t */\n\tget( index:number ):T {\n\t\treturn this.items[ index ];\n\t}\n\n\t/**\n\t * Returns the first item in the list\n\t */\n\tfirst():T {\n\t\treturn this.items[0];\n\t}\n\n\t/**\n\t * Returns the last item in the list\n\t */\n\tlast():T {\n\t\treturn this.items[ this.items.length - 1 ];\n\t}\n\n\t/**\n\t * Shortcut to empty the list\n\t */\n\tempty() {\n\t\tthis.fill( [] );\n\t}\n\n\t/**\n\t * Finds an element in the list with the given closure\n\t */\n\tfind( closure:( item:T, index?:number, array?:Array ) => boolean ) {\n\t\treturn this.all().filter( closure )[ 0 ];\n }\n\n\n\n\t/**\n\t * Returns the index of the given item\n\t */\n\tindex( searchItem:T ):number {\n\t\tvar index = -1;\n\t\tthis.items.forEach( ( item, i ) => {\n\t\t\tif( item === searchItem ) index = i;\n\t\t});\n\t\treturn index;\n\t}\n\n\t/**\n\t * Tests if the given item exists in the list\n\t */\n\tcontains( item:T ):boolean {\n\t\treturn this.index( item ) >= 0;\n\t}\n\n\t/**\n\t * Returns the length of the list\n\t */\n\tget length():number {\n\t\treturn this.items.length;\n\t}\n\n\t/**\n\t * Resorts the items based on the given array of items\n\t */\n\tsort( items:T[] ) {\n\n\t\t// check if items size match\n\t\t// no check for same instances...\n\t\tif( this.items.length != items.length ) throw \"Sort items should be the same size\";\n\n\t\tthis.items = items;\n\t\tthis.sorted.dispatch( { items: items } );\n\t}\n\n\t/**\n\t * Sorts the list by the closures return value\n\t */\n\tsortBy( closure:( item:T )=>any ) {\n\t\tvar items = this.items.map( function( x:T ) {\n\t\t\treturn [ x, closure( x ) ];\n\t\t}).sort(function (a, b) {\n\t\t\treturn a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0;\n\t\t}).map(function (x) {\n\t\t\treturn x[0];\n\t\t});\n\t\tthis.sort( items );\n\t}\n}\n\nexport default List;\n","import { Signal } from '../signal/Signal';\nimport { IList, List, ListAddedListener, ListFilledListener, ListRemovedListener } from './List';\n\nexport interface ModifierClosure {\n\t( items:T[] ):T[]\n}\n/**\n * A generic representation of a modifiable (fiterable, sortable) list.\n *\n */\nexport class ModifiableList implements IList {\n\n\t/** @event */\n\tpublic added:Signal>;\n\t/** @event */\n\tpublic removed:Signal>;\n\t/** @event */\n\tpublic filled:Signal>;\n\t/** @event */\n\tpublic sorted:Signal>;\n\n\tpublic modifiers:List>;\n\tpublic originals:List;\n\n\tprivate cache:List;\n\n\tconstructor( items?:T[] ) {\n\n\t\tthis.added = new Signal>();\n\t\tthis.removed = new Signal>();\n\t\tthis.filled = new Signal>();\n\t\tthis.sorted = new Signal>();\n\n\t\tthis.modifiers = new List>();\n\t\tthis.modifiers.added.subscribe( this.onModifiersChanged.bind( this ) );\n\t\tthis.modifiers.removed.subscribe( this.onModifiersChanged.bind( this ) );\n\t\tthis.modifiers.filled.subscribe( this.onModifiersChanged.bind( this ) );\n\n\t\tthis.originals = new List( items );\n\t\tthis.originals.added.subscribe( this.onOriginalsAdded.bind( this ) );\n\t\tthis.originals.removed.subscribe( this.onOriginalsRemoved.bind( this ) );\n\t\tthis.originals.filled.subscribe( this.onOriginalsFilled.bind( this ) );\n\n\t\tthis.update();\n\t}\n\n\t/**\n\t * Returns only the modified items\n\t */\n\tall():T[] {\n\t\treturn this.cache.all();\n\t}\n\n\t/**\n\t * Delegate\n\t */\n\tfill( items:T[] ) {\n\t\tthis.originals.fill( items );\n\t}\n\n\t/**\n\t * Delegate\n\t */\n\tfind( closure:( item:T, index?:number, array?:Array ) => boolean ) {\n\t\treturn this.originals.find( closure );\n\t}\n\n\t/**\n\t * Delegate\n\t */\n\tsort( items:T[] ) {\n\t\tthis.originals.sort( items );\n\t\tthis.sorted.dispatch( { items: items } );\n\t}\n\n\t/**\n\t * forces to reapply modifiers\n\t */\n\tupdate() {\n\t\tthis.buildCache();\n\t\tthis.filled.dispatch( { items: this.cache.all() } );\n\t}\n\n\t/**\n\t * Callback when the modifies list has changed.\n\t */\n\tprivate onModifiersChanged() {\n\t\tthis.update();\n\t}\n\n\t/**\n\t * Callback when something is added to the originals\n\t * Check it needs to be added to the modified items\n\t */\n\tprivate onOriginalsAdded( event:{ newItem:T, index:number } ) {\n\t\tthis.buildCache();\n\n\t\t// check if it should be displayed\n\t\tvar modIndex = this.cache.index( event.newItem );\n\t\tif( modIndex >= 0 ) this.added.dispatch( { newItem:event.newItem, index:modIndex } );\n\t}\n\n\t/**\n\t * Callback when something is removed from the originals\n\t * Check it needs to be removed from the modified items\n\t */\n\tprivate onOriginalsRemoved( event:{ removedItem:T, index:number } ) {\n\n\t\tvar oldIndex = this.cache.index( event.removedItem );\n\n\t\tthis.buildCache();\n\n\t\tif( oldIndex >= 0 ) this.removed.dispatch( { removedItem: event.removedItem, index: oldIndex } );\n\t}\n\n\t/**\n\t * Callback when list is filled\n\t */\n\tprivate onOriginalsFilled( item:T[] ) {\n\t\tthis.onModifiersChanged();\n\t}\n\n\n\t/**\n\t * Updates the results of the modifications into the cache var\n\t */\n\tprivate buildCache() {\n\n\t\tvar data = this.originals.all();\n\t\tthis.modifiers.all().forEach( function( modifier ) {\n\t\t\tdata = modifier( data );\n\t\t});\n\n\t\tthis.cache = new List( data );\n\t}\n}\n\nexport default ModifiableList;\n","import IoC from '../ioc/IoC';\nimport Model from '../model/Model';\nimport { IList, List } from '../list/List';\nimport { ModifiableList } from '../list/ModifiableList';\n\n/**\n * Specific interface for closure function used in the ioc\n */\nexport interface IoCFactoryFunction {\n\t( item:T, index?:number ): { node:Element };\n}\n\n/**\n * A function that defines how to a map the registered keywords in the ioc with the item:T\n * Example if T is Model:\n * \t\tfunction( model:Model ) {\n * \t\t\treturn model.modelName;\n * \t\t}\n *\n */\nexport interface IoCSelectorFunction {\n\t( item: T ): string;\n}\n\n\n/**\n * An interface for links that combine the node and its item\n */\nexport interface ILink {\n\tnode: Node;\n\titem: T;\n}\n\n\n/** Abstract base class for `ListRenderer` and `ModifiableListRenderer`.\n *\n * @hidden */\nabstract class ListRendererBase {\n\n\tpublic ioc: IoC> = new IoC>();\n\tpublic selectorFunction: IoCSelectorFunction;\n\tpublic links = new List>();\n\tpublic container:Element;\n\n\tprivate _source: IList;\n\tprivate subscriptions:{};\n\n\tconstructor( initialSource: IList, container?: Element ) {\n\t\tthis.container = container;\n\n\t\t// the default selector function to use without ioc definitions.\n\t\tthis.selectorFunction = function( item:T ) {\n\t\t\treturn ( item instanceof Model ) ? item.get( 'modelName' ) : 'default';\n\t\t}\n\n\t\tthis.setSource(initialSource);\n\t}\n\n\t/** @hidden */\n\tprotected getSource(): IList {\n\t\treturn this._source;\n\t}\n\n\t/** @hidden */\n\tprotected setSource( items: IList ) {\n\t\tif( this._source ) this.removeListeners();\n\t\tthis._source = items;\n\t\tthis.addListeners();\n\n\t\tif( this.container ) this.onFilled( { items: items.all() } );\n\t}\n\n\tpublic defaultRender( closure:IoCFactoryFunction ) {\n\t\tthis.ioc.add( 'default', closure );\n\t}\n\n\tprotected addListeners(){\n\t\tthis.subscriptions = {\n\t\t\tfilled: this._source.filled.subscribe( this.onFilled.bind( this ) ),\n\t\t\tadded: this._source.added.subscribe( this.onAdded.bind( this ) ),\n\t\t\tremoved: this._source.removed.subscribe( this.onRemoved.bind( this ) ),\n\t\t\tsorted: this._source.sorted.subscribe( this.onSorted.bind( this ) ),\n\t\t};\n\t}\n\n\tprotected removeListeners() {\n\t\tObject.keys( this.subscriptions ).forEach( type => {\n\t\t\tthis.subscriptions[ type ].unsubscribe();\n\t\t});\n\t}\n\n\tprotected renderList( items:T[] ) {\n\n\t\tvar fragment = document.createDocumentFragment();\n\n\t\titems.forEach( function( item, index ) {\n\n\t\t\tvar obj = >this.ioc.get( this.selectorFunction( item ) )( item, index );\n\t\t\tobj.item = item; // inject item\n\t\t\tthis.links.append( obj );\n\n\t\t\t// add to fragment\n\t\t\tfragment.appendChild( obj.node );\n\t\t}, this);\n\n\t\t// append fragment to container.\n\t\tthis.container.appendChild( fragment );\n\t}\n\n\tprotected onFilled( event:{ items:T[] } ) {\n\t\t// remove all links\n\t\tthis.links.all().forEach( link => {\n\t\t\tlink.node.parentNode.removeChild( link.node );\n\t\t});\n\n\t\tthis.links.empty();\n\t\tthis.renderList( event.items );\n\t}\n\n\tprotected onAdded( event:{ newItem:T, index:number } ) {\n\t\tvar obj = > this.ioc.get( this.selectorFunction( event.newItem ) )( event.newItem, event.index );\n\t\tobj.item = event.newItem;\n\t\tthis.container.insertBefore( obj.node, this.container.childNodes[ event.index ] || null );\n\t\tthis.links.add( obj, event.index );\n\t}\n\n\tprotected onRemoved( event:{ removedItem:T, index:number } ) {\n\t\tvar link = this.links.get( event.index );\n\t\tthis.links.removeAt( event.index );\n\t\tthis.container.removeChild( link.node );\n\t\tlink.node = undefined;\n\t}\n\n\tprotected onSorted( event:{ items:T[] } ) {\n\t\tvar links = [];\n\t\tfor( var i = 0; i < event.items.length; i++ ) {\n\t\t\tvar link = this.linkOf( event.items[i] );\n\t\t\tthis.container.insertBefore( link.node, this.container.childNodes[ i ] || null );\n\t\t\tlinks.push( link );\n\t\t}\n\t\tthis.links.fill( links );\n\t}\n\n\tpublic linkOf( item:T | Node ):ILink {\n\n\t\t// define on which attribute to check\n\t\tvar attr = ( item instanceof Node ) ? \"node\" : \"item\";\n\n\t\treturn this.links.find( function( link ) {\n\t\t\treturn link[attr] === item;\n\t\t});\n\t}\n}\n\n\n/**\n * Renders a `List` list with items of type `T` into a template. Listens on list signals for rerendering.\n * The rendering of the list items is defined through an ioc for simpler usage with a render function.\n *\n *\n * ### Examples\n *\n *\n * #### Rendering a list of strings\n *\n * @example\n * ```typescript\n *\n * // Instantiate the ListRenderer and provide a node the listRenedrer is rendered to\n * const listRenderer = new ListRenderer( Node.js( 'targetNode' ) );\n *\n * // Define the closure a list item is rendered with\n * listRenderer.defaultRender( function( item:string ) {\n * \tconst myView = new MyView( item ).render();\n * \treturn { node: myView.node }\n * });\n *\n * // Fill in the source with items. This invokes the render function of the listRenderer\n * listRenderer.source.fill( [ 'one', 'two', 'three' ] );\n *\n * // Append a new element. The list is rerenderer after all list manipulations\n * listRenderer.source.append( 'four' );\n * ```\n *  \n *\n * #### Rendering models\n *\n * @example\n * ```typescript\n *\n * // Instantiate a ListRenderer with type \"Model\"\n * const listRenderer = new ListRenderer( Node.js( 'targetNode' ) );\n *\n * // Define how a Title model is rendered\n * listRenderer.renderer.ioc.add( 'Title', function( model:TitleModel ) {\n * \tconst titleView = new TitleView( model ).render();\n * \treturn { node: titleView.node }\n * });\n *\n * // Define how a Paragraph model is rendered\n * listRenderer.renderer.ioc.add( 'Paragraph', function( model:ParagraphModel ) {\n * \tconst paragraphView = new ParagraphView( model ).render();\n * \treturn { node: paragraphView.node }\n * });\n *\n * // Define how to distinguish between the models\n * // This step is optional in this case. The selectorFunction is predefined\n * listRenderer.selectorFunction = function( model:Model ) {\n * \treturn model.get( 'modelName' );\n * }\n *\n * // Fill the source of the ListRenderer with models.\n * listRenderer.source.fill( [ new TitleModel(), new ParagraphModel(), new ParagraphModel() ] )\n * ```\n *\n *\n * ### See also\n *\n * @see ModifiableListRenderer for a list renderer that uses a `ModifiableList` as its data source.\n */\nexport class ListRenderer extends ListRendererBase {\n\n\tconstructor(container?: Element) {\n\t\tsuper(new List([]), container);\n\t}\n\n\tget source(): List {\n\t\treturn super.getSource() as List;\n\t}\n\n\tset source(value: List) {\n\t\tsuper.setSource(value);\n\t}\n}\n\n\n/**\n * Renders a `ModifiableList` list with items of type `T` into a template. Listens on list signals for rerendering.\n * The rendering of the list items is defined through an ioc for simpler usage with a render function.\n *\n *\n * ### Example\n *\n *\n * #### Using a `ModifiableList` instead of a `List` as source\n *\n * @example\n * ```typescript\n *\n * // Instantiate a ModifiableListRenderer with type string, containing a source with type ModifiableList\n * const listRenderer = new ModifiableListRenderer( Node.js( \"content\" ) );\n *\n * // Define the closure a list item is rendererd with\n * listRenderer.defaultRender( function( item:string ) {\n *\t\tconst node = Node.fromTag( 'div' );\n *\t\tnode.html = item;\n *\t\treturn { node: node };\n *\t});\n *\n * // Instantiate a fresh ModifiableList as new source\n * listRenderer.source = new ModifiableList();\n *\n * // Fill in the source\n * listRenderer.source.fill( [ \"eins\", \"zwei\", \"drei\", \"vier\", \"fünf\", \"sechs\" ] );\n *\n * // Define a modifier for the ModifiableList\n * // Filter the list in order to display only items with less than 5 letters\n * // Appending a modifier applies the modifier and rerenders the list\n * listRenderer.source.modifiers.append( function( items ) {\n * \treturn items.filter( item => item.length < 5);\n * });\n * ```\n *\n *\n * ### See also\n *\n * @see ListRenderer for a list renderer that uses a `List` as its data source.\n */\nexport class ModifiableListRenderer extends ListRendererBase {\n\n\tconstructor(container?: Element) {\n\t\tsuper(new ModifiableList([]), container);\n\t}\n\n\tget source(): ModifiableList {\n\t\treturn super.getSource() as ModifiableList;\n\t}\n\n\tset source(value: ModifiableList) {\n\t\tsuper.setSource(value);\n\t}\n}\n\n\nexport default ListRenderer;\n","/**\n * This module contains the [[Repeat]] helper component used to repeat HTML per collection item.\n */\n\n/***/\n\nimport Model, { isAttributeChangeObservable } from '../core/model/Model';\nimport ListRenderer from '../core/list/ListRenderer';\nimport View from '../core/view/View';\nimport { node } from '../core/node/Node';\n\n\n/**\n * A helper view that repeats its inner HTML once for each item of a given collection.\n * Set its `items` attribute to the collection, and specify the iteration variable's name in the `as` attribute.\n * Within the repeat block, you can access the context of the outside component with `parent`.\n *\n * ### Basic usage:\n *\n * ```html\n *
\n * \n *
\n * ```\n *\n * For this to work, you must have previously registered the component under the key `repeat`.\n * For example:\n *\n * ```typescript\n * import Repeat from '.../components/Repeat';\n * ...\n * scan(document.body, { 'repeat': Repeat }, ...otherViewRegistrations);\n * ```\n */\nexport default class Repeat extends View {\n\n\titemTemplate:string;\n\trenderer:ListRenderer;\n\n\tconstructor() {\n\t\tsuper( { template:'', data:new RepeatModel( { as:'', items:[] } ) } );\n\t}\n\n\trender( target:Element ) {\n\n\t\t// before render get inner html for item template.\n\t\tthis.itemTemplate = target.innerHTML;\n\t\ttarget.innerHTML = '';\n\n\t\tsuper.render( target );\n\t}\n\n\tinit() {\n\t\tthis.renderItems();\n\t\tthis.data.change.filter( c => c.name == 'items' ).subscribe( this.renderItems.bind( this ) );\n\t}\n\n\trenderItems() {\n\n\t\tnode( this.node ).empty();\n\n\n\t\t// check for valid array\n\t\tlet items = this.data.items;\n\t\tif( !Array.isArray( items ) ) return;\n\n\t\tthis.renderer = new ListRenderer( this.node );\n\t\tthis.renderer.defaultRender( ( item, index ) => {\n\t\t\tlet data = {\n\t\t\t\tparent:this.parent.data,\n\t\t\t\tindex:index,\n\t\t\t\titems:items,\n\t\t\t};\n\n\t\t\t// inject item\n\t\t\tdata[this.data.as] = item;\n\n\t\t\tlet temp = new View( { template:this.itemTemplate, data:data } );\n\t\t\ttemp.parent = this;\n\t\t\ttemp.render();\n\n\t\t\t// setup proper updates with prefix name\n\t\t\tif( isAttributeChangeObservable( item ) ) {\n\t\t\t\titem.change.subscribe( ( change ) => {\n\t\t\t\t\ttemp.template.update( this.data.as + '.' + change.name );\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn { node: temp.node };\n\t\t} );\n\n\t\tthis.renderer.source.fill( items );\n\t}\n\n}\n\n\n/** @ignore */\nclass RepeatModel extends Model {\n\tas:string;\n\titems:[];\n}\n","import View from '@lernetz/ts-lib/src/core/view/View';\nimport { renderer } from '@lernetz/ts-lib/src/core/view/Renderer';\n\nexport default class Image extends View {\n\n constructor() {\n super({ template:'' } );\n }\n\n protected init() {\n if (this.data ) {\n this.node.setAttribute('src', renderer.context.imagePath(this.data, this.data.preset ? this.data.preset : 'large', this.data.ext ? this.data.ext : 'png'));\n }\n \n \n }\n};\n","/**\n * This module contains the [[Show]] helper component used to conditionally render HTML.\n */\n\n/***/\n\nimport View from '../core/view/View';\nimport Model from '../core/model/Model';\nimport { node } from '../core/node/Node';\n\n/**\n * A helper view that renders the contents of its node into the DOM only if some condition is true.\n *\n * ### Basic usage:\n *\n * ```html\n *
\n * This is rendered only if `someBooleanCondition` evaluates to true.\n *
\n * ```\n *\n * For this to work, you must have previously registered the component under the key `show`.\n * For example:\n *\n * ```typescript\n * import Show from '.../components/Show';\n * ...\n * scan(document.body, { 'show': Show }, ...otherViewRegistrations);\n * ```\n */\nexport default class Show extends View {\n\n\tprivate placeholder:Comment;\n\tprivate content:string;\n\n\tconstructor( ) {\n\t\tsuper( { template:'', data:new ShowModel( { if:true } ) } );\n\n\t\tthis.placeholder = document.createComment('');\n\n\t\tthis.template.context = {\n\t\t\tdata: () => this.parent.data,\n\t\t\tchildFactory: ( key ) => this.parent.createChild( key ),\n\t\t\tview: () => this.parent\n\t\t}\n\t}\n\n\tinit() {\n\n\t\tthis.checkVisibility();\n\n\t\tthis.data.change.filter( c => c.name == 'if' ).subscribe( this.checkVisibility.bind( this ) );\n\t}\n\n\tcheckVisibility() {\n\t\tif( this.data.if && this.placeholder.parentNode ) node( this.placeholder ).replace( this.node );\n\t\tif( !this.data.if && this.node.parentNode ) node( this.node ).replace( this.placeholder );\n\t}\n}\n\n\n/** @ignore */\nclass ShowModel extends Model {\n\tif:boolean;\n}\n","import View from '@lernetz/ts-lib/src/core/view/View';\nimport { renderer } from '@lernetz/ts-lib/src/core/view/Renderer';\n\nexport default class BackgroundImage extends View {\n\n constructor() {\n super({ template:'' } );\n }\n\n protected init() {\n if ( this.data ) {\n this.node.setAttribute('style', 'background-image:url( ' + renderer.context.imagePath(this.data, \"original\", this.data.ext ) + ' ) ');\n }\n }\n};\n","import View from '@lernetz/ts-lib/src/core/view/View';\nimport { renderer } from '@lernetz/ts-lib/src/core/view/Renderer';\nimport {setup, SetupConfig} from 'ln/setup/Setup';\n\nexport default class StaticImage extends View {\n\n constructor() {\n super({ template:'' } );\n }\n\n protected init() {\n if (this.data ) {\n this.node.setAttribute('src', setup.route('image', {file_name: this.data}).url() );\n \n }\n \n \n }\n};\n","/* Auto generated by gulp-typescript-template */\n\nexport const choiceQuizTemplate = `
`;\nexport const textChoiceTemplate = `
[[text]]
`;\nexport const toggleTemplate = ``;\nexport const checkBoxCheckedTemplate = ``;\nexport const checkBoxUncheckedTemplate = ``;\nexport const radioButtonCheckedTemplate = ``;\nexport const radioButtonUncheckedTemplate = ``;\n","/** @module components/choice-quiz */\n\n\n/**/\nimport View from '@lernetz/ts-lib/src/core/view/View';\nimport {toggleTemplate as template} from '../../templates/choice-quiz';\n\n\n/**\n * A [View](https://ts-lib.beta.lernetz.site/classes/_core_view_view_.view.html) that renders a toggle; for instance, a check box, a radio button,\n * or anything else with two distinct visual states.\n */\nexport class ToggleView extends View {\n\n /**\n * Initializes a new instance of the `ToggleView` class.\n *\n * @param checkedTemplate The template to render when `data` is truthy.\n * @param uncheckedTemplate The template to render when `data` is falsy.\n */\n public constructor(private readonly checkedTemplate: string, private readonly uncheckedTemplate: string) {\n super({ template });\n }\n\n /**\n * @ignore\n * @inheritdoc\n */\n init(): void {\n this.update();\n }\n\n /**\n * @ignore\n * @inheritdoc\n */\n update(): void {\n if (!this.node) return;\n\n this.node.innerHTML = this.data ? this.checkedTemplate : this.uncheckedTemplate;\n }\n}\n","/** @module components/choice-quiz */\n\n\n/**/\nimport Model from '@lernetz/ts-lib/src/core/model/Model';\nimport {View, ViewConfig, ViewRegistrationMap} from '@lernetz/ts-lib/src/core/view/View';\n\nimport {Choice} from './Choice';\nimport {ChoiceQuizType} from './ChoiceQuiz';\nimport {ToggleView} from './Toggle';\n\nimport {CanShowCorrectness} from '../quiz/CanShowCorrectness';\n\nimport {checkBoxCheckedTemplate,\n checkBoxUncheckedTemplate,\n radioButtonCheckedTemplate,\n radioButtonUncheckedTemplate,\n textChoiceTemplate} from '../../templates/choice-quiz';\n\n\n/**\n * Specifies the initial state of a [[TextChoice]].\n */\nexport interface TextChoiceInitialState {\n\n /**\n * Sets whether this choice is a (or the) correct one.\n */\n correct: boolean;\n\n /**\n * Sets whether this choice should be rendered as initially selected.\n *\n * Defaults to `false`.\n */\n selected?: boolean;\n\n /**\n * Sets whether the correctness of this choice should be initially displayed.\n * Defaults to `false`.\n */\n showCorrectness?: boolean;\n\n /**\n * Sets the text that should be displayed for this choice.\n */\n text: string;\n}\n\n\n/**\n * A textual choice in a [[ChoiceQuiz]].\n *\n * @see [[Choice]], the main interface implemented by this class.\n */\nexport class TextChoice extends Model implements Choice, CanShowCorrectness {\n\n /**\n * Initializes a new instance of the [[TextChoice]] class.\n *\n * @param initialState Specifies the initial state for the new instance.\n */\n public constructor(initialState: TextChoiceInitialState) {\n super({\n correct: false,\n selected: false,\n showCorrectness: false,\n text: '',\n ...initialState,\n });\n }\n\n /** @inheritdoc */\n public readonly correct: boolean;\n\n /** @inheritdoc */\n public selected: boolean;\n\n /**\n * Gets or sets whether the correctness of this choice should be shown.\n */\n public showCorrectness: boolean;\n\n /**\n * Gets the text that should be displayed for this choice.\n */\n public readonly text: string;\n}\n\n\n/**\n * Base `View` class to render a [[TextChoice]].\n * Subclass this type if you want to use a different template.\n */\nexport class TextChoiceView extends View {\n\n /**\n * Initializes a new instance of the [[TextChoiceView]] class.\n */\n public constructor(type: ChoiceQuizType, config: ViewConfig = {}) {\n super({\n template: textChoiceTemplate,\n registrations: TextChoiceView.createRegistrations(type),\n ...config\n })\n }\n\n protected static createRegistrations(type: ChoiceQuizType): ViewRegistrationMap {\n const registrations = new ViewRegistrationMap();\n registrations.set('Toggle', () => new ToggleView(...TextChoiceView.getToggleTemplates(type)));\n return registrations;\n }\n\n protected static getToggleTemplates(type: ChoiceQuizType): [string, string] {\n return type === 'single' ? [radioButtonCheckedTemplate, radioButtonUncheckedTemplate]\n : [checkBoxCheckedTemplate, checkBoxUncheckedTemplate ];\n }\n}\n","/** @module components/choice-quiz */\n\n\n/**/\nimport Model from '@lernetz/ts-lib/src/core/model/Model';\nimport {View, ViewConfig, ViewRegistrationMap} from '@lernetz/ts-lib/src/core/view/View';\nimport Repeat from '@lernetz/ts-lib/src/components/Repeat';\n\nimport {Choice} from './Choice';\nimport {TextChoice, TextChoiceView} from './TextChoice';\n\nimport {Quiz, QuizInputState, QuizVisitor} from '../quiz';\n\nimport {choiceQuizTemplate} from '../../templates/choice-quiz';\n\n\n/**\n * Specifies the type of a [[ChoiceQuiz]] (either `'single'` or `'multiple'`).\n */\nexport type ChoiceQuizType = 'multiple' | 'single';\n\n\n/**\n * [[QuizVisitor]]s that support [[ChoiceQuiz]] should implement this interface.\n */\nexport interface ChoiceQuizVisitor extends QuizVisitor {\n visitChoiceQuiz(quiz: ChoiceQuiz): TResult;\n}\n\n\n/**\n * TypeScript [type guard](https://www.typescriptlang.org/docs/handbook/advanced-types.html#user-defined-type-guards)\n * that tests whether the given `visitor` is a [[ChoiceQuizVisitor]] (i.e. supports [[ChoiceQuiz]]).\n *\n * @param visitor The visitor to check.\n */\nfunction isChoiceQuizVisitor(visitor: QuizVisitor): visitor is ChoiceQuizVisitor {\n return typeof visitor['visitChoiceQuiz'] !== 'undefined';\n}\n\n\n/**\n * Specifies the initial state of a [[ChoiceQuiz]].\n */\nexport interface ChoiceQuizInitialState {\n\n /**\n * Sets the available choices for the choice quiz.\n */\n choices: Choice[];\n\n /**\n * Sets the type of choice quiz (`'single'` or `'multiple'`).\n */\n type: ChoiceQuizType;\n}\n\n\n/**\n * A type of [[Quiz]] that models single-choice and multiple-choice quizzes.\n *\n * @example\n *```typescript\n *\n * import {ChoiceQuiz, TextChoice, registrations as choiceQuizRegistrations} from '@lernetz/lernfragen/components/choice-quiz';\n *\n * const singleChoiceQuiz = new ChoiceQuiz({\n * type: 'single',\n * choices: [\n * new TextChoice({ text: 'I am the only correct answer', correct: true }),\n * new TextChoice({ text: 'I am a wrong answer', correct: false }),\n * new TextChoice({ text: 'I am another wrong answer', correct: false }),\n * ],\n * });\n *```\n *\n * Don't forget to register `choiceQuizRegistrations`. Then, in your HTML template:\n *\n *```html\n *
\n *```\n *\n * @seealso [[Quiz]], the main interface implemented by this class.\n */\nexport abstract class ChoiceQuiz extends Model implements Quiz {\n\n /**\n * Initializes a new instance of the [[ChoiceQuiz]] class.\n *\n * @param initialState Specifies the initial state for the new instance.\n * @param data An optional object to be passed through to the base class' ([[Model]]) constructor.\n */\n protected constructor(initialState: ChoiceQuizInitialState, data: object = {}) {\n super({\n choices: [],\n inputState: 'none',\n type: 'multiple',\n ...initialState,\n ...data\n });\n\n this.updateInputState();\n for (const ch of this.choices) {\n ch.change.filter(c => c.name === 'selected').subscribe(_ => this.updateInputState());\n }\n }\n\n private dirty: boolean;\n\n /**\n * Gets all choices in the quiz.\n */\n public readonly choices: Choice[];\n\n /** @inheritdoc */\n public readonly inputState: QuizInputState;\n\n /**\n * Gets the type of this choice quiz (either `'single'` or `'multiple'`).\n */\n public readonly type: ChoiceQuizType;\n\n /**\n * Dispatches to [[ChoiceQuizVisitor.visitChoiceQuiz]] (if implemented by `visitor`).\n */\n public accept(visitor: QuizVisitor): TResult {\n if (isChoiceQuizVisitor(visitor)) {\n return visitor.visitChoiceQuiz(this);\n }\n }\n\n /**\n * Callback method that gets invoked when the user clicks or taps on the specified `choice`.\n * It sets that choice's [[Choice.selected]] state to `true`, and resets all other choices' `selected` state.\n *\n * @param choice The [[Choice]] that was clicked or tapped by the user.\n */\n public onChoiceClicked(choice: Choice): void {\n this.dirty = true;\n switch (this.type) {\n\n case 'multiple':\n choice.selected = !choice.selected;\n break;\n\n case 'single':\n for (const ch of this.choices) {\n ch.selected = (ch === choice);\n }\n break;\n }\n }\n\n /**\n * Updates the [[inputState]] property.\n */\n protected updateInputState(): void {\n let inputState: QuizInputState;\n if (this.choices.some(ch => ch.selected)) {\n inputState = this.choices.some(ch => ch.selected !== ch.correct) ? 'incorrect' : 'correct';\n }\n else {\n inputState = this.dirty ? 'incomplete' : 'none';\n }\n this.set('inputState', inputState);\n }\n}\n\n\n/**\n * Base `View` class to render a [[ChoiceQuiz]].\n * Subclass this type if you want to use a different template.\n */\nexport abstract class ChoiceQuizView extends View {\n\n /**\n * Initializes a new instance of the [[ChoiceViewQuiz]] class.\n */\n protected constructor(type: ChoiceQuizType, config: ViewConfig = {}) {\n super({\n template: choiceQuizTemplate,\n registrations: ChoiceQuizView.createRegistrations(type),\n ...config\n })\n }\n\n protected static createRegistrations(type: ChoiceQuizType): ViewRegistrationMap {\n const registrations = new ViewRegistrationMap();\n registrations.set('repeat', Repeat);\n registrations.set(TextChoice, () => new TextChoiceView(type));\n return registrations;\n }\n}\n","/** @module components/choice-quiz */\n\n\n/**/\nimport {ViewConfig} from '@lernetz/ts-lib/src/core/view/View';\n\nimport {Choice} from './Choice';\nimport {ChoiceQuiz, ChoiceQuizView} from './ChoiceQuiz';\n\n\n/**\n * Specifies the initial state of a [[MultipleChoiceQuiz]].\n */\nexport interface MultipleChoiceQuizInitialState {\n\n /**\n * Sets the available choices for the multiple-choice quiz.\n */\n choices: Choice[];\n}\n\n\n/**\n * A multiple-choice quiz.\n *\n * @example\n *```typescript\n *\n * import {MultipleChoiceQuiz, TextChoice} from '@lernetz/lernfragen/components/choice-quiz';\n *\n * const multipleChoiceQuiz = new MultipleChoiceQuiz({\n * choices: [\n * new TextChoice({ text: 'I am a correct answer', correct: true }),\n * new TextChoice({ text: 'I am a wrong answer', correct: false }),\n * new TextChoice({ text: 'I am another correct answer', correct: true }),\n * ],\n * });\n *```\n */\nexport class MultipleChoiceQuiz extends ChoiceQuiz {\n\n /**\n * Initializes a new instance of the [[MultipleChoiceQuiz]] class.\n *\n * @param initialState Specifies the initial state for the new instance.\n * @param data An optional object to be passed through to the base class' ([[Model]]) constructor.\n */\n public constructor(initialState: MultipleChoiceQuizInitialState, data: object = {}) {\n super({ type: 'multiple', ...initialState }, data);\n }\n}\n\n\n/**\n * Base `View` class to render a [[MultipleChoiceQuiz]].\n * Subclass this type if you want to use a different template.\n */\nexport class MultipleChoiceQuizView extends ChoiceQuizView {\n\n public constructor(config: ViewConfig = {}) {\n super('multiple', config);\n }\n}\n","/** @module components/choice-quiz */\n\n\n/**/\nimport {ViewConfig} from '@lernetz/ts-lib/src/core/view/View';\n\nimport {Choice} from './Choice';\nimport {ChoiceQuiz, ChoiceQuizView} from './ChoiceQuiz';\n\n\n/**\n * Specifies the initial state of a [[SingleChoiceQuiz]].\n */\nexport interface SingleChoiceQuizInitialState {\n\n /**\n * Sets the available choices for the single-choice quiz.\n */\n choices: Choice[];\n}\n\n\n/**\n * A single-choice quiz.\n *\n * @example\n *```typescript\n *\n * import {SingleChoiceQuiz, TextChoice} from '@lernetz/lernfragen/components/choice-quiz';\n *\n * const singleChoiceQuiz = new SingleChoiceQuiz({\n * choices: [\n * new TextChoice({ text: 'I am the only correct answer', correct: true }),\n * new TextChoice({ text: 'I am a wrong answer', correct: false }),\n * new TextChoice({ text: 'I am another wrong answer', correct: false }),\n * ],\n * });\n *```\n */\nexport class SingleChoiceQuiz extends ChoiceQuiz {\n\n /**\n * Initializes a new instance of the [[SingleChoiceQuiz]] class.\n *\n * @param initialState Specifies the initial state for the new instance.\n * @param data An optional object to be passed through to the base class' ([[Model]]) constructor.\n */\n public constructor(initialState: SingleChoiceQuizInitialState, data: object = {}) {\n super({ type: 'single', ...initialState }, data);\n }\n}\n\n\n/**\n * Base `View` class to render a [[SingleChoiceQuiz]].\n * Subclass this type if you want to use a different template.\n */\nexport class SingleChoiceQuizView extends ChoiceQuizView {\n\n public constructor(config: ViewConfig = {}) {\n super('single', config);\n }\n}\n","/* Auto generated by gulp-typescript-template */\n\nexport const clozedropdown = `
`;\nexport const customizedMultipleChoiceTemplate = `
`;\nexport const customizedSingleChoiceTemplate = `

`;\n","\nimport { SingleChoiceQuizView, TextChoice, TextChoiceView } from '@lernetz/lernfragen/components/choice-quiz';\nimport {customizedSingleChoiceTemplate as template } from '../../templates/components/quiz-overwrite'\n\nexport class CustomizedSingleChoiceQuizView extends SingleChoiceQuizView {\n constructor() {\n super({ registrations: CustomizedSingleChoiceQuizView.createRegistrations() })\n }\n \n static createRegistrations() {\n const registrations = SingleChoiceQuizView.createRegistrations('single');\n registrations.set(TextChoice, () => new TextChoiceView('single', { template: template}));\n return registrations;\n }\n}","\nimport { MultipleChoiceQuizView, TextChoice, TextChoiceView } from '@lernetz/lernfragen/components/choice-quiz';\nimport {customizedMultipleChoiceTemplate as template } from '../../templates/components/quiz-overwrite'\n\nexport class CustomizedMultipleChoiceQuizView extends MultipleChoiceQuizView {\n constructor() {\n super({ registrations: CustomizedMultipleChoiceQuizView.createRegistrations() })\n }\n \n static createRegistrations() {\n const registrations = MultipleChoiceQuizView.createRegistrations('multiple');\n registrations.set(TextChoice, () => new TextChoiceView('multiple', { template: template}));\n return registrations;\n }\n}","/** @module components/cloze-quiz */\n\n\n/**/\nimport Model from '@lernetz/ts-lib/src/core/model/Model';\nimport {View} from '@lernetz/ts-lib/src/core/view/View';\n\nimport {CanShowCorrectness} from '../quiz';\n\n\n/**\n * Specifies the initial state of a [[SelectSpanChoice]].\n */\nexport interface SelectSpanChoiceInitialState {\n\n /**\n * Sets whether this is the correct choice.\n */\n correct: boolean;\n\n /**\n * Sets whether this should should be initially selected. Defaults to `false`.\n */\n selected?: boolean;\n\n /**\n * Sets whether the correctness of this choice should be initially displayed.\n * Defaults to `false`.\n */\n showCorrectness?: boolean;\n\n /**\n * Sets the text that should be displayed for this choice.\n */\n text: string;\n}\n\n\n/**\n * A choice for a cloze-dropdown\n */\nexport class SelectSpanChoice extends Model implements CanShowCorrectness {\n\n /**\n * Initializes a new instance of the [[ClozeChoice]] class.\n *\n * @param initialState Specifies the initial state for the new instance.\n * @param data An optional object to be passed through to the base class' ([[Model]]) constructor.\n */\n public constructor(initialState: SelectSpanChoiceInitialState, data: object = {}) {\n super({\n showCorrectness: false,\n correct: false,\n selected: false,\n text: '',\n ...initialState,\n ...data\n });\n }\n\n /**\n * Gets whether this is the correct choice.\n */\n public readonly correct: boolean;\n\n /**\n * Gets or sets whether this choice is currently selected.\n */\n public selected: boolean;\n\n /**\n * Gets or sets whether the correctness of this choice should be shown.\n */\n public showCorrectness: boolean;\n\n /**\n * Gets the text that is displayed for this choice.\n */\n public readonly text: string;\n}\n\n\n/**\n * View class accompanying [[SelectSpanChoice]] that makes sure the initial [[selected]] state\n * is correctly transferred into the DOM.\n */\nexport class SelectSpanChoiceView extends View {\n\n constructor() {\n super({});\n }\n\n init() {\n this.node.innerHTML = this.data.text;\n\n // The `selected` attribute only specifies whether the option is *initially* selected,\n // therefore we don't need to keep it in sync with `this.data.selected` later on:\n if (this.data.selected) {\n this.node.setAttribute('selected', '');\n }\n }\n}\n","/* Auto generated by gulp-typescript-template */\n\nexport const clozeQuizTemplate = `

`;\nexport const selectSpanTemplate = ` `;\nexport const textSpanTemplate = ` [[text]]`;\n","/** @module components/cloze-quiz */\n\n\n/**/\nimport Model from '@lernetz/ts-lib/src/core/model/Model';\nimport {View, ViewConfig, ViewRegistrationMap} from '@lernetz/ts-lib/src/core/view/View';\n\nimport {Span} from './Span';\nimport {SelectSpanChoice, SelectSpanChoiceView} from './SelectSpanChoice';\n\nimport {CanShowCorrectness} from '../quiz';\n\nimport {selectSpanTemplate} from '../../templates/cloze-quiz';\n\n\n/**\n * Specifies the initial state for a [[SelectSpan]].\n */\nexport interface SelectSpanInitialState {\n\n /**\n * Sets the choices that are available in this [[SelectSpan]].\n */\n choices: SelectSpanChoice[];\n\n /**\n * Sets whether the correctness of the selected choice should be initially shown.\n * Defaults to `false`.\n */\n showCorrectness?: boolean;\n}\n\n\n/**\n * An `
`;\n","import Model from 'ln/model/Model';\nimport {View, ViewConstructor} from 'ln/view/View';\nimport {AttributeChangeObservable, AttributeChange} from '@lernetz/ts-lib/src/core/model/Model';\nimport {SolutionInputAnswer as AnswerTemplate } from '../../templates/components/solutioninput';\nimport { CanShowCorrectness } from '@lernetz/lernfragen/components/quiz';\nimport { Signal, Observable } from '@lernetz/ts-lib/src/core/signal/Signal';\n\nexport class SolutionInputAnswer extends Model implements CanShowCorrectness {\n correct: boolean;\n answered: boolean;\n text: string;\n solutions: [{solution: string}];\n showCorrectness: boolean;\n //change: Signal; //wozu brauchts das, wenn vom Model geerbt wird?\n \n\n constructor(data: {correct, answered, text, solutions, showCorrectness }) {\n super(data)\n }\n\n public updateText(e) {\n this.answered = true;\n let text = this.text;\n this.text = e.target.value;\n this.correct = this.solutions.filter( ( item ) => item.solution.toLowerCase() === this.text.toLowerCase() ).length > 0 ? true : false ;\n this.change.dispatch( {name: text, newValue: this.text, oldValue:text} );\n }\n}\n\nexport class SolutionInputAnswerView extends View {\n constructor() {\n super({template: AnswerTemplate })\n }\n}","import Model from 'ln/model/Model';\nimport {View, ViewConstructor} from 'ln/view/View';\nimport {setup} from 'ln/setup/Setup';\nimport {ViewDefinition} from 'ln/view/View';\nimport {AttributeChangeObservable} from '@lernetz/ts-lib/src/core/model/Model';\n\nimport Template from '@lernetz/ts-lib/src/core/view/Template';\nimport { renderer } from '@lernetz/ts-lib/src/core/view/Renderer';\n\nimport {Quiz, QuizInputState, QuizVisitor} from '@lernetz/lernfragen/components/quiz';\n\n\nimport {SolutionInput as template} from '../../templates/components/solutioninput';\n\nimport {SolutionInputAnswer } from './SolutionInputAnswer';\nimport { CanShowCorrectness } from '@lernetz/lernfragen/components/quiz';\n\n\nexport class SolutionInput extends Model implements Quiz {\n\n public inputState: QuizInputState;\n\n public readonly answers: SolutionInputAnswer[];\n public readonly totalSolutions: number;\n public readonly elements: [];\n \n\n constructor(initialState: SolutionInputInitialState, data: object = {}) {\n super({\n answers:[],\n inputState: 'none',\n ...initialState,\n ...data\n });\n\n\n for (let step = 0; step < this.totalSolutions; step++) {\n let answer = new SolutionInputAnswer( { correct: false, answered: false, text: '', solutions: this.elements, showCorrectness: false } );\n answer.change.subscribe( ()=> this.updateInputState( ) );\n this.answers.push( answer )\n }\n\n //this.updateInputState();\n }\n\n public updateInputState() {\n // find duplicates\n // todo: make it nice...\n this.answers.map( (item, index) => {\n let found = this.answers.filter( (inner) => {\n return item.text.toLowerCase() === inner.text.toLowerCase();\n })\n if (found.length > 1) {\n found.forEach( (duplicate, index) => {\n if (index > 0) {\n duplicate.correct = false;\n }\n })\n }\n });\n \n this.inputState = this.answers.some(answer => answer.correct === false) ? 'incorrect' : 'correct';\n\n }\n\n public accept(visitor: QuizVisitor): TResult {\n if (isSolutionInputAnswerVisitor(visitor)) {\n return visitor.visitSolutionInputAnswer(this);\n }\n }\n}\n\nfunction isSolutionInputAnswerVisitor(visitor: QuizVisitor): visitor is SolutionInputAnswerVisitor {\n return typeof visitor['visitSolutionInputAnswer'] !== 'undefined';\n}\n\nexport interface SolutionInputAnswerVisitor extends QuizVisitor {\n visitSolutionInputAnswer(quiz: SolutionInput): TResult;\n}\n\nexport interface SolutionInputInitialState {\n /**\n * Sets the available choices for the choice quiz.\n */\n answers: [];\n}\n\n\nexport class SolutionInputView extends View {\n public constructor() {\n super({ template: template });\n }\n}","/** @module components/choice-quiz */\n\n\n/**/\nimport Model from '@lernetz/ts-lib/src/core/model/Model';\nimport {View, ViewConfig, ViewRegistrationMap} from '@lernetz/ts-lib/src/core/view/View';\nimport Repeat from '@lernetz/ts-lib/src/components/Repeat';\n\nimport {Choice} from '@lernetz/lernfragen/components/choice-quiz';\nimport {TextChoice, TextChoiceView} from '@lernetz/lernfragen/components/choice-quiz';\n\nimport {Quiz, QuizInputState, QuizVisitor} from '@lernetz/lernfragen/components/quiz';\n\nimport {choiceQuizTemplate} from '@lernetz/lernfragen/templates/choice-quiz';\n\n\nimport {ChoiceQuizInitialState, ChoiceQuizType} from '@lernetz/lernfragen/components/choice-quiz';\n\n\nexport interface ChoiceQuizCorrectVisitor extends QuizVisitor {\n visitChoiceQuizCorrect(quiz: ChoiceQuizCorrect): TResult;\n}\n\nfunction isChoiceQuizCorrectVisitor(visitor: QuizVisitor): visitor is ChoiceQuizCorrectVisitor {\n return typeof visitor['visitChoiceQuizCorrect'] !== 'undefined';\n}\n\n\n//allways has a correct input state\nexport abstract class ChoiceQuizCorrect extends Model implements Quiz {\n\n protected constructor(initialState: ChoiceQuizInitialState, data: object = {}) {\n super({\n choices: [],\n inputState: 'none',\n type: 'multiple',\n ...initialState,\n ...data\n });\n\n this.updateInputState();\n }\n\n private dirty: boolean;\n\n /**\n * Gets all choices in the quiz.\n */\n public readonly choices: Choice[];\n\n /** @inheritdoc */\n public readonly inputState: QuizInputState;\n\n /**\n * Gets the type of this choice quiz (either `'single'` or `'multiple'`).\n */\n public readonly type: ChoiceQuizType;\n\n public accept(visitor: QuizVisitor): TResult {\n if (isChoiceQuizCorrectVisitor(visitor)) {\n return visitor.visitChoiceQuizCorrect(this);\n }\n }\n\n public onChoiceClicked(choice: Choice): void {\n this.dirty = true;\n switch (this.type) {\n\n case 'multiple':\n choice.selected = !choice.selected;\n break;\n\n case 'single':\n for (const ch of this.choices) {\n ch.selected = (ch === choice);\n }\n break;\n }\n this.change.dispatch({name: 'inputState', newValue: 'correct', oldValue: 'correct'})\n }\n\n /**\n * Updates the [[inputState]] property.\n */\n protected updateInputState(): void {\n let inputState: QuizInputState;\n this.set('inputState', 'correct');\n }\n}\n","\nimport {ViewConfig} from '@lernetz/ts-lib/src/core/view/View';\n\nimport {Choice} from '@lernetz/lernfragen/components/choice-quiz';\n\nimport {MultipleChoiceQuizInitialState} from '@lernetz/lernfragen/components/choice-quiz'; \nimport {ChoiceQuizView} from '@lernetz/lernfragen/components/choice-quiz';\nimport {ChoiceQuizCorrect} from './ChoiceQuizCorrect';\n\n\nexport class MultipleChoiceCorrectQuiz extends ChoiceQuizCorrect {\n\n /**\n * Initializes a new instance of the [[MultipleChoiceQuiz]] class.\n *\n * @param initialState Specifies the initial state for the new instance.\n * @param data An optional object to be passed through to the base class' ([[Model]]) constructor.\n */\n public constructor(initialState: MultipleChoiceQuizInitialState, data: object = {}) {\n super({ type: 'multiple', ...initialState }, data);\n }\n}\n","/* Auto generated by gulp-typescript-template */\n\nexport const PostcardTemplate = `
[[ title ]]

[[ sender ]]
`;\n","import Model from 'ln/model/Model';\nimport {ViewDefinition, View} from 'ln/view/View';\nimport { renderer } from '@lernetz/ts-lib/src/core/view/Renderer';\nimport {PostcardTemplate as template} from 'templates/components/postcard';\nimport {setup, SetupConfig} from 'ln/setup/Setup';\nimport { HttpRequest } from 'ln/request/Request';\n\nexport class Postcard extends Model {\n\n\n linkText: string;\n slug: string;\n title: string;\n sender: string;\n scrollPosition: number;\n image: string;\n\n dropdowns: [{\n name:string;\n choices: [{\n text: string;\n }]\n }]\n id: number;\n openPostcard: boolean;\n\n\n\n\n public constructor(dto: object) {\n super({\n openPostcard: false,\n dropdowns: [],\n page: null,\n scrollPosition: 0,\n id: null,\n image: '',\n ...dto\n });\n }\n\n public togglePostcard() {\n this.openPostcard = ! this.openPostcard;\n if (this.openPostcard === true ) {\n this.scrollPosition = window.scrollY;\n }\n }\n\n\n}\n\n\nexport class PostcardView extends View {\n\n public constructor() {\n super({ template: template });\n }\n\n public init() {\n\n this.data.change.filter( (e)=> {\n return e.name === 'openPostcard'\n }).subscribe( (p)=> {\n\n if (p.newValue === true) {\n document.body.style.position = 'fixed';\n document.querySelector('.header').setAttribute('style', 'display:none')\n }\n else {\n document.body.style.position = '';\n document.body.style.top = '';\n document.querySelector('.header').removeAttribute('style');\n window.scrollTo(0, this.data.scrollPosition) ;\n }\n\n });\n }\n\n\n}\n\n\n// create model for data binding\nexport class DropDown extends Model {\n\n constructor( dto? ) {\n super( { selection:null, ...dto } );\n }\n}\n","import register from 'ln/setup/register';\n\nimport Html from 'ln/components/Html';\nimport Repeat from 'ln/components/Repeat';\nimport Image from './util/Image';\nimport Show from '@lernetz/ts-lib/src/components/Show';\n\n\nimport BackgroundImage from './util/BackgroundImage';\nimport StaticImage from './util/StaticImage';\n\nimport { SingleChoiceQuiz, SingleChoiceQuizView, MultipleChoiceQuiz, MultipleChoiceQuizView, TextChoice, TextChoiceView } from '@lernetz/lernfragen/components/choice-quiz';\n\nimport { CustomizedSingleChoiceQuizView } from './quiz-overwrite/CustomizedSingleChoiceQuizView';\nimport { CustomizedMultipleChoiceQuizView } from './quiz-overwrite/CustomizedMultipleChoiceQuizView';\n\nimport { ClozeQuiz, ClozeQuizView, createClozeQuizFromText } from '@lernetz/lernfragen/components/cloze-quiz';\nimport { HotSpotQuiz, HotSpotQuizView, RectangularHotSpotArea } from '@lernetz/lernfragen/components/hot-spot-quiz';\nimport ImageModel from \"./image/ImageModel\";\nimport {Image as imageTemplate } from \"../templates/components/image\";\nimport { CustomizedClozeQuizView } from './quiz-overwrite/CustomizedClozeQuizView';\nimport {AudioService} from './services/AudioService';\n\n\nimport {PlaceholderView} from './util/Placeholder';\n\nimport {StoryPage, StoryPageView} from './storypage/StoryPage';\nimport {StoryText, StoryTextView} from './storytext/StoryText';\nimport {StoryQuiz, StoryQuizView} from './storyquiz/StoryQuiz';\nimport {StorySolution, StorySolutionView} from './storysolution/StorySolution';\nimport {StoryImage, StoryImageView} from './storyimage/StoryImage';\nimport {Chapter, ChapterView} from './chapter/Chapter';\n\nimport {Footer, FooterView} from './footer/Footer';\n\nimport {QuizPresenter, QuizPresenterView } from './quizpresenter/QuizPresenter';\n\n\nimport {AudioPlayer, AudioPlayerView} from './util/AudioPlayer';\n\nimport {StoryPreview, StoryPreviewView} from './startpage/StoryPreview';\n\nimport {Navigation, NavigationView} from './navigation/Navigation';\nimport { DropDownView } from './dropdown/DropDown';\n\nimport {StartPage, StartPageView} from './startpage/StartPage';\nimport {SinglePage, SinglePageView} from './singlepage/SinglePage';\n\nimport {TitleElement, TitleElementView} from './elements/TitleElement';\nimport {ParagraphElement, ParagraphElementView} from './elements/ParagraphElement';\nimport {ImageElement, ImageElementView} from './elements/ImageElement';\n\nimport {ResourceList, ResourceListView} from './elements/ResourceList';\nimport {LinkItem, LinkItemView} from './elements/LinkItem';\nimport {DownloadItem, DownloadItemView} from './elements/DownloadItem';\n\nimport {setup} from 'ln/setup/Setup';\nimport {SiteView, Site} from './site/Site';\n\nimport { SolutionInput, SolutionInputView } from './solutioninput/SolutionInput';\nimport { SolutionInputAnswer, SolutionInputAnswerView } from './solutioninput/SolutionInputAnswer';\n\nimport { MultipleChoiceCorrectQuiz } from './multiplechoicecorrect/MultipleChoiceCorrectQuiz';\nimport {Postcard, PostcardView, DropDown} from './postcard/Postcard';\n\nexport const {viewRegistrations} = register(({ model, view }) => {\n\n view('default', PlaceholderView);\n view('html', Html);\n view('repeat', Repeat);\n view( 'Image', Image );\n view('show', Show);\n\n view( 'BackgroundImage', BackgroundImage );\n view( 'StaticImage', StaticImage );\n\n view('Navigation', NavigationView);\n view('DropDown', DropDownView );\n\n //test for new start page route (app can get deleted afterward)\n //this is done via data data attribute in the blade template\n //const getSite = () => setup.data('data') as Site;\n view('Site', SiteView);\n model('App\\\\Site',Site);\n\n model('App\\\\StartPage', StartPage).view(StartPageView);\n view('StoryPreview', StoryPreviewView);\n\n model('App\\\\SinglePage', SinglePage).view(SinglePageView);\n\n view('Footer', FooterView);\n\n\n model('App\\\\TitleElement', TitleElement).view(TitleElementView);\n model('App\\\\ParagraphElement', ParagraphElement).view(ParagraphElementView);\n model('App\\\\ImageElement', ImageElement).view(ImageElementView);\n model('App\\\\ResourceList', ResourceList).view(ResourceListView);\n model('App\\\\DownloadItem', DownloadItem).view(DownloadItemView);\n model('App\\\\LinkItem', LinkItem).view(LinkItemView);\n\n\n //todDo: audioData in AudioPlayer Model...\n //no model key ?\n view('Audio', AudioPlayerView)\n\n model('App\\\\StoryPage', StoryPage).view(StoryPageView);\n model('App\\\\Chapter', Chapter).view(ChapterView);\n model('App\\\\StoryText', StoryText).view(StoryTextView);\n model('App\\\\StoryQuiz', StoryQuiz).view(StoryQuizView);\n model('App\\\\StoryImage', StoryImage).view(StoryImageView);\n model('App\\\\Postcard', Postcard).view(PostcardView);\n model('App\\\\StorySolution', StorySolution).view(StorySolutionView);\n model('App\\\\PostcardDropDown',DropDown );\n\n\n\n //the quiz\n model( 'App\\\\ChoiceAnswer', (json:any) => new TextChoice( { text:json.text, correct:json.correct || false }));\n //not uses yet, but gives the possibility to overwrite the result in the template for the MultipleChoiceCorrectQuiz\n model( 'App\\\\ChoiceAnswerCorrect', (json:any) => new TextChoice( { text:json.text, correct:json.correct || false }));\n\n model('App\\\\SingleChoice', (json:any) => {\n const quiz = new SingleChoiceQuiz({ choices: json.answers || [] });\n return new QuizPresenter(quiz, json.title, json.question, json.image, json.posFeedback, json.negFeedback, json.infoText );\n });\n view(SingleChoiceQuiz, CustomizedSingleChoiceQuizView)\n\n model('App\\\\MultipleChoice', (json:any) => {\n const quiz = new MultipleChoiceQuiz({ choices: json.answers || [] });\n return new QuizPresenter(quiz, json.title, json.question, json.image, json.posFeedback, json.negFeedback );\n });\n view(MultipleChoiceQuiz, CustomizedMultipleChoiceQuizView);\n\n model('App\\\\MultipleChoiceCorrect', (json:any) => {\n const quiz = new MultipleChoiceCorrectQuiz({ choices: json.answers || [] });\n return new QuizPresenter(quiz, json.title, json.question, json.image, json.posFeedback, json.posFeedback );\n });\n view(MultipleChoiceCorrectQuiz, CustomizedMultipleChoiceQuizView);\n\n model('App\\\\DropDown', (json:any) => {\n const quiz = createClozeQuizFromText(json.text);\n return new QuizPresenter(quiz, json.title, json.question, json.image, json.posFeedback, json.negFeedback );\n });\n view(ClozeQuiz, CustomizedClozeQuizView ); //select-span view = dropdown\n\n model( 'App\\\\Image', ImageModel).view({ template: imageTemplate });\n // view( 'ImageElement', {\n // template: imageTemplate,\n // });\n\n model('App\\\\Hotspot', (json:any) => {\n const background = new ImageModel(json);\n const hotSpotAreas = json.hotspot_areas.map(hsa => new RectangularHotSpotArea( {  topLeft: { x: hsa.left, y: hsa.top }, bottomRight: { x: hsa.left + hsa.width, y: hsa.top + hsa.height } }));\n const quiz = new HotSpotQuiz({ background , hotSpotAreas, spots: [] }, json);\n\n return new QuizPresenter(quiz, json.title, json.question, null, json.posFeedback, json.negFeedback );\n });\n view(HotSpotQuiz, HotSpotQuizView);\n\n //model(DragAndDropQuiz).view(() => new DragAndDropQuizView({ template: customizedDragAndDropQuizTemplate }));\n\n // model(TextChoice).view( ()=> new class extends TextChoiceView {\n // constructor() {\n // super(test);\n // }\n // } );\n\n model( 'App\\\\SolutionInput', (json:any) => {\n let quiz = new SolutionInput(json)\n return new QuizPresenter(quiz, json.title, json.question, json.image, json.posFeedback, json.negFeedback );\n });\n\n view(SolutionInput, SolutionInputView);\n view(SolutionInputAnswer, SolutionInputAnswerView);\n\n\n\n\n view(QuizPresenter, QuizPresenterView);\n\n\n});\n","import Lang from 'ln/lang/Lang';\nimport {renderer} from 'ln/view/Renderer';\nimport {scan} from 'ln/view/View';\nimport {setup, SetupConfig} from 'ln/setup/Setup';\nimport Request from 'ln/request/Request';\n\nimport {viewRegistrations} from './components/register';\n\n\n// export function load(dataUri: string) {\n// Request.get(dataUri).load().then(init);\n// }\n\nexport function init(data: SetupConfig) {\n renderer.logging = true;\n setup.init(data);\n\n renderer.context.setup = setup;\n\n\trenderer.context.imagePath = function(image: { file_name: string }, preset: string = 'medium', ext: string = 'png') {\n if( !image ) return 'https://via.placeholder.com/233x150/F0F0F0/000000?text=Bild fehlt';\n return decodeURIComponent(setup.route('asset', { file_name: image.file_name, preset, ext }).url());\n }\n\n\n Lang.add(setup.data('lang'));\n\n scan(document.body, viewRegistrations);\n\n // window.history.pushState = new Proxy(window.history.pushState, {\n // apply: (target, thisArg, argArray) => {\n // // trigger here what you need\n // console.log(target)\n // console.log(thisArg)\n // console.log(argArray[0]['title'])\n\n // //return target.apply(thisArg, argArray);\n // },\n // });\n\n}\n\n\nexport function trackPageView( pageName: string) {\n\n window['dataLayer'].push({\n 'event': 'page_change', // static Event Name\n 'virtual_pageview': 'true', // SPA route change indicator, boolean true/false\n 'virtual_page_name': pageName, // SPA route change/transition new page name/page title\n 'virtual_url': 'https://reise-abenteuer.ch', // SPA route change new URL\n 'page_name_language_neutral': pageName, // required\n //'page_url_language_neutral': '<>', // required\n 'page_url_language_neutral': 'https://reise-abenteuer.ch', // required\n });\n\n}\n"],"names":["template","Image","StoryQuiz","Footer","ShowCorrectnessOfGivenAnswersQuizVisitor","AudioPlayer","Navigation","StoryPage","SinglePage","StartPage","AnswerTemplate","SolutionInputAnswer","Lang"],"mappings":";;;CASA;;;CAGA;KAAA;SAES,YAAO,GAAkB,EAAE,CAAC;MA6BpC;;;;KAxBA,wBAAG,GAAH,UAAK,MAAmB;SACvB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAE,MAAM,CAAE,CAAC;MAC5B;;;;KAMD,wBAAG,GAAH,UAAK,GAAU,EAAE,QAAgB;SAEhC,IAAI,MAAM,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;;SAGhC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAG;aAC/B,MAAM,GAAG,CAAC,CAAE,CAAC,CAAE,CAAC,MAAM,CAAE,GAAG,CAAE,CAAC;aAC9B,IAAI,MAAM,IAAI,IAAI;iBAAG,OAAO,MAAM,CAAC;UACnC;;SAGD,IAAI,QAAQ,KAAK,SAAS;aAAG,OAAO,QAAQ,CAAC;;SAG7C,OAAO,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC;MACxB;KACF,iBAAC;CAAD,CAAC,IAAA;;CC3CD;;;CAUA;;;AAGA,UAAgB,MAAM,CAAE,KAAS,EAAE,OAAoC;;KAGtE,IAAI,KAAK,GAAoB,CAAE,CAAC,KAAK,CAAC,OAAO,CAAE,OAAO,CAAE,IAAK,CAAE,OAAO,CAAE,GAAG,OAAO,CAAC;;KAGnF,IAAI,KAAK,CAAC,OAAO,CAAE,QAAQ,CAAE,IAAI,CAAC,EAAG;SACpC,IAAI,KAAK,GAAG,KAAK,IA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