Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@heduapp/book-objects

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@heduapp/book-objects - npm Package Compare versions

Comparing version 0.16.0 to 0.16.1

.vscode/launch.json

2

business-object/abstract-business-object.d.ts

@@ -24,2 +24,4 @@ import { Comment } from './comment';

readonly uuid: UUID;
static defaultLocale: Locales;
static objectTypesWithLocale: BusinessObjectType[];
/**

@@ -26,0 +28,0 @@ * TypeScript does not support different access signatures on getters and setters, hence this solution.

2

business-object/index.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),s=n(4),u=[i.BusinessObjectType.Book,i.BusinessObjectType.Chapter,i.BusinessObjectType.Problem,i.BusinessObjectType.Supplement,i.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,i,u){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===i&&(i=s.Locales.Czech),void 0===u&&(u=o.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=u,this.internalChildren=[],this.internalLocale=s.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=i}return Object.defineProperty(e.prototype,"locale",{get:function(){return u.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(i.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(i.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=u.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},function(e,t){e.exports=require("uuid")},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US",e.EnglishGB="en-GB",e.Slovak="sk-SK",e.Italian="it-IT",e.Polish="pl-PL",e.German="de-DE"}(t.Locales||(t.Locales={}))},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var o=n(0);t.BusinessObjectType=o.BusinessObjectType;var i=n(10);t.BookType=i.BookType;var s=n(11);t.Book=s.Book;var u=n(12);t.Chapter=u.Chapter;var c=n(13);t.Comment=c.Comment;var p=n(14);t.GenericObject=p.GenericObject;var a=n(15);t.Text=a.Text;var f=n(16);t.Answer=f.Answer;var l=n(17);t.Environment=l.Environment;var b=n(18);t.Supplement=b.Supplement;var d=n(19);t.Question=d.Question;var h=n(20);t.Problem=h.Problem;var y=n(21);t.Link=y.Link;var v=n(9);t.Content=v.Content;var O=n(4);t.Locales=O.Locales},,,function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Content,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Content=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Book="BOOK",e.Worksheet="WORKSHEET",e.Tests="TESTS",e.Preparations="PREPARATIONS",e.Mixture="MIXTURE"}(t.BookType||(t.BookType={}))},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i){return void 0===r&&(r=u.Locales.Czech),void 0===i&&(i=o.v4()),e.call(this,s.BusinessObjectType.Book,t,0,n,r,i)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(s.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Chapter,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(s.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(s.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Comment,t,n,r,i,c)||this}return r(t,e),t}(i.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r,o,i){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i=u.v4());var c=e.call(this,s.BusinessObjectType.Generic,n,r,o,void 0,i)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(i.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=u.v4());var o=e.call(this,s.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return o.text=t,o}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{text:this.text})},t}(i.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Answer,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Answer=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Environment,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Environment=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Supplement,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(s.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(s.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Question,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===i.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(i.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Question=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Problem,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(s.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(s.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(s.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(s.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Link,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Link=u}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),s=n(4),u=function(){function e(t,n,r,i,s,u){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i={}),void 0===s&&(s=e.defaultLocale),void 0===u&&(u=o.v4());var c=this;this.objectType=t,this.sortOrder=r,this.attributes=i,this.uuid=u,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=n.map(function(e){return e.changeParent(c)}),this.internalLocale=s}return Object.defineProperty(e.prototype,"locale",{get:function(){var t=e.defaultLocale,n=e.objectTypesWithLocale;return this.internalLocale!==t&&n.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(i.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(i.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var t=this,n=e.objectTypesWithLocale.reduce(function(e,n){if(e)return e;var r=t.findParent(n);return r?r.locale:void 0},void 0);return n||this.objectType!==i.BusinessObjectType.Book?n||this.locale:e.defaultLocale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e.defaultLocale=s.Locales.Czech,e.objectTypesWithLocale=[i.BusinessObjectType.Comment,i.BusinessObjectType.Problem,i.BusinessObjectType.Supplement,i.BusinessObjectType.Chapter,i.BusinessObjectType.Book],e}();t.AbstractBusinessObject=u},function(e,t){e.exports=require("uuid")},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US",e.EnglishGB="en-GB",e.Slovak="sk-SK",e.Italian="it-IT",e.Polish="pl-PL",e.German="de-DE"}(t.Locales||(t.Locales={}))},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var o=n(0);t.BusinessObjectType=o.BusinessObjectType;var i=n(10);t.BookType=i.BookType;var s=n(11);t.Book=s.Book;var u=n(12);t.Chapter=u.Chapter;var c=n(13);t.Comment=c.Comment;var p=n(14);t.GenericObject=p.GenericObject;var a=n(15);t.Text=a.Text;var f=n(16);t.Answer=f.Answer;var l=n(17);t.Environment=l.Environment;var b=n(18);t.Supplement=b.Supplement;var d=n(19);t.Question=d.Question;var h=n(20);t.Problem=h.Problem;var y=n(21);t.Link=y.Link;var v=n(9);t.Content=v.Content;var O=n(4);t.Locales=O.Locales},,,function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Content,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Content=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Book="BOOK",e.Worksheet="WORKSHEET",e.Tests="TESTS",e.Preparations="PREPARATIONS",e.Mixture="MIXTURE"}(t.BookType||(t.BookType={}))},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i){return void 0===r&&(r=u.Locales.Czech),void 0===i&&(i=o.v4()),e.call(this,s.BusinessObjectType.Book,t,0,n,r,i)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(s.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Chapter,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(s.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(s.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Comment,t,n,r,i,c)||this}return r(t,e),t}(i.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r,o,i){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i=u.v4());var c=e.call(this,s.BusinessObjectType.Generic,n,r,o,void 0,i)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(i.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=u.v4());var o=e.call(this,s.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return o.text=t,o}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{text:this.text})},t}(i.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Answer,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Answer=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Environment,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Environment=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Supplement,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(s.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(s.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Question,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===i.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(i.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Question=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Problem,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(s.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(s.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(s.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(s.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Link,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Link=u}])});
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=39)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(4),s=[i.BusinessObjectType.Book,i.BusinessObjectType.Chapter,i.BusinessObjectType.Problem,i.BusinessObjectType.Supplement,i.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,i,s){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===i&&(i=u.Locales.Czech),void 0===s&&(s=o.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=s,this.internalChildren=[],this.internalLocale=u.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=i}return Object.defineProperty(e.prototype,"locale",{get:function(){return s.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(i.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(i.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=s.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},function(e,t){e.exports=require("uuid")},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US",e.EnglishGB="en-GB",e.Slovak="sk-SK",e.Italian="it-IT",e.Polish="pl-PL",e.German="de-DE"}(t.Locales||(t.Locales={}))},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var o=n(0);t.BusinessObjectType=o.BusinessObjectType;var i=n(10);t.BookType=i.BookType;var u=n(11);t.Book=u.Book;var s=n(12);t.Chapter=s.Chapter;var c=n(13);t.Comment=c.Comment;var p=n(14);t.GenericObject=p.GenericObject;var a=n(15);t.Text=a.Text;var f=n(16);t.Answer=f.Answer;var l=n(17);t.Environment=l.Environment;var b=n(18);t.Supplement=b.Supplement;var d=n(19);t.Question=d.Question;var h=n(20);t.Problem=h.Problem;var y=n(21);t.Link=y.Link;var v=n(9);t.Content=v.Content;var O=n(4);t.Locales=O.Locales},,,function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Content,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Content=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Book="BOOK",e.Worksheet="WORKSHEET",e.Tests="TESTS",e.Preparations="PREPARATIONS",e.Mixture="MIXTURE"}(t.BookType||(t.BookType={}))},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i){return void 0===r&&(r=s.Locales.Czech),void 0===i&&(i=o.v4()),e.call(this,u.BusinessObjectType.Book,t,0,n,r,i)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(u.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Chapter,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(u.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(u.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Comment,t,n,r,i,c)||this}return r(t,e),t}(i.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),u=n(0),s=n(2),c=function(e){function t(t,n,r,o,i){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i=s.v4());var c=e.call(this,u.BusinessObjectType.Generic,n,r,o,void 0,i)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(i.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),u=n(0),s=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=s.v4());var o=e.call(this,u.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return o.text=t,o}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{text:this.text})},t}(i.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Answer,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Answer=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Environment,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Environment=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Supplement,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(u.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(u.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Question,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===i.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(i.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Question=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Problem,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(u.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(u.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(u.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(u.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Link,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Link=s},,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(u,s)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),u=function(){function e(){var e=this;this.decodeObject=function(t){var n=t.children,r=t.attributes,o=t.objectType,u=t.elementType,s=t.locale,c=t.uuid,p=t.sortOrder,a=t.text,f=e.decodeChildren(n);switch(o){case i.BusinessObjectType.Book:return new i.Book(f,r,s,c);case i.BusinessObjectType.Chapter:return new i.Chapter(f,p,r,s,c);case i.BusinessObjectType.Comment:return new i.Comment(f,p,r,s,c);case i.BusinessObjectType.Problem:return new i.Problem(f,p,r,s,c);case i.BusinessObjectType.Supplement:return new i.Supplement(f,p,r,s,c);case i.BusinessObjectType.Question:return new i.Question(f,p,r,c);case i.BusinessObjectType.Answer:return new i.Answer(f,p,r,c);case i.BusinessObjectType.Environment:return new i.Environment(f,p,r,c);case i.BusinessObjectType.Link:return new i.Link(f,p,r,c);case i.BusinessObjectType.Content:return new i.Content(f,p,r,c);case i.BusinessObjectType.Text:return new i.Text(a,p,c);default:return new i.GenericObject(u||"unknown",f,p,r,c)}},this.decodeChildren=function(t){return t?t.map(e.decodeObject):[]}}return e.prototype.decode=function(e){return r(this,void 0,void 0,function(){return o(this,function(t){return[2,this.decodeSync(e)]})})},e.prototype.decodeSync=function(e){var t="string"==typeof e?JSON.parse(e):e;return this.decodeObject(t)},e}();t.JSONCodec=u}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=39)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),u=n(4),s=function(){function e(t,n,r,i,u,s){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i={}),void 0===u&&(u=e.defaultLocale),void 0===s&&(s=o.v4());var c=this;this.objectType=t,this.sortOrder=r,this.attributes=i,this.uuid=s,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=n.map(function(e){return e.changeParent(c)}),this.internalLocale=u}return Object.defineProperty(e.prototype,"locale",{get:function(){var t=e.defaultLocale,n=e.objectTypesWithLocale;return this.internalLocale!==t&&n.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(i.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(i.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var t=this,n=e.objectTypesWithLocale.reduce(function(e,n){if(e)return e;var r=t.findParent(n);return r?r.locale:void 0},void 0);return n||this.objectType!==i.BusinessObjectType.Book?n||this.locale:e.defaultLocale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e.defaultLocale=u.Locales.Czech,e.objectTypesWithLocale=[i.BusinessObjectType.Comment,i.BusinessObjectType.Problem,i.BusinessObjectType.Supplement,i.BusinessObjectType.Chapter,i.BusinessObjectType.Book],e}();t.AbstractBusinessObject=s},function(e,t){e.exports=require("uuid")},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US",e.EnglishGB="en-GB",e.Slovak="sk-SK",e.Italian="it-IT",e.Polish="pl-PL",e.German="de-DE"}(t.Locales||(t.Locales={}))},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var o=n(0);t.BusinessObjectType=o.BusinessObjectType;var i=n(10);t.BookType=i.BookType;var u=n(11);t.Book=u.Book;var s=n(12);t.Chapter=s.Chapter;var c=n(13);t.Comment=c.Comment;var p=n(14);t.GenericObject=p.GenericObject;var a=n(15);t.Text=a.Text;var f=n(16);t.Answer=f.Answer;var l=n(17);t.Environment=l.Environment;var b=n(18);t.Supplement=b.Supplement;var d=n(19);t.Question=d.Question;var h=n(20);t.Problem=h.Problem;var y=n(21);t.Link=y.Link;var v=n(9);t.Content=v.Content;var O=n(4);t.Locales=O.Locales},,,function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Content,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Content=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Book="BOOK",e.Worksheet="WORKSHEET",e.Tests="TESTS",e.Preparations="PREPARATIONS",e.Mixture="MIXTURE"}(t.BookType||(t.BookType={}))},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i){return void 0===r&&(r=s.Locales.Czech),void 0===i&&(i=o.v4()),e.call(this,u.BusinessObjectType.Book,t,0,n,r,i)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(u.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Chapter,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(u.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(u.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Comment,t,n,r,i,c)||this}return r(t,e),t}(i.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),u=n(0),s=n(2),c=function(e){function t(t,n,r,o,i){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i=s.v4());var c=e.call(this,u.BusinessObjectType.Generic,n,r,o,void 0,i)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(i.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),u=n(0),s=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=s.v4());var o=e.call(this,u.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return o.text=t,o}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{text:this.text})},t}(i.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Answer,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Answer=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Environment,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Environment=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Supplement,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(u.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(u.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Question,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===i.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(i.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Question=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),u=n(0),s=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,u.BusinessObjectType.Problem,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(u.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(u.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(u.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(u.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),u=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=u.v4()),e.call(this,i.BusinessObjectType.Link,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Link=s},,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(u,s)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),u=function(){function e(){var e=this;this.decodeObject=function(t){var n=t.children,r=t.attributes,o=t.objectType,u=t.elementType,s=t.locale,c=t.uuid,p=t.sortOrder,a=t.text,f=e.decodeChildren(n);switch(o){case i.BusinessObjectType.Book:return new i.Book(f,r,s,c);case i.BusinessObjectType.Chapter:return new i.Chapter(f,p,r,s,c);case i.BusinessObjectType.Comment:return new i.Comment(f,p,r,s,c);case i.BusinessObjectType.Problem:return new i.Problem(f,p,r,s,c);case i.BusinessObjectType.Supplement:return new i.Supplement(f,p,r,s,c);case i.BusinessObjectType.Question:return new i.Question(f,p,r,c);case i.BusinessObjectType.Answer:return new i.Answer(f,p,r,c);case i.BusinessObjectType.Environment:return new i.Environment(f,p,r,c);case i.BusinessObjectType.Link:return new i.Link(f,p,r,c);case i.BusinessObjectType.Content:return new i.Content(f,p,r,c);case i.BusinessObjectType.Text:return new i.Text(a,p,c);default:return new i.GenericObject(u||"unknown",f,p,r,c)}},this.decodeChildren=function(t){return t?t.map(e.decodeObject):[]}}return e.prototype.decode=function(e){return r(this,void 0,void 0,function(){return o(this,function(t){return[2,this.decodeSync(e)]})})},e.prototype.decodeSync=function(e){var t="string"==typeof e?JSON.parse(e):e;return this.decodeObject(t)},e}();t.JSONCodec=u}])});
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=36)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(4),u=[o.BusinessObjectType.Book,o.BusinessObjectType.Chapter,o.BusinessObjectType.Problem,o.BusinessObjectType.Supplement,o.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,o,u){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===o&&(o=s.Locales.Czech),void 0===u&&(u=i.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=u,this.internalChildren=[],this.internalLocale=s.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=o}return Object.defineProperty(e.prototype,"locale",{get:function(){return u.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(o.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(o.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=u.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},function(e,t){e.exports=require("uuid")},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US",e.EnglishGB="en-GB",e.Slovak="sk-SK",e.Italian="it-IT",e.Polish="pl-PL",e.German="de-DE"}(t.Locales||(t.Locales={}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Text=function(e){var t=e.text;return t?i.default.createElement("span",{className:"text"},t):null},t.Text.displayName="Text"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var i=n(0);t.BusinessObjectType=i.BusinessObjectType;var o=n(10);t.BookType=o.BookType;var s=n(11);t.Book=s.Book;var u=n(12);t.Chapter=u.Chapter;var c=n(13);t.Comment=c.Comment;var a=n(14);t.GenericObject=a.GenericObject;var l=n(15);t.Text=l.Text;var p=n(16);t.Answer=p.Answer;var f=n(17);t.Environment=f.Environment;var d=n(18);t.Supplement=d.Supplement;var b=n(19);t.Question=b.Question;var h=n(20);t.Problem=h.Problem;var v=n(21);t.Link=v.Link;var y=n(9);t.Content=y.Content;var m=n(4);t.Locales=m.Locales},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Title=function(e){var t=e.title;return t?i.default.createElement("h2",{className:"title"},t):null},t.Title.displayName="Title"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(28);t.Environment=function(e){var t=e.environment,n=e.displayAnswers;return o.default.createElement(s.EnvironmentStatic,r({},{environment:t,displayAnswers:n}))},t.Environment.displayName="Environment"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Content,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Content=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Book="BOOK",e.Worksheet="WORKSHEET",e.Tests="TESTS",e.Preparations="PREPARATIONS",e.Mixture="MIXTURE"}(t.BookType||(t.BookType={}))},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o){return void 0===r&&(r=u.Locales.Czech),void 0===o&&(o=i.v4()),e.call(this,s.BusinessObjectType.Book,t,0,n,r,o)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(s.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Chapter,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(s.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(s.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Comment,t,n,r,o,c)||this}return r(t,e),t}(o.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r,i,o){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===o&&(o=u.v4());var c=e.call(this,s.BusinessObjectType.Generic,n,r,i,void 0,o)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(o.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=u.v4());var i=e.call(this,s.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return i.text=t,i}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{text:this.text})},t}(o.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Answer,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Answer=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Environment,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Environment=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Supplement,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(s.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(s.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Question,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===o.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(o.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Question=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Problem,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(s.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(s.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(s.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(s.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Link,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Link=u},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(23),c=n(31),a=n(27);t.Chapter=function(e){var t=e.chapter,n=t.title,i=t.comment,l=t.problems,p=t.supplements;return o.default.createElement("div",{className:"Chapter"},o.default.createElement(s.Title,r({},{title:n})),i&&o.default.createElement(u.Comment,r({},{comment:i})),l.map(function(e,t){return o.default.createElement(c.Problem,r({},{problem:e,key:t}))}),p.map(function(e,t){return o.default.createElement(a.Supplement,r({},{supplement:e,key:t}))}))},t.Chapter.displayName="Chapter"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(24);t.Comment=function(e){var t=e.comment.children;return o.default.createElement("div",{className:"Comment"},t.map(function(e,t){return o.default.createElement(s.BusinessObject,r({},{businessObject:e,key:t}))}))},t.Comment.displayName="Comment"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var u=o(n(3)),c=s(n(6)),a=n(8),l=n(25),p=n(26),f=n(22),d=n(5),b=n(7),h=n(29),v=n(30),y=n(27);function m(e){var t=e.objectType,n=i(e,["objectType"]);return t!==c.BusinessObjectType.Generic||"title"!==n.elementType}t.BusinessObject=function(e){var n=e.businessObject,i=e.overrides,o=void 0===i?{}:i,s=n.objectType,_=n.children,O=function(e,t){var n=t.objectType,r=e[n];if(!r&&n===c.BusinessObjectType.Generic){var i=t.elementType;return e[i]}return r}(o,n);if(O)return O(n);switch(s){case c.BusinessObjectType.Text:var j=n.text;return u.default.createElement(d.Text,r({},{text:j}));case c.BusinessObjectType.Chapter:var g=n;return u.default.createElement(f.Chapter,r({},{chapter:g}));case c.BusinessObjectType.Question:var P=n;return u.default.createElement(p.Question,r({},{question:P}));case c.BusinessObjectType.Answer:var T=n;return u.default.createElement(l.Answer,r({},{answer:T}));case c.BusinessObjectType.Environment:var B=n;return u.default.createElement(a.Environment,r({},{environment:B}));case c.BusinessObjectType.Generic:var C=n;return u.default.createElement(h.GenericObject,r({},{object:C,overrides:o}));case c.BusinessObjectType.Book:var w=n;return u.default.createElement(v.Book,r({},{book:w}));case c.BusinessObjectType.Supplement:var E=n;return u.default.createElement(y.Supplement,r({},{supplement:E}));default:var x=n.title;return u.default.createElement("div",{className:function(e){void 0===e&&(e="");return e.substr(0,1).toUpperCase()+e.substr(1)}(s)},u.default.createElement(b.Title,r({},{title:x})),_.filter(m).map(function(e,n){return u.default.createElement(t.BusinessObject,r({businessObject:e},{key:n,overrides:o}))}))}},t.BusinessObject.displayName="BusinessObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(8);t.Answer=function(e){var t=e.answer,n=t.isText,i=t.text,c=t.environments,a=e.hide,l=void 0!==a&&a;return l?null:o.default.createElement("div",{className:"Answer"},n?o.default.createElement(s.Text,r({},{text:i})):c.map(function(e,t){return o.default.createElement(u.Environment,r({displayAnswers:!l},{environment:e,key:t}))}))},t.Answer.displayName="Answer"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(25),c=n(8);t.Question=function(e){var t=e.question,n=t.text,i=t.sid,a=t.answer,l=t.environments;return o.default.createElement("div",{className:"Question"},i&&o.default.createElement("strong",{className:"sid"},i,")"),n&&o.default.createElement(s.Text,r({},{text:n})),a&&o.default.createElement(u.Answer,r({},{answer:a})),l.length&&l.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Question.displayName="Question"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(5),c=n(8);t.Supplement=function(e){var t=e.supplement,n=t.title,i=t.text,a=t.environments;return o.default.createElement("div",{className:"Supplement"},o.default.createElement(s.Title,r({},{title:n})),o.default.createElement(u.Text,r({},{text:i})),a.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Supplement.displayName="Supplement"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3)),u=n(3),c=n(33),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.displayName="EnvironmentStatic",t.renderAlternative=function(e,n){return t.props.displayAnswers?s.default.createElement("img",i({src:e},{key:n})):null},t}return r(t,e),t.prototype.render=function(){var e=this.props.environment,t=e.alternatives,n="inline"===e.attributes.inline;return s.default.createElement(c.EnvironmentWrapper,{className:"EnvironmentStatic",inline:n},t.map(this.renderAlternative))},t}(u.Component);t.EnvironmentStatic=a},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(3)),u=o(n(6)),c=n(3),a=n(5),l=n(34),p=n(24),f=n(35);t.GenericObject=function(e){var t=e.object,n=e.overrides,i=void 0===n?{}:n,o=t,d=o.elementType,b=o.objectType,h=o.children,v=o.attributes;if(b===u.BusinessObjectType.Text){var y=t.text;return s.default.createElement(a.Text,r({},{text:y}))}if(b===u.BusinessObjectType.Generic){var m=l.isVoidElement(d)?null:h.map(function(e,t){return s.default.createElement(p.BusinessObject,r({},{businessObject:e,overrides:i,key:t}))});if(v.style){var _=r({},v,{style:f.transformCSSToInlineStyle(v.style)});return c.createElement(d,_,m)}return c.createElement(d,v,m)}return s.default.createElement(p.BusinessObject,r({businessObject:t},{overrides:i}))},t.GenericObject.displayName="GenericObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(22);t.Book=function(e){var t=e.book,n=t.title,i=t.chapters;return o.default.createElement("div",{className:"Book"},o.default.createElement(s.Title,r({},{title:n})),i.map(function(e,t){return o.default.createElement(u.Chapter,r({},{chapter:e,key:t}))}))},t.Book.displayName="Book"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(26),u=n(23);t.Problem=function(e){var t=e.problem,n=t.questions,i=t.comment;return o.default.createElement("div",{className:"Problem"},i&&o.default.createElement(u.Comment,r({},{comment:i})),o.default.createElement("div",{className:"questions"},n.map(function(e,t){return o.default.createElement(s.Question,r({},{question:e,key:t}))})))},t.Problem.displayName="Problem"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(22);t.Chapter=r.Chapter;var i=n(5);t.Text=i.Text;var o=n(7);t.Title=o.Title;var s=n(26);t.Question=s.Question;var u=n(25);t.Answer=u.Answer;var c=n(28);t.EnvironmentStatic=c.EnvironmentStatic;var a=n(31);t.Problem=a.Problem;var l=n(29);t.GenericObject=l.GenericObject;var p=n(8);t.Environment=p.Environment;var f=n(24);t.BusinessObject=f.BusinessObject;var d=n(23);t.Comment=d.Comment;var b=n(30);t.Book=b.Book;var h=n(27);t.Supplement=h.Supplement},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3));t.EnvironmentWrapper=function(e){var t=e.inline,n=e.children,o=i(e,["inline","children"]);return t?s.default.createElement("span",r({},o),n):s.default.createElement("div",r({},o),n)},t.EnvironmentWrapper.displayName="EnvironmentWrapper"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};t.isVoidElement=function(e){return!0===r[e]}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.transformCSSToInlineStyle=function(e){var t=/([\w\s-_]+).*?:.*?([\w\s-_]+)/g;return e.split(";").reduce(function(e,n){var i,o=t.exec(n);if(!o)return e;var s=o[1],u=o[2],c=function(e){return e.replace(/\s\s+/g," ").replace(/[^a-zA-Z0-9]/g,"_").replace(/^_+/g,"").replace(/_+$/g,"")}(function(e){return e.replace(/(-.)/g,function(e){return e[1].toUpperCase()})}(s));return r({},e,((i={})[c]=u,i))},{})}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=s(n(3)),c=n(32),a=function(){function e(e){this.overrides=e}return e.prototype.encode=function(e){return i(this,void 0,void 0,function(){var t=this;return o(this,function(n){return[2,function(){return u.default.createElement(c.BusinessObject,r({overrides:t.overrides},{businessObject:e}))}]})})},e.prototype.encodeSync=function(e){var t=this;return function(){return u.default.createElement(c.BusinessObject,r({overrides:t.overrides},{businessObject:e}))}},e}();t.JSXCodec=a}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=36)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(4),u=function(){function e(t,n,r,o,s,u){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===o&&(o={}),void 0===s&&(s=e.defaultLocale),void 0===u&&(u=i.v4());var c=this;this.objectType=t,this.sortOrder=r,this.attributes=o,this.uuid=u,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=n.map(function(e){return e.changeParent(c)}),this.internalLocale=s}return Object.defineProperty(e.prototype,"locale",{get:function(){var t=e.defaultLocale,n=e.objectTypesWithLocale;return this.internalLocale!==t&&n.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(o.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(o.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var t=this,n=e.objectTypesWithLocale.reduce(function(e,n){if(e)return e;var r=t.findParent(n);return r?r.locale:void 0},void 0);return n||this.objectType!==o.BusinessObjectType.Book?n||this.locale:e.defaultLocale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e.defaultLocale=s.Locales.Czech,e.objectTypesWithLocale=[o.BusinessObjectType.Comment,o.BusinessObjectType.Problem,o.BusinessObjectType.Supplement,o.BusinessObjectType.Chapter,o.BusinessObjectType.Book],e}();t.AbstractBusinessObject=u},function(e,t){e.exports=require("uuid")},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US",e.EnglishGB="en-GB",e.Slovak="sk-SK",e.Italian="it-IT",e.Polish="pl-PL",e.German="de-DE"}(t.Locales||(t.Locales={}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Text=function(e){var t=e.text;return t?i.default.createElement("span",{className:"text"},t):null},t.Text.displayName="Text"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var i=n(0);t.BusinessObjectType=i.BusinessObjectType;var o=n(10);t.BookType=o.BookType;var s=n(11);t.Book=s.Book;var u=n(12);t.Chapter=u.Chapter;var c=n(13);t.Comment=c.Comment;var a=n(14);t.GenericObject=a.GenericObject;var l=n(15);t.Text=l.Text;var p=n(16);t.Answer=p.Answer;var f=n(17);t.Environment=f.Environment;var d=n(18);t.Supplement=d.Supplement;var b=n(19);t.Question=b.Question;var h=n(20);t.Problem=h.Problem;var v=n(21);t.Link=v.Link;var y=n(9);t.Content=y.Content;var m=n(4);t.Locales=m.Locales},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Title=function(e){var t=e.title;return t?i.default.createElement("h2",{className:"title"},t):null},t.Title.displayName="Title"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(28);t.Environment=function(e){var t=e.environment,n=e.displayAnswers;return o.default.createElement(s.EnvironmentStatic,r({},{environment:t,displayAnswers:n}))},t.Environment.displayName="Environment"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Content,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Content=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Book="BOOK",e.Worksheet="WORKSHEET",e.Tests="TESTS",e.Preparations="PREPARATIONS",e.Mixture="MIXTURE"}(t.BookType||(t.BookType={}))},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o){return void 0===r&&(r=u.Locales.Czech),void 0===o&&(o=i.v4()),e.call(this,s.BusinessObjectType.Book,t,0,n,r,o)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(s.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Chapter,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(s.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(s.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Comment,t,n,r,o,c)||this}return r(t,e),t}(o.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r,i,o){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===o&&(o=u.v4());var c=e.call(this,s.BusinessObjectType.Generic,n,r,i,void 0,o)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(o.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=u.v4());var i=e.call(this,s.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return i.text=t,i}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{text:this.text})},t}(o.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Answer,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Answer=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Environment,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Environment=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Supplement,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(s.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(s.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Question,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===o.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(o.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Question=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Problem,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(s.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(s.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(s.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(s.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Link,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Link=u},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(23),c=n(31),a=n(27);t.Chapter=function(e){var t=e.chapter,n=t.title,i=t.comment,l=t.problems,p=t.supplements;return o.default.createElement("div",{className:"Chapter"},o.default.createElement(s.Title,r({},{title:n})),i&&o.default.createElement(u.Comment,r({},{comment:i})),l.map(function(e,t){return o.default.createElement(c.Problem,r({},{problem:e,key:t}))}),p.map(function(e,t){return o.default.createElement(a.Supplement,r({},{supplement:e,key:t}))}))},t.Chapter.displayName="Chapter"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(24);t.Comment=function(e){var t=e.comment.children;return o.default.createElement("div",{className:"Comment"},t.map(function(e,t){return o.default.createElement(s.BusinessObject,r({},{businessObject:e,key:t}))}))},t.Comment.displayName="Comment"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var u=o(n(3)),c=s(n(6)),a=n(8),l=n(25),p=n(26),f=n(22),d=n(5),b=n(7),h=n(29),v=n(30),y=n(27);function m(e){var t=e.objectType,n=i(e,["objectType"]);return t!==c.BusinessObjectType.Generic||"title"!==n.elementType}t.BusinessObject=function(e){var n=e.businessObject,i=e.overrides,o=void 0===i?{}:i,s=n.objectType,O=n.children,_=function(e,t){var n=t.objectType,r=e[n];if(!r&&n===c.BusinessObjectType.Generic){var i=t.elementType;return e[i]}return r}(o,n);if(_)return _(n);switch(s){case c.BusinessObjectType.Text:var j=n.text;return u.default.createElement(d.Text,r({},{text:j}));case c.BusinessObjectType.Chapter:var g=n;return u.default.createElement(f.Chapter,r({},{chapter:g}));case c.BusinessObjectType.Question:var P=n;return u.default.createElement(p.Question,r({},{question:P}));case c.BusinessObjectType.Answer:var T=n;return u.default.createElement(l.Answer,r({},{answer:T}));case c.BusinessObjectType.Environment:var B=n;return u.default.createElement(a.Environment,r({},{environment:B}));case c.BusinessObjectType.Generic:var C=n;return u.default.createElement(h.GenericObject,r({},{object:C,overrides:o}));case c.BusinessObjectType.Book:var w=n;return u.default.createElement(v.Book,r({},{book:w}));case c.BusinessObjectType.Supplement:var E=n;return u.default.createElement(y.Supplement,r({},{supplement:E}));default:var x=n.title;return u.default.createElement("div",{className:function(e){void 0===e&&(e="");return e.substr(0,1).toUpperCase()+e.substr(1)}(s)},u.default.createElement(b.Title,r({},{title:x})),O.filter(m).map(function(e,n){return u.default.createElement(t.BusinessObject,r({businessObject:e},{key:n,overrides:o}))}))}},t.BusinessObject.displayName="BusinessObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(8);t.Answer=function(e){var t=e.answer,n=t.isText,i=t.text,c=t.environments,a=e.hide,l=void 0!==a&&a;return l?null:o.default.createElement("div",{className:"Answer"},n?o.default.createElement(s.Text,r({},{text:i})):c.map(function(e,t){return o.default.createElement(u.Environment,r({displayAnswers:!l},{environment:e,key:t}))}))},t.Answer.displayName="Answer"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(25),c=n(8);t.Question=function(e){var t=e.question,n=t.text,i=t.sid,a=t.answer,l=t.environments;return o.default.createElement("div",{className:"Question"},i&&o.default.createElement("strong",{className:"sid"},i,")"),n&&o.default.createElement(s.Text,r({},{text:n})),a&&o.default.createElement(u.Answer,r({},{answer:a})),l.length&&l.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Question.displayName="Question"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(5),c=n(8);t.Supplement=function(e){var t=e.supplement,n=t.title,i=t.text,a=t.environments;return o.default.createElement("div",{className:"Supplement"},o.default.createElement(s.Title,r({},{title:n})),o.default.createElement(u.Text,r({},{text:i})),a.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Supplement.displayName="Supplement"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3)),u=n(3),c=n(33),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.displayName="EnvironmentStatic",t.renderAlternative=function(e,n){return t.props.displayAnswers?s.default.createElement("img",i({src:e},{key:n})):null},t}return r(t,e),t.prototype.render=function(){var e=this.props.environment,t=e.alternatives,n="inline"===e.attributes.inline;return s.default.createElement(c.EnvironmentWrapper,{className:"EnvironmentStatic",inline:n},t.map(this.renderAlternative))},t}(u.Component);t.EnvironmentStatic=a},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(3)),u=o(n(6)),c=n(3),a=n(5),l=n(34),p=n(24),f=n(35);t.GenericObject=function(e){var t=e.object,n=e.overrides,i=void 0===n?{}:n,o=t,d=o.elementType,b=o.objectType,h=o.children,v=o.attributes;if(b===u.BusinessObjectType.Text){var y=t.text;return s.default.createElement(a.Text,r({},{text:y}))}if(b===u.BusinessObjectType.Generic){var m=l.isVoidElement(d)?null:h.map(function(e,t){return s.default.createElement(p.BusinessObject,r({},{businessObject:e,overrides:i,key:t}))});if(v.style){var O=r({},v,{style:f.transformCSSToInlineStyle(v.style)});return c.createElement(d,O,m)}return c.createElement(d,v,m)}return s.default.createElement(p.BusinessObject,r({businessObject:t},{overrides:i}))},t.GenericObject.displayName="GenericObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(22);t.Book=function(e){var t=e.book,n=t.title,i=t.chapters;return o.default.createElement("div",{className:"Book"},o.default.createElement(s.Title,r({},{title:n})),i.map(function(e,t){return o.default.createElement(u.Chapter,r({},{chapter:e,key:t}))}))},t.Book.displayName="Book"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(26),u=n(23);t.Problem=function(e){var t=e.problem,n=t.questions,i=t.comment;return o.default.createElement("div",{className:"Problem"},i&&o.default.createElement(u.Comment,r({},{comment:i})),o.default.createElement("div",{className:"questions"},n.map(function(e,t){return o.default.createElement(s.Question,r({},{question:e,key:t}))})))},t.Problem.displayName="Problem"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(22);t.Chapter=r.Chapter;var i=n(5);t.Text=i.Text;var o=n(7);t.Title=o.Title;var s=n(26);t.Question=s.Question;var u=n(25);t.Answer=u.Answer;var c=n(28);t.EnvironmentStatic=c.EnvironmentStatic;var a=n(31);t.Problem=a.Problem;var l=n(29);t.GenericObject=l.GenericObject;var p=n(8);t.Environment=p.Environment;var f=n(24);t.BusinessObject=f.BusinessObject;var d=n(23);t.Comment=d.Comment;var b=n(30);t.Book=b.Book;var h=n(27);t.Supplement=h.Supplement},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3));t.EnvironmentWrapper=function(e){var t=e.inline,n=e.children,o=i(e,["inline","children"]);return t?s.default.createElement("span",r({},o),n):s.default.createElement("div",r({},o),n)},t.EnvironmentWrapper.displayName="EnvironmentWrapper"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};t.isVoidElement=function(e){return!0===r[e]}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.transformCSSToInlineStyle=function(e){var t=/([\w\s-_]+).*?:.*?([\w\s-_]+)/g;return e.split(";").reduce(function(e,n){var i,o=t.exec(n);if(!o)return e;var s=o[1],u=o[2],c=function(e){return e.replace(/\s\s+/g," ").replace(/[^a-zA-Z0-9]/g,"_").replace(/^_+/g,"").replace(/_+$/g,"")}(function(e){return e.replace(/(-.)/g,function(e){return e[1].toUpperCase()})}(s));return r({},e,((i={})[c]=u,i))},{})}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function u(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=s(n(3)),c=n(32),a=function(){function e(e){this.overrides=e}return e.prototype.encode=function(e){return i(this,void 0,void 0,function(){var t=this;return o(this,function(n){return[2,function(){return u.default.createElement(c.BusinessObject,r({overrides:t.overrides},{businessObject:e}))}]})})},e.prototype.encodeSync=function(e){var t=this;return function(){return u.default.createElement(c.BusinessObject,r({overrides:t.overrides},{businessObject:e}))}},e}();t.JSXCodec=a}])});
//# sourceMappingURL=index.js.map

@@ -15,2 +15,3 @@ import { IEncoder, IDecoder } from './codec';

private decodeElements;
private encodeLocaleAttribute;
}

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=37)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),s=n(4),u=[i.BusinessObjectType.Book,i.BusinessObjectType.Chapter,i.BusinessObjectType.Problem,i.BusinessObjectType.Supplement,i.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,i,u){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===i&&(i=s.Locales.Czech),void 0===u&&(u=o.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=u,this.internalChildren=[],this.internalLocale=s.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=i}return Object.defineProperty(e.prototype,"locale",{get:function(){return u.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(i.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(i.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=u.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},function(e,t){e.exports=require("uuid")},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US",e.EnglishGB="en-GB",e.Slovak="sk-SK",e.Italian="it-IT",e.Polish="pl-PL",e.German="de-DE"}(t.Locales||(t.Locales={}))},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var o=n(0);t.BusinessObjectType=o.BusinessObjectType;var i=n(10);t.BookType=i.BookType;var s=n(11);t.Book=s.Book;var u=n(12);t.Chapter=u.Chapter;var c=n(13);t.Comment=c.Comment;var p=n(14);t.GenericObject=p.GenericObject;var a=n(15);t.Text=a.Text;var f=n(16);t.Answer=f.Answer;var l=n(17);t.Environment=l.Environment;var d=n(18);t.Supplement=d.Supplement;var b=n(19);t.Question=b.Question;var h=n(20);t.Problem=h.Problem;var y=n(21);t.Link=y.Link;var v=n(9);t.Content=v.Content;var O=n(4);t.Locales=O.Locales},,,function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Content,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Content=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Book="BOOK",e.Worksheet="WORKSHEET",e.Tests="TESTS",e.Preparations="PREPARATIONS",e.Mixture="MIXTURE"}(t.BookType||(t.BookType={}))},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i){return void 0===r&&(r=u.Locales.Czech),void 0===i&&(i=o.v4()),e.call(this,s.BusinessObjectType.Book,t,0,n,r,i)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(s.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Chapter,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(s.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(s.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Comment,t,n,r,i,c)||this}return r(t,e),t}(i.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r,o,i){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i=u.v4());var c=e.call(this,s.BusinessObjectType.Generic,n,r,o,void 0,i)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(i.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=u.v4());var o=e.call(this,s.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return o.text=t,o}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{text:this.text})},t}(i.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Answer,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Answer=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Environment,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Environment=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Supplement,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(s.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(s.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Question,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===i.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(i.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Question=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Problem,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(s.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(s.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(s.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(s.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Link,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Link=u},,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(38),u=n(6),c=n(9),p=function(){function e(){}return e.prototype.decode=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){return[2,this.decodeSync(e)]})})},e.prototype.decodeSync=function(e){var t=s.xml2js(e).elements;if(!t||!t.length)throw new Error("Book not found in XML");if(t.length>1)throw new Error("More than one book found in XML");return this.decodeElement(t[0])},e.prototype.encode=function(e,t){return void 0===t&&(t=!1),o(this,void 0,void 0,function(){return i(this,function(n){return[2,this.encodeSync(e,t)]})})},e.prototype.encodeSync=function(e,t){void 0===t&&(t=!1);var n={declaration:{attributes:{encoding:"UTF-8",version:"1.0"}},elements:[this.encodeChild(e)]},r=t?{spaces:4,fullTagEmptyElement:!0,ignoreDeclaration:!0,ignoreDoctype:!0,textFn:function(e){return"\n"+e.replace(/[\r\n]/gm,"").replace(" "," ").trim()}}:{},o=s.js2xml(n,r);return this.encodeXMLEntities(o)},e.prototype.encodeChildren=function(e){var t=this;return e.map(function(e){return t.encodeChild(e)})},e.prototype.encodeChild=function(e){var t=e.objectType,n=e.children,o={attributes:e.attributes,elements:this.encodeChildren(n),type:"element"};switch(t){case u.BusinessObjectType.Generic:var i=e.elementType;return r({},o,{name:i});case u.BusinessObjectType.Text:return{text:e.text,type:"text"};default:return r({},o,{name:t})}},e.prototype.encodeXMLEntities=function(e){return e.replace(/&/g,"&amp;")},e.prototype.decodeElement=function(e,t){var n=e.name,r=e.elements,o=e.type,i=e.text,s=e.attributes;if(void 0===t&&(t=0),o===u.BusinessObjectType.Text)return new u.Text(""+i,t);var p=this.decodeElements(r);switch(n){case u.BusinessObjectType.Book:return new u.Book(p,s);case u.BusinessObjectType.Chapter:return new u.Chapter(p,t,s);case u.BusinessObjectType.Comment:return new u.Comment(p,t,s);case u.BusinessObjectType.Problem:return new u.Problem(p,t,s);case u.BusinessObjectType.Question:return new u.Question(p,t,s);case u.BusinessObjectType.Answer:return new u.Answer(p,t,s);case u.BusinessObjectType.Environment:return new u.Environment(p,t,s);case u.BusinessObjectType.Supplement:return new u.Supplement(p,t,s);case u.BusinessObjectType.Link:return new u.Link(p,t,s);case u.BusinessObjectType.Content:return new c.Content(p,t,s);default:return new u.GenericObject(n||"unknown",this.decodeElements(r),t,s)}},e.prototype.ignoreElements=function(e,t){return e.filter(function(e){var n=e.name;return!n||!t.includes(n)})},e.prototype.decodeElements=function(e){var t=this;return e?e.map(function(e,n){return t.decodeElement(e,n)}):[]},e}();t.XMLCodec=p},function(e,t){e.exports=require("xml-js")}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=37)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),c=n(4),s=function(){function e(t,n,r,i,c,s){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i={}),void 0===c&&(c=e.defaultLocale),void 0===s&&(s=o.v4());var u=this;this.objectType=t,this.sortOrder=r,this.attributes=i,this.uuid=s,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=n.map(function(e){return e.changeParent(u)}),this.internalLocale=c}return Object.defineProperty(e.prototype,"locale",{get:function(){var t=e.defaultLocale,n=e.objectTypesWithLocale;return this.internalLocale!==t&&n.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(i.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(i.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var t=this,n=e.objectTypesWithLocale.reduce(function(e,n){if(e)return e;var r=t.findParent(n);return r?r.locale:void 0},void 0);return n||this.objectType!==i.BusinessObjectType.Book?n||this.locale:e.defaultLocale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e.defaultLocale=c.Locales.Czech,e.objectTypesWithLocale=[i.BusinessObjectType.Comment,i.BusinessObjectType.Problem,i.BusinessObjectType.Supplement,i.BusinessObjectType.Chapter,i.BusinessObjectType.Book],e}();t.AbstractBusinessObject=s},function(e,t){e.exports=require("uuid")},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US",e.EnglishGB="en-GB",e.Slovak="sk-SK",e.Italian="it-IT",e.Polish="pl-PL",e.German="de-DE"}(t.Locales||(t.Locales={}))},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var o=n(0);t.BusinessObjectType=o.BusinessObjectType;var i=n(10);t.BookType=i.BookType;var c=n(11);t.Book=c.Book;var s=n(12);t.Chapter=s.Chapter;var u=n(13);t.Comment=u.Comment;var p=n(14);t.GenericObject=p.GenericObject;var a=n(15);t.Text=a.Text;var l=n(16);t.Answer=l.Answer;var f=n(17);t.Environment=f.Environment;var d=n(18);t.Supplement=d.Supplement;var b=n(19);t.Question=b.Question;var h=n(20);t.Problem=h.Problem;var y=n(21);t.Link=y.Link;var v=n(9);t.Content=v.Content;var O=n(4);t.Locales=O.Locales},,,function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),c=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=c.v4()),e.call(this,i.BusinessObjectType.Content,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Content=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Book="BOOK",e.Worksheet="WORKSHEET",e.Tests="TESTS",e.Preparations="PREPARATIONS",e.Mixture="MIXTURE"}(t.BookType||(t.BookType={}))},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),c=n(0),s=n(4),u=function(e){function t(t,n,r,i){return void 0===r&&(r=s.Locales.Czech),void 0===i&&(i=o.v4()),e.call(this,c.BusinessObjectType.Book,t,0,n,r,i)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(c.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Book=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),c=n(0),s=n(4),u=function(e){function t(t,n,r,i,u){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===u&&(u=o.v4()),e.call(this,c.BusinessObjectType.Chapter,t,n,r,i,u)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(c.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(c.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Chapter=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),c=n(0),s=n(4),u=function(e){function t(t,n,r,i,u){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===u&&(u=o.v4()),e.call(this,c.BusinessObjectType.Comment,t,n,r,i,u)||this}return r(t,e),t}(i.AbstractBusinessObject);t.Comment=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),c=n(0),s=n(2),u=function(e){function t(t,n,r,o,i){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i=s.v4());var u=e.call(this,c.BusinessObjectType.Generic,n,r,o,void 0,i)||this;return u.elementType=t,u}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(i.AbstractBusinessObject);t.GenericObject=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),c=n(0),s=n(2),u=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=s.v4());var o=e.call(this,c.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return o.text=t,o}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{text:this.text})},t}(i.AbstractBusinessObject);t.Text=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),c=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=c.v4()),e.call(this,i.BusinessObjectType.Answer,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Answer=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),c=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=c.v4()),e.call(this,i.BusinessObjectType.Environment,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Environment=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),c=n(0),s=n(4),u=function(e){function t(t,n,r,i,u){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===u&&(u=o.v4()),e.call(this,c.BusinessObjectType.Supplement,t,n,r,i,u)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(c.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(c.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Supplement=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),c=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=c.v4()),e.call(this,i.BusinessObjectType.Question,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===i.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(i.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Question=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),c=n(0),s=n(4),u=function(e){function t(t,n,r,i,u){return void 0===n&&(n=0),void 0===i&&(i=s.Locales.Czech),void 0===u&&(u=o.v4()),e.call(this,c.BusinessObjectType.Problem,t,n,r,i,u)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(c.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(c.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(c.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(c.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Problem=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),c=n(2),s=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=c.v4()),e.call(this,i.BusinessObjectType.Link,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Link=s},,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function c(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(c,s)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},c=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var s=n(38),u=n(6),p=n(9),a=function(){function e(){}return e.prototype.decode=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){return[2,this.decodeSync(e)]})})},e.prototype.decodeSync=function(e){var t=s.xml2js(e).elements;if(!t||!t.length)throw new Error("Book not found in XML");if(t.length>1)throw new Error("More than one book found in XML");return this.decodeElement(t[0])},e.prototype.encode=function(e,t){return void 0===t&&(t=!1),o(this,void 0,void 0,function(){return i(this,function(n){return[2,this.encodeSync(e,t)]})})},e.prototype.encodeSync=function(e,t){void 0===t&&(t=!1);var n={declaration:{attributes:{encoding:"UTF-8",version:"1.0"}},elements:[this.encodeChild(e)]},r=t?{spaces:4,fullTagEmptyElement:!0,ignoreDeclaration:!0,ignoreDoctype:!0,textFn:function(e){return"\n"+e.replace(/[\r\n]/gm,"").replace(" "," ").trim()}}:{},o=s.js2xml(n,r);return this.encodeXMLEntities(o)},e.prototype.encodeChildren=function(e){var t=this;return e.map(function(e){return t.encodeChild(e)})},e.prototype.encodeChild=function(e){var t=e.objectType,n=e.children,o=e.attributes,i={attributes:r({},o,this.encodeLocaleAttribute(e)),elements:this.encodeChildren(n),type:"element"};switch(t){case u.BusinessObjectType.Generic:var c=e.elementType;return r({},i,{name:c});case u.BusinessObjectType.Text:return{text:e.text,type:"text"};default:return r({},i,{name:t})}},e.prototype.encodeXMLEntities=function(e){return e.replace(/&/g,"&amp;")},e.prototype.decodeElement=function(e,t){var n=e.name,r=e.elements,o=e.type,i=e.text,s=e.attributes;if(void 0===t&&(t=0),o===u.BusinessObjectType.Text)return new u.Text(""+i,t);var a=this.decodeElements(r),l=s||{},f=l.locale,d=c(l,["locale"]),b=f?f.toString():void 0;switch(n){case u.BusinessObjectType.Book:return new u.Book(a,d,b);case u.BusinessObjectType.Chapter:return new u.Chapter(a,t,d,b);case u.BusinessObjectType.Comment:return new u.Comment(a,t,d,b);case u.BusinessObjectType.Problem:return new u.Problem(a,t,d,b);case u.BusinessObjectType.Question:return new u.Question(a,t,d);case u.BusinessObjectType.Answer:return new u.Answer(a,t,d);case u.BusinessObjectType.Environment:return new u.Environment(a,t,d);case u.BusinessObjectType.Supplement:return new u.Supplement(a,t,d,b);case u.BusinessObjectType.Link:return new u.Link(a,t,d);case u.BusinessObjectType.Content:return new p.Content(a,t,d);default:return new u.GenericObject(n||"unknown",this.decodeElements(r),t,d)}},e.prototype.ignoreElements=function(e,t){return e.filter(function(e){var n=e.name;return!n||!t.includes(n)})},e.prototype.decodeElements=function(e){var t=this;return e?e.map(function(e,n){return t.decodeElement(e,n)}):[]},e.prototype.encodeLocaleAttribute=function(e){var t=e.objectType,n=e.locale,r=u.AbstractBusinessObject.objectTypesWithLocale,o=u.AbstractBusinessObject.defaultLocale,i=r.includes(t),c=n===o,s=e.internalLocale===o;return!i||c||s?{}:{locale:n}},e}();t.XMLCodec=a},function(e,t){e.exports=require("xml-js")}])});
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=40)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),s=n(4),u=[i.BusinessObjectType.Book,i.BusinessObjectType.Chapter,i.BusinessObjectType.Problem,i.BusinessObjectType.Supplement,i.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,i,u){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===i&&(i=s.Locales.Czech),void 0===u&&(u=o.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=u,this.internalChildren=[],this.internalLocale=s.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=i}return Object.defineProperty(e.prototype,"locale",{get:function(){return u.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(i.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(i.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=u.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},function(e,t){e.exports=require("uuid")},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US",e.EnglishGB="en-GB",e.Slovak="sk-SK",e.Italian="it-IT",e.Polish="pl-PL",e.German="de-DE"}(t.Locales||(t.Locales={}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(3));t.Text=function(e){var t=e.text;return t?o.default.createElement("span",{className:"text"},t):null},t.Text.displayName="Text"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var o=n(0);t.BusinessObjectType=o.BusinessObjectType;var i=n(10);t.BookType=i.BookType;var s=n(11);t.Book=s.Book;var u=n(12);t.Chapter=u.Chapter;var c=n(13);t.Comment=c.Comment;var a=n(14);t.GenericObject=a.GenericObject;var l=n(15);t.Text=l.Text;var p=n(16);t.Answer=p.Answer;var f=n(17);t.Environment=f.Environment;var d=n(18);t.Supplement=d.Supplement;var h=n(19);t.Question=h.Question;var b=n(20);t.Problem=b.Problem;var y=n(21);t.Link=y.Link;var v=n(9);t.Content=v.Content;var m=n(4);t.Locales=m.Locales},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(3));t.Title=function(e){var t=e.title;return t?o.default.createElement("h2",{className:"title"},t):null},t.Title.displayName="Title"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(3)),s=n(28);t.Environment=function(e){var t=e.environment,n=e.displayAnswers;return i.default.createElement(s.EnvironmentStatic,r({},{environment:t,displayAnswers:n}))},t.Environment.displayName="Environment"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Content,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Content=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Book="BOOK",e.Worksheet="WORKSHEET",e.Tests="TESTS",e.Preparations="PREPARATIONS",e.Mixture="MIXTURE"}(t.BookType||(t.BookType={}))},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i){return void 0===r&&(r=u.Locales.Czech),void 0===i&&(i=o.v4()),e.call(this,s.BusinessObjectType.Book,t,0,n,r,i)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(s.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Chapter,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(s.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(s.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Comment,t,n,r,i,c)||this}return r(t,e),t}(i.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r,o,i){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i=u.v4());var c=e.call(this,s.BusinessObjectType.Generic,n,r,o,void 0,i)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(i.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=u.v4());var o=e.call(this,s.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return o.text=t,o}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{text:this.text})},t}(i.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Answer,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Answer=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Environment,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Environment=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Supplement,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(s.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(s.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Question,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===i.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(i.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Question=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Problem,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(s.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(s.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(s.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(s.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Link,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Link=u},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(3)),s=n(7),u=n(23),c=n(31),a=n(27);t.Chapter=function(e){var t=e.chapter,n=t.title,o=t.comment,l=t.problems,p=t.supplements;return i.default.createElement("div",{className:"Chapter"},i.default.createElement(s.Title,r({},{title:n})),o&&i.default.createElement(u.Comment,r({},{comment:o})),l.map(function(e,t){return i.default.createElement(c.Problem,r({},{problem:e,key:t}))}),p.map(function(e,t){return i.default.createElement(a.Supplement,r({},{supplement:e,key:t}))}))},t.Chapter.displayName="Chapter"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(3)),s=n(24);t.Comment=function(e){var t=e.comment.children;return i.default.createElement("div",{className:"Comment"},t.map(function(e,t){return i.default.createElement(s.BusinessObject,r({},{businessObject:e,key:t}))}))},t.Comment.displayName="Comment"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var u=i(n(3)),c=s(n(6)),a=n(8),l=n(25),p=n(26),f=n(22),d=n(5),h=n(7),b=n(29),y=n(30),v=n(27);function m(e){var t=e.objectType,n=o(e,["objectType"]);return t!==c.BusinessObjectType.Generic||"title"!==n.elementType}t.BusinessObject=function(e){var n=e.businessObject,o=e.overrides,i=void 0===o?{}:o,s=n.objectType,O=n.children,_=function(e,t){var n=t.objectType,r=e[n];if(!r&&n===c.BusinessObjectType.Generic){var o=t.elementType;return e[o]}return r}(i,n);if(_)return _(n);switch(s){case c.BusinessObjectType.Text:var j=n.text;return u.default.createElement(d.Text,r({},{text:j}));case c.BusinessObjectType.Chapter:var g=n;return u.default.createElement(f.Chapter,r({},{chapter:g}));case c.BusinessObjectType.Question:var P=n;return u.default.createElement(p.Question,r({},{question:P}));case c.BusinessObjectType.Answer:var T=n;return u.default.createElement(l.Answer,r({},{answer:T}));case c.BusinessObjectType.Environment:var w=n;return u.default.createElement(a.Environment,r({},{environment:w}));case c.BusinessObjectType.Generic:var B=n;return u.default.createElement(b.GenericObject,r({},{object:B,overrides:i}));case c.BusinessObjectType.Book:var C=n;return u.default.createElement(y.Book,r({},{book:C}));case c.BusinessObjectType.Supplement:var E=n;return u.default.createElement(v.Supplement,r({},{supplement:E}));default:var x=n.title;return u.default.createElement("div",{className:function(e){void 0===e&&(e="");return e.substr(0,1).toUpperCase()+e.substr(1)}(s)},u.default.createElement(h.Title,r({},{title:x})),O.filter(m).map(function(e,n){return u.default.createElement(t.BusinessObject,r({businessObject:e},{key:n,overrides:i}))}))}},t.BusinessObject.displayName="BusinessObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(3)),s=n(5),u=n(8);t.Answer=function(e){var t=e.answer,n=t.isText,o=t.text,c=t.environments,a=e.hide,l=void 0!==a&&a;return l?null:i.default.createElement("div",{className:"Answer"},n?i.default.createElement(s.Text,r({},{text:o})):c.map(function(e,t){return i.default.createElement(u.Environment,r({displayAnswers:!l},{environment:e,key:t}))}))},t.Answer.displayName="Answer"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(3)),s=n(5),u=n(25),c=n(8);t.Question=function(e){var t=e.question,n=t.text,o=t.sid,a=t.answer,l=t.environments;return i.default.createElement("div",{className:"Question"},o&&i.default.createElement("strong",{className:"sid"},o,")"),n&&i.default.createElement(s.Text,r({},{text:n})),a&&i.default.createElement(u.Answer,r({},{answer:a})),l.length&&l.map(function(e,t){return i.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Question.displayName="Question"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(3)),s=n(7),u=n(5),c=n(8);t.Supplement=function(e){var t=e.supplement,n=t.title,o=t.text,a=t.environments;return i.default.createElement("div",{className:"Supplement"},i.default.createElement(s.Title,r({},{title:n})),i.default.createElement(u.Text,r({},{text:o})),a.map(function(e,t){return i.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Supplement.displayName="Supplement"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(3)),u=n(3),c=n(33),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.displayName="EnvironmentStatic",t.renderAlternative=function(e,n){return t.props.displayAnswers?s.default.createElement("img",o({src:e},{key:n})):null},t}return r(t,e),t.prototype.render=function(){var e=this.props.environment,t=e.alternatives,n="inline"===e.attributes.inline;return s.default.createElement(c.EnvironmentWrapper,{className:"EnvironmentStatic",inline:n},t.map(this.renderAlternative))},t}(u.Component);t.EnvironmentStatic=a},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3)),u=i(n(6)),c=n(3),a=n(5),l=n(34),p=n(24),f=n(35);t.GenericObject=function(e){var t=e.object,n=e.overrides,o=void 0===n?{}:n,i=t,d=i.elementType,h=i.objectType,b=i.children,y=i.attributes;if(h===u.BusinessObjectType.Text){var v=t.text;return s.default.createElement(a.Text,r({},{text:v}))}if(h===u.BusinessObjectType.Generic){var m=l.isVoidElement(d)?null:b.map(function(e,t){return s.default.createElement(p.BusinessObject,r({},{businessObject:e,overrides:o,key:t}))});if(y.style){var O=r({},y,{style:f.transformCSSToInlineStyle(y.style)});return c.createElement(d,O,m)}return c.createElement(d,y,m)}return s.default.createElement(p.BusinessObject,r({businessObject:t},{overrides:o}))},t.GenericObject.displayName="GenericObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(3)),s=n(7),u=n(22);t.Book=function(e){var t=e.book,n=t.title,o=t.chapters;return i.default.createElement("div",{className:"Book"},i.default.createElement(s.Title,r({},{title:n})),o.map(function(e,t){return i.default.createElement(u.Chapter,r({},{chapter:e,key:t}))}))},t.Book.displayName="Book"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(3)),s=n(26),u=n(23);t.Problem=function(e){var t=e.problem,n=t.questions,o=t.comment;return i.default.createElement("div",{className:"Problem"},o&&i.default.createElement(u.Comment,r({},{comment:o})),i.default.createElement("div",{className:"questions"},n.map(function(e,t){return i.default.createElement(s.Question,r({},{question:e,key:t}))})))},t.Problem.displayName="Problem"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(22);t.Chapter=r.Chapter;var o=n(5);t.Text=o.Text;var i=n(7);t.Title=i.Title;var s=n(26);t.Question=s.Question;var u=n(25);t.Answer=u.Answer;var c=n(28);t.EnvironmentStatic=c.EnvironmentStatic;var a=n(31);t.Problem=a.Problem;var l=n(29);t.GenericObject=l.GenericObject;var p=n(8);t.Environment=p.Environment;var f=n(24);t.BusinessObject=f.BusinessObject;var d=n(23);t.Comment=d.Comment;var h=n(30);t.Book=h.Book;var b=n(27);t.Supplement=b.Supplement},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(3));t.EnvironmentWrapper=function(e){var t=e.inline,n=e.children,i=o(e,["inline","children"]);return t?s.default.createElement("span",r({},i),n):s.default.createElement("div",r({},i),n)},t.EnvironmentWrapper.displayName="EnvironmentWrapper"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};t.isVoidElement=function(e){return!0===r[e]}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.transformCSSToInlineStyle=function(e){var t=/([\w\s-_]+).*?:.*?([\w\s-_]+)/g;return e.split(";").reduce(function(e,n){var o,i=t.exec(n);if(!i)return e;var s=i[1],u=i[2],c=function(e){return e.replace(/\s\s+/g," ").replace(/[^a-zA-Z0-9]/g,"_").replace(/^_+/g,"").replace(/_+$/g,"")}(function(e){return e.replace(/(-.)/g,function(e){return e[1].toUpperCase()})}(s));return r({},e,((o={})[c]=u,o))},{})}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=s(n(3)),c=n(32),a=function(){function e(e){this.overrides=e}return e.prototype.encode=function(e){return o(this,void 0,void 0,function(){var t=this;return i(this,function(n){return[2,function(){return u.default.createElement(c.BusinessObject,r({overrides:t.overrides},{businessObject:e}))}]})})},e.prototype.encodeSync=function(e){var t=this;return function(){return u.default.createElement(c.BusinessObject,r({overrides:t.overrides},{businessObject:e}))}},e}();t.JSXCodec=a},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(38),u=n(6),c=n(9),a=function(){function e(){}return e.prototype.decode=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){return[2,this.decodeSync(e)]})})},e.prototype.decodeSync=function(e){var t=s.xml2js(e).elements;if(!t||!t.length)throw new Error("Book not found in XML");if(t.length>1)throw new Error("More than one book found in XML");return this.decodeElement(t[0])},e.prototype.encode=function(e,t){return void 0===t&&(t=!1),o(this,void 0,void 0,function(){return i(this,function(n){return[2,this.encodeSync(e,t)]})})},e.prototype.encodeSync=function(e,t){void 0===t&&(t=!1);var n={declaration:{attributes:{encoding:"UTF-8",version:"1.0"}},elements:[this.encodeChild(e)]},r=t?{spaces:4,fullTagEmptyElement:!0,ignoreDeclaration:!0,ignoreDoctype:!0,textFn:function(e){return"\n"+e.replace(/[\r\n]/gm,"").replace(" "," ").trim()}}:{},o=s.js2xml(n,r);return this.encodeXMLEntities(o)},e.prototype.encodeChildren=function(e){var t=this;return e.map(function(e){return t.encodeChild(e)})},e.prototype.encodeChild=function(e){var t=e.objectType,n=e.children,o={attributes:e.attributes,elements:this.encodeChildren(n),type:"element"};switch(t){case u.BusinessObjectType.Generic:var i=e.elementType;return r({},o,{name:i});case u.BusinessObjectType.Text:return{text:e.text,type:"text"};default:return r({},o,{name:t})}},e.prototype.encodeXMLEntities=function(e){return e.replace(/&/g,"&amp;")},e.prototype.decodeElement=function(e,t){var n=e.name,r=e.elements,o=e.type,i=e.text,s=e.attributes;if(void 0===t&&(t=0),o===u.BusinessObjectType.Text)return new u.Text(""+i,t);var a=this.decodeElements(r);switch(n){case u.BusinessObjectType.Book:return new u.Book(a,s);case u.BusinessObjectType.Chapter:return new u.Chapter(a,t,s);case u.BusinessObjectType.Comment:return new u.Comment(a,t,s);case u.BusinessObjectType.Problem:return new u.Problem(a,t,s);case u.BusinessObjectType.Question:return new u.Question(a,t,s);case u.BusinessObjectType.Answer:return new u.Answer(a,t,s);case u.BusinessObjectType.Environment:return new u.Environment(a,t,s);case u.BusinessObjectType.Supplement:return new u.Supplement(a,t,s);case u.BusinessObjectType.Link:return new u.Link(a,t,s);case u.BusinessObjectType.Content:return new c.Content(a,t,s);default:return new u.GenericObject(n||"unknown",this.decodeElements(r),t,s)}},e.prototype.ignoreElements=function(e,t){return e.filter(function(e){var n=e.name;return!n||!t.includes(n)})},e.prototype.decodeElements=function(e){var t=this;return e?e.map(function(e,n){return t.decodeElement(e,n)}):[]},e}();t.XMLCodec=a},function(e,t){e.exports=require("xml-js")},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),s=function(){function e(){var e=this;this.decodeObject=function(t){var n=t.children,r=t.attributes,o=t.objectType,s=t.elementType,u=t.locale,c=t.uuid,a=t.sortOrder,l=t.text,p=e.decodeChildren(n);switch(o){case i.BusinessObjectType.Book:return new i.Book(p,r,u,c);case i.BusinessObjectType.Chapter:return new i.Chapter(p,a,r,u,c);case i.BusinessObjectType.Comment:return new i.Comment(p,a,r,u,c);case i.BusinessObjectType.Problem:return new i.Problem(p,a,r,u,c);case i.BusinessObjectType.Supplement:return new i.Supplement(p,a,r,u,c);case i.BusinessObjectType.Question:return new i.Question(p,a,r,c);case i.BusinessObjectType.Answer:return new i.Answer(p,a,r,c);case i.BusinessObjectType.Environment:return new i.Environment(p,a,r,c);case i.BusinessObjectType.Link:return new i.Link(p,a,r,c);case i.BusinessObjectType.Content:return new i.Content(p,a,r,c);case i.BusinessObjectType.Text:return new i.Text(l,a,c);default:return new i.GenericObject(s||"unknown",p,a,r,c)}},this.decodeChildren=function(t){return t?t.map(e.decodeObject):[]}}return e.prototype.decode=function(e){return r(this,void 0,void 0,function(){return o(this,function(t){return[2,this.decodeSync(e)]})})},e.prototype.decodeSync=function(e){var t="string"==typeof e?JSON.parse(e):e;return this.decodeObject(t)},e}();t.JSONCodec=s},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(6));t.BusinessObject=o;var i=r(n(32));t.JSX=i;var s=r(n(41));t.Codec=s},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(36)),r(n(37)),r(n(39))}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=40)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(0),s=n(4),u=function(){function e(t,n,r,i,s,u){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i={}),void 0===s&&(s=e.defaultLocale),void 0===u&&(u=o.v4());var c=this;this.objectType=t,this.sortOrder=r,this.attributes=i,this.uuid=u,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=n.map(function(e){return e.changeParent(c)}),this.internalLocale=s}return Object.defineProperty(e.prototype,"locale",{get:function(){var t=e.defaultLocale,n=e.objectTypesWithLocale;return this.internalLocale!==t&&n.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(i.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(i.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var t=this,n=e.objectTypesWithLocale.reduce(function(e,n){if(e)return e;var r=t.findParent(n);return r?r.locale:void 0},void 0);return n||this.objectType!==i.BusinessObjectType.Book?n||this.locale:e.defaultLocale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e.defaultLocale=s.Locales.Czech,e.objectTypesWithLocale=[i.BusinessObjectType.Comment,i.BusinessObjectType.Problem,i.BusinessObjectType.Supplement,i.BusinessObjectType.Chapter,i.BusinessObjectType.Book],e}();t.AbstractBusinessObject=u},function(e,t){e.exports=require("uuid")},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US",e.EnglishGB="en-GB",e.Slovak="sk-SK",e.Italian="it-IT",e.Polish="pl-PL",e.German="de-DE"}(t.Locales||(t.Locales={}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(3));t.Text=function(e){var t=e.text;return t?o.default.createElement("span",{className:"text"},t):null},t.Text.displayName="Text"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var o=n(0);t.BusinessObjectType=o.BusinessObjectType;var i=n(10);t.BookType=i.BookType;var s=n(11);t.Book=s.Book;var u=n(12);t.Chapter=u.Chapter;var c=n(13);t.Comment=c.Comment;var a=n(14);t.GenericObject=a.GenericObject;var l=n(15);t.Text=l.Text;var p=n(16);t.Answer=p.Answer;var f=n(17);t.Environment=f.Environment;var d=n(18);t.Supplement=d.Supplement;var b=n(19);t.Question=b.Question;var h=n(20);t.Problem=h.Problem;var y=n(21);t.Link=y.Link;var v=n(9);t.Content=v.Content;var m=n(4);t.Locales=m.Locales},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(3));t.Title=function(e){var t=e.title;return t?o.default.createElement("h2",{className:"title"},t):null},t.Title.displayName="Title"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(3)),s=n(28);t.Environment=function(e){var t=e.environment,n=e.displayAnswers;return i.default.createElement(s.EnvironmentStatic,r({},{environment:t,displayAnswers:n}))},t.Environment.displayName="Environment"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Content,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(i.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Content=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Book="BOOK",e.Worksheet="WORKSHEET",e.Tests="TESTS",e.Preparations="PREPARATIONS",e.Mixture="MIXTURE"}(t.BookType||(t.BookType={}))},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i){return void 0===r&&(r=u.Locales.Czech),void 0===i&&(i=o.v4()),e.call(this,s.BusinessObjectType.Book,t,0,n,r,i)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(s.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Chapter,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(s.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(s.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Comment,t,n,r,i,c)||this}return r(t,e),t}(i.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r,o,i){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===i&&(i=u.v4());var c=e.call(this,s.BusinessObjectType.Generic,n,r,o,void 0,i)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(i.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=u.v4());var o=e.call(this,s.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return o.text=t,o}return r(t,e),t.prototype.toJSON=function(){return o({},e.prototype.toJSON.call(this),{text:this.text})},t}(i.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Answer,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Answer=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Environment,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Environment=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Supplement,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(s.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(s.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Question,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===i.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(i.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(i.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(i.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(i.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Question=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,i,c){return void 0===n&&(n=0),void 0===i&&(i=u.Locales.Czech),void 0===c&&(c=o.v4()),e.call(this,s.BusinessObjectType.Problem,t,n,r,i,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(s.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(s.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(s.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(s.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),s=n(2),u=function(e){function t(t,n,r,o){return void 0===n&&(n=0),void 0===o&&(o=s.v4()),e.call(this,i.BusinessObjectType.Link,t,n,r,void 0,o)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Link=u},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(3)),s=n(7),u=n(23),c=n(31),a=n(27);t.Chapter=function(e){var t=e.chapter,n=t.title,o=t.comment,l=t.problems,p=t.supplements;return i.default.createElement("div",{className:"Chapter"},i.default.createElement(s.Title,r({},{title:n})),o&&i.default.createElement(u.Comment,r({},{comment:o})),l.map(function(e,t){return i.default.createElement(c.Problem,r({},{problem:e,key:t}))}),p.map(function(e,t){return i.default.createElement(a.Supplement,r({},{supplement:e,key:t}))}))},t.Chapter.displayName="Chapter"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(3)),s=n(24);t.Comment=function(e){var t=e.comment.children;return i.default.createElement("div",{className:"Comment"},t.map(function(e,t){return i.default.createElement(s.BusinessObject,r({},{businessObject:e,key:t}))}))},t.Comment.displayName="Comment"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var u=i(n(3)),c=s(n(6)),a=n(8),l=n(25),p=n(26),f=n(22),d=n(5),b=n(7),h=n(29),y=n(30),v=n(27);function m(e){var t=e.objectType,n=o(e,["objectType"]);return t!==c.BusinessObjectType.Generic||"title"!==n.elementType}t.BusinessObject=function(e){var n=e.businessObject,o=e.overrides,i=void 0===o?{}:o,s=n.objectType,O=n.children,_=function(e,t){var n=t.objectType,r=e[n];if(!r&&n===c.BusinessObjectType.Generic){var o=t.elementType;return e[o]}return r}(i,n);if(_)return _(n);switch(s){case c.BusinessObjectType.Text:var j=n.text;return u.default.createElement(d.Text,r({},{text:j}));case c.BusinessObjectType.Chapter:var g=n;return u.default.createElement(f.Chapter,r({},{chapter:g}));case c.BusinessObjectType.Question:var P=n;return u.default.createElement(p.Question,r({},{question:P}));case c.BusinessObjectType.Answer:var T=n;return u.default.createElement(l.Answer,r({},{answer:T}));case c.BusinessObjectType.Environment:var w=n;return u.default.createElement(a.Environment,r({},{environment:w}));case c.BusinessObjectType.Generic:var B=n;return u.default.createElement(h.GenericObject,r({},{object:B,overrides:i}));case c.BusinessObjectType.Book:var C=n;return u.default.createElement(y.Book,r({},{book:C}));case c.BusinessObjectType.Supplement:var E=n;return u.default.createElement(v.Supplement,r({},{supplement:E}));default:var x=n.title;return u.default.createElement("div",{className:function(e){void 0===e&&(e="");return e.substr(0,1).toUpperCase()+e.substr(1)}(s)},u.default.createElement(b.Title,r({},{title:x})),O.filter(m).map(function(e,n){return u.default.createElement(t.BusinessObject,r({businessObject:e},{key:n,overrides:i}))}))}},t.BusinessObject.displayName="BusinessObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(3)),s=n(5),u=n(8);t.Answer=function(e){var t=e.answer,n=t.isText,o=t.text,c=t.environments,a=e.hide,l=void 0!==a&&a;return l?null:i.default.createElement("div",{className:"Answer"},n?i.default.createElement(s.Text,r({},{text:o})):c.map(function(e,t){return i.default.createElement(u.Environment,r({displayAnswers:!l},{environment:e,key:t}))}))},t.Answer.displayName="Answer"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(3)),s=n(5),u=n(25),c=n(8);t.Question=function(e){var t=e.question,n=t.text,o=t.sid,a=t.answer,l=t.environments;return i.default.createElement("div",{className:"Question"},o&&i.default.createElement("strong",{className:"sid"},o,")"),n&&i.default.createElement(s.Text,r({},{text:n})),a&&i.default.createElement(u.Answer,r({},{answer:a})),l.length&&l.map(function(e,t){return i.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Question.displayName="Question"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(3)),s=n(7),u=n(5),c=n(8);t.Supplement=function(e){var t=e.supplement,n=t.title,o=t.text,a=t.environments;return i.default.createElement("div",{className:"Supplement"},i.default.createElement(s.Title,r({},{title:n})),i.default.createElement(u.Text,r({},{text:o})),a.map(function(e,t){return i.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Supplement.displayName="Supplement"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(3)),u=n(3),c=n(33),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.displayName="EnvironmentStatic",t.renderAlternative=function(e,n){return t.props.displayAnswers?s.default.createElement("img",o({src:e},{key:n})):null},t}return r(t,e),t.prototype.render=function(){var e=this.props.environment,t=e.alternatives,n="inline"===e.attributes.inline;return s.default.createElement(c.EnvironmentWrapper,{className:"EnvironmentStatic",inline:n},t.map(this.renderAlternative))},t}(u.Component);t.EnvironmentStatic=a},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3)),u=i(n(6)),c=n(3),a=n(5),l=n(34),p=n(24),f=n(35);t.GenericObject=function(e){var t=e.object,n=e.overrides,o=void 0===n?{}:n,i=t,d=i.elementType,b=i.objectType,h=i.children,y=i.attributes;if(b===u.BusinessObjectType.Text){var v=t.text;return s.default.createElement(a.Text,r({},{text:v}))}if(b===u.BusinessObjectType.Generic){var m=l.isVoidElement(d)?null:h.map(function(e,t){return s.default.createElement(p.BusinessObject,r({},{businessObject:e,overrides:o,key:t}))});if(y.style){var O=r({},y,{style:f.transformCSSToInlineStyle(y.style)});return c.createElement(d,O,m)}return c.createElement(d,y,m)}return s.default.createElement(p.BusinessObject,r({businessObject:t},{overrides:o}))},t.GenericObject.displayName="GenericObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(3)),s=n(7),u=n(22);t.Book=function(e){var t=e.book,n=t.title,o=t.chapters;return i.default.createElement("div",{className:"Book"},i.default.createElement(s.Title,r({},{title:n})),o.map(function(e,t){return i.default.createElement(u.Chapter,r({},{chapter:e,key:t}))}))},t.Book.displayName="Book"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=o(n(3)),s=n(26),u=n(23);t.Problem=function(e){var t=e.problem,n=t.questions,o=t.comment;return i.default.createElement("div",{className:"Problem"},o&&i.default.createElement(u.Comment,r({},{comment:o})),i.default.createElement("div",{className:"questions"},n.map(function(e,t){return i.default.createElement(s.Question,r({},{question:e,key:t}))})))},t.Problem.displayName="Problem"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(22);t.Chapter=r.Chapter;var o=n(5);t.Text=o.Text;var i=n(7);t.Title=i.Title;var s=n(26);t.Question=s.Question;var u=n(25);t.Answer=u.Answer;var c=n(28);t.EnvironmentStatic=c.EnvironmentStatic;var a=n(31);t.Problem=a.Problem;var l=n(29);t.GenericObject=l.GenericObject;var p=n(8);t.Environment=p.Environment;var f=n(24);t.BusinessObject=f.BusinessObject;var d=n(23);t.Comment=d.Comment;var b=n(30);t.Book=b.Book;var h=n(27);t.Supplement=h.Supplement},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(3));t.EnvironmentWrapper=function(e){var t=e.inline,n=e.children,i=o(e,["inline","children"]);return t?s.default.createElement("span",r({},i),n):s.default.createElement("div",r({},i),n)},t.EnvironmentWrapper.displayName="EnvironmentWrapper"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};t.isVoidElement=function(e){return!0===r[e]}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.transformCSSToInlineStyle=function(e){var t=/([\w\s-_]+).*?:.*?([\w\s-_]+)/g;return e.split(";").reduce(function(e,n){var o,i=t.exec(n);if(!i)return e;var s=i[1],u=i[2],c=function(e){return e.replace(/\s\s+/g," ").replace(/[^a-zA-Z0-9]/g,"_").replace(/^_+/g,"").replace(/_+$/g,"")}(function(e){return e.replace(/(-.)/g,function(e){return e[1].toUpperCase()})}(s));return r({},e,((o={})[c]=u,o))},{})}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=s(n(3)),c=n(32),a=function(){function e(e){this.overrides=e}return e.prototype.encode=function(e){return o(this,void 0,void 0,function(){var t=this;return i(this,function(n){return[2,function(){return u.default.createElement(c.BusinessObject,r({overrides:t.overrides},{businessObject:e}))}]})})},e.prototype.encodeSync=function(e){var t=this;return function(){return u.default.createElement(c.BusinessObject,r({overrides:t.overrides},{businessObject:e}))}},e}();t.JSXCodec=a},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},s=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var u=n(38),c=n(6),a=n(9),l=function(){function e(){}return e.prototype.decode=function(e){return o(this,void 0,void 0,function(){return i(this,function(t){return[2,this.decodeSync(e)]})})},e.prototype.decodeSync=function(e){var t=u.xml2js(e).elements;if(!t||!t.length)throw new Error("Book not found in XML");if(t.length>1)throw new Error("More than one book found in XML");return this.decodeElement(t[0])},e.prototype.encode=function(e,t){return void 0===t&&(t=!1),o(this,void 0,void 0,function(){return i(this,function(n){return[2,this.encodeSync(e,t)]})})},e.prototype.encodeSync=function(e,t){void 0===t&&(t=!1);var n={declaration:{attributes:{encoding:"UTF-8",version:"1.0"}},elements:[this.encodeChild(e)]},r=t?{spaces:4,fullTagEmptyElement:!0,ignoreDeclaration:!0,ignoreDoctype:!0,textFn:function(e){return"\n"+e.replace(/[\r\n]/gm,"").replace(" "," ").trim()}}:{},o=u.js2xml(n,r);return this.encodeXMLEntities(o)},e.prototype.encodeChildren=function(e){var t=this;return e.map(function(e){return t.encodeChild(e)})},e.prototype.encodeChild=function(e){var t=e.objectType,n=e.children,o=e.attributes,i={attributes:r({},o,this.encodeLocaleAttribute(e)),elements:this.encodeChildren(n),type:"element"};switch(t){case c.BusinessObjectType.Generic:var s=e.elementType;return r({},i,{name:s});case c.BusinessObjectType.Text:return{text:e.text,type:"text"};default:return r({},i,{name:t})}},e.prototype.encodeXMLEntities=function(e){return e.replace(/&/g,"&amp;")},e.prototype.decodeElement=function(e,t){var n=e.name,r=e.elements,o=e.type,i=e.text,u=e.attributes;if(void 0===t&&(t=0),o===c.BusinessObjectType.Text)return new c.Text(""+i,t);var l=this.decodeElements(r),p=u||{},f=p.locale,d=s(p,["locale"]),b=f?f.toString():void 0;switch(n){case c.BusinessObjectType.Book:return new c.Book(l,d,b);case c.BusinessObjectType.Chapter:return new c.Chapter(l,t,d,b);case c.BusinessObjectType.Comment:return new c.Comment(l,t,d,b);case c.BusinessObjectType.Problem:return new c.Problem(l,t,d,b);case c.BusinessObjectType.Question:return new c.Question(l,t,d);case c.BusinessObjectType.Answer:return new c.Answer(l,t,d);case c.BusinessObjectType.Environment:return new c.Environment(l,t,d);case c.BusinessObjectType.Supplement:return new c.Supplement(l,t,d,b);case c.BusinessObjectType.Link:return new c.Link(l,t,d);case c.BusinessObjectType.Content:return new a.Content(l,t,d);default:return new c.GenericObject(n||"unknown",this.decodeElements(r),t,d)}},e.prototype.ignoreElements=function(e,t){return e.filter(function(e){var n=e.name;return!n||!t.includes(n)})},e.prototype.decodeElements=function(e){var t=this;return e?e.map(function(e,n){return t.decodeElement(e,n)}):[]},e.prototype.encodeLocaleAttribute=function(e){var t=e.objectType,n=e.locale,r=c.AbstractBusinessObject.objectTypesWithLocale,o=c.AbstractBusinessObject.defaultLocale,i=r.includes(t),s=n===o,u=e.internalLocale===o;return!i||s||u?{}:{locale:n}},e}();t.XMLCodec=l},function(e,t){e.exports=require("xml-js")},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,u)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),s=function(){function e(){var e=this;this.decodeObject=function(t){var n=t.children,r=t.attributes,o=t.objectType,s=t.elementType,u=t.locale,c=t.uuid,a=t.sortOrder,l=t.text,p=e.decodeChildren(n);switch(o){case i.BusinessObjectType.Book:return new i.Book(p,r,u,c);case i.BusinessObjectType.Chapter:return new i.Chapter(p,a,r,u,c);case i.BusinessObjectType.Comment:return new i.Comment(p,a,r,u,c);case i.BusinessObjectType.Problem:return new i.Problem(p,a,r,u,c);case i.BusinessObjectType.Supplement:return new i.Supplement(p,a,r,u,c);case i.BusinessObjectType.Question:return new i.Question(p,a,r,c);case i.BusinessObjectType.Answer:return new i.Answer(p,a,r,c);case i.BusinessObjectType.Environment:return new i.Environment(p,a,r,c);case i.BusinessObjectType.Link:return new i.Link(p,a,r,c);case i.BusinessObjectType.Content:return new i.Content(p,a,r,c);case i.BusinessObjectType.Text:return new i.Text(l,a,c);default:return new i.GenericObject(s||"unknown",p,a,r,c)}},this.decodeChildren=function(t){return t?t.map(e.decodeObject):[]}}return e.prototype.decode=function(e){return r(this,void 0,void 0,function(){return o(this,function(t){return[2,this.decodeSync(e)]})})},e.prototype.decodeSync=function(e){var t="string"==typeof e?JSON.parse(e):e;return this.decodeObject(t)},e}();t.JSONCodec=s},function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(6));t.BusinessObject=o;var i=r(n(32));t.JSX=i;var s=r(n(41));t.Codec=s},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(36)),r(n(37)),r(n(39))}])});
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=32)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(4),u=[o.BusinessObjectType.Book,o.BusinessObjectType.Chapter,o.BusinessObjectType.Problem,o.BusinessObjectType.Supplement,o.BusinessObjectType.Comment],c=function(){function e(e,t,n,r,o,u){void 0===t&&(t=[]),void 0===n&&(n=0),void 0===r&&(r={}),void 0===o&&(o=s.Locales.Czech),void 0===u&&(u=i.v4());var c=this;this.objectType=e,this.sortOrder=n,this.attributes=r,this.uuid=u,this.internalChildren=[],this.internalLocale=s.Locales.Czech,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=t.map(function(e){return e.changeParent(c)}),this.internalLocale=o}return Object.defineProperty(e.prototype,"locale",{get:function(){return u.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(o.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(o.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var e=this,t=u.reduce(function(t,n){if(t)return t;var r=e.findParent(n);return r?r.locale:void 0},void 0);return t||this.locale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e}();t.AbstractBusinessObject=c},function(e,t){e.exports=require("uuid")},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US",e.EnglishGB="en-GB",e.Slovak="sk-SK",e.Italian="it-IT",e.Polish="pl-PL",e.German="de-DE"}(t.Locales||(t.Locales={}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Text=function(e){var t=e.text;return t?i.default.createElement("span",{className:"text"},t):null},t.Text.displayName="Text"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var i=n(0);t.BusinessObjectType=i.BusinessObjectType;var o=n(10);t.BookType=o.BookType;var s=n(11);t.Book=s.Book;var u=n(12);t.Chapter=u.Chapter;var c=n(13);t.Comment=c.Comment;var a=n(14);t.GenericObject=a.GenericObject;var l=n(15);t.Text=l.Text;var p=n(16);t.Answer=p.Answer;var f=n(17);t.Environment=f.Environment;var d=n(18);t.Supplement=d.Supplement;var b=n(19);t.Question=b.Question;var h=n(20);t.Problem=h.Problem;var v=n(21);t.Link=v.Link;var y=n(9);t.Content=y.Content;var m=n(4);t.Locales=m.Locales},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Title=function(e){var t=e.title;return t?i.default.createElement("h2",{className:"title"},t):null},t.Title.displayName="Title"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(28);t.Environment=function(e){var t=e.environment,n=e.displayAnswers;return o.default.createElement(s.EnvironmentStatic,r({},{environment:t,displayAnswers:n}))},t.Environment.displayName="Environment"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Content,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Content=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Book="BOOK",e.Worksheet="WORKSHEET",e.Tests="TESTS",e.Preparations="PREPARATIONS",e.Mixture="MIXTURE"}(t.BookType||(t.BookType={}))},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o){return void 0===r&&(r=u.Locales.Czech),void 0===o&&(o=i.v4()),e.call(this,s.BusinessObjectType.Book,t,0,n,r,o)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(s.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Chapter,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(s.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(s.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Comment,t,n,r,o,c)||this}return r(t,e),t}(o.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r,i,o){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===o&&(o=u.v4());var c=e.call(this,s.BusinessObjectType.Generic,n,r,i,void 0,o)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(o.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=u.v4());var i=e.call(this,s.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return i.text=t,i}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{text:this.text})},t}(o.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Answer,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Answer=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Environment,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Environment=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Supplement,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(s.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(s.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Question,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===o.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(o.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Question=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Problem,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(s.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(s.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(s.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(s.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Link,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Link=u},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(23),c=n(31),a=n(27);t.Chapter=function(e){var t=e.chapter,n=t.title,i=t.comment,l=t.problems,p=t.supplements;return o.default.createElement("div",{className:"Chapter"},o.default.createElement(s.Title,r({},{title:n})),i&&o.default.createElement(u.Comment,r({},{comment:i})),l.map(function(e,t){return o.default.createElement(c.Problem,r({},{problem:e,key:t}))}),p.map(function(e,t){return o.default.createElement(a.Supplement,r({},{supplement:e,key:t}))}))},t.Chapter.displayName="Chapter"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(24);t.Comment=function(e){var t=e.comment.children;return o.default.createElement("div",{className:"Comment"},t.map(function(e,t){return o.default.createElement(s.BusinessObject,r({},{businessObject:e,key:t}))}))},t.Comment.displayName="Comment"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var u=o(n(3)),c=s(n(6)),a=n(8),l=n(25),p=n(26),f=n(22),d=n(5),b=n(7),h=n(29),v=n(30),y=n(27);function m(e){var t=e.objectType,n=i(e,["objectType"]);return t!==c.BusinessObjectType.Generic||"title"!==n.elementType}t.BusinessObject=function(e){var n=e.businessObject,i=e.overrides,o=void 0===i?{}:i,s=n.objectType,O=n.children,_=function(e,t){var n=t.objectType,r=e[n];if(!r&&n===c.BusinessObjectType.Generic){var i=t.elementType;return e[i]}return r}(o,n);if(_)return _(n);switch(s){case c.BusinessObjectType.Text:var j=n.text;return u.default.createElement(d.Text,r({},{text:j}));case c.BusinessObjectType.Chapter:var g=n;return u.default.createElement(f.Chapter,r({},{chapter:g}));case c.BusinessObjectType.Question:var P=n;return u.default.createElement(p.Question,r({},{question:P}));case c.BusinessObjectType.Answer:var T=n;return u.default.createElement(l.Answer,r({},{answer:T}));case c.BusinessObjectType.Environment:var B=n;return u.default.createElement(a.Environment,r({},{environment:B}));case c.BusinessObjectType.Generic:var C=n;return u.default.createElement(h.GenericObject,r({},{object:C,overrides:o}));case c.BusinessObjectType.Book:var E=n;return u.default.createElement(v.Book,r({},{book:E}));case c.BusinessObjectType.Supplement:var w=n;return u.default.createElement(y.Supplement,r({},{supplement:w}));default:var x=n.title;return u.default.createElement("div",{className:function(e){void 0===e&&(e="");return e.substr(0,1).toUpperCase()+e.substr(1)}(s)},u.default.createElement(b.Title,r({},{title:x})),O.filter(m).map(function(e,n){return u.default.createElement(t.BusinessObject,r({businessObject:e},{key:n,overrides:o}))}))}},t.BusinessObject.displayName="BusinessObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(8);t.Answer=function(e){var t=e.answer,n=t.isText,i=t.text,c=t.environments,a=e.hide,l=void 0!==a&&a;return l?null:o.default.createElement("div",{className:"Answer"},n?o.default.createElement(s.Text,r({},{text:i})):c.map(function(e,t){return o.default.createElement(u.Environment,r({displayAnswers:!l},{environment:e,key:t}))}))},t.Answer.displayName="Answer"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(25),c=n(8);t.Question=function(e){var t=e.question,n=t.text,i=t.sid,a=t.answer,l=t.environments;return o.default.createElement("div",{className:"Question"},i&&o.default.createElement("strong",{className:"sid"},i,")"),n&&o.default.createElement(s.Text,r({},{text:n})),a&&o.default.createElement(u.Answer,r({},{answer:a})),l.length&&l.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Question.displayName="Question"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(5),c=n(8);t.Supplement=function(e){var t=e.supplement,n=t.title,i=t.text,a=t.environments;return o.default.createElement("div",{className:"Supplement"},o.default.createElement(s.Title,r({},{title:n})),o.default.createElement(u.Text,r({},{text:i})),a.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Supplement.displayName="Supplement"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3)),u=n(3),c=n(33),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.displayName="EnvironmentStatic",t.renderAlternative=function(e,n){return t.props.displayAnswers?s.default.createElement("img",i({src:e},{key:n})):null},t}return r(t,e),t.prototype.render=function(){var e=this.props.environment,t=e.alternatives,n="inline"===e.attributes.inline;return s.default.createElement(c.EnvironmentWrapper,{className:"EnvironmentStatic",inline:n},t.map(this.renderAlternative))},t}(u.Component);t.EnvironmentStatic=a},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(3)),u=o(n(6)),c=n(3),a=n(5),l=n(34),p=n(24),f=n(35);t.GenericObject=function(e){var t=e.object,n=e.overrides,i=void 0===n?{}:n,o=t,d=o.elementType,b=o.objectType,h=o.children,v=o.attributes;if(b===u.BusinessObjectType.Text){var y=t.text;return s.default.createElement(a.Text,r({},{text:y}))}if(b===u.BusinessObjectType.Generic){var m=l.isVoidElement(d)?null:h.map(function(e,t){return s.default.createElement(p.BusinessObject,r({},{businessObject:e,overrides:i,key:t}))});if(v.style){var O=r({},v,{style:f.transformCSSToInlineStyle(v.style)});return c.createElement(d,O,m)}return c.createElement(d,v,m)}return s.default.createElement(p.BusinessObject,r({businessObject:t},{overrides:i}))},t.GenericObject.displayName="GenericObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(22);t.Book=function(e){var t=e.book,n=t.title,i=t.chapters;return o.default.createElement("div",{className:"Book"},o.default.createElement(s.Title,r({},{title:n})),i.map(function(e,t){return o.default.createElement(u.Chapter,r({},{chapter:e,key:t}))}))},t.Book.displayName="Book"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(26),u=n(23);t.Problem=function(e){var t=e.problem,n=t.questions,i=t.comment;return o.default.createElement("div",{className:"Problem"},i&&o.default.createElement(u.Comment,r({},{comment:i})),o.default.createElement("div",{className:"questions"},n.map(function(e,t){return o.default.createElement(s.Question,r({},{question:e,key:t}))})))},t.Problem.displayName="Problem"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(22);t.Chapter=r.Chapter;var i=n(5);t.Text=i.Text;var o=n(7);t.Title=o.Title;var s=n(26);t.Question=s.Question;var u=n(25);t.Answer=u.Answer;var c=n(28);t.EnvironmentStatic=c.EnvironmentStatic;var a=n(31);t.Problem=a.Problem;var l=n(29);t.GenericObject=l.GenericObject;var p=n(8);t.Environment=p.Environment;var f=n(24);t.BusinessObject=f.BusinessObject;var d=n(23);t.Comment=d.Comment;var b=n(30);t.Book=b.Book;var h=n(27);t.Supplement=h.Supplement},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3));t.EnvironmentWrapper=function(e){var t=e.inline,n=e.children,o=i(e,["inline","children"]);return t?s.default.createElement("span",r({},o),n):s.default.createElement("div",r({},o),n)},t.EnvironmentWrapper.displayName="EnvironmentWrapper"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};t.isVoidElement=function(e){return!0===r[e]}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.transformCSSToInlineStyle=function(e){var t=/([\w\s-_]+).*?:.*?([\w\s-_]+)/g;return e.split(";").reduce(function(e,n){var i,o=t.exec(n);if(!o)return e;var s=o[1],u=o[2],c=function(e){return e.replace(/\s\s+/g," ").replace(/[^a-zA-Z0-9]/g,"_").replace(/^_+/g,"").replace(/_+$/g,"")}(function(e){return e.replace(/(-.)/g,function(e){return e[1].toUpperCase()})}(s));return r({},e,((i={})[c]=u,i))},{})}}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BookObjects=t():e.BookObjects=t()}(global,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=32)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Answer="answer",e.Book="book",e.Chapter="chapter",e.Comment="comment",e.Content="content",e.Environment="environment",e.Generic="generic",e.Link="link",e.Problem="problem",e.Question="question",e.Supplement="supplement",e.Text="text",e.Title="title"}(t.BusinessObjectType||(t.BusinessObjectType={}))},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(0),s=n(4),u=function(){function e(t,n,r,o,s,u){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===o&&(o={}),void 0===s&&(s=e.defaultLocale),void 0===u&&(u=i.v4());var c=this;this.objectType=t,this.sortOrder=r,this.attributes=o,this.uuid=u,this.childTypeFilter=function(e){return function(t){return t.objectType===e}},this.childUUIDFilter=function(e){return function(t){return t.uuid===e}},this.internalChildren=n.map(function(e){return e.changeParent(c)}),this.internalLocale=s}return Object.defineProperty(e.prototype,"locale",{get:function(){var t=e.defaultLocale,n=e.objectTypesWithLocale;return this.internalLocale!==t&&n.includes(this.objectType)?this.internalLocale:this.findParentLocale()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.internalChildren.sort(function(e,t){return e.sortOrder===t.sortOrder?0:e.sortOrder>t.sortOrder?1:-1})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.findChildren(o.BusinessObjectType.Generic).filter(function(e){return"title"===e.elementType})[0];if(e){var t=e.findChild(o.BusinessObjectType.Text);return t?t.text:void 0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.internalParent},enumerable:!0,configurable:!0}),e.prototype.findDeepChild=function(e){var t=this.findDeepChildren(e);if(t.length)return t[0]},e.prototype.findDeepChildren=function(e){return this.children.reduce(function(t,n){return t.concat(n.findDeepChildren(e),[n])},[]).filter(this.childTypeFilter(e))},e.prototype.findChild=function(e){return this.children.find(this.childTypeFilter(e))},e.prototype.findChildByUUID=function(e){return this.children.find(this.childUUIDFilter(e))},e.prototype.findChildren=function(e){return this.children.filter(this.childTypeFilter(e))},e.prototype.findParent=function(e){if(this.parent)return this.parent.objectType===e?this.parent:this.parent.findParent(e)},e.prototype.addChild=function(e){return e.changeParent(this),this.internalChildren=this.internalChildren.concat(e),this},e.prototype.replaceChild=function(e,t){return t.changeParent(this),this.removeChild(e).addChild(t)},e.prototype.replaceDeepChild=function(e,t){var n=this.findChildByUUID(e);if(n&&!n.parent)throw new Error("Cannot replace top level object");return n&&n.parent&&n.parent.removeChild(e).addChild(t),n||this.children.forEach(function(n){return n.replaceDeepChild(e,t)}),this},e.prototype.removeChild=function(e){return this.internalChildren=this.internalChildren.filter(function(t){return t.uuid!==e}),this},e.prototype.removeDeepChild=function(e){return this.findChildByUUID(e)?this.removeChild(e):(this.children.forEach(function(t){return t.removeDeepChild(e)}),this)},e.prototype.toJSON=function(){return{attributes:r({},this.attributes),children:this.children.map(function(e){return e.toJSON()}),locale:this.locale,sortOrder:this.sortOrder,objectType:this.objectType,uuid:this.uuid}},e.prototype.findParentLocale=function(){var t=this,n=e.objectTypesWithLocale.reduce(function(e,n){if(e)return e;var r=t.findParent(n);return r?r.locale:void 0},void 0);return n||this.objectType!==o.BusinessObjectType.Book?n||this.locale:e.defaultLocale},e.prototype.changeParent=function(e){return this.internalParent=e,this},e.defaultLocale=s.Locales.Czech,e.objectTypesWithLocale=[o.BusinessObjectType.Comment,o.BusinessObjectType.Problem,o.BusinessObjectType.Supplement,o.BusinessObjectType.Chapter,o.BusinessObjectType.Book],e}();t.AbstractBusinessObject=u},function(e,t){e.exports=require("uuid")},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Czech="cs-CZ",e.English="en-US",e.EnglishGB="en-GB",e.Slovak="sk-SK",e.Italian="it-IT",e.Polish="pl-PL",e.German="de-DE"}(t.Locales||(t.Locales={}))},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Text=function(e){var t=e.text;return t?i.default.createElement("span",{className:"text"},t):null},t.Text.displayName="Text"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.AbstractBusinessObject=r.AbstractBusinessObject;var i=n(0);t.BusinessObjectType=i.BusinessObjectType;var o=n(10);t.BookType=o.BookType;var s=n(11);t.Book=s.Book;var u=n(12);t.Chapter=u.Chapter;var c=n(13);t.Comment=c.Comment;var a=n(14);t.GenericObject=a.GenericObject;var l=n(15);t.Text=l.Text;var p=n(16);t.Answer=p.Answer;var f=n(17);t.Environment=f.Environment;var d=n(18);t.Supplement=d.Supplement;var b=n(19);t.Question=b.Question;var h=n(20);t.Problem=h.Problem;var v=n(21);t.Link=v.Link;var y=n(9);t.Content=y.Content;var m=n(4);t.Locales=m.Locales},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(3));t.Title=function(e){var t=e.title;return t?i.default.createElement("h2",{className:"title"},t):null},t.Title.displayName="Title"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(28);t.Environment=function(e){var t=e.environment,n=e.displayAnswers;return o.default.createElement(s.EnvironmentStatic,r({},{environment:t,displayAnswers:n}))},t.Environment.displayName="Environment"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Content,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){return this.findChild(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){return this.findChild(o.BusinessObjectType.Comment)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Content=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Book="BOOK",e.Worksheet="WORKSHEET",e.Tests="TESTS",e.Preparations="PREPARATIONS",e.Mixture="MIXTURE"}(t.BookType||(t.BookType={}))},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o){return void 0===r&&(r=u.Locales.Czech),void 0===o&&(o=i.v4()),e.call(this,s.BusinessObjectType.Book,t,0,n,r,o)||this}return r(t,e),Object.defineProperty(t.prototype,"chapters",{get:function(){return this.findChildren(s.BusinessObjectType.Chapter)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Book=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Chapter,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"problems",{get:function(){return this.findChildren(s.BusinessObjectType.Problem)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supplements",{get:function(){return this.findChildren(s.BusinessObjectType.Supplement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problemsAndSupplements",{get:function(){return this.problems.concat(this.supplements).sort(function(e,t){return e.sortOrder<t.sortOrder?-1:1})},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Chapter=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Comment,t,n,r,o,c)||this}return r(t,e),t}(o.AbstractBusinessObject);t.Comment=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r,i,o){void 0===n&&(n=[]),void 0===r&&(r=0),void 0===o&&(o=u.v4());var c=e.call(this,s.BusinessObjectType.Generic,n,r,i,void 0,o)||this;return c.elementType=t,c}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{elementType:this.elementType})},t}(o.AbstractBusinessObject);t.GenericObject=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(0),u=n(2),c=function(e){function t(t,n,r){void 0===n&&(n=0),void 0===r&&(r=u.v4());var i=e.call(this,s.BusinessObjectType.Text,[],n,void 0,void 0,r)||this;return i.text=t,i}return r(t,e),t.prototype.toJSON=function(){return i({},e.prototype.toJSON.call(this),{text:this.text})},t}(o.AbstractBusinessObject);t.Text=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Answer,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isText",{get:function(){return void 0!==this.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Answer=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Environment,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"inline",{get:function(){return"inline"===this.attributes.inline},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alternatives",{get:function(){return this.attributes.alternative?(""+this.attributes.alternative).split(" "):[]},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Environment=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Supplement,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(s.BusinessObjectType.Text);return e?e.text:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(s.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Supplement=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Question,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"isSubquestion",{get:function(){return!!this.parent&&this.parent.objectType===o.BusinessObjectType.Question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sid",{get:function(){var e=this.attributes.sid;return void 0===e?"":""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){var e=this.findChild(o.BusinessObjectType.Text);return void 0===e?"":e.text},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this.findChild(o.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.findChildren(o.BusinessObjectType.Environment)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subQuestions",{get:function(){return this.findChildren(o.BusinessObjectType.Question)},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Question=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(2),o=n(1),s=n(0),u=n(4),c=function(e){function t(t,n,r,o,c){return void 0===n&&(n=0),void 0===o&&(o=u.Locales.Czech),void 0===c&&(c=i.v4()),e.call(this,s.BusinessObjectType.Problem,t,n,r,o,c)||this}return r(t,e),Object.defineProperty(t.prototype,"question",{get:function(){if(this.content)return this.content.question},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"questions",{get:function(){return this.content&&this.content.question?this.content.question.subQuestions:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){var e=this.attributes.level,t=Number.parseFloat(""+e);return Number.isNaN(t)?void 0:t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"environments",{get:function(){return this.content?this.content.findDeepChildren(s.BusinessObjectType.Environment):[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flag",{get:function(){var e=this.attributes.flag;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"links",{get:function(){return this.findChildren(s.BusinessObjectType.Link)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this.findChild(s.BusinessObjectType.Content)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"comment",{get:function(){if(this.content)return this.content.comment},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){if(this.content)return this.content.findChild(s.BusinessObjectType.Answer)},enumerable:!0,configurable:!0}),t}(o.AbstractBusinessObject);t.Problem=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(0),s=n(2),u=function(e){function t(t,n,r,i){return void 0===n&&(n=0),void 0===i&&(i=s.v4()),e.call(this,o.BusinessObjectType.Link,t,n,r,void 0,i)||this}return r(t,e),Object.defineProperty(t.prototype,"book",{get:function(){var e=this.attributes.book;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chapter",{get:function(){var e=this.attributes.chapter;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"problem",{get:function(){var e=this.attributes.problem;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var e=this.attributes.type;return void 0===e?void 0:""+e},enumerable:!0,configurable:!0}),t}(i.AbstractBusinessObject);t.Link=u},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(23),c=n(31),a=n(27);t.Chapter=function(e){var t=e.chapter,n=t.title,i=t.comment,l=t.problems,p=t.supplements;return o.default.createElement("div",{className:"Chapter"},o.default.createElement(s.Title,r({},{title:n})),i&&o.default.createElement(u.Comment,r({},{comment:i})),l.map(function(e,t){return o.default.createElement(c.Problem,r({},{problem:e,key:t}))}),p.map(function(e,t){return o.default.createElement(a.Supplement,r({},{supplement:e,key:t}))}))},t.Chapter.displayName="Chapter"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(24);t.Comment=function(e){var t=e.comment.children;return o.default.createElement("div",{className:"Comment"},t.map(function(e,t){return o.default.createElement(s.BusinessObject,r({},{businessObject:e,key:t}))}))},t.Comment.displayName="Comment"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var u=o(n(3)),c=s(n(6)),a=n(8),l=n(25),p=n(26),f=n(22),d=n(5),b=n(7),h=n(29),v=n(30),y=n(27);function m(e){var t=e.objectType,n=i(e,["objectType"]);return t!==c.BusinessObjectType.Generic||"title"!==n.elementType}t.BusinessObject=function(e){var n=e.businessObject,i=e.overrides,o=void 0===i?{}:i,s=n.objectType,O=n.children,_=function(e,t){var n=t.objectType,r=e[n];if(!r&&n===c.BusinessObjectType.Generic){var i=t.elementType;return e[i]}return r}(o,n);if(_)return _(n);switch(s){case c.BusinessObjectType.Text:var j=n.text;return u.default.createElement(d.Text,r({},{text:j}));case c.BusinessObjectType.Chapter:var g=n;return u.default.createElement(f.Chapter,r({},{chapter:g}));case c.BusinessObjectType.Question:var P=n;return u.default.createElement(p.Question,r({},{question:P}));case c.BusinessObjectType.Answer:var T=n;return u.default.createElement(l.Answer,r({},{answer:T}));case c.BusinessObjectType.Environment:var B=n;return u.default.createElement(a.Environment,r({},{environment:B}));case c.BusinessObjectType.Generic:var C=n;return u.default.createElement(h.GenericObject,r({},{object:C,overrides:o}));case c.BusinessObjectType.Book:var E=n;return u.default.createElement(v.Book,r({},{book:E}));case c.BusinessObjectType.Supplement:var w=n;return u.default.createElement(y.Supplement,r({},{supplement:w}));default:var x=n.title;return u.default.createElement("div",{className:function(e){void 0===e&&(e="");return e.substr(0,1).toUpperCase()+e.substr(1)}(s)},u.default.createElement(b.Title,r({},{title:x})),O.filter(m).map(function(e,n){return u.default.createElement(t.BusinessObject,r({businessObject:e},{key:n,overrides:o}))}))}},t.BusinessObject.displayName="BusinessObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(8);t.Answer=function(e){var t=e.answer,n=t.isText,i=t.text,c=t.environments,a=e.hide,l=void 0!==a&&a;return l?null:o.default.createElement("div",{className:"Answer"},n?o.default.createElement(s.Text,r({},{text:i})):c.map(function(e,t){return o.default.createElement(u.Environment,r({displayAnswers:!l},{environment:e,key:t}))}))},t.Answer.displayName="Answer"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(5),u=n(25),c=n(8);t.Question=function(e){var t=e.question,n=t.text,i=t.sid,a=t.answer,l=t.environments;return o.default.createElement("div",{className:"Question"},i&&o.default.createElement("strong",{className:"sid"},i,")"),n&&o.default.createElement(s.Text,r({},{text:n})),a&&o.default.createElement(u.Answer,r({},{answer:a})),l.length&&l.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Question.displayName="Question"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(5),c=n(8);t.Supplement=function(e){var t=e.supplement,n=t.title,i=t.text,a=t.environments;return o.default.createElement("div",{className:"Supplement"},o.default.createElement(s.Title,r({},{title:n})),o.default.createElement(u.Text,r({},{text:i})),a.map(function(e,t){return o.default.createElement(c.Environment,r({},{environment:e,key:t}))}))},t.Supplement.displayName="Supplement"},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3)),u=n(3),c=n(33),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.displayName="EnvironmentStatic",t.renderAlternative=function(e,n){return t.props.displayAnswers?s.default.createElement("img",i({src:e},{key:n})):null},t}return r(t,e),t.prototype.render=function(){var e=this.props.environment,t=e.alternatives,n="inline"===e.attributes.inline;return s.default.createElement(c.EnvironmentWrapper,{className:"EnvironmentStatic",inline:n},t.map(this.renderAlternative))},t}(u.Component);t.EnvironmentStatic=a},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var s=i(n(3)),u=o(n(6)),c=n(3),a=n(5),l=n(34),p=n(24),f=n(35);t.GenericObject=function(e){var t=e.object,n=e.overrides,i=void 0===n?{}:n,o=t,d=o.elementType,b=o.objectType,h=o.children,v=o.attributes;if(b===u.BusinessObjectType.Text){var y=t.text;return s.default.createElement(a.Text,r({},{text:y}))}if(b===u.BusinessObjectType.Generic){var m=l.isVoidElement(d)?null:h.map(function(e,t){return s.default.createElement(p.BusinessObject,r({},{businessObject:e,overrides:i,key:t}))});if(v.style){var O=r({},v,{style:f.transformCSSToInlineStyle(v.style)});return c.createElement(d,O,m)}return c.createElement(d,v,m)}return s.default.createElement(p.BusinessObject,r({businessObject:t},{overrides:i}))},t.GenericObject.displayName="GenericObject"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(7),u=n(22);t.Book=function(e){var t=e.book,n=t.title,i=t.chapters;return o.default.createElement("div",{className:"Book"},o.default.createElement(s.Title,r({},{title:n})),i.map(function(e,t){return o.default.createElement(u.Chapter,r({},{chapter:e,key:t}))}))},t.Book.displayName="Book"},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(3)),s=n(26),u=n(23);t.Problem=function(e){var t=e.problem,n=t.questions,i=t.comment;return o.default.createElement("div",{className:"Problem"},i&&o.default.createElement(u.Comment,r({},{comment:i})),o.default.createElement("div",{className:"questions"},n.map(function(e,t){return o.default.createElement(s.Question,r({},{question:e,key:t}))})))},t.Problem.displayName="Problem"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(22);t.Chapter=r.Chapter;var i=n(5);t.Text=i.Text;var o=n(7);t.Title=o.Title;var s=n(26);t.Question=s.Question;var u=n(25);t.Answer=u.Answer;var c=n(28);t.EnvironmentStatic=c.EnvironmentStatic;var a=n(31);t.Problem=a.Problem;var l=n(29);t.GenericObject=l.GenericObject;var p=n(8);t.Environment=p.Environment;var f=n(24);t.BusinessObject=f.BusinessObject;var d=n(23);t.Comment=d.Comment;var b=n(30);t.Book=b.Book;var h=n(27);t.Supplement=h.Supplement},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&(n[r[i]]=e[r[i]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(n(3));t.EnvironmentWrapper=function(e){var t=e.inline,n=e.children,o=i(e,["inline","children"]);return t?s.default.createElement("span",r({},o),n):s.default.createElement("div",r({},o),n)},t.EnvironmentWrapper.displayName="EnvironmentWrapper"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};t.isVoidElement=function(e){return!0===r[e]}},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0}),t.transformCSSToInlineStyle=function(e){var t=/([\w\s-_]+).*?:.*?([\w\s-_]+)/g;return e.split(";").reduce(function(e,n){var i,o=t.exec(n);if(!o)return e;var s=o[1],u=o[2],c=function(e){return e.replace(/\s\s+/g," ").replace(/[^a-zA-Z0-9]/g,"_").replace(/^_+/g,"").replace(/_+$/g,"")}(function(e){return e.replace(/(-.)/g,function(e){return e[1].toUpperCase()})}(s));return r({},e,((i={})[c]=u,i))},{})}}])});
//# sourceMappingURL=index.js.map
{
"name": "@heduapp/book-objects",
"version": "0.16.0",
"version": "0.16.1",
"author": "H-Edu s.r.o.",

@@ -9,3 +9,3 @@ "main": "./index.js",

"test": "ts-node test/runner.ts ./**/*.test.{ts,tsx}",
"test-watch": "onchange \"**/*.{js,ts,tsx}\" -- npm run test",
"test-watch": "onchange -i \"**/*.{js,ts,tsx}\" -- npm run test",
"prettier": "prettier --config .prettierrc --write src/**/*.{ts,tsx,js} test/**/*.{ts,tsx,js} webpack.config.js",

@@ -12,0 +12,0 @@ "prettier-watch": "onchange \"**/*.{js,ts,tsx,json}\" -- npm run prettier",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc