@heduapp/book-objects
Advanced tools
Comparing version 0.21.0 to 0.21.1
@@ -0,0 +0,0 @@ import { Comment } from './comment'; |
@@ -0,0 +0,0 @@ import { AbstractBusinessObject, IAttributes } from './abstract-business-object'; |
@@ -0,0 +0,0 @@ export declare enum BookType { |
@@ -0,0 +0,0 @@ import { AbstractBusinessObject, IAttributes, UUID } from './abstract-business-object'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import { AbstractBusinessObject, IAttributes, UUID } from './abstract-business-object'; |
@@ -0,0 +0,0 @@ import { AbstractBusinessObject, IAttributes, UUID } from './abstract-business-object'; |
@@ -0,0 +0,0 @@ import { AbstractBusinessObject, IAttributes } from './abstract-business-object'; |
@@ -0,0 +0,0 @@ import { AbstractBusinessObject, IAttributes } from './abstract-business-object'; |
@@ -0,0 +0,0 @@ import { AbstractBusinessObject, IAttributes } from './abstract-business-object'; |
@@ -0,0 +0,0 @@ import { AbstractBusinessObject, IAttributes } from './abstract-business-object'; |
@@ -0,0 +0,0 @@ import { EnvironmentH } from './environment-h'; |
@@ -0,0 +0,0 @@ import { AbstractBusinessObject, IAttributes } from './abstract-business-object'; |
@@ -0,0 +0,0 @@ export declare enum Locales { |
@@ -0,0 +0,0 @@ import { AbstractBusinessObject, IAttributes, UUID } from './abstract-business-object'; |
@@ -0,0 +0,0 @@ import { AbstractBusinessObject, IAttributes } from './abstract-business-object'; |
@@ -0,0 +0,0 @@ import { AbstractBusinessObject, IAttributes, UUID } from './abstract-business-object'; |
@@ -0,0 +0,0 @@ import { AbstractBusinessObject } from './abstract-business-object'; |
@@ -0,0 +0,0 @@ import { IBusinessObject } from '../business-object'; |
@@ -0,0 +0,0 @@ export * from './codec'; |
@@ -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 o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=43)}({43:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})}})}); | ||
!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 o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=44)}({44:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0})}})}); | ||
//# sourceMappingURL=index.js.map |
@@ -0,0 +0,0 @@ import { IDecoder } from './codec'; |
@@ -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.EnvironmentH="environment-h",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.parent?this.findParentLocale():this.internalLocale},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||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(9);t.EnvironmentH=r.EnvironmentH;var o=n(1);t.AbstractBusinessObject=o.AbstractBusinessObject;var i=n(0);t.BusinessObjectType=i.BusinessObjectType;var u=n(11);t.BookType=u.BookType;var s=n(12);t.Book=s.Book;var c=n(13);t.Chapter=c.Chapter;var p=n(14);t.Comment=p.Comment;var a=n(15);t.GenericObject=a.GenericObject;var f=n(16);t.Text=f.Text;var l=n(17);t.Answer=l.Answer;var b=n(18);t.Environment=b.Environment;var d=n(19);t.Supplement=d.Supplement;var h=n(20);t.Question=h.Question;var y=n(21);t.Problem=y.Problem;var v=n(22);t.Link=v.Link;var O=n(10);t.Content=O.Content;var j=n(4);t.Locales=j.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.EnvironmentH,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.EnvironmentH=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.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}),Object.defineProperty(t.prototype,"page",{get:function(){var e=this.attributes.page;if(e)return"number"!=typeof e?Number.parseInt(e):e},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(9),u=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,c=t.locale,p=t.uuid,a=t.sortOrder,f=t.text,l=e.decodeChildren(n);switch(o){case u.BusinessObjectType.Book:return new u.Book(l,r,c,p);case u.BusinessObjectType.Chapter:return new u.Chapter(l,a,r,c,p);case u.BusinessObjectType.Comment:return new u.Comment(l,a,r,c,p);case u.BusinessObjectType.Problem:return new u.Problem(l,a,r,c,p);case u.BusinessObjectType.Supplement:return new u.Supplement(l,a,r,c,p);case u.BusinessObjectType.Question:return new u.Question(l,a,r,p);case u.BusinessObjectType.Answer:return new u.Answer(l,a,r,p);case u.BusinessObjectType.Environment:return new u.Environment(l,a,r,p);case u.BusinessObjectType.EnvironmentH:return new i.EnvironmentH(l,a,r,p);case u.BusinessObjectType.Link:return new u.Link(l,a,r,p);case u.BusinessObjectType.Content:return new u.Content(l,a,r,p);case u.BusinessObjectType.Text:return new u.Text(f,a,p);default:return new u.GenericObject(s||"unknown",l,a,r,p)}},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){"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=41)}([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.EnvironmentH="environment-h",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.parent?this.findParentLocale():this.internalLocale},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||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(9);t.EnvironmentH=r.EnvironmentH;var o=n(1);t.AbstractBusinessObject=o.AbstractBusinessObject;var i=n(0);t.BusinessObjectType=i.BusinessObjectType;var u=n(11);t.BookType=u.BookType;var s=n(12);t.Book=s.Book;var c=n(13);t.Chapter=c.Chapter;var p=n(14);t.Comment=p.Comment;var a=n(15);t.GenericObject=a.GenericObject;var f=n(16);t.Text=f.Text;var l=n(17);t.Answer=l.Answer;var b=n(18);t.Environment=b.Environment;var d=n(19);t.Supplement=d.Supplement;var h=n(20);t.Question=h.Question;var y=n(21);t.Problem=y.Problem;var v=n(22);t.Link=v.Link;var O=n(10);t.Content=O.Content;var j=n(4);t.Locales=j.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.EnvironmentH,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.EnvironmentH=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.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}),Object.defineProperty(t.prototype,"page",{get:function(){var e=this.attributes.page;if(e)return"number"!=typeof e?Number.parseInt(e):e},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(9),u=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,c=t.locale,p=t.uuid,a=t.sortOrder,f=t.text,l=e.decodeChildren(n);switch(o){case u.BusinessObjectType.Book:return new u.Book(l,r,c,p);case u.BusinessObjectType.Chapter:return new u.Chapter(l,a,r,c,p);case u.BusinessObjectType.Comment:return new u.Comment(l,a,r,c,p);case u.BusinessObjectType.Problem:return new u.Problem(l,a,r,c,p);case u.BusinessObjectType.Supplement:return new u.Supplement(l,a,r,c,p);case u.BusinessObjectType.Question:return new u.Question(l,a,r,p);case u.BusinessObjectType.Answer:return new u.Answer(l,a,r,p);case u.BusinessObjectType.Environment:return new u.Environment(l,a,r,p);case u.BusinessObjectType.EnvironmentH:return new i.EnvironmentH(l,a,r,p);case u.BusinessObjectType.Link:return new u.Link(l,a,r,p);case u.BusinessObjectType.Content:return new u.Content(l,a,r,p);case u.BusinessObjectType.Text:return new u.Text(f,a,p);default:return new u.GenericObject(s||"unknown",l,a,r,p)}},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}])}); | ||
//# sourceMappingURL=index.js.map |
@@ -0,0 +0,0 @@ import { SFC } from 'react'; |
@@ -0,0 +0,0 @@ import { IEncoder, IDecoder } from './codec'; |
@@ -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=38)}([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.EnvironmentH="environment-h",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.parent?this.findParentLocale():this.internalLocale},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||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(9);t.EnvironmentH=r.EnvironmentH;var o=n(1);t.AbstractBusinessObject=o.AbstractBusinessObject;var i=n(0);t.BusinessObjectType=i.BusinessObjectType;var s=n(11);t.BookType=s.BookType;var u=n(12);t.Book=u.Book;var c=n(13);t.Chapter=c.Chapter;var a=n(14);t.Comment=a.Comment;var p=n(15);t.GenericObject=p.GenericObject;var l=n(16);t.Text=l.Text;var f=n(17);t.Answer=f.Answer;var b=n(18);t.Environment=b.Environment;var d=n(19);t.Supplement=d.Supplement;var y=n(20);t.Question=y.Question;var h=n(21);t.Problem=h.Problem;var v=n(22);t.Link=v.Link;var O=n(10);t.Content=O.Content;var j=n(4);t.Locales=j.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.EnvironmentH,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.EnvironmentH=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.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}),Object.defineProperty(t.prototype,"page",{get:function(){var e=this.attributes.page;if(e)return"number"!=typeof e?Number.parseInt(e):e},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])}}},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(9),c=n(39),a=n(6),p=n(10),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=c.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=c.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 a.BusinessObjectType.Generic:var s=e.elementType;return r({},i,{name:s});case a.BusinessObjectType.Text:return{text:e.text,type:"text"};default:return r({},i,{name:t})}},e.prototype.encodeXMLEntities=function(e){return e.replace(/&/g,"&")},e.prototype.decodeElement=function(e,t){var n=e.name,r=e.elements,o=e.type,i=e.text,c=e.attributes;if(void 0===t&&(t=0),o===a.BusinessObjectType.Text)return new a.Text(""+i,t);var l=this.decodeElements(r),f=c||{},b=f.locale,d=s(f,["locale"]),y=b?b.toString():void 0;switch(n){case a.BusinessObjectType.Book:return new a.Book(l,d,y);case a.BusinessObjectType.Chapter:return new a.Chapter(l,t,d,y);case a.BusinessObjectType.Comment:return new a.Comment(l,t,d,y);case a.BusinessObjectType.Problem:return new a.Problem(l,t,d,y);case a.BusinessObjectType.Question:return new a.Question(l,t,d);case a.BusinessObjectType.Answer:return new a.Answer(l,t,d);case a.BusinessObjectType.Environment:return new a.Environment(l,t,d);case a.BusinessObjectType.EnvironmentH:return new u.EnvironmentH(l,t,d);case a.BusinessObjectType.Supplement:return new a.Supplement(l,t,d,y);case a.BusinessObjectType.Link:return new a.Link(l,t,d);case a.BusinessObjectType.Content:return new p.Content(l,t,d);default:return new a.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=a.AbstractBusinessObject.objectTypesWithLocale,o=a.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){"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=38)}([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.EnvironmentH="environment-h",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.parent?this.findParentLocale():this.internalLocale},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||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(9);t.EnvironmentH=r.EnvironmentH;var o=n(1);t.AbstractBusinessObject=o.AbstractBusinessObject;var i=n(0);t.BusinessObjectType=i.BusinessObjectType;var s=n(11);t.BookType=s.BookType;var u=n(12);t.Book=u.Book;var c=n(13);t.Chapter=c.Chapter;var a=n(14);t.Comment=a.Comment;var p=n(15);t.GenericObject=p.GenericObject;var l=n(16);t.Text=l.Text;var f=n(17);t.Answer=f.Answer;var d=n(18);t.Environment=d.Environment;var b=n(19);t.Supplement=b.Supplement;var h=n(20);t.Question=h.Question;var y=n(21);t.Problem=y.Problem;var v=n(22);t.Link=v.Link;var O=n(10);t.Content=O.Content;var j=n(4);t.Locales=j.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.EnvironmentH,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.EnvironmentH=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.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}),Object.defineProperty(t.prototype,"page",{get:function(){var e=this.attributes.page;if(e)return"number"!=typeof e?Number.parseInt(e):e},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])}}},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},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=n(9),a=n(39),p=n(6),l=n(10),f=u(n(40)),d=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=a.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=a.js2xml(n);return t&&(r=f.default(r,{collapseContent:!0}).replace('<?xml encoding="UTF-8" version="1.0"?>',"").trim().split("\r\n").join("\n")),this.encodeXMLEntities(r)},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 p.BusinessObjectType.Generic:var s=e.elementType;return r({},i,{name:s});case p.BusinessObjectType.Text:return{text:e.text,type:"text"};default:return r({},i,{name:t})}},e.prototype.encodeXMLEntities=function(e){return e.replace(/&/g,"&")},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===p.BusinessObjectType.Text)return new p.Text(""+i,t);var a=this.decodeElements(r),f=u||{},d=f.locale,b=s(f,["locale"]),h=d?d.toString():void 0;switch(n){case p.BusinessObjectType.Book:return new p.Book(a,b,h);case p.BusinessObjectType.Chapter:return new p.Chapter(a,t,b,h);case p.BusinessObjectType.Comment:return new p.Comment(a,t,b,h);case p.BusinessObjectType.Problem:return new p.Problem(a,t,b,h);case p.BusinessObjectType.Question:return new p.Question(a,t,b);case p.BusinessObjectType.Answer:return new p.Answer(a,t,b);case p.BusinessObjectType.Environment:return new p.Environment(a,t,b);case p.BusinessObjectType.EnvironmentH:return new c.EnvironmentH(a,t,b);case p.BusinessObjectType.Supplement:return new p.Supplement(a,t,b,h);case p.BusinessObjectType.Link:return new p.Link(a,t,b);case p.BusinessObjectType.Content:return new l.Content(a,t,b);default:return new p.GenericObject(n||"unknown",this.decodeElements(r),t,b)}},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=p.AbstractBusinessObject.objectTypesWithLocale,o=p.AbstractBusinessObject.defaultLocale,i=r.includes(t),s=n===o,u=e.internalLocale===o;return!i||s||u?{}:{locale:n}},e}();t.XMLCodec=d},function(e,t){e.exports=require("xml-js")},function(e,t){e.exports=require("xml-formatter")}])}); | ||
//# sourceMappingURL=index.js.map |
@@ -0,0 +0,0 @@ import * as BusinessObject from './business-object'; |
@@ -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=41)}([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.EnvironmentH="environment-h",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.parent?this.findParentLocale():this.internalLocale},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||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(9);t.EnvironmentH=r.EnvironmentH;var o=n(1);t.AbstractBusinessObject=o.AbstractBusinessObject;var i=n(0);t.BusinessObjectType=i.BusinessObjectType;var s=n(11);t.BookType=s.BookType;var u=n(12);t.Book=u.Book;var c=n(13);t.Chapter=c.Chapter;var a=n(14);t.Comment=a.Comment;var l=n(15);t.GenericObject=l.GenericObject;var p=n(16);t.Text=p.Text;var f=n(17);t.Answer=f.Answer;var d=n(18);t.Environment=d.Environment;var b=n(19);t.Supplement=b.Supplement;var h=n(20);t.Question=h.Question;var y=n(21);t.Problem=y.Problem;var v=n(22);t.Link=v.Link;var m=n(10);t.Content=m.Content;var O=n(4);t.Locales=O.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(29);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.EnvironmentH,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.EnvironmentH=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.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}),Object.defineProperty(t.prototype,"page",{get:function(){var e=this.attributes.page;if(e)return"number"!=typeof e?Number.parseInt(e):e},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(24),c=n(32),a=n(28);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(25);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(26),p=n(27),f=n(23),d=n(5),b=n(7),h=n(30),y=n(31),v=n(28);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.EnvironmentH:var B=n;return u.default.createElement(h.GenericObject,r({},{object:B}));case c.BusinessObjectType.Generic:var E=n;return u.default.createElement(h.GenericObject,r({},{object:E,overrides:i}));case c.BusinessObjectType.Book:var C=n;return u.default.createElement(y.Book,r({},{book:C}));case c.BusinessObjectType.Supplement:var x=n;return u.default.createElement(v.Supplement,r({},{supplement:x}));default:var S=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:S})),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(26),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(34),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(35),p=n(25),f=n(36);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(23);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(27),u=n(24);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(23);t.Chapter=r.Chapter;var o=n(5);t.Text=o.Text;var i=n(7);t.Title=i.Title;var s=n(27);t.Question=s.Question;var u=n(26);t.Answer=u.Answer;var c=n(29);t.EnvironmentStatic=c.EnvironmentStatic;var a=n(32);t.Problem=a.Problem;var l=n(30);t.GenericObject=l.GenericObject;var p=n(8);t.Environment=p.Environment;var f=n(25);t.BusinessObject=f.BusinessObject;var d=n(24);t.Comment=d.Comment;var b=n(31);t.Book=b.Book;var h=n(28);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(33),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(9),c=n(39),a=n(6),l=n(10),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=c.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=c.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 a.BusinessObjectType.Generic:var s=e.elementType;return r({},i,{name:s});case a.BusinessObjectType.Text:return{text:e.text,type:"text"};default:return r({},i,{name:t})}},e.prototype.encodeXMLEntities=function(e){return e.replace(/&/g,"&")},e.prototype.decodeElement=function(e,t){var n=e.name,r=e.elements,o=e.type,i=e.text,c=e.attributes;if(void 0===t&&(t=0),o===a.BusinessObjectType.Text)return new a.Text(""+i,t);var p=this.decodeElements(r),f=c||{},d=f.locale,b=s(f,["locale"]),h=d?d.toString():void 0;switch(n){case a.BusinessObjectType.Book:return new a.Book(p,b,h);case a.BusinessObjectType.Chapter:return new a.Chapter(p,t,b,h);case a.BusinessObjectType.Comment:return new a.Comment(p,t,b,h);case a.BusinessObjectType.Problem:return new a.Problem(p,t,b,h);case a.BusinessObjectType.Question:return new a.Question(p,t,b);case a.BusinessObjectType.Answer:return new a.Answer(p,t,b);case a.BusinessObjectType.Environment:return new a.Environment(p,t,b);case a.BusinessObjectType.EnvironmentH:return new u.EnvironmentH(p,t,b);case a.BusinessObjectType.Supplement:return new a.Supplement(p,t,b,h);case a.BusinessObjectType.Link:return new a.Link(p,t,b);case a.BusinessObjectType.Content:return new l.Content(p,t,b);default:return new a.GenericObject(n||"unknown",this.decodeElements(r),t,b)}},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=a.AbstractBusinessObject.objectTypesWithLocale,o=a.AbstractBusinessObject.defaultLocale,i=r.includes(t),s=n===o,u=e.internalLocale===o;return!i||s||u?{}:{locale:n}},e}();t.XMLCodec=p},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(9),s=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,c=t.locale,a=t.uuid,l=t.sortOrder,p=t.text,f=e.decodeChildren(n);switch(o){case s.BusinessObjectType.Book:return new s.Book(f,r,c,a);case s.BusinessObjectType.Chapter:return new s.Chapter(f,l,r,c,a);case s.BusinessObjectType.Comment:return new s.Comment(f,l,r,c,a);case s.BusinessObjectType.Problem:return new s.Problem(f,l,r,c,a);case s.BusinessObjectType.Supplement:return new s.Supplement(f,l,r,c,a);case s.BusinessObjectType.Question:return new s.Question(f,l,r,a);case s.BusinessObjectType.Answer:return new s.Answer(f,l,r,a);case s.BusinessObjectType.Environment:return new s.Environment(f,l,r,a);case s.BusinessObjectType.EnvironmentH:return new i.EnvironmentH(f,l,r,a);case s.BusinessObjectType.Link:return new s.Link(f,l,r,a);case s.BusinessObjectType.Content:return new s.Content(f,l,r,a);case s.BusinessObjectType.Text:return new s.Text(p,l,a);default:return new s.GenericObject(u||"unknown",f,l,r,a)}},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,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(33));t.JSX=i;var s=r(n(42));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(37)),r(n(38)),r(n(40))}])}); | ||
!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=42)}([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.EnvironmentH="environment-h",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.parent?this.findParentLocale():this.internalLocale},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||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(9);t.EnvironmentH=r.EnvironmentH;var o=n(1);t.AbstractBusinessObject=o.AbstractBusinessObject;var i=n(0);t.BusinessObjectType=i.BusinessObjectType;var s=n(11);t.BookType=s.BookType;var u=n(12);t.Book=u.Book;var c=n(13);t.Chapter=c.Chapter;var a=n(14);t.Comment=a.Comment;var l=n(15);t.GenericObject=l.GenericObject;var p=n(16);t.Text=p.Text;var f=n(17);t.Answer=f.Answer;var d=n(18);t.Environment=d.Environment;var b=n(19);t.Supplement=b.Supplement;var h=n(20);t.Question=h.Question;var y=n(21);t.Problem=y.Problem;var v=n(22);t.Link=v.Link;var m=n(10);t.Content=m.Content;var O=n(4);t.Locales=O.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(29);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.EnvironmentH,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.EnvironmentH=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.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}),Object.defineProperty(t.prototype,"page",{get:function(){var e=this.attributes.page;if(e)return"number"!=typeof e?Number.parseInt(e):e},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(24),c=n(32),a=n(28);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(25);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(26),p=n(27),f=n(23),d=n(5),b=n(7),h=n(30),y=n(31),v=n(28);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.EnvironmentH:var B=n;return u.default.createElement(h.GenericObject,r({},{object:B}));case c.BusinessObjectType.Generic:var C=n;return u.default.createElement(h.GenericObject,r({},{object:C,overrides:i}));case c.BusinessObjectType.Book:var E=n;return u.default.createElement(y.Book,r({},{book:E}));case c.BusinessObjectType.Supplement:var x=n;return u.default.createElement(v.Supplement,r({},{supplement:x}));default:var S=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:S})),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(26),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(34),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(35),p=n(25),f=n(36);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(23);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(27),u=n(24);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(23);t.Chapter=r.Chapter;var o=n(5);t.Text=o.Text;var i=n(7);t.Title=i.Title;var s=n(27);t.Question=s.Question;var u=n(26);t.Answer=u.Answer;var c=n(29);t.EnvironmentStatic=c.EnvironmentStatic;var a=n(32);t.Problem=a.Problem;var l=n(30);t.GenericObject=l.GenericObject;var p=n(8);t.Environment=p.Environment;var f=n(25);t.BusinessObject=f.BusinessObject;var d=n(24);t.Comment=d.Comment;var b=n(31);t.Book=b.Book;var h=n(28);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(33),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},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=n(9),a=n(39),l=n(6),p=n(10),f=u(n(40)),d=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=a.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=a.js2xml(n);return t&&(r=f.default(r,{collapseContent:!0}).replace('<?xml encoding="UTF-8" version="1.0"?>',"").trim().split("\r\n").join("\n")),this.encodeXMLEntities(r)},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 l.BusinessObjectType.Generic:var s=e.elementType;return r({},i,{name:s});case l.BusinessObjectType.Text:return{text:e.text,type:"text"};default:return r({},i,{name:t})}},e.prototype.encodeXMLEntities=function(e){return e.replace(/&/g,"&")},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===l.BusinessObjectType.Text)return new l.Text(""+i,t);var a=this.decodeElements(r),f=u||{},d=f.locale,b=s(f,["locale"]),h=d?d.toString():void 0;switch(n){case l.BusinessObjectType.Book:return new l.Book(a,b,h);case l.BusinessObjectType.Chapter:return new l.Chapter(a,t,b,h);case l.BusinessObjectType.Comment:return new l.Comment(a,t,b,h);case l.BusinessObjectType.Problem:return new l.Problem(a,t,b,h);case l.BusinessObjectType.Question:return new l.Question(a,t,b);case l.BusinessObjectType.Answer:return new l.Answer(a,t,b);case l.BusinessObjectType.Environment:return new l.Environment(a,t,b);case l.BusinessObjectType.EnvironmentH:return new c.EnvironmentH(a,t,b);case l.BusinessObjectType.Supplement:return new l.Supplement(a,t,b,h);case l.BusinessObjectType.Link:return new l.Link(a,t,b);case l.BusinessObjectType.Content:return new p.Content(a,t,b);default:return new l.GenericObject(n||"unknown",this.decodeElements(r),t,b)}},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=l.AbstractBusinessObject.objectTypesWithLocale,o=l.AbstractBusinessObject.defaultLocale,i=r.includes(t),s=n===o,u=e.internalLocale===o;return!i||s||u?{}:{locale:n}},e}();t.XMLCodec=d},function(e,t){e.exports=require("xml-js")},function(e,t){e.exports=require("xml-formatter")},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(9),s=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,c=t.locale,a=t.uuid,l=t.sortOrder,p=t.text,f=e.decodeChildren(n);switch(o){case s.BusinessObjectType.Book:return new s.Book(f,r,c,a);case s.BusinessObjectType.Chapter:return new s.Chapter(f,l,r,c,a);case s.BusinessObjectType.Comment:return new s.Comment(f,l,r,c,a);case s.BusinessObjectType.Problem:return new s.Problem(f,l,r,c,a);case s.BusinessObjectType.Supplement:return new s.Supplement(f,l,r,c,a);case s.BusinessObjectType.Question:return new s.Question(f,l,r,a);case s.BusinessObjectType.Answer:return new s.Answer(f,l,r,a);case s.BusinessObjectType.Environment:return new s.Environment(f,l,r,a);case s.BusinessObjectType.EnvironmentH:return new i.EnvironmentH(f,l,r,a);case s.BusinessObjectType.Link:return new s.Link(f,l,r,a);case s.BusinessObjectType.Content:return new s.Content(f,l,r,a);case s.BusinessObjectType.Text:return new s.Text(p,l,a);default:return new s.GenericObject(u||"unknown",f,l,r,a)}},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,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(33));t.JSX=i;var s=r(n(43));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(37)),r(n(38)),r(n(41))}])}); | ||
//# sourceMappingURL=index.js.map |
@@ -0,0 +0,0 @@ import * as BO from '../business-object'; |
@@ -0,0 +0,0 @@ import { SFC } from 'react'; |
@@ -0,0 +0,0 @@ import { SFC, ReactElement } from 'react'; |
@@ -0,0 +0,0 @@ import { SFC } from 'react'; |
@@ -0,0 +0,0 @@ import { SFC } from 'react'; |
@@ -0,0 +0,0 @@ import { SFC } from 'react'; |
@@ -0,0 +0,0 @@ import { Component } from 'react'; |
@@ -0,0 +0,0 @@ import { ReactNode, SFC } from 'react'; |
@@ -0,0 +0,0 @@ import * as BO from '../business-object'; |
@@ -0,0 +0,0 @@ import { Chapter } from './Chapter'; |
@@ -0,0 +0,0 @@ export interface IVoidElements { |
@@ -0,0 +0,0 @@ import { SFC } from 'react'; |
@@ -0,0 +0,0 @@ import { SFC } from 'react'; |
@@ -0,0 +0,0 @@ import { SFC } from 'react'; |
@@ -0,0 +0,0 @@ import { SFC } from 'react'; |
@@ -0,0 +0,0 @@ import { SFC } from 'react'; |
export declare function transformCSSToInlineStyle(inputCssText: string): {}; |
{ | ||
"name": "@heduapp/book-objects", | ||
"version": "0.21.0", | ||
"version": "0.21.1", | ||
"author": "H-Edu s.r.o.", | ||
@@ -46,2 +46,3 @@ "main": "./index.js", | ||
"dependencies": { | ||
"@types/xml-formatter": "^1.1.0", | ||
"native-css": "^2.0.0", | ||
@@ -51,2 +52,3 @@ "react": "^16.4.1", | ||
"uuid": "^3.3.2", | ||
"xml-formatter": "^1.1.0", | ||
"xml-js": "^1.6.7" | ||
@@ -53,0 +55,0 @@ }, |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
612966
1159
0
10
+ Added@types/xml-formatter@^1.1.0
+ Addedxml-formatter@^1.1.0
+ Added@types/xml-formatter@1.2.0(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addedms@2.1.3(transitive)
+ Addedxml-formatter@1.2.1(transitive)
+ Addedxml-parser-xo@2.2.1(transitive)