@gmb/bitmark-parser-generator 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/browser/bitmark-parser-generator-antlr.min.js +1 -1
  2. package/dist/browser/bitmark-parser-generator.min.js +1 -1
  3. package/dist/browser/bundle-report.html +2 -2
  4. package/dist/cjs/ast/BaseBuilder.js +22 -22
  5. package/dist/cjs/ast/BaseBuilder.js.map +1 -1
  6. package/dist/cjs/ast/Builder.js +137 -54
  7. package/dist/cjs/ast/Builder.js.map +1 -1
  8. package/dist/cjs/config/bits/flashcardBitConfig.js +6 -2
  9. package/dist/cjs/config/bits/flashcardBitConfig.js.map +1 -1
  10. package/dist/cjs/config/bits/generic/cardSetBitConfigs.js +15 -1
  11. package/dist/cjs/config/bits/generic/cardSetBitConfigs.js.map +1 -1
  12. package/dist/cjs/config/bits/generic/standardBitConfigs.js +18 -0
  13. package/dist/cjs/config/bits/generic/standardBitConfigs.js.map +1 -1
  14. package/dist/cjs/config/config.js +5 -1
  15. package/dist/cjs/config/config.js.map +1 -1
  16. package/dist/cjs/config/properties/colorTagPropertyConfig.js +8 -0
  17. package/dist/cjs/config/properties/colorTagPropertyConfig.js.map +1 -0
  18. package/dist/cjs/config/properties/iconPropertyConfig.js +9 -0
  19. package/dist/cjs/config/properties/iconPropertyConfig.js.map +1 -0
  20. package/dist/cjs/config/properties/iconTagPropertyConfig.js +9 -0
  21. package/dist/cjs/config/properties/iconTagPropertyConfig.js.map +1 -0
  22. package/dist/cjs/config/properties/tagPropertyConfig.js +8 -0
  23. package/dist/cjs/config/properties/tagPropertyConfig.js.map +1 -0
  24. package/dist/cjs/config/properties/targetPropertyConfig.js +8 -0
  25. package/dist/cjs/config/properties/targetPropertyConfig.js.map +1 -0
  26. package/dist/cjs/generated/build-info.js +1 -1
  27. package/dist/cjs/generated/parser/bitmark/bitmark-peggy-parser.js +161 -213
  28. package/dist/cjs/generated/parser/bitmark/bitmark-peggy-parser.js.map +1 -1
  29. package/dist/cjs/generator/bitmark/BitmarkGenerator.js +51 -4
  30. package/dist/cjs/generator/bitmark/BitmarkGenerator.js.map +1 -1
  31. package/dist/cjs/generator/json/JsonGenerator.js +49 -4
  32. package/dist/cjs/generator/json/JsonGenerator.js.map +1 -1
  33. package/dist/cjs/model/ast/NodeType.js +18 -0
  34. package/dist/cjs/model/ast/NodeType.js.map +1 -1
  35. package/dist/cjs/model/enum/BitType.js +13 -1
  36. package/dist/cjs/model/enum/BitType.js.map +1 -1
  37. package/dist/cjs/model/enum/CardSetType.js +1 -0
  38. package/dist/cjs/model/enum/CardSetType.js.map +1 -1
  39. package/dist/cjs/model/enum/PropertyKey.js +5 -0
  40. package/dist/cjs/model/enum/PropertyKey.js.map +1 -1
  41. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js +21 -2
  42. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserHelper.js.map +1 -1
  43. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserTypes.js +1 -1
  44. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserTypes.js.map +1 -1
  45. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js +10 -3
  46. package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js.map +1 -1
  47. package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +148 -27
  48. package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +1 -1
  49. package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +4 -0
  50. package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +1 -1
  51. package/dist/cjs/parser/json/JsonParser.js +24 -2
  52. package/dist/cjs/parser/json/JsonParser.js.map +1 -1
  53. package/dist/esm/ast/BaseBuilder.js +22 -22
  54. package/dist/esm/ast/BaseBuilder.js.map +1 -1
  55. package/dist/esm/ast/Builder.js +137 -54
  56. package/dist/esm/ast/Builder.js.map +1 -1
  57. package/dist/esm/config/bits/flashcardBitConfig.js +6 -2
  58. package/dist/esm/config/bits/flashcardBitConfig.js.map +1 -1
  59. package/dist/esm/config/bits/generic/cardSetBitConfigs.js +14 -1
  60. package/dist/esm/config/bits/generic/cardSetBitConfigs.js.map +1 -1
  61. package/dist/esm/config/bits/generic/standardBitConfigs.js +18 -0
  62. package/dist/esm/config/bits/generic/standardBitConfigs.js.map +1 -1
  63. package/dist/esm/config/config.js +5 -1
  64. package/dist/esm/config/config.js.map +1 -1
  65. package/dist/esm/config/properties/colorTagPropertyConfig.js +6 -0
  66. package/dist/esm/config/properties/colorTagPropertyConfig.js.map +1 -0
  67. package/dist/esm/config/properties/iconPropertyConfig.js +7 -0
  68. package/dist/esm/config/properties/iconPropertyConfig.js.map +1 -0
  69. package/dist/esm/config/properties/iconTagPropertyConfig.js +7 -0
  70. package/dist/esm/config/properties/iconTagPropertyConfig.js.map +1 -0
  71. package/dist/esm/config/properties/tagPropertyConfig.js +6 -0
  72. package/dist/esm/config/properties/tagPropertyConfig.js.map +1 -0
  73. package/dist/esm/config/properties/targetPropertyConfig.js +6 -0
  74. package/dist/esm/config/properties/targetPropertyConfig.js.map +1 -0
  75. package/dist/esm/generated/build-info.js +1 -1
  76. package/dist/esm/generated/parser/bitmark/bitmark-peggy-parser.js +161 -213
  77. package/dist/esm/generated/parser/bitmark/bitmark-peggy-parser.js.map +1 -1
  78. package/dist/esm/generator/bitmark/BitmarkGenerator.js +51 -4
  79. package/dist/esm/generator/bitmark/BitmarkGenerator.js.map +1 -1
  80. package/dist/esm/generator/json/JsonGenerator.js +49 -4
  81. package/dist/esm/generator/json/JsonGenerator.js.map +1 -1
  82. package/dist/esm/model/ast/NodeType.js +18 -0
  83. package/dist/esm/model/ast/NodeType.js.map +1 -1
  84. package/dist/esm/model/enum/BitType.js +13 -1
  85. package/dist/esm/model/enum/BitType.js.map +1 -1
  86. package/dist/esm/model/enum/CardSetType.js +1 -0
  87. package/dist/esm/model/enum/CardSetType.js.map +1 -1
  88. package/dist/esm/model/enum/PropertyKey.js +5 -0
  89. package/dist/esm/model/enum/PropertyKey.js.map +1 -1
  90. package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js +21 -2
  91. package/dist/esm/parser/bitmark/peg/BitmarkPegParserHelper.js.map +1 -1
  92. package/dist/esm/parser/bitmark/peg/BitmarkPegParserTypes.js +1 -1
  93. package/dist/esm/parser/bitmark/peg/BitmarkPegParserTypes.js.map +1 -1
  94. package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js +10 -3
  95. package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js.map +1 -1
  96. package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +149 -28
  97. package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +1 -1
  98. package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +4 -0
  99. package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +1 -1
  100. package/dist/esm/parser/json/JsonParser.js +24 -2
  101. package/dist/esm/parser/json/JsonParser.js.map +1 -1
  102. package/dist/types/ast/BaseBuilder.d.ts +8 -8
  103. package/dist/types/ast/Builder.d.ts +51 -6
  104. package/dist/types/ast/Builder.d.ts.map +1 -1
  105. package/dist/types/config/bits/generic/cardSetBitConfigs.d.ts +2 -1
  106. package/dist/types/config/bits/generic/cardSetBitConfigs.d.ts.map +1 -1
  107. package/dist/types/config/bits/generic/standardBitConfigs.d.ts.map +1 -1
  108. package/dist/types/config/config.d.ts +5 -1
  109. package/dist/types/config/config.d.ts.map +1 -1
  110. package/dist/types/config/properties/colorTagPropertyConfig.d.ts +2 -0
  111. package/dist/types/config/properties/colorTagPropertyConfig.d.ts.map +1 -0
  112. package/dist/types/config/properties/iconPropertyConfig.d.ts +2 -0
  113. package/dist/types/config/properties/iconPropertyConfig.d.ts.map +1 -0
  114. package/dist/types/config/properties/iconTagPropertyConfig.d.ts +2 -0
  115. package/dist/types/config/properties/iconTagPropertyConfig.d.ts.map +1 -0
  116. package/dist/types/config/properties/tagPropertyConfig.d.ts +2 -0
  117. package/dist/types/config/properties/tagPropertyConfig.d.ts.map +1 -0
  118. package/dist/types/config/properties/targetPropertyConfig.d.ts +2 -0
  119. package/dist/types/config/properties/targetPropertyConfig.d.ts.map +1 -0
  120. package/dist/types/generated/parser/bitmark/bitmark-peggy-parser.d.ts.map +1 -1
  121. package/dist/types/generator/bitmark/BitmarkGenerator.d.ts +6 -1
  122. package/dist/types/generator/bitmark/BitmarkGenerator.d.ts.map +1 -1
  123. package/dist/types/generator/json/JsonGenerator.d.ts +1 -0
  124. package/dist/types/generator/json/JsonGenerator.d.ts.map +1 -1
  125. package/dist/types/model/ast/NodeType.d.ts +32 -0
  126. package/dist/types/model/ast/NodeType.d.ts.map +1 -1
  127. package/dist/types/model/ast/Nodes.d.ts +17 -0
  128. package/dist/types/model/ast/Nodes.d.ts.map +1 -1
  129. package/dist/types/model/enum/BitType.d.ts +10 -2
  130. package/dist/types/model/enum/BitType.d.ts.map +1 -1
  131. package/dist/types/model/enum/CardSetType.d.ts +2 -0
  132. package/dist/types/model/enum/CardSetType.d.ts.map +1 -1
  133. package/dist/types/model/enum/PropertyKey.d.ts +10 -0
  134. package/dist/types/model/enum/PropertyKey.d.ts.map +1 -1
  135. package/dist/types/model/json/BitJson.d.ts +24 -7
  136. package/dist/types/model/json/BitJson.d.ts.map +1 -1
  137. package/dist/types/parser/bitmark/peg/BitmarkPegParserHelper.d.ts.map +1 -1
  138. package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts +7 -4
  139. package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts.map +1 -1
  140. package/dist/types/parser/bitmark/peg/BitmarkPegParserValidator.d.ts.map +1 -1
  141. package/dist/types/parser/bitmark/peg/contentProcessors/CardContentProcessor.d.ts.map +1 -1
  142. package/dist/types/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.d.ts.map +1 -1
  143. package/dist/types/parser/json/JsonParser.d.ts +1 -0
  144. package/dist/types/parser/json/JsonParser.d.ts.map +1 -1
  145. package/package.json +1 -1
  146. package/dist/cjs/config/bits/flashcard1BitConfig.js +0 -11
  147. package/dist/cjs/config/bits/flashcard1BitConfig.js.map +0 -1
  148. package/dist/esm/config/bits/flashcard1BitConfig.js +0 -9
  149. package/dist/esm/config/bits/flashcard1BitConfig.js.map +0 -1
  150. package/dist/types/config/bits/flashcard1BitConfig.d.ts +0 -2
  151. package/dist/types/config/bits/flashcard1BitConfig.d.ts.map +0 -1
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.bitmarkParserGenerator=t():e.bitmarkParserGenerator=t()}(this,(()=>(()=>{"use strict";var e={6688:(e,t,r)=>{function i(e,t){var r;const i=Object.freeze,o=Object.defineProperty,s=Object.assign,n={enumerable:!1},a=new Map,l=new Map,u=new Map,c=new Map,d=new Map,p=(null!==(r=null==t?void 0:t.iterationKeys)&&void 0!==r?r:Object.keys(e)).map((e=>`${e}`));for(const[t,r]of Object.entries(e))a.set(t,r),u.set(t.toLowerCase(),r);for(const[e,t]of a){const r="string"==typeof t?t.toLowerCase():t;l.set(t,e),c.set(r,e)}const h=p.map((e=>a.get(e))),y=p.map((e=>[e,a.get(e)]));return(t=>{let r=e;function g(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?a.get(c.get(e.toLowerCase())):!e||l.has(e)?e:void 0}Object.isExtensible(e)||(r=s({},e)),o(r,"fromKey",s({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?u.get(e.toLowerCase()):a.get(`${e}`)}},n)),o(r,"fromValue",s({value:g},n)),o(r,"keyFromValue",s({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?c.get(e.toLowerCase()):l.get(e)}},n)),o(r,"setMetadata",s({value:function(e,t,r){const i=g(e);i&&d.set(i,t)}},n)),o(r,"getMetadata",s({value:function(e,t){return d.get(e)}},n)),o(r,Symbol.iterator,s({value:function(){let e=0;return{next:()=>e<p.length?{value:a.get(`${p[e++]}`),done:!1}:{done:!0}}}},n)),o(r,"values",s({value:()=>h},n)),o(r,"keys",s({value:()=>p},n)),o(r,"entries",s({value:()=>y},n));let f=r;return(null==t?void 0:t.noFreeze)||(f=i(r),i(p),i(h),i(y)),f})(t)}r.r(t),r.d(t,{superenum:()=>o});const o=i;o.fromObject=i,o.fromArray=function(e,t){Array.isArray(e)||(e=[]);const r=e.reduce(((e,t)=>(e[`${t}`]=t,e)),{});return(!t||t&&!t.iterationKeys)&&((t=Object.assign({},t)).iterationKeys=e),i(r,t)}},390:function(e,t,r){var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,o)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=(this&&this.__importStar,this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))});this&&this.__importDefault;Object.defineProperty(t,"__esModule",{value:!0}),t.Output=t.BitmarkParserGenerator=void 0;const n=r(6688),a=r(8256),l=r(8582),u=r(4275),c=r(6958),d=r(9556),p=r(2434),h=r(671),y=(0,n.superenum)({bitmark:"bitmark",json:"json",ast:"ast"});t.Output=y;t.BitmarkParserGenerator=class{constructor(){this.ast=new a.Ast,this.jsonParser=new p.JsonParser,this.bitmarkParser=new d.BitmarkParser,this.jsonStringifyPrettify=(e,t,r)=>{const i=!0===t.prettify?2:t.prettify||void 0;return r||!0===t.stringify||void 0!==i?JSON.stringify(e,null,i):e}}version(){return h.env.appVersion.full}convert(e,t){return s(this,void 0,void 0,(function*(){let r;const i=Object.assign({},t),o=Object.assign({},i.fileOptions),n=Object.assign({},i.jsonOptions),a=i.outputFormat,d=a===y.bitmark,p=a===y.json,g=a===y.ast,f=i.bitmarkParserType;let m=e;if(h.env.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");h.env.isNode&&fs.existsSync(m)&&(m=fs.readFileSync(m,{encoding:"utf8"}));let b=this.ast.preprocessAst(m);const v=!!b;v||(b=this.jsonParser.toAst(m));const T=!!(null==b?void 0:b.bits),A=e=>s(this,void 0,void 0,(function*(){yield P(e),yield x(r)})),P=e=>s(this,void 0,void 0,(function*(){r=this.bitmarkParser.toAst(e,{parserType:f})})),_=e=>s(this,void 0,void 0,(function*(){if(f===c.BitmarkParserType.antlr){const t=this.bitmarkParser.parseUsingAntlr(e);if(i.outputFile){const e=this.jsonStringifyPrettify(t,n,!0),r=o.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(i.outputFile.toString())),fs.writeFileSync(i.outputFile,e,{flag:r})}else r=this.jsonStringifyPrettify(t,n)}else if(b=this.bitmarkParser.toAst(e,{parserType:f}),i.outputFile){const e=new JsonFileGenerator_1.JsonFileGenerator(i.outputFile,i);yield e.generate(b)}else{const e=new u.JsonObjectGenerator(i),t=yield e.generate(b);r=this.jsonStringifyPrettify(t,n)}})),x=e=>s(this,void 0,void 0,(function*(){if(i.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(i.outputFile,i);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(i);r=yield t.generate(e)}})),w=e=>s(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,n)})),S=e=>s(this,void 0,void 0,(function*(){if(i.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(i.outputFile,i);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(i),o=yield t.generate(e);r=this.jsonStringifyPrettify(o,n)}})),O=e=>s(this,void 0,void 0,(function*(){if(i.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(i.outputFile,i);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(i);r=yield t.generate(e)}})),R=e=>s(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,n)})),k=e=>s(this,void 0,void 0,(function*(){yield S(e)}));return!T&&!v?d?yield A(m):g?yield P(m):yield _(m):v?g?yield w(b):p?yield S(b):yield x(b):p?yield k(b):g?yield R(b):yield O(b),r}))}upgrade(e,t){return s(this,void 0,void 0,(function*(){let r;const i=Object.assign({},t),o=Object.assign({},i.jsonOptions),n=i.bitmarkParserType;let a=e;if(h.env.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");h.env.isNode&&fs.existsSync(a)&&(a=fs.readFileSync(a,{encoding:"utf8"}));let c=this.jsonParser.toAst(a);const d=e=>s(this,void 0,void 0,(function*(){const t=this.bitmarkParser.toAst(e,{parserType:n});if(i.outputFile){const e=new BitmarkFileGenerator_1.BitmarkFileGenerator(i.outputFile,i);yield e.generate(t)}else{const e=new l.BitmarkStringGenerator(i);r=yield e.generate(t)}})),p=e=>s(this,void 0,void 0,(function*(){if(i.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(i.outputFile,i);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(i),s=yield t.generate(e);r=this.jsonStringifyPrettify(s,o)}}));return!!!(null==c?void 0:c.bits)?yield d(a):yield p(c),r}))}createAst(e){let t,r=e;h.env.isNode&&fs.existsSync(r)&&(r=fs.readFileSync(r,{encoding:"utf8"}));let i=this.ast.preprocessAst(r);const o=!!i;o||(i=this.jsonParser.toAst(r));return t=!!!(null==i?void 0:i.bits)&&!o?this.bitmarkParser.toAst(r):i,t}}},8256:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Ast=void 0;const i=r(7087),o=r(549),s=r(3633);t.Ast=class{constructor(){(0,i.init)()}walk(e,t,r,i){this.walkRecursive(e,void 0,r,[{index:0,key:t,value:e}],i)}getRouteKey(e){return e.reduce(((t,r,i)=>(+r.key!==r.index&&(t+=`${r.key}`,i<e.length-1&&(t+="_")),t)),"")}printTree(e,t=o.NodeType.bitmarkAst){this.walkRecursive(e,void 0,{enter:(e,t,r)=>{console.log("Enter: "+this.getRouteKey(r))},between:(e,t,r,i,o)=>{console.log("Between: "+this.getRouteKey(o))},exit:(e,t,r)=>{console.log("Exit: "+this.getRouteKey(r))},leaf:(e,t,r)=>{console.log("Leaf: "+this.getRouteKey(r))}},[{index:0,key:t,value:e}],void 0)}preprocessAst(e){if(s.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){return!(!Object.prototype.hasOwnProperty.call(e,"bits")||!Array.isArray(e.bits))}walkRecursive(e,t,r,i,o){const{enter:s,between:n,exit:a,leaf:l}=r,u=i[i.length-1].key,c=!this.isValue(e),d=i[i.length-1];if(c){if(s){if(!1===s(d,t,i,o))return}}else l&&l(d,t,i,o);if(c){const s=this.isArray(e),a=Object.keys(e);for(let l=0,c=a.length;l<c;l++){const p=a[l],h=l===c-1,y=e,g=y[p];if(null!=g){const e={key:this.getAstKey(p,u,s),index:l,value:g},c=i.slice();if(c.push(e),this.walkRecursive(g,d,r,c,o),!h){const r=a[l+1],c=y[r],p={key:this.getAstKey(r,u,s),index:l+1,value:c};if(n){if(!1===n(d,e,p,t,i,o))break}}}}}c&&a&&a(d,t,i,o)}getAstKey(e,t,r){let i=e;return r&&t&&(i=`${t}Value`),o.NodeType.fromKey(i)||`unknown(${i})`}isArray(e){return Array.isArray(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}}},423:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseBuilder=void 0;const i=r(4719),o=r(7646),s=r(672),n=r(994),a=r(3633);t.BaseBuilder=class{toExample(e,t){return e?{isDefaultExample:!0,isExample:!0}:null!=t?(!0===t&&(t="true"),!1===t&&(t="false"),{isDefaultExample:!1,isExample:!0,example:t}):{isDefaultExample:!1,isExample:!1}}toExampleBoolean(e,t){const r=null!=t&&!s.BooleanUtils.isBooleanString(t);return e||r?{isDefaultExample:!0,isExample:!0}:null!=t?{isDefaultExample:!1,isExample:!0,example:s.BooleanUtils.toBoolean(t)}:{isDefaultExample:!1,isExample:!1}}toAstProperty(e,t){var r;const l=null!==(r=i.PropertyKey.getMetadata(e))&&void 0!==r?r:{};if(null==t)return;const u=e=>{if(null!=e)return l.isTrimmedString&&(e=a.StringUtils.isString(e)?a.StringUtils.trimmedString(e):void 0),l.isNumber&&(e=n.NumberUtils.asNumber(e)),l.isBoolean&&(e=s.BooleanUtils.toBoolean(e,!0)),l.isInvertedBoolean&&(e=!s.BooleanUtils.toBoolean(e,!0)),e};if(Array.isArray(t)){const e=t;for(let t=0,r=e.length;t<r;t++)e[t]=u(e[t])}else t=u(t);return o.ArrayUtils.asArray(t)}}},9046:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=void 0;const i=r(208),o=r(1060),s=r(4719),n=r(1353),a=r(7646),l=r(4598),u=r(994),c=r(4309),d=r(671),p=r(423),h=r(2377);class y extends p.BaseBuilder{bitmark(e){const{bits:t,errors:r}=e,i={bits:t,errors:r};return c.ObjectUtils.removeUnwantedProperties(i),i}bit(e){var t;const{bitType:r,textFormat:i,resourceType:o,id:d,externalId:p,spaceId:y,padletId:g,aiGenerated:f,releaseVersion:m,ageRange:b,language:v,computerLanguage:T,subtype:A,coverImage:P,publisher:_,publications:x,author:w,subject:S,date:O,location:R,theme:k,kind:C,action:E,thumbImage:I,focusX:j,focusY:B,duration:L,referenceProperty:N,deeplink:M,externalLink:U,externalLinkText:K,videoCallLink:F,bot:D,list:V,textReference:G,isTracked:H,isInfoOnly:$,labelTrue:q,labelFalse:J,book:z,quotedPerson:W,partialAnswer:Y,levelProperty:X,title:Q,subtitle:Z,level:ee,toc:te,progress:re,anchor:ie,reference:oe,referenceEnd:se,item:ne,lead:ae,hint:le,instruction:ue,isDefaultExample:ce,example:de,partner:pe,markConfig:he,extraProperties:ye,resource:ge,body:fe,sampleSolution:me,footer:be,markup:ve,parser:Te}=e,Ae=this.cardNode(e),Pe=Object.assign(Object.assign({bitType:r,textFormat:null!==(t=n.TextFormat.fromValue(i))&&void 0!==t?t:n.TextFormat.bitmarkMinusMinus,resourceType:l.BitUtils.calculateValidResourceType(r,o,ge),id:this.toAstProperty(s.PropertyKey.id,d),externalId:this.toAstProperty(s.PropertyKey.externalId,p),spaceId:this.toAstProperty(s.PropertyKey.spaceId,y),padletId:this.toAstProperty(s.PropertyKey.padletId,g),aiGenerated:this.toAstProperty(s.PropertyKey.aiGenerated,f),releaseVersion:this.toAstProperty(s.PropertyKey.releaseVersion,m),book:z,ageRange:this.toAstProperty(s.PropertyKey.ageRange,b),language:this.toAstProperty(s.PropertyKey.language,v),computerLanguage:this.toAstProperty(s.PropertyKey.computerLanguage,T),subtype:this.toAstProperty(s.PropertyKey.subtype,A),coverImage:this.toAstProperty(s.PropertyKey.coverImage,P),publisher:this.toAstProperty(s.PropertyKey.publisher,_),publications:this.toAstProperty(s.PropertyKey.publications,x),author:this.toAstProperty(s.PropertyKey.author,w),subject:this.toAstProperty(s.PropertyKey.subject,S),date:this.toAstProperty(s.PropertyKey.date,O),location:this.toAstProperty(s.PropertyKey.location,R),theme:this.toAstProperty(s.PropertyKey.theme,k),kind:this.toAstProperty(s.PropertyKey.kind,C),action:this.toAstProperty(s.PropertyKey.action,E),thumbImage:this.toAstProperty(s.PropertyKey.thumbImage,I),focusX:this.toAstProperty(s.PropertyKey.focusX,j),focusY:this.toAstProperty(s.PropertyKey.focusY,B),deeplink:this.toAstProperty(s.PropertyKey.deeplink,M),externalLink:this.toAstProperty(s.PropertyKey.externalLink,U),externalLinkText:this.toAstProperty(s.PropertyKey.externalLinkText,K),videoCallLink:this.toAstProperty(s.PropertyKey.videoCallLink,F),bot:this.toAstProperty(s.PropertyKey.bot,D),duration:this.toAstProperty(s.PropertyKey.duration,L),referenceProperty:this.toAstProperty(s.PropertyKey.reference,N),list:this.toAstProperty(s.PropertyKey.list,V),textReference:this.toAstProperty(s.PropertyKey.textReference,G),isTracked:this.toAstProperty(s.PropertyKey.isTracked,H),isInfoOnly:this.toAstProperty(s.PropertyKey.isInfoOnly,$),labelTrue:this.toAstProperty(s.PropertyKey.labelTrue,q),labelFalse:this.toAstProperty(s.PropertyKey.labelFalse,J),quotedPerson:this.toAstProperty(s.PropertyKey.quotedPerson,W),partialAnswer:this.toAstProperty(s.PropertyKey.partialAnswer,Y),levelProperty:this.toAstProperty(s.PropertyKey.level,X),title:Q,subtitle:Z,level:u.NumberUtils.asNumber(ee),toc:this.toAstProperty(s.PropertyKey.toc,te),progress:this.toAstProperty(s.PropertyKey.progress,re),anchor:ie,reference:oe,referenceEnd:se,markConfig:he,itemLead:this.itemLead(ne,ae),hint:le,instruction:ue},this.toExample(ce,de)),{partner:pe,resource:ge,body:fe,sampleSolution:a.ArrayUtils.asArray(me),cardNode:Ae,footer:be,markup:ve,parser:Te,extraProperties:this.parseExtraProperties(ye)});if(ce){if(Ae){if(this.setDefaultExamplesFlags(!0,Ae.choices),this.setDefaultExamplesFlags(!1,Ae.responses,Ae.statements,Ae.statement,Ae.pairs),Ae.quizzes)for(const e of Ae.quizzes)this.setDefaultExamplesFlags(!0,e.choices),this.setDefaultExamplesFlags(!1,e.responses);if(Ae.matrix)for(const e of Ae.matrix)this.setDefaultExamplesFlags(!1,e.cells)}fe&&this.setDefaultExamplesBodyBits(fe)}return this.setDefaultBitValues(Pe),this.setIsExampleFlags(Pe),this.addVersionToParserInfo(Pe),c.ObjectUtils.removeUnwantedProperties(Pe,{ignoreAllFalse:!0,ignoreEmptyString:["example"]}),h.NodeValidator.validateBit(Pe)}choice(e){const{text:t,isCorrect:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:s,instruction:n},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}response(e){const{text:t,isCorrect:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:s,instruction:n},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}botResponse(e){const{response:t,reaction:r,feedback:i,item:o,lead:s,hint:n}=e,a={response:t,reaction:r,feedback:i,itemLead:this.itemLead(o,s),hint:n};return c.ObjectUtils.removeUnwantedProperties(a,{ignoreEmptyString:["response","reaction","feedback"]}),a}quiz(e){const{choices:t,responses:r,item:i,lead:o,hint:s,instruction:n,isDefaultExample:a}=e;a&&(this.setDefaultExamplesFlags(!0,t),this.setDefaultExamplesFlags(!1,r));const l={itemLead:this.itemLead(i,o),hint:s,instruction:n,choices:t,responses:r};return c.ObjectUtils.removeUnwantedProperties(l),l}heading(e){var t;const{forKeys:r,forValues:i}=e;if(null==r)return;const o={forKeys:r||"",forValues:null!==(t=a.ArrayUtils.asArray(i))&&void 0!==t?t:[]};return c.ObjectUtils.removeUnwantedProperties(o),o}pair(e){const{key:t,keyAudio:r,keyImage:i,values:o,item:s,lead:n,hint:a,instruction:l,isCaseSensitive:u,isShortAnswer:d,isDefaultExample:p,example:h}=e,y=Object.assign(Object.assign({key:t,keyAudio:r,keyImage:i,itemLead:this.itemLead(s,n),hint:a,instruction:l},this.toExample(p,h)),{isCaseSensitive:u,isShortAnswer:d,values:o});return c.ObjectUtils.removeUnwantedProperties(y,{ignoreAllFalse:!0}),y}matrix(e){const{key:t,cells:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isShortAnswer:l,isDefaultExample:u}=e;let d=!1;for(const e of null!=r?r:[])u&&!e.isExample&&(e.isDefaultExample=!0,e.isExample=!0),d=!!e.isExample||d;const p={key:t,itemLead:this.itemLead(i,o),hint:s,instruction:n,isCaseSensitive:a,isShortAnswer:l,isExample:d,cells:r};return c.ObjectUtils.removeUnwantedProperties(p,{ignoreAllFalse:!0}),p}matrixCell(e){const{values:t,item:r,lead:i,hint:o,instruction:s,isDefaultExample:n,example:a}=e,l=Object.assign({values:t,itemLead:this.itemLead(r,i),hint:o,instruction:s},this.toExample(n,a));return c.ObjectUtils.removeUnwantedProperties(l,{ignoreAllFalse:!0}),l}question(e){const{question:t,partialAnswer:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isShortAnswer:l,sampleSolution:u,isDefaultExample:d,example:p}=e,h=Object.assign(Object.assign({itemLead:this.itemLead(i,o),question:t,partialAnswer:r,hint:s,instruction:n},this.toExample(d,p)),{isCaseSensitive:a,isShortAnswer:l,sampleSolution:u});return c.ObjectUtils.removeUnwantedProperties(h,{ignoreEmptyString:["question"],ignoreAllFalse:!0}),h}body(e){const{bodyParts:t}=e;return{bodyParts:t}}bodyText(e){const{text:t}=e;return{type:o.BodyBitType.text,data:{bodyText:t}}}footerText(e){const{text:t}=e;return{footerText:t}}gap(e){const{solutions:t,item:r,lead:i,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d={type:o.BodyBitType.gap,data:Object.assign(Object.assign({solutions:t,itemLead:this.itemLead(r,i),hint:s,instruction:n},this.toExample(l,u)),{isCaseSensitive:a})};return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}markConfig(e){const{mark:t,color:r,emphasis:i}=e,o={mark:t,color:r,emphasis:i};return c.ObjectUtils.removeUnwantedProperties(o),o}mark(e){const{solution:t,mark:r,item:i,lead:s,hint:n,instruction:a,isDefaultExample:l,example:u}=e,d={type:o.BodyBitType.mark,data:Object.assign({solution:t,mark:r,itemLead:this.itemLead(i,s),hint:n,instruction:a},this.toExample(l,u))};return c.ObjectUtils.removeUnwantedProperties(d),d}select(e){const{options:t,prefix:r,postfix:i,item:s,lead:n,hint:a,instruction:l,isCaseSensitive:u}=e,d={type:o.BodyBitType.select,data:{prefix:r,options:t,postfix:i,itemLead:this.itemLead(s,n),hint:a,instruction:l,isCaseSensitive:u}};return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}selectOption(e){const{text:t,isCorrect:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:s,instruction:n},this.toExample(l,u)),{isCaseSensitive:a});return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}highlight(e){const{texts:t,prefix:r,postfix:i,item:s,lead:n,hint:a,instruction:l,isCaseSensitive:u}=e,d={type:o.BodyBitType.highlight,data:{prefix:r,texts:t,postfix:i,itemLead:this.itemLead(s,n),hint:a,instruction:l,isCaseSensitive:u}};return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}highlightText(e){const{text:t,isCorrect:r,isHighlighted:i,item:o,lead:s,hint:n,instruction:a,isCaseSensitive:l,isDefaultExample:u,example:d}=e,p=Object.assign(Object.assign({text:t,isCorrect:!!r,isHighlighted:!!i,itemLead:this.itemLead(o,s),hint:n,instruction:a},this.toExample(u,d)),{isCaseSensitive:l});return c.ObjectUtils.removeUnwantedProperties(p,{ignoreAllFalse:!0}),p}statement(e){const{text:t,isCorrect:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:s,instruction:n},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}partner(e){const{name:t,avatarImage:r}=e,i={name:t,avatarImage:r};return c.ObjectUtils.removeUnwantedProperties(i),i}comment(e){const{text:t,location:r}=e,i={text:t,location:r};return c.ObjectUtils.removeUnwantedProperties(i),i}itemLead(e,t){let r;return(e||t)&&(r={item:e,lead:t}),r}cardNode(e){let t;const{questions:r,elements:i,statement:o,statements:s,choices:n,responses:a,quizzes:l,heading:u,pairs:d,matrix:p,botResponses:h}=e;return(r||i||o||s||n||a||l||u||d||p||h)&&(t={questions:r,elements:i,statement:o,statements:s,choices:n,responses:a,quizzes:l,heading:u,pairs:d,matrix:p,botResponses:h},c.ObjectUtils.removeUnwantedProperties(t)),t}setDefaultExamplesFlags(e,...t){if(Array.isArray(t))for(const r of t)if(Array.isArray(r))for(const t of r)t.isExample||e&&!t.isCorrect||(t.isDefaultExample=!0,t.isExample=!0);else r&&(r.isExample||e&&!r.isCorrect||(r.isDefaultExample=!0,r.isExample=!0))}setDefaultExamplesBodyBits(e){if(e&&e.bodyParts&&0!==e.bodyParts.length)for(const t of e.bodyParts)if(t)switch(t.type){case o.BodyBitType.gap:{const e=t;e.data.isExample||(e.data.isDefaultExample=!0,e.data.isExample=!0);break}case o.BodyBitType.mark:{const e=t;e.data.isExample||(e.data.isDefaultExample=!0,e.data.isExample=!0);break}case o.BodyBitType.select:{const e=t;for(const t of e.data.options)!t.isExample&&t.isCorrect&&(t.isDefaultExample=!0,t.isExample=!0);break}case o.BodyBitType.highlight:{const e=t;for(const t of e.data.texts)!t.isExample&&t.isCorrect&&(t.isDefaultExample=!0,t.isExample=!0);break}}}parseExtraProperties(e){if(!e)return;const t=Object.entries(e);if(0===t.length)return;const r={};for(const[e,i]of t)r[e]=a.ArrayUtils.asArray(i)||[i];return r}setIsExampleFlags(e){var t,r,i,s,n,a,l,u,c,d,p,h;e.isExample=!1;const y=t=>!!t&&(t.isDefaultExample||null!=t.example?(t.isExample=!0,e.isExample=!0):t.isExample=t===e&&!!e.isExample,t.isExample),{body:g,cardNode:f}=e;if(g&&g.bodyParts)for(const e of g.bodyParts)switch(e.type){case o.BodyBitType.gap:case o.BodyBitType.mark:y(e.data);break;case o.BodyBitType.select:{const t=e;let r=!1;for(const e of t.data.options)r=!!y(e)||r;t.data.isExample=r;break}case o.BodyBitType.highlight:{const t=e;let r=!1;for(const e of t.data.texts)r=!!y(e)||r;t.data.isExample=r;break}}if(f){for(const e of null!==(t=f.pairs)&&void 0!==t?t:[])y(e);for(const e of null!==(r=f.matrix)&&void 0!==r?r:[]){let t=!1;for(const r of null!==(i=e.cells)&&void 0!==i?i:[])t=!!y(r)||t;e.isExample=t}for(const e of null!==(s=f.quizzes)&&void 0!==s?s:[]){let t=!1;for(const r of null!==(n=e.responses)&&void 0!==n?n:[])t=!!y(r)||t;for(const r of null!==(a=e.choices)&&void 0!==a?a:[])t=!!y(r)||t;e.isExample=t}for(const e of null!==(l=f.responses)&&void 0!==l?l:[])y(e);for(const e of null!==(u=f.choices)&&void 0!==u?u:[])y(e);for(const e of null!==(c=f.statements)&&void 0!==c?c:[])y(e);y(f.statement);for(const e of null!==(d=f.questions)&&void 0!==d?d:[])y(e)}y(e.statement);for(const t of null!==(p=e.responses)&&void 0!==p?p:[])y(t);for(const t of null!==(h=e.choices)&&void 0!==h?h:[])y(t);y(e)}setDefaultBitValues(e){switch(e.bitType.alias){case i.AliasBitType.articleAi:case i.AliasBitType.noteAi:case i.AliasBitType.summaryAi:e.aiGenerated=this.toAstProperty(s.PropertyKey.aiGenerated,!0)}}addVersionToParserInfo(e){var t;const r=null!==(t=e.parser)&&void 0!==t?t:{};r.version=d.env.appVersion.full,e.parser=r}}t.Builder=y},8703:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceBuilder=void 0;const o=r(1895),s=r(4309),n=r(169),a=r(423),l=r(2377);class u extends a.BaseBuilder{resource(e){var t,r,s;let n;const{type:a,value:l,format:u}=e,c=i(e,["type","value","format"]),d=Object.assign({type:a,value:null!=l?l:"",format:null!=u?u:""},c);switch(a){case o.ResourceType.video:case o.ResourceType.videoEmbed:case o.ResourceType.videoLink:case o.ResourceType.stillImageFilmEmbed:case o.ResourceType.stillImageFilmLink:{const r=["src1x","src2x","src3x","src4x"],i=[];for(const t of r){const r=e[t];if(r){const e=this.resource({type:o.ResourceType.image,value:r});e&&i.push(e)}}d.thumbnails=[...null!==(t=d.thumbnails)&&void 0!==t?t:[],...i]}}switch(a){case o.ResourceType.image:n=this.imageResource(d);break;case o.ResourceType.imageLink:n=this.imageLinkResource(d);break;case o.ResourceType.audio:n=this.audioResource(d);break;case o.ResourceType.audioEmbed:n=this.audioEmbedResource(d);break;case o.ResourceType.audioLink:n=this.audioLinkResource(d);break;case o.ResourceType.video:n=this.videoResource(d);break;case o.ResourceType.videoEmbed:n=this.videoEmbedResource(d);break;case o.ResourceType.videoLink:n=this.videoLinkResource(d);break;case o.ResourceType.stillImageFilm:n=this.stillImageFilmResource({image:this.imageResource(null!==(r=d.image)&&void 0!==r?r:{format:"",value:""}),audio:this.audioResource(null!==(s=d.audio)&&void 0!==s?s:{format:"",value:""})});break;case o.ResourceType.stillImageFilmEmbed:n=this.stillImageFilmEmbedResource(d);break;case o.ResourceType.stillImageFilmLink:n=this.stillImageFilmLinkResource(d);break;case o.ResourceType.article:n=this.articleResource(d);break;case o.ResourceType.document:n=this.documentResource(d);break;case o.ResourceType.documentEmbed:n=this.documentEmbedResource(d);break;case o.ResourceType.documentLink:n=this.documentLinkResource(d);break;case o.ResourceType.documentDownload:n=this.documentDownloadResource(d);break;case o.ResourceType.appLink:n=this.appLinkResource(d);break;case o.ResourceType.websiteLink:n=this.websiteLinkResource(d)}return n}imageResource(e){const{value:t,src1x:r,src2x:i,src3x:a,src4x:u,width:c,height:d,alt:p,license:h,copyright:y,showInIndex:g,caption:f}=e,m={type:o.ResourceType.image,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,src1x:r,src2x:i,src3x:a,src4x:u,width:c,height:d,alt:p,license:h,copyright:y,showInIndex:g,caption:f};return s.ObjectUtils.removeUnwantedProperties(m),l.NodeValidator.validateResource(m)}imageLinkResource(e){const{value:t,src1x:r,src2x:i,src3x:a,src4x:u,width:c,height:d,alt:p,license:h,copyright:y,showInIndex:g,caption:f}=e,m={type:o.ResourceType.imageLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,src1x:r,src2x:i,src3x:a,src4x:u,width:c,height:d,alt:p,license:h,copyright:y,showInIndex:g,caption:f};return s.ObjectUtils.removeUnwantedProperties(m),l.NodeValidator.validateResource(m)}audioResource(e){const{value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p}=e,h={type:o.ResourceType.audio,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p};return s.ObjectUtils.removeUnwantedProperties(h),l.NodeValidator.validateResource(h)}audioEmbedResource(e){const{value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p}=e,h={type:o.ResourceType.audioEmbed,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p};return s.ObjectUtils.removeUnwantedProperties(h),l.NodeValidator.validateResource(h)}audioLinkResource(e){const{value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p}=e,h={type:o.ResourceType.audioLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p};return s.ObjectUtils.removeUnwantedProperties(h),l.NodeValidator.validateResource(h)}videoResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v}=e,T={type:o.ResourceType.video,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}videoEmbedResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v}=e,T={type:o.ResourceType.videoEmbed,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}videoLinkResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v}=e,T={type:o.ResourceType.videoLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}stillImageFilmResource(e){const{image:t,audio:r}=e,i={type:o.ResourceType.stillImageFilm,image:null!=t?t:this.imageResource({format:"",value:""}),audio:null!=r?r:this.audioResource({format:"",value:""})};return s.ObjectUtils.removeUnwantedProperties(i),l.NodeValidator.validateResource(i)}stillImageFilmEmbedResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v}=e,T={type:o.ResourceType.stillImageFilmEmbed,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}stillImageFilmLinkResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v}=e,T={type:o.ResourceType.stillImageFilmLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}articleResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.article,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.document,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentEmbedResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.documentEmbed,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentLinkResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.documentLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentDownloadResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.documentDownload,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}appLinkResource(e){const{value:t,license:r,copyright:i,showInIndex:n,caption:a}=e,u={type:o.ResourceType.appLink,value:t,license:r,copyright:i,showInIndex:n,caption:a};return s.ObjectUtils.removeUnwantedProperties(u),l.NodeValidator.validateResource(u)}websiteLinkResource(e){const{value:t,siteName:r,license:i,copyright:n,showInIndex:a,caption:u}=e,c={type:o.ResourceType.websiteLink,value:t,siteName:r,license:i,copyright:n,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}}t.ResourceBuilder=u},2377:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValidator=void 0;const i=r(208),o=r(1895),s=r(3633);const n=new class{validateBit(e){if(!e)return e;let t=e;if(e.bitType.root===i.RootBitType.interview)t=this.validateInterviewBit(e);return t}validateResource(e){var t,r;if(!e)return;let i=e,s=!1;switch(e.type){case o.ResourceType.stillImageFilm:{const i=e;i.image=null!==(t=this.validateResource(i.image))&&void 0!==t?t:{type:o.ResourceType.image},i.audio=null!==(r=this.validateResource(i.audio))&&void 0!==r?r:{type:o.ResourceType.audio},s=!!i.image||!!i.audio;break}default:s=!!e.value}return s||e.type&&(i={type:e.type}),i}isRequired(e,t){if(!e)throw new Error(`${t} is required but is not set`)}isOneOfRequired(e,t){if(Array.isArray(e))for(const t of e)if(t)return;throw new Error(`One of '${t.join(", ")}' is required but none is set`)}isString(e,t){if(!s.StringUtils.isString(e))throw new Error(`${t} is required to be a string`)}isNonEmptyString(e,t){if(!s.StringUtils.isString(e)||""===e)throw new Error(`${t} is required to be a non-empty string`)}isStringOrBoolean(e,t){if(!s.StringUtils.isString(e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a string or a boolean`)}isNonEmptyStringOrBoolean(e,t){if((!s.StringUtils.isString(e)||""===e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a non-empty string or a boolean`)}isArray(e,t){if(!Array.isArray(e))throw new Error(`${t} is required to be a array`)}isNonEmptyArray(e,t){if(!(Array.isArray(e)&&e.length>0))throw new Error(`${t} is required to be a non-empty array`)}isNumber(e,t){if(!Number.isFinite(e))throw new Error(`${t} is required to be a number`)}isBoolean(e,t){if(!0!==e&&!1!==e)throw new Error(`${t} is required to be a boolean`)}isStringOrNumberOrBooleanOrNullOrUndefined(e,t){if(!s.StringUtils.isString(e)&&!Number.isFinite(e)&&!0!==e&&!1!==e&&null!=e)throw new Error(`${t} is required to be a string or a number or a boolean or null or undefined`)}validateInterviewBit(e){return e.cardNode||(e.cardNode={}),e.cardNode.questions||(e.cardNode.questions=[]),e}};t.NodeValidator=n},227:function(e,t){var r=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;t.StringWriter=class{constructor(){this._string="",this.endOfLineString="\n"}get isSync(){return!0}getString(){return this._string}open(){return r(this,void 0,void 0,(function*(){this.openSync(),Promise.resolve()}))}close(){return r(this,void 0,void 0,(function*(){try{this.closeSync()}catch(e){return Promise.reject(e)}Promise.resolve()}))}openSync(){this._buffer=[],this._string=""}closeSync(){if(!this._buffer)throw new Error("open() or openSync() never called");this._string=this._buffer.join(""),this._buffer=[]}writeLine(e){return this._buffer?(null!=e?this._buffer.push(e+this.endOfLineString):this._buffer.push(this.endOfLineString),this):this}writeLines(e,t){if(!this._buffer)return this;if(!e)return this;for(let r=0,i=e.length;r<i;r++){const o=e[r];this._buffer.push(o),t&&r<i-1&&this._buffer.push(t),this._buffer.push(this.endOfLineString)}return this}write(e){return this._buffer?(null==e||this._buffer.push(e),this):this}writeWhiteSpace(){return this.write(" "),this}}},4842:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208);i.RootBitType.setMetadata(i.RootBitType._error,{tags:{},resourceAttachmentAllowed:!1,bodyAllowed:!0})},3616:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.appLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_APP_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.appLink,bodyAllowed:!1})},4373:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.article,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),{[o.TagType.Title]:{}}),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},2773:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.articleEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ARTICLE_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.articleEmbed,bodyAllowed:!0})},6360:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.articleLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ARTICLE_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.articleLink,bodyAllowed:!0})},6246:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.audio,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_AUDIO_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.audio,bodyAllowed:!0})},9309:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.audioEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_AUDIO_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.audioEmbed,bodyAllowed:!0})},591:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.audioLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_AUDIO_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.audioLink,bodyAllowed:!0})},3851:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.bitAlias,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.TagType.Reference]:{},[o.TagType.Anchor]:{}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},980:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(9881),o=r(208),s=r(4719),n=r(6562),a=r(6027);o.RootBitType.setMetadata(o.RootBitType.book,{tags:Object.assign(Object.assign({},a.TAGS_DEFAULT),{[s.PropertyKey.spaceId]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[n.TagType.Title]:{maxCount:2},[s.PropertyKey.subtype]:{isProperty:!0},[s.PropertyKey.coverImage]:{isProperty:!0},[s.PropertyKey.publisher]:{isProperty:!0},[s.PropertyKey.subject]:{isProperty:!0},[s.PropertyKey.author]:{isProperty:!0},[s.PropertyKey.theme]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},8788:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.botActionResponse,{tags:Object.assign({},s.TAGS_DEFAULT),resourceAttachmentAllowed:!1,cardSet:o.CARD_SET_BOT_ACTION_RESPONSES,bodyAllowed:!0,footerAllowed:!0})},1:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.botActionSend,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.PropertyKey.date]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},7386:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(1895),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.browserImage,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_IMAGE_RESOURCE),{[o.PropertyKey.focusX]:{isProperty:!0},[o.PropertyKey.focusY]:{isProperty:!0}}),resourceAttachmentAllowed:!1,resourceType:s.ResourceType.image,bodyAllowed:!0})},4865:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(5319),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.card1,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},3890:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.chapter,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.TagType.Anchor]:{},[o.TagType.Title]:{}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},3707:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.clozeAndMultipleChoiceText,{tags:Object.assign(Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),o.TAGS_CHAIN_GAP),o.TAGS_CHAIN_TRUE_FALSE),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},2585:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027),a={tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),o.TAGS_CHAIN_GAP),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0};i.RootBitType.setMetadata(i.RootBitType.cloze,a)},8161:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.code,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.PropertyKey.computerLanguage]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},5912:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.conversationLeft1,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),o.TAGS_CHAIN_PARTNER),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},8305:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.document,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_DOCUMENT_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.document,bodyAllowed:!0})},2438:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.documentDownload,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_DOCUMENT_DOWNLOAD_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.documentDownload,bodyAllowed:!0})},5983:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.documentEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_DOCUMENT_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.documentEmbed,bodyAllowed:!0})},1363:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.documentLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_DOCUMENT_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.documentLink,bodyAllowed:!0})},1934:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(7028),s=r(4719),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.essay,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),{[s.PropertyKey.sampleSolution]:{isProperty:!0}}),resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:o.ExampleType.string})},4954:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(7028),s=r(6562),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.example,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),{[s.TagType.Title]:{}}),n.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:o.ExampleType.string})},3913:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6027);i.RootBitType.setMetadata(i.RootBitType.flashcard1,{tags:Object.assign({},o.TAGS_DEFAULT),resourceAttachmentAllowed:!1,bodyAllowed:!0})},8157:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6027);i.RootBitType.setMetadata(i.RootBitType.flashcard,{tags:Object.assign({},o.TAGS_DEFAULT),resourceAttachmentAllowed:!1,bodyAllowed:!0})},8253:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(1895),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.focusImage,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_IMAGE_RESOURCE),{[o.PropertyKey.focusX]:{isProperty:!0},[o.PropertyKey.focusY]:{isProperty:!0}}),resourceAttachmentAllowed:!1,resourceType:s.ResourceType.image,bodyAllowed:!0})},1614:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARD_SET_BOT_ACTION_RESPONSES=t.CARD_SET_MATCH_MATRIX=t.CARD_SET_MATCH_IMAGE_PAIRS=t.CARD_SET_MATCH_AUDIO_PAIRS=t.CARD_SET_MATCH_PAIRS=t.CARD_SET_QUESTIONS=t.CARD_SET_QUIZ=t.CARD_SET_STATEMENTS=t.CARD_SET_ELEMENTS=void 0;const i=r(7210),o=r(4719),s=r(1895),n=r(6562),a=r(781),l=r(6027),u={type:i.CardSetType.elements,variants:[[{tags:Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_ELEMENTS=u;const c={type:i.CardSetType.statements,variants:[[{tags:Object.assign(Object.assign({[n.TagType.True]:{maxCount:1},[n.TagType.False]:{maxCount:1}},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE)}]]};t.CARD_SET_STATEMENTS=c;const d={type:i.CardSetType.quiz,variants:[[{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_CHAIN_TRUE_FALSE),l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE)}]]};t.CARD_SET_QUIZ=d;const p={type:i.CardSetType.questions,variants:[[{tags:Object.assign(Object.assign({[n.TagType.SampleSolution]:{},[o.PropertyKey.shortAnswer]:{isProperty:!0}},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),bodyAllowed:!0}]]};t.CARD_SET_QUESTIONS=p;const h={type:i.CardSetType.matchPairs,variants:[[{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),{[n.TagType.Title]:{}}),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_MATCH_PAIRS=h;const y={type:i.CardSetType.matchPairs,variants:[[{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),{[n.TagType.Title]:{},[s.ResourceType.audio]:{isResource:!0}}),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_MATCH_AUDIO_PAIRS=y;const g={type:i.CardSetType.matchPairs,variants:[[{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),{[n.TagType.Title]:{},[s.ResourceType.image]:{isResource:!0}}),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_MATCH_IMAGE_PAIRS=g;const f={type:i.CardSetType.matchMatrix,variants:[[{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),{[n.TagType.Title]:{}}),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_MATCH_MATRIX=f;const m={type:i.CardSetType.botActionResponses,variants:[[{tags:Object.assign(Object.assign({[o.PropertyKey.reaction]:{isProperty:!0}},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),bodyAllowed:!0}]]};t.CARD_SET_BOT_ACTION_RESPONSES=m},781:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS_CHAIN_MARK=t.TAGS_CHAIN_MARK_CONFIG=t.TAGS_CHAIN_TRUE_FALSE=t.TAGS_CHAIN_GAP=t.TAGS_CHAIN_PARTNER=void 0;const i=r(9881),o=r(4719),s=r(6562),n=r(5319),a=r(6027),l={[o.PropertyKey.partner]:{isProperty:!0,chain:Object.assign({},n.TAGS_CHAIN_IMAGE_RESOURCE)}};t.TAGS_CHAIN_PARTNER=l;const u={[s.TagType.Gap]:{maxCount:i.INFINITE_COUNT,chain:Object.assign(Object.assign({[s.TagType.Gap]:{maxCount:i.INFINITE_COUNT}},a.TAGS_ITEM_LEAD_INSTRUCTION_HINT),a.TAGS_PROPERTY_EXAMPLE)}};t.TAGS_CHAIN_GAP=u;const c={[s.TagType.True]:{maxCount:i.INFINITE_COUNT,chain:Object.assign(Object.assign({[s.TagType.True]:{maxCount:i.INFINITE_COUNT},[s.TagType.False]:{maxCount:i.INFINITE_COUNT}},a.TAGS_ITEM_LEAD_INSTRUCTION_HINT),a.TAGS_PROPERTY_EXAMPLE)},[s.TagType.False]:{maxCount:i.INFINITE_COUNT,chain:Object.assign(Object.assign({[s.TagType.True]:{maxCount:i.INFINITE_COUNT},[s.TagType.False]:{maxCount:i.INFINITE_COUNT}},a.TAGS_ITEM_LEAD_INSTRUCTION_HINT),a.TAGS_PROPERTY_EXAMPLE)}};t.TAGS_CHAIN_TRUE_FALSE=c;const d={[o.PropertyKey.mark]:{isProperty:!0,maxCount:i.INFINITE_COUNT,chain:{[o.PropertyKey.color]:{isProperty:!0},[o.PropertyKey.emphasis]:{isProperty:!0}}}};t.TAGS_CHAIN_MARK_CONFIG=d;const p={[s.TagType.Mark]:{maxCount:i.INFINITE_COUNT,chain:Object.assign({[o.PropertyKey.mark]:{isProperty:!0}},a.TAGS_PROPERTY_EXAMPLE)}};t.TAGS_CHAIN_MARK=p},5319:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS_CHAIN_ANY_RESOURCE=t.TAGS_CHAIN_WEBSITE_LINK_RESOURCE=t.TAGS_CHAIN_APP_LINK_RESOURCE=t.TAGS_CHAIN_DOCUMENT_DOWNLOAD_RESOURCE=t.TAGS_CHAIN_DOCUMENT_LINK_RESOURCE=t.TAGS_CHAIN_DOCUMENT_EMBED_RESOURCE=t.TAGS_CHAIN_DOCUMENT_RESOURCE=t.TAGS_CHAIN_ARTICLE_LINK_RESOURCE=t.TAGS_CHAIN_ARTICLE_EMBED_RESOURCE=t.TAGS_CHAIN_ARTICLE_RESOURCE=t.TAGS_CHAIN_STILL_IMAGE_FILM_LINK_RESOURCE=t.TAGS_CHAIN_STILL_IMAGE_FILM_EMBED_RESOURCE=t.TAGS_CHAIN_STILL_IMAGE_FILM_RESOURCE=t.TAGS_CHAIN_VIDEO_LINK_RESOURCE=t.TAGS_CHAIN_VIDEO_EMBED_RESOURCE=t.TAGS_CHAIN_VIDEO_RESOURCE=t.TAGS_CHAIN_AUDIO_LINK_RESOURCE=t.TAGS_CHAIN_AUDIO_EMBED_RESOURCE=t.TAGS_CHAIN_AUDIO_RESOURCE=t.TAGS_CHAIN_IMAGE_LINK_RESOURCE=t.TAGS_CHAIN_IMAGE_EMBED_RESOURCE=t.TAGS_CHAIN_IMAGE_RESOURCE=void 0;const i=r(4719),o=r(1895),s={[i.PropertyKey.license]:{isProperty:!0},[i.PropertyKey.copyright]:{isProperty:!0},[i.PropertyKey.caption]:{isProperty:!0},[i.PropertyKey.showInIndex]:{isProperty:!0}},n={[o.ResourceType.image]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0},[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0}})}};t.TAGS_CHAIN_IMAGE_RESOURCE=n;const a={[o.ResourceType.imageEmbed]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0},[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0}})}};t.TAGS_CHAIN_IMAGE_EMBED_RESOURCE=a;const l={[o.ResourceType.imageLink]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0},[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0}})}};t.TAGS_CHAIN_IMAGE_LINK_RESOURCE=l;const u={[o.ResourceType.audio]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0}})}};t.TAGS_CHAIN_AUDIO_RESOURCE=u;const c={[o.ResourceType.audioEmbed]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0}})}};t.TAGS_CHAIN_AUDIO_EMBED_RESOURCE=c;const d={[o.ResourceType.audioLink]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0}})}};t.TAGS_CHAIN_AUDIO_LINK_RESOURCE=d;const p={[o.ResourceType.video]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0},[i.PropertyKey.allowSubtitles]:{isProperty:!0},[i.PropertyKey.showSubtitles]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0},[i.PropertyKey.posterImage]:{isProperty:!0},[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0}})}};t.TAGS_CHAIN_VIDEO_RESOURCE=p;const h={[o.ResourceType.videoEmbed]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0},[i.PropertyKey.allowSubtitles]:{isProperty:!0},[i.PropertyKey.showSubtitles]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0},[i.PropertyKey.posterImage]:{isProperty:!0},[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0}})}};t.TAGS_CHAIN_VIDEO_EMBED_RESOURCE=h;const y={[o.ResourceType.videoLink]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0},[i.PropertyKey.allowSubtitles]:{isProperty:!0},[i.PropertyKey.showSubtitles]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0},[i.PropertyKey.posterImage]:{isProperty:!0},[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0}})}};t.TAGS_CHAIN_VIDEO_LINK_RESOURCE=y;const g={[o.ResourceType.image]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0},[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0}})},[o.ResourceType.audio]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0}})}};t.TAGS_CHAIN_STILL_IMAGE_FILM_RESOURCE=g;const f={[o.ResourceType.stillImageFilmEmbed]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0},[i.PropertyKey.allowSubtitles]:{isProperty:!0},[i.PropertyKey.showSubtitles]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0},[i.PropertyKey.posterImage]:{isProperty:!0},[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0}})}};t.TAGS_CHAIN_STILL_IMAGE_FILM_EMBED_RESOURCE=f;const m={[o.ResourceType.stillImageFilmLink]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0},[i.PropertyKey.allowSubtitles]:{isProperty:!0},[i.PropertyKey.showSubtitles]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0},[i.PropertyKey.posterImage]:{isProperty:!0},[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0}})}};t.TAGS_CHAIN_STILL_IMAGE_FILM_LINK_RESOURCE=m;const b={[o.ResourceType.article]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_ARTICLE_RESOURCE=b;const v={[o.ResourceType.articleEmbed]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_ARTICLE_EMBED_RESOURCE=v;const T={[o.ResourceType.articleLink]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_ARTICLE_LINK_RESOURCE=T;const A={[o.ResourceType.document]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_DOCUMENT_RESOURCE=A;const P={[o.ResourceType.documentEmbed]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_DOCUMENT_EMBED_RESOURCE=P;const _={[o.ResourceType.documentLink]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_DOCUMENT_LINK_RESOURCE=_;const x={[o.ResourceType.documentDownload]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_DOCUMENT_DOWNLOAD_RESOURCE=x;const w={[o.ResourceType.appLink]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_APP_LINK_RESOURCE=w;const S={[o.ResourceType.websiteLink]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.siteName]:{isProperty:!0}})}};t.TAGS_CHAIN_WEBSITE_LINK_RESOURCE=S;const O=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),a),l),u),c),d),p),h),y),g),f),m),b),v),T),A),P),_),x),w),S);t.TAGS_CHAIN_ANY_RESOURCE=O},6027:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS_PROPERTY_EXAMPLE=t.TAGS_ITEM_LEAD_INSTRUCTION_HINT=t.TAGS_ALL_BITS=t.TAGS_DEFAULT=void 0;const i=r(9881),o=r(4719),s=r(6562),n={[o.PropertyKey.id]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.externalId]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.aiGenerated]:{isProperty:!0},[o.PropertyKey.ageRange]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.language]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[s.TagType.Anchor]:{}};t.TAGS_ALL_BITS=n;const a={[s.TagType.ItemLead]:{maxCount:2},[s.TagType.Instruction]:{},[s.TagType.Hint]:{}};t.TAGS_ITEM_LEAD_INSTRUCTION_HINT=a;const l={[o.PropertyKey.example]:{isProperty:!0}};t.TAGS_PROPERTY_EXAMPLE=l;const u=Object.assign(Object.assign(Object.assign({},n),a),l);t.TAGS_DEFAULT=u},1559:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.highlightText,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),o.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},5046:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.image,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.image,bodyAllowed:!0})},76:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.imageLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.imageLink,bodyAllowed:!0})},4861:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.internalLink,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.TagType.Reference]:{}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},2161:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.interview,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:o.CARD_SET_QUESTIONS,bodyAllowed:!0,footerAllowed:!0})},9338:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(9881),o=r(208),s=r(4719),n=r(6562),a=r(5319),l=r(6027),u={[s.PropertyKey.action]:{isProperty:!0},[s.PropertyKey.duration]:{isProperty:!0},[s.PropertyKey.date]:{isProperty:!0},[s.PropertyKey.location]:{isProperty:!0},[s.PropertyKey.list]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[s.PropertyKey.textReference]:{isProperty:!0},[s.PropertyKey.isTracked]:{isProperty:!0},[s.PropertyKey.isInfoOnly]:{isProperty:!0},[s.PropertyKey.book]:{isProperty:!0,chain:{[n.TagType.Reference]:{maxCount:2}}}};o.RootBitType.setMetadata(o.RootBitType.learningPathBook,{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_DEFAULT),a.TAGS_CHAIN_ANY_RESOURCE),u),resourceAttachmentAllowed:!0,bodyAllowed:!0}),o.RootBitType.setMetadata(o.RootBitType.learningPathExternalLink,{tags:Object.assign(Object.assign(Object.assign(Object.assign({},l.TAGS_DEFAULT),a.TAGS_CHAIN_ANY_RESOURCE),u),{[s.PropertyKey.externalLink]:{isProperty:!0},[s.PropertyKey.externalLinkText]:{isProperty:!0}}),resourceAttachmentAllowed:!0,bodyAllowed:!0}),o.RootBitType.setMetadata(o.RootBitType.learningPathVideoCall,{tags:Object.assign(Object.assign(Object.assign(Object.assign({},l.TAGS_DEFAULT),a.TAGS_CHAIN_ANY_RESOURCE),u),{[s.PropertyKey.videoCallLink]:{isProperty:!0}}),resourceAttachmentAllowed:!0,bodyAllowed:!0})},700:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.mark,{tags:Object.assign(Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),o.TAGS_CHAIN_MARK_CONFIG),o.TAGS_CHAIN_MARK),resourceAttachmentAllowed:!0,bodyAllowed:!0})},8371:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(5319),s=r(6027),n=r(1614);i.RootBitType.setMetadata(i.RootBitType.match,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:n.CARD_SET_MATCH_PAIRS,bodyAllowed:!0,footerAllowed:!0}),i.RootBitType.setMetadata(i.RootBitType.matchMatrix,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:n.CARD_SET_MATCH_MATRIX,bodyAllowed:!0,footerAllowed:!0}),i.RootBitType.setMetadata(i.RootBitType.matchAudio,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:n.CARD_SET_MATCH_AUDIO_PAIRS,bodyAllowed:!0,footerAllowed:!0}),i.RootBitType.setMetadata(i.RootBitType.matchPicture,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:n.CARD_SET_MATCH_IMAGE_PAIRS,bodyAllowed:!0,footerAllowed:!0})},5730:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleChoice1,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),o.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},3947:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(781),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleChoice,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),s.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,cardSet:o.CARD_SET_QUIZ,bodyAllowed:!0,footerAllowed:!0})},9745:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleChoiceText,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),o.TAGS_CHAIN_TRUE_FALSE),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},2033:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleResponse1,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),o.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},9780:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(781),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleResponse,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),s.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,cardSet:o.CARD_SET_QUIZ,bodyAllowed:!0,footerAllowed:!0})},8801:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.photo,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.image,bodyAllowed:!0})},4446:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.quote,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.PropertyKey.quotedPerson]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},1417:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6027);i.RootBitType.setMetadata(i.RootBitType.rating,{tags:Object.assign({},o.TAGS_DEFAULT),resourceAttachmentAllowed:!1,bodyAllowed:!0})},5309:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.releaseNote,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),{[o.PropertyKey.releaseVersion]:{isProperty:!0}}),resourceAttachmentAllowed:!0,bodyAllowed:!0})},543:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.sampleSolution,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),{[o.TagType.Anchor]:{},[o.TagType.Reference]:{}}),resourceAttachmentAllowed:!0,bodyAllowed:!0})},149:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.screenshot,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.image,bodyAllowed:!0})},9330:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(7028),s=r(1614),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.sequence,{tags:Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:s.CARD_SET_ELEMENTS,bodyAllowed:!0,footerAllowed:!0,rootExampleType:o.ExampleType.boolean})},3983:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.stillImageFilm,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_STILL_IMAGE_FILM_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.stillImageFilm,bodyAllowed:!0})},7030:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.stillImageFilmEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_STILL_IMAGE_FILM_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.stillImageFilmEmbed,bodyAllowed:!0})},2527:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.stillImageFilmLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_STILL_IMAGE_FILM_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.stillImageFilmLink,bodyAllowed:!0})},8388:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(5319),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.surveyAnonymous,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},8424:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(5319),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.survey,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},4157:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6027);i.RootBitType.setMetadata(i.RootBitType.toc,{tags:Object.assign({},o.TAGS_DEFAULT),resourceAttachmentAllowed:!1,bodyAllowed:!0})},3194:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(7028),s=r(4719),n=r(6562),a=r(5319),l=r(6027);i.RootBitType.setMetadata(i.RootBitType.trueFalse1,{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_DEFAULT),a.TAGS_CHAIN_ANY_RESOURCE),{[s.PropertyKey.labelTrue]:{isProperty:!0},[s.PropertyKey.labelFalse]:{isProperty:!0},[n.TagType.True]:{},[n.TagType.False]:{}}),resourceAttachmentAllowed:!0,bodyAllowed:!1,rootExampleType:o.ExampleType.boolean})},4238:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(1614),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.trueFalse,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),{[o.PropertyKey.labelTrue]:{isProperty:!0},[o.PropertyKey.labelFalse]:{isProperty:!0}}),resourceAttachmentAllowed:!0,cardSet:s.CARD_SET_STATEMENTS,bodyAllowed:!0,footerAllowed:!0})},9755:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.vendorPadletEmbed,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.PropertyKey.padletId]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},5297:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.video,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_VIDEO_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.video,bodyAllowed:!0})},2787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.videoEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_VIDEO_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.videoEmbed,bodyAllowed:!0})},7159:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.videoLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_VIDEO_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.videoLink,bodyAllowed:!0})},1703:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.websiteLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_WEBSITE_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.websiteLink,bodyAllowed:!0})},2093:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),r(4842),r(3616),r(4373),r(2773),r(6360),r(6246),r(9309),r(591),r(3851),r(980),r(8788),r(1),r(7386),r(4865),r(3890),r(3707),r(2585),r(8161),r(5912),r(8305),r(2438),r(5983),r(1363),r(1934),r(4954),r(3913),r(8157),r(8253),r(1559),r(5046),r(76),r(4861),r(2161),r(9338),r(700),r(8371),r(5730),r(3947),r(9745),r(2033),r(9780),r(8801),r(4446),r(1417),r(5309),r(543),r(149),r(9330),r(3983),r(7030),r(2527),r(8388),r(8424),r(4157),r(3194),r(4238),r(9755),r(5297),r(2787),r(7159),r(1703),r(5595),r(6138),r(7243),r(1197),r(3828),r(9787),r(3728),r(3589),r(3544),r(4681),r(9678),r(4303),r(5805),r(8634),r(5158),r(374),r(9851),r(2853),r(1128),r(1802),r(6263),r(6321),r(3904),r(7582),r(209),r(2737),r(5243),r(1285),r(6367),r(7443),r(4245),r(5635),r(8856),r(2786),r(2375),r(8699),r(6667),r(7538),r(4648),r(9448),r(1500),r(759),r(8e3),r(2706),r(5044),r(1502),r(3477),r(7882),r(2675),r(9404),r(6625),r(3908),r(3739),r(2891)},5595:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.action,{isSingle:!0,isTrimmedString:!0})},6138:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.ageRange,{isTrimmedString:!0})},7243:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.aiGenerated,{astKey:"aiGenerated",isSingle:!0,isBoolean:!0})},1197:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.author,{isTrimmedString:!0})},3828:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.book,{isTrimmedString:!0,isSingle:!0})},9787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.bot,{})},3728:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.caseSensitive,{isSingle:!0,isBoolean:!0,astKey:"isCaseSensitive",jsonKey:"isCaseSensitive"})},3589:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.color,{isSingle:!0,isTrimmedString:!0})},3544:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.computerLanguage,{isSingle:!0,isTrimmedString:!0})},4681:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.coverImage,{isTrimmedString:!0})},9678:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.date,{isSingle:!0})},4303:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.deeplink,{isTrimmedString:!0})},5805:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.duration,{isSingle:!0,isTrimmedString:!0})},8634:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.example,{isSingle:!0})},5158:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.externalId,{isTrimmedString:!0})},374:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.externalLink,{isSingle:!0,isTrimmedString:!0})},9851:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.externalLinkText,{isSingle:!0,isTrimmedString:!0})},2853:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.focusX,{isSingle:!0,isNumber:!0})},1128:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.focusY,{isSingle:!0,isNumber:!0})},1802:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.id,{isTrimmedString:!0})},6263:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.emphasis,{isSingle:!0,isTrimmedString:!0})},6321:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.isInfoOnly,{isSingle:!0,isBoolean:!0})},3904:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.isTracked,{isSingle:!0,isBoolean:!0})},7582:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.kind,{isSingle:!0,isTrimmedString:!0})},209:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.labelFalse,{isSingle:!0,isTrimmedString:!0})},2737:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.labelTrue,{isSingle:!0,isTrimmedString:!0})},5243:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.language,{isTrimmedString:!0})},1285:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.level,{isSingle:!0,astKey:"levelProperty"})},6367:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.list,{isTrimmedString:!0})},7443:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.location,{isSingle:!0,isTrimmedString:!0})},4245:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.longAnswer,{isSingle:!0,isInvertedBoolean:!0,astKey:"isShortAnswer",jsonKey:"isShortAnswer"})},5635:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.mark,{isTrimmedString:!0})},8856:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.padletId,{isTrimmedString:!0,isSingle:!0})},2786:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.partialAnswer,{isSingle:!0,isTrimmedString:!0})},2375:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.partner,{isTrimmedString:!0,isSingle:!0})},8699:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.progress,{isSingle:!0,isBoolean:!0,ignoreTrue:!0})},6667:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.publications,{isTrimmedString:!0})},7538:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.publisher,{isTrimmedString:!0})},4648:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.quotedPerson,{isSingle:!0,isTrimmedString:!0})},9448:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.reaction,{isSingle:!0,isTrimmedString:!0})},1500:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.reference,{isSingle:!1,isTrimmedString:!0,astKey:"referenceProperty"})},759:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.releaseVersion,{isTrimmedString:!0,isSingle:!0})},8e3:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.width,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.height,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.license,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.copyright,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.caption,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.showInIndex,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.alt,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.src1x,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.src2x,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.src3x,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.src4x,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.mute,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.autoplay,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.allowSubtitles,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.showSubtitles,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.siteName,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.posterImage,{isSingle:!0,isTrimmedString:!0})},2706:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.sampleSolution,{isSingle:!0,isTrimmedString:!0})},5044:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.shortAnswer,{isSingle:!0,isBoolean:!0,astKey:"isShortAnswer",jsonKey:"isShortAnswer"})},1502:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.spaceId,{isTrimmedString:!0})},3477:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.subject,{isTrimmedString:!0})},7882:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.subtype,{isSingle:!0,isTrimmedString:!0})},2675:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.textReference,{isSingle:!0,isTrimmedString:!0})},9404:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.theme,{isTrimmedString:!0})},6625:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.thumbImage,{isSingle:!0,isTrimmedString:!0})},3908:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.toc,{isSingle:!0,isBoolean:!0,ignoreTrue:!0})},3739:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.type,{isSingle:!0,isTrimmedString:!0})},2891:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.videoCallLink,{isSingle:!0,isTrimmedString:!0})},1022:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildInfo=void 0,t.buildInfo={name:"@gmb/bitmark-parser-generator",version:"1.2.0"}},4369:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=void 0;const i=r(6831),o=r(2892),s=r(7448);function n(e,t,r,i){var o=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(o,n.prototype),o.expected=t,o.found=r,o.location=i,o.name="SyntaxError",o}function a(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}t.SyntaxError=n,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(n,Error),n.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){i=e[r].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,s=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,n=this.location.source+":"+s.line+":"+s.column;if(i){var l=this.location.end,u=a("",s.line.toString().length," "),c=i[o.line-1],d=(o.line===l.line?l.column:c.length+1)-o.column||1;t+="\n --\x3e "+n+"\n"+u+" |\n"+s.line+" | "+c+"\n"+u+" | "+a("",o.column-1," ")+a("",d,"^")}else t+="\n at "+n}return t},n.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?s(e[0])+"-"+s(e[1]):s(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function i(e){return e.charCodeAt(0).toString(16).toUpperCase()}function o(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function s(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function n(e){return r[e.type](e)}return"Expected "+function(e){var t,r,i=e.map(n);if(i.sort(),i.length>0){for(t=1,r=1;t<i.length;t++)i[t-1]!==i[t]&&(i[r]=i[t],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(e)+" but "+function(e){return e?'"'+o(e)+'"':"end of input"}(t)+" found."},t.parse=function e(t,r){var a,l={},u=(r=void 0!==r?r:{}).grammarSource,c={bitmark:sr,bit:function(){var e,t,r,i,o;e=$t,t=[],r=kr();for(;r!==l;)t.push(r),r=kr();if((r=lr())!==l){for(i=[],o=kr();o!==l;)i.push(o),o=kr();qt=e,e=We(r)}else $t=e,e=l;return e},cardContent:function(){var e,t,r;e=$t,t=[],(r=pr())===l&&(r=Tr());for(;r!==l;)t.push(r),(r=pr())===l&&(r=Tr());return qt=e,t=vt(t),e=t}},d=sr,p="[.",h="]",y=":",g="&",f="++",m="====",b="--",v="~~",T="===",A="==",P="[@id",_="[",x="#",w="[▼",S="[►",O="[@",R="[%",k="[!",C="[?",E="[+",I="[-",j="[$",B="[_",L="[=",N="[&",M="::",U="||",K="id:",F="\n",D="\r\n",V="\r",G="\u2028",H="\u2029",$=/^[^\]]/,q=/^[^:\]]/,J=/^[^&:\]]/,z=/^[ \t]/,W=/^[^\n\r\u2028\u2029]/,Y=/^[ \t\n\r\u2028\u2029]/,X=Qt("[.",!1),Q=Zt(["]"],!0,!1),Z=Qt("]",!1),ee=Qt(":",!1),te=Qt("&",!1),re={type:"any"},ie=Qt("++",!1),oe=Qt("====",!1),se=Qt("--",!1),ne=Qt("~~",!1),ae=Qt("===",!1),le=Qt("==",!1),ue=Qt("[@id",!1),ce=Qt("[",!1),de=Qt("#",!1),pe=Qt("[▼",!1),he=Qt("[►",!1),ye=Qt("[@",!1),ge=Qt("[%",!1),fe=Qt("[!",!1),me=Qt("[?",!1),be=Qt("[+",!1),ve=Qt("[-",!1),Te=Qt("[$",!1),Ae=Qt("[_",!1),Pe=Qt("[=",!1),_e=Qt("[&",!1),xe=Qt("::",!1),we=Qt("||",!1),Se=Qt("id:",!1),Oe=Zt([":","]"],!0,!1),Re=Zt(["&",":","]"],!0,!1),ke=(er("Empty"),Zt([" ","\t"],!1,!1)),Ce=er("Anything"),Ee=er("Character"),Ie=Zt(["\n","\r","\u2028","\u2029"],!0,!1),je=er("Line"),Be=(er("whitespace in line"),er("Blank Line")),Le=er("Line Terminator"),Ne=Qt("\n",!1),Me=Qt("\r\n",!1),Ue=Qt("\r",!1),Ke=Qt("\u2028",!1),Fe=Qt("\u2029",!1),De=er("Whitespace, then Line Terminator"),Ve=er("whitespace"),Ge=Zt([" ","\t","\n","\r","\u2028","\u2029"],!1,!1),He=function(e,t){return Nr.buildBits([e,...t])},$e=function(e){return Lr.handleRawBit(e)},qe=function(e){return e},Je=function(e){return Lr.handleRawBit(e)},ze=function(e){return e},We=function(e){return e},Ye=function(e,t){return Nr.buildBit(e,t)},Xe=function(e){return Nr.invalidBit(e)},Qe=function(e,t){return Nr.buildBitHeader(e,t)},Ze=function(e,t){return Nr.buildTextAndResourceType(e,t)},et=function(e){return Lr.handleTextFormat(e)},tt=function(e){return Lr.handleResourceType(e)},rt=function(e){return Lr.handleBitContent(e)},it=function(e){return Lr.handleTagChain(e)},ot=function(e){return e},st=function(e){return Lr.handleBitTag(e)},nt=function(e){return{type:i.TypeKey.BodyChar,value:e}},at=function(e){return Lr.handleCardSet(e[1].flat())},lt=function(){Lr.handleCardSetStart()},ut=function(){Lr.handleCardSetEnd()},ct=function(e){return Lr.handleCards(e)},dt=function(e){return Lr.handleCardLineOrDivider(e,2)},pt=function(e){return Lr.handleCardLine(e)},ht=function(e){return Lr.handleCardSet(e[1].flat())},yt=function(){Lr.handleCardSetStart()},gt=function(){Lr.handleCardSetEnd()},ft=function(e){return Lr.handleCards(e)},mt=function(e){return Lr.handleCardLineOrDivider(e,1)},bt=function(e){return Lr.handleCardLine(e)},vt=function(e){return Lr.handleCardContent(e)},Tt=function(e){return{type:i.TypeKey.CardChar,value:e}},At=function(e){return Lr.handlePropertyTag("id",e)},Pt=function(e,t){return Lr.handleTag(i.TypeKey.Title,{level:e,title:t})},_t=function(e){return Lr.handleTag(i.TypeKey.Anchor,e)},xt=function(e){return Lr.handleTag(i.TypeKey.Reference,e)},wt=function(e,t){return Lr.handlePropertyTag(e,t)},St=function(e){return Lr.handleTag(i.TypeKey.ItemLead,e)},Ot=function(e){return Lr.handleTag(i.TypeKey.Instruction,e)},Rt=function(e){return Lr.handleTag(i.TypeKey.Hint,e)},kt=function(e){return Lr.handleTag(i.TypeKey.True,e)},Ct=function(e){return Lr.handleTag(i.TypeKey.False,e)},Et=function(e){return Lr.handleTag(i.TypeKey.SampleSolution,e)},It=function(e){return Lr.handleTag(i.TypeKey.Gap,e)},jt=function(e){return Lr.handleTag(i.TypeKey.Mark,e)},Bt=function(e,t){return Lr.handleResourceTag(e,t)},Lt=function(e){return Lr.handleTag(i.TypeKey.BodyText,e)},Nt=function(e){return Lr.handleTag(i.TypeKey.Comment,e)},Mt=function(e){return e},Ut=function(e){return e?e.trim():""},Kt=function(e){return e?e.trim():null},Ft=function(e){return e?e.trim():""},Dt=function(){return!0},Vt=function(e){return e},Gt=function(e){return e},Ht=function(e){return e},$t=0,qt=0,Jt=[{line:1,column:1}],zt=0,Wt=[],Yt=0;if("startRule"in r){if(!(r.startRule in c))throw new Error("Can't start parsing from rule \""+r.startRule+'".');d=c[r.startRule]}function Xt(){return t.substring(qt,$t)}function Qt(e,t){return{type:"literal",text:e,ignoreCase:t}}function Zt(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function er(e){return{type:"other",description:e}}function tr(e){var r,i=Jt[e];if(i)return i;for(r=e-1;!Jt[r];)r--;for(i={line:(i=Jt[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return Jt[e]=i,i}function rr(e,t,r){var i=tr(e),o=tr(t),s={source:u,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:o.line,column:o.column}};return r&&u&&"function"==typeof u.offset&&(s.start=u.offset(s.start),s.end=u.offset(s.end)),s}function ir(e){$t<zt||($t>zt&&(zt=$t,Wt=[]),Wt.push(e))}function or(e,t,r){return new n(n.buildMessage(e,t),e,t,r)}function sr(){return function(){var e,r,i,o;e=$t,r=[],(i=Ir())===l&&(i=Ar());for(;i!==l;)r.push(i),(i=Ir())===l&&(i=Ar());return i=function(){var e,r,i,o;e=$t,r=$t,i=[],o=ar();for(;o!==l;)i.push(o),o=ar();return r=t.substring(r,$t),qt=e,r=$e(r),e=r,e}(),o=function(){var e,t;e=[],t=nr();for(;t!==l;)e.push(t),t=nr();return e}(),qt=e,e=He(i,o),e}()}function nr(){var e,r,i,o;for(e=$t,r=[],i=kr();i!==l;)r.push(i),i=kr();return(i=Cr())===l&&(i=null),o=function(){var e,r,i,o,s,n;if(e=$t,r=$t,i=$t,o=function(){var e,r,i,o;e=$t,t.substr($t,2)===p?(r=p,$t+=2):(r=l,0===Yt&&ir(X));if(r!==l){for(i=[],$.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Q));o!==l;)i.push(o),$.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Q));93===t.charCodeAt($t)?(o=h,$t++):(o=l,0===Yt&&ir(Z)),o!==l?(qt=e,e=ze(r)):($t=e,e=l)}else $t=e,e=l;return e}(),o!==l){for(s=[],n=ar();n!==l;)s.push(n),n=ar();i=o=[o,s]}else $t=i,i=l;r=i!==l?t.substring(r,$t):i;r!==l&&(qt=e,r=Je(r));return e=r,e}(),o!==l?(qt=e,e=qe(o)):($t=e,e=l),e}function ar(){var e,t,r,i;if(e=$t,(t=Cr())!==l?(r=$t,Yt++,i=ur(),Yt--,i===l?r=void 0:($t=r,r=l),r!==l?e=t=[t,r]:($t=e,e=l)):($t=e,e=l),e===l)if(e=[],(t=Or())!==l)for(;t!==l;)e.push(t),t=Or();else e=l;return e}function lr(){var e,r,i;return e=$t,(r=ur())!==l?(i=function(){var e,t,r;e=$t,t=[],r=fr(),r===l&&(r=br())===l&&(r=pr())===l&&(r=gr());for(;r!==l;)t.push(r),(r=fr())===l&&(r=br())===l&&(r=pr())===l&&(r=gr());return qt=e,t=rt(t),e=t,e}(),qt=e,e=Ye(r,i)):($t=e,e=l),e===l&&(e=$t,r=$t,i=function(){var e,r;Yt++,e=[],t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re));for(;r!==l;)e.push(r),t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re));Yt--,r=l,0===Yt&&ir(Ce);return e}(),r=t.substring(r,$t),qt=e,e=r=Xe(r)),e}function ur(){var e,r,i,o,s;return e=$t,t.substr($t,2)===p?(r=p,$t+=2):(r=l,0===Yt&&ir(X)),r!==l?(i=wr(),o=function(){var e,t,r;e=$t,t=cr(),t===l&&(t=dr());t===l&&(t=null);r=cr(),r===l&&(r=dr());r===l&&(r=null);return qt=e,e=Ze(t,r),e}(),93===t.charCodeAt($t)?(s=h,$t++):(s=l,0===Yt&&ir(Z)),s!==l?(qt=e,e=Qe(i,o)):($t=e,e=l)):($t=e,e=l),e}function cr(){var e,r,i;return e=$t,58===t.charCodeAt($t)?(r=y,$t++):(r=l,0===Yt&&ir(ee)),r!==l?(i=wr(),qt=e,e=et(i)):($t=e,e=l),e}function dr(){var e,r,i;return e=$t,38===t.charCodeAt($t)?(r=g,$t++):(r=l,0===Yt&&ir(te)),r!==l?(i=wr(),qt=e,e=tt(i)):($t=e,e=l),e}function pr(){var e,t,r,i,o;if(e=$t,t=$t,(r=yr())!==l){for(i=[],o=hr();o!==l;)i.push(o),o=hr();t=r=[r,i]}else $t=t,t=l;return t!==l&&(qt=e,t=it(t)),e=t}function hr(){var e,t;return e=$t,(t=yr())!==l&&(qt=e,t=ot(t)),e=t}function yr(){var e,r;return e=$t,(r=Ar())===l&&(r=function(){var e,r,i,o,s,n,a,u;e=$t,r=$t,i=$t,t.substr($t,2)===M?(o=M,$t+=2):(o=l,0===Yt&&ir(xe));o!==l?(s=function(){var e,r,i,o,s,n;e=$t,r=$t,i=[],o=$t,s=$t,Yt++,t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(xe));Yt--,n===l?s=void 0:($t=s,s=l);s!==l&&(n=Or())!==l?o=s=[s,n]:($t=o,o=l);for(;o!==l;)i.push(o),o=$t,s=$t,Yt++,t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(xe)),Yt--,n===l?s=void 0:($t=s,s=l),s!==l&&(n=Or())!==l?o=s=[s,n]:($t=o,o=l);return r=t.substring(r,$t),qt=e,r=Vt(r),e=r,e}(),t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(xe)),n!==l?(a=function(){var e,r,i,o,s,n;e=$t,r=$t,i=[],o=$t,s=$t,Yt++,t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(xe));Yt--,n===l?s=void 0:($t=s,s=l);s!==l?(t.length>$t?(n=t.charAt($t),$t++):(n=l,0===Yt&&ir(re)),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l);for(;o!==l;)i.push(o),o=$t,s=$t,Yt++,t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(xe)),Yt--,n===l?s=void 0:($t=s,s=l),s!==l?(t.length>$t?(n=t.charAt($t),$t++):(n=l,0===Yt&&ir(re)),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l);return r=t.substring(r,$t),qt=e,r=Gt(r),e=r,e}(),u=function(){var e,r,i;t.substr($t,2)===M?(e=M,$t+=2):(e=l,0===Yt&&ir(xe));if(e===l){for(e=$t,r=[],i=Ir();i!==l;)r.push(i),i=Ir();(i=Br())!==l?e=r=[r,i]:($t=e,e=l)}return e}(),u!==l?i=o=[o,s,n,a,u]:($t=i,i=l)):($t=i,i=l)):($t=i,i=l);r=i!==l?t.substring(r,$t):i;r!==l&&(qt=e,r=Lt(r));return e=r,e}(),r===l&&(r=function(){var e,r,i,o;e=$t,t.substr($t,4)===P?(r=P,$t+=4):(r=l,0===Yt&&ir(ue));r!==l&&(i=Sr())!==l?(o=function(){var e;93===t.charCodeAt($t)?(e=h,$t++):(e=l,0===Yt&&ir(Z));return e}(),o!==l?(qt=e,e=At(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i,o;e=$t,t.substr($t,2)===O?(r=O,$t+=2):(r=l,0===Yt&&ir(ye));r!==l&&(i=_r())!==l&&(o=Sr())!==l&&xr()!==l?(qt=e,e=wt(i,o)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i,o;e=$t,91===t.charCodeAt($t)?(r=_,$t++):(r=l,0===Yt&&ir(ce));if(r!==l){if(i=[],35===t.charCodeAt($t)?(o=x,$t++):(o=l,0===Yt&&ir(de)),o!==l)for(;o!==l;)i.push(o),35===t.charCodeAt($t)?(o=x,$t++):(o=l,0===Yt&&ir(de));else i=l;i!==l?(o=Pr(),xr()!==l?(qt=e,e=Pt(i,o)):($t=e,e=l)):($t=e,e=l)}else $t=e,e=l;return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===w?(r=w,$t+=2):(r=l,0===Yt&&ir(pe));r!==l?(i=Pr(),xr()!==l?(qt=e,e=_t(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===S?(r=S,$t+=2):(r=l,0===Yt&&ir(he));r!==l?(i=Pr(),xr()!==l?(qt=e,e=xt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===R?(r=R,$t+=2):(r=l,0===Yt&&ir(ge));r!==l?(i=Pr(),xr()!==l?(qt=e,e=St(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===k?(r=k,$t+=2):(r=l,0===Yt&&ir(fe));r!==l?(i=Pr(),xr()!==l?(qt=e,e=Ot(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===C?(r=C,$t+=2):(r=l,0===Yt&&ir(me));r!==l?(i=Pr(),xr()!==l?(qt=e,e=Rt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===B?(r=B,$t+=2):(r=l,0===Yt&&ir(Ae));r!==l?(i=Pr(),xr()!==l?(qt=e,e=It(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===L?(r=L,$t+=2):(r=l,0===Yt&&ir(Pe));r!==l?(i=Pr(),xr()!==l?(qt=e,e=jt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===j?(r=j,$t+=2):(r=l,0===Yt&&ir(Te));r!==l?(i=Pr(),xr()!==l?(qt=e,e=Et(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===E?(r=E,$t+=2):(r=l,0===Yt&&ir(be));r!==l?(i=Pr(),xr()!==l?(qt=e,e=kt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===I?(r=I,$t+=2):(r=l,0===Yt&&ir(ve));r!==l?(i=Pr(),xr()!==l?(qt=e,e=Ct(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i,o;e=$t,t.substr($t,2)===N?(r=N,$t+=2):(r=l,0===Yt&&ir(_e));r!==l&&(i=_r())!==l&&(o=Sr())!==l&&xr()!==l?(qt=e,e=Bt(i,o)):($t=e,e=l);return e}()))))))))))))))),r!==l&&(qt=e,r=st(r)),e=r}function gr(){var e,r;return e=$t,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),r!==l&&(qt=e,r=nt(r)),e=r}function fr(){var e,r,i,o,s;if(e=$t,r=$t,i=function(){var e,r,i,o,s,n,a;e=$t,r=Cr(),r!==l?(t.substr($t,2)===f?(i=f,$t+=2):(i=l,0===Yt&&ir(ie)),i!==l&&Er()!==l?(o=$t,Yt++,s=$t,t.substr($t,4)===m?(n=m,$t+=4):(n=l,0===Yt&&ir(oe)),n!==l&&(a=Er())!==l?s=n=[n,a]:($t=s,s=l),Yt--,s!==l?($t=o,o=void 0):o=l,o!==l?(qt=e,e=lt()):($t=e,e=l)):($t=e,e=l)):($t=e,e=l);return e}(),i!==l){for(o=[],s=mr();s!==l;)o.push(s),s=mr();s=function(){var e,r,i,o,s,n;e=$t,t.substr($t,4)===m?(r=m,$t+=4):(r=l,0===Yt&&ir(oe));r!==l&&(i=Er())!==l?(t.substr($t,2)===f?(o=f,$t+=2):(o=l,0===Yt&&ir(ie)),o!==l?(s=$t,Yt++,n=jr(),Yt--,n!==l?($t=s,s=void 0):s=l,s!==l?e=r=[r,i,o,s]:($t=e,e=l)):($t=e,e=l)):($t=e,e=l);if(e===l){for(e=$t,r=$t,i=[],o=Ir();o!==l;)i.push(o),o=Ir();(o=Br())!==l?r=i=[i,o]:($t=r,r=l),r!==l&&(qt=e,r=ut()),e=r}return e}(),s!==l?r=i=[i,o,s]:($t=r,r=l)}else $t=r,r=l;return r!==l&&(qt=e,r=at(r)),e=r}function mr(){var e,r,i,o,s,n,a;return e=$t,r=$t,Yt++,i=$t,t.substr($t,4)===m?(o=m,$t+=4):(o=l,0===Yt&&ir(oe)),o!==l&&(s=Er())!==l?(t.substr($t,2)===f?(n=f,$t+=2):(n=l,0===Yt&&ir(ie)),n!==l&&(a=jr())!==l?i=o=[o,s,n,a]:($t=i,i=l)):($t=i,i=l),Yt--,i===l?r=void 0:($t=r,r=l),r!==l?(i=function(){var e,r,i,o;e=$t,r=$t,t.substr($t,4)===m?(i=m,$t+=4):(i=l,0===Yt&&ir(oe));i!==l&&(o=Er())!==l?r=i=[i,o]:($t=r,r=l);r===l&&(r=$t,t.substr($t,2)===b?(i=b,$t+=2):(i=l,0===Yt&&ir(se)),i!==l&&(o=Er())!==l?r=i=[i,o]:($t=r,r=l),r===l&&(r=$t,t.substr($t,2)===v?(i=v,$t+=2):(i=l,0===Yt&&ir(ne)),i!==l&&(o=Er())!==l?r=i=[i,o]:($t=r,r=l),r===l&&(r=function(){var e,r,i,o,s;e=$t,r=$t,i=$t,o=Rr(),s=Cr(),s!==l?i=o=[o,s]:($t=i,i=l);r=i!==l?t.substring(r,$t):i;r!==l&&(qt=e,r=pt(r));return e=r,e}())));r!==l&&(qt=e,r=dt(r));return e=r,e}(),i!==l?(qt=e,e=ct(i)):($t=e,e=l)):($t=e,e=l),e}function br(){var e,r,i,o,s;if(e=$t,r=$t,i=function(){var e,r,i,o,s,n;e=$t,r=Cr(),r!==l?(i=$t,Yt++,o=$t,t.substr($t,3)===T?(s=T,$t+=3):(s=l,0===Yt&&ir(ae)),s!==l&&(n=Er())!==l?o=s=[s,n]:($t=o,o=l),Yt--,o!==l?($t=i,i=void 0):i=l,i!==l?(qt=e,e=yt()):($t=e,e=l)):($t=e,e=l);return e}(),i!==l){for(o=[],s=vr();s!==l;)o.push(s),s=vr();s=function(){var e,r,i,o,s;e=$t,r=$t,t.substr($t,3)===T?(i=T,$t+=3):(i=l,0===Yt&&ir(ae));i!==l?(o=$t,Yt++,s=jr(),Yt--,s!==l?($t=o,o=void 0):o=l,o!==l?r=i=[i,o]:($t=r,r=l)):($t=r,r=l);r!==l&&(qt=e,r=gt());return e=r,e}(),s!==l?r=i=[i,o,s]:($t=r,r=l)}else $t=r,r=l;return r!==l&&(qt=e,r=ht(r)),e=r}function vr(){var e,r,i,o,s,n,a,u,c,d,p;if(e=$t,r=$t,Yt++,i=$t,t.substr($t,3)===T?(o=T,$t+=3):(o=l,0===Yt&&ir(ae)),o!==l){for(s=[],n=Ir();n!==l;)s.push(n),n=Ir();for(n=[],a=$t,u=$t,Yt++,c=$t,(d=Cr())!==l?(t.substr($t,3)===T?(p=T,$t+=3):(p=l,0===Yt&&ir(ae)),p!==l?c=d=[d,p]:($t=c,c=l)):($t=c,c=l),Yt--,c===l?u=void 0:($t=u,u=l),u!==l?(t.length>$t?(c=t.charAt($t),$t++):(c=l,0===Yt&&ir(re)),c!==l?a=u=[u,c]:($t=a,a=l)):($t=a,a=l);a!==l;)n.push(a),a=$t,u=$t,Yt++,c=$t,(d=Cr())!==l?(t.substr($t,3)===T?(p=T,$t+=3):(p=l,0===Yt&&ir(ae)),p!==l?c=d=[d,p]:($t=c,c=l)):($t=c,c=l),Yt--,c===l?u=void 0:($t=u,u=l),u!==l?(t.length>$t?(c=t.charAt($t),$t++):(c=l,0===Yt&&ir(re)),c!==l?a=u=[u,c]:($t=a,a=l)):($t=a,a=l);(a=Br())!==l?i=o=[o,s,n,a]:($t=i,i=l)}else $t=i,i=l;return Yt--,i===l?r=void 0:($t=r,r=l),r!==l?(i=function(){var e,r,i,o;e=$t,r=$t,t.substr($t,3)===T?(i=T,$t+=3):(i=l,0===Yt&&ir(ae));i!==l&&(o=Er())!==l?r=i=[i,o]:($t=r,r=l);r===l&&(r=$t,t.substr($t,2)===A?(i=A,$t+=2):(i=l,0===Yt&&ir(le)),i!==l&&(o=Er())!==l?r=i=[i,o]:($t=r,r=l),r===l&&(r=$t,t.substr($t,2)===b?(i=b,$t+=2):(i=l,0===Yt&&ir(se)),i!==l&&(o=Er())!==l?r=i=[i,o]:($t=r,r=l),r===l&&(r=function(){var e,r,i,o,s;e=$t,r=$t,i=$t,o=Rr(),s=Cr(),s!==l?i=o=[o,s]:($t=i,i=l);r=i!==l?t.substring(r,$t):i;r!==l&&(qt=e,r=bt(r));return e=r,e}())));r!==l&&(qt=e,r=mt(r));return e=r,e}(),i!==l?(qt=e,e=ft(i)):($t=e,e=l)):($t=e,e=l),e}function Tr(){var e,r;return e=$t,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),r!==l&&(qt=e,r=Tt(r)),e=r}function Ar(){var e,r,i,o;return e=$t,t.substr($t,2)===U?(r=U,$t+=2):(r=l,0===Yt&&ir(we)),r!==l?(i=function(){var e,r,i,o,s,n;e=$t,r=$t,i=[],o=$t,s=$t,Yt++,t.substr($t,2)===U?(n=U,$t+=2):(n=l,0===Yt&&ir(we));Yt--,n===l?s=void 0:($t=s,s=l);s!==l?(t.length>$t?(n=t.charAt($t),$t++):(n=l,0===Yt&&ir(re)),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l);for(;o!==l;)i.push(o),o=$t,s=$t,Yt++,t.substr($t,2)===U?(n=U,$t+=2):(n=l,0===Yt&&ir(we)),Yt--,n===l?s=void 0:($t=s,s=l),s!==l?(t.length>$t?(n=t.charAt($t),$t++):(n=l,0===Yt&&ir(re)),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l);return r=t.substring(r,$t),qt=e,r=Ht(r),e=r,e}(),o=function(){var e,r,i;t.substr($t,2)===U?(e=U,$t+=2):(e=l,0===Yt&&ir(we));if(e===l){for(e=$t,r=[],i=Ir();i!==l;)r.push(i),i=Ir();(i=Br())!==l?e=r=[r,i]:($t=e,e=l)}return e}(),o!==l?(qt=e,e=Nt(i)):($t=e,e=l)):($t=e,e=l),e}function Pr(){var e,r,i,o;for(e=$t,r=$t,i=[],$.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Q));o!==l;)i.push(o),$.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Q));return r=t.substring(r,$t),qt=e,e=r=Mt(r)}function _r(){var e,r,i,o,s;if(e=$t,r=$t,Yt++,t.substr($t,3)===K?(i=K,$t+=3):(i=l,0===Yt&&ir(Se)),Yt--,i===l?r=void 0:($t=r,r=l),r!==l){for(i=$t,o=[],q.test(t.charAt($t))?(s=t.charAt($t),$t++):(s=l,0===Yt&&ir(Oe));s!==l;)o.push(s),q.test(t.charAt($t))?(s=t.charAt($t),$t++):(s=l,0===Yt&&ir(Oe));i=t.substring(i,$t),qt=e,e=Ut(i)}else $t=e,e=l;return e}function xr(){var e,r,i;if(93===t.charCodeAt($t)?(e=h,$t++):(e=l,0===Yt&&ir(Z)),e===l){for(e=$t,r=[],i=Ir();i!==l;)r.push(i),i=Ir();(i=Br())!==l?e=r=[r,i]:($t=e,e=l)}return e}function wr(){var e,r,i,o;for(e=$t,r=$t,i=[],J.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Re));o!==l;)i.push(o),J.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Re));return r=t.substring(r,$t),qt=e,e=r=Kt(r)}function Sr(){var e,r,i;return e=$t,58===t.charCodeAt($t)?(r=y,$t++):(r=l,0===Yt&&ir(ee)),r!==l?(i=Pr(),qt=e,e=Ft(i)):($t=e,e=l),e===l&&(r="",qt=e=$t,e=r=Dt()),e}function Or(){var e;return Yt++,W.test(t.charAt($t))?(e=t.charAt($t),$t++):(e=l,0===Yt&&ir(Ie)),Yt--,e===l&&(l,0===Yt&&ir(Ee)),e}function Rr(){var e,t;for(Yt++,e=[],t=Or();t!==l;)e.push(t),t=Or();return Yt--,t=l,0===Yt&&ir(je),e}function kr(){var e,r,i;for(Yt++,e=$t,r=[],z.test(t.charAt($t))?(i=t.charAt($t),$t++):(i=l,0===Yt&&ir(ke));i!==l;)r.push(i),z.test(t.charAt($t))?(i=t.charAt($t),$t++):(i=l,0===Yt&&ir(ke));return(i=Cr())!==l?e=r=[r,i]:($t=e,e=l),Yt--,e===l&&(r=l,0===Yt&&ir(Be)),e}function Cr(){var e;return Yt++,10===t.charCodeAt($t)?(e=F,$t++):(e=l,0===Yt&&ir(Ne)),e===l&&(t.substr($t,2)===D?(e=D,$t+=2):(e=l,0===Yt&&ir(Me)),e===l&&(13===t.charCodeAt($t)?(e=V,$t++):(e=l,0===Yt&&ir(Ue)),e===l&&(8232===t.charCodeAt($t)?(e=G,$t++):(e=l,0===Yt&&ir(Ke)),e===l&&(8233===t.charCodeAt($t)?(e=H,$t++):(e=l,0===Yt&&ir(Fe)))))),Yt--,e===l&&(l,0===Yt&&ir(Le)),e}function Er(){var e,r,i;for(Yt++,e=$t,r=[],z.test(t.charAt($t))?(i=t.charAt($t),$t++):(i=l,0===Yt&&ir(ke));i!==l;)r.push(i),z.test(t.charAt($t))?(i=t.charAt($t),$t++):(i=l,0===Yt&&ir(ke));return(i=Cr())!==l?e=r=[r,i]:($t=e,e=l),Yt--,e===l&&(r=l,0===Yt&&ir(De)),e}function Ir(){var e;return Yt++,Y.test(t.charAt($t))?(e=t.charAt($t),$t++):(e=l,0===Yt&&ir(Ge)),Yt--,e===l&&(l,0===Yt&&ir(Ve)),e}function jr(){var e,r;return(e=Er())===l&&(e=$t,Yt++,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),Yt--,r===l?e=void 0:($t=e,e=l)),e}function Br(){var e,r;return e=$t,Yt++,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),Yt--,r===l?e=void 0:($t=e,e=l),e}const Lr=new o.BitmarkPegParserHelper({parse:e,parserText:Xt,parserLocation:Mr}),Nr=new s.BitmarkPegParserProcessor({parse:e,parserText:Xt,parserLocation:Mr});function Mr(){const e=rr(qt,$t);return e?(delete e.source,e):e}function rr(e,t,r){var i=tr(e),o=tr(t),s={source:u,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:o.line,column:o.column}};return u&&"function"==typeof u.offset&&(s.start=u.offset(s.start),s.end=u.offset(s.end)),s}if((a=d())!==l&&$t===t.length)return a;throw a!==l&&$t<t.length&&ir({type:"end"}),or(Wt,zt<t.length?t.charAt(zt):null,zt<t.length?rr(zt,zt+1):rr(zt,zt))}},4764:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=void 0;const r=new RegExp(/=\^(\^*)(?==)|\*\^(\^*)(?=\*)|_\^(\^*)(?=_)|`\^(\^*)(?=`)|!\^(\^*)(?=!)|\[\^(\^*)|•\^(\^*)|#\^(\^*)|\|\^(\^*)|\|\^(\^*)/,"g");function i(e){let t=e||"";let i=r;return t=t.replace(i,(function(e,t,r,i,o){return e.replace("^","")})),t}function o(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkPlusString"}):l(e,{startRule:"bitmarkPlusString"})}function s(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkMinusMinusString"}):l(e,{startRule:"bitmarkMinusMinusString"})}function n(e,t,r,i){var o=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(o,n.prototype),o.expected=t,o.found=r,o.location=i,o.name="SyntaxError",o}function a(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}function l(e,t){var r,a={},l=(t=void 0!==t?t:{}).grammarSource,u={bitmarkPlusPlus:Ni,bitmarkPlus:function(){var e,t;Ri++,e=xi,t=oo(),e,t=Yr(t),e=t,Ri--,t=a,0===Ri&&Bi(Ne);return e},bitmarkMinusMinus:function(){var e,t;Ri++,e=xi,t=ho(),e,t=gi(t),e=t,Ri--,t=a,0===Ri&&Bi(Ht);return e},bitmarkPlusString:function(){var e;Ri++,e=oo(),Ri--,a,0===Ri&&Bi(nt);return e},bitmarkMinusMinusString:ho},c=Ni,d="|",p=":",h="### ",y="## ",g="# ",f="code",m="bitmark++",b="bitmark--",v="JavaScript",T="• ",A="•1 ",P="•+ ",_="•- ",x="\t",w="image",S=" ",O="#",R="@",k="width",C="height",E="=",I="𝑓",j="link:",B="var:",L="code:",N="color:",M="bold",U="italic",K="light",F="highlight",D="strike",V="sub",G="super",H="ins",$="del",q="aqua",J="black",z="blue",W="pink",Y="fuchsia",X="lightgrey",Q="gray",Z="darkgray",ee="green",te="lime",re="magenta",ie="maroon",oe="navy",se="olive",ne="orange",ae="purple",le="red",ue="silver",ce="teal",de="violet",pe="white",he="yellow",ye="*",ge="_",fe="`",me="!",be="[!",ve="]",Te="\n",Ae="\r\n",Pe="\r",_e="\u2028",xe="\u2029",we="http",Se="s",Oe="://",Re="mailto:",ke="~",Ce="^",Ee="'",Ie=/^[ \t]/,je=/^[0-9]/,Be=/^[^\n\r\u2028\u2029]/,Le=/^[a-zA-Z0-9!*'()=+-\/._?#@[\]$&(),;%:{}]/,Ne=Ei("StyledText"),Me=ki("|",!1),Ue=ki(":",!1),Ke=ki("### ",!1),Fe=ki("## ",!1),De=ki("# ",!1),Ve=ki("code",!1),Ge=Ci([" ","\t"],!1,!1),He=ki("bitmark++",!1),$e=ki("bitmark--",!1),qe=ki("JavaScript",!1),Je=ki("• ",!1),ze=ki("•1 ",!1),We=ki("•+ ",!1),Ye=ki("•- ",!1),Xe={type:"any"},Qe=ki("\t",!1),Ze=ki("image",!1),et=ki(" ",!1),tt=ki("#",!1),rt=ki("@",!1),it=Ci([["0","9"]],!1,!1),ot=ki("width",!1),st=ki("height",!1),nt=Ei("StyledString"),at=ki("=",!1),lt=ki("𝑓",!1),ut=ki("link:",!1),ct=ki("var:",!1),dt=ki("code:",!1),pt=ki("color:",!1),ht=ki("bold",!1),yt=ki("italic",!1),gt=ki("light",!1),ft=ki("highlight",!1),mt=ki("strike",!1),bt=ki("sub",!1),vt=ki("super",!1),Tt=ki("ins",!1),At=ki("del",!1),Pt=ki("aqua",!1),_t=ki("black",!1),xt=ki("blue",!1),wt=ki("pink",!1),St=ki("fuchsia",!1),Ot=ki("lightgrey",!1),Rt=ki("gray",!1),kt=ki("darkgray",!1),Ct=ki("green",!1),Et=ki("lime",!1),It=ki("magenta",!1),jt=ki("maroon",!1),Bt=ki("navy",!1),Lt=ki("olive",!1),Nt=ki("orange",!1),Mt=ki("purple",!1),Ut=ki("red",!1),Kt=ki("silver",!1),Ft=ki("teal",!1),Dt=ki("violet",!1),Vt=ki("white",!1),Gt=ki("yellow",!1),Ht=Ei("MinimalStyledText"),$t=Ei("MinimalStyledString"),qt=ki("*",!1),Jt=ki("_",!1),zt=ki("`",!1),Wt=ki("!",!1),Yt=ki("[!",!1),Xt=ki("]",!1),Qt=Ei("Line Terminator"),Zt=ki("\n",!1),er=ki("\r\n",!1),tr=ki("\r",!1),rr=ki("\u2028",!1),ir=ki("\u2029",!1),or=(Ei("whitespace in line"),Ei("space"),Ei("language tag separator"),Ei("white space, separator"),Ci(["\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!1,!1),Ci(["\n","\r","\u2028","\u2029"],!1,!1),Ci(["\n","\r","\u2028","\u2029"],!0,!1)),sr=(Ci(["\n","\r","\u2028","\u2029","\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!0,!1),ki("http",!1)),nr=ki("s",!1),ar=ki("://",!1),lr=ki("mailto:",!1),ur=Ci([["a","z"],["A","Z"],["0","9"],"!","*","'","(",")","=",["+","/"],".","_","?","#","@","[","]","$","&","(",")",",",";","%",":","{","}"],!1,!1),cr=ki("~",!1),dr=ki("^",!1),pr=ki("'",!1),hr=function(e){return Object.assign({},e)},yr=function(e){return Object.assign({},e)},gr=function(e){return Object.assign({},e)},fr=function(e){return Object.assign({},e)},mr=function(e){return Object.assign({},e)},br=function(){return[]},vr=function(e,t){return{type:"heading",content:s(t),attrs:{level:e.length-1}}},Tr=function(e){return e},Ar=function(e,t){return Object.assign(Object.assign({},e),{content:t})},Pr=function(){return{type:"codeBlock",language:""}},_r=function(e){return{type:"codeBlock",attrs:{language:e.trim().toLowerCase()}}},xr=function(e){return[{type:"text",text:i(e.trim())}]},wr=function(e){return e},Sr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Or=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Rr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},kr=function(){return{type:"bulletList"}},Cr=function(){return{type:"orderedList"}},Er=function(){return{type:"taskList"}},Ir=function(e,t,r,i){return i},jr=function(e,t,r,i){let s="bulletList";"•1 "==e&&(s="orderedList"),"•+ "!=e&&"•- "!=e||(s="taskList");let n=[{type:"paragraph",attrs:{},content:o((t+r.join("")).trim())}];if(i&&i[0]&&i[0].parent){let e={type:i[0].parent,attrs:{start:1},content:i,parent:""};"orderedList"==e.parent&&(e.attrs.start=1),n.push(e)}let a="listItem",l={};if("taskList"==s){a="taskItem";let t=!1;"•+ "==e&&(t=!0),l={checked:t}}return{type:a,content:n,parent:s,attrs:l}},Br=function(e){return e},Lr=function(e){return e.join("")===Io},Nr=function(e){return e.length>Io.length},Mr=function(e){Eo.push(Io),Io=e.join("")},Ur=function(){return Io=Eo.pop(),!0},Kr=function(e){return{type:"paragraph",content:o(e.trim()),attrs:{}}},Fr=function(e){return{type:"paragraph",content:o(e.trim()),attrs:{}}},Dr=function(e){return{type:"paragraph",content:o(e.trim()),attrs:{}}},Vr=function(e){return e},Gr=function(e,t,r){const i=Object.assign({},...r);let o=i.captionAlign||"left";delete i.captionAlign;let s=i.alt||null;delete i.alt;let n=i.caption||null;delete i.caption;let a=i.align||"center";return delete i.align,{type:e,attrs:Object.assign({textAlign:o,src:t,alt:s,title:n,class:a},i)}},Hr=function(e){return e},$r=function(e){return{comment:e}},qr=function(e,t){return{[e]:parseInt(t)}},Jr=function(e,t){return{type:"error",msg:e+" must be an positive integer.",found:t}},zr=function(e,t){return{[e]:t}},Wr=function(e){return{[e]:!0}},Yr=function(e){return[{type:"paragraph",content:e,attrs:{}}]},Xr=function(e,t){return e?[e,...t.flat()]:t.flat()},Qr=function(){return{type:"hardBreak"}},Zr=function(e){return{text:i(e),type:"text"}},ei=function(e){return{index:+e,type:"bit"}},ti=function(e,t){return t||(t=[]),{marks:t,text:i(e),type:"text"}},ri=function(e){return{marks:[{type:"bold"}],text:i(e),type:"text"}},ii=function(e){return{marks:[{type:"italic"}],text:i(e),type:"text"}},oi=function(e){return{marks:[{type:"light"}],text:i(e),type:"text"}},si=function(e){return{marks:[{type:"highlight"}],text:i(e),type:"text"}},ni=function(e){return{marks:[{type:"link",attrs:{href:(e.pr+e.t).trim(),target:"_blank"}}],text:e.t,type:"text"}},ai=function(e){return e},li=function(e){return{type:"link",attrs:{href:e.trim(),target:"_blank"}}},ui=function(e){return{type:"var",attrs:{name:e.trim()}}},ci=function(){return{type:"code",attrs:{language:"plain text"}}},di=function(e){return{type:"code",attrs:{language:e.trim().toLowerCase()}}},pi=function(e){return{type:"color",attrs:{color:e}}},hi=function(e){return{type:e}},yi=function(e){return{type:"comment",comment:e}},gi=function(e){return[{type:"paragraph",content:e,attrs:{}}]},fi=function(e,t){return e?[e,...t.flat()]:t.flat()},mi=function(e){return{text:i(e),type:"text"}},bi=function(e){return{index:+e,type:"bit"}},vi=function(e){return{marks:[{type:"bold"}],text:i(e),type:"text"}},Ti=function(e){return{marks:[{type:"italic"}],text:i(e),type:"text"}},Ai=function(e){return{marks:[{type:"light"}],text:i(e),type:"text"}},Pi=function(e){return{marks:[{type:"highlight"}],text:i(e),type:"text"}},_i=function(e,t){return{pr:e,t}},xi=0,wi=[{line:1,column:1}],Si=0,Oi=[],Ri=0;if("startRule"in t){if(!(t.startRule in u))throw new Error("Can't start parsing from rule \""+t.startRule+'".');c=u[t.startRule]}function ki(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ci(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Ei(e){return{type:"other",description:e}}function Ii(t){var r,i=wi[t];if(i)return i;for(r=t-1;!wi[r];)r--;for(i={line:(i=wi[r]).line,column:i.column};r<t;)10===e.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return wi[t]=i,i}function ji(e,t,r){var i=Ii(e),o=Ii(t),s={source:l,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:o.line,column:o.column}};return r&&l&&"function"==typeof l.offset&&(s.start=l.offset(s.start),s.end=l.offset(s.end)),s}function Bi(e){xi<Si||(xi>Si&&(Si=xi,Oi=[]),Oi.push(e))}function Li(e,t,r){return new n(n.buildMessage(e,t),e,t,r)}function Ni(){var e,t;if(Ri++,e=[],(t=Mi())!==a)for(;t!==a;)e.push(t),t=Mi();else e=a;return e===a&&(e=function(){var e,t;return e=xi,t="",e,t=br(),e=t,e}()),Ri--,e===a&&(t=a,0===Ri&&Bi(Ne)),e}function Mi(){var t,r;return t=xi,r=function(){var t,r,i,o,s;if(t=xi,r=Fi(),r!==a){for(i=xi,o=[],s=Ro();s!==a;)o.push(s),s=Ro();i=e.substring(i,xi),(o=ko())!==a?((s=Oo())===a&&(s=null),t,t=vr(r,i)):(xi=t,t=a)}else xi=t,t=a;return t}(),r!==a&&(t,r=hr(r)),(t=r)===a&&(t=xi,r=function(){var e,t,r,i;if(e=xi,t=function(){var e,t,r;e=xi,t=xi,Ri++,r=Hi(),Ri--,r!==a?(xi=t,t=void 0):t=a;t!==a&&(e,t=kr());return e=t,e}(),t!==a){if(r=[],(i=zi())!==a)for(;i!==a;)r.push(i),i=zi();else r=a;r!==a?((i=Oo())===a&&(i=null),e,e=Sr(t,r)):(xi=e,e=a)}else xi=e,e=a;if(e===a){if(e=xi,t=function(){var e,t,r;e=xi,t=xi,Ri++,r=$i(),Ri--,r!==a?(xi=t,t=void 0):t=a;t!==a&&(e,t=Cr());return e=t,e}(),t!==a){if(r=[],(i=zi())!==a)for(;i!==a;)r.push(i),i=zi();else r=a;r!==a?((i=Oo())===a&&(i=null),e,e=Or(t,r)):(xi=e,e=a)}else xi=e,e=a;if(e===a)if(e=xi,t=function(){var e,t,r;e=xi,t=xi,Ri++,r=qi(),Ri--,r!==a?(xi=t,t=void 0):t=a;t!==a&&(e,t=Er());return e=t,e}(),t!==a){if(r=[],(i=zi())!==a)for(;i!==a;)r.push(i),i=zi();else r=a;r!==a?((i=Oo())===a&&(i=null),e,e=Rr(t,r)):(xi=e,e=a)}else xi=e,e=a}return e}(),r!==a&&(t,r=yr(r)),(t=r)===a&&(t=xi,(r=to())!==a&&(t,r=gr(r)),(t=r)===a&&(t=xi,r=function(){var t,r,i;t=xi,r=Vi(),r!==a?(i=function(){var t,r,i,o;t=xi,r=xi,i=[],o=Gi();for(;o!==a;)i.push(o),o=Gi();return r=e.substring(r,xi),t,r=xr(r),t=r,t}(),t,t=Ar(r,i)):(xi=t,t=a);return t}(),r!==a&&(t,r=fr(r)),(t=r)===a&&(t=xi,r=function(){var e,t,r;e=xi,t=xi,Ri++,r=Ui(),Ri--,r===a?t=void 0:(xi=t,t=a);t!==a&&(r=Xi())!==a?(e,e=Kr(r)):(xi=e,e=a);e===a&&(e=xi,(t=Zi())!==a&&(r=Xi())!==a?(e,e=Fr(r)):(xi=e,e=a),e===a&&(e=xi,(t=Zi())!==a?(e,e=Dr(r="")):(xi=e,e=a)));return e}(),r!==a&&(t,r=mr(r)),t=r)))),t}function Ui(){var e;return(e=Fi())===a&&(e=Ji())===a&&(e=to())===a&&(e=Vi())===a&&(e=Zi()),e}function Ki(){var t;return 124===e.charCodeAt(xi)?(t=d,xi++):(t=a,0===Ri&&Bi(Me)),t}function Fi(){var t;return e.substr(xi,4)===h?(t=h,xi+=4):(t=a,0===Ri&&Bi(Ke)),t===a&&(e.substr(xi,3)===y?(t=y,xi+=3):(t=a,0===Ri&&Bi(Fe)),t===a&&(e.substr(xi,2)===g?(t=g,xi+=2):(t=a,0===Ri&&Bi(De)))),t}function Di(){var t,r;return t=xi,Ki()!==a?(r=function(){var t;return e.substr(xi,4)===f?(t=f,xi+=4):(t=a,0===Ri&&Bi(Ve)),t}(),r!==a?(t,t=Tr(r)):(xi=t,t=a)):(xi=t,t=a),t}function Vi(){var t,r,i,o,s,n,l;if(t=xi,Di()!==a){for(r=xi,i=xi,o=[],Ie.test(e.charAt(xi))?(s=e.charAt(xi),xi++):(s=a,0===Ri&&Bi(Ge));s!==a;)o.push(s),Ie.test(e.charAt(xi))?(s=e.charAt(xi),xi++):(s=a,0===Ri&&Bi(Ge));(s=ko())!==a?i=o=[o,s]:(xi=i,i=a),(r=i!==a?e.substring(r,xi):i)!==a?(t,t=Pr()):(xi=t,t=a)}else xi=t,t=a;if(t===a)if(t=xi,Di()!==a)if(58===e.charCodeAt(xi)?(r=p,xi++):(r=a,0===Ri&&Bi(Ue)),r!==a)if(i=function(){var t,r,i;e.substr(xi,9)===m?(t=m,xi+=9):(t=a,0===Ri&&Bi(He));if(t===a&&(e.substr(xi,9)===b?(t=b,xi+=9):(t=a,0===Ri&&Bi($e)),t===a&&(e.substr(xi,10)===v?(t=v,xi+=10):(t=a,0===Ri&&Bi(qe)),t===a))){if(t=xi,r=[],(i=Ro())!==a)for(;i!==a;)r.push(i),i=Ro();else r=a;(t=r!==a?e.substring(t,xi):r)===a&&(t="")}return t}(),i!==a){for(o=xi,s=xi,n=[],Ie.test(e.charAt(xi))?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Ge));l!==a;)n.push(l),Ie.test(e.charAt(xi))?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Ge));(l=ko())!==a?s=n=[n,l]:(xi=s,s=a),(o=s!==a?e.substring(o,xi):s)!==a?(t,t=_r(i)):(xi=t,t=a)}else xi=t,t=a;else xi=t,t=a;else xi=t,t=a;return t}function Gi(){var t,r,i,o,s,n;if(t=xi,r=xi,Ri++,i=Ui(),Ri--,i===a?r=void 0:(xi=r,r=a),r!==a){if(i=xi,o=xi,s=[],(n=Ro())!==a)for(;n!==a;)s.push(n),n=Ro();else s=a;s!==a&&(n=ko())!==a?o=s=[s,n]:(xi=o,o=a),(i=o!==a?e.substring(i,xi):o)!==a?(t,t=wr(i)):(xi=t,t=a)}else xi=t,t=a;return t===a&&(t=Oo()),t}function Hi(){var t;return e.substr(xi,2)===T?(t=T,xi+=2):(t=a,0===Ri&&Bi(Je)),t}function $i(){var t;return e.substr(xi,3)===A?(t=A,xi+=3):(t=a,0===Ri&&Bi(ze)),t}function qi(){var t;return e.substr(xi,3)===P?(t=P,xi+=3):(t=a,0===Ri&&Bi(We)),t===a&&(e.substr(xi,3)===_?(t=_,xi+=3):(t=a,0===Ri&&Bi(Ye))),t}function Ji(){var e;return(e=Hi())===a&&(e=$i())===a&&(e=qi()),e}function zi(){var t,r,i,o,s,n,l,u;if(t=xi,Yi()!==a)if((r=Ji())!==a){for(i=xi,o=xi,s=[],n=xi,l=xi,Ri++,u=Oo(),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);n!==a;)s.push(n),n=xi,l=xi,Ri++,u=Oo(),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);for((n=Oo())===a&&(n=null),o=s=[s,n],i=e.substring(i,xi),o=[],s=Wi();s!==a;)o.push(s),s=Wi();if(s=xi,n=function(){var t,r,i,o;t=xi,Ri++,r=xi,i=[],9===e.charCodeAt(xi)?(o=x,xi++):(o=a,0===Ri&&Bi(Qe));if(o!==a)for(;o!==a;)i.push(o),9===e.charCodeAt(xi)?(o=x,xi++):(o=a,0===Ri&&Bi(Qe));else i=a;i!==a?(xi,(o=(o=Nr(i))?void 0:a)!==a?(r,r=Mr(i)):(xi=r,r=a)):(xi=r,r=a);Ri--,r!==a?(xi=t,t=void 0):t=a;return t}(),n!==a){for(l=[],u=zi();u!==a;)l.push(u),u=zi();u=function(){var e;xi,e=Ur(),e=e?void 0:a;return e}(),u!==a?(s,s=Ir(r,i,o,l)):(xi=s,s=a)}else xi=s,s=a;s===a&&(s=null),t,t=jr(r,i,o,s)}else xi=t,t=a;else xi=t,t=a;return t}function Wi(){var t,r,i,o,s,n,l,u,c,d;if(t=xi,r=xi,Ri++,i=function(){var t,r,i;t=xi,r=[],Ie.test(e.charAt(xi))?(i=e.charAt(xi),xi++):(i=a,0===Ri&&Bi(Ge));for(;i!==a;)r.push(i),Ie.test(e.charAt(xi))?(i=e.charAt(xi),xi++):(i=a,0===Ri&&Bi(Ge));i=Oo(),i!==a?t=r=[r,i]:(xi=t,t=a);return t}(),Ri--,i===a?r=void 0:(xi=r,r=a),r!==a)if((i=Yi())!==a)if(o=xi,Ri++,s=Ji(),Ri--,s===a?o=void 0:(xi=o,o=a),o!==a){if(s=xi,n=xi,l=[],u=xi,c=xi,Ri++,d=Oo(),Ri--,d===a?c=void 0:(xi=c,c=a),c!==a?(e.length>xi?(d=e.charAt(xi),xi++):(d=a,0===Ri&&Bi(Xe)),d!==a?u=c=[c,d]:(xi=u,u=a)):(xi=u,u=a),u!==a)for(;u!==a;)l.push(u),u=xi,c=xi,Ri++,d=Oo(),Ri--,d===a?c=void 0:(xi=c,c=a),c!==a?(e.length>xi?(d=e.charAt(xi),xi++):(d=a,0===Ri&&Bi(Xe)),d!==a?u=c=[c,d]:(xi=u,u=a)):(xi=u,u=a);else l=a;l!==a&&(u=ko())!==a?n=l=[l,u]:(xi=n,n=a),(s=n!==a?e.substring(s,xi):n)!==a?(t,t=Br(s)):(xi=t,t=a)}else xi=t,t=a;else xi=t,t=a;else xi=t,t=a;return t}function Yi(){var t,r,i;for(t=xi,r=[],9===e.charCodeAt(xi)?(i=x,xi++):(i=a,0===Ri&&Bi(Qe));i!==a;)r.push(i),9===e.charCodeAt(xi)?(i=x,xi++):(i=a,0===Ri&&Bi(Qe));return xi,(i=(i=Lr(r))?void 0:a)!==a?t=r=[r,i]:(xi=t,t=a),t}function Xi(){var t,r,i;if(t=xi,r=[],(i=Qi())!==a)for(;i!==a;)r.push(i),i=Qi();else r=a;return t=r!==a?e.substring(t,xi):r}function Qi(){var t,r,i,o,s,n;if(t=xi,r=xi,Ri++,i=Ui(),Ri--,i===a?r=void 0:(xi=r,r=a),r!==a){if(i=xi,o=xi,s=[],(n=Ro())!==a)for(;n!==a;)s.push(n),n=Ro();else s=a;s!==a&&(n=ko())!==a?o=s=[s,n]:(xi=o,o=a),(i=o!==a?e.substring(i,xi):o)!==a?t=r=[r,i]:(xi=t,t=a)}else xi=t,t=a;return t===a&&(t=Oo()),t}function Zi(){var t,r,i,o,s,n;if(t=xi,(r=Ki())!==a){for(i=xi,o=xi,s=[],Ie.test(e.charAt(xi))?(n=e.charAt(xi),xi++):(n=a,0===Ri&&Bi(Ge));n!==a;)s.push(n),Ie.test(e.charAt(xi))?(n=e.charAt(xi),xi++):(n=a,0===Ri&&Bi(Ge));(n=ko())!==a?o=s=[s,n]:(xi=o,o=a),(i=o!==a?e.substring(i,xi):o)!==a?((o=Oo())===a&&(o=null),t=r=[r,i,o]):(xi=t,t=a)}else xi=t,t=a;return t}function eo(){var t,r;return t=xi,Ki()!==a?(r=function(){var t;return e.substr(xi,5)===w?(t=w,xi+=5):(t=a,0===Ri&&Bi(Ze)),t}(),r!==a?(t,t=Vr(r)):(xi=t,t=a)):(xi=t,t=a),t}function to(){var t,r,i,o,s,n,l,u,c,d;if(t=xi,(r=eo())!==a)if(58===e.charCodeAt(xi)?(i=p,xi++):(i=a,0===Ri&&Bi(Ue)),i!==a)if(32===e.charCodeAt(xi)?(o=S,xi++):(o=a,0===Ri&&Bi(et)),o===a&&(o=null),s=function(){var t,r,i,o,s,n,l,u,c;t=xi,r=xi,e.substr(xi,4)===we?(i=we,xi+=4):(i=a,0===Ri&&Bi(sr));if(i!==a)if(115===e.charCodeAt(xi)?(o=Se,xi++):(o=a,0===Ri&&Bi(nr)),o===a&&(o=null),e.substr(xi,3)===Oe?(s=Oe,xi+=3):(s=a,0===Ri&&Bi(ar)),s!==a){for(n=[],l=xi,u=xi,Ri++,c=Ki(),Ri--,c===a?u=void 0:(xi=u,u=a),u!==a&&(c=Co())!==a?l=u=[u,c]:(xi=l,l=a);l!==a;)n.push(l),l=xi,u=xi,Ri++,c=Ki(),Ri--,c===a?u=void 0:(xi=u,u=a),u!==a&&(c=Co())!==a?l=u=[u,c]:(xi=l,l=a);r=i=[i,o,s,n]}else xi=r,r=a;else xi=r,r=a;t=r!==a?e.substring(t,xi):r;return t}(),s!==a)if(Ki()!==a){for(n=function(){var e,t,r;e=xi,t=[],r=ro();for(;r!==a;)t.push(r),r=ro();return e,t=Hr(t),e=t,e}(),l=xi,u=xi,c=[],Ie.test(e.charAt(xi))?(d=e.charAt(xi),xi++):(d=a,0===Ri&&Bi(Ge));d!==a;)c.push(d),Ie.test(e.charAt(xi))?(d=e.charAt(xi),xi++):(d=a,0===Ri&&Bi(Ge));(d=ko())!==a?u=c=[c,d]:(xi=u,u=a),(l=u!==a?e.substring(l,xi):u)!==a?((u=Oo())===a&&(u=null),t,t=Gr(r,s,n)):(xi=t,t=a)}else xi=t,t=a;else xi=t,t=a;else xi=t,t=a;else xi=t,t=a;return t}function ro(){var t,r,i,o,s,n,l,u,c,d;if(t=xi,35===e.charCodeAt(xi)?(r=O,xi++):(r=a,0===Ri&&Bi(tt)),r!==a){for(i=xi,o=[],s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);i=e.substring(i,xi),(o=Ki())!==a?(t,t=$r(i)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,64===e.charCodeAt(xi)?(r=R,xi++):(r=a,0===Ri&&Bi(rt)),r===a&&(r=null),(i=io())!==a)if(58===e.charCodeAt(xi)?(o=p,xi++):(o=a,0===Ri&&Bi(Ue)),o!==a){for(s=[],32===e.charCodeAt(xi)?(n=S,xi++):(n=a,0===Ri&&Bi(et));n!==a;)s.push(n),32===e.charCodeAt(xi)?(n=S,xi++):(n=a,0===Ri&&Bi(et));if(n=xi,l=[],u=xi,c=xi,Ri++,d=Ki(),Ri--,d===a?c=void 0:(xi=c,c=a),c!==a?(je.test(e.charAt(xi))?(d=e.charAt(xi),xi++):(d=a,0===Ri&&Bi(it)),d!==a?u=c=[c,d]:(xi=u,u=a)):(xi=u,u=a),u!==a)for(;u!==a;)l.push(u),u=xi,c=xi,Ri++,d=Ki(),Ri--,d===a?c=void 0:(xi=c,c=a),c!==a?(je.test(e.charAt(xi))?(d=e.charAt(xi),xi++):(d=a,0===Ri&&Bi(it)),d!==a?u=c=[c,d]:(xi=u,u=a)):(xi=u,u=a);else l=a;(n=l!==a?e.substring(n,xi):l)!==a&&(l=Ki())!==a?(t,t=qr(i,n)):(xi=t,t=a)}else xi=t,t=a;else xi=t,t=a;if(t===a){if(t=xi,64===e.charCodeAt(xi)?(r=R,xi++):(r=a,0===Ri&&Bi(rt)),r===a&&(r=null),(i=io())!==a)if(58===e.charCodeAt(xi)?(o=p,xi++):(o=a,0===Ri&&Bi(Ue)),o!==a){for(s=[],32===e.charCodeAt(xi)?(n=S,xi++):(n=a,0===Ri&&Bi(et));n!==a;)s.push(n),32===e.charCodeAt(xi)?(n=S,xi++):(n=a,0===Ri&&Bi(et));for(n=xi,l=[],u=xi,c=xi,Ri++,d=Ki(),Ri--,d===a?c=void 0:(xi=c,c=a),c!==a&&(d=Ro())!==a?u=c=[c,d]:(xi=u,u=a);u!==a;)l.push(u),u=xi,c=xi,Ri++,d=Ki(),Ri--,d===a?c=void 0:(xi=c,c=a),c!==a&&(d=Ro())!==a?u=c=[c,d]:(xi=u,u=a);n=e.substring(n,xi),(l=Ki())!==a?(t,t=Jr(i,n)):(xi=t,t=a)}else xi=t,t=a;else xi=t,t=a;if(t===a){for(t=xi,64===e.charCodeAt(xi)?(r=R,xi++):(r=a,0===Ri&&Bi(rt)),r===a&&(r=null),i=xi,o=[],s=xi,n=xi,Ri++,(l=Ki())===a&&(58===e.charCodeAt(xi)?(l=p,xi++):(l=a,0===Ri&&Bi(Ue))),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,(l=Ki())===a&&(58===e.charCodeAt(xi)?(l=p,xi++):(l=a,0===Ri&&Bi(Ue))),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);if(i=e.substring(i,xi),58===e.charCodeAt(xi)?(o=p,xi++):(o=a,0===Ri&&Bi(Ue)),o!==a){for(32===e.charCodeAt(xi)?(s=S,xi++):(s=a,0===Ri&&Bi(et)),s===a&&(s=null),n=xi,l=[],u=xi,c=xi,Ri++,d=Ki(),Ri--,d===a?c=void 0:(xi=c,c=a),c!==a&&(d=Ro())!==a?u=c=[c,d]:(xi=u,u=a);u!==a;)l.push(u),u=xi,c=xi,Ri++,d=Ki(),Ri--,d===a?c=void 0:(xi=c,c=a),c!==a&&(d=Ro())!==a?u=c=[c,d]:(xi=u,u=a);n=e.substring(n,xi),(l=Ki())!==a?(t,t=zr(i,n)):(xi=t,t=a)}else xi=t,t=a;if(t===a){for(t=xi,64===e.charCodeAt(xi)?(r=R,xi++):(r=a,0===Ri&&Bi(rt)),r===a&&(r=null),i=xi,o=[],s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);i=e.substring(i,xi),(o=Ki())!==a?(t,t=Wr(i)):(xi=t,t=a)}}}}return t}function io(){var t;return e.substr(xi,5)===k?(t=k,xi+=5):(t=a,0===Ri&&Bi(ot)),t===a&&(e.substr(xi,6)===C?(t=C,xi+=6):(t=a,0===Ri&&Bi(st))),t}function oo(){var e,t,r,i;for(e=xi,(t=so())===a&&(t=null),r=[],(i=uo())===a&&(i=so());i!==a;)r.push(i),(i=uo())===a&&(i=so());return e,e=Xr(t,r)}function so(){var t,r,i,o,s,n,l;if(t=xi,(r=Oo())!==a&&(t,r=Qr()),(t=r)===a){if(t=xi,r=xi,i=[],o=xi,(s=co())===a&&(s=null),n=xi,Ri++,l=uo(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?o=s=[s,n,l]:(xi=o,o=a),o===a&&(o=xi,(s=co())!==a?(n=xi,Ri++,l=uo(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?o=s=[s,n]:(xi=o,o=a)):(xi=o,o=a)),o!==a)for(;o!==a;)i.push(o),o=xi,(s=co())===a&&(s=null),n=xi,Ri++,l=uo(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?o=s=[s,n,l]:(xi=o,o=a),o===a&&(o=xi,(s=co())!==a?(n=xi,Ri++,l=uo(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?o=s=[s,n]:(xi=o,o=a)):(xi=o,o=a));else i=a;(r=i!==a?e.substring(r,xi):i)!==a&&(t,r=Zr(r)),t=r}return t}function no(){var t;return 61===e.charCodeAt(xi)?(t=E,xi++):(t=a,0===Ri&&Bi(at)),t}function ao(){var t;return e.substr(xi,2)===I?(t=I,xi+=2):(t=a,0===Ri&&Bi(lt)),t}function lo(){var e,t,r;return e=xi,(t=no())!==a&&(r=no())!==a?e=t=[t,r]:(xi=e,e=a),e}function uo(){var t,r,i,o,s,n,l,u,c,p;if(t=xi,(r=_o())!==a){if(i=xi,o=[],je.test(e.charAt(xi))?(s=e.charAt(xi),xi++):(s=a,0===Ri&&Bi(it)),s!==a)for(;s!==a;)o.push(s),je.test(e.charAt(xi))?(s=e.charAt(xi),xi++):(s=a,0===Ri&&Bi(it));else o=a;(i=o!==a?e.substring(i,xi):o)!==a&&(o=xo())!==a?(t,t=ei(i)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,(r=lo())!==a){for(32===e.charCodeAt(xi)?(i=S,xi++):(i=a,0===Ri&&Bi(et)),i===a&&(i=null),o=xi,s=[],n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=lo())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);n!==a;)s.push(n),n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=lo())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);o=e.substring(o,xi),32===e.charCodeAt(xi)?(s=S,xi++):(s=a,0===Ri&&Bi(et)),s===a&&(s=null),(n=lo())!==a?(l=function(){var t,r,i,o;t=xi,124===e.charCodeAt(xi)?(r=d,xi++):(r=a,0===Ri&&Bi(Me));if(r!==a){for(i=[],o=po();o!==a;)i.push(o),o=po();t,t=ai(i)}else xi=t,t=a;return t}(),l===a&&(l=null),t,t=ti(o,l)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,(r=vo())!==a){for(32===e.charCodeAt(xi)?(i=S,xi++):(i=a,0===Ri&&Bi(et)),i===a&&(i=null),o=xi,s=[],n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=vo())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);n!==a;)s.push(n),n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=vo())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);o=e.substring(o,xi),32===e.charCodeAt(xi)?(s=S,xi++):(s=a,0===Ri&&Bi(et)),s===a&&(s=null),(n=vo())!==a?(t,t=ri(o)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,(r=To())!==a){for(32===e.charCodeAt(xi)?(i=S,xi++):(i=a,0===Ri&&Bi(et)),i===a&&(i=null),o=xi,s=[],n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=To())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);n!==a;)s.push(n),n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=To())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);o=e.substring(o,xi),32===e.charCodeAt(xi)?(s=S,xi++):(s=a,0===Ri&&Bi(et)),s===a&&(s=null),(n=To())!==a?(t,t=ii(o)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,(r=Ao())!==a){for(32===e.charCodeAt(xi)?(i=S,xi++):(i=a,0===Ri&&Bi(et)),i===a&&(i=null),o=xi,s=[],n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=Ao())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);n!==a;)s.push(n),n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=Ao())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);o=e.substring(o,xi),32===e.charCodeAt(xi)?(s=S,xi++):(s=a,0===Ri&&Bi(et)),s===a&&(s=null),(n=Ao())!==a?(t,t=oi(o)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,(r=Po())!==a){for(32===e.charCodeAt(xi)?(i=S,xi++):(i=a,0===Ri&&Bi(et)),i===a&&(i=null),o=xi,s=[],n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=Po())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);n!==a;)s.push(n),n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=Po())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);o=e.substring(o,xi),32===e.charCodeAt(xi)?(s=S,xi++):(s=a,0===Ri&&Bi(et)),s===a&&(s=null),(n=Po())!==a?(t,t=si(o)):(xi=t,t=a)}else xi=t,t=a;t===a&&(t=xi,r=function(){var t,r,i,o,s,n,l;t=xi,r=xi,i=xi,e.substr(xi,4)===we?(o=we,xi+=4):(o=a,0===Ri&&Bi(sr));o!==a?(115===e.charCodeAt(xi)?(s=Se,xi++):(s=a,0===Ri&&Bi(nr)),s===a&&(s=null),e.substr(xi,3)===Oe?(n=Oe,xi+=3):(n=a,0===Ri&&Bi(ar)),n!==a?i=o=[o,s,n]:(xi=i,i=a)):(xi=i,i=a);i===a&&(e.substr(xi,7)===Re?(i=Re,xi+=7):(i=a,0===Ri&&Bi(lr)));r=i!==a?e.substring(r,xi):i;if(r!==a){for(i=xi,o=[],s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Co())!==a?s=n=[n,l]:(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Co())!==a?s=n=[n,l]:(xi=s,s=a);i=e.substring(i,xi),t,t=_i(r,i)}else xi=t,t=a;return t}(),r!==a&&(t,r=ni(r)),t=r)}}}}}return t}function co(){var t,r,i,o,s;if(t=xi,r=xi,(i=lo())!==a){if(o=[],(s=no())!==a)for(;s!==a;)o.push(s),s=no();else o=a;o!==a?r=i=[i,o]:(xi=r,r=a)}else xi=r,r=a;if((t=r!==a?e.substring(t,xi):r)===a){if(t=xi,r=xi,i=function(){var e,t,r;return e=xi,(t=ao())!==a&&(r=ao())!==a?e=t=[t,r]:(xi=e,e=a),e}(),i!==a){if(o=[],(s=ao())!==a)for(;s!==a;)o.push(s),s=ao();else o=a;o!==a?r=i=[i,o]:(xi=r,r=a)}else xi=r,r=a;if((t=r!==a?e.substring(t,xi):r)===a){if(t=xi,r=xi,(i=Ao())!==a){if(o=[],(s=mo())!==a)for(;s!==a;)o.push(s),s=mo();else o=a;o!==a?r=i=[i,o]:(xi=r,r=a)}else xi=r,r=a;if((t=r!==a?e.substring(t,xi):r)===a){if(t=xi,r=xi,(i=Po())!==a){if(o=[],(s=bo())!==a)for(;s!==a;)o.push(s),s=bo();else o=a;o!==a?r=i=[i,o]:(xi=r,r=a)}else xi=r,r=a;t=r!==a?e.substring(t,xi):r}}}return t}function po(){var t,r,i,o,s,n,l;if(t=xi,e.substr(xi,5)===j?(r=j,xi+=5):(r=a,0===Ri&&Bi(ut)),r!==a){for(i=xi,o=[],s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);i=e.substring(i,xi),(o=Ki())!==a?(t,t=li(i)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,e.substr(xi,4)===B?(r=B,xi+=4):(r=a,0===Ri&&Bi(ct)),r!==a){for(i=xi,o=[],s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);i=e.substring(i,xi),(o=Ki())!==a?(t,t=ui(i)):(xi=t,t=a)}else xi=t,t=a;if(t===a&&(t=xi,e.substr(xi,4)===f?(r=f,xi+=4):(r=a,0===Ri&&Bi(Ve)),r!==a&&(i=Ki())!==a?(t,t=ci()):(xi=t,t=a),t===a)){if(t=xi,e.substr(xi,5)===L?(r=L,xi+=5):(r=a,0===Ri&&Bi(dt)),r!==a){for(i=xi,o=[],s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);i=e.substring(i,xi),(o=Ki())!==a?(t,t=di(i)):(xi=t,t=a)}else xi=t,t=a;if(t===a&&(t=xi,e.substr(xi,6)===N?(r=N,xi+=6):(r=a,0===Ri&&Bi(pt)),r!==a?(i=function(){var t;e.substr(xi,4)===q?(t=q,xi+=4):(t=a,0===Ri&&Bi(Pt));t===a&&(e.substr(xi,5)===J?(t=J,xi+=5):(t=a,0===Ri&&Bi(_t)),t===a&&(e.substr(xi,4)===z?(t=z,xi+=4):(t=a,0===Ri&&Bi(xt)),t===a&&(e.substr(xi,4)===W?(t=W,xi+=4):(t=a,0===Ri&&Bi(wt)),t===a&&(e.substr(xi,7)===Y?(t=Y,xi+=7):(t=a,0===Ri&&Bi(St)),t===a&&(e.substr(xi,9)===X?(t=X,xi+=9):(t=a,0===Ri&&Bi(Ot)),t===a&&(e.substr(xi,4)===Q?(t=Q,xi+=4):(t=a,0===Ri&&Bi(Rt)),t===a&&(e.substr(xi,8)===Z?(t=Z,xi+=8):(t=a,0===Ri&&Bi(kt)),t===a&&(e.substr(xi,5)===ee?(t=ee,xi+=5):(t=a,0===Ri&&Bi(Ct)),t===a&&(e.substr(xi,4)===te?(t=te,xi+=4):(t=a,0===Ri&&Bi(Et)),t===a&&(e.substr(xi,7)===re?(t=re,xi+=7):(t=a,0===Ri&&Bi(It)),t===a&&(e.substr(xi,6)===ie?(t=ie,xi+=6):(t=a,0===Ri&&Bi(jt)),t===a&&(e.substr(xi,4)===oe?(t=oe,xi+=4):(t=a,0===Ri&&Bi(Bt)),t===a&&(e.substr(xi,5)===se?(t=se,xi+=5):(t=a,0===Ri&&Bi(Lt)),t===a&&(e.substr(xi,6)===ne?(t=ne,xi+=6):(t=a,0===Ri&&Bi(Nt)),t===a&&(e.substr(xi,6)===ae?(t=ae,xi+=6):(t=a,0===Ri&&Bi(Mt)),t===a&&(e.substr(xi,3)===le?(t=le,xi+=3):(t=a,0===Ri&&Bi(Ut)),t===a&&(e.substr(xi,6)===ue?(t=ue,xi+=6):(t=a,0===Ri&&Bi(Kt)),t===a&&(e.substr(xi,4)===ce?(t=ce,xi+=4):(t=a,0===Ri&&Bi(Ft)),t===a&&(e.substr(xi,6)===de?(t=de,xi+=6):(t=a,0===Ri&&Bi(Dt)),t===a&&(e.substr(xi,5)===pe?(t=pe,xi+=5):(t=a,0===Ri&&Bi(Vt)),t===a&&(e.substr(xi,6)===he?(t=he,xi+=6):(t=a,0===Ri&&Bi(Gt)))))))))))))))))))))));return t}(),i!==a&&(o=Ki())!==a?(t,t=pi(i)):(xi=t,t=a)):(xi=t,t=a),t===a&&(t=xi,r=function(){var t;e.substr(xi,4)===M?(t=M,xi+=4):(t=a,0===Ri&&Bi(ht));t===a&&(e.substr(xi,6)===U?(t=U,xi+=6):(t=a,0===Ri&&Bi(yt)),t===a&&(e.substr(xi,5)===K?(t=K,xi+=5):(t=a,0===Ri&&Bi(gt)),t===a&&(e.substr(xi,9)===F?(t=F,xi+=9):(t=a,0===Ri&&Bi(ft)),t===a&&(e.substr(xi,6)===D?(t=D,xi+=6):(t=a,0===Ri&&Bi(mt)),t===a&&(e.substr(xi,3)===V?(t=V,xi+=3):(t=a,0===Ri&&Bi(bt)),t===a&&(e.substr(xi,5)===G?(t=G,xi+=5):(t=a,0===Ri&&Bi(vt)),t===a&&(e.substr(xi,3)===H?(t=H,xi+=3):(t=a,0===Ri&&Bi(Tt)),t===a&&(e.substr(xi,3)===$?(t=$,xi+=3):(t=a,0===Ri&&Bi(At))))))))));return t}(),r!==a&&(i=Ki())!==a?(t,t=hi(r)):(xi=t,t=a),t===a)))if(t=xi,35===e.charCodeAt(xi)?(r=O,xi++):(r=a,0===Ri&&Bi(tt)),r!==a){for(i=xi,o=[],s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);i=e.substring(i,xi),(o=Ki())!==a?(t,t=yi(i)):(xi=t,t=a)}else xi=t,t=a}}return t}function ho(){var e,t,r,i;for(Ri++,e=xi,(t=yo())===a&&(t=null),r=[],(i=wo())===a&&(i=yo());i!==a;)r.push(i),(i=wo())===a&&(i=yo());return e,e=fi(t,r),Ri--,t=a,0===Ri&&Bi($t),e}function yo(){var t,r,i,o,s,n,l;if(t=xi,r=xi,i=[],o=xi,(s=So())===a&&(s=null),n=xi,Ri++,l=wo(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?o=s=[s,n,l]:(xi=o,o=a)):(xi=o,o=a),o!==a)for(;o!==a;)i.push(o),o=xi,(s=So())===a&&(s=null),n=xi,Ri++,l=wo(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?o=s=[s,n,l]:(xi=o,o=a)):(xi=o,o=a);else i=a;return(r=i!==a?e.substring(r,xi):i)!==a&&(t,r=mi(r)),(t=r)===a&&(t=Oo()),t}function go(){var t;return 42===e.charCodeAt(xi)?(t=ye,xi++):(t=a,0===Ri&&Bi(qt)),t}function fo(){var t;return 95===e.charCodeAt(xi)?(t=ge,xi++):(t=a,0===Ri&&Bi(Jt)),t}function mo(){var t;return 96===e.charCodeAt(xi)?(t=fe,xi++):(t=a,0===Ri&&Bi(zt)),t}function bo(){var t;return 33===e.charCodeAt(xi)?(t=me,xi++):(t=a,0===Ri&&Bi(Wt)),t}function vo(){var e,t,r;return e=xi,(t=go())!==a&&(r=go())!==a?e=t=[t,r]:(xi=e,e=a),e}function To(){var e,t,r;return e=xi,(t=fo())!==a&&(r=fo())!==a?e=t=[t,r]:(xi=e,e=a),e}function Ao(){var e,t,r;return e=xi,(t=mo())!==a&&(r=mo())!==a?e=t=[t,r]:(xi=e,e=a),e}function Po(){var e,t,r;return e=xi,(t=bo())!==a&&(r=bo())!==a?e=t=[t,r]:(xi=e,e=a),e}function _o(){var t;return e.substr(xi,2)===be?(t=be,xi+=2):(t=a,0===Ri&&Bi(Yt)),t}function xo(){var t;return 93===e.charCodeAt(xi)?(t=ve,xi++):(t=a,0===Ri&&Bi(Xt)),t}function wo(){var t,r,i,o,s,n,l,u,c;if(t=xi,_o()!==a){if(r=xi,i=[],je.test(e.charAt(xi))?(o=e.charAt(xi),xi++):(o=a,0===Ri&&Bi(it)),o!==a)for(;o!==a;)i.push(o),je.test(e.charAt(xi))?(o=e.charAt(xi),xi++):(o=a,0===Ri&&Bi(it));else i=a;(r=i!==a?e.substring(r,xi):i)!==a&&(i=xo())!==a?(t,t=bi(r)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,vo()!==a){for(32===e.charCodeAt(xi)?(r=S,xi++):(r=a,0===Ri&&Bi(et)),r===a&&(r=null),i=xi,o=[],s=xi,n=xi,Ri++,l=xi,32===e.charCodeAt(xi)?(u=S,xi++):(u=a,0===Ri&&Bi(et)),u===a&&(u=null),(c=vo())!==a?l=u=[u,c]:(xi=l,l=a),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?s=n=[n,l]:(xi=s,s=a)):(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=xi,32===e.charCodeAt(xi)?(u=S,xi++):(u=a,0===Ri&&Bi(et)),u===a&&(u=null),(c=vo())!==a?l=u=[u,c]:(xi=l,l=a),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?s=n=[n,l]:(xi=s,s=a)):(xi=s,s=a);i=e.substring(i,xi),32===e.charCodeAt(xi)?(o=S,xi++):(o=a,0===Ri&&Bi(et)),o===a&&(o=null),(s=vo())!==a?(t,t=vi(i)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,To()!==a){for(32===e.charCodeAt(xi)?(r=S,xi++):(r=a,0===Ri&&Bi(et)),r===a&&(r=null),i=xi,o=[],s=xi,n=xi,Ri++,l=xi,32===e.charCodeAt(xi)?(u=S,xi++):(u=a,0===Ri&&Bi(et)),u===a&&(u=null),(c=To())!==a?l=u=[u,c]:(xi=l,l=a),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?s=n=[n,l]:(xi=s,s=a)):(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=xi,32===e.charCodeAt(xi)?(u=S,xi++):(u=a,0===Ri&&Bi(et)),u===a&&(u=null),(c=To())!==a?l=u=[u,c]:(xi=l,l=a),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?s=n=[n,l]:(xi=s,s=a)):(xi=s,s=a);i=e.substring(i,xi),32===e.charCodeAt(xi)?(o=S,xi++):(o=a,0===Ri&&Bi(et)),o===a&&(o=null),(s=To())!==a?(t,t=Ti(i)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,Ao()!==a){for(32===e.charCodeAt(xi)?(r=S,xi++):(r=a,0===Ri&&Bi(et)),r===a&&(r=null),i=xi,o=[],s=xi,n=xi,Ri++,l=xi,32===e.charCodeAt(xi)?(u=S,xi++):(u=a,0===Ri&&Bi(et)),u===a&&(u=null),(c=Ao())!==a?l=u=[u,c]:(xi=l,l=a),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?s=n=[n,l]:(xi=s,s=a)):(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=xi,32===e.charCodeAt(xi)?(u=S,xi++):(u=a,0===Ri&&Bi(et)),u===a&&(u=null),(c=Ao())!==a?l=u=[u,c]:(xi=l,l=a),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?s=n=[n,l]:(xi=s,s=a)):(xi=s,s=a);i=e.substring(i,xi),32===e.charCodeAt(xi)?(o=S,xi++):(o=a,0===Ri&&Bi(et)),o===a&&(o=null),(s=Ao())!==a?(t,t=Ai(i)):(xi=t,t=a)}else xi=t,t=a;if(t===a)if(t=xi,Po()!==a){for(32===e.charCodeAt(xi)?(r=S,xi++):(r=a,0===Ri&&Bi(et)),r===a&&(r=null),i=xi,o=[],s=xi,n=xi,Ri++,l=xi,32===e.charCodeAt(xi)?(u=S,xi++):(u=a,0===Ri&&Bi(et)),u===a&&(u=null),(c=Po())!==a?l=u=[u,c]:(xi=l,l=a),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?s=n=[n,l]:(xi=s,s=a)):(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=xi,32===e.charCodeAt(xi)?(u=S,xi++):(u=a,0===Ri&&Bi(et)),u===a&&(u=null),(c=Po())!==a?l=u=[u,c]:(xi=l,l=a),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?s=n=[n,l]:(xi=s,s=a)):(xi=s,s=a);i=e.substring(i,xi),32===e.charCodeAt(xi)?(o=S,xi++):(o=a,0===Ri&&Bi(et)),o===a&&(o=null),(s=Po())!==a?(t,t=Pi(i)):(xi=t,t=a)}else xi=t,t=a}}}return t}function So(){var t,r,i,o,s;if(t=xi,r=xi,(i=vo())!==a){if(o=[],(s=go())!==a)for(;s!==a;)o.push(s),s=go();else o=a;o!==a?r=i=[i,o]:(xi=r,r=a)}else xi=r,r=a;if((t=r!==a?e.substring(t,xi):r)===a){if(t=xi,r=xi,(i=To())!==a){if(o=[],(s=fo())!==a)for(;s!==a;)o.push(s),s=fo();else o=a;o!==a?r=i=[i,o]:(xi=r,r=a)}else xi=r,r=a;if((t=r!==a?e.substring(t,xi):r)===a){if(t=xi,r=xi,(i=Ao())!==a){if(o=[],(s=mo())!==a)for(;s!==a;)o.push(s),s=mo();else o=a;o!==a?r=i=[i,o]:(xi=r,r=a)}else xi=r,r=a;if((t=r!==a?e.substring(t,xi):r)===a){if(t=xi,r=xi,(i=Po())!==a){if(o=[],(s=bo())!==a)for(;s!==a;)o.push(s),s=bo();else o=a;o!==a?r=i=[i,o]:(xi=r,r=a)}else xi=r,r=a;t=r!==a?e.substring(t,xi):r}}}return t}function Oo(){var t;return Ri++,10===e.charCodeAt(xi)?(t=Te,xi++):(t=a,0===Ri&&Bi(Zt)),t===a&&(e.substr(xi,2)===Ae?(t=Ae,xi+=2):(t=a,0===Ri&&Bi(er)),t===a&&(13===e.charCodeAt(xi)?(t=Pe,xi++):(t=a,0===Ri&&Bi(tr)),t===a&&(8232===e.charCodeAt(xi)?(t=_e,xi++):(t=a,0===Ri&&Bi(rr)),t===a&&(8233===e.charCodeAt(xi)?(t=xe,xi++):(t=a,0===Ri&&Bi(ir)))))),Ri--,t===a&&(a,0===Ri&&Bi(Qt)),t}function Ro(){var t;return Be.test(e.charAt(xi))?(t=e.charAt(xi),xi++):(t=a,0===Ri&&Bi(or)),t}function ko(){var t,r;return(t=Oo())===a&&(t=xi,Ri++,e.length>xi?(r=e.charAt(xi),xi++):(r=a,0===Ri&&Bi(Xe)),Ri--,r===a?t=void 0:(xi=t,t=a)),t}function Co(){var t;return Le.test(e.charAt(xi))?(t=e.charAt(xi),xi++):(t=a,0===Ri&&Bi(ur)),t===a&&(126===e.charCodeAt(xi)?(t=ke,xi++):(t=a,0===Ri&&Bi(cr)),t===a&&(94===e.charCodeAt(xi)?(t=Ce,xi++):(t=a,0===Ri&&Bi(dr)),t===a&&(39===e.charCodeAt(xi)?(t=Ee,xi++):(t=a,0===Ri&&Bi(pr))))),t}var Eo=[],Io="";if(e=e.trimStart(),(r=c())!==a&&xi===e.length)return r;throw r!==a&&xi<e.length&&Bi({type:"end"}),Li(Oi,Si<e.length?e.charAt(Si):null,Si<e.length?ji(Si,Si+1):ji(Si,Si))}t.SyntaxError=n,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(n,Error),n.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){i=e[r].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,s=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,n=this.location.source+":"+s.line+":"+s.column;if(i){var l=this.location.end,u=a("",s.line.toString().length," "),c=i[o.line-1],d=(o.line===l.line?l.column:c.length+1)-o.column||1;t+="\n --\x3e "+n+"\n"+u+" |\n"+s.line+" | "+c+"\n"+u+" | "+a("",o.column-1," ")+a("",d,"^")}else t+="\n at "+n}return t},n.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?s(e[0])+"-"+s(e[1]):s(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function i(e){return e.charCodeAt(0).toString(16).toUpperCase()}function o(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function s(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function n(e){return r[e.type](e)}return"Expected "+function(e){var t,r,i=e.map(n);if(i.sort(),i.length>0){for(t=1,r=1;t<i.length;t++)i[t-1]!==i[t]&&(i[r]=i[t],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(e)+" but "+function(e){return e?'"'+o(e)+'"':"end of input"}(t)+" found."},t.parse=l},297:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkGenerator=void 0;const o=r(8256),s=r(549),n=r(208),a=r(8791),l=r(1060),u=r(8565),c=r(4719),d=r(1895),p=r(1353),h={debugGenerationInline:!1};t.BitmarkGenerator=class{constructor(e,t){var r;this.ast=new o.Ast,this.skipNLBetweenBitsValue=!1,this.printed=!1,this.bitmarkVersion=null!==(r=a.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:a.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},h),null==t?void 0:t.bitmarkOptions),this.bitmarkVersion===a.BitmarkVersion.v2?void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=u.CardSetVersion.v1):void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=u.CardSetVersion.v2),this.writer=e,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this),this.generatePropertyHandlers()}generate(e){return i(this,void 0,void 0,(function*(){this.resetState(),yield this.writer.open(),this.walkAndWrite(e),this.writeLine(),yield this.writer.close()}))}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.skipNLBetweenBitsValue=!1,this.printed=!1}walkAndWrite(e){this.ast.walk(e,s.NodeType.bitmarkAst,this,void 0),this.writeLine()}enter(e,t,r){let i;const o=this,s=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[s]&&(i=o[s](e,t,r)),i}between(e,t,r,i,o){let s;const n=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof n[a]&&(s=n[a](e,t,r,i,o)),s}exit(e,t,r){const i=this,o=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof i[o]&&i[o](e,t,r)}leaf(e,t,r){const i=this,o=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[o]&&i[o](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}between_bits(e,t,r,i,o){this.writeNL(),this.writeNL(),this.writeNL()}enter_bitsValue(e,t,r){var i,o;const s=e.value;if(this.writeOPD(),this.writeString(s.bitType.alias),s.textFormat){this.isWriteTextFormat(s.textFormat)&&(this.writeColon(),this.writeString(s.textFormat))}const n=null===(i=s.resource)||void 0===i?void 0:i.type;n&&n!==s.bitType.root&&(this.writeAmpersand(),this.writeString(null===(o=s.resource)||void 0===o?void 0:o.type)),this.writeCL(),this.writeNL()}between_bitsValue(e,t,r,i,o){const n=[s.NodeType.bitType,s.NodeType.textFormat,s.NodeType.level,s.NodeType.progress,s.NodeType.toc,s.NodeType.referenceEnd,s.NodeType.labelFalse];e.value.book&&n.push(s.NodeType.reference);(()=>{if(this.skipNLBetweenBitsValue)return this.skipNLBetweenBitsValue=!1,!0;for(const e of n)if(t.key===e)return!0;return!1})()||this.writeNL()}enter_labelTrue(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==s.NodeType.bitsValue)return;const o=null==t?void 0:t.value;o&&(""!=i&&this.writeProperty(c.PropertyKey.labelTrue,i,!0),o.labelFalse&&""!=o.labelFalse[0]&&this.writeProperty(c.PropertyKey.labelFalse,o.labelFalse,!0))}enter_partner(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==s.NodeType.bitsValue)return;const{name:o,avatarImage:n}=i;this.writeProperty("partner",o,!0),n&&this.writeResource(n)}enter_markConfigValue(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==s.NodeType.markConfig)return;const{mark:o,color:n,emphasis:a}=i;o&&(this.writeProperty("mark",o,!0),n&&this.writeProperty("color",n,!0),a&&this.writeProperty("emphasis",a,!0),this.writeNL())}enter_sampleSolution(e,t,r){this.writeProperty("sampleSolution",e.value)}enter_itemLead(e,t,r){const i=e.value;i&&(i.item||i.lead)&&(this.writeOPC(),this.writeString(i.item||""),this.writeCL(),i.lead&&(this.writeOPC(),this.writeString(i.lead),this.writeCL()))}enter_body(e,t,r){e.value.bodyParts.length>0&&this.writeNL()}enter_solutions(e,t,r){const i=e.value;i&&0===i.length&&(this.writeOPU(),this.writeCL())}leaf_solution(e,t,r){var i;const o=e.value,s=null===(i=this.getParentNode(r,2))||void 0===i?void 0:i.value;(null==s?void 0:s.type)===l.BodyBitType.mark&&o&&(this.writeOPE(),this.writeString(o),this.writeCL())}leaf_mark(e,t,r){var i;const o=e.value,s=null===(i=this.getParentNode(r,2))||void 0===i?void 0:i.value;(null==s?void 0:s.type)===l.BodyBitType.mark&&o&&this.writeProperty("mark",o,!0)}enter_optionsValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}enter_textsValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}enter_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeCardSetStart(),this.writeNL())}between_cardNode(e,t,r,i,o){this.isRootBitType1(o)||(this.writeNL(),this.writeCardSetCardDivider(),this.writeNL())}exit_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeNL(),this.writeCardSetEnd())}enter_elements(e,t,r){}between_elements(e,t,r,i,o){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}exit_elements(e,t,r){}enter_statements(e,t,r){}between_statements(e,t,r,i,o){this.isRootBitType(o,n.RootBitType.trueFalse1)||(this.writeNL(),this.writeCardSetCardDivider()),this.writeNL()}exit_statements(e,t,r){}enter_statementsValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}between_choices(e,t,r,i,o){this.writeNL()}exit_choices(e,t,r){this.writeNL()}enter_choicesValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}between_responses(e,t,r,i,o){this.writeNL()}exit_responses(e,t,r){this.writeNL()}enter_responsesValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}enter_quizzes(e,t,r){}between_quizzes(e,t,r,i,o){this.writeCardSetCardDivider(),this.writeNL()}exit_quizzes(e,t,r){}between_quizzesValue(e,t,r,i,o){r.key!==s.NodeType.choices&&r.key!==s.NodeType.responses||this.writeNL()}enter_heading(e,t,r){}between_heading(e,t,r,i,o){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_heading(e,t,r){}enter_forValues(e,t,r){}between_forValues(e,t,r,i,o){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_forValues(e,t,r){}enter_pairs(e,t,r){}between_pairs(e,t,r,i,o){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_pairs(e,t,r){}between_pairsValue(e,t,r,i,o){}enter_keyAudio(e,t,r){const i=e.value;this.writeResource(i)}enter_keyImage(e,t,r){const i=e.value;this.writeResource(i)}enter_matrix(e,t,r){}between_matrix(e,t,r,i,o){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_matrix(e,t,r){}between_matrixValue(e,t,r,i,o){}enter_values(e,t,r){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}between_values(e,t,r,i,o){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}enter_questions(e,t,r){}between_questions(e,t,r,i,o){this.writeCardSetCardDivider(),this.writeNL()}exit_questions(e,t,r){}between_questionsValue(e,t,r,i,o){r.key===s.NodeType.sampleSolution&&this.writeNL()}exit_questionsValue(e,t,r){this.writeNL()}enter_botResponses(e,t,r){}between_botResponses(e,t,r,i,o){this.writeCardSetCardDivider(),this.writeNL()}exit_botResponses(e,t,r){}between_botResponsesValue(e,t,r,i,o){this.writeNL()}exit_botResponsesValue(e,t,r){this.writeNL()}leaf_response(e,t,r){this.writeOPB(),this.writeString(e.value),this.writeCL()}leaf_reaction(e,t,r){this.writeProperty("reaction",e.value,!0)}leaf_feedback(e,t,r){const i=e.value;i&&this.write(i)}enter_resource(e,t,r){const i=e.value;this.writeResource(i)}enter_posterImage(e,t,r){const i=e.value;i&&i.value&&this.writeProperty("posterImage",i.value)}enter_thumbnails(e,t,r){const i=e.value;if(Array.isArray(i)){const e=["src1x","src2x","src3x","src4x"];for(let t=0;t<i.length&&t!==e.length;t++){const r=i[t],o=e[t];this.writeProperty(o,r.value,!0)}}}leaf_title(e,t,r){const i=e.value,o=(null==t?void 0:t.value).level||1;if(o&&i){this.writeOP();for(let e=0;e<+o;e++)this.writeHash();this.writeString(i),this.writeCL()}}leaf_subtitle(e,t,r){const i=e.value;if(i){this.writeOP();for(let e=0;e<2;e++)this.writeHash();this.writeString(i),this.writeCL()}}leaf_book(e,t,r){const i=null==t?void 0:t.value;i&&e.value&&(this.writeProperty("book",e.value),i.reference&&(this.writeOPRANGLE(),this.writeString(i.reference),this.writeCL(),i.referenceEnd&&(this.writeOPRANGLE(),this.writeString(i.referenceEnd),this.writeCL())))}leaf_anchor(e,t,r){e.value&&(this.writeOPDANGLE(),this.writeString(e.value),this.writeCL())}leaf_reference(e,t,r){const i=null==t?void 0:t.value;i&&e.value&&(i.book||(this.writeOPRANGLE(),this.writeString(e.value),this.writeCL()))}leaf_hint(e,t,r){const i=e.value;i&&(this.writeOPQ(),this.writeString(i),this.writeCL())}leaf_instruction(e,t,r){const i=e.value;i&&(this.writeOPB(),this.writeString(i),this.writeCL())}leaf_example(e,t,r){var i,o;const s=e.value,n=null!==(i=null==t?void 0:t.value.isExample)&&void 0!==i&&i,a=null!==(o=null==t?void 0:t.value.isDefaultExample)&&void 0!==o&&o;n&&(a?(this.writeOPA(),this.writeString("example"),this.writeCL()):null!=s&&(this.writeOPA(),this.writeString("example"),this.writeColon(),!0===s?this.writeString("true"):!1===s?this.writeString("false"):this.writeString(s),this.writeCL()))}leaf_bodyText(e,t,r){const i=e.value;i&&this.writeString(i)}leaf_footerText(e,t,r){const i=e.value;i&&this.writeString(i)}leaf_elementsValue(e,t,r){e.value&&this.writeString(e.value)}leaf_solutionsValue(e,t,r){e.value&&(this.writeOPU(),this.writeString(e.value),this.writeCL())}leaf_prefix(e,t,r){e.value&&(this.writeOPPRE(),this.writeString(e.value),this.writeCL())}leaf_postfix(e,t,r){e.value&&(this.writeOPPOST(),this.writeString(e.value),this.writeCL())}leaf_forKeys(e,t,r){this.writeOPHASH(),this.writeString(e.value),this.writeCL()}leaf_forValuesValue(e,t,r){this.writeOPHASH(),this.writeString(e.value),this.writeCL()}leaf_key(e,t,r){e.value&&this.writeString(e.value)}leaf_valuesValue(e,t,r){e.value&&this.writeString(e.value)}leaf_question(e,t,r){e.value&&this.writeString(e.value)}leaf_sampleSolution(e,t,r){e.value&&(this.writeOPDOLLAR(),this.writeString(e.value),this.writeCL())}leaf_isShortAnswer(e,t,r){!1===e.value&&(this.writeOPA(),this.writeString("longAnswer"),this.writeCL())}leaf_src1x(e,t,r){this.writeProperty("src1x",e.value)}leaf_src2x(e,t,r){this.writeProperty("src2x",e.value)}leaf_src3x(e,t,r){this.writeProperty("src3x",e.value)}leaf_src4x(e,t,r){this.writeProperty("src4x",e.value)}leaf_width(e,t,r){this.writeProperty("width",e.value)}leaf_height(e,t,r){this.writeProperty("height",e.value)}leaf_alt(e,t,r){this.writeProperty("alt",e.value)}leaf_license(e,t,r){this.writeProperty("license",e.value)}leaf_copyright(e,t,r){this.writeProperty("copyright",e.value)}leaf_provider(e,t,r){}leaf_showInIndex(e,t,r){this.writeProperty("showInIndex",e.value)}leaf_caption(e,t,r){const i=e.value;this.writeProperty("caption",i)}leaf_duration(e,t,r){(null==t?void 0:t.key)!==s.NodeType.bitsValue&&this.writeProperty("duration",e.value)}leaf_mute(e,t,r){this.writeProperty("mute",e.value)}leaf_autoplay(e,t,r){this.writeProperty("autoplay",e.value)}leaf_allowSubtitles(e,t,r){this.writeProperty("allowSubtitles",e.value)}leaf_showSubtitles(e,t,r){this.writeProperty("showSubtitles",e.value)}generatePropertyHandlers(){var e;for(const t of c.PropertyKey.values()){const r=null!==(e=c.PropertyKey.getMetadata(c.PropertyKey.fromValue(t)))&&void 0!==e?e:{},i=r.astKey?r.astKey:t,o=`enter_${i}`;i!==c.PropertyKey.example&&(i!==c.PropertyKey.labelTrue&&i!==c.PropertyKey.labelFalse&&i!==c.PropertyKey.posterImage&&i!==c.PropertyKey.partner&&(this[o]=(e,i,o)=>{null!=e.value&&(null==i?void 0:i.key)===s.NodeType.bitsValue&&this.writeProperty(t,e.value,r.isSingle,r.ignoreFalse,r.ignoreTrue)},this[o]=this[o].bind(this)))}}writeString(e){null!=e&&this.write(`${e}`)}writeOPBUL(){this.write("[•")}writeOPESC(){this.write("[^")}writeOPRANGLE(){this.write("[►")}writeOPDANGLE(){this.write("[▼")}writeOPD(){this.write("[.")}writeOPU(){this.write("[_")}writeOPE(){this.write("[=")}writeOPB(){this.write("[!")}writeOPQ(){this.write("[?")}writeOPA(){this.write("[@")}writeOPP(){this.write("[+")}writeOPM(){this.write("[-")}writeOPS(){this.write("[\\")}writeOPR(){this.write("[*")}writeOPC(){this.write("[%")}writeOPAMP(){this.write("[&")}writeOPDOLLAR(){this.write("[$")}writeOPHASH(){this.write("[#")}writeOPPRE(){this.write("['")}writeOPPOST(){this.write("[")}writeOP(){this.write("[")}writeCL(){this.write("]")}writeAmpersand(){this.write("&")}writeColon(){this.write(":")}writeHash(){this.write("#")}writeCardSetStart(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("==="):this.write("++\n====")}writeCardSetEnd(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("==="):this.write("====\n++")}writeCardSetCardDivider(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetSideDivider(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("=="):this.write("--")}writeCardSetVariantDivider(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("--"):this.write("~~")}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeResource(e){const t=e;if(e)if(e.type===d.ResourceType.stillImageFilm){const t=e;this.writeResource(t.image),this.writeNL(),this.writeResource(t.audio)}else this.writeOPAMP(),this.writeString(e.type),e.type===d.ResourceType.article&&t.value?(this.writeColon(),this.writeString(t.value),this.writeNL()):e.value&&(this.writeColon(),this.writeString(e.value)),this.writeCL()}writeProperty(e,t,r,i,o){let s,n=!1;if(void 0!==t&&(s=Array.isArray(t)?t:[t],s.length>0)){r&&(s=s.slice(s.length-1));for(const t of s)if(void 0!==t){if(i&&!1===t)continue;if(o&&!0===t)continue;this.writeOPA(),this.writeString(e),this.writeColon(),this.writeString(`${t}`),this.writeCL(),n=!0}}n||(this.skipNLBetweenBitsValue=!0)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}isWriteTextFormat(e){return!!(!(p.TextFormat.fromValue(e)===p.TextFormat.bitmarkMinusMinus)||this.options.explicitTextFormat)}isRootBitType1(e){return this.isRootBitType(e,n.RootBitType.trueFalse1)||this.isRootBitType(e,n.RootBitType.multipleChoice1)||this.isRootBitType(e,n.RootBitType.multipleResponse1)}isRootBitType(e,t){const r=this.getBitType(e);return(null==r?void 0:r.root)===t}getBitType(e){for(const t of e)if(t.key===s.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getParentNode(e,t=1){if(e.length>t+1)return e[e.length-t-1]}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}}},8582:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkStringGenerator=void 0;const o=r(227),s=r(297);t.BitmarkStringGenerator=class{constructor(e){this.writer=new o.StringWriter,this.generator=new s.BitmarkGenerator(this.writer,e)}generate(e){return i(this,void 0,void 0,(function*(){return yield this.generator.generate(e),this.writer.getString()}))}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}}},3857:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))},o=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonGenerator=void 0;const s=r(8256),n=r(549),a=r(208),l=r(8791),u=r(1060),c=r(7028),d=r(4719),p=r(1895),h=r(1353),y=r(406),g=r(7646),f=r(672),m=r(3633),b=r(169),v={};t.JsonGenerator=class{constructor(e,t){var r;this.ast=new s.Ast,this.textParser=new y.TextParser,this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault="",this.bodyDefault="",this.printed=!1,this.bitmarkVersion=null!==(r=l.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:l.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},v),null==t?void 0:t.jsonOptions),this.jsonPrettifySpace=!0===this.options.prettify?2:this.options.prettify||void 0,this.bitmarkVersion===l.BitmarkVersion.v2?void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!0):void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!1),this.writer=e,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this),this.generatePropertyHandlers()}generate(e){return i(this,void 0,void 0,(function*(){this.resetState(),yield this.writer.open(),this.walkAndWrite(e),this.write(JSON.stringify(this.json,null,this.jsonPrettifySpace)),yield this.writer.close()}))}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault=this.options.textAsPlainText?"":[],this.bodyDefault=this.options.textAsPlainText?"":[],this.printed=!1}walkAndWrite(e){this.ast.walk(e,n.NodeType.bitmarkAst,this,void 0)}enter(e,t,r){let i;const o=this,s=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[s]&&(i=o[s](e,t,r)),i}between(e,t,r,i,o){let s;const n=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof n[a]&&(s=n[a](e,t,r,i,o)),s}exit(e,t,r){const i=this,o=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof i[o]&&i[o](e,t,r)}leaf(e,t,r){const i=this,o=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[o]&&i[o](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_bitmarkAst(e,t,r){this.json=[]}enter_bitsValue(e,t,r){var i,o,s;const n=e.value;this.bitWrapperJson={},this.json.push(this.bitWrapperJson),this.bitJson=this.createBitJson(n),this.bitWrapperJson.bit=this.bitJson;const l=a.RootBitType.getMetadata(n.bitType.root),u=!!(null==l?void 0:l.rootExampleType),d=(null==l?void 0:l.rootExampleType)===c.ExampleType.boolean;if(u){let e;d?(e=!0,n.bitType.root===a.RootBitType.trueFalse1&&void 0!==(null===(o=null===(i=n.cardNode)||void 0===i?void 0:i.statement)||void 0===o?void 0:o.isCorrect)&&(e=n.cardNode.statement.isCorrect)):e=null!==(s=g.ArrayUtils.asSingle(n.sampleSolution))&&void 0!==s?s:"";const t=this.toExample(n,{defaultExample:e,isBoolean:d});this.bitJson.isExample=t.isExample,this.bitJson.example=t.example}else n.isExample&&(this.bitJson.isExample=!0)}exit_bitsValue(e,t,r){this.cleanAndSetDefaultsForBitJson(this.bitJson)}enter_partner(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==n.NodeType.bitsValue)return;const{name:o,avatarImage:s}=i,a={};if(this.addProperty(a,"name",null!=o?o:"",!0),s){const e=this.parseResourceToJson(s);e&&e.type===p.ResourceType.image&&(a.avatarImage=e.image)}this.bitJson.partner=a}enter_markConfigValue(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==n.NodeType.markConfig)return;const{mark:o,color:s,emphasis:a}=i,l={};this.addProperty(l,"mark",null!=o?o:"unknown",!0),s&&this.addProperty(l,"color",null!=s?s:"",!0),a&&this.addProperty(l,"emphasis",null!=a?a:"",!0),this.bitJson.marks||(this.bitJson.marks=[]),this.bitJson.marks.push(l)}enter_sampleSolution(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"sampleSolution",e.value,!0)}enter_itemLead(e,t,r){const i=e.value,{item:o,lead:s}=i;(null==t?void 0:t.key)===n.NodeType.bitsValue&&(null!=o&&(this.bitJson.item=this.toTextAstOrString(o)),null!=s&&(this.bitJson.lead=this.toTextAstOrString(s)))}enter_extraProperties(e,t,r){const i=e.value;if(!this.options.excludeUnknownProperties&&i)for(const[e,t]of Object.entries(i)){let r=e;Object.prototype.hasOwnProperty.call(this.bitJson,e)&&(r=`_${e}`),this.addProperty(this.bitJson,r,t)}}enter_bodyParts(e,t,r){const i=e.value,o=this.options.textAsPlainText,s=this.getTextFormat(r);let n="",a=0;null==this.bitJson.body&&(this.bitJson.body=this.bodyDefault);const l=e=>({legacyPlaceholderKey:`{${e}}`,placeholderKey:`[!${e}]`});for(let e=0;e<i.length;e++){const t=i[e];if(t.type===u.BodyBitType.text){n+=t.data.bodyText}else{const{legacyPlaceholderKey:e,placeholderKey:t}=l(a);n+=o?e:t,a++}}this.bitJson.body=this.toTextAstOrString(n,s);const c=this.bitJson.body;a=0;for(let e=0;e<i.length;e++){const t=i[e];if(t.type===u.BodyBitType.text)continue;const r=t;let s;const{legacyPlaceholderKey:n}=l(a);switch(t.type){case u.BodyBitType.gap:{const e=r;s=this.createGapJson(e);break}case u.BodyBitType.mark:{const e=r;s=this.createMarkJson(e);break}case u.BodyBitType.select:{const e=r;s=this.createSelectJson(e);break}case u.BodyBitType.highlight:{const e=r;s=this.createHighlightJson(e);break}}s&&(o?(this.bitJson.placeholders||(this.bitJson.placeholders={}),this.bitJson.placeholders[n]=s):this.replacePlaceholderWithBodyBit(c,s,a)),a++}return!1}enter_elements(e,t,r){const i=e.value;i&&i.length>0&&(this.bitJson.elements=i)}enter_statement(e,t,r){var i,o;const s=e.value;(null==t?void 0:t.key)===n.NodeType.cardNode&&s&&(this.bitJson.statement=null!==(i=s.text)&&void 0!==i?i:"",this.bitJson.isCorrect=null!==(o=s.isCorrect)&&void 0!==o&&o)}enter_statements(e,t,r){var i,o,s;const a=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const l=[];if(a)for(const e of a){const t=Object.assign(Object.assign({statement:null!==(i=e.text)&&void 0!==i?i:"",isCorrect:!!e.isCorrect},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(o=e.itemLead)||void 0===o?void 0:o.item)&&delete t.item,null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,null==(null==e?void 0:e.hint)&&delete t.hint,null==(null==e?void 0:e.instruction)&&delete t.instruction,l.push(t)}l.length>0&&(this.bitJson.statements=l)}enter_choices(e,t,r){var i,o,s;const a=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const l=[];if(a)for(const e of a){const t=Object.assign(Object.assign({choice:null!==(i=e.text)&&void 0!==i?i:"",isCorrect:null!==(o=e.isCorrect)&&void 0!==o&&o},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,l.push(t)}l.length>0&&(this.bitJson.choices=l)}enter_responses(e,t,r){var i,o,s;const a=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const l=[];if(a)for(const e of a){const t=Object.assign(Object.assign({response:null!==(i=e.text)&&void 0!==i?i:"",isCorrect:null!==(o=e.isCorrect)&&void 0!==o&&o},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,l.push(t)}l.length>0&&(this.bitJson.responses=l)}enter_quizzes(e,t,r){var i,o,s,n,a,l,u,c;const d=e.value,p=[];if(d)for(const e of d){const t=[];if(e.choices)for(const r of e.choices){const n=Object.assign(Object.assign({choice:null!==(i=r.text)&&void 0!==i?i:"",isCorrect:null!==(o=r.isCorrect)&&void 0!==o&&o},this.toItemLeadHintInstruction(r)),this.toExample(r,{defaultExample:!!r.isCorrect,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete n.lead,t.push(n)}const r=[];if(e.responses)for(const t of e.responses){const i=Object.assign(Object.assign({response:null!==(n=t.text)&&void 0!==n?n:"",isCorrect:null!==(a=t.isCorrect)&&void 0!==a&&a},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!!t.isCorrect,isBoolean:!0}));null==(null===(l=e.itemLead)||void 0===l?void 0:l.lead)&&delete i.lead,r.push(i)}const d=Object.assign(Object.assign({},this.toItemLeadHintInstruction(e)),{isExample:null!==(u=e.isExample)&&void 0!==u&&u,choices:e.choices?t:void 0,responses:e.responses?r:void 0});null==(null===(c=e.itemLead)||void 0===c?void 0:c.lead)&&delete d.lead,p.push(d)}p.length>0&&(this.bitJson.quizzes=p)}enter_heading(e,t,r){var i,o;const s=e.value;let n=!1;if(s&&s.forKeys&&(n=!0),!n)return!1;const a={forKeys:null!==(i=s.forKeys)&&void 0!==i?i:""};Array.isArray(s.forValues)?s.forValues.length>1?a.forValues=s.forValues:1===s.forValues.length?a.forValues=s.forValues[0]:a.forValues=s.forValues:a.forValues=null!==(o=s.forValues)&&void 0!==o?o:"",this.bitJson.heading=a}enter_pairs(e,t,r){var i,o,s,n,a;const l=e.value,u=[];if(l)for(const e of l){const t=Object.assign(Object.assign(Object.assign({key:null!==(i=e.key)&&void 0!==i?i:"",keyAudio:e.keyAudio?this.addAudioResource(e.keyAudio):void 0,keyImage:e.keyImage?this.addImageResource(e.keyImage):void 0,values:null!==(o=e.values)&&void 0!==o?o:[]},this.toItemLeadHintInstruction(e)),{isCaseSensitive:null===(s=e.isCaseSensitive)||void 0===s||s,isLongAnswer:null!==(n=!e.isShortAnswer)&&void 0!==n&&n}),this.toExample(e,{defaultExample:!0,isBoolean:!0}));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete t.lead,t.key&&(delete t.keyAudio,delete t.keyImage),null!=t.keyAudio&&(delete t.key,delete t.keyImage),null!=t.keyImage&&(delete t.key,delete t.keyAudio),u.push(t)}u.length>0&&(this.bitJson.pairs=u)}enter_matrix(e,t,r){var i,o,s,n,a,l,u;const c=e.value,d=[];if(c)for(const e of c){const t=[];if(e.cells)for(const r of e.cells){const e=Object.assign(Object.assign({values:null!==(i=r.values)&&void 0!==i?i:[]},this.toItemLeadHintInstruction(r)),this.toExample(r,{defaultExample:!0,isBoolean:!0}));null==(null===(o=r.itemLead)||void 0===o?void 0:o.lead)&&delete e.lead,null==r.hint&&delete e.hint,t.push(e)}const r=Object.assign(Object.assign({key:null!==(s=e.key)&&void 0!==s?s:"",cells:null!=t?t:[]},this.toItemLeadHintInstruction(e)),{isCaseSensitive:null===(n=e.isCaseSensitive)||void 0===n||n,isLongAnswer:null!==(a=!e.isShortAnswer)&&void 0!==a&&a,isExample:null!==(l=e.isExample)&&void 0!==l&&l});null==(null===(u=e.itemLead)||void 0===u?void 0:u.lead)&&delete r.lead,null==e.instruction&&delete r.instruction,d.push(r)}d.length>0&&(this.bitJson.matrix=d)}enter_questions(e,t,r){var i,o,s,n,a;const l=e.value,u=[];if(l)for(const e of l){const t=Object.assign(Object.assign(Object.assign({question:null!==(i=e.question)&&void 0!==i?i:"",partialAnswer:null!==(o=g.ArrayUtils.asSingle(e.partialAnswer))&&void 0!==o?o:"",sampleSolution:null!==(s=e.sampleSolution)&&void 0!==s?s:""},this.toItemLeadHintInstruction(e)),{isShortAnswer:null===(n=e.isShortAnswer)||void 0===n||n}),this.toExample(e,{defaultExample:e.sampleSolution||"",isBoolean:!1}));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.questions=u)}enter_botResponses(e,t,r){var i,o,s,a;const l=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const u=[];if(l)for(const e of l){const t=Object.assign({response:null!==(i=e.response)&&void 0!==i?i:"",reaction:null!==(o=e.reaction)&&void 0!==o?o:"",feedback:null!==(s=e.feedback)&&void 0!==s?s:""},this.toItemLeadHintInstruction(e));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete t.lead,null==e.hint&&delete t.hint,delete t.instruction,u.push(t)}u.length>0&&(this.bitJson.responses=u)}enter_resource(e,t,r){const i=e.value;this.bitJson.resource=this.parseResourceToJson(i)}leaf_title(e,t,r){this.bitJson.title=this.toTextAstOrString(e.value)}leaf_subtitle(e,t,r){this.bitJson.subtitle=this.toTextAstOrString(e.value)}leaf_level(e,t,r){var i;null!=e.value&&this.addProperty(this.bitJson,"level",null!==(i=e.value)&&void 0!==i?i:1,!0)}leaf_book(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"book",e.value,!0)}leaf_anchor(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"anchor",e.value,!0)}leaf_reference(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"reference",e.value,!0)}leaf_referenceEnd(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"referenceEnd",e.value,!0)}leaf_hint(e,t,r){const i=e.value;(null==t?void 0:t.key)===n.NodeType.bitsValue&&(this.bitJson.hint=this.toTextAstOrString(i))}leaf_instruction(e,t,r){const i=e.value;(null==t?void 0:t.key)===n.NodeType.bitsValue&&(this.bitJson.instruction=this.toTextAstOrString(i))}leaf_footerText(e,t,r){const i=e.value;this.bitJson.footer=this.toTextAstOrString(i)}leaf_markup(e,t,r){const i=e.value;i&&(this.bitWrapperJson.bitmark=i)}enter_parser(e,t,r){const i=e.value;if(i){const{version:e,excessResources:r,warnings:s,errors:a}=i,l=o(i,["version","excessResources","warnings","errors"]),u=`${this.bitmarkVersion}`;let c;if(Array.isArray(r)&&r.length>0){c=[];for(const e of r){const t=this.parseResourceToJson(e);t&&c.push(t)}}(null==t?void 0:t.key)===n.NodeType.bitsValue&&(this.bitWrapperJson.parser=Object.assign(Object.assign({version:e,bitmarkVersion:u},l),{warnings:s,errors:a,excessResources:c}),this.options.enableWarnings||delete this.bitWrapperJson.parser.warnings)}}generatePropertyHandlers(){var e;for(const t of d.PropertyKey.values()){const r=d.PropertyKey.fromValue(t),i=null!==(e=d.PropertyKey.getMetadata(r))&&void 0!==e?e:{},o=i.astKey?i.astKey:t,s=`enter_${o}`;o!==d.PropertyKey.example&&(o!==d.PropertyKey.partner&&(this[s]=(e,r,o)=>{const s=e.value;if(null==s)return;if((null==r?void 0:r.key)!==n.NodeType.bitsValue)return;let a=t;i.jsonKey&&(a=i.jsonKey),this.addProperty(this.bitJson,a,s,i.isSingle)},this[s]=this[s].bind(this)))}}createGapJson(e){var t;const r=e.data,i=r.solutions&&r.solutions.length>0?r.solutions[0]:"",o=Object.assign(Object.assign(Object.assign(Object.assign({type:"gap"},this.toItemLeadHintInstruction(r)),{isCaseSensitive:null===(t=r.isCaseSensitive)||void 0===t||t}),this.toExample(r,{defaultExample:i,isBoolean:!1})),{solutions:r.solutions});return o.lead||delete o.lead,o}createMarkJson(e){const t=e.data,r=Object.assign(Object.assign({type:"mark",solution:t.solution,mark:t.mark},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!0,isBoolean:!0}));return r.lead||delete r.lead,r}createSelectJson(e){var t,r,i,o;const s=e.data,n=[];for(const e of s.options){const r=Object.assign(Object.assign({text:e.text,isCorrect:null!==(t=e.isCorrect)&&void 0!==t&&t},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));r.item||delete r.item,r.lead||delete r.lead,r.instruction||delete r.instruction,r.isCaseSensitive||delete r.isCaseSensitive,n.push(r)}const a=Object.assign(Object.assign({type:"select",prefix:null!==(r=s.prefix)&&void 0!==r?r:"",postfix:null!==(i=s.postfix)&&void 0!==i?i:""},this.toItemLeadHintInstruction(s)),{isExample:null!==(o=s.isExample)&&void 0!==o&&o,options:n});return a.lead||delete a.lead,a}createHighlightJson(e){var t,r,i,o,s;const n=e.data,a=[];for(const e of n.texts){const i=Object.assign(Object.assign({text:e.text,isCorrect:null!==(t=e.isCorrect)&&void 0!==t&&t,isHighlighted:null!==(r=e.isHighlighted)&&void 0!==r&&r},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));i.item||delete i.item,i.lead||delete i.lead,i.hint||delete i.hint,i.isCaseSensitive||delete i.isCaseSensitive,a.push(i)}const l=Object.assign(Object.assign({type:"highlight",prefix:null!==(i=n.prefix)&&void 0!==i?i:"",postfix:null!==(o=n.postfix)&&void 0!==o?o:""},this.toItemLeadHintInstruction(n)),{isExample:null!==(s=n.isExample)&&void 0!==s&&s,texts:a});return l.lead||delete l.lead,l}parseResourceToJson(e){if(!e)return;let t;switch(e.type){case p.ResourceType.image:t={type:p.ResourceType.image,image:this.addImageResource(e)};break;case p.ResourceType.imageLink:t={type:p.ResourceType.imageLink,imageLink:this.addImageLinkResource(e)};break;case p.ResourceType.audio:t={type:p.ResourceType.audio,audio:this.addAudioResource(e)};break;case p.ResourceType.audioEmbed:t={type:p.ResourceType.audioEmbed,audioEmbed:this.addAudioEmbedResource(e)};break;case p.ResourceType.audioLink:t={type:p.ResourceType.audioLink,audioLink:this.addAudioLinkResource(e)};break;case p.ResourceType.video:t={type:p.ResourceType.video,video:this.addVideoResource(e)};break;case p.ResourceType.videoEmbed:t={type:p.ResourceType.videoEmbed,videoEmbed:this.addVideoEmbedResource(e)},t.videoEmbed=this.addVideoLinkResource(e);break;case p.ResourceType.videoLink:t={type:p.ResourceType.videoLink,videoLink:this.addVideoLinkResource(e)};break;case p.ResourceType.stillImageFilm:{const r=e;null!=r.image.value&&null!=r.audio.value&&(t={type:p.ResourceType.stillImageFilm,image:this.addImageResource(r.image),audio:this.addAudioResource(r.audio)});break}case p.ResourceType.stillImageFilmEmbed:t={type:p.ResourceType.stillImageFilmEmbed,stillImageFilmEmbed:this.addStillImageFilmEmbedResource(e)};break;case p.ResourceType.stillImageFilmLink:t={type:p.ResourceType.stillImageFilmLink,stillImageFilmLink:this.addStillImageFilmLinkResource(e)};break;case p.ResourceType.article:t={type:p.ResourceType.article,article:this.addArticleResource(e)};break;case p.ResourceType.document:t={type:p.ResourceType.document,document:this.addDocumentResource(e)};break;case p.ResourceType.documentEmbed:t={type:p.ResourceType.documentEmbed,documentEmbed:this.addDocumentEmbedResource(e)};break;case p.ResourceType.documentLink:t={type:p.ResourceType.documentLink,documentLink:this.addDocumentLinkResource(e)};break;case p.ResourceType.documentDownload:t={type:p.ResourceType.documentDownload,documentDownload:this.addDocumentDownloadResource(e)};break;case p.ResourceType.appLink:t={type:p.ResourceType.appLink,appLink:this.addAppLinkResource(e)};break;case p.ResourceType.websiteLink:t={type:p.ResourceType.websiteLink,websiteLink:this.addWebsiteLinkResource(e)}}return t}addImageResource(e){var t,r,i;const o={};if(m.StringUtils.isString(e)){const t=e;e={type:p.ResourceType.image,value:t,format:b.UrlUtils.fileExtensionFromUrl(t),provider:b.UrlUtils.domainFromUrl(t)}}return null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.src=e.value),null!=e.src1x&&(o.src1x=e.src1x),null!=e.src2x&&(o.src2x=e.src2x),null!=e.src3x&&(o.src3x=e.src3x),null!=e.src4x&&(o.src4x=e.src4x),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,o.alt=null!==(i=e.alt)&&void 0!==i?i:"",this.addGenericResourceProperties(e,o),o}addImageLinkResource(e){var t,r,i;const o={};if(m.StringUtils.isString(e)){const t=e;e={type:p.ResourceType.imageLink,value:t,format:b.UrlUtils.fileExtensionFromUrl(t),provider:b.UrlUtils.domainFromUrl(t)}}return null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.url=e.value),null!=e.src1x&&(o.src1x=e.src1x),null!=e.src2x&&(o.src2x=e.src2x),null!=e.src3x&&(o.src3x=e.src3x),null!=e.src4x&&(o.src4x=e.src4x),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,o.alt=null!==(i=e.alt)&&void 0!==i?i:"",this.addGenericResourceProperties(e,o),o}addAudioResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.src=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t),t}addAudioEmbedResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.src=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t),t}addAudioLinkResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t,!0),t}addVideoResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.src=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addVideoEmbedResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.src=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addVideoLinkResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.url=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addStillImageFilmEmbedResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.url=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addStillImageFilmLinkResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.url=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addArticleResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.body=e.value),this.addGenericResourceProperties(e,t),t}addDocumentResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentEmbedResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentLinkResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentDownloadResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addAppLinkResource(e){const t={};return null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addWebsiteLinkResource(e){const t={};return null!=e.value&&(t.url=e.value),null!=e.siteName&&(t.siteName=e.siteName),this.addGenericResourceProperties(e,t),t}addGenericResourceProperties(e,t,r){var i,o,s,n,a,l,u,c;return r?(null!=e.license&&(t.license=null!==(i=e.license)&&void 0!==i?i:""),null!=e.copyright&&(t.copyright=null!==(o=e.copyright)&&void 0!==o?o:""),null!=e.provider&&(t.provider=e.provider),null!=e.showInIndex&&(t.showInIndex=null!==(s=e.showInIndex)&&void 0!==s&&s),null!=e.caption&&(t.caption=this.toTextAstOrString(null!==(n=e.caption)&&void 0!==n?n:""))):(t.license=null!==(a=e.license)&&void 0!==a?a:"",t.copyright=null!==(l=e.copyright)&&void 0!==l?l:"",null!=e.provider&&(t.provider=e.provider),t.showInIndex=null!==(u=e.showInIndex)&&void 0!==u&&u,t.caption=this.toTextAstOrString(null!==(c=e.caption)&&void 0!==c?c:"")),t}toItemLeadHintInstruction(e){var t,r,i,o,s,n;return{item:this.toTextAstOrString(null!==(r=null===(t=e.itemLead)||void 0===t?void 0:t.item)&&void 0!==r?r:""),lead:this.toTextAstOrString(null!==(o=null===(i=e.itemLead)||void 0===i?void 0:i.lead)&&void 0!==o?o:""),hint:this.toTextAstOrString(null!==(s=e.hint)&&void 0!==s?s:""),instruction:this.toTextAstOrString(null!==(n=e.instruction)&&void 0!==n?n:"")}}toExample(e,t){const{isExample:r,example:i,isDefaultExample:o}=e,{defaultExample:s,isBoolean:n}=t;if(!r)return{isExample:!1,example:null};let a;return a=o?n?f.BooleanUtils.toBoolean(s):this.toTextAstOrString(s):n?f.BooleanUtils.toBoolean(i):this.toTextAstOrString(i),{isExample:!0,example:a}}addProperty(e,t,r,i){void 0!==r&&(Array.isArray(r)||(r=[r]),Array.isArray(r)&&r.length>0&&(i&&r.length>=1?e[t]=r[r.length-1]:e[t]=r))}getBitType(e){for(const t of e)if(t.key===n.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getTextFormat(e){for(const t of e)if(t.key===n.NodeType.bitsValue){const e=t.value;return h.TextFormat.fromValue(null==e?void 0:e.textFormat)}}toTextAstOrString(e,t=h.TextFormat.bitmarkMinusMinus){if(this.options.textAsPlainText)return e;return this.textParser.toAst(e,{textFormat:t})}replacePlaceholderWithBodyBit(e,t,r){const i=(e,o,s)=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){const r=e[t];if(i(r,e,t))return!0}else{if("bit"===e.type&&e.index===r)return o[s]=t,!0;if(e.content){if(i(e.content,e,"content"))return!0}}return!1};i(e,null,null)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}writeString(e){null!=e&&this.write(`${e}`)}createBitJson(e){return{type:e.bitType.alias,format:e.textFormat,id:void 0,externalId:void 0,spaceId:void 0,padletId:void 0,AIGenerated:void 0,releaseVersion:void 0,book:void 0,ageRange:void 0,language:void 0,computerLanguage:void 0,subtype:void 0,coverImage:void 0,publisher:void 0,publications:void 0,author:void 0,subject:void 0,date:void 0,location:void 0,theme:void 0,kind:void 0,action:void 0,thumbImage:void 0,focusX:void 0,focusY:void 0,deeplink:void 0,externalLink:void 0,externalLinkText:void 0,videoCallLink:void 0,duration:void 0,list:void 0,textReference:void 0,isTracked:void 0,isInfoOnly:void 0,labelTrue:void 0,labelFalse:void 0,quotedPerson:void 0,partialAnswer:void 0,title:void 0,subtitle:void 0,level:void 0,toc:void 0,progress:void 0,anchor:void 0,reference:void 0,referenceEnd:void 0,item:void 0,lead:void 0,hint:void 0,instruction:void 0,isExample:void 0,example:void 0,partner:void 0,marks:void 0,extraProperties:void 0,body:void 0,resource:void 0,statement:void 0,isCorrect:void 0,sampleSolution:void 0,elements:void 0,statements:void 0,responses:void 0,quizzes:void 0,heading:void 0,pairs:void 0,matrix:void 0,choices:void 0,questions:void 0,placeholders:void 0,footer:void 0}}cleanAndSetDefaultsForBitJson(e){const t=a.BitTypeUtils.getBitType(e.type),r=this.options.textAsPlainText;switch(e.item||(e.item=void 0),t.root){case a.RootBitType._error:break;case a.RootBitType.article:case a.RootBitType.sampleSolution:null==e.body&&(e.body=this.bodyDefault);break;default:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.body&&(e.body=this.bodyDefault),t.alias!==a.AliasBitType.articleAi&&t.alias!==a.AliasBitType.noteAi&&t.alias!==a.AliasBitType.summaryAi||null==e.AIGenerated&&(e.AIGenerated=!0);break;case a.RootBitType.cloze:case a.RootBitType.multipleChoice1:case a.RootBitType.multipleResponse1:case a.RootBitType.multipleChoiceText:case a.RootBitType.highlightText:case a.RootBitType.clozeAndMultipleChoiceText:case a.RootBitType.sequence:case a.RootBitType.mark:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.multipleChoice:case a.RootBitType.multipleResponse:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault);break;case a.RootBitType.essay:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.body&&(e.body=this.bodyDefault),null==e.partialAnswer&&(e.partialAnswer="");break;case a.RootBitType.trueFalse1:null==e.item&&(e.item=this.textDefault),null==e.lead&&(e.lead=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.isCorrect&&(e.isCorrect=!1),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.trueFalse:null==e.item&&(e.item=this.textDefault),null==e.lead&&(e.lead=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.labelFalse&&(e.labelFalse=""),null==e.labelTrue&&(e.labelTrue=""),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.chapter:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.toc&&(e.toc=!0),null==e.progress&&(e.progress=!0),null==e.level&&(e.level=1),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.interview:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault),null==e.questions&&(e.questions=[]);break;case a.RootBitType.match:null==e.item&&(e.item=this.textDefault),null==e.heading&&(e.heading={}),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.matchMatrix:null==e.item&&(e.item=this.textDefault),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.learningPathBook:case a.RootBitType.learningPathExternalLink:case a.RootBitType.learningPathVideoCall:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.isTracked&&(e.isTracked=!0),null==e.isInfoOnly&&(e.isInfoOnly=!1),null==e.body&&(e.body=this.bodyDefault)}return null==e.id&&delete e.id,null==e.externalId&&delete e.externalId,null==e.spaceId&&delete e.spaceId,null==e.padletId&&delete e.padletId,null==e.AIGenerated&&delete e.AIGenerated,null==e.releaseVersion&&delete e.releaseVersion,null==e.book&&delete e.book,null==e.ageRange&&delete e.ageRange,null==e.language&&delete e.language,null==e.computerLanguage&&delete e.computerLanguage,null==e.subtype&&delete e.subtype,null==e.coverImage&&delete e.coverImage,null==e.publisher&&delete e.publisher,null==e.publications&&delete e.publications,null==e.author&&delete e.author,null==e.subject&&delete e.subject,null==e.date&&delete e.date,null==e.location&&delete e.location,null==e.theme&&delete e.theme,null==e.kind&&delete e.kind,null==e.action&&delete e.action,null==e.thumbImage&&delete e.thumbImage,null==e.deeplink&&delete e.deeplink,null==e.externalLink&&delete e.externalLink,null==e.externalLinkText&&delete e.externalLinkText,null==e.videoCallLink&&delete e.videoCallLink,null==e.duration&&delete e.duration,null==e.list&&delete e.list,null==e.textReference&&delete e.textReference,null==e.isTracked&&delete e.isTracked,null==e.isInfoOnly&&delete e.isInfoOnly,null==e.labelTrue&&delete e.labelTrue,null==e.labelFalse&&delete e.labelFalse,null==e.quotedPerson&&delete e.quotedPerson,null==e.title&&delete e.title,null==e.subtitle&&delete e.subtitle,null==e.level&&delete e.level,null==e.toc&&delete e.toc,null==e.progress&&delete e.progress,null==e.anchor&&delete e.anchor,null==e.reference&&delete e.reference,null==e.referenceEnd&&delete e.referenceEnd,null==e.item&&delete e.item,null==e.lead&&delete e.lead,null==e.hint&&delete e.hint,null==e.instruction&&delete e.instruction,void 0===e.example&&delete e.example,null==e.isExample&&delete e.isExample,null==e.marks&&delete e.marks,null==e.extraProperties&&delete e.extraProperties,null==e.body&&delete e.body,null!=e.placeholders&&0!==Object.keys(e.placeholders).length||delete e.placeholders,null==e.resource&&delete e.resource,null==e.statement&&delete e.statement,null==e.isCorrect&&delete e.isCorrect,null==e.sampleSolution&&delete e.sampleSolution,null==e.partialAnswer&&delete e.partialAnswer,null==e.elements&&delete e.elements,null==e.statements&&delete e.statements,null==e.responses&&delete e.responses,null==e.quizzes&&delete e.quizzes,null==e.heading&&delete e.heading,null==e.pairs&&delete e.pairs,null==e.matrix&&delete e.matrix,null==e.choices&&delete e.choices,null==e.questions&&delete e.questions,r&&null!=e.placeholders||delete e.placeholders,null==e.footer&&delete e.footer,e}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}}},4275:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonObjectGenerator=void 0;const o=r(227),s=r(3857);t.JsonObjectGenerator=class{constructor(e){this.writer=new o.StringWriter,this.generator=new s.JsonGenerator(this.writer,e)}generate(e){return i(this,void 0,void 0,(function*(){return yield this.generator.generate(e),JSON.parse(this.writer.getString())}))}generateSync(e){return this.generator.generateSync(e),JSON.parse(this.writer.getString())}}},5132:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonStringGenerator=void 0;const o=r(227),s=r(3857);t.JsonStringGenerator=class{constructor(e){this.writer=new o.StringWriter,this.generator=new s.JsonGenerator(this.writer,e)}generate(e){return i(this,void 0,void 0,(function*(){return yield this.generator.generate(e),this.writer.getString()}))}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}}},6300:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TextGenerator=void 0;const o=r(8256),s=r(549),n=r(8791),a=r(1353),l=r(1888),u=r(2610),c={debugGenerationInline:!1},d={[l.TextMarkType.bold]:"**",[l.TextMarkType.light]:"``",[l.TextMarkType.italic]:"__",[l.TextMarkType.highlight]:"!!"},p=new RegExp("([=*_`!])([\\^]*)\\1|([\\|\\[])","g"),h="$1$3^$2$1",y=new RegExp("^(\\||•|#)","gm"),g=new RegExp(/(\n|\r\n)/,"g"),f=new RegExp(/https?:\/\/|mailto:(.*)/,"g");t.TextGenerator=class{constructor(e,t){var r;this.ast=new o.Ast,this.textFormat=a.TextFormat.bitmarkMinusMinus,this.writerText="",this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.placeholderIndex=0,this.placeholders={},this.printed=!1,this.bitmarkVersion=null!==(r=n.BitmarkVersion.fromValue(e))&&void 0!==r?r:n.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},c),t),this.bitmarkVersion,n.BitmarkVersion.v2,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this)}generate(e,t){return i(this,void 0,void 0,(function*(){return this.resetState(t),this.walkAndWrite(e),this.writerText}))}generateSync(e,t){return this.resetState(t),this.walkAndWrite(e),this.writerText}getPlaceholders(){return this.placeholders}resetState(e){this.printed=!1,this.textFormat=null!=e?e:a.TextFormat.bitmarkMinusMinus,this.writerText="",this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.placeholderIndex=0,this.placeholders={}}walkAndWrite(e){this.ast.walk(e,s.NodeType.textAst,this,void 0)}enter(e,t,r){let i;const o=this,s=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[s]&&(i=o[s](e,t,r)),i}between(e,t,r,i,o){let s;const n=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof n[a]&&(s=n[a](e,t,r,i,o)),s}exit(e,t,r){const i=this,o=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof i[o]&&i[o](e,t,r)}leaf(e,t,r){const i=this,o=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[o]&&i[o](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_textAstValue(e,t,r){this.handleEnterNode(e.value)}between_textAstValue(e,t,r,i,o){this.handleBetweenNode(e.value)}exit_textAstValue(e,t,r){this.handleExitNode(e.value)}enter_contentValueValue(e,t,r){this.handleEnterNode(e.value)}between_contentValueValue(e,t,r,i,o){this.handleBetweenNode(e.value)}exit_contentValueValue(e,t,r){this.handleExitNode(e.value)}handleEnterNode(e){switch(this.handleIndent(e),e.type){case u.TextNodeType.paragraph:this.writeParagraph(e);break;case u.TextNodeType.hardBreak:this.writeHardBreak(e);break;case u.TextNodeType.text:this.writeMarks(e,!0),this.writeText(e);break;case u.TextNodeType.heading:this.writeHeading(e);break;case u.TextNodeType.section:this.writeSection(e);break;case u.TextNodeType.listItem:case u.TextNodeType.taskItem:this.writeBullet(e);break;case u.TextNodeType.image:this.writeImage(e);break;case u.TextNodeType.codeBlock:this.inCodeBlock=!0,this.writeCodeBlock(e);break;case u.TextNodeType.gap:case u.TextNodeType.select:case u.TextNodeType.highlight:this.writeBodyBit(e)}this.exitedCodeBlock=!1}handleBetweenNode(e){e.type}handleExitNode(e){switch(e.type){case u.TextNodeType.text:this.writeMarks(e,!1);break;case u.TextNodeType.paragraph:this.textFormat!==a.TextFormat.bitmarkMinusMinus&&this.writeNL();break;case u.TextNodeType.heading:case u.TextNodeType.section:case u.TextNodeType.image:this.writeNL(),this.writeNL();break;case u.TextNodeType.codeBlock:this.writeNL(),this.writeNL(),this.inCodeBlock=!1,this.exitedCodeBlock=!0;break;case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent<=1&&this.writeNL()}this.handleDedent(e)}handleIndent(e){switch(e.type){case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent++}}handleDedent(e){switch(e.type){case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent--}}getLinkHref(e){if(e.type===u.TextNodeType.text&&e.marks){const t=e.marks.reduce(((e,t)=>{var r;if(t.type===l.TextMarkType.link){const e=null===(r=t.attrs)||void 0===r?void 0:r.href;if(e)return e}return e}),"");if(t)return t}return!1}getIndentationString(){if(this.currentIndent===this.prevIndent)return this.indentationStringCache;let e="";for(let t=1;t<this.currentIndent;t++)e+="\t";return this.indentationStringCache=e,this.prevIndent=this.currentIndent,e}writeBodyBit(e){const t=`[!${this.placeholderIndex}]`;this.writerText+=t,this.placeholders[t]=e,this.placeholderIndex++}writeText(e){if(null==e.text)return;if(this.writeLink(e))return;const t=this.inCodeBlock;let r=e.text;if(r=t?r.replace(y,"$1^"):r.replace(p,h),this.currentIndent>1){const e=this.getIndentationString();r=r.replace(g,`$1${e}`)}this.write(r)}writeLink(e){if(null==e.text)return!1;const t=this.getLinkHref(e);if(t){let r=e.text.replace(p,h);if(this.currentIndent>1){const e=this.getIndentationString();r=r.replace(g,`$1${e}`)}return t.replace(f,"$1")===r?this.write(t):(r=`==${r}==|link:${t}|`,this.write(r)),!0}return!1}writeMarks(e,t){if(e.marks)for(const r of e.marks)switch(r.type){case l.TextMarkType.bold:case l.TextMarkType.light:case l.TextMarkType.italic:case l.TextMarkType.highlight:this.writeStandardMark(r);break;case l.TextMarkType.strike:case l.TextMarkType.sub:case l.TextMarkType.super:case l.TextMarkType.ins:case l.TextMarkType.del:case l.TextMarkType.var:case l.TextMarkType.code:case l.TextMarkType.color:this.writeInlineMark(r,t);break;case l.TextMarkType.comment:this.writeCommentMark(r,t);case l.TextMarkType.link:}}writeParagraph(e){this.exitedCodeBlock&&(this.write("|"),this.writeNL(),this.writeNL())}writeHardBreak(e){if(this.writeNL(),this.currentIndent>1){const e=this.getIndentationString();this.write(e)}}writeHeading(e){var t,r;let i="";const o=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.level)&&void 0!==r?r:1;for(let e=0;e<+o;e++)i+="#";i+=" ",this.write(i)}writeSection(e){let t="";t=e.section?`|${e.section}: `:"|",this.write(t)}writeBullet(e){var t,r;let i=this.getIndentationString();if(e.parent===u.TextNodeType.bulletList)i+="• ";else if(e.parent===u.TextNodeType.orderedList)i+="•1 ";else if(e.parent===u.TextNodeType.taskList){i+=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.checked)&&void 0!==r&&r?"•+ ":"•- "}i&&this.write(i)}writeImage(e){if(null==e.attrs||!e.attrs.src)return;const t=e.attrs;let r=`|image:${t.src}|`;for(const[e,i]of Object.entries(t))switch(e){case"textAlign":"left"!==i&&(r+=`@captionAlign:${i}|`);break;case"title":i&&(r+=`@caption:${i}|`);break;case"class":"center"!==i&&i&&(r+=`@align:${i}|`);break;case"comment":i&&(r+=`#${i}|`);break;case"alt":case"width":case"height":default:i&&(r+=`@${e}:${i}|`);case"src":}this.write(r)}writeCodeBlock(e){if(null==e.attrs||!e.attrs.language)return;const t=`|code:${e.attrs.language}\n`;this.write(t)}writeStandardMark(e){const t=d[e.type];t&&this.write(t)}writeInlineMark(e,t){if(t)this.write("==");else{let t=`==|${e.type}`;if(e.attrs)for(const[r,i]of Object.entries(e.attrs))("language"===r&&"plain text"!==i||"color"===r)&&(t=`${t}:${i}`);t=`${t}|`,this.write(t)}}writeCommentMark(e,t){if(t);else if(e.comment){const t=`#${e.comment}|`;this.write(t)}}writeString(e){null!=e&&this.write(`${e}`)}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}getBitType(e){for(const t of e)if(t.key===s.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}write(e){return this.writerText+=e,this}writeLine(e){return this.write(`${e}\n`),this}writeLines(e,t){for(const r of e)this.write(`${r}${null!=t?t:""}\n`);return this}writeWhiteSpace(){return this.write(" "),this}}},7087:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const i=r(1022),o=r(671);r(2093);let s=!1;t.init=function(){s||((0,o.initEnv)(i.buildInfo.name,i.buildInfo.version),s=!0)}},549:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeType=void 0;const i=(0,r(6688).superenum)({unknown:"unknown",bitType:"bitType",alias:"alias",root:"root",textFormat:"textFormat",bitmarkAst:"bitmarkAst",bits:"bits",bitsValue:"bitsValue",properties:"properties",property:"property",propertyValues:"propertyValues",itemLead:"itemLead",body:"body",bodyParts:"bodyParts",bodyPartsValue:"bodyPartsValue",bodyPartText:"bodyPartText",data:"data",bodyText:"bodyText",footer:"footer",footerText:"footerText",gap:"gap",select:"select",highlight:"highlight",cardNode:"cardNode",elements:"elements",solutions:"solutions",options:"options",optionsValue:"optionsValue",texts:"texts",textsValue:"textsValue",statement:"statement",statements:"statements",statementsValue:"statementsValue",choices:"choices",choicesValue:"choicesValue",responses:"responses",responsesValue:"responsesValue",quizzes:"quizzes",quizzesValue:"quizzesValue",heading:"heading",forValues:"forValues",pairs:"pairs",pairsValue:"pairsValue",values:"values",matrix:"matrix",matrixValue:"matrixValue",cells:"cells",cellsValue:"cellsValue",questions:"questions",questionsValue:"questionsValue",botResponses:"botResponses",botResponsesValue:"botResponsesValue",id:"id",idValue:"idValue",externalId:"externalId",externalIdValue:"externalIdValue",spaceId:"spaceId",spaceIdValue:"spaceIdValue",releaseVersion:"releaseVersion",releaseVersionValue:"releaseVersionValue",padletId:"padletId",padletIdValue:"padletIdValue",aiGenerated:"aiGenerated",aiGeneratedValue:"aiGeneratedValue",ageRange:"ageRange",ageRangeValue:"ageRangeValue",language:"language",languageValue:"languageValue",computerLanguage:"computerLanguage",computerLanguageValue:"computerLanguageValue",subtype:"subtype",subtypeValue:"subtypeValue",coverImage:"coverImage",coverImageValue:"coverImageValue",publisher:"publisher",publisherValue:"publisherValue",publications:"publications",publicationsValue:"publicationsValue",author:"author",authorValue:"authorValue",subject:"subject",subjectValue:"subjectValue",date:"date",dateValue:"dateValue",location:"location",locationValue:"locationValue",theme:"theme",themeValue:"themeValue",kind:"kind",kindValue:"kindValue",action:"action",actionValue:"actionValue",thumbImage:"thumbImage",thumbImageValue:"thumbImageValue",focusX:"focusX",focusXValue:"focusXValue",focusY:"focusY",focusYValue:"focusYValue",duration:"duration",durationValue:"durationValue",deeplink:"deeplink",deeplinkValue:"deeplinkValue",externalLink:"externalLink",externalLinkText:"externalLinkText",videoCallLink:"videoCallLink",videoCallLinkValue:"videoCallLinkValue",bot:"bot",botValue:"botValue",referenceProperty:"referenceProperty",referencePropertyValue:"referencePropertyValue",list:"list",listValue:"listValue",textReference:"textReference",textReferenceValue:"textReferenceValue",isTracked:"isTracked",isTrackedValue:"isTrackedValue",isInfoOnly:"isInfoOnly",isInfoOnlyValue:"isInfoOnlyValue",labelTrue:"labelTrue",labelFalse:"labelFalse",quotedPerson:"quotedPerson",partialAnswer:"partialAnswer",partialAnswerValue:"partialAnswerValue",book:"book",item:"item",lead:"lead",hint:"hint",instruction:"instruction",isDefaultExample:"isDefaultExample",isExample:"isExample",example:"example",exampleValue:"exampleValue",extraProperties:"extraProperties",title:"title",subtitle:"subtitle",level:"level",toc:"toc",tocValue:"tocValue",progress:"progress",progressValue:"progressValue",levelProperty:"levelProperty",levelPropertyValue:"LevelPropertyValue",anchor:"anchor",reference:"reference",referenceEnd:"referenceEnd",elementsValue:"elementsValue",solutionsValue:"solutionsValue",prefix:"prefix",postfix:"postfix",isCaseSensitive:"isCaseSensitive",isShortAnswer:"isShortAnswer",isCorrect:"isCorrect",forKeys:"forKeys",forValuesValue:"forValuesValue",key:"key",valuesValue:"valuesValue",question:"question",sampleSolution:"sampleSolution",sampleSolutionValue:"sampleSolutionValue",statementText:"statementText",text:"text",propertyKey:"propertyKey",propertyValue:"propertyValue",keyAudio:"keyAudio",keyImage:"keyImage",response:"response",reaction:"reaction",feedback:"feedback",partner:"partner",name:"name",avatarImage:"avatarImage",markConfig:"markConfig",markConfigValue:"markConfigValue",solution:"solution",mark:"mark",color:"color",emphasis:"emphasis",resource:"resource",resourceType:"resourceType",image:"image",audio:"audio",type:"type",format:"format",value:"value",url:"url",src:"src",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",width:"width",height:"height",alt:"alt",license:"license",copyright:"copyright",provider:"provider",showInIndex:"showInIndex",caption:"caption",posterImage:"posterImage",thumbnails:"thumbnails",thumbnailsValue:"thumbnailsValue",textAst:"textAst",textAstValue:"textAstValue",content:"contentValue",contentValue:"contentValue",contentValueValue:"contentValueValue",attrs:"attrs",section:"section",parent:"parent",marks:"marks",marksValue:"marksValue",comment:"comment",parser:"parser",version:"version",bitmarkVersion:"bitmarkVersion",warnings:"warnings",warningsValue:"warningsValue",errors:"errors",errorsValue:"errorsValue",message:"message",start:"start",end:"end",offset:"offset",line:"line",column:"column",markup:"markup"});t.NodeType=i},9881:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INFINITE_COUNT=void 0;t.INFINITE_COUNT=-1},208:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitTypeUtils=t.AliasBitType=t.RootBitType=void 0;const i=r(6688),o=(0,i.superenum)({_error:"_error",appLink:"app-link",article:"article",articleEmbed:"article-embed",articleLink:"article-link",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",bitAlias:"bit-alias",book:"book",botActionResponse:"bot-action-response",botActionSend:"bot-action-send",browserImage:"browser-image",card1:"card-1",chapter:"chapter",cloze:"cloze",clozeAndMultipleChoiceText:"cloze-and-multiple-choice-text",code:"code",conversationLeft1:"conversation-left-1",document:"document",documentDownload:"document-download",documentEmbed:"document-embed",documentLink:"document-link",essay:"essay",example:"example",flashcard:"flashcard",flashcard1:"flashcard-1",focusImage:"focus-image",highlightText:"highlight-text",image:"image",imageLink:"image-link",internalLink:"internal-link",interview:"interview",learningPathBook:"learning-path-book",learningPathExternalLink:"learning-path-external-link",learningPathVideoCall:"learning-path-video-call",mark:"mark",match:"match",matchAudio:"match-audio",matchMatrix:"match-matrix",matchPicture:"match-picture",multipleChoice:"multiple-choice",multipleChoice1:"multiple-choice-1",multipleChoiceText:"multiple-choice-text",multipleResponse:"multiple-response",multipleResponse1:"multiple-response-1",photo:"photo",quote:"quote",rating:"rating",releaseNote:"release-note",sampleSolution:"sample-solution",screenshot:"screenshot",sequence:"sequence",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",survey:"survey",surveyAnonymous:"survey-anonymous",toc:"toc",trueFalse:"true-false",trueFalse1:"true-false-1",vendorPadletEmbed:"vendor-padlet-embed",video:"video",videoEmbed:"video-embed",videoLink:"video-link",websiteLink:"website-link"});t.RootBitType=o;const s=(0,i.superenum)({aiPrompt:"ai-prompt",anchor:"anchor",appAiPrompt:"app-ai-prompt",articleAi:"article-ai",articleAttachment:"article-attachment",assignment:"assignment",audioTranscript:"audio-transcript",bitBookEnding:"bit-book-ending",bitBookSummary:"bit-book-summary",bitmarkExample:"bitmark-example",blogArticle:"blog-article",bookAcknowledgments:"book-acknowledgments",bookAddendum:"book-addendum",bookAfterword:"book-afterword",bookAppendix:"book-appendix",bookArticle:"book-article",bookAutherBio:"book-author-bio",bookBibliography:"book-bibliography",bookComingSoon:"book-coming-soon",bookConclusion:"book-conclusion",bookCopyright:"book-copyright",bookCopyrightPermissions:"book-copyright-permissions",bookDedication:"book-dedication",bookEndnotes:"book-endnotes",bookEpigraph:"book-epigraph",bookEpilogue:"book-epilogue",bookForword:"book-foreword",bookFrontispiece:"book-frontispiece",bookImprint:"book-imprint",bookIncitingIncident:"book-inciting-incident",bookIntroduction:"book-introduction",bookListOfContributors:"book-list-of-contributors",bookNotes:"book-notes",bookPostscript:"book-postscript",bookPreface:"book-preface",bookPrologue:"book-prologue",bookReadMore:"book-read-more",bookReferenceList:"book-reference-list",bookRequestForABookReview:"book-request-for-a-book-review",bookSummary:"book-summary",bookTeaser:"book-teaser",bookTitle:"book-title",botActionAnnounce:"bot-action-announce",botActionRatingNumber:"bot-action-rating-number",botActionRemind:"bot-action-remind",botActionSave:"bot-action-save",botActionTrueFalse:"bot-action-true-false",botInterview:"bot-interview",bug:"bug",chapterSubjectMatter:"chapter-subject-matter",chat:"chat",checklist:"checklist",clozeInstructionGrouped:"cloze-instruction-grouped",clozeSolutionGrouped:"cloze-solution-grouped",coachAudioTranscript:"coach-audio-transcript",coachCallToActionChecklist:"coach-call-to-action-checklist",coachCallToActionCloze:"coach-call-to-action-cloze",coachCallToActionClozeAndMultipleChoiceText:"coach-call-to-action-cloze-and-multiple-choice-text",coachCallToActionEssay:"coach-call-to-action-essay",coachCallToActionMultipleChoiceText:"coach-call-to-action-multiple-choice-text",coachHomeRules:"coach-home-rules",coachSelfReflectionCloze:"coach-self-reflection-cloze",coachSelfReflectionEssay:"coach-self-reflection-essay",coachSelfReflectionMultipleChoice:"coach-self-reflection-multiple-choice",coachSelfReflectionMultipleChoice1:"coach-self-reflection-multiple-choice-1",coachSelfReflectionMultipleChoiceText:"coach-self-reflection-multiple-choice-text",coachSelfReflectionMultipleResponse:"coach-self-reflection-multiple-response",coachSelfReflectionMultipleResponse1:"coach-self-reflection-multiple-response-1",coachSelfReflectionRating:"coach-self-reflection-rating",coachVideoTranscript:"coach-video-transcript",conclusion:"conclusion",conversationLeft1Scream:"conversation-left-1-scream",conversationLeft1Thought:"conversation-left-1-thought",conversationRight1:"conversation-right-1",conversationRight1Scream:"conversation-right-1-scream",conversationRight1Thought:"conversation-right-1-thought",cookArrangement:"cook-arrangement",cookIngredients:"cook-ingredients",cookInsert:"cook-insert",cookPersonalRecommendation:"cook-personal-recommendation",cookPlate:"cook-plate",cookPracticeAdvise:"cook-practice-advise",cookPreparation:"cook-preparation",cookRecommendation:"cook-recommendation",cookRemark:"cook-remark",cookSideDish:"cook-side-dish",cookSideDrink:"cook-side-drink",cookStep:"cook-step",cookTimer:"cook-timer",cookVariation:"cook-variation",correction:"correction",danger:"danger",details:"details",details1:"details-1",documentUpload:"document-upload",editorial:"editorial",editorNote:"editor-note",featured:"featured",footNote:"foot-note",groupBorn:"group-born",groupDied:"group-died",help:"help",hint:"hint",imageLandscape:"image-landscape",imageOnDevice:"image-on-device",imagePortrait:"image-portrait",imagePrototype:"image-prototype",imageSuperWide:"image-super-wide",imageZoom:"image-zoom",info:"info",interviewInstructionGrouped:"interview-instruction-grouped",langAudioScript:"lang-audio-script",langEnablingLanguageSkills:"lang-enabling-language-skills",langEnglishAroundWorld:"lang-english-around-world",langExtraActivity:"lang-extra-activity",langGoodToKnow:"lang-good-to-know",langHomework:"lang-homework",langLearningGoal:"lang-learning-goal",langLearningOutcomes:"lang-learning-outcomes",langLearningStrategy:"lang-learning-strategy",langLevelDown:"lang-level-down",langLevelUp:"lang-level-up",langLifeSkills:"lang-life-skills",langLikeALocal:"lang-like-a-local",langMaterial:"lang-material",langTeacherNote:"lang-teacher-note",langTeacherPronunciation:"lang-teacher-pronunciation",langUsefulPhrases:"lang-useful-phrases",langVideoScript:"lang-video-script",langVocabulary:"lang-vocabulary",learningPathBotTraining:"learning-path-bot-training",learningPathClassroomEvent:"learning-path-classroom-event",learningPathClassroomTraining:"learning-path-classroom-training",learningPathClosing:"learning-path-closing",learningPathExternalLink:"learning-path-external-link",learningPathFeedback:"learning-path-feedback",learningPathLearningGoal:"learning-path-learning-goal",learningPathLti:"learning-path-lti",learningPathSign:"learning-path-sign",learningPathStep:"learning-path-step",learningPathVideoCall:"learning-path-video-call",matchAll:"match-all",matchAllReverse:"match-all-reverse",matchReverse:"match-reverse",matchSolutionGrouped:"match-solution-grouped",message:"message",newspaperArticle:"newspaper-article",note:"note",noteAi:"note-ai",notebookArticle:"notebook-article",page:"page",preparationNote:"preparation-note",question1:"question-1",recordAudio:"record-audio",releaseNotesSummary:"release-notes-summary",remark:"remark",reviewApprovedNote:"review-approved-note",reviewAuthorNote:"review-author-note",reviewNote:"review-note",reviewRequestForReviewNote:"review-request-for-review-note",reviewReviewerNote:"review-reviewer-note",selfAssessment:"self-assessment",sideNote:"side-note",statement:"statement",stickyNote:"sticky-note",summary:"summary",summaryAi:"summary-ai",survey1:"survey-1",surveyAnonymous1:"survey-anonymous-1",takePicture:"take-picture",videoLandscape:"video-landscape",videoPortrait:"video-portrait",videoTranscript:"video-transcript",warning:"warning",workbookArticle:"workbook-article"});t.AliasBitType=s;const n={[o.article]:[s.page,s.statement],[o.book]:[s.bookAcknowledgments,s.bookAddendum,s.bookAfterword,s.bookAppendix,s.bookArticle,s.bookAutherBio,s.bookBibliography,s.bookComingSoon,s.bookConclusion,s.bookCopyright,s.bookCopyrightPermissions,s.bookDedication,s.bookEndnotes,s.bookEpigraph,s.bookEpilogue,s.bookForword,s.bookFrontispiece,s.bookImprint,s.bookIncitingIncident,s.bookIntroduction,s.bookListOfContributors,s.bookNotes,s.bookPostscript,s.bookPreface,s.bookPrologue,s.bookReadMore,s.bookReferenceList,s.bookRequestForABookReview,s.bookSummary,s.bookTeaser,s.bookTitle],[o.cloze]:[s.clozeInstructionGrouped,s.clozeSolutionGrouped,s.coachSelfReflectionCloze,s.coachCallToActionCloze],[o.clozeAndMultipleChoiceText]:[s.coachCallToActionClozeAndMultipleChoiceText],[o.conversationLeft1]:[s.conversationLeft1Scream,s.conversationLeft1Thought,s.conversationRight1,s.conversationRight1Scream,s.conversationRight1Thought],[o.essay]:[s.coachSelfReflectionEssay,s.coachCallToActionEssay],[o.example]:[s.appAiPrompt,s.aiPrompt,s.articleAi,s.articleAttachment,s.assignment,s.audioTranscript,s.bitmarkExample,s.blogArticle,s.bug,s.checklist,s.coachAudioTranscript,s.coachCallToActionChecklist,s.coachHomeRules,s.coachVideoTranscript,s.correction,s.cookPreparation,s.cookStep,s.cookIngredients,s.cookRemark,s.cookVariation,s.cookInsert,s.cookArrangement,s.cookPracticeAdvise,s.cookPlate,s.cookRecommendation,s.cookPersonalRecommendation,s.cookSideDrink,s.cookSideDish,s.cookTimer,s.danger,s.details1,s.details,s.editorial,s.editorNote,s.featured,s.help,s.hint,s.info,s.langLearningOutcomes,s.langEnablingLanguageSkills,s.langLifeSkills,s.langEnglishAroundWorld,s.langGoodToKnow,s.langLearningGoal,s.langLearningStrategy,s.langLikeALocal,s.langMaterial,s.langUsefulPhrases,s.langLevelDown,s.langLevelUp,s.langExtraActivity,s.langVideoScript,s.langAudioScript,s.langVocabulary,s.langHomework,s.langTeacherNote,s.langTeacherPronunciation,s.message,s.newspaperArticle,s.note,s.noteAi,s.notebookArticle,s.preparationNote,s.releaseNotesSummary,s.remark,s.reviewNote,s.reviewAuthorNote,s.reviewReviewerNote,s.reviewRequestForReviewNote,s.reviewApprovedNote,s.selfAssessment,s.sideNote,s.summary,s.summaryAi,s.videoTranscript,s.warning,s.workbookArticle],[o.image]:[s.imageLandscape,s.imageOnDevice,s.imagePortrait,s.imagePrototype,s.imageSuperWide,s.imageZoom],[o.interview]:[s.interviewInstructionGrouped,s.botInterview],[o.learningPathBook]:[s.learningPathBotTraining,s.learningPathClassroomEvent,s.learningPathClassroomTraining,s.learningPathClosing,s.learningPathFeedback,s.learningPathLearningGoal,s.learningPathLti,s.learningPathSign,s.learningPathStep],[o.card1]:[s.question1,s.survey1,s.surveyAnonymous1],[o.match]:[s.matchAll,s.matchReverse,s.matchAllReverse,s.matchSolutionGrouped],[o.multipleChoice1]:[s.coachSelfReflectionMultipleChoice1],[o.multipleChoice]:[s.coachSelfReflectionMultipleChoice],[o.multipleChoiceText]:[s.coachCallToActionMultipleChoiceText,s.coachSelfReflectionMultipleChoiceText],[o.multipleResponse1]:[s.coachSelfReflectionMultipleResponse1],[o.multipleResponse]:[s.coachSelfReflectionMultipleResponse],[o.rating]:[s.coachSelfReflectionRating],[o.toc]:[s.anchor,s.bitBookEnding,s.bitBookSummary,s.botActionAnnounce,s.botActionRatingNumber,s.botActionRemind,s.botActionSave,s.botActionTrueFalse,s.chapterSubjectMatter,s.chat,s.conclusion,s.documentUpload,s.footNote,s.groupBorn,s.groupDied,s.recordAudio,s.stickyNote,s.takePicture],[o.video]:[s.videoLandscape,s.videoPortrait]},a=new Map;class l{static getBitType(e){const t=l.getAliasedBitType(e);return{alias:t,root:l.getRootBitType(t)}}static getRootBitType(e){var t;return e&&null!==(t=a.get(e))&&void 0!==t?t:o._error}static getAliasedBitType(e){var t,r;return null!==(r=null!==(t=s.fromValue(e))&&void 0!==t?t:o.fromValue(e))&&void 0!==r?r:o._error}}t.BitTypeUtils=l,function(){for(const e of o.values())a.set(e,e);for(const[e,t]of Object.entries(n))for(const r of t)a.set(r,e)}()},6958:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParserType=void 0;const i=(0,r(6688).superenum)({antlr:"antlr",peggy:"peggy"});t.BitmarkParserType=i},8791:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_BITMARK_VERSION=t.BitmarkVersion=void 0;const i=(0,r(6688).superenum)({v2:2,v3:3});t.BitmarkVersion=i;const o=i.v3;t.DEFAULT_BITMARK_VERSION=o},1060:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BodyBitType=void 0;const i=(0,r(6688).superenum)({text:"text",gap:"gap",mark:"mark",select:"select",highlight:"highlight"});t.BodyBitType=i},7210:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetType=void 0;const i=(0,r(6688).superenum)({elements:"elements",statements:"statements",quiz:"quiz",questions:"questions",matchPairs:"matchPairs",matchMatrix:"matchMatrix",botActionResponses:"botActionResponses"});t.CardSetType=i},8565:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetVersion=void 0;const i=(0,r(6688).superenum)({v1:1,v2:2});t.CardSetVersion=i},7028:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExampleType=void 0;const i=(0,r(6688).superenum)({none:"none",string:"string",boolean:"boolean"});t.ExampleType=i},4719:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyKey=void 0;const i=(0,r(6688).superenum)({id:"id",externalId:"externalId",spaceId:"spaceId",padletId:"padletId",aiGenerated:"AIGenerated",releaseVersion:"releaseVersion",ageRange:"ageRange",language:"language",computerLanguage:"computerLanguage",subtype:"subtype",coverImage:"coverImage",publisher:"publisher",publications:"publications",author:"author",subject:"subject",date:"date",location:"location",theme:"theme",kind:"kind",action:"action",thumbImage:"thumbImage",focusX:"focusX",focusY:"focusY",deeplink:"deeplink",externalLink:"externalLink",externalLinkText:"externalLinkText",videoCallLink:"videoCallLink",bot:"bot",duration:"duration",reference:"reference",list:"list",textReference:"textReference",isTracked:"isTracked",isInfoOnly:"isInfoOnly",labelTrue:"labelTrue",labelFalse:"labelFalse",quotedPerson:"quotedPerson",partialAnswer:"partialAnswer",example:"example",toc:"toc",progress:"progress",level:"level",book:"book",partner:"partner",sampleSolution:"sampleSolution",mark:"mark",type:"type",color:"color",emphasis:"emphasis",shortAnswer:"shortAnswer",longAnswer:"longAnswer",caseSensitive:"caseSensitive",reaction:"reaction",width:"width",height:"height",license:"license",copyright:"copyright",caption:"caption",showInIndex:"showInIndex",alt:"alt",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",mute:"mute",autoplay:"autoplay",allowSubtitles:"allowSubtitles",showSubtitles:"showSubtitles",siteName:"siteName",posterImage:"posterImage"});t.PropertyKey=i},1895:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceType=void 0;const i=(0,r(6688).superenum)({unknown:"unknown",image:"image",imageEmbed:"imageEmbed",imageLink:"image-link",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",video:"video",videoEmbed:"video-embed",videoLink:"video-link",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",article:"article",articleEmbed:"articleEmbed",articleLink:"articleLink",document:"document",documentEmbed:"document-embed",documentLink:"document-link",documentDownload:"document-download",appLink:"app-link",websiteLink:"website-link"});t.ResourceType=i},6562:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TagType=void 0;const i=(0,r(6688).superenum)({Title:"Title",Anchor:"Anchor",Reference:"Reference",Property:"Property",ItemLead:"ItemLead",Instruction:"Instruction",Hint:"Hint",True:"True",False:"False",SampleSolution:"SampleSolution",Gap:"Gap",Mark:"Mark",Resource:"Resource",Remark:"Remark",Comment:"Comment"});t.TagType=i},1353:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextFormat=void 0;const i=(0,r(6688).superenum)({text:"text",bitmarkMinusMinus:"bitmark--",bitmarkPlusPlus:"bitmark++"});t.TextFormat=i},1888:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextMarkType=void 0;const i=(0,r(6688).superenum)({bold:"bold",light:"light",italic:"italic",highlight:"highlight",strike:"strike",sub:"sub",super:"super",ins:"ins",del:"del",link:"link",var:"var",code:"code",color:"color",hash:"#",comment:"comment"});t.TextMarkType=i},2610:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextNodeType=void 0;const i=(0,r(6688).superenum)({text:"text",hardBreak:"hardBreak",paragraph:"paragraph",heading:"heading",section:"section",bulletList:"bulletList",orderedList:"orderedList",taskList:"taskList",listItem:"listItem",taskItem:"taskItem",image:"image",codeBlock:"codeBlock",gap:"gap",select:"select",highlight:"highlight"});t.TextNodeType=i},9556:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParser=void 0;const i=r(6958),o=r(2434),s=r(8030);t.BitmarkParser=class{constructor(){this.jsonParser=new o.JsonParser}toAst(e,t){return Object.assign({},t).parserType===i.BitmarkParserType.antlr?this.jsonParser.toAst(this.parseUsingAntlr(e)):(0,s.parse)(e)}parseUsingAntlr(e){if(!function(){let e=!1;return e}())throw new Error("ANTLR parser is not available");const t=(0,bitmark_grammar_1.parse)(e);return JSON.parse(t)}}},8030:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const i=r(4369).parse;t.parse=i},2892:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserHelper=void 0;const i=r(7542),o=r(6831);r(2093);t.BitmarkPegParserHelper=class{constructor(e){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0,this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation}handleRawBit(e){var t,r;const o=e.trim();if(this.debugPrint("RAW BIT",o),!o)return;const s=null!==(r=null===(t=this.parserLocation())||void 0===t?void 0:t.start)&&void 0!==r?r:{line:1,column:1,offset:0},n=this.parse(e,{startRule:"bit",grammarSource:new i.PeggyGrammarLocation("bit",s)});return n.value&&(n.value.markup=o),n}handleTextFormat(e){return{type:o.TypeKey.TextFormat,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceType(e){return{type:o.TypeKey.ResourceType,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleBitContent(e){let t=this.reduceToArrayOfTypes(e);return t=this.mergeCharToText(t),t}handleBitTag(e){return e}handleTag(e,t){return{type:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handlePropertyTag(e,t){return{type:o.TypeKey.Property,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceTag(e,t){return{type:o.TypeKey.Resource,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleTagChain(e){const t=this.reduceToArrayOfTypes(e);let r=t;if(t.length>1){const e=t[0];e.chain=t.slice(1),r=[e]}return r}handleCardSet(e){const t=e,r={cards:[]},s={cards:[]};if(t){for(const e of t){if(!e)continue;const{type:t,value:i,parser:s}=e;if(!t||t!==o.TypeKey.Card)continue;const{cardIndex:n,cardSideIndex:a,cardVariantIndex:l,value:u}=i;let c=r.cards[n];c||(c={sides:[]},r.cards[n]=c);let d=c.sides[a];d||(d={variants:[]},c.sides[a]=d);d.variants[l]?d.variants[l].value+=u:d.variants[l]={value:u,parser:s}}for(const e of r.cards){const t={sides:[]};s.cards.push(t);for(const r of e.sides){const e={variants:[]};t.sides.push(e);for(const t of r.variants){let r={line:1,column:1,offset:0};if(t.parser.location){r=t.parser.location.start;const e=t.parser.text,i=e?e.length:0,o=1;r.offset+=i,r.line+=o}let o=this.parse(t.value,{startRule:"cardContent",grammarSource:new i.PeggyGrammarLocation("card-content",r)});o=this.reduceToArrayOfTypes(o),this.debugPrint("parsedCardContent",o),e.variants.push(o)}}}}return{type:o.TypeKey.CardSet,value:s,parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardSetStart(){this.cardIndex=-1,this.cardSideIndex=0,this.cardVariantIndex=0}handleCardSetEnd(){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0}handleCards(e){return e}handleCardLineOrDivider(e,t){let r=!1,i=!1,s=!1;return Array.isArray(e)&&2===e.length&&(e=e[0],1===t?(r=e===o.CARD_DIVIDER_V1,i=e===o.CARD_SIDE_DIVIDER_V1,s=e===o.CARD_VARIANT_DIVIDER_V1):(r=e===o.CARD_DIVIDER_V2,i=e===o.CARD_SIDE_DIVIDER_V2,s=e===o.CARD_VARIANT_DIVIDER_V2)),r?(this.cardIndex++,this.cardSideIndex=0,this.cardVariantIndex=0):i?(this.cardSideIndex++,this.cardVariantIndex=0):s&&this.cardVariantIndex++,this.isType(e,o.TypeKey.Card)?e:{type:o.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:""},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardLine(e){return{type:o.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:e},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardContent(e){return this.mergeCharToText(e)}handleCardTags(e){return e}mergeCharToText(e){var t,r,i,s,n,a;const l=[];let u,c;for(const d of e)switch(d.type){case o.TypeKey.BodyChar:if(u){const e=`${null!==(t=u.value)&&void 0!==t?t:""}${null!==(r=d.value)&&void 0!==r?r:""}`;u.value=e}else u={type:o.TypeKey.BodyText,value:null!==(i=d.value)&&void 0!==i?i:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;case o.TypeKey.CardChar:if(c){const e=`${null!==(s=c.value)&&void 0!==s?s:""}${null!==(n=d.value)&&void 0!==n?n:""}`;c.value=e}else c={type:o.TypeKey.CardText,value:null!==(a=d.value)&&void 0!==a?a:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;default:u&&(l.push(u),u=void 0),c&&(l.push(c),c=void 0),l.push(d)}return u&&l.push(u),c&&l.push(c),l}isType(e,t){if(!e)return!1;const{type:r}=e;return t?Array.isArray(t)?t.indexOf(r)>=0:t===r:!!o.TypeKey.fromValue(r)}reduceToArrayOfTypes(e,t,r){if(!Array.isArray(e))return[];return e.reduce(((e,i,o)=>{if(null==i)return e;const{type:s,value:n}=i;if(Array.isArray(i)){const r=this.reduceToArrayOfTypes(i,t);e.push(...r)}else{if(!this.isType(i,t))return e;if(r&&Array.isArray(n)){const r=this.reduceToArrayOfTypes(n,t);e.push(...r)}else s&&e.push(i)}return e}),[])}debugPrint(e,t){}}},7448:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserProcessor=void 0;const o=r(9046),s=r(208),n=r(1060),a=r(1895),l=r(1353),u=r(8386),c=r(1182),d=r(6934),p=r(8081),h=r(9577),y=r(9457),g=r(857),f=r(3287),m=r(3130),b=r(5516),v=r(1838),T=r(4177),A=r(6831),P=new o.Builder;t.BitmarkPegParserProcessor=class{constructor(e){this.nonFatalWarnings=[],this.nonFatalErrors=[],this.parser={},this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation,this.context={DEBUG_BIT_RAW:true,DEBUG_BIT_CONTENT_RAW:false,DEBUG_BIT_CONTENT:true,DEBUG_BIT_TAGS:true,DEBUG_BODY:true,DEBUG_FOOTER:true,DEBUG_CHAIN_CONTENT:true,DEBUG_CHAIN_TAGS:true,DEBUG_CARD_SET_CONTENT:true,DEBUG_CARD_SET:true,DEBUG_CARD_TAGS:true,parser:this.parser,parse:this.parse,bitContentProcessor:this.bitContentProcessor.bind(this),splitBitContent:this.splitBitContent.bind(this),addWarning:this.addWarning.bind(this),addError:this.addError.bind(this),debugPrint:this.debugPrint.bind(this)}}buildBits(e){var t;const r=[];let i=[];for(const o of e){if(!o)continue;const e=o.value;e?r.push(e):i=i.concat(null!==(t=o.errors)&&void 0!==t?t:[])}return P.bitmark({bits:r,errors:i.length>0?i:void 0})}buildBit(e,t){const{bitType:r,textFormat:o,resourceType:n}=e;if(!r||r.root===s.RootBitType._error)return this.invalidBit();const a=r.root===s.RootBitType.trueFalse1,l=r.root===s.RootBitType.multipleChoice1,d=r.root===s.RootBitType.multipleResponse1;this.debugPrint("BIT CONTENT",t),t=u.BitmarkPegParserValidator.validateBitTags(this.context,r,t);const p=this.bitContentProcessor(A.BitContentLevel.Bit,r,t),{body:h,footer:y,cardSet:g,title:f,statement:m,statements:T,choices:_,responses:x,resources:w,comments:S}=p,O=i(p,["body","footer","cardSet","title","statement","statements","choices","responses","resources","comments"]);this.debugPrint("BIT TAGS",O),this.debugPrint("BIT BODY",h),this.debugPrint("BIT FOOTER",y);const R=(0,v.buildTitles)(this.context,r,f),k=(0,c.buildCards)(this.context,r,g,m,T,_,x),C=(0,b.buildResource)(this.context,r,n,w);(S||k.comments)&&(this.parser.comments=[],S&&this.parser.comments.push(...S),k.comments&&this.parser.comments.push(...k.comments));const E=this.buildBitLevelWarnings(),I=this.buildBitLevelErrors();E&&(this.parser.warnings=E),I&&(this.parser.errors=I);return{value:P.bit(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({bitType:r,textFormat:o,resourceType:n},R),{statement:a?m:void 0,choices:l?_:void 0,responses:d?x:void 0}),O),{resource:C}),k),{body:h,footer:y,parser:this.parser}))}}invalidBit(e){e&&this.addError("Invalid bit"),this.parser.errors=this.buildBitLevelErrors();return{value:P.bit({bitType:s.BitTypeUtils.getBitType(s.RootBitType._error),parser:this.parser})}}buildBitHeader(e,t){var r;const i=s.BitTypeUtils.getBitType(e);return i.root===s.RootBitType._error&&this.addError(`Invalid bit type: '${e}'`),{bitType:i,textFormat:null!==(r=t.textFormat)&&void 0!==r?r:l.TextFormat.bitmarkMinusMinus,resourceType:t.resourceType}}buildTextAndResourceType(e,t){const r={textFormat:l.TextFormat.bitmarkMinusMinus},i=e=>{var t;e&&(e.type===A.TypeKey.TextFormat?(r.textFormat=l.TextFormat.fromValue(e.value),e.value&&!r.textFormat&&this.addWarning(`Invalid text format '${e.value}', defaulting to '${l.TextFormat.bitmarkMinusMinus}'`),r.textFormat=null!==(t=r.textFormat)&&void 0!==t?t:l.TextFormat.bitmarkMinusMinus):(r.resourceType=a.ResourceType.fromValue(e.value),e.value&&!r.resourceType&&this.addWarning(`Invalid resource type '${e.value}', it will be ignored`)))};return i(e),i(t),r}bitContentProcessor(e,t,r){const i={};if(!r)return i;i.title=[],i.solutions=[],i.statements=[],i.choices=[],i.responses=[],i.resources=[],i.trueFalse=[],i.markConfig=[],i.extraProperties={},i.comments=[];let o=!1,s=!1,n=!1;const a=[];let l="",c="",_="";const x=e===A.BitContentLevel.Chain,w=()=>{if(l){l=u.BitmarkPegParserValidator.checkBodyPart(this.context,e,t,l);const r=P.bodyText({text:l});a.push(r)}l=""};return r.forEach(((r,u)=>{const{type:P,value:S}=r;switch(P){case A.TypeKey.Comment:(0,d.commentTagContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.ItemLead:(0,y.itemLeadTagContentProcessor)(this.context,e,t,r,i,o),o=!0;break;case A.TypeKey.Instruction:case A.TypeKey.Hint:case A.TypeKey.Anchor:case A.TypeKey.SampleSolution:(0,p.defaultTagContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.Reference:(0,m.referenceTagContentProcessor)(this.context,e,t,r,i,s),s=!0;break;case A.TypeKey.Title:(0,v.titleTagContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.Property:(0,f.propertyContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.Gap:x||w(),(0,h.gapChainContentProcessor)(this.context,e,t,r,i,a);break;case A.TypeKey.Mark:x||w(),(0,g.markChainContentProcessor)(this.context,e,t,r,i,a);break;case A.TypeKey.True:case A.TypeKey.False:x||w(),(0,T.trueFalseChainContentProcessor)(this.context,e,t,r,i,a);break;case A.TypeKey.Resource:(0,b.resourceContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.CardSet:i.cardSet=S,n=!0;break;case A.TypeKey.BodyText:n?c+=S:l+=S;break;case A.TypeKey.CardText:_+=S}})),w(),i.body=a.length>0?P.body({bodyParts:this.trimBodyParts(a)}):void 0,u.BitmarkPegParserValidator.checkBody(this.context,e,t,i.body),c=c.trim(),c&&(c=u.BitmarkPegParserValidator.checkFooter(this.context,e,t,c),c&&(i.footer=P.footerText({text:c}))),_=_.trim(),_&&(i.cardBody=_),0===Object.keys(i.extraProperties).length&&delete i.extraProperties,0===i.title.length&&delete i.title,0===i.solutions.length&&delete i.solutions,0===i.statements.length&&delete i.statements,0===i.choices.length&&delete i.choices,0===i.responses.length&&delete i.responses,0===i.trueFalse.length&&delete i.trueFalse,0===i.markConfig.length&&delete i.markConfig,0===i.resources.length&&delete i.resources,0===i.comments.length&&delete i.comments,i}buildBitLevelWarnings(){let e;return this.nonFatalWarnings.length>0&&(e=this.nonFatalWarnings,this.nonFatalWarnings=[]),e}buildBitLevelErrors(){let e;return this.nonFatalErrors.length>0&&(e=this.nonFatalErrors,this.nonFatalErrors=[]),e}splitBitContent(e,t){const r=[];let i=[];for(const o of e)t.includes(o.type)&&(i.length>0&&r.push(i),i=[]),i.push(o);return i.length>0&&r.push(i),r}trimBodyParts(e){let t=!1,r=e.reduce(((e,r)=>{const i=r;if(t||i.type!==n.BodyBitType.text)t=!0,e.push(r);else{const r=i.data.bodyText.trimStart();r&&(t=!0,i.data.bodyText=r,e.push(i))}return e}),[]);return t=!1,r=r.reduceRight(((e,r)=>{const i=r;if(t||i.type!==n.BodyBitType.text)t=!0,e.unshift(r);else{const r=i.data.bodyText.trimEnd();r&&(t=!0,i.data.bodyText=r,e.unshift(i))}return e}),[]),r}addWarning(e,t,r){var i,o,s;const n={message:e,text:null!==(i=null==t?void 0:t.parser.text)&&void 0!==i?i:this.parserText(),location:null!==(o=null==t?void 0:t.parser.location)&&void 0!==o?o:this.parserLocation(),original:null!==(s=null==r?void 0:r.parser)&&void 0!==s?s:void 0};n.original||delete n.original,this.nonFatalWarnings.push(n)}addError(e,t,r){var i,o,s;const n={message:e,text:null!==(i=null==t?void 0:t.parser.text)&&void 0!==i?i:this.parserText(),location:null!==(o=null==t?void 0:t.parser.location)&&void 0!==o?o:this.parserLocation(),original:null!==(s=null==r?void 0:r.parser)&&void 0!==s?s:void 0};n.original||delete n.original,this.nonFatalErrors.push(n)}debugPrint(e,t){}}},6831:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARD_VARIANT_DIVIDER_V1=t.CARD_SIDE_DIVIDER_V1=t.CARD_DIVIDER_V1=t.CARD_VARIANT_DIVIDER_V2=t.CARD_SIDE_DIVIDER_V2=t.CARD_DIVIDER_V2=t.BitContentLevel=t.TypeKey=void 0;const i=r(6688);t.CARD_DIVIDER_V2="====";t.CARD_SIDE_DIVIDER_V2="--";t.CARD_VARIANT_DIVIDER_V2="~~";t.CARD_DIVIDER_V1="===";t.CARD_SIDE_DIVIDER_V1="==";t.CARD_VARIANT_DIVIDER_V1="--";const o=(0,i.superenum)({TextFormat:"TextFormat",ResourceType:"ResourceType",Title:"Title",Anchor:"Anchor",Reference:"Reference",ItemLead:"ItemLead",Instruction:"Instruction",Hint:"Hint",True:"True",False:"False",Gap:"Gap",Mark:"Mark",SampleSolution:"SampleSolution",Comment:"Comment",Property:"Property",Resource:"Resource",TagChain:"TagChain",BodyChar:"BodyChar",BodyText:"BodyText",CardSet:"CardSet",Card:"Card",CardChar:"CardChar",CardText:"CardText",GapChain:"GapChain",TrueFalseChain:"TrueFalseChain"});t.TypeKey=o;const s=(0,i.superenum)({Bit:"Bit",Card:"Card",Chain:"Chain"});t.BitContentLevel=s},8386:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserValidator=void 0;const i=r(9881),o=r(208),s=r(6831),n=["====","----","\n==\n","\n---\n","\n--\n",":::","::::","|||","||||"],a=["==\n","---\n","--\n"],l=["\n==","\n---","\n--"];const u=new class{validateBitTags(e,t,r){if(!r)return[];const i=this.getMetadataForBitType(t),{tags:o,cardSet:n}=i;return this.validateTagChainsRecursive(e,s.BitContentLevel.Bit,t,r,o,n)}checkBody(e,t,r,i){if(!i)return i;const o=this.getMetadataForBitType(r),{bodyAllowed:s}=o;return i.bodyParts.length>0&&!s&&e.addWarning(`Bit '${r.alias}' should not have a body.`),i}checkBodyPart(e,t,r,i){return i?(this.checkBodyForCommonPotentialMistakes(e,t,r,i),i):i}checkFooter(e,t,r,i){if(!i)return i;const o=this.getMetadataForBitType(r),{footerAllowed:s}=o;return this.checkBodyForCommonPotentialMistakes(e,t,r,i),s||e.addWarning(`Bit '${r.alias}' should not have a footer.`),i}checkCardBody(e,t,r,i,o,s,n){if(!i)return i;const a=this.getMetadataForBitType(r);if(!a.cardSet)return i;const l=this.getVariantConfig(a.cardSet.variants,s,n);if(!l)return i;const{bodyAllowed:u}=l;return this.checkBodyForCommonPotentialMistakes(e,t,r,i),u||e.addWarning(`Bit '${r.alias}' should not have a card body at card:${o+1}, side:${s+1}, variant:${n+1}.`),i}validateTagChainsRecursive(e,t,r,o,n,a){if(!o)return[];const l=[...o],u=new Map,c=this.convertTagsToTypeKeyMap(n);c.set(s.TypeKey.Comment,{maxCount:i.INFINITE_COUNT}),t===s.BitContentLevel.Bit?(a&&c.set(s.TypeKey.CardSet,{_key:a.type}),c.set(s.TypeKey.TextFormat,{}),c.set(s.TypeKey.BodyText,{maxCount:i.INFINITE_COUNT})):t===s.BitContentLevel.Card&&c.set(s.TypeKey.CardText,{maxCount:i.INFINITE_COUNT});for(let i=0;i<l.length;i++){const o=l[i];if(!o)continue;const{type:n,key:d}=o,p=s.TypeKey.fromValue(n);if(!p)continue;let h=p;p!==s.TypeKey.Property&&p!==s.TypeKey.Resource||(h=`${p}:${d}`);const y=c.get(h),g=this.validateSingleTag(e,t,r,o,p,h,y,u,a);if(g||l.splice(i,1,null),g&&Array.isArray(g.chain)&&g.chain.length>0)if(y&&y.chain){const t=this.validateTagChainsRecursive(e,s.BitContentLevel.Chain,r,g.chain,y.chain);t&&t.length>0?g.chain=t:g.chain=void 0}else l.splice(i+1,0,...g.chain),g.chain=void 0}return l.filter((e=>null!=e))}validateSingleTag(e,t,r,i,o,n,a,l,u){const{type:c,key:d}=i,p=c===s.TypeKey.Property||c===s.TypeKey.Resource?` with key '${d}'`:"",h=" It will be ignored";let y,g,f="",m=l.get(n);null==m&&(m={count:0},l.set(n,m));let b=m.previous;if(m.count++,a)switch(o){case s.TypeKey.Property:{const{content:o,warning:s}=this.validatePropertyTag(e,t,r,a,i,m);y=o,g=s;break}case s.TypeKey.Resource:{const{content:o,warning:s}=this.validateResourceTag(e,t,r,a,i,m);y=o,g=s;break}case s.TypeKey.CardSet:{const{content:t,warning:o}=this.validateCardSet(e,r,a,i,u);y=t,g=o;break}default:{const{content:o,warning:s}=this.validateStandardTag(e,t,r,a,i,m);y=o,g=s}}else switch(o){case s.TypeKey.Property:g={extraProperty:!0},y=i;break;case s.TypeKey.Resource:g={excessResource:!0},y=i;break;default:g={invalid:!0}}return g&&(b=m.previous,g.invalid||g.excessResource?f=`'${c}'${p} is not valid here.${h}`:g.tooMany?f=`'${c}'${p} is included more than ${g.tooMany} time(s). The earlier ones will be ignored`:g.extraProperty?f=`'${c}'${p} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`:g.unexpectedCardSet?f=`'${c}'${p} is not expected here.${h}`:g.unexpectedCardSideVariant&&(f=`'${c}'${p} has a card / side / variant that is not expected here.${h}`),e.addWarning(f,i,b)),m.previous=i,y}validateStandardTag(e,t,r,i,o,s){const n=null==i.maxCount?1:i.maxCount;return n>0&&s.count>n?{warning:{tooMany:n},content:o}:{content:o}}validatePropertyTag(e,t,r,i,o,s){const n=null==i.maxCount?1:i.maxCount;return n>0&&s.count>n?{warning:{tooMany:n},content:o}:{content:o}}validateResourceTag(e,t,r,i,o,s){const n=null==i.maxCount?1:i.maxCount;return n>0&&s&&s.count>n?{warning:{tooMany:n},content:o}:{content:o}}validateCardSet(e,t,r,i,o){if(!o||!o.variants||0===o.variants.length)return{warning:{unexpectedCardSet:!0}};const{value:n}=i,a=n;let l,u=0,c=0;for(const r of a.cards){u=0;for(const i of r.sides){c=0;for(const r of i.variants){let n;const a=this.getVariantConfig(o.variants,u,c);a?n=this.validateTagChainsRecursive(e,s.BitContentLevel.Card,t,r,a.tags):l={unexpectedCardSideVariant:!0},n&&n.length>0?i.variants[c]=n:i.variants[c]=[],c++}u++}}return{content:i,warning:l}}checkBodyForCommonPotentialMistakes(e,t,r,i){if(i){for(const t of n)i.includes(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of a)i.startsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of l)i.endsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`)}}convertTagsToTypeKeyMap(e){const t=new Map;for(const[r,i]of Object.entries(e))if(i._key=r,i.isProperty)t.set(`${s.TypeKey.Property}:${r}`,i);else if(i.isResource)t.set(`${s.TypeKey.Resource}:${r}`,i);else{const e=s.TypeKey.fromValue(r);e&&t.set(e,i)}return t}getVariantConfig(e,t,r){let i;if(0===e.length)return;const o=e[Math.min(t,e.length-1)],s=o.length-1;if(r>s){if(i=o[s],!i.infiniteRepeat)return}else i=o[r];return i}getMetadataForBitType(e){const t=o.RootBitType.getMetadata(e.root);if(!t)throw new Error(`Root bit type ${e.root} has no metadata`);return t}};t.BitmarkPegParserValidator=u},7542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PeggyGrammarLocation=void 0;t.PeggyGrammarLocation=class{constructor(e,t){this.source=e,this.start=t}toString(){return String(this.source)}offset(e){return{line:e.line+this.start.line-1,column:1===e.line?e.column+this.start.column-1:e.column,offset:e.offset+this.start.offset}}static offsetStart(e){return e.source&&"function"==typeof e.source.offset?e.source.offset(e.start):e.start}static offsetEnd(e){return e.source&&"function"==typeof e.source.offset?e.source.offset(e.end):e.end}}},4185:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.bookChainContentProcessor=void 0;const i=r(3633),o=r(6831);t.bookChainContentProcessor=function(e,t,r,s,n){if(t===o.BitContentLevel.Chain);else{const t=function(e,t,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("book content",r);const s=e.bitContentProcessor(o.BitContentLevel.Chain,t,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("book TAGS",s);const{reference:n,referenceEnd:a}=s,l=i.StringUtils.trimmedString(r.value);return{book:l,reference:n,referenceEnd:a}}(e,r,s);n.book=t.book,n.reference=t.reference,n.referenceEnd=t.referenceEnd}}},1182:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.buildCards=void 0;const o=r(9046),s=r(208),n=r(7210),a=r(1895),l=r(8386),u=r(6831),c=new o.Builder;t.buildCards=function(e,t,r,o,d,p,h){var y;e.DEBUG_CARD_SET&&e.debugPrint("card set",r);let g={};const f=function(e,t,r){const i={cards:[],comments:[]};if(!r)return i;let o=0,s=0,n=0;for(const a of r.cards){const r={no:o++,sides:[]};i.cards.push(r);for(const o of a.sides){const a={no:s++,variants:[]};r.sides.push(a);for(const s of o.variants){const o={no:n++};a.variants.push(o);const c=e.bitContentProcessor(u.BitContentLevel.Card,t,s);e.DEBUG_CARD_TAGS&&e.debugPrint("card tags (elements)",c),c.cardBody=l.BitmarkPegParserValidator.checkCardBody(e,u.BitContentLevel.Card,t,c.cardBody,r.no,a.no,o.no),o.data=c,c.comments&&i.comments.push(...c.comments)}n=0}s=0}return i}(e,t,r),m=s.RootBitType.getMetadata(t.root);switch(m&&(null===(y=m.cardSet)||void 0===y?void 0:y.type)){case n.CardSetType.elements:g=function(e,t,r){var i;const o=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data;o.push(null!==(i=t.cardBody)&&void 0!==i?i:"")}return{elements:o.length>0?o:void 0}}(0,0,f);break;case n.CardSetType.statements:g=function(e,t,r,o,s){const n=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{statements:r}=t,o=i(t,["statements"]);if(Array.isArray(r))for(const e of r){const t=c.statement(Object.assign(Object.assign(Object.assign({},e),e.itemLead),o));n.push(t)}}o&&n.push(o);Array.isArray(s)&&s.length>0&&n.push(...s);return{statements:n.length>0?n:void 0}}(0,0,f,o,d);break;case n.CardSetType.quiz:g=function(e,t,r,i,o){const n=[],a=t.root===s.RootBitType.multipleChoice,l=t.root===s.RootBitType.multipleResponse;if(!a&&!l)return{};for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,r=t.isDefaultExample||null!=t.example;if(l&&t.trueFalse&&t.trueFalse.length>0){t.responses=[];for(const e of t.trueFalse){const r=c.response(e);t.responses.push(r)}}if(a&&t.trueFalse&&t.trueFalse.length>0){t.choices=[];for(const e of t.trueFalse){const r=c.choice(e);t.choices.push(r)}}const i=c.quiz(Object.assign(Object.assign({},t),{isDefaultExample:r}));n.push(i)}if(a&&Array.isArray(i)&&i.length>0){const e=c.quiz({choices:i});n.push(e)}if(l&&Array.isArray(o)&&o.length>0){const e=c.quiz({responses:o});n.push(e)}return{quizzes:n.length>0?n:void 0}}(0,t,f,p,h);break;case n.CardSetType.questions:g=function(e,t,r){var i;const o=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,r=c.question(Object.assign({question:null!==(i=t.cardBody)&&void 0!==i?i:""},t));o.push(r)}return{questions:o.length>0?o:void 0}}(0,0,f);break;case n.CardSetType.matchPairs:g=function(e,t,r){let o,s=0;const n=[];let l;const u=[];let d,p,h,y=[],g={};for(const e of r.cards){l=void 0,d=void 0,y=[],p=void 0,h=void 0,s=0,g={};for(const t of e.sides){for(const e of t.variants){const t=e.data,{cardBody:r,title:o,resources:n,isDefaultExample:c,example:f}=t,m=i(t,["cardBody","title","resources","isDefaultExample","example"]),b=c||null!=f,v=o&&o[1];if(0===s)if(null!=v)l=v;else if(Array.isArray(n)&&n.length>0){const e=n[0];e.type===a.ResourceType.audio?p=e:e.type===a.ResourceType.image&&(h=e)}else d=r;else null!=v?u.push(v):null==o&&y.push(null!=r?r:"");g=Object.assign(Object.assign(Object.assign({},g),m),{isCaseSensitive:!0}),b&&(g.isDefaultExample=!0)}s++}if(null!=l)o=c.heading({forKeys:l,forValues:u});else{const e=c.pair(Object.assign({key:null!=d?d:"",keyAudio:p,keyImage:h,values:y,isShortAnswer:!0},g));n.push(e)}}return{heading:o,pairs:n.length>0?n:void 0}}(0,0,f);break;case n.CardSetType.matchMatrix:g=function(e,t,r){let o,s,n=0;const a=[];let l;const u=[];let d=[],p=[],h={},y={},g=!1,f=!1;for(const e of r.cards){s=void 0,l=void 0,d=[],p=[],n=0,f=!1;for(const t of e.sides){p=[],h={},y={};for(const e of t.variants){const t=e.data,{title:r,cardBody:o,isDefaultExample:u,example:c}=t,d=i(t,["title","cardBody","isDefaultExample","example"]),m=u||null!=c;Object.assign(h,d);const b=r&&r[1];0===n?null!=b?(s=b,g=!!m||g):(l=o,f=!!m||f):null!=b?a.push(b):null==t.title&&p.push(null!=o?o:""),m&&(y.isDefaultExample=!0)}if(n>0){const e=c.matrixCell(Object.assign(Object.assign({values:p},h),y));d.push(e)}n++}if(null!=s)o=c.heading({forKeys:s,forValues:a});else{const e=c.matrix({key:null!=l?l:"",cells:d,isShortAnswer:!0,isCaseSensitive:!0,isDefaultExample:g||f});u.push(e)}}return{heading:o,matrix:u.length>0?u:void 0}}(0,0,f);break;case n.CardSetType.botActionResponses:g=function(e,t,r){const o=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{instruction:r,reaction:s,cardBody:n}=t,a=i(t,["instruction","reaction","cardBody"]),l=c.botResponse(Object.assign({response:null!=r?r:"",reaction:null!=s?s:"",feedback:null!=n?n:""},a));o.push(l)}return{botResponses:o.length>0?o:void 0}}(0,0,f)}return g.comments=f.comments.length>0?f.comments:void 0,g}},4471:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clozeTagContentProcessor=void 0;const i=r(3633);t.clozeTagContentProcessor=function(e,t,r,o,s){const{value:n}=o,a=s.solutions;if(a&&i.StringUtils.isString(n)){const e=i.StringUtils.trimmedString(n);a.push(e)}}},6934:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.commentTagContentProcessor=void 0;const i=r(9046),o=r(3633),s=new i.Builder;t.commentTagContentProcessor=function(e,t,r,i,n){if(!n.comments)return;const{value:a}=i,l=o.StringUtils.isString(a)?a:"",u=s.comment({text:l,location:i.parser.location});n.comments.push(u)}},8081:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTagContentProcessor=void 0;const i=r(3633),o=r(6831);t.defaultTagContentProcessor=function(e,t,r,s,n){const{type:a,value:l}=s,u=i.StringUtils.trimmedString(l);switch(a){case o.TypeKey.Instruction:n.instruction=u;break;case o.TypeKey.Hint:n.hint=u;break;case o.TypeKey.Anchor:n.anchor=u;break;case o.TypeKey.Reference:n.reference=u;break;case o.TypeKey.SampleSolution:n.sampleSolution=u}}},4787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.exampleTagContentProcessor=void 0;const i=r(208);function o(e,t,r,i){!0===r?i.isDefaultExample=!0:i.example=r}t.exampleTagContentProcessor=function(e,t,r,s,n){const{value:a}=s,l=a;switch(r.root){case i.RootBitType.cloze:case i.RootBitType.clozeAndMultipleChoiceText:case i.RootBitType.multipleChoiceText:case i.RootBitType.highlightText:!function(e,t,r,i){var s,n;let a;Array.isArray(i.trueFalse)&&i.trueFalse.length>0&&(a=null!==(s=i.trueFalse[i.trueFalse.length-1])&&void 0!==s?s:void 0);a?a.isDefaultExample=!0:Array.isArray(i.solutions)&&i.solutions.length>0?i.example=!0===r?null!==(n=i.solutions[i.solutions.length-1])&&void 0!==n?n:void 0:r:o(e,t,r,i)}(e,r,l,n);break;case i.RootBitType.mark:!function(e,t,r,i){i.isDefaultExample=!0}(0,0,0,n);break;default:o(e,r,l,n)}}},9577:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.gapChainContentProcessor=void 0;const o=r(9046),s=r(4471),n=r(6831),a=new o.Builder;t.gapChainContentProcessor=function(e,t,r,o,l,u){if(t===n.BitContentLevel.Chain)(0,s.clozeTagContentProcessor)(e,n.BitContentLevel.Chain,r,o,l);else{const t=function(e,t,r){var o;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("gap content",r);const s=[r,...null!==(o=r.chain)&&void 0!==o?o:[]],l=e.bitContentProcessor(n.BitContentLevel.Chain,t,s);e.DEBUG_CHAIN_TAGS&&e.debugPrint("gap TAGS",l);const{solutions:u}=l,c=i(l,["solutions"]),d=a.gap(Object.assign(Object.assign({solutions:null!=u?u:[]},c),{isCaseSensitive:!0}));return d}(e,r,o);t&&u.push(t)}}},9457:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.itemLeadTagContentProcessor=void 0;const i=r(3633);t.itemLeadTagContentProcessor=function(e,t,r,o,s,n){const{value:a}=o,l=i.StringUtils.trimmedString(a);n?s.lead=l:s.item=l}},857:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markChainContentProcessor=void 0;const o=r(9046),s=r(7646),n=r(3298),a=r(6831),l=new o.Builder;t.markChainContentProcessor=function(e,t,r,o,u,c){if(t===a.BitContentLevel.Chain)(0,n.markTagContentProcessor)(e,a.BitContentLevel.Chain,r,o,u);else{const t=function(e,t,r){var o,n;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",r);const u=[r,...null!==(o=r.chain)&&void 0!==o?o:[]],c=e.bitContentProcessor(a.BitContentLevel.Chain,t,u);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",c);const{solution:d,mark:p}=c,h=i(c,["solution","mark"]),y=l.mark(Object.assign({solution:null!=d?d:"",mark:null!==(n=s.ArrayUtils.asSingle(p))&&void 0!==n?n:""},h));return y}(e,r,o);t&&c.push(t)}}},2595:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markConfigChainContentProcessor=void 0;const o=r(9046),s=r(3633),n=r(6831),a=new o.Builder;t.markConfigChainContentProcessor=function(e,t,r,o,l){var u;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",o);const c=l.markConfig;if(!c)return;const d=e.bitContentProcessor(n.BitContentLevel.Chain,r,o.chain),{mark:p}=d,h=i(d,["mark"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",h);const y=null!==(u=s.StringUtils.trimmedString(o.value))&&void 0!==u?u:"unknown",g=a.markConfig(Object.assign({mark:y,emphasis:"underline"},h));c.push(g)}},3298:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.markTagContentProcessor=void 0;const i=r(3633);t.markTagContentProcessor=function(e,t,r,o,s){const{value:n}=o;i.StringUtils.isString(n)&&(s.solution=n)}},8326:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.partnerChainContentProcessor=void 0;const i=r(9046),o=r(1895),s=r(3633),n=r(6831),a=new i.Builder;t.partnerChainContentProcessor=function(e,t,r,i,l){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("partner content",i);const u=e.bitContentProcessor(n.BitContentLevel.Chain,r,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("partner TAGS",u);const{resources:c}=u,d=s.StringUtils.trimmedString(i.value),p=function(e,t){let r;const i=[];if(t)for(const e of t.reverse())r||o.ResourceType.image!==e.type?i.push(e):r=e;i.length>0&&(e.parser.excessResources=i,e.addWarning(`${i.length} excess resource(s) present in the [@parter] chain.`));return r}(e,c),h=a.partner({name:d,avatarImage:p});l.partner=h}},3287:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propertyContentProcessor=void 0;const i=r(4719),o=r(672),s=r(994),n=r(3633),a=r(4185),l=r(4787),u=r(2595),c=r(8326),d=r(6831);t.propertyContentProcessor=function(e,t,r,p,h){const{key:y,value:g}=p,f=t===d.BitContentLevel.Chain;if(y===i.PropertyKey.example)return void(0,l.exampleTagContentProcessor)(e,t,r,p,h);if(y===i.PropertyKey.partner)return void(0,c.partnerChainContentProcessor)(e,t,r,p,h);if(y===i.PropertyKey.book)return void(0,a.bookChainContentProcessor)(e,t,r,p,h);if(y===i.PropertyKey.mark&&!f)return void(0,u.markConfigChainContentProcessor)(e,t,r,p,h);const m=(e,t,r)=>{var a;const l=null!==(a=i.PropertyKey.getMetadata(i.PropertyKey.fromValue(t)))&&void 0!==a?a:{};if(l.astKey&&(t=l.astKey),l.isTrimmedString&&(r=n.StringUtils.isString(r)?n.StringUtils.trimmedString(r):void 0),l.isNumber&&(r=s.NumberUtils.asNumber(r)),l.isBoolean&&(r=o.BooleanUtils.toBoolean(r,!0)),l.isInvertedBoolean&&(r=!o.BooleanUtils.toBoolean(r,!0)),l.isSingle)e[t]=r;else if(Object.prototype.hasOwnProperty.call(e,t)){const i=e[t];e[t]=[...i,r]}else e[t]=[r]};i.PropertyKey.fromValue(y)?m(h,y,g):m(h.extraProperties,y,g)}},3130:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.referenceTagContentProcessor=void 0;const i=r(3633);t.referenceTagContentProcessor=function(e,t,r,o,s,n){const{value:a}=o,l=i.StringUtils.trimmedString(a);n?s.referenceEnd=l:s.reference=l}},5516:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resourceContentProcessor=t.buildResource=void 0;const i=r(8703),o=r(208),s=r(1895),n=r(4598),a=r(6831),l=new i.ResourceBuilder;t.buildResource=function(e,t,r,i){let a,u;const c=[],d=o.RootBitType.getMetadata(t.root),p=null==d?void 0:d.resourceAttachmentAllowed,h=p?r:void 0,y=n.BitUtils.calculateValidResourceType(t,h,void 0);if(y===s.ResourceType.stillImageFilm){if(i){let e,t;u=[];for(const r of i.reverse())e||s.ResourceType.image!==r.type?t||s.ResourceType.audio!==r.type?u.push(r):t=r:e=r;a=l.stillImageFilmResource({image:e,audio:t})}}else u=i;if(u)for(const e of u.reverse())a||y!==e.type?c.push(e):a=e;if(!p&&r){let t=`Resource type '&${r}' is specified in the bit header, but no extra resource is allowed for this bit.`;y&&(t+=` The resource type '&${y}' is automatically expected and should not be added.`),e.addWarning(t)}if(a||(r?e.addWarning(`Resource type '&${r}' is specified in the bit header, but no such a resource is present in the bit`):y&&e.addWarning(`Resource type '&${y}' is required but is not present in the bit`)),c.length>0){e.parser.excessResources=c;let t=`${c.length} excess resource(s) present in the bit.`;if(y===o.RootBitType.stillImageFilm)t+=" The expected resource types are '&image' and '&audio'";else{t+=` The expected resource type is '${y?`&${y}`:"NONE"}'`}e.addWarning(t)}return a},t.resourceContentProcessor=function(e,t,r,i,o){const{type:n,key:u,value:c,chain:d}=i,p=o.resources;if(!p)return;const h=s.ResourceType.fromValue(u);if(h){const t=e.bitContentProcessor(a.BitContentLevel.Chain,r,d),i=l.resource(Object.assign({type:h,value:c},t));i&&p.push(i)}}},1838:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildTitles=t.titleTagContentProcessor=void 0;const i=r(208),o=r(3633);t.titleTagContentProcessor=function(e,t,r,i,s){const{value:n}=i,a=s.title;if(!a)return;const l=n,u=o.StringUtils.trimmedString(l.title);a[l.level.length]=u},t.buildTitles=function(e,t,r){var o,s;switch(r=null!=r?r:[],t.root){case i.RootBitType.chapter:{let e;return r.length>0&&(e=r[r.length-1]),{title:e,level:r.length>0?r.length-1:void 0}}case i.RootBitType.book:default:return{title:null!==(o=r[1])&&void 0!==o?o:void 0,subtitle:null!==(s=r[2])&&void 0!==s?s:void 0}}}},4177:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseChainContentProcessor=void 0;const o=r(9046),s=r(208),n=r(8660),a=r(6831),l=new o.Builder;t.trueFalseChainContentProcessor=function(e,t,r,o,u,c){t===a.BitContentLevel.Chain?(0,n.trueFalseTagContentProcessor)(e,a.BitContentLevel.Chain,r,o,u):function(e,t,r,o,n,u){var c;const d=[o,...null!==(c=o.chain)&&void 0!==c?c:[]],p=n.statements,h=n.choices,y=n.responses;if(!(p&&h&&y&&u))return;if(r.root===s.RootBitType.trueFalse1)n.statement=function(e,t,r){if(t.root!==s.RootBitType.trueFalse1)return;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (statement)",r);const o=e.bitContentProcessor(a.BitContentLevel.Chain,t,r),{trueFalse:n}=o,u=i(o,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (statement)",u);let c;n&&n.length>0&&(c=l.statement(Object.assign(Object.assign({},n[0]),u)));return c}(e,r,d);else if(r.root===s.RootBitType.trueFalse||r.root===s.RootBitType.multipleChoice||r.root===s.RootBitType.multipleChoice1||r.root===s.RootBitType.multipleResponse||r.root===s.RootBitType.multipleResponse1){const t=function(e,t,r){const o=t.root===s.RootBitType.trueFalse,n=t.root===s.RootBitType.multipleChoice||t.root===s.RootBitType.multipleChoice1,u=t.root===s.RootBitType.multipleResponse||t.root===s.RootBitType.multipleResponse1;if(!o&&!n&&!u)return{};const c=[],d=[],p=[],h=e.splitBitContent(r,[a.TypeKey.True,a.TypeKey.False]);e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (choices/responses)",h);for(const r of h){const s=e.bitContentProcessor(a.BitContentLevel.Chain,t,r),{trueFalse:h}=s,y=i(s,["trueFalse"]);if(e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (choices/responses)",y),o){if(h&&h.length>0){const e=l.statement(Object.assign(Object.assign({},h[0]),y));c.push(e)}}else if(n){if(h&&h.length>0){const e=l.choice(Object.assign(Object.assign({},h[0]),y));d.push(e)}}else if(u&&h&&h.length>0){const e=l.response(Object.assign(Object.assign({},h[0]),y));p.push(e)}}const y={};o?y.statements=c:n?y.choices=d:u&&(y.responses=p);return y}(e,r,d);t.statements&&p.push(...t.statements),t.choices&&h.push(...t.choices),t.responses&&y.push(...t.responses)}else if(r.root===s.RootBitType.highlightText){const t=function(e,t,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("highlight content",r);const o=e.bitContentProcessor(a.BitContentLevel.Chain,t,r),{trueFalse:s}=o,n=i(o,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("highlight TAGS",Object.assign({trueFalse:s},n));const u=[];if(s)for(const e of s)u.push(l.highlightText(Object.assign(Object.assign({},e),{isHighlighted:!1})));const c=l.highlight(Object.assign({texts:u},n));return c}(e,r,d);t&&u.push(t)}else{const t=function(e,t,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("select content",r);const o=e.bitContentProcessor(a.BitContentLevel.Chain,t,r),{trueFalse:s}=o,n=i(o,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("select TAGS",Object.assign({trueFalse:s},n));const u=[];if(s)for(const e of s)u.push(l.selectOption(e));const c=l.select(Object.assign({options:u},n));return c}(e,r,d);t&&u.push(t)}}(e,0,r,o,u,c)}},8660:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseTagContentProcessor=void 0;const i=r(3633),o=r(6831);t.trueFalseTagContentProcessor=function(e,t,r,s,n){const{type:a,value:l}=s,u=n.trueFalse;if(!u)return;const c=i.StringUtils.trimmedString(l);u.push({text:c,isCorrect:a===o.TypeKey.True,isDefaultExample:!1})}},2434:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JsonParser=void 0;const i=r(9046),o=r(8703),s=r(6300),n=r(208),a=r(1060),l=r(1895),u=r(1353),c=r(3633),d=new i.Builder,p=new o.ResourceBuilder;t.JsonParser=class{constructor(){this.textGenerator=new s.TextGenerator}toAst(e){const t=this.preprocessJson(e),r=[];for(const e of t){const{bit:t}=e,i=this.bitToAst(t);i&&r.push(i)}const i=r.length>0?{bits:r}:{};return d.bitmark(i)}preprocessJson(e){const t=[];if(c.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return[]}}const r=e=>{if(this.isBitWrapper(e)){const r=e;t.push(r)}else if(this.isBit(e)){const r=e;t.push(this.bitToBitWrapper(r))}};if(Array.isArray(e))for(const t of e)r(t);else r(e);return t}isBitWrapper(e){if(Object.prototype.hasOwnProperty.call(e,"bit")){const t=e;return this.isBit(t.bit)}return!1}isBit(e){if(Object.prototype.hasOwnProperty.call(e,"type")){const t=e;return n.BitTypeUtils.getBitType(t.type).root!==n.RootBitType._error}return!1}bitToBitWrapper(e){return{bit:e}}bitToAst(e){var t;const{type:r,format:i,id:o,externalId:s,spaceId:a,padletId:l,AIGenerated:c,releaseVersion:p,ageRange:h,language:y,computerLanguage:g,subtype:f,coverImage:m,publisher:b,publications:v,author:T,date:A,location:P,theme:_,kind:x,action:w,thumbImage:S,focusX:O,focusY:R,duration:k,deeplink:C,externalLink:E,externalLinkText:I,videoCallLink:j,bot:B,list:L,textReference:N,isTracked:M,isInfoOnly:U,labelTrue:K,labelFalse:F,quotedPerson:D,book:V,title:G,subtitle:H,level:$,toc:q,progress:J,anchor:z,reference:W,referenceEnd:Y,item:X,lead:Q,hint:Z,instruction:ee,example:te,partner:re,marks:ie,resource:oe,body:se,sampleSolution:ne,elements:ae,statement:le,isCorrect:ue,statements:ce,responses:de,quizzes:pe,heading:he,pairs:ye,matrix:ge,choices:fe,questions:me,footer:be,placeholders:ve}=e,Te=n.BitTypeUtils.getBitType(r),Ae=null!==(t=u.TextFormat.fromValue(i))&&void 0!==t?t:u.TextFormat.bitmarkMinusMinus,Pe=this.resourceBitToAst(oe),_e=this.bodyToAst(se,Ae,ve),xe=this.partnerBitToAst(re),we=this.markConfigBitToAst(ie),Se=this.statementBitsToAst(le,ue,ce,te),Oe=this.responseBitsToAst(Te,de),Re=this.quizBitsToAst(Te,pe),ke=this.headingBitToAst(he),Ce=this.pairBitsToAst(ye),Ee=this.matrixBitsToAst(ge),Ie=this.choiceBitsToAst(fe),je=this.questionBitsToAst(me),Be=this.botResponseBitsToAst(Te,de),Le=this.footerToAst(be,Ae),{reference:Ne,referenceProperty:Me}=this.referenceToAst(W);return d.bit(Object.assign(Object.assign(Object.assign({bitType:Te,textFormat:i,id:o,externalId:s,spaceId:a,padletId:l,aiGenerated:c,releaseVersion:p,ageRange:h,language:y,computerLanguage:g,subtype:f,coverImage:m,publisher:b,publications:v,author:T,date:A,location:P,theme:_,kind:x,action:w,duration:k,referenceProperty:Me,thumbImage:S,focusX:O,focusY:R,deeplink:C,externalLink:E,externalLinkText:I,videoCallLink:j,bot:B,list:L,textReference:N,isTracked:M,isInfoOnly:U,labelTrue:K,labelFalse:F,quotedPerson:D,book:V,title:this.parseText(G),subtitle:this.parseText(H),level:$,toc:q,progress:J,anchor:z,reference:Ne,referenceEnd:Y},this.parseItemLeadHintInstruction(X,Q,Z,ee)),this.parseExample(te)),{partner:xe,markConfig:we,resource:Pe,body:_e,sampleSolution:ne,elements:ae,statements:Se,responses:Oe,quizzes:Re,heading:ke,pairs:Ce,matrix:Ee,choices:Ie,questions:je,botResponses:Be,footer:Le}))}partnerBitToAst(e){let t;if(e){const r=this.resourceDataToAst(l.ResourceType.image,e.avatarImage);t=d.partner({name:e.name,avatarImage:r})}return t}markConfigBitToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{mark:e,color:i,emphasis:o}=r,s=d.markConfig({mark:e,color:i,emphasis:o});t.push(s)}if(0!==t.length)return t}statementBitsToAst(e,t,r,i){const o=[];if(e){const r=d.statement(Object.assign({text:e,isCorrect:null!=t&&t},this.parseExample(i)));o.push(r)}if(Array.isArray(r))for(const e of r){const{statement:t,isCorrect:r,item:i,lead:s,hint:n,instruction:a,example:l,isCaseSensitive:u}=e,c=d.statement(Object.assign(Object.assign(Object.assign({text:t,isCorrect:r},this.parseItemLeadHintInstruction(i,s,n,a)),this.parseExample(l)),{isCaseSensitive:u}));o.push(c)}if(0!==o.length)return o}choiceBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{choice:e,isCorrect:i,item:o,lead:s,hint:n,instruction:a,example:l,isCaseSensitive:u}=r,c=d.choice(Object.assign(Object.assign(Object.assign({text:e,isCorrect:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:u}));t.push(c)}if(0!==t.length)return t}responseBitsToAst(e,t){const r=[];if(e.root!==n.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,isCorrect:i,item:o,lead:s,hint:n,instruction:a,example:l,isCaseSensitive:u}=e,c=d.response(Object.assign(Object.assign(Object.assign({text:t,isCorrect:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:u}));r.push(c)}if(0!==r.length)return r}}selectOptionBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{text:e,isCorrect:i,item:o,lead:s,hint:n,instruction:a,example:l,isCaseSensitive:u}=r,c=d.selectOption(Object.assign(Object.assign(Object.assign({text:e,isCorrect:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:u}));t.push(c)}return t}highlightTextBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{text:e,isCorrect:i,isHighlighted:o,item:s,lead:n,hint:a,instruction:l,example:u,isCaseSensitive:c}=r,p=d.highlightText(Object.assign(Object.assign(Object.assign({text:e,isCorrect:i,isHighlighted:o},this.parseItemLeadHintInstruction(s,n,a,l)),this.parseExample(u)),{isCaseSensitive:c}));t.push(p)}return t}quizBitsToAst(e,t){const r=[];if(Array.isArray(t))for(const i of t){const{item:t,lead:o,hint:s,instruction:n,choices:a,responses:l}=i,u=this.choiceBitsToAst(a),c=this.responseBitsToAst(e,l),p=d.quiz(Object.assign(Object.assign({},this.parseItemLeadHintInstruction(t,o,s,n)),{choices:u,responses:c}));r.push(p)}if(0!==r.length)return r}headingBitToAst(e){let t;return e&&(t=d.heading({forKeys:e.forKeys,forValues:e.forValues})),t}pairBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{key:e,keyAudio:i,keyImage:o,values:s,item:n,lead:a,hint:u,instruction:c,example:p,isCaseSensitive:h,isLongAnswer:y}=r,g=this.resourceDataToAst(l.ResourceType.audio,i),f=this.resourceDataToAst(l.ResourceType.image,o),m=d.pair(Object.assign(Object.assign(Object.assign({key:e,keyAudio:g,keyImage:f,values:s},this.parseItemLeadHintInstruction(n,a,u,c)),this.parseExample(p)),{isCaseSensitive:h,isShortAnswer:!y}));t.push(m)}if(0!==t.length)return t}matrixBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const i of e){const{key:e,cells:o,item:s,lead:n,hint:a,instruction:l,example:u,isCaseSensitive:c,isLongAnswer:p}=i,h=d.matrix(Object.assign(Object.assign(Object.assign({key:e,cells:null!==(t=this.matrixCellsToAst(o))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(s,n,a,l)),this.parseExample(u)),{isCaseSensitive:c,isShortAnswer:!p}));r.push(h)}if(0!==r.length)return r}matrixCellsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{values:e,item:i,lead:o,hint:s,instruction:n,example:a}=r,l=d.matrixCell(Object.assign(Object.assign({values:e},this.parseItemLeadHintInstruction(i,o,s,n)),this.parseExample(a)));t.push(l)}if(0!==t.length)return t}questionBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{question:e,partialAnswer:i,sampleSolution:o,item:s,lead:n,hint:a,instruction:l,example:u,isCaseSensitive:c,isShortAnswer:p}=r,h=d.question(Object.assign(Object.assign(Object.assign({question:e,partialAnswer:i,sampleSolution:o},this.parseItemLeadHintInstruction(s,n,a,l)),this.parseExample(u)),{isCaseSensitive:c,isShortAnswer:p}));t.push(h)}if(0!==t.length)return t}botResponseBitsToAst(e,t){const r=[];if(e.root===n.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,reaction:i,feedback:o,item:s,lead:n,hint:a}=e,l=d.botResponse({response:t,reaction:i,feedback:o,item:this.parseText(s),lead:this.parseText(n),hint:this.parseText(a)});r.push(l)}if(0!==r.length)return r}}resourceBitToAst(e){var t;let r;if(e){const i=null!==(t=l.ResourceType.keyFromValue(e.type))&&void 0!==t?t:l.ResourceType.unknown;let o;if(e.type===l.ResourceType.stillImageFilm){const t=e,i=this.resourceDataToAst(l.ResourceType.image,t.image),o=this.resourceDataToAst(l.ResourceType.audio,t.audio);r=p.stillImageFilmResource({image:i,audio:o})}else{if(o=e[i],!o)return;r=this.resourceDataToAst(e.type,o)}}return r}resourceDataToAst(e,t){var r,i;let o;if(t){if(!t)return;const s=c.StringUtils.isString(t)?t:void 0,n=t.url||t.src||t.href||t.app||t.body||s,a=this.resourceDataToAst(l.ResourceType.image,t.posterImage),u=t.thumbnails?t.thumbnails.map((e=>this.resourceDataToAst(l.ResourceType.image,e))):void 0;o=p.resource({type:e,value:n,format:t.format,src1x:t.src1x,src2x:t.src2x,src3x:t.src3x,src4x:t.src4x,caption:this.parseText(t.caption),width:null!==(r=t.width)&&void 0!==r?r:void 0,height:null!==(i=t.height)&&void 0!==i?i:void 0,alt:t.alt,duration:t.duration,mute:t.mute,autoplay:t.autoplay,allowSubtitles:t.allowSubtitles,showSubtitles:t.showSubtitles,posterImage:a,thumbnails:u,siteName:t.siteName,license:t.license,copyright:t.copyright,showInIndex:t.showInIndex})}return o}bodyToAst(e,t,r){let i,o;const s={};if(Array.isArray(e)?(o=this.parseText(e,t),r=this.textGenerator.getPlaceholders()):o=e,r)for(const[e,t]of Object.entries(r)){const r=this.bodyBitToAst(t);s[e]=r}if(o){const e=[],t=c.StringUtils.splitPlaceholders(o,Object.keys(s));for(let r=0,i=t.length;r<i;r++){const i=t[r];if(s[i])e.push(s[i]);else{const t=this.bodyTextToAst(i);e.push(t)}}i=d.body({bodyParts:e})}return i}bodyTextToAst(e){return d.bodyText({text:e})}bodyBitToAst(e){switch(e.type){case a.BodyBitType.gap:return this.gapBitToAst(e);case a.BodyBitType.mark:return this.markBitToAst(e);case a.BodyBitType.select:return this.selectBitToAst(e);case a.BodyBitType.highlight:return this.highlightBitToAst(e)}return this.bodyTextToAst("")}footerToAst(e,t){const r=this.parseText(e,t);if(r)return d.footerText({text:r})}referenceToAst(e){return Array.isArray(e)&&e.length>0?{reference:void 0,referenceProperty:e}:{reference:e,referenceProperty:void 0}}gapBitToAst(e){const{item:t,lead:r,hint:i,instruction:o,example:s,isCaseSensitive:n,solutions:a}=e;return d.gap(Object.assign(Object.assign(Object.assign({solutions:a},this.parseItemLeadHintInstruction(t,r,i,o)),this.parseExample(s)),{isCaseSensitive:n}))}markBitToAst(e){const{solution:t,mark:r,item:i,lead:o,hint:s,instruction:n,example:a}=e;return d.mark(Object.assign(Object.assign({solution:t,mark:r},this.parseItemLeadHintInstruction(i,o,s,n)),this.parseExample(a)))}selectBitToAst(e){const{options:t,prefix:r,postfix:i,item:o,lead:s,hint:n,instruction:a,example:l}=e,u=this.selectOptionBitsToAst(t);return d.select(Object.assign(Object.assign(Object.assign({options:u,prefix:r,postfix:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:!0}))}highlightBitToAst(e){const{texts:t,prefix:r,postfix:i,item:o,lead:s,hint:n,instruction:a,example:l}=e,u=this.highlightTextBitsToAst(t);return d.highlight(Object.assign(Object.assign(Object.assign({texts:u,prefix:r,postfix:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:!0}))}parseItemLeadHintInstruction(e,t,r,i){return{item:this.parseText(e),lead:this.parseText(t),hint:this.parseText(r),instruction:this.parseText(i)}}parseExample(e){if(null==e)return;const t=this.parseText(e);return t?{example:t}:{example:!!e}}parseText(e,t){if(null!=e){if(Array.isArray(e)){return this.textGenerator.generateSync(e,t)}return e}}}},406:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextParser=void 0;const i=r(1353),o=r(8436);t.TextParser=class{toAst(e,t){if(Array.isArray(e))return e;const r=e,s=Object.assign({},t);s.textFormat||(s.textFormat=i.TextFormat.bitmarkMinusMinus);const n=s.textFormat===i.TextFormat.bitmarkPlusPlus?"bitmarkPlusPlus":"bitmarkMinusMinus";return(0,o.parse)(null!=r?r:"",{startRule:n})}}},8436:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const i=r(4764).parse;t.parse=i},7646:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayUtils=void 0;const r=new class{asArray(e){if(null!=e)return Array.isArray(e)?e:[e]}asSingle(e,t){if(null!=e)return Array.isArray(e)?e.length>0?t?e[e.length-1]:e[0]:void 0:e}};t.ArrayUtils=r},4598:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitUtils=void 0;const i=r(208),o=r(1895);const s=new class{calculateValidResourceType(e,t,r){let s;if(t&&(s=o.ResourceType.fromValue(t)),!s&&r&&(s=r.type),!s){const t=i.RootBitType.getMetadata(e.root);t&&(s=t.resourceType)}return s}};t.BitUtils=s},672:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanUtils=void 0;const r=new class{isBoolean(e){return!0===e||!1===e}isBooleanString(e){return!!this.isBoolean(e)||("true"===e||"false"===e)}toBoolean(e,t){return t?!1!==e&&"false"!==e:!0===e||"true"===e}};t.BooleanUtils=r},994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NumberUtils=void 0;const r=new class{asNumber(e,t){if(null==e)return null!=t?t:void 0;const r=+e;return Number.isNaN(r)?null!=t?t:void 0:r}};t.NumberUtils=r},4309:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUtils=void 0;const r=new class{isFunction(e){return"[object Function]"===Object.prototype.toString.call(e)}isArray(e){return Array.isArray(e)}isDate(e){return"[object Date]"===Object.prototype.toString.call(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}orderProperties(e,t){const r=e,i=Object.assign({},r);for(const e of Object.keys(r))delete r[e];for(const e of t)Object.prototype.hasOwnProperty.call(i,e)&&(r[e]=i[e])}removeUndefinedProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||null==i&&delete r[e]}removeFalseProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||!1===i&&delete r[e]}removeEmptyStringProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||""===i&&delete r[e]}removeEmptyArrayProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||Array.isArray(i)&&0===i.length&&delete r[e]}removeEmptyObjectProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||this.isObject(i)&&0===Object.keys(i).length&&delete r[e]}removeUnwantedProperties(e,t){(t=Object.assign({},t)).ignoreAllUndefined||this.removeUndefinedProperties(e,t.ignoreUndefined),t.ignoreAllFalse||this.removeFalseProperties(e,t.ignoreFalse),t.ignoreAllEmptyString||this.removeEmptyStringProperties(e,t.ignoreEmptyString),t.ignoreAllEmptyArrays||this.removeEmptyArrayProperties(e,t.ignoreEmptyArrays),t.ignoreAllEmptyObjects||this.removeEmptyObjectProperties(e,t.ignoreEmptyObjects)}extractSingleValue(e,t){if(!e)return;const r=e;if(null==r[t])return;let i=r[t];if(Array.isArray(i)){if(0===i.length)return;i=i[i.length-1]}return i}};t.ObjectUtils=r},3633:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StringUtils=void 0;const r=new class{isString(e){return"string"==typeof e||e instanceof String}trimmedString(e){return e?`${e}`.trim():""}splitPlaceholders(e,t){let r=[e];const i=(e,t)=>{const r=[];for(const i of e){const e=i.split(t);for(let i=0,o=e.length;i<o;i++){const s=e[i],n=i===o-1;r.push(s),n||r.push(t)}}return r};for(const e of t)r=i(r,e);return r}firstLine(e,t){const r=e;if(null==t&&(t=e.length),t<1||null==e||e.length<=t)return r;const i=e.split("\n");return i.length>0?i[0].substring(0,t):r}wordWrap(e,t){const r=[];if(t<1||null==e||e.length<=t)return r;const i=e.length,o=i-t;let s,n=0;for(;n<o;){let i;const o=n+t,a=e.indexOf("\n",n);if(a>-1&&a>n&&a<o){i=a-n,s=e.substr(n,i),n=n+i+1,r.push(s);continue}const l=e.lastIndexOf(" ",o);let u=0;l>-1&&l!=n-1?(i=l-n,i>0&&(u=n+i+1)):(i=t,u=n+t),s=e.substr(n,i),n=u,r.push(s.trim())}return n<i&&(s=e.substr(n),r.push(s)),r}};t.StringUtils=r},169:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UrlUtils=void 0;const r=new class{fileExtensionFromUrl(e){let t;if(e)try{const r=new URL(e).pathname.split(".");r.length>1&&(t=r[r.length-1])}catch(e){}return t}domainFromUrl(e){let t;if(e)try{t=new URL(e).hostname}catch(e){}return t}};t.UrlUtils=r},671:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.initEnv=t.env=void 0;const i=r(2164),o=r(7619),s=r(306),n=r(9870);const a=new class{constructor(){Object.defineProperty(this,"userAgentInfo",{value:(0,n.parseUserAgent)(),enumerable:!1}),this.bootTimestamp=Date.now(),this.app="",this.appVersion=s.EMPTY_VERSION,this.environment=this.getEnvironment(),this.environmentVersion=this.getEnvironmentVersion(),this.isBrowser=this.getIsBrowser(),this.isNode=this.environment===i.Environment.node,this.isCI=this.getIsCI(),this.NODE_ENV=this.getNodeEnv(),this.os=this.getOs(),this.osVersion=this.getOsVersion()}init(e,t){this.app=e,this.appVersion=this.parseMMBVersion(t)}get upTimestamp(){return Date.now()-this.bootTimestamp}getEnvironment(){return this.userAgentInfo?this.userAgentInfo.browser:"undefined"!=typeof process&&void 0!==process.versions&&process.versions.node?i.Environment.node:i.Environment.unknown}getEnvironmentVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.browserVersion):"undefined"!=typeof process?this.parseMMBVersion(process.version):s.EMPTY_VERSION}getOs(){return this.userAgentInfo?this.userAgentInfo.os:("undefined"!=typeof process&&void 0!==process.versions&&process.versions.node,o.Os.unknown)}getOsVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.osVersion):"undefined"!=typeof process?this.parseMMBVersion(""):s.EMPTY_VERSION}getIsBrowser(){return!("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof navigator||!navigator.userAgent)}getIsCI(){return!("undefined"==typeof process||!process.env||!process.env.CI)}getNodeEnv(){return"undefined"!=typeof process&&process.env?"production":""}parseMMBVersion(e){if(!e)return s.EMPTY_VERSION;e.startsWith("v")&&(e=e.substring(1));const t=e.split(".",1e3);let r="",i="",o="",n="";for(let e=0,s=t.length;e<s;e++){const s=t[e];0===e?r=s:1===e?i=s:2===e?n=s:3===e&&(o=s)}return{full:e,major:r,minor:i,patch:n,build:o}}};t.env=a;const l=a.init.bind(a);t.initEnv=l},2164:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Environment=void 0;const i=(0,r(6688).superenum)({unknown:"",node:"node",chrome:"chrome",safari:"safari",firefox:"firefox",edge:"edge",ie:"ie"});t.Environment=i},7619:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Os=void 0;const i=(0,r(6688).superenum)({unknown:"",macos:"macos",windows:"windows",linux:"linux",android:"android",ios:"ios"});t.Os=i},306:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_VERSION=void 0;t.EMPTY_VERSION={full:"",major:"",minor:"",patch:"",build:""}},9870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUserAgent=void 0;const i=r(2164),o=r(7619);t.parseUserAgent=function(){if("undefined"==typeof window||!window.navigator||!window.navigator.userAgent)return;const e={browser:i.Environment.unknown,os:o.Os.unknown},t=function(e){const t=e.toLowerCase().split(new RegExp("[ /,;()]","g")).reduce(((e,t)=>(t&&e.push(t),e)),[]),r={keys:new Set,versions:{}};let i="";for(let e=0,o=t.length;e<o;e++){const o=t[e];let s=!1;for(let e=0;e<=9;e++)if(o.startsWith(`${e}`)){s=!0;break}s?r.versions[i]=o.replace("_","."):r.keys.add(o),i=o}return r}(window.navigator.userAgent),r=t.keys.has("firefox"),s=t.keys.has("chrome"),n=t.keys.has("chromium"),a=t.keys.has("safari"),l=s,u=r,c=t.keys.has("macintosh");return a&&!s&&!n?(e.browser=i.Environment.safari,e.browserVersion=t.versions.version):l?(e.browser=i.Environment.chrome,e.browserVersion=t.versions.chrome):u&&(e.browser=i.Environment.firefox,e.browserVersion=t.versions.firefox),c&&(e.os=o.Os.macos,e.osVersion=t.versions.x),e}}},t={};function r(i){var o=t[i];if(void 0!==o)return o.exports;var s=t[i]={exports:{}};return e[i].call(s.exports,s,s.exports,r),s.exports}r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{var e=i;Object.defineProperty(e,"__esModule",{value:!0}),e.StreamWriter=e.FileWriter=e.BitmarkFileGenerator=e.JsonFileGenerator=e.CardSetVersion=e.BitmarkVersion=e.BitmarkParserType=e.NodeType=e.ResourceType=e.TextFormat=e.BitTypeUtils=e.AliasBitType=e.RootBitType=e.StringWriter=e.BitmarkStringGenerator=e.BitmarkGenerator=e.BitmarkParser=e.JsonStringGenerator=e.JsonGenerator=e.JsonParser=e.Ast=e.ResourceBuilder=e.Builder=e.Output=e.BitmarkParserGenerator=void 0;const t=r(7087);var o=r(390);Object.defineProperty(e,"BitmarkParserGenerator",{enumerable:!0,get:function(){return o.BitmarkParserGenerator}}),Object.defineProperty(e,"Output",{enumerable:!0,get:function(){return o.Output}});var s=r(9046);Object.defineProperty(e,"Builder",{enumerable:!0,get:function(){return s.Builder}});var n=r(8703);Object.defineProperty(e,"ResourceBuilder",{enumerable:!0,get:function(){return n.ResourceBuilder}});var a=r(8256);Object.defineProperty(e,"Ast",{enumerable:!0,get:function(){return a.Ast}});var l=r(2434);Object.defineProperty(e,"JsonParser",{enumerable:!0,get:function(){return l.JsonParser}});var u=r(3857);Object.defineProperty(e,"JsonGenerator",{enumerable:!0,get:function(){return u.JsonGenerator}});var c=r(5132);Object.defineProperty(e,"JsonStringGenerator",{enumerable:!0,get:function(){return c.JsonStringGenerator}});var d=r(9556);Object.defineProperty(e,"BitmarkParser",{enumerable:!0,get:function(){return d.BitmarkParser}});var p=r(297);Object.defineProperty(e,"BitmarkGenerator",{enumerable:!0,get:function(){return p.BitmarkGenerator}});var h=r(8582);Object.defineProperty(e,"BitmarkStringGenerator",{enumerable:!0,get:function(){return h.BitmarkStringGenerator}});var y=r(227);Object.defineProperty(e,"StringWriter",{enumerable:!0,get:function(){return y.StringWriter}});var g=r(208);Object.defineProperty(e,"RootBitType",{enumerable:!0,get:function(){return g.RootBitType}}),Object.defineProperty(e,"AliasBitType",{enumerable:!0,get:function(){return g.AliasBitType}}),Object.defineProperty(e,"BitTypeUtils",{enumerable:!0,get:function(){return g.BitTypeUtils}});var f=r(1353);Object.defineProperty(e,"TextFormat",{enumerable:!0,get:function(){return f.TextFormat}});var m=r(1895);Object.defineProperty(e,"ResourceType",{enumerable:!0,get:function(){return m.ResourceType}});var b=r(549);Object.defineProperty(e,"NodeType",{enumerable:!0,get:function(){return b.NodeType}});var v=r(6958);Object.defineProperty(e,"BitmarkParserType",{enumerable:!0,get:function(){return v.BitmarkParserType}});var T=r(8791);Object.defineProperty(e,"BitmarkVersion",{enumerable:!0,get:function(){return T.BitmarkVersion}});var A=r(8565);Object.defineProperty(e,"CardSetVersion",{enumerable:!0,get:function(){return A.CardSetVersion}});(0,t.init)()})(),i})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.bitmarkParserGenerator=t():e.bitmarkParserGenerator=t()}(this,(()=>(()=>{"use strict";var e={6688:(e,t,r)=>{function i(e,t){var r;const i=Object.freeze,o=Object.defineProperty,s=Object.assign,n={enumerable:!1},a=new Map,l=new Map,u=new Map,c=new Map,d=new Map,p=(null!==(r=null==t?void 0:t.iterationKeys)&&void 0!==r?r:Object.keys(e)).map((e=>`${e}`));for(const[t,r]of Object.entries(e))a.set(t,r),u.set(t.toLowerCase(),r);for(const[e,t]of a){const r="string"==typeof t?t.toLowerCase():t;l.set(t,e),c.set(r,e)}const h=p.map((e=>a.get(e))),y=p.map((e=>[e,a.get(e)]));return(t=>{let r=e;function g(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?a.get(c.get(e.toLowerCase())):!e||l.has(e)?e:void 0}Object.isExtensible(e)||(r=s({},e)),o(r,"fromKey",s({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?u.get(e.toLowerCase()):a.get(`${e}`)}},n)),o(r,"fromValue",s({value:g},n)),o(r,"keyFromValue",s({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?c.get(e.toLowerCase()):l.get(e)}},n)),o(r,"setMetadata",s({value:function(e,t,r){const i=g(e);i&&d.set(i,t)}},n)),o(r,"getMetadata",s({value:function(e,t){return d.get(e)}},n)),o(r,Symbol.iterator,s({value:function(){let e=0;return{next:()=>e<p.length?{value:a.get(`${p[e++]}`),done:!1}:{done:!0}}}},n)),o(r,"values",s({value:()=>h},n)),o(r,"keys",s({value:()=>p},n)),o(r,"entries",s({value:()=>y},n));let f=r;return(null==t?void 0:t.noFreeze)||(f=i(r),i(p),i(h),i(y)),f})(t)}r.r(t),r.d(t,{superenum:()=>o});const o=i;o.fromObject=i,o.fromArray=function(e,t){Array.isArray(e)||(e=[]);const r=e.reduce(((e,t)=>(e[`${t}`]=t,e)),{});return(!t||t&&!t.iterationKeys)&&((t=Object.assign({},t)).iterationKeys=e),i(r,t)}},390:function(e,t,r){var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,o)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=(this&&this.__importStar,this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))});this&&this.__importDefault;Object.defineProperty(t,"__esModule",{value:!0}),t.Output=t.BitmarkParserGenerator=void 0;const n=r(6688),a=r(8256),l=r(8582),u=r(4275),c=r(6958),d=r(9556),p=r(2434),h=r(671),y=(0,n.superenum)({bitmark:"bitmark",json:"json",ast:"ast"});t.Output=y;t.BitmarkParserGenerator=class{constructor(){this.ast=new a.Ast,this.jsonParser=new p.JsonParser,this.bitmarkParser=new d.BitmarkParser,this.jsonStringifyPrettify=(e,t,r)=>{const i=!0===t.prettify?2:t.prettify||void 0;return r||!0===t.stringify||void 0!==i?JSON.stringify(e,null,i):e}}version(){return h.env.appVersion.full}convert(e,t){return s(this,void 0,void 0,(function*(){let r;const i=Object.assign({},t),o=Object.assign({},i.fileOptions),n=Object.assign({},i.jsonOptions),a=i.outputFormat,d=a===y.bitmark,p=a===y.json,g=a===y.ast,f=i.bitmarkParserType;let m=e;if(h.env.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");h.env.isNode&&fs.existsSync(m)&&(m=fs.readFileSync(m,{encoding:"utf8"}));let b=this.ast.preprocessAst(m);const v=!!b;v||(b=this.jsonParser.toAst(m));const T=!!(null==b?void 0:b.bits),A=e=>s(this,void 0,void 0,(function*(){yield P(e),yield x(r)})),P=e=>s(this,void 0,void 0,(function*(){r=this.bitmarkParser.toAst(e,{parserType:f})})),_=e=>s(this,void 0,void 0,(function*(){if(f===c.BitmarkParserType.antlr){const t=this.bitmarkParser.parseUsingAntlr(e);if(i.outputFile){const e=this.jsonStringifyPrettify(t,n,!0),r=o.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(i.outputFile.toString())),fs.writeFileSync(i.outputFile,e,{flag:r})}else r=this.jsonStringifyPrettify(t,n)}else if(b=this.bitmarkParser.toAst(e,{parserType:f}),i.outputFile){const e=new JsonFileGenerator_1.JsonFileGenerator(i.outputFile,i);yield e.generate(b)}else{const e=new u.JsonObjectGenerator(i),t=yield e.generate(b);r=this.jsonStringifyPrettify(t,n)}})),x=e=>s(this,void 0,void 0,(function*(){if(i.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(i.outputFile,i);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(i);r=yield t.generate(e)}})),w=e=>s(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,n)})),S=e=>s(this,void 0,void 0,(function*(){if(i.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(i.outputFile,i);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(i),o=yield t.generate(e);r=this.jsonStringifyPrettify(o,n)}})),O=e=>s(this,void 0,void 0,(function*(){if(i.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(i.outputFile,i);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(i);r=yield t.generate(e)}})),R=e=>s(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,n)})),k=e=>s(this,void 0,void 0,(function*(){yield S(e)}));return!T&&!v?d?yield A(m):g?yield P(m):yield _(m):v?g?yield w(b):p?yield S(b):yield x(b):p?yield k(b):g?yield R(b):yield O(b),r}))}upgrade(e,t){return s(this,void 0,void 0,(function*(){let r;const i=Object.assign({},t),o=Object.assign({},i.jsonOptions),n=i.bitmarkParserType;let a=e;if(h.env.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");h.env.isNode&&fs.existsSync(a)&&(a=fs.readFileSync(a,{encoding:"utf8"}));let c=this.jsonParser.toAst(a);const d=e=>s(this,void 0,void 0,(function*(){const t=this.bitmarkParser.toAst(e,{parserType:n});if(i.outputFile){const e=new BitmarkFileGenerator_1.BitmarkFileGenerator(i.outputFile,i);yield e.generate(t)}else{const e=new l.BitmarkStringGenerator(i);r=yield e.generate(t)}})),p=e=>s(this,void 0,void 0,(function*(){if(i.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(i.outputFile,i);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(i),s=yield t.generate(e);r=this.jsonStringifyPrettify(s,o)}}));return!!!(null==c?void 0:c.bits)?yield d(a):yield p(c),r}))}createAst(e){let t,r=e;h.env.isNode&&fs.existsSync(r)&&(r=fs.readFileSync(r,{encoding:"utf8"}));let i=this.ast.preprocessAst(r);const o=!!i;o||(i=this.jsonParser.toAst(r));return t=!!!(null==i?void 0:i.bits)&&!o?this.bitmarkParser.toAst(r):i,t}}},8256:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Ast=void 0;const i=r(7087),o=r(549),s=r(3633);t.Ast=class{constructor(){(0,i.init)()}walk(e,t,r,i){this.walkRecursive(e,void 0,r,[{index:0,key:t,value:e}],i)}getRouteKey(e){return e.reduce(((t,r,i)=>(+r.key!==r.index&&(t+=`${r.key}`,i<e.length-1&&(t+="_")),t)),"")}printTree(e,t=o.NodeType.bitmarkAst){this.walkRecursive(e,void 0,{enter:(e,t,r)=>{console.log("Enter: "+this.getRouteKey(r))},between:(e,t,r,i,o)=>{console.log("Between: "+this.getRouteKey(o))},exit:(e,t,r)=>{console.log("Exit: "+this.getRouteKey(r))},leaf:(e,t,r)=>{console.log("Leaf: "+this.getRouteKey(r))}},[{index:0,key:t,value:e}],void 0)}preprocessAst(e){if(s.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){return!(!Object.prototype.hasOwnProperty.call(e,"bits")||!Array.isArray(e.bits))}walkRecursive(e,t,r,i,o){const{enter:s,between:n,exit:a,leaf:l}=r,u=i[i.length-1].key,c=!this.isValue(e),d=i[i.length-1];if(c){if(s){if(!1===s(d,t,i,o))return}}else l&&l(d,t,i,o);if(c){const s=this.isArray(e),a=Object.keys(e);for(let l=0,c=a.length;l<c;l++){const p=a[l],h=l===c-1,y=e,g=y[p];if(null!=g){const e={key:this.getAstKey(p,u,s),index:l,value:g},c=i.slice();if(c.push(e),this.walkRecursive(g,d,r,c,o),!h){const r=a[l+1],c=y[r],p={key:this.getAstKey(r,u,s),index:l+1,value:c};if(n){if(!1===n(d,e,p,t,i,o))break}}}}}c&&a&&a(d,t,i,o)}getAstKey(e,t,r){let i=e;return r&&t&&(i=`${t}Value`),o.NodeType.fromKey(i)||`unknown(${i})`}isArray(e){return Array.isArray(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}}},423:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseBuilder=void 0;const i=r(4719),o=r(7646),s=r(672),n=r(994),a=r(3633);t.BaseBuilder=class{toExample(e,t){return null!=t?(!0===t&&(t="true"),!1===t&&(t="false"),{isDefaultExample:!1,isExample:!0,example:t}):e?{isDefaultExample:!0,isExample:!0}:{isDefaultExample:!1,isExample:!1}}toExampleBoolean(e,t){const r=null!=t&&!s.BooleanUtils.isBooleanString(t);return null==t||r?e||r?{isDefaultExample:!0,isExample:!0}:{isDefaultExample:!1,isExample:!1}:{isDefaultExample:!1,isExample:!0,example:s.BooleanUtils.toBoolean(t)}}toAstProperty(e,t){var r;const l=null!==(r=i.PropertyKey.getMetadata(e))&&void 0!==r?r:{};if(null==t)return;const u=e=>{if(null!=e)return l.isTrimmedString&&(e=a.StringUtils.isString(e)?a.StringUtils.trimmedString(e):void 0),l.isNumber&&(e=n.NumberUtils.asNumber(e)),l.isBoolean&&(e=s.BooleanUtils.toBoolean(e,!0)),l.isInvertedBoolean&&(e=!s.BooleanUtils.toBoolean(e,!0)),e};if(Array.isArray(t)){const e=t;for(let t=0,r=e.length;t<r;t++)e[t]=u(e[t])}else t=u(t);return o.ArrayUtils.asArray(t)}}},9046:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=void 0;const i=r(208),o=r(1060),s=r(4719),n=r(1353),a=r(7646),l=r(4598),u=r(994),c=r(4309),d=r(671),p=r(423),h=r(2377);class y extends p.BaseBuilder{bitmark(e){const{bits:t,errors:r}=e,i={bits:t,errors:r};return c.ObjectUtils.removeUnwantedProperties(i),i}bit(e){var t;const{bitType:r,textFormat:i,resourceType:o,id:d,externalId:p,spaceId:y,padletId:g,aiGenerated:f,releaseVersion:m,ageRange:b,language:v,computerLanguage:T,target:A,tag:P,icon:_,iconTag:x,colorTag:w,subtype:S,coverImage:O,publisher:R,publications:k,author:C,subject:E,date:I,location:j,theme:B,kind:L,action:N,thumbImage:M,focusX:U,focusY:K,duration:D,referenceProperty:V,deeplink:F,externalLink:G,externalLinkText:H,videoCallLink:$,bot:q,list:J,textReference:z,isTracked:W,isInfoOnly:Y,labelTrue:X,labelFalse:Q,book:Z,quotedPerson:ee,partialAnswer:te,levelProperty:re,title:ie,subtitle:oe,level:se,toc:ne,progress:ae,anchor:le,reference:ue,referenceEnd:ce,item:de,lead:pe,hint:he,instruction:ye,isDefaultExample:ge,example:fe,partner:me,markConfig:be,extraProperties:ve,resource:Te,body:Ae,sampleSolution:Pe,footer:_e,markup:xe,parser:we}=e,Se=this.cardNode(e),Oe=Object.assign(Object.assign({bitType:r,textFormat:null!==(t=n.TextFormat.fromValue(i))&&void 0!==t?t:n.TextFormat.bitmarkMinusMinus,resourceType:l.BitUtils.calculateValidResourceType(r,o,Te),id:this.toAstProperty(s.PropertyKey.id,d),externalId:this.toAstProperty(s.PropertyKey.externalId,p),spaceId:this.toAstProperty(s.PropertyKey.spaceId,y),padletId:this.toAstProperty(s.PropertyKey.padletId,g),aiGenerated:this.toAstProperty(s.PropertyKey.aiGenerated,f),releaseVersion:this.toAstProperty(s.PropertyKey.releaseVersion,m),book:Z,ageRange:this.toAstProperty(s.PropertyKey.ageRange,b),language:this.toAstProperty(s.PropertyKey.language,v),computerLanguage:this.toAstProperty(s.PropertyKey.computerLanguage,T),target:this.toAstProperty(s.PropertyKey.target,A),tag:this.toAstProperty(s.PropertyKey.tag,P),icon:this.toAstProperty(s.PropertyKey.icon,_),iconTag:this.toAstProperty(s.PropertyKey.iconTag,x),colorTag:this.toAstProperty(s.PropertyKey.colorTag,w),subtype:this.toAstProperty(s.PropertyKey.subtype,S),coverImage:this.toAstProperty(s.PropertyKey.coverImage,O),publisher:this.toAstProperty(s.PropertyKey.publisher,R),publications:this.toAstProperty(s.PropertyKey.publications,k),author:this.toAstProperty(s.PropertyKey.author,C),subject:this.toAstProperty(s.PropertyKey.subject,E),date:this.toAstProperty(s.PropertyKey.date,I),location:this.toAstProperty(s.PropertyKey.location,j),theme:this.toAstProperty(s.PropertyKey.theme,B),kind:this.toAstProperty(s.PropertyKey.kind,L),action:this.toAstProperty(s.PropertyKey.action,N),thumbImage:this.toAstProperty(s.PropertyKey.thumbImage,M),focusX:this.toAstProperty(s.PropertyKey.focusX,U),focusY:this.toAstProperty(s.PropertyKey.focusY,K),deeplink:this.toAstProperty(s.PropertyKey.deeplink,F),externalLink:this.toAstProperty(s.PropertyKey.externalLink,G),externalLinkText:this.toAstProperty(s.PropertyKey.externalLinkText,H),videoCallLink:this.toAstProperty(s.PropertyKey.videoCallLink,$),bot:this.toAstProperty(s.PropertyKey.bot,q),duration:this.toAstProperty(s.PropertyKey.duration,D),referenceProperty:this.toAstProperty(s.PropertyKey.reference,V),list:this.toAstProperty(s.PropertyKey.list,J),textReference:this.toAstProperty(s.PropertyKey.textReference,z),isTracked:this.toAstProperty(s.PropertyKey.isTracked,W),isInfoOnly:this.toAstProperty(s.PropertyKey.isInfoOnly,Y),labelTrue:this.toAstProperty(s.PropertyKey.labelTrue,X),labelFalse:this.toAstProperty(s.PropertyKey.labelFalse,Q),quotedPerson:this.toAstProperty(s.PropertyKey.quotedPerson,ee),partialAnswer:this.toAstProperty(s.PropertyKey.partialAnswer,te),levelProperty:this.toAstProperty(s.PropertyKey.level,re),title:ie,subtitle:oe,level:u.NumberUtils.asNumber(se),toc:this.toAstProperty(s.PropertyKey.toc,ne),progress:this.toAstProperty(s.PropertyKey.progress,ae),anchor:le,reference:ue,referenceEnd:ce,markConfig:be,itemLead:this.itemLead(de,pe),hint:he,instruction:ye},this.toExample(ge,fe)),{partner:me,resource:Te,body:Ae,sampleSolution:a.ArrayUtils.asArray(Pe),cardNode:Se,footer:_e,markup:xe,parser:we,extraProperties:this.parseExtraProperties(ve)});return this.pushExampleDownTree(Ae,Se,ge,fe),this.setDefaultBitValues(Oe),this.setIsExampleFlags(Oe),this.addVersionToParserInfo(Oe),c.ObjectUtils.removeUnwantedProperties(Oe,{ignoreAllFalse:!0,ignoreEmptyString:["example"]}),h.NodeValidator.validateBit(Oe)}choice(e){const{text:t,isCorrect:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:s,instruction:n},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}response(e){const{text:t,isCorrect:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:s,instruction:n},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}botResponse(e){const{response:t,reaction:r,feedback:i,item:o,lead:s,hint:n}=e,a={response:t,reaction:r,feedback:i,itemLead:this.itemLead(o,s),hint:n};return c.ObjectUtils.removeUnwantedProperties(a,{ignoreEmptyString:["response","reaction","feedback"]}),a}quiz(e){const{choices:t,responses:r,item:i,lead:o,hint:s,instruction:n,isDefaultExample:a}=e;this.pushExampleDownTreeBoolean(a,void 0,!0,t),this.pushExampleDownTreeBoolean(a,void 0,!1,r);const l={itemLead:this.itemLead(i,o),hint:s,instruction:n,isExample:a,choices:t,responses:r};return c.ObjectUtils.removeUnwantedProperties(l,{ignoreAllFalse:!0}),l}heading(e){var t;const{forKeys:r,forValues:i}=e;if(null==r)return;const o={forKeys:r||"",forValues:null!==(t=a.ArrayUtils.asArray(i))&&void 0!==t?t:[]};return c.ObjectUtils.removeUnwantedProperties(o),o}pair(e){const{key:t,keyAudio:r,keyImage:i,values:o,item:s,lead:n,hint:a,instruction:l,isCaseSensitive:u,isShortAnswer:d,isDefaultExample:p,example:h}=e,y=Object.assign(Object.assign({key:t,keyAudio:r,keyImage:i,itemLead:this.itemLead(s,n),hint:a,instruction:l},this.toExample(p,h)),{isCaseSensitive:u,isShortAnswer:d,values:o});return c.ObjectUtils.removeUnwantedProperties(y,{ignoreAllFalse:!0}),y}matrix(e){const{key:t,cells:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isShortAnswer:l,isDefaultExample:u}=e;let d=!1;for(const e of null!=r?r:[])u&&!e.isExample&&(e.isDefaultExample=!0,e.isExample=!0),d=!!e.isExample||d;const p={key:t,itemLead:this.itemLead(i,o),hint:s,instruction:n,isCaseSensitive:a,isShortAnswer:l,isExample:d,cells:r};return c.ObjectUtils.removeUnwantedProperties(p,{ignoreAllFalse:!0}),p}matrixCell(e){const{values:t,item:r,lead:i,hint:o,instruction:s,isDefaultExample:n,example:a}=e,l=Object.assign({values:t,itemLead:this.itemLead(r,i),hint:o,instruction:s},this.toExample(n,a));return c.ObjectUtils.removeUnwantedProperties(l,{ignoreAllFalse:!0}),l}question(e){const{question:t,partialAnswer:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isShortAnswer:l,sampleSolution:u,isDefaultExample:d,example:p}=e,h=Object.assign(Object.assign({itemLead:this.itemLead(i,o),question:t,partialAnswer:r,hint:s,instruction:n},this.toExample(d,p)),{isCaseSensitive:a,isShortAnswer:l,sampleSolution:u});return c.ObjectUtils.removeUnwantedProperties(h,{ignoreEmptyString:["question"],ignoreAllFalse:!0}),h}body(e){const{bodyParts:t}=e;return{bodyParts:t}}bodyText(e){const{text:t}=e;return{type:o.BodyBitType.text,data:{bodyText:t}}}footerText(e){const{text:t}=e;return{footerText:t}}gap(e){const{solutions:t,item:r,lead:i,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d={type:o.BodyBitType.gap,data:Object.assign(Object.assign({solutions:t,itemLead:this.itemLead(r,i),hint:s,instruction:n},this.toExample(l,u)),{isCaseSensitive:a})};return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}markConfig(e){const{mark:t,color:r,emphasis:i}=e,o={mark:t,color:r,emphasis:i};return c.ObjectUtils.removeUnwantedProperties(o),o}mark(e){const{solution:t,mark:r,item:i,lead:s,hint:n,instruction:a,isDefaultExample:l,example:u}=e,d={type:o.BodyBitType.mark,data:Object.assign({solution:t,mark:r,itemLead:this.itemLead(i,s),hint:n,instruction:a},this.toExample(l,u))};return c.ObjectUtils.removeUnwantedProperties(d),d}select(e){const{options:t,prefix:r,postfix:i,item:s,lead:n,hint:a,instruction:l,isCaseSensitive:u}=e,d={type:o.BodyBitType.select,data:{prefix:r,options:t,postfix:i,itemLead:this.itemLead(s,n),hint:a,instruction:l,isCaseSensitive:u}};return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}selectOption(e){const{text:t,isCorrect:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:s,instruction:n},this.toExample(l,u)),{isCaseSensitive:a});return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}highlight(e){const{texts:t,prefix:r,postfix:i,item:s,lead:n,hint:a,instruction:l,isCaseSensitive:u}=e,d={type:o.BodyBitType.highlight,data:{prefix:r,texts:t,postfix:i,itemLead:this.itemLead(s,n),hint:a,instruction:l,isCaseSensitive:u}};return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}highlightText(e){const{text:t,isCorrect:r,isHighlighted:i,item:o,lead:s,hint:n,instruction:a,isCaseSensitive:l,isDefaultExample:u,example:d}=e,p=Object.assign(Object.assign({text:t,isCorrect:!!r,isHighlighted:!!i,itemLead:this.itemLead(o,s),hint:n,instruction:a},this.toExample(u,d)),{isCaseSensitive:l});return c.ObjectUtils.removeUnwantedProperties(p,{ignoreAllFalse:!0}),p}flashcard(e){const{question:t,answer:r,alternativeAnswers:i,item:o,lead:s,hint:n,instruction:a,isDefaultExample:l,example:u}=e,d=Object.assign({question:t,answer:r,alternativeAnswers:i,itemLead:this.itemLead(o,s),hint:n,instruction:a},this.toExampleBoolean(l,u));return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}statement(e){const{text:t,isCorrect:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:s,instruction:n},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}partner(e){const{name:t,avatarImage:r}=e,i={name:t,avatarImage:r};return c.ObjectUtils.removeUnwantedProperties(i),i}comment(e){const{text:t,location:r}=e,i={text:t,location:r};return c.ObjectUtils.removeUnwantedProperties(i),i}itemLead(e,t){let r;return(e||t)&&(r={item:e,lead:t}),r}cardNode(e){let t;const{questions:r,elements:i,flashcards:o,statement:s,statements:n,choices:a,responses:l,quizzes:u,heading:d,pairs:p,matrix:h,botResponses:y}=e;return(r||i||o||s||n||a||l||u||d||p||h||y)&&(t={questions:r,elements:i,flashcards:o,statement:s,statements:n,choices:a,responses:l,quizzes:u,heading:d,pairs:p,matrix:h,botResponses:y},c.ObjectUtils.removeUnwantedProperties(t)),t}pushExampleDownTreeBoolean(e,t,r,...i){if(!e&&!t)return;const o=e=>{e.isExample||r&&!e.isCorrect||(e.isDefaultExample=!0,e.isExample=!0)};if(Array.isArray(i))for(const e of i)if(Array.isArray(e))for(const t of e)o(t);else e&&o(e)}pushExampleDownTree(e,t,r,i){if(r||i){if(t){if(this.pushExampleDownTreeString(r,i,t.pairs),this.pushExampleDownTreeBoolean(r,i,!1,t.flashcards),this.pushExampleDownTreeBoolean(r,i,!0,t.choices),this.pushExampleDownTreeBoolean(r,i,!1,t.responses,t.statements,t.statement),t.quizzes)for(const e of t.quizzes)this.pushExampleDownTreeBoolean(r,i,!0,e.choices),this.pushExampleDownTreeBoolean(r,i,!1,e.responses);if(t.matrix)for(const e of t.matrix)this.pushExampleDownTreeString(r,i,e.cells)}e&&this.pushExampleDownTreeBodyBits(r,i,e)}}pushExampleDownTreeString(e,t,...r){if(!e&&!t)return;const i=r=>{r.isExample||(e?(r.isDefaultExample=!0,r.isExample=!0):(r.isDefaultExample=!1,r.example=t))};if(Array.isArray(r))for(const e of r)if(Array.isArray(e))for(const t of e)i(t);else e&&i(e)}pushExampleDownTreeBodyBits(e,t,r){if((e||t)&&r&&r.bodyParts&&0!==r.bodyParts.length)for(const e of r.bodyParts)if(e)switch(e.type){case o.BodyBitType.gap:{const t=e;t.data.isExample||(t.data.isDefaultExample=!0,t.data.isExample=!0);break}case o.BodyBitType.mark:{const t=e;t.data.isExample||(t.data.isDefaultExample=!0,t.data.isExample=!0);break}case o.BodyBitType.select:{const t=e;for(const e of t.data.options)!e.isExample&&e.isCorrect&&(e.isDefaultExample=!0,e.isExample=!0);break}case o.BodyBitType.highlight:{const t=e;for(const e of t.data.texts)!e.isExample&&e.isCorrect&&(e.isDefaultExample=!0,e.isExample=!0);break}}}parseExtraProperties(e){if(!e)return;const t=Object.entries(e);if(0===t.length)return;const r={};for(const[e,i]of t)r[e]=a.ArrayUtils.asArray(i)||[i];return r}setIsExampleFlags(e){var t,r,i,s,n,a,l,u,c,d,p,h,y;e.isExample=!1;const g=t=>!!t&&(t.isDefaultExample||null!=t.example?(t.isExample=!0,e.isExample=!0):t.isExample=t===e&&!!e.isExample,t.isExample),{body:f,cardNode:m}=e;if(f&&f.bodyParts)for(const e of f.bodyParts)switch(e.type){case o.BodyBitType.gap:case o.BodyBitType.mark:g(e.data);break;case o.BodyBitType.select:{const t=e;let r=!1;for(const e of t.data.options)r=!!g(e)||r;t.data.isExample=r;break}case o.BodyBitType.highlight:{const t=e;let r=!1;for(const e of t.data.texts)r=!!g(e)||r;t.data.isExample=r;break}}if(m){for(const e of null!==(t=m.flashcards)&&void 0!==t?t:[])g(e);for(const e of null!==(r=m.pairs)&&void 0!==r?r:[])g(e);for(const e of null!==(i=m.matrix)&&void 0!==i?i:[]){let t=!1;for(const r of null!==(s=e.cells)&&void 0!==s?s:[])t=!!g(r)||t;e.isExample=t}for(const e of null!==(n=m.quizzes)&&void 0!==n?n:[]){let t=!1;for(const r of null!==(a=e.responses)&&void 0!==a?a:[])t=!!g(r)||t;for(const r of null!==(l=e.choices)&&void 0!==l?l:[])t=!!g(r)||t;e.isExample=t}for(const e of null!==(u=m.responses)&&void 0!==u?u:[])g(e);for(const e of null!==(c=m.choices)&&void 0!==c?c:[])g(e);for(const e of null!==(d=m.statements)&&void 0!==d?d:[])g(e);g(m.statement);for(const e of null!==(p=m.questions)&&void 0!==p?p:[])g(e)}g(e.statement);for(const t of null!==(h=e.responses)&&void 0!==h?h:[])g(t);for(const t of null!==(y=e.choices)&&void 0!==y?y:[])g(t);g(e)}setDefaultBitValues(e){switch(e.bitType.alias){case i.AliasBitType.articleAi:case i.AliasBitType.noteAi:case i.AliasBitType.summaryAi:e.aiGenerated=this.toAstProperty(s.PropertyKey.aiGenerated,!0)}}addVersionToParserInfo(e){var t;const r=null!==(t=e.parser)&&void 0!==t?t:{};r.version=d.env.appVersion.full,e.parser=r}}t.Builder=y},8703:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceBuilder=void 0;const o=r(1895),s=r(4309),n=r(169),a=r(423),l=r(2377);class u extends a.BaseBuilder{resource(e){var t,r,s;let n;const{type:a,value:l,format:u}=e,c=i(e,["type","value","format"]),d=Object.assign({type:a,value:null!=l?l:"",format:null!=u?u:""},c);switch(a){case o.ResourceType.video:case o.ResourceType.videoEmbed:case o.ResourceType.videoLink:case o.ResourceType.stillImageFilmEmbed:case o.ResourceType.stillImageFilmLink:{const r=["src1x","src2x","src3x","src4x"],i=[];for(const t of r){const r=e[t];if(r){const e=this.resource({type:o.ResourceType.image,value:r});e&&i.push(e)}}d.thumbnails=[...null!==(t=d.thumbnails)&&void 0!==t?t:[],...i]}}switch(a){case o.ResourceType.image:n=this.imageResource(d);break;case o.ResourceType.imageLink:n=this.imageLinkResource(d);break;case o.ResourceType.audio:n=this.audioResource(d);break;case o.ResourceType.audioEmbed:n=this.audioEmbedResource(d);break;case o.ResourceType.audioLink:n=this.audioLinkResource(d);break;case o.ResourceType.video:n=this.videoResource(d);break;case o.ResourceType.videoEmbed:n=this.videoEmbedResource(d);break;case o.ResourceType.videoLink:n=this.videoLinkResource(d);break;case o.ResourceType.stillImageFilm:n=this.stillImageFilmResource({image:this.imageResource(null!==(r=d.image)&&void 0!==r?r:{format:"",value:""}),audio:this.audioResource(null!==(s=d.audio)&&void 0!==s?s:{format:"",value:""})});break;case o.ResourceType.stillImageFilmEmbed:n=this.stillImageFilmEmbedResource(d);break;case o.ResourceType.stillImageFilmLink:n=this.stillImageFilmLinkResource(d);break;case o.ResourceType.article:n=this.articleResource(d);break;case o.ResourceType.document:n=this.documentResource(d);break;case o.ResourceType.documentEmbed:n=this.documentEmbedResource(d);break;case o.ResourceType.documentLink:n=this.documentLinkResource(d);break;case o.ResourceType.documentDownload:n=this.documentDownloadResource(d);break;case o.ResourceType.appLink:n=this.appLinkResource(d);break;case o.ResourceType.websiteLink:n=this.websiteLinkResource(d)}return n}imageResource(e){const{value:t,src1x:r,src2x:i,src3x:a,src4x:u,width:c,height:d,alt:p,license:h,copyright:y,showInIndex:g,caption:f}=e,m={type:o.ResourceType.image,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,src1x:r,src2x:i,src3x:a,src4x:u,width:c,height:d,alt:p,license:h,copyright:y,showInIndex:g,caption:f};return s.ObjectUtils.removeUnwantedProperties(m),l.NodeValidator.validateResource(m)}imageLinkResource(e){const{value:t,src1x:r,src2x:i,src3x:a,src4x:u,width:c,height:d,alt:p,license:h,copyright:y,showInIndex:g,caption:f}=e,m={type:o.ResourceType.imageLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,src1x:r,src2x:i,src3x:a,src4x:u,width:c,height:d,alt:p,license:h,copyright:y,showInIndex:g,caption:f};return s.ObjectUtils.removeUnwantedProperties(m),l.NodeValidator.validateResource(m)}audioResource(e){const{value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p}=e,h={type:o.ResourceType.audio,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p};return s.ObjectUtils.removeUnwantedProperties(h),l.NodeValidator.validateResource(h)}audioEmbedResource(e){const{value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p}=e,h={type:o.ResourceType.audioEmbed,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p};return s.ObjectUtils.removeUnwantedProperties(h),l.NodeValidator.validateResource(h)}audioLinkResource(e){const{value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p}=e,h={type:o.ResourceType.audioLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p};return s.ObjectUtils.removeUnwantedProperties(h),l.NodeValidator.validateResource(h)}videoResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v}=e,T={type:o.ResourceType.video,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}videoEmbedResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v}=e,T={type:o.ResourceType.videoEmbed,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}videoLinkResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v}=e,T={type:o.ResourceType.videoLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}stillImageFilmResource(e){const{image:t,audio:r}=e,i={type:o.ResourceType.stillImageFilm,image:null!=t?t:this.imageResource({format:"",value:""}),audio:null!=r?r:this.audioResource({format:"",value:""})};return s.ObjectUtils.removeUnwantedProperties(i),l.NodeValidator.validateResource(i)}stillImageFilmEmbedResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v}=e,T={type:o.ResourceType.stillImageFilmEmbed,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}stillImageFilmLinkResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v}=e,T={type:o.ResourceType.stillImageFilmLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:g,license:f,copyright:m,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}articleResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.article,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.document,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentEmbedResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.documentEmbed,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentLinkResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.documentLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentDownloadResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.documentDownload,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}appLinkResource(e){const{value:t,license:r,copyright:i,showInIndex:n,caption:a}=e,u={type:o.ResourceType.appLink,value:t,license:r,copyright:i,showInIndex:n,caption:a};return s.ObjectUtils.removeUnwantedProperties(u),l.NodeValidator.validateResource(u)}websiteLinkResource(e){const{value:t,siteName:r,license:i,copyright:n,showInIndex:a,caption:u}=e,c={type:o.ResourceType.websiteLink,value:t,siteName:r,license:i,copyright:n,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}}t.ResourceBuilder=u},2377:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValidator=void 0;const i=r(208),o=r(1895),s=r(3633);const n=new class{validateBit(e){if(!e)return e;let t=e;if(e.bitType.root===i.RootBitType.interview)t=this.validateInterviewBit(e);return t}validateResource(e){var t,r;if(!e)return;let i=e,s=!1;switch(e.type){case o.ResourceType.stillImageFilm:{const i=e;i.image=null!==(t=this.validateResource(i.image))&&void 0!==t?t:{type:o.ResourceType.image},i.audio=null!==(r=this.validateResource(i.audio))&&void 0!==r?r:{type:o.ResourceType.audio},s=!!i.image||!!i.audio;break}default:s=!!e.value}return s||e.type&&(i={type:e.type}),i}isRequired(e,t){if(!e)throw new Error(`${t} is required but is not set`)}isOneOfRequired(e,t){if(Array.isArray(e))for(const t of e)if(t)return;throw new Error(`One of '${t.join(", ")}' is required but none is set`)}isString(e,t){if(!s.StringUtils.isString(e))throw new Error(`${t} is required to be a string`)}isNonEmptyString(e,t){if(!s.StringUtils.isString(e)||""===e)throw new Error(`${t} is required to be a non-empty string`)}isStringOrBoolean(e,t){if(!s.StringUtils.isString(e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a string or a boolean`)}isNonEmptyStringOrBoolean(e,t){if((!s.StringUtils.isString(e)||""===e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a non-empty string or a boolean`)}isArray(e,t){if(!Array.isArray(e))throw new Error(`${t} is required to be a array`)}isNonEmptyArray(e,t){if(!(Array.isArray(e)&&e.length>0))throw new Error(`${t} is required to be a non-empty array`)}isNumber(e,t){if(!Number.isFinite(e))throw new Error(`${t} is required to be a number`)}isBoolean(e,t){if(!0!==e&&!1!==e)throw new Error(`${t} is required to be a boolean`)}isStringOrNumberOrBooleanOrNullOrUndefined(e,t){if(!s.StringUtils.isString(e)&&!Number.isFinite(e)&&!0!==e&&!1!==e&&null!=e)throw new Error(`${t} is required to be a string or a number or a boolean or null or undefined`)}validateInterviewBit(e){return e.cardNode||(e.cardNode={}),e.cardNode.questions||(e.cardNode.questions=[]),e}};t.NodeValidator=n},227:function(e,t){var r=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;t.StringWriter=class{constructor(){this._string="",this.endOfLineString="\n"}get isSync(){return!0}getString(){return this._string}open(){return r(this,void 0,void 0,(function*(){this.openSync(),Promise.resolve()}))}close(){return r(this,void 0,void 0,(function*(){try{this.closeSync()}catch(e){return Promise.reject(e)}Promise.resolve()}))}openSync(){this._buffer=[],this._string=""}closeSync(){if(!this._buffer)throw new Error("open() or openSync() never called");this._string=this._buffer.join(""),this._buffer=[]}writeLine(e){return this._buffer?(null!=e?this._buffer.push(e+this.endOfLineString):this._buffer.push(this.endOfLineString),this):this}writeLines(e,t){if(!this._buffer)return this;if(!e)return this;for(let r=0,i=e.length;r<i;r++){const o=e[r];this._buffer.push(o),t&&r<i-1&&this._buffer.push(t),this._buffer.push(this.endOfLineString)}return this}write(e){return this._buffer?(null==e||this._buffer.push(e),this):this}writeWhiteSpace(){return this.write(" "),this}}},4842:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208);i.RootBitType.setMetadata(i.RootBitType._error,{tags:{},resourceAttachmentAllowed:!1,bodyAllowed:!0})},3616:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.appLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_APP_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.appLink,bodyAllowed:!1})},4373:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.article,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),{[o.TagType.Title]:{}}),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},2773:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.articleEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ARTICLE_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.articleEmbed,bodyAllowed:!0})},6360:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.articleLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ARTICLE_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.articleLink,bodyAllowed:!0})},6246:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.audio,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_AUDIO_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.audio,bodyAllowed:!0})},9309:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.audioEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_AUDIO_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.audioEmbed,bodyAllowed:!0})},591:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.audioLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_AUDIO_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.audioLink,bodyAllowed:!0})},3851:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.bitAlias,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.TagType.Reference]:{},[o.TagType.Anchor]:{}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},980:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(9881),o=r(208),s=r(4719),n=r(6562),a=r(6027);o.RootBitType.setMetadata(o.RootBitType.book,{tags:Object.assign(Object.assign({},a.TAGS_DEFAULT),{[s.PropertyKey.spaceId]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[n.TagType.Title]:{maxCount:2},[s.PropertyKey.subtype]:{isProperty:!0},[s.PropertyKey.coverImage]:{isProperty:!0},[s.PropertyKey.publisher]:{isProperty:!0},[s.PropertyKey.subject]:{isProperty:!0},[s.PropertyKey.author]:{isProperty:!0},[s.PropertyKey.theme]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},8788:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.botActionResponse,{tags:Object.assign({},s.TAGS_DEFAULT),resourceAttachmentAllowed:!1,cardSet:o.CARD_SET_BOT_ACTION_RESPONSES,bodyAllowed:!0,footerAllowed:!0})},1:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.botActionSend,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.PropertyKey.date]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},7386:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(1895),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.browserImage,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_IMAGE_RESOURCE),{[o.PropertyKey.focusX]:{isProperty:!0},[o.PropertyKey.focusY]:{isProperty:!0}}),resourceAttachmentAllowed:!1,resourceType:s.ResourceType.image,bodyAllowed:!0})},4865:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(5319),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.card1,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},3890:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.chapter,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.TagType.Anchor]:{},[o.TagType.Title]:{}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},3707:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.clozeAndMultipleChoiceText,{tags:Object.assign(Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),o.TAGS_CHAIN_GAP),o.TAGS_CHAIN_TRUE_FALSE),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},2585:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027),a={tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),o.TAGS_CHAIN_GAP),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0};i.RootBitType.setMetadata(i.RootBitType.cloze,a)},8161:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.code,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.PropertyKey.computerLanguage]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},5912:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.conversationLeft1,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),o.TAGS_CHAIN_PARTNER),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},8305:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.document,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_DOCUMENT_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.document,bodyAllowed:!0})},2438:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.documentDownload,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_DOCUMENT_DOWNLOAD_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.documentDownload,bodyAllowed:!0})},5983:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.documentEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_DOCUMENT_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.documentEmbed,bodyAllowed:!0})},1363:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.documentLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_DOCUMENT_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.documentLink,bodyAllowed:!0})},1934:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(7028),s=r(4719),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.essay,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),{[s.PropertyKey.sampleSolution]:{isProperty:!0}}),resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:o.ExampleType.string})},4954:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(7028),s=r(6562),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.example,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),{[s.TagType.Title]:{}}),n.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:o.ExampleType.string})},8157:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.flashcard,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:o.CARD_SET_FLASHCARDS,bodyAllowed:!0,footerAllowed:!0})},8253:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(1895),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.focusImage,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_IMAGE_RESOURCE),{[o.PropertyKey.focusX]:{isProperty:!0},[o.PropertyKey.focusY]:{isProperty:!0}}),resourceAttachmentAllowed:!1,resourceType:s.ResourceType.image,bodyAllowed:!0})},1614:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARD_SET_BOT_ACTION_RESPONSES=t.CARD_SET_MATCH_MATRIX=t.CARD_SET_MATCH_IMAGE_PAIRS=t.CARD_SET_MATCH_AUDIO_PAIRS=t.CARD_SET_MATCH_PAIRS=t.CARD_SET_QUESTIONS=t.CARD_SET_QUIZ=t.CARD_SET_STATEMENTS=t.CARD_SET_ELEMENTS=t.CARD_SET_FLASHCARDS=void 0;const i=r(7210),o=r(4719),s=r(1895),n=r(6562),a=r(781),l=r(6027),u={type:i.CardSetType.flashcards,variants:[[{tags:Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_FLASHCARDS=u;const c={type:i.CardSetType.elements,variants:[[{tags:Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_ELEMENTS=c;const d={type:i.CardSetType.statements,variants:[[{tags:Object.assign(Object.assign({[n.TagType.True]:{maxCount:1},[n.TagType.False]:{maxCount:1}},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE)}]]};t.CARD_SET_STATEMENTS=d;const p={type:i.CardSetType.quiz,variants:[[{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_CHAIN_TRUE_FALSE),l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE)}]]};t.CARD_SET_QUIZ=p;const h={type:i.CardSetType.questions,variants:[[{tags:Object.assign(Object.assign({[n.TagType.SampleSolution]:{},[o.PropertyKey.shortAnswer]:{isProperty:!0}},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),bodyAllowed:!0}]]};t.CARD_SET_QUESTIONS=h;const y={type:i.CardSetType.matchPairs,variants:[[{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),{[n.TagType.Title]:{}}),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_MATCH_PAIRS=y;const g={type:i.CardSetType.matchPairs,variants:[[{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),{[n.TagType.Title]:{},[s.ResourceType.audio]:{isResource:!0}}),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_MATCH_AUDIO_PAIRS=g;const f={type:i.CardSetType.matchPairs,variants:[[{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),{[n.TagType.Title]:{},[s.ResourceType.image]:{isResource:!0}}),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_MATCH_IMAGE_PAIRS=f;const m={type:i.CardSetType.matchMatrix,variants:[[{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),{[n.TagType.Title]:{}}),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_MATCH_MATRIX=m;const b={type:i.CardSetType.botActionResponses,variants:[[{tags:Object.assign(Object.assign({[o.PropertyKey.reaction]:{isProperty:!0}},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),bodyAllowed:!0}]]};t.CARD_SET_BOT_ACTION_RESPONSES=b},781:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS_CHAIN_MARK=t.TAGS_CHAIN_MARK_CONFIG=t.TAGS_CHAIN_TRUE_FALSE=t.TAGS_CHAIN_GAP=t.TAGS_CHAIN_PARTNER=void 0;const i=r(9881),o=r(4719),s=r(6562),n=r(5319),a=r(6027),l={[o.PropertyKey.partner]:{isProperty:!0,chain:Object.assign({},n.TAGS_CHAIN_IMAGE_RESOURCE)}};t.TAGS_CHAIN_PARTNER=l;const u={[s.TagType.Gap]:{maxCount:i.INFINITE_COUNT,chain:Object.assign(Object.assign({[s.TagType.Gap]:{maxCount:i.INFINITE_COUNT}},a.TAGS_ITEM_LEAD_INSTRUCTION_HINT),a.TAGS_PROPERTY_EXAMPLE)}};t.TAGS_CHAIN_GAP=u;const c={[s.TagType.True]:{maxCount:i.INFINITE_COUNT,chain:Object.assign(Object.assign({[s.TagType.True]:{maxCount:i.INFINITE_COUNT},[s.TagType.False]:{maxCount:i.INFINITE_COUNT}},a.TAGS_ITEM_LEAD_INSTRUCTION_HINT),a.TAGS_PROPERTY_EXAMPLE)},[s.TagType.False]:{maxCount:i.INFINITE_COUNT,chain:Object.assign(Object.assign({[s.TagType.True]:{maxCount:i.INFINITE_COUNT},[s.TagType.False]:{maxCount:i.INFINITE_COUNT}},a.TAGS_ITEM_LEAD_INSTRUCTION_HINT),a.TAGS_PROPERTY_EXAMPLE)}};t.TAGS_CHAIN_TRUE_FALSE=c;const d={[o.PropertyKey.mark]:{isProperty:!0,maxCount:i.INFINITE_COUNT,chain:{[o.PropertyKey.color]:{isProperty:!0},[o.PropertyKey.emphasis]:{isProperty:!0}}}};t.TAGS_CHAIN_MARK_CONFIG=d;const p={[s.TagType.Mark]:{maxCount:i.INFINITE_COUNT,chain:Object.assign({[o.PropertyKey.mark]:{isProperty:!0}},a.TAGS_PROPERTY_EXAMPLE)}};t.TAGS_CHAIN_MARK=p},5319:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS_CHAIN_ANY_RESOURCE=t.TAGS_CHAIN_WEBSITE_LINK_RESOURCE=t.TAGS_CHAIN_APP_LINK_RESOURCE=t.TAGS_CHAIN_DOCUMENT_DOWNLOAD_RESOURCE=t.TAGS_CHAIN_DOCUMENT_LINK_RESOURCE=t.TAGS_CHAIN_DOCUMENT_EMBED_RESOURCE=t.TAGS_CHAIN_DOCUMENT_RESOURCE=t.TAGS_CHAIN_ARTICLE_LINK_RESOURCE=t.TAGS_CHAIN_ARTICLE_EMBED_RESOURCE=t.TAGS_CHAIN_ARTICLE_RESOURCE=t.TAGS_CHAIN_STILL_IMAGE_FILM_LINK_RESOURCE=t.TAGS_CHAIN_STILL_IMAGE_FILM_EMBED_RESOURCE=t.TAGS_CHAIN_STILL_IMAGE_FILM_RESOURCE=t.TAGS_CHAIN_VIDEO_LINK_RESOURCE=t.TAGS_CHAIN_VIDEO_EMBED_RESOURCE=t.TAGS_CHAIN_VIDEO_RESOURCE=t.TAGS_CHAIN_AUDIO_LINK_RESOURCE=t.TAGS_CHAIN_AUDIO_EMBED_RESOURCE=t.TAGS_CHAIN_AUDIO_RESOURCE=t.TAGS_CHAIN_IMAGE_LINK_RESOURCE=t.TAGS_CHAIN_IMAGE_EMBED_RESOURCE=t.TAGS_CHAIN_IMAGE_RESOURCE=void 0;const i=r(4719),o=r(1895),s={[i.PropertyKey.license]:{isProperty:!0},[i.PropertyKey.copyright]:{isProperty:!0},[i.PropertyKey.caption]:{isProperty:!0},[i.PropertyKey.showInIndex]:{isProperty:!0}},n={[o.ResourceType.image]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0},[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0}})}};t.TAGS_CHAIN_IMAGE_RESOURCE=n;const a={[o.ResourceType.imageEmbed]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0},[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0}})}};t.TAGS_CHAIN_IMAGE_EMBED_RESOURCE=a;const l={[o.ResourceType.imageLink]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0},[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0}})}};t.TAGS_CHAIN_IMAGE_LINK_RESOURCE=l;const u={[o.ResourceType.audio]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0}})}};t.TAGS_CHAIN_AUDIO_RESOURCE=u;const c={[o.ResourceType.audioEmbed]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0}})}};t.TAGS_CHAIN_AUDIO_EMBED_RESOURCE=c;const d={[o.ResourceType.audioLink]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0}})}};t.TAGS_CHAIN_AUDIO_LINK_RESOURCE=d;const p={[o.ResourceType.video]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0},[i.PropertyKey.allowSubtitles]:{isProperty:!0},[i.PropertyKey.showSubtitles]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0},[i.PropertyKey.posterImage]:{isProperty:!0},[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0}})}};t.TAGS_CHAIN_VIDEO_RESOURCE=p;const h={[o.ResourceType.videoEmbed]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0},[i.PropertyKey.allowSubtitles]:{isProperty:!0},[i.PropertyKey.showSubtitles]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0},[i.PropertyKey.posterImage]:{isProperty:!0},[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0}})}};t.TAGS_CHAIN_VIDEO_EMBED_RESOURCE=h;const y={[o.ResourceType.videoLink]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0},[i.PropertyKey.allowSubtitles]:{isProperty:!0},[i.PropertyKey.showSubtitles]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0},[i.PropertyKey.posterImage]:{isProperty:!0},[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0}})}};t.TAGS_CHAIN_VIDEO_LINK_RESOURCE=y;const g={[o.ResourceType.image]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0},[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0}})},[o.ResourceType.audio]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0}})}};t.TAGS_CHAIN_STILL_IMAGE_FILM_RESOURCE=g;const f={[o.ResourceType.stillImageFilmEmbed]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0},[i.PropertyKey.allowSubtitles]:{isProperty:!0},[i.PropertyKey.showSubtitles]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0},[i.PropertyKey.posterImage]:{isProperty:!0},[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0}})}};t.TAGS_CHAIN_STILL_IMAGE_FILM_EMBED_RESOURCE=f;const m={[o.ResourceType.stillImageFilmLink]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0},[i.PropertyKey.allowSubtitles]:{isProperty:!0},[i.PropertyKey.showSubtitles]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0},[i.PropertyKey.posterImage]:{isProperty:!0},[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0}})}};t.TAGS_CHAIN_STILL_IMAGE_FILM_LINK_RESOURCE=m;const b={[o.ResourceType.article]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_ARTICLE_RESOURCE=b;const v={[o.ResourceType.articleEmbed]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_ARTICLE_EMBED_RESOURCE=v;const T={[o.ResourceType.articleLink]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_ARTICLE_LINK_RESOURCE=T;const A={[o.ResourceType.document]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_DOCUMENT_RESOURCE=A;const P={[o.ResourceType.documentEmbed]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_DOCUMENT_EMBED_RESOURCE=P;const _={[o.ResourceType.documentLink]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_DOCUMENT_LINK_RESOURCE=_;const x={[o.ResourceType.documentDownload]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_DOCUMENT_DOWNLOAD_RESOURCE=x;const w={[o.ResourceType.appLink]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_APP_LINK_RESOURCE=w;const S={[o.ResourceType.websiteLink]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.siteName]:{isProperty:!0}})}};t.TAGS_CHAIN_WEBSITE_LINK_RESOURCE=S;const O=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),a),l),u),c),d),p),h),y),g),f),m),b),v),T),A),P),_),x),w),S);t.TAGS_CHAIN_ANY_RESOURCE=O},6027:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS_PROPERTY_EXAMPLE=t.TAGS_ITEM_LEAD_INSTRUCTION_HINT=t.TAGS_ALL_BITS=t.TAGS_DEFAULT=void 0;const i=r(9881),o=r(4719),s=r(6562),n={[o.PropertyKey.id]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.externalId]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.aiGenerated]:{isProperty:!0},[o.PropertyKey.ageRange]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.language]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.target]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.tag]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.icon]:{isProperty:!0},[o.PropertyKey.iconTag]:{isProperty:!0},[o.PropertyKey.colorTag]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[s.TagType.Anchor]:{}};t.TAGS_ALL_BITS=n;const a={[s.TagType.ItemLead]:{maxCount:2},[s.TagType.Instruction]:{},[s.TagType.Hint]:{}};t.TAGS_ITEM_LEAD_INSTRUCTION_HINT=a;const l={[o.PropertyKey.example]:{isProperty:!0}};t.TAGS_PROPERTY_EXAMPLE=l;const u=Object.assign(Object.assign(Object.assign({},n),a),l);t.TAGS_DEFAULT=u},1559:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.highlightText,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),o.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},5046:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.image,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.image,bodyAllowed:!0})},76:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.imageLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.imageLink,bodyAllowed:!0})},4861:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.internalLink,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.TagType.Reference]:{}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},2161:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.interview,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:o.CARD_SET_QUESTIONS,bodyAllowed:!0,footerAllowed:!0})},9338:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(9881),o=r(208),s=r(4719),n=r(6562),a=r(5319),l=r(6027),u={[s.PropertyKey.action]:{isProperty:!0},[s.PropertyKey.duration]:{isProperty:!0},[s.PropertyKey.date]:{isProperty:!0},[s.PropertyKey.location]:{isProperty:!0},[s.PropertyKey.list]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[s.PropertyKey.textReference]:{isProperty:!0},[s.PropertyKey.isTracked]:{isProperty:!0},[s.PropertyKey.isInfoOnly]:{isProperty:!0},[s.PropertyKey.book]:{isProperty:!0,chain:{[n.TagType.Reference]:{maxCount:2}}}};o.RootBitType.setMetadata(o.RootBitType.learningPathBook,{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_DEFAULT),a.TAGS_CHAIN_ANY_RESOURCE),u),resourceAttachmentAllowed:!0,bodyAllowed:!0}),o.RootBitType.setMetadata(o.RootBitType.learningPathExternalLink,{tags:Object.assign(Object.assign(Object.assign(Object.assign({},l.TAGS_DEFAULT),a.TAGS_CHAIN_ANY_RESOURCE),u),{[s.PropertyKey.externalLink]:{isProperty:!0},[s.PropertyKey.externalLinkText]:{isProperty:!0}}),resourceAttachmentAllowed:!0,bodyAllowed:!0}),o.RootBitType.setMetadata(o.RootBitType.learningPathVideoCall,{tags:Object.assign(Object.assign(Object.assign(Object.assign({},l.TAGS_DEFAULT),a.TAGS_CHAIN_ANY_RESOURCE),u),{[s.PropertyKey.videoCallLink]:{isProperty:!0}}),resourceAttachmentAllowed:!0,bodyAllowed:!0})},700:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.mark,{tags:Object.assign(Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),o.TAGS_CHAIN_MARK_CONFIG),o.TAGS_CHAIN_MARK),resourceAttachmentAllowed:!0,bodyAllowed:!0})},8371:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(5319),s=r(6027),n=r(1614);i.RootBitType.setMetadata(i.RootBitType.match,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:n.CARD_SET_MATCH_PAIRS,bodyAllowed:!0,footerAllowed:!0}),i.RootBitType.setMetadata(i.RootBitType.matchMatrix,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:n.CARD_SET_MATCH_MATRIX,bodyAllowed:!0,footerAllowed:!0}),i.RootBitType.setMetadata(i.RootBitType.matchAudio,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:n.CARD_SET_MATCH_AUDIO_PAIRS,bodyAllowed:!0,footerAllowed:!0}),i.RootBitType.setMetadata(i.RootBitType.matchPicture,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:n.CARD_SET_MATCH_IMAGE_PAIRS,bodyAllowed:!0,footerAllowed:!0})},5730:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleChoice1,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),o.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},3947:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(781),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleChoice,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),s.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,cardSet:o.CARD_SET_QUIZ,bodyAllowed:!0,footerAllowed:!0})},9745:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleChoiceText,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),o.TAGS_CHAIN_TRUE_FALSE),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},2033:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleResponse1,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),o.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},9780:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(781),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleResponse,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),s.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,cardSet:o.CARD_SET_QUIZ,bodyAllowed:!0,footerAllowed:!0})},8801:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.photo,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.image,bodyAllowed:!0})},4446:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.quote,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.PropertyKey.quotedPerson]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},1417:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6027);i.RootBitType.setMetadata(i.RootBitType.rating,{tags:Object.assign({},o.TAGS_DEFAULT),resourceAttachmentAllowed:!1,bodyAllowed:!0})},5309:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.releaseNote,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),{[o.PropertyKey.releaseVersion]:{isProperty:!0}}),resourceAttachmentAllowed:!0,bodyAllowed:!0})},543:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.sampleSolution,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),{[o.TagType.Anchor]:{},[o.TagType.Reference]:{}}),resourceAttachmentAllowed:!0,bodyAllowed:!0})},149:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.screenshot,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.image,bodyAllowed:!0})},9330:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(7028),s=r(1614),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.sequence,{tags:Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:s.CARD_SET_ELEMENTS,bodyAllowed:!0,footerAllowed:!0,rootExampleType:o.ExampleType.boolean})},3983:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.stillImageFilm,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_STILL_IMAGE_FILM_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.stillImageFilm,bodyAllowed:!0})},7030:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.stillImageFilmEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_STILL_IMAGE_FILM_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.stillImageFilmEmbed,bodyAllowed:!0})},2527:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.stillImageFilmLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_STILL_IMAGE_FILM_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.stillImageFilmLink,bodyAllowed:!0})},8388:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(5319),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.surveyAnonymous,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},8424:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(5319),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.survey,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},4157:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6027);i.RootBitType.setMetadata(i.RootBitType.toc,{tags:Object.assign({},o.TAGS_DEFAULT),resourceAttachmentAllowed:!1,bodyAllowed:!0})},3194:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(7028),s=r(4719),n=r(6562),a=r(5319),l=r(6027);i.RootBitType.setMetadata(i.RootBitType.trueFalse1,{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_DEFAULT),a.TAGS_CHAIN_ANY_RESOURCE),{[s.PropertyKey.labelTrue]:{isProperty:!0},[s.PropertyKey.labelFalse]:{isProperty:!0},[n.TagType.True]:{},[n.TagType.False]:{}}),resourceAttachmentAllowed:!0,bodyAllowed:!1,rootExampleType:o.ExampleType.boolean})},4238:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(1614),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.trueFalse,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),{[o.PropertyKey.labelTrue]:{isProperty:!0},[o.PropertyKey.labelFalse]:{isProperty:!0}}),resourceAttachmentAllowed:!0,cardSet:s.CARD_SET_STATEMENTS,bodyAllowed:!0,footerAllowed:!0})},9755:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.vendorPadletEmbed,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.PropertyKey.padletId]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},5297:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.video,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_VIDEO_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.video,bodyAllowed:!0})},2787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.videoEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_VIDEO_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.videoEmbed,bodyAllowed:!0})},7159:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.videoLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_VIDEO_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.videoLink,bodyAllowed:!0})},1703:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.websiteLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_WEBSITE_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.websiteLink,bodyAllowed:!0})},2093:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),r(4842),r(3616),r(4373),r(2773),r(6360),r(6246),r(9309),r(591),r(3851),r(980),r(8788),r(1),r(7386),r(4865),r(3890),r(3707),r(2585),r(8161),r(5912),r(8305),r(2438),r(5983),r(1363),r(1934),r(4954),r(8157),r(8253),r(1559),r(5046),r(76),r(4861),r(2161),r(9338),r(700),r(8371),r(5730),r(3947),r(9745),r(2033),r(9780),r(8801),r(4446),r(1417),r(5309),r(543),r(149),r(9330),r(3983),r(7030),r(2527),r(8388),r(8424),r(4157),r(3194),r(4238),r(9755),r(5297),r(2787),r(7159),r(1703),r(5595),r(6138),r(7243),r(1197),r(3828),r(9787),r(3728),r(3589),r(460),r(3544),r(4681),r(9678),r(4303),r(5805),r(8634),r(5158),r(374),r(9851),r(2853),r(1128),r(9546),r(2347),r(1802),r(6263),r(6321),r(3904),r(7582),r(209),r(2737),r(5243),r(1285),r(6367),r(7443),r(4245),r(5635),r(8856),r(2786),r(2375),r(8699),r(6667),r(7538),r(4648),r(9448),r(1500),r(759),r(8e3),r(2706),r(5044),r(1502),r(3477),r(7882),r(5175),r(5804),r(2675),r(9404),r(6625),r(3908),r(3739),r(2891)},5595:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.action,{isSingle:!0,isTrimmedString:!0})},6138:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.ageRange,{isTrimmedString:!0})},7243:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.aiGenerated,{astKey:"aiGenerated",isSingle:!0,isBoolean:!0})},1197:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.author,{isTrimmedString:!0})},3828:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.book,{isTrimmedString:!0,isSingle:!0})},9787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.bot,{})},3728:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.caseSensitive,{isSingle:!0,isBoolean:!0,astKey:"isCaseSensitive",jsonKey:"isCaseSensitive"})},3589:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.color,{isSingle:!0,isTrimmedString:!0})},460:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.colorTag,{isTrimmedString:!0})},3544:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.computerLanguage,{isSingle:!0,isTrimmedString:!0})},4681:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.coverImage,{isTrimmedString:!0})},9678:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.date,{isSingle:!0})},4303:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.deeplink,{isTrimmedString:!0})},5805:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.duration,{isSingle:!0,isTrimmedString:!0})},8634:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.example,{isSingle:!0})},5158:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.externalId,{isTrimmedString:!0})},374:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.externalLink,{isSingle:!0,isTrimmedString:!0})},9851:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.externalLinkText,{isSingle:!0,isTrimmedString:!0})},2853:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.focusX,{isSingle:!0,isNumber:!0})},1128:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.focusY,{isSingle:!0,isNumber:!0})},9546:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.icon,{isSingle:!0,isTrimmedString:!0})},2347:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.iconTag,{isSingle:!0,isTrimmedString:!0})},1802:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.id,{isTrimmedString:!0})},6263:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.emphasis,{isSingle:!0,isTrimmedString:!0})},6321:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.isInfoOnly,{isSingle:!0,isBoolean:!0})},3904:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.isTracked,{isSingle:!0,isBoolean:!0})},7582:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.kind,{isSingle:!0,isTrimmedString:!0})},209:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.labelFalse,{isSingle:!0,isTrimmedString:!0})},2737:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.labelTrue,{isSingle:!0,isTrimmedString:!0})},5243:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.language,{isTrimmedString:!0})},1285:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.level,{isSingle:!0,astKey:"levelProperty"})},6367:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.list,{isTrimmedString:!0})},7443:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.location,{isSingle:!0,isTrimmedString:!0})},4245:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.longAnswer,{isSingle:!0,isInvertedBoolean:!0,astKey:"isShortAnswer",jsonKey:"isShortAnswer"})},5635:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.mark,{isTrimmedString:!0})},8856:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.padletId,{isTrimmedString:!0,isSingle:!0})},2786:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.partialAnswer,{isSingle:!0,isTrimmedString:!0})},2375:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.partner,{isTrimmedString:!0,isSingle:!0})},8699:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.progress,{isSingle:!0,isBoolean:!0,ignoreTrue:!0})},6667:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.publications,{isTrimmedString:!0})},7538:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.publisher,{isTrimmedString:!0})},4648:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.quotedPerson,{isSingle:!0,isTrimmedString:!0})},9448:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.reaction,{isSingle:!0,isTrimmedString:!0})},1500:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.reference,{isSingle:!1,isTrimmedString:!0,astKey:"referenceProperty"})},759:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.releaseVersion,{isTrimmedString:!0,isSingle:!0})},8e3:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.width,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.height,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.license,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.copyright,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.caption,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.showInIndex,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.alt,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.src1x,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.src2x,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.src3x,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.src4x,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.mute,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.autoplay,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.allowSubtitles,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.showSubtitles,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.siteName,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.posterImage,{isSingle:!0,isTrimmedString:!0})},2706:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.sampleSolution,{isSingle:!0,isTrimmedString:!0})},5044:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.shortAnswer,{isSingle:!0,isBoolean:!0,astKey:"isShortAnswer",jsonKey:"isShortAnswer"})},1502:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.spaceId,{isTrimmedString:!0})},3477:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.subject,{isTrimmedString:!0})},7882:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.subtype,{isSingle:!0,isTrimmedString:!0})},5175:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.tag,{isTrimmedString:!0})},5804:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.target,{isTrimmedString:!0})},2675:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.textReference,{isSingle:!0,isTrimmedString:!0})},9404:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.theme,{isTrimmedString:!0})},6625:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.thumbImage,{isSingle:!0,isTrimmedString:!0})},3908:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.toc,{isSingle:!0,isBoolean:!0,ignoreTrue:!0})},3739:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.type,{isSingle:!0,isTrimmedString:!0})},2891:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.videoCallLink,{isSingle:!0,isTrimmedString:!0})},1022:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildInfo=void 0,t.buildInfo={name:"@gmb/bitmark-parser-generator",version:"1.2.1"}},4369:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=void 0;const i=r(6831),o=r(2892),s=r(7448);function n(e,t,r,i){var o=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(o,n.prototype),o.expected=t,o.found=r,o.location=i,o.name="SyntaxError",o}function a(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}t.SyntaxError=n,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(n,Error),n.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){i=e[r].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,s=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,n=this.location.source+":"+s.line+":"+s.column;if(i){var l=this.location.end,u=a("",s.line.toString().length," "),c=i[o.line-1],d=(o.line===l.line?l.column:c.length+1)-o.column||1;t+="\n --\x3e "+n+"\n"+u+" |\n"+s.line+" | "+c+"\n"+u+" | "+a("",o.column-1," ")+a("",d,"^")}else t+="\n at "+n}return t},n.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?s(e[0])+"-"+s(e[1]):s(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function i(e){return e.charCodeAt(0).toString(16).toUpperCase()}function o(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function s(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function n(e){return r[e.type](e)}return"Expected "+function(e){var t,r,i=e.map(n);if(i.sort(),i.length>0){for(t=1,r=1;t<i.length;t++)i[t-1]!==i[t]&&(i[r]=i[t],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(e)+" but "+function(e){return e?'"'+o(e)+'"':"end of input"}(t)+" found."},t.parse=function e(t,r){var a,l={},u=(r=void 0!==r?r:{}).grammarSource,c={bitmark:sr,bit:function(){var e,t,r,i,o;e=$t,t=[],r=kr();for(;r!==l;)t.push(r),r=kr();if((r=lr())!==l){for(i=[],o=kr();o!==l;)i.push(o),o=kr();qt=e,e=We(r)}else $t=e,e=l;return e},cardContent:function(){var e,t,r;e=$t,t=[],(r=pr())===l&&(r=Tr());for(;r!==l;)t.push(r),(r=pr())===l&&(r=Tr());return qt=e,t=vt(t),e=t}},d=sr,p="[.",h="]",y=":",g="&",f="====",m="~~~~",b="--",v="++",T="===",A="==",P="[@id",_="[",x="#",w="[▼",S="[►",O="[@",R="[%",k="[!",C="[?",E="[+",I="[-",j="[$",B="[_",L="[=",N="[&",M="::",U="||",K="id:",D="\n",V="\r\n",F="\r",G="\u2028",H="\u2029",$=/^[^\]]/,q=/^[^:\]]/,J=/^[^&:\]]/,z=/^[ \t]/,W=/^[^\n\r\u2028\u2029]/,Y=/^[ \t\n\r\u2028\u2029]/,X=Qt("[.",!1),Q=Zt(["]"],!0,!1),Z=Qt("]",!1),ee=Qt(":",!1),te=Qt("&",!1),re={type:"any"},ie=Qt("====",!1),oe=Qt("~~~~",!1),se=Qt("--",!1),ne=Qt("++",!1),ae=Qt("===",!1),le=Qt("==",!1),ue=Qt("[@id",!1),ce=Qt("[",!1),de=Qt("#",!1),pe=Qt("[▼",!1),he=Qt("[►",!1),ye=Qt("[@",!1),ge=Qt("[%",!1),fe=Qt("[!",!1),me=Qt("[?",!1),be=Qt("[+",!1),ve=Qt("[-",!1),Te=Qt("[$",!1),Ae=Qt("[_",!1),Pe=Qt("[=",!1),_e=Qt("[&",!1),xe=Qt("::",!1),we=Qt("||",!1),Se=Qt("id:",!1),Oe=Zt([":","]"],!0,!1),Re=Zt(["&",":","]"],!0,!1),ke=(er("Empty"),Zt([" ","\t"],!1,!1)),Ce=er("Anything"),Ee=er("Character"),Ie=Zt(["\n","\r","\u2028","\u2029"],!0,!1),je=er("Line"),Be=(er("whitespace in line"),er("Blank Line")),Le=er("Line Terminator"),Ne=Qt("\n",!1),Me=Qt("\r\n",!1),Ue=Qt("\r",!1),Ke=Qt("\u2028",!1),De=Qt("\u2029",!1),Ve=er("Whitespace, then Line Terminator"),Fe=er("whitespace"),Ge=Zt([" ","\t","\n","\r","\u2028","\u2029"],!1,!1),He=function(e,t){return Nr.buildBits([e,...t])},$e=function(e){return Lr.handleRawBit(e)},qe=function(e){return e},Je=function(e){return Lr.handleRawBit(e)},ze=function(e){return e},We=function(e){return e},Ye=function(e,t){return Nr.buildBit(e,t)},Xe=function(e){return Nr.invalidBit(e)},Qe=function(e,t){return Nr.buildBitHeader(e,t)},Ze=function(e,t){return Nr.buildTextAndResourceType(e,t)},et=function(e){return Lr.handleTextFormat(e)},tt=function(e){return Lr.handleResourceType(e)},rt=function(e){return Lr.handleBitContent(e)},it=function(e){return Lr.handleTagChain(e)},ot=function(e){return e},st=function(e){return Lr.handleBitTag(e)},nt=function(e){return{type:i.TypeKey.BodyChar,value:e}},at=function(e){return Lr.handleCardSet(e[1].flat())},lt=function(){Lr.handleCardSetStart()},ut=function(){Lr.handleCardSetEnd()},ct=function(e){return Lr.handleCards(e)},dt=function(e){return Lr.handleCardLineOrDivider(e,2)},pt=function(e){return Lr.handleCardLine(e)},ht=function(e){return Lr.handleCardSet(e[1].flat())},yt=function(){Lr.handleCardSetStart()},gt=function(){Lr.handleCardSetEnd()},ft=function(e){return Lr.handleCards(e)},mt=function(e){return Lr.handleCardLineOrDivider(e,1)},bt=function(e){return Lr.handleCardLine(e)},vt=function(e){return Lr.handleCardContent(e)},Tt=function(e){return{type:i.TypeKey.CardChar,value:e}},At=function(e){return Lr.handlePropertyTag("id",e)},Pt=function(e,t){return Lr.handleTag(i.TypeKey.Title,{level:e,title:t})},_t=function(e){return Lr.handleTag(i.TypeKey.Anchor,e)},xt=function(e){return Lr.handleTag(i.TypeKey.Reference,e)},wt=function(e,t){return Lr.handlePropertyTag(e,t)},St=function(e){return Lr.handleTag(i.TypeKey.ItemLead,e)},Ot=function(e){return Lr.handleTag(i.TypeKey.Instruction,e)},Rt=function(e){return Lr.handleTag(i.TypeKey.Hint,e)},kt=function(e){return Lr.handleTag(i.TypeKey.True,e)},Ct=function(e){return Lr.handleTag(i.TypeKey.False,e)},Et=function(e){return Lr.handleTag(i.TypeKey.SampleSolution,e)},It=function(e){return Lr.handleTag(i.TypeKey.Gap,e)},jt=function(e){return Lr.handleTag(i.TypeKey.Mark,e)},Bt=function(e,t){return Lr.handleResourceTag(e,t)},Lt=function(e){return Lr.handleTag(i.TypeKey.BodyText,e)},Nt=function(e){return Lr.handleTag(i.TypeKey.Comment,e)},Mt=function(e){return e},Ut=function(e){return e?e.trim():""},Kt=function(e){return e?e.trim():null},Dt=function(e){return e?e.trim():""},Vt=function(){return!0},Ft=function(e){return e},Gt=function(e){return e},Ht=function(e){return e},$t=0,qt=0,Jt=[{line:1,column:1}],zt=0,Wt=[],Yt=0;if("startRule"in r){if(!(r.startRule in c))throw new Error("Can't start parsing from rule \""+r.startRule+'".');d=c[r.startRule]}function Xt(){return t.substring(qt,$t)}function Qt(e,t){return{type:"literal",text:e,ignoreCase:t}}function Zt(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function er(e){return{type:"other",description:e}}function tr(e){var r,i=Jt[e];if(i)return i;for(r=e-1;!Jt[r];)r--;for(i={line:(i=Jt[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return Jt[e]=i,i}function rr(e,t,r){var i=tr(e),o=tr(t),s={source:u,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:o.line,column:o.column}};return r&&u&&"function"==typeof u.offset&&(s.start=u.offset(s.start),s.end=u.offset(s.end)),s}function ir(e){$t<zt||($t>zt&&(zt=$t,Wt=[]),Wt.push(e))}function or(e,t,r){return new n(n.buildMessage(e,t),e,t,r)}function sr(){return function(){var e,r,i,o;e=$t,r=[],(i=Ir())===l&&(i=Ar());for(;i!==l;)r.push(i),(i=Ir())===l&&(i=Ar());return i=function(){var e,r,i,o;e=$t,r=$t,i=[],o=ar();for(;o!==l;)i.push(o),o=ar();return r=t.substring(r,$t),qt=e,r=$e(r),e=r,e}(),o=function(){var e,t;e=[],t=nr();for(;t!==l;)e.push(t),t=nr();return e}(),qt=e,e=He(i,o),e}()}function nr(){var e,r,i,o;for(e=$t,r=[],i=kr();i!==l;)r.push(i),i=kr();return(i=Cr())===l&&(i=null),o=function(){var e,r,i,o,s,n;if(e=$t,r=$t,i=$t,o=function(){var e,r,i,o;e=$t,t.substr($t,2)===p?(r=p,$t+=2):(r=l,0===Yt&&ir(X));if(r!==l){for(i=[],$.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Q));o!==l;)i.push(o),$.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Q));93===t.charCodeAt($t)?(o=h,$t++):(o=l,0===Yt&&ir(Z)),o!==l?(qt=e,e=ze(r)):($t=e,e=l)}else $t=e,e=l;return e}(),o!==l){for(s=[],n=ar();n!==l;)s.push(n),n=ar();i=o=[o,s]}else $t=i,i=l;r=i!==l?t.substring(r,$t):i;r!==l&&(qt=e,r=Je(r));return e=r,e}(),o!==l?(qt=e,e=qe(o)):($t=e,e=l),e}function ar(){var e,t,r,i;if(e=$t,(t=Cr())!==l?(r=$t,Yt++,i=ur(),Yt--,i===l?r=void 0:($t=r,r=l),r!==l?e=t=[t,r]:($t=e,e=l)):($t=e,e=l),e===l)if(e=[],(t=Or())!==l)for(;t!==l;)e.push(t),t=Or();else e=l;return e}function lr(){var e,r,i;return e=$t,(r=ur())!==l?(i=function(){var e,t,r;e=$t,t=[],r=fr(),r===l&&(r=br())===l&&(r=pr())===l&&(r=gr());for(;r!==l;)t.push(r),(r=fr())===l&&(r=br())===l&&(r=pr())===l&&(r=gr());return qt=e,t=rt(t),e=t,e}(),qt=e,e=Ye(r,i)):($t=e,e=l),e===l&&(e=$t,r=$t,i=function(){var e,r;Yt++,e=[],t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re));for(;r!==l;)e.push(r),t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re));Yt--,r=l,0===Yt&&ir(Ce);return e}(),r=t.substring(r,$t),qt=e,e=r=Xe(r)),e}function ur(){var e,r,i,o,s;return e=$t,t.substr($t,2)===p?(r=p,$t+=2):(r=l,0===Yt&&ir(X)),r!==l?(i=wr(),o=function(){var e,t,r;e=$t,t=cr(),t===l&&(t=dr());t===l&&(t=null);r=cr(),r===l&&(r=dr());r===l&&(r=null);return qt=e,e=Ze(t,r),e}(),93===t.charCodeAt($t)?(s=h,$t++):(s=l,0===Yt&&ir(Z)),s!==l?(qt=e,e=Qe(i,o)):($t=e,e=l)):($t=e,e=l),e}function cr(){var e,r,i;return e=$t,58===t.charCodeAt($t)?(r=y,$t++):(r=l,0===Yt&&ir(ee)),r!==l?(i=wr(),qt=e,e=et(i)):($t=e,e=l),e}function dr(){var e,r,i;return e=$t,38===t.charCodeAt($t)?(r=g,$t++):(r=l,0===Yt&&ir(te)),r!==l?(i=wr(),qt=e,e=tt(i)):($t=e,e=l),e}function pr(){var e,t,r,i,o;if(e=$t,t=$t,(r=yr())!==l){for(i=[],o=hr();o!==l;)i.push(o),o=hr();t=r=[r,i]}else $t=t,t=l;return t!==l&&(qt=e,t=it(t)),e=t}function hr(){var e,t;return e=$t,(t=yr())!==l&&(qt=e,t=ot(t)),e=t}function yr(){var e,r;return e=$t,(r=Ar())===l&&(r=function(){var e,r,i,o,s,n,a,u;e=$t,r=$t,i=$t,t.substr($t,2)===M?(o=M,$t+=2):(o=l,0===Yt&&ir(xe));o!==l?(s=function(){var e,r,i,o,s,n;e=$t,r=$t,i=[],o=$t,s=$t,Yt++,t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(xe));Yt--,n===l?s=void 0:($t=s,s=l);s!==l&&(n=Or())!==l?o=s=[s,n]:($t=o,o=l);for(;o!==l;)i.push(o),o=$t,s=$t,Yt++,t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(xe)),Yt--,n===l?s=void 0:($t=s,s=l),s!==l&&(n=Or())!==l?o=s=[s,n]:($t=o,o=l);return r=t.substring(r,$t),qt=e,r=Ft(r),e=r,e}(),t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(xe)),n!==l?(a=function(){var e,r,i,o,s,n;e=$t,r=$t,i=[],o=$t,s=$t,Yt++,t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(xe));Yt--,n===l?s=void 0:($t=s,s=l);s!==l?(t.length>$t?(n=t.charAt($t),$t++):(n=l,0===Yt&&ir(re)),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l);for(;o!==l;)i.push(o),o=$t,s=$t,Yt++,t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(xe)),Yt--,n===l?s=void 0:($t=s,s=l),s!==l?(t.length>$t?(n=t.charAt($t),$t++):(n=l,0===Yt&&ir(re)),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l);return r=t.substring(r,$t),qt=e,r=Gt(r),e=r,e}(),u=function(){var e,r,i;t.substr($t,2)===M?(e=M,$t+=2):(e=l,0===Yt&&ir(xe));if(e===l){for(e=$t,r=[],i=Ir();i!==l;)r.push(i),i=Ir();(i=Br())!==l?e=r=[r,i]:($t=e,e=l)}return e}(),u!==l?i=o=[o,s,n,a,u]:($t=i,i=l)):($t=i,i=l)):($t=i,i=l);r=i!==l?t.substring(r,$t):i;r!==l&&(qt=e,r=Lt(r));return e=r,e}(),r===l&&(r=function(){var e,r,i,o;e=$t,t.substr($t,4)===P?(r=P,$t+=4):(r=l,0===Yt&&ir(ue));r!==l&&(i=Sr())!==l?(o=function(){var e;93===t.charCodeAt($t)?(e=h,$t++):(e=l,0===Yt&&ir(Z));return e}(),o!==l?(qt=e,e=At(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i,o;e=$t,t.substr($t,2)===O?(r=O,$t+=2):(r=l,0===Yt&&ir(ye));r!==l&&(i=_r())!==l&&(o=Sr())!==l&&xr()!==l?(qt=e,e=wt(i,o)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i,o;e=$t,91===t.charCodeAt($t)?(r=_,$t++):(r=l,0===Yt&&ir(ce));if(r!==l){if(i=[],35===t.charCodeAt($t)?(o=x,$t++):(o=l,0===Yt&&ir(de)),o!==l)for(;o!==l;)i.push(o),35===t.charCodeAt($t)?(o=x,$t++):(o=l,0===Yt&&ir(de));else i=l;i!==l?(o=Pr(),xr()!==l?(qt=e,e=Pt(i,o)):($t=e,e=l)):($t=e,e=l)}else $t=e,e=l;return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===w?(r=w,$t+=2):(r=l,0===Yt&&ir(pe));r!==l?(i=Pr(),xr()!==l?(qt=e,e=_t(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===S?(r=S,$t+=2):(r=l,0===Yt&&ir(he));r!==l?(i=Pr(),xr()!==l?(qt=e,e=xt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===R?(r=R,$t+=2):(r=l,0===Yt&&ir(ge));r!==l?(i=Pr(),xr()!==l?(qt=e,e=St(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===k?(r=k,$t+=2):(r=l,0===Yt&&ir(fe));r!==l?(i=Pr(),xr()!==l?(qt=e,e=Ot(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===C?(r=C,$t+=2):(r=l,0===Yt&&ir(me));r!==l?(i=Pr(),xr()!==l?(qt=e,e=Rt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===B?(r=B,$t+=2):(r=l,0===Yt&&ir(Ae));r!==l?(i=Pr(),xr()!==l?(qt=e,e=It(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===L?(r=L,$t+=2):(r=l,0===Yt&&ir(Pe));r!==l?(i=Pr(),xr()!==l?(qt=e,e=jt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===j?(r=j,$t+=2):(r=l,0===Yt&&ir(Te));r!==l?(i=Pr(),xr()!==l?(qt=e,e=Et(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===E?(r=E,$t+=2):(r=l,0===Yt&&ir(be));r!==l?(i=Pr(),xr()!==l?(qt=e,e=kt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===I?(r=I,$t+=2):(r=l,0===Yt&&ir(ve));r!==l?(i=Pr(),xr()!==l?(qt=e,e=Ct(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i,o;e=$t,t.substr($t,2)===N?(r=N,$t+=2):(r=l,0===Yt&&ir(_e));r!==l&&(i=_r())!==l&&(o=Sr())!==l&&xr()!==l?(qt=e,e=Bt(i,o)):($t=e,e=l);return e}()))))))))))))))),r!==l&&(qt=e,r=st(r)),e=r}function gr(){var e,r;return e=$t,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),r!==l&&(qt=e,r=nt(r)),e=r}function fr(){var e,r,i,o,s;if(e=$t,r=$t,i=function(){var e,r,i,o,s,n;e=$t,r=Cr(),r!==l?(i=$t,Yt++,o=$t,t.substr($t,4)===f?(s=f,$t+=4):(s=l,0===Yt&&ir(ie)),s!==l&&(n=Er())!==l?o=s=[s,n]:($t=o,o=l),Yt--,o!==l?($t=i,i=void 0):i=l,i!==l?(qt=e,e=lt()):($t=e,e=l)):($t=e,e=l);return e}(),i!==l){for(o=[],s=mr();s!==l;)o.push(s),s=mr();s=function(){var e,r,i,o,s;e=$t,r=$t,t.substr($t,4)===m?(i=m,$t+=4):(i=l,0===Yt&&ir(oe));i===l&&(i=null);o=$t,Yt++,s=jr(),Yt--,s!==l?($t=o,o=void 0):o=l;o!==l?r=i=[i,o]:($t=r,r=l);r!==l&&(qt=e,r=ut());return e=r,e}(),s!==l?r=i=[i,o,s]:($t=r,r=l)}else $t=r,r=l;return r!==l&&(qt=e,r=at(r)),e=r}function mr(){var e,r;return e=$t,r=function(){var e,r,i,o;e=$t,r=$t,t.substr($t,4)===f?(i=f,$t+=4):(i=l,0===Yt&&ir(ie));i!==l?((o=Er())===l&&(o=jr()),o!==l?r=i=[i,o]:($t=r,r=l)):($t=r,r=l);r===l&&(r=$t,t.substr($t,2)===b?(i=b,$t+=2):(i=l,0===Yt&&ir(se)),i!==l?((o=Er())===l&&(o=jr()),o!==l?r=i=[i,o]:($t=r,r=l)):($t=r,r=l),r===l&&(r=$t,t.substr($t,2)===v?(i=v,$t+=2):(i=l,0===Yt&&ir(ne)),i!==l?((o=Er())===l&&(o=jr()),o!==l?r=i=[i,o]:($t=r,r=l)):($t=r,r=l),r===l&&(r=function(){var e,r,i,o,s,n;e=$t,r=$t,Yt++,i=$t,t.substr($t,4)===m?(o=m,$t+=4):(o=l,0===Yt&&ir(oe));o!==l&&(s=jr())!==l?i=o=[o,s]:($t=i,i=l);Yt--,i===l?r=void 0:($t=r,r=l);if(r!==l){if(i=$t,o=$t,s=Rr(),(n=Cr())!==l?o=s=[s,n]:($t=o,o=l),o===l){if(o=$t,s=[],(n=Or())!==l)for(;n!==l;)s.push(n),n=Or();else s=l;s!==l?(n=function(){var e,r;e=Cr(),e===l&&(e=$t,Yt++,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),Yt--,r===l?e=void 0:($t=e,e=l));return e}(),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l)}(i=o!==l?t.substring(i,$t):o)!==l?(qt=e,e=pt(i)):($t=e,e=l)}else $t=e,e=l;return e}())));r!==l&&(qt=e,r=dt(r));return e=r,e}(),r!==l&&(qt=e,r=ct(r)),e=r}function br(){var e,r,i,o,s;if(e=$t,r=$t,i=function(){var e,r,i,o,s,n;e=$t,r=Cr(),r!==l?(i=$t,Yt++,o=$t,t.substr($t,3)===T?(s=T,$t+=3):(s=l,0===Yt&&ir(ae)),s!==l&&(n=Er())!==l?o=s=[s,n]:($t=o,o=l),Yt--,o!==l?($t=i,i=void 0):i=l,i!==l?(qt=e,e=yt()):($t=e,e=l)):($t=e,e=l);return e}(),i!==l){for(o=[],s=vr();s!==l;)o.push(s),s=vr();s=function(){var e,r,i,o,s;e=$t,r=$t,t.substr($t,3)===T?(i=T,$t+=3):(i=l,0===Yt&&ir(ae));i!==l?(o=$t,Yt++,s=jr(),Yt--,s!==l?($t=o,o=void 0):o=l,o!==l?r=i=[i,o]:($t=r,r=l)):($t=r,r=l);r!==l&&(qt=e,r=gt());return e=r,e}(),s!==l?r=i=[i,o,s]:($t=r,r=l)}else $t=r,r=l;return r!==l&&(qt=e,r=ht(r)),e=r}function vr(){var e,r,i,o,s,n,a,u,c,d,p;if(e=$t,r=$t,Yt++,i=$t,t.substr($t,3)===T?(o=T,$t+=3):(o=l,0===Yt&&ir(ae)),o!==l){for(s=[],n=Ir();n!==l;)s.push(n),n=Ir();for(n=[],a=$t,u=$t,Yt++,c=$t,(d=Cr())!==l?(t.substr($t,3)===T?(p=T,$t+=3):(p=l,0===Yt&&ir(ae)),p!==l?c=d=[d,p]:($t=c,c=l)):($t=c,c=l),Yt--,c===l?u=void 0:($t=u,u=l),u!==l?(t.length>$t?(c=t.charAt($t),$t++):(c=l,0===Yt&&ir(re)),c!==l?a=u=[u,c]:($t=a,a=l)):($t=a,a=l);a!==l;)n.push(a),a=$t,u=$t,Yt++,c=$t,(d=Cr())!==l?(t.substr($t,3)===T?(p=T,$t+=3):(p=l,0===Yt&&ir(ae)),p!==l?c=d=[d,p]:($t=c,c=l)):($t=c,c=l),Yt--,c===l?u=void 0:($t=u,u=l),u!==l?(t.length>$t?(c=t.charAt($t),$t++):(c=l,0===Yt&&ir(re)),c!==l?a=u=[u,c]:($t=a,a=l)):($t=a,a=l);(a=Br())!==l?i=o=[o,s,n,a]:($t=i,i=l)}else $t=i,i=l;return Yt--,i===l?r=void 0:($t=r,r=l),r!==l?(i=function(){var e,r,i,o;e=$t,r=$t,t.substr($t,3)===T?(i=T,$t+=3):(i=l,0===Yt&&ir(ae));i!==l&&(o=Er())!==l?r=i=[i,o]:($t=r,r=l);r===l&&(r=$t,t.substr($t,2)===A?(i=A,$t+=2):(i=l,0===Yt&&ir(le)),i!==l&&(o=Er())!==l?r=i=[i,o]:($t=r,r=l),r===l&&(r=$t,t.substr($t,2)===b?(i=b,$t+=2):(i=l,0===Yt&&ir(se)),i!==l&&(o=Er())!==l?r=i=[i,o]:($t=r,r=l),r===l&&(r=function(){var e,r,i,o,s;e=$t,r=$t,i=$t,o=Rr(),s=Cr(),s!==l?i=o=[o,s]:($t=i,i=l);r=i!==l?t.substring(r,$t):i;r!==l&&(qt=e,r=bt(r));return e=r,e}())));r!==l&&(qt=e,r=mt(r));return e=r,e}(),i!==l?(qt=e,e=ft(i)):($t=e,e=l)):($t=e,e=l),e}function Tr(){var e,r;return e=$t,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),r!==l&&(qt=e,r=Tt(r)),e=r}function Ar(){var e,r,i,o;return e=$t,t.substr($t,2)===U?(r=U,$t+=2):(r=l,0===Yt&&ir(we)),r!==l?(i=function(){var e,r,i,o,s,n;e=$t,r=$t,i=[],o=$t,s=$t,Yt++,t.substr($t,2)===U?(n=U,$t+=2):(n=l,0===Yt&&ir(we));Yt--,n===l?s=void 0:($t=s,s=l);s!==l?(t.length>$t?(n=t.charAt($t),$t++):(n=l,0===Yt&&ir(re)),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l);for(;o!==l;)i.push(o),o=$t,s=$t,Yt++,t.substr($t,2)===U?(n=U,$t+=2):(n=l,0===Yt&&ir(we)),Yt--,n===l?s=void 0:($t=s,s=l),s!==l?(t.length>$t?(n=t.charAt($t),$t++):(n=l,0===Yt&&ir(re)),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l);return r=t.substring(r,$t),qt=e,r=Ht(r),e=r,e}(),o=function(){var e,r,i;t.substr($t,2)===U?(e=U,$t+=2):(e=l,0===Yt&&ir(we));if(e===l){for(e=$t,r=[],i=Ir();i!==l;)r.push(i),i=Ir();(i=Br())!==l?e=r=[r,i]:($t=e,e=l)}return e}(),o!==l?(qt=e,e=Nt(i)):($t=e,e=l)):($t=e,e=l),e}function Pr(){var e,r,i,o;for(e=$t,r=$t,i=[],$.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Q));o!==l;)i.push(o),$.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Q));return r=t.substring(r,$t),qt=e,e=r=Mt(r)}function _r(){var e,r,i,o,s;if(e=$t,r=$t,Yt++,t.substr($t,3)===K?(i=K,$t+=3):(i=l,0===Yt&&ir(Se)),Yt--,i===l?r=void 0:($t=r,r=l),r!==l){for(i=$t,o=[],q.test(t.charAt($t))?(s=t.charAt($t),$t++):(s=l,0===Yt&&ir(Oe));s!==l;)o.push(s),q.test(t.charAt($t))?(s=t.charAt($t),$t++):(s=l,0===Yt&&ir(Oe));i=t.substring(i,$t),qt=e,e=Ut(i)}else $t=e,e=l;return e}function xr(){var e,r,i;if(93===t.charCodeAt($t)?(e=h,$t++):(e=l,0===Yt&&ir(Z)),e===l){for(e=$t,r=[],i=Ir();i!==l;)r.push(i),i=Ir();(i=Br())!==l?e=r=[r,i]:($t=e,e=l)}return e}function wr(){var e,r,i,o;for(e=$t,r=$t,i=[],J.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Re));o!==l;)i.push(o),J.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Re));return r=t.substring(r,$t),qt=e,e=r=Kt(r)}function Sr(){var e,r,i;return e=$t,58===t.charCodeAt($t)?(r=y,$t++):(r=l,0===Yt&&ir(ee)),r!==l?(i=Pr(),qt=e,e=Dt(i)):($t=e,e=l),e===l&&(r="",qt=e=$t,e=r=Vt()),e}function Or(){var e;return Yt++,W.test(t.charAt($t))?(e=t.charAt($t),$t++):(e=l,0===Yt&&ir(Ie)),Yt--,e===l&&(l,0===Yt&&ir(Ee)),e}function Rr(){var e,t;for(Yt++,e=[],t=Or();t!==l;)e.push(t),t=Or();return Yt--,t=l,0===Yt&&ir(je),e}function kr(){var e,r,i;for(Yt++,e=$t,r=[],z.test(t.charAt($t))?(i=t.charAt($t),$t++):(i=l,0===Yt&&ir(ke));i!==l;)r.push(i),z.test(t.charAt($t))?(i=t.charAt($t),$t++):(i=l,0===Yt&&ir(ke));return(i=Cr())!==l?e=r=[r,i]:($t=e,e=l),Yt--,e===l&&(r=l,0===Yt&&ir(Be)),e}function Cr(){var e;return Yt++,10===t.charCodeAt($t)?(e=D,$t++):(e=l,0===Yt&&ir(Ne)),e===l&&(t.substr($t,2)===V?(e=V,$t+=2):(e=l,0===Yt&&ir(Me)),e===l&&(13===t.charCodeAt($t)?(e=F,$t++):(e=l,0===Yt&&ir(Ue)),e===l&&(8232===t.charCodeAt($t)?(e=G,$t++):(e=l,0===Yt&&ir(Ke)),e===l&&(8233===t.charCodeAt($t)?(e=H,$t++):(e=l,0===Yt&&ir(De)))))),Yt--,e===l&&(l,0===Yt&&ir(Le)),e}function Er(){var e,r,i;for(Yt++,e=$t,r=[],z.test(t.charAt($t))?(i=t.charAt($t),$t++):(i=l,0===Yt&&ir(ke));i!==l;)r.push(i),z.test(t.charAt($t))?(i=t.charAt($t),$t++):(i=l,0===Yt&&ir(ke));return(i=Cr())!==l?e=r=[r,i]:($t=e,e=l),Yt--,e===l&&(r=l,0===Yt&&ir(Ve)),e}function Ir(){var e;return Yt++,Y.test(t.charAt($t))?(e=t.charAt($t),$t++):(e=l,0===Yt&&ir(Ge)),Yt--,e===l&&(l,0===Yt&&ir(Fe)),e}function jr(){var e,r;return(e=Er())===l&&(e=$t,Yt++,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),Yt--,r===l?e=void 0:($t=e,e=l)),e}function Br(){var e,r;return e=$t,Yt++,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),Yt--,r===l?e=void 0:($t=e,e=l),e}const Lr=new o.BitmarkPegParserHelper({parse:e,parserText:Xt,parserLocation:Mr}),Nr=new s.BitmarkPegParserProcessor({parse:e,parserText:Xt,parserLocation:Mr});function Mr(){const e=rr(qt,$t);return e?(delete e.source,e):e}function rr(e,t,r){var i=tr(e),o=tr(t),s={source:u,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:o.line,column:o.column}};return u&&"function"==typeof u.offset&&(s.start=u.offset(s.start),s.end=u.offset(s.end)),s}if((a=d())!==l&&$t===t.length)return a;throw a!==l&&$t<t.length&&ir({type:"end"}),or(Wt,zt<t.length?t.charAt(zt):null,zt<t.length?rr(zt,zt+1):rr(zt,zt))}},4764:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=void 0;const r=new RegExp(/=\^(\^*)(?==)|\*\^(\^*)(?=\*)|_\^(\^*)(?=_)|`\^(\^*)(?=`)|!\^(\^*)(?=!)|\[\^(\^*)|•\^(\^*)|#\^(\^*)|\|\^(\^*)|\|\^(\^*)/,"g");function i(e){let t=e||"";let i=r;return t=t.replace(i,(function(e,t,r,i,o){return e.replace("^","")})),t}function o(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkPlusString"}):l(e,{startRule:"bitmarkPlusString"})}function s(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkMinusMinusString"}):l(e,{startRule:"bitmarkMinusMinusString"})}function n(e,t,r,i){var o=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(o,n.prototype),o.expected=t,o.found=r,o.location=i,o.name="SyntaxError",o}function a(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}function l(e,t){var r,a={},l=(t=void 0!==t?t:{}).grammarSource,u={bitmarkPlusPlus:Ni,bitmarkPlus:function(){var e,t;Ri++,e=xi,t=oo(),e,t=Yr(t),e=t,Ri--,t=a,0===Ri&&Bi(Ne);return e},bitmarkMinusMinus:function(){var e,t;Ri++,e=xi,t=ho(),e,t=gi(t),e=t,Ri--,t=a,0===Ri&&Bi(Ht);return e},bitmarkPlusString:function(){var e;Ri++,e=oo(),Ri--,a,0===Ri&&Bi(nt);return e},bitmarkMinusMinusString:ho},c=Ni,d="|",p=":",h="### ",y="## ",g="# ",f="code",m="bitmark++",b="bitmark--",v="JavaScript",T="• ",A="•1 ",P="•+ ",_="•- ",x="\t",w="image",S=" ",O="#",R="@",k="width",C="height",E="=",I="𝑓",j="link:",B="var:",L="code:",N="color:",M="bold",U="italic",K="light",D="highlight",V="strike",F="sub",G="super",H="ins",$="del",q="aqua",J="black",z="blue",W="pink",Y="fuchsia",X="lightgrey",Q="gray",Z="darkgray",ee="green",te="lime",re="magenta",ie="maroon",oe="navy",se="olive",ne="orange",ae="purple",le="red",ue="silver",ce="teal",de="violet",pe="white",he="yellow",ye="*",ge="_",fe="`",me="!",be="[!",ve="]",Te="\n",Ae="\r\n",Pe="\r",_e="\u2028",xe="\u2029",we="http",Se="s",Oe="://",Re="mailto:",ke="~",Ce="^",Ee="'",Ie=/^[ \t]/,je=/^[0-9]/,Be=/^[^\n\r\u2028\u2029]/,Le=/^[a-zA-Z0-9!*'()=+-\/._?#@[\]$&(),;%:{}]/,Ne=Ei("StyledText"),Me=ki("|",!1),Ue=ki(":",!1),Ke=ki("### ",!1),De=ki("## ",!1),Ve=ki("# ",!1),Fe=ki("code",!1),Ge=Ci([" ","\t"],!1,!1),He=ki("bitmark++",!1),$e=ki("bitmark--",!1),qe=ki("JavaScript",!1),Je=ki("• ",!1),ze=ki("•1 ",!1),We=ki("•+ ",!1),Ye=ki("•- ",!1),Xe={type:"any"},Qe=ki("\t",!1),Ze=ki("image",!1),et=ki(" ",!1),tt=ki("#",!1),rt=ki("@",!1),it=Ci([["0","9"]],!1,!1),ot=ki("width",!1),st=ki("height",!1),nt=Ei("StyledString"),at=ki("=",!1),lt=ki("𝑓",!1),ut=ki("link:",!1),ct=ki("var:",!1),dt=ki("code:",!1),pt=ki("color:",!1),ht=ki("bold",!1),yt=ki("italic",!1),gt=ki("light",!1),ft=ki("highlight",!1),mt=ki("strike",!1),bt=ki("sub",!1),vt=ki("super",!1),Tt=ki("ins",!1),At=ki("del",!1),Pt=ki("aqua",!1),_t=ki("black",!1),xt=ki("blue",!1),wt=ki("pink",!1),St=ki("fuchsia",!1),Ot=ki("lightgrey",!1),Rt=ki("gray",!1),kt=ki("darkgray",!1),Ct=ki("green",!1),Et=ki("lime",!1),It=ki("magenta",!1),jt=ki("maroon",!1),Bt=ki("navy",!1),Lt=ki("olive",!1),Nt=ki("orange",!1),Mt=ki("purple",!1),Ut=ki("red",!1),Kt=ki("silver",!1),Dt=ki("teal",!1),Vt=ki("violet",!1),Ft=ki("white",!1),Gt=ki("yellow",!1),Ht=Ei("MinimalStyledText"),$t=Ei("MinimalStyledString"),qt=ki("*",!1),Jt=ki("_",!1),zt=ki("`",!1),Wt=ki("!",!1),Yt=ki("[!",!1),Xt=ki("]",!1),Qt=Ei("Line Terminator"),Zt=ki("\n",!1),er=ki("\r\n",!1),tr=ki("\r",!1),rr=ki("\u2028",!1),ir=ki("\u2029",!1),or=(Ei("whitespace in line"),Ei("space"),Ei("language tag separator"),Ei("white space, separator"),Ci(["\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!1,!1),Ci(["\n","\r","\u2028","\u2029"],!1,!1),Ci(["\n","\r","\u2028","\u2029"],!0,!1)),sr=(Ci(["\n","\r","\u2028","\u2029","\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!0,!1),ki("http",!1)),nr=ki("s",!1),ar=ki("://",!1),lr=ki("mailto:",!1),ur=Ci([["a","z"],["A","Z"],["0","9"],"!","*","'","(",")","=",["+","/"],".","_","?","#","@","[","]","$","&","(",")",",",";","%",":","{","}"],!1,!1),cr=ki("~",!1),dr=ki("^",!1),pr=ki("'",!1),hr=function(e){return Object.assign({},e)},yr=function(e){return Object.assign({},e)},gr=function(e){return Object.assign({},e)},fr=function(e){return Object.assign({},e)},mr=function(e){return Object.assign({},e)},br=function(){return[]},vr=function(e,t){return{type:"heading",content:s(t),attrs:{level:e.length-1}}},Tr=function(e){return e},Ar=function(e,t){return Object.assign(Object.assign({},e),{content:t})},Pr=function(){return{type:"codeBlock",language:""}},_r=function(e){return{type:"codeBlock",attrs:{language:e.trim().toLowerCase()}}},xr=function(e){return[{type:"text",text:i(e.trim())}]},wr=function(e){return e},Sr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Or=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Rr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},kr=function(){return{type:"bulletList"}},Cr=function(){return{type:"orderedList"}},Er=function(){return{type:"taskList"}},Ir=function(e,t,r,i){return i},jr=function(e,t,r,i){let s="bulletList";"•1 "==e&&(s="orderedList"),"•+ "!=e&&"•- "!=e||(s="taskList");let n=[{type:"paragraph",attrs:{},content:o((t+r.join("")).trim())}];if(i&&i[0]&&i[0].parent){let e={type:i[0].parent,attrs:{start:1},content:i,parent:""};"orderedList"==e.parent&&(e.attrs.start=1),n.push(e)}let a="listItem",l={};if("taskList"==s){a="taskItem";let t=!1;"•+ "==e&&(t=!0),l={checked:t}}return{type:a,content:n,parent:s,attrs:l}},Br=function(e){return e},Lr=function(e){return e.join("")===Io},Nr=function(e){return e.length>Io.length},Mr=function(e){Eo.push(Io),Io=e.join("")},Ur=function(){return Io=Eo.pop(),!0},Kr=function(e){return{type:"paragraph",content:o(e.trim()),attrs:{}}},Dr=function(e){return{type:"paragraph",content:o(e.trim()),attrs:{}}},Vr=function(e){return{type:"paragraph",content:o(e.trim()),attrs:{}}},Fr=function(e){return e},Gr=function(e,t,r){const i=Object.assign({},...r);let o=i.captionAlign||"left";delete i.captionAlign;let s=i.alt||null;delete i.alt;let n=i.caption||null;delete i.caption;let a=i.align||"center";return delete i.align,{type:e,attrs:Object.assign({textAlign:o,src:t,alt:s,title:n,class:a},i)}},Hr=function(e){return e},$r=function(e){return{comment:e}},qr=function(e,t){return{[e]:parseInt(t)}},Jr=function(e,t){return{type:"error",msg:e+" must be an positive integer.",found:t}},zr=function(e,t){return{[e]:t}},Wr=function(e){return{[e]:!0}},Yr=function(e){return[{type:"paragraph",content:e,attrs:{}}]},Xr=function(e,t){return e?[e,...t.flat()]:t.flat()},Qr=function(){return{type:"hardBreak"}},Zr=function(e){return{text:i(e),type:"text"}},ei=function(e){return{index:+e,type:"bit"}},ti=function(e,t){return t||(t=[]),{marks:t,text:i(e),type:"text"}},ri=function(e){return{marks:[{type:"bold"}],text:i(e),type:"text"}},ii=function(e){return{marks:[{type:"italic"}],text:i(e),type:"text"}},oi=function(e){return{marks:[{type:"light"}],text:i(e),type:"text"}},si=function(e){return{marks:[{type:"highlight"}],text:i(e),type:"text"}},ni=function(e){return{marks:[{type:"link",attrs:{href:(e.pr+e.t).trim(),target:"_blank"}}],text:e.t,type:"text"}},ai=function(e){return e},li=function(e){return{type:"link",attrs:{href:e.trim(),target:"_blank"}}},ui=function(e){return{type:"var",attrs:{name:e.trim()}}},ci=function(){return{type:"code",attrs:{language:"plain text"}}},di=function(e){return{type:"code",attrs:{language:e.trim().toLowerCase()}}},pi=function(e){return{type:"color",attrs:{color:e}}},hi=function(e){return{type:e}},yi=function(e){return{type:"comment",comment:e}},gi=function(e){return[{type:"paragraph",content:e,attrs:{}}]},fi=function(e,t){return e?[e,...t.flat()]:t.flat()},mi=function(e){return{text:i(e),type:"text"}},bi=function(e){return{index:+e,type:"bit"}},vi=function(e){return{marks:[{type:"bold"}],text:i(e),type:"text"}},Ti=function(e){return{marks:[{type:"italic"}],text:i(e),type:"text"}},Ai=function(e){return{marks:[{type:"light"}],text:i(e),type:"text"}},Pi=function(e){return{marks:[{type:"highlight"}],text:i(e),type:"text"}},_i=function(e,t){return{pr:e,t}},xi=0,wi=[{line:1,column:1}],Si=0,Oi=[],Ri=0;if("startRule"in t){if(!(t.startRule in u))throw new Error("Can't start parsing from rule \""+t.startRule+'".');c=u[t.startRule]}function ki(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ci(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Ei(e){return{type:"other",description:e}}function Ii(t){var r,i=wi[t];if(i)return i;for(r=t-1;!wi[r];)r--;for(i={line:(i=wi[r]).line,column:i.column};r<t;)10===e.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return wi[t]=i,i}function ji(e,t,r){var i=Ii(e),o=Ii(t),s={source:l,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:o.line,column:o.column}};return r&&l&&"function"==typeof l.offset&&(s.start=l.offset(s.start),s.end=l.offset(s.end)),s}function Bi(e){xi<Si||(xi>Si&&(Si=xi,Oi=[]),Oi.push(e))}function Li(e,t,r){return new n(n.buildMessage(e,t),e,t,r)}function Ni(){var e,t;if(Ri++,e=[],(t=Mi())!==a)for(;t!==a;)e.push(t),t=Mi();else e=a;return e===a&&(e=function(){var e,t;return e=xi,t="",e,t=br(),e=t,e}()),Ri--,e===a&&(t=a,0===Ri&&Bi(Ne)),e}function Mi(){var t,r;return t=xi,r=function(){var t,r,i,o,s;if(t=xi,r=Di(),r!==a){for(i=xi,o=[],s=Ro();s!==a;)o.push(s),s=Ro();i=e.substring(i,xi),(o=ko())!==a?((s=Oo())===a&&(s=null),t,t=vr(r,i)):(xi=t,t=a)}else xi=t,t=a;return t}(),r!==a&&(t,r=hr(r)),(t=r)===a&&(t=xi,r=function(){var e,t,r,i;if(e=xi,t=function(){var e,t,r;e=xi,t=xi,Ri++,r=Hi(),Ri--,r!==a?(xi=t,t=void 0):t=a;t!==a&&(e,t=kr());return e=t,e}(),t!==a){if(r=[],(i=zi())!==a)for(;i!==a;)r.push(i),i=zi();else r=a;r!==a?((i=Oo())===a&&(i=null),e,e=Sr(t,r)):(xi=e,e=a)}else xi=e,e=a;if(e===a){if(e=xi,t=function(){var e,t,r;e=xi,t=xi,Ri++,r=$i(),Ri--,r!==a?(xi=t,t=void 0):t=a;t!==a&&(e,t=Cr());return e=t,e}(),t!==a){if(r=[],(i=zi())!==a)for(;i!==a;)r.push(i),i=zi();else r=a;r!==a?((i=Oo())===a&&(i=null),e,e=Or(t,r)):(xi=e,e=a)}else xi=e,e=a;if(e===a)if(e=xi,t=function(){var e,t,r;e=xi,t=xi,Ri++,r=qi(),Ri--,r!==a?(xi=t,t=void 0):t=a;t!==a&&(e,t=Er());return e=t,e}(),t!==a){if(r=[],(i=zi())!==a)for(;i!==a;)r.push(i),i=zi();else r=a;r!==a?((i=Oo())===a&&(i=null),e,e=Rr(t,r)):(xi=e,e=a)}else xi=e,e=a}return e}(),r!==a&&(t,r=yr(r)),(t=r)===a&&(t=xi,(r=to())!==a&&(t,r=gr(r)),(t=r)===a&&(t=xi,r=function(){var t,r,i;t=xi,r=Fi(),r!==a?(i=function(){var t,r,i,o;t=xi,r=xi,i=[],o=Gi();for(;o!==a;)i.push(o),o=Gi();return r=e.substring(r,xi),t,r=xr(r),t=r,t}(),t,t=Ar(r,i)):(xi=t,t=a);return t}(),r!==a&&(t,r=fr(r)),(t=r)===a&&(t=xi,r=function(){var e,t,r;e=xi,t=xi,Ri++,r=Ui(),Ri--,r===a?t=void 0:(xi=t,t=a);t!==a&&(r=Xi())!==a?(e,e=Kr(r)):(xi=e,e=a);e===a&&(e=xi,(t=Zi())!==a&&(r=Xi())!==a?(e,e=Dr(r)):(xi=e,e=a),e===a&&(e=xi,(t=Zi())!==a?(e,e=Vr(r="")):(xi=e,e=a)));return e}(),r!==a&&(t,r=mr(r)),t=r)))),t}function Ui(){var e;return(e=Di())===a&&(e=Ji())===a&&(e=to())===a&&(e=Fi())===a&&(e=Zi()),e}function Ki(){var t;return 124===e.charCodeAt(xi)?(t=d,xi++):(t=a,0===Ri&&Bi(Me)),t}function Di(){var t;return e.substr(xi,4)===h?(t=h,xi+=4):(t=a,0===Ri&&Bi(Ke)),t===a&&(e.substr(xi,3)===y?(t=y,xi+=3):(t=a,0===Ri&&Bi(De)),t===a&&(e.substr(xi,2)===g?(t=g,xi+=2):(t=a,0===Ri&&Bi(Ve)))),t}function Vi(){var t,r;return t=xi,Ki()!==a?(r=function(){var t;return e.substr(xi,4)===f?(t=f,xi+=4):(t=a,0===Ri&&Bi(Fe)),t}(),r!==a?(t,t=Tr(r)):(xi=t,t=a)):(xi=t,t=a),t}function Fi(){var t,r,i,o,s,n,l;if(t=xi,Vi()!==a){for(r=xi,i=xi,o=[],Ie.test(e.charAt(xi))?(s=e.charAt(xi),xi++):(s=a,0===Ri&&Bi(Ge));s!==a;)o.push(s),Ie.test(e.charAt(xi))?(s=e.charAt(xi),xi++):(s=a,0===Ri&&Bi(Ge));(s=ko())!==a?i=o=[o,s]:(xi=i,i=a),(r=i!==a?e.substring(r,xi):i)!==a?(t,t=Pr()):(xi=t,t=a)}else xi=t,t=a;if(t===a)if(t=xi,Vi()!==a)if(58===e.charCodeAt(xi)?(r=p,xi++):(r=a,0===Ri&&Bi(Ue)),r!==a)if(i=function(){var t,r,i;e.substr(xi,9)===m?(t=m,xi+=9):(t=a,0===Ri&&Bi(He));if(t===a&&(e.substr(xi,9)===b?(t=b,xi+=9):(t=a,0===Ri&&Bi($e)),t===a&&(e.substr(xi,10)===v?(t=v,xi+=10):(t=a,0===Ri&&Bi(qe)),t===a))){if(t=xi,r=[],(i=Ro())!==a)for(;i!==a;)r.push(i),i=Ro();else r=a;(t=r!==a?e.substring(t,xi):r)===a&&(t="")}return t}(),i!==a){for(o=xi,s=xi,n=[],Ie.test(e.charAt(xi))?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Ge));l!==a;)n.push(l),Ie.test(e.charAt(xi))?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Ge));(l=ko())!==a?s=n=[n,l]:(xi=s,s=a),(o=s!==a?e.substring(o,xi):s)!==a?(t,t=_r(i)):(xi=t,t=a)}else xi=t,t=a;else xi=t,t=a;else xi=t,t=a;return t}function Gi(){var t,r,i,o,s,n;if(t=xi,r=xi,Ri++,i=Ui(),Ri--,i===a?r=void 0:(xi=r,r=a),r!==a){if(i=xi,o=xi,s=[],(n=Ro())!==a)for(;n!==a;)s.push(n),n=Ro();else s=a;s!==a&&(n=ko())!==a?o=s=[s,n]:(xi=o,o=a),(i=o!==a?e.substring(i,xi):o)!==a?(t,t=wr(i)):(xi=t,t=a)}else xi=t,t=a;return t===a&&(t=Oo()),t}function Hi(){var t;return e.substr(xi,2)===T?(t=T,xi+=2):(t=a,0===Ri&&Bi(Je)),t}function $i(){var t;return e.substr(xi,3)===A?(t=A,xi+=3):(t=a,0===Ri&&Bi(ze)),t}function qi(){var t;return e.substr(xi,3)===P?(t=P,xi+=3):(t=a,0===Ri&&Bi(We)),t===a&&(e.substr(xi,3)===_?(t=_,xi+=3):(t=a,0===Ri&&Bi(Ye))),t}function Ji(){var e;return(e=Hi())===a&&(e=$i())===a&&(e=qi()),e}function zi(){var t,r,i,o,s,n,l,u;if(t=xi,Yi()!==a)if((r=Ji())!==a){for(i=xi,o=xi,s=[],n=xi,l=xi,Ri++,u=Oo(),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);n!==a;)s.push(n),n=xi,l=xi,Ri++,u=Oo(),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);for((n=Oo())===a&&(n=null),o=s=[s,n],i=e.substring(i,xi),o=[],s=Wi();s!==a;)o.push(s),s=Wi();if(s=xi,n=function(){var t,r,i,o;t=xi,Ri++,r=xi,i=[],9===e.charCodeAt(xi)?(o=x,xi++):(o=a,0===Ri&&Bi(Qe));if(o!==a)for(;o!==a;)i.push(o),9===e.charCodeAt(xi)?(o=x,xi++):(o=a,0===Ri&&Bi(Qe));else i=a;i!==a?(xi,(o=(o=Nr(i))?void 0:a)!==a?(r,r=Mr(i)):(xi=r,r=a)):(xi=r,r=a);Ri--,r!==a?(xi=t,t=void 0):t=a;return t}(),n!==a){for(l=[],u=zi();u!==a;)l.push(u),u=zi();u=function(){var e;xi,e=Ur(),e=e?void 0:a;return e}(),u!==a?(s,s=Ir(r,i,o,l)):(xi=s,s=a)}else xi=s,s=a;s===a&&(s=null),t,t=jr(r,i,o,s)}else xi=t,t=a;else xi=t,t=a;return t}function Wi(){var t,r,i,o,s,n,l,u,c,d;if(t=xi,r=xi,Ri++,i=function(){var t,r,i;t=xi,r=[],Ie.test(e.charAt(xi))?(i=e.charAt(xi),xi++):(i=a,0===Ri&&Bi(Ge));for(;i!==a;)r.push(i),Ie.test(e.charAt(xi))?(i=e.charAt(xi),xi++):(i=a,0===Ri&&Bi(Ge));i=Oo(),i!==a?t=r=[r,i]:(xi=t,t=a);return t}(),Ri--,i===a?r=void 0:(xi=r,r=a),r!==a)if((i=Yi())!==a)if(o=xi,Ri++,s=Ji(),Ri--,s===a?o=void 0:(xi=o,o=a),o!==a){if(s=xi,n=xi,l=[],u=xi,c=xi,Ri++,d=Oo(),Ri--,d===a?c=void 0:(xi=c,c=a),c!==a?(e.length>xi?(d=e.charAt(xi),xi++):(d=a,0===Ri&&Bi(Xe)),d!==a?u=c=[c,d]:(xi=u,u=a)):(xi=u,u=a),u!==a)for(;u!==a;)l.push(u),u=xi,c=xi,Ri++,d=Oo(),Ri--,d===a?c=void 0:(xi=c,c=a),c!==a?(e.length>xi?(d=e.charAt(xi),xi++):(d=a,0===Ri&&Bi(Xe)),d!==a?u=c=[c,d]:(xi=u,u=a)):(xi=u,u=a);else l=a;l!==a&&(u=ko())!==a?n=l=[l,u]:(xi=n,n=a),(s=n!==a?e.substring(s,xi):n)!==a?(t,t=Br(s)):(xi=t,t=a)}else xi=t,t=a;else xi=t,t=a;else xi=t,t=a;return t}function Yi(){var t,r,i;for(t=xi,r=[],9===e.charCodeAt(xi)?(i=x,xi++):(i=a,0===Ri&&Bi(Qe));i!==a;)r.push(i),9===e.charCodeAt(xi)?(i=x,xi++):(i=a,0===Ri&&Bi(Qe));return xi,(i=(i=Lr(r))?void 0:a)!==a?t=r=[r,i]:(xi=t,t=a),t}function Xi(){var t,r,i;if(t=xi,r=[],(i=Qi())!==a)for(;i!==a;)r.push(i),i=Qi();else r=a;return t=r!==a?e.substring(t,xi):r}function Qi(){var t,r,i,o,s,n;if(t=xi,r=xi,Ri++,i=Ui(),Ri--,i===a?r=void 0:(xi=r,r=a),r!==a){if(i=xi,o=xi,s=[],(n=Ro())!==a)for(;n!==a;)s.push(n),n=Ro();else s=a;s!==a&&(n=ko())!==a?o=s=[s,n]:(xi=o,o=a),(i=o!==a?e.substring(i,xi):o)!==a?t=r=[r,i]:(xi=t,t=a)}else xi=t,t=a;return t===a&&(t=Oo()),t}function Zi(){var t,r,i,o,s,n;if(t=xi,(r=Ki())!==a){for(i=xi,o=xi,s=[],Ie.test(e.charAt(xi))?(n=e.charAt(xi),xi++):(n=a,0===Ri&&Bi(Ge));n!==a;)s.push(n),Ie.test(e.charAt(xi))?(n=e.charAt(xi),xi++):(n=a,0===Ri&&Bi(Ge));(n=ko())!==a?o=s=[s,n]:(xi=o,o=a),(i=o!==a?e.substring(i,xi):o)!==a?((o=Oo())===a&&(o=null),t=r=[r,i,o]):(xi=t,t=a)}else xi=t,t=a;return t}function eo(){var t,r;return t=xi,Ki()!==a?(r=function(){var t;return e.substr(xi,5)===w?(t=w,xi+=5):(t=a,0===Ri&&Bi(Ze)),t}(),r!==a?(t,t=Fr(r)):(xi=t,t=a)):(xi=t,t=a),t}function to(){var t,r,i,o,s,n,l,u,c,d;if(t=xi,(r=eo())!==a)if(58===e.charCodeAt(xi)?(i=p,xi++):(i=a,0===Ri&&Bi(Ue)),i!==a)if(32===e.charCodeAt(xi)?(o=S,xi++):(o=a,0===Ri&&Bi(et)),o===a&&(o=null),s=function(){var t,r,i,o,s,n,l,u,c;t=xi,r=xi,e.substr(xi,4)===we?(i=we,xi+=4):(i=a,0===Ri&&Bi(sr));if(i!==a)if(115===e.charCodeAt(xi)?(o=Se,xi++):(o=a,0===Ri&&Bi(nr)),o===a&&(o=null),e.substr(xi,3)===Oe?(s=Oe,xi+=3):(s=a,0===Ri&&Bi(ar)),s!==a){for(n=[],l=xi,u=xi,Ri++,c=Ki(),Ri--,c===a?u=void 0:(xi=u,u=a),u!==a&&(c=Co())!==a?l=u=[u,c]:(xi=l,l=a);l!==a;)n.push(l),l=xi,u=xi,Ri++,c=Ki(),Ri--,c===a?u=void 0:(xi=u,u=a),u!==a&&(c=Co())!==a?l=u=[u,c]:(xi=l,l=a);r=i=[i,o,s,n]}else xi=r,r=a;else xi=r,r=a;t=r!==a?e.substring(t,xi):r;return t}(),s!==a)if(Ki()!==a){for(n=function(){var e,t,r;e=xi,t=[],r=ro();for(;r!==a;)t.push(r),r=ro();return e,t=Hr(t),e=t,e}(),l=xi,u=xi,c=[],Ie.test(e.charAt(xi))?(d=e.charAt(xi),xi++):(d=a,0===Ri&&Bi(Ge));d!==a;)c.push(d),Ie.test(e.charAt(xi))?(d=e.charAt(xi),xi++):(d=a,0===Ri&&Bi(Ge));(d=ko())!==a?u=c=[c,d]:(xi=u,u=a),(l=u!==a?e.substring(l,xi):u)!==a?((u=Oo())===a&&(u=null),t,t=Gr(r,s,n)):(xi=t,t=a)}else xi=t,t=a;else xi=t,t=a;else xi=t,t=a;else xi=t,t=a;return t}function ro(){var t,r,i,o,s,n,l,u,c,d;if(t=xi,35===e.charCodeAt(xi)?(r=O,xi++):(r=a,0===Ri&&Bi(tt)),r!==a){for(i=xi,o=[],s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);i=e.substring(i,xi),(o=Ki())!==a?(t,t=$r(i)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,64===e.charCodeAt(xi)?(r=R,xi++):(r=a,0===Ri&&Bi(rt)),r===a&&(r=null),(i=io())!==a)if(58===e.charCodeAt(xi)?(o=p,xi++):(o=a,0===Ri&&Bi(Ue)),o!==a){for(s=[],32===e.charCodeAt(xi)?(n=S,xi++):(n=a,0===Ri&&Bi(et));n!==a;)s.push(n),32===e.charCodeAt(xi)?(n=S,xi++):(n=a,0===Ri&&Bi(et));if(n=xi,l=[],u=xi,c=xi,Ri++,d=Ki(),Ri--,d===a?c=void 0:(xi=c,c=a),c!==a?(je.test(e.charAt(xi))?(d=e.charAt(xi),xi++):(d=a,0===Ri&&Bi(it)),d!==a?u=c=[c,d]:(xi=u,u=a)):(xi=u,u=a),u!==a)for(;u!==a;)l.push(u),u=xi,c=xi,Ri++,d=Ki(),Ri--,d===a?c=void 0:(xi=c,c=a),c!==a?(je.test(e.charAt(xi))?(d=e.charAt(xi),xi++):(d=a,0===Ri&&Bi(it)),d!==a?u=c=[c,d]:(xi=u,u=a)):(xi=u,u=a);else l=a;(n=l!==a?e.substring(n,xi):l)!==a&&(l=Ki())!==a?(t,t=qr(i,n)):(xi=t,t=a)}else xi=t,t=a;else xi=t,t=a;if(t===a){if(t=xi,64===e.charCodeAt(xi)?(r=R,xi++):(r=a,0===Ri&&Bi(rt)),r===a&&(r=null),(i=io())!==a)if(58===e.charCodeAt(xi)?(o=p,xi++):(o=a,0===Ri&&Bi(Ue)),o!==a){for(s=[],32===e.charCodeAt(xi)?(n=S,xi++):(n=a,0===Ri&&Bi(et));n!==a;)s.push(n),32===e.charCodeAt(xi)?(n=S,xi++):(n=a,0===Ri&&Bi(et));for(n=xi,l=[],u=xi,c=xi,Ri++,d=Ki(),Ri--,d===a?c=void 0:(xi=c,c=a),c!==a&&(d=Ro())!==a?u=c=[c,d]:(xi=u,u=a);u!==a;)l.push(u),u=xi,c=xi,Ri++,d=Ki(),Ri--,d===a?c=void 0:(xi=c,c=a),c!==a&&(d=Ro())!==a?u=c=[c,d]:(xi=u,u=a);n=e.substring(n,xi),(l=Ki())!==a?(t,t=Jr(i,n)):(xi=t,t=a)}else xi=t,t=a;else xi=t,t=a;if(t===a){for(t=xi,64===e.charCodeAt(xi)?(r=R,xi++):(r=a,0===Ri&&Bi(rt)),r===a&&(r=null),i=xi,o=[],s=xi,n=xi,Ri++,(l=Ki())===a&&(58===e.charCodeAt(xi)?(l=p,xi++):(l=a,0===Ri&&Bi(Ue))),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,(l=Ki())===a&&(58===e.charCodeAt(xi)?(l=p,xi++):(l=a,0===Ri&&Bi(Ue))),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);if(i=e.substring(i,xi),58===e.charCodeAt(xi)?(o=p,xi++):(o=a,0===Ri&&Bi(Ue)),o!==a){for(32===e.charCodeAt(xi)?(s=S,xi++):(s=a,0===Ri&&Bi(et)),s===a&&(s=null),n=xi,l=[],u=xi,c=xi,Ri++,d=Ki(),Ri--,d===a?c=void 0:(xi=c,c=a),c!==a&&(d=Ro())!==a?u=c=[c,d]:(xi=u,u=a);u!==a;)l.push(u),u=xi,c=xi,Ri++,d=Ki(),Ri--,d===a?c=void 0:(xi=c,c=a),c!==a&&(d=Ro())!==a?u=c=[c,d]:(xi=u,u=a);n=e.substring(n,xi),(l=Ki())!==a?(t,t=zr(i,n)):(xi=t,t=a)}else xi=t,t=a;if(t===a){for(t=xi,64===e.charCodeAt(xi)?(r=R,xi++):(r=a,0===Ri&&Bi(rt)),r===a&&(r=null),i=xi,o=[],s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);i=e.substring(i,xi),(o=Ki())!==a?(t,t=Wr(i)):(xi=t,t=a)}}}}return t}function io(){var t;return e.substr(xi,5)===k?(t=k,xi+=5):(t=a,0===Ri&&Bi(ot)),t===a&&(e.substr(xi,6)===C?(t=C,xi+=6):(t=a,0===Ri&&Bi(st))),t}function oo(){var e,t,r,i;for(e=xi,(t=so())===a&&(t=null),r=[],(i=uo())===a&&(i=so());i!==a;)r.push(i),(i=uo())===a&&(i=so());return e,e=Xr(t,r)}function so(){var t,r,i,o,s,n,l;if(t=xi,(r=Oo())!==a&&(t,r=Qr()),(t=r)===a){if(t=xi,r=xi,i=[],o=xi,(s=co())===a&&(s=null),n=xi,Ri++,l=uo(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?o=s=[s,n,l]:(xi=o,o=a),o===a&&(o=xi,(s=co())!==a?(n=xi,Ri++,l=uo(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?o=s=[s,n]:(xi=o,o=a)):(xi=o,o=a)),o!==a)for(;o!==a;)i.push(o),o=xi,(s=co())===a&&(s=null),n=xi,Ri++,l=uo(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?o=s=[s,n,l]:(xi=o,o=a),o===a&&(o=xi,(s=co())!==a?(n=xi,Ri++,l=uo(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?o=s=[s,n]:(xi=o,o=a)):(xi=o,o=a));else i=a;(r=i!==a?e.substring(r,xi):i)!==a&&(t,r=Zr(r)),t=r}return t}function no(){var t;return 61===e.charCodeAt(xi)?(t=E,xi++):(t=a,0===Ri&&Bi(at)),t}function ao(){var t;return e.substr(xi,2)===I?(t=I,xi+=2):(t=a,0===Ri&&Bi(lt)),t}function lo(){var e,t,r;return e=xi,(t=no())!==a&&(r=no())!==a?e=t=[t,r]:(xi=e,e=a),e}function uo(){var t,r,i,o,s,n,l,u,c,p;if(t=xi,(r=_o())!==a){if(i=xi,o=[],je.test(e.charAt(xi))?(s=e.charAt(xi),xi++):(s=a,0===Ri&&Bi(it)),s!==a)for(;s!==a;)o.push(s),je.test(e.charAt(xi))?(s=e.charAt(xi),xi++):(s=a,0===Ri&&Bi(it));else o=a;(i=o!==a?e.substring(i,xi):o)!==a&&(o=xo())!==a?(t,t=ei(i)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,(r=lo())!==a){for(32===e.charCodeAt(xi)?(i=S,xi++):(i=a,0===Ri&&Bi(et)),i===a&&(i=null),o=xi,s=[],n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=lo())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);n!==a;)s.push(n),n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=lo())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);o=e.substring(o,xi),32===e.charCodeAt(xi)?(s=S,xi++):(s=a,0===Ri&&Bi(et)),s===a&&(s=null),(n=lo())!==a?(l=function(){var t,r,i,o;t=xi,124===e.charCodeAt(xi)?(r=d,xi++):(r=a,0===Ri&&Bi(Me));if(r!==a){for(i=[],o=po();o!==a;)i.push(o),o=po();t,t=ai(i)}else xi=t,t=a;return t}(),l===a&&(l=null),t,t=ti(o,l)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,(r=vo())!==a){for(32===e.charCodeAt(xi)?(i=S,xi++):(i=a,0===Ri&&Bi(et)),i===a&&(i=null),o=xi,s=[],n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=vo())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);n!==a;)s.push(n),n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=vo())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);o=e.substring(o,xi),32===e.charCodeAt(xi)?(s=S,xi++):(s=a,0===Ri&&Bi(et)),s===a&&(s=null),(n=vo())!==a?(t,t=ri(o)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,(r=To())!==a){for(32===e.charCodeAt(xi)?(i=S,xi++):(i=a,0===Ri&&Bi(et)),i===a&&(i=null),o=xi,s=[],n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=To())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);n!==a;)s.push(n),n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=To())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);o=e.substring(o,xi),32===e.charCodeAt(xi)?(s=S,xi++):(s=a,0===Ri&&Bi(et)),s===a&&(s=null),(n=To())!==a?(t,t=ii(o)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,(r=Ao())!==a){for(32===e.charCodeAt(xi)?(i=S,xi++):(i=a,0===Ri&&Bi(et)),i===a&&(i=null),o=xi,s=[],n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=Ao())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);n!==a;)s.push(n),n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=Ao())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);o=e.substring(o,xi),32===e.charCodeAt(xi)?(s=S,xi++):(s=a,0===Ri&&Bi(et)),s===a&&(s=null),(n=Ao())!==a?(t,t=oi(o)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,(r=Po())!==a){for(32===e.charCodeAt(xi)?(i=S,xi++):(i=a,0===Ri&&Bi(et)),i===a&&(i=null),o=xi,s=[],n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=Po())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);n!==a;)s.push(n),n=xi,l=xi,Ri++,u=xi,32===e.charCodeAt(xi)?(c=S,xi++):(c=a,0===Ri&&Bi(et)),c===a&&(c=null),(p=Po())!==a?u=c=[c,p]:(xi=u,u=a),Ri--,u===a?l=void 0:(xi=l,l=a),l!==a?(e.length>xi?(u=e.charAt(xi),xi++):(u=a,0===Ri&&Bi(Xe)),u!==a?n=l=[l,u]:(xi=n,n=a)):(xi=n,n=a);o=e.substring(o,xi),32===e.charCodeAt(xi)?(s=S,xi++):(s=a,0===Ri&&Bi(et)),s===a&&(s=null),(n=Po())!==a?(t,t=si(o)):(xi=t,t=a)}else xi=t,t=a;t===a&&(t=xi,r=function(){var t,r,i,o,s,n,l;t=xi,r=xi,i=xi,e.substr(xi,4)===we?(o=we,xi+=4):(o=a,0===Ri&&Bi(sr));o!==a?(115===e.charCodeAt(xi)?(s=Se,xi++):(s=a,0===Ri&&Bi(nr)),s===a&&(s=null),e.substr(xi,3)===Oe?(n=Oe,xi+=3):(n=a,0===Ri&&Bi(ar)),n!==a?i=o=[o,s,n]:(xi=i,i=a)):(xi=i,i=a);i===a&&(e.substr(xi,7)===Re?(i=Re,xi+=7):(i=a,0===Ri&&Bi(lr)));r=i!==a?e.substring(r,xi):i;if(r!==a){for(i=xi,o=[],s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Co())!==a?s=n=[n,l]:(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Co())!==a?s=n=[n,l]:(xi=s,s=a);i=e.substring(i,xi),t,t=_i(r,i)}else xi=t,t=a;return t}(),r!==a&&(t,r=ni(r)),t=r)}}}}}return t}function co(){var t,r,i,o,s;if(t=xi,r=xi,(i=lo())!==a){if(o=[],(s=no())!==a)for(;s!==a;)o.push(s),s=no();else o=a;o!==a?r=i=[i,o]:(xi=r,r=a)}else xi=r,r=a;if((t=r!==a?e.substring(t,xi):r)===a){if(t=xi,r=xi,i=function(){var e,t,r;return e=xi,(t=ao())!==a&&(r=ao())!==a?e=t=[t,r]:(xi=e,e=a),e}(),i!==a){if(o=[],(s=ao())!==a)for(;s!==a;)o.push(s),s=ao();else o=a;o!==a?r=i=[i,o]:(xi=r,r=a)}else xi=r,r=a;if((t=r!==a?e.substring(t,xi):r)===a){if(t=xi,r=xi,(i=Ao())!==a){if(o=[],(s=mo())!==a)for(;s!==a;)o.push(s),s=mo();else o=a;o!==a?r=i=[i,o]:(xi=r,r=a)}else xi=r,r=a;if((t=r!==a?e.substring(t,xi):r)===a){if(t=xi,r=xi,(i=Po())!==a){if(o=[],(s=bo())!==a)for(;s!==a;)o.push(s),s=bo();else o=a;o!==a?r=i=[i,o]:(xi=r,r=a)}else xi=r,r=a;t=r!==a?e.substring(t,xi):r}}}return t}function po(){var t,r,i,o,s,n,l;if(t=xi,e.substr(xi,5)===j?(r=j,xi+=5):(r=a,0===Ri&&Bi(ut)),r!==a){for(i=xi,o=[],s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);i=e.substring(i,xi),(o=Ki())!==a?(t,t=li(i)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,e.substr(xi,4)===B?(r=B,xi+=4):(r=a,0===Ri&&Bi(ct)),r!==a){for(i=xi,o=[],s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);i=e.substring(i,xi),(o=Ki())!==a?(t,t=ui(i)):(xi=t,t=a)}else xi=t,t=a;if(t===a&&(t=xi,e.substr(xi,4)===f?(r=f,xi+=4):(r=a,0===Ri&&Bi(Fe)),r!==a&&(i=Ki())!==a?(t,t=ci()):(xi=t,t=a),t===a)){if(t=xi,e.substr(xi,5)===L?(r=L,xi+=5):(r=a,0===Ri&&Bi(dt)),r!==a){for(i=xi,o=[],s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);i=e.substring(i,xi),(o=Ki())!==a?(t,t=di(i)):(xi=t,t=a)}else xi=t,t=a;if(t===a&&(t=xi,e.substr(xi,6)===N?(r=N,xi+=6):(r=a,0===Ri&&Bi(pt)),r!==a?(i=function(){var t;e.substr(xi,4)===q?(t=q,xi+=4):(t=a,0===Ri&&Bi(Pt));t===a&&(e.substr(xi,5)===J?(t=J,xi+=5):(t=a,0===Ri&&Bi(_t)),t===a&&(e.substr(xi,4)===z?(t=z,xi+=4):(t=a,0===Ri&&Bi(xt)),t===a&&(e.substr(xi,4)===W?(t=W,xi+=4):(t=a,0===Ri&&Bi(wt)),t===a&&(e.substr(xi,7)===Y?(t=Y,xi+=7):(t=a,0===Ri&&Bi(St)),t===a&&(e.substr(xi,9)===X?(t=X,xi+=9):(t=a,0===Ri&&Bi(Ot)),t===a&&(e.substr(xi,4)===Q?(t=Q,xi+=4):(t=a,0===Ri&&Bi(Rt)),t===a&&(e.substr(xi,8)===Z?(t=Z,xi+=8):(t=a,0===Ri&&Bi(kt)),t===a&&(e.substr(xi,5)===ee?(t=ee,xi+=5):(t=a,0===Ri&&Bi(Ct)),t===a&&(e.substr(xi,4)===te?(t=te,xi+=4):(t=a,0===Ri&&Bi(Et)),t===a&&(e.substr(xi,7)===re?(t=re,xi+=7):(t=a,0===Ri&&Bi(It)),t===a&&(e.substr(xi,6)===ie?(t=ie,xi+=6):(t=a,0===Ri&&Bi(jt)),t===a&&(e.substr(xi,4)===oe?(t=oe,xi+=4):(t=a,0===Ri&&Bi(Bt)),t===a&&(e.substr(xi,5)===se?(t=se,xi+=5):(t=a,0===Ri&&Bi(Lt)),t===a&&(e.substr(xi,6)===ne?(t=ne,xi+=6):(t=a,0===Ri&&Bi(Nt)),t===a&&(e.substr(xi,6)===ae?(t=ae,xi+=6):(t=a,0===Ri&&Bi(Mt)),t===a&&(e.substr(xi,3)===le?(t=le,xi+=3):(t=a,0===Ri&&Bi(Ut)),t===a&&(e.substr(xi,6)===ue?(t=ue,xi+=6):(t=a,0===Ri&&Bi(Kt)),t===a&&(e.substr(xi,4)===ce?(t=ce,xi+=4):(t=a,0===Ri&&Bi(Dt)),t===a&&(e.substr(xi,6)===de?(t=de,xi+=6):(t=a,0===Ri&&Bi(Vt)),t===a&&(e.substr(xi,5)===pe?(t=pe,xi+=5):(t=a,0===Ri&&Bi(Ft)),t===a&&(e.substr(xi,6)===he?(t=he,xi+=6):(t=a,0===Ri&&Bi(Gt)))))))))))))))))))))));return t}(),i!==a&&(o=Ki())!==a?(t,t=pi(i)):(xi=t,t=a)):(xi=t,t=a),t===a&&(t=xi,r=function(){var t;e.substr(xi,4)===M?(t=M,xi+=4):(t=a,0===Ri&&Bi(ht));t===a&&(e.substr(xi,6)===U?(t=U,xi+=6):(t=a,0===Ri&&Bi(yt)),t===a&&(e.substr(xi,5)===K?(t=K,xi+=5):(t=a,0===Ri&&Bi(gt)),t===a&&(e.substr(xi,9)===D?(t=D,xi+=9):(t=a,0===Ri&&Bi(ft)),t===a&&(e.substr(xi,6)===V?(t=V,xi+=6):(t=a,0===Ri&&Bi(mt)),t===a&&(e.substr(xi,3)===F?(t=F,xi+=3):(t=a,0===Ri&&Bi(bt)),t===a&&(e.substr(xi,5)===G?(t=G,xi+=5):(t=a,0===Ri&&Bi(vt)),t===a&&(e.substr(xi,3)===H?(t=H,xi+=3):(t=a,0===Ri&&Bi(Tt)),t===a&&(e.substr(xi,3)===$?(t=$,xi+=3):(t=a,0===Ri&&Bi(At))))))))));return t}(),r!==a&&(i=Ki())!==a?(t,t=hi(r)):(xi=t,t=a),t===a)))if(t=xi,35===e.charCodeAt(xi)?(r=O,xi++):(r=a,0===Ri&&Bi(tt)),r!==a){for(i=xi,o=[],s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=Ki(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a&&(l=Ro())!==a?s=n=[n,l]:(xi=s,s=a);i=e.substring(i,xi),(o=Ki())!==a?(t,t=yi(i)):(xi=t,t=a)}else xi=t,t=a}}return t}function ho(){var e,t,r,i;for(Ri++,e=xi,(t=yo())===a&&(t=null),r=[],(i=wo())===a&&(i=yo());i!==a;)r.push(i),(i=wo())===a&&(i=yo());return e,e=fi(t,r),Ri--,t=a,0===Ri&&Bi($t),e}function yo(){var t,r,i,o,s,n,l;if(t=xi,r=xi,i=[],o=xi,(s=So())===a&&(s=null),n=xi,Ri++,l=wo(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?o=s=[s,n,l]:(xi=o,o=a)):(xi=o,o=a),o!==a)for(;o!==a;)i.push(o),o=xi,(s=So())===a&&(s=null),n=xi,Ri++,l=wo(),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?o=s=[s,n,l]:(xi=o,o=a)):(xi=o,o=a);else i=a;return(r=i!==a?e.substring(r,xi):i)!==a&&(t,r=mi(r)),(t=r)===a&&(t=Oo()),t}function go(){var t;return 42===e.charCodeAt(xi)?(t=ye,xi++):(t=a,0===Ri&&Bi(qt)),t}function fo(){var t;return 95===e.charCodeAt(xi)?(t=ge,xi++):(t=a,0===Ri&&Bi(Jt)),t}function mo(){var t;return 96===e.charCodeAt(xi)?(t=fe,xi++):(t=a,0===Ri&&Bi(zt)),t}function bo(){var t;return 33===e.charCodeAt(xi)?(t=me,xi++):(t=a,0===Ri&&Bi(Wt)),t}function vo(){var e,t,r;return e=xi,(t=go())!==a&&(r=go())!==a?e=t=[t,r]:(xi=e,e=a),e}function To(){var e,t,r;return e=xi,(t=fo())!==a&&(r=fo())!==a?e=t=[t,r]:(xi=e,e=a),e}function Ao(){var e,t,r;return e=xi,(t=mo())!==a&&(r=mo())!==a?e=t=[t,r]:(xi=e,e=a),e}function Po(){var e,t,r;return e=xi,(t=bo())!==a&&(r=bo())!==a?e=t=[t,r]:(xi=e,e=a),e}function _o(){var t;return e.substr(xi,2)===be?(t=be,xi+=2):(t=a,0===Ri&&Bi(Yt)),t}function xo(){var t;return 93===e.charCodeAt(xi)?(t=ve,xi++):(t=a,0===Ri&&Bi(Xt)),t}function wo(){var t,r,i,o,s,n,l,u,c;if(t=xi,_o()!==a){if(r=xi,i=[],je.test(e.charAt(xi))?(o=e.charAt(xi),xi++):(o=a,0===Ri&&Bi(it)),o!==a)for(;o!==a;)i.push(o),je.test(e.charAt(xi))?(o=e.charAt(xi),xi++):(o=a,0===Ri&&Bi(it));else i=a;(r=i!==a?e.substring(r,xi):i)!==a&&(i=xo())!==a?(t,t=bi(r)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,vo()!==a){for(32===e.charCodeAt(xi)?(r=S,xi++):(r=a,0===Ri&&Bi(et)),r===a&&(r=null),i=xi,o=[],s=xi,n=xi,Ri++,l=xi,32===e.charCodeAt(xi)?(u=S,xi++):(u=a,0===Ri&&Bi(et)),u===a&&(u=null),(c=vo())!==a?l=u=[u,c]:(xi=l,l=a),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?s=n=[n,l]:(xi=s,s=a)):(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=xi,32===e.charCodeAt(xi)?(u=S,xi++):(u=a,0===Ri&&Bi(et)),u===a&&(u=null),(c=vo())!==a?l=u=[u,c]:(xi=l,l=a),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?s=n=[n,l]:(xi=s,s=a)):(xi=s,s=a);i=e.substring(i,xi),32===e.charCodeAt(xi)?(o=S,xi++):(o=a,0===Ri&&Bi(et)),o===a&&(o=null),(s=vo())!==a?(t,t=vi(i)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,To()!==a){for(32===e.charCodeAt(xi)?(r=S,xi++):(r=a,0===Ri&&Bi(et)),r===a&&(r=null),i=xi,o=[],s=xi,n=xi,Ri++,l=xi,32===e.charCodeAt(xi)?(u=S,xi++):(u=a,0===Ri&&Bi(et)),u===a&&(u=null),(c=To())!==a?l=u=[u,c]:(xi=l,l=a),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?s=n=[n,l]:(xi=s,s=a)):(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=xi,32===e.charCodeAt(xi)?(u=S,xi++):(u=a,0===Ri&&Bi(et)),u===a&&(u=null),(c=To())!==a?l=u=[u,c]:(xi=l,l=a),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?s=n=[n,l]:(xi=s,s=a)):(xi=s,s=a);i=e.substring(i,xi),32===e.charCodeAt(xi)?(o=S,xi++):(o=a,0===Ri&&Bi(et)),o===a&&(o=null),(s=To())!==a?(t,t=Ti(i)):(xi=t,t=a)}else xi=t,t=a;if(t===a){if(t=xi,Ao()!==a){for(32===e.charCodeAt(xi)?(r=S,xi++):(r=a,0===Ri&&Bi(et)),r===a&&(r=null),i=xi,o=[],s=xi,n=xi,Ri++,l=xi,32===e.charCodeAt(xi)?(u=S,xi++):(u=a,0===Ri&&Bi(et)),u===a&&(u=null),(c=Ao())!==a?l=u=[u,c]:(xi=l,l=a),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?s=n=[n,l]:(xi=s,s=a)):(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=xi,32===e.charCodeAt(xi)?(u=S,xi++):(u=a,0===Ri&&Bi(et)),u===a&&(u=null),(c=Ao())!==a?l=u=[u,c]:(xi=l,l=a),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?s=n=[n,l]:(xi=s,s=a)):(xi=s,s=a);i=e.substring(i,xi),32===e.charCodeAt(xi)?(o=S,xi++):(o=a,0===Ri&&Bi(et)),o===a&&(o=null),(s=Ao())!==a?(t,t=Ai(i)):(xi=t,t=a)}else xi=t,t=a;if(t===a)if(t=xi,Po()!==a){for(32===e.charCodeAt(xi)?(r=S,xi++):(r=a,0===Ri&&Bi(et)),r===a&&(r=null),i=xi,o=[],s=xi,n=xi,Ri++,l=xi,32===e.charCodeAt(xi)?(u=S,xi++):(u=a,0===Ri&&Bi(et)),u===a&&(u=null),(c=Po())!==a?l=u=[u,c]:(xi=l,l=a),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?s=n=[n,l]:(xi=s,s=a)):(xi=s,s=a);s!==a;)o.push(s),s=xi,n=xi,Ri++,l=xi,32===e.charCodeAt(xi)?(u=S,xi++):(u=a,0===Ri&&Bi(et)),u===a&&(u=null),(c=Po())!==a?l=u=[u,c]:(xi=l,l=a),Ri--,l===a?n=void 0:(xi=n,n=a),n!==a?(e.length>xi?(l=e.charAt(xi),xi++):(l=a,0===Ri&&Bi(Xe)),l!==a?s=n=[n,l]:(xi=s,s=a)):(xi=s,s=a);i=e.substring(i,xi),32===e.charCodeAt(xi)?(o=S,xi++):(o=a,0===Ri&&Bi(et)),o===a&&(o=null),(s=Po())!==a?(t,t=Pi(i)):(xi=t,t=a)}else xi=t,t=a}}}return t}function So(){var t,r,i,o,s;if(t=xi,r=xi,(i=vo())!==a){if(o=[],(s=go())!==a)for(;s!==a;)o.push(s),s=go();else o=a;o!==a?r=i=[i,o]:(xi=r,r=a)}else xi=r,r=a;if((t=r!==a?e.substring(t,xi):r)===a){if(t=xi,r=xi,(i=To())!==a){if(o=[],(s=fo())!==a)for(;s!==a;)o.push(s),s=fo();else o=a;o!==a?r=i=[i,o]:(xi=r,r=a)}else xi=r,r=a;if((t=r!==a?e.substring(t,xi):r)===a){if(t=xi,r=xi,(i=Ao())!==a){if(o=[],(s=mo())!==a)for(;s!==a;)o.push(s),s=mo();else o=a;o!==a?r=i=[i,o]:(xi=r,r=a)}else xi=r,r=a;if((t=r!==a?e.substring(t,xi):r)===a){if(t=xi,r=xi,(i=Po())!==a){if(o=[],(s=bo())!==a)for(;s!==a;)o.push(s),s=bo();else o=a;o!==a?r=i=[i,o]:(xi=r,r=a)}else xi=r,r=a;t=r!==a?e.substring(t,xi):r}}}return t}function Oo(){var t;return Ri++,10===e.charCodeAt(xi)?(t=Te,xi++):(t=a,0===Ri&&Bi(Zt)),t===a&&(e.substr(xi,2)===Ae?(t=Ae,xi+=2):(t=a,0===Ri&&Bi(er)),t===a&&(13===e.charCodeAt(xi)?(t=Pe,xi++):(t=a,0===Ri&&Bi(tr)),t===a&&(8232===e.charCodeAt(xi)?(t=_e,xi++):(t=a,0===Ri&&Bi(rr)),t===a&&(8233===e.charCodeAt(xi)?(t=xe,xi++):(t=a,0===Ri&&Bi(ir)))))),Ri--,t===a&&(a,0===Ri&&Bi(Qt)),t}function Ro(){var t;return Be.test(e.charAt(xi))?(t=e.charAt(xi),xi++):(t=a,0===Ri&&Bi(or)),t}function ko(){var t,r;return(t=Oo())===a&&(t=xi,Ri++,e.length>xi?(r=e.charAt(xi),xi++):(r=a,0===Ri&&Bi(Xe)),Ri--,r===a?t=void 0:(xi=t,t=a)),t}function Co(){var t;return Le.test(e.charAt(xi))?(t=e.charAt(xi),xi++):(t=a,0===Ri&&Bi(ur)),t===a&&(126===e.charCodeAt(xi)?(t=ke,xi++):(t=a,0===Ri&&Bi(cr)),t===a&&(94===e.charCodeAt(xi)?(t=Ce,xi++):(t=a,0===Ri&&Bi(dr)),t===a&&(39===e.charCodeAt(xi)?(t=Ee,xi++):(t=a,0===Ri&&Bi(pr))))),t}var Eo=[],Io="";if(e=e.trimStart(),(r=c())!==a&&xi===e.length)return r;throw r!==a&&xi<e.length&&Bi({type:"end"}),Li(Oi,Si<e.length?e.charAt(Si):null,Si<e.length?ji(Si,Si+1):ji(Si,Si))}t.SyntaxError=n,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(n,Error),n.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){i=e[r].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,s=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,n=this.location.source+":"+s.line+":"+s.column;if(i){var l=this.location.end,u=a("",s.line.toString().length," "),c=i[o.line-1],d=(o.line===l.line?l.column:c.length+1)-o.column||1;t+="\n --\x3e "+n+"\n"+u+" |\n"+s.line+" | "+c+"\n"+u+" | "+a("",o.column-1," ")+a("",d,"^")}else t+="\n at "+n}return t},n.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?s(e[0])+"-"+s(e[1]):s(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function i(e){return e.charCodeAt(0).toString(16).toUpperCase()}function o(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function s(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function n(e){return r[e.type](e)}return"Expected "+function(e){var t,r,i=e.map(n);if(i.sort(),i.length>0){for(t=1,r=1;t<i.length;t++)i[t-1]!==i[t]&&(i[r]=i[t],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(e)+" but "+function(e){return e?'"'+o(e)+'"':"end of input"}(t)+" found."},t.parse=l},297:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkGenerator=void 0;const o=r(8256),s=r(549),n=r(208),a=r(8791),l=r(1060),u=r(8565),c=r(4719),d=r(1895),p=r(1353),h={debugGenerationInline:!1};t.BitmarkGenerator=class{constructor(e,t){var r;this.ast=new o.Ast,this.skipNLBetweenBitsValue=!1,this.printed=!1,this.bitmarkVersion=null!==(r=a.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:a.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},h),null==t?void 0:t.bitmarkOptions),this.bitmarkVersion===a.BitmarkVersion.v2?void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=u.CardSetVersion.v1):void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=u.CardSetVersion.v2),this.writer=e,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this),this.generatePropertyHandlers()}generate(e){return i(this,void 0,void 0,(function*(){this.resetState(),yield this.writer.open(),this.walkAndWrite(e),this.writeLine(),yield this.writer.close()}))}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.skipNLBetweenBitsValue=!1,this.printed=!1}walkAndWrite(e){this.ast.walk(e,s.NodeType.bitmarkAst,this,void 0),this.writeLine()}enter(e,t,r){let i;const o=this,s=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[s]&&(i=o[s](e,t,r)),i}between(e,t,r,i,o){let s;const n=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof n[a]&&(s=n[a](e,t,r,i,o)),s}exit(e,t,r){const i=this,o=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof i[o]&&i[o](e,t,r)}leaf(e,t,r){const i=this,o=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[o]&&i[o](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}between_bits(e,t,r,i,o){this.writeNL(),this.writeNL(),this.writeNL()}enter_bitsValue(e,t,r){var i,o;const s=e.value;if(this.writeOPD(),this.writeString(s.bitType.alias),s.textFormat){this.isWriteTextFormat(s.textFormat)&&(this.writeColon(),this.writeString(s.textFormat))}const n=null===(i=s.resource)||void 0===i?void 0:i.type;n&&n!==s.bitType.root&&(this.writeAmpersand(),this.writeString(null===(o=s.resource)||void 0===o?void 0:o.type)),this.writeCL(),this.writeNL()}between_bitsValue(e,t,r,i,o){const n=[s.NodeType.bitType,s.NodeType.textFormat,s.NodeType.level,s.NodeType.progress,s.NodeType.toc,s.NodeType.referenceEnd,s.NodeType.labelFalse];e.value.book&&n.push(s.NodeType.reference);(()=>{if(this.skipNLBetweenBitsValue)return this.skipNLBetweenBitsValue=!1,!0;for(const e of n)if(t.key===e)return!0;return!1})()||this.writeNL()}enter_labelTrue(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==s.NodeType.bitsValue)return;const o=null==t?void 0:t.value;o&&(""!=i&&this.writeProperty(c.PropertyKey.labelTrue,i,!0),o.labelFalse&&""!=o.labelFalse[0]&&this.writeProperty(c.PropertyKey.labelFalse,o.labelFalse,!0))}enter_partner(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==s.NodeType.bitsValue)return;const{name:o,avatarImage:n}=i;this.writeProperty("partner",o,!0),n&&this.writeResource(n)}enter_markConfigValue(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==s.NodeType.markConfig)return;const{mark:o,color:n,emphasis:a}=i;o&&(this.writeProperty("mark",o,!0),n&&this.writeProperty("color",n,!0),a&&this.writeProperty("emphasis",a,!0),this.writeNL())}enter_sampleSolution(e,t,r){this.writeProperty("sampleSolution",e.value)}enter_itemLead(e,t,r){const i=e.value;i&&(i.item||i.lead)&&(this.writeOPC(),this.writeString(i.item||""),this.writeCL(),i.lead&&(this.writeOPC(),this.writeString(i.lead),this.writeCL()))}enter_body(e,t,r){e.value.bodyParts.length>0&&this.writeNL()}enter_solutions(e,t,r){const i=e.value;i&&0===i.length&&(this.writeOPU(),this.writeCL())}leaf_solution(e,t,r){var i;const o=e.value,s=null===(i=this.getParentNode(r,2))||void 0===i?void 0:i.value;(null==s?void 0:s.type)===l.BodyBitType.mark&&o&&(this.writeOPE(),this.writeString(o),this.writeCL())}leaf_mark(e,t,r){var i;const o=e.value,s=null===(i=this.getParentNode(r,2))||void 0===i?void 0:i.value;(null==s?void 0:s.type)===l.BodyBitType.mark&&o&&this.writeProperty("mark",o,!0)}enter_optionsValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}enter_textsValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}enter_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeCardSetStart(),this.writeNL())}between_cardNode(e,t,r,i,o){this.isRootBitType1(o)||(this.writeNL(),this.writeCardSetCardDivider(),this.writeNL())}exit_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeNL(),this.writeCardSetEnd())}enter_elements(e,t,r){}between_elements(e,t,r,i,o){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}exit_elements(e,t,r){}between_flashcards(e,t,r,i,o){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}between_flashcardsValue(e,t,r,i,o){r.key===s.NodeType.answer?(this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()):r.key===s.NodeType.alternativeAnswers&&(this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL())}leaf_answer(e,t,r){(null==t?void 0:t.key)===s.NodeType.flashcardsValue&&e.value&&this.writeString(e.value)}between_alternativeAnswers(e,t,r){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}leaf_alternativeAnswersValue(e,t,r){(null==t?void 0:t.key)===s.NodeType.alternativeAnswers&&e.value&&this.writeString(e.value)}enter_statements(e,t,r){}between_statements(e,t,r,i,o){this.isRootBitType(o,n.RootBitType.trueFalse1)||(this.writeNL(),this.writeCardSetCardDivider()),this.writeNL()}exit_statements(e,t,r){}enter_statementsValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}between_choices(e,t,r,i,o){this.writeNL()}exit_choices(e,t,r){this.writeNL()}enter_choicesValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}between_responses(e,t,r,i,o){this.writeNL()}exit_responses(e,t,r){this.writeNL()}enter_responsesValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}enter_quizzes(e,t,r){}between_quizzes(e,t,r,i,o){this.writeCardSetCardDivider(),this.writeNL()}exit_quizzes(e,t,r){}between_quizzesValue(e,t,r,i,o){r.key!==s.NodeType.choices&&r.key!==s.NodeType.responses||this.writeNL()}enter_heading(e,t,r){}between_heading(e,t,r,i,o){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_heading(e,t,r){}enter_forValues(e,t,r){}between_forValues(e,t,r,i,o){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_forValues(e,t,r){}enter_pairs(e,t,r){}between_pairs(e,t,r,i,o){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_pairs(e,t,r){}between_pairsValue(e,t,r,i,o){}enter_keyAudio(e,t,r){const i=e.value;this.writeResource(i)}enter_keyImage(e,t,r){const i=e.value;this.writeResource(i)}enter_matrix(e,t,r){}between_matrix(e,t,r,i,o){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_matrix(e,t,r){}between_matrixValue(e,t,r,i,o){}enter_values(e,t,r){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}between_values(e,t,r,i,o){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}enter_questions(e,t,r){}between_questions(e,t,r,i,o){this.writeCardSetCardDivider(),this.writeNL()}exit_questions(e,t,r){}between_questionsValue(e,t,r,i,o){r.key===s.NodeType.sampleSolution&&this.writeNL()}exit_questionsValue(e,t,r){this.writeNL()}enter_botResponses(e,t,r){}between_botResponses(e,t,r,i,o){this.writeCardSetCardDivider(),this.writeNL()}exit_botResponses(e,t,r){}between_botResponsesValue(e,t,r,i,o){this.writeNL()}exit_botResponsesValue(e,t,r){this.writeNL()}leaf_response(e,t,r){this.writeOPB(),this.writeString(e.value),this.writeCL()}leaf_reaction(e,t,r){this.writeProperty("reaction",e.value,!0)}leaf_feedback(e,t,r){const i=e.value;i&&this.write(i)}enter_resource(e,t,r){const i=e.value;this.writeResource(i)}enter_posterImage(e,t,r){const i=e.value;i&&i.value&&this.writeProperty("posterImage",i.value)}enter_thumbnails(e,t,r){const i=e.value;if(Array.isArray(i)){const e=["src1x","src2x","src3x","src4x"];for(let t=0;t<i.length&&t!==e.length;t++){const r=i[t],o=e[t];this.writeProperty(o,r.value,!0)}}}leaf_title(e,t,r){const i=e.value,o=(null==t?void 0:t.value).level||1;if(o&&i){this.writeOP();for(let e=0;e<+o;e++)this.writeHash();this.writeString(i),this.writeCL()}}leaf_subtitle(e,t,r){const i=e.value;if(i){this.writeOP();for(let e=0;e<2;e++)this.writeHash();this.writeString(i),this.writeCL()}}leaf_book(e,t,r){const i=null==t?void 0:t.value;i&&e.value&&(this.writeProperty("book",e.value),i.reference&&(this.writeOPRANGLE(),this.writeString(i.reference),this.writeCL(),i.referenceEnd&&(this.writeOPRANGLE(),this.writeString(i.referenceEnd),this.writeCL())))}leaf_anchor(e,t,r){e.value&&(this.writeOPDANGLE(),this.writeString(e.value),this.writeCL())}leaf_reference(e,t,r){const i=null==t?void 0:t.value;i&&e.value&&(i.book||(this.writeOPRANGLE(),this.writeString(e.value),this.writeCL()))}leaf_hint(e,t,r){const i=e.value;i&&(this.writeOPQ(),this.writeString(i),this.writeCL())}leaf_instruction(e,t,r){const i=e.value;i&&(this.writeOPB(),this.writeString(i),this.writeCL())}leaf_example(e,t,r){var i,o;const s=e.value,n=null!==(i=null==t?void 0:t.value.isExample)&&void 0!==i&&i,a=null!==(o=null==t?void 0:t.value.isDefaultExample)&&void 0!==o&&o;n&&(a?(this.writeOPA(),this.writeString("example"),this.writeCL()):null!=s&&(this.writeOPA(),this.writeString("example"),this.writeColon(),!0===s?this.writeString("true"):!1===s?this.writeString("false"):this.writeString(s),this.writeCL()))}leaf_bodyText(e,t,r){const i=e.value;i&&this.writeString(i)}leaf_footerText(e,t,r){const i=e.value;i&&this.writeString(i)}leaf_elementsValue(e,t,r){e.value&&this.writeString(e.value)}leaf_solutionsValue(e,t,r){e.value&&(this.writeOPU(),this.writeString(e.value),this.writeCL())}leaf_prefix(e,t,r){e.value&&(this.writeOPPRE(),this.writeString(e.value),this.writeCL())}leaf_postfix(e,t,r){e.value&&(this.writeOPPOST(),this.writeString(e.value),this.writeCL())}leaf_forKeys(e,t,r){this.writeOPHASH(),this.writeString(e.value),this.writeCL()}leaf_forValuesValue(e,t,r){this.writeOPHASH(),this.writeString(e.value),this.writeCL()}leaf_key(e,t,r){e.value&&this.writeString(e.value)}leaf_valuesValue(e,t,r){e.value&&this.writeString(e.value)}leaf_question(e,t,r){(null==t?void 0:t.key)!==s.NodeType.questionsValue&&(null==t?void 0:t.key)!==s.NodeType.flashcardsValue||e.value&&this.writeString(e.value)}leaf_sampleSolution(e,t,r){e.value&&(this.writeOPDOLLAR(),this.writeString(e.value),this.writeCL())}leaf_isShortAnswer(e,t,r){!1===e.value&&(this.writeOPA(),this.writeString("longAnswer"),this.writeCL())}leaf_src1x(e,t,r){this.writeProperty("src1x",e.value)}leaf_src2x(e,t,r){this.writeProperty("src2x",e.value)}leaf_src3x(e,t,r){this.writeProperty("src3x",e.value)}leaf_src4x(e,t,r){this.writeProperty("src4x",e.value)}leaf_width(e,t,r){this.writeProperty("width",e.value)}leaf_height(e,t,r){this.writeProperty("height",e.value)}leaf_alt(e,t,r){this.writeProperty("alt",e.value)}leaf_license(e,t,r){this.writeProperty("license",e.value)}leaf_copyright(e,t,r){this.writeProperty("copyright",e.value)}leaf_provider(e,t,r){}leaf_showInIndex(e,t,r){this.writeProperty("showInIndex",e.value)}leaf_caption(e,t,r){const i=e.value;this.writeProperty("caption",i)}leaf_duration(e,t,r){(null==t?void 0:t.key)!==s.NodeType.bitsValue&&this.writeProperty("duration",e.value)}leaf_mute(e,t,r){this.writeProperty("mute",e.value)}leaf_autoplay(e,t,r){this.writeProperty("autoplay",e.value)}leaf_allowSubtitles(e,t,r){this.writeProperty("allowSubtitles",e.value)}leaf_showSubtitles(e,t,r){this.writeProperty("showSubtitles",e.value)}generatePropertyHandlers(){var e;for(const t of c.PropertyKey.values()){const r=null!==(e=c.PropertyKey.getMetadata(c.PropertyKey.fromValue(t)))&&void 0!==e?e:{},i=r.astKey?r.astKey:t,o=`enter_${i}`;i!==c.PropertyKey.example&&(i!==c.PropertyKey.labelTrue&&i!==c.PropertyKey.labelFalse&&i!==c.PropertyKey.posterImage&&i!==c.PropertyKey.partner&&(this[o]=(e,i,o)=>{null!=e.value&&(null==i?void 0:i.key)===s.NodeType.bitsValue&&this.writeProperty(t,e.value,r.isSingle,r.ignoreFalse,r.ignoreTrue)},this[o]=this[o].bind(this)))}}writeString(e){null!=e&&this.write(`${e}`)}writeOPBUL(){this.write("[•")}writeOPESC(){this.write("[^")}writeOPRANGLE(){this.write("[►")}writeOPDANGLE(){this.write("[▼")}writeOPD(){this.write("[.")}writeOPU(){this.write("[_")}writeOPE(){this.write("[=")}writeOPB(){this.write("[!")}writeOPQ(){this.write("[?")}writeOPA(){this.write("[@")}writeOPP(){this.write("[+")}writeOPM(){this.write("[-")}writeOPS(){this.write("[\\")}writeOPR(){this.write("[*")}writeOPC(){this.write("[%")}writeOPAMP(){this.write("[&")}writeOPDOLLAR(){this.write("[$")}writeOPHASH(){this.write("[#")}writeOPPRE(){this.write("['")}writeOPPOST(){this.write("[")}writeOP(){this.write("[")}writeCL(){this.write("]")}writeAmpersand(){this.write("&")}writeColon(){this.write(":")}writeHash(){this.write("#")}writeCardSetStart(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetEnd(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("==="):this.write("~~~~")}writeCardSetCardDivider(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetSideDivider(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("=="):this.write("--")}writeCardSetVariantDivider(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("--"):this.write("++")}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeResource(e){const t=e;if(e)if(e.type===d.ResourceType.stillImageFilm){const t=e;this.writeResource(t.image),this.writeNL(),this.writeResource(t.audio)}else this.writeOPAMP(),this.writeString(e.type),e.type===d.ResourceType.article&&t.value?(this.writeColon(),this.writeString(t.value),this.writeNL()):e.value&&(this.writeColon(),this.writeString(e.value)),this.writeCL()}writeProperty(e,t,r,i,o){let s,n=!1;if(void 0!==t&&(s=Array.isArray(t)?t:[t],s.length>0)){r&&(s=s.slice(s.length-1));for(const t of s)if(void 0!==t){if(i&&!1===t)continue;if(o&&!0===t)continue;this.writeOPA(),this.writeString(e),this.writeColon(),this.writeString(`${t}`),this.writeCL(),n=!0}}n||(this.skipNLBetweenBitsValue=!0)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}isWriteTextFormat(e){return!!(!(p.TextFormat.fromValue(e)===p.TextFormat.bitmarkMinusMinus)||this.options.explicitTextFormat)}isRootBitType1(e){return this.isRootBitType(e,n.RootBitType.trueFalse1)||this.isRootBitType(e,n.RootBitType.multipleChoice1)||this.isRootBitType(e,n.RootBitType.multipleResponse1)}isRootBitType(e,t){const r=this.getBitType(e);return(null==r?void 0:r.root)===t}getBitType(e){for(const t of e)if(t.key===s.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getParentNode(e,t=1){if(e.length>t+1)return e[e.length-t-1]}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}}},8582:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkStringGenerator=void 0;const o=r(227),s=r(297);t.BitmarkStringGenerator=class{constructor(e){this.writer=new o.StringWriter,this.generator=new s.BitmarkGenerator(this.writer,e)}generate(e){return i(this,void 0,void 0,(function*(){return yield this.generator.generate(e),this.writer.getString()}))}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}}},3857:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))},o=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonGenerator=void 0;const s=r(8256),n=r(549),a=r(208),l=r(8791),u=r(1060),c=r(7028),d=r(4719),p=r(1895),h=r(1353),y=r(406),g=r(7646),f=r(672),m=r(3633),b=r(169),v={};t.JsonGenerator=class{constructor(e,t){var r;this.ast=new s.Ast,this.textParser=new y.TextParser,this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault="",this.bodyDefault="",this.printed=!1,this.bitmarkVersion=null!==(r=l.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:l.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},v),null==t?void 0:t.jsonOptions),this.jsonPrettifySpace=!0===this.options.prettify?2:this.options.prettify||void 0,this.bitmarkVersion===l.BitmarkVersion.v2?void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!0):void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!1),this.writer=e,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this),this.generatePropertyHandlers()}generate(e){return i(this,void 0,void 0,(function*(){this.resetState(),yield this.writer.open(),this.walkAndWrite(e),this.write(JSON.stringify(this.json,null,this.jsonPrettifySpace)),yield this.writer.close()}))}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault=this.options.textAsPlainText?"":[],this.bodyDefault=this.options.textAsPlainText?"":[],this.printed=!1}walkAndWrite(e){this.ast.walk(e,n.NodeType.bitmarkAst,this,void 0)}enter(e,t,r){let i;const o=this,s=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[s]&&(i=o[s](e,t,r)),i}between(e,t,r,i,o){let s;const n=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof n[a]&&(s=n[a](e,t,r,i,o)),s}exit(e,t,r){const i=this,o=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof i[o]&&i[o](e,t,r)}leaf(e,t,r){const i=this,o=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[o]&&i[o](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_bitmarkAst(e,t,r){this.json=[]}enter_bitsValue(e,t,r){var i,o,s;const n=e.value;this.bitWrapperJson={},this.json.push(this.bitWrapperJson),this.bitJson=this.createBitJson(n),this.bitWrapperJson.bit=this.bitJson;const l=a.RootBitType.getMetadata(n.bitType.root),u=!!(null==l?void 0:l.rootExampleType),d=(null==l?void 0:l.rootExampleType)===c.ExampleType.boolean;if(u){let e;d?(e=!0,n.bitType.root===a.RootBitType.trueFalse1&&void 0!==(null===(o=null===(i=n.cardNode)||void 0===i?void 0:i.statement)||void 0===o?void 0:o.isCorrect)&&(e=n.cardNode.statement.isCorrect)):e=null!==(s=g.ArrayUtils.asSingle(n.sampleSolution))&&void 0!==s?s:"";const t=this.toExample(n,{defaultExample:e,isBoolean:d});this.bitJson.isExample=t.isExample,this.bitJson.example=t.example}else n.isExample&&(this.bitJson.isExample=!0)}exit_bitsValue(e,t,r){this.cleanAndSetDefaultsForBitJson(this.bitJson)}enter_partner(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==n.NodeType.bitsValue)return;const{name:o,avatarImage:s}=i,a={};if(this.addProperty(a,"name",null!=o?o:"",!0),s){const e=this.parseResourceToJson(s);e&&e.type===p.ResourceType.image&&(a.avatarImage=e.image)}this.bitJson.partner=a}enter_markConfigValue(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==n.NodeType.markConfig)return;const{mark:o,color:s,emphasis:a}=i,l={};this.addProperty(l,"mark",null!=o?o:"unknown",!0),s&&this.addProperty(l,"color",null!=s?s:"",!0),a&&this.addProperty(l,"emphasis",null!=a?a:"",!0),this.bitJson.marks||(this.bitJson.marks=[]),this.bitJson.marks.push(l)}enter_sampleSolution(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"sampleSolution",e.value,!0)}enter_itemLead(e,t,r){const i=e.value,{item:o,lead:s}=i;(null==t?void 0:t.key)===n.NodeType.bitsValue&&(null!=o&&(this.bitJson.item=this.toTextAstOrString(o)),null!=s&&(this.bitJson.lead=this.toTextAstOrString(s)))}enter_extraProperties(e,t,r){const i=e.value;if(!this.options.excludeUnknownProperties&&i)for(const[e,t]of Object.entries(i)){let r=e;Object.prototype.hasOwnProperty.call(this.bitJson,e)&&(r=`_${e}`),this.addProperty(this.bitJson,r,t)}}enter_bodyParts(e,t,r){const i=e.value,o=this.options.textAsPlainText,s=this.getTextFormat(r);let n="",a=0;null==this.bitJson.body&&(this.bitJson.body=this.bodyDefault);const l=e=>({legacyPlaceholderKey:`{${e}}`,placeholderKey:`[!${e}]`});for(let e=0;e<i.length;e++){const t=i[e];if(t.type===u.BodyBitType.text){n+=t.data.bodyText}else{const{legacyPlaceholderKey:e,placeholderKey:t}=l(a);n+=o?e:t,a++}}this.bitJson.body=this.toTextAstOrString(n,s);const c=this.bitJson.body;a=0;for(let e=0;e<i.length;e++){const t=i[e];if(t.type===u.BodyBitType.text)continue;const r=t;let s;const{legacyPlaceholderKey:n}=l(a);switch(t.type){case u.BodyBitType.gap:{const e=r;s=this.createGapJson(e);break}case u.BodyBitType.mark:{const e=r;s=this.createMarkJson(e);break}case u.BodyBitType.select:{const e=r;s=this.createSelectJson(e);break}case u.BodyBitType.highlight:{const e=r;s=this.createHighlightJson(e);break}}s&&(o?(this.bitJson.placeholders||(this.bitJson.placeholders={}),this.bitJson.placeholders[n]=s):this.replacePlaceholderWithBodyBit(c,s,a)),a++}return!1}enter_elements(e,t,r){const i=e.value;i&&i.length>0&&(this.bitJson.elements=i)}enter_flashcards(e,t,r){var i,o,s,a;const l=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const u=[];if(l)for(const e of l){const t=Object.assign(Object.assign({question:null!==(i=e.question)&&void 0!==i?i:"",answer:null!==(o=e.answer)&&void 0!==o?o:"",alternativeAnswers:null!==(s=e.alternativeAnswers)&&void 0!==s?s:[]},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:e.isDefaultExample,isBoolean:!0}));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.cards=u)}enter_statement(e,t,r){var i,o;const s=e.value;(null==t?void 0:t.key)===n.NodeType.cardNode&&s&&(this.bitJson.statement=null!==(i=s.text)&&void 0!==i?i:"",this.bitJson.isCorrect=null!==(o=s.isCorrect)&&void 0!==o&&o)}enter_statements(e,t,r){var i,o,s;const a=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const l=[];if(a)for(const e of a){const t=Object.assign(Object.assign({statement:null!==(i=e.text)&&void 0!==i?i:"",isCorrect:!!e.isCorrect},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(o=e.itemLead)||void 0===o?void 0:o.item)&&delete t.item,null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,null==(null==e?void 0:e.hint)&&delete t.hint,null==(null==e?void 0:e.instruction)&&delete t.instruction,l.push(t)}l.length>0&&(this.bitJson.statements=l)}enter_choices(e,t,r){var i,o,s;const a=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const l=[];if(a)for(const e of a){const t=Object.assign(Object.assign({choice:null!==(i=e.text)&&void 0!==i?i:"",isCorrect:null!==(o=e.isCorrect)&&void 0!==o&&o},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,l.push(t)}l.length>0&&(this.bitJson.choices=l)}enter_responses(e,t,r){var i,o,s;const a=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const l=[];if(a)for(const e of a){const t=Object.assign(Object.assign({response:null!==(i=e.text)&&void 0!==i?i:"",isCorrect:null!==(o=e.isCorrect)&&void 0!==o&&o},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,l.push(t)}l.length>0&&(this.bitJson.responses=l)}enter_quizzes(e,t,r){var i,o,s,n,a,l,u,c;const d=e.value,p=[];if(d)for(const e of d){const t=[];if(e.choices)for(const r of e.choices){const n=Object.assign(Object.assign({choice:null!==(i=r.text)&&void 0!==i?i:"",isCorrect:null!==(o=r.isCorrect)&&void 0!==o&&o},this.toItemLeadHintInstruction(r)),this.toExample(r,{defaultExample:!!r.isCorrect,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete n.lead,t.push(n)}const r=[];if(e.responses)for(const t of e.responses){const i=Object.assign(Object.assign({response:null!==(n=t.text)&&void 0!==n?n:"",isCorrect:null!==(a=t.isCorrect)&&void 0!==a&&a},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!!t.isCorrect,isBoolean:!0}));null==(null===(l=e.itemLead)||void 0===l?void 0:l.lead)&&delete i.lead,r.push(i)}const d=Object.assign(Object.assign({},this.toItemLeadHintInstruction(e)),{isExample:null!==(u=e.isExample)&&void 0!==u&&u,choices:e.choices?t:void 0,responses:e.responses?r:void 0});null==(null===(c=e.itemLead)||void 0===c?void 0:c.lead)&&delete d.lead,p.push(d)}p.length>0&&(this.bitJson.quizzes=p)}enter_heading(e,t,r){var i,o;const s=e.value;let n=!1;if(s&&s.forKeys&&(n=!0),!n)return!1;const a={forKeys:null!==(i=s.forKeys)&&void 0!==i?i:""};Array.isArray(s.forValues)?s.forValues.length>1?a.forValues=s.forValues:1===s.forValues.length?a.forValues=s.forValues[0]:a.forValues=s.forValues:a.forValues=null!==(o=s.forValues)&&void 0!==o?o:"",this.bitJson.heading=a}enter_pairs(e,t,r){var i,o,s,n,a;const l=e.value,u=[];if(l)for(const e of l){const t=Array.isArray(e.values)&&e.values.length>0&&e.values[0],r=Object.assign(Object.assign(Object.assign({key:null!==(i=e.key)&&void 0!==i?i:"",keyAudio:e.keyAudio?this.addAudioResource(e.keyAudio):void 0,keyImage:e.keyImage?this.addImageResource(e.keyImage):void 0,values:null!==(o=e.values)&&void 0!==o?o:[]},this.toItemLeadHintInstruction(e)),{isCaseSensitive:null===(s=e.isCaseSensitive)||void 0===s||s,isLongAnswer:null!==(n=!e.isShortAnswer)&&void 0!==n&&n}),this.toExample(e,{defaultExample:t,isBoolean:!1}));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete r.lead,r.key&&(delete r.keyAudio,delete r.keyImage),null!=r.keyAudio&&(delete r.key,delete r.keyImage),null!=r.keyImage&&(delete r.key,delete r.keyAudio),u.push(r)}u.length>0&&(this.bitJson.pairs=u)}enter_matrix(e,t,r){var i,o,s,n,a,l,u;const c=e.value,d=[];if(c)for(const e of c){const t=[];if(e.cells)for(const r of e.cells){const e=Array.isArray(r.values)&&r.values.length>0&&r.values[0],s=Object.assign(Object.assign({values:null!==(i=r.values)&&void 0!==i?i:[]},this.toItemLeadHintInstruction(r)),this.toExample(r,{defaultExample:e,isBoolean:!1}));null==(null===(o=r.itemLead)||void 0===o?void 0:o.lead)&&delete s.lead,null==r.hint&&delete s.hint,t.push(s)}const r=Object.assign(Object.assign({key:null!==(s=e.key)&&void 0!==s?s:"",cells:null!=t?t:[]},this.toItemLeadHintInstruction(e)),{isCaseSensitive:null===(n=e.isCaseSensitive)||void 0===n||n,isLongAnswer:null!==(a=!e.isShortAnswer)&&void 0!==a&&a,isExample:null!==(l=e.isExample)&&void 0!==l&&l});null==(null===(u=e.itemLead)||void 0===u?void 0:u.lead)&&delete r.lead,null==e.instruction&&delete r.instruction,d.push(r)}d.length>0&&(this.bitJson.matrix=d)}enter_questions(e,t,r){var i,o,s,n,a;const l=e.value,u=[];if(l)for(const e of l){const t=Object.assign(Object.assign(Object.assign({question:null!==(i=e.question)&&void 0!==i?i:"",partialAnswer:null!==(o=g.ArrayUtils.asSingle(e.partialAnswer))&&void 0!==o?o:"",sampleSolution:null!==(s=e.sampleSolution)&&void 0!==s?s:""},this.toItemLeadHintInstruction(e)),{isShortAnswer:null===(n=e.isShortAnswer)||void 0===n||n}),this.toExample(e,{defaultExample:e.sampleSolution||"",isBoolean:!1}));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.questions=u)}enter_botResponses(e,t,r){var i,o,s,a;const l=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const u=[];if(l)for(const e of l){const t=Object.assign({response:null!==(i=e.response)&&void 0!==i?i:"",reaction:null!==(o=e.reaction)&&void 0!==o?o:"",feedback:null!==(s=e.feedback)&&void 0!==s?s:""},this.toItemLeadHintInstruction(e));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete t.lead,null==e.hint&&delete t.hint,delete t.instruction,u.push(t)}u.length>0&&(this.bitJson.responses=u)}enter_resource(e,t,r){const i=e.value;this.bitJson.resource=this.parseResourceToJson(i)}leaf_title(e,t,r){this.bitJson.title=this.toTextAstOrString(e.value)}leaf_subtitle(e,t,r){this.bitJson.subtitle=this.toTextAstOrString(e.value)}leaf_level(e,t,r){var i;null!=e.value&&this.addProperty(this.bitJson,"level",null!==(i=e.value)&&void 0!==i?i:1,!0)}leaf_book(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"book",e.value,!0)}leaf_anchor(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"anchor",e.value,!0)}leaf_reference(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"reference",e.value,!0)}leaf_referenceEnd(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"referenceEnd",e.value,!0)}leaf_hint(e,t,r){const i=e.value;(null==t?void 0:t.key)===n.NodeType.bitsValue&&(this.bitJson.hint=this.toTextAstOrString(i))}leaf_instruction(e,t,r){const i=e.value;(null==t?void 0:t.key)===n.NodeType.bitsValue&&(this.bitJson.instruction=this.toTextAstOrString(i))}leaf_footerText(e,t,r){const i=e.value;this.bitJson.footer=this.toTextAstOrString(i)}leaf_markup(e,t,r){const i=e.value;i&&(this.bitWrapperJson.bitmark=i)}enter_parser(e,t,r){const i=e.value;if(i){const{version:e,excessResources:r,warnings:s,errors:a}=i,l=o(i,["version","excessResources","warnings","errors"]),u=`${this.bitmarkVersion}`;let c;if(Array.isArray(r)&&r.length>0){c=[];for(const e of r){const t=this.parseResourceToJson(e);t&&c.push(t)}}(null==t?void 0:t.key)===n.NodeType.bitsValue&&(this.bitWrapperJson.parser=Object.assign(Object.assign({version:e,bitmarkVersion:u},l),{warnings:s,errors:a,excessResources:c}),this.options.enableWarnings||delete this.bitWrapperJson.parser.warnings)}}generatePropertyHandlers(){var e;for(const t of d.PropertyKey.values()){const r=d.PropertyKey.fromValue(t),i=null!==(e=d.PropertyKey.getMetadata(r))&&void 0!==e?e:{},o=i.astKey?i.astKey:t,s=`enter_${o}`;o!==d.PropertyKey.example&&(o!==d.PropertyKey.partner&&(this[s]=(e,r,o)=>{const s=e.value;if(null==s)return;if((null==r?void 0:r.key)!==n.NodeType.bitsValue)return;let a=t;i.jsonKey&&(a=i.jsonKey),this.addProperty(this.bitJson,a,s,i.isSingle)},this[s]=this[s].bind(this)))}}createGapJson(e){var t;const r=e.data,i=r.solutions&&r.solutions.length>0?r.solutions[0]:"",o=Object.assign(Object.assign(Object.assign(Object.assign({type:"gap"},this.toItemLeadHintInstruction(r)),{isCaseSensitive:null===(t=r.isCaseSensitive)||void 0===t||t}),this.toExample(r,{defaultExample:i,isBoolean:!1})),{solutions:r.solutions});return o.lead||delete o.lead,o}createMarkJson(e){const t=e.data,r=Object.assign(Object.assign({type:"mark",solution:t.solution,mark:t.mark},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!0,isBoolean:!0}));return r.lead||delete r.lead,r}createSelectJson(e){var t,r,i,o;const s=e.data,n=[];for(const e of s.options){const r=Object.assign(Object.assign({text:e.text,isCorrect:null!==(t=e.isCorrect)&&void 0!==t&&t},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));r.item||delete r.item,r.lead||delete r.lead,r.instruction||delete r.instruction,r.isCaseSensitive||delete r.isCaseSensitive,n.push(r)}const a=Object.assign(Object.assign({type:"select",prefix:null!==(r=s.prefix)&&void 0!==r?r:"",postfix:null!==(i=s.postfix)&&void 0!==i?i:""},this.toItemLeadHintInstruction(s)),{isExample:null!==(o=s.isExample)&&void 0!==o&&o,options:n});return a.lead||delete a.lead,a}createHighlightJson(e){var t,r,i,o,s;const n=e.data,a=[];for(const e of n.texts){const i=Object.assign(Object.assign({text:e.text,isCorrect:null!==(t=e.isCorrect)&&void 0!==t&&t,isHighlighted:null!==(r=e.isHighlighted)&&void 0!==r&&r},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));i.item||delete i.item,i.lead||delete i.lead,i.hint||delete i.hint,i.isCaseSensitive||delete i.isCaseSensitive,a.push(i)}const l=Object.assign(Object.assign({type:"highlight",prefix:null!==(i=n.prefix)&&void 0!==i?i:"",postfix:null!==(o=n.postfix)&&void 0!==o?o:""},this.toItemLeadHintInstruction(n)),{isExample:null!==(s=n.isExample)&&void 0!==s&&s,texts:a});return l.lead||delete l.lead,l}parseResourceToJson(e){if(!e)return;let t;switch(e.type){case p.ResourceType.image:t={type:p.ResourceType.image,image:this.addImageResource(e)};break;case p.ResourceType.imageLink:t={type:p.ResourceType.imageLink,imageLink:this.addImageLinkResource(e)};break;case p.ResourceType.audio:t={type:p.ResourceType.audio,audio:this.addAudioResource(e)};break;case p.ResourceType.audioEmbed:t={type:p.ResourceType.audioEmbed,audioEmbed:this.addAudioEmbedResource(e)};break;case p.ResourceType.audioLink:t={type:p.ResourceType.audioLink,audioLink:this.addAudioLinkResource(e)};break;case p.ResourceType.video:t={type:p.ResourceType.video,video:this.addVideoResource(e)};break;case p.ResourceType.videoEmbed:t={type:p.ResourceType.videoEmbed,videoEmbed:this.addVideoEmbedResource(e)},t.videoEmbed=this.addVideoLinkResource(e);break;case p.ResourceType.videoLink:t={type:p.ResourceType.videoLink,videoLink:this.addVideoLinkResource(e)};break;case p.ResourceType.stillImageFilm:{const r=e;null!=r.image.value&&null!=r.audio.value&&(t={type:p.ResourceType.stillImageFilm,image:this.addImageResource(r.image),audio:this.addAudioResource(r.audio)});break}case p.ResourceType.stillImageFilmEmbed:t={type:p.ResourceType.stillImageFilmEmbed,stillImageFilmEmbed:this.addStillImageFilmEmbedResource(e)};break;case p.ResourceType.stillImageFilmLink:t={type:p.ResourceType.stillImageFilmLink,stillImageFilmLink:this.addStillImageFilmLinkResource(e)};break;case p.ResourceType.article:t={type:p.ResourceType.article,article:this.addArticleResource(e)};break;case p.ResourceType.document:t={type:p.ResourceType.document,document:this.addDocumentResource(e)};break;case p.ResourceType.documentEmbed:t={type:p.ResourceType.documentEmbed,documentEmbed:this.addDocumentEmbedResource(e)};break;case p.ResourceType.documentLink:t={type:p.ResourceType.documentLink,documentLink:this.addDocumentLinkResource(e)};break;case p.ResourceType.documentDownload:t={type:p.ResourceType.documentDownload,documentDownload:this.addDocumentDownloadResource(e)};break;case p.ResourceType.appLink:t={type:p.ResourceType.appLink,appLink:this.addAppLinkResource(e)};break;case p.ResourceType.websiteLink:t={type:p.ResourceType.websiteLink,websiteLink:this.addWebsiteLinkResource(e)}}return t}addImageResource(e){var t,r,i;const o={};if(m.StringUtils.isString(e)){const t=e;e={type:p.ResourceType.image,value:t,format:b.UrlUtils.fileExtensionFromUrl(t),provider:b.UrlUtils.domainFromUrl(t)}}return null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.src=e.value),null!=e.src1x&&(o.src1x=e.src1x),null!=e.src2x&&(o.src2x=e.src2x),null!=e.src3x&&(o.src3x=e.src3x),null!=e.src4x&&(o.src4x=e.src4x),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,o.alt=null!==(i=e.alt)&&void 0!==i?i:"",this.addGenericResourceProperties(e,o),o}addImageLinkResource(e){var t,r,i;const o={};if(m.StringUtils.isString(e)){const t=e;e={type:p.ResourceType.imageLink,value:t,format:b.UrlUtils.fileExtensionFromUrl(t),provider:b.UrlUtils.domainFromUrl(t)}}return null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.url=e.value),null!=e.src1x&&(o.src1x=e.src1x),null!=e.src2x&&(o.src2x=e.src2x),null!=e.src3x&&(o.src3x=e.src3x),null!=e.src4x&&(o.src4x=e.src4x),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,o.alt=null!==(i=e.alt)&&void 0!==i?i:"",this.addGenericResourceProperties(e,o),o}addAudioResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.src=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t),t}addAudioEmbedResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.src=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t),t}addAudioLinkResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t,!0),t}addVideoResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.src=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addVideoEmbedResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.src=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addVideoLinkResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.url=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addStillImageFilmEmbedResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.url=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addStillImageFilmLinkResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.url=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addArticleResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.body=e.value),this.addGenericResourceProperties(e,t),t}addDocumentResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentEmbedResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentLinkResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentDownloadResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addAppLinkResource(e){const t={};return null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addWebsiteLinkResource(e){const t={};return null!=e.value&&(t.url=e.value),null!=e.siteName&&(t.siteName=e.siteName),this.addGenericResourceProperties(e,t),t}addGenericResourceProperties(e,t,r){var i,o,s,n,a,l,u,c;return r?(null!=e.license&&(t.license=null!==(i=e.license)&&void 0!==i?i:""),null!=e.copyright&&(t.copyright=null!==(o=e.copyright)&&void 0!==o?o:""),null!=e.provider&&(t.provider=e.provider),null!=e.showInIndex&&(t.showInIndex=null!==(s=e.showInIndex)&&void 0!==s&&s),null!=e.caption&&(t.caption=this.toTextAstOrString(null!==(n=e.caption)&&void 0!==n?n:""))):(t.license=null!==(a=e.license)&&void 0!==a?a:"",t.copyright=null!==(l=e.copyright)&&void 0!==l?l:"",null!=e.provider&&(t.provider=e.provider),t.showInIndex=null!==(u=e.showInIndex)&&void 0!==u&&u,t.caption=this.toTextAstOrString(null!==(c=e.caption)&&void 0!==c?c:"")),t}toItemLeadHintInstruction(e){var t,r,i,o,s,n;return{item:this.toTextAstOrString(null!==(r=null===(t=e.itemLead)||void 0===t?void 0:t.item)&&void 0!==r?r:""),lead:this.toTextAstOrString(null!==(o=null===(i=e.itemLead)||void 0===i?void 0:i.lead)&&void 0!==o?o:""),hint:this.toTextAstOrString(null!==(s=e.hint)&&void 0!==s?s:""),instruction:this.toTextAstOrString(null!==(n=e.instruction)&&void 0!==n?n:"")}}toExample(e,t){const{isExample:r,example:i,isDefaultExample:o}=e,{defaultExample:s,isBoolean:n}=t;if(!r)return{isExample:!1,example:null};let a;return a=o?n?f.BooleanUtils.toBoolean(s):this.toTextAstOrString(s):n?f.BooleanUtils.toBoolean(i):this.toTextAstOrString(i),{isExample:!0,example:a}}addProperty(e,t,r,i){void 0!==r&&(Array.isArray(r)||(r=[r]),Array.isArray(r)&&r.length>0&&(i&&r.length>=1?e[t]=r[r.length-1]:e[t]=r))}getBitType(e){for(const t of e)if(t.key===n.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getTextFormat(e){for(const t of e)if(t.key===n.NodeType.bitsValue){const e=t.value;return h.TextFormat.fromValue(null==e?void 0:e.textFormat)}}toTextAstOrString(e,t=h.TextFormat.bitmarkMinusMinus){if(this.options.textAsPlainText)return e;return this.textParser.toAst(e,{textFormat:t})}replacePlaceholderWithBodyBit(e,t,r){const i=(e,o,s)=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){const r=e[t];if(i(r,e,t))return!0}else{if("bit"===e.type&&e.index===r)return o[s]=t,!0;if(e.content){if(i(e.content,e,"content"))return!0}}return!1};i(e,null,null)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}writeString(e){null!=e&&this.write(`${e}`)}createBitJson(e){return{type:e.bitType.alias,format:e.textFormat,id:void 0,externalId:void 0,spaceId:void 0,padletId:void 0,AIGenerated:void 0,releaseVersion:void 0,book:void 0,ageRange:void 0,language:void 0,computerLanguage:void 0,target:void 0,tag:void 0,icon:void 0,iconTag:void 0,colorTag:void 0,subtype:void 0,coverImage:void 0,publisher:void 0,publications:void 0,author:void 0,subject:void 0,date:void 0,location:void 0,theme:void 0,kind:void 0,action:void 0,thumbImage:void 0,focusX:void 0,focusY:void 0,deeplink:void 0,externalLink:void 0,externalLinkText:void 0,videoCallLink:void 0,duration:void 0,list:void 0,textReference:void 0,isTracked:void 0,isInfoOnly:void 0,labelTrue:void 0,labelFalse:void 0,quotedPerson:void 0,partialAnswer:void 0,title:void 0,subtitle:void 0,level:void 0,toc:void 0,progress:void 0,anchor:void 0,reference:void 0,referenceEnd:void 0,item:void 0,lead:void 0,hint:void 0,instruction:void 0,isExample:void 0,example:void 0,partner:void 0,marks:void 0,extraProperties:void 0,body:void 0,resource:void 0,statement:void 0,isCorrect:void 0,sampleSolution:void 0,elements:void 0,statements:void 0,responses:void 0,quizzes:void 0,heading:void 0,pairs:void 0,matrix:void 0,choices:void 0,questions:void 0,placeholders:void 0,footer:void 0}}cleanAndSetDefaultsForBitJson(e){const t=a.BitTypeUtils.getBitType(e.type),r=this.options.textAsPlainText;switch(e.item||(e.item=void 0),t.root){case a.RootBitType._error:break;case a.RootBitType.article:case a.RootBitType.sampleSolution:null==e.body&&(e.body=this.bodyDefault);break;default:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.body&&(e.body=this.bodyDefault),t.alias!==a.AliasBitType.articleAi&&t.alias!==a.AliasBitType.noteAi&&t.alias!==a.AliasBitType.summaryAi||null==e.AIGenerated&&(e.AIGenerated=!0);break;case a.RootBitType.cloze:case a.RootBitType.multipleChoice1:case a.RootBitType.multipleResponse1:case a.RootBitType.multipleChoiceText:case a.RootBitType.highlightText:case a.RootBitType.clozeAndMultipleChoiceText:case a.RootBitType.sequence:case a.RootBitType.mark:case a.RootBitType.flashcard:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.multipleChoice:case a.RootBitType.multipleResponse:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault);break;case a.RootBitType.essay:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.body&&(e.body=this.bodyDefault),null==e.partialAnswer&&(e.partialAnswer="");break;case a.RootBitType.trueFalse1:null==e.item&&(e.item=this.textDefault),null==e.lead&&(e.lead=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.isCorrect&&(e.isCorrect=!1),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.trueFalse:null==e.item&&(e.item=this.textDefault),null==e.lead&&(e.lead=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.labelFalse&&(e.labelFalse=""),null==e.labelTrue&&(e.labelTrue=""),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.chapter:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.toc&&(e.toc=!0),null==e.progress&&(e.progress=!0),null==e.level&&(e.level=1),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.interview:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault),null==e.questions&&(e.questions=[]);break;case a.RootBitType.match:null==e.item&&(e.item=this.textDefault),null==e.heading&&(e.heading={}),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.matchMatrix:null==e.item&&(e.item=this.textDefault),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.learningPathBook:case a.RootBitType.learningPathExternalLink:case a.RootBitType.learningPathVideoCall:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.isTracked&&(e.isTracked=!0),null==e.isInfoOnly&&(e.isInfoOnly=!1),null==e.body&&(e.body=this.bodyDefault)}return null==e.id&&delete e.id,null==e.externalId&&delete e.externalId,null==e.spaceId&&delete e.spaceId,null==e.padletId&&delete e.padletId,null==e.AIGenerated&&delete e.AIGenerated,null==e.releaseVersion&&delete e.releaseVersion,null==e.book&&delete e.book,null==e.ageRange&&delete e.ageRange,null==e.language&&delete e.language,null==e.computerLanguage&&delete e.computerLanguage,null==e.target&&delete e.target,null==e.tag&&delete e.tag,null==e.icon&&delete e.icon,null==e.iconTag&&delete e.iconTag,null==e.colorTag&&delete e.colorTag,null==e.subtype&&delete e.subtype,null==e.coverImage&&delete e.coverImage,null==e.publisher&&delete e.publisher,null==e.publications&&delete e.publications,null==e.author&&delete e.author,null==e.subject&&delete e.subject,null==e.date&&delete e.date,null==e.location&&delete e.location,null==e.theme&&delete e.theme,null==e.kind&&delete e.kind,null==e.action&&delete e.action,null==e.thumbImage&&delete e.thumbImage,null==e.deeplink&&delete e.deeplink,null==e.externalLink&&delete e.externalLink,null==e.externalLinkText&&delete e.externalLinkText,null==e.videoCallLink&&delete e.videoCallLink,null==e.duration&&delete e.duration,null==e.list&&delete e.list,null==e.textReference&&delete e.textReference,null==e.isTracked&&delete e.isTracked,null==e.isInfoOnly&&delete e.isInfoOnly,null==e.labelTrue&&delete e.labelTrue,null==e.labelFalse&&delete e.labelFalse,null==e.quotedPerson&&delete e.quotedPerson,null==e.title&&delete e.title,null==e.subtitle&&delete e.subtitle,null==e.level&&delete e.level,null==e.toc&&delete e.toc,null==e.progress&&delete e.progress,null==e.anchor&&delete e.anchor,null==e.reference&&delete e.reference,null==e.referenceEnd&&delete e.referenceEnd,null==e.item&&delete e.item,null==e.lead&&delete e.lead,null==e.hint&&delete e.hint,null==e.instruction&&delete e.instruction,void 0===e.example&&delete e.example,null==e.isExample&&delete e.isExample,null==e.marks&&delete e.marks,null==e.extraProperties&&delete e.extraProperties,null==e.body&&delete e.body,null!=e.placeholders&&0!==Object.keys(e.placeholders).length||delete e.placeholders,null==e.resource&&delete e.resource,null==e.statement&&delete e.statement,null==e.isCorrect&&delete e.isCorrect,null==e.sampleSolution&&delete e.sampleSolution,null==e.partialAnswer&&delete e.partialAnswer,null==e.elements&&delete e.elements,null==e.statements&&delete e.statements,null==e.responses&&delete e.responses,null==e.quizzes&&delete e.quizzes,null==e.heading&&delete e.heading,null==e.pairs&&delete e.pairs,null==e.matrix&&delete e.matrix,null==e.choices&&delete e.choices,null==e.questions&&delete e.questions,r&&null!=e.placeholders||delete e.placeholders,null==e.footer&&delete e.footer,e}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}}},4275:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonObjectGenerator=void 0;const o=r(227),s=r(3857);t.JsonObjectGenerator=class{constructor(e){this.writer=new o.StringWriter,this.generator=new s.JsonGenerator(this.writer,e)}generate(e){return i(this,void 0,void 0,(function*(){return yield this.generator.generate(e),JSON.parse(this.writer.getString())}))}generateSync(e){return this.generator.generateSync(e),JSON.parse(this.writer.getString())}}},5132:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonStringGenerator=void 0;const o=r(227),s=r(3857);t.JsonStringGenerator=class{constructor(e){this.writer=new o.StringWriter,this.generator=new s.JsonGenerator(this.writer,e)}generate(e){return i(this,void 0,void 0,(function*(){return yield this.generator.generate(e),this.writer.getString()}))}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}}},6300:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TextGenerator=void 0;const o=r(8256),s=r(549),n=r(8791),a=r(1353),l=r(1888),u=r(2610),c={debugGenerationInline:!1},d={[l.TextMarkType.bold]:"**",[l.TextMarkType.light]:"``",[l.TextMarkType.italic]:"__",[l.TextMarkType.highlight]:"!!"},p=new RegExp("([=*_`!])([\\^]*)\\1|([\\|\\[])","g"),h="$1$3^$2$1",y=new RegExp("^(\\||•|#)","gm"),g=new RegExp(/(\n|\r\n)/,"g"),f=new RegExp(/https?:\/\/|mailto:(.*)/,"g");t.TextGenerator=class{constructor(e,t){var r;this.ast=new o.Ast,this.textFormat=a.TextFormat.bitmarkMinusMinus,this.writerText="",this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.placeholderIndex=0,this.placeholders={},this.printed=!1,this.bitmarkVersion=null!==(r=n.BitmarkVersion.fromValue(e))&&void 0!==r?r:n.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},c),t),this.bitmarkVersion,n.BitmarkVersion.v2,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this)}generate(e,t){return i(this,void 0,void 0,(function*(){return this.resetState(t),this.walkAndWrite(e),this.writerText}))}generateSync(e,t){return this.resetState(t),this.walkAndWrite(e),this.writerText}getPlaceholders(){return this.placeholders}resetState(e){this.printed=!1,this.textFormat=null!=e?e:a.TextFormat.bitmarkMinusMinus,this.writerText="",this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.placeholderIndex=0,this.placeholders={}}walkAndWrite(e){this.ast.walk(e,s.NodeType.textAst,this,void 0)}enter(e,t,r){let i;const o=this,s=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[s]&&(i=o[s](e,t,r)),i}between(e,t,r,i,o){let s;const n=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof n[a]&&(s=n[a](e,t,r,i,o)),s}exit(e,t,r){const i=this,o=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof i[o]&&i[o](e,t,r)}leaf(e,t,r){const i=this,o=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[o]&&i[o](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_textAstValue(e,t,r){this.handleEnterNode(e.value)}between_textAstValue(e,t,r,i,o){this.handleBetweenNode(e.value)}exit_textAstValue(e,t,r){this.handleExitNode(e.value)}enter_contentValueValue(e,t,r){this.handleEnterNode(e.value)}between_contentValueValue(e,t,r,i,o){this.handleBetweenNode(e.value)}exit_contentValueValue(e,t,r){this.handleExitNode(e.value)}handleEnterNode(e){switch(this.handleIndent(e),e.type){case u.TextNodeType.paragraph:this.writeParagraph(e);break;case u.TextNodeType.hardBreak:this.writeHardBreak(e);break;case u.TextNodeType.text:this.writeMarks(e,!0),this.writeText(e);break;case u.TextNodeType.heading:this.writeHeading(e);break;case u.TextNodeType.section:this.writeSection(e);break;case u.TextNodeType.listItem:case u.TextNodeType.taskItem:this.writeBullet(e);break;case u.TextNodeType.image:this.writeImage(e);break;case u.TextNodeType.codeBlock:this.inCodeBlock=!0,this.writeCodeBlock(e);break;case u.TextNodeType.gap:case u.TextNodeType.select:case u.TextNodeType.highlight:this.writeBodyBit(e)}this.exitedCodeBlock=!1}handleBetweenNode(e){e.type}handleExitNode(e){switch(e.type){case u.TextNodeType.text:this.writeMarks(e,!1);break;case u.TextNodeType.paragraph:this.textFormat!==a.TextFormat.bitmarkMinusMinus&&this.writeNL();break;case u.TextNodeType.heading:case u.TextNodeType.section:case u.TextNodeType.image:this.writeNL(),this.writeNL();break;case u.TextNodeType.codeBlock:this.writeNL(),this.writeNL(),this.inCodeBlock=!1,this.exitedCodeBlock=!0;break;case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent<=1&&this.writeNL()}this.handleDedent(e)}handleIndent(e){switch(e.type){case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent++}}handleDedent(e){switch(e.type){case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent--}}getLinkHref(e){if(e.type===u.TextNodeType.text&&e.marks){const t=e.marks.reduce(((e,t)=>{var r;if(t.type===l.TextMarkType.link){const e=null===(r=t.attrs)||void 0===r?void 0:r.href;if(e)return e}return e}),"");if(t)return t}return!1}getIndentationString(){if(this.currentIndent===this.prevIndent)return this.indentationStringCache;let e="";for(let t=1;t<this.currentIndent;t++)e+="\t";return this.indentationStringCache=e,this.prevIndent=this.currentIndent,e}writeBodyBit(e){const t=`[!${this.placeholderIndex}]`;this.writerText+=t,this.placeholders[t]=e,this.placeholderIndex++}writeText(e){if(null==e.text)return;if(this.writeLink(e))return;const t=this.inCodeBlock;let r=e.text;if(r=t?r.replace(y,"$1^"):r.replace(p,h),this.currentIndent>1){const e=this.getIndentationString();r=r.replace(g,`$1${e}`)}this.write(r)}writeLink(e){if(null==e.text)return!1;const t=this.getLinkHref(e);if(t){let r=e.text.replace(p,h);if(this.currentIndent>1){const e=this.getIndentationString();r=r.replace(g,`$1${e}`)}return t.replace(f,"$1")===r?this.write(t):(r=`==${r}==|link:${t}|`,this.write(r)),!0}return!1}writeMarks(e,t){if(e.marks)for(const r of e.marks)switch(r.type){case l.TextMarkType.bold:case l.TextMarkType.light:case l.TextMarkType.italic:case l.TextMarkType.highlight:this.writeStandardMark(r);break;case l.TextMarkType.strike:case l.TextMarkType.sub:case l.TextMarkType.super:case l.TextMarkType.ins:case l.TextMarkType.del:case l.TextMarkType.var:case l.TextMarkType.code:case l.TextMarkType.color:this.writeInlineMark(r,t);break;case l.TextMarkType.comment:this.writeCommentMark(r,t);case l.TextMarkType.link:}}writeParagraph(e){this.exitedCodeBlock&&(this.write("|"),this.writeNL(),this.writeNL())}writeHardBreak(e){if(this.writeNL(),this.currentIndent>1){const e=this.getIndentationString();this.write(e)}}writeHeading(e){var t,r;let i="";const o=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.level)&&void 0!==r?r:1;for(let e=0;e<+o;e++)i+="#";i+=" ",this.write(i)}writeSection(e){let t="";t=e.section?`|${e.section}: `:"|",this.write(t)}writeBullet(e){var t,r;let i=this.getIndentationString();if(e.parent===u.TextNodeType.bulletList)i+="• ";else if(e.parent===u.TextNodeType.orderedList)i+="•1 ";else if(e.parent===u.TextNodeType.taskList){i+=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.checked)&&void 0!==r&&r?"•+ ":"•- "}i&&this.write(i)}writeImage(e){if(null==e.attrs||!e.attrs.src)return;const t=e.attrs;let r=`|image:${t.src}|`;for(const[e,i]of Object.entries(t))switch(e){case"textAlign":"left"!==i&&(r+=`@captionAlign:${i}|`);break;case"title":i&&(r+=`@caption:${i}|`);break;case"class":"center"!==i&&i&&(r+=`@align:${i}|`);break;case"comment":i&&(r+=`#${i}|`);break;case"alt":case"width":case"height":default:i&&(r+=`@${e}:${i}|`);case"src":}this.write(r)}writeCodeBlock(e){if(null==e.attrs||!e.attrs.language)return;const t=`|code:${e.attrs.language}\n`;this.write(t)}writeStandardMark(e){const t=d[e.type];t&&this.write(t)}writeInlineMark(e,t){if(t)this.write("==");else{let t=`==|${e.type}`;if(e.attrs)for(const[r,i]of Object.entries(e.attrs))("language"===r&&"plain text"!==i||"color"===r)&&(t=`${t}:${i}`);t=`${t}|`,this.write(t)}}writeCommentMark(e,t){if(t);else if(e.comment){const t=`#${e.comment}|`;this.write(t)}}writeString(e){null!=e&&this.write(`${e}`)}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}getBitType(e){for(const t of e)if(t.key===s.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}write(e){return this.writerText+=e,this}writeLine(e){return this.write(`${e}\n`),this}writeLines(e,t){for(const r of e)this.write(`${r}${null!=t?t:""}\n`);return this}writeWhiteSpace(){return this.write(" "),this}}},7087:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const i=r(1022),o=r(671);r(2093);let s=!1;t.init=function(){s||((0,o.initEnv)(i.buildInfo.name,i.buildInfo.version),s=!0)}},549:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeType=void 0;const i=(0,r(6688).superenum)({unknown:"unknown",bitType:"bitType",alias:"alias",root:"root",textFormat:"textFormat",bitmarkAst:"bitmarkAst",bits:"bits",bitsValue:"bitsValue",properties:"properties",property:"property",propertyValues:"propertyValues",itemLead:"itemLead",body:"body",bodyParts:"bodyParts",bodyPartsValue:"bodyPartsValue",bodyPartText:"bodyPartText",data:"data",bodyText:"bodyText",footer:"footer",footerText:"footerText",gap:"gap",select:"select",highlight:"highlight",cardNode:"cardNode",elements:"elements",solutions:"solutions",options:"options",optionsValue:"optionsValue",texts:"texts",textsValue:"textsValue",statement:"statement",statements:"statements",statementsValue:"statementsValue",choices:"choices",choicesValue:"choicesValue",responses:"responses",responsesValue:"responsesValue",quizzes:"quizzes",quizzesValue:"quizzesValue",heading:"heading",forValues:"forValues",pairs:"pairs",pairsValue:"pairsValue",values:"values",matrix:"matrix",matrixValue:"matrixValue",cells:"cells",cellsValue:"cellsValue",questions:"questions",questionsValue:"questionsValue",botResponses:"botResponses",botResponsesValue:"botResponsesValue",id:"id",idValue:"idValue",externalId:"externalId",externalIdValue:"externalIdValue",spaceId:"spaceId",spaceIdValue:"spaceIdValue",releaseVersion:"releaseVersion",releaseVersionValue:"releaseVersionValue",padletId:"padletId",padletIdValue:"padletIdValue",aiGenerated:"aiGenerated",aiGeneratedValue:"aiGeneratedValue",ageRange:"ageRange",ageRangeValue:"ageRangeValue",language:"language",languageValue:"languageValue",computerLanguage:"computerLanguage",computerLanguageValue:"computerLanguageValue",target:"target",targetValue:"targetValue",tag:"tag",tagValue:"tagValue",icon:"icon",iconValue:"iconValue",iconTag:"iconTag",iconTagValue:"iconTagValue",colorTag:"colorTag",colorTagValue:"colorTagValue",subtype:"subtype",subtypeValue:"subtypeValue",coverImage:"coverImage",coverImageValue:"coverImageValue",publisher:"publisher",publisherValue:"publisherValue",publications:"publications",publicationsValue:"publicationsValue",author:"author",authorValue:"authorValue",subject:"subject",subjectValue:"subjectValue",date:"date",dateValue:"dateValue",location:"location",locationValue:"locationValue",theme:"theme",themeValue:"themeValue",kind:"kind",kindValue:"kindValue",action:"action",actionValue:"actionValue",thumbImage:"thumbImage",thumbImageValue:"thumbImageValue",focusX:"focusX",focusXValue:"focusXValue",focusY:"focusY",focusYValue:"focusYValue",duration:"duration",durationValue:"durationValue",deeplink:"deeplink",deeplinkValue:"deeplinkValue",externalLink:"externalLink",externalLinkText:"externalLinkText",videoCallLink:"videoCallLink",videoCallLinkValue:"videoCallLinkValue",bot:"bot",botValue:"botValue",referenceProperty:"referenceProperty",referencePropertyValue:"referencePropertyValue",list:"list",listValue:"listValue",textReference:"textReference",textReferenceValue:"textReferenceValue",isTracked:"isTracked",isTrackedValue:"isTrackedValue",isInfoOnly:"isInfoOnly",isInfoOnlyValue:"isInfoOnlyValue",labelTrue:"labelTrue",labelFalse:"labelFalse",quotedPerson:"quotedPerson",partialAnswer:"partialAnswer",partialAnswerValue:"partialAnswerValue",book:"book",item:"item",lead:"lead",hint:"hint",instruction:"instruction",isDefaultExample:"isDefaultExample",isExample:"isExample",example:"example",exampleValue:"exampleValue",extraProperties:"extraProperties",title:"title",subtitle:"subtitle",level:"level",toc:"toc",tocValue:"tocValue",progress:"progress",progressValue:"progressValue",levelProperty:"levelProperty",levelPropertyValue:"LevelPropertyValue",anchor:"anchor",reference:"reference",referenceEnd:"referenceEnd",elementsValue:"elementsValue",solutionsValue:"solutionsValue",prefix:"prefix",postfix:"postfix",isCaseSensitive:"isCaseSensitive",isShortAnswer:"isShortAnswer",isCorrect:"isCorrect",forKeys:"forKeys",forValuesValue:"forValuesValue",key:"key",valuesValue:"valuesValue",question:"question",sampleSolution:"sampleSolution",sampleSolutionValue:"sampleSolutionValue",statementText:"statementText",text:"text",propertyKey:"propertyKey",propertyValue:"propertyValue",keyAudio:"keyAudio",keyImage:"keyImage",response:"response",reaction:"reaction",feedback:"feedback",partner:"partner",name:"name",avatarImage:"avatarImage",markConfig:"markConfig",markConfigValue:"markConfigValue",solution:"solution",mark:"mark",color:"color",emphasis:"emphasis",flashcards:"flashcards",flashcardsValue:"flashcardsValue",answer:"answer",alternativeAnswers:"alternativeAnswers",alternativeAnswersValue:"alternativeAnswersValue",resource:"resource",resourceType:"resourceType",image:"image",audio:"audio",type:"type",format:"format",value:"value",url:"url",src:"src",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",width:"width",height:"height",alt:"alt",license:"license",copyright:"copyright",provider:"provider",showInIndex:"showInIndex",caption:"caption",posterImage:"posterImage",thumbnails:"thumbnails",thumbnailsValue:"thumbnailsValue",textAst:"textAst",textAstValue:"textAstValue",content:"contentValue",contentValue:"contentValue",contentValueValue:"contentValueValue",attrs:"attrs",section:"section",parent:"parent",marks:"marks",marksValue:"marksValue",comment:"comment",parser:"parser",version:"version",bitmarkVersion:"bitmarkVersion",warnings:"warnings",warningsValue:"warningsValue",errors:"errors",errorsValue:"errorsValue",message:"message",start:"start",end:"end",offset:"offset",line:"line",column:"column",markup:"markup"});t.NodeType=i},9881:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INFINITE_COUNT=void 0;t.INFINITE_COUNT=-1},208:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitTypeUtils=t.AliasBitType=t.RootBitType=void 0;const i=r(6688),o=(0,i.superenum)({_error:"_error",appLink:"app-link",article:"article",articleEmbed:"article-embed",articleLink:"article-link",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",bitAlias:"bit-alias",book:"book",botActionResponse:"bot-action-response",botActionSend:"bot-action-send",browserImage:"browser-image",card1:"card-1",chapter:"chapter",cloze:"cloze",clozeAndMultipleChoiceText:"cloze-and-multiple-choice-text",code:"code",conversationLeft1:"conversation-left-1",document:"document",documentDownload:"document-download",documentEmbed:"document-embed",documentLink:"document-link",essay:"essay",example:"example",flashcard:"flashcard",focusImage:"focus-image",highlightText:"highlight-text",image:"image",imageLink:"image-link",internalLink:"internal-link",interview:"interview",learningPathBook:"learning-path-book",learningPathExternalLink:"learning-path-external-link",learningPathVideoCall:"learning-path-video-call",mark:"mark",match:"match",matchAudio:"match-audio",matchMatrix:"match-matrix",matchPicture:"match-picture",multipleChoice:"multiple-choice",multipleChoice1:"multiple-choice-1",multipleChoiceText:"multiple-choice-text",multipleResponse:"multiple-response",multipleResponse1:"multiple-response-1",photo:"photo",quote:"quote",rating:"rating",releaseNote:"release-note",sampleSolution:"sample-solution",screenshot:"screenshot",sequence:"sequence",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",survey:"survey",surveyAnonymous:"survey-anonymous",toc:"toc",trueFalse:"true-false",trueFalse1:"true-false-1",vendorPadletEmbed:"vendor-padlet-embed",video:"video",videoEmbed:"video-embed",videoLink:"video-link",websiteLink:"website-link"});t.RootBitType=o;const s=(0,i.superenum)({aiPrompt:"ai-prompt",anchor:"anchor",appAiPrompt:"app-ai-prompt",articleAi:"article-ai",articleAttachment:"article-attachment",assignment:"assignment",audioTranscript:"audio-transcript",bitBookEnding:"bit-book-ending",bitBookSummary:"bit-book-summary",bitmarkExample:"bitmark-example",blogArticle:"blog-article",bookAcknowledgments:"book-acknowledgments",bookAddendum:"book-addendum",bookAfterword:"book-afterword",bookAppendix:"book-appendix",bookArticle:"book-article",bookAutherBio:"book-author-bio",bookBibliography:"book-bibliography",bookComingSoon:"book-coming-soon",bookConclusion:"book-conclusion",bookCopyright:"book-copyright",bookCopyrightPermissions:"book-copyright-permissions",bookDedication:"book-dedication",bookEndnotes:"book-endnotes",bookEpigraph:"book-epigraph",bookEpilogue:"book-epilogue",bookForword:"book-foreword",bookFrontispiece:"book-frontispiece",bookImprint:"book-imprint",bookIncitingIncident:"book-inciting-incident",bookIntroduction:"book-introduction",bookListOfContributors:"book-list-of-contributors",bookNotes:"book-notes",bookLink:"book-link",bookLinkNext:"book-link-next",bookLinkPrev:"book-link-prev",bookPostscript:"book-postscript",bookPreface:"book-preface",bookPrologue:"book-prologue",bookReadMore:"book-read-more",bookReferenceList:"book-reference-list",bookRequestForABookReview:"book-request-for-a-book-review",bookSummary:"book-summary",bookTeaser:"book-teaser",bookTitle:"book-title",botActionAnnounce:"bot-action-announce",botActionRatingNumber:"bot-action-rating-number",botActionRemind:"bot-action-remind",botActionSave:"bot-action-save",botActionTrueFalse:"bot-action-true-false",botInterview:"bot-interview",bug:"bug",chapterSubjectMatter:"chapter-subject-matter",chat:"chat",checklist:"checklist",clozeInstructionGrouped:"cloze-instruction-grouped",clozeSolutionGrouped:"cloze-solution-grouped",coachAudioTranscript:"coach-audio-transcript",coachCallToActionChecklist:"coach-call-to-action-checklist",coachCallToActionCloze:"coach-call-to-action-cloze",coachCallToActionClozeAndMultipleChoiceText:"coach-call-to-action-cloze-and-multiple-choice-text",coachCallToActionEssay:"coach-call-to-action-essay",coachCallToActionMultipleChoiceText:"coach-call-to-action-multiple-choice-text",coachHomeRules:"coach-home-rules",coachSelfReflectionCloze:"coach-self-reflection-cloze",coachSelfReflectionEssay:"coach-self-reflection-essay",coachSelfReflectionMultipleChoice:"coach-self-reflection-multiple-choice",coachSelfReflectionMultipleChoice1:"coach-self-reflection-multiple-choice-1",coachSelfReflectionMultipleChoiceText:"coach-self-reflection-multiple-choice-text",coachSelfReflectionMultipleResponse:"coach-self-reflection-multiple-response",coachSelfReflectionMultipleResponse1:"coach-self-reflection-multiple-response-1",coachSelfReflectionRating:"coach-self-reflection-rating",coachVideoTranscript:"coach-video-transcript",conclusion:"conclusion",conversationLeft1Scream:"conversation-left-1-scream",conversationLeft1Thought:"conversation-left-1-thought",conversationRight1:"conversation-right-1",conversationRight1Scream:"conversation-right-1-scream",conversationRight1Thought:"conversation-right-1-thought",cookArrangement:"cook-arrangement",cookIngredients:"cook-ingredients",cookInsert:"cook-insert",cookPersonalRecommendation:"cook-personal-recommendation",cookPlate:"cook-plate",cookPracticeAdvise:"cook-practice-advise",cookPreparation:"cook-preparation",cookRecommendation:"cook-recommendation",cookRemark:"cook-remark",cookSideDish:"cook-side-dish",cookSideDrink:"cook-side-drink",cookStep:"cook-step",cookTimer:"cook-timer",cookVariation:"cook-variation",correction:"correction",danger:"danger",details:"details",details1:"details-1",documentUpload:"document-upload",editorial:"editorial",editorNote:"editor-note",featured:"featured",flashcard1:"flashcard-1",footNote:"foot-note",groupBorn:"group-born",groupDied:"group-died",help:"help",hint:"hint",imageLandscape:"image-landscape",imageOnDevice:"image-on-device",imagePortrait:"image-portrait",imagePrototype:"image-prototype",imageSuperWide:"image-super-wide",imageZoom:"image-zoom",info:"info",interviewInstructionGrouped:"interview-instruction-grouped",langAudioScript:"lang-audio-script",langEnablingLanguageSkills:"lang-enabling-language-skills",langEnglishAroundWorld:"lang-english-around-world",langExtraActivity:"lang-extra-activity",langGoodToKnow:"lang-good-to-know",langHomework:"lang-homework",langLearningGoal:"lang-learning-goal",langLearningOutcomes:"lang-learning-outcomes",langLearningStrategy:"lang-learning-strategy",langLevelDown:"lang-level-down",langLevelUp:"lang-level-up",langLifeSkillIcon:"lang-life-skill-icon",langLifeSkills:"lang-life-skills",langLikeALocal:"lang-like-a-local",langMaterial:"lang-material",langTeacherNote:"lang-teacher-note",langTeacherPronunciation:"lang-teacher-pronunciation",langUsefulPhrases:"lang-useful-phrases",langVideoScript:"lang-video-script",langVocabulary:"lang-vocabulary",learningPathBotTraining:"learning-path-bot-training",learningPathClassroomEvent:"learning-path-classroom-event",learningPathClassroomTraining:"learning-path-classroom-training",learningPathClosing:"learning-path-closing",learningPathExternalLink:"learning-path-external-link",learningPathFeedback:"learning-path-feedback",learningPathLearningGoal:"learning-path-learning-goal",learningPathLti:"learning-path-lti",learningPathSign:"learning-path-sign",learningPathStep:"learning-path-step",learningPathVideoCall:"learning-path-video-call",matchAll:"match-all",matchAllReverse:"match-all-reverse",matchReverse:"match-reverse",matchSolutionGrouped:"match-solution-grouped",message:"message",newspaperArticle:"newspaper-article",note:"note",noteAi:"note-ai",notebookArticle:"notebook-article",page:"page",preparationNote:"preparation-note",question1:"question-1",recordAudio:"record-audio",releaseNotesSummary:"release-notes-summary",remark:"remark",reviewApprovedNote:"review-approved-note",reviewAuthorNote:"review-author-note",reviewNote:"review-note",reviewRequestForReviewNote:"review-request-for-review-note",reviewReviewerNote:"review-reviewer-note",selfAssessment:"self-assessment",sideNote:"side-note",statement:"statement",stickyNote:"sticky-note",summary:"summary",summaryAi:"summary-ai",survey1:"survey-1",surveyAnonymous1:"survey-anonymous-1",takePicture:"take-picture",videoLandscape:"video-landscape",videoPortrait:"video-portrait",videoTranscript:"video-transcript",warning:"warning",workbookArticle:"workbook-article"});t.AliasBitType=s;const n={[o.article]:[s.page,s.statement],[o.book]:[s.bookAcknowledgments,s.bookAddendum,s.bookAfterword,s.bookAppendix,s.bookArticle,s.bookAutherBio,s.bookBibliography,s.bookComingSoon,s.bookConclusion,s.bookCopyright,s.bookCopyrightPermissions,s.bookDedication,s.bookEndnotes,s.bookEpigraph,s.bookEpilogue,s.bookForword,s.bookFrontispiece,s.bookImprint,s.bookIncitingIncident,s.bookIntroduction,s.bookListOfContributors,s.bookNotes,s.bookPostscript,s.bookPreface,s.bookPrologue,s.bookReadMore,s.bookReferenceList,s.bookRequestForABookReview,s.bookSummary,s.bookTeaser,s.bookTitle],[o.cloze]:[s.clozeInstructionGrouped,s.clozeSolutionGrouped,s.coachSelfReflectionCloze,s.coachCallToActionCloze],[o.clozeAndMultipleChoiceText]:[s.coachCallToActionClozeAndMultipleChoiceText],[o.conversationLeft1]:[s.conversationLeft1Scream,s.conversationLeft1Thought,s.conversationRight1,s.conversationRight1Scream,s.conversationRight1Thought],[o.essay]:[s.coachSelfReflectionEssay,s.coachCallToActionEssay],[o.example]:[s.appAiPrompt,s.aiPrompt,s.articleAi,s.articleAttachment,s.assignment,s.audioTranscript,s.bitmarkExample,s.blogArticle,s.bug,s.checklist,s.coachAudioTranscript,s.coachCallToActionChecklist,s.coachHomeRules,s.coachVideoTranscript,s.correction,s.cookPreparation,s.cookStep,s.cookIngredients,s.cookRemark,s.cookVariation,s.cookInsert,s.cookArrangement,s.cookPracticeAdvise,s.cookPlate,s.cookRecommendation,s.cookPersonalRecommendation,s.cookSideDrink,s.cookSideDish,s.cookTimer,s.danger,s.details1,s.details,s.editorial,s.editorNote,s.featured,s.help,s.hint,s.info,s.langLearningOutcomes,s.langEnablingLanguageSkills,s.langLifeSkills,s.langEnglishAroundWorld,s.langGoodToKnow,s.langLearningGoal,s.langLearningStrategy,s.langLikeALocal,s.langMaterial,s.langUsefulPhrases,s.langLevelDown,s.langLevelUp,s.langExtraActivity,s.langVideoScript,s.langAudioScript,s.langVocabulary,s.langHomework,s.langTeacherNote,s.langTeacherPronunciation,s.message,s.newspaperArticle,s.note,s.noteAi,s.notebookArticle,s.preparationNote,s.releaseNotesSummary,s.remark,s.reviewNote,s.reviewAuthorNote,s.reviewReviewerNote,s.reviewRequestForReviewNote,s.reviewApprovedNote,s.selfAssessment,s.sideNote,s.summary,s.summaryAi,s.videoTranscript,s.warning,s.workbookArticle],[o.flashcard]:[s.flashcard1],[o.image]:[s.imageLandscape,s.imageOnDevice,s.imagePortrait,s.imagePrototype,s.imageSuperWide,s.imageZoom,s.langLifeSkillIcon],[o.interview]:[s.interviewInstructionGrouped,s.botInterview],[o.learningPathBook]:[s.bookLink,s.bookLinkNext,s.bookLinkPrev,s.learningPathBotTraining,s.learningPathClassroomEvent,s.learningPathClassroomTraining,s.learningPathClosing,s.learningPathFeedback,s.learningPathLearningGoal,s.learningPathLti,s.learningPathSign,s.learningPathStep],[o.card1]:[s.question1,s.survey1,s.surveyAnonymous1],[o.match]:[s.matchAll,s.matchReverse,s.matchAllReverse,s.matchSolutionGrouped],[o.multipleChoice1]:[s.coachSelfReflectionMultipleChoice1],[o.multipleChoice]:[s.coachSelfReflectionMultipleChoice],[o.multipleChoiceText]:[s.coachCallToActionMultipleChoiceText,s.coachSelfReflectionMultipleChoiceText],[o.multipleResponse1]:[s.coachSelfReflectionMultipleResponse1],[o.multipleResponse]:[s.coachSelfReflectionMultipleResponse],[o.rating]:[s.coachSelfReflectionRating],[o.toc]:[s.anchor,s.bitBookEnding,s.bitBookSummary,s.botActionAnnounce,s.botActionRatingNumber,s.botActionRemind,s.botActionSave,s.botActionTrueFalse,s.chapterSubjectMatter,s.chat,s.conclusion,s.documentUpload,s.footNote,s.groupBorn,s.groupDied,s.recordAudio,s.stickyNote,s.takePicture],[o.video]:[s.videoLandscape,s.videoPortrait]},a=new Map;class l{static getBitType(e){const t=l.getAliasedBitType(e);return{alias:t,root:l.getRootBitType(t)}}static getRootBitType(e){var t;return e&&null!==(t=a.get(e))&&void 0!==t?t:o._error}static getAliasedBitType(e){var t,r;return null!==(r=null!==(t=s.fromValue(e))&&void 0!==t?t:o.fromValue(e))&&void 0!==r?r:o._error}}t.BitTypeUtils=l,function(){for(const e of o.values())a.set(e,e);for(const[e,t]of Object.entries(n))for(const r of t)a.set(r,e)}()},6958:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParserType=void 0;const i=(0,r(6688).superenum)({antlr:"antlr",peggy:"peggy"});t.BitmarkParserType=i},8791:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_BITMARK_VERSION=t.BitmarkVersion=void 0;const i=(0,r(6688).superenum)({v2:2,v3:3});t.BitmarkVersion=i;const o=i.v3;t.DEFAULT_BITMARK_VERSION=o},1060:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BodyBitType=void 0;const i=(0,r(6688).superenum)({text:"text",gap:"gap",mark:"mark",select:"select",highlight:"highlight"});t.BodyBitType=i},7210:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetType=void 0;const i=(0,r(6688).superenum)({flashcards:"flashcards",elements:"elements",statements:"statements",quiz:"quiz",questions:"questions",matchPairs:"matchPairs",matchMatrix:"matchMatrix",botActionResponses:"botActionResponses"});t.CardSetType=i},8565:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetVersion=void 0;const i=(0,r(6688).superenum)({v1:1,v2:2});t.CardSetVersion=i},7028:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExampleType=void 0;const i=(0,r(6688).superenum)({none:"none",string:"string",boolean:"boolean"});t.ExampleType=i},4719:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyKey=void 0;const i=(0,r(6688).superenum)({id:"id",externalId:"externalId",spaceId:"spaceId",padletId:"padletId",aiGenerated:"AIGenerated",releaseVersion:"releaseVersion",ageRange:"ageRange",language:"language",computerLanguage:"computerLanguage",target:"target",tag:"tag",icon:"icon",iconTag:"iconTag",colorTag:"colorTag",subtype:"subtype",coverImage:"coverImage",publisher:"publisher",publications:"publications",author:"author",subject:"subject",date:"date",location:"location",theme:"theme",kind:"kind",action:"action",thumbImage:"thumbImage",focusX:"focusX",focusY:"focusY",deeplink:"deeplink",externalLink:"externalLink",externalLinkText:"externalLinkText",videoCallLink:"videoCallLink",bot:"bot",duration:"duration",reference:"reference",list:"list",textReference:"textReference",isTracked:"isTracked",isInfoOnly:"isInfoOnly",labelTrue:"labelTrue",labelFalse:"labelFalse",quotedPerson:"quotedPerson",partialAnswer:"partialAnswer",example:"example",toc:"toc",progress:"progress",level:"level",book:"book",partner:"partner",sampleSolution:"sampleSolution",mark:"mark",type:"type",color:"color",emphasis:"emphasis",shortAnswer:"shortAnswer",longAnswer:"longAnswer",caseSensitive:"caseSensitive",reaction:"reaction",width:"width",height:"height",license:"license",copyright:"copyright",caption:"caption",showInIndex:"showInIndex",alt:"alt",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",mute:"mute",autoplay:"autoplay",allowSubtitles:"allowSubtitles",showSubtitles:"showSubtitles",siteName:"siteName",posterImage:"posterImage"});t.PropertyKey=i},1895:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceType=void 0;const i=(0,r(6688).superenum)({unknown:"unknown",image:"image",imageEmbed:"imageEmbed",imageLink:"image-link",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",video:"video",videoEmbed:"video-embed",videoLink:"video-link",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",article:"article",articleEmbed:"articleEmbed",articleLink:"articleLink",document:"document",documentEmbed:"document-embed",documentLink:"document-link",documentDownload:"document-download",appLink:"app-link",websiteLink:"website-link"});t.ResourceType=i},6562:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TagType=void 0;const i=(0,r(6688).superenum)({Title:"Title",Anchor:"Anchor",Reference:"Reference",Property:"Property",ItemLead:"ItemLead",Instruction:"Instruction",Hint:"Hint",True:"True",False:"False",SampleSolution:"SampleSolution",Gap:"Gap",Mark:"Mark",Resource:"Resource",Remark:"Remark",Comment:"Comment"});t.TagType=i},1353:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextFormat=void 0;const i=(0,r(6688).superenum)({text:"text",bitmarkMinusMinus:"bitmark--",bitmarkPlusPlus:"bitmark++"});t.TextFormat=i},1888:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextMarkType=void 0;const i=(0,r(6688).superenum)({bold:"bold",light:"light",italic:"italic",highlight:"highlight",strike:"strike",sub:"sub",super:"super",ins:"ins",del:"del",link:"link",var:"var",code:"code",color:"color",hash:"#",comment:"comment"});t.TextMarkType=i},2610:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextNodeType=void 0;const i=(0,r(6688).superenum)({text:"text",hardBreak:"hardBreak",paragraph:"paragraph",heading:"heading",section:"section",bulletList:"bulletList",orderedList:"orderedList",taskList:"taskList",listItem:"listItem",taskItem:"taskItem",image:"image",codeBlock:"codeBlock",gap:"gap",select:"select",highlight:"highlight"});t.TextNodeType=i},9556:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParser=void 0;const i=r(6958),o=r(2434),s=r(8030);t.BitmarkParser=class{constructor(){this.jsonParser=new o.JsonParser}toAst(e,t){return Object.assign({},t).parserType===i.BitmarkParserType.antlr?this.jsonParser.toAst(this.parseUsingAntlr(e)):(0,s.parse)(e)}parseUsingAntlr(e){if(!function(){let e=!1;return e}())throw new Error("ANTLR parser is not available");const t=(0,bitmark_grammar_1.parse)(e);return JSON.parse(t)}}},8030:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const i=r(4369).parse;t.parse=i},2892:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserHelper=void 0;const i=r(8565),o=r(3633),s=r(7542),n=r(6831);r(2093);t.BitmarkPegParserHelper=class{constructor(e){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0,this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation}handleRawBit(e){var t,r;const i=e.trim();if(this.debugPrint("RAW BIT",i),!i)return;const o=null!==(r=null===(t=this.parserLocation())||void 0===t?void 0:t.start)&&void 0!==r?r:{line:1,column:1,offset:0},n=this.parse(e,{startRule:"bit",grammarSource:new s.PeggyGrammarLocation("bit",o)});return n.value&&(n.value.markup=i),n}handleTextFormat(e){return{type:n.TypeKey.TextFormat,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceType(e){return{type:n.TypeKey.ResourceType,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleBitContent(e){let t=this.reduceToArrayOfTypes(e);return t=this.mergeCharToText(t),t}handleBitTag(e){return e}handleTag(e,t){return{type:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handlePropertyTag(e,t){return{type:n.TypeKey.Property,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceTag(e,t){return{type:n.TypeKey.Resource,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleTagChain(e){const t=this.reduceToArrayOfTypes(e);let r=t;if(t.length>1){const e=t[0];e.chain=t.slice(1),r=[e]}return r}handleCardSet(e){const t=e,r={cards:[]},i={cards:[]};if(t){const e={text:this.parserText(),location:this.parserLocation()};for(const e of t){if(!e)continue;const{type:t,value:i,parser:o}=e;if(!t||t!==n.TypeKey.Card)continue;const{cardIndex:s,cardSideIndex:a,cardVariantIndex:l,value:u}=i;let c=r.cards[s];c||(c={sides:[]},r.cards[s]=c);let d=c.sides[a];d||(d={variants:[]},c.sides[a]=d);d.variants[l]?d.variants[l].value+=u:d.variants[l]={value:u,parser:o}}r.cards=r.cards.filter((e=>e.sides.some((e=>e.variants.some((e=>0!==o.StringUtils.trimmedString(e.value).length))))));for(const t of r.cards){const r={sides:[]};i.cards.push(r);for(const i of t.sides){const t={variants:[]};r.sides.push(t);for(const r of i.variants){let i={line:1,column:1,offset:0};if(r.parser.location){i=r.parser.location.start;const e=r.parser.text,t=e?e.length:0,o=1;i.offset+=t,i.line+=o}let o=this.parse(r.value,{startRule:"cardContent",grammarSource:new s.PeggyGrammarLocation("card-content",i)});o=this.reduceToArrayOfTypes(o),this.debugPrint("parsedCardContent",o),t.variants.push({parser:e,content:o})}}}}return{type:n.TypeKey.CardSet,value:i,parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardSetStart(){this.cardIndex=-1,this.cardSideIndex=0,this.cardVariantIndex=0}handleCardSetEnd(){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0}handleCards(e){return e}handleCardLineOrDivider(e,t){let r=!1,o=!1,s=!1;return Array.isArray(e)&&2===e.length&&(e=e[0],t===i.CardSetVersion.v1?(r=e===n.CARD_DIVIDER_V1,o=e===n.CARD_SIDE_DIVIDER_V1,s=e===n.CARD_VARIANT_DIVIDER_V1):(r=e===n.CARD_DIVIDER_V2,o=e===n.CARD_SIDE_DIVIDER_V2,s=e===n.CARD_VARIANT_DIVIDER_V2)),r?(this.cardIndex++,this.cardSideIndex=0,this.cardVariantIndex=0):o?(this.cardSideIndex++,this.cardVariantIndex=0):s&&this.cardVariantIndex++,this.isType(e,n.TypeKey.Card)?e:{type:n.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:""},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardLine(e){return{type:n.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:e},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardContent(e){return this.mergeCharToText(e)}handleCardTags(e){return e}mergeCharToText(e){var t,r,i,o,s,a;const l=[];let u,c;for(const d of e)switch(d.type){case n.TypeKey.BodyChar:if(u){const e=`${null!==(t=u.value)&&void 0!==t?t:""}${null!==(r=d.value)&&void 0!==r?r:""}`;u.value=e}else u={type:n.TypeKey.BodyText,value:null!==(i=d.value)&&void 0!==i?i:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;case n.TypeKey.CardChar:if(c){const e=`${null!==(o=c.value)&&void 0!==o?o:""}${null!==(s=d.value)&&void 0!==s?s:""}`;c.value=e}else c={type:n.TypeKey.CardText,value:null!==(a=d.value)&&void 0!==a?a:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;default:u&&(l.push(u),u=void 0),c&&(l.push(c),c=void 0),l.push(d)}return u&&l.push(u),c&&l.push(c),l}isType(e,t){if(!e)return!1;const{type:r}=e;return t?Array.isArray(t)?t.indexOf(r)>=0:t===r:!!n.TypeKey.fromValue(r)}reduceToArrayOfTypes(e,t,r){if(!Array.isArray(e))return[];return e.reduce(((e,i,o)=>{if(null==i)return e;const{type:s,value:n}=i;if(Array.isArray(i)){const r=this.reduceToArrayOfTypes(i,t);e.push(...r)}else{if(!this.isType(i,t))return e;if(r&&Array.isArray(n)){const r=this.reduceToArrayOfTypes(n,t);e.push(...r)}else s&&e.push(i)}return e}),[])}debugPrint(e,t){}}},7448:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserProcessor=void 0;const o=r(9046),s=r(208),n=r(1060),a=r(1895),l=r(1353),u=r(8386),c=r(1182),d=r(6934),p=r(8081),h=r(9577),y=r(9457),g=r(857),f=r(3287),m=r(3130),b=r(5516),v=r(1838),T=r(4177),A=r(6831),P=new o.Builder;t.BitmarkPegParserProcessor=class{constructor(e){this.nonFatalWarnings=[],this.nonFatalErrors=[],this.parser={},this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation,this.context={DEBUG_BIT_RAW:true,DEBUG_BIT_CONTENT_RAW:false,DEBUG_BIT_CONTENT:true,DEBUG_BIT_TAGS:true,DEBUG_BODY:true,DEBUG_FOOTER:true,DEBUG_CHAIN_CONTENT:true,DEBUG_CHAIN_TAGS:true,DEBUG_CARD_SET_CONTENT:true,DEBUG_CARD_SET:true,DEBUG_CARD_TAGS:true,parser:this.parser,parse:this.parse,bitContentProcessor:this.bitContentProcessor.bind(this),splitBitContent:this.splitBitContent.bind(this),addWarning:this.addWarning.bind(this),addError:this.addError.bind(this),debugPrint:this.debugPrint.bind(this)}}buildBits(e){var t;const r=[];let i=[];for(const o of e){if(!o)continue;const e=o.value;e?r.push(e):i=i.concat(null!==(t=o.errors)&&void 0!==t?t:[])}return P.bitmark({bits:r,errors:i.length>0?i:void 0})}buildBit(e,t){const{bitType:r,textFormat:o,resourceType:n}=e;if(!r||r.root===s.RootBitType._error)return this.invalidBit();const a=r.root===s.RootBitType.trueFalse1,l=r.root===s.RootBitType.multipleChoice1,d=r.root===s.RootBitType.multipleResponse1;this.debugPrint("BIT CONTENT",t),t=u.BitmarkPegParserValidator.validateBitTags(this.context,r,t);const p=this.bitContentProcessor(A.BitContentLevel.Bit,r,t),{body:h,footer:y,cardSet:g,title:f,statement:m,statements:T,choices:_,responses:x,resources:w,comments:S}=p,O=i(p,["body","footer","cardSet","title","statement","statements","choices","responses","resources","comments"]);this.debugPrint("BIT TAGS",O),this.debugPrint("BIT BODY",h),this.debugPrint("BIT FOOTER",y);const R=(0,v.buildTitles)(this.context,r,f),k=(0,c.buildCards)(this.context,r,g,m,T,_,x),C=(0,b.buildResource)(this.context,r,n,w);(S||k.comments)&&(this.parser.comments=[],S&&this.parser.comments.push(...S),k.comments&&this.parser.comments.push(...k.comments));const E=this.buildBitLevelWarnings(),I=this.buildBitLevelErrors();E&&(this.parser.warnings=E),I&&(this.parser.errors=I);return{value:P.bit(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({bitType:r,textFormat:o,resourceType:n},R),{statement:a?m:void 0,choices:l?_:void 0,responses:d?x:void 0}),O),{resource:C}),k),{body:h,footer:y,parser:this.parser}))}}invalidBit(e){e&&this.addError("Invalid bit"),this.parser.errors=this.buildBitLevelErrors();return{value:P.bit({bitType:s.BitTypeUtils.getBitType(s.RootBitType._error),parser:this.parser})}}buildBitHeader(e,t){var r;const i=s.BitTypeUtils.getBitType(e);return i.root===s.RootBitType._error&&this.addError(`Invalid bit type: '${e}'`),{bitType:i,textFormat:null!==(r=t.textFormat)&&void 0!==r?r:l.TextFormat.bitmarkMinusMinus,resourceType:t.resourceType}}buildTextAndResourceType(e,t){const r={textFormat:l.TextFormat.bitmarkMinusMinus},i=e=>{var t;e&&(e.type===A.TypeKey.TextFormat?(r.textFormat=l.TextFormat.fromValue(e.value),e.value&&!r.textFormat&&this.addWarning(`Invalid text format '${e.value}', defaulting to '${l.TextFormat.bitmarkMinusMinus}'`),r.textFormat=null!==(t=r.textFormat)&&void 0!==t?t:l.TextFormat.bitmarkMinusMinus):(r.resourceType=a.ResourceType.fromValue(e.value),e.value&&!r.resourceType&&this.addWarning(`Invalid resource type '${e.value}', it will be ignored`)))};return i(e),i(t),r}bitContentProcessor(e,t,r){const i={};if(!r)return i;i.title=[],i.solutions=[],i.statements=[],i.choices=[],i.responses=[],i.resources=[],i.trueFalse=[],i.markConfig=[],i.extraProperties={},i.comments=[];let o=!1,s=!1,n=!1;const a=[];let l="",c="",_="";const x=e===A.BitContentLevel.Chain,w=()=>{if(l){l=u.BitmarkPegParserValidator.checkBodyPart(this.context,e,t,l);const r=P.bodyText({text:l});a.push(r)}l=""};return r.forEach(((r,u)=>{const{type:P,value:S}=r;switch(P){case A.TypeKey.Comment:(0,d.commentTagContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.ItemLead:(0,y.itemLeadTagContentProcessor)(this.context,e,t,r,i,o),o=!0;break;case A.TypeKey.Instruction:case A.TypeKey.Hint:case A.TypeKey.Anchor:case A.TypeKey.SampleSolution:(0,p.defaultTagContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.Reference:(0,m.referenceTagContentProcessor)(this.context,e,t,r,i,s),s=!0;break;case A.TypeKey.Title:(0,v.titleTagContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.Property:(0,f.propertyContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.Gap:x||w(),(0,h.gapChainContentProcessor)(this.context,e,t,r,i,a);break;case A.TypeKey.Mark:x||w(),(0,g.markChainContentProcessor)(this.context,e,t,r,i,a);break;case A.TypeKey.True:case A.TypeKey.False:x||w(),(0,T.trueFalseChainContentProcessor)(this.context,e,t,r,i,a);break;case A.TypeKey.Resource:(0,b.resourceContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.CardSet:i.cardSet=S,n=!0;break;case A.TypeKey.BodyText:n?c+=S:l+=S;break;case A.TypeKey.CardText:_+=S}})),w(),i.body=a.length>0?P.body({bodyParts:this.trimBodyParts(a)}):void 0,u.BitmarkPegParserValidator.checkBody(this.context,e,t,i.body),c=c.trim(),c&&(c=u.BitmarkPegParserValidator.checkFooter(this.context,e,t,c),c&&(i.footer=P.footerText({text:c}))),_=_.trim(),_&&(i.cardBody=_),0===Object.keys(i.extraProperties).length&&delete i.extraProperties,0===i.title.length&&delete i.title,0===i.solutions.length&&delete i.solutions,0===i.statements.length&&delete i.statements,0===i.choices.length&&delete i.choices,0===i.responses.length&&delete i.responses,0===i.trueFalse.length&&delete i.trueFalse,0===i.markConfig.length&&delete i.markConfig,0===i.resources.length&&delete i.resources,0===i.comments.length&&delete i.comments,i}buildBitLevelWarnings(){let e;return this.nonFatalWarnings.length>0&&(e=this.nonFatalWarnings,this.nonFatalWarnings=[]),e}buildBitLevelErrors(){let e;return this.nonFatalErrors.length>0&&(e=this.nonFatalErrors,this.nonFatalErrors=[]),e}splitBitContent(e,t){const r=[];let i=[];for(const o of e)t.includes(o.type)&&(i.length>0&&r.push(i),i=[]),i.push(o);return i.length>0&&r.push(i),r}trimBodyParts(e){let t=!1,r=e.reduce(((e,r)=>{const i=r;if(t||i.type!==n.BodyBitType.text)t=!0,e.push(r);else{const r=i.data.bodyText.trimStart();r&&(t=!0,i.data.bodyText=r,e.push(i))}return e}),[]);return t=!1,r=r.reduceRight(((e,r)=>{const i=r;if(t||i.type!==n.BodyBitType.text)t=!0,e.unshift(r);else{const r=i.data.bodyText.trimEnd();r&&(t=!0,i.data.bodyText=r,e.unshift(i))}return e}),[]),r}addWarning(e,t,r){var i,o,s;const n={message:e,text:null!==(i=null==t?void 0:t.parser.text)&&void 0!==i?i:this.parserText(),location:null!==(o=null==t?void 0:t.parser.location)&&void 0!==o?o:this.parserLocation(),original:null!==(s=null==r?void 0:r.parser)&&void 0!==s?s:void 0};n.original||delete n.original,this.nonFatalWarnings.push(n)}addError(e,t,r){var i,o,s;const n={message:e,text:null!==(i=null==t?void 0:t.parser.text)&&void 0!==i?i:this.parserText(),location:null!==(o=null==t?void 0:t.parser.location)&&void 0!==o?o:this.parserLocation(),original:null!==(s=null==r?void 0:r.parser)&&void 0!==s?s:void 0};n.original||delete n.original,this.nonFatalErrors.push(n)}debugPrint(e,t){}}},6831:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARD_VARIANT_DIVIDER_V1=t.CARD_SIDE_DIVIDER_V1=t.CARD_DIVIDER_V1=t.CARD_VARIANT_DIVIDER_V2=t.CARD_SIDE_DIVIDER_V2=t.CARD_DIVIDER_V2=t.BitContentLevel=t.TypeKey=void 0;const i=r(6688);t.CARD_DIVIDER_V2="====";t.CARD_SIDE_DIVIDER_V2="--";t.CARD_VARIANT_DIVIDER_V2="++";t.CARD_DIVIDER_V1="===";t.CARD_SIDE_DIVIDER_V1="==";t.CARD_VARIANT_DIVIDER_V1="--";const o=(0,i.superenum)({TextFormat:"TextFormat",ResourceType:"ResourceType",Title:"Title",Anchor:"Anchor",Reference:"Reference",ItemLead:"ItemLead",Instruction:"Instruction",Hint:"Hint",True:"True",False:"False",Gap:"Gap",Mark:"Mark",SampleSolution:"SampleSolution",Comment:"Comment",Property:"Property",Resource:"Resource",TagChain:"TagChain",BodyChar:"BodyChar",BodyText:"BodyText",CardSet:"CardSet",Card:"Card",CardChar:"CardChar",CardText:"CardText",GapChain:"GapChain",TrueFalseChain:"TrueFalseChain"});t.TypeKey=o;const s=(0,i.superenum)({Bit:"Bit",Card:"Card",Chain:"Chain"});t.BitContentLevel=s},8386:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserValidator=void 0;const i=r(9881),o=r(208),s=r(6831),n=["====","----","\n==\n","\n---\n","\n--\n",":::","::::","|||","||||"],a=["==\n","---\n","--\n"],l=["\n==","\n---","\n--"];const u=new class{validateBitTags(e,t,r){if(!r)return[];const i=this.getMetadataForBitType(t),{tags:o,cardSet:n}=i;return this.validateTagChainsRecursive(e,s.BitContentLevel.Bit,t,r,o,n)}checkBody(e,t,r,i){if(!i)return i;const o=this.getMetadataForBitType(r),{bodyAllowed:s}=o;return i.bodyParts.length>0&&!s&&e.addWarning(`Bit '${r.alias}' should not have a body.`),i}checkBodyPart(e,t,r,i){return i?(this.checkBodyForCommonPotentialMistakes(e,t,r,i),i):i}checkFooter(e,t,r,i){if(!i)return i;const o=this.getMetadataForBitType(r),{footerAllowed:s}=o;return this.checkBodyForCommonPotentialMistakes(e,t,r,i),s||e.addWarning(`Bit '${r.alias}' should not have a footer.`),i}checkCardBody(e,t,r,i,o,s,n){if(!i)return i;const a=this.getMetadataForBitType(r);if(!a.cardSet)return i;const l=this.getVariantConfig(a.cardSet.variants,s,n);if(!l)return i;const{bodyAllowed:u}=l;return this.checkBodyForCommonPotentialMistakes(e,t,r,i),u||e.addWarning(`Bit '${r.alias}' should not have a card body at card:${o+1}, side:${s+1}, variant:${n+1}.`),i}validateTagChainsRecursive(e,t,r,o,n,a){if(!o)return[];const l=[...o],u=new Map,c=this.convertTagsToTypeKeyMap(n);c.set(s.TypeKey.Comment,{maxCount:i.INFINITE_COUNT}),t===s.BitContentLevel.Bit?(a&&c.set(s.TypeKey.CardSet,{_key:a.type}),c.set(s.TypeKey.TextFormat,{}),c.set(s.TypeKey.BodyText,{maxCount:i.INFINITE_COUNT})):t===s.BitContentLevel.Card&&c.set(s.TypeKey.CardText,{maxCount:i.INFINITE_COUNT});for(let i=0;i<l.length;i++){const o=l[i];if(!o)continue;const{type:n,key:d}=o,p=s.TypeKey.fromValue(n);if(!p)continue;let h=p;p!==s.TypeKey.Property&&p!==s.TypeKey.Resource||(h=`${p}:${d}`);const y=c.get(h),g=this.validateSingleTag(e,t,r,o,p,h,y,u,a);if(g||l.splice(i,1,null),g&&Array.isArray(g.chain)&&g.chain.length>0)if(y&&y.chain){const t=this.validateTagChainsRecursive(e,s.BitContentLevel.Chain,r,g.chain,y.chain);t&&t.length>0?g.chain=t:g.chain=void 0}else l.splice(i+1,0,...g.chain),g.chain=void 0}return l.filter((e=>null!=e))}validateSingleTag(e,t,r,i,o,n,a,l,u){const{type:c,key:d}=i,p=c===s.TypeKey.Property||c===s.TypeKey.Resource?` with key '${d}'`:"",h=" It will be ignored";let y,g,f="",m=l.get(n);null==m&&(m={count:0},l.set(n,m));let b=m.previous;if(m.count++,a)switch(o){case s.TypeKey.Property:{const{content:o,warning:s}=this.validatePropertyTag(e,t,r,a,i,m);y=o,g=s;break}case s.TypeKey.Resource:{const{content:o,warning:s}=this.validateResourceTag(e,t,r,a,i,m);y=o,g=s;break}case s.TypeKey.CardSet:{const{content:t,warning:o}=this.validateCardSet(e,r,a,i,u);y=t,g=o;break}default:{const{content:o,warning:s}=this.validateStandardTag(e,t,r,a,i,m);y=o,g=s}}else switch(o){case s.TypeKey.Property:g={extraProperty:!0},y=i;break;case s.TypeKey.Resource:g={excessResource:!0},y=i;break;default:g={invalid:!0}}return g&&(b=m.previous,g.invalid||g.excessResource?f=`'${c}'${p} is not valid here.${h}`:g.tooMany?f=`'${c}'${p} is included more than ${g.tooMany} time(s). The earlier ones will be ignored`:g.extraProperty?f=`'${c}'${p} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`:g.unexpectedCardSet?f=`'${c}'${p} is not expected here.${h}`:g.unexpectedCardSideVariant&&(f=`'${c}'${p} has a card / side / variant that is not expected here.${h}`),e.addWarning(f,i,b)),m.previous=i,y}validateStandardTag(e,t,r,i,o,s){const n=null==i.maxCount?1:i.maxCount;return n>0&&s.count>n?{warning:{tooMany:n},content:o}:{content:o}}validatePropertyTag(e,t,r,i,o,s){const n=null==i.maxCount?1:i.maxCount;return n>0&&s.count>n?{warning:{tooMany:n},content:o}:{content:o}}validateResourceTag(e,t,r,i,o,s){const n=null==i.maxCount?1:i.maxCount;return n>0&&s&&s.count>n?{warning:{tooMany:n},content:o}:{content:o}}validateCardSet(e,t,r,i,o){if(!o||!o.variants||0===o.variants.length)return{warning:{unexpectedCardSet:!0}};const{value:n}=i,a=n;let l,u=0,c=0;for(const r of a.cards){u=0;for(const i of r.sides){c=0;for(const r of i.variants){const n=r.content;let a;const d=this.getVariantConfig(o.variants,u,c);d?a=this.validateTagChainsRecursive(e,s.BitContentLevel.Card,t,n,d.tags):l={unexpectedCardSideVariant:!0},a&&a.length>0?i.variants[c]={parser:r.parser,content:a}:i.variants[c]={parser:r.parser,content:[]},c++}u++}}return{content:i,warning:l}}checkBodyForCommonPotentialMistakes(e,t,r,i){if(i){for(const t of n)i.includes(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of a)i.startsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of l)i.endsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`)}}convertTagsToTypeKeyMap(e){const t=new Map;for(const[r,i]of Object.entries(e))if(i._key=r,i.isProperty)t.set(`${s.TypeKey.Property}:${r}`,i);else if(i.isResource)t.set(`${s.TypeKey.Resource}:${r}`,i);else{const e=s.TypeKey.fromValue(r);e&&t.set(e,i)}return t}getVariantConfig(e,t,r){let i;if(0===e.length)return;const o=e[Math.min(t,e.length-1)],s=o.length-1;if(r>s){if(i=o[s],!i.infiniteRepeat)return}else i=o[r];return i}getMetadataForBitType(e){const t=o.RootBitType.getMetadata(e.root);if(!t)throw new Error(`Root bit type ${e.root} has no metadata`);return t}};t.BitmarkPegParserValidator=u},7542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PeggyGrammarLocation=void 0;t.PeggyGrammarLocation=class{constructor(e,t){this.source=e,this.start=t}toString(){return String(this.source)}offset(e){return{line:e.line+this.start.line-1,column:1===e.line?e.column+this.start.column-1:e.column,offset:e.offset+this.start.offset}}static offsetStart(e){return e.source&&"function"==typeof e.source.offset?e.source.offset(e.start):e.start}static offsetEnd(e){return e.source&&"function"==typeof e.source.offset?e.source.offset(e.end):e.end}}},4185:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.bookChainContentProcessor=void 0;const i=r(3633),o=r(6831);t.bookChainContentProcessor=function(e,t,r,s,n){if(t===o.BitContentLevel.Chain);else{const t=function(e,t,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("book content",r);const s=e.bitContentProcessor(o.BitContentLevel.Chain,t,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("book TAGS",s);const{reference:n,referenceEnd:a}=s,l=i.StringUtils.trimmedString(r.value);return{book:l,reference:n,referenceEnd:a}}(e,r,s);n.book=t.book,n.reference=t.reference,n.referenceEnd=t.referenceEnd}}},1182:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.buildCards=void 0;const o=r(9046),s=r(208),n=r(7210),a=r(1895),l=r(8386),u=r(6831),c=new o.Builder;t.buildCards=function(e,t,r,o,d,p,h){var y;e.DEBUG_CARD_SET&&e.debugPrint("card set",r);let g={};const f=function(e,t,r){const i={cards:[],comments:[]};if(!r)return i;let o=0,s=0,n=0;for(const a of r.cards){const r={no:o++,sides:[]};i.cards.push(r);for(const o of a.sides){const a={no:s++,variants:[]};r.sides.push(a);for(const s of o.variants){const{parser:o,content:c}=s,d={parser:o,no:n++};a.variants.push(d);const p=e.bitContentProcessor(u.BitContentLevel.Card,t,c);e.DEBUG_CARD_TAGS&&e.debugPrint("card tags",p),p.cardBody=l.BitmarkPegParserValidator.checkCardBody(e,u.BitContentLevel.Card,t,p.cardBody,r.no,a.no,d.no),d.data=p,p.comments&&i.comments.push(...p.comments)}n=0}s=0}return i}(e,t,r),m=s.RootBitType.getMetadata(t.root);switch(m&&(null===(y=m.cardSet)||void 0===y?void 0:y.type)){case n.CardSetType.flashcards:g=function(e,t,r){const o=[];let n,a,l="",u=[],d=0,p=0,h={};const y=t.alias===s.AliasBitType.flashcard1;for(const s of r.cards){l="",n=void 0,u=[],p=0,h={};for(const e of s.sides)for(const t of e.variants){const e=t.data,{cardBody:r}=e,o=i(e,["cardBody"]);h=Object.assign(Object.assign({},h),o),0===p?(a=t,l=null!=r?r:""):1===p?n=null!=r?r:"":u.push(null!=r?r:""),p++}if(0!==d&&y){e.addWarning(`Bit '${t.alias}' should only contain one card. Ignore subsequent card: '${l}'`,a);break}o.push(c.flashcard(Object.assign({question:l,answer:n,alternativeAnswers:u.length>0?u:void 0},h))),d++}return{flashcards:o.length>0?o:void 0}}(e,t,f);break;case n.CardSetType.elements:g=function(e,t,r){var i;const o=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data;o.push(null!==(i=t.cardBody)&&void 0!==i?i:"")}return{elements:o.length>0?o:void 0}}(0,0,f);break;case n.CardSetType.statements:g=function(e,t,r,o,s){const n=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{statements:r}=t,o=i(t,["statements"]);if(Array.isArray(r))for(const e of r){const t=c.statement(Object.assign(Object.assign(Object.assign({},e),e.itemLead),o));n.push(t)}}o&&n.push(o);Array.isArray(s)&&s.length>0&&n.push(...s);return{statements:n.length>0?n:void 0}}(0,0,f,o,d);break;case n.CardSetType.quiz:g=function(e,t,r,i,o){const n=[],a=t.root===s.RootBitType.multipleChoice,l=t.root===s.RootBitType.multipleResponse;if(!a&&!l)return{};for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,r=t.isDefaultExample||null!=t.example;if(l&&t.trueFalse&&t.trueFalse.length>0){t.responses=[];for(const e of t.trueFalse){const r=c.response(e);t.responses.push(r)}}if(a&&t.trueFalse&&t.trueFalse.length>0){t.choices=[];for(const e of t.trueFalse){const r=c.choice(e);t.choices.push(r)}}const i=c.quiz(Object.assign(Object.assign({},t),{isDefaultExample:r}));n.push(i)}if(a&&Array.isArray(i)&&i.length>0){const e=c.quiz({choices:i});n.push(e)}if(l&&Array.isArray(o)&&o.length>0){const e=c.quiz({responses:o});n.push(e)}return{quizzes:n.length>0?n:void 0}}(0,t,f,p,h);break;case n.CardSetType.questions:g=function(e,t,r){var i;const o=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,r=c.question(Object.assign({question:null!==(i=t.cardBody)&&void 0!==i?i:""},t));o.push(r)}return{questions:o.length>0?o:void 0}}(0,0,f);break;case n.CardSetType.matchPairs:g=function(e,t,r){let o,s=0;const n=[];let l;const u=[];let d,p,h,y,g,f=[],m={},b=!1,v=!1;for(const e of r.cards){l=void 0,d=void 0,f=[],p=void 0,h=void 0,s=0,m={},v=!1,g="";for(const t of e.sides){for(const e of t.variants){const t=e.data,{cardBody:r,title:o,resources:n,isDefaultExample:c,example:T}=t,A=i(t,["cardBody","title","resources","isDefaultExample","example"]);v=!0===c||v,g=T||g;const P=o&&o[1];if(0===s)if(null!=P)l=P,b=!0===c||b,y=T||y;else if(Array.isArray(n)&&n.length>0){const e=n[0];e.type===a.ResourceType.audio?p=e:e.type===a.ResourceType.image&&(h=e)}else d=r;else if(null!=P)u.push(P),b=!0===c||b,y=T||y;else if(null==o){const e=null!=r?r:"";f.push(e),!b&&!v||g||(g=e)}m=Object.assign(Object.assign(Object.assign({},m),A),{isCaseSensitive:!0})}s++}if(null!=l)o=c.heading({forKeys:l,forValues:u});else{v&&(y=void 0);const e=v||b,t=g||y,r=c.pair(Object.assign(Object.assign({key:null!=d?d:"",keyAudio:p,keyImage:h,values:f,isShortAnswer:!0},m),{isDefaultExample:e,example:t}));n.push(r)}}return{heading:o,pairs:n.length>0?n:void 0}}(0,0,f);break;case n.CardSetType.matchMatrix:g=function(e,t,r){let o,s,n=0;const a=[];let l;const u=[];let d,p,h,y=[],g=[],f={},m=!1,b=!1,v=!1;for(const e of r.cards){s=void 0,l=void 0,y=[],g=[],n=0,b=!1,p="";for(const t of e.sides){g=[],f={},v=!1,h="";for(const e of t.variants){const t=e.data,{title:r,cardBody:o,isDefaultExample:u,example:c}=t,y=i(t,["title","cardBody","isDefaultExample","example"]);v=!0===u||v,h=c||h,Object.assign(f,y);const T=r&&r[1];if(0===n)null!=T?(s=T,m=!0===u||m,d=c||d):(l=o,b=!0===u||b,p=c||p);else if(null!=T)a.push(T),m=!0===u||m,d=c||d;else if(null==t.title){const e=null!=o?o:"";g.push(e),!m&&!v||h||(h=e)}}if(n>0){v&&(p=d=void 0),b&&(d=void 0);const e=v||b||m,t=h||p||d,r=c.matrixCell(Object.assign(Object.assign({values:g},f),{isDefaultExample:e,example:t}));y.push(r)}n++}if(null!=s)o=c.heading({forKeys:s,forValues:a});else{const e=c.matrix({key:null!=l?l:"",cells:y,isShortAnswer:!0,isCaseSensitive:!0});u.push(e)}}return{heading:o,matrix:u.length>0?u:void 0}}(0,0,f);break;case n.CardSetType.botActionResponses:g=function(e,t,r){const o=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{instruction:r,reaction:s,cardBody:n}=t,a=i(t,["instruction","reaction","cardBody"]),l=c.botResponse(Object.assign({response:null!=r?r:"",reaction:null!=s?s:"",feedback:null!=n?n:""},a));o.push(l)}return{botResponses:o.length>0?o:void 0}}(0,0,f)}return g.comments=f.comments.length>0?f.comments:void 0,g}},4471:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clozeTagContentProcessor=void 0;const i=r(3633);t.clozeTagContentProcessor=function(e,t,r,o,s){const{value:n}=o,a=s.solutions;if(a&&i.StringUtils.isString(n)){const e=i.StringUtils.trimmedString(n);a.push(e)}}},6934:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.commentTagContentProcessor=void 0;const i=r(9046),o=r(3633),s=new i.Builder;t.commentTagContentProcessor=function(e,t,r,i,n){if(!n.comments)return;const{value:a}=i,l=o.StringUtils.isString(a)?a:"",u=s.comment({text:l,location:i.parser.location});n.comments.push(u)}},8081:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTagContentProcessor=void 0;const i=r(3633),o=r(6831);t.defaultTagContentProcessor=function(e,t,r,s,n){const{type:a,value:l}=s,u=i.StringUtils.trimmedString(l);switch(a){case o.TypeKey.Instruction:n.instruction=u;break;case o.TypeKey.Hint:n.hint=u;break;case o.TypeKey.Anchor:n.anchor=u;break;case o.TypeKey.Reference:n.reference=u;break;case o.TypeKey.SampleSolution:n.sampleSolution=u}}},4787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.exampleTagContentProcessor=void 0;const i=r(208);function o(e,t,r,i){!0===r?(i.isDefaultExample=!0,i.example=void 0):i.example=r}t.exampleTagContentProcessor=function(e,t,r,s,n){const{value:a}=s,l=a;switch(r.root){case i.RootBitType.cloze:case i.RootBitType.clozeAndMultipleChoiceText:case i.RootBitType.multipleChoiceText:case i.RootBitType.highlightText:!function(e,t,r,i){var s,n;let a;Array.isArray(i.trueFalse)&&i.trueFalse.length>0&&(a=null!==(s=i.trueFalse[i.trueFalse.length-1])&&void 0!==s?s:void 0);a?(a.isDefaultExample=!0,a.example=void 0):Array.isArray(i.solutions)&&i.solutions.length>0?i.example=!0===r?null!==(n=i.solutions[i.solutions.length-1])&&void 0!==n?n:void 0:r:o(e,t,r,i)}(e,r,l,n);break;case i.RootBitType.mark:!function(e,t,r,i){i.isDefaultExample=!0,i.example=void 0}(0,0,0,n);break;default:o(e,r,l,n)}}},9577:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.gapChainContentProcessor=void 0;const o=r(9046),s=r(4471),n=r(6831),a=new o.Builder;t.gapChainContentProcessor=function(e,t,r,o,l,u){if(t===n.BitContentLevel.Chain)(0,s.clozeTagContentProcessor)(e,n.BitContentLevel.Chain,r,o,l);else{const t=function(e,t,r){var o;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("gap content",r);const s=[r,...null!==(o=r.chain)&&void 0!==o?o:[]],l=e.bitContentProcessor(n.BitContentLevel.Chain,t,s);e.DEBUG_CHAIN_TAGS&&e.debugPrint("gap TAGS",l);const{solutions:u}=l,c=i(l,["solutions"]),d=a.gap(Object.assign(Object.assign({solutions:null!=u?u:[]},c),{isCaseSensitive:!0}));return d}(e,r,o);t&&u.push(t)}}},9457:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.itemLeadTagContentProcessor=void 0;const i=r(3633);t.itemLeadTagContentProcessor=function(e,t,r,o,s,n){const{value:a}=o,l=i.StringUtils.trimmedString(a);n?s.lead=l:s.item=l}},857:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markChainContentProcessor=void 0;const o=r(9046),s=r(7646),n=r(3298),a=r(6831),l=new o.Builder;t.markChainContentProcessor=function(e,t,r,o,u,c){if(t===a.BitContentLevel.Chain)(0,n.markTagContentProcessor)(e,a.BitContentLevel.Chain,r,o,u);else{const t=function(e,t,r){var o,n;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",r);const u=[r,...null!==(o=r.chain)&&void 0!==o?o:[]],c=e.bitContentProcessor(a.BitContentLevel.Chain,t,u);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",c);const{solution:d,mark:p}=c,h=i(c,["solution","mark"]),y=l.mark(Object.assign({solution:null!=d?d:"",mark:null!==(n=s.ArrayUtils.asSingle(p))&&void 0!==n?n:""},h));return y}(e,r,o);t&&c.push(t)}}},2595:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markConfigChainContentProcessor=void 0;const o=r(9046),s=r(3633),n=r(6831),a=new o.Builder;t.markConfigChainContentProcessor=function(e,t,r,o,l){var u;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",o);const c=l.markConfig;if(!c)return;const d=e.bitContentProcessor(n.BitContentLevel.Chain,r,o.chain),{mark:p}=d,h=i(d,["mark"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",h);const y=null!==(u=s.StringUtils.trimmedString(o.value))&&void 0!==u?u:"unknown",g=a.markConfig(Object.assign({mark:y,emphasis:"underline"},h));c.push(g)}},3298:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.markTagContentProcessor=void 0;const i=r(3633);t.markTagContentProcessor=function(e,t,r,o,s){const{value:n}=o;i.StringUtils.isString(n)&&(s.solution=n)}},8326:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.partnerChainContentProcessor=void 0;const i=r(9046),o=r(1895),s=r(3633),n=r(6831),a=new i.Builder;t.partnerChainContentProcessor=function(e,t,r,i,l){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("partner content",i);const u=e.bitContentProcessor(n.BitContentLevel.Chain,r,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("partner TAGS",u);const{resources:c}=u,d=s.StringUtils.trimmedString(i.value),p=function(e,t){let r;const i=[];if(t)for(const e of t.reverse())r||o.ResourceType.image!==e.type?i.push(e):r=e;i.length>0&&(e.parser.excessResources=i,e.addWarning(`${i.length} excess resource(s) present in the [@parter] chain.`));return r}(e,c),h=a.partner({name:d,avatarImage:p});l.partner=h}},3287:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propertyContentProcessor=void 0;const i=r(4719),o=r(672),s=r(994),n=r(3633),a=r(4185),l=r(4787),u=r(2595),c=r(8326),d=r(6831);t.propertyContentProcessor=function(e,t,r,p,h){const{key:y,value:g}=p,f=t===d.BitContentLevel.Chain;if(y===i.PropertyKey.example)return void(0,l.exampleTagContentProcessor)(e,t,r,p,h);if(y===i.PropertyKey.partner)return void(0,c.partnerChainContentProcessor)(e,t,r,p,h);if(y===i.PropertyKey.book)return void(0,a.bookChainContentProcessor)(e,t,r,p,h);if(y===i.PropertyKey.mark&&!f)return void(0,u.markConfigChainContentProcessor)(e,t,r,p,h);const m=(e,t,r)=>{var a;const l=null!==(a=i.PropertyKey.getMetadata(i.PropertyKey.fromValue(t)))&&void 0!==a?a:{};if(l.astKey&&(t=l.astKey),l.isTrimmedString&&(r=n.StringUtils.isString(r)?n.StringUtils.trimmedString(r):void 0),l.isNumber&&(r=s.NumberUtils.asNumber(r)),l.isBoolean&&(r=o.BooleanUtils.toBoolean(r,!0)),l.isInvertedBoolean&&(r=!o.BooleanUtils.toBoolean(r,!0)),l.isSingle)e[t]=r;else if(Object.prototype.hasOwnProperty.call(e,t)){const i=e[t];e[t]=[...i,r]}else e[t]=[r]};i.PropertyKey.fromValue(y)?m(h,y,g):m(h.extraProperties,y,g)}},3130:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.referenceTagContentProcessor=void 0;const i=r(3633);t.referenceTagContentProcessor=function(e,t,r,o,s,n){const{value:a}=o,l=i.StringUtils.trimmedString(a);n?s.referenceEnd=l:s.reference=l}},5516:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resourceContentProcessor=t.buildResource=void 0;const i=r(8703),o=r(208),s=r(1895),n=r(4598),a=r(6831),l=new i.ResourceBuilder;t.buildResource=function(e,t,r,i){let a,u;const c=[],d=o.RootBitType.getMetadata(t.root),p=null==d?void 0:d.resourceAttachmentAllowed,h=p?r:void 0,y=n.BitUtils.calculateValidResourceType(t,h,void 0);if(y===s.ResourceType.stillImageFilm){if(i){let e,t;u=[];for(const r of i.reverse())e||s.ResourceType.image!==r.type?t||s.ResourceType.audio!==r.type?u.push(r):t=r:e=r;a=l.stillImageFilmResource({image:e,audio:t})}}else u=i;if(u)for(const e of u.reverse())a||y!==e.type?c.push(e):a=e;if(!p&&r){let t=`Resource type '&${r}' is specified in the bit header, but no extra resource is allowed for this bit.`;y&&(t+=` The resource type '&${y}' is automatically expected and should not be added.`),e.addWarning(t)}if(a||(r?e.addWarning(`Resource type '&${r}' is specified in the bit header, but no such a resource is present in the bit`):y&&e.addWarning(`Resource type '&${y}' is required but is not present in the bit`)),c.length>0){e.parser.excessResources=c;let t=`${c.length} excess resource(s) present in the bit.`;if(y===o.RootBitType.stillImageFilm)t+=" The expected resource types are '&image' and '&audio'";else{t+=` The expected resource type is '${y?`&${y}`:"NONE"}'`}e.addWarning(t)}return a},t.resourceContentProcessor=function(e,t,r,i,o){const{type:n,key:u,value:c,chain:d}=i,p=o.resources;if(!p)return;const h=s.ResourceType.fromValue(u);if(h){const t=e.bitContentProcessor(a.BitContentLevel.Chain,r,d),i=l.resource(Object.assign({type:h,value:c},t));i&&p.push(i)}}},1838:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildTitles=t.titleTagContentProcessor=void 0;const i=r(208),o=r(3633);t.titleTagContentProcessor=function(e,t,r,i,s){const{value:n}=i,a=s.title;if(!a)return;const l=n,u=o.StringUtils.trimmedString(l.title);a[l.level.length]=u},t.buildTitles=function(e,t,r){var o,s;switch(r=null!=r?r:[],t.root){case i.RootBitType.chapter:{let e;return r.length>0&&(e=r[r.length-1]),{title:e,level:r.length>0?r.length-1:void 0}}case i.RootBitType.book:default:return{title:null!==(o=r[1])&&void 0!==o?o:void 0,subtitle:null!==(s=r[2])&&void 0!==s?s:void 0}}}},4177:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseChainContentProcessor=void 0;const o=r(9046),s=r(208),n=r(8660),a=r(6831),l=new o.Builder;t.trueFalseChainContentProcessor=function(e,t,r,o,u,c){t===a.BitContentLevel.Chain?(0,n.trueFalseTagContentProcessor)(e,a.BitContentLevel.Chain,r,o,u):function(e,t,r,o,n,u){var c;const d=[o,...null!==(c=o.chain)&&void 0!==c?c:[]],p=n.statements,h=n.choices,y=n.responses;if(!(p&&h&&y&&u))return;if(r.root===s.RootBitType.trueFalse1)n.statement=function(e,t,r){if(t.root!==s.RootBitType.trueFalse1)return;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (statement)",r);const o=e.bitContentProcessor(a.BitContentLevel.Chain,t,r),{trueFalse:n}=o,u=i(o,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (statement)",u);let c;n&&n.length>0&&(c=l.statement(Object.assign(Object.assign({},n[0]),u)));return c}(e,r,d);else if(r.root===s.RootBitType.trueFalse||r.root===s.RootBitType.multipleChoice||r.root===s.RootBitType.multipleChoice1||r.root===s.RootBitType.multipleResponse||r.root===s.RootBitType.multipleResponse1){const t=function(e,t,r){const o=t.root===s.RootBitType.trueFalse,n=t.root===s.RootBitType.multipleChoice||t.root===s.RootBitType.multipleChoice1,u=t.root===s.RootBitType.multipleResponse||t.root===s.RootBitType.multipleResponse1;if(!o&&!n&&!u)return{};const c=[],d=[],p=[],h=e.splitBitContent(r,[a.TypeKey.True,a.TypeKey.False]);e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (choices/responses)",h);for(const r of h){const s=e.bitContentProcessor(a.BitContentLevel.Chain,t,r),{trueFalse:h}=s,y=i(s,["trueFalse"]);if(e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (choices/responses)",y),o){if(h&&h.length>0){const e=l.statement(Object.assign(Object.assign({},h[0]),y));c.push(e)}}else if(n){if(h&&h.length>0){const e=l.choice(Object.assign(Object.assign({},h[0]),y));d.push(e)}}else if(u&&h&&h.length>0){const e=l.response(Object.assign(Object.assign({},h[0]),y));p.push(e)}}const y={};o?y.statements=c:n?y.choices=d:u&&(y.responses=p);return y}(e,r,d);t.statements&&p.push(...t.statements),t.choices&&h.push(...t.choices),t.responses&&y.push(...t.responses)}else if(r.root===s.RootBitType.highlightText){const t=function(e,t,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("highlight content",r);const o=e.bitContentProcessor(a.BitContentLevel.Chain,t,r),{trueFalse:s}=o,n=i(o,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("highlight TAGS",Object.assign({trueFalse:s},n));const u=[];if(s)for(const e of s)u.push(l.highlightText(Object.assign(Object.assign({},e),{isHighlighted:!1})));const c=l.highlight(Object.assign({texts:u},n));return c}(e,r,d);t&&u.push(t)}else{const t=function(e,t,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("select content",r);const o=e.bitContentProcessor(a.BitContentLevel.Chain,t,r),{trueFalse:s}=o,n=i(o,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("select TAGS",Object.assign({trueFalse:s},n));const u=[];if(s)for(const e of s)u.push(l.selectOption(e));const c=l.select(Object.assign({options:u},n));return c}(e,r,d);t&&u.push(t)}}(e,0,r,o,u,c)}},8660:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseTagContentProcessor=void 0;const i=r(3633),o=r(6831);t.trueFalseTagContentProcessor=function(e,t,r,s,n){const{type:a,value:l}=s,u=n.trueFalse;if(!u)return;const c=i.StringUtils.trimmedString(l);u.push({text:c,isCorrect:a===o.TypeKey.True,isDefaultExample:!1})}},2434:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JsonParser=void 0;const i=r(9046),o=r(8703),s=r(6300),n=r(208),a=r(1060),l=r(1895),u=r(1353),c=r(3633),d=new i.Builder,p=new o.ResourceBuilder;t.JsonParser=class{constructor(){this.textGenerator=new s.TextGenerator}toAst(e){const t=this.preprocessJson(e),r=[];for(const e of t){const{bit:t}=e,i=this.bitToAst(t);i&&r.push(i)}const i=r.length>0?{bits:r}:{};return d.bitmark(i)}preprocessJson(e){const t=[];if(c.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return[]}}const r=e=>{if(this.isBitWrapper(e)){const r=e;t.push(r)}else if(this.isBit(e)){const r=e;t.push(this.bitToBitWrapper(r))}};if(Array.isArray(e))for(const t of e)r(t);else r(e);return t}isBitWrapper(e){if(Object.prototype.hasOwnProperty.call(e,"bit")){const t=e;return this.isBit(t.bit)}return!1}isBit(e){if(Object.prototype.hasOwnProperty.call(e,"type")){const t=e;return n.BitTypeUtils.getBitType(t.type).root!==n.RootBitType._error}return!1}bitToBitWrapper(e){return{bit:e}}bitToAst(e){var t;const{type:r,format:i,id:o,externalId:s,spaceId:a,padletId:l,AIGenerated:c,releaseVersion:p,ageRange:h,language:y,computerLanguage:g,target:f,tag:m,icon:b,iconTag:v,colorTag:T,subtype:A,coverImage:P,publisher:_,publications:x,author:w,date:S,location:O,theme:R,kind:k,action:C,thumbImage:E,focusX:I,focusY:j,duration:B,deeplink:L,externalLink:N,externalLinkText:M,videoCallLink:U,bot:K,list:D,textReference:V,isTracked:F,isInfoOnly:G,labelTrue:H,labelFalse:$,quotedPerson:q,book:J,title:z,subtitle:W,level:Y,toc:X,progress:Q,anchor:Z,reference:ee,referenceEnd:te,item:re,lead:ie,hint:oe,instruction:se,example:ne,partner:ae,marks:le,resource:ue,body:ce,sampleSolution:de,elements:pe,statement:he,isCorrect:ye,cards:ge,statements:fe,responses:me,quizzes:be,heading:ve,pairs:Te,matrix:Ae,choices:Pe,questions:_e,footer:xe,placeholders:we}=e,Se=n.BitTypeUtils.getBitType(r),Oe=null!==(t=u.TextFormat.fromValue(i))&&void 0!==t?t:u.TextFormat.bitmarkMinusMinus,Re=this.resourceBitToAst(ue),ke=this.bodyToAst(ce,Oe,we),Ce=this.partnerBitToAst(ae),Ee=this.markConfigBitToAst(le),Ie=this.flashcardBitsToAst(ge),je=this.statementBitsToAst(he,ye,fe,ne),Be=this.responseBitsToAst(Se,me),Le=this.quizBitsToAst(Se,be),Ne=this.headingBitToAst(ve),Me=this.pairBitsToAst(Te),Ue=this.matrixBitsToAst(Ae),Ke=this.choiceBitsToAst(Pe),De=this.questionBitsToAst(_e),Ve=this.botResponseBitsToAst(Se,me),Fe=this.footerToAst(xe,Oe),{reference:Ge,referenceProperty:He}=this.referenceToAst(ee);return d.bit(Object.assign(Object.assign(Object.assign({bitType:Se,textFormat:i,id:o,externalId:s,spaceId:a,padletId:l,aiGenerated:c,releaseVersion:p,ageRange:h,language:y,computerLanguage:g,target:f,tag:m,icon:b,iconTag:v,colorTag:T,subtype:A,coverImage:P,publisher:_,publications:x,author:w,date:S,location:O,theme:R,kind:k,action:C,duration:B,referenceProperty:He,thumbImage:E,focusX:I,focusY:j,deeplink:L,externalLink:N,externalLinkText:M,videoCallLink:U,bot:K,list:D,textReference:V,isTracked:F,isInfoOnly:G,labelTrue:H,labelFalse:$,quotedPerson:q,book:J,title:this.parseText(z),subtitle:this.parseText(W),level:Y,toc:X,progress:Q,anchor:Z,reference:Ge,referenceEnd:te},this.parseItemLeadHintInstruction(re,ie,oe,se)),this.parseExample(ne)),{partner:Ce,markConfig:Ee,resource:Re,body:ke,sampleSolution:de,elements:pe,flashcards:Ie,statements:je,responses:Be,quizzes:Le,heading:Ne,pairs:Me,matrix:Ue,choices:Ke,questions:De,botResponses:Ve,footer:Fe}))}partnerBitToAst(e){let t;if(e){const r=this.resourceDataToAst(l.ResourceType.image,e.avatarImage);t=d.partner({name:e.name,avatarImage:r})}return t}markConfigBitToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{mark:e,color:i,emphasis:o}=r,s=d.markConfig({mark:e,color:i,emphasis:o});t.push(s)}if(0!==t.length)return t}flashcardBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{question:e,answer:i,alternativeAnswers:o,item:s,lead:n,hint:a,instruction:l,example:u}=r,c=d.flashcard(Object.assign(Object.assign({question:e,answer:i,alternativeAnswers:o},this.parseItemLeadHintInstruction(s,n,a,l)),this.parseExample(u)));t.push(c)}if(0!==t.length)return t}statementBitsToAst(e,t,r,i){const o=[];if(e){const r=d.statement(Object.assign({text:e,isCorrect:null!=t&&t},this.parseExample(i)));o.push(r)}if(Array.isArray(r))for(const e of r){const{statement:t,isCorrect:r,item:i,lead:s,hint:n,instruction:a,example:l,isCaseSensitive:u}=e,c=d.statement(Object.assign(Object.assign(Object.assign({text:t,isCorrect:r},this.parseItemLeadHintInstruction(i,s,n,a)),this.parseExample(l)),{isCaseSensitive:u}));o.push(c)}if(0!==o.length)return o}choiceBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{choice:e,isCorrect:i,item:o,lead:s,hint:n,instruction:a,example:l,isCaseSensitive:u}=r,c=d.choice(Object.assign(Object.assign(Object.assign({text:e,isCorrect:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:u}));t.push(c)}if(0!==t.length)return t}responseBitsToAst(e,t){const r=[];if(e.root!==n.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,isCorrect:i,item:o,lead:s,hint:n,instruction:a,example:l,isCaseSensitive:u}=e,c=d.response(Object.assign(Object.assign(Object.assign({text:t,isCorrect:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:u}));r.push(c)}if(0!==r.length)return r}}selectOptionBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{text:e,isCorrect:i,item:o,lead:s,hint:n,instruction:a,example:l,isCaseSensitive:u}=r,c=d.selectOption(Object.assign(Object.assign(Object.assign({text:e,isCorrect:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:u}));t.push(c)}return t}highlightTextBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{text:e,isCorrect:i,isHighlighted:o,item:s,lead:n,hint:a,instruction:l,example:u,isCaseSensitive:c}=r,p=d.highlightText(Object.assign(Object.assign(Object.assign({text:e,isCorrect:i,isHighlighted:o},this.parseItemLeadHintInstruction(s,n,a,l)),this.parseExample(u)),{isCaseSensitive:c}));t.push(p)}return t}quizBitsToAst(e,t){const r=[];if(Array.isArray(t))for(const i of t){const{item:t,lead:o,hint:s,instruction:n,choices:a,responses:l}=i,u=this.choiceBitsToAst(a),c=this.responseBitsToAst(e,l),p=d.quiz(Object.assign(Object.assign({},this.parseItemLeadHintInstruction(t,o,s,n)),{choices:u,responses:c}));r.push(p)}if(0!==r.length)return r}headingBitToAst(e){let t;return e&&(t=d.heading({forKeys:e.forKeys,forValues:e.forValues})),t}pairBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{key:e,keyAudio:i,keyImage:o,values:s,item:n,lead:a,hint:u,instruction:c,example:p,isCaseSensitive:h,isLongAnswer:y}=r,g=this.resourceDataToAst(l.ResourceType.audio,i),f=this.resourceDataToAst(l.ResourceType.image,o),m=d.pair(Object.assign(Object.assign(Object.assign({key:e,keyAudio:g,keyImage:f,values:s},this.parseItemLeadHintInstruction(n,a,u,c)),this.parseExample(p)),{isCaseSensitive:h,isShortAnswer:!y}));t.push(m)}if(0!==t.length)return t}matrixBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const i of e){const{key:e,cells:o,item:s,lead:n,hint:a,instruction:l,example:u,isCaseSensitive:c,isLongAnswer:p}=i,h=d.matrix(Object.assign(Object.assign(Object.assign({key:e,cells:null!==(t=this.matrixCellsToAst(o))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(s,n,a,l)),this.parseExample(u)),{isCaseSensitive:c,isShortAnswer:!p}));r.push(h)}if(0!==r.length)return r}matrixCellsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{values:e,item:i,lead:o,hint:s,instruction:n,example:a}=r,l=d.matrixCell(Object.assign(Object.assign({values:e},this.parseItemLeadHintInstruction(i,o,s,n)),this.parseExample(a)));t.push(l)}if(0!==t.length)return t}questionBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{question:e,partialAnswer:i,sampleSolution:o,item:s,lead:n,hint:a,instruction:l,example:u,isCaseSensitive:c,isShortAnswer:p}=r,h=d.question(Object.assign(Object.assign(Object.assign({question:e,partialAnswer:i,sampleSolution:o},this.parseItemLeadHintInstruction(s,n,a,l)),this.parseExample(u)),{isCaseSensitive:c,isShortAnswer:p}));t.push(h)}if(0!==t.length)return t}botResponseBitsToAst(e,t){const r=[];if(e.root===n.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,reaction:i,feedback:o,item:s,lead:n,hint:a}=e,l=d.botResponse({response:t,reaction:i,feedback:o,item:this.parseText(s),lead:this.parseText(n),hint:this.parseText(a)});r.push(l)}if(0!==r.length)return r}}resourceBitToAst(e){var t;let r;if(e){const i=null!==(t=l.ResourceType.keyFromValue(e.type))&&void 0!==t?t:l.ResourceType.unknown;let o;if(e.type===l.ResourceType.stillImageFilm){const t=e,i=this.resourceDataToAst(l.ResourceType.image,t.image),o=this.resourceDataToAst(l.ResourceType.audio,t.audio);r=p.stillImageFilmResource({image:i,audio:o})}else{if(o=e[i],!o)return;r=this.resourceDataToAst(e.type,o)}}return r}resourceDataToAst(e,t){var r,i;let o;if(t){if(!t)return;const s=c.StringUtils.isString(t)?t:void 0,n=t.url||t.src||t.href||t.app||t.body||s,a=this.resourceDataToAst(l.ResourceType.image,t.posterImage),u=t.thumbnails?t.thumbnails.map((e=>this.resourceDataToAst(l.ResourceType.image,e))):void 0;o=p.resource({type:e,value:n,format:t.format,src1x:t.src1x,src2x:t.src2x,src3x:t.src3x,src4x:t.src4x,caption:this.parseText(t.caption),width:null!==(r=t.width)&&void 0!==r?r:void 0,height:null!==(i=t.height)&&void 0!==i?i:void 0,alt:t.alt,duration:t.duration,mute:t.mute,autoplay:t.autoplay,allowSubtitles:t.allowSubtitles,showSubtitles:t.showSubtitles,posterImage:a,thumbnails:u,siteName:t.siteName,license:t.license,copyright:t.copyright,showInIndex:t.showInIndex})}return o}bodyToAst(e,t,r){let i,o;const s={};if(Array.isArray(e)?(o=this.parseText(e,t),r=this.textGenerator.getPlaceholders()):o=e,r)for(const[e,t]of Object.entries(r)){const r=this.bodyBitToAst(t);s[e]=r}if(o){const e=[],t=c.StringUtils.splitPlaceholders(o,Object.keys(s));for(let r=0,i=t.length;r<i;r++){const i=t[r];if(s[i])e.push(s[i]);else{const t=this.bodyTextToAst(i);e.push(t)}}i=d.body({bodyParts:e})}return i}bodyTextToAst(e){return d.bodyText({text:e})}bodyBitToAst(e){switch(e.type){case a.BodyBitType.gap:return this.gapBitToAst(e);case a.BodyBitType.mark:return this.markBitToAst(e);case a.BodyBitType.select:return this.selectBitToAst(e);case a.BodyBitType.highlight:return this.highlightBitToAst(e)}return this.bodyTextToAst("")}footerToAst(e,t){const r=this.parseText(e,t);if(r)return d.footerText({text:r})}referenceToAst(e){return Array.isArray(e)&&e.length>0?{reference:void 0,referenceProperty:e}:{reference:e,referenceProperty:void 0}}gapBitToAst(e){const{item:t,lead:r,hint:i,instruction:o,example:s,isCaseSensitive:n,solutions:a}=e;return d.gap(Object.assign(Object.assign(Object.assign({solutions:a},this.parseItemLeadHintInstruction(t,r,i,o)),this.parseExample(s)),{isCaseSensitive:n}))}markBitToAst(e){const{solution:t,mark:r,item:i,lead:o,hint:s,instruction:n,example:a}=e;return d.mark(Object.assign(Object.assign({solution:t,mark:r},this.parseItemLeadHintInstruction(i,o,s,n)),this.parseExample(a)))}selectBitToAst(e){const{options:t,prefix:r,postfix:i,item:o,lead:s,hint:n,instruction:a,example:l}=e,u=this.selectOptionBitsToAst(t);return d.select(Object.assign(Object.assign(Object.assign({options:u,prefix:r,postfix:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:!0}))}highlightBitToAst(e){const{texts:t,prefix:r,postfix:i,item:o,lead:s,hint:n,instruction:a,example:l}=e,u=this.highlightTextBitsToAst(t);return d.highlight(Object.assign(Object.assign(Object.assign({texts:u,prefix:r,postfix:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:!0}))}parseItemLeadHintInstruction(e,t,r,i){return{item:this.parseText(e),lead:this.parseText(t),hint:this.parseText(r),instruction:this.parseText(i)}}parseExample(e){if(null==e)return;const t=this.parseText(e);return t?{example:t}:{example:!!e}}parseText(e,t){if(null!=e){if(Array.isArray(e)){return this.textGenerator.generateSync(e,t)}return e}}}},406:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextParser=void 0;const i=r(1353),o=r(8436);t.TextParser=class{toAst(e,t){if(Array.isArray(e))return e;const r=e,s=Object.assign({},t);s.textFormat||(s.textFormat=i.TextFormat.bitmarkMinusMinus);const n=s.textFormat===i.TextFormat.bitmarkPlusPlus?"bitmarkPlusPlus":"bitmarkMinusMinus";return(0,o.parse)(null!=r?r:"",{startRule:n})}}},8436:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const i=r(4764).parse;t.parse=i},7646:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayUtils=void 0;const r=new class{asArray(e){if(null!=e)return Array.isArray(e)?e:[e]}asSingle(e,t){if(null!=e)return Array.isArray(e)?e.length>0?t?e[e.length-1]:e[0]:void 0:e}};t.ArrayUtils=r},4598:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitUtils=void 0;const i=r(208),o=r(1895);const s=new class{calculateValidResourceType(e,t,r){let s;if(t&&(s=o.ResourceType.fromValue(t)),!s&&r&&(s=r.type),!s){const t=i.RootBitType.getMetadata(e.root);t&&(s=t.resourceType)}return s}};t.BitUtils=s},672:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanUtils=void 0;const r=new class{isBoolean(e){return!0===e||!1===e}isBooleanString(e){return!!this.isBoolean(e)||("true"===e||"false"===e)}toBoolean(e,t){return t?!1!==e&&"false"!==e:!0===e||"true"===e}};t.BooleanUtils=r},994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NumberUtils=void 0;const r=new class{asNumber(e,t){if(null==e)return null!=t?t:void 0;const r=+e;return Number.isNaN(r)?null!=t?t:void 0:r}};t.NumberUtils=r},4309:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUtils=void 0;const r=new class{isFunction(e){return"[object Function]"===Object.prototype.toString.call(e)}isArray(e){return Array.isArray(e)}isDate(e){return"[object Date]"===Object.prototype.toString.call(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}orderProperties(e,t){const r=e,i=Object.assign({},r);for(const e of Object.keys(r))delete r[e];for(const e of t)Object.prototype.hasOwnProperty.call(i,e)&&(r[e]=i[e])}removeUndefinedProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||null==i&&delete r[e]}removeFalseProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||!1===i&&delete r[e]}removeEmptyStringProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||""===i&&delete r[e]}removeEmptyArrayProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||Array.isArray(i)&&0===i.length&&delete r[e]}removeEmptyObjectProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||this.isObject(i)&&0===Object.keys(i).length&&delete r[e]}removeUnwantedProperties(e,t){(t=Object.assign({},t)).ignoreAllUndefined||this.removeUndefinedProperties(e,t.ignoreUndefined),t.ignoreAllFalse||this.removeFalseProperties(e,t.ignoreFalse),t.ignoreAllEmptyString||this.removeEmptyStringProperties(e,t.ignoreEmptyString),t.ignoreAllEmptyArrays||this.removeEmptyArrayProperties(e,t.ignoreEmptyArrays),t.ignoreAllEmptyObjects||this.removeEmptyObjectProperties(e,t.ignoreEmptyObjects)}extractSingleValue(e,t){if(!e)return;const r=e;if(null==r[t])return;let i=r[t];if(Array.isArray(i)){if(0===i.length)return;i=i[i.length-1]}return i}};t.ObjectUtils=r},3633:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StringUtils=void 0;const r=new class{isString(e){return"string"==typeof e||e instanceof String}trimmedString(e){return e?`${e}`.trim():""}splitPlaceholders(e,t){let r=[e];const i=(e,t)=>{const r=[];for(const i of e){const e=i.split(t);for(let i=0,o=e.length;i<o;i++){const s=e[i],n=i===o-1;r.push(s),n||r.push(t)}}return r};for(const e of t)r=i(r,e);return r}firstLine(e,t){const r=e;if(null==t&&(t=e.length),t<1||null==e||e.length<=t)return r;const i=e.split("\n");return i.length>0?i[0].substring(0,t):r}wordWrap(e,t){const r=[];if(t<1||null==e||e.length<=t)return r;const i=e.length,o=i-t;let s,n=0;for(;n<o;){let i;const o=n+t,a=e.indexOf("\n",n);if(a>-1&&a>n&&a<o){i=a-n,s=e.substr(n,i),n=n+i+1,r.push(s);continue}const l=e.lastIndexOf(" ",o);let u=0;l>-1&&l!=n-1?(i=l-n,i>0&&(u=n+i+1)):(i=t,u=n+t),s=e.substr(n,i),n=u,r.push(s.trim())}return n<i&&(s=e.substr(n),r.push(s)),r}};t.StringUtils=r},169:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UrlUtils=void 0;const r=new class{fileExtensionFromUrl(e){let t;if(e)try{const r=new URL(e).pathname.split(".");r.length>1&&(t=r[r.length-1])}catch(e){}return t}domainFromUrl(e){let t;if(e)try{t=new URL(e).hostname}catch(e){}return t}};t.UrlUtils=r},671:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.initEnv=t.env=void 0;const i=r(2164),o=r(7619),s=r(306),n=r(9870);const a=new class{constructor(){Object.defineProperty(this,"userAgentInfo",{value:(0,n.parseUserAgent)(),enumerable:!1}),this.bootTimestamp=Date.now(),this.app="",this.appVersion=s.EMPTY_VERSION,this.environment=this.getEnvironment(),this.environmentVersion=this.getEnvironmentVersion(),this.isBrowser=this.getIsBrowser(),this.isNode=this.environment===i.Environment.node,this.isCI=this.getIsCI(),this.NODE_ENV=this.getNodeEnv(),this.os=this.getOs(),this.osVersion=this.getOsVersion()}init(e,t){this.app=e,this.appVersion=this.parseMMBVersion(t)}get upTimestamp(){return Date.now()-this.bootTimestamp}getEnvironment(){return this.userAgentInfo?this.userAgentInfo.browser:"undefined"!=typeof process&&void 0!==process.versions&&process.versions.node?i.Environment.node:i.Environment.unknown}getEnvironmentVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.browserVersion):"undefined"!=typeof process?this.parseMMBVersion(process.version):s.EMPTY_VERSION}getOs(){return this.userAgentInfo?this.userAgentInfo.os:("undefined"!=typeof process&&void 0!==process.versions&&process.versions.node,o.Os.unknown)}getOsVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.osVersion):"undefined"!=typeof process?this.parseMMBVersion(""):s.EMPTY_VERSION}getIsBrowser(){return!("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof navigator||!navigator.userAgent)}getIsCI(){return!("undefined"==typeof process||!process.env||!process.env.CI)}getNodeEnv(){return"undefined"!=typeof process&&process.env?"production":""}parseMMBVersion(e){if(!e)return s.EMPTY_VERSION;e.startsWith("v")&&(e=e.substring(1));const t=e.split(".",1e3);let r="",i="",o="",n="";for(let e=0,s=t.length;e<s;e++){const s=t[e];0===e?r=s:1===e?i=s:2===e?n=s:3===e&&(o=s)}return{full:e,major:r,minor:i,patch:n,build:o}}};t.env=a;const l=a.init.bind(a);t.initEnv=l},2164:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Environment=void 0;const i=(0,r(6688).superenum)({unknown:"",node:"node",chrome:"chrome",safari:"safari",firefox:"firefox",edge:"edge",ie:"ie"});t.Environment=i},7619:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Os=void 0;const i=(0,r(6688).superenum)({unknown:"",macos:"macos",windows:"windows",linux:"linux",android:"android",ios:"ios"});t.Os=i},306:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_VERSION=void 0;t.EMPTY_VERSION={full:"",major:"",minor:"",patch:"",build:""}},9870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUserAgent=void 0;const i=r(2164),o=r(7619);t.parseUserAgent=function(){if("undefined"==typeof window||!window.navigator||!window.navigator.userAgent)return;const e={browser:i.Environment.unknown,os:o.Os.unknown},t=function(e){const t=e.toLowerCase().split(new RegExp("[ /,;()]","g")).reduce(((e,t)=>(t&&e.push(t),e)),[]),r={keys:new Set,versions:{}};let i="";for(let e=0,o=t.length;e<o;e++){const o=t[e];let s=!1;for(let e=0;e<=9;e++)if(o.startsWith(`${e}`)){s=!0;break}s?r.versions[i]=o.replace("_","."):r.keys.add(o),i=o}return r}(window.navigator.userAgent),r=t.keys.has("firefox"),s=t.keys.has("chrome"),n=t.keys.has("chromium"),a=t.keys.has("safari"),l=s,u=r,c=t.keys.has("macintosh");return a&&!s&&!n?(e.browser=i.Environment.safari,e.browserVersion=t.versions.version):l?(e.browser=i.Environment.chrome,e.browserVersion=t.versions.chrome):u&&(e.browser=i.Environment.firefox,e.browserVersion=t.versions.firefox),c&&(e.os=o.Os.macos,e.osVersion=t.versions.x),e}}},t={};function r(i){var o=t[i];if(void 0!==o)return o.exports;var s=t[i]={exports:{}};return e[i].call(s.exports,s,s.exports,r),s.exports}r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{var e=i;Object.defineProperty(e,"__esModule",{value:!0}),e.StreamWriter=e.FileWriter=e.BitmarkFileGenerator=e.JsonFileGenerator=e.CardSetVersion=e.BitmarkVersion=e.BitmarkParserType=e.NodeType=e.ResourceType=e.TextFormat=e.BitTypeUtils=e.AliasBitType=e.RootBitType=e.StringWriter=e.BitmarkStringGenerator=e.BitmarkGenerator=e.BitmarkParser=e.JsonStringGenerator=e.JsonGenerator=e.JsonParser=e.Ast=e.ResourceBuilder=e.Builder=e.Output=e.BitmarkParserGenerator=void 0;const t=r(7087);var o=r(390);Object.defineProperty(e,"BitmarkParserGenerator",{enumerable:!0,get:function(){return o.BitmarkParserGenerator}}),Object.defineProperty(e,"Output",{enumerable:!0,get:function(){return o.Output}});var s=r(9046);Object.defineProperty(e,"Builder",{enumerable:!0,get:function(){return s.Builder}});var n=r(8703);Object.defineProperty(e,"ResourceBuilder",{enumerable:!0,get:function(){return n.ResourceBuilder}});var a=r(8256);Object.defineProperty(e,"Ast",{enumerable:!0,get:function(){return a.Ast}});var l=r(2434);Object.defineProperty(e,"JsonParser",{enumerable:!0,get:function(){return l.JsonParser}});var u=r(3857);Object.defineProperty(e,"JsonGenerator",{enumerable:!0,get:function(){return u.JsonGenerator}});var c=r(5132);Object.defineProperty(e,"JsonStringGenerator",{enumerable:!0,get:function(){return c.JsonStringGenerator}});var d=r(9556);Object.defineProperty(e,"BitmarkParser",{enumerable:!0,get:function(){return d.BitmarkParser}});var p=r(297);Object.defineProperty(e,"BitmarkGenerator",{enumerable:!0,get:function(){return p.BitmarkGenerator}});var h=r(8582);Object.defineProperty(e,"BitmarkStringGenerator",{enumerable:!0,get:function(){return h.BitmarkStringGenerator}});var y=r(227);Object.defineProperty(e,"StringWriter",{enumerable:!0,get:function(){return y.StringWriter}});var g=r(208);Object.defineProperty(e,"RootBitType",{enumerable:!0,get:function(){return g.RootBitType}}),Object.defineProperty(e,"AliasBitType",{enumerable:!0,get:function(){return g.AliasBitType}}),Object.defineProperty(e,"BitTypeUtils",{enumerable:!0,get:function(){return g.BitTypeUtils}});var f=r(1353);Object.defineProperty(e,"TextFormat",{enumerable:!0,get:function(){return f.TextFormat}});var m=r(1895);Object.defineProperty(e,"ResourceType",{enumerable:!0,get:function(){return m.ResourceType}});var b=r(549);Object.defineProperty(e,"NodeType",{enumerable:!0,get:function(){return b.NodeType}});var v=r(6958);Object.defineProperty(e,"BitmarkParserType",{enumerable:!0,get:function(){return v.BitmarkParserType}});var T=r(8791);Object.defineProperty(e,"BitmarkVersion",{enumerable:!0,get:function(){return T.BitmarkVersion}});var A=r(8565);Object.defineProperty(e,"CardSetVersion",{enumerable:!0,get:function(){return A.CardSetVersion}});(0,t.init)()})(),i})()));