@gmb/bitmark-parser-generator 1.4.16 → 1.4.18
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.
- package/dist/browser/bitmark-parser-generator.min.js +1 -1
- package/dist/browser/bundle-report.html +2 -2
- package/dist/cjs/BitmarkParserGenerator.js +2 -13
- package/dist/cjs/BitmarkParserGenerator.js.map +1 -1
- package/dist/cjs/ast/Builder.js +8 -8
- package/dist/cjs/ast/Builder.js.map +1 -1
- package/dist/cjs/ast/rules/NodeValidator.js +6 -23
- package/dist/cjs/ast/rules/NodeValidator.js.map +1 -1
- package/dist/cjs/config/Config.js +57 -86
- package/dist/cjs/config/Config.js.map +1 -1
- package/dist/cjs/config/raw/bits.js +388 -450
- package/dist/cjs/config/raw/bits.js.map +1 -1
- package/dist/cjs/config/raw/properties.js +37 -0
- package/dist/cjs/config/raw/properties.js.map +1 -1
- package/dist/cjs/generated/build-info.js +1 -1
- package/dist/cjs/generator/bitmark/BitmarkGenerator.js +9 -11
- package/dist/cjs/generator/bitmark/BitmarkGenerator.js.map +1 -1
- package/dist/cjs/generator/json/JsonGenerator.js +236 -208
- package/dist/cjs/generator/json/JsonGenerator.js.map +1 -1
- package/dist/cjs/index.js +2 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/info/InfoBuilder.js +10 -33
- package/dist/cjs/info/InfoBuilder.js.map +1 -1
- package/dist/cjs/model/ast/NodeType.js +16 -0
- package/dist/cjs/model/ast/NodeType.js.map +1 -1
- package/dist/cjs/model/config/BitConfig.js +8 -7
- package/dist/cjs/model/config/BitConfig.js.map +1 -1
- package/dist/cjs/model/config/enum/PropertyConfigKey.js +7 -0
- package/dist/cjs/model/config/enum/PropertyConfigKey.js.map +1 -1
- package/dist/cjs/model/enum/BitType.js +86 -84
- package/dist/cjs/model/enum/BitType.js.map +1 -1
- package/dist/cjs/model/enum/PropertyAstKey.js +2 -0
- package/dist/cjs/model/enum/PropertyAstKey.js.map +1 -1
- package/dist/cjs/model/enum/PropertyTag.js +5 -0
- package/dist/cjs/model/enum/PropertyTag.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js +14 -14
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js +6 -6
- package/dist/cjs/parser/bitmark/peg/BitmarkPegParserValidator.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +11 -10
- package/dist/cjs/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +52 -47
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/{CommentTagContentProcessor.js → InternalCommentTagContentProcessor.js} +5 -5
- package/dist/cjs/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.js.map +1 -0
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PartnerChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +2 -2
- package/dist/cjs/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js +15 -17
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js +14 -11
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js.map +1 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +1 -1
- package/dist/cjs/parser/json/JsonParser.js +9 -9
- package/dist/cjs/parser/json/JsonParser.js.map +1 -1
- package/dist/cjs/utils/ObjectUtils.js +62 -0
- package/dist/cjs/utils/ObjectUtils.js.map +1 -1
- package/dist/esm/BitmarkParserGenerator.js +2 -13
- package/dist/esm/BitmarkParserGenerator.js.map +1 -1
- package/dist/esm/ast/Builder.js +9 -9
- package/dist/esm/ast/Builder.js.map +1 -1
- package/dist/esm/ast/rules/NodeValidator.js +6 -23
- package/dist/esm/ast/rules/NodeValidator.js.map +1 -1
- package/dist/esm/config/Config.js +57 -86
- package/dist/esm/config/Config.js.map +1 -1
- package/dist/esm/config/raw/bits.js +389 -451
- package/dist/esm/config/raw/bits.js.map +1 -1
- package/dist/esm/config/raw/properties.js +37 -0
- package/dist/esm/config/raw/properties.js.map +1 -1
- package/dist/esm/generated/build-info.js +1 -1
- package/dist/esm/generator/bitmark/BitmarkGenerator.js +10 -12
- package/dist/esm/generator/bitmark/BitmarkGenerator.js.map +1 -1
- package/dist/esm/generator/json/JsonGenerator.js +237 -209
- package/dist/esm/generator/json/JsonGenerator.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/info/InfoBuilder.js +11 -34
- package/dist/esm/info/InfoBuilder.js.map +1 -1
- package/dist/esm/model/ast/NodeType.js +16 -0
- package/dist/esm/model/ast/NodeType.js.map +1 -1
- package/dist/esm/model/config/BitConfig.js +8 -7
- package/dist/esm/model/config/BitConfig.js.map +1 -1
- package/dist/esm/model/config/enum/PropertyConfigKey.js +7 -0
- package/dist/esm/model/config/enum/PropertyConfigKey.js.map +1 -1
- package/dist/esm/model/enum/BitType.js +85 -82
- package/dist/esm/model/enum/BitType.js.map +1 -1
- package/dist/esm/model/enum/PropertyAstKey.js +2 -0
- package/dist/esm/model/enum/PropertyAstKey.js.map +1 -1
- package/dist/esm/model/enum/PropertyTag.js +5 -0
- package/dist/esm/model/enum/PropertyTag.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js +15 -15
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js +6 -6
- package/dist/esm/parser/bitmark/peg/BitmarkPegParserValidator.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js +12 -11
- package/dist/esm/parser/bitmark/peg/contentProcessors/CardContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js +53 -48
- package/dist/esm/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/{CommentTagContentProcessor.js → InternalCommentTagContentProcessor.js} +5 -5
- package/dist/esm/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.js.map +1 -0
- package/dist/esm/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/PartnerChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js +2 -2
- package/dist/esm/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js +16 -18
- package/dist/esm/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js +15 -12
- package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.js.map +1 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.js.map +1 -1
- package/dist/esm/parser/json/JsonParser.js +10 -10
- package/dist/esm/parser/json/JsonParser.js.map +1 -1
- package/dist/esm/utils/ObjectUtils.js +59 -0
- package/dist/esm/utils/ObjectUtils.js.map +1 -1
- package/dist/types/BitmarkParserGenerator.d.ts.map +1 -1
- package/dist/types/ast/Builder.d.ts +9 -2
- package/dist/types/ast/Builder.d.ts.map +1 -1
- package/dist/types/ast/rules/NodeValidator.d.ts +0 -1
- package/dist/types/ast/rules/NodeValidator.d.ts.map +1 -1
- package/dist/types/config/Config.d.ts +16 -28
- package/dist/types/config/Config.d.ts.map +1 -1
- package/dist/types/config/raw/bits.d.ts.map +1 -1
- package/dist/types/config/raw/properties.d.ts.map +1 -1
- package/dist/types/generator/bitmark/BitmarkGenerator.d.ts +4 -4
- package/dist/types/generator/bitmark/BitmarkGenerator.d.ts.map +1 -1
- package/dist/types/generator/json/JsonGenerator.d.ts +22 -22
- package/dist/types/generator/json/JsonGenerator.d.ts.map +1 -1
- package/dist/types/generator/text/TextGenerator.d.ts +2 -2
- package/dist/types/generator/text/TextGenerator.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/info/InfoBuilder.d.ts +3 -4
- package/dist/types/info/InfoBuilder.d.ts.map +1 -1
- package/dist/types/model/ast/NodeType.d.ts +32 -0
- package/dist/types/model/ast/NodeType.d.ts.map +1 -1
- package/dist/types/model/ast/Nodes.d.ts +9 -2
- package/dist/types/model/ast/Nodes.d.ts.map +1 -1
- package/dist/types/model/config/BitConfig.d.ts +5 -4
- package/dist/types/model/config/BitConfig.d.ts.map +1 -1
- package/dist/types/model/config/_Config.d.ts +3 -5
- package/dist/types/model/config/_Config.d.ts.map +1 -1
- package/dist/types/model/config/enum/ConfigKey.d.ts +14 -0
- package/dist/types/model/config/enum/ConfigKey.d.ts.map +1 -1
- package/dist/types/model/config/enum/PropertyConfigKey.d.ts +21 -0
- package/dist/types/model/config/enum/PropertyConfigKey.d.ts.map +1 -1
- package/dist/types/model/enum/BitType.d.ts +171 -178
- package/dist/types/model/enum/BitType.d.ts.map +1 -1
- package/dist/types/model/enum/PropertyAstKey.d.ts +4 -0
- package/dist/types/model/enum/PropertyAstKey.d.ts.map +1 -1
- package/dist/types/model/enum/PropertyTag.d.ts +10 -0
- package/dist/types/model/enum/PropertyTag.d.ts.map +1 -1
- package/dist/types/model/json/BitJson.d.ts +5 -0
- package/dist/types/model/json/BitJson.d.ts.map +1 -1
- package/dist/types/model/json/ParserJson.d.ts +1 -1
- package/dist/types/model/json/ParserJson.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/BitmarkPegParserProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts +6 -6
- package/dist/types/parser/bitmark/peg/BitmarkPegParserTypes.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/BitmarkPegParserValidator.d.ts +6 -6
- package/dist/types/parser/bitmark/peg/BitmarkPegParserValidator.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/BookChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/CardContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/CardContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/ClozeTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/DefaultTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/ExampleTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/GapChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/ImageSourceChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.d.ts +5 -0
- package/dist/types/parser/bitmark/peg/contentProcessors/InternalCommentTagContentProcessor.d.ts.map +1 -0
- package/dist/types/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/ItemLeadTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/MarkChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/MarkConfigChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/MarkTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/PartnerChainContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/PartnerChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/PropertyContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/ReferenceTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.d.ts +3 -3
- package/dist/types/parser/bitmark/peg/contentProcessors/ResourceContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.d.ts +3 -3
- package/dist/types/parser/bitmark/peg/contentProcessors/TitleTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseChainContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.d.ts +2 -2
- package/dist/types/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.d.ts.map +1 -1
- package/dist/types/parser/json/JsonParser.d.ts.map +1 -1
- package/dist/types/utils/ObjectUtils.d.ts +9 -0
- package/dist/types/utils/ObjectUtils.d.ts.map +1 -1
- package/package.json +3 -1
- package/dist/cjs/parser/bitmark/peg/contentProcessors/CommentTagContentProcessor.js.map +0 -1
- package/dist/esm/parser/bitmark/peg/contentProcessors/CommentTagContentProcessor.js.map +0 -1
- package/dist/types/parser/bitmark/peg/contentProcessors/CommentTagContentProcessor.d.ts +0 -5
- package/dist/types/parser/bitmark/peg/contentProcessors/CommentTagContentProcessor.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 o(e,t){var r;const o=Object.freeze,i=Object.defineProperty,n=Object.assign,a={enumerable:!1},s=new Map,l=new Map,u=new Map,c=new Map,p=new Map,g=(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))s.set(t,r),u.set(t.toLowerCase(),r);for(const[e,t]of s){const r="string"==typeof t?t.toLowerCase():t;l.set(t,e),c.set(r,e)}const d=g.map((e=>s.get(e))),y=g.map((e=>[e,s.get(e)]));return(t=>{let r=e;function f(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?s.get(c.get(e.toLowerCase())):!e||l.has(e)?e:void 0}Object.isExtensible(e)||(r=n({},e)),i(r,"fromKey",n({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?u.get(e.toLowerCase()):s.get(`${e}`)}},a)),i(r,"fromValue",n({value:f},a)),i(r,"keyFromValue",n({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?c.get(e.toLowerCase()):l.get(e)}},a)),i(r,"setMetadata",n({value:function(e,t,r){const o=f(e);o&&p.set(o,t)}},a)),i(r,"getMetadata",n({value:function(e,t){return p.get(e)}},a)),i(r,Symbol.iterator,n({value:function(){let e=0;return{next:()=>e<g.length?{value:s.get(`${g[e++]}`),done:!1}:{done:!0}}}},a)),i(r,"values",n({value:()=>d},a)),i(r,"keys",n({value:()=>g},a)),i(r,"entries",n({value:()=>y},a));let h=r;return(null==t?void 0:t.noFreeze)||(h=o(r),o(g),o(d),o(y)),h})(t)}r.r(t),r.d(t,{superenum:()=>i});const i=o;i.fromObject=o,i.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),o(r,t)}},390:function(e,t,r){var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,i)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=(this&&this.__importStar,this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))});this&&this.__importDefault;Object.defineProperty(t,"__esModule",{value:!0}),t.Output=t.BitmarkParserGenerator=void 0;const a=r(6688),s=r(8256),l=r(8582),u=r(4275),c=r(6958),p=r(9556),g=r(2434),d=r(671),y=r(9677),f=r(7347),h=r(8681),m=r(2606),T=r(1353),b=r(6300),v=r(406),C=(0,a.superenum)({bitmark:"bitmark",json:"json",ast:"ast"});t.Output=C;t.BitmarkParserGenerator=class{constructor(){this.ast=new s.Ast,this.jsonParser=new g.JsonParser,this.bitmarkParser=new p.BitmarkParser,this.textParser=new v.TextParser,this.textGenerator=new b.TextGenerator,this.jsonStringifyPrettify=(e,t,r)=>{const o=!0===t.prettify?2:t.prettify||void 0;return r||!0===t.stringify||void 0!==o?JSON.stringify(e,null,o):e}}version(){return d.env.appVersion.full}info(e){const t=Object.assign({},e),r=new y.InfoBuilder;let o;const i=!t.outputFormat||t.outputFormat===h.InfoFormat.text,n=t.outputFormat===h.InfoFormat.json,a=t.type===f.InfoType.all,s=t.type===f.InfoType.deprecated,l=a||!s,u=a||s;if(t.type===f.InfoType.bit){const e=r.getSupportedBitConfigs().filter((e=>{if(!t.bit)return!0;return m.Config.getBitType(t.bit).root===e.rootBitType}));o=i?e.map((e=>e.toString({includeChains:!0,includeConfigs:!0}))).join("\n\n--------------\n\n"):e}else{const e=r.getSupportedBits({includeNonDeprecated:l,includeDeprecated:u}).filter((e=>{var r;if(!t.bit)return!0;const o=m.Config.getBitType(t.bit);if(e.name===o.root)return!0;return!!(null===(r=e.aliases)||void 0===r?void 0:r.find((e=>e.name===o.alias)))}));o=i?this.supportedBitsAsString(e):e}if(n){const e=!0===t.prettify?2:t.prettify||void 0;o=JSON.stringify(o,null,e)}return o}convert(e,t){return n(this,void 0,void 0,(function*(){let r;const o=Object.assign({},t),i=Object.assign({},o.jsonOptions),a=o.outputFormat,s=a===C.bitmark,p=a===C.json,g=a===C.ast,y=c.BitmarkParserType.peggy;let f=e;if(d.env.isBrowser&&o.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(f)&&(f=fs.readFileSync(f,{encoding:"utf8"}));let h=this.ast.preprocessAst(f);const m=!!h;m||(h=this.jsonParser.toAst(f));const T=!!(null==h?void 0:h.bits),b=e=>n(this,void 0,void 0,(function*(){yield v(e),yield B(r)})),v=e=>n(this,void 0,void 0,(function*(){r=this.bitmarkParser.toAst(e,{parserType:y})})),k=e=>n(this,void 0,void 0,(function*(){if(y===c.BitmarkParserType.peggy)if(h=this.bitmarkParser.toAst(e,{parserType:y}),o.outputFile){const e=new JsonFileGenerator_1.JsonFileGenerator(o.outputFile,o);yield e.generate(h)}else{const e=new u.JsonObjectGenerator(o),t=yield e.generate(h);r=this.jsonStringifyPrettify(t,i)}})),B=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(o);r=yield t.generate(e)}})),x=e=>n(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,i)})),A=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(o),n=yield t.generate(e);r=this.jsonStringifyPrettify(n,i)}})),P=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(o);r=yield t.generate(e)}})),w=e=>n(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,i)})),S=e=>n(this,void 0,void 0,(function*(){yield A(e)}));return!T&&!m?s?yield b(f):g?yield v(f):yield k(f):m?g?yield x(h):p?yield A(h):yield B(h):p?yield S(h):g?yield w(h):yield P(h),r}))}upgrade(e,t){return n(this,void 0,void 0,(function*(){let r;const o=Object.assign({},t),i=Object.assign({},o.jsonOptions),a=o.bitmarkParserType;let s=e;if(d.env.isBrowser&&o.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(s)&&(s=fs.readFileSync(s,{encoding:"utf8"}));let c=this.jsonParser.toAst(s);const p=e=>n(this,void 0,void 0,(function*(){const t=this.bitmarkParser.toAst(e,{parserType:a});if(o.outputFile){const e=new BitmarkFileGenerator_1.BitmarkFileGenerator(o.outputFile,o);yield e.generate(t)}else{const e=new l.BitmarkStringGenerator(o);r=yield e.generate(t)}})),g=e=>n(this,void 0,void 0,(function*(){if(o.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(o.outputFile,o);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(o),n=yield t.generate(e);r=this.jsonStringifyPrettify(n,i)}}));return!!!(null==c?void 0:c.bits)?yield p(s):yield g(c),r}))}createAst(e){let t,r=e;d.env.isNode&&fs.existsSync(r)&&(r=fs.readFileSync(r,{encoding:"utf8"}));let o=this.ast.preprocessAst(r);const i=!!o;i||(o=this.jsonParser.toAst(r));return t=!!!(null==o?void 0:o.bits)&&!i?this.bitmarkParser.toAst(r):o,t}convertText(e,t){var r;return n(this,void 0,void 0,(function*(){let o,i;const n=Object.assign({},t),a=Object.assign({},n.fileOptions),s=Object.assign({},n.jsonOptions),l=null!==(r=n.textFormat)&&void 0!==r?r:T.TextFormat.bitmarkMinusMinus;let u=e;if(d.env.isBrowser&&n.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(u)&&(u=fs.readFileSync(u,{encoding:"utf8"}));const c=this.textParser.preprocessAst(u),p=!!c;if(i=p?yield this.textGenerator.generate(c,l):this.textParser.toAst(u,{textFormat:l}),n.outputFile){const e=n.outputFile.toString();let t=i;p||(t=this.jsonStringifyPrettify(i,s,!0));const r=a.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(e)),fs.writeFileSync(e,t,{flag:r})}else o=p?i:this.jsonStringifyPrettify(i,s);return o}))}breakscapeText(e,t){if(!e)return e;const r=Object.assign({},t),o=Object.assign({},r.fileOptions);let i=e;if(d.env.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(i)&&(i=fs.readFileSync(i,{encoding:"utf8"}));const n=Breakscape_1.Breakscape.breakscape(i,{});if(!r.outputFile)return n;{const e=r.outputFile.toString(),t=o.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(e)),fs.writeFileSync(e,n,{flag:t})}}unbreakscapeText(e,t){if(!e)return e;const r=Object.assign({},t),o=Object.assign({},r.fileOptions);let i=e;if(d.env.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(i)&&(i=fs.readFileSync(i,{encoding:"utf8"}));const n=Breakscape_1.Breakscape.unbreakscape(i);if(!r.outputFile)return n;{const e=r.outputFile.toString(),t=o.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(e)),fs.writeFileSync(e,n,{flag:t})}}supportedBitsAsString(e){let t="";for(const r of e)if(t+=`${r.name} (since: ${r.since}`,r.deprecated&&(t+=`, deprecated: ${r.deprecated}`),t+=")\n",r.aliases&&r.aliases.length>0)for(const e of r.aliases)t+=`|__ ${e.name} (since: ${e.since}`,e.deprecated&&(t+=`, deprecated: ${e.deprecated}`),t+=")\n";return t}}},8256:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Ast=void 0;const o=r(7087),i=r(549),n=r(3633);t.Ast=class{constructor(){(0,o.init)()}walk(e,t,r,o){this.walkRecursive(e,void 0,r,[{index:0,key:t,value:e}],o)}getRouteKey(e){return e.reduce(((t,r,o)=>(+r.key!==r.index&&(t+=`${r.key}`,o<e.length-1&&(t+="_")),t)),"")}printTree(e,t=i.NodeType.bitmarkAst){this.walkRecursive(e,void 0,{enter:(e,t,r)=>{console.log("Enter: "+this.getRouteKey(r))},between:(e,t,r,o,i)=>{console.log("Between: "+this.getRouteKey(i))},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(n.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,o,i){const{enter:n,between:a,exit:s,leaf:l}=r,u=o[o.length-1].key,c=!this.isValue(e),p=o[o.length-1];if(c){if(n){if(!1===n(p,t,o,i))return}}else l&&l(p,t,o,i);if(c){const n=this.isArray(e),s=Object.keys(e);for(let l=0,c=s.length;l<c;l++){const g=s[l],d=l===c-1,y=e,f=y[g];if(null!=f){const e={key:this.getAstKey(g,u,n),index:l,value:f},c=o.slice();if(c.push(e),this.walkRecursive(f,p,r,c,i),!d){const r=s[l+1],c=y[r],g={key:this.getAstKey(r,u,n),index:l+1,value:c};if(a){if(!1===a(p,e,g,t,o,i))break}}}}}c&&s&&s(p,t,o,i)}getAstKey(e,t,r){let o=e;return r&&t&&(o=`${t}Value`),i.NodeType.fromKey(o)||`unknown(${o})`}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)}}},1:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseBuilder=void 0;const o=r(8159),i=r(2606),n=r(5486),a=r(7646),s=r(672),l=r(994),u=r(3633);t.BaseBuilder=class{toExample(e,t){return null!=t?(!0===t&&(t=o.Breakscape.breakscape("true")),!1===t&&(t=o.Breakscape.breakscape("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){if(null==t)return;const r=i.Config.getRawPropertiesConfig()[e],o=e=>{if(null!=e){switch(r.format){case n.PropertyFormat.string:return u.StringUtils.isString(e)?u.StringUtils.string(e):void 0;case n.PropertyFormat.trimmedString:return u.StringUtils.isString(e)?u.StringUtils.trimmedString(e):void 0;case n.PropertyFormat.number:return l.NumberUtils.asNumber(e);case n.PropertyFormat.boolean:return s.BooleanUtils.toBoolean(e,!0);case n.PropertyFormat.invertedBoolean:return!s.BooleanUtils.toBoolean(e,!0)}return e}};if(Array.isArray(t)){const e=t;for(let t=0,r=e.length;t<r;t++)e[t]=o(e[t])}else t=o(t);return a.ArrayUtils.asArray(t)}}},9046:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=void 0;const o=r(8159),i=r(2606),n=r(3518),a=r(208),s=r(1060),l=r(9779),u=r(1353),c=r(7646),p=r(4598),g=r(994),d=r(3589),y=r(671),f=r(1),h=r(2377);class m extends f.BaseBuilder{bitmark(e){const{bits:t,errors:r}=e,o={bits:t,errors:r};return d.ObjectUtils.removeUnwantedProperties(o),o}bit(e){var t;const{bitType:r,textFormat:o,resourceType:s,id:p,internalComment:y,externalId:f,spaceId:m,padletId:T,jupyterId:b,jupyterExecutionCount:v,aiGenerated:C,releaseVersion:k,ageRange:B,lang:x,language:A,computerLanguage:P,target:w,tag:S,icon:K,iconTag:_,colorTag:R,flashcardSet:I,subtype:E,bookAlias:O,coverImage:L,publisher:j,publications:F,author:G,subject:V,date:N,location:D,theme:M,kind:U,action:$,thumbImage:J,focusX:q,focusY:z,duration:H,referenceProperty:W,deeplink:Y,externalLink:X,externalLinkText:Z,videoCallLink:Q,bot:ee,list:te,textReference:re,isTracked:oe,isInfoOnly:ie,labelTrue:ne,labelFalse:ae,content2Buy:se,book:le,quotedPerson:ue,partialAnswer:ce,reasonableNumOfChars:pe,resolved:ge,resolvedDate:de,resolvedBy:ye,maxCreatedBits:fe,title:he,subtitle:me,level:Te,toc:be,progress:ve,anchor:Ce,reference:ke,referenceEnd:Be,item:xe,lead:Ae,hint:Pe,instruction:we,isDefaultExample:Se,example:Ke,imageSource:_e,partner:Re,markConfig:Ie,extraProperties:Ee,resources:Oe,body:Le,sampleSolution:je,footer:Fe,markup:Ge,parser:Ve}=e,Ne=i.Config.getBitConfig(r),De=c.ArrayUtils.asArray(Oe),Me=this.cardNode(e),Ue=r.root===a.RootBitType.essay?this.toAstProperty(n.PropertyConfigKey.reasonableNumOfChars,pe):void 0,$e=Object.assign(Object.assign({bitType:r,textFormat:null!==(t=u.TextFormat.fromValue(o))&&void 0!==t?t:Ne.textFormatDefault,resourceType:l.ResourceTag.fromValue(s),id:this.toAstProperty(n.PropertyConfigKey.id,p),internalComment:this.toAstProperty(n.PropertyConfigKey.internalComment,y),externalId:this.toAstProperty(n.PropertyConfigKey.externalId,f),spaceId:this.toAstProperty(n.PropertyConfigKey.spaceId,m),padletId:this.toAstProperty(n.PropertyConfigKey.padletId,T),jupyterId:this.toAstProperty(n.PropertyConfigKey.jupyterId,b),jupyterExecutionCount:this.toAstProperty(n.PropertyConfigKey.jupyterExecutionCount,v),aiGenerated:this.toAstProperty(n.PropertyConfigKey.aiGenerated,C),releaseVersion:this.toAstProperty(n.PropertyConfigKey.releaseVersion,k),book:le,ageRange:this.toAstProperty(n.PropertyConfigKey.ageRange,B),lang:this.toAstProperty(n.PropertyConfigKey.lang,x),language:this.toAstProperty(n.PropertyConfigKey.language,A),computerLanguage:this.toAstProperty(n.PropertyConfigKey.computerLanguage,P),target:this.toAstProperty(n.PropertyConfigKey.target,w),tag:this.toAstProperty(n.PropertyConfigKey.tag,S),icon:this.toAstProperty(n.PropertyConfigKey.icon,K),iconTag:this.toAstProperty(n.PropertyConfigKey.iconTag,_),colorTag:this.toAstProperty(n.PropertyConfigKey.colorTag,R),flashcardSet:this.toAstProperty(n.PropertyConfigKey.flashcardSet,I),subtype:this.toAstProperty(n.PropertyConfigKey.subtype,E),bookAlias:this.toAstProperty(n.PropertyConfigKey.bookAlias,O),coverImage:this.toAstProperty(n.PropertyConfigKey.coverImage,L),publisher:this.toAstProperty(n.PropertyConfigKey.publisher,j),publications:this.toAstProperty(n.PropertyConfigKey.publications,F),author:this.toAstProperty(n.PropertyConfigKey.author,G),subject:this.toAstProperty(n.PropertyConfigKey.subject,V),date:this.toAstProperty(n.PropertyConfigKey.date,N),location:this.toAstProperty(n.PropertyConfigKey.location,D),theme:this.toAstProperty(n.PropertyConfigKey.theme,M),kind:this.toAstProperty(n.PropertyConfigKey.kind,U),action:this.toAstProperty(n.PropertyConfigKey.action,$),thumbImage:this.toAstProperty(n.PropertyConfigKey.thumbImage,J),focusX:this.toAstProperty(n.PropertyConfigKey.focusX,q),focusY:this.toAstProperty(n.PropertyConfigKey.focusY,z),deeplink:this.toAstProperty(n.PropertyConfigKey.deeplink,Y),externalLink:this.toAstProperty(n.PropertyConfigKey.externalLink,X),externalLinkText:this.toAstProperty(n.PropertyConfigKey.externalLinkText,Z),videoCallLink:this.toAstProperty(n.PropertyConfigKey.videoCallLink,Q),bot:this.toAstProperty(n.PropertyConfigKey.bot,ee),duration:this.toAstProperty(n.PropertyConfigKey.duration,H),referenceProperty:this.toAstProperty(n.PropertyConfigKey.property_reference,W),list:this.toAstProperty(n.PropertyConfigKey.list,te),textReference:this.toAstProperty(n.PropertyConfigKey.textReference,re),isTracked:this.toAstProperty(n.PropertyConfigKey.isTracked,oe),isInfoOnly:this.toAstProperty(n.PropertyConfigKey.isInfoOnly,ie),labelTrue:this.toAstProperty(n.PropertyConfigKey.labelTrue,ne),labelFalse:this.toAstProperty(n.PropertyConfigKey.labelFalse,ae),content2Buy:this.toAstProperty(n.PropertyConfigKey.content2Buy,se),quotedPerson:this.toAstProperty(n.PropertyConfigKey.quotedPerson,ue),partialAnswer:this.toAstProperty(n.PropertyConfigKey.partialAnswer,ce),reasonableNumOfChars:Ue,resolved:this.toAstProperty(n.PropertyConfigKey.resolved,ge),resolvedDate:this.toAstProperty(n.PropertyConfigKey.resolvedDate,de),resolvedBy:this.toAstProperty(n.PropertyConfigKey.resolvedBy,ye),maxCreatedBits:this.toAstProperty(n.PropertyConfigKey.maxCreatedBits,fe),title:he,subtitle:me,level:g.NumberUtils.asNumber(Te),toc:this.toAstProperty(n.PropertyConfigKey.toc,be),progress:this.toAstProperty(n.PropertyConfigKey.progress,ve),anchor:Ce,reference:ke,referenceEnd:Be,markConfig:Ie,itemLead:this.itemLead(xe,Ae),hint:Pe,instruction:we},this.toExample(Se,Ke)),{imageSource:_e,partner:Re,resources:De,body:Le,sampleSolution:c.ArrayUtils.asSingle(je),cardNode:Me,footer:Fe,markup:Ge,parser:Ve,extraProperties:this.parseExtraProperties(Ee)});return r.root===a.RootBitType.interview&&this.pushDownTree(void 0,void 0,Me,"questions",n.PropertyConfigKey.reasonableNumOfChars,pe),this.pushExampleDownTree(Le,Me,Se,Ke),this.setDefaultBitValues($e),this.setIsExampleFlags($e),this.addVersionToParserInfo($e),d.ObjectUtils.removeUnwantedProperties($e,{ignoreAllFalse:!0,ignoreEmptyString:["example"]}),h.NodeValidator.validateBit($e)}choice(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s,example:l}=e,u=Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:a},this.toExampleBoolean(s,l));return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}response(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s,example:l}=e,u=Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:a},this.toExampleBoolean(s,l));return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}botResponse(e){const{response:t,reaction:r,feedback:o,item:i,lead:n,hint:a}=e,s={response:t,reaction:r,feedback:o,itemLead:this.itemLead(i,n),hint:a};return d.ObjectUtils.removeUnwantedProperties(s,{ignoreEmptyString:["response","reaction","feedback"]}),s}quiz(e){const{choices:t,responses:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s,example:l}=e;this.pushExampleDownTreeBoolean(s,l,!0,t),this.pushExampleDownTreeBoolean(s,l,!1,r);const u={itemLead:this.itemLead(o,i),hint:n,instruction:a,isExample:s||null!=l,choices:t,responses:r};return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}heading(e){var t;const{forKeys:r,forValues:i}=e;if(null==r)return;const n={forKeys:r||o.Breakscape.EMPTY_STRING,forValues:null!==(t=c.ArrayUtils.asArray(i))&&void 0!==t?t:[]};return d.ObjectUtils.removeUnwantedProperties(n),n}pair(e){const{key:t,keyAudio:r,keyImage:o,values:i,item:n,lead:a,hint:s,instruction:l,isCaseSensitive:u,isDefaultExample:c,example:p}=e,g=Object.assign(Object.assign({key:t,keyAudio:r,keyImage:o,itemLead:this.itemLead(n,a),hint:s,instruction:l},this.toExample(c,p)),{isCaseSensitive:null==u||u,values:i});return d.ObjectUtils.removeUnwantedProperties(g,{ignoreAllFalse:!0}),g}matrix(e){const{key:t,cells:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s}=e;let l=!1;for(const e of null!=r?r:[])s&&!e.isExample&&(e.isDefaultExample=!0,e.isExample=!0),l=!!e.isExample||l;const u={key:t,itemLead:this.itemLead(o,i),hint:n,instruction:a,isExample:l,cells:r};return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}matrixCell(e){const{values:t,item:r,lead:o,hint:i,instruction:n,isCaseSensitive:a,isDefaultExample:s,example:l}=e,u=Object.assign({values:t,itemLead:this.itemLead(r,o),hint:i,instruction:n,isCaseSensitive:null==a||a},this.toExample(s,l));return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}question(e){const{question:t,partialAnswer:r,item:o,lead:i,hint:n,instruction:a,reasonableNumOfChars:s,sampleSolution:l,isDefaultExample:u,example:c}=e,p=Object.assign(Object.assign({itemLead:this.itemLead(o,i),question:t,partialAnswer:r,hint:n,instruction:a},this.toExample(u,c)),{reasonableNumOfChars:s,sampleSolution:l});return d.ObjectUtils.removeUnwantedProperties(p,{ignoreEmptyString:["question"],ignoreAllFalse:!0}),p}body(e){const{bodyParts:t}=e;return{bodyParts:t}}bodyText(e){const{text:t}=e;return{type:s.BodyBitType.text,data:{bodyText:t}}}footerText(e){const{text:t}=e;return{footerText:t}}gap(e){const{solutions:t,item:r,lead:o,hint:i,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,c={type:s.BodyBitType.gap,data:Object.assign({solutions:t,itemLead:this.itemLead(r,o),hint:i,instruction:n,isCaseSensitive:null==a||a},this.toExample(l,u))};return d.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}markConfig(e){const{mark:t,color:r,emphasis:o}=e,i={mark:t,color:r,emphasis:o};return d.ObjectUtils.removeUnwantedProperties(i),i}mark(e){const{solution:t,mark:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:l,example:u}=e,c={type:s.BodyBitType.mark,data:Object.assign({solution:t,mark:r,itemLead:this.itemLead(o,i),hint:n,instruction:a},this.toExample(l,u))};return d.ObjectUtils.removeUnwantedProperties(c),c}select(e){const{options:t,prefix:r,postfix:o,item:i,lead:n,hint:a,instruction:l}=e,u={type:s.BodyBitType.select,data:{prefix:r,options:t,postfix:o,itemLead:this.itemLead(i,n),hint:a,instruction:l}};return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}selectOption(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s,example:l}=e,u=Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:a},this.toExample(s,l));return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}highlight(e){const{texts:t,prefix:r,postfix:o,item:i,lead:n,hint:a,instruction:l}=e,u={type:s.BodyBitType.highlight,data:{prefix:r,texts:t,postfix:o,itemLead:this.itemLead(i,n),hint:a,instruction:l}};return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}highlightText(e){const{text:t,isCorrect:r,isHighlighted:o,item:i,lead:n,hint:a,instruction:s,isDefaultExample:l,example:u}=e,c=Object.assign({text:t,isCorrect:!!r,isHighlighted:!!o,itemLead:this.itemLead(i,n),hint:a,instruction:s},this.toExample(l,u));return d.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}flashcard(e){const{question:t,answer:r,alternativeAnswers:o,item:i,lead:n,hint:a,instruction:s,isDefaultExample:l,example:u}=e,c=Object.assign({question:t,answer:r,alternativeAnswers:o,itemLead:this.itemLead(i,n),hint:a,instruction:s},this.toExampleBoolean(l,u));return d.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}statement(e){const{text:t,isCorrect:r,item:o,lead:i,hint:n,instruction:a,isDefaultExample:s,example:l}=e,u=Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(o,i),hint:n,instruction:a},this.toExampleBoolean(s,l));return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}imageSource(e){const{url:t,mockupId:r,size:o,format:i,trim:n}=e,a={url:t,mockupId:r,size:o,format:i,trim:n};return d.ObjectUtils.removeUnwantedProperties(a,{ignoreFalse:["trim"]}),a}partner(e){const{name:t,avatarImage:r}=e,o={name:t,avatarImage:r};return d.ObjectUtils.removeUnwantedProperties(o),o}itemLead(e,t){let r;return(e||t)&&(r={item:e,lead:t}),r}cardBit(e){const{item:t,lead:r,hint:o,instruction:i,isDefaultExample:n,example:a,extraProperties:s,body:l}=e,u=Object.assign(Object.assign({itemLead:this.itemLead(t,r),hint:o,instruction:i},this.toExample(n,a)),{body:l,extraProperties:this.parseExtraProperties(s)});return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0,ignoreEmptyString:["example"]}),h.NodeValidator.validateCardBit(u)}cardNode(e){let t;const{questions:r,elements:o,flashcards:i,statement:n,statements:a,choices:s,responses:l,quizzes:u,heading:c,pairs:p,matrix:g,botResponses:y,cardBits:f}=e;return(r||o||i||n||a||s||l||u||c||p||g||y||f)&&(t={questions:r,elements:o,flashcards:i,statement:n,statements:a,choices:s,responses:l,quizzes:u,heading:c,pairs:p,matrix:g,botResponses:y,cardBits:f},d.ObjectUtils.removeUnwantedProperties(t)),t}pushExampleDownTree(e,t,r,o){if(r||o){if(t){if(this.pushExampleDownTreeString(r,o,t.pairs),this.pushExampleDownTreeBoolean(r,o,!1,t.flashcards),this.pushExampleDownTreeBoolean(r,o,!0,t.choices),this.pushExampleDownTreeBoolean(r,o,!1,t.responses,t.statements,t.statement),t.quizzes)for(const e of t.quizzes)this.pushExampleDownTreeBoolean(r,o,!0,e.choices),this.pushExampleDownTreeBoolean(r,o,!1,e.responses);if(t.matrix)for(const e of t.matrix)this.pushExampleDownTreeString(r,o,e.cells)}e&&this.pushExampleDownTreeBodyBits(r,o,e)}}pushExampleDownTreeBoolean(e,t,r,...o){if((e||t)&&Array.isArray(o))for(const i of o)if(i){const o=Array.isArray(i)?i:[i];p.BitUtils.fillBooleanExample(o,e,t,r)}}pushExampleDownTreeString(e,t,...r){if((e||t)&&Array.isArray(r))for(const o of r)if(o){const r=Array.isArray(o)?o:[o];p.BitUtils.fillStringExample(r,e,t,!1)}}pushExampleDownTreeBodyBits(e,t,r){if((e||t)&&r&&r.bodyParts&&0!==r.bodyParts.length)for(const o of r.bodyParts)if(o)switch(o.type){case s.BodyBitType.gap:{const r=o;p.BitUtils.fillStringExample([r.data],e,t,!1);break}case s.BodyBitType.mark:{const r=o;p.BitUtils.fillBooleanExample([r.data],e,t,!1);break}case s.BodyBitType.select:{const r=o;p.BitUtils.fillBooleanExample(r.data.options,e,t,!0);break}case s.BodyBitType.highlight:{const r=o;p.BitUtils.fillBooleanExample(r.data.texts,e,t,!0);break}}}pushDownTree(e,t,r,o,i,n){if(void 0!==n){if(r&&o){const e=r[o];if(Array.isArray(e))for(const t of e)null==t[i]&&(t[i]=n)}if(t&&e&&e.bodyParts&&e.bodyParts.length>0)for(const r of e.bodyParts)if(r&&-1!==t.indexOf(r.type)){r.data[i]=n}}}parseExtraProperties(e){if(!e)return;const t=Object.entries(e);if(0===t.length)return;const r={};for(const[e,o]of t)r[e]=c.ArrayUtils.asArray(o)||[o];return r}setIsExampleFlags(e){var t,r,o,i,n,a,l,u,c,p,g,d,y;e.isExample=!1;const f=t=>!!t&&(t.isDefaultExample||null!=t.example?(t.isExample=!0,e.isExample=!0):t.isExample=t===e&&!!e.isExample,t.isExample),{body:h,cardNode:m}=e;if(h&&h.bodyParts)for(const e of h.bodyParts)switch(e.type){case s.BodyBitType.gap:case s.BodyBitType.mark:f(e.data);break;case s.BodyBitType.select:{const t=e;let r=!1;for(const e of t.data.options)r=!!f(e)||r;t.data.isExample=r;break}case s.BodyBitType.highlight:{const t=e;let r=!1;for(const e of t.data.texts)r=!!f(e)||r;t.data.isExample=r;break}}if(m){for(const e of null!==(t=m.flashcards)&&void 0!==t?t:[])f(e);for(const e of null!==(r=m.pairs)&&void 0!==r?r:[])f(e);for(const e of null!==(o=m.matrix)&&void 0!==o?o:[]){let t=!1;for(const r of null!==(i=e.cells)&&void 0!==i?i:[])t=!!f(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=!!f(r)||t;for(const r of null!==(l=e.choices)&&void 0!==l?l:[])t=!!f(r)||t;e.isExample=t}for(const e of null!==(u=m.responses)&&void 0!==u?u:[])f(e);for(const e of null!==(c=m.choices)&&void 0!==c?c:[])f(e);for(const e of null!==(p=m.statements)&&void 0!==p?p:[])f(e);f(m.statement);for(const e of null!==(g=m.questions)&&void 0!==g?g:[])f(e)}f(e.statement);for(const t of null!==(d=e.responses)&&void 0!==d?d:[])f(t);for(const t of null!==(y=e.choices)&&void 0!==y?y:[])f(t);f(e)}setDefaultBitValues(e){switch(e.bitType.alias){case a.AliasBitType.articleAi:case a.AliasBitType.noteAi:case a.AliasBitType.summaryAi:e.aiGenerated=this.toAstProperty(n.PropertyConfigKey.aiGenerated,!0)}}addVersionToParserInfo(e){var t;const r=null!==(t=e.parser)&&void 0!==t?t:{};r.version=y.env.appVersion.full,e.parser=r}}t.Builder=m},8703:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceBuilder=void 0;const i=r(8159),n=r(9779),a=r(3589),s=r(169),l=r(1),u=r(2377);class c extends l.BaseBuilder{resource(e){var t;let r;const{type:a,value:s,format:l}=e,u=o(e,["type","value","format"]),c=Object.assign({type:a,value:null!=s?s:i.Breakscape.EMPTY_STRING,format:null!=l?l:i.Breakscape.EMPTY_STRING},u);switch(a){case n.ResourceTag.video:case n.ResourceTag.videoEmbed:case n.ResourceTag.videoLink:case n.ResourceTag.stillImageFilmEmbed:case n.ResourceTag.stillImageFilmLink:{const r=["src1x","src2x","src3x","src4x"],o=[];for(const t of r){const r=e[t];if(r){const e=this.resource({type:n.ResourceTag.image,value:r});e&&o.push(e)}}c.thumbnails=[...null!==(t=c.thumbnails)&&void 0!==t?t:[],...o]}}switch(a){case n.ResourceTag.image:case n.ResourceTag.imagePortrait:case n.ResourceTag.imageLandscape:r=this.imageResource(c,a);break;case n.ResourceTag.imageLink:r=this.imageLinkResource(c);break;case n.ResourceTag.audio:r=this.audioResource(c);break;case n.ResourceTag.audioEmbed:r=this.audioEmbedResource(c);break;case n.ResourceTag.audioLink:r=this.audioLinkResource(c);break;case n.ResourceTag.video:r=this.videoResource(c);break;case n.ResourceTag.videoEmbed:r=this.videoEmbedResource(c);break;case n.ResourceTag.videoLink:r=this.videoLinkResource(c);break;case n.ResourceTag.stillImageFilmEmbed:r=this.stillImageFilmEmbedResource(c);break;case n.ResourceTag.stillImageFilmLink:r=this.stillImageFilmLinkResource(c);break;case n.ResourceTag.article:r=this.articleResource(c);break;case n.ResourceTag.document:r=this.documentResource(c);break;case n.ResourceTag.documentEmbed:r=this.documentEmbedResource(c);break;case n.ResourceTag.documentLink:r=this.documentLinkResource(c);break;case n.ResourceTag.documentDownload:r=this.documentDownloadResource(c);break;case n.ResourceTag.appLink:r=this.appLinkResource(c);break;case n.ResourceTag.websiteLink:r=this.websiteLinkResource(c)}return r}imageResource(e,t){const{value:r,src1x:o,src2x:i,src3x:l,src4x:c,width:p,height:g,alt:d,zoomDisabled:y,license:f,copyright:h,showInIndex:m,caption:T}=e,b={type:n.ResourceTag.image,typeAlias:null!=t?t:n.ResourceTag.image,format:s.UrlUtils.fileExtensionFromUrl(r),provider:s.UrlUtils.domainFromUrl(r),value:r,src1x:o,src2x:i,src3x:l,src4x:c,width:p,height:g,alt:d,zoomDisabled:y,license:f,copyright:h,showInIndex:m,caption:T};return a.ObjectUtils.removeUnwantedProperties(b,{ignoreFalse:["zoomDisabled"]}),u.NodeValidator.validateResource(b)}imageLinkResource(e){const{value:t,src1x:r,src2x:o,src3x:i,src4x:l,width:c,height:p,alt:g,zoomDisabled:d,license:y,copyright:f,showInIndex:h,caption:m}=e,T={type:n.ResourceTag.imageLink,typeAlias:n.ResourceTag.imageLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,src1x:r,src2x:o,src3x:i,src4x:l,zoomDisabled:d,width:c,height:p,alt:g,license:y,copyright:f,showInIndex:h,caption:m};return a.ObjectUtils.removeUnwantedProperties(T,{ignoreFalse:["zoomDisabled"]}),u.NodeValidator.validateResource(T)}audioResource(e){const{value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g}=e,d={type:n.ResourceTag.audio,typeAlias:n.ResourceTag.audio,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g};return a.ObjectUtils.removeUnwantedProperties(d),u.NodeValidator.validateResource(d)}audioEmbedResource(e){const{value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g}=e,d={type:n.ResourceTag.audioEmbed,typeAlias:n.ResourceTag.audioEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g};return a.ObjectUtils.removeUnwantedProperties(d),u.NodeValidator.validateResource(d)}audioLinkResource(e){const{value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g}=e,d={type:n.ResourceTag.audioLink,typeAlias:n.ResourceTag.audioLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:o,autoplay:i,license:l,copyright:c,showInIndex:p,caption:g};return a.ObjectUtils.removeUnwantedProperties(d),u.NodeValidator.validateResource(d)}videoResource(e){const{value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.video,typeAlias:n.ResourceTag.video,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}videoEmbedResource(e){const{value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.videoEmbed,typeAlias:n.ResourceTag.videoEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}videoLinkResource(e){const{value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.videoLink,typeAlias:n.ResourceTag.videoLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}stillImageFilmEmbedResource(e){const{value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.stillImageFilmEmbed,typeAlias:n.ResourceTag.stillImageFilmEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}stillImageFilmLinkResource(e){const{value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.stillImageFilmLink,typeAlias:n.ResourceTag.stillImageFilmLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:o,duration:i,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}articleResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:l}=e,c={type:n.ResourceTag.article,typeAlias:n.ResourceTag.article,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:i,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}documentResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:l}=e,c={type:n.ResourceTag.document,typeAlias:n.ResourceTag.document,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:i,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}documentEmbedResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:l}=e,c={type:n.ResourceTag.documentEmbed,typeAlias:n.ResourceTag.documentEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:i,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}documentLinkResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:l}=e,c={type:n.ResourceTag.documentLink,typeAlias:n.ResourceTag.documentLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:i,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}documentDownloadResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:l}=e,c={type:n.ResourceTag.documentDownload,typeAlias:n.ResourceTag.documentDownload,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:o,showInIndex:i,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}appLinkResource(e){const{value:t,license:r,copyright:o,showInIndex:i,caption:s}=e,l={type:n.ResourceTag.appLink,typeAlias:n.ResourceTag.appLink,value:t,license:r,copyright:o,showInIndex:i,caption:s};return a.ObjectUtils.removeUnwantedProperties(l),u.NodeValidator.validateResource(l)}websiteLinkResource(e){const{value:t,siteName:r,license:o,copyright:i,showInIndex:s,caption:l}=e,c={type:n.ResourceTag.websiteLink,typeAlias:n.ResourceTag.websiteLink,value:t,siteName:r,license:o,copyright:i,showInIndex:s,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}}t.ResourceBuilder=c},2377:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValidator=void 0;const o=r(208),i=r(3633);const n=new class{validateBit(e){if(!e)return e;let t=e;if(e.bitType.root===o.RootBitType.interview)t=this.validateInterviewBit(e);return t}validateCardBit(e){if(!e)return e;return e}validateResource(e){if(!e)return;let t=e,r=!1;return e.type,r=!!e.value,r||e.type&&(t={type:e.type,typeAlias:e.type}),t}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(!i.StringUtils.isString(e))throw new Error(`${t} is required to be a string`)}isNonEmptyString(e,t){if(!i.StringUtils.isString(e)||""===e)throw new Error(`${t} is required to be a non-empty string`)}isStringOrBoolean(e,t){if(!i.StringUtils.isString(e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a string or a boolean`)}isNonEmptyStringOrBoolean(e,t){if((!i.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(!i.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,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.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,o=e.length;r<o;r++){const i=e[r];this._buffer.push(i),t&&r<o-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}}},8159:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Breakscape=void 0;const o=r(3633),i=`${/([*`_!=])([\^]*)\1/.source}|${/^(\|)([\^]*)(code[\s]*|code:|image:|[\s]*$)/.source}|${/^([#]{1,3})([\^]*)([^\S\r\n]+)/.source}|${/^(•)([\^]*)(1|\+|-|)([^\S\r\n]+)/.source}|${/(\[)([\^]*)([.@#▼►%!?+\-$_=&])/.source}|${/([\^]*)(])/.source}`,n=i.replace(/(\(\[\\\^\]\*\))/g,"\\^$1"),a=new RegExp(i,"gm"),s="$1$3$6$9$13^$2$1$4$5$7$8$10$11$12$14$15$16$17",l=new RegExp(n,"gm"),u=s.replace(/\^/g,""),c=new RegExp("^(\\||•|#)","gm");const p=new class{constructor(){this.EMPTY_STRING=""}breakscape(e,t){if(null==e)return e;const r=Object.assign({},t),i=e=>e?e=e.replace(a,s):e;if(Array.isArray(e)){const t=r.modifyArray?e:[e.length];for(let r=0,n=e.length;r<n;r++){const n=e[r];o.StringUtils.isString(n)&&(t[r]=i(n))}e=t}else o.StringUtils.isString(e)&&(e=i(e));return e}unbreakscape(e,t){if(null==e)return e;const r=Object.assign({},t),i=e=>e?e=e.replace(l,u):e;if(Array.isArray(e)){const t=r.modifyArray?e:[];for(let r=0,n=e.length;r<n;r++){const n=e[r];o.StringUtils.isString(n)?t[r]=i(n):t[r]=n}e=t}else o.StringUtils.isString(e)&&(e=i(e));return e}breakscapeCode(e,t){if(null==e)return e;const r=Object.assign({},t),i=e=>e?e.replace(c,"$1^"):e;if(Array.isArray(e)){const t=r.modifyArray?e:[e.length];for(let t=0,r=e.length;t<r;t++){const r=e[t];o.StringUtils.isString(r)&&(e[t]=i(r))}e=t}else o.StringUtils.isString(e)&&(e=i(e));return e}concatenate(e,t){return e+t}};t.Breakscape=p},2606:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Config=void 0;const o=r(429),i=r(7585),n=r(3059),a=r(5428),s=r(742),l=r(1353),u=r(8360),c=r(3141),p=r(9036),g=r(6260),d=r(208);const y=new class{constructor(){this.bitTypeAliasMap=new Map,this.bitCache=new Map,this.comboResourcesCache=new Map,this.buildBitTypeAliasMap()}getBitType(e){const t=this.getAliasedBitType(e);return{alias:t,root:this.getRootBitType(t)}}getBitConfig(e){var t;let r=this.bitCache.get(e.alias);if(!r){const i=()=>{throw new Error(`No config found for bit: ALIAS:${e.alias}, ROOT:${e.root}`)},n=c.BITS[e.root];n||i();const a=e.root!==e.alias;let s;a&&n.aliases&&(s=n.aliases[e.alias]),a&&!s&&i();const{since:p,deprecated:g}=s||n,y=n.aliases?Object.keys(n.aliases).map((e=>d.AliasBitType.fromValue(e))):[],{textFormatDefault:f,tags:h,cardSet:m,bodyAllowed:T,bodyRequired:b,footerAllowed:v,footerRequired:C,resourceAttachmentAllowed:k,rootExampleType:B}=n,x=this.getAllResourcesTagsWithZeroCounts(),A=u.ConfigHydrator.hydrateTagsConfig(h),P=u.ConfigHydrator.hydrateCardSetConfig(m),w=null===(t=A.info)||void 0===t?void 0:t.comboResourceType,S=Object.assign({},A.tags);for(const[e,t]of Object.entries(x))S[e]||(S[e]=t);r=new o.BitConfig(p,e,y,null!=f?f:l.TextFormat.bitmarkMinusMinus,S,P,g,T,b,v,C,k,B,w),this.bitCache.set(e.root,r)}return r}getRawPropertiesConfig(){return g.PROPERTIES}getTagConfigForTag(e,t){if(e)for(const[,r]of Object.entries(e))if(r.tag===t)return r}getTagsConfigForCardSet(e,t,r){const o=this.getBitConfig(e);if(!o)return;const i=o.cardSet;if(!i)return;t=Math.min(t,i.variants.length-1);const n=i.variants[t];return n[r=Math.min(r,n.length-1)].tags}getBitResourcesConfig(e,t){var r;let o={};const a=new Map,l=this.getBitConfig(e),u={};for(const[e,t]of Object.entries(l.tags))t.type===s.BitTagType.resource&&(u[e]=t);const c=null!==(r=l.comboResourceType)&&void 0!==r?r:l.resourceAttachmentAllowed&&t;if(c){const e=new Map,r=this.getComboResource(c);if(r){const t=Object.values(r).filter((e=>e.type===s.BitTagType.resource));t.map((e=>e.tag)).forEach((r=>{const o=t.find((e=>e.tag===r));o&&e.set(r,o)}));const o=this.getComboResourceTagTypes(c);o&&o.length>0&&a.set(c,o)}if(t)for(const[t,r]of Object.entries(u)){const n=c===r.tag,a=!!e&&e.has(r.tag);if(n){const e=new i.ResourceTagConfig(r.configKey,r.tag,1,1,r.chain,r.jsonKey,r.deprecated);o[t]=e}else if(a){if(e){const i=e.get(r.tag);i&&(o[t]=i)}}else o[t]=r}else o=u}else o=u;return new n.ResourcesConfig(o,l.resourceAttachmentAllowed,t,a)}getComboResourceTagTypes(e){const t=this.getComboResource(e);if(t){return Object.values(t).filter((e=>e.type===s.BitTagType.resource)).map((e=>e.tag))}}getComboResource(e){if(!e)return;let t=this.comboResourcesCache.get(e);return t||(t={},Object.values(p.GROUPS).filter((t=>t.type===a.GroupConfigType.comboResource&&t.comboResourceType===e)).forEach((e=>{t=Object.assign(Object.assign({},t),u.ConfigHydrator.hydrateTagsConfig(e.tags).tags)})),0===Object.keys(t).length&&(t=void 0),this.comboResourcesCache.set(e,t)),t}getAllResourcesTagsWithZeroCounts(){let e=this.allResourcesCache;if(!e){e={},Object.values(p.GROUPS).filter((e=>e.type===a.GroupConfigType.resource)).forEach((t=>{e=Object.assign(Object.assign({},e),u.ConfigHydrator.hydrateTagsConfig(t.tags).tags)}));for(const t of Object.values(e)){const e=t;e.maxCount=0,e.minCount=0}this.allResourcesCache=e}return e}buildBitTypeAliasMap(){for(const e of d.RootBitType.values())this.bitTypeAliasMap.set(e,e);for(const[e,t]of Object.entries(c.BITS))if(t.aliases)for(const r of Object.keys(t.aliases))this.bitTypeAliasMap.set(r,e)}getRootBitType(e){var t;if(!e)return d.RootBitType._error;let r=null!==(t=this.bitTypeAliasMap.get(e))&&void 0!==t?t:d.RootBitType._error;return r===d.RootBitType._error&&e&&e.startsWith("|")&&(r=d.RootBitType._comment),r}getAliasedBitType(e){var t,r;let o=null!==(r=null!==(t=d.AliasBitType.fromValue(e))&&void 0!==t?t:d.RootBitType.fromValue(e))&&void 0!==r?r:d.RootBitType._error;return o===d.RootBitType._error&&e&&e.startsWith("|")&&(o=d.RootBitType._comment),o}};t.Config=y},8360:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigHydrator=void 0;const o=r(2005),i=r(3585),n=r(6620),a=r(6956),s=r(7585),l=r(8620),u=r(177),c=r(3518),p=r(6194),g=r(1595),d=r(742),y=r(4182),f=r(9036),h=r(6260),m=r(5100),T=r(3622);const b=new class{hydrateTagsConfig(e){var t;const r={tags:{}};for(const o of e){let e;switch(o.type){case d.BitTagType.tag:e=this.hydrateTagConfig(o);break;case d.BitTagType.property:e=this.hydratePropertyTagConfig(o);break;case d.BitTagType.resource:e=this.hydrateResourceTagConfig(o);break;case d.BitTagType.group:e=this.hydrateTagGroupConfig(o)}e&&(r.tags=Object.assign(Object.assign({},r.tags),e.tags),r.info=Object.assign(null!==(t=r.info)&&void 0!==t?t:{},e.info))}return r}hydrateCardSetConfig(e){if(!e)return;const t=y.CARDS[e];if(!t)throw new Error(`No config found for card set config key '${e}'`);const r=[];for(const e of t.variants){const t=[];for(const r of e){const e=this.hydrateCardVariantConfig(r);t.push(e)}r.push(t)}return new o.CardSetConfig(e,r)}hydrateTagConfig(e){const{configKey:t,maxCount:r,minCount:o,chain:i}=e,a=g.TagConfigKey.fromKey(t)||l.ConfigKey._unknown,s=T.TAGS[a];if(!s)throw new Error(`No config found for tag config key '${t}'`);const{tag:u,deprecated:c}=s;let p;i&&(p=this.hydrateTagsConfig(i).tags);return{tags:{[a]:new n.MarkupTagConfig(a,u,null!=r?r:1,null!=o?o:0,p,c)}}}hydratePropertyTagConfig(e){const{configKey:t,maxCount:r,minCount:o,chain:i}=e,n=c.PropertyConfigKey.fromKey(t)||l.ConfigKey._unknown,s=h.PROPERTIES[n];if(!s)throw new Error(`No config found for property config key '${t}'`);const{tag:u,deprecated:p,single:g,format:d,defaultValue:y,jsonKey:f,astKey:m}=s;let T;i&&(T=this.hydrateTagsConfig(i).tags);return{tags:{[n]:new a.PropertyTagConfig(n,u,null!=r?r:1,null!=o?o:0,T,f,m,g,d,y,p)}}}hydrateResourceTagConfig(e){const{configKey:t,maxCount:r,minCount:o,chain:i}=e,n=p.ResourceConfigKey.fromKey(t)||l.ConfigKey._unknown,a=m.RESOURCES[n];if(!a)throw new Error(`No config found for resource config key '${t}'`);const{tag:u,deprecated:c,jsonKey:g}=a;let d;i&&(d=this.hydrateTagsConfig(i).tags);return{tags:{[n]:new s.ResourceTagConfig(n,u,null!=r?r:1,null!=o?o:0,d,g,c)}}}hydrateTagGroupConfig(e){var t,r;const{configKey:o}=e,i=u.GroupConfigKey.fromKey(o)||l.ConfigKey._unknown,n=f.GROUPS[i];if(!n)throw new Error(`No config found for group config key '${o}'`);const{tags:a}=n,s=this.hydrateTagsConfig(a).tags,c=Object.values(s);if(c.length>0){const o=c[0],i=o;i.maxCount=null!==(t=e.maxCount)&&void 0!==t?t:o.maxCount,i.minCount=null!==(r=e.minCount)&&void 0!==r?r:o.minCount}return{tags:s,info:{comboResourceType:n.comboResourceType}}}hydrateCardVariantConfig(e){const{tags:t,bodyAllowed:r,bodyRequired:o,repeatCount:n}=e,a=this.hydrateTagsConfig(t);return new i.CardVariantConfig(a.tags,r,o,n)}};t.ConfigHydrator=b},3141:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BITS=void 0;const o=r(2574),i=r(177),n=r(3518),a=r(1595),s=r(742),l=r(208),u=r(1035),c=r(7028),p=r(1353),g={[l.RootBitType._error]:{since:"1.3.0",tags:[]},[l.RootBitType._comment]:{since:"1.4.12",tags:[]},[l.RootBitType.appFlashcards]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.flashcardSet,maxCount:u.Count.infinity}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.appFlashcardsQuiz]:{since:"1.3.0"},[l.AliasBitType.appFlashcardsLearn]:{since:"1.3.0"}}},[l.RootBitType.appLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAppLink,minCount:1}],bodyAllowed:!1},[l.RootBitType.article]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.statement]:{since:"1.3.0"},[l.AliasBitType.buttonCopyText]:{since:"1.4.3"}}},[l.RootBitType.appBitmarkFromJavascript]:{since:"1.4.5",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.maxCreatedBits}],textFormatDefault:p.TextFormat.text,resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.appBitmarkFromEditor]:{since:"1.4.5"}}},[l.RootBitType.articleEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceArticleEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.articleLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceArticleLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.audio]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudio,minCount:1}],bodyAllowed:!0},[l.RootBitType.audioEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudioEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.audioLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudioLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.bitAlias]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.tag_reference},{type:s.BitTagType.tag,configKey:a.TagConfigKey.anchor}],bodyAllowed:!0},[l.RootBitType.book]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_bookCommon}],bodyAllowed:!0,aliases:{[l.AliasBitType.bookAcknowledgments]:{since:"1.3.0"},[l.AliasBitType.bookAddendum]:{since:"1.3.0"},[l.AliasBitType.bookAfterword]:{since:"1.3.0"},[l.AliasBitType.bookAppendix]:{since:"1.3.0"},[l.AliasBitType.bookArticle]:{since:"1.3.0"},[l.AliasBitType.bookAutherBio]:{since:"1.3.0"},[l.AliasBitType.bookBibliography]:{since:"1.3.0"},[l.AliasBitType.bookComingSoon]:{since:"1.3.0"},[l.AliasBitType.bookConclusion]:{since:"1.3.0"},[l.AliasBitType.bookCopyright]:{since:"1.3.0"},[l.AliasBitType.bookCopyrightPermissions]:{since:"1.3.0"},[l.AliasBitType.bookDedication]:{since:"1.3.0"},[l.AliasBitType.bookEndnotes]:{since:"1.3.0"},[l.AliasBitType.bookEpigraph]:{since:"1.3.0"},[l.AliasBitType.bookEpilogue]:{since:"1.3.0"},[l.AliasBitType.bookForword]:{since:"1.3.0"},[l.AliasBitType.bookFrontispiece]:{since:"1.3.0"},[l.AliasBitType.bookImprint]:{since:"1.3.0"},[l.AliasBitType.bookIncitingIncident]:{since:"1.3.0"},[l.AliasBitType.bookIntroduction]:{since:"1.3.0"},[l.AliasBitType.bookListOfContributors]:{since:"1.3.0"},[l.AliasBitType.bookNotes]:{since:"1.3.0"},[l.AliasBitType.bookPostscript]:{since:"1.3.0"},[l.AliasBitType.bookPreface]:{since:"1.3.0"},[l.AliasBitType.bookPrologue]:{since:"1.3.0"},[l.AliasBitType.bookReadMore]:{since:"1.3.0"},[l.AliasBitType.bookReferenceList]:{since:"1.3.0"},[l.AliasBitType.bookRequestForABookReview]:{since:"1.3.0"},[l.AliasBitType.bookSummary]:{since:"1.3.0"},[l.AliasBitType.bookTeaser]:{since:"1.3.0"},[l.AliasBitType.bookTitle]:{since:"1.3.0"}}},[l.RootBitType.bookAlias]:{since:"1.4.3",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_bookCommon},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.bookAlias,maxCount:u.Count.infinity}],bodyAllowed:!0},[l.RootBitType.botActionResponse]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._botActionResponses,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.botActionSend]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.date}],bodyAllowed:!0},[l.RootBitType.browserImage]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.focusX},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.focusY}],bodyAllowed:!0},[l.RootBitType.card1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.question1]:{since:"1.3.0"},[l.AliasBitType.survey1]:{since:"1.3.0"},[l.AliasBitType.surveyAnonymous1]:{since:"1.3.0"}}},[l.RootBitType.chapter]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.anchor},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.toc},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.progress}],bodyAllowed:!0},[l.RootBitType.clozeAndMultipleChoiceText]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_gap},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachCallToActionClozeAndMultipleChoiceText]:{since:"1.3.0"}}},[l.RootBitType.cloze]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_gap}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.clozeInstructionGrouped]:{since:"1.3.0"},[l.AliasBitType.clozeSolutionGrouped]:{since:"1.3.0"},[l.AliasBitType.coachSelfReflectionCloze]:{since:"1.3.0"},[l.AliasBitType.coachCallToActionCloze]:{since:"1.3.0"}}},[l.RootBitType.clozeList]:{since:"1.4.13",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._clozeList,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.code]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.computerLanguage}],textFormatDefault:p.TextFormat.text,bodyAllowed:!0,aliases:{[l.AliasBitType.appCodeCell]:{since:"1.4.3"},[l.AliasBitType.appCodeEditor]:{since:"1.4.3"},[l.AliasBitType.appCodeIde]:{since:"1.4.3"},[l.AliasBitType.codeRuntime]:{since:"1.4.3"},[l.AliasBitType.consoleLog]:{since:"1.4.3"},[l.AliasBitType.output]:{since:"1.4.3"},[l.AliasBitType.stdout]:{since:"1.4.3"}}},[l.RootBitType.conversationLeft1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_partner}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.conversationLeft1Scream]:{since:"1.3.0"},[l.AliasBitType.conversationLeft1Thought]:{since:"1.3.0"},[l.AliasBitType.conversationRight1]:{since:"1.3.0"},[l.AliasBitType.conversationRight1Scream]:{since:"1.3.0"},[l.AliasBitType.conversationRight1Thought]:{since:"1.3.0"}}},[l.RootBitType.document]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocument,minCount:1}],bodyAllowed:!0},[l.RootBitType.documentDownload]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocumentDownload,minCount:1}],bodyAllowed:!0},[l.RootBitType.documentEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocumentEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.documentLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceDocumentLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.essay]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.property_sampleSolution},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.partialAnswer},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.property_reference,maxCount:u.Count.infinity}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.coachSelfReflectionEssay]:{since:"1.3.0"},[l.AliasBitType.coachCallToActionEssay]:{since:"1.3.0"}}},[l.RootBitType.example]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.appAiPrompt]:{since:"1.3.0"},[l.AliasBitType.aiPrompt]:{since:"1.3.0"},[l.AliasBitType.articleAi]:{since:"1.3.0"},[l.AliasBitType.articleAttachment]:{since:"1.3.0"},[l.AliasBitType.assignment]:{since:"1.3.0"},[l.AliasBitType.audioTranscript]:{since:"1.3.0"},[l.AliasBitType.bitmarkExample]:{since:"1.3.0"},[l.AliasBitType.blogArticle]:{since:"1.3.0"},[l.AliasBitType.bug]:{since:"1.3.0"},[l.AliasBitType.checklist]:{since:"1.3.0"},[l.AliasBitType.coachAudioTranscript]:{since:"1.3.0"},[l.AliasBitType.coachCallToActionChecklist]:{since:"1.3.0"},[l.AliasBitType.coachHomeRules]:{since:"1.3.0"},[l.AliasBitType.coachVideoTranscript]:{since:"1.3.0"},[l.AliasBitType.correction]:{since:"1.3.0"},[l.AliasBitType.cookPreparation]:{since:"1.3.0"},[l.AliasBitType.cookStep]:{since:"1.3.0"},[l.AliasBitType.cookIngredients]:{since:"1.3.0"},[l.AliasBitType.cookRemark]:{since:"1.3.0"},[l.AliasBitType.cookVariation]:{since:"1.3.0"},[l.AliasBitType.cookInsert]:{since:"1.3.0"},[l.AliasBitType.cookArrangement]:{since:"1.3.0"},[l.AliasBitType.cookPracticeAdvise]:{since:"1.3.0"},[l.AliasBitType.cookPlate]:{since:"1.3.0"},[l.AliasBitType.cookRecommendation]:{since:"1.3.0"},[l.AliasBitType.cookPersonalRecommendation]:{since:"1.3.0"},[l.AliasBitType.cookSideDrink]:{since:"1.3.0"},[l.AliasBitType.cookSideDish]:{since:"1.3.0"},[l.AliasBitType.cookTimer]:{since:"1.3.0"},[l.AliasBitType.danger]:{since:"1.3.0"},[l.AliasBitType.details1]:{since:"1.3.0"},[l.AliasBitType.details]:{since:"1.3.0"},[l.AliasBitType.editorial]:{since:"1.3.0"},[l.AliasBitType.editorNote]:{since:"1.3.0"},[l.AliasBitType.featured]:{since:"1.3.0"},[l.AliasBitType.help]:{since:"1.3.0"},[l.AliasBitType.hint]:{since:"1.3.0"},[l.AliasBitType.info]:{since:"1.3.0"},[l.AliasBitType.langLearningOutcomes]:{since:"1.3.0"},[l.AliasBitType.langEnablingLanguageSkills]:{since:"1.3.0"},[l.AliasBitType.langLifeSkills]:{since:"1.3.0"},[l.AliasBitType.langEnglishAroundWorld]:{since:"1.3.0"},[l.AliasBitType.langGoodToKnow]:{since:"1.3.0"},[l.AliasBitType.langLearningGoal]:{since:"1.3.0"},[l.AliasBitType.langLearningStrategy]:{since:"1.3.0"},[l.AliasBitType.langLikeALocal]:{since:"1.3.0"},[l.AliasBitType.langMaterial]:{since:"1.3.0"},[l.AliasBitType.langUsefulPhrases]:{since:"1.3.0"},[l.AliasBitType.langLevelDown]:{since:"1.3.0"},[l.AliasBitType.langLevelUp]:{since:"1.3.0"},[l.AliasBitType.langExtraActivity]:{since:"1.3.0"},[l.AliasBitType.langVideoScript]:{since:"1.3.0"},[l.AliasBitType.langAudioScript]:{since:"1.3.0"},[l.AliasBitType.langVocabulary]:{since:"1.3.0"},[l.AliasBitType.langHomework]:{since:"1.3.0"},[l.AliasBitType.langTeacherNote]:{since:"1.3.0"},[l.AliasBitType.langTeacherPronunciation]:{since:"1.3.0"},[l.AliasBitType.message]:{since:"1.3.0"},[l.AliasBitType.newspaperArticle]:{since:"1.3.0"},[l.AliasBitType.note]:{since:"1.3.0"},[l.AliasBitType.noteAi]:{since:"1.3.0"},[l.AliasBitType.notebookArticle]:{since:"1.3.0"},[l.AliasBitType.preparationNote]:{since:"1.3.0"},[l.AliasBitType.releaseNotesSummary]:{since:"1.3.0"},[l.AliasBitType.remark]:{since:"1.3.0"},[l.AliasBitType.selfAssessment]:{since:"1.3.0"},[l.AliasBitType.separator]:{since:"1.4.15"},[l.AliasBitType.sideNote]:{since:"1.3.0"},[l.AliasBitType.summary]:{since:"1.3.0"},[l.AliasBitType.summaryAi]:{since:"1.3.0"},[l.AliasBitType.videoTranscript]:{since:"1.3.0"},[l.AliasBitType.warning]:{since:"1.3.0"},[l.AliasBitType.workbookArticle]:{since:"1.3.0"}}},[l.RootBitType.exampleList]:{since:"1.4.13",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title}],cardSet:o.CardSetConfigKey._exampleBitList,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.assignmentList]:{since:"1.4.13"},[l.AliasBitType.pageFooter]:{since:"1.4.13"}}},[l.RootBitType.flashcard]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._flashcards,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.flashcard1]:{since:"1.3.0"}}},[l.RootBitType.focusImage]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.focusX},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.focusY}],bodyAllowed:!0},[l.RootBitType.highlightText]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.image]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.appCreateBitsFromImage]:{since:"1.3.0"},[l.AliasBitType.appGetScreenshot]:{since:"1.3.0"},[l.AliasBitType.detailsImage]:{since:"1.3.0"},[l.AliasBitType.figure]:{since:"1.3.0",deprecated:"1.4.0"},[l.AliasBitType.imageBanner]:{since:"1.3.0"},[l.AliasBitType.imageFigure]:{since:"1.3.0"},[l.AliasBitType.imageLandscape]:{since:"1.3.0"},[l.AliasBitType.imageMood]:{since:"1.3.0"},[l.AliasBitType.imagePortrait]:{since:"1.3.0"},[l.AliasBitType.imagePrototype]:{since:"1.3.0"},[l.AliasBitType.imageSeparator]:{since:"1.4.15"},[l.AliasBitType.imageScreenshot]:{since:"1.3.0"},[l.AliasBitType.imageStyled]:{since:"1.3.0"},[l.AliasBitType.imageSuperWide]:{since:"1.3.0"},[l.AliasBitType.imageZoom]:{since:"1.3.0"},[l.AliasBitType.langLifeSkillIcon]:{since:"1.3.0"},[l.AliasBitType.lifeSkillSticker]:{since:"1.3.0"},[l.AliasBitType.pageBanner]:{since:"1.4.3"},[l.AliasBitType.screenshot]:{since:"1.3.0",deprecated:"1.4.0"}}},[l.RootBitType.imageLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImageLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.imageOnDevice]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_imageSource}],bodyAllowed:!0},[l.RootBitType.imageResponsive]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImageResponsive}],bodyAllowed:!0},[l.RootBitType.internalLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.tag_reference}],bodyAllowed:!0},[l.RootBitType.interview]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars}],cardSet:o.CardSetConfigKey._questions,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.interviewInstructionGrouped]:{since:"1.3.0"},[l.AliasBitType.botInterview]:{since:"1.3.0"}}},[l.RootBitType.learningPathBook]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.bookLink]:{since:"1.3.0"},[l.AliasBitType.bookLinkNext]:{since:"1.3.0"},[l.AliasBitType.bookLinkPrev]:{since:"1.3.0"},[l.AliasBitType.learningPathClassroomEvent]:{since:"1.3.0"},[l.AliasBitType.learningPathClassroomTraining]:{since:"1.3.0"},[l.AliasBitType.learningPathClosing]:{since:"1.3.0"},[l.AliasBitType.learningPathFeedback]:{since:"1.3.0"},[l.AliasBitType.learningPathLearningGoal]:{since:"1.3.0"},[l.AliasBitType.learningPathLti]:{since:"1.3.0"},[l.AliasBitType.learningPathSign]:{since:"1.3.0"},[l.AliasBitType.learningPathStep]:{since:"1.3.0"}}},[l.RootBitType.learningPathBotTraining]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.bot}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.learningPathExternalLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.externalLink},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.externalLinkText}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.learningPathVideoCall]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_learningPathCommon},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.videoCallLink}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.mark]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_markConfig},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_mark}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.match]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchPairs,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.matchAll]:{since:"1.3.0"},[l.AliasBitType.matchReverse]:{since:"1.3.0"},[l.AliasBitType.matchAllReverse]:{since:"1.3.0"},[l.AliasBitType.matchSolutionGrouped]:{since:"1.3.0"}}},[l.RootBitType.matchMatrix]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchMatrix,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.matchAudio]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchAudioPairs,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.matchPicture]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._matchImagePairs,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.multipleChoice1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleChoice1]:{since:"1.3.0"}}},[l.RootBitType.multipleChoice]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],cardSet:o.CardSetConfigKey._quiz,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleChoice]:{since:"1.3.0"}}},[l.RootBitType.multipleChoiceText]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachCallToActionMultipleChoiceText]:{since:"1.3.0"},[l.AliasBitType.coachSelfReflectionMultipleChoiceText]:{since:"1.3.0"}}},[l.RootBitType.multipleResponse1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleResponse1]:{since:"1.3.0"}}},[l.RootBitType.multipleResponse]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse}],cardSet:o.CardSetConfigKey._quiz,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionMultipleResponse]:{since:"1.3.0"}}},[l.RootBitType.page]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.thumbImage}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.pageBuyButton]:{since:"1.4.3",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.content2Buy}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.photo]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,minCount:1}],bodyAllowed:!0},[l.RootBitType.quote]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.quotedPerson}],bodyAllowed:!0},[l.RootBitType.rating]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],bodyAllowed:!0,aliases:{[l.AliasBitType.coachSelfReflectionRating]:{since:"1.3.0"}}},[l.RootBitType.releaseNote]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.releaseVersion}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.reviewNote]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.resolved},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.resolvedDate},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.resolvedBy}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string,aliases:{[l.AliasBitType.reviewAuthorNote]:{since:"1.3.0"},[l.AliasBitType.reviewReviewerNote]:{since:"1.3.0"},[l.AliasBitType.reviewRequestForReviewNote]:{since:"1.3.0"},[l.AliasBitType.reviewApprovedNote]:{since:"1.3.0"}}},[l.RootBitType.sampleSolution]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.anchor},{type:s.BitTagType.tag,configKey:a.TagConfigKey.tag_reference}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.sequence]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],cardSet:o.CardSetConfigKey._elements,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,rootExampleType:c.ExampleType.boolean},[l.RootBitType.stillImageFilm]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceStillImageFilm}],bodyAllowed:!0},[l.RootBitType.stillImageFilmEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceStillImageFilmEmbed,minCount:1}],bodyAllowed:!0},[l.RootBitType.stillImageFilmLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceStillImageFilmLink,minCount:1}],bodyAllowed:!0},[l.RootBitType.surveyAnonymous]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.survey]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.RootBitType.toc]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags}],bodyAllowed:!0,aliases:{[l.AliasBitType.anchor]:{since:"1.3.0"},[l.AliasBitType.bitBookEnding]:{since:"1.3.0"},[l.AliasBitType.bitBookSummary]:{since:"1.3.0"},[l.AliasBitType.botActionAnnounce]:{since:"1.3.0"},[l.AliasBitType.botActionRatingNumber]:{since:"1.3.0"},[l.AliasBitType.botActionRemind]:{since:"1.3.0"},[l.AliasBitType.botActionSave]:{since:"1.3.0"},[l.AliasBitType.botActionTrueFalse]:{since:"1.3.0"},[l.AliasBitType.chapterSubjectMatter]:{since:"1.3.0"},[l.AliasBitType.chat]:{since:"1.3.0"},[l.AliasBitType.conclusion]:{since:"1.3.0"},[l.AliasBitType.documentUpload]:{since:"1.3.0"},[l.AliasBitType.footNote]:{since:"1.3.0"},[l.AliasBitType.groupBorn]:{since:"1.3.0"},[l.AliasBitType.groupDied]:{since:"1.3.0"},[l.AliasBitType.recordAudio]:{since:"1.3.0"},[l.AliasBitType.stickyNote]:{since:"1.3.0"},[l.AliasBitType.takePicture]:{since:"1.3.0"}}},[l.RootBitType.trueFalse1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.labelTrue},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.labelFalse},{type:s.BitTagType.tag,configKey:a.TagConfigKey.true},{type:s.BitTagType.tag,configKey:a.TagConfigKey.false}],resourceAttachmentAllowed:!0,bodyAllowed:!1,rootExampleType:c.ExampleType.boolean},[l.RootBitType.trueFalse]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.labelTrue},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.labelFalse}],cardSet:o.CardSetConfigKey._statements,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.RootBitType.vendorPadletEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.padletId}],textFormatDefault:p.TextFormat.text,bodyAllowed:!0},[l.RootBitType.vendorJupyterOutput]:{since:"1.4.3",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.jupyterId},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.jupyterExecutionCount},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.computerLanguage}],textFormatDefault:p.TextFormat.text,bodyAllowed:!0,aliases:{[l.AliasBitType.vendorJupyterCellCode]:{since:"1.4.3"},[l.AliasBitType.vendorJupyterCellMarkdown]:{since:"1.4.3"},[l.AliasBitType.vendorJupyterCellRaw]:{since:"1.4.3"},[l.AliasBitType.vendorJupyterIpynb]:{since:"1.4.3"}}},[l.RootBitType.video]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideo,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.videoLandscape]:{since:"1.3.0"},[l.AliasBitType.videoPortrait]:{since:"1.3.0"}}},[l.RootBitType.videoEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideoEmbed,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.videoEmbedLandscape]:{since:"1.3.0"},[l.AliasBitType.videoEmbedPortrait]:{since:"1.3.0"}}},[l.RootBitType.videoLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideoLink,minCount:1}],bodyAllowed:!0,aliases:{[l.AliasBitType.videoLinkLandscape]:{since:"1.3.0"},[l.AliasBitType.videoLinkPortrait]:{since:"1.3.0"}}},[l.RootBitType.websiteLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:i.GroupConfigKey.group_resourceWebsiteLink,minCount:1}],bodyAllowed:!0}};t.BITS=g},4182:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARDS=void 0;const o=r(2574),i=r(177),n=r(3518),a=r(6194),s=r(1595),l=r(742),u=r(1035),c={[o.CardSetConfigKey._flashcards]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._elements]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._statements]:{variants:[[{tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.true,maxCount:1},{type:l.BitTagType.tag,configKey:s.TagConfigKey.false,maxCount:1},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}]}]]},[o.CardSetConfigKey._quiz]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_trueFalse},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}]}]]},[o.CardSetConfigKey._questions]:{variants:[[{tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars},{type:l.BitTagType.tag,configKey:s.TagConfigKey.sampleSolution},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.property_sampleSolution},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchPairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isCaseSensitive}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchAudioPairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title},{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.audio}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchImagePairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title},{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.image}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._matchMatrix]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isCaseSensitive}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[o.CardSetConfigKey._botActionResponses]:{variants:[[{tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.reaction},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}],bodyAllowed:!0}]]},[o.CardSetConfigKey._clozeList]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_gap}],bodyAllowed:!0}]]},[o.CardSetConfigKey._exampleBitList]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardTags},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]}};t.CARDS=c},9036:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GROUPS=void 0;const o=r(177),i=r(5428),n=r(3518),a=r(6194),s=r(1595),l=r(742),u=r(1035),c=r(9779),p={[o.GroupConfigKey.group_standardAllBits]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.id,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.externalId,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.aiGenerated},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.ageRange,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.lang},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.target,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.tag,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.icon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.iconTag},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.colorTag,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:s.TagConfigKey.anchor}]},[o.GroupConfigKey.group_standardItemLeadInstructionHint]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.itemLead,maxCount:2},{type:l.BitTagType.tag,configKey:s.TagConfigKey.instruction},{type:l.BitTagType.tag,configKey:s.TagConfigKey.hint}]},[o.GroupConfigKey.group_standardExample]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.example}]},[o.GroupConfigKey.group_standardTags]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardAllBits},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]},[o.GroupConfigKey.group_imageSource]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.imageSource,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mockupId},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.size},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.format},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.trim}]}]},[o.GroupConfigKey.group_partner]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.partner,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImage}]}]},[o.GroupConfigKey.group_gap]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.gap,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.gap,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isCaseSensitive}]}]},[o.GroupConfigKey.group_trueFalse]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.true,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.true,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:s.TagConfigKey.false,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]},{type:l.BitTagType.tag,configKey:s.TagConfigKey.false,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.true,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:s.TagConfigKey.false,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]}]},[o.GroupConfigKey.group_markConfig]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.markConfig,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.color},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.emphasis}]}]},[o.GroupConfigKey.group_mark]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.tag_mark,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.property_mark},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]}]},[o.GroupConfigKey.group_bookCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.language,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.spaceId,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.kind},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title,maxCount:2},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.subtype,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.coverImage,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.publisher,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.subject,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.author,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.theme,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.publications,maxCount:u.Count.infinity}]},[o.GroupConfigKey.group_learningPathCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.action},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.date},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.location},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.list,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.textReference},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isTracked},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isInfoOnly},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.deeplink},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.book,chain:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.tag_reference,maxCount:2}]}]},[o.GroupConfigKey.group_resourceCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.license},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.copyright},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.caption},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.showInIndex}]},[o.GroupConfigKey.group_resourceImageCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src1x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src2x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src3x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src4x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.width},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.height},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.alt},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.zoomDisabled}]},[o.GroupConfigKey.group_resourceAudioCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mute},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.autoplay}]},[o.GroupConfigKey.group_resourceVideoCommon]:{type:i.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.width},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.height},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mute},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.autoplay},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.allowSubtitles},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.showSubtitles},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.alt},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.posterImage},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src1x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src2x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src3x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src4x}]},[o.GroupConfigKey.group_resourceImage]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.image,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImagePortrait]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.imagePortrait,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImageLandscape]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.imageLandscape,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImageEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.imageEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceImageLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.imageLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageCommon}]}]},[o.GroupConfigKey.group_resourceAudio]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.audio,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioCommon}]}]},[o.GroupConfigKey.group_resourceAudioEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.audioEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioCommon}]}]},[o.GroupConfigKey.group_resourceAudioLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.audioLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioCommon}]}]},[o.GroupConfigKey.group_resourceVideo]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.video,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceVideoEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.videoEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceVideoLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.videoLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceStillImageFilmEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.stillImageFilmEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceStillImageFilmLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.stillImageFilmLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoCommon}]}]},[o.GroupConfigKey.group_resourceArticle]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.article,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceArticleEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.articleEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceArticleLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.articleLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocument]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.document,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocumentEmbed]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.documentEmbed,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocumentLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.documentLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceDocumentDownload]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.documentDownload,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceAppLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.appLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceWebsiteLink]:{type:i.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.websiteLink,chain:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceCommon}]}]},[o.GroupConfigKey.group_resourceStillImageFilm]:{type:i.GroupConfigType.comboResource,comboResourceType:c.ResourceTag.stillImageFilm,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImage,maxCount:1,minCount:1},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudio,maxCount:1,minCount:1}]},[o.GroupConfigKey.group_resourceImageResponsive]:{type:i.GroupConfigType.comboResource,comboResourceType:c.ResourceTag.imageResponsive,tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImagePortrait,maxCount:1,minCount:1},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageLandscape,maxCount:1,minCount:1}]}};t.GROUPS=p},6260:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PROPERTIES=void 0;const o=r(3518),i=r(7204),n=r(5486),a=r(7953),s={[o.PropertyConfigKey.id]:{tag:a.PropertyTag.id,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.internalComment]:{tag:a.PropertyTag.internalComment,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.externalId]:{tag:a.PropertyTag.externalId,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.spaceId]:{tag:a.PropertyTag.spaceId,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.padletId]:{tag:a.PropertyTag.padletId,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.jupyterId]:{tag:a.PropertyTag.jupyterId,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.jupyterExecutionCount]:{tag:a.PropertyTag.jupyterExecutionCount,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.aiGenerated]:{tag:a.PropertyTag.aiGenerated,single:!0,format:n.PropertyFormat.boolean,astKey:i.PropertyAstKey.aiGenerated},[o.PropertyConfigKey.releaseVersion]:{tag:a.PropertyTag.releaseVersion,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.resolved]:{tag:a.PropertyTag.resolved,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.resolvedDate]:{tag:a.PropertyTag.resolvedDate,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.resolvedBy]:{tag:a.PropertyTag.resolvedBy,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.ageRange]:{tag:a.PropertyTag.ageRange,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.lang]:{tag:a.PropertyTag.lang,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.language]:{tag:a.PropertyTag.language,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.computerLanguage]:{tag:a.PropertyTag.computerLanguage,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.target]:{tag:a.PropertyTag.target,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.tag]:{tag:a.PropertyTag.tag,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.icon]:{tag:a.PropertyTag.icon,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.iconTag]:{tag:a.PropertyTag.iconTag,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.colorTag]:{tag:a.PropertyTag.colorTag,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.flashcardSet]:{tag:a.PropertyTag.flashcardSet,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.subtype]:{tag:a.PropertyTag.subtype,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.bookAlias]:{tag:a.PropertyTag.bookAlias,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.coverImage]:{tag:a.PropertyTag.coverImage,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.publisher]:{tag:a.PropertyTag.publisher,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.publications]:{tag:a.PropertyTag.publications,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.author]:{tag:a.PropertyTag.author,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.subject]:{tag:a.PropertyTag.subject,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.date]:{tag:a.PropertyTag.date,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.location]:{tag:a.PropertyTag.location,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.theme]:{tag:a.PropertyTag.theme,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.kind]:{tag:a.PropertyTag.kind,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.action]:{tag:a.PropertyTag.action,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.thumbImage]:{tag:a.PropertyTag.thumbImage,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.focusX]:{tag:a.PropertyTag.focusX,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.focusY]:{tag:a.PropertyTag.focusY,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.deeplink]:{tag:a.PropertyTag.deeplink,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.externalLink]:{tag:a.PropertyTag.externalLink,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.externalLinkText]:{tag:a.PropertyTag.externalLinkText,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.videoCallLink]:{tag:a.PropertyTag.videoCallLink,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.bot]:{tag:a.PropertyTag.bot,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.duration]:{tag:a.PropertyTag.duration,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.property_reference]:{tag:a.PropertyTag.reference,format:n.PropertyFormat.trimmedString,astKey:i.PropertyAstKey.referenceProperty},[o.PropertyConfigKey.list]:{tag:a.PropertyTag.list,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.textReference]:{tag:a.PropertyTag.textReference,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.isTracked]:{tag:a.PropertyTag.isTracked,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.isInfoOnly]:{tag:a.PropertyTag.isInfoOnly,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.labelTrue]:{tag:a.PropertyTag.labelTrue,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.labelFalse]:{tag:a.PropertyTag.labelFalse,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.content2Buy]:{tag:a.PropertyTag.content2Buy,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.quotedPerson]:{tag:a.PropertyTag.quotedPerson,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.partialAnswer]:{tag:a.PropertyTag.partialAnswer,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.reasonableNumOfChars]:{tag:a.PropertyTag.reasonableNumOfChars,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.maxCreatedBits]:{tag:a.PropertyTag.maxCreatedBits,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.example]:{tag:a.PropertyTag.example,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.toc]:{tag:a.PropertyTag.toc,single:!0,format:n.PropertyFormat.boolean,defaultValue:"true"},[o.PropertyConfigKey.progress]:{tag:a.PropertyTag.progress,single:!0,format:n.PropertyFormat.boolean,defaultValue:"true"},[o.PropertyConfigKey.book]:{tag:a.PropertyTag.book,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.partner]:{tag:a.PropertyTag.partner,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.property_sampleSolution]:{tag:a.PropertyTag.sampleSolution,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.markConfig]:{tag:a.PropertyTag.mark,format:n.PropertyFormat.trimmedString,astKey:i.PropertyAstKey.markConfig},[o.PropertyConfigKey.property_mark]:{tag:a.PropertyTag.mark,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.color]:{tag:a.PropertyTag.color,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.emphasis]:{tag:a.PropertyTag.emphasis,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.isCaseSensitive]:{tag:a.PropertyTag.isCaseSensitive,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.reaction]:{tag:a.PropertyTag.reaction,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.imageSource]:{tag:a.PropertyTag.imageSource,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.mockupId]:{tag:a.PropertyTag.mockupId,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.size]:{tag:a.PropertyTag.size,single:!0,format:n.PropertyFormat.number},[o.PropertyConfigKey.format]:{tag:a.PropertyTag.format,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.trim]:{tag:a.PropertyTag.trim,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.width]:{tag:a.PropertyTag.width,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.height]:{tag:a.PropertyTag.height,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.license]:{tag:a.PropertyTag.license,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.copyright]:{tag:a.PropertyTag.copyright,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.caption]:{tag:a.PropertyTag.caption,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.showInIndex]:{tag:a.PropertyTag.showInIndex,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.alt]:{tag:a.PropertyTag.alt,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.zoomDisabled]:{tag:a.PropertyTag.zoomDisabled,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.src1x]:{tag:a.PropertyTag.src1x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src2x]:{tag:a.PropertyTag.src2x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src3x]:{tag:a.PropertyTag.src3x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.src4x]:{tag:a.PropertyTag.src4x,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.mute]:{tag:a.PropertyTag.mute,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.autoplay]:{tag:a.PropertyTag.autoplay,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.allowSubtitles]:{tag:a.PropertyTag.allowSubtitles,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.showSubtitles]:{tag:a.PropertyTag.showSubtitles,single:!0,format:n.PropertyFormat.boolean},[o.PropertyConfigKey.siteName]:{tag:a.PropertyTag.siteName,single:!0,format:n.PropertyFormat.trimmedString},[o.PropertyConfigKey.posterImage]:{tag:a.PropertyTag.posterImage,single:!0,format:n.PropertyFormat.trimmedString}};t.PROPERTIES=s},5100:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RESOURCES=void 0;const o=r(6194),i=r(9431),n=r(9779),a={[o.ResourceConfigKey.image]:{tag:n.ResourceTag.image},[o.ResourceConfigKey.imagePortrait]:{tag:n.ResourceTag.imagePortrait,jsonKey:i.ResourceJsonKey.imagePortrait},[o.ResourceConfigKey.imageLandscape]:{tag:n.ResourceTag.imageLandscape,jsonKey:i.ResourceJsonKey.imageLandscape},[o.ResourceConfigKey.imageEmbed]:{tag:n.ResourceTag.imageEmbed,jsonKey:i.ResourceJsonKey.imageEmbed},[o.ResourceConfigKey.imageLink]:{tag:n.ResourceTag.imageLink,jsonKey:i.ResourceJsonKey.imageLink},[o.ResourceConfigKey.audio]:{tag:n.ResourceTag.audio},[o.ResourceConfigKey.audioEmbed]:{tag:n.ResourceTag.audioEmbed,jsonKey:i.ResourceJsonKey.audioEmbed},[o.ResourceConfigKey.audioLink]:{tag:n.ResourceTag.audioLink,jsonKey:i.ResourceJsonKey.audioLink},[o.ResourceConfigKey.video]:{tag:n.ResourceTag.video},[o.ResourceConfigKey.videoEmbed]:{tag:n.ResourceTag.videoEmbed,jsonKey:i.ResourceJsonKey.videoEmbed},[o.ResourceConfigKey.videoLink]:{tag:n.ResourceTag.videoLink,jsonKey:i.ResourceJsonKey.videoLink},[o.ResourceConfigKey.stillImageFilmEmbed]:{tag:n.ResourceTag.stillImageFilmEmbed,jsonKey:i.ResourceJsonKey.stillImageFilmEmbed},[o.ResourceConfigKey.stillImageFilmLink]:{tag:n.ResourceTag.stillImageFilmLink,jsonKey:i.ResourceJsonKey.stillImageFilmLink},[o.ResourceConfigKey.article]:{tag:n.ResourceTag.article},[o.ResourceConfigKey.articleEmbed]:{tag:n.ResourceTag.articleEmbed,jsonKey:i.ResourceJsonKey.articleEmbed},[o.ResourceConfigKey.articleLink]:{tag:n.ResourceTag.articleLink,jsonKey:i.ResourceJsonKey.articleLink},[o.ResourceConfigKey.document]:{tag:n.ResourceTag.document},[o.ResourceConfigKey.documentEmbed]:{tag:n.ResourceTag.documentEmbed,jsonKey:i.ResourceJsonKey.documentEmbed},[o.ResourceConfigKey.documentLink]:{tag:n.ResourceTag.documentLink,jsonKey:i.ResourceJsonKey.documentLink},[o.ResourceConfigKey.documentDownload]:{tag:n.ResourceTag.documentDownload,jsonKey:i.ResourceJsonKey.documentDownload},[o.ResourceConfigKey.appLink]:{tag:n.ResourceTag.appLink,jsonKey:i.ResourceJsonKey.appLink},[o.ResourceConfigKey.websiteLink]:{tag:n.ResourceTag.websiteLink,jsonKey:i.ResourceJsonKey.websiteLink}};t.RESOURCES=a},3622:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS=void 0;const o=r(1595),i=r(8739),n={[o.TagConfigKey.title]:{tag:i.Tag.title},[o.TagConfigKey.anchor]:{tag:i.Tag.anchor},[o.TagConfigKey.tag_reference]:{tag:i.Tag.reference},[o.TagConfigKey.property]:{tag:i.Tag.property},[o.TagConfigKey.itemLead]:{tag:i.Tag.itemLead},[o.TagConfigKey.instruction]:{tag:i.Tag.instruction},[o.TagConfigKey.hint]:{tag:i.Tag.hint},[o.TagConfigKey.true]:{tag:i.Tag.true},[o.TagConfigKey.false]:{tag:i.Tag.false},[o.TagConfigKey.sampleSolution]:{tag:i.Tag.sampleSolution},[o.TagConfigKey.gap]:{tag:i.Tag.gap},[o.TagConfigKey.tag_mark]:{tag:i.Tag.mark},[o.TagConfigKey.resource]:{tag:i.Tag.resource}};t.TAGS=n},1022:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildInfo=void 0,t.buildInfo={name:"@gmb/bitmark-parser-generator",version:"1.4.16",author:"Get More Brain Ltd",license:"ISC",description:"A bitmark parser and generator using Peggy.js"}},4369:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=void 0;const o=r(6831),i=r(2892),n=r(7448);function a(e,t,r,o){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,a.prototype),i.expected=t,i.found=r,i.location=o,i.name="SyntaxError",i}function s(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}t.SyntaxError=a,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(a,Error),a.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,o=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){o=e[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,n=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,a=this.location.source+":"+n.line+":"+n.column;if(o){var l=this.location.end,u=s("",n.line.toString().length," "),c=o[i.line-1],p=(i.line===l.line?l.column:c.length+1)-i.column||1;t+="\n --\x3e "+a+"\n"+u+" |\n"+n.line+" | "+c+"\n"+u+" | "+s("",i.column-1," ")+s("",p,"^")}else t+="\n at "+a}return t},a.buildMessage=function(e,t){var r={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function o(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(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"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(e)}))}function n(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"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(e)}))}function a(e){return r[e.type](e)}return"Expected "+function(e){var t,r,o=e.map(a);if(o.sort(),o.length>0){for(t=1,r=1;t<o.length;t++)o[t-1]!==o[t]&&(o[r]=o[t],r++);o.length=r}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."},t.parse=function e(t,r){var s,l={},u=(r=void 0!==r?r:{}).grammarSource,c={bitmark:Zt,bit:function(){var e,t,r,o,i;e=Gt,t=[],r=Cr();for(;r!==l;)t.push(r),r=Cr();if((r=tr())!==l){for(o=[],i=Cr();i!==l;)o.push(i),i=Cr();Vt=e,e=ze(r)}else Gt=e,e=l;return e},cardContent:function(){var e,t,r;e=Gt,t=[],(r=nr())===l&&(r=dr());for(;r!==l;)t.push(r),(r=nr())===l&&(r=dr());return Vt=e,t=mt(t),e=t}},p=Zt,g="[.",d="]",y=":",f="&",h="====",m="~~~~",T="--",b="++",v="===",C="==",k="[@id",B="[",x="#",A="[▼",P="[►",w="[@",S="[%",K="[!",_="[?",R="[+",I="[-",E="[$",O="[_",L="[=",j="[&",F="^]",G="id:",V="\n",N="\r\n",D="\r",M="\u2028",U="\u2029",$=/^[^\]]/,J=/^[^:\]]/,q=/^[^&:\]]/,z=/^[ \t]/,H=/^[^\n\r\u2028\u2029]/,W=/^[ \t\n\r\u2028\u2029]/,Y=Jt("[.",!1),X=qt(["]"],!0,!1),Z=Jt("]",!1),Q=Jt(":",!1),ee=Jt("&",!1),te={type:"any"},re=Jt("====",!1),oe=Jt("~~~~",!1),ie=Jt("--",!1),ne=Jt("++",!1),ae=Jt("===",!1),se=Jt("==",!1),le=Jt("[@id",!1),ue=Jt("[",!1),ce=Jt("#",!1),pe=Jt("[▼",!1),ge=Jt("[►",!1),de=Jt("[@",!1),ye=Jt("[%",!1),fe=Jt("[!",!1),he=Jt("[?",!1),me=Jt("[+",!1),Te=Jt("[-",!1),be=Jt("[$",!1),ve=Jt("[_",!1),Ce=Jt("[=",!1),ke=Jt("[&",!1),Be=Jt("^]",!1),xe=Jt("id:",!1),Ae=qt([":","]"],!0,!1),Pe=qt(["&",":","]"],!0,!1),we=(zt("Empty"),qt([" ","\t"],!1,!1)),Se=zt("Anything"),Ke=zt("Character"),_e=qt(["\n","\r","\u2028","\u2029"],!0,!1),Re=zt("Line"),Ie=(zt("whitespace in line"),zt("Blank Line")),Ee=zt("Line Terminator"),Oe=Jt("\n",!1),Le=Jt("\r\n",!1),je=Jt("\r",!1),Fe=Jt("\u2028",!1),Ge=Jt("\u2029",!1),Ve=zt("Whitespace, then Line Terminator"),Ne=zt("whitespace"),De=qt([" ","\t","\n","\r","\u2028","\u2029"],!1,!1),Me=function(e,t){return Sr.buildBits([e,...t])},Ue=function(e){return wr.handleRawBit(e)},$e=function(e){return e},Je=function(e){return wr.handleRawBit(e)},qe=function(e){return e},ze=function(e){return e},He=function(e,t){return Sr.buildBit(e,t)},We=function(e){return Sr.invalidBit(e)},Ye=function(e,t){return Sr.buildBitHeader(e,t)},Xe=function(e,t){return Sr.buildTextAndResourceType(e,t)},Ze=function(e){return wr.handleTextFormat(e)},Qe=function(e){return wr.handleResourceType(e)},et=function(e){return wr.handleBitContent(e)},tt=function(e){return wr.handleTagChain(e)},rt=function(e){return e},ot=function(e){return wr.handleBitTag(e)},it=function(e){return{type:o.TypeKey.BodyChar,value:e}},nt=function(e){return wr.handleCardSet(e[1].flat())},at=function(){wr.handleCardSetStart()},st=function(){wr.handleCardSetEnd()},lt=function(e){return wr.handleCards(e)},ut=function(e){return wr.handleCardLineOrDivider(e,2)},ct=function(e){return wr.handleCardLine(e)},pt=function(e){return wr.handleCardSet(e[1].flat())},gt=function(){wr.handleCardSetStart()},dt=function(){wr.handleCardSetEnd()},yt=function(e){return wr.handleCards(e)},ft=function(e){return wr.handleCardLineOrDivider(e,1)},ht=function(e){return wr.handleCardLine(e)},mt=function(e){return wr.handleCardContent(e)},Tt=function(e){return{type:o.TypeKey.CardChar,value:e}},bt=function(e){return wr.handlePropertyTag("id",e)},vt=function(e,t){return wr.handleTag(o.TypeKey.Title,{level:e,title:t})},Ct=function(e){return wr.handleTag(o.TypeKey.Anchor,e)},kt=function(e){return wr.handleTag(o.TypeKey.Reference,e)},Bt=function(e,t){return wr.handlePropertyTag(e,t)},xt=function(e){return wr.handleTag(o.TypeKey.ItemLead,e)},At=function(e){return wr.handleTag(o.TypeKey.Instruction,e)},Pt=function(e){return wr.handleTag(o.TypeKey.Hint,e)},wt=function(e){return wr.handleTag(o.TypeKey.True,e)},St=function(e){return wr.handleTag(o.TypeKey.False,e)},Kt=function(e){return wr.handleTag(o.TypeKey.SampleSolution,e)},_t=function(e){return wr.handleTag(o.TypeKey.Gap,e)},Rt=function(e){return wr.handleTag(o.TypeKey.Mark,e)},It=function(e,t){return wr.handleResourceTag(e,t)},Et=function(e){return e},Ot=function(e){return e?e.trim():""},Lt=function(e){return e?e.trim():null},jt=function(e){return e?e.trim():""},Ft=function(){return!0},Gt=0,Vt=0,Nt=[{line:1,column:1}],Dt=0,Mt=[],Ut=0;if("startRule"in r){if(!(r.startRule in c))throw new Error("Can't start parsing from rule \""+r.startRule+'".');p=c[r.startRule]}function $t(){return t.substring(Vt,Gt)}function Jt(e,t){return{type:"literal",text:e,ignoreCase:t}}function qt(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function zt(e){return{type:"other",description:e}}function Ht(e){var r,o=Nt[e];if(o)return o;for(r=e-1;!Nt[r];)r--;for(o={line:(o=Nt[r]).line,column:o.column};r<e;)10===t.charCodeAt(r)?(o.line++,o.column=1):o.column++,r++;return Nt[e]=o,o}function Wt(e,t,r){var o=Ht(e),i=Ht(t),n={source:u,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:i.line,column:i.column}};return r&&u&&"function"==typeof u.offset&&(n.start=u.offset(n.start),n.end=u.offset(n.end)),n}function Yt(e){Gt<Dt||(Gt>Dt&&(Dt=Gt,Mt=[]),Mt.push(e))}function Xt(e,t,r){return new a(a.buildMessage(e,t),e,t,r)}function Zt(){return function(){var e,r,o,i;e=Gt,r=[],o=xr();for(;o!==l;)r.push(o),o=xr();return o=function(){var e,r,o,i;e=Gt,r=Gt,o=[],i=er();for(;i!==l;)o.push(i),i=er();return r=t.substring(r,Gt),Vt=e,r=Ue(r),e=r,e}(),i=function(){var e,t;e=[],t=Qt();for(;t!==l;)e.push(t),t=Qt();return e}(),Vt=e,e=Me(o,i),e}()}function Qt(){var e,r,o,i;for(e=Gt,r=[],o=Cr();o!==l;)r.push(o),o=Cr();return(o=kr())===l&&(o=null),i=function(){var e,r,o,i,n,a;if(e=Gt,r=Gt,o=Gt,i=function(){var e,r,o,i;e=Gt,t.substr(Gt,2)===g?(r=g,Gt+=2):(r=l,0===Ut&&Yt(Y));if(r!==l){for(o=[],$.test(t.charAt(Gt))?(i=t.charAt(Gt),Gt++):(i=l,0===Ut&&Yt(X));i!==l;)o.push(i),$.test(t.charAt(Gt))?(i=t.charAt(Gt),Gt++):(i=l,0===Ut&&Yt(X));93===t.charCodeAt(Gt)?(i=d,Gt++):(i=l,0===Ut&&Yt(Z)),i!==l?(Vt=e,e=qe(r)):(Gt=e,e=l)}else Gt=e,e=l;return e}(),i!==l){for(n=[],a=er();a!==l;)n.push(a),a=er();o=i=[i,n]}else Gt=o,o=l;r=o!==l?t.substring(r,Gt):o;r!==l&&(Vt=e,r=Je(r));return e=r,e}(),i!==l?(Vt=e,e=$e(i)):(Gt=e,e=l),e}function er(){var e,t,r,o;if(e=Gt,(t=kr())!==l?(r=Gt,Ut++,o=rr(),Ut--,o===l?r=void 0:(Gt=r,r=l),r!==l?e=t=[t,r]:(Gt=e,e=l)):(Gt=e,e=l),e===l)if(e=[],(t=br())!==l)for(;t!==l;)e.push(t),t=br();else e=l;return e}function tr(){var e,r,o;return e=Gt,(r=rr())!==l?(o=function(){var e,t,r;e=Gt,t=[],r=ur(),r===l&&(r=pr())===l&&(r=nr())===l&&(r=lr());for(;r!==l;)t.push(r),(r=ur())===l&&(r=pr())===l&&(r=nr())===l&&(r=lr());return Vt=e,t=et(t),e=t,e}(),Vt=e,e=He(r,o)):(Gt=e,e=l),e===l&&(e=Gt,r=Gt,o=function(){var e,r;Ut++,e=[],t.length>Gt?(r=t.charAt(Gt),Gt++):(r=l,0===Ut&&Yt(te));for(;r!==l;)e.push(r),t.length>Gt?(r=t.charAt(Gt),Gt++):(r=l,0===Ut&&Yt(te));Ut--,r=l,0===Ut&&Yt(Se);return e}(),r=t.substring(r,Gt),Vt=e,e=r=We(r)),e}function rr(){var e,r,o,i,n;return e=Gt,t.substr(Gt,2)===g?(r=g,Gt+=2):(r=l,0===Ut&&Yt(Y)),r!==l?(o=mr(),i=function(){var e,t,r;e=Gt,t=or(),t===l&&(t=ir());t===l&&(t=null);r=or(),r===l&&(r=ir());r===l&&(r=null);return Vt=e,e=Xe(t,r),e}(),93===t.charCodeAt(Gt)?(n=d,Gt++):(n=l,0===Ut&&Yt(Z)),n!==l?(Vt=e,e=Ye(o,i)):(Gt=e,e=l)):(Gt=e,e=l),e}function or(){var e,r,o;return e=Gt,58===t.charCodeAt(Gt)?(r=y,Gt++):(r=l,0===Ut&&Yt(Q)),r!==l?(o=mr(),Vt=e,e=Ze(o)):(Gt=e,e=l),e}function ir(){var e,r,o;return e=Gt,38===t.charCodeAt(Gt)?(r=f,Gt++):(r=l,0===Ut&&Yt(ee)),r!==l?(o=mr(),Vt=e,e=Qe(o)):(Gt=e,e=l),e}function nr(){var e,t,r,o,i;if(e=Gt,t=Gt,(r=sr())!==l){for(o=[],i=ar();i!==l;)o.push(i),i=ar();t=r=[r,o]}else Gt=t,t=l;return t!==l&&(Vt=e,t=tt(t)),e=t}function ar(){var e,t;return e=Gt,(t=sr())!==l&&(Vt=e,t=rt(t)),e=t}function sr(){var e,r;return e=Gt,r=function(){var e,r,o,i;e=Gt,t.substr(Gt,4)===k?(r=k,Gt+=4):(r=l,0===Ut&&Yt(le));r!==l&&(o=Tr())!==l?(i=function(){var e;93===t.charCodeAt(Gt)?(e=d,Gt++):(e=l,0===Ut&&Yt(Z));return e}(),i!==l?(Vt=e,e=bt(o)):(Gt=e,e=l)):(Gt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o,i;e=Gt,t.substr(Gt,2)===w?(r=w,Gt+=2):(r=l,0===Ut&&Yt(de));r!==l&&(o=fr())!==l&&(i=Tr())!==l&&hr()!==l?(Vt=e,e=Bt(o,i)):(Gt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o,i;e=Gt,91===t.charCodeAt(Gt)?(r=B,Gt++):(r=l,0===Ut&&Yt(ue));if(r!==l){if(o=[],35===t.charCodeAt(Gt)?(i=x,Gt++):(i=l,0===Ut&&Yt(ce)),i!==l)for(;i!==l;)o.push(i),35===t.charCodeAt(Gt)?(i=x,Gt++):(i=l,0===Ut&&Yt(ce));else o=l;o!==l?(i=yr(),hr()!==l?(Vt=e,e=vt(o,i)):(Gt=e,e=l)):(Gt=e,e=l)}else Gt=e,e=l;return e}(),r===l&&(r=function(){var e,r,o;e=Gt,t.substr(Gt,2)===A?(r=A,Gt+=2):(r=l,0===Ut&&Yt(pe));r!==l?(o=yr(),hr()!==l?(Vt=e,e=Ct(o)):(Gt=e,e=l)):(Gt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Gt,t.substr(Gt,2)===P?(r=P,Gt+=2):(r=l,0===Ut&&Yt(ge));r!==l?(o=yr(),hr()!==l?(Vt=e,e=kt(o)):(Gt=e,e=l)):(Gt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Gt,t.substr(Gt,2)===S?(r=S,Gt+=2):(r=l,0===Ut&&Yt(ye));r!==l?(o=yr(),hr()!==l?(Vt=e,e=xt(o)):(Gt=e,e=l)):(Gt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Gt,t.substr(Gt,2)===K?(r=K,Gt+=2):(r=l,0===Ut&&Yt(fe));r!==l?(o=yr(),hr()!==l?(Vt=e,e=At(o)):(Gt=e,e=l)):(Gt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Gt,t.substr(Gt,2)===_?(r=_,Gt+=2):(r=l,0===Ut&&Yt(he));r!==l?(o=yr(),hr()!==l?(Vt=e,e=Pt(o)):(Gt=e,e=l)):(Gt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Gt,t.substr(Gt,2)===O?(r=O,Gt+=2):(r=l,0===Ut&&Yt(ve));r!==l?(o=yr(),hr()!==l?(Vt=e,e=_t(o)):(Gt=e,e=l)):(Gt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Gt,t.substr(Gt,2)===L?(r=L,Gt+=2):(r=l,0===Ut&&Yt(Ce));r!==l?(o=yr(),hr()!==l?(Vt=e,e=Rt(o)):(Gt=e,e=l)):(Gt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Gt,t.substr(Gt,2)===E?(r=E,Gt+=2):(r=l,0===Ut&&Yt(be));r!==l?(o=yr(),hr()!==l?(Vt=e,e=Kt(o)):(Gt=e,e=l)):(Gt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Gt,t.substr(Gt,2)===R?(r=R,Gt+=2):(r=l,0===Ut&&Yt(me));r!==l?(o=yr(),hr()!==l?(Vt=e,e=wt(o)):(Gt=e,e=l)):(Gt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o;e=Gt,t.substr(Gt,2)===I?(r=I,Gt+=2):(r=l,0===Ut&&Yt(Te));r!==l?(o=yr(),hr()!==l?(Vt=e,e=St(o)):(Gt=e,e=l)):(Gt=e,e=l);return e}(),r===l&&(r=function(){var e,r,o,i;e=Gt,t.substr(Gt,2)===j?(r=j,Gt+=2):(r=l,0===Ut&&Yt(ke));r!==l&&(o=fr())!==l&&(i=Tr())!==l&&hr()!==l?(Vt=e,e=It(o,i)):(Gt=e,e=l);return e}()))))))))))))),r!==l&&(Vt=e,r=ot(r)),e=r}function lr(){var e,r;return e=Gt,t.length>Gt?(r=t.charAt(Gt),Gt++):(r=l,0===Ut&&Yt(te)),r!==l&&(Vt=e,r=it(r)),e=r}function ur(){var e,r,o,i,n;if(e=Gt,r=Gt,o=function(){var e,r,o,i,n,a;e=Gt,r=kr(),r!==l?(o=Gt,Ut++,i=Gt,t.substr(Gt,4)===h?(n=h,Gt+=4):(n=l,0===Ut&&Yt(re)),n!==l&&(a=Br())!==l?i=n=[n,a]:(Gt=i,i=l),Ut--,i!==l?(Gt=o,o=void 0):o=l,o!==l?(Vt=e,e=at()):(Gt=e,e=l)):(Gt=e,e=l);return e}(),o!==l){for(i=[],n=cr();n!==l;)i.push(n),n=cr();n=function(){var e,r,o,i,n;e=Gt,r=Gt,t.substr(Gt,4)===m?(o=m,Gt+=4):(o=l,0===Ut&&Yt(oe));o===l&&(o=null);i=Gt,Ut++,n=Ar(),Ut--,n!==l?(Gt=i,i=void 0):i=l;i!==l?r=o=[o,i]:(Gt=r,r=l);r!==l&&(Vt=e,r=st());return e=r,e}(),n!==l?r=o=[o,i,n]:(Gt=r,r=l)}else Gt=r,r=l;return r!==l&&(Vt=e,r=nt(r)),e=r}function cr(){var e,r;return e=Gt,r=function(){var e,r,o,i;e=Gt,r=Gt,t.substr(Gt,4)===h?(o=h,Gt+=4):(o=l,0===Ut&&Yt(re));o!==l?((i=Br())===l&&(i=Ar()),i!==l?r=o=[o,i]:(Gt=r,r=l)):(Gt=r,r=l);r===l&&(r=Gt,t.substr(Gt,2)===T?(o=T,Gt+=2):(o=l,0===Ut&&Yt(ie)),o!==l?((i=Br())===l&&(i=Ar()),i!==l?r=o=[o,i]:(Gt=r,r=l)):(Gt=r,r=l),r===l&&(r=Gt,t.substr(Gt,2)===b?(o=b,Gt+=2):(o=l,0===Ut&&Yt(ne)),o!==l?((i=Br())===l&&(i=Ar()),i!==l?r=o=[o,i]:(Gt=r,r=l)):(Gt=r,r=l),r===l&&(r=function(){var e,r,o,i,n,a;e=Gt,r=Gt,Ut++,o=Gt,t.substr(Gt,4)===m?(i=m,Gt+=4):(i=l,0===Ut&&Yt(oe));i!==l&&(n=Ar())!==l?o=i=[i,n]:(Gt=o,o=l);Ut--,o===l?r=void 0:(Gt=r,r=l);if(r!==l){if(o=Gt,i=Gt,n=vr(),(a=kr())!==l?i=n=[n,a]:(Gt=i,i=l),i===l){if(i=Gt,n=[],(a=br())!==l)for(;a!==l;)n.push(a),a=br();else n=l;n!==l?(a=function(){var e,r;e=kr(),e===l&&(e=Gt,Ut++,t.length>Gt?(r=t.charAt(Gt),Gt++):(r=l,0===Ut&&Yt(te)),Ut--,r===l?e=void 0:(Gt=e,e=l));return e}(),a!==l?i=n=[n,a]:(Gt=i,i=l)):(Gt=i,i=l)}(o=i!==l?t.substring(o,Gt):i)!==l?(Vt=e,e=ct(o)):(Gt=e,e=l)}else Gt=e,e=l;return e}())));r!==l&&(Vt=e,r=ut(r));return e=r,e}(),r!==l&&(Vt=e,r=lt(r)),e=r}function pr(){var e,r,o,i,n;if(e=Gt,r=Gt,o=function(){var e,r,o,i,n,a;e=Gt,r=kr(),r!==l?(o=Gt,Ut++,i=Gt,t.substr(Gt,3)===v?(n=v,Gt+=3):(n=l,0===Ut&&Yt(ae)),n!==l&&(a=Br())!==l?i=n=[n,a]:(Gt=i,i=l),Ut--,i!==l?(Gt=o,o=void 0):o=l,o!==l?(Vt=e,e=gt()):(Gt=e,e=l)):(Gt=e,e=l);return e}(),o!==l){for(i=[],n=gr();n!==l;)i.push(n),n=gr();n=function(){var e,r,o,i,n;e=Gt,r=Gt,t.substr(Gt,3)===v?(o=v,Gt+=3):(o=l,0===Ut&&Yt(ae));o!==l?(i=Gt,Ut++,n=Ar(),Ut--,n!==l?(Gt=i,i=void 0):i=l,i!==l?r=o=[o,i]:(Gt=r,r=l)):(Gt=r,r=l);r!==l&&(Vt=e,r=dt());return e=r,e}(),n!==l?r=o=[o,i,n]:(Gt=r,r=l)}else Gt=r,r=l;return r!==l&&(Vt=e,r=pt(r)),e=r}function gr(){var e,r,o,i,n,a,s,u,c,p,g;if(e=Gt,r=Gt,Ut++,o=Gt,t.substr(Gt,3)===v?(i=v,Gt+=3):(i=l,0===Ut&&Yt(ae)),i!==l){for(n=[],a=xr();a!==l;)n.push(a),a=xr();for(a=[],s=Gt,u=Gt,Ut++,c=Gt,(p=kr())!==l?(t.substr(Gt,3)===v?(g=v,Gt+=3):(g=l,0===Ut&&Yt(ae)),g!==l?c=p=[p,g]:(Gt=c,c=l)):(Gt=c,c=l),Ut--,c===l?u=void 0:(Gt=u,u=l),u!==l?(t.length>Gt?(c=t.charAt(Gt),Gt++):(c=l,0===Ut&&Yt(te)),c!==l?s=u=[u,c]:(Gt=s,s=l)):(Gt=s,s=l);s!==l;)a.push(s),s=Gt,u=Gt,Ut++,c=Gt,(p=kr())!==l?(t.substr(Gt,3)===v?(g=v,Gt+=3):(g=l,0===Ut&&Yt(ae)),g!==l?c=p=[p,g]:(Gt=c,c=l)):(Gt=c,c=l),Ut--,c===l?u=void 0:(Gt=u,u=l),u!==l?(t.length>Gt?(c=t.charAt(Gt),Gt++):(c=l,0===Ut&&Yt(te)),c!==l?s=u=[u,c]:(Gt=s,s=l)):(Gt=s,s=l);(s=Pr())!==l?o=i=[i,n,a,s]:(Gt=o,o=l)}else Gt=o,o=l;return Ut--,o===l?r=void 0:(Gt=r,r=l),r!==l?(o=function(){var e,r,o,i;e=Gt,r=Gt,t.substr(Gt,3)===v?(o=v,Gt+=3):(o=l,0===Ut&&Yt(ae));o!==l&&(i=Br())!==l?r=o=[o,i]:(Gt=r,r=l);r===l&&(r=Gt,t.substr(Gt,2)===C?(o=C,Gt+=2):(o=l,0===Ut&&Yt(se)),o!==l&&(i=Br())!==l?r=o=[o,i]:(Gt=r,r=l),r===l&&(r=Gt,t.substr(Gt,2)===T?(o=T,Gt+=2):(o=l,0===Ut&&Yt(ie)),o!==l&&(i=Br())!==l?r=o=[o,i]:(Gt=r,r=l),r===l&&(r=function(){var e,r,o,i,n;e=Gt,r=Gt,o=Gt,i=vr(),n=kr(),n!==l?o=i=[i,n]:(Gt=o,o=l);r=o!==l?t.substring(r,Gt):o;r!==l&&(Vt=e,r=ht(r));return e=r,e}())));r!==l&&(Vt=e,r=ft(r));return e=r,e}(),o!==l?(Vt=e,e=yt(o)):(Gt=e,e=l)):(Gt=e,e=l),e}function dr(){var e,r;return e=Gt,t.length>Gt?(r=t.charAt(Gt),Gt++):(r=l,0===Ut&&Yt(te)),r!==l&&(Vt=e,r=Tt(r)),e=r}function yr(){var e,r,o,i;for(e=Gt,r=Gt,o=[],t.substr(Gt,2)===F?(i=F,Gt+=2):(i=l,0===Ut&&Yt(Be)),i===l&&($.test(t.charAt(Gt))?(i=t.charAt(Gt),Gt++):(i=l,0===Ut&&Yt(X)));i!==l;)o.push(i),t.substr(Gt,2)===F?(i=F,Gt+=2):(i=l,0===Ut&&Yt(Be)),i===l&&($.test(t.charAt(Gt))?(i=t.charAt(Gt),Gt++):(i=l,0===Ut&&Yt(X)));return r=t.substring(r,Gt),Vt=e,e=r=Et(r)}function fr(){var e,r,o,i,n;if(e=Gt,r=Gt,Ut++,t.substr(Gt,3)===G?(o=G,Gt+=3):(o=l,0===Ut&&Yt(xe)),Ut--,o===l?r=void 0:(Gt=r,r=l),r!==l){for(o=Gt,i=[],J.test(t.charAt(Gt))?(n=t.charAt(Gt),Gt++):(n=l,0===Ut&&Yt(Ae));n!==l;)i.push(n),J.test(t.charAt(Gt))?(n=t.charAt(Gt),Gt++):(n=l,0===Ut&&Yt(Ae));o=t.substring(o,Gt),Vt=e,e=Ot(o)}else Gt=e,e=l;return e}function hr(){var e,r,o;if(93===t.charCodeAt(Gt)?(e=d,Gt++):(e=l,0===Ut&&Yt(Z)),e===l){for(e=Gt,r=[],o=xr();o!==l;)r.push(o),o=xr();(o=Pr())!==l?e=r=[r,o]:(Gt=e,e=l)}return e}function mr(){var e,r,o,i;for(e=Gt,r=Gt,o=[],q.test(t.charAt(Gt))?(i=t.charAt(Gt),Gt++):(i=l,0===Ut&&Yt(Pe));i!==l;)o.push(i),q.test(t.charAt(Gt))?(i=t.charAt(Gt),Gt++):(i=l,0===Ut&&Yt(Pe));return r=t.substring(r,Gt),Vt=e,e=r=Lt(r)}function Tr(){var e,r,o;return e=Gt,58===t.charCodeAt(Gt)?(r=y,Gt++):(r=l,0===Ut&&Yt(Q)),r!==l?(o=yr(),Vt=e,e=jt(o)):(Gt=e,e=l),e===l&&(r="",Vt=e=Gt,e=r=Ft()),e}function br(){var e;return Ut++,H.test(t.charAt(Gt))?(e=t.charAt(Gt),Gt++):(e=l,0===Ut&&Yt(_e)),Ut--,e===l&&(l,0===Ut&&Yt(Ke)),e}function vr(){var e,t;for(Ut++,e=[],t=br();t!==l;)e.push(t),t=br();return Ut--,t=l,0===Ut&&Yt(Re),e}function Cr(){var e,r,o;for(Ut++,e=Gt,r=[],z.test(t.charAt(Gt))?(o=t.charAt(Gt),Gt++):(o=l,0===Ut&&Yt(we));o!==l;)r.push(o),z.test(t.charAt(Gt))?(o=t.charAt(Gt),Gt++):(o=l,0===Ut&&Yt(we));return(o=kr())!==l?e=r=[r,o]:(Gt=e,e=l),Ut--,e===l&&(r=l,0===Ut&&Yt(Ie)),e}function kr(){var e;return Ut++,10===t.charCodeAt(Gt)?(e=V,Gt++):(e=l,0===Ut&&Yt(Oe)),e===l&&(t.substr(Gt,2)===N?(e=N,Gt+=2):(e=l,0===Ut&&Yt(Le)),e===l&&(13===t.charCodeAt(Gt)?(e=D,Gt++):(e=l,0===Ut&&Yt(je)),e===l&&(8232===t.charCodeAt(Gt)?(e=M,Gt++):(e=l,0===Ut&&Yt(Fe)),e===l&&(8233===t.charCodeAt(Gt)?(e=U,Gt++):(e=l,0===Ut&&Yt(Ge)))))),Ut--,e===l&&(l,0===Ut&&Yt(Ee)),e}function Br(){var e,r,o;for(Ut++,e=Gt,r=[],z.test(t.charAt(Gt))?(o=t.charAt(Gt),Gt++):(o=l,0===Ut&&Yt(we));o!==l;)r.push(o),z.test(t.charAt(Gt))?(o=t.charAt(Gt),Gt++):(o=l,0===Ut&&Yt(we));return(o=kr())!==l?e=r=[r,o]:(Gt=e,e=l),Ut--,e===l&&(r=l,0===Ut&&Yt(Ve)),e}function xr(){var e;return Ut++,W.test(t.charAt(Gt))?(e=t.charAt(Gt),Gt++):(e=l,0===Ut&&Yt(De)),Ut--,e===l&&(l,0===Ut&&Yt(Ne)),e}function Ar(){var e,r;return(e=Br())===l&&(e=Gt,Ut++,t.length>Gt?(r=t.charAt(Gt),Gt++):(r=l,0===Ut&&Yt(te)),Ut--,r===l?e=void 0:(Gt=e,e=l)),e}function Pr(){var e,r;return e=Gt,Ut++,t.length>Gt?(r=t.charAt(Gt),Gt++):(r=l,0===Ut&&Yt(te)),Ut--,r===l?e=void 0:(Gt=e,e=l),e}const wr=new i.BitmarkPegParserHelper({parse:e,parserText:$t,parserLocation:Kr}),Sr=new n.BitmarkPegParserProcessor({parse:e,parserText:$t,parserLocation:Kr});function Kr(){const e=Wt(Vt,Gt);return e?(delete e.source,e):e}function Wt(e,t,r){var o=Ht(e),i=Ht(t),n={source:u,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:i.line,column:i.column}};return u&&"function"==typeof u.offset&&(n.start=u.offset(n.start),n.end=u.offset(n.end)),n}if((s=p())!==l&&Gt===t.length)return s;throw s!==l&&Gt<t.length&&Yt({type:"end"}),Xt(Mt,Dt<t.length?t.charAt(Dt):null,Dt<t.length?Wt(Dt,Dt+1):Wt(Dt,Dt))}},4764:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=void 0;const o=r(8159);function i(e){let t=e||"";return t=o.Breakscape.unbreakscape(t),t}function n(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkPlusString"}):u(e,{startRule:"bitmarkPlusString"})}function a(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkMinusMinusString"}):u(e,{startRule:"bitmarkMinusMinusString"})}function s(e,t,r,o){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,s.prototype),i.expected=t,i.found=r,i.location=o,i.name="SyntaxError",i}function l(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}function u(e,t){var r,o={},l=(t=void 0!==t?t:{}).grammarSource,u={bitmarkPlusPlus:Fo,bitmarkPlus:function(){var e,t;Ko++,e=Ao,t=ni(),e,t=Yr(t),e=t,Ko--,t=o,0===Ko&&Lo(je);return e},bitmarkMinusMinus:function(){var e,t;Ko++,e=Ao,t=di(),e,t=ho(t),e=t,Ko--,t=o,0===Ko&&Lo($t);return e},bitmarkPlusString:function(){var e;Ko++,e=ni(),Ko--,o,0===Ko&&Lo(at);return e},bitmarkMinusMinusString:di},c=Fo,p="|",g=":",d="### ",y="## ",f="# ",h="code",m="bitmark++",T="bitmark--",b="JavaScript",v="• ",C="•1 ",k="•+ ",B="•- ",x="\t",A="image",P=" ",w="#",S="@",K="width",_="height",R="=",I="𝑓",E="link:",O="var:",L="code:",j="color:",F="bold",G="italic",V="light",N="highlight",D="strike",M="sub",U="super",$="ins",J="del",q="aqua",z="black",H="blue",W="pink",Y="fuchsia",X="lightgrey",Z="gray",Q="darkgray",ee="green",te="lime",re="magenta",oe="maroon",ie="navy",ne="olive",ae="orange",se="purple",le="red",ue="silver",ce="teal",pe="violet",ge="white",de="yellow",ye="*",fe="_",he="`",me="!",Te="[!",be="]",ve="\n",Ce="\r\n",ke="\r",Be="\u2028",xe="\u2029",Ae="http",Pe="s",we="://",Se="mailto:",Ke="~",_e="^",Re="'",Ie=/^[ \t]/,Ee=/^[0-9]/,Oe=/^[^\n\r\u2028\u2029]/,Le=/^[a-zA-Z0-9!*'()=+-\/._?#@[\]$&(),;%:{}]/,je=Io("StyledText"),Fe=_o("|",!1),Ge=_o(":",!1),Ve=_o("### ",!1),Ne=_o("## ",!1),De=_o("# ",!1),Me=_o("code",!1),Ue=Ro([" ","\t"],!1,!1),$e=_o("bitmark++",!1),Je=_o("bitmark--",!1),qe=_o("JavaScript",!1),ze=_o("• ",!1),He=_o("•1 ",!1),We=_o("•+ ",!1),Ye=_o("•- ",!1),Xe={type:"any"},Ze=_o("\t",!1),Qe=_o("image",!1),et=_o(" ",!1),tt=_o("#",!1),rt=_o("@",!1),ot=Ro([["0","9"]],!1,!1),it=_o("width",!1),nt=_o("height",!1),at=Io("StyledString"),st=_o("=",!1),lt=_o("𝑓",!1),ut=_o("link:",!1),ct=_o("var:",!1),pt=_o("code:",!1),gt=_o("color:",!1),dt=_o("bold",!1),yt=_o("italic",!1),ft=_o("light",!1),ht=_o("highlight",!1),mt=_o("strike",!1),Tt=_o("sub",!1),bt=_o("super",!1),vt=_o("ins",!1),Ct=_o("del",!1),kt=_o("aqua",!1),Bt=_o("black",!1),xt=_o("blue",!1),At=_o("pink",!1),Pt=_o("fuchsia",!1),wt=_o("lightgrey",!1),St=_o("gray",!1),Kt=_o("darkgray",!1),_t=_o("green",!1),Rt=_o("lime",!1),It=_o("magenta",!1),Et=_o("maroon",!1),Ot=_o("navy",!1),Lt=_o("olive",!1),jt=_o("orange",!1),Ft=_o("purple",!1),Gt=_o("red",!1),Vt=_o("silver",!1),Nt=_o("teal",!1),Dt=_o("violet",!1),Mt=_o("white",!1),Ut=_o("yellow",!1),$t=Io("MinimalStyledText"),Jt=Io("MinimalStyledString"),qt=_o("*",!1),zt=_o("_",!1),Ht=_o("`",!1),Wt=_o("!",!1),Yt=_o("[!",!1),Xt=_o("]",!1),Zt=Io("Line Terminator"),Qt=_o("\n",!1),er=_o("\r\n",!1),tr=_o("\r",!1),rr=_o("\u2028",!1),or=_o("\u2029",!1),ir=(Io("whitespace in line"),Io("space"),Io("language tag separator"),Io("white space, separator"),Ro(["\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!1,!1),Ro(["\n","\r","\u2028","\u2029"],!1,!1),Ro(["\n","\r","\u2028","\u2029"],!0,!1)),nr=(Ro(["\n","\r","\u2028","\u2029","\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!0,!1),_o("http",!1)),ar=_o("s",!1),sr=_o("://",!1),lr=_o("mailto:",!1),ur=Ro([["a","z"],["A","Z"],["0","9"],"!","*","'","(",")","=",["+","/"],".","_","?","#","@","[","]","$","&","(",")",",",";","%",":","{","}"],!1,!1),cr=_o("~",!1),pr=_o("^",!1),gr=_o("'",!1),dr=function(e){return Object.assign({},e)},yr=function(e){return Object.assign({},e)},fr=function(e){return Object.assign({},e)},hr=function(e){return Object.assign({},e)},mr=function(e){return Object.assign({},e)},Tr=function(){return[]},br=function(e,t){return{type:"heading",content:a(t),attrs:{level:e.length-1}}},vr=function(e){return e},Cr=function(e,t){return Object.assign(Object.assign({},e),{content:t})},kr=function(){return{type:"codeBlock",language:""}},Br=function(e){return{type:"codeBlock",attrs:{language:e.trim().toLowerCase()}}},xr=function(e){return[{type:"text",text:i(e.trim())}]},Ar=function(e){return e},Pr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},wr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Sr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Kr=function(){return{type:"bulletList"}},_r=function(){return{type:"orderedList"}},Rr=function(){return{type:"taskList"}},Ir=function(e,t,r,o){return o},Er=function(e,t,r,o){let i="bulletList";"•1 "==e&&(i="orderedList"),"•+ "!=e&&"•- "!=e||(i="taskList");let a=[{type:"paragraph",attrs:{},content:n((t+r.join("")).trim())}];if(o&&o[0]&&o[0].parent){let e={type:o[0].parent,attrs:{start:1},content:o,parent:""};"orderedList"==e.parent&&(e.attrs.start=1),a.push(e)}let s="listItem",l={};if("taskList"==i){s="taskItem";let t=!1;"•+ "==e&&(t=!0),l={checked:t}}return{type:s,content:a,parent:i,attrs:l}},Or=function(e){return e},Lr=function(e){return e.join("")===Ii},jr=function(e){return e.length>Ii.length},Fr=function(e){Ri.push(Ii),Ii=e.join("")},Gr=function(){return Ii=Ri.pop(),!0},Vr=function(e){return{type:"paragraph",content:n(e.trim()),attrs:{}}},Nr=function(e){return{type:"paragraph",content:n(e.trim()),attrs:{}}},Dr=function(e){return{type:"paragraph",content:n(e.trim()),attrs:{}}},Mr=function(e){return e},Ur=function(e,t,r){const o=Object.assign({},...r);let i=o.captionAlign||"left";delete o.captionAlign;let n=o.alt||null;delete o.alt;let a=o.caption||null;delete o.caption;let s=o.align||"center";return delete o.align,{type:e,attrs:Object.assign({textAlign:i,src:t,alt:n,title:a,class:s},o)}},$r=function(e){return e},Jr=function(e){return{comment:e}},qr=function(e,t){return{[e]:parseInt(t)}},zr=function(e,t){return{type:"error",msg:e+" must be an positive integer.",found:t}},Hr=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()},Zr=function(){return{type:"hardBreak"}},Qr=function(e){return{text:i(e),type:"text"}},eo=function(e){return{index:+e,type:"bit"}},to=function(e,t){return t||(t=[]),{marks:t,text:i(e),type:"text"}},ro=function(e){return{marks:[{type:"bold"}],text:i(e),type:"text"}},oo=function(e){return{marks:[{type:"italic"}],text:i(e),type:"text"}},io=function(e){return{marks:[{type:"light"}],text:i(e),type:"text"}},no=function(e){return{marks:[{type:"highlight"}],text:i(e),type:"text"}},ao=function(e){return{marks:[{type:"link",attrs:{href:(e.pr+e.t).trim(),target:"_blank"}}],text:e.t,type:"text"}},so=function(e){return e},lo=function(e){return{type:"link",attrs:{href:e.trim(),target:"_blank"}}},uo=function(e){return{type:"var",attrs:{name:e.trim()}}},co=function(){return{type:"code",attrs:{language:"plain text"}}},po=function(e){return{type:"code",attrs:{language:e.trim().toLowerCase()}}},go=function(e){return{type:"color",attrs:{color:e}}},yo=function(e){return{type:e}},fo=function(e){return{type:"comment",comment:e}},ho=function(e){return[{type:"paragraph",content:e,attrs:{}}]},mo=function(e,t){return e?[e,...t.flat()]:t.flat()},To=function(e){return{text:i(e),type:"text"}},bo=function(e){return{index:+e,type:"bit"}},vo=function(e){return{marks:[{type:"bold"}],text:i(e),type:"text"}},Co=function(e){return{marks:[{type:"italic"}],text:i(e),type:"text"}},ko=function(e){return{marks:[{type:"light"}],text:i(e),type:"text"}},Bo=function(e){return{marks:[{type:"highlight"}],text:i(e),type:"text"}},xo=function(e,t){return{pr:e,t}},Ao=0,Po=[{line:1,column:1}],wo=0,So=[],Ko=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 _o(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ro(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Io(e){return{type:"other",description:e}}function Eo(t){var r,o=Po[t];if(o)return o;for(r=t-1;!Po[r];)r--;for(o={line:(o=Po[r]).line,column:o.column};r<t;)10===e.charCodeAt(r)?(o.line++,o.column=1):o.column++,r++;return Po[t]=o,o}function Oo(e,t,r){var o=Eo(e),i=Eo(t),n={source:l,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:i.line,column:i.column}};return r&&l&&"function"==typeof l.offset&&(n.start=l.offset(n.start),n.end=l.offset(n.end)),n}function Lo(e){Ao<wo||(Ao>wo&&(wo=Ao,So=[]),So.push(e))}function jo(e,t,r){return new s(s.buildMessage(e,t),e,t,r)}function Fo(){var e,t;if(Ko++,e=[],(t=Go())!==o)for(;t!==o;)e.push(t),t=Go();else e=o;return e===o&&(e=function(){var e,t;return e=Ao,t="",e,t=Tr(),e=t,e}()),Ko--,e===o&&(t=o,0===Ko&&Lo(je)),e}function Go(){var t,r;return t=Ao,r=function(){var t,r,i,n,a;if(t=Ao,r=Do(),r!==o){for(i=Ao,n=[],a=Si();a!==o;)n.push(a),a=Si();i=e.substring(i,Ao),(n=Ki())!==o?((a=wi())===o&&(a=null),t,t=br(r,i)):(Ao=t,t=o)}else Ao=t,t=o;return t}(),r!==o&&(t,r=dr(r)),(t=r)===o&&(t=Ao,r=function(){var e,t,r,i;if(e=Ao,t=function(){var e,t,r;e=Ao,t=Ao,Ko++,r=Jo(),Ko--,r!==o?(Ao=t,t=void 0):t=o;t!==o&&(e,t=Kr());return e=t,e}(),t!==o){if(r=[],(i=Wo())!==o)for(;i!==o;)r.push(i),i=Wo();else r=o;r!==o?((i=wi())===o&&(i=null),e,e=Pr(t,r)):(Ao=e,e=o)}else Ao=e,e=o;if(e===o){if(e=Ao,t=function(){var e,t,r;e=Ao,t=Ao,Ko++,r=qo(),Ko--,r!==o?(Ao=t,t=void 0):t=o;t!==o&&(e,t=_r());return e=t,e}(),t!==o){if(r=[],(i=Wo())!==o)for(;i!==o;)r.push(i),i=Wo();else r=o;r!==o?((i=wi())===o&&(i=null),e,e=wr(t,r)):(Ao=e,e=o)}else Ao=e,e=o;if(e===o)if(e=Ao,t=function(){var e,t,r;e=Ao,t=Ao,Ko++,r=zo(),Ko--,r!==o?(Ao=t,t=void 0):t=o;t!==o&&(e,t=Rr());return e=t,e}(),t!==o){if(r=[],(i=Wo())!==o)for(;i!==o;)r.push(i),i=Wo();else r=o;r!==o?((i=wi())===o&&(i=null),e,e=Sr(t,r)):(Ao=e,e=o)}else Ao=e,e=o}return e}(),r!==o&&(t,r=yr(r)),(t=r)===o&&(t=Ao,(r=ri())!==o&&(t,r=fr(r)),(t=r)===o&&(t=Ao,r=function(){var t,r,i;t=Ao,r=Uo(),r!==o?(i=function(){var t,r,i,n;t=Ao,r=Ao,i=[],n=$o();for(;n!==o;)i.push(n),n=$o();return r=e.substring(r,Ao),t,r=xr(r),t=r,t}(),t,t=Cr(r,i)):(Ao=t,t=o);return t}(),r!==o&&(t,r=hr(r)),(t=r)===o&&(t=Ao,r=function(){var e,t,r;e=Ao,t=Ao,Ko++,r=Vo(),Ko--,r===o?t=void 0:(Ao=t,t=o);t!==o&&(r=Zo())!==o?(e,e=Vr(r)):(Ao=e,e=o);e===o&&(e=Ao,(t=ei())!==o&&(r=Zo())!==o?(e,e=Nr(r)):(Ao=e,e=o),e===o&&(e=Ao,(t=ei())!==o?(e,e=Dr(r="")):(Ao=e,e=o)));return e}(),r!==o&&(t,r=mr(r)),t=r)))),t}function Vo(){var e;return(e=Do())===o&&(e=Ho())===o&&(e=ri())===o&&(e=Uo())===o&&(e=ei()),e}function No(){var t;return 124===e.charCodeAt(Ao)?(t=p,Ao++):(t=o,0===Ko&&Lo(Fe)),t}function Do(){var t;return e.substr(Ao,4)===d?(t=d,Ao+=4):(t=o,0===Ko&&Lo(Ve)),t===o&&(e.substr(Ao,3)===y?(t=y,Ao+=3):(t=o,0===Ko&&Lo(Ne)),t===o&&(e.substr(Ao,2)===f?(t=f,Ao+=2):(t=o,0===Ko&&Lo(De)))),t}function Mo(){var t,r;return t=Ao,No()!==o?(r=function(){var t;return e.substr(Ao,4)===h?(t=h,Ao+=4):(t=o,0===Ko&&Lo(Me)),t}(),r!==o?(t,t=vr(r)):(Ao=t,t=o)):(Ao=t,t=o),t}function Uo(){var t,r,i,n,a,s,l;if(t=Ao,Mo()!==o){for(r=Ao,i=Ao,n=[],Ie.test(e.charAt(Ao))?(a=e.charAt(Ao),Ao++):(a=o,0===Ko&&Lo(Ue));a!==o;)n.push(a),Ie.test(e.charAt(Ao))?(a=e.charAt(Ao),Ao++):(a=o,0===Ko&&Lo(Ue));(a=Ki())!==o?i=n=[n,a]:(Ao=i,i=o),(r=i!==o?e.substring(r,Ao):i)!==o?(t,t=kr()):(Ao=t,t=o)}else Ao=t,t=o;if(t===o)if(t=Ao,Mo()!==o)if(58===e.charCodeAt(Ao)?(r=g,Ao++):(r=o,0===Ko&&Lo(Ge)),r!==o)if(i=function(){var t,r,i;e.substr(Ao,9)===m?(t=m,Ao+=9):(t=o,0===Ko&&Lo($e));if(t===o&&(e.substr(Ao,9)===T?(t=T,Ao+=9):(t=o,0===Ko&&Lo(Je)),t===o&&(e.substr(Ao,10)===b?(t=b,Ao+=10):(t=o,0===Ko&&Lo(qe)),t===o))){if(t=Ao,r=[],(i=Si())!==o)for(;i!==o;)r.push(i),i=Si();else r=o;(t=r!==o?e.substring(t,Ao):r)===o&&(t="")}return t}(),i!==o){for(n=Ao,a=Ao,s=[],Ie.test(e.charAt(Ao))?(l=e.charAt(Ao),Ao++):(l=o,0===Ko&&Lo(Ue));l!==o;)s.push(l),Ie.test(e.charAt(Ao))?(l=e.charAt(Ao),Ao++):(l=o,0===Ko&&Lo(Ue));(l=Ki())!==o?a=s=[s,l]:(Ao=a,a=o),(n=a!==o?e.substring(n,Ao):a)!==o?(t,t=Br(i)):(Ao=t,t=o)}else Ao=t,t=o;else Ao=t,t=o;else Ao=t,t=o;return t}function $o(){var t,r,i,n,a,s;if(t=Ao,r=Ao,Ko++,i=Vo(),Ko--,i===o?r=void 0:(Ao=r,r=o),r!==o){if(i=Ao,n=Ao,a=[],(s=Si())!==o)for(;s!==o;)a.push(s),s=Si();else a=o;a!==o&&(s=Ki())!==o?n=a=[a,s]:(Ao=n,n=o),(i=n!==o?e.substring(i,Ao):n)!==o?(t,t=Ar(i)):(Ao=t,t=o)}else Ao=t,t=o;return t===o&&(t=wi()),t}function Jo(){var t;return e.substr(Ao,2)===v?(t=v,Ao+=2):(t=o,0===Ko&&Lo(ze)),t}function qo(){var t;return e.substr(Ao,3)===C?(t=C,Ao+=3):(t=o,0===Ko&&Lo(He)),t}function zo(){var t;return e.substr(Ao,3)===k?(t=k,Ao+=3):(t=o,0===Ko&&Lo(We)),t===o&&(e.substr(Ao,3)===B?(t=B,Ao+=3):(t=o,0===Ko&&Lo(Ye))),t}function Ho(){var e;return(e=Jo())===o&&(e=qo())===o&&(e=zo()),e}function Wo(){var t,r,i,n,a,s,l,u;if(t=Ao,Xo()!==o)if((r=Ho())!==o){for(i=Ao,n=Ao,a=[],s=Ao,l=Ao,Ko++,u=wi(),Ko--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===Ko&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,Ko++,u=wi(),Ko--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===Ko&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);for((s=wi())===o&&(s=null),n=a=[a,s],i=e.substring(i,Ao),n=[],a=Yo();a!==o;)n.push(a),a=Yo();if(a=Ao,s=function(){var t,r,i,n;t=Ao,Ko++,r=Ao,i=[],9===e.charCodeAt(Ao)?(n=x,Ao++):(n=o,0===Ko&&Lo(Ze));if(n!==o)for(;n!==o;)i.push(n),9===e.charCodeAt(Ao)?(n=x,Ao++):(n=o,0===Ko&&Lo(Ze));else i=o;i!==o?(Ao,(n=(n=jr(i))?void 0:o)!==o?(r,r=Fr(i)):(Ao=r,r=o)):(Ao=r,r=o);Ko--,r!==o?(Ao=t,t=void 0):t=o;return t}(),s!==o){for(l=[],u=Wo();u!==o;)l.push(u),u=Wo();u=function(){var e;Ao,e=Gr(),e=e?void 0:o;return e}(),u!==o?(a,a=Ir(r,i,n,l)):(Ao=a,a=o)}else Ao=a,a=o;a===o&&(a=null),t,t=Er(r,i,n,a)}else Ao=t,t=o;else Ao=t,t=o;return t}function Yo(){var t,r,i,n,a,s,l,u,c,p;if(t=Ao,r=Ao,Ko++,i=function(){var t,r,i;t=Ao,r=[],Ie.test(e.charAt(Ao))?(i=e.charAt(Ao),Ao++):(i=o,0===Ko&&Lo(Ue));for(;i!==o;)r.push(i),Ie.test(e.charAt(Ao))?(i=e.charAt(Ao),Ao++):(i=o,0===Ko&&Lo(Ue));i=wi(),i!==o?t=r=[r,i]:(Ao=t,t=o);return t}(),Ko--,i===o?r=void 0:(Ao=r,r=o),r!==o)if((i=Xo())!==o)if(n=Ao,Ko++,a=Ho(),Ko--,a===o?n=void 0:(Ao=n,n=o),n!==o){if(a=Ao,s=Ao,l=[],u=Ao,c=Ao,Ko++,p=wi(),Ko--,p===o?c=void 0:(Ao=c,c=o),c!==o?(e.length>Ao?(p=e.charAt(Ao),Ao++):(p=o,0===Ko&&Lo(Xe)),p!==o?u=c=[c,p]:(Ao=u,u=o)):(Ao=u,u=o),u!==o)for(;u!==o;)l.push(u),u=Ao,c=Ao,Ko++,p=wi(),Ko--,p===o?c=void 0:(Ao=c,c=o),c!==o?(e.length>Ao?(p=e.charAt(Ao),Ao++):(p=o,0===Ko&&Lo(Xe)),p!==o?u=c=[c,p]:(Ao=u,u=o)):(Ao=u,u=o);else l=o;l!==o&&(u=Ki())!==o?s=l=[l,u]:(Ao=s,s=o),(a=s!==o?e.substring(a,Ao):s)!==o?(t,t=Or(a)):(Ao=t,t=o)}else Ao=t,t=o;else Ao=t,t=o;else Ao=t,t=o;return t}function Xo(){var t,r,i;for(t=Ao,r=[],9===e.charCodeAt(Ao)?(i=x,Ao++):(i=o,0===Ko&&Lo(Ze));i!==o;)r.push(i),9===e.charCodeAt(Ao)?(i=x,Ao++):(i=o,0===Ko&&Lo(Ze));return Ao,(i=(i=Lr(r))?void 0:o)!==o?t=r=[r,i]:(Ao=t,t=o),t}function Zo(){var t,r,i;if(t=Ao,r=[],(i=Qo())!==o)for(;i!==o;)r.push(i),i=Qo();else r=o;return t=r!==o?e.substring(t,Ao):r}function Qo(){var t,r,i,n,a,s;if(t=Ao,r=Ao,Ko++,i=Vo(),Ko--,i===o?r=void 0:(Ao=r,r=o),r!==o){if(i=Ao,n=Ao,a=[],(s=Si())!==o)for(;s!==o;)a.push(s),s=Si();else a=o;a!==o&&(s=Ki())!==o?n=a=[a,s]:(Ao=n,n=o),(i=n!==o?e.substring(i,Ao):n)!==o?t=r=[r,i]:(Ao=t,t=o)}else Ao=t,t=o;return t===o&&(t=wi()),t}function ei(){var t,r,i,n,a,s;if(t=Ao,(r=No())!==o){for(i=Ao,n=Ao,a=[],Ie.test(e.charAt(Ao))?(s=e.charAt(Ao),Ao++):(s=o,0===Ko&&Lo(Ue));s!==o;)a.push(s),Ie.test(e.charAt(Ao))?(s=e.charAt(Ao),Ao++):(s=o,0===Ko&&Lo(Ue));(s=Ki())!==o?n=a=[a,s]:(Ao=n,n=o),(i=n!==o?e.substring(i,Ao):n)!==o?((n=wi())===o&&(n=null),t=r=[r,i,n]):(Ao=t,t=o)}else Ao=t,t=o;return t}function ti(){var t,r;return t=Ao,No()!==o?(r=function(){var t;return e.substr(Ao,5)===A?(t=A,Ao+=5):(t=o,0===Ko&&Lo(Qe)),t}(),r!==o?(t,t=Mr(r)):(Ao=t,t=o)):(Ao=t,t=o),t}function ri(){var t,r,i,n,a,s,l,u,c,p;if(t=Ao,(r=ti())!==o)if(58===e.charCodeAt(Ao)?(i=g,Ao++):(i=o,0===Ko&&Lo(Ge)),i!==o)if(32===e.charCodeAt(Ao)?(n=P,Ao++):(n=o,0===Ko&&Lo(et)),n===o&&(n=null),a=function(){var t,r,i,n,a,s,l,u,c;t=Ao,r=Ao,e.substr(Ao,4)===Ae?(i=Ae,Ao+=4):(i=o,0===Ko&&Lo(nr));if(i!==o)if(115===e.charCodeAt(Ao)?(n=Pe,Ao++):(n=o,0===Ko&&Lo(ar)),n===o&&(n=null),e.substr(Ao,3)===we?(a=we,Ao+=3):(a=o,0===Ko&&Lo(sr)),a!==o){for(s=[],l=Ao,u=Ao,Ko++,c=No(),Ko--,c===o?u=void 0:(Ao=u,u=o),u!==o&&(c=_i())!==o?l=u=[u,c]:(Ao=l,l=o);l!==o;)s.push(l),l=Ao,u=Ao,Ko++,c=No(),Ko--,c===o?u=void 0:(Ao=u,u=o),u!==o&&(c=_i())!==o?l=u=[u,c]:(Ao=l,l=o);r=i=[i,n,a,s]}else Ao=r,r=o;else Ao=r,r=o;t=r!==o?e.substring(t,Ao):r;return t}(),a!==o)if(No()!==o){for(s=function(){var e,t,r;e=Ao,t=[],r=oi();for(;r!==o;)t.push(r),r=oi();return e,t=$r(t),e=t,e}(),l=Ao,u=Ao,c=[],Ie.test(e.charAt(Ao))?(p=e.charAt(Ao),Ao++):(p=o,0===Ko&&Lo(Ue));p!==o;)c.push(p),Ie.test(e.charAt(Ao))?(p=e.charAt(Ao),Ao++):(p=o,0===Ko&&Lo(Ue));(p=Ki())!==o?u=c=[c,p]:(Ao=u,u=o),(l=u!==o?e.substring(l,Ao):u)!==o?((u=wi())===o&&(u=null),t,t=Ur(r,a,s)):(Ao=t,t=o)}else Ao=t,t=o;else Ao=t,t=o;else Ao=t,t=o;else Ao=t,t=o;return t}function oi(){var t,r,i,n,a,s,l,u,c,p;if(t=Ao,35===e.charCodeAt(Ao)?(r=w,Ao++):(r=o,0===Ko&&Lo(tt)),r!==o){for(i=Ao,n=[],a=Ao,s=Ao,Ko++,l=No(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,Ko++,l=No(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=Jr(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,64===e.charCodeAt(Ao)?(r=S,Ao++):(r=o,0===Ko&&Lo(rt)),r===o&&(r=null),(i=ii())!==o)if(58===e.charCodeAt(Ao)?(n=g,Ao++):(n=o,0===Ko&&Lo(Ge)),n!==o){for(a=[],32===e.charCodeAt(Ao)?(s=P,Ao++):(s=o,0===Ko&&Lo(et));s!==o;)a.push(s),32===e.charCodeAt(Ao)?(s=P,Ao++):(s=o,0===Ko&&Lo(et));if(s=Ao,l=[],u=Ao,c=Ao,Ko++,p=No(),Ko--,p===o?c=void 0:(Ao=c,c=o),c!==o?(Ee.test(e.charAt(Ao))?(p=e.charAt(Ao),Ao++):(p=o,0===Ko&&Lo(ot)),p!==o?u=c=[c,p]:(Ao=u,u=o)):(Ao=u,u=o),u!==o)for(;u!==o;)l.push(u),u=Ao,c=Ao,Ko++,p=No(),Ko--,p===o?c=void 0:(Ao=c,c=o),c!==o?(Ee.test(e.charAt(Ao))?(p=e.charAt(Ao),Ao++):(p=o,0===Ko&&Lo(ot)),p!==o?u=c=[c,p]:(Ao=u,u=o)):(Ao=u,u=o);else l=o;(s=l!==o?e.substring(s,Ao):l)!==o&&(l=No())!==o?(t,t=qr(i,s)):(Ao=t,t=o)}else Ao=t,t=o;else Ao=t,t=o;if(t===o){if(t=Ao,64===e.charCodeAt(Ao)?(r=S,Ao++):(r=o,0===Ko&&Lo(rt)),r===o&&(r=null),(i=ii())!==o)if(58===e.charCodeAt(Ao)?(n=g,Ao++):(n=o,0===Ko&&Lo(Ge)),n!==o){for(a=[],32===e.charCodeAt(Ao)?(s=P,Ao++):(s=o,0===Ko&&Lo(et));s!==o;)a.push(s),32===e.charCodeAt(Ao)?(s=P,Ao++):(s=o,0===Ko&&Lo(et));for(s=Ao,l=[],u=Ao,c=Ao,Ko++,p=No(),Ko--,p===o?c=void 0:(Ao=c,c=o),c!==o&&(p=Si())!==o?u=c=[c,p]:(Ao=u,u=o);u!==o;)l.push(u),u=Ao,c=Ao,Ko++,p=No(),Ko--,p===o?c=void 0:(Ao=c,c=o),c!==o&&(p=Si())!==o?u=c=[c,p]:(Ao=u,u=o);s=e.substring(s,Ao),(l=No())!==o?(t,t=zr(i,s)):(Ao=t,t=o)}else Ao=t,t=o;else Ao=t,t=o;if(t===o){for(t=Ao,64===e.charCodeAt(Ao)?(r=S,Ao++):(r=o,0===Ko&&Lo(rt)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,Ko++,(l=No())===o&&(58===e.charCodeAt(Ao)?(l=g,Ao++):(l=o,0===Ko&&Lo(Ge))),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,Ko++,(l=No())===o&&(58===e.charCodeAt(Ao)?(l=g,Ao++):(l=o,0===Ko&&Lo(Ge))),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);if(i=e.substring(i,Ao),58===e.charCodeAt(Ao)?(n=g,Ao++):(n=o,0===Ko&&Lo(Ge)),n!==o){for(32===e.charCodeAt(Ao)?(a=P,Ao++):(a=o,0===Ko&&Lo(et)),a===o&&(a=null),s=Ao,l=[],u=Ao,c=Ao,Ko++,p=No(),Ko--,p===o?c=void 0:(Ao=c,c=o),c!==o&&(p=Si())!==o?u=c=[c,p]:(Ao=u,u=o);u!==o;)l.push(u),u=Ao,c=Ao,Ko++,p=No(),Ko--,p===o?c=void 0:(Ao=c,c=o),c!==o&&(p=Si())!==o?u=c=[c,p]:(Ao=u,u=o);s=e.substring(s,Ao),(l=No())!==o?(t,t=Hr(i,s)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){for(t=Ao,64===e.charCodeAt(Ao)?(r=S,Ao++):(r=o,0===Ko&&Lo(rt)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,Ko++,l=No(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,Ko++,l=No(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=Wr(i)):(Ao=t,t=o)}}}}return t}function ii(){var t;return e.substr(Ao,5)===K?(t=K,Ao+=5):(t=o,0===Ko&&Lo(it)),t===o&&(e.substr(Ao,6)===_?(t=_,Ao+=6):(t=o,0===Ko&&Lo(nt))),t}function ni(){var e,t,r,i;for(e=Ao,(t=ai())===o&&(t=null),r=[],(i=ci())===o&&(i=ai());i!==o;)r.push(i),(i=ci())===o&&(i=ai());return e,e=Xr(t,r)}function ai(){var t,r,i,n,a,s,l;if(t=Ao,(r=wi())!==o&&(t,r=Zr()),(t=r)===o){if(t=Ao,r=Ao,i=[],n=Ao,(a=pi())===o&&(a=null),s=Ao,Ko++,l=ci(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?n=a=[a,s,l]:(Ao=n,n=o),n===o&&(n=Ao,(a=pi())!==o?(s=Ao,Ko++,l=ci(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o?n=a=[a,s]:(Ao=n,n=o)):(Ao=n,n=o)),n!==o)for(;n!==o;)i.push(n),n=Ao,(a=pi())===o&&(a=null),s=Ao,Ko++,l=ci(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?n=a=[a,s,l]:(Ao=n,n=o),n===o&&(n=Ao,(a=pi())!==o?(s=Ao,Ko++,l=ci(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o?n=a=[a,s]:(Ao=n,n=o)):(Ao=n,n=o));else i=o;(r=i!==o?e.substring(r,Ao):i)!==o&&(t,r=Qr(r)),t=r}return t}function si(){var t;return 61===e.charCodeAt(Ao)?(t=R,Ao++):(t=o,0===Ko&&Lo(st)),t}function li(){var t;return e.substr(Ao,2)===I?(t=I,Ao+=2):(t=o,0===Ko&&Lo(lt)),t}function ui(){var e,t,r;return e=Ao,(t=si())!==o&&(r=si())!==o?e=t=[t,r]:(Ao=e,e=o),e}function ci(){var t,r,i,n,a,s,l,u,c,g;if(t=Ao,(r=Bi())!==o){if(i=Ao,n=[],Ee.test(e.charAt(Ao))?(a=e.charAt(Ao),Ao++):(a=o,0===Ko&&Lo(ot)),a!==o)for(;a!==o;)n.push(a),Ee.test(e.charAt(Ao))?(a=e.charAt(Ao),Ao++):(a=o,0===Ko&&Lo(ot));else n=o;(i=n!==o?e.substring(i,Ao):n)!==o&&(n=xi())!==o?(t,t=eo(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,(r=ui())!==o){for(32===e.charCodeAt(Ao)?(i=P,Ao++):(i=o,0===Ko&&Lo(et)),i===o&&(i=null),n=Ao,a=[],s=Ao,l=Ao,Ko++,u=Ao,32===e.charCodeAt(Ao)?(c=P,Ao++):(c=o,0===Ko&&Lo(et)),c===o&&(c=null),(g=ui())!==o?u=c=[c,g]:(Ao=u,u=o),Ko--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===Ko&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,Ko++,u=Ao,32===e.charCodeAt(Ao)?(c=P,Ao++):(c=o,0===Ko&&Lo(et)),c===o&&(c=null),(g=ui())!==o?u=c=[c,g]:(Ao=u,u=o),Ko--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===Ko&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);n=e.substring(n,Ao),32===e.charCodeAt(Ao)?(a=P,Ao++):(a=o,0===Ko&&Lo(et)),a===o&&(a=null),(s=ui())!==o?(l=function(){var t,r,i,n;t=Ao,124===e.charCodeAt(Ao)?(r=p,Ao++):(r=o,0===Ko&&Lo(Fe));if(r!==o){for(i=[],n=gi();n!==o;)i.push(n),n=gi();t,t=so(i)}else Ao=t,t=o;return t}(),l===o&&(l=null),t,t=to(n,l)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,(r=bi())!==o){for(32===e.charCodeAt(Ao)?(i=P,Ao++):(i=o,0===Ko&&Lo(et)),i===o&&(i=null),n=Ao,a=[],s=Ao,l=Ao,Ko++,u=Ao,32===e.charCodeAt(Ao)?(c=P,Ao++):(c=o,0===Ko&&Lo(et)),c===o&&(c=null),(g=bi())!==o?u=c=[c,g]:(Ao=u,u=o),Ko--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===Ko&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,Ko++,u=Ao,32===e.charCodeAt(Ao)?(c=P,Ao++):(c=o,0===Ko&&Lo(et)),c===o&&(c=null),(g=bi())!==o?u=c=[c,g]:(Ao=u,u=o),Ko--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===Ko&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);n=e.substring(n,Ao),32===e.charCodeAt(Ao)?(a=P,Ao++):(a=o,0===Ko&&Lo(et)),a===o&&(a=null),(s=bi())!==o?(t,t=ro(n)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,(r=vi())!==o){for(32===e.charCodeAt(Ao)?(i=P,Ao++):(i=o,0===Ko&&Lo(et)),i===o&&(i=null),n=Ao,a=[],s=Ao,l=Ao,Ko++,u=Ao,32===e.charCodeAt(Ao)?(c=P,Ao++):(c=o,0===Ko&&Lo(et)),c===o&&(c=null),(g=vi())!==o?u=c=[c,g]:(Ao=u,u=o),Ko--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===Ko&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,Ko++,u=Ao,32===e.charCodeAt(Ao)?(c=P,Ao++):(c=o,0===Ko&&Lo(et)),c===o&&(c=null),(g=vi())!==o?u=c=[c,g]:(Ao=u,u=o),Ko--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===Ko&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);n=e.substring(n,Ao),32===e.charCodeAt(Ao)?(a=P,Ao++):(a=o,0===Ko&&Lo(et)),a===o&&(a=null),(s=vi())!==o?(t,t=oo(n)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,(r=Ci())!==o){for(32===e.charCodeAt(Ao)?(i=P,Ao++):(i=o,0===Ko&&Lo(et)),i===o&&(i=null),n=Ao,a=[],s=Ao,l=Ao,Ko++,u=Ao,32===e.charCodeAt(Ao)?(c=P,Ao++):(c=o,0===Ko&&Lo(et)),c===o&&(c=null),(g=Ci())!==o?u=c=[c,g]:(Ao=u,u=o),Ko--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===Ko&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,Ko++,u=Ao,32===e.charCodeAt(Ao)?(c=P,Ao++):(c=o,0===Ko&&Lo(et)),c===o&&(c=null),(g=Ci())!==o?u=c=[c,g]:(Ao=u,u=o),Ko--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===Ko&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);n=e.substring(n,Ao),32===e.charCodeAt(Ao)?(a=P,Ao++):(a=o,0===Ko&&Lo(et)),a===o&&(a=null),(s=Ci())!==o?(t,t=io(n)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,(r=ki())!==o){for(32===e.charCodeAt(Ao)?(i=P,Ao++):(i=o,0===Ko&&Lo(et)),i===o&&(i=null),n=Ao,a=[],s=Ao,l=Ao,Ko++,u=Ao,32===e.charCodeAt(Ao)?(c=P,Ao++):(c=o,0===Ko&&Lo(et)),c===o&&(c=null),(g=ki())!==o?u=c=[c,g]:(Ao=u,u=o),Ko--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===Ko&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);s!==o;)a.push(s),s=Ao,l=Ao,Ko++,u=Ao,32===e.charCodeAt(Ao)?(c=P,Ao++):(c=o,0===Ko&&Lo(et)),c===o&&(c=null),(g=ki())!==o?u=c=[c,g]:(Ao=u,u=o),Ko--,u===o?l=void 0:(Ao=l,l=o),l!==o?(e.length>Ao?(u=e.charAt(Ao),Ao++):(u=o,0===Ko&&Lo(Xe)),u!==o?s=l=[l,u]:(Ao=s,s=o)):(Ao=s,s=o);n=e.substring(n,Ao),32===e.charCodeAt(Ao)?(a=P,Ao++):(a=o,0===Ko&&Lo(et)),a===o&&(a=null),(s=ki())!==o?(t,t=no(n)):(Ao=t,t=o)}else Ao=t,t=o;t===o&&(t=Ao,r=function(){var t,r,i,n,a,s,l;t=Ao,r=Ao,i=Ao,e.substr(Ao,4)===Ae?(n=Ae,Ao+=4):(n=o,0===Ko&&Lo(nr));n!==o?(115===e.charCodeAt(Ao)?(a=Pe,Ao++):(a=o,0===Ko&&Lo(ar)),a===o&&(a=null),e.substr(Ao,3)===we?(s=we,Ao+=3):(s=o,0===Ko&&Lo(sr)),s!==o?i=n=[n,a,s]:(Ao=i,i=o)):(Ao=i,i=o);i===o&&(e.substr(Ao,7)===Se?(i=Se,Ao+=7):(i=o,0===Ko&&Lo(lr)));r=i!==o?e.substring(r,Ao):i;if(r!==o){for(i=Ao,n=[],a=Ao,s=Ao,Ko++,l=No(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=_i())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,Ko++,l=No(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=_i())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),t,t=xo(r,i)}else Ao=t,t=o;return t}(),r!==o&&(t,r=ao(r)),t=r)}}}}}return t}function pi(){var t,r,i,n,a;if(t=Ao,r=Ao,(i=ui())!==o){if(n=[],(a=si())!==o)for(;a!==o;)n.push(a),a=si();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,i=function(){var e,t,r;return e=Ao,(t=li())!==o&&(r=li())!==o?e=t=[t,r]:(Ao=e,e=o),e}(),i!==o){if(n=[],(a=li())!==o)for(;a!==o;)n.push(a),a=li();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,(i=Ci())!==o){if(n=[],(a=mi())!==o)for(;a!==o;)n.push(a),a=mi();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,(i=ki())!==o){if(n=[],(a=Ti())!==o)for(;a!==o;)n.push(a),a=Ti();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;t=r!==o?e.substring(t,Ao):r}}}return t}function gi(){var t,r,i,n,a,s,l;if(t=Ao,e.substr(Ao,5)===E?(r=E,Ao+=5):(r=o,0===Ko&&Lo(ut)),r!==o){for(i=Ao,n=[],a=Ao,s=Ao,Ko++,l=No(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,Ko++,l=No(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=lo(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,e.substr(Ao,4)===O?(r=O,Ao+=4):(r=o,0===Ko&&Lo(ct)),r!==o){for(i=Ao,n=[],a=Ao,s=Ao,Ko++,l=No(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,Ko++,l=No(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=uo(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o&&(t=Ao,e.substr(Ao,4)===h?(r=h,Ao+=4):(r=o,0===Ko&&Lo(Me)),r!==o&&(i=No())!==o?(t,t=co()):(Ao=t,t=o),t===o)){if(t=Ao,e.substr(Ao,5)===L?(r=L,Ao+=5):(r=o,0===Ko&&Lo(pt)),r!==o){for(i=Ao,n=[],a=Ao,s=Ao,Ko++,l=No(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,Ko++,l=No(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=po(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o&&(t=Ao,e.substr(Ao,6)===j?(r=j,Ao+=6):(r=o,0===Ko&&Lo(gt)),r!==o?(i=function(){var t;e.substr(Ao,4)===q?(t=q,Ao+=4):(t=o,0===Ko&&Lo(kt));t===o&&(e.substr(Ao,5)===z?(t=z,Ao+=5):(t=o,0===Ko&&Lo(Bt)),t===o&&(e.substr(Ao,4)===H?(t=H,Ao+=4):(t=o,0===Ko&&Lo(xt)),t===o&&(e.substr(Ao,4)===W?(t=W,Ao+=4):(t=o,0===Ko&&Lo(At)),t===o&&(e.substr(Ao,7)===Y?(t=Y,Ao+=7):(t=o,0===Ko&&Lo(Pt)),t===o&&(e.substr(Ao,9)===X?(t=X,Ao+=9):(t=o,0===Ko&&Lo(wt)),t===o&&(e.substr(Ao,4)===Z?(t=Z,Ao+=4):(t=o,0===Ko&&Lo(St)),t===o&&(e.substr(Ao,8)===Q?(t=Q,Ao+=8):(t=o,0===Ko&&Lo(Kt)),t===o&&(e.substr(Ao,5)===ee?(t=ee,Ao+=5):(t=o,0===Ko&&Lo(_t)),t===o&&(e.substr(Ao,4)===te?(t=te,Ao+=4):(t=o,0===Ko&&Lo(Rt)),t===o&&(e.substr(Ao,7)===re?(t=re,Ao+=7):(t=o,0===Ko&&Lo(It)),t===o&&(e.substr(Ao,6)===oe?(t=oe,Ao+=6):(t=o,0===Ko&&Lo(Et)),t===o&&(e.substr(Ao,4)===ie?(t=ie,Ao+=4):(t=o,0===Ko&&Lo(Ot)),t===o&&(e.substr(Ao,5)===ne?(t=ne,Ao+=5):(t=o,0===Ko&&Lo(Lt)),t===o&&(e.substr(Ao,6)===ae?(t=ae,Ao+=6):(t=o,0===Ko&&Lo(jt)),t===o&&(e.substr(Ao,6)===se?(t=se,Ao+=6):(t=o,0===Ko&&Lo(Ft)),t===o&&(e.substr(Ao,3)===le?(t=le,Ao+=3):(t=o,0===Ko&&Lo(Gt)),t===o&&(e.substr(Ao,6)===ue?(t=ue,Ao+=6):(t=o,0===Ko&&Lo(Vt)),t===o&&(e.substr(Ao,4)===ce?(t=ce,Ao+=4):(t=o,0===Ko&&Lo(Nt)),t===o&&(e.substr(Ao,6)===pe?(t=pe,Ao+=6):(t=o,0===Ko&&Lo(Dt)),t===o&&(e.substr(Ao,5)===ge?(t=ge,Ao+=5):(t=o,0===Ko&&Lo(Mt)),t===o&&(e.substr(Ao,6)===de?(t=de,Ao+=6):(t=o,0===Ko&&Lo(Ut)))))))))))))))))))))));return t}(),i!==o&&(n=No())!==o?(t,t=go(i)):(Ao=t,t=o)):(Ao=t,t=o),t===o&&(t=Ao,r=function(){var t;e.substr(Ao,4)===F?(t=F,Ao+=4):(t=o,0===Ko&&Lo(dt));t===o&&(e.substr(Ao,6)===G?(t=G,Ao+=6):(t=o,0===Ko&&Lo(yt)),t===o&&(e.substr(Ao,5)===V?(t=V,Ao+=5):(t=o,0===Ko&&Lo(ft)),t===o&&(e.substr(Ao,9)===N?(t=N,Ao+=9):(t=o,0===Ko&&Lo(ht)),t===o&&(e.substr(Ao,6)===D?(t=D,Ao+=6):(t=o,0===Ko&&Lo(mt)),t===o&&(e.substr(Ao,3)===M?(t=M,Ao+=3):(t=o,0===Ko&&Lo(Tt)),t===o&&(e.substr(Ao,5)===U?(t=U,Ao+=5):(t=o,0===Ko&&Lo(bt)),t===o&&(e.substr(Ao,3)===$?(t=$,Ao+=3):(t=o,0===Ko&&Lo(vt)),t===o&&(e.substr(Ao,3)===J?(t=J,Ao+=3):(t=o,0===Ko&&Lo(Ct))))))))));return t}(),r!==o&&(i=No())!==o?(t,t=yo(r)):(Ao=t,t=o),t===o)))if(t=Ao,35===e.charCodeAt(Ao)?(r=w,Ao++):(r=o,0===Ko&&Lo(tt)),r!==o){for(i=Ao,n=[],a=Ao,s=Ao,Ko++,l=No(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,Ko++,l=No(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o&&(l=Si())!==o?a=s=[s,l]:(Ao=a,a=o);i=e.substring(i,Ao),(n=No())!==o?(t,t=fo(i)):(Ao=t,t=o)}else Ao=t,t=o}}return t}function di(){var e,t,r,i;for(Ko++,e=Ao,(t=yi())===o&&(t=null),r=[],(i=Ai())===o&&(i=yi());i!==o;)r.push(i),(i=Ai())===o&&(i=yi());return e,e=mo(t,r),Ko--,t=o,0===Ko&&Lo(Jt),e}function yi(){var t,r,i,n,a,s,l;if(t=Ao,r=Ao,i=[],n=Ao,(a=Pi())===o&&(a=null),s=Ao,Ko++,l=Ai(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===Ko&&Lo(Xe)),l!==o?n=a=[a,s,l]:(Ao=n,n=o)):(Ao=n,n=o),n!==o)for(;n!==o;)i.push(n),n=Ao,(a=Pi())===o&&(a=null),s=Ao,Ko++,l=Ai(),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===Ko&&Lo(Xe)),l!==o?n=a=[a,s,l]:(Ao=n,n=o)):(Ao=n,n=o);else i=o;return(r=i!==o?e.substring(r,Ao):i)!==o&&(t,r=To(r)),(t=r)===o&&(t=wi()),t}function fi(){var t;return 42===e.charCodeAt(Ao)?(t=ye,Ao++):(t=o,0===Ko&&Lo(qt)),t}function hi(){var t;return 95===e.charCodeAt(Ao)?(t=fe,Ao++):(t=o,0===Ko&&Lo(zt)),t}function mi(){var t;return 96===e.charCodeAt(Ao)?(t=he,Ao++):(t=o,0===Ko&&Lo(Ht)),t}function Ti(){var t;return 33===e.charCodeAt(Ao)?(t=me,Ao++):(t=o,0===Ko&&Lo(Wt)),t}function bi(){var e,t,r;return e=Ao,(t=fi())!==o&&(r=fi())!==o?e=t=[t,r]:(Ao=e,e=o),e}function vi(){var e,t,r;return e=Ao,(t=hi())!==o&&(r=hi())!==o?e=t=[t,r]:(Ao=e,e=o),e}function Ci(){var e,t,r;return e=Ao,(t=mi())!==o&&(r=mi())!==o?e=t=[t,r]:(Ao=e,e=o),e}function ki(){var e,t,r;return e=Ao,(t=Ti())!==o&&(r=Ti())!==o?e=t=[t,r]:(Ao=e,e=o),e}function Bi(){var t;return e.substr(Ao,2)===Te?(t=Te,Ao+=2):(t=o,0===Ko&&Lo(Yt)),t}function xi(){var t;return 93===e.charCodeAt(Ao)?(t=be,Ao++):(t=o,0===Ko&&Lo(Xt)),t}function Ai(){var t,r,i,n,a,s,l,u,c;if(t=Ao,Bi()!==o){if(r=Ao,i=[],Ee.test(e.charAt(Ao))?(n=e.charAt(Ao),Ao++):(n=o,0===Ko&&Lo(ot)),n!==o)for(;n!==o;)i.push(n),Ee.test(e.charAt(Ao))?(n=e.charAt(Ao),Ao++):(n=o,0===Ko&&Lo(ot));else i=o;(r=i!==o?e.substring(r,Ao):i)!==o&&(i=xi())!==o?(t,t=bo(r)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,bi()!==o){for(32===e.charCodeAt(Ao)?(r=P,Ao++):(r=o,0===Ko&&Lo(et)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,Ko++,l=Ao,32===e.charCodeAt(Ao)?(u=P,Ao++):(u=o,0===Ko&&Lo(et)),u===o&&(u=null),(c=bi())!==o?l=u=[u,c]:(Ao=l,l=o),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===Ko&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,Ko++,l=Ao,32===e.charCodeAt(Ao)?(u=P,Ao++):(u=o,0===Ko&&Lo(et)),u===o&&(u=null),(c=bi())!==o?l=u=[u,c]:(Ao=l,l=o),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===Ko&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);i=e.substring(i,Ao),32===e.charCodeAt(Ao)?(n=P,Ao++):(n=o,0===Ko&&Lo(et)),n===o&&(n=null),(a=bi())!==o?(t,t=vo(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,vi()!==o){for(32===e.charCodeAt(Ao)?(r=P,Ao++):(r=o,0===Ko&&Lo(et)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,Ko++,l=Ao,32===e.charCodeAt(Ao)?(u=P,Ao++):(u=o,0===Ko&&Lo(et)),u===o&&(u=null),(c=vi())!==o?l=u=[u,c]:(Ao=l,l=o),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===Ko&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,Ko++,l=Ao,32===e.charCodeAt(Ao)?(u=P,Ao++):(u=o,0===Ko&&Lo(et)),u===o&&(u=null),(c=vi())!==o?l=u=[u,c]:(Ao=l,l=o),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===Ko&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);i=e.substring(i,Ao),32===e.charCodeAt(Ao)?(n=P,Ao++):(n=o,0===Ko&&Lo(et)),n===o&&(n=null),(a=vi())!==o?(t,t=Co(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o){if(t=Ao,Ci()!==o){for(32===e.charCodeAt(Ao)?(r=P,Ao++):(r=o,0===Ko&&Lo(et)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,Ko++,l=Ao,32===e.charCodeAt(Ao)?(u=P,Ao++):(u=o,0===Ko&&Lo(et)),u===o&&(u=null),(c=Ci())!==o?l=u=[u,c]:(Ao=l,l=o),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===Ko&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,Ko++,l=Ao,32===e.charCodeAt(Ao)?(u=P,Ao++):(u=o,0===Ko&&Lo(et)),u===o&&(u=null),(c=Ci())!==o?l=u=[u,c]:(Ao=l,l=o),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===Ko&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);i=e.substring(i,Ao),32===e.charCodeAt(Ao)?(n=P,Ao++):(n=o,0===Ko&&Lo(et)),n===o&&(n=null),(a=Ci())!==o?(t,t=ko(i)):(Ao=t,t=o)}else Ao=t,t=o;if(t===o)if(t=Ao,ki()!==o){for(32===e.charCodeAt(Ao)?(r=P,Ao++):(r=o,0===Ko&&Lo(et)),r===o&&(r=null),i=Ao,n=[],a=Ao,s=Ao,Ko++,l=Ao,32===e.charCodeAt(Ao)?(u=P,Ao++):(u=o,0===Ko&&Lo(et)),u===o&&(u=null),(c=ki())!==o?l=u=[u,c]:(Ao=l,l=o),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===Ko&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);a!==o;)n.push(a),a=Ao,s=Ao,Ko++,l=Ao,32===e.charCodeAt(Ao)?(u=P,Ao++):(u=o,0===Ko&&Lo(et)),u===o&&(u=null),(c=ki())!==o?l=u=[u,c]:(Ao=l,l=o),Ko--,l===o?s=void 0:(Ao=s,s=o),s!==o?(e.length>Ao?(l=e.charAt(Ao),Ao++):(l=o,0===Ko&&Lo(Xe)),l!==o?a=s=[s,l]:(Ao=a,a=o)):(Ao=a,a=o);i=e.substring(i,Ao),32===e.charCodeAt(Ao)?(n=P,Ao++):(n=o,0===Ko&&Lo(et)),n===o&&(n=null),(a=ki())!==o?(t,t=Bo(i)):(Ao=t,t=o)}else Ao=t,t=o}}}return t}function Pi(){var t,r,i,n,a;if(t=Ao,r=Ao,(i=bi())!==o){if(n=[],(a=fi())!==o)for(;a!==o;)n.push(a),a=fi();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,(i=vi())!==o){if(n=[],(a=hi())!==o)for(;a!==o;)n.push(a),a=hi();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,(i=Ci())!==o){if(n=[],(a=mi())!==o)for(;a!==o;)n.push(a),a=mi();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;if((t=r!==o?e.substring(t,Ao):r)===o){if(t=Ao,r=Ao,(i=ki())!==o){if(n=[],(a=Ti())!==o)for(;a!==o;)n.push(a),a=Ti();else n=o;n!==o?r=i=[i,n]:(Ao=r,r=o)}else Ao=r,r=o;t=r!==o?e.substring(t,Ao):r}}}return t}function wi(){var t;return Ko++,10===e.charCodeAt(Ao)?(t=ve,Ao++):(t=o,0===Ko&&Lo(Qt)),t===o&&(e.substr(Ao,2)===Ce?(t=Ce,Ao+=2):(t=o,0===Ko&&Lo(er)),t===o&&(13===e.charCodeAt(Ao)?(t=ke,Ao++):(t=o,0===Ko&&Lo(tr)),t===o&&(8232===e.charCodeAt(Ao)?(t=Be,Ao++):(t=o,0===Ko&&Lo(rr)),t===o&&(8233===e.charCodeAt(Ao)?(t=xe,Ao++):(t=o,0===Ko&&Lo(or)))))),Ko--,t===o&&(o,0===Ko&&Lo(Zt)),t}function Si(){var t;return Oe.test(e.charAt(Ao))?(t=e.charAt(Ao),Ao++):(t=o,0===Ko&&Lo(ir)),t}function Ki(){var t,r;return(t=wi())===o&&(t=Ao,Ko++,e.length>Ao?(r=e.charAt(Ao),Ao++):(r=o,0===Ko&&Lo(Xe)),Ko--,r===o?t=void 0:(Ao=t,t=o)),t}function _i(){var t;return Le.test(e.charAt(Ao))?(t=e.charAt(Ao),Ao++):(t=o,0===Ko&&Lo(ur)),t===o&&(126===e.charCodeAt(Ao)?(t=Ke,Ao++):(t=o,0===Ko&&Lo(cr)),t===o&&(94===e.charCodeAt(Ao)?(t=_e,Ao++):(t=o,0===Ko&&Lo(pr)),t===o&&(39===e.charCodeAt(Ao)?(t=Re,Ao++):(t=o,0===Ko&&Lo(gr))))),t}var Ri=[],Ii="";if(e=e.trimStart(),(r=c())!==o&&Ao===e.length)return r;throw r!==o&&Ao<e.length&&Lo({type:"end"}),jo(So,wo<e.length?e.charAt(wo):null,wo<e.length?Oo(wo,wo+1):Oo(wo,wo))}t.SyntaxError=s,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(s,Error),s.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,o=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){o=e[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,n=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,a=this.location.source+":"+n.line+":"+n.column;if(o){var s=this.location.end,u=l("",n.line.toString().length," "),c=o[i.line-1],p=(i.line===s.line?s.column:c.length+1)-i.column||1;t+="\n --\x3e "+a+"\n"+u+" |\n"+n.line+" | "+c+"\n"+u+" | "+l("",i.column-1," ")+l("",p,"^")}else t+="\n at "+a}return t},s.buildMessage=function(e,t){var r={literal:function(e){return'"'+i(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function o(e){return e.charCodeAt(0).toString(16).toUpperCase()}function i(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"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(e)}))}function n(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"+o(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+o(e)}))}function a(e){return r[e.type](e)}return"Expected "+function(e){var t,r,o=e.map(a);if(o.sort(),o.length>0){for(t=1,r=1;t<o.length;t++)o[t-1]!==o[t]&&(o[r]=o[t],r++);o.length=r}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+i(e)+'"':"end of input"}(t)+" found."},t.parse=u},297:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkGenerator=void 0;const i=r(8256),n=r(2606),a=r(549),s=r(208),l=r(8791),u=r(1060),c=r(8565),p=r(7204),g=r(7953),d=r(9779),y=r(1353),f=r(672),h={debugGenerationInline:!1};t.BitmarkGenerator=class{constructor(e,t){var r;this.ast=new i.Ast,this.skipNLBetweenBitsValue=!1,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({},h),null==t?void 0:t.bitmarkOptions),this.bitmarkVersion===l.BitmarkVersion.v2?void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=c.CardSetVersion.v1):void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=c.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 o(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,a.NodeType.bitmarkAst,this,void 0),this.writeLine()}enter(e,t,r){let o;const i=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[n]&&(o=i[n](e,t,r)),o}between(e,t,r,o,i){let n;const a=this,s=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof a[s]&&(n=a[s](e,t,r,o,i)),n}exit(e,t,r){const o=this,i=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof o[i]&&o[i](e,t,r)}leaf(e,t,r){const o=this,i=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[i]&&o[i](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}between_bits(e,t,r,o,i){this.writeNL(),this.writeNL(),this.writeNL()}enter_bitsValue(e,t,r){const o=e.value,i=n.Config.getBitConfig(o.bitType),a=n.Config.getBitResourcesConfig(o.bitType,o.resourceType);if(this.writeOPD(),this.writeString(o.bitType.alias),o.textFormat){this.isWriteTextFormat(o.textFormat,i.textFormatDefault)&&(this.writeColon(),this.writeString(o.textFormat))}let s;if(i.resourceAttachmentAllowed&&o.resources&&o.resources.length>0){const e=a.comboResourceTagTypesMap;if(a.comboResourceTagTypesMap.size>0)for(const t of e.keys())s=t;else s=o.resources[0].type}s&&(this.writeAmpersand(),this.writeString(s)),this.writeCL(),this.writeNL()}between_bitsValue(e,t,r,o,i){const n=[a.NodeType.bitType,a.NodeType.textFormat,a.NodeType.level,a.NodeType.progress,a.NodeType.toc,a.NodeType.referenceEnd,a.NodeType.labelFalse];e.value.book&&n.push(a.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_internalComment(e,t,r){const o=e.value;if((null==t?void 0:t.key)===a.NodeType.bitsValue)for(let e=0;e<o.length;e++){const t=o[e],r=e===o.length-1;this.writeProperty("internalComment",t),r||this.writeNL()}}enter_labelTrue(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const i=null==t?void 0:t.value;i&&(""!=o&&this.writeProperty(g.PropertyTag.labelTrue,o,!0),i.labelFalse&&""!=i.labelFalse[0]&&this.writeProperty(g.PropertyTag.labelFalse,i.labelFalse,!0))}enter_imageSource(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const{url:i,mockupId:n,size:s,format:l,trim:u}=o;this.writeProperty("imageSource",i,!0),i&&(n&&this.writeProperty("mockupId",n,!0),s&&this.writeProperty("size",s,!0),l&&this.writeProperty("format",l,!0),f.BooleanUtils.isBoolean(u)&&this.writeProperty("trim",u,!0))}enter_partner(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const{name:i,avatarImage:n}=o;this.writeProperty("partner",i,!0),n&&this.writeResource(n)}enter_markConfigValue(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==a.NodeType.markConfig)return;const{mark:i,color:n,emphasis:s}=o;i&&(this.writeProperty("mark",i,!0),n&&this.writeProperty("color",n,!0),s&&this.writeProperty("emphasis",s,!0),this.writeNL())}leaf_sampleSolution(e,t,r){this.writeProperty("sampleSolution",e.value)}leaf_reasonableNumOfChars(e,t,r){this.writeProperty("reasonableNumOfChars",e.value)}enter_itemLead(e,t,r){const o=e.value;o&&(o.item||o.lead)&&(this.writeOPC(),this.writeString(o.item||""),this.writeCL(),o.lead&&(this.writeOPC(),this.writeString(o.lead),this.writeCL()))}enter_body(e,t,r){e.value.bodyParts.length>0&&this.writeNL()}enter_solutions(e,t,r){const o=e.value;o&&0===o.length&&(this.writeOPU(),this.writeCL())}leaf_solution(e,t,r){var o;const i=e.value,n=null===(o=this.getParentNode(r,2))||void 0===o?void 0:o.value;(null==n?void 0:n.type)===u.BodyBitType.mark&&i&&(this.writeOPE(),this.writeString(i),this.writeCL())}leaf_mark(e,t,r){var o;const i=e.value,n=null===(o=this.getParentNode(r,2))||void 0===o?void 0:o.value;(null==n?void 0:n.type)===u.BodyBitType.mark&&i&&this.writeProperty("mark",i,!0)}enter_optionsValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}enter_textsValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}enter_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeCardSetStart(),this.writeNL())}between_cardNode(e,t,r,o,i){this.isRootBitType1(i)||(this.writeNL(),this.writeCardSetCardDivider(),this.writeNL())}exit_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeNL(),this.writeCardSetEnd(),this.writeNL())}enter_elements(e,t,r){}between_elements(e,t,r,o,i){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}exit_elements(e,t,r){}between_flashcards(e,t,r,o,i){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}between_flashcardsValue(e,t,r,o,i){r.key===a.NodeType.answer?(this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()):r.key===a.NodeType.alternativeAnswers&&(this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL())}leaf_answer(e,t,r){(null==t?void 0:t.key)===a.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)===a.NodeType.alternativeAnswers&&e.value&&this.writeString(e.value)}enter_statements(e,t,r){}between_statements(e,t,r,o,i){this.isRootBitType(i,s.RootBitType.trueFalse1)||(this.writeNL(),this.writeCardSetCardDivider()),this.writeNL()}exit_statements(e,t,r){}enter_statementsValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}between_choices(e,t,r,o,i){this.writeNL()}exit_choices(e,t,r){this.writeNL()}enter_choicesValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}between_responses(e,t,r,o,i){this.writeNL()}exit_responses(e,t,r){this.writeNL()}enter_responsesValue(e,t,r){const o=e.value;o.isCorrect?this.writeOPP():this.writeOPM(),this.write(o.text),this.writeCL()}enter_quizzes(e,t,r){}between_quizzes(e,t,r,o,i){this.writeCardSetCardDivider(),this.writeNL()}exit_quizzes(e,t,r){}between_quizzesValue(e,t,r,o,i){r.key!==a.NodeType.choices&&r.key!==a.NodeType.responses||this.writeNL()}enter_heading(e,t,r){}between_heading(e,t,r,o,i){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_heading(e,t,r){}enter_forValues(e,t,r){}between_forValues(e,t,r,o,i){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_forValues(e,t,r){}enter_pairs(e,t,r){}between_pairs(e,t,r,o,i){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_pairs(e,t,r){}between_pairsValue(e,t,r,o,i){}enter_keyAudio(e,t,r){const o=e.value;this.writeResource(o)}enter_keyImage(e,t,r){const o=e.value;this.writeResource(o)}enter_matrix(e,t,r){}between_matrix(e,t,r,o,i){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_matrix(e,t,r){}between_matrixValue(e,t,r,o,i){}enter_values(e,t,r){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}between_values(e,t,r,o,i){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}enter_questions(e,t,r){}between_questions(e,t,r,o,i){this.writeCardSetCardDivider(),this.writeNL()}exit_questions(e,t,r){}between_questionsValue(e,t,r,o,i){r.key===a.NodeType.sampleSolution&&this.writeNL()}exit_questionsValue(e,t,r){this.writeNL()}enter_botResponses(e,t,r){}between_botResponses(e,t,r,o,i){this.writeCardSetCardDivider(),this.writeNL()}exit_botResponses(e,t,r){}between_botResponsesValue(e,t,r,o,i){this.writeNL()}exit_botResponsesValue(e,t,r){this.writeNL()}enter_cardBits(e,t,r){}between_cardBits(e,t,r,o,i){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_cardBits(e,t,r){}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 o=e.value;o&&this.write(o)}between_resources(e,t,r,o,i){this.writeNL()}enter_resourcesValue(e,t,r){const o=e.value;this.writeResource(o)}enter_posterImage(e,t,r){const o=e.value;o&&o.value&&this.writeProperty("posterImage",o.value)}enter_thumbnails(e,t,r){const o=e.value;if(Array.isArray(o)){const e=["src1x","src2x","src3x","src4x"];for(let t=0;t<o.length&&t!==e.length;t++){const r=o[t],i=e[t];this.writeProperty(i,r.value,!0)}}}leaf_title(e,t,r){const o=e.value,i=(null==t?void 0:t.value).level||1;if(i&&o){this.writeOP();for(let e=0;e<+i;e++)this.writeHash();this.writeString(o),this.writeCL()}}leaf_subtitle(e,t,r){const o=e.value;if(o){this.writeOP();for(let e=0;e<2;e++)this.writeHash();this.writeString(o),this.writeCL()}}leaf_book(e,t,r){const o=null==t?void 0:t.value;o&&e.value&&(this.writeProperty("book",e.value),o.reference&&(this.writeOPRANGLE(),this.writeString(o.reference),this.writeCL(),o.referenceEnd&&(this.writeOPRANGLE(),this.writeString(o.referenceEnd),this.writeCL())))}leaf_anchor(e,t,r){e.value&&(this.writeOPDANGLE(),this.writeString(e.value),this.writeCL())}leaf_reference(e,t,r){const o=null==t?void 0:t.value;o&&e.value&&(o.book||(this.writeOPRANGLE(),this.writeString(e.value),this.writeCL()))}leaf_hint(e,t,r){const o=e.value;o&&(this.writeOPQ(),this.writeString(o),this.writeCL())}leaf_instruction(e,t,r){const o=e.value;o&&(this.writeOPB(),this.writeString(o),this.writeCL())}leaf_example(e,t,r){var o,i;const n=e.value,a=null!==(o=null==t?void 0:t.value.isExample)&&void 0!==o&&o,s=null!==(i=null==t?void 0:t.value.isDefaultExample)&&void 0!==i&&i;a&&(s?(this.writeOPA(),this.writeString("example"),this.writeCL()):null!=n&&(this.writeOPA(),this.writeString("example"),this.writeColon(),!0===n?this.writeString("true"):!1===n?this.writeString("false"):this.writeString(n),this.writeCL()))}leaf_bodyText(e,t,r){const o=e.value;o&&this.writeString(o)}leaf_footerText(e,t,r){const o=e.value;o&&this.writeString(o)}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_isCaseSensitive(e,t,r){this.writeProperty("isCaseSensitive",e.value,!0,!1,!0)}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)!==a.NodeType.questionsValue&&(null==t?void 0:t.key)!==a.NodeType.flashcardsValue||e.value&&this.writeString(e.value)}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_zoomDisabled(e,t,r){this.writeProperty("zoomDisabled",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 o=e.value;this.writeProperty("caption",o)}leaf_duration(e,t,r){(null==t?void 0:t.key)!==a.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;const t=n.Config.getRawPropertiesConfig();for(const r of Object.values(t)){const t=null!==(e=r.astKey)&&void 0!==e?e:r.tag;if(t===g.PropertyTag.internalComment)continue;if(t===g.PropertyTag.example)continue;if(t===g.PropertyTag.labelTrue)continue;if(t===g.PropertyTag.labelFalse)continue;if(t===g.PropertyTag.posterImage)continue;if(t===g.PropertyTag.imageSource)continue;if(t===g.PropertyTag.partner)continue;if(t===p.PropertyAstKey.markConfig)continue;const o=`enter_${t}`;this[o]=(e,t,o)=>{null!=e.value&&(null==t?void 0:t.key)===a.NodeType.bitsValue&&this.writeProperty(r.tag,e.value,r.single,"false"===r.defaultValue,"true"===r.defaultValue)},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===c.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetEnd(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("==="):this.write("~~~~")}writeCardSetCardDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetSideDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("=="):this.write("--")}writeCardSetVariantDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("--"):this.write("++")}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeResource(e){var t;const r=e;e&&(this.writeOPAMP(),this.writeString(null!==(t=e.typeAlias)&&void 0!==t?t:e.type),e.type===d.ResourceTag.article&&r.value?(this.writeColon(),this.writeString(r.value),this.writeNL()):e.value&&(this.writeColon(),this.writeString(e.value)),this.writeCL())}writeProperty(e,t,r,o,i){let n,a=!1;if(void 0!==t&&(n=Array.isArray(t)?t:[t],n.length>0)){r&&(n=n.slice(n.length-1));for(const t of n)if(void 0!==t){if(o&&!1===t)continue;if(i&&!0===t)continue;this.writeOPA(),this.writeString(e),this.writeColon(),this.writeString(`${t}`),this.writeCL(),a=!0}}a||(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,t){return!!(!(y.TextFormat.fromValue(e)===t)||this.options.explicitTextFormat)}isRootBitType1(e){return this.isRootBitType(e,s.RootBitType.trueFalse1)||this.isRootBitType(e,s.RootBitType.multipleChoice1)||this.isRootBitType(e,s.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===a.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 o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkStringGenerator=void 0;const i=r(227),n=r(297);t.BitmarkStringGenerator=class{constructor(e){this.writer=new i.StringWriter,this.generator=new n.BitmarkGenerator(this.writer,e)}generate(e){return o(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 o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))},i=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonGenerator=void 0;const n=r(8256),a=r(8159),s=r(2606),l=r(549),u=r(208),c=r(8791),p=r(1060),g=r(7028),d=r(7204),y=r(7953),f=r(9779),h=r(1353),m=r(406),T=r(7646),b=r(672),v=r(3633),C=r(169),k={};t.JsonGenerator=class{constructor(e,t){var r;this.ast=new n.Ast,this.textParser=new m.TextParser,this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault=a.Breakscape.EMPTY_STRING,this.bodyDefault=a.Breakscape.EMPTY_STRING,this.bodyJson=this.bodyDefault,this.startPlaceholderIndex=0,this.printed=!1,this.bitmarkVersion=null!==(r=c.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:c.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},k),null==t?void 0:t.jsonOptions),this.jsonPrettifySpace=!0===this.options.prettify?2:this.options.prettify||void 0,this.bitmarkVersion===c.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 o(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?a.Breakscape.EMPTY_STRING:[],this.bodyDefault=this.options.textAsPlainText?a.Breakscape.EMPTY_STRING:[],this.bodyJson=this.bodyDefault,this.startPlaceholderIndex=0,this.printed=!1}walkAndWrite(e){this.ast.walk(e,l.NodeType.bitmarkAst,this,void 0)}enter(e,t,r){let o;const i=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[n]&&(o=i[n](e,t,r)),o}between(e,t,r,o,i){let n;const a=this,s=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof a[s]&&(n=a[s](e,t,r,o,i)),n}exit(e,t,r){const o=this,i=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof o[i]&&o[i](e,t,r)}leaf(e,t,r){const o=this,i=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[i]&&o[i](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 o,i,n;const a=e.value;this.bitWrapperJson={},this.json.push(this.bitWrapperJson),this.bitJson=this.createBitJson(a),this.bitWrapperJson.bit=this.bitJson;const l=s.Config.getBitConfig(a.bitType),c=!!l.rootExampleType,p=l.rootExampleType===g.ExampleType.boolean;if(c){let e;p?(e=!0,a.bitType.root===u.RootBitType.trueFalse1&&void 0!==(null===(i=null===(o=a.cardNode)||void 0===o?void 0:o.statement)||void 0===i?void 0:i.isCorrect)&&(e=a.cardNode.statement.isCorrect)):e=null!==(n=a.sampleSolution)&&void 0!==n?n:"";const t=this.toExample(a,{defaultExample:e,isBoolean:p});this.bitJson.isExample=t.isExample,this.bitJson.example=t.example}else a.isExample&&(this.bitJson.isExample=!0)}exit_bitsValue(e,t,r){this.cleanAndSetDefaultsForBitJson(this.bitJson)}enter_imageSource(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==l.NodeType.bitsValue)return;const{url:i,mockupId:n,size:a,format:s,trim:u}=o,c={};this.addProperty(c,"url",null!=i?i:"",!0),this.addProperty(c,"mockupId",null!=n?n:"",!0),this.addProperty(c,"size",null!=a?a:null,!0),this.addProperty(c,"format",null!=s?s:null,!0),this.addProperty(c,"trim",b.BooleanUtils.isBoolean(u)?u:null,!0),this.bitJson.imageSource=c}enter_partner(e,t,r){const o=e.value,i=this.getBitType(r);if((null==t?void 0:t.key)!==l.NodeType.bitsValue||!i)return;const{name:n,avatarImage:a}=o,s={};if(this.addProperty(s,"name",null!=n?n:"",!0),a){const e=this.parseResourceToJson(i,a);e&&e.type===f.ResourceTag.image&&(s.avatarImage=e.image)}this.bitJson.partner=s}enter_markConfigValue(e,t,r){const o=e.value;if((null==t?void 0:t.key)!==l.NodeType.markConfig)return;const{mark:i,color:n,emphasis:a}=o,s={};this.addProperty(s,"mark",null!=i?i:"unknown",!0),n&&this.addProperty(s,"color",null!=n?n:"",!0),a&&this.addProperty(s,"emphasis",null!=a?a:"",!0),this.bitJson.marks||(this.bitJson.marks=[]),this.bitJson.marks.push(s)}leaf_sampleSolution(e,t,r){(null==t?void 0:t.key)===l.NodeType.bitsValue&&null!=e.value&&this.addProperty(this.bitJson,"sampleSolution",e.value,!0)}enter_itemLead(e,t,r){const o=e.value,{item:i,lead:n}=o;(null==t?void 0:t.key)===l.NodeType.bitsValue&&(null!=i&&(this.bitJson.item=this.convertBreakscapedStringToJsonText(i,h.TextFormat.bitmarkMinusMinus)),null!=n&&(this.bitJson.lead=this.convertBreakscapedStringToJsonText(n,h.TextFormat.bitmarkMinusMinus)))}enter_extraProperties(e,t,r){const o=e.value;if(!this.options.excludeUnknownProperties&&o)for(const[e,t]of Object.entries(o)){let r=e;Object.prototype.hasOwnProperty.call(this.bitJson,e)&&(r=`_${e}`),this.addProperty(this.bitJson,r,t)}}enter_cardBitsValue(e,t,r){const o=this.getBitType(r);if(!o)return;let i;o.alias===u.AliasBitType.pageFooter?(this.bitJson.sections||(this.bitJson.sections=[]),i=this.bitJson.sections):(this.bitJson.listItems||(this.bitJson.listItems=[]),i=this.bitJson.listItems),this.listItem=Object.assign(Object.assign({},this.toItemLeadHintInstruction(e.value)),{body:this.bodyDefault}),i.push(this.listItem)}exit_cardBitsValue(e,t,r){this.listItem=void 0}enter_body(e,t,r){this.bodyJson=this.bodyDefault}exit_body(e,t,r){t&&(t.key===l.NodeType.bitsValue?this.bitJson.body=this.bodyJson:t.key===l.NodeType.cardBitsValue&&this.listItem&&(this.listItem.body=this.bodyJson))}enter_bodyParts(e,t,r){const o=e.value,i=this.options.textAsPlainText,n=this.getTextFormat(r);let s="",l=this.startPlaceholderIndex;const u=e=>({legacyPlaceholderKey:`{${e}}`,placeholderKey:`[!${e}]`});for(let e=0;e<o.length;e++){const t=o[e];if(t.type===p.BodyBitType.text){const e=t.data.bodyText;s=a.Breakscape.concatenate(s,e)}else{const{legacyPlaceholderKey:e,placeholderKey:t}=u(l);s=a.Breakscape.concatenate(s,i?e:t),l++}}this.bodyJson=this.convertBreakscapedStringToJsonText(s,n);const c=this.bodyJson;l=this.startPlaceholderIndex;for(let e=0;e<o.length;e++){const t=o[e];if(t.type===p.BodyBitType.text)continue;const r=t;let n;const{legacyPlaceholderKey:a}=u(l);switch(t.type){case p.BodyBitType.gap:{const e=r;n=this.createGapJson(e);break}case p.BodyBitType.mark:{const e=r;n=this.createMarkJson(e);break}case p.BodyBitType.select:{const e=r;n=this.createSelectJson(e);break}case p.BodyBitType.highlight:{const e=r;n=this.createHighlightJson(e);break}}n&&(i?(this.bitJson.placeholders||(this.bitJson.placeholders={}),this.bitJson.placeholders[a]=n):this.replacePlaceholderWithBodyBit(c,n,l)),l++}return this.startPlaceholderIndex=l,!1}enter_elements(e,t,r){const o=e.value;o&&o.length>0&&(this.bitJson.elements=a.Breakscape.unbreakscape(o))}enter_flashcards(e,t,r){var o,i,n,s;const u=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const c=[];if(u)for(const e of u){const t=Object.assign(Object.assign({question:null!==(o=a.Breakscape.unbreakscape(e.question))&&void 0!==o?o:"",answer:null!==(i=a.Breakscape.unbreakscape(e.answer))&&void 0!==i?i:"",alternativeAnswers:null!==(n=a.Breakscape.unbreakscape(e.alternativeAnswers))&&void 0!==n?n:[]},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:e.isDefaultExample,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,c.push(t)}c.length>0&&(this.bitJson.cards=c)}enter_statement(e,t,r){var o,i;const n=e.value;(null==t?void 0:t.key)===l.NodeType.cardNode&&n&&(this.bitJson.statement=null!==(o=a.Breakscape.unbreakscape(n.text))&&void 0!==o?o:"",this.bitJson.isCorrect=null!==(i=n.isCorrect)&&void 0!==i&&i)}enter_statements(e,t,r){var o,i,n;const s=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const u=[];if(s)for(const e of s){const t=Object.assign(Object.assign({statement:null!==(o=a.Breakscape.unbreakscape(e.text))&&void 0!==o?o:"",isCorrect:!!e.isCorrect},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(i=e.itemLead)||void 0===i?void 0:i.item)&&delete t.item,null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,null==(null==e?void 0:e.hint)&&delete t.hint,null==(null==e?void 0:e.instruction)&&delete t.instruction,u.push(t)}u.length>0&&(this.bitJson.statements=u)}enter_choices(e,t,r){var o,i,n;const s=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const u=[];if(s)for(const e of s){const t=Object.assign(Object.assign({choice:null!==(o=a.Breakscape.unbreakscape(e.text))&&void 0!==o?o:"",isCorrect:null!==(i=e.isCorrect)&&void 0!==i&&i},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.choices=u)}enter_responses(e,t,r){var o,i,n;const s=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const u=[];if(s)for(const e of s){const t=Object.assign(Object.assign({response:null!==(o=a.Breakscape.unbreakscape(e.text))&&void 0!==o?o:"",isCorrect:null!==(i=e.isCorrect)&&void 0!==i&&i},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.responses=u)}enter_quizzes(e,t,r){var o,i,n,s,l,u,c,p;const g=e.value,d=[];if(g)for(const e of g){const t=[];if(e.choices)for(const r of e.choices){const s=Object.assign(Object.assign({choice:null!==(o=a.Breakscape.unbreakscape(r.text))&&void 0!==o?o:"",isCorrect:null!==(i=r.isCorrect)&&void 0!==i&&i},this.toItemLeadHintInstruction(r)),this.toExample(r,{defaultExample:!!r.isCorrect,isBoolean:!0}));null==(null===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete s.lead,t.push(s)}const r=[];if(e.responses)for(const t of e.responses){const o=Object.assign(Object.assign({response:null!==(s=a.Breakscape.unbreakscape(t.text))&&void 0!==s?s:"",isCorrect:null!==(l=t.isCorrect)&&void 0!==l&&l},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!!t.isCorrect,isBoolean:!0}));null==(null===(u=e.itemLead)||void 0===u?void 0:u.lead)&&delete o.lead,r.push(o)}const g=Object.assign(Object.assign({},this.toItemLeadHintInstruction(e)),{isExample:null!==(c=e.isExample)&&void 0!==c&&c,choices:e.choices?t:void 0,responses:e.responses?r:void 0});null==(null===(p=e.itemLead)||void 0===p?void 0:p.lead)&&delete g.lead,d.push(g)}d.length>0&&(this.bitJson.quizzes=d)}enter_heading(e,t,r){var o,i;const n=e.value;let s=!1;if(n&&n.forKeys&&(s=!0),!s)return!1;const l={forKeys:null!==(o=a.Breakscape.unbreakscape(n.forKeys))&&void 0!==o?o:""};Array.isArray(n.forValues)?n.forValues.length>1?l.forValues=a.Breakscape.unbreakscape(n.forValues):1===n.forValues.length?l.forValues=a.Breakscape.unbreakscape(n.forValues[0]):l.forValues=a.Breakscape.unbreakscape(n.forValues):l.forValues=null!==(i=a.Breakscape.unbreakscape(n.forValues))&&void 0!==i?i:"",this.bitJson.heading=l}enter_pairs(e,t,r){var o,i,n,s;const l=e.value,u=[],c=this.getBitType(r);if(l&&c)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!==(o=a.Breakscape.unbreakscape(e.key))&&void 0!==o?o:"",keyAudio:e.keyAudio?this.addAudioResource(c,e.keyAudio):void 0,keyImage:e.keyImage?this.addImageResource(c,e.keyImage):void 0,values:null!==(i=a.Breakscape.unbreakscape(e.values))&&void 0!==i?i:[]},this.toItemLeadHintInstruction(e)),{isCaseSensitive:null===(n=e.isCaseSensitive)||void 0===n||n}),this.toExample(e,{defaultExample:t,isBoolean:!1}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.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 o,i,n,s,l,u;const c=e.value,p=[];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(Object.assign({values:null!==(o=a.Breakscape.unbreakscape(r.values))&&void 0!==o?o:[]},this.toItemLeadHintInstruction(r)),{isCaseSensitive:null===(i=r.isCaseSensitive)||void 0===i||i}),this.toExample(r,{defaultExample:e,isBoolean:!1}));null==(null===(n=r.itemLead)||void 0===n?void 0:n.lead)&&delete s.lead,null==r.hint&&delete s.hint,t.push(s)}const r=Object.assign(Object.assign({key:null!==(s=a.Breakscape.unbreakscape(e.key))&&void 0!==s?s:"",cells:null!=t?t:[]},this.toItemLeadHintInstruction(e)),{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,p.push(r)}p.length>0&&(this.bitJson.matrix=p)}enter_questions(e,t,r){var o,i,n,s;const l=e.value,u=[];if(l)for(const e of l){const t=Object.assign(Object.assign(Object.assign({question:null!==(o=a.Breakscape.unbreakscape(e.question))&&void 0!==o?o:"",partialAnswer:null!==(i=a.Breakscape.unbreakscape(T.ArrayUtils.asSingle(e.partialAnswer)))&&void 0!==i?i:"",sampleSolution:null!==(n=a.Breakscape.unbreakscape(e.sampleSolution))&&void 0!==n?n:""},this.toItemLeadHintInstruction(e)),{reasonableNumOfChars:e.reasonableNumOfChars}),this.toExample(e,{defaultExample:e.sampleSolution||"",isBoolean:!1}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.questions=u)}enter_botResponses(e,t,r){var o,i,n,s;const u=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const c=[];if(u)for(const e of u){const t=Object.assign({response:null!==(o=a.Breakscape.unbreakscape(e.response))&&void 0!==o?o:"",reaction:null!==(i=a.Breakscape.unbreakscape(e.reaction))&&void 0!==i?i:"",feedback:null!==(n=a.Breakscape.unbreakscape(e.feedback))&&void 0!==n?n:""},this.toItemLeadHintInstruction(e));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,null==e.hint&&delete t.hint,delete t.instruction,c.push(t)}c.length>0&&(this.bitJson.responses=c)}enter_resources(e,t,r){var o;const i=e.value,n=this.getBitType(r),a=this.getResourceType(r);if(!i||!n)return;let l;const u=s.Config.getBitConfig(n),c=s.Config.getBitResourcesConfig(n,a),p=c.comboResourceTagTypesMap;if(c.comboResourceTagTypesMap.size>0)for(const[e,t]of p.entries()){const r={type:e};for(const e of t){const t=i.find((t=>t.typeAlias===e));if(t){const e=s.Config.getTagConfigForTag(u.tags,t.typeAlias),i=null!==(o=null==e?void 0:e.jsonKey)&&void 0!==o?o:t.typeAlias,a=this.parseResourceToJson(n,t);if(a)for(const[e,t]of Object.entries(a))"type"!==e&&(r[i]=t)}}l=r}else i.length>=1&&(l=this.parseResourceToJson(n,i[0]));this.bitJson.resource=l}leaf_title(e,t,r){this.bitJson.title=this.convertBreakscapedStringToJsonText(e.value,h.TextFormat.bitmarkMinusMinus)}leaf_subtitle(e,t,r){this.bitJson.subtitle=this.convertBreakscapedStringToJsonText(e.value,h.TextFormat.bitmarkMinusMinus)}leaf_level(e,t,r){var o;null!=e.value&&this.addProperty(this.bitJson,"level",null!==(o=e.value)&&void 0!==o?o: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 o=e.value;(null==t?void 0:t.key)===l.NodeType.bitsValue&&(this.bitJson.hint=this.convertBreakscapedStringToJsonText(o,h.TextFormat.bitmarkMinusMinus))}leaf_instruction(e,t,r){const o=e.value;(null==t?void 0:t.key)===l.NodeType.bitsValue&&(this.bitJson.instruction=this.convertBreakscapedStringToJsonText(o,h.TextFormat.bitmarkMinusMinus))}leaf_footerText(e,t,r){const o=e.value;this.bitJson.footer=this.convertBreakscapedStringToJsonText(o,h.TextFormat.bitmarkMinusMinus)}leaf_markup(e,t,r){const o=e.value;o&&(this.bitWrapperJson.bitmark=o)}enter_parser(e,t,r){const o=e.value,n=this.getBitType(r);if(o&&n){const{version:e,excessResources:s,warnings:u,errors:c}=o,p=i(o,["version","excessResources","warnings","errors"]),g=`${this.bitmarkVersion}`;let d;if(Array.isArray(s)&&s.length>0){d=[];for(const e of s){const t=this.parseResourceToJson(n,e);t&&d.push(t)}}const y=a.Breakscape.unbreakscape(this.getInternalComments(r));(null==t?void 0:t.key)===l.NodeType.bitsValue&&(this.bitWrapperJson.parser=Object.assign(Object.assign({version:e,bitmarkVersion:g,comments:y},p),{warnings:u,errors:c,excessResources:d}),this.options.enableWarnings||delete this.bitWrapperJson.parser.warnings)}}generatePropertyHandlers(){var e;const t=s.Config.getRawPropertiesConfig();for(const r of Object.values(t)){const t=null!==(e=r.astKey)&&void 0!==e?e:r.tag;if(t===y.PropertyTag.internalComment)continue;if(t===y.PropertyTag.example)continue;if(t===y.PropertyTag.imageSource)continue;if(t===y.PropertyTag.partner)continue;if(t===d.PropertyAstKey.markConfig)continue;const o=`enter_${t}`;this[o]=(e,t,o)=>{var i;const n=e.value;if(null==n)return;if((null==t?void 0:t.key)!==l.NodeType.bitsValue)return;const a=null!==(i=r.jsonKey)&&void 0!==i?i:r.tag;this.addProperty(this.bitJson,a,n,r.single)},this[o]=this[o].bind(this)}}createGapJson(e){var t;const r=e.data,o=r.solutions&&r.solutions.length>0?r.solutions[0]:"",i=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:o,isBoolean:!1})),{solutions:a.Breakscape.unbreakscape(r.solutions)});return i.lead||delete i.lead,i}createMarkJson(e){const t=e.data,r=Object.assign(Object.assign({type:"mark",solution:a.Breakscape.unbreakscape(t.solution),mark:a.Breakscape.unbreakscape(t.mark)},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!0,isBoolean:!0}));return r.lead||delete r.lead,r}createSelectJson(e){var t,r,o,i;const n=e.data,s=[];for(const e of n.options){const r=Object.assign(Object.assign({text:a.Breakscape.unbreakscape(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,s.push(r)}const l=Object.assign(Object.assign({type:"select",prefix:null!==(r=a.Breakscape.unbreakscape(n.prefix))&&void 0!==r?r:"",postfix:null!==(o=a.Breakscape.unbreakscape(n.postfix))&&void 0!==o?o:""},this.toItemLeadHintInstruction(n)),{isExample:null!==(i=n.isExample)&&void 0!==i&&i,options:s});return l.lead||delete l.lead,l}createHighlightJson(e){var t,r,o,i,n;const s=e.data,l=[];for(const e of s.texts){const o=Object.assign(Object.assign({text:a.Breakscape.unbreakscape(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}));o.item||delete o.item,o.lead||delete o.lead,o.hint||delete o.hint,l.push(o)}const u=Object.assign(Object.assign({type:"highlight",prefix:null!==(o=a.Breakscape.unbreakscape(s.prefix))&&void 0!==o?o:"",postfix:null!==(i=a.Breakscape.unbreakscape(s.postfix))&&void 0!==i?i:""},this.toItemLeadHintInstruction(s)),{isExample:null!==(n=s.isExample)&&void 0!==n&&n,texts:l});return u.lead||delete u.lead,u}parseResourceToJson(e,t){if(!t)return;let r;switch(t.type){case f.ResourceTag.image:r={type:f.ResourceTag.image,image:this.addImageResource(e,t)};break;case f.ResourceTag.imageLink:r={type:f.ResourceTag.imageLink,imageLink:this.addImageLinkResource(e,t)};break;case f.ResourceTag.audio:r={type:f.ResourceTag.audio,audio:this.addAudioResource(e,t)};break;case f.ResourceTag.audioEmbed:r={type:f.ResourceTag.audioEmbed,audioEmbed:this.addAudioEmbedResource(e,t)};break;case f.ResourceTag.audioLink:r={type:f.ResourceTag.audioLink,audioLink:this.addAudioLinkResource(e,t)};break;case f.ResourceTag.video:r={type:f.ResourceTag.video,video:this.addVideoResource(e,t)};break;case f.ResourceTag.videoEmbed:r={type:f.ResourceTag.videoEmbed,videoEmbed:this.addVideoEmbedResource(e,t)},r.videoEmbed=this.addVideoLinkResource(e,t);break;case f.ResourceTag.videoLink:r={type:f.ResourceTag.videoLink,videoLink:this.addVideoLinkResource(e,t)};break;case f.ResourceTag.stillImageFilmEmbed:r={type:f.ResourceTag.stillImageFilmEmbed,stillImageFilmEmbed:this.addStillImageFilmEmbedResource(e,t)};break;case f.ResourceTag.stillImageFilmLink:r={type:f.ResourceTag.stillImageFilmLink,stillImageFilmLink:this.addStillImageFilmLinkResource(e,t)};break;case f.ResourceTag.article:r={type:f.ResourceTag.article,article:this.addArticleResource(e,t)};break;case f.ResourceTag.document:r={type:f.ResourceTag.document,document:this.addDocumentResource(e,t)};break;case f.ResourceTag.documentEmbed:r={type:f.ResourceTag.documentEmbed,documentEmbed:this.addDocumentEmbedResource(e,t)};break;case f.ResourceTag.documentLink:r={type:f.ResourceTag.documentLink,documentLink:this.addDocumentLinkResource(e,t)};break;case f.ResourceTag.documentDownload:r={type:f.ResourceTag.documentDownload,documentDownload:this.addDocumentDownloadResource(e,t)};break;case f.ResourceTag.appLink:r={type:f.ResourceTag.appLink,appLink:this.addAppLinkResource(e,t)};break;case f.ResourceTag.websiteLink:r={type:f.ResourceTag.websiteLink,websiteLink:this.addWebsiteLinkResource(e,t)}}return r}addImageResource(e,t){var r,o,i;const n={};if(v.StringUtils.isString(t)){const e=t;t={type:f.ResourceTag.image,typeAlias:f.ResourceTag.image,value:e,format:C.UrlUtils.fileExtensionFromUrl(e),provider:C.UrlUtils.domainFromUrl(e)}}return null!=t.format&&(n.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(n.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(n.src=a.Breakscape.unbreakscape(t.value)),null!=t.src1x&&(n.src1x=a.Breakscape.unbreakscape(t.src1x)),null!=t.src2x&&(n.src2x=a.Breakscape.unbreakscape(t.src2x)),null!=t.src3x&&(n.src3x=a.Breakscape.unbreakscape(t.src3x)),null!=t.src4x&&(n.src4x=a.Breakscape.unbreakscape(t.src4x)),n.width=null!==(r=t.width)&&void 0!==r?r:null,n.height=null!==(o=t.height)&&void 0!==o?o:null,n.alt=null!==(i=a.Breakscape.unbreakscape(t.alt))&&void 0!==i?i:"",n.zoomDisabled=this.getZoomDisabled(e,t.zoomDisabled),this.addGenericResourceProperties(e,t,n),n}addImageLinkResource(e,t){var r,o,i;const n={};if(v.StringUtils.isString(t)){const e=t;t={type:f.ResourceTag.imageLink,typeAlias:f.ResourceTag.imageLink,value:e,format:C.UrlUtils.fileExtensionFromUrl(e),provider:C.UrlUtils.domainFromUrl(e)}}return null!=t.format&&(n.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(n.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(n.url=a.Breakscape.unbreakscape(t.value)),null!=t.src1x&&(n.src1x=a.Breakscape.unbreakscape(t.src1x)),null!=t.src2x&&(n.src2x=a.Breakscape.unbreakscape(t.src2x)),null!=t.src3x&&(n.src3x=a.Breakscape.unbreakscape(t.src3x)),null!=t.src4x&&(n.src4x=a.Breakscape.unbreakscape(t.src4x)),n.width=null!==(r=t.width)&&void 0!==r?r:null,n.height=null!==(o=t.height)&&void 0!==o?o:null,n.alt=null!==(i=a.Breakscape.unbreakscape(t.alt))&&void 0!==i?i:"",n.zoomDisabled=this.getZoomDisabled(e,t.zoomDisabled),this.addGenericResourceProperties(e,t,n),n}addAudioResource(e,t){const r={};return null!=t.format&&(r.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(r.src=a.Breakscape.unbreakscape(t.value)),null!=t.duration&&(r.duration=t.duration),null!=t.mute&&(r.mute=t.mute),null!=t.autoplay&&(r.autoplay=t.autoplay),this.addGenericResourceProperties(e,t,r),r}addAudioEmbedResource(e,t){const r={};return null!=t.format&&(r.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(r.src=a.Breakscape.unbreakscape(t.value)),null!=t.duration&&(r.duration=t.duration),null!=t.mute&&(r.mute=t.mute),null!=t.autoplay&&(r.autoplay=t.autoplay),this.addGenericResourceProperties(e,t,r),r}addAudioLinkResource(e,t){const r={};return null!=t.format&&(r.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(r.url=a.Breakscape.unbreakscape(t.value)),null!=t.duration&&(r.duration=t.duration),null!=t.mute&&(r.mute=t.mute),null!=t.autoplay&&(r.autoplay=t.autoplay),this.addGenericResourceProperties(e,t,r,!0),r}addVideoResource(e,t){var r,o;const i={};if(null!=t.format&&(i.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(i.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(i.src=a.Breakscape.unbreakscape(t.value)),i.width=null!==(r=t.width)&&void 0!==r?r:null,i.height=null!==(o=t.height)&&void 0!==o?o:null,null!=t.duration&&(i.duration=t.duration),null!=t.mute&&(i.mute=t.mute),null!=t.autoplay&&(i.autoplay=t.autoplay),null!=t.allowSubtitles&&(i.allowSubtitles=t.allowSubtitles),null!=t.showSubtitles&&(i.showSubtitles=t.showSubtitles),null!=t.alt&&(i.alt=a.Breakscape.unbreakscape(t.alt)),null!=t.posterImage&&(i.posterImage=this.addImageResource(e,t.posterImage)),null!=t.thumbnails&&t.thumbnails.length>0){i.thumbnails=[];for(const r of t.thumbnails)i.thumbnails.push(this.addImageResource(e,r))}return this.addGenericResourceProperties(e,t,i),i}addVideoEmbedResource(e,t){var r,o;const i={};if(null!=t.format&&(i.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(i.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(i.src=a.Breakscape.unbreakscape(t.value)),i.width=null!==(r=t.width)&&void 0!==r?r:null,i.height=null!==(o=t.height)&&void 0!==o?o:null,null!=t.duration&&(i.duration=t.duration),null!=t.mute&&(i.mute=t.mute),null!=t.autoplay&&(i.autoplay=t.autoplay),null!=t.allowSubtitles&&(i.allowSubtitles=t.allowSubtitles),null!=t.showSubtitles&&(i.showSubtitles=t.showSubtitles),null!=t.alt&&(i.alt=a.Breakscape.unbreakscape(t.alt)),null!=t.posterImage&&(i.posterImage=this.addImageResource(e,t.posterImage)),null!=t.thumbnails&&t.thumbnails.length>0){i.thumbnails=[];for(const r of t.thumbnails)i.thumbnails.push(this.addImageResource(e,r))}return this.addGenericResourceProperties(e,t,i),i}addVideoLinkResource(e,t){var r,o;const i={};if(null!=t.format&&(i.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(i.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(i.url=a.Breakscape.unbreakscape(t.value)),i.width=null!==(r=t.width)&&void 0!==r?r:null,i.height=null!==(o=t.height)&&void 0!==o?o:null,null!=t.duration&&(i.duration=t.duration),null!=t.mute&&(i.mute=t.mute),null!=t.autoplay&&(i.autoplay=t.autoplay),null!=t.allowSubtitles&&(i.allowSubtitles=t.allowSubtitles),null!=t.showSubtitles&&(i.showSubtitles=t.showSubtitles),null!=t.alt&&(i.alt=a.Breakscape.unbreakscape(t.alt)),null!=t.posterImage&&(i.posterImage=this.addImageResource(e,t.posterImage)),null!=t.thumbnails&&t.thumbnails.length>0){i.thumbnails=[];for(const r of t.thumbnails)i.thumbnails.push(this.addImageResource(e,r))}return this.addGenericResourceProperties(e,t,i),i}addStillImageFilmEmbedResource(e,t){var r,o;const i={};if(null!=t.format&&(i.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(i.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(i.url=a.Breakscape.unbreakscape(t.value)),i.width=null!==(r=t.width)&&void 0!==r?r:null,i.height=null!==(o=t.height)&&void 0!==o?o:null,null!=t.duration&&(i.duration=t.duration),null!=t.mute&&(i.mute=t.mute),null!=t.autoplay&&(i.autoplay=t.autoplay),null!=t.allowSubtitles&&(i.allowSubtitles=t.allowSubtitles),null!=t.showSubtitles&&(i.showSubtitles=t.showSubtitles),null!=t.alt&&(i.alt=a.Breakscape.unbreakscape(t.alt)),null!=t.posterImage&&(i.posterImage=this.addImageResource(e,t.posterImage)),null!=t.thumbnails&&t.thumbnails.length>0){i.thumbnails=[];for(const r of t.thumbnails)i.thumbnails.push(this.addImageResource(e,r))}return this.addGenericResourceProperties(e,t,i),i}addStillImageFilmLinkResource(e,t){var r,o;const i={};if(null!=t.format&&(i.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(i.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(i.url=a.Breakscape.unbreakscape(t.value)),i.width=null!==(r=t.width)&&void 0!==r?r:null,i.height=null!==(o=t.height)&&void 0!==o?o:null,null!=t.duration&&(i.duration=t.duration),null!=t.mute&&(i.mute=t.mute),null!=t.autoplay&&(i.autoplay=t.autoplay),null!=t.allowSubtitles&&(i.allowSubtitles=t.allowSubtitles),null!=t.showSubtitles&&(i.showSubtitles=t.showSubtitles),null!=t.alt&&(i.alt=a.Breakscape.unbreakscape(t.alt)),null!=t.posterImage&&(i.posterImage=this.addImageResource(e,t.posterImage)),null!=t.thumbnails&&t.thumbnails.length>0){i.thumbnails=[];for(const r of t.thumbnails)i.thumbnails.push(this.addImageResource(e,r))}return this.addGenericResourceProperties(e,t,i),i}addArticleResource(e,t){const r={};return null!=t.format&&(r.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(r.body=a.Breakscape.unbreakscape(t.value)),this.addGenericResourceProperties(e,t,r),r}addDocumentResource(e,t){const r={};return null!=t.format&&(r.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(r.url=a.Breakscape.unbreakscape(t.value)),this.addGenericResourceProperties(e,t,r),r}addDocumentEmbedResource(e,t){const r={};return null!=t.format&&(r.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(r.url=a.Breakscape.unbreakscape(t.value)),this.addGenericResourceProperties(e,t,r),r}addDocumentLinkResource(e,t){const r={};return null!=t.format&&(r.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(r.url=a.Breakscape.unbreakscape(t.value)),this.addGenericResourceProperties(e,t,r),r}addDocumentDownloadResource(e,t){const r={};return null!=t.format&&(r.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(r.url=a.Breakscape.unbreakscape(t.value)),this.addGenericResourceProperties(e,t,r),r}addAppLinkResource(e,t){const r={};return null!=t.value&&(r.url=a.Breakscape.unbreakscape(t.value)),this.addGenericResourceProperties(e,t,r),r}addWebsiteLinkResource(e,t){const r={};return null!=t.value&&(r.url=a.Breakscape.unbreakscape(t.value)),null!=t.siteName&&(r.siteName=a.Breakscape.unbreakscape(t.siteName)),this.addGenericResourceProperties(e,t,r),r}addGenericResourceProperties(e,t,r,o){var i,n,s,l,u,c,p,g;return o?(null!=t.license&&(r.license=null!==(i=a.Breakscape.unbreakscape(t.license))&&void 0!==i?i:""),null!=t.copyright&&(r.copyright=null!==(n=a.Breakscape.unbreakscape(t.copyright))&&void 0!==n?n:""),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.showInIndex&&(r.showInIndex=null!==(s=t.showInIndex)&&void 0!==s&&s),null!=t.caption&&(r.caption=this.convertBreakscapedStringToJsonText(null!==(l=t.caption)&&void 0!==l?l:"",h.TextFormat.bitmarkMinusMinus))):(r.license=null!==(u=a.Breakscape.unbreakscape(t.license))&&void 0!==u?u:"",r.copyright=null!==(c=a.Breakscape.unbreakscape(t.copyright))&&void 0!==c?c:"",null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),r.showInIndex=null!==(p=t.showInIndex)&&void 0!==p&&p,r.caption=this.convertBreakscapedStringToJsonText(null!==(g=t.caption)&&void 0!==g?g:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus)),r}toItemLeadHintInstruction(e){var t,r,o,i,n,s;return{item:this.convertBreakscapedStringToJsonText(null!==(r=null===(t=e.itemLead)||void 0===t?void 0:t.item)&&void 0!==r?r:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus),lead:this.convertBreakscapedStringToJsonText(null!==(i=null===(o=e.itemLead)||void 0===o?void 0:o.lead)&&void 0!==i?i:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus),hint:this.convertBreakscapedStringToJsonText(null!==(n=e.hint)&&void 0!==n?n:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus),instruction:this.convertBreakscapedStringToJsonText(null!==(s=e.instruction)&&void 0!==s?s:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus)}}toExample(e,t){const{isExample:r,example:o,isDefaultExample:i}=e,{defaultExample:n,isBoolean:a}=t;if(!r)return{isExample:!1,example:null};let s;return s=i?a?b.BooleanUtils.toBoolean(n):this.convertBreakscapedStringToJsonText(n,h.TextFormat.bitmarkMinusMinus):a?b.BooleanUtils.toBoolean(o):this.convertBreakscapedStringToJsonText(o,h.TextFormat.bitmarkMinusMinus),{isExample:!0,example:s}}addProperty(e,t,r,o){if(void 0!==r){let i;Array.isArray(r)||(r=[r]),Array.isArray(r)&&r.length>0&&(r=a.Breakscape.unbreakscape(r),i=Array.isArray(r)&&o&&r.length>=1?r[r.length-1]:r),e[t]=i}}getZoomDisabled(e,t){if(null!=t)return t;switch(e.alias){case u.AliasBitType.imageSeparator:case u.AliasBitType.pageBanner:return!0}return!1}getBitType(e){for(const t of e)if(t.key===l.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getTextFormat(e){var t;const r=this.getBitType(e);if(r){const o=s.Config.getBitConfig(r);for(const r of e)if(r.key===l.NodeType.bitsValue){const e=r.value;return null!==(t=h.TextFormat.fromValue(null==e?void 0:e.textFormat))&&void 0!==t?t:o.textFormatDefault}}return h.TextFormat.bitmarkMinusMinus}getResourceType(e){for(const t of e)if(t.key===l.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.resourceType}}getInternalComments(e){if(this.getBitType(e))for(const t of e)if(t.key===l.NodeType.bitsValue){return t.value.internalComment}}convertBreakscapedStringToJsonText(e,t){if(this.options.textAsPlainText||t===h.TextFormat.text)return e||a.Breakscape.EMPTY_STRING;return this.textParser.toAst(e,{textFormat:t})}replacePlaceholderWithBodyBit(e,t,r){const o=(e,i,n)=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){const r=e[t];if(o(r,e,t))return!0}else{if("bit"===e.type&&e.index===r)return i[n]=t,!0;if(e.content){if(o(e.content,e,"content"))return!0}}return!1};o(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,internalComment:void 0,externalId:void 0,spaceId:void 0,padletId:void 0,jupyterId:void 0,jupyterExecutionCount:void 0,AIGenerated:void 0,releaseVersion:void 0,book:void 0,ageRange:void 0,lang:void 0,language:void 0,computerLanguage:void 0,target:void 0,tag:void 0,icon:void 0,iconTag:void 0,colorTag:void 0,flashcardSet:void 0,subtype:void 0,bookAlias: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,content2Buy:void 0,quotedPerson:void 0,reasonableNumOfChars:void 0,resolved:void 0,resolvedDate:void 0,resolvedBy:void 0,maxCreatedBits: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,partialAnswer: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,listItems:void 0,sections:void 0,placeholders:void 0,footer:void 0}}cleanAndSetDefaultsForBitJson(e){const t=s.Config.getBitType(e.type),r=this.options.textAsPlainText;switch(e.item||(e.item=void 0),t.root){case u.RootBitType._error:case u.RootBitType._comment:delete e.format;break;case u.RootBitType.article:case u.RootBitType.sampleSolution:case u.RootBitType.page: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!==u.AliasBitType.articleAi&&t.alias!==u.AliasBitType.noteAi&&t.alias!==u.AliasBitType.summaryAi||null==e.AIGenerated&&(e.AIGenerated=!0),t.root===u.RootBitType.reviewNote&&(null==e.resolved&&(e.resolved=!1),null==e.resolvedDate&&(e.resolvedDate=""),null==e.resolvedBy&&(e.resolvedBy=""));break;case u.RootBitType.cloze:case u.RootBitType.multipleChoice1:case u.RootBitType.multipleResponse1:case u.RootBitType.multipleChoiceText:case u.RootBitType.highlightText:case u.RootBitType.clozeAndMultipleChoiceText:case u.RootBitType.sequence:case u.RootBitType.mark:case u.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 u.RootBitType.multipleChoice:case u.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 u.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 u.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 u.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 u.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 u.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 u.RootBitType.match:null==e.item&&(e.item=this.textDefault),null==e.heading&&(e.heading={}),null==e.body&&(e.body=this.bodyDefault);break;case u.RootBitType.matchMatrix:null==e.item&&(e.item=this.textDefault),null==e.body&&(e.body=this.bodyDefault);break;case u.RootBitType.learningPathBook:case u.RootBitType.learningPathExternalLink:case u.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);break;case u.RootBitType.pageBuyButton:null==e.content2Buy&&(e.content2Buy=""),null==e.body&&(e.body=this.bodyDefault)}return null==e.id&&delete e.id,null==e.internalComment&&delete e.internalComment,null==e.externalId&&delete e.externalId,null==e.spaceId&&delete e.spaceId,null==e.padletId&&delete e.padletId,null==e.jupyterId&&delete e.jupyterId,null==e.jupyterExecutionCount&&delete e.jupyterExecutionCount,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.lang&&delete e.lang,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.flashcardSet&&delete e.flashcardSet,null==e.subtype&&delete e.subtype,null==e.bookAlias&&delete e.bookAlias,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.content2Buy&&delete e.content2Buy,null==e.quotedPerson&&delete e.quotedPerson,null==e.resolved&&delete e.resolved,null==e.resolvedDate&&delete e.resolvedDate,null==e.resolvedBy&&delete e.resolvedBy,null==e.maxCreatedBits&&delete e.maxCreatedBits,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,null==e.listItems&&delete e.listItems,null==e.sections&&delete e.sections,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 o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonObjectGenerator=void 0;const i=r(227),n=r(3857);t.JsonObjectGenerator=class{constructor(e){this.writer=new i.StringWriter,this.generator=new n.JsonGenerator(this.writer,e)}generate(e){return o(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 o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonStringGenerator=void 0;const i=r(227),n=r(3857);t.JsonStringGenerator=class{constructor(e){this.writer=new i.StringWriter,this.generator=new n.JsonGenerator(this.writer,e)}generate(e){return o(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 o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(i,n){function a(e){try{l(o.next(e))}catch(e){n(e)}}function s(e){try{l(o.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TextGenerator=void 0;const i=r(8256),n=r(8159),a=r(549),s=r(8791),l=r(1353),u=r(1888),c=r(2610),p={debugGenerationInline:!1},g="==",d={[u.TextMarkType.bold]:"**",[u.TextMarkType.light]:"``",[u.TextMarkType.italic]:"__",[u.TextMarkType.highlight]:"!!"},y=new RegExp(/(\n|\r\n)/,"g"),f=new RegExp(/https?:\/\/|mailto:(.*)/,"g");t.TextGenerator=class{constructor(e,t){var r;this.ast=new i.Ast,this.textFormat=l.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=s.BitmarkVersion.fromValue(e))&&void 0!==r?r:s.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},p),t),this.bitmarkVersion,s.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 o(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=e,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,a.NodeType.textAst,this,void 0)}enter(e,t,r){let o;const i=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[n]&&(o=i[n](e,t,r)),o}between(e,t,r,o,i){let n;const a=this,s=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof a[s]&&(n=a[s](e,t,r,o,i)),n}exit(e,t,r){const o=this,i=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof o[i]&&o[i](e,t,r)}leaf(e,t,r){const o=this,i=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[i]&&o[i](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_textAstValue(e,t,r){return this.handleEnterNode(e.value)}between_textAstValue(e,t,r,o,i){return this.handleBetweenNode(e.value)}exit_textAstValue(e,t,r){return this.handleExitNode(e.value)}enter_contentValueValue(e,t,r){return this.handleEnterNode(e.value)}between_contentValueValue(e,t,r,o,i){this.handleBetweenNode(e.value)}exit_contentValueValue(e,t,r){return this.handleExitNode(e.value)}handleEnterNode(e){switch(this.handleIndent(e),e.type){case c.TextNodeType.paragraph:this.writeParagraph(e);break;case c.TextNodeType.hardBreak:this.writeHardBreak(e);break;case c.TextNodeType.text:this.writeMarks(e,!0),this.writeText(e);break;case c.TextNodeType.heading:this.writeHeading(e);break;case c.TextNodeType.section:this.writeSection(e);break;case c.TextNodeType.listItem:case c.TextNodeType.taskItem:this.writeBullet(e);break;case c.TextNodeType.image:this.writeImage(e);break;case c.TextNodeType.codeBlock:this.inCodeBlock=!0,this.writeCodeBlock(e);break;case c.TextNodeType.gap:case c.TextNodeType.select:case c.TextNodeType.highlight:case c.TextNodeType.mark:return this.writeBodyBit(e),!1}this.exitedCodeBlock=!1}handleBetweenNode(e){e.type}handleExitNode(e){switch(e.type){case c.TextNodeType.text:this.writeMarks(e,!1);break;case c.TextNodeType.paragraph:this.textFormat!==l.TextFormat.bitmarkMinusMinus&&this.writeNL();break;case c.TextNodeType.heading:case c.TextNodeType.section:case c.TextNodeType.image:this.writeNL(),this.writeNL();break;case c.TextNodeType.codeBlock:this.writeNL(),this.writeNL(),this.inCodeBlock=!1,this.exitedCodeBlock=!0;break;case c.TextNodeType.bulletList:case c.TextNodeType.orderedList:case c.TextNodeType.taskList:this.currentIndent<=1&&this.writeNL()}this.handleDedent(e)}handleIndent(e){switch(e.type){case c.TextNodeType.bulletList:case c.TextNodeType.orderedList:case c.TextNodeType.taskList:this.currentIndent++}}handleDedent(e){switch(e.type){case c.TextNodeType.bulletList:case c.TextNodeType.orderedList:case c.TextNodeType.taskList:this.currentIndent--}}getLinkHref(e){if(e.type===c.TextNodeType.text&&e.marks){const t=e.marks.reduce(((e,t)=>{var r;if(t.type===u.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;this.inCodeBlock;let t=e.text;if(t=n.Breakscape.breakscape(t),this.currentIndent>1){const e=this.getIndentationString();t=t.replace(y,`$1${e}`)}this.write(t)}writeLink(e){if(null==e.text)return!1;const t=this.getLinkHref(e);if(t){let r=n.Breakscape.breakscape(e.text);if(this.currentIndent>1){const e=this.getIndentationString();r=r.replace(y,`$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){if(0===e.marks.length)return void this.writeMarkTextWrapper(g);const r=1===e.marks.length,o=e.marks.reduce(((e,t)=>{if(e)return e;switch(t.type){case u.TextMarkType.bold:case u.TextMarkType.light:case u.TextMarkType.italic:case u.TextMarkType.highlight:return r?d[t.type]:g;case u.TextMarkType.strike:case u.TextMarkType.sub:case u.TextMarkType.super:case u.TextMarkType.ins:case u.TextMarkType.del:case u.TextMarkType.var:case u.TextMarkType.code:case u.TextMarkType.color:case u.TextMarkType.comment:return g;case u.TextMarkType.link:}return e}),void 0);if(null!=o&&(this.writeMarkTextWrapper(o),!t)){let t=!1;for(const o of e.marks)switch(o.type){case u.TextMarkType.bold:case u.TextMarkType.light:case u.TextMarkType.italic:case u.TextMarkType.highlight:r||(this.writeInlineMarkStartEnd(),this.writeInlineMark(o),t=!0);break;case u.TextMarkType.strike:case u.TextMarkType.sub:case u.TextMarkType.super:case u.TextMarkType.ins:case u.TextMarkType.del:case u.TextMarkType.var:case u.TextMarkType.code:case u.TextMarkType.color:this.writeInlineMarkStartEnd(),this.writeInlineMark(o),t=!0;break;case u.TextMarkType.comment:this.writeInlineMarkStartEnd(),this.writeCommentMark(o),t=!0;case u.TextMarkType.link:}t&&this.writeInlineMarkStartEnd()}}}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 o="";const i=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.level)&&void 0!==r?r:1;for(let e=0;e<+i;e++)o+="#";o+=" ",this.write(o)}writeSection(e){let t="";t=e.section?`|${e.section}: `:"|",this.write(t)}writeBullet(e){var t,r;let o=this.getIndentationString();if(e.parent===c.TextNodeType.bulletList)o+="• ";else if(e.parent===c.TextNodeType.orderedList)o+="•1 ";else if(e.parent===c.TextNodeType.taskList){o+=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.checked)&&void 0!==r&&r?"•+ ":"•- "}o&&this.write(o)}writeImage(e){if(null==e.attrs||!e.attrs.src)return;const t=e.attrs;let r=`|image:${t.src}|`;for(const[e,o]of Object.entries(t))switch(e){case"textAlign":"left"!==o&&(r+=`@captionAlign:${o}|`);break;case"title":o&&(r+=`@caption:${o}|`);break;case"class":"center"!==o&&o&&(r+=`@align:${o}|`);break;case"comment":o&&(r+=`#${o}|`);break;case"alt":case"width":case"height":default:o&&(r+=`@${e}:${o}|`);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)}writeMarkTextWrapper(e){e&&this.write(e)}writeInlineMark(e){let t=`${e.type}`;if(e.attrs)for(const[r,o]of Object.entries(e.attrs))("language"===r&&"plain text"!==o||"color"===r)&&(t=`${t}:${o}`);this.write(t)}writeCommentMark(e){if(e.comment){const t=`#${e.comment}`;this.write(t)}}writeInlineMarkStartEnd(){this.write("|")}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===a.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}}},9677:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoBuilder=void 0;const o=r(2606),i=r(208);t.InfoBuilder=class{getSupportedBits(e){var t,r;const n=null===(t=null==e?void 0:e.includeNonDeprecated)||void 0===t||t,a=null!==(r=null==e?void 0:e.includeDeprecated)&&void 0!==r&&r,s=[];for(const t of i.RootBitType.values()){if(t===i.RootBitType._error||t===i.RootBitType._comment)continue;const r=o.Config.getBitType(t),l=o.Config.getBitConfig(r),u=this.getSupportedBitAliases(t,e);(u.length>0||n&&!l.deprecated||a&&l.deprecated)&&s.push({name:t,since:l.since,deprecated:l.deprecated,aliases:u})}return s}getSupportedBitConfigs(){const e=[];for(const t of i.RootBitType.values()){if(t===i.RootBitType._error||t===i.RootBitType._comment)continue;const r=o.Config.getBitType(t),n=o.Config.getBitConfig(r);e.push(n)}return e}getSupportedBitAliases(e,t){var r,n;const a=null===(r=null==t?void 0:t.includeNonDeprecated)||void 0===r||r,s=null!==(n=null==t?void 0:t.includeDeprecated)&&void 0!==n&&n,l=[];for(const t of i.AliasBitType.values()){const r=o.Config.getBitType(t);if(r.root===e){const e=o.Config.getBitConfig(r);(a&&!e.deprecated||s&&e.deprecated)&&l.push({name:r.alias,since:e.since,deprecated:e.deprecated})}}return l}}},7087:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const o=r(1022),i=r(671);r(2606);let n=!1;t.init=function(){n||((0,i.initEnv)(o.buildInfo.name,o.buildInfo.version),n=!0)}},549:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeType=void 0;const o=(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",cardBits:"cardBits",cardBitsValue:"cardBitsValue",id:"id",idValue:"idValue",internalComment:"internalComment",internalCommentValue:"internalCommentValue",externalId:"externalId",externalIdValue:"externalIdValue",spaceId:"spaceId",spaceIdValue:"spaceIdValue",releaseVersion:"releaseVersion",releaseVersionValue:"releaseVersionValue",padletId:"padletId",padletIdValue:"padletIdValue",jupyterId:"jupyterId",jupyterIdValue:"jupyterIdValue",jupyterExecutionCount:"jupyterExecutionCount",jupyterExecutionCountValue:"jupyterExecutionCountValue",aiGenerated:"aiGenerated",aiGeneratedValue:"aiGeneratedValue",ageRange:"ageRange",ageRangeValue:"ageRangeValue",lang:"lang",langValue:"langValue",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",flashcardSet:"flashcardSet",flashcardSetValue:"flashcardSetValue",subtype:"subtype",subtypeValue:"subtypeValue",bookAlias:"bookAlias",bookAliasValue:"bookAliasValue",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",content2Buy:"content2Buy",quotedPerson:"quotedPerson",partialAnswer:"partialAnswer",partialAnswerValue:"partialAnswerValue",reasonableNumOfChars:"reasonableNumOfChars",reasonableNumOfCharsValue:"reasonableNumOfCharsValue",resolved:"resolved",resolvedValue:"resolvedValue",resolvedDate:"resolvedDate",resolvedDateValue:"resolvedDateValue",resolvedBy:"resolvedBy",resolvedByValue:"resolvedByValue",maxCreatedBits:"maxCreatedBits",maxCreatedBitsValue:"maxCreatedBitsValue",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",anchor:"anchor",reference:"reference",referenceEnd:"referenceEnd",elementsValue:"elementsValue",solutionsValue:"solutionsValue",prefix:"prefix",postfix:"postfix",isCaseSensitive:"isCaseSensitive",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",imageSource:"imageSource",mockupId:"mockupId",size:"size",trim:"trim",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",resourceType:"resourceType",resources:"resources",resourcesValue:"resourcesValue",image:"image",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",audio:"audio",type:"type",typeAlias:"typeAlias",format:"format",value:"value",url:"url",src:"src",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",width:"width",height:"height",alt:"alt",zoomDisabled:"zoomDisabled",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=o},7200:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractTagConfig=void 0;t.AbstractTagConfig=class{constructor(e,t,r,o,i,n,a,s,l){this.type=e,this.configKey=t,this.tag=r,this.maxCount=o,this.minCount=i,this.chain=n,this.jsonKey=a,this.astKey=s,this.deprecated=l}}},429:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitConfig=void 0;const o=r(1035);t.BitConfig=class{constructor(e,t,r,o,i,n,a,s,l,u,c,p,g,d){this.tags={},this.since=e,this.rootBitType=t.root,this.aliases=r,this.textFormatDefault=o,this.tags=i,this.cardSet=n,this.deprecated=a,this.bodyAllowed=s,this.bodyRequired=l,this.footerAllowed=u,this.footerRequired=c,this.resourceAttachmentAllowed=p,this.rootExampleType=g,this.comboResourceType=d}toString(e){const t=Object.assign({},e);let r=`[Bit]\n${this.rootBitType}`;this.aliases.length>0&&(r+="\n\n[Aliases]",r+=`\n${this.aliases.join(", ")}`),r+=`\n\n[Default text format]\n${this.textFormatDefault}`;const i=[];null!=this.since&&i.push(`since=${this.since}`),null!=this.deprecated&&i.push(`deprecated=${this.deprecated}`),this.bodyAllowed&&i.push("bodyAllowed"),this.bodyRequired&&i.push("bodyRequired"),this.footerAllowed&&i.push("footerAllowed"),this.footerRequired&&i.push("footerRequired"),this.resourceAttachmentAllowed&&i.push("resourceAttachmentAllowed"),null!=this.rootExampleType&&i.push(`rootExampleType=${this.rootExampleType}`),null!=this.comboResourceType&&i.push(`comboResourceType=${this.comboResourceType}`),r+=`\n\n[Flags]\n${i.join(", ")}`,r+="\n\n[Tags]";for(const e of Object.values(this.tags))(e.maxCount===o.Count.infinity||e.maxCount>0)&&(r+=`\n${e.toString(t)}`);return this.cardSet&&(r+=`\n\n${this.cardSet.toString(t)}`),r}}},2005:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetConfig=void 0;t.CardSetConfig=class{constructor(e,t){this.configKey=e,this.variants=t}toString(e){const t=Object.assign({},e);let r="",o=0,i=0;for(const e of this.variants){for(const n of e)r+=`[Card - Side ${o}, Variant ${i}]`,r+=`\n${n.toString(t)}`,i++;o++}return r}}},3585:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardVariantConfig=void 0;t.CardVariantConfig=class{constructor(e,t,r,o){this.tags=e,this.bodyAllowed=t,this.bodyRequired=r,this.repeatCount=o}toString(e){const t=Object.assign({},e);let r="";const o=[];this.bodyAllowed&&o.push("bodyAllowed"),this.bodyRequired&&o.push("bodyRequired"),null!=this.repeatCount&&o.push(`repeatCount=${this.repeatCount}`),r+=`[Flags]\n${o.join(", ")}`,r+="\n\n[Tags]";for(const e of Object.values(this.tags))r+=`\n${e.toString(t)}`;return r}}},6620:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MarkupTagConfig=void 0;const o=r(742),i=r(7200);class n extends i.AbstractTagConfig{constructor(e,t,r,i,n,a){super(o.BitTagType.tag,e,t,r,i,n,void 0,void 0,a),this.type=o.BitTagType.tag}toString(e){const t=Object.assign({},e);let r=`TAG[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const o of Object.values(this.chain))e||(r+=" "),r+=`${o.toString(t)}`,e=!1}return r}}t.MarkupTagConfig=n},6956:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyTagConfig=void 0;const o=r(742),i=r(7200);class n extends i.AbstractTagConfig{constructor(e,t,r,i,n,a,s,l,u,c,p){super(o.BitTagType.property,e,t,r,i,n,a,s,p),this.type=o.BitTagType.property,this.single=l,this.format=u,this.defaultValue=c}toString(e){const t=Object.assign({},e);let r=`PTY[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`),null!=this.single&&(r+=`, sgl=${this.single}`),null!=this.format&&(r+=`, fmt=${this.format}`),null!=this.defaultValue&&(r+=`, def=${this.defaultValue}`),null!=this.jsonKey&&(r+=`, json=${this.jsonKey}`),null!=this.astKey&&(r+=`, ast=${this.astKey}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const o of Object.values(this.chain))e||(r+=" "),r+=`${o.toString(t)}`,e=!1}return r}}t.PropertyTagConfig=n},7585:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceTagConfig=void 0;const o=r(742),i=r(7200);class n extends i.AbstractTagConfig{constructor(e,t,r,i,n,a,s){super(o.BitTagType.resource,e,t,r,i,n,a,void 0,s),this.type=o.BitTagType.resource}toString(e){const t=Object.assign({},e);let r=`RES[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`),null!=this.jsonKey&&(r+=`, json=${this.jsonKey}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const o of Object.values(this.chain))e||(r+=" "),r+=`${o.toString(t)}`,e=!1}return r}}t.ResourceTagConfig=n},3059:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourcesConfig=void 0;t.ResourcesConfig=class{constructor(e,t,r,o){this.tags=e,this.resourceAttachmentAllowed=null!=t&&t,this.resourceTypeAttachment=r,this.comboResourceTagTypesMap=o}getCountsMin(){const e=new Map;for(const t of Object.values(this.tags))null!=t.minCount&&e.set(t.tag,t.minCount);return e}getCountsMax(){const e=new Map;for(const t of Object.values(this.tags))null!=t.maxCount&&e.set(t.tag,t.maxCount);return e}}},2574:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetConfigKey=void 0;const o=(0,r(6688).superenum)({_flashcards:"_flashcards",_elements:"_elements",_statements:"_statements",_quiz:"_quiz",_questions:"_questions",_matchPairs:"_matchPairs",_matchAudioPairs:"_matchAudioPairs",_matchImagePairs:"_matchImagePairs",_matchMatrix:"_matchMatrix",_botActionResponses:"_botActionResponses",_exampleBitList:"_exampleBitList",_clozeList:"_clozeList"});t.CardSetConfigKey=o},8620:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigKey=void 0;const o=r(6688),i=r(177),n=r(3518),a=r(6194),s=r(1595),l=(0,o.superenum)(Object.assign(Object.assign(Object.assign(Object.assign({_unknown:"_unknown"},s.tagConfigKeys),n.propertyConfigKeys),a.resourceConfigKeys),i.groupConfigKeys));t.ConfigKey=l,function(){const e=new Set,t=[s.tagConfigKeys,n.propertyConfigKeys,a.resourceConfigKeys,i.groupConfigKeys];for(const r of t)for(const t in r){if(e.has(t))throw new Error(`Duplicate ConfigKey: ${t}`);e.add(t)}}()},177:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.groupConfigKeys=t.GroupConfigKey=void 0;const o=r(6688),i={group_standardAllBits:"group_standardAllBits",group_standardItemLeadInstructionHint:"group_standardItemLeadInstructionHint",group_standardExample:"group_standardExample",group_standardTags:"group_standardTags",group_imageSource:"group_imageSource",group_partner:"group_partner",group_gap:"group_gap",group_trueFalse:"group_trueFalse",group_markConfig:"group_markConfig",group_mark:"group_mark",group_bookCommon:"group_bookCommon",group_learningPathCommon:"group_learningPathCommon",group_resourceCommon:"group_resourceCommon",group_resourceImageCommon:"group_resourceImageCommon",group_resourceAudioCommon:"group_resourceAudioCommon",group_resourceVideoCommon:"group_resourceVideoCommon",group_resourceImage:"group_resourceImage",group_resourceImageEmbed:"group_resourceImageEmbed",group_resourceImageLink:"group_resourceImageLink",group_resourceImageResponsive:"group_resourceImageResponsive",group_resourceImagePortrait:"group_resourceImagePortrait",group_resourceImageLandscape:"group_resourceImageLandscape",group_resourceAudio:"group_resourceAudio",group_resourceAudioEmbed:"group_resourceAudioEmbed",group_resourceAudioLink:"group_resourceAudioLink",group_resourceVideo:"group_resourceVideo",group_resourceVideoEmbed:"group_resourceVideoEmbed",group_resourceVideoLink:"group_resourceVideoLink",group_resourceStillImageFilm:"group_resourceStillImageFilm",group_resourceStillImageFilmEmbed:"group_resourceStillImageFilmEmbed",group_resourceStillImageFilmLink:"group_resourceStillImageFilmLink",group_resourceArticle:"group_resourceArticle",group_resourceArticleEmbed:"group_resourceArticleEmbed",group_resourceArticleLink:"group_resourceArticleLink",group_resourceDocument:"group_resourceDocument",group_resourceDocumentEmbed:"group_resourceDocumentEmbed",group_resourceDocumentLink:"group_resourceDocumentLink",group_resourceDocumentDownload:"group_resourceDocumentDownload",group_resourceAppLink:"group_resourceAppLink",group_resourceWebsiteLink:"group_resourceWebsiteLink"};t.groupConfigKeys=i;const n=(0,o.superenum)(i);t.GroupConfigKey=n},5428:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GroupConfigType=void 0;const o=(0,r(6688).superenum)({standard:"standard",resource:"resource",comboResource:"comboResource"});t.GroupConfigType=o},3518:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propertyConfigKeys=t.PropertyConfigKey=void 0;const o=r(6688),i={action:"action",ageRange:"ageRange",aiGenerated:"aiGenerated",allowSubtitles:"allowSubtitles",alt:"alt",author:"author",autoplay:"autoplay",book:"book",bookAlias:"bookAlias",bot:"bot",caption:"caption",isCaseSensitive:"isCaseSensitive",color:"color",colorTag:"colorTag",computerLanguage:"computerLanguage",content2Buy:"content2Buy",copyright:"copyright",coverImage:"coverImage",date:"date",deeplink:"deeplink",duration:"duration",emphasis:"emphasis",example:"example",externalId:"externalId",externalLink:"externalLink",externalLinkText:"externalLinkText",flashcardSet:"flashcardSet",focusX:"focusX",focusY:"focusY",format:"format",height:"height",icon:"icon",iconTag:"iconTag",id:"id",imageSource:"imageSource",internalComment:"internalComment",isInfoOnly:"isInfoOnly",isTracked:"isTracked",jupyterExecutionCount:"jupyterExecutionCount",jupyterId:"jupyterId",kind:"kind",labelFalse:"labelFalse",labelTrue:"labelTrue",lang:"lang",language:"language",license:"license",list:"list",location:"location",markConfig:"markConfig",maxCreatedBits:"maxCreatedBits",mockupId:"mockupId",mute:"mute",padletId:"padletId",partialAnswer:"partialAnswer",partner:"partner",posterImage:"posterImage",progress:"progress",property_mark:"property_mark",property_reference:"property_reference",property_sampleSolution:"property_sampleSolution",publications:"publications",publisher:"publisher",quotedPerson:"quotedPerson",reaction:"reaction",reasonableNumOfChars:"reasonableNumOfChars",releaseVersion:"releaseVersion",resolved:"resolved",resolvedDate:"resolvedDate",resolvedBy:"resolvedBy",showInIndex:"showInIndex",showSubtitles:"showSubtitles",siteName:"siteName",size:"size",spaceId:"spaceId",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",subject:"subject",subtype:"subtype",tag:"tag",target:"target",textReference:"textReference",theme:"theme",thumbImage:"thumbImage",toc:"toc",trim:"trim",videoCallLink:"videoCallLink",width:"width",zoomDisabled:"zoomDisabled"};t.propertyConfigKeys=i;const n=(0,o.superenum)(i);t.PropertyConfigKey=n},6194:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resourceConfigKeys=t.ResourceConfigKey=void 0;const o=r(6688),i={image:"image",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",imageEmbed:"imageEmbed",imageLink:"imageLink",audio:"audio",audioEmbed:"audioEmbed",audioLink:"audioLink",video:"video",videoEmbed:"videoEmbed",videoLink:"videoLink",stillImageFilmEmbed:"stillImageFilmEmbed",stillImageFilmLink:"stillImageFilmLink",article:"article",articleEmbed:"articleEmbed",articleLink:"articleLink",document:"document",documentEmbed:"documentEmbed",documentLink:"documentLink",documentDownload:"documentDownload",appLink:"appLink",websiteLink:"websiteLink"};t.resourceConfigKeys=i;const n=(0,o.superenum)(i);t.ResourceConfigKey=n},1595:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tagConfigKeys=t.TagConfigKey=void 0;const o=r(6688),i={title:"title",anchor:"anchor",tag_reference:"tag_reference",property:"property",itemLead:"itemLead",instruction:"instruction",hint:"hint",true:"true",false:"false",sampleSolution:"sampleSolution",gap:"gap",tag_mark:"tag_mark",resource:"resource"};t.tagConfigKeys=i;const n=(0,o.superenum)(i);t.TagConfigKey=n},742:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitTagType=void 0;const o=(0,r(6688).superenum)({tag:"tag",property:"property",resource:"resource",group:"group"});t.BitTagType=o},208:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AliasBitType=t.RootBitType=void 0;const o=r(6688),i=(0,o.superenum)({_error:"_error",_comment:"_comment",appBitmarkFromJavascript:"app-bitmark-from-javascript",appFlashcards:"app-flashcards",appLink:"app-link",article:"article",articleEmbed:"article-embed",articleLink:"article-link",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",bitAlias:"bit-alias",book:"book",bookAlias:"book-alias",botActionResponse:"bot-action-response",botActionSend:"bot-action-send",browserImage:"browser-image",card1:"card-1",chapter:"chapter",cloze:"cloze",clozeAndMultipleChoiceText:"cloze-and-multiple-choice-text",clozeList:"cloze-list",code:"code",conversationLeft1:"conversation-left-1",document:"document",documentDownload:"document-download",documentEmbed:"document-embed",documentLink:"document-link",essay:"essay",example:"example",exampleList:"example-list",flashcard:"flashcard",focusImage:"focus-image",highlightText:"highlight-text",image:"image",imageLink:"image-link",imageOnDevice:"image-on-device",imageResponsive:"image-responsive",internalLink:"internal-link",interview:"interview",learningPathBook:"learning-path-book",learningPathBotTraining:"learning-path-bot-training",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",page:"page",pageBuyButton:"page-buy-button",photo:"photo",quote:"quote",rating:"rating",releaseNote:"release-note",sampleSolution:"sample-solution",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",reviewNote:"review-note",vendorPadletEmbed:"vendor-padlet-embed",vendorJupyterOutput:"vendor-jupyter-output",video:"video",videoEmbed:"video-embed",videoLink:"video-link",websiteLink:"website-link"});t.RootBitType=i;const n=(0,o.superenum)({aiPrompt:"ai-prompt",anchor:"anchor",appAiPrompt:"app-ai-prompt",appBitmarkFromEditor:"app-bitmark-from-editor",appCodeCell:"app-code-cell",appCodeEditor:"app-code-editor",appCodeIde:"app-code-ide",appCreateBitsFromImage:"app-create-bits-from-image",appFlashcardsLearn:"app-flashcards-learn",appFlashcardsQuiz:"app-flashcards-quiz",appGetScreenshot:"app-get-screenshot",articleAi:"article-ai",articleAttachment:"article-attachment",assignment:"assignment",assignmentList:"assignment-list",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",bookLink:"book-link",bookLinkNext:"book-link-next",bookLinkPrev:"book-link-prev",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",buttonCopyText:"button-copy-text",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",codeRuntime:"code-runtime",conclusion:"conclusion",consoleLog:"console-log",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",detailsImage:"details-image",documentUpload:"document-upload",editorial:"editorial",editorNote:"editor-note",featured:"featured",figure:"figure",flashcard1:"flashcard-1",footNote:"foot-note",groupBorn:"group-born",groupDied:"group-died",help:"help",hint:"hint",imageBanner:"image-banner",imageFigure:"image-figure",imageLandscape:"image-landscape",imageMood:"image-mood",imagePortrait:"image-portrait",imagePrototype:"image-prototype",imageScreenshot:"image-screenshot",imageSeparator:"image-separator",imageStyled:"image-styled",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",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",lifeSkillSticker:"life-skill-sticker",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",output:"output",pageBanner:"page-banner",pageFooter:"page-footer",preparationNote:"preparation-note",question1:"question-1",recordAudio:"record-audio",releaseNotesSummary:"release-notes-summary",remark:"remark",reviewApprovedNote:"review-approved-note",reviewAuthorNote:"review-author-note",reviewRequestForReviewNote:"review-request-for-review-note",reviewReviewerNote:"review-reviewer-note",screenshot:"screenshot",selfAssessment:"self-assessment",separator:"separator",sideNote:"side-note",statement:"statement",stdout:"stdout",stickyNote:"sticky-note",summary:"summary",summaryAi:"summary-ai",survey1:"survey-1",surveyAnonymous1:"survey-anonymous-1",takePicture:"take-picture",vendorJupyterCellCode:"vendor-jupyter-cell-code",vendorJupyterCellMarkdown:"vendor-jupyter-cell-markdown",vendorJupyterCellRaw:"vendor-jupyter-cell-raw",vendorJupyterIpynb:"vendor-jupyter-ipynb",videoLandscape:"video-landscape",videoPortrait:"video-portrait",videoEmbedLandscape:"video-embed-landscape",videoEmbedPortrait:"video-embed-portrait",videoLinkLandscape:"video-link-landscape",videoLinkPortrait:"video-link-portrait",videoTranscript:"video-transcript",warning:"warning",workbookArticle:"workbook-article"});t.AliasBitType=n},6958:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParserType=void 0;const o=(0,r(6688).superenum)({peggy:"peggy"});t.BitmarkParserType=o},8791:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_BITMARK_VERSION=t.BitmarkVersion=void 0;const o=(0,r(6688).superenum)({v2:2,v3:3});t.BitmarkVersion=o;const i=o.v3;t.DEFAULT_BITMARK_VERSION=i},1060:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BodyBitType=void 0;const o=(0,r(6688).superenum)({text:"text",gap:"gap",mark:"mark",select:"select",highlight:"highlight"});t.BodyBitType=o},8565:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetVersion=void 0;const o=(0,r(6688).superenum)({v1:1,v2:2});t.CardSetVersion=o},1035:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Count=void 0;const o=(0,r(6688).superenum)({infinity:"infinity"});t.Count=o},7028:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExampleType=void 0;const o=(0,r(6688).superenum)({none:"none",string:"string",boolean:"boolean"});t.ExampleType=o},7204:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyAstKey=void 0;const o=(0,r(6688).superenum)({aiGenerated:"aiGenerated",isCaseSensitive:"isCaseSensitive",referenceProperty:"referenceProperty",markConfig:"markConfig"});t.PropertyAstKey=o},5486:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyFormat=void 0;const o=(0,r(6688).superenum)({none:"none",string:"string",trimmedString:"trimmedString",number:"number",boolean:"boolean",invertedBoolean:"invertedBoolean"});t.PropertyFormat=o},7953:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyTag=void 0;const o=(0,r(6688).superenum)({action:"action",ageRange:"ageRange",aiGenerated:"AIGenerated",allowSubtitles:"allowSubtitles",alt:"alt",author:"author",autoplay:"autoplay",book:"book",bookAlias:"bookAlias",bot:"bot",caption:"caption",isCaseSensitive:"isCaseSensitive",color:"color",colorTag:"colorTag",computerLanguage:"computerLanguage",content2Buy:"content2Buy",copyright:"copyright",coverImage:"coverImage",date:"date",deeplink:"deeplink",duration:"duration",emphasis:"emphasis",example:"example",externalId:"externalId",externalLink:"externalLink",externalLinkText:"externalLinkText",flashcardSet:"flashcardSet",focusX:"focusX",focusY:"focusY",format:"format",height:"height",icon:"icon",iconTag:"iconTag",id:"id",imageSource:"imageSource",internalComment:"internalComment",isInfoOnly:"isInfoOnly",isTracked:"isTracked",jupyterExecutionCount:"jupyterExecutionCount",jupyterId:"jupyterId",kind:"kind",labelFalse:"labelFalse",labelTrue:"labelTrue",lang:"lang",language:"language",license:"license",list:"list",location:"location",mark:"mark",maxCreatedBits:"maxCreatedBits",mockupId:"mockupId",mute:"mute",padletId:"padletId",partialAnswer:"partialAnswer",partner:"partner",posterImage:"posterImage",progress:"progress",publications:"publications",publisher:"publisher",quotedPerson:"quotedPerson",reaction:"reaction",reasonableNumOfChars:"reasonableNumOfChars",reference:"reference",releaseVersion:"releaseVersion",resolved:"resolved",resolvedDate:"resolvedDate",resolvedBy:"resolvedBy",sampleSolution:"sampleSolution",showInIndex:"showInIndex",showSubtitles:"showSubtitles",siteName:"siteName",size:"size",spaceId:"spaceId",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",subject:"subject",subtype:"subtype",tag:"tag",target:"target",textReference:"textReference",theme:"theme",thumbImage:"thumbImage",toc:"toc",trim:"trim",videoCallLink:"videoCallLink",width:"width",zoomDisabled:"zoomDisabled"});t.PropertyTag=o},9431:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceJsonKey=void 0;const o=(0,r(6688).superenum)({imageResponsive:"imageResponsive",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",imageEmbed:"imageEmbed",imageLink:"imageLink",audioEmbed:"audioEmbed",audioLink:"audioLink",videoEmbed:"videoEmbed",videoLink:"videoLink",stillImageFilm:"stillImageFilm",stillImageFilmEmbed:"stillImageFilmEmbed",stillImageFilmLink:"stillImageFilmLink",articleEmbed:"articleEmbed",articleLink:"articleLink",documentEmbed:"documentEmbed",documentLink:"documentLink",documentDownload:"documentDownload",appLink:"appLink",websiteLink:"websiteLink"});t.ResourceJsonKey=o},9779:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceTag=void 0;const o=(0,r(6688).superenum)({unknown:"unknown",image:"image",imageResponsive:"image-responsive",imagePortrait:"image-portrait",imageLandscape:"image-landscape",imageEmbed:"image-embed",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:"article-embed",articleLink:"article-link",document:"document",documentEmbed:"document-embed",documentLink:"document-link",documentDownload:"document-download",appLink:"app-link",websiteLink:"website-link"});t.ResourceTag=o},8739:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const o=(0,r(6688).superenum)({title:"#",anchor:"▼",reference:"►",property:"@",itemLead:"%",instruction:"!",hint:"?",true:"+",false:"-",sampleSolution:"$",gap:"_",mark:"=",resource:"&"});t.Tag=o},1353:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextFormat=void 0;const o=(0,r(6688).superenum)({text:"text",bitmarkMinusMinus:"bitmark--",bitmarkPlusPlus:"bitmark++"});t.TextFormat=o},1888:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextMarkType=void 0;const o=(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=o},2610:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextNodeType=void 0;const o=(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",mark:"mark"});t.TextNodeType=o},8681:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoFormat=void 0;const o=(0,r(6688).superenum)({text:"text",json:"json",pojo:"pojo"});t.InfoFormat=o},7347:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoType=void 0;const o=(0,r(6688).superenum)({list:"list",deprecated:"deprecated",all:"all",bit:"bit"});t.InfoType=o},9556:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParser=void 0;const o=r(2434),i=r(8030);t.BitmarkParser=class{constructor(){this.jsonParser=new o.JsonParser}toAst(e,t){return(0,i.parse)(e)}}},8030:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const o=r(4369).parse;t.parse=o},2892:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserHelper=void 0;const o=r(8565),i=r(3633),n=r(7542),a=r(6831);r(2606);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 i=null!==(r=null===(t=this.parserLocation())||void 0===t?void 0:t.start)&&void 0!==r?r:{line:1,column:1,offset:0},a=this.parse(e,{startRule:"bit",grammarSource:new n.PeggyGrammarLocation("bit",i)});return a.value&&(a.value.markup=o),a}handleTextFormat(e){return{type:a.TypeKey.TextFormat,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceType(e){return{type:a.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:a.TypeKey.Property,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceTag(e,t){return{type:a.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:[]},o={cards:[]};if(t){const e={text:this.parserText(),location:this.parserLocation()};for(const e of t){if(!e)continue;const{type:t,value:o,parser:i}=e;if(!t||t!==a.TypeKey.Card)continue;const{cardIndex:n,cardSideIndex:s,cardVariantIndex:l,value:u}=o;let c=r.cards[n];c||(c={sides:[]},r.cards[n]=c);let p=c.sides[s];p||(p={variants:[]},c.sides[s]=p);p.variants[l]?p.variants[l].value+=u:p.variants[l]={value:u,parser:i}}r.cards=r.cards.filter((e=>e.sides.some((e=>e.variants.some((e=>0!==i.StringUtils.trimmedString(e.value).length))))));for(const t of r.cards){const r={sides:[]};o.cards.push(r);for(const o of t.sides){const t={variants:[]};r.sides.push(t);for(const r of o.variants){let o={line:1,column:1,offset:0};if(r.parser.location){o=r.parser.location.start;const e=r.parser.text,t=e?e.length:0,i=1;o.offset+=t,o.line+=i}let i=this.parse(r.value,{startRule:"cardContent",grammarSource:new n.PeggyGrammarLocation("card-content",o)});i=this.reduceToArrayOfTypes(i),this.debugPrint("parsedCardContent",i),t.variants.push({parser:e,content:i})}}}}return{type:a.TypeKey.CardSet,value:o,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,n=!1;return Array.isArray(e)&&2===e.length&&(e=e[0],t===o.CardSetVersion.v1?(r=e===a.CARD_DIVIDER_V1,i=e===a.CARD_SIDE_DIVIDER_V1,n=e===a.CARD_VARIANT_DIVIDER_V1):(r=e===a.CARD_DIVIDER_V2,i=e===a.CARD_SIDE_DIVIDER_V2,n=e===a.CARD_VARIANT_DIVIDER_V2)),r?(this.cardIndex++,this.cardSideIndex=0,this.cardVariantIndex=0):i?(this.cardSideIndex++,this.cardVariantIndex=0):n&&this.cardVariantIndex++,this.isType(e,a.TypeKey.Card)?e:{type:a.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:""},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardLine(e){return{type:a.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,o,i,n,s;const l=[];let u,c;for(const p of e)switch(p.type){case a.TypeKey.BodyChar:if(u){const e=`${null!==(t=u.value)&&void 0!==t?t:""}${null!==(r=p.value)&&void 0!==r?r:""}`;u.value=e}else u={type:a.TypeKey.BodyText,value:null!==(o=p.value)&&void 0!==o?o:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;case a.TypeKey.CardChar:if(c){const e=`${null!==(i=c.value)&&void 0!==i?i:""}${null!==(n=p.value)&&void 0!==n?n:""}`;c.value=e}else c={type:a.TypeKey.CardText,value:null!==(s=p.value)&&void 0!==s?s:"",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(p)}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:!!a.TypeKey.fromValue(r)}reduceToArrayOfTypes(e,t,r){if(!Array.isArray(e))return[];return e.reduce(((e,o,i)=>{if(null==o)return e;const{type:n,value:a}=o;if(Array.isArray(o)){const r=this.reduceToArrayOfTypes(o,t);e.push(...r)}else{if(!this.isType(o,t))return e;if(r&&Array.isArray(a)){const r=this.reduceToArrayOfTypes(a,t);e.push(...r)}else n&&e.push(o)}return e}),[])}debugPrint(e,t){}}},7448:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserProcessor=void 0;const i=r(9046),n=r(8159),a=r(2606),s=r(208),l=r(1060),u=r(9779),c=r(1353),p=r(3633),g=r(8386),d=r(1182),y=r(8081),f=r(9577),h=r(2786),m=r(857),T=r(3287),b=r(3130),v=r(5516),C=r(1838),k=r(4177),B=r(6831),x=new i.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),state:{}}}buildBits(e){var t;const r=[];let o=[];for(const i of e){if(!i)continue;const e=i.value;e?r.push(e):o=o.concat(null!==(t=i.errors)&&void 0!==t?t:[])}return x.bitmark({bits:r,errors:o.length>0?o:void 0})}buildBit(e,t){var r;const{bitType:i,textFormat:n,resourceType:l}=e;if(!i||i.root===s.RootBitType._error)return this.invalidBit();if(i.root===s.RootBitType._comment)return this.commentBit();const u=i.root===s.RootBitType.trueFalse1,c=i.root===s.RootBitType.multipleChoice1,p=i.root===s.RootBitType.multipleResponse1;this.debugPrint("BIT CONTENT",t),this.resetParserState(),t=g.BitmarkPegParserValidator.validateBitTags(this.context,i,l,t);const y=a.Config.getBitConfig(i),f=this.bitContentProcessor(i,B.BitContentLevel.Bit,y.tags,t),{body:h,footer:m,cardSet:T,title:b,statement:k,statements:A,choices:P,responses:w,resources:S,comments:K}=f,_=o(f,["body","footer","cardSet","title","statement","statements","choices","responses","resources","comments"]);this.debugPrint("BIT TAGS",_),this.debugPrint("BIT BODY",h),this.debugPrint("BIT FOOTER",m);const R=(0,C.buildTitles)(this.context,i,b),I=(0,d.buildCards)(this.context,i,T,k,A,P,w),E=(0,v.buildResources)(this.context,i,l,S),O=[...null!=K?K:[],...null!==(r=I.comments)&&void 0!==r?r:[]],L=this.buildBitLevelWarnings(),j=this.buildBitLevelErrors();L&&(this.parser.warnings=L),j&&(this.parser.errors=j);return{value:x.bit(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({bitType:i,textFormat:n,resourceType:l},R),{statement:u?k:void 0,choices:c?P:void 0,responses:p?w:void 0}),_),{resources:E}),I),{body:h,footer:m,internalComment:O,parser:this.parser}))}}invalidBit(e){e&&this.addError("Invalid bit"),this.parser.errors=this.buildBitLevelErrors();return{value:x.bit({bitType:a.Config.getBitType(s.RootBitType._error),parser:this.parser})}}commentBit(){this.parser.errors=this.buildBitLevelErrors();return{value:x.bit({bitType:a.Config.getBitType(s.RootBitType._comment),parser:this.parser})}}buildBitHeader(e,t){const r=a.Config.getBitType(e);r.root===s.RootBitType._error?this.addError(`Invalid bit type: '${e}'`):r.root===s.RootBitType._comment&&(this.parser.commentedBitType=`[.${e.slice(1)}]`);const o=a.Config.getBitConfig(r);let i=c.TextFormat.fromValue(t.textFormat);t.textFormat&&!i&&this.addWarning(`Invalid text format '${t.textFormat}', defaulting to '${o.textFormatDefault}'`),i=null!=i?i:o.textFormatDefault;const n=u.ResourceTag.fromValue(t.resourceType);return t.resourceType&&!n&&this.addWarning(`Invalid resource type '${t.resourceType}', it will be ignored`),{bitType:r,textFormat:null!=i?i:o.textFormatDefault,resourceType:n}}buildTextAndResourceType(e,t){const r={},o=e=>{e&&(e.type===B.TypeKey.TextFormat?r.textFormat=p.StringUtils.string(e.value):r.resourceType=p.StringUtils.string(e.value))};return o(e),o(t),r}resetParserState(){this.context.state={}}bitContentProcessor(e,t,r,o){const i={};if(!o)return i;i.title=[],i.solutions=[],i.statements=[],i.choices=[],i.responses=[],i.resources=[],i.trueFalse=[],i.markConfig=[],i.extraProperties={},i.comments=[];let a=!1,s=!1,l=!1;const u=[];let c=n.Breakscape.EMPTY_STRING,p=n.Breakscape.EMPTY_STRING;const d=t===B.BitContentLevel.Bit,A=t===B.BitContentLevel.Card,P=t===B.BitContentLevel.Chain,w=()=>{if(c){c=g.BitmarkPegParserValidator.checkBodyPart(this.context,e,t,c);const r=x.bodyText({text:c});u.push(r)}c=n.Breakscape.EMPTY_STRING};return o.forEach(((o,g)=>{const{type:d,value:x}=o;switch(d){case B.TypeKey.ItemLead:(0,h.itemLeadTagContentProcessor)(this.context,e,t,r,o,i,a),a=!0;break;case B.TypeKey.Instruction:case B.TypeKey.Hint:case B.TypeKey.Anchor:case B.TypeKey.SampleSolution:(0,y.defaultTagContentProcessor)(this.context,e,t,r,o,i);break;case B.TypeKey.Reference:(0,b.referenceTagContentProcessor)(this.context,e,t,r,o,i,s),s=!0;break;case B.TypeKey.Title:(0,C.titleTagContentProcessor)(this.context,e,t,r,o,i);break;case B.TypeKey.Property:(0,T.propertyContentProcessor)(this.context,e,t,r,o,i);break;case B.TypeKey.Gap:P||w(),(0,f.gapChainContentProcessor)(this.context,e,t,r,o,i,u);break;case B.TypeKey.Mark:P||w(),(0,m.markChainContentProcessor)(this.context,e,t,r,o,i,u);break;case B.TypeKey.True:case B.TypeKey.False:P||w(),(0,k.trueFalseChainContentProcessor)(this.context,e,t,r,o,i,u);break;case B.TypeKey.Resource:(0,v.resourceContentProcessor)(this.context,e,t,r,o,i);break;case B.TypeKey.CardSet:i.cardSet=x,l=!0;break;case B.TypeKey.BodyText:case B.TypeKey.CardText:l?p=n.Breakscape.concatenate(p,x):c=n.Breakscape.concatenate(c,x)}})),w(),d?(i.body=u.length>0?x.body({bodyParts:this.trimBodyParts(u)}):void 0,g.BitmarkPegParserValidator.checkBody(this.context,e,t,i.body)):A&&(i.cardBody=u.length>0?x.body({bodyParts:this.trimBodyParts(u)}):void 0),p=p.trim(),p&&(p=g.BitmarkPegParserValidator.checkFooter(this.context,e,t,p),p&&(i.footer=x.footerText({text:p}))),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 o=[];for(const i of e)t.includes(i.type)&&(o.length>0&&r.push(o),o=[]),o.push(i);return o.length>0&&r.push(o),r}trimBodyParts(e){let t=!1,r=e.reduce(((e,r)=>{const o=r;if(t||o.type!==l.BodyBitType.text)t=!0,e.push(r);else{const r=o.data.bodyText.trimStart();r&&(t=!0,o.data.bodyText=r,e.push(o))}return e}),[]);return t=!1,r=r.reduceRight(((e,r)=>{const o=r;if(t||o.type!==l.BodyBitType.text)t=!0,e.unshift(r);else{const r=o.data.bodyText.trimEnd();r&&(t=!0,o.data.bodyText=r,e.unshift(o))}return e}),[]),r}addWarning(e,t,r){var o,i,n;const a={message:e,text:null!==(o=null==t?void 0:t.parser.text)&&void 0!==o?o:this.parserText(),location:null!==(i=null==t?void 0:t.parser.location)&&void 0!==i?i:this.parserLocation(),original:null!==(n=null==r?void 0:r.parser)&&void 0!==n?n:void 0};a.original||delete a.original,this.nonFatalWarnings.push(a)}addError(e,t,r){var o,i,n;const a={message:e,text:null!==(o=null==t?void 0:t.parser.text)&&void 0!==o?o:this.parserText(),location:null!==(i=null==t?void 0:t.parser.location)&&void 0!==i?i:this.parserLocation(),original:null!==(n=null==r?void 0:r.parser)&&void 0!==n?n:void 0};a.original||delete a.original,this.nonFatalErrors.push(a)}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 o=r(6688),i=r(8739);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 n=(0,o.superenum)({TextFormat:"TextFormat",ResourceType:"ResourceType",Title:i.Tag.title,Anchor:i.Tag.anchor,Reference:i.Tag.reference,ItemLead:i.Tag.itemLead,Instruction:i.Tag.instruction,Hint:i.Tag.hint,True:i.Tag.true,False:i.Tag.false,Gap:i.Tag.gap,Mark:i.Tag.mark,SampleSolution:i.Tag.sampleSolution,Property:"Property",Resource:"Resource",TagChain:"TagChain",BodyChar:"BodyChar",BodyText:"BodyText",CardSet:"CardSet",Card:"Card",CardChar:"CardChar",CardText:"CardText",GapChain:"GapChain",TrueFalseChain:"TrueFalseChain"});t.TypeKey=n;const a=(0,o.superenum)({Bit:"Bit",Card:"Card",Chain:"Chain"});t.BitContentLevel=a},8386:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserValidator=void 0;const o=r(2606),i=r(742),n=r(1035),a=r(7953),s=r(8739),l=r(6831),u=["====","----","\n==\n","\n---\n","\n--\n",":::","::::","|||","||||"],c=["==\n","---\n","--\n"],p=["\n==","\n---","\n--"];const g=new class{validateBitTags(e,t,r,i){if(!i)return[];const n=o.Config.getBitConfig(t),{tags:a,cardSet:s}=n,u=o.Config.getBitResourcesConfig(t,r),c=Object.assign(Object.assign({},a),u.tags);return this.validateTagChainsRecursive(e,t,l.BitContentLevel.Bit,i,c,s)}checkBody(e,t,r,i){if(!i)return i;const n=o.Config.getBitConfig(t),{bodyAllowed:a}=n;return i.bodyParts.length>0&&!a&&e.addWarning(`Bit '${t.alias}' should not have a body.`),i}checkBodyPart(e,t,r,o){return o?(this.checkBodyForCommonPotentialMistakes(e,r,t,o),o):o}checkFooter(e,t,r,i){if(!i)return i;const n=o.Config.getBitConfig(t),{footerAllowed:a}=n;return this.checkBodyForCommonPotentialMistakes(e,r,t,i),a||e.addWarning(`Bit '${t.alias}' should not have a footer.`),i}checkCardBody(e,t,r,i,n,a,s){if(!i)return i;const l=o.Config.getBitConfig(t);if(!l.cardSet)return i;const u=this.getVariantConfig(l.cardSet.variants,a,s);if(!u)return i;const{bodyAllowed:c}=u;return i.bodyParts.length>0&&!c&&e.addWarning(`Bit '${t.alias}' should not have a card body at card:${n+1}, side:${a+1}, variant:${s+1}.`),i}validateTagChainsRecursive(e,t,r,o,u,c){if(!o)return[];const p=[...o],g=this.convertTagsToTypeKeyMap(e,r,t,u),d=(e,t,r)=>{g.set(e,{maxCount:t,minCount:r,_type:e,_tag:e,_seenCount:0})};var y,f,h;y=a.PropertyTag.internalComment,f=n.Count.infinity,h=0,g.set(`${l.TypeKey.Property}:${y}`,{maxCount:f,minCount:h,_type:i.BitTagType.property,_tag:s.Tag.property,_seenCount:0}),r===l.BitContentLevel.Bit?(c&&d(l.TypeKey.CardSet,1,0),d(l.TypeKey.TextFormat,1,0),d(l.TypeKey.BodyText,n.Count.infinity,0)):r===l.BitContentLevel.Card&&d(l.TypeKey.CardText,n.Count.infinity,0);for(let o=0;o<p.length;o++){const i=p[o];if(!i)continue;const{type:n,key:a}=i,s=l.TypeKey.fromValue(n);if(!s)continue;let u=s;s!==l.TypeKey.Property&&s!==l.TypeKey.Resource||(u=`${s}:${a}`);const d=g.get(u),y=this.validateSingleTag(e,t,r,i,s,d,c);if(y||p.splice(o,1,null),y&&Array.isArray(y.chain)&&y.chain.length>0)if(d&&d.chain){const r=this.validateTagChainsRecursive(e,t,l.BitContentLevel.Chain,y.chain,d.chain);r&&r.length>0?y.chain=r:y.chain=void 0}else y.type!==l.TypeKey.Resource&&(p.splice(o+1,0,...y.chain),y.chain=void 0)}for(const t of g.values()){const{minCount:r,_seenCount:o}=t;if(null!=r&&o<r){const o=`${this.getTagSignature(t)} is required at least ${r} time(s)`;e.addWarning(o)}}return p.filter((e=>null!=e))}validateSingleTag(e,t,r,o,i,n,a){const{type:s,key:u}=o,c=n?this.getTagSignature(n):this.getUnknownTagSignature(s,u),p=" It will be ignored";let g,d,y="";if(n)switch(n._seenCount++,i){case l.TypeKey.Property:{const{content:i,warning:a}=this.validatePropertyTag(e,r,t,n,o);g=i,d=a;break}case l.TypeKey.Resource:{const{content:i,warning:a}=this.validateResourceTag(e,r,t,n,o);g=i,d=a;break}case l.TypeKey.CardSet:{const{content:r,warning:i}=this.validateCardSet(e,t,n,o,a);g=r,d=i;break}default:{const{content:i,warning:a}=this.validateStandardTag(e,r,t,n,o);g=i,d=a}}else switch(i){case l.TypeKey.Property:d={extraProperty:!0},g=o;break;case l.TypeKey.Resource:d={excessResource:!0},g=o;break;default:d={invalid:!0}}if(d){const t=null==n?void 0:n._previous;d.invalid||d.excessResource?y=`${c} is not valid here.${p}`:null!=d.tooMany?(y=`${c} is included more than ${d.tooMany} time(s).`,d.tooMany>0&&(y+=" The earlier ones will be ignored")):d.extraProperty?y=`${c} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`:d.unexpectedCardSet?y=`${c} is not expected here.${p}`:d.unexpectedCardSideVariant&&(y=`${c} has a card / side / variant that is not expected here.${p}`),e.addWarning(y,o,t)}return n&&(n._previous=o),g}validateStandardTag(e,t,r,o,i){const a=null==o.maxCount?1:o.maxCount;return a!==n.Count.infinity&&o._seenCount>a?{warning:{tooMany:a},content:i}:{content:i}}validatePropertyTag(e,t,r,o,i){const a=null==o.maxCount?1:o.maxCount;return a!==n.Count.infinity&&o._seenCount>a?{warning:{tooMany:a},content:i}:{content:i}}validateResourceTag(e,t,r,o,i){const a=null==o.maxCount?1:o.maxCount;return a!==n.Count.infinity&&o._seenCount>a?{warning:{tooMany:a},content:i}:{content:i}}validateCardSet(e,t,r,o,i){if(!i||!i.variants||0===i.variants.length)return{warning:{unexpectedCardSet:!0}};const{value:n}=o,a=n;let s,u=0,c=0;for(const r of a.cards){u=0;for(const o of r.sides){c=0;for(const r of o.variants){const n=r.content;let a;const p=this.getVariantConfig(i.variants,u,c);p?a=this.validateTagChainsRecursive(e,t,l.BitContentLevel.Card,n,p.tags):s={unexpectedCardSideVariant:!0},a&&a.length>0?o.variants[c]={parser:r.parser,content:a}:o.variants[c]={parser:r.parser,content:[]},c++}u++}}return{content:o,warning:s}}checkBodyForCommonPotentialMistakes(e,t,r,o){if(o){for(const t of u)o.includes(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of c)o.startsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of p)o.endsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`)}}convertTagsToTypeKeyMap(e,t,r,o){const n=new Map;for(const e of Object.values(o)){const t={minCount:e.minCount,maxCount:e.maxCount,isTag:e.type===i.BitTagType.tag,isProperty:e.type===i.BitTagType.property,isResource:e.type===i.BitTagType.resource,chain:e.chain,_configKey:e.configKey,_type:e.type,_tag:e.tag,_seenCount:0,_previous:void 0};if(t.isProperty)n.set(`${l.TypeKey.Property}:${e.tag}`,t);else if(t.isResource)n.set(`${l.TypeKey.Resource}:${e.tag}`,t);else{const r=l.TypeKey.fromValue(e.tag);r&&n.set(r,t)}}return n}getVariantConfig(e,t,r){let o;if(0===e.length)return;const i=e[Math.min(t,e.length-1)],a=i.length-1;if(r>a){if(o=i[a],o.repeatCount!==n.Count.infinity)return}else o=i[r];return o}getTagSignature(e){switch(e._type){case i.BitTagType.tag:return`[${e._tag}]`;case i.BitTagType.property:return`[@${e._tag}]`;case i.BitTagType.resource:return`[&${e._tag}]`;default:return`'${e._type}' tag '${e._tag}'`}}getUnknownTagSignature(e,t){switch(e){case l.TypeKey.Property:return`[@${t}]`;case l.TypeKey.Resource:return`[&${t}]`;default:return`'${e}' tag '${t}'`}}};t.BitmarkPegParserValidator=g},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 o=r(3633),i=r(6831);t.bookChainContentProcessor=function(e,t,r,n,a,s){if(r===i.BitContentLevel.Chain);else{const r=function(e,t,r,n,a){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("book content",a);const s=e.bitContentProcessor(t,i.BitContentLevel.Chain,n,a.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("book TAGS",s);const{reference:l,referenceEnd:u}=s,c=o.StringUtils.trimmedString(a.value);return{book:c,reference:l,referenceEnd:u}}(e,t,0,n,a);s.book=r.book,s.reference=r.reference,s.referenceEnd=r.referenceEnd}}},1182:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.buildCards=void 0;const i=r(9046),n=r(8159),a=r(2606),s=r(2574),l=r(208),u=r(1060),c=r(9779),p=r(8386),g=r(6831),d=new i.Builder;function y(e){let t="";if(e&&e.bodyParts)for(const r of e.bodyParts)if(r.type===u.BodyBitType.text){t+=r.data.bodyText}return t}t.buildCards=function(e,t,r,i,u,f,h){var m;e.DEBUG_CARD_SET&&e.debugPrint("card set",r);let T={};const b=function(e,t,r){const o={cards:[],comments:[]};if(!r)return o;let i=0,n=0,s=0;for(const l of r.cards){const r={no:i++,sides:[]};o.cards.push(r);for(const i of l.sides){const l={no:n++,variants:[]};r.sides.push(l);for(const u of i.variants){const{parser:i,content:c}=u,d={parser:i,no:s++};l.variants.push(d);const f=a.Config.getTagsConfigForCardSet(t,n,s),h=e.bitContentProcessor(t,g.BitContentLevel.Card,f,c);e.DEBUG_CARD_TAGS&&e.debugPrint("card tags",h),h.cardBody=p.BitmarkPegParserValidator.checkCardBody(e,t,g.BitContentLevel.Card,h.cardBody,r.no,l.no,d.no),h.cardBodyStr=y(h.cardBody),d.data=h,h.comments&&o.comments.push(...h.comments)}s=0}n=0}return o}(e,t,r);switch(null===(m=a.Config.getBitConfig(t).cardSet)||void 0===m?void 0:m.configKey){case s.CardSetConfigKey._flashcards:T=function(e,t,r){const i=[];let a,s,u=n.Breakscape.EMPTY_STRING,c=[],p=0,g=0,y={};const f=t.alias===l.AliasBitType.flashcard1;for(const l of r.cards){u=n.Breakscape.EMPTY_STRING,a=void 0,c=[],g=0,y={};for(const e of l.sides)for(const t of e.variants){const e=t.data,{cardBodyStr:r}=e,i=o(e,["cardBodyStr"]);y=Object.assign(Object.assign({},y),i),0===g?(s=t,u=null!=r?r:n.Breakscape.EMPTY_STRING):1===g?a=null!=r?r:n.Breakscape.EMPTY_STRING:c.push(null!=r?r:n.Breakscape.EMPTY_STRING),g++}if(0!==p&&f){e.addWarning(`Bit '${t.alias}' should only contain one card. Ignore subsequent card: '${u}'`,s);break}i.push(d.flashcard(Object.assign({question:u,answer:a,alternativeAnswers:c.length>0?c:void 0},y))),p++}return{flashcards:i.length>0?i:void 0}}(e,t,b);break;case s.CardSetConfigKey._elements:T=function(e,t,r){var o;const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data;i.push(null!==(o=t.cardBodyStr)&&void 0!==o?o:n.Breakscape.EMPTY_STRING)}return{elements:i.length>0?i:void 0}}(0,0,b);break;case s.CardSetConfigKey._statements:T=function(e,t,r,i,n){const a=[];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,i=o(t,["statements"]);if(Array.isArray(r))for(const e of r){const t=d.statement(Object.assign(Object.assign(Object.assign({},e),e.itemLead),i));a.push(t)}}i&&a.push(i);Array.isArray(n)&&n.length>0&&a.push(...n);return{statements:a.length>0?a:void 0}}(0,0,b,i,u);break;case s.CardSetConfigKey._quiz:T=function(e,t,r,i,a){const s=[],u=t.root===l.RootBitType.multipleChoice,c=t.root===l.RootBitType.multipleResponse;if(!u&&!c)return{};let p,g=!1;for(const e of r.cards){g=!1,p=n.Breakscape.EMPTY_STRING;for(const t of e.sides)for(const e of t.variants){const t=e.data,{isDefaultExample:r,example:i}=t,n=o(t,["isDefaultExample","example"]);if(g=!0===r||g,p=i||p,n.trueFalse&&n.trueFalse.length>0){const e=[],t=c?d.response:d.choice;for(const r of n.trueFalse){const{isDefaultExample:i,example:n}=r,a=o(r,["isDefaultExample","example"]),s=i||g,l=n||p,u=t(Object.assign(Object.assign({},a),{isDefaultExample:s,example:l}));e.push(u)}c?n.responses=e:n.choices=e}const a=d.quiz(Object.assign(Object.assign({},n),{isDefaultExample:g,example:p}));s.push(a)}}if(u&&Array.isArray(i)&&i.length>0){const e=d.quiz({choices:i});s.push(e)}if(c&&Array.isArray(a)&&a.length>0){const e=d.quiz({responses:a});s.push(e)}return{quizzes:s.length>0?s:void 0}}(0,t,b,f,h);break;case s.CardSetConfigKey._questions:T=function(e,t,r){var o;const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,r=d.question(Object.assign({question:null!==(o=t.cardBodyStr)&&void 0!==o?o:n.Breakscape.EMPTY_STRING},t));i.push(r)}return{questions:i.length>0?i:void 0}}(0,0,b);break;case s.CardSetConfigKey._matchPairs:T=function(e,t,r){let i,a=0;const s=[];let l;const u=[];let p,g,y,f,h,m=[],T={},b=!1,v=!1;for(const e of r.cards){l=void 0,p=void 0,m=[],g=void 0,y=void 0,a=0,T={},v=!1,h=n.Breakscape.EMPTY_STRING;for(const t of e.sides){for(const e of t.variants){const t=e.data,{cardBodyStr:r,title:i,resources:s,isDefaultExample:d,example:C}=t,k=o(t,["cardBodyStr","title","resources","isDefaultExample","example"]);v=!0===d||v,h=C||h;const B=i&&i[1];if(0===a)if(null!=B)l=B,b=!0===d||b,f=C||f;else if(Array.isArray(s)&&s.length>0){const e=s[0];e.type===c.ResourceTag.audio?g=e:e.type===c.ResourceTag.image&&(y=e)}else p=r;else if(null!=B)u.push(B),b=!0===d||b,f=C||f;else if(null==i){const e=null!=r?r:n.Breakscape.EMPTY_STRING;m.push(e),!b&&!v||h||(h=e)}T=Object.assign(Object.assign({},T),k)}a++}if(null!=l)i=d.heading({forKeys:l,forValues:u});else{v&&(f=void 0);const e=v||b,t=h||f,r=d.pair(Object.assign(Object.assign({key:null!=p?p:n.Breakscape.EMPTY_STRING,keyAudio:g,keyImage:y,values:m},T),{isDefaultExample:e,example:t}));s.push(r)}}return{heading:i,pairs:s.length>0?s:void 0}}(0,0,b);break;case s.CardSetConfigKey._matchMatrix:T=function(e,t,r){let i,a,s=0;const l=[];let u;const c=[];let p,g,y,f,h,m=[],T=[],b={},v=!1,C=!1,k=!1;for(const e of r.cards){a=void 0,u=void 0,m=[],T=[],s=0,C=!1,g=n.Breakscape.EMPTY_STRING,f=void 0;for(const t of e.sides){T=[],b={},k=!1,y=n.Breakscape.EMPTY_STRING,h=void 0;for(const e of t.variants){const t=e.data,{title:r,cardBodyStr:i,isDefaultExample:c,example:d,isCaseSensitive:m}=t,B=o(t,["title","cardBodyStr","isDefaultExample","example","isCaseSensitive"]);k=!0===c||k,y=d||y,Object.assign(b,B);const x=r&&r[1];if(0===s)null!=x?(a=x,v=!0===c||v,p=d||p):(u=i,C=!0===c||C,g=d||g,f=null!=m?m:f);else if(null!=x)l.push(x),v=!0===c||v,p=d||p;else if(null==t.title){const e=null!=i?i:n.Breakscape.EMPTY_STRING;T.push(e),!v&&!k||y||(y=e),h=null!=m?m:f}}if(s>0){k&&(g=p=void 0),C&&(p=void 0);const e=k||C||v,t=y||g||p,r=d.matrixCell(Object.assign(Object.assign({values:T},b),{isDefaultExample:e,example:t,isCaseSensitive:h}));m.push(r)}s++}if(null!=a)i=d.heading({forKeys:a,forValues:l});else{const e=d.matrix({key:null!=u?u:n.Breakscape.EMPTY_STRING,cells:m});c.push(e)}}return{heading:i,matrix:c.length>0?c:void 0}}(0,0,b);break;case s.CardSetConfigKey._botActionResponses:T=function(e,t,r){const i=[];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:a,cardBodyStr:s}=t,l=o(t,["instruction","reaction","cardBodyStr"]),u=d.botResponse(Object.assign({response:null!=r?r:n.Breakscape.EMPTY_STRING,reaction:null!=a?a:n.Breakscape.EMPTY_STRING,feedback:null!=s?s:n.Breakscape.EMPTY_STRING},l));i.push(u)}return{botResponses:i.length>0?i:void 0}}(0,0,b);break;case s.CardSetConfigKey._clozeList:case s.CardSetConfigKey._exampleBitList:T=function(e,t,r){const i=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{cardBody:r}=t,n=o(t,["cardBody"]),a=d.cardBit(Object.assign({body:r},n));a&&i.push(a)}return{cardBits:i.length>0?i:void 0}}(0,0,b)}return T.comments=b.comments.length>0?b.comments:void 0,T}},4471:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clozeTagContentProcessor=void 0;const o=r(3633);t.clozeTagContentProcessor=function(e,t,r,i,n,a){const{value:s}=n,l=a.solutions;if(l&&o.StringUtils.isString(s)){const e=o.StringUtils.trimmedString(s);l.push(e)}}},6934:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.commentTagContentProcessor=void 0;const o=r(3633);t.commentTagContentProcessor=function(e,t,r,i,n){if(!n.comments)return;const{value:a}=i,s=o.StringUtils.isString(a)?o.StringUtils.trimmedString(a):void 0;s&&n.comments.push(s)}},8081:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTagContentProcessor=void 0;const o=r(3633),i=r(6831);t.defaultTagContentProcessor=function(e,t,r,n,a,s){const{type:l,value:u}=a,c=o.StringUtils.trimmedString(u);switch(l){case i.TypeKey.Instruction:s.instruction=c;break;case i.TypeKey.Hint:s.hint=c;break;case i.TypeKey.Anchor:s.anchor=c;break;case i.TypeKey.Reference:s.reference=c;break;case i.TypeKey.SampleSolution:s.sampleSolution=c,e.addWarning("[$...] tag is deprecated, use [@sampleSolution:...] instead",a)}}},4787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.exampleTagContentProcessor=void 0;const o=r(208),i=r(672);function n(e,t,r,o,i){!0===o?(i.isDefaultExample=!0,i.example=void 0):i.example=o}t.exampleTagContentProcessor=function(e,t,r,a,s){const{value:l}=a,u=l;switch(t.root){case o.RootBitType.cloze:case o.RootBitType.clozeAndMultipleChoiceText:case o.RootBitType.multipleChoiceText:case o.RootBitType.highlightText:case o.RootBitType.trueFalse:case o.RootBitType.trueFalse1:case o.RootBitType.multipleResponse:case o.RootBitType.multipleResponse1:case o.RootBitType.multipleChoice:case o.RootBitType.multipleChoice1:!function(e,t,r,a,s){var l,u;let c;Array.isArray(s.trueFalse)&&s.trueFalse.length>0&&(c=null!==(l=s.trueFalse[s.trueFalse.length-1])&&void 0!==l?l:void 0);if(c)!0===a?(c.isDefaultExample=!0,c.example=void 0):i.BooleanUtils.isBooleanString(a)?c.example=a:(c.isDefaultExample=!0,c.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",r));else if(Array.isArray(s.solutions)&&s.solutions.length>0)s.example=!0===a?null!==(u=s.solutions[s.solutions.length-1])&&void 0!==u?u:void 0:a;else switch(t.root){default:case o.RootBitType.cloze:n(e,t,r,a,s);break;case o.RootBitType.multipleChoiceText:case o.RootBitType.highlightText:case o.RootBitType.trueFalse:case o.RootBitType.trueFalse1:case o.RootBitType.multipleResponse:case o.RootBitType.multipleResponse1:!function(e,t,r,o,n){!0===o?(n.isDefaultExample=!0,n.example=void 0):i.BooleanUtils.isBooleanString(o)?n.example=o:(n.isDefaultExample=!0,n.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",r))}(e,0,r,a,s);break;case o.RootBitType.clozeAndMultipleChoiceText:case o.RootBitType.multipleChoice:case o.RootBitType.multipleChoice1:s.isDefaultExample=!0,s.example=void 0,!0!==a&&e.addWarning("At this level, only default [@example] is allowed, using default",r)}}(e,t,a,u,s);break;case o.RootBitType.mark:!function(e,t,r,o,i){i.isDefaultExample=!0,i.example=void 0,!0!==o&&e.addWarning("Only default [@example] is allowed, using default",r)}(e,0,a,u,s);break;default:n(e,t,a,u,s)}}},9577:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.gapChainContentProcessor=void 0;const i=r(9046),n=r(2606),a=r(4471),s=r(6831),l=new i.Builder;t.gapChainContentProcessor=function(e,t,r,i,u,c,p){if(r===s.BitContentLevel.Chain)(0,a.clozeTagContentProcessor)(e,t,r,i,u,c);else{const r=function(e,t,r,i,a){var u;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("gap content",a);const c=n.Config.getTagConfigForTag(i,a.type),p=[a,...null!==(u=a.chain)&&void 0!==u?u:[]],g=e.bitContentProcessor(t,s.BitContentLevel.Chain,null==c?void 0:c.chain,p);e.DEBUG_CHAIN_TAGS&&e.debugPrint("gap TAGS",g);const{solutions:d}=g,y=o(g,["solutions"]),f=l.gap(Object.assign({solutions:null!=d?d:[]},y));return f}(e,t,0,i,u);r&&p.push(r)}}},8664:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.imageSourceChainContentProcessor=void 0;const i=r(9046),n=r(8159),a=r(2606),s=r(3633),l=r(6831),u=new i.Builder;t.imageSourceChainContentProcessor=function(e,t,r,i,c,p){r===l.BitContentLevel.Chain?function(e,t,r,o,i,n){const{value:a}=i,l=s.StringUtils.trimmedString(a);n.imageSourceUrl=l}(0,0,0,0,c,p):function(e,t,r,i,s,c){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("imageSource content",s);const{key:p}=s,g=a.Config.getTagConfigForTag(i,p),d=e.bitContentProcessor(t,l.BitContentLevel.Chain,i,[s]),y=e.bitContentProcessor(t,l.BitContentLevel.Chain,null==g?void 0:g.chain,s.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("imageSource TAGS",y);const{imageSourceUrl:f}=d,{mockupId:h}=y,m=o(y,["mockupId"]);f||e.addWarning("[@imageSource] is missing the image url",s);h||e.addWarning("[@mockupId:xxx] is missing from [@imageSource]",s);const T=u.imageSource(Object.assign({url:null!=f?f:n.Breakscape.EMPTY_STRING,mockupId:null!=h?h:n.Breakscape.EMPTY_STRING},m));c.imageSource=T}(e,t,0,i,c,p)}},2786:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.itemLeadTagContentProcessor=void 0;const o=r(3633);t.itemLeadTagContentProcessor=function(e,t,r,i,n,a,s){const{value:l}=n,u=o.StringUtils.trimmedString(l);s?a.lead=u:a.item=u}},857:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markChainContentProcessor=void 0;const i=r(9046),n=r(8159),a=r(2606),s=r(7646),l=r(3298),u=r(6831),c=new i.Builder;t.markChainContentProcessor=function(e,t,r,i,p,g,d){if(r===u.BitContentLevel.Chain)(0,l.markTagContentProcessor)(e,u.BitContentLevel.Chain,t,p,g);else{const r=function(e,t,r,i,l){var p;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",l);const g=a.Config.getTagConfigForTag(i,l.type),d=e.bitContentProcessor(t,u.BitContentLevel.Chain,i,[l]),y=e.bitContentProcessor(t,u.BitContentLevel.Chain,null==g?void 0:g.chain,l.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",y);const{solution:f}=d,{mark:h}=y,m=o(y,["mark"]),T=c.mark(Object.assign({solution:null!=f?f:n.Breakscape.EMPTY_STRING,mark:null!==(p=s.ArrayUtils.asSingle(h))&&void 0!==p?p:n.Breakscape.EMPTY_STRING},m));return T}(e,t,0,i,p);r&&d.push(r)}}},2595:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markConfigChainContentProcessor=void 0;const i=r(9046),n=r(2606),a=r(3633),s=r(6831),l=new i.Builder;t.markConfigChainContentProcessor=function(e,t,r,i,u,c){var p;const{key:g}=u;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",u);const d=c.markConfig;if(!d)return;const y=n.Config.getTagConfigForTag(i,g),f=e.bitContentProcessor(t,s.BitContentLevel.Chain,null==y?void 0:y.chain,u.chain),{mark:h}=f,m=o(f,["mark"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",m);const T=null!==(p=a.StringUtils.trimmedString(u.value))&&void 0!==p?p:"unknown",b=l.markConfig(Object.assign({mark:T,emphasis:"underline"},m));d.push(b)}},3298:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.markTagContentProcessor=void 0;const o=r(3633);t.markTagContentProcessor=function(e,t,r,i,n){const{value:a}=i;o.StringUtils.isString(a)&&(n.solution=a)}},8326:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.partnerChainContentProcessor=void 0;const o=r(9046),i=r(9779),n=r(3633),a=r(6831),s=new o.Builder;t.partnerChainContentProcessor=function(e,t,r,o,l,u){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("partner content",l);const c=e.bitContentProcessor(t,a.BitContentLevel.Chain,o,l.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("partner TAGS",c);const{resources:p}=c,g=n.StringUtils.trimmedString(l.value),d=function(e,t){let r;const o=[];if(t)for(const e of t.reverse())r||i.ResourceTag.image!==e.type?o.push(e):r=e;o.length>0&&(e.parser.excessResources=o,e.addWarning(`${o.length} excess resource(s) present in the [@parter] chain.`));return r}(e,p),y=s.partner({name:g,avatarImage:d});u.partner=y}},3287:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propertyContentProcessor=void 0;const o=r(2606),i=r(3518),n=r(5486),a=r(7953),s=r(672),l=r(994),u=r(3633),c=r(4185),p=r(6934),g=r(4787),d=r(8664),y=r(2595),f=r(8326),h=r(6831);t.propertyContentProcessor=function(e,t,r,m,T,b){const{key:v,value:C}=T,k=r===h.BitContentLevel.Chain,B=o.Config.getTagConfigForTag(m,v),x=B?B.configKey:void 0;if(v===a.PropertyTag.internalComment)return void(0,p.commentTagContentProcessor)(e,t,r,T,b);if(B){if(x===i.PropertyConfigKey.example)return void(0,g.exampleTagContentProcessor)(e,t,r,T,b);if(x===i.PropertyConfigKey.partner)return void(0,f.partnerChainContentProcessor)(e,t,r,B.chain,T,b);if(x===i.PropertyConfigKey.imageSource)return void(0,d.imageSourceChainContentProcessor)(e,t,r,m,T,b);if(x===i.PropertyConfigKey.book)return void(0,c.bookChainContentProcessor)(e,t,r,B.chain,T,b);if(x===i.PropertyConfigKey.markConfig&&!k)return void(0,y.markConfigChainContentProcessor)(e,t,r,m,T,b)}const A=(e,t,r,o)=>{if(r=(e=>{if(null!=e){if(o)switch(o.format){case n.PropertyFormat.string:return u.StringUtils.isString(e)?u.StringUtils.string(e):void 0;case n.PropertyFormat.trimmedString:return u.StringUtils.isString(e)?u.StringUtils.trimmedString(e):void 0;case n.PropertyFormat.number:return l.NumberUtils.asNumber(e);case n.PropertyFormat.boolean:return s.BooleanUtils.toBoolean(e,!0);case n.PropertyFormat.invertedBoolean:return!s.BooleanUtils.toBoolean(e,!0)}return e}})(r),(null==o?void 0:o.astKey)&&(t=o.astKey),null==o?void 0:o.single)e[t]=r;else if(Object.prototype.hasOwnProperty.call(e,t)){const o=e[t];e[t]=[...o,r]}else e[t]=[r]};A(B?b:b.extraProperties,v,C,B)}},3130:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.referenceTagContentProcessor=void 0;const o=r(3633);t.referenceTagContentProcessor=function(e,t,r,i,n,a,s){const{value:l}=n,u=o.StringUtils.trimmedString(l);s?a.referenceEnd=u:a.reference=u}},5516:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resourceContentProcessor=t.buildResources=void 0;const o=r(8703),i=r(2606),n=r(1035),a=r(9779),s=r(6831),l=new o.ResourceBuilder;t.buildResources=function(e,t,r,o){var s,l;const u=[],c=[],p=a.ResourceTag.fromValue(r),g=i.Config.getBitResourcesConfig(t,p),d=g.resourceAttachmentAllowed,y=g.getCountsMin(),f=g.getCountsMax();if(o)for(const e of o.reverse()){let t=null!==(s=y.get(e.typeAlias))&&void 0!==s?s:0,r=null!==(l=f.get(e.typeAlias))&&void 0!==l?l:0;t=Math.max(0,t-1),r===n.Count.infinity?u.unshift(e):r>0?(u.unshift(e),r--):c.unshift(e),y.set(e.typeAlias,t),f.set(e.typeAlias,r)}if(!d&&r){const t=`Resource type [&${r}] is specified in the bit header, but no extra resource is allowed for this bit.`;e.addWarning(t)}else 0===u.length&&r&&e.addWarning(`Resource type [&${r}] is specified in the bit header, but no such a resource is present`);return c.length>0&&(e.parser.excessResources=c),u},t.resourceContentProcessor=function(e,t,r,o,n,u){const{type:c,key:p,value:g,chain:d}=n,y=u.resources;if(!y)return;const f=a.ResourceTag.fromValue(p);if(f){const r=i.Config.getTagConfigForTag(o,p),n=e.bitContentProcessor(t,s.BitContentLevel.Chain,null==r?void 0:r.chain,d),a=l.resource(Object.assign({type:f,value:g},n));a&&y.push(a)}}},1838:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildTitles=t.titleTagContentProcessor=void 0;const o=r(208),i=r(3633);t.titleTagContentProcessor=function(e,t,r,o,n,a){const{value:s}=n,l=a.title;if(!l)return;const u=s,c=i.StringUtils.trimmedString(u.title);l[u.level.length]=c},t.buildTitles=function(e,t,r){var i,n;switch(r=null!=r?r:[],t.root){case o.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 o.RootBitType.book:default:return{title:null!==(i=r[1])&&void 0!==i?i:void 0,subtitle:null!==(n=r[2])&&void 0!==n?n:void 0}}}},4177:function(e,t,r){var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseChainContentProcessor=void 0;const i=r(9046),n=r(208),a=r(8660),s=r(6831),l=new i.Builder;t.trueFalseChainContentProcessor=function(e,t,r,i,u,c,p){r===s.BitContentLevel.Chain?(0,a.trueFalseTagContentProcessor)(e,s.BitContentLevel.Chain,t,u,c):function(e,t,r,i,a,u,c){var p;const g=[a,...null!==(p=a.chain)&&void 0!==p?p:[]],d=u.statements,y=u.choices,f=u.responses;if(!(d&&y&&f&&c))return;if(t.root===n.RootBitType.trueFalse1)u.statement=function(e,t,r,i){if(t.root!==n.RootBitType.trueFalse1)return;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (statement)",i);const a=e.bitContentProcessor(t,s.BitContentLevel.Chain,r,i),{trueFalse:u}=a,c=o(a,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (statement)",c);let p;u&&u.length>0&&(p=l.statement(Object.assign(Object.assign({},u[0]),c)));return p}(e,t,i,g);else if(t.root===n.RootBitType.trueFalse||t.root===n.RootBitType.multipleChoice||t.root===n.RootBitType.multipleChoice1||t.root===n.RootBitType.multipleResponse||t.root===n.RootBitType.multipleResponse1){const r=function(e,t,r,i){const a=t.root===n.RootBitType.trueFalse,u=t.root===n.RootBitType.multipleChoice||t.root===n.RootBitType.multipleChoice1,c=t.root===n.RootBitType.multipleResponse||t.root===n.RootBitType.multipleResponse1;if(!a&&!u&&!c)return{};const p=[],g=[],d=[],y=e.splitBitContent(i,[s.TypeKey.True,s.TypeKey.False]);e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (choices/responses)",y);for(const i of y){const n=e.bitContentProcessor(t,s.BitContentLevel.Chain,r,i),{trueFalse:y}=n,f=o(n,["trueFalse"]);if(e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (choices/responses)",f),a){if(y&&y.length>0){const e=l.statement(Object.assign(Object.assign({},y[0]),f));p.push(e)}}else if(u){if(y&&y.length>0){const e=l.choice(Object.assign(Object.assign({},y[0]),f));g.push(e)}}else if(c&&y&&y.length>0){const e=l.response(Object.assign(Object.assign({},y[0]),f));d.push(e)}}const f={};a?f.statements=p:u?f.choices=g:c&&(f.responses=d);return f}(e,t,i,g);r.statements&&d.push(...r.statements),r.choices&&y.push(...r.choices),r.responses&&f.push(...r.responses)}else if(t.root===n.RootBitType.highlightText){const r=function(e,t,r,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("highlight content",i);const n=e.bitContentProcessor(t,s.BitContentLevel.Chain,r,i),{trueFalse:a}=n,u=o(n,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("highlight TAGS",Object.assign({trueFalse:a},u));const c=[];if(a)for(const e of a)c.push(l.highlightText(Object.assign(Object.assign({},e),{isHighlighted:!1})));const p=l.highlight(Object.assign({texts:c},u));return p}(e,t,i,g);r&&c.push(r)}else{const r=function(e,t,r,i){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("select content",i);const n=e.bitContentProcessor(t,s.BitContentLevel.Chain,r,i),{trueFalse:a}=n,u=o(n,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("select TAGS",Object.assign({trueFalse:a},u));const c=[];if(a)for(const e of a)c.push(l.selectOption(e));const p=l.select(Object.assign({options:c},u));return p}(e,t,i,g);r&&c.push(r)}}(e,t,0,i,u,c,p)}},8660:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseTagContentProcessor=void 0;const o=r(3633),i=r(6831);t.trueFalseTagContentProcessor=function(e,t,r,n,a){const{type:s,value:l}=n,u=a.trueFalse;if(!u)return;const c=o.StringUtils.trimmedString(l);u.push({text:c,isCorrect:s===i.TypeKey.True,isDefaultExample:!1})}},2434:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JsonParser=void 0;const o=r(9046),i=r(8703),n=r(8159),a=r(2606),s=r(6300),l=r(208),u=r(1060),c=r(9779),p=r(1353),g=r(3633),d=r(406),y=new o.Builder,f=new i.ResourceBuilder;t.JsonParser=class{constructor(){this.textGenerator=new s.TextGenerator,this.textParser=new d.TextParser}toAst(e){const t=this.preprocessJson(e),r=[];for(const e of t){const{bit:t,parser:o}=e,i=this.bitToAst(t,null==o?void 0:o.comments);i&&r.push(i)}const o=r.length>0?{bits:r}:{};return y.bitmark(o)}preprocessJson(e){const t=[];if(g.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 a.Config.getBitType(t.type).root!==l.RootBitType._error}return!1}bitToBitWrapper(e){return{bit:e}}bitToAst(e,t){var r;const{type:o,format:i,id:n,externalId:s,spaceId:l,padletId:u,jupyterId:c,jupyterExecutionCount:g,AIGenerated:d,releaseVersion:f,ageRange:h,lang:m,language:T,computerLanguage:b,target:v,tag:C,icon:k,iconTag:B,colorTag:x,flashcardSet:A,subtype:P,bookAlias:w,coverImage:S,publisher:K,publications:_,author:R,date:I,location:E,theme:O,kind:L,action:j,thumbImage:F,focusX:G,focusY:V,duration:N,deeplink:D,externalLink:M,externalLinkText:U,videoCallLink:$,bot:J,list:q,textReference:z,isTracked:H,isInfoOnly:W,labelTrue:Y,labelFalse:X,content2Buy:Z,quotedPerson:Q,reasonableNumOfChars:ee,resolved:te,resolvedDate:re,resolvedBy:oe,maxCreatedBits:ie,book:ne,title:ae,subtitle:se,level:le,toc:ue,progress:ce,anchor:pe,reference:ge,referenceEnd:de,item:ye,lead:fe,hint:he,instruction:me,example:Te,imageSource:be,partner:ve,marks:Ce,resource:ke,body:Be,sampleSolution:xe,elements:Ae,statement:Pe,isCorrect:we,cards:Se,statements:Ke,responses:_e,quizzes:Re,heading:Ie,pairs:Ee,matrix:Oe,choices:Le,questions:je,listItems:Fe,sections:Ge,footer:Ve,placeholders:Ne}=e,De=a.Config.getBitType(o),Me=a.Config.getBitConfig(De),Ue=null!==(r=p.TextFormat.fromValue(i))&&void 0!==r?r:Me.textFormatDefault,$e=this.getResourceType(ke),Je=this.resourceBitToAst(ke),qe=this.bodyToAst(Be,Ue,Ne),ze=this.imageSourceBitToAst(be),He=this.partnerBitToAst(ve),We=this.markConfigBitToAst(Ce),Ye=this.flashcardBitsToAst(Se),Xe=this.statementBitsToAst(Pe,we,Ke,Te),Ze=this.responseBitsToAst(De,_e),Qe=this.quizBitsToAst(De,Re),et=this.headingBitToAst(Ie),tt=this.pairBitsToAst(Ee),rt=this.matrixBitsToAst(Oe),ot=this.choiceBitsToAst(Le),it=this.questionBitsToAst(je),nt=this.botResponseBitsToAst(De,_e),at=this.listItemsToAst(null!=Fe?Fe:Ge,Ue,Ne),st=this.footerToAst(Ve,Ue),{reference:lt,referenceProperty:ut}=this.referenceToAst(ge);return y.bit(Object.assign(Object.assign(Object.assign({bitType:De,textFormat:i,resourceType:$e,id:this.convertStringToBreakscapedString(n),internalComment:this.convertStringToBreakscapedString(t),externalId:this.convertStringToBreakscapedString(s),spaceId:this.convertStringToBreakscapedString(l),padletId:this.convertStringToBreakscapedString(u),jupyterId:this.convertStringToBreakscapedString(c),jupyterExecutionCount:g,aiGenerated:d,releaseVersion:this.convertStringToBreakscapedString(f),ageRange:h,lang:this.convertStringToBreakscapedString(m),language:this.convertStringToBreakscapedString(T),computerLanguage:this.convertStringToBreakscapedString(b),target:this.convertStringToBreakscapedString(v),tag:this.convertStringToBreakscapedString(C),icon:this.convertStringToBreakscapedString(k),iconTag:this.convertStringToBreakscapedString(B),colorTag:this.convertStringToBreakscapedString(x),flashcardSet:this.convertStringToBreakscapedString(A),subtype:this.convertStringToBreakscapedString(P),bookAlias:this.convertStringToBreakscapedString(w),coverImage:this.convertStringToBreakscapedString(S),publisher:this.convertStringToBreakscapedString(K),publications:this.convertStringToBreakscapedString(_),author:this.convertStringToBreakscapedString(R),date:this.convertStringToBreakscapedString(I),location:this.convertStringToBreakscapedString(E),theme:this.convertStringToBreakscapedString(O),kind:this.convertStringToBreakscapedString(L),action:this.convertStringToBreakscapedString(j),duration:this.convertStringToBreakscapedString(N),referenceProperty:this.convertStringToBreakscapedString(ut),thumbImage:this.convertStringToBreakscapedString(F),focusX:G,focusY:V,deeplink:this.convertStringToBreakscapedString(D),externalLink:this.convertStringToBreakscapedString(M),externalLinkText:this.convertStringToBreakscapedString(U),videoCallLink:this.convertStringToBreakscapedString($),bot:this.convertStringToBreakscapedString(J),list:this.convertStringToBreakscapedString(q),textReference:this.convertStringToBreakscapedString(z),isTracked:H,isInfoOnly:W,labelTrue:this.convertStringToBreakscapedString(Y),labelFalse:this.convertStringToBreakscapedString(X),content2Buy:this.convertStringToBreakscapedString(Z),quotedPerson:this.convertStringToBreakscapedString(Q),reasonableNumOfChars:ee,resolved:te,resolvedDate:this.convertStringToBreakscapedString(re),resolvedBy:this.convertStringToBreakscapedString(oe),maxCreatedBits:ie,book:this.convertStringToBreakscapedString(ne),title:this.convertJsonTextToBreakscapedString(ae),subtitle:this.convertJsonTextToBreakscapedString(se),level:le,toc:ue,progress:ce,anchor:this.convertStringToBreakscapedString(pe),reference:this.convertStringToBreakscapedString(lt),referenceEnd:this.convertStringToBreakscapedString(de)},this.parseItemLeadHintInstruction(ye,fe,he,me)),this.parseExample(Te)),{imageSource:ze,partner:He,markConfig:We,resources:Je,body:qe,sampleSolution:this.convertStringToBreakscapedString(xe),elements:this.convertStringToBreakscapedString(Ae),flashcards:Ye,statements:Xe,responses:Ze,quizzes:Qe,heading:et,pairs:tt,matrix:rt,choices:ot,questions:it,botResponses:nt,cardBits:at,footer:st}))}imageSourceBitToAst(e){var t,r;let o;if(e){const{url:i,mockupId:a,format:s,size:l,trim:u}=e;o=y.imageSource({url:null!==(t=this.convertStringToBreakscapedString(i))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,mockupId:null!==(r=this.convertStringToBreakscapedString(a))&&void 0!==r?r:n.Breakscape.EMPTY_STRING,format:this.convertStringToBreakscapedString(s),size:l,trim:u})}return o}partnerBitToAst(e){var t;let r;if(e){const o=this.resourceDataToAst(c.ResourceTag.image,e.avatarImage);r=y.partner({name:null!==(t=this.convertStringToBreakscapedString(e.name))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,avatarImage:o})}return r}markConfigBitToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{mark:e,color:i,emphasis:a}=o,s=y.markConfig({mark:null!==(t=this.convertStringToBreakscapedString(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,color:this.convertStringToBreakscapedString(i),emphasis:this.convertStringToBreakscapedString(a)});r.push(s)}if(0!==r.length)return r}flashcardBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{question:e,answer:i,alternativeAnswers:a,item:s,lead:l,hint:u,instruction:c,example:p}=o,g=y.flashcard(Object.assign(Object.assign({question:null!==(t=this.convertStringToBreakscapedString(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,answer:this.convertStringToBreakscapedString(i),alternativeAnswers:this.convertStringToBreakscapedString(a)},this.parseItemLeadHintInstruction(s,l,u,c)),this.parseExample(p)));r.push(g)}if(0!==r.length)return r}statementBitsToAst(e,t,r,o){var i,a;const s=[];if(e){const r=y.statement(Object.assign({text:null!==(i=this.convertStringToBreakscapedString(e))&&void 0!==i?i:n.Breakscape.EMPTY_STRING,isCorrect:null!=t&&t},this.parseExample(o)));s.push(r)}if(Array.isArray(r))for(const e of r){const{statement:t,isCorrect:r,item:o,lead:i,hint:l,instruction:u,example:c}=e,p=y.statement(Object.assign(Object.assign({text:null!==(a=this.convertStringToBreakscapedString(t))&&void 0!==a?a:n.Breakscape.EMPTY_STRING,isCorrect:r},this.parseItemLeadHintInstruction(o,i,l,u)),this.parseExample(c)));s.push(p)}if(0!==s.length)return s}choiceBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{choice:e,isCorrect:i,item:a,lead:s,hint:l,instruction:u,example:c}=o,p=y.choice(Object.assign(Object.assign({text:null!==(t=this.convertStringToBreakscapedString(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,isCorrect:i},this.parseItemLeadHintInstruction(a,s,l,u)),this.parseExample(c)));r.push(p)}if(0!==r.length)return r}responseBitsToAst(e,t){var r;const o=[];if(e.root!==l.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,isCorrect:i,item:a,lead:s,hint:l,instruction:u,example:c}=e,p=y.response(Object.assign(Object.assign({text:null!==(r=this.convertStringToBreakscapedString(t))&&void 0!==r?r:n.Breakscape.EMPTY_STRING,isCorrect:i},this.parseItemLeadHintInstruction(a,s,l,u)),this.parseExample(c)));o.push(p)}if(0!==o.length)return o}}selectOptionBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{text:e,isCorrect:i,item:a,lead:s,hint:l,instruction:u,example:c}=o,p=y.selectOption(Object.assign(Object.assign({text:null!==(t=this.convertStringToBreakscapedString(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,isCorrect:i},this.parseItemLeadHintInstruction(a,s,l,u)),this.parseExample(c)));r.push(p)}return r}highlightTextBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{text:e,isCorrect:i,isHighlighted:a,item:s,lead:l,hint:u,instruction:c,example:p}=o,g=y.highlightText(Object.assign(Object.assign({text:null!==(t=this.convertStringToBreakscapedString(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,isCorrect:i,isHighlighted:a},this.parseItemLeadHintInstruction(s,l,u,c)),this.parseExample(p)));r.push(g)}return r}quizBitsToAst(e,t){const r=[];if(Array.isArray(t))for(const o of t){const{item:t,lead:i,hint:n,instruction:a,choices:s,responses:l}=o,u=this.choiceBitsToAst(s),c=this.responseBitsToAst(e,l),p=y.quiz(Object.assign(Object.assign({},this.parseItemLeadHintInstruction(t,i,n,a)),{choices:u,responses:c}));r.push(p)}if(0!==r.length)return r}headingBitToAst(e){var t,r;let o;return e&&(o=y.heading({forKeys:null!==(t=this.convertStringToBreakscapedString(e.forKeys))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,forValues:null!==(r=this.convertStringToBreakscapedString(e.forValues))&&void 0!==r?r:[]})),o}pairBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{key:e,keyAudio:i,keyImage:n,values:a,item:s,lead:l,hint:u,instruction:p,example:g,isCaseSensitive:d}=o,f=this.resourceDataToAst(c.ResourceTag.audio,i),h=this.resourceDataToAst(c.ResourceTag.image,n),m=y.pair(Object.assign(Object.assign(Object.assign({key:this.convertStringToBreakscapedString(e),keyAudio:f,keyImage:h,values:null!==(t=this.convertStringToBreakscapedString(a))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(s,l,u,p)),this.parseExample(g)),{isCaseSensitive:d}));r.push(m)}if(0!==r.length)return r}matrixBitsToAst(e){var t,r;const o=[];if(Array.isArray(e))for(const i of e){const{key:e,cells:a,item:s,lead:l,hint:u,instruction:c,example:p}=i,g=y.matrix(Object.assign(Object.assign({key:null!==(t=this.convertStringToBreakscapedString(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,cells:null!==(r=this.matrixCellsToAst(a))&&void 0!==r?r:[]},this.parseItemLeadHintInstruction(s,l,u,c)),this.parseExample(p)));o.push(g)}if(0!==o.length)return o}matrixCellsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{values:e,item:i,lead:n,hint:a,instruction:s,isCaseSensitive:l,example:u}=o,c=y.matrixCell(Object.assign(Object.assign(Object.assign({values:null!==(t=this.convertStringToBreakscapedString(e))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(i,n,a,s)),{isCaseSensitive:l}),this.parseExample(u)));r.push(c)}if(0!==r.length)return r}questionBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const o of e){const{question:e,partialAnswer:i,sampleSolution:a,item:s,lead:l,hint:u,instruction:c,example:p,reasonableNumOfChars:g}=o,d=y.question(Object.assign(Object.assign(Object.assign({question:null!==(t=this.convertStringToBreakscapedString(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,partialAnswer:this.convertStringToBreakscapedString(i),sampleSolution:this.convertStringToBreakscapedString(a)},this.parseItemLeadHintInstruction(s,l,u,c)),this.parseExample(p)),{reasonableNumOfChars:g}));r.push(d)}if(0!==r.length)return r}botResponseBitsToAst(e,t){var r,o,i;const a=[];if(e.root===l.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,reaction:s,feedback:l,item:u,lead:c,hint:p}=e,g=y.botResponse({response:null!==(r=this.convertStringToBreakscapedString(t))&&void 0!==r?r:n.Breakscape.EMPTY_STRING,reaction:null!==(o=this.convertStringToBreakscapedString(s))&&void 0!==o?o:n.Breakscape.EMPTY_STRING,feedback:null!==(i=this.convertStringToBreakscapedString(l))&&void 0!==i?i:n.Breakscape.EMPTY_STRING,item:this.convertJsonTextToBreakscapedString(u),lead:this.convertJsonTextToBreakscapedString(c),hint:this.convertJsonTextToBreakscapedString(p)});a.push(g)}if(0!==a.length)return a}}listItemsToAst(e,t,r){const o=[];if(Array.isArray(e))for(const i of e){const{item:e,lead:n,hint:a,instruction:s,body:l}=i,u=y.cardBit({item:this.convertJsonTextToBreakscapedString(e),lead:this.convertJsonTextToBreakscapedString(n),hint:this.convertJsonTextToBreakscapedString(a),instruction:this.convertJsonTextToBreakscapedString(s),body:this.bodyToAst(l,t,r)});u&&o.push(u)}if(0!==o.length)return o}getResourceType(e){if(e){return c.ResourceTag.fromValue(e.type)}}resourceBitToAst(e){var t;const r=[];if(e){const o=null!==(t=c.ResourceTag.keyFromValue(e.type))&&void 0!==t?t:c.ResourceTag.unknown;let i;if(e.type===c.ResourceTag.imageResponsive){const t=e,o=this.resourceDataToAst(c.ResourceTag.imagePortrait,t.imagePortrait),i=this.resourceDataToAst(c.ResourceTag.imageLandscape,t.imageLandscape);o&&r.push(o),i&&r.push(i)}else if(e.type===c.ResourceTag.stillImageFilm){const t=e,o=this.resourceDataToAst(c.ResourceTag.image,t.image),i=this.resourceDataToAst(c.ResourceTag.audio,t.audio);o&&r.push(o),i&&r.push(i)}else{if(i=e[o],!i)return;const t=this.resourceDataToAst(e.type,i);t&&r.push(t)}}return r}resourceDataToAst(e,t){var r,o;let i;if(t){if(!t)return;const n=g.StringUtils.isString(t)?t:void 0,a=t.url||t.src||t.href||t.app||t.body||n,s=this.resourceDataToAst(c.ResourceTag.image,t.posterImage),l=t.thumbnails?t.thumbnails.map((e=>this.resourceDataToAst(c.ResourceTag.image,e))):void 0;i=f.resource({type:e,value:this.convertStringToBreakscapedString(a),format:this.convertStringToBreakscapedString(t.format),src1x:this.convertStringToBreakscapedString(t.src1x),src2x:this.convertStringToBreakscapedString(t.src2x),src3x:this.convertStringToBreakscapedString(t.src3x),src4x:this.convertStringToBreakscapedString(t.src4x),caption:this.convertJsonTextToBreakscapedString(t.caption),width:null!==(r=t.width)&&void 0!==r?r:void 0,height:null!==(o=t.height)&&void 0!==o?o:void 0,alt:this.convertStringToBreakscapedString(t.alt),zoomDisabled:t.zoomDisabled,duration:t.duration,mute:t.mute,autoplay:t.autoplay,allowSubtitles:t.allowSubtitles,showSubtitles:t.showSubtitles,posterImage:s,thumbnails:l,siteName:this.convertStringToBreakscapedString(t.siteName),license:this.convertStringToBreakscapedString(t.license),copyright:this.convertStringToBreakscapedString(t.copyright),showInIndex:t.showInIndex})}return i}bodyToAst(e,t,r){let o,i;const n={};if(Array.isArray(e)?(i=this.convertJsonTextToBreakscapedString(e,t),r=this.textGenerator.getPlaceholders()):i=e,r)for(const[e,t]of Object.entries(r)){const r=this.bodyBitToAst(t);n[e]=r}if(i){const e=[],t=g.StringUtils.splitPlaceholders(i,Object.keys(n));for(let r=0,o=t.length;r<o;r++){const o=t[r];if(n[o])e.push(n[o]);else{const t=this.bodyTextToAst(o);e.push(t)}}o=y.body({bodyParts:e})}return o}bodyTextToAst(e){return y.bodyText({text:null!=e?e:n.Breakscape.EMPTY_STRING})}bodyBitToAst(e){switch(e.type){case u.BodyBitType.gap:return this.gapBitToAst(e);case u.BodyBitType.mark:return this.markBitToAst(e);case u.BodyBitType.select:return this.selectBitToAst(e);case u.BodyBitType.highlight:return this.highlightBitToAst(e)}return this.bodyTextToAst(n.Breakscape.EMPTY_STRING)}footerToAst(e,t){const r=this.convertJsonTextToBreakscapedString(e,t);if(r)return y.footerText({text:r})}referenceToAst(e){return Array.isArray(e)&&e.length>0?{reference:void 0,referenceProperty:e}:{reference:e,referenceProperty:void 0}}gapBitToAst(e){var t;const{item:r,lead:o,hint:i,instruction:n,example:a,isCaseSensitive:s,solutions:l}=e;return y.gap(Object.assign(Object.assign(Object.assign({solutions:null!==(t=this.convertStringToBreakscapedString(l))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(r,o,i,n)),this.parseExample(a)),{isCaseSensitive:s}))}markBitToAst(e){var t;const{solution:r,mark:o,item:i,lead:a,hint:s,instruction:l,example:u}=e;return y.mark(Object.assign(Object.assign({solution:null!==(t=this.convertStringToBreakscapedString(r))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,mark:this.convertStringToBreakscapedString(o)},this.parseItemLeadHintInstruction(i,a,s,l)),this.parseExample(u)))}selectBitToAst(e){const{options:t,prefix:r,postfix:o,item:i,lead:n,hint:a,instruction:s,example:l}=e,u=this.selectOptionBitsToAst(t);return y.select(Object.assign(Object.assign({options:u,prefix:this.convertStringToBreakscapedString(r),postfix:this.convertStringToBreakscapedString(o)},this.parseItemLeadHintInstruction(i,n,a,s)),this.parseExample(l)))}highlightBitToAst(e){const{texts:t,prefix:r,postfix:o,item:i,lead:n,hint:a,instruction:s,example:l}=e,u=this.highlightTextBitsToAst(t);return y.highlight(Object.assign(Object.assign({texts:u,prefix:this.convertStringToBreakscapedString(r),postfix:this.convertStringToBreakscapedString(o)},this.parseItemLeadHintInstruction(i,n,a,s)),this.parseExample(l)))}parseItemLeadHintInstruction(e,t,r,o){return{item:this.convertJsonTextToBreakscapedString(e),lead:this.convertJsonTextToBreakscapedString(t),hint:this.convertJsonTextToBreakscapedString(r),instruction:this.convertJsonTextToBreakscapedString(o)}}parseExample(e){if(null==e)return;const t=this.convertJsonTextToBreakscapedString(e);return t?{example:t}:{example:!!e}}convertJsonTextToBreakscapedString(e,t){if(t=null!=t?t:p.TextFormat.bitmarkMinusMinus,null!=e){if(this.textParser.isAst(e)){return this.textGenerator.generateSync(e,t)}if(Array.isArray(e)){const r=[];for(let o=0,i=e.length;o<i;o++){const i=e[o];if(this.textParser.isAst(i)){const e=this.textGenerator.generateSync(i,t);r[o]=e}else r[o]=i}return r}return e}}convertStringToBreakscapedString(e){if(null!=e){if(Array.isArray(e)){const t=[];for(let r=0,o=e.length;r<o;r++){const o=e[r];t[r]=n.Breakscape.breakscape(o)}return t}return n.Breakscape.breakscape(e)}}}},406:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextParser=void 0;const o=r(1353),i=r(3633),n=r(8436);t.TextParser=class{preprocessAst(e){if(i.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){if(Array.isArray(e)){if(0===e.length)return!0;if(Object.prototype.hasOwnProperty.call(e[0],"type"))return!0}return!1}toAst(e,t){var r;if(Array.isArray(e))return e;const i=null!==(r=e)&&void 0!==r?r:"";if(!i)return[];const a=Object.assign({},t);a.textFormat||(a.textFormat=o.TextFormat.bitmarkMinusMinus);const s=a.textFormat===o.TextFormat.bitmarkPlusPlus?"bitmarkPlusPlus":"bitmarkMinusMinus";return(0,n.parse)(i,{startRule:s})}}},8436:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const o=r(4764).parse;t.parse=o},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 o=r(672);const i=new class{fillStringExample(e,t,r,o){if(e){Array.isArray(e)||(e=[e]);for(const i of e)if(!i.isExample&&(t?(i.isDefaultExample=!0,i.isExample=!0):(i.isDefaultExample=!1,i.example=r),o))break}}fillBooleanExample(e,t,r,i){if(e){Array.isArray(e)||(e=[e]);for(const n of e)if(!n.isExample&&(!i||n.isCorrect)&&(t?(n.isDefaultExample=!0,n.isExample=!0):(n.isDefaultExample=!1,n.example=o.BooleanUtils.toBoolean(r)),i))break}}};t.BitUtils=i},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},3589:(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,o=Object.assign({},r);for(const e of Object.keys(r))delete r[e];for(const e of t)Object.prototype.hasOwnProperty.call(o,e)&&(r[e]=o[e])}removeUndefinedProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||null==o&&delete r[e]}removeFalseProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||!1===o&&delete r[e]}removeEmptyStringProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||""===o&&delete r[e]}removeEmptyArrayProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||Array.isArray(o)&&0===o.length&&delete r[e]}removeEmptyObjectProperties(e,t){const r=e;for(const[e,o]of Object.entries(r))t&&t.indexOf(e)>=0||this.isObject(o)&&0===Object.keys(o).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 o=r[t];if(Array.isArray(o)){if(0===o.length)return;o=o[o.length-1]}return o}};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}string(e){return e?`${e}`:""}trimmedString(e){return this.string(e).trim()}splitPlaceholders(e,t){let r=[e];const o=(e,t)=>{const r=[];for(const o of e){const e=o.split(t);for(let o=0,i=e.length;o<i;o++){const n=e[o],a=o===i-1;r.push(n),a||r.push(t)}}return r};for(const e of t)r=o(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 o=e.split("\n");return o.length>0?o[0].substring(0,t):r}wordWrap(e,t){const r=[];if(t<1||null==e||e.length<=t)return r;const o=e.length,i=o-t;let n,a=0;for(;a<i;){let o;const i=a+t,s=e.indexOf("\n",a);if(s>-1&&s>a&&s<i){o=s-a,n=e.substr(a,o),a=a+o+1,r.push(n);continue}const l=e.lastIndexOf(" ",i);let u=0;l>-1&&l!=a-1?(o=l-a,o>0&&(u=a+o+1)):(o=t,u=a+t),n=e.substr(a,o),a=u,r.push(n.trim())}return a<o&&(n=e.substr(a),r.push(n)),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 o=r(2164),i=r(7619),n=r(306),a=r(9870);const s=new class{constructor(){Object.defineProperty(this,"userAgentInfo",{value:(0,a.parseUserAgent)(),enumerable:!1}),this.bootTimestamp=Date.now(),this.app="",this.appVersion=n.EMPTY_VERSION,this.environment=this.getEnvironment(),this.environmentVersion=this.getEnvironmentVersion(),this.isBrowser=this.getIsBrowser(),this.isNode=this.environment===o.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?o.Environment.node:o.Environment.unknown}getEnvironmentVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.browserVersion):"undefined"!=typeof process?this.parseMMBVersion(process.version):n.EMPTY_VERSION}getOs(){return this.userAgentInfo?this.userAgentInfo.os:("undefined"!=typeof process&&void 0!==process.versions&&process.versions.node,i.Os.unknown)}getOsVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.osVersion):"undefined"!=typeof process?this.parseMMBVersion(""):n.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 n.EMPTY_VERSION;e.startsWith("v")&&(e=e.substring(1));const t=e.split(".",1e3);let r="",o="",i="",a="";for(let e=0,n=t.length;e<n;e++){const n=t[e];0===e?r=n:1===e?o=n:2===e?a=n:3===e&&(i=n)}return{full:e,major:r,minor:o,patch:a,build:i}}};t.env=s;const l=s.init.bind(s);t.initEnv=l},2164:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Environment=void 0;const o=(0,r(6688).superenum)({unknown:"",node:"node",chrome:"chrome",safari:"safari",firefox:"firefox",edge:"edge",ie:"ie"});t.Environment=o},7619:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Os=void 0;const o=(0,r(6688).superenum)({unknown:"",macos:"macos",windows:"windows",linux:"linux",android:"android",ios:"ios"});t.Os=o},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 o=r(2164),i=r(7619);t.parseUserAgent=function(){if("undefined"==typeof window||!window.navigator||!window.navigator.userAgent)return;const e={browser:o.Environment.unknown,os:i.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 o="";for(let e=0,i=t.length;e<i;e++){const i=t[e];let n=!1;for(let e=0;e<=9;e++)if(i.startsWith(`${e}`)){n=!0;break}n?r.versions[o]=i.replace("_","."):r.keys.add(i),o=i}return r}(window.navigator.userAgent),r=t.keys.has("firefox"),n=t.keys.has("chrome"),a=t.keys.has("chromium"),s=t.keys.has("safari"),l=n,u=r,c=t.keys.has("macintosh");return s&&!n&&!a?(e.browser=o.Environment.safari,e.browserVersion=t.versions.version):l?(e.browser=o.Environment.chrome,e.browserVersion=t.versions.chrome):u&&(e.browser=o.Environment.firefox,e.browserVersion=t.versions.firefox),c&&(e.os=i.Os.macos,e.osVersion=t.versions.x),e}}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var n=t[o]={exports:{}};return e[o].call(n.exports,n,n.exports,r),n.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},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 o={};return(()=>{var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.StreamWriter=e.FileWriter=e.BitmarkFileGenerator=e.JsonFileGenerator=e.InfoFormat=e.InfoType=e.CardSetVersion=e.BitmarkVersion=e.BitmarkParserType=e.NodeType=e.ResourceTag=e.TextFormat=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 i=r(390);Object.defineProperty(e,"BitmarkParserGenerator",{enumerable:!0,get:function(){return i.BitmarkParserGenerator}}),Object.defineProperty(e,"Output",{enumerable:!0,get:function(){return i.Output}});var n=r(9046);Object.defineProperty(e,"Builder",{enumerable:!0,get:function(){return n.Builder}});var a=r(8703);Object.defineProperty(e,"ResourceBuilder",{enumerable:!0,get:function(){return a.ResourceBuilder}});var s=r(8256);Object.defineProperty(e,"Ast",{enumerable:!0,get:function(){return s.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 p=r(9556);Object.defineProperty(e,"BitmarkParser",{enumerable:!0,get:function(){return p.BitmarkParser}});var g=r(297);Object.defineProperty(e,"BitmarkGenerator",{enumerable:!0,get:function(){return g.BitmarkGenerator}});var d=r(8582);Object.defineProperty(e,"BitmarkStringGenerator",{enumerable:!0,get:function(){return d.BitmarkStringGenerator}});var y=r(227);Object.defineProperty(e,"StringWriter",{enumerable:!0,get:function(){return y.StringWriter}});var f=r(208);Object.defineProperty(e,"RootBitType",{enumerable:!0,get:function(){return f.RootBitType}}),Object.defineProperty(e,"AliasBitType",{enumerable:!0,get:function(){return f.AliasBitType}});var h=r(1353);Object.defineProperty(e,"TextFormat",{enumerable:!0,get:function(){return h.TextFormat}});var m=r(9779);Object.defineProperty(e,"ResourceTag",{enumerable:!0,get:function(){return m.ResourceTag}});var T=r(549);Object.defineProperty(e,"NodeType",{enumerable:!0,get:function(){return T.NodeType}});var b=r(6958);Object.defineProperty(e,"BitmarkParserType",{enumerable:!0,get:function(){return b.BitmarkParserType}});var v=r(8791);Object.defineProperty(e,"BitmarkVersion",{enumerable:!0,get:function(){return v.BitmarkVersion}});var C=r(8565);Object.defineProperty(e,"CardSetVersion",{enumerable:!0,get:function(){return C.CardSetVersion}});var k=r(7347);Object.defineProperty(e,"InfoType",{enumerable:!0,get:function(){return k.InfoType}});var B=r(8681);Object.defineProperty(e,"InfoFormat",{enumerable:!0,get:function(){return B.InfoFormat}});(0,t.init)()})(),o})()));
|
|
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,n=Object.assign,a={enumerable:!1},s=new Map,l=new Map,u=new Map,c=new Map,p=new Map,g=(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))s.set(t,r),u.set(t.toLowerCase(),r);for(const[e,t]of s){const r="string"==typeof t?t.toLowerCase():t;l.set(t,e),c.set(r,e)}const d=g.map((e=>s.get(e))),y=g.map((e=>[e,s.get(e)]));return(t=>{let r=e;function f(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?s.get(c.get(e.toLowerCase())):!e||l.has(e)?e:void 0}Object.isExtensible(e)||(r=n({},e)),o(r,"fromKey",n({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?u.get(e.toLowerCase()):s.get(`${e}`)}},a)),o(r,"fromValue",n({value:f},a)),o(r,"keyFromValue",n({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?c.get(e.toLowerCase()):l.get(e)}},a)),o(r,"setMetadata",n({value:function(e,t,r){const i=f(e);i&&p.set(i,t)}},a)),o(r,"getMetadata",n({value:function(e,t){return p.get(e)}},a)),o(r,Symbol.iterator,n({value:function(){let e=0;return{next:()=>e<g.length?{value:s.get(`${g[e++]}`),done:!1}:{done:!0}}}},a)),o(r,"values",n({value:()=>d},a)),o(r,"keys",n({value:()=>g},a)),o(r,"entries",n({value:()=>y},a));let h=r;return(null==t?void 0:t.noFreeze)||(h=i(r),i(g),i(d),i(y)),h})(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}),n=(this&&this.__importStar,this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function s(e){try{l(i.throw(e))}catch(e){n(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(a,s)}l((i=i.apply(e,t||[])).next())}))});this&&this.__importDefault;Object.defineProperty(t,"__esModule",{value:!0}),t.Output=t.BitmarkParserGenerator=void 0;const a=r(6688),s=r(8256),l=r(8582),u=r(4275),c=r(6958),p=r(9556),g=r(2434),d=r(671),y=r(9677),f=r(7347),h=r(8681),m=r(2606),T=r(1353),b=r(6300),v=r(406),B=(0,a.superenum)({bitmark:"bitmark",json:"json",ast:"ast"});t.Output=B;t.BitmarkParserGenerator=class{constructor(){this.ast=new s.Ast,this.jsonParser=new g.JsonParser,this.bitmarkParser=new p.BitmarkParser,this.textParser=new v.TextParser,this.textGenerator=new b.TextGenerator,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 d.env.appVersion.full}info(e){const t=Object.assign({},e),r=new y.InfoBuilder;let i;const o=!t.outputFormat||t.outputFormat===h.InfoFormat.text,n=t.outputFormat===h.InfoFormat.json,a=t.type===f.InfoType.all,s=t.type===f.InfoType.deprecated,l=a||!s,u=a||s;if(t.type===f.InfoType.bit){const e=r.getSupportedBitConfigs().filter((e=>{if(!t.bit)return!0;return m.Config.getBitType(t.bit)===e.bitType}));i=o?e.map((e=>e.toString({includeChains:!0,includeConfigs:!0}))).join("\n\n--------------\n\n"):e}else{const e=r.getSupportedBits({includeNonDeprecated:l,includeDeprecated:u}).filter((e=>{if(!t.bit)return!0;const r=m.Config.getBitType(t.bit);return e.name===r||void 0}));i=o?this.supportedBitsAsString(e):e}if(n){const e=!0===t.prettify?2:t.prettify||void 0;i=JSON.stringify(i,null,e)}return i}convert(e,t){return n(this,void 0,void 0,(function*(){let r;const i=Object.assign({},t),o=Object.assign({},i.jsonOptions),a=i.outputFormat,s=a===B.bitmark,p=a===B.json,g=a===B.ast,y=c.BitmarkParserType.peggy;let f=e;if(d.env.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(f)&&(f=fs.readFileSync(f,{encoding:"utf8"}));let h=this.ast.preprocessAst(f);const m=!!h;m||(h=this.jsonParser.toAst(f));const T=!!(null==h?void 0:h.bits),b=e=>n(this,void 0,void 0,(function*(){yield v(e),yield k(r)})),v=e=>n(this,void 0,void 0,(function*(){r=this.bitmarkParser.toAst(e,{parserType:y})})),C=e=>n(this,void 0,void 0,(function*(){if(y===c.BitmarkParserType.peggy)if(h=this.bitmarkParser.toAst(e,{parserType:y}),i.outputFile){const e=new JsonFileGenerator_1.JsonFileGenerator(i.outputFile,i);yield e.generate(h)}else{const e=new u.JsonObjectGenerator(i),t=yield e.generate(h);r=this.jsonStringifyPrettify(t,o)}})),k=e=>n(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)}})),x=e=>n(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,o)})),P=e=>n(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),n=yield t.generate(e);r=this.jsonStringifyPrettify(n,o)}})),w=e=>n(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)}})),S=e=>n(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,o)})),A=e=>n(this,void 0,void 0,(function*(){yield P(e)}));return!T&&!m?s?yield b(f):g?yield v(f):yield C(f):m?g?yield x(h):p?yield P(h):yield k(h):p?yield A(h):g?yield S(h):yield w(h),r}))}upgrade(e,t){return n(this,void 0,void 0,(function*(){let r;const i=Object.assign({},t),o=Object.assign({},i.jsonOptions),a=i.bitmarkParserType;let s=e;if(d.env.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(s)&&(s=fs.readFileSync(s,{encoding:"utf8"}));let c=this.jsonParser.toAst(s);const p=e=>n(this,void 0,void 0,(function*(){const t=this.bitmarkParser.toAst(e,{parserType:a});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)}})),g=e=>n(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),n=yield t.generate(e);r=this.jsonStringifyPrettify(n,o)}}));return!!!(null==c?void 0:c.bits)?yield p(s):yield g(c),r}))}createAst(e){let t,r=e;d.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}convertText(e,t){var r;return n(this,void 0,void 0,(function*(){let i,o;const n=Object.assign({},t),a=Object.assign({},n.fileOptions),s=Object.assign({},n.jsonOptions),l=null!==(r=n.textFormat)&&void 0!==r?r:T.TextFormat.bitmarkMinusMinus;let u=e;if(d.env.isBrowser&&n.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(u)&&(u=fs.readFileSync(u,{encoding:"utf8"}));const c=this.textParser.preprocessAst(u),p=!!c;if(o=p?yield this.textGenerator.generate(c,l):this.textParser.toAst(u,{textFormat:l}),n.outputFile){const e=n.outputFile.toString();let t=o;p||(t=this.jsonStringifyPrettify(o,s,!0));const r=a.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(e)),fs.writeFileSync(e,t,{flag:r})}else i=p?o:this.jsonStringifyPrettify(o,s);return i}))}breakscapeText(e,t){if(!e)return e;const r=Object.assign({},t),i=Object.assign({},r.fileOptions);let o=e;if(d.env.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(o)&&(o=fs.readFileSync(o,{encoding:"utf8"}));const n=Breakscape_1.Breakscape.breakscape(o,{});if(!r.outputFile)return n;{const e=r.outputFile.toString(),t=i.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(e)),fs.writeFileSync(e,n,{flag:t})}}unbreakscapeText(e,t){if(!e)return e;const r=Object.assign({},t),i=Object.assign({},r.fileOptions);let o=e;if(d.env.isBrowser&&r.outputFile)throw new Error("Cannot write to file in browser environment");d.env.isNode&&fs.existsSync(o)&&(o=fs.readFileSync(o,{encoding:"utf8"}));const n=Breakscape_1.Breakscape.unbreakscape(o);if(!r.outputFile)return n;{const e=r.outputFile.toString(),t=i.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(e)),fs.writeFileSync(e,n,{flag:t})}}supportedBitsAsString(e){let t="";for(const r of e)t+=`${r.name} (since: ${r.since}`,r.deprecated&&(t+=`, deprecated: ${r.deprecated}`),t+=")\n";return t}}},8256:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Ast=void 0;const i=r(7087),o=r(549),n=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(n.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:n,between:a,exit:s,leaf:l}=r,u=i[i.length-1].key,c=!this.isValue(e),p=i[i.length-1];if(c){if(n){if(!1===n(p,t,i,o))return}}else l&&l(p,t,i,o);if(c){const n=this.isArray(e),s=Object.keys(e);for(let l=0,c=s.length;l<c;l++){const g=s[l],d=l===c-1,y=e,f=y[g];if(null!=f){const e={key:this.getAstKey(g,u,n),index:l,value:f},c=i.slice();if(c.push(e),this.walkRecursive(f,p,r,c,o),!d){const r=s[l+1],c=y[r],g={key:this.getAstKey(r,u,n),index:l+1,value:c};if(a){if(!1===a(p,e,g,t,i,o))break}}}}}c&&s&&s(p,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)}}},1:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseBuilder=void 0;const i=r(8159),o=r(2606),n=r(5486),a=r(7646),s=r(672),l=r(994),u=r(3633);t.BaseBuilder=class{toExample(e,t){return null!=t?(!0===t&&(t=i.Breakscape.breakscape("true")),!1===t&&(t=i.Breakscape.breakscape("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){if(null==t)return;const r=o.Config.getRawPropertiesConfig()[e],i=e=>{if(null!=e){switch(r.format){case n.PropertyFormat.string:return u.StringUtils.isString(e)?u.StringUtils.string(e):void 0;case n.PropertyFormat.trimmedString:return u.StringUtils.isString(e)?u.StringUtils.trimmedString(e):void 0;case n.PropertyFormat.number:return l.NumberUtils.asNumber(e);case n.PropertyFormat.boolean:return s.BooleanUtils.toBoolean(e,!0);case n.PropertyFormat.invertedBoolean:return!s.BooleanUtils.toBoolean(e,!0)}return e}};if(Array.isArray(t)){const e=t;for(let t=0,r=e.length;t<r;t++)e[t]=i(e[t])}else t=i(t);return a.ArrayUtils.asArray(t)}}},9046:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=void 0;const i=r(8159),o=r(2606),n=r(3518),a=r(208),s=r(1060),l=r(9779),u=r(1353),c=r(7646),p=r(4598),g=r(994),d=r(3589),y=r(671),f=r(1),h=r(2377);class m extends f.BaseBuilder{bitmark(e){const{bits:t,errors:r}=e,i={bits:t,errors:r};return d.ObjectUtils.removeUnwantedProperties(i),i}bit(e){var t;const{bitType:r,textFormat:i,resourceType:s,id:p,internalComment:y,externalId:f,spaceId:m,padletId:T,jupyterId:b,jupyterExecutionCount:v,aiGenerated:B,releaseVersion:C,ageRange:k,lang:x,language:P,computerLanguage:w,target:S,tag:A,icon:K,iconTag:_,colorTag:I,flashcardSet:O,subtype:R,bookAlias:E,coverImage:L,publisher:j,publications:V,author:F,subject:G,date:N,location:D,theme:M,kind:U,action:$,thumbImage:J,focusX:z,focusY:q,pointerLeft:H,pointerTop:W,duration:Y,referenceProperty:X,deeplink:Z,externalLink:Q,externalLinkText:ee,videoCallLink:te,bot:re,list:ie,textReference:oe,isTracked:ne,isInfoOnly:ae,labelTrue:se,labelFalse:le,content2Buy:ue,book:ce,quotedPerson:pe,partialAnswer:ge,reasonableNumOfChars:de,resolved:ye,resolvedDate:fe,resolvedBy:he,maxCreatedBits:me,product:Te,productList:be,productVideo:ve,productVideoList:Be,productFolder:Ce,title:ke,subtitle:xe,level:Pe,toc:we,progress:Se,anchor:Ae,reference:Ke,referenceEnd:_e,item:Ie,lead:Oe,hint:Re,instruction:Ee,isDefaultExample:Le,example:je,imageSource:Ve,partner:Fe,markConfig:Ge,extraProperties:Ne,resources:De,body:Me,sampleSolution:Ue,footer:$e,markup:Je,parser:ze}=e,qe=o.Config.getBitConfig(r),He=c.ArrayUtils.asArray(De),We=this.cardNode(e),Ye=o.Config.isOfBitType(r,a.BitType.essay)?this.toAstProperty(n.PropertyConfigKey.reasonableNumOfChars,de):void 0,Xe=Object.assign(Object.assign({bitType:r,textFormat:null!==(t=u.TextFormat.fromValue(i))&&void 0!==t?t:qe.textFormatDefault,resourceType:l.ResourceTag.fromValue(s),id:this.toAstProperty(n.PropertyConfigKey.id,p),internalComment:this.toAstProperty(n.PropertyConfigKey.internalComment,y),externalId:this.toAstProperty(n.PropertyConfigKey.externalId,f),spaceId:this.toAstProperty(n.PropertyConfigKey.spaceId,m),padletId:this.toAstProperty(n.PropertyConfigKey.padletId,T),jupyterId:this.toAstProperty(n.PropertyConfigKey.jupyterId,b),jupyterExecutionCount:this.toAstProperty(n.PropertyConfigKey.jupyterExecutionCount,v),aiGenerated:this.toAstProperty(n.PropertyConfigKey.aiGenerated,B),releaseVersion:this.toAstProperty(n.PropertyConfigKey.releaseVersion,C),book:ce,ageRange:this.toAstProperty(n.PropertyConfigKey.ageRange,k),lang:this.toAstProperty(n.PropertyConfigKey.lang,x),language:this.toAstProperty(n.PropertyConfigKey.language,P),computerLanguage:this.toAstProperty(n.PropertyConfigKey.computerLanguage,w),target:this.toAstProperty(n.PropertyConfigKey.target,S),tag:this.toAstProperty(n.PropertyConfigKey.tag,A),icon:this.toAstProperty(n.PropertyConfigKey.icon,K),iconTag:this.toAstProperty(n.PropertyConfigKey.iconTag,_),colorTag:this.toAstProperty(n.PropertyConfigKey.colorTag,I),flashcardSet:this.toAstProperty(n.PropertyConfigKey.flashcardSet,O),subtype:this.toAstProperty(n.PropertyConfigKey.subtype,R),bookAlias:this.toAstProperty(n.PropertyConfigKey.bookAlias,E),coverImage:this.toAstProperty(n.PropertyConfigKey.coverImage,L),publisher:this.toAstProperty(n.PropertyConfigKey.publisher,j),publications:this.toAstProperty(n.PropertyConfigKey.publications,V),author:this.toAstProperty(n.PropertyConfigKey.author,F),subject:this.toAstProperty(n.PropertyConfigKey.subject,G),date:this.toAstProperty(n.PropertyConfigKey.date,N),location:this.toAstProperty(n.PropertyConfigKey.location,D),theme:this.toAstProperty(n.PropertyConfigKey.theme,M),kind:this.toAstProperty(n.PropertyConfigKey.kind,U),action:this.toAstProperty(n.PropertyConfigKey.action,$),thumbImage:this.toAstProperty(n.PropertyConfigKey.thumbImage,J),focusX:this.toAstProperty(n.PropertyConfigKey.focusX,z),focusY:this.toAstProperty(n.PropertyConfigKey.focusY,q),pointerLeft:this.toAstProperty(n.PropertyConfigKey.pointerLeft,H),pointerTop:this.toAstProperty(n.PropertyConfigKey.pointerTop,W),deeplink:this.toAstProperty(n.PropertyConfigKey.deeplink,Z),externalLink:this.toAstProperty(n.PropertyConfigKey.externalLink,Q),externalLinkText:this.toAstProperty(n.PropertyConfigKey.externalLinkText,ee),videoCallLink:this.toAstProperty(n.PropertyConfigKey.videoCallLink,te),bot:this.toAstProperty(n.PropertyConfigKey.bot,re),duration:this.toAstProperty(n.PropertyConfigKey.duration,Y),referenceProperty:this.toAstProperty(n.PropertyConfigKey.property_reference,X),list:this.toAstProperty(n.PropertyConfigKey.list,ie),textReference:this.toAstProperty(n.PropertyConfigKey.textReference,oe),isTracked:this.toAstProperty(n.PropertyConfigKey.isTracked,ne),isInfoOnly:this.toAstProperty(n.PropertyConfigKey.isInfoOnly,ae),labelTrue:this.toAstProperty(n.PropertyConfigKey.labelTrue,se),labelFalse:this.toAstProperty(n.PropertyConfigKey.labelFalse,le),content2Buy:this.toAstProperty(n.PropertyConfigKey.content2Buy,ue),quotedPerson:this.toAstProperty(n.PropertyConfigKey.quotedPerson,pe),partialAnswer:this.toAstProperty(n.PropertyConfigKey.partialAnswer,ge),reasonableNumOfChars:Ye,resolved:this.toAstProperty(n.PropertyConfigKey.resolved,ye),resolvedDate:this.toAstProperty(n.PropertyConfigKey.resolvedDate,fe),resolvedBy:this.toAstProperty(n.PropertyConfigKey.resolvedBy,he),maxCreatedBits:this.toAstProperty(n.PropertyConfigKey.maxCreatedBits,me),product:this.toAstProperty(n.PropertyConfigKey.product,Te),productList:this.toAstProperty(n.PropertyConfigKey.productList,be),productVideo:this.toAstProperty(n.PropertyConfigKey.productVideo,ve),productVideoList:this.toAstProperty(n.PropertyConfigKey.productVideoList,Be),productFolder:this.toAstProperty(n.PropertyConfigKey.productFolder,Ce),title:ke,subtitle:xe,level:g.NumberUtils.asNumber(Pe),toc:this.toAstProperty(n.PropertyConfigKey.toc,we),progress:this.toAstProperty(n.PropertyConfigKey.progress,Se),anchor:Ae,reference:Ke,referenceEnd:_e,markConfig:Ge,itemLead:this.itemLead(Ie,Oe),hint:Re,instruction:Ee},this.toExample(Le,je)),{imageSource:Ve,partner:Fe,resources:He,body:Me,sampleSolution:c.ArrayUtils.asSingle(Ue),cardNode:We,footer:$e,markup:Je,parser:ze,extraProperties:this.parseExtraProperties(Ne)});return o.Config.isOfBitType(r,a.BitType.interview)&&this.pushDownTree(void 0,void 0,We,"questions",n.PropertyConfigKey.reasonableNumOfChars,de),this.pushExampleDownTree(Me,We,Le,je),this.setDefaultBitValues(Xe),this.setIsExampleFlags(Xe),this.addVersionToParserInfo(Xe),d.ObjectUtils.removeUnwantedProperties(Xe,{ignoreAllFalse:!0,ignoreEmptyString:["example"]}),h.NodeValidator.validateBit(Xe)}choice(e){const{text:t,isCorrect:r,item:i,lead:o,hint:n,instruction:a,isDefaultExample:s,example:l}=e,u=Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:n,instruction:a},this.toExampleBoolean(s,l));return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}response(e){const{text:t,isCorrect:r,item:i,lead:o,hint:n,instruction:a,isDefaultExample:s,example:l}=e,u=Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:n,instruction:a},this.toExampleBoolean(s,l));return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}botResponse(e){const{response:t,reaction:r,feedback:i,item:o,lead:n,hint:a}=e,s={response:t,reaction:r,feedback:i,itemLead:this.itemLead(o,n),hint:a};return d.ObjectUtils.removeUnwantedProperties(s,{ignoreEmptyString:["response","reaction","feedback"]}),s}quiz(e){const{choices:t,responses:r,item:i,lead:o,hint:n,instruction:a,isDefaultExample:s,example:l}=e;this.pushExampleDownTreeBoolean(s,l,!0,t),this.pushExampleDownTreeBoolean(s,l,!1,r);const u={itemLead:this.itemLead(i,o),hint:n,instruction:a,isExample:s||null!=l,choices:t,responses:r};return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}heading(e){var t;const{forKeys:r,forValues:o}=e;if(null==r)return;const n={forKeys:r||i.Breakscape.EMPTY_STRING,forValues:null!==(t=c.ArrayUtils.asArray(o))&&void 0!==t?t:[]};return d.ObjectUtils.removeUnwantedProperties(n),n}pair(e){const{key:t,keyAudio:r,keyImage:i,values:o,item:n,lead:a,hint:s,instruction:l,isCaseSensitive:u,isDefaultExample:c,example:p}=e,g=Object.assign(Object.assign({key:t,keyAudio:r,keyImage:i,itemLead:this.itemLead(n,a),hint:s,instruction:l},this.toExample(c,p)),{isCaseSensitive:null==u||u,values:o});return d.ObjectUtils.removeUnwantedProperties(g,{ignoreAllFalse:!0}),g}matrix(e){const{key:t,cells:r,item:i,lead:o,hint:n,instruction:a,isDefaultExample:s}=e;let l=!1;for(const e of null!=r?r:[])s&&!e.isExample&&(e.isDefaultExample=!0,e.isExample=!0),l=!!e.isExample||l;const u={key:t,itemLead:this.itemLead(i,o),hint:n,instruction:a,isExample:l,cells:r};return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}matrixCell(e){const{values:t,item:r,lead:i,hint:o,instruction:n,isCaseSensitive:a,isDefaultExample:s,example:l}=e,u=Object.assign({values:t,itemLead:this.itemLead(r,i),hint:o,instruction:n,isCaseSensitive:null==a||a},this.toExample(s,l));return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}question(e){const{question:t,partialAnswer:r,item:i,lead:o,hint:n,instruction:a,reasonableNumOfChars:s,sampleSolution:l,isDefaultExample:u,example:c}=e,p=Object.assign(Object.assign({itemLead:this.itemLead(i,o),question:t,partialAnswer:r,hint:n,instruction:a},this.toExample(u,c)),{reasonableNumOfChars:s,sampleSolution:l});return d.ObjectUtils.removeUnwantedProperties(p,{ignoreEmptyString:["question"],ignoreAllFalse:!0}),p}body(e){const{bodyParts:t}=e;return{bodyParts:t}}bodyText(e){const{text:t}=e;return{type:s.BodyBitType.text,data:{bodyText:t}}}footerText(e){const{text:t}=e;return{footerText:t}}gap(e){const{solutions:t,item:r,lead:i,hint:o,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,c={type:s.BodyBitType.gap,data:Object.assign({solutions:t,itemLead:this.itemLead(r,i),hint:o,instruction:n,isCaseSensitive:null==a||a},this.toExample(l,u))};return d.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}markConfig(e){const{mark:t,color:r,emphasis:i}=e,o={mark:t,color:r,emphasis:i};return d.ObjectUtils.removeUnwantedProperties(o),o}mark(e){const{solution:t,mark:r,item:i,lead:o,hint:n,instruction:a,isDefaultExample:l,example:u}=e,c={type:s.BodyBitType.mark,data:Object.assign({solution:t,mark:r,itemLead:this.itemLead(i,o),hint:n,instruction:a},this.toExample(l,u))};return d.ObjectUtils.removeUnwantedProperties(c),c}select(e){const{options:t,prefix:r,postfix:i,item:o,lead:n,hint:a,instruction:l}=e,u={type:s.BodyBitType.select,data:{prefix:r,options:t,postfix:i,itemLead:this.itemLead(o,n),hint:a,instruction:l}};return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}selectOption(e){const{text:t,isCorrect:r,item:i,lead:o,hint:n,instruction:a,isDefaultExample:s,example:l}=e,u=Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:n,instruction:a},this.toExample(s,l));return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}highlight(e){const{texts:t,prefix:r,postfix:i,item:o,lead:n,hint:a,instruction:l}=e,u={type:s.BodyBitType.highlight,data:{prefix:r,texts:t,postfix:i,itemLead:this.itemLead(o,n),hint:a,instruction:l}};return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}highlightText(e){const{text:t,isCorrect:r,isHighlighted:i,item:o,lead:n,hint:a,instruction:s,isDefaultExample:l,example:u}=e,c=Object.assign({text:t,isCorrect:!!r,isHighlighted:!!i,itemLead:this.itemLead(o,n),hint:a,instruction:s},this.toExample(l,u));return d.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}flashcard(e){const{question:t,answer:r,alternativeAnswers:i,item:o,lead:n,hint:a,instruction:s,isDefaultExample:l,example:u}=e,c=Object.assign({question:t,answer:r,alternativeAnswers:i,itemLead:this.itemLead(o,n),hint:a,instruction:s},this.toExampleBoolean(l,u));return d.ObjectUtils.removeUnwantedProperties(c,{ignoreAllFalse:!0}),c}statement(e){const{text:t,isCorrect:r,item:i,lead:o,hint:n,instruction:a,isDefaultExample:s,example:l}=e,u=Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:n,instruction:a},this.toExampleBoolean(s,l));return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}imageSource(e){const{url:t,mockupId:r,size:i,format:o,trim:n}=e,a={url:t,mockupId:r,size:i,format:o,trim:n};return d.ObjectUtils.removeUnwantedProperties(a,{ignoreFalse:["trim"]}),a}partner(e){const{name:t,avatarImage:r}=e,i={name:t,avatarImage:r};return d.ObjectUtils.removeUnwantedProperties(i),i}itemLead(e,t){let r;return(e||t)&&(r={item:e,lead:t}),r}cardBit(e){const{item:t,lead:r,hint:i,instruction:o,isDefaultExample:n,example:a,extraProperties:s,body:l}=e,u=Object.assign(Object.assign({itemLead:this.itemLead(t,r),hint:i,instruction:o},this.toExample(n,a)),{body:l,extraProperties:this.parseExtraProperties(s)});return d.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0,ignoreEmptyString:["example"]}),h.NodeValidator.validateCardBit(u)}cardNode(e){let t;const{questions:r,elements:i,flashcards:o,statement:n,statements:a,choices:s,responses:l,quizzes:u,heading:c,pairs:p,matrix:g,botResponses:y,cardBits:f}=e;return(r||i||o||n||a||s||l||u||c||p||g||y||f)&&(t={questions:r,elements:i,flashcards:o,statement:n,statements:a,choices:s,responses:l,quizzes:u,heading:c,pairs:p,matrix:g,botResponses:y,cardBits:f},d.ObjectUtils.removeUnwantedProperties(t)),t}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)}}pushExampleDownTreeBoolean(e,t,r,...i){if((e||t)&&Array.isArray(i))for(const o of i)if(o){const i=Array.isArray(o)?o:[o];p.BitUtils.fillBooleanExample(i,e,t,r)}}pushExampleDownTreeString(e,t,...r){if((e||t)&&Array.isArray(r))for(const i of r)if(i){const r=Array.isArray(i)?i:[i];p.BitUtils.fillStringExample(r,e,t,!1)}}pushExampleDownTreeBodyBits(e,t,r){if((e||t)&&r&&r.bodyParts&&0!==r.bodyParts.length)for(const i of r.bodyParts)if(i)switch(i.type){case s.BodyBitType.gap:{const r=i;p.BitUtils.fillStringExample([r.data],e,t,!1);break}case s.BodyBitType.mark:{const r=i;p.BitUtils.fillBooleanExample([r.data],e,t,!1);break}case s.BodyBitType.select:{const r=i;p.BitUtils.fillBooleanExample(r.data.options,e,t,!0);break}case s.BodyBitType.highlight:{const r=i;p.BitUtils.fillBooleanExample(r.data.texts,e,t,!0);break}}}pushDownTree(e,t,r,i,o,n){if(void 0!==n){if(r&&i){const e=r[i];if(Array.isArray(e))for(const t of e)null==t[o]&&(t[o]=n)}if(t&&e&&e.bodyParts&&e.bodyParts.length>0)for(const r of e.bodyParts)if(r&&-1!==t.indexOf(r.type)){r.data[o]=n}}}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]=c.ArrayUtils.asArray(i)||[i];return r}setIsExampleFlags(e){var t,r,i,o,n,a,l,u,c,p,g,d,y;e.isExample=!1;const f=t=>!!t&&(t.isDefaultExample||null!=t.example?(t.isExample=!0,e.isExample=!0):t.isExample=t===e&&!!e.isExample,t.isExample),{body:h,cardNode:m}=e;if(h&&h.bodyParts)for(const e of h.bodyParts)switch(e.type){case s.BodyBitType.gap:case s.BodyBitType.mark:f(e.data);break;case s.BodyBitType.select:{const t=e;let r=!1;for(const e of t.data.options)r=!!f(e)||r;t.data.isExample=r;break}case s.BodyBitType.highlight:{const t=e;let r=!1;for(const e of t.data.texts)r=!!f(e)||r;t.data.isExample=r;break}}if(m){for(const e of null!==(t=m.flashcards)&&void 0!==t?t:[])f(e);for(const e of null!==(r=m.pairs)&&void 0!==r?r:[])f(e);for(const e of null!==(i=m.matrix)&&void 0!==i?i:[]){let t=!1;for(const r of null!==(o=e.cells)&&void 0!==o?o:[])t=!!f(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=!!f(r)||t;for(const r of null!==(l=e.choices)&&void 0!==l?l:[])t=!!f(r)||t;e.isExample=t}for(const e of null!==(u=m.responses)&&void 0!==u?u:[])f(e);for(const e of null!==(c=m.choices)&&void 0!==c?c:[])f(e);for(const e of null!==(p=m.statements)&&void 0!==p?p:[])f(e);f(m.statement);for(const e of null!==(g=m.questions)&&void 0!==g?g:[])f(e)}f(e.statement);for(const t of null!==(d=e.responses)&&void 0!==d?d:[])f(t);for(const t of null!==(y=e.choices)&&void 0!==y?y:[])f(t);f(e)}setDefaultBitValues(e){switch(e.bitType){case a.BitType.articleAi:case a.BitType.noteAi:case a.BitType.summaryAi:e.aiGenerated=this.toAstProperty(n.PropertyConfigKey.aiGenerated,!0)}}addVersionToParserInfo(e){var t;const r=null!==(t=e.parser)&&void 0!==t?t:{};r.version=y.env.appVersion.full,e.parser=r}}t.Builder=m},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(8159),n=r(9779),a=r(3589),s=r(169),l=r(1),u=r(2377);class c extends l.BaseBuilder{resource(e){var t;let r;const{type:a,value:s,format:l}=e,u=i(e,["type","value","format"]),c=Object.assign({type:a,value:null!=s?s:o.Breakscape.EMPTY_STRING,format:null!=l?l:o.Breakscape.EMPTY_STRING},u);switch(a){case n.ResourceTag.video:case n.ResourceTag.videoEmbed:case n.ResourceTag.videoLink:case n.ResourceTag.stillImageFilmEmbed:case n.ResourceTag.stillImageFilmLink:{const r=["src1x","src2x","src3x","src4x"],i=[];for(const t of r){const r=e[t];if(r){const e=this.resource({type:n.ResourceTag.image,value:r});e&&i.push(e)}}c.thumbnails=[...null!==(t=c.thumbnails)&&void 0!==t?t:[],...i]}}switch(a){case n.ResourceTag.image:case n.ResourceTag.imagePortrait:case n.ResourceTag.imageLandscape:r=this.imageResource(c,a);break;case n.ResourceTag.imageLink:r=this.imageLinkResource(c);break;case n.ResourceTag.audio:r=this.audioResource(c);break;case n.ResourceTag.audioEmbed:r=this.audioEmbedResource(c);break;case n.ResourceTag.audioLink:r=this.audioLinkResource(c);break;case n.ResourceTag.video:r=this.videoResource(c);break;case n.ResourceTag.videoEmbed:r=this.videoEmbedResource(c);break;case n.ResourceTag.videoLink:r=this.videoLinkResource(c);break;case n.ResourceTag.stillImageFilmEmbed:r=this.stillImageFilmEmbedResource(c);break;case n.ResourceTag.stillImageFilmLink:r=this.stillImageFilmLinkResource(c);break;case n.ResourceTag.article:r=this.articleResource(c);break;case n.ResourceTag.document:r=this.documentResource(c);break;case n.ResourceTag.documentEmbed:r=this.documentEmbedResource(c);break;case n.ResourceTag.documentLink:r=this.documentLinkResource(c);break;case n.ResourceTag.documentDownload:r=this.documentDownloadResource(c);break;case n.ResourceTag.appLink:r=this.appLinkResource(c);break;case n.ResourceTag.websiteLink:r=this.websiteLinkResource(c)}return r}imageResource(e,t){const{value:r,src1x:i,src2x:o,src3x:l,src4x:c,width:p,height:g,alt:d,zoomDisabled:y,license:f,copyright:h,showInIndex:m,caption:T}=e,b={type:n.ResourceTag.image,typeAlias:null!=t?t:n.ResourceTag.image,format:s.UrlUtils.fileExtensionFromUrl(r),provider:s.UrlUtils.domainFromUrl(r),value:r,src1x:i,src2x:o,src3x:l,src4x:c,width:p,height:g,alt:d,zoomDisabled:y,license:f,copyright:h,showInIndex:m,caption:T};return a.ObjectUtils.removeUnwantedProperties(b,{ignoreFalse:["zoomDisabled"]}),u.NodeValidator.validateResource(b)}imageLinkResource(e){const{value:t,src1x:r,src2x:i,src3x:o,src4x:l,width:c,height:p,alt:g,zoomDisabled:d,license:y,copyright:f,showInIndex:h,caption:m}=e,T={type:n.ResourceTag.imageLink,typeAlias:n.ResourceTag.imageLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,src1x:r,src2x:i,src3x:o,src4x:l,zoomDisabled:d,width:c,height:p,alt:g,license:y,copyright:f,showInIndex:h,caption:m};return a.ObjectUtils.removeUnwantedProperties(T,{ignoreFalse:["zoomDisabled"]}),u.NodeValidator.validateResource(T)}audioResource(e){const{value:t,duration:r,mute:i,autoplay:o,license:l,copyright:c,showInIndex:p,caption:g}=e,d={type:n.ResourceTag.audio,typeAlias:n.ResourceTag.audio,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:i,autoplay:o,license:l,copyright:c,showInIndex:p,caption:g};return a.ObjectUtils.removeUnwantedProperties(d),u.NodeValidator.validateResource(d)}audioEmbedResource(e){const{value:t,duration:r,mute:i,autoplay:o,license:l,copyright:c,showInIndex:p,caption:g}=e,d={type:n.ResourceTag.audioEmbed,typeAlias:n.ResourceTag.audioEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:i,autoplay:o,license:l,copyright:c,showInIndex:p,caption:g};return a.ObjectUtils.removeUnwantedProperties(d),u.NodeValidator.validateResource(d)}audioLinkResource(e){const{value:t,duration:r,mute:i,autoplay:o,license:l,copyright:c,showInIndex:p,caption:g}=e,d={type:n.ResourceTag.audioLink,typeAlias:n.ResourceTag.audioLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:i,autoplay:o,license:l,copyright:c,showInIndex:p,caption:g};return a.ObjectUtils.removeUnwantedProperties(d),u.NodeValidator.validateResource(d)}videoResource(e){const{value:t,width:r,height:i,duration:o,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.video,typeAlias:n.ResourceTag.video,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:o,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}videoEmbedResource(e){const{value:t,width:r,height:i,duration:o,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.videoEmbed,typeAlias:n.ResourceTag.videoEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:o,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}videoLinkResource(e){const{value:t,width:r,height:i,duration:o,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.videoLink,typeAlias:n.ResourceTag.videoLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:o,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}stillImageFilmEmbedResource(e){const{value:t,width:r,height:i,duration:o,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.stillImageFilmEmbed,typeAlias:n.ResourceTag.stillImageFilmEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:o,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}stillImageFilmLinkResource(e){const{value:t,width:r,height:i,duration:o,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b}=e,v={type:n.ResourceTag.stillImageFilmLink,typeAlias:n.ResourceTag.stillImageFilmLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:o,mute:l,autoplay:c,allowSubtitles:p,showSubtitles:g,alt:d,posterImage:y,thumbnails:f,license:h,copyright:m,showInIndex:T,caption:b};return a.ObjectUtils.removeUnwantedProperties(v),u.NodeValidator.validateResource(v)}articleResource(e){const{value:t,license:r,copyright:i,showInIndex:o,caption:l}=e,c={type:n.ResourceTag.article,typeAlias:n.ResourceTag.article,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:o,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}documentResource(e){const{value:t,license:r,copyright:i,showInIndex:o,caption:l}=e,c={type:n.ResourceTag.document,typeAlias:n.ResourceTag.document,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:o,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}documentEmbedResource(e){const{value:t,license:r,copyright:i,showInIndex:o,caption:l}=e,c={type:n.ResourceTag.documentEmbed,typeAlias:n.ResourceTag.documentEmbed,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:o,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}documentLinkResource(e){const{value:t,license:r,copyright:i,showInIndex:o,caption:l}=e,c={type:n.ResourceTag.documentLink,typeAlias:n.ResourceTag.documentLink,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:o,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}documentDownloadResource(e){const{value:t,license:r,copyright:i,showInIndex:o,caption:l}=e,c={type:n.ResourceTag.documentDownload,typeAlias:n.ResourceTag.documentDownload,format:s.UrlUtils.fileExtensionFromUrl(t),provider:s.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:o,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}appLinkResource(e){const{value:t,license:r,copyright:i,showInIndex:o,caption:s}=e,l={type:n.ResourceTag.appLink,typeAlias:n.ResourceTag.appLink,value:t,license:r,copyright:i,showInIndex:o,caption:s};return a.ObjectUtils.removeUnwantedProperties(l),u.NodeValidator.validateResource(l)}websiteLinkResource(e){const{value:t,siteName:r,license:i,copyright:o,showInIndex:s,caption:l}=e,c={type:n.ResourceTag.websiteLink,typeAlias:n.ResourceTag.websiteLink,value:t,siteName:r,license:i,copyright:o,showInIndex:s,caption:l};return a.ObjectUtils.removeUnwantedProperties(c),u.NodeValidator.validateResource(c)}}t.ResourceBuilder=c},2377:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValidator=void 0;const i=r(3633);const o=new class{validateBit(e){if(!e)return e;return e}validateCardBit(e){if(!e)return e;return e}validateResource(e){if(!e)return;let t=e,r=!1;return e.type,r=!!e.value,r||e.type&&(t={type:e.type,typeAlias:e.type}),t}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(!i.StringUtils.isString(e))throw new Error(`${t} is required to be a string`)}isNonEmptyString(e,t){if(!i.StringUtils.isString(e)||""===e)throw new Error(`${t} is required to be a non-empty string`)}isStringOrBoolean(e,t){if(!i.StringUtils.isString(e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a string or a boolean`)}isNonEmptyStringOrBoolean(e,t){if((!i.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(!i.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`)}};t.NodeValidator=o},227:function(e,t){var r=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function s(e){try{l(i.throw(e))}catch(e){n(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(a,s)}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}}},8159:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Breakscape=void 0;const i=r(3633),o=`${/([*`_!=])([\^]*)\1/.source}|${/^(\|)([\^]*)(code[\s]*|code:|image:|[\s]*$)/.source}|${/^([#]{1,3})([\^]*)([^\S\r\n]+)/.source}|${/^(•)([\^]*)(1|\+|-|)([^\S\r\n]+)/.source}|${/(\[)([\^]*)([.@#▼►%!?+\-$_=&])/.source}|${/([\^]*)(])/.source}`,n=o.replace(/(\(\[\\\^\]\*\))/g,"\\^$1"),a=new RegExp(o,"gm"),s="$1$3$6$9$13^$2$1$4$5$7$8$10$11$12$14$15$16$17",l=new RegExp(n,"gm"),u=s.replace(/\^/g,""),c=new RegExp("^(\\||•|#)","gm");const p=new class{constructor(){this.EMPTY_STRING=""}breakscape(e,t){if(null==e)return e;const r=Object.assign({},t),o=e=>e?e=e.replace(a,s):e;if(Array.isArray(e)){const t=r.modifyArray?e:[e.length];for(let r=0,n=e.length;r<n;r++){const n=e[r];i.StringUtils.isString(n)&&(t[r]=o(n))}e=t}else i.StringUtils.isString(e)&&(e=o(e));return e}unbreakscape(e,t){if(null==e)return e;const r=Object.assign({},t),o=e=>e?e=e.replace(l,u):e;if(Array.isArray(e)){const t=r.modifyArray?e:[];for(let r=0,n=e.length;r<n;r++){const n=e[r];i.StringUtils.isString(n)?t[r]=o(n):t[r]=n}e=t}else i.StringUtils.isString(e)&&(e=o(e));return e}breakscapeCode(e,t){if(null==e)return e;const r=Object.assign({},t),o=e=>e?e.replace(c,"$1^"):e;if(Array.isArray(e)){const t=r.modifyArray?e:[e.length];for(let t=0,r=e.length;t<r;t++){const r=e[t];i.StringUtils.isString(r)&&(e[t]=o(r))}e=t}else i.StringUtils.isString(e)&&(e=o(e));return e}concatenate(e,t){return e+t}};t.Breakscape=p},2606:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Config=void 0;const i=r(429),o=r(7585),n=r(3059),a=r(5428),s=r(742),l=r(208),u=r(1353),c=r(3589),p=r(8360),g=r(3141),d=r(9036),y=r(6260);const f=new class{constructor(){this.bitCache=new Map,this.comboResourcesCache=new Map}getBitType(e){var t;return null!==(t=l.BitType.fromValue(e))&&void 0!==t?t:l.BitType._error}isOfBitType(e,t){if(!e)return!1;if(e===t)return!0;const r=this.getBitConfig(e);if(!r)return!1;if(Array.isArray(t)){for(const e of t)if(r.inheritedBitTypesSet.has(e))return!0;return!1}return r.inheritedBitTypesSet.has(t)}getBitConfig(e){var t;let r=this.bitCache.get(e);if(!r){const o=()=>{throw new Error(`No config found for bit: ${e}`)},n=[],a=[];let s=e;for(;s;){const e=g.BITS[s];e||o(),n.push(s),a.push(e),s=e.baseBitType}a.reverse();const l=a.reduce(((e,t)=>e=c.ObjectUtils.deepMerge(e,t)),{}),{since:d,textFormatDefault:y,tags:f,cardSet:h,deprecated:m,bodyAllowed:T,bodyRequired:b,footerAllowed:v,footerRequired:B,resourceAttachmentAllowed:C,rootExampleType:k}=l,x=this.getAllResourcesTagsWithZeroCounts(),P=p.ConfigHydrator.hydrateTagsConfig(null!=f?f:[]),w=p.ConfigHydrator.hydrateCardSetConfig(h),S=null===(t=P.info)||void 0===t?void 0:t.comboResourceType,A=Object.assign({},P.tags);for(const[e,t]of Object.entries(x))A[e]||(A[e]=t);r=new i.BitConfig(d,e,n,null!=y?y:u.TextFormat.bitmarkMinusMinus,A,w,m,T,b,v,B,C,k,S),this.bitCache.set(e,r)}return r}getRawPropertiesConfig(){return y.PROPERTIES}getTagConfigForTag(e,t){if(e)for(const[,r]of Object.entries(e))if(r.tag===t)return r}getTagsConfigForCardSet(e,t,r){const i=this.getBitConfig(e);if(!i)return;const o=i.cardSet;if(!o)return;t=Math.min(t,o.variants.length-1);const n=o.variants[t];return n[r=Math.min(r,n.length-1)].tags}getBitResourcesConfig(e,t){var r;let i={};const a=new Map,l=this.getBitConfig(e),u={};for(const[e,t]of Object.entries(l.tags))t.type===s.BitTagType.resource&&(u[e]=t);const c=null!==(r=l.comboResourceType)&&void 0!==r?r:l.resourceAttachmentAllowed&&t;if(c){const e=new Map,r=this.getComboResource(c);if(r){const t=Object.values(r).filter((e=>e.type===s.BitTagType.resource));t.map((e=>e.tag)).forEach((r=>{const i=t.find((e=>e.tag===r));i&&e.set(r,i)}));const i=this.getComboResourceTagTypes(c);i&&i.length>0&&a.set(c,i)}if(t)for(const[t,r]of Object.entries(u)){const n=c===r.tag,a=!!e&&e.has(r.tag);if(n){const e=new o.ResourceTagConfig(r.configKey,r.tag,1,1,r.chain,r.jsonKey,r.deprecated);i[t]=e}else if(a){if(e){const o=e.get(r.tag);o&&(i[t]=o)}}else i[t]=r}else i=u}else i=u;return new n.ResourcesConfig(i,l.resourceAttachmentAllowed,t,a)}getComboResourceTagTypes(e){const t=this.getComboResource(e);if(t){return Object.values(t).filter((e=>e.type===s.BitTagType.resource)).map((e=>e.tag))}}getComboResource(e){if(!e)return;let t=this.comboResourcesCache.get(e);return t||(t={},Object.values(d.GROUPS).filter((t=>t.type===a.GroupConfigType.comboResource&&t.comboResourceType===e)).forEach((e=>{t=Object.assign(Object.assign({},t),p.ConfigHydrator.hydrateTagsConfig(e.tags).tags)})),0===Object.keys(t).length&&(t=void 0),this.comboResourcesCache.set(e,t)),t}getAllResourcesTagsWithZeroCounts(){let e=this.allResourcesCache;if(!e){e={},Object.values(d.GROUPS).filter((e=>e.type===a.GroupConfigType.resource)).forEach((t=>{e=Object.assign(Object.assign({},e),p.ConfigHydrator.hydrateTagsConfig(t.tags).tags)}));for(const t of Object.values(e)){const e=t;e.maxCount=0,e.minCount=0}this.allResourcesCache=e}return e}};t.Config=f},8360:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigHydrator=void 0;const i=r(2005),o=r(3585),n=r(6620),a=r(6956),s=r(7585),l=r(8620),u=r(177),c=r(3518),p=r(6194),g=r(1595),d=r(742),y=r(4182),f=r(9036),h=r(6260),m=r(5100),T=r(3622);const b=new class{hydrateTagsConfig(e){var t;const r={tags:{}};for(const i of e){let e;switch(i.type){case d.BitTagType.tag:e=this.hydrateTagConfig(i);break;case d.BitTagType.property:e=this.hydratePropertyTagConfig(i);break;case d.BitTagType.resource:e=this.hydrateResourceTagConfig(i);break;case d.BitTagType.group:e=this.hydrateTagGroupConfig(i)}e&&(r.tags=Object.assign(Object.assign({},r.tags),e.tags),r.info=Object.assign(null!==(t=r.info)&&void 0!==t?t:{},e.info))}return r}hydrateCardSetConfig(e){if(!e)return;const t=y.CARDS[e];if(!t)throw new Error(`No config found for card set config key '${e}'`);const r=[];for(const e of t.variants){const t=[];for(const r of e){const e=this.hydrateCardVariantConfig(r);t.push(e)}r.push(t)}return new i.CardSetConfig(e,r)}hydrateTagConfig(e){const{configKey:t,maxCount:r,minCount:i,chain:o}=e,a=g.TagConfigKey.fromKey(t)||l.ConfigKey._unknown,s=T.TAGS[a];if(!s)throw new Error(`No config found for tag config key '${t}'`);const{tag:u,deprecated:c}=s;let p;o&&(p=this.hydrateTagsConfig(o).tags);return{tags:{[a]:new n.MarkupTagConfig(a,u,null!=r?r:1,null!=i?i:0,p,c)}}}hydratePropertyTagConfig(e){const{configKey:t,maxCount:r,minCount:i,chain:o}=e,n=c.PropertyConfigKey.fromKey(t)||l.ConfigKey._unknown,s=h.PROPERTIES[n];if(!s)throw new Error(`No config found for property config key '${t}'`);const{tag:u,deprecated:p,single:g,format:d,defaultValue:y,jsonKey:f,astKey:m}=s;let T;o&&(T=this.hydrateTagsConfig(o).tags);return{tags:{[n]:new a.PropertyTagConfig(n,u,null!=r?r:1,null!=i?i:0,T,f,m,g,d,y,p)}}}hydrateResourceTagConfig(e){const{configKey:t,maxCount:r,minCount:i,chain:o}=e,n=p.ResourceConfigKey.fromKey(t)||l.ConfigKey._unknown,a=m.RESOURCES[n];if(!a)throw new Error(`No config found for resource config key '${t}'`);const{tag:u,deprecated:c,jsonKey:g}=a;let d;o&&(d=this.hydrateTagsConfig(o).tags);return{tags:{[n]:new s.ResourceTagConfig(n,u,null!=r?r:1,null!=i?i:0,d,g,c)}}}hydrateTagGroupConfig(e){var t,r;const{configKey:i}=e,o=u.GroupConfigKey.fromKey(i)||l.ConfigKey._unknown,n=f.GROUPS[o];if(!n)throw new Error(`No config found for group config key '${i}'`);const{tags:a}=n,s=this.hydrateTagsConfig(a).tags,c=Object.values(s);if(c.length>0){const i=c[0],o=i;o.maxCount=null!==(t=e.maxCount)&&void 0!==t?t:i.maxCount,o.minCount=null!==(r=e.minCount)&&void 0!==r?r:i.minCount}return{tags:s,info:{comboResourceType:n.comboResourceType}}}hydrateCardVariantConfig(e){const{tags:t,bodyAllowed:r,bodyRequired:i,repeatCount:n}=e,a=this.hydrateTagsConfig(t);return new o.CardVariantConfig(a.tags,r,i,n)}};t.ConfigHydrator=b},3141:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BITS=void 0;const i=r(2574),o=r(177),n=r(3518),a=r(1595),s=r(742),l=r(208),u=r(1035),c=r(7028),p=r(1353),g={[l.BitType._error]:{since:"1.3.0",tags:[]},[l.BitType._comment]:{since:"1.4.12",tags:[]},[l.BitType.appFlashcards]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.flashcardSet,maxCount:u.Count.infinity}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string},[l.BitType.appFlashcardsQuiz]:{since:"1.3.0",baseBitType:l.BitType.appFlashcards},[l.BitType.appFlashcardsLearn]:{since:"1.3.0",baseBitType:l.BitType.appFlashcards},[l.BitType.appLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAppLink,minCount:1}],bodyAllowed:!1},[l.BitType.article]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.statement]:{since:"1.3.0",baseBitType:l.BitType.article},[l.BitType.buttonCopyText]:{since:"1.4.3",baseBitType:l.BitType.article},[l.BitType.appBitmarkFromJavascript]:{since:"1.4.5",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.maxCreatedBits}],textFormatDefault:p.TextFormat.text,resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.appBitmarkFromEditor]:{since:"1.4.5",baseBitType:l.BitType.appBitmarkFromJavascript},[l.BitType.articleEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceArticleEmbed,minCount:1}],bodyAllowed:!0},[l.BitType.articleLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceArticleLink,minCount:1}],bodyAllowed:!0},[l.BitType.audio]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudio,minCount:1}],bodyAllowed:!0},[l.BitType.audioEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioEmbed,minCount:1}],bodyAllowed:!0},[l.BitType.audioLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceAudioLink,minCount:1}],bodyAllowed:!0},[l.BitType.bitAlias]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.tag_reference},{type:s.BitTagType.tag,configKey:a.TagConfigKey.anchor}],bodyAllowed:!0},[l.BitType.book]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_bookCommon}],bodyAllowed:!0},[l.BitType.bookAcknowledgments]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookAddendum]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookAfterword]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookAppendix]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookArticle]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookAutherBio]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookBibliography]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookComingSoon]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookConclusion]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookCopyright]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookCopyrightPermissions]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookDedication]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookEndnotes]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookEpigraph]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookEpilogue]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookForword]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookFrontispiece]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookImprint]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookIncitingIncident]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookIntroduction]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookListOfContributors]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookNotes]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookPostscript]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookPreface]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookPrologue]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookReadMore]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookReferenceList]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookRequestForABookReview]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookSummary]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookTeaser]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookTitle]:{since:"1.3.0",baseBitType:l.BitType.book},[l.BitType.bookAlias]:{since:"1.4.3",baseBitType:l.BitType.book,tags:[{type:s.BitTagType.property,configKey:n.PropertyConfigKey.bookAlias,maxCount:u.Count.infinity}]},[l.BitType.botActionResponse]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags}],cardSet:i.CardSetConfigKey._botActionResponses,bodyAllowed:!0,footerAllowed:!0},[l.BitType.botActionSend]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.date}],bodyAllowed:!0},[l.BitType.browserImage]:{since:"1.3.0",baseBitType:l.BitType.image,tags:[{type:s.BitTagType.property,configKey:n.PropertyConfigKey.focusX},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.focusY}]},[l.BitType.card1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.question1]:{since:"1.3.0",baseBitType:l.BitType.card1},[l.BitType.survey1]:{since:"1.3.0",baseBitType:l.BitType.card1},[l.BitType.surveyAnonymous1]:{since:"1.3.0",baseBitType:l.BitType.card1},[l.BitType.chapter]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.anchor},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.toc},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.progress}],bodyAllowed:!0},[l.BitType.clozeAndMultipleChoiceText]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_gap},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.coachCallToActionClozeAndMultipleChoiceText]:{since:"1.3.0",baseBitType:l.BitType.clozeAndMultipleChoiceText},[l.BitType.cloze]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_gap}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.clozeInstructionGrouped]:{since:"1.3.0",baseBitType:l.BitType.cloze},[l.BitType.clozeSolutionGrouped]:{since:"1.3.0",baseBitType:l.BitType.cloze},[l.BitType.coachSelfReflectionCloze]:{since:"1.3.0",baseBitType:l.BitType.cloze},[l.BitType.coachCallToActionCloze]:{since:"1.3.0",baseBitType:l.BitType.cloze},[l.BitType.clozeList]:{since:"1.4.13",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags}],cardSet:i.CardSetConfigKey._clozeList,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.BitType.code]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.computerLanguage}],textFormatDefault:p.TextFormat.text,bodyAllowed:!0},[l.BitType.appCodeCell]:{since:"1.4.3",baseBitType:l.BitType.code},[l.BitType.appCodeEditor]:{since:"1.4.3",baseBitType:l.BitType.code},[l.BitType.appCodeIde]:{since:"1.4.3",baseBitType:l.BitType.code},[l.BitType.codeRuntime]:{since:"1.4.3",baseBitType:l.BitType.code},[l.BitType.consoleLog]:{since:"1.4.3",baseBitType:l.BitType.code},[l.BitType.output]:{since:"1.4.3",baseBitType:l.BitType.code},[l.BitType.stdout]:{since:"1.4.3",baseBitType:l.BitType.code},[l.BitType.step]:{since:"1.5.0",baseBitType:l.BitType.example},[l.BitType.stepImageScreenshot]:{since:"1.5.0",baseBitType:l.BitType.image},[l.BitType.stepImageScreenshotWithPointer]:{since:"1.5.0",baseBitType:l.BitType.image,tags:[{type:s.BitTagType.property,configKey:n.PropertyConfigKey.pointerTop,minCount:1,maxCount:1},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.pointerLeft,minCount:1,maxCount:1}]},[l.BitType.conversationLeft1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_partner}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.conversationLeft1Scream]:{since:"1.3.0",baseBitType:l.BitType.conversationLeft1},[l.BitType.conversationLeft1Thought]:{since:"1.3.0",baseBitType:l.BitType.conversationLeft1},[l.BitType.conversationRight1]:{since:"1.3.0",baseBitType:l.BitType.conversationLeft1},[l.BitType.conversationRight1Scream]:{since:"1.3.0",baseBitType:l.BitType.conversationLeft1},[l.BitType.conversationRight1Thought]:{since:"1.3.0",baseBitType:l.BitType.conversationLeft1},[l.BitType.document]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceDocument,minCount:1}],bodyAllowed:!0},[l.BitType.documentDownload]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceDocumentDownload,minCount:1}],bodyAllowed:!0},[l.BitType.documentEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceDocumentEmbed,minCount:1}],bodyAllowed:!0},[l.BitType.documentLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceDocumentLink,minCount:1}],bodyAllowed:!0},[l.BitType.essay]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.property_sampleSolution},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.partialAnswer},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.property_reference,maxCount:u.Count.infinity}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string},[l.BitType.coachSelfReflectionEssay]:{since:"1.3.0",baseBitType:l.BitType.essay},[l.BitType.coachCallToActionEssay]:{since:"1.3.0",baseBitType:l.BitType.essay},[l.BitType.example]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string},[l.BitType.appAiPrompt]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.aiPrompt]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.articleAi]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.articleAttachment]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.assignment]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.audioTranscript]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.bitmarkExample]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.blogArticle]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.bug]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.checklist]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.coachAudioTranscript]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.coachCallToActionChecklist]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.coachHomeRules]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.coachVideoTranscript]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.correction]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.cookPreparation]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.cookStep]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.cookIngredients]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.cookRemark]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.cookVariation]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.cookInsert]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.cookArrangement]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.cookPracticeAdvise]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.cookPlate]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.cookRecommendation]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.cookPersonalRecommendation]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.cookSideDrink]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.cookSideDish]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.cookTimer]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.danger]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.details1]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.details]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.editorial]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.editorNote]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.featured]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.help]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.hint]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.info]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langLearningOutcomes]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langEnablingLanguageSkills]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langLifeSkills]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langEnglishAroundWorld]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langGoodToKnow]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langLearningGoal]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langLearningStrategy]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langLikeALocal]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langMaterial]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langUsefulPhrases]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langLevelDown]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langLevelUp]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langExtraActivity]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langVideoScript]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langAudioScript]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langVocabulary]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langHomework]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langTeacherNote]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.langTeacherPronunciation]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.message]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.newspaperArticle]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.note]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.noteAi]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.notebookArticle]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.preparationNote]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.releaseNotesSummary]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.remark]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.selfAssessment]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.separator]:{since:"1.4.15",baseBitType:l.BitType.example},[l.BitType.sideNote]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.summary]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.summaryAi]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.videoTranscript]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.warning]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.workbookArticle]:{since:"1.3.0",baseBitType:l.BitType.example},[l.BitType.exampleList]:{since:"1.4.13",baseBitType:l.BitType.example,cardSet:i.CardSetConfigKey._exampleBitList,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,rootExampleType:c.ExampleType.string},[l.BitType.assignmentList]:{since:"1.4.13",baseBitType:l.BitType.exampleList},[l.BitType.pageFooter]:{since:"1.4.13",baseBitType:l.BitType.exampleList},[l.BitType.flashcard]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags}],cardSet:i.CardSetConfigKey._flashcards,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.BitType.flashcard1]:{since:"1.3.0",baseBitType:l.BitType.flashcard},[l.BitType.focusImage]:{since:"1.3.0",baseBitType:l.BitType.image,tags:[{type:s.BitTagType.property,configKey:n.PropertyConfigKey.focusX},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.focusY}]},[l.BitType.highlightText]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.image]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImage,minCount:1}],bodyAllowed:!0},[l.BitType.appCreateBitsFromImage]:{since:"1.3.0",baseBitType:l.BitType.image},[l.BitType.appGetScreenshot]:{since:"1.3.0",baseBitType:l.BitType.image},[l.BitType.detailsImage]:{since:"1.3.0",baseBitType:l.BitType.image},[l.BitType.figure]:{since:"1.3.0",deprecated:"1.4.0",baseBitType:l.BitType.image},[l.BitType.imageBanner]:{since:"1.3.0",baseBitType:l.BitType.image},[l.BitType.imageFigure]:{since:"1.3.0",baseBitType:l.BitType.image},[l.BitType.imageLandscape]:{since:"1.3.0",baseBitType:l.BitType.image},[l.BitType.imageMood]:{since:"1.3.0",baseBitType:l.BitType.image},[l.BitType.imagePortrait]:{since:"1.3.0",baseBitType:l.BitType.image},[l.BitType.imagePrototype]:{since:"1.3.0",baseBitType:l.BitType.image},[l.BitType.imageSeparator]:{since:"1.4.15",baseBitType:l.BitType.image},[l.BitType.imageScreenshot]:{since:"1.3.0",baseBitType:l.BitType.image},[l.BitType.imageStyled]:{since:"1.3.0",baseBitType:l.BitType.image},[l.BitType.imageSuperWide]:{since:"1.3.0",baseBitType:l.BitType.image},[l.BitType.imageZoom]:{since:"1.3.0",baseBitType:l.BitType.image},[l.BitType.langLifeSkillIcon]:{since:"1.3.0",baseBitType:l.BitType.image},[l.BitType.lifeSkillSticker]:{since:"1.3.0",baseBitType:l.BitType.image},[l.BitType.pageBanner]:{since:"1.4.3",baseBitType:l.BitType.image},[l.BitType.screenshot]:{since:"1.3.0",deprecated:"1.4.0",baseBitType:l.BitType.image},[l.BitType.imageLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageLink,minCount:1}],bodyAllowed:!0},[l.BitType.imageOnDevice]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImage},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_imageSource}],bodyAllowed:!0},[l.BitType.imageResponsive]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceImageResponsive}],bodyAllowed:!0},[l.BitType.internalLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.tag_reference}],bodyAllowed:!0},[l.BitType.interview]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars}],cardSet:i.CardSetConfigKey._questions,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.BitType.interviewInstructionGrouped]:{since:"1.3.0",baseBitType:l.BitType.interview},[l.BitType.botInterview]:{since:"1.3.0",baseBitType:l.BitType.interview},[l.BitType.learningPathBook]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_learningPathCommon}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.bookLink]:{since:"1.3.0",baseBitType:l.BitType.learningPathBook},[l.BitType.bookLinkNext]:{since:"1.3.0",baseBitType:l.BitType.learningPathBook},[l.BitType.bookLinkPrev]:{since:"1.3.0",baseBitType:l.BitType.learningPathBook},[l.BitType.learningPathClassroomEvent]:{since:"1.3.0",baseBitType:l.BitType.learningPathBook},[l.BitType.learningPathClassroomTraining]:{since:"1.3.0",baseBitType:l.BitType.learningPathBook},[l.BitType.learningPathClosing]:{since:"1.3.0",baseBitType:l.BitType.learningPathBook},[l.BitType.learningPathFeedback]:{since:"1.3.0",baseBitType:l.BitType.learningPathBook},[l.BitType.learningPathLearningGoal]:{since:"1.3.0",baseBitType:l.BitType.learningPathBook},[l.BitType.learningPathLti]:{since:"1.3.0",baseBitType:l.BitType.learningPathBook},[l.BitType.learningPathSign]:{since:"1.3.0",baseBitType:l.BitType.learningPathBook},[l.BitType.learningPathStep]:{since:"1.3.0",baseBitType:l.BitType.learningPathBook},[l.BitType.learningPathBotTraining]:{since:"1.3.0",baseBitType:l.BitType.learningPathBook,tags:[{type:s.BitTagType.property,configKey:n.PropertyConfigKey.bot}]},[l.BitType.learningPathExternalLink]:{since:"1.3.0",baseBitType:l.BitType.learningPathBook,tags:[{type:s.BitTagType.property,configKey:n.PropertyConfigKey.externalLink},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.externalLinkText}]},[l.BitType.learningPathVideoCall]:{since:"1.3.0",baseBitType:l.BitType.learningPathBook,tags:[{type:s.BitTagType.property,configKey:n.PropertyConfigKey.videoCallLink}]},[l.BitType.mark]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_markConfig},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_mark}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.match]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags}],cardSet:i.CardSetConfigKey._matchPairs,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.BitType.matchAll]:{since:"1.3.0",baseBitType:l.BitType.match},[l.BitType.matchReverse]:{since:"1.3.0",baseBitType:l.BitType.match},[l.BitType.matchAllReverse]:{since:"1.3.0",baseBitType:l.BitType.match},[l.BitType.matchSolutionGrouped]:{since:"1.3.0",baseBitType:l.BitType.match},[l.BitType.matchMatrix]:{since:"1.3.0",baseBitType:l.BitType.match,cardSet:i.CardSetConfigKey._matchMatrix},[l.BitType.matchAudio]:{since:"1.3.0",baseBitType:l.BitType.match,cardSet:i.CardSetConfigKey._matchAudioPairs},[l.BitType.matchPicture]:{since:"1.3.0",baseBitType:l.BitType.match,cardSet:i.CardSetConfigKey._matchImagePairs},[l.BitType.multipleChoice1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.coachSelfReflectionMultipleChoice1]:{since:"1.3.0",baseBitType:l.BitType.multipleChoice1},[l.BitType.multipleChoice]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_trueFalse}],cardSet:i.CardSetConfigKey._quiz,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.BitType.coachSelfReflectionMultipleChoice]:{since:"1.3.0",baseBitType:l.BitType.multipleChoice},[l.BitType.multipleChoiceText]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.coachCallToActionMultipleChoiceText]:{since:"1.3.0",baseBitType:l.BitType.multipleChoiceText},[l.BitType.coachSelfReflectionMultipleChoiceText]:{since:"1.3.0",baseBitType:l.BitType.multipleChoiceText},[l.BitType.multipleResponse1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_trueFalse}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.coachSelfReflectionMultipleResponse1]:{since:"1.3.0",baseBitType:l.BitType.multipleResponse1},[l.BitType.multipleResponse]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_trueFalse}],cardSet:i.CardSetConfigKey._quiz,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.BitType.coachSelfReflectionMultipleResponse]:{since:"1.3.0",baseBitType:l.BitType.multipleResponse},[l.BitType.page]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.thumbImage}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.pageBuyButton]:{since:"1.4.3",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.content2Buy}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.pageProduct]:{since:"1.4.17",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.product}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.pageProductList]:{since:"1.4.17",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.productList,maxCount:u.Count.infinity}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.pageProductVideo]:{since:"1.4.17",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.productVideo}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.pageProductVideoList]:{since:"1.4.17",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.productVideoList,maxCount:u.Count.infinity}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.pageSectionFolder]:{since:"1.4.17",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.productFolder}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.photo]:{since:"1.3.0",baseBitType:l.BitType.image},[l.BitType.quote]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.quotedPerson}],bodyAllowed:!0},[l.BitType.rating]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags}],bodyAllowed:!0},[l.BitType.coachSelfReflectionRating]:{since:"1.3.0",baseBitType:l.BitType.rating},[l.BitType.releaseNote]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.releaseVersion}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.reviewNote]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.title},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.resolved},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.resolvedDate},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.resolvedBy}],resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:c.ExampleType.string},[l.BitType.reviewAuthorNote]:{since:"1.3.0",baseBitType:l.BitType.reviewNote},[l.BitType.reviewReviewerNote]:{since:"1.3.0",baseBitType:l.BitType.reviewNote},[l.BitType.reviewRequestForReviewNote]:{since:"1.3.0",baseBitType:l.BitType.reviewNote},[l.BitType.reviewApprovedNote]:{since:"1.3.0",baseBitType:l.BitType.reviewNote},[l.BitType.sampleSolution]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.tag,configKey:a.TagConfigKey.anchor},{type:s.BitTagType.tag,configKey:a.TagConfigKey.tag_reference}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.sequence]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags}],cardSet:i.CardSetConfigKey._elements,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0,rootExampleType:c.ExampleType.boolean},[l.BitType.stillImageFilm]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceStillImageFilm}],bodyAllowed:!0},[l.BitType.stillImageFilmEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceStillImageFilmEmbed,minCount:1}],bodyAllowed:!0},[l.BitType.stillImageFilmLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceStillImageFilmLink,minCount:1}],bodyAllowed:!0},[l.BitType.surveyAnonymous]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.survey]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags}],resourceAttachmentAllowed:!0,bodyAllowed:!0},[l.BitType.toc]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags}],bodyAllowed:!0},[l.BitType.anchor]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.bitBookEnding]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.bitBookSummary]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.botActionAnnounce]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.botActionRatingNumber]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.botActionRemind]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.botActionSave]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.botActionTrueFalse]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.chapterSubjectMatter]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.chat]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.conclusion]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.documentUpload]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.footNote]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.groupBorn]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.groupDied]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.recordAudio]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.stickyNote]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.takePicture]:{since:"1.3.0",baseBitType:l.BitType.toc},[l.BitType.trueFalse1]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.labelTrue},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.labelFalse},{type:s.BitTagType.tag,configKey:a.TagConfigKey.true},{type:s.BitTagType.tag,configKey:a.TagConfigKey.false}],resourceAttachmentAllowed:!0,bodyAllowed:!1,rootExampleType:c.ExampleType.boolean},[l.BitType.trueFalse]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.labelTrue},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.labelFalse}],cardSet:i.CardSetConfigKey._statements,resourceAttachmentAllowed:!0,bodyAllowed:!0,footerAllowed:!0},[l.BitType.vendorPadletEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.padletId}],textFormatDefault:p.TextFormat.text,bodyAllowed:!0},[l.BitType.vendorJupyterOutput]:{since:"1.4.3",baseBitType:l.BitType.code,tags:[{type:s.BitTagType.property,configKey:n.PropertyConfigKey.jupyterId},{type:s.BitTagType.property,configKey:n.PropertyConfigKey.jupyterExecutionCount}],textFormatDefault:p.TextFormat.text,bodyAllowed:!0},[l.BitType.vendorJupyterCellCode]:{since:"1.4.3",baseBitType:l.BitType.vendorJupyterOutput},[l.BitType.vendorJupyterCellMarkdown]:{since:"1.4.3",baseBitType:l.BitType.vendorJupyterOutput},[l.BitType.vendorJupyterCellRaw]:{since:"1.4.3",baseBitType:l.BitType.vendorJupyterOutput},[l.BitType.vendorJupyterIpynb]:{since:"1.4.3",baseBitType:l.BitType.vendorJupyterOutput},[l.BitType.video]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideo,minCount:1}],bodyAllowed:!0},[l.BitType.videoLandscape]:{since:"1.3.0",baseBitType:l.BitType.video},[l.BitType.videoPortrait]:{since:"1.3.0",baseBitType:l.BitType.video},[l.BitType.videoEmbed]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoEmbed,minCount:1}],bodyAllowed:!0},[l.BitType.videoEmbedLandscape]:{since:"1.3.0",baseBitType:l.BitType.videoEmbed},[l.BitType.videoEmbedPortrait]:{since:"1.3.0",baseBitType:l.BitType.videoEmbed},[l.BitType.videoLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceVideoLink,minCount:1}],bodyAllowed:!0},[l.BitType.videoLinkLandscape]:{since:"1.3.0",baseBitType:l.BitType.videoLink},[l.BitType.videoLinkPortrait]:{since:"1.3.0",baseBitType:l.BitType.videoLink},[l.BitType.websiteLink]:{since:"1.3.0",tags:[{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:s.BitTagType.group,configKey:o.GroupConfigKey.group_resourceWebsiteLink,minCount:1}],bodyAllowed:!0}};t.BITS=g},4182:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARDS=void 0;const i=r(2574),o=r(177),n=r(3518),a=r(6194),s=r(1595),l=r(742),u=r(1035),c={[i.CardSetConfigKey._flashcards]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[i.CardSetConfigKey._elements]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[i.CardSetConfigKey._statements]:{variants:[[{tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.true,maxCount:1},{type:l.BitTagType.tag,configKey:s.TagConfigKey.false,maxCount:1},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]}]]},[i.CardSetConfigKey._quiz]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_trueFalse},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}]}]]},[i.CardSetConfigKey._questions]:{variants:[[{tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.reasonableNumOfChars},{type:l.BitTagType.tag,configKey:s.TagConfigKey.sampleSolution},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.property_sampleSolution},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[i.CardSetConfigKey._matchPairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isCaseSensitive}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[i.CardSetConfigKey._matchAudioPairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title},{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.audio}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[i.CardSetConfigKey._matchImagePairs]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title},{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.image}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[i.CardSetConfigKey._matchMatrix]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isCaseSensitive}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]},[i.CardSetConfigKey._botActionResponses]:{variants:[[{tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.reaction},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardExample}],bodyAllowed:!0}]]},[i.CardSetConfigKey._clozeList]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_gap}],bodyAllowed:!0}]]},[i.CardSetConfigKey._exampleBitList]:{variants:[[{tags:[{type:l.BitTagType.group,configKey:o.GroupConfigKey.group_standardTags},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title}],bodyAllowed:!0,repeatCount:u.Count.infinity}]]}};t.CARDS=c},9036:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GROUPS=void 0;const i=r(177),o=r(5428),n=r(3518),a=r(6194),s=r(1595),l=r(742),u=r(1035),c=r(9779),p={[i.GroupConfigKey.group_standardAllBits]:{type:o.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.id,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.externalId,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.aiGenerated},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.ageRange,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.lang},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.target,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.tag,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.icon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.iconTag},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.colorTag,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:s.TagConfigKey.anchor}]},[i.GroupConfigKey.group_standardItemLeadInstructionHint]:{type:o.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.itemLead,maxCount:2},{type:l.BitTagType.tag,configKey:s.TagConfigKey.instruction},{type:l.BitTagType.tag,configKey:s.TagConfigKey.hint}]},[i.GroupConfigKey.group_standardExample]:{type:o.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.example}]},[i.GroupConfigKey.group_standardTags]:{type:o.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardAllBits},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}]},[i.GroupConfigKey.group_imageSource]:{type:o.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.imageSource,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mockupId},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.size},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.format},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.trim}]}]},[i.GroupConfigKey.group_partner]:{type:o.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.partner,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage}]}]},[i.GroupConfigKey.group_gap]:{type:o.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.gap,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.gap,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isCaseSensitive}]}]},[i.GroupConfigKey.group_trueFalse]:{type:o.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.true,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.true,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:s.TagConfigKey.false,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}]},{type:l.BitTagType.tag,configKey:s.TagConfigKey.false,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.true,maxCount:u.Count.infinity},{type:l.BitTagType.tag,configKey:s.TagConfigKey.false,maxCount:u.Count.infinity},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardItemLeadInstructionHint},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}]}]},[i.GroupConfigKey.group_markConfig]:{type:o.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.markConfig,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.color},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.emphasis}]}]},[i.GroupConfigKey.group_mark]:{type:o.GroupConfigType.standard,tags:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.tag_mark,maxCount:u.Count.infinity,chain:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.property_mark},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_standardExample}]}]},[i.GroupConfigKey.group_bookCommon]:{type:o.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.language,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.spaceId,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.kind},{type:l.BitTagType.tag,configKey:s.TagConfigKey.title,maxCount:2},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.subtype,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.coverImage,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.publisher,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.subject,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.author,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.theme,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.publications,maxCount:u.Count.infinity}]},[i.GroupConfigKey.group_learningPathCommon]:{type:o.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.action},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.date},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.location},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.list,maxCount:u.Count.infinity},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.textReference},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isTracked},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.isInfoOnly},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.deeplink},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.book,chain:[{type:l.BitTagType.tag,configKey:s.TagConfigKey.tag_reference,maxCount:2}]}]},[i.GroupConfigKey.group_resourceCommon]:{type:o.GroupConfigType.standard,tags:[{type:l.BitTagType.property,configKey:n.PropertyConfigKey.license},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.copyright},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.caption},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.showInIndex}]},[i.GroupConfigKey.group_resourceImageCommon]:{type:o.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src1x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src2x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src3x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src4x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.width},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.height},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.alt},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.zoomDisabled}]},[i.GroupConfigKey.group_resourceAudioCommon]:{type:o.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mute},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.autoplay}]},[i.GroupConfigKey.group_resourceVideoCommon]:{type:o.GroupConfigType.standard,tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceCommon},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.width},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.height},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.duration},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.mute},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.autoplay},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.allowSubtitles},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.showSubtitles},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.alt},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.posterImage},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src1x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src2x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src3x},{type:l.BitTagType.property,configKey:n.PropertyConfigKey.src4x}]},[i.GroupConfigKey.group_resourceImage]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.image,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImageCommon}]}]},[i.GroupConfigKey.group_resourceImagePortrait]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.imagePortrait,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImageCommon}]}]},[i.GroupConfigKey.group_resourceImageLandscape]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.imageLandscape,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImageCommon}]}]},[i.GroupConfigKey.group_resourceImageEmbed]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.imageEmbed,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImageCommon}]}]},[i.GroupConfigKey.group_resourceImageLink]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.imageLink,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImageCommon}]}]},[i.GroupConfigKey.group_resourceAudio]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.audio,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudioCommon}]}]},[i.GroupConfigKey.group_resourceAudioEmbed]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.audioEmbed,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudioCommon}]}]},[i.GroupConfigKey.group_resourceAudioLink]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.audioLink,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudioCommon}]}]},[i.GroupConfigKey.group_resourceVideo]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.video,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideoCommon}]}]},[i.GroupConfigKey.group_resourceVideoEmbed]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.videoEmbed,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideoCommon}]}]},[i.GroupConfigKey.group_resourceVideoLink]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.videoLink,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideoCommon}]}]},[i.GroupConfigKey.group_resourceStillImageFilmEmbed]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.stillImageFilmEmbed,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideoCommon}]}]},[i.GroupConfigKey.group_resourceStillImageFilmLink]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.stillImageFilmLink,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceVideoCommon}]}]},[i.GroupConfigKey.group_resourceArticle]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.article,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceCommon}]}]},[i.GroupConfigKey.group_resourceArticleEmbed]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.articleEmbed,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceCommon}]}]},[i.GroupConfigKey.group_resourceArticleLink]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.articleLink,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceCommon}]}]},[i.GroupConfigKey.group_resourceDocument]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.document,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceCommon}]}]},[i.GroupConfigKey.group_resourceDocumentEmbed]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.documentEmbed,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceCommon}]}]},[i.GroupConfigKey.group_resourceDocumentLink]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.documentLink,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceCommon}]}]},[i.GroupConfigKey.group_resourceDocumentDownload]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.documentDownload,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceCommon}]}]},[i.GroupConfigKey.group_resourceAppLink]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.appLink,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceCommon}]}]},[i.GroupConfigKey.group_resourceWebsiteLink]:{type:o.GroupConfigType.resource,tags:[{type:l.BitTagType.resource,configKey:a.ResourceConfigKey.websiteLink,chain:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceCommon}]}]},[i.GroupConfigKey.group_resourceStillImageFilm]:{type:o.GroupConfigType.comboResource,comboResourceType:c.ResourceTag.stillImageFilm,tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImage,maxCount:1,minCount:1},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceAudio,maxCount:1,minCount:1}]},[i.GroupConfigKey.group_resourceImageResponsive]:{type:o.GroupConfigType.comboResource,comboResourceType:c.ResourceTag.imageResponsive,tags:[{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImagePortrait,maxCount:1,minCount:1},{type:l.BitTagType.group,configKey:i.GroupConfigKey.group_resourceImageLandscape,maxCount:1,minCount:1}]}};t.GROUPS=p},6260:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PROPERTIES=void 0;const i=r(3518),o=r(7204),n=r(5486),a=r(7953),s={[i.PropertyConfigKey.id]:{tag:a.PropertyTag.id,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.internalComment]:{tag:a.PropertyTag.internalComment,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.externalId]:{tag:a.PropertyTag.externalId,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.spaceId]:{tag:a.PropertyTag.spaceId,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.padletId]:{tag:a.PropertyTag.padletId,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.jupyterId]:{tag:a.PropertyTag.jupyterId,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.jupyterExecutionCount]:{tag:a.PropertyTag.jupyterExecutionCount,single:!0,format:n.PropertyFormat.number},[i.PropertyConfigKey.aiGenerated]:{tag:a.PropertyTag.aiGenerated,single:!0,format:n.PropertyFormat.boolean,astKey:o.PropertyAstKey.aiGenerated},[i.PropertyConfigKey.releaseVersion]:{tag:a.PropertyTag.releaseVersion,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.resolved]:{tag:a.PropertyTag.resolved,single:!0,format:n.PropertyFormat.boolean},[i.PropertyConfigKey.resolvedDate]:{tag:a.PropertyTag.resolvedDate,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.resolvedBy]:{tag:a.PropertyTag.resolvedBy,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.ageRange]:{tag:a.PropertyTag.ageRange,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.lang]:{tag:a.PropertyTag.lang,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.language]:{tag:a.PropertyTag.language,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.computerLanguage]:{tag:a.PropertyTag.computerLanguage,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.target]:{tag:a.PropertyTag.target,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.tag]:{tag:a.PropertyTag.tag,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.icon]:{tag:a.PropertyTag.icon,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.iconTag]:{tag:a.PropertyTag.iconTag,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.colorTag]:{tag:a.PropertyTag.colorTag,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.flashcardSet]:{tag:a.PropertyTag.flashcardSet,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.subtype]:{tag:a.PropertyTag.subtype,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.bookAlias]:{tag:a.PropertyTag.bookAlias,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.coverImage]:{tag:a.PropertyTag.coverImage,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.publisher]:{tag:a.PropertyTag.publisher,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.publications]:{tag:a.PropertyTag.publications,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.author]:{tag:a.PropertyTag.author,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.subject]:{tag:a.PropertyTag.subject,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.date]:{tag:a.PropertyTag.date,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.location]:{tag:a.PropertyTag.location,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.theme]:{tag:a.PropertyTag.theme,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.kind]:{tag:a.PropertyTag.kind,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.action]:{tag:a.PropertyTag.action,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.thumbImage]:{tag:a.PropertyTag.thumbImage,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.focusX]:{tag:a.PropertyTag.focusX,single:!0,format:n.PropertyFormat.number},[i.PropertyConfigKey.focusY]:{tag:a.PropertyTag.focusY,single:!0,format:n.PropertyFormat.number},[i.PropertyConfigKey.deeplink]:{tag:a.PropertyTag.deeplink,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.externalLink]:{tag:a.PropertyTag.externalLink,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.externalLinkText]:{tag:a.PropertyTag.externalLinkText,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.videoCallLink]:{tag:a.PropertyTag.videoCallLink,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.bot]:{tag:a.PropertyTag.bot,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.duration]:{tag:a.PropertyTag.duration,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.property_reference]:{tag:a.PropertyTag.reference,format:n.PropertyFormat.trimmedString,astKey:o.PropertyAstKey.referenceProperty},[i.PropertyConfigKey.list]:{tag:a.PropertyTag.list,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.textReference]:{tag:a.PropertyTag.textReference,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.isTracked]:{tag:a.PropertyTag.isTracked,single:!0,format:n.PropertyFormat.boolean},[i.PropertyConfigKey.isInfoOnly]:{tag:a.PropertyTag.isInfoOnly,single:!0,format:n.PropertyFormat.boolean},[i.PropertyConfigKey.labelTrue]:{tag:a.PropertyTag.labelTrue,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.labelFalse]:{tag:a.PropertyTag.labelFalse,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.content2Buy]:{tag:a.PropertyTag.content2Buy,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.quotedPerson]:{tag:a.PropertyTag.quotedPerson,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.partialAnswer]:{tag:a.PropertyTag.partialAnswer,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.reasonableNumOfChars]:{tag:a.PropertyTag.reasonableNumOfChars,single:!0,format:n.PropertyFormat.number},[i.PropertyConfigKey.maxCreatedBits]:{tag:a.PropertyTag.maxCreatedBits,single:!0,format:n.PropertyFormat.number},[i.PropertyConfigKey.example]:{tag:a.PropertyTag.example,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.toc]:{tag:a.PropertyTag.toc,single:!0,format:n.PropertyFormat.boolean,defaultValue:"true"},[i.PropertyConfigKey.product]:{tag:a.PropertyTag.product,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.productList]:{tag:a.PropertyTag.product,single:!1,format:n.PropertyFormat.trimmedString,astKey:o.PropertyAstKey.productList},[i.PropertyConfigKey.productVideo]:{tag:a.PropertyTag.productVideo,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.productVideoList]:{tag:a.PropertyTag.productVideo,single:!1,format:n.PropertyFormat.trimmedString,astKey:o.PropertyAstKey.productVideoList},[i.PropertyConfigKey.productFolder]:{tag:a.PropertyTag.productFolder,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.progress]:{tag:a.PropertyTag.progress,single:!0,format:n.PropertyFormat.boolean,defaultValue:"true"},[i.PropertyConfigKey.book]:{tag:a.PropertyTag.book,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.partner]:{tag:a.PropertyTag.partner,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.property_sampleSolution]:{tag:a.PropertyTag.sampleSolution,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.markConfig]:{tag:a.PropertyTag.mark,format:n.PropertyFormat.trimmedString,astKey:o.PropertyAstKey.markConfig},[i.PropertyConfigKey.property_mark]:{tag:a.PropertyTag.mark,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.color]:{tag:a.PropertyTag.color,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.emphasis]:{tag:a.PropertyTag.emphasis,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.isCaseSensitive]:{tag:a.PropertyTag.isCaseSensitive,single:!0,format:n.PropertyFormat.boolean},[i.PropertyConfigKey.reaction]:{tag:a.PropertyTag.reaction,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.imageSource]:{tag:a.PropertyTag.imageSource,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.mockupId]:{tag:a.PropertyTag.mockupId,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.size]:{tag:a.PropertyTag.size,single:!0,format:n.PropertyFormat.number},[i.PropertyConfigKey.format]:{tag:a.PropertyTag.format,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.trim]:{tag:a.PropertyTag.trim,single:!0,format:n.PropertyFormat.boolean},[i.PropertyConfigKey.width]:{tag:a.PropertyTag.width,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.height]:{tag:a.PropertyTag.height,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.license]:{tag:a.PropertyTag.license,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.copyright]:{tag:a.PropertyTag.copyright,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.caption]:{tag:a.PropertyTag.caption,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.showInIndex]:{tag:a.PropertyTag.showInIndex,single:!0,format:n.PropertyFormat.boolean},[i.PropertyConfigKey.alt]:{tag:a.PropertyTag.alt,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.zoomDisabled]:{tag:a.PropertyTag.zoomDisabled,single:!0,format:n.PropertyFormat.boolean},[i.PropertyConfigKey.src1x]:{tag:a.PropertyTag.src1x,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.src2x]:{tag:a.PropertyTag.src2x,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.src3x]:{tag:a.PropertyTag.src3x,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.src4x]:{tag:a.PropertyTag.src4x,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.mute]:{tag:a.PropertyTag.mute,single:!0,format:n.PropertyFormat.boolean},[i.PropertyConfigKey.autoplay]:{tag:a.PropertyTag.autoplay,single:!0,format:n.PropertyFormat.boolean},[i.PropertyConfigKey.allowSubtitles]:{tag:a.PropertyTag.allowSubtitles,single:!0,format:n.PropertyFormat.boolean},[i.PropertyConfigKey.showSubtitles]:{tag:a.PropertyTag.showSubtitles,single:!0,format:n.PropertyFormat.boolean},[i.PropertyConfigKey.siteName]:{tag:a.PropertyTag.siteName,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.pointerLeft]:{tag:a.PropertyTag.pointerLeft,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.pointerTop]:{tag:a.PropertyTag.pointerTop,single:!0,format:n.PropertyFormat.trimmedString},[i.PropertyConfigKey.posterImage]:{tag:a.PropertyTag.posterImage,single:!0,format:n.PropertyFormat.trimmedString}};t.PROPERTIES=s},5100:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RESOURCES=void 0;const i=r(6194),o=r(9431),n=r(9779),a={[i.ResourceConfigKey.image]:{tag:n.ResourceTag.image},[i.ResourceConfigKey.imagePortrait]:{tag:n.ResourceTag.imagePortrait,jsonKey:o.ResourceJsonKey.imagePortrait},[i.ResourceConfigKey.imageLandscape]:{tag:n.ResourceTag.imageLandscape,jsonKey:o.ResourceJsonKey.imageLandscape},[i.ResourceConfigKey.imageEmbed]:{tag:n.ResourceTag.imageEmbed,jsonKey:o.ResourceJsonKey.imageEmbed},[i.ResourceConfigKey.imageLink]:{tag:n.ResourceTag.imageLink,jsonKey:o.ResourceJsonKey.imageLink},[i.ResourceConfigKey.audio]:{tag:n.ResourceTag.audio},[i.ResourceConfigKey.audioEmbed]:{tag:n.ResourceTag.audioEmbed,jsonKey:o.ResourceJsonKey.audioEmbed},[i.ResourceConfigKey.audioLink]:{tag:n.ResourceTag.audioLink,jsonKey:o.ResourceJsonKey.audioLink},[i.ResourceConfigKey.video]:{tag:n.ResourceTag.video},[i.ResourceConfigKey.videoEmbed]:{tag:n.ResourceTag.videoEmbed,jsonKey:o.ResourceJsonKey.videoEmbed},[i.ResourceConfigKey.videoLink]:{tag:n.ResourceTag.videoLink,jsonKey:o.ResourceJsonKey.videoLink},[i.ResourceConfigKey.stillImageFilmEmbed]:{tag:n.ResourceTag.stillImageFilmEmbed,jsonKey:o.ResourceJsonKey.stillImageFilmEmbed},[i.ResourceConfigKey.stillImageFilmLink]:{tag:n.ResourceTag.stillImageFilmLink,jsonKey:o.ResourceJsonKey.stillImageFilmLink},[i.ResourceConfigKey.article]:{tag:n.ResourceTag.article},[i.ResourceConfigKey.articleEmbed]:{tag:n.ResourceTag.articleEmbed,jsonKey:o.ResourceJsonKey.articleEmbed},[i.ResourceConfigKey.articleLink]:{tag:n.ResourceTag.articleLink,jsonKey:o.ResourceJsonKey.articleLink},[i.ResourceConfigKey.document]:{tag:n.ResourceTag.document},[i.ResourceConfigKey.documentEmbed]:{tag:n.ResourceTag.documentEmbed,jsonKey:o.ResourceJsonKey.documentEmbed},[i.ResourceConfigKey.documentLink]:{tag:n.ResourceTag.documentLink,jsonKey:o.ResourceJsonKey.documentLink},[i.ResourceConfigKey.documentDownload]:{tag:n.ResourceTag.documentDownload,jsonKey:o.ResourceJsonKey.documentDownload},[i.ResourceConfigKey.appLink]:{tag:n.ResourceTag.appLink,jsonKey:o.ResourceJsonKey.appLink},[i.ResourceConfigKey.websiteLink]:{tag:n.ResourceTag.websiteLink,jsonKey:o.ResourceJsonKey.websiteLink}};t.RESOURCES=a},3622:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS=void 0;const i=r(1595),o=r(8739),n={[i.TagConfigKey.title]:{tag:o.Tag.title},[i.TagConfigKey.anchor]:{tag:o.Tag.anchor},[i.TagConfigKey.tag_reference]:{tag:o.Tag.reference},[i.TagConfigKey.property]:{tag:o.Tag.property},[i.TagConfigKey.itemLead]:{tag:o.Tag.itemLead},[i.TagConfigKey.instruction]:{tag:o.Tag.instruction},[i.TagConfigKey.hint]:{tag:o.Tag.hint},[i.TagConfigKey.true]:{tag:o.Tag.true},[i.TagConfigKey.false]:{tag:o.Tag.false},[i.TagConfigKey.sampleSolution]:{tag:o.Tag.sampleSolution},[i.TagConfigKey.gap]:{tag:o.Tag.gap},[i.TagConfigKey.tag_mark]:{tag:o.Tag.mark},[i.TagConfigKey.resource]:{tag:o.Tag.resource}};t.TAGS=n},1022:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildInfo=void 0,t.buildInfo={name:"@gmb/bitmark-parser-generator",version:"1.4.18",author:"Get More Brain Ltd",license:"ISC",description:"A bitmark parser and generator using Peggy.js"}},4369:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=void 0;const i=r(6831),o=r(2892),n=r(7448);function a(e,t,r,i){var o=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(o,a.prototype),o.expected=t,o.found=r,o.location=i,o.name="SyntaxError",o}function s(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}t.SyntaxError=a,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(a,Error),a.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,n=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,a=this.location.source+":"+n.line+":"+n.column;if(i){var l=this.location.end,u=s("",n.line.toString().length," "),c=i[o.line-1],p=(o.line===l.line?l.column:c.length+1)-o.column||1;t+="\n --\x3e "+a+"\n"+u+" |\n"+n.line+" | "+c+"\n"+u+" | "+s("",o.column-1," ")+s("",p,"^")}else t+="\n at "+a}return t},a.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)?n(e[0])+"-"+n(e[1]):n(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 n(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 a(e){return r[e.type](e)}return"Expected "+function(e){var t,r,i=e.map(a);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 s,l={},u=(r=void 0!==r?r:{}).grammarSource,c={bitmark:Zt,bit:function(){var e,t,r,i,o;e=Ft,t=[],r=Br();for(;r!==l;)t.push(r),r=Br();if((r=tr())!==l){for(i=[],o=Br();o!==l;)i.push(o),o=Br();Gt=e,e=qe(r)}else Ft=e,e=l;return e},cardContent:function(){var e,t,r;e=Ft,t=[],(r=nr())===l&&(r=dr());for(;r!==l;)t.push(r),(r=nr())===l&&(r=dr());return Gt=e,t=mt(t),e=t}},p=Zt,g="[.",d="]",y=":",f="&",h="====",m="~~~~",T="--",b="++",v="===",B="==",C="[@id",k="[",x="#",P="[▼",w="[►",S="[@",A="[%",K="[!",_="[?",I="[+",O="[-",R="[$",E="[_",L="[=",j="[&",V="^]",F="id:",G="\n",N="\r\n",D="\r",M="\u2028",U="\u2029",$=/^[^\]]/,J=/^[^:\]]/,z=/^[^&:\]]/,q=/^[ \t]/,H=/^[^\n\r\u2028\u2029]/,W=/^[ \t\n\r\u2028\u2029]/,Y=Jt("[.",!1),X=zt(["]"],!0,!1),Z=Jt("]",!1),Q=Jt(":",!1),ee=Jt("&",!1),te={type:"any"},re=Jt("====",!1),ie=Jt("~~~~",!1),oe=Jt("--",!1),ne=Jt("++",!1),ae=Jt("===",!1),se=Jt("==",!1),le=Jt("[@id",!1),ue=Jt("[",!1),ce=Jt("#",!1),pe=Jt("[▼",!1),ge=Jt("[►",!1),de=Jt("[@",!1),ye=Jt("[%",!1),fe=Jt("[!",!1),he=Jt("[?",!1),me=Jt("[+",!1),Te=Jt("[-",!1),be=Jt("[$",!1),ve=Jt("[_",!1),Be=Jt("[=",!1),Ce=Jt("[&",!1),ke=Jt("^]",!1),xe=Jt("id:",!1),Pe=zt([":","]"],!0,!1),we=zt(["&",":","]"],!0,!1),Se=(qt("Empty"),zt([" ","\t"],!1,!1)),Ae=qt("Anything"),Ke=qt("Character"),_e=zt(["\n","\r","\u2028","\u2029"],!0,!1),Ie=qt("Line"),Oe=(qt("whitespace in line"),qt("Blank Line")),Re=qt("Line Terminator"),Ee=Jt("\n",!1),Le=Jt("\r\n",!1),je=Jt("\r",!1),Ve=Jt("\u2028",!1),Fe=Jt("\u2029",!1),Ge=qt("Whitespace, then Line Terminator"),Ne=qt("whitespace"),De=zt([" ","\t","\n","\r","\u2028","\u2029"],!1,!1),Me=function(e,t){return Ar.buildBits([e,...t])},Ue=function(e){return Sr.handleRawBit(e)},$e=function(e){return e},Je=function(e){return Sr.handleRawBit(e)},ze=function(e){return e},qe=function(e){return e},He=function(e,t){return Ar.buildBit(e,t)},We=function(e){return Ar.invalidBit(e)},Ye=function(e,t){return Ar.buildBitHeader(e,t)},Xe=function(e,t){return Ar.buildTextAndResourceType(e,t)},Ze=function(e){return Sr.handleTextFormat(e)},Qe=function(e){return Sr.handleResourceType(e)},et=function(e){return Sr.handleBitContent(e)},tt=function(e){return Sr.handleTagChain(e)},rt=function(e){return e},it=function(e){return Sr.handleBitTag(e)},ot=function(e){return{type:i.TypeKey.BodyChar,value:e}},nt=function(e){return Sr.handleCardSet(e[1].flat())},at=function(){Sr.handleCardSetStart()},st=function(){Sr.handleCardSetEnd()},lt=function(e){return Sr.handleCards(e)},ut=function(e){return Sr.handleCardLineOrDivider(e,2)},ct=function(e){return Sr.handleCardLine(e)},pt=function(e){return Sr.handleCardSet(e[1].flat())},gt=function(){Sr.handleCardSetStart()},dt=function(){Sr.handleCardSetEnd()},yt=function(e){return Sr.handleCards(e)},ft=function(e){return Sr.handleCardLineOrDivider(e,1)},ht=function(e){return Sr.handleCardLine(e)},mt=function(e){return Sr.handleCardContent(e)},Tt=function(e){return{type:i.TypeKey.CardChar,value:e}},bt=function(e){return Sr.handlePropertyTag("id",e)},vt=function(e,t){return Sr.handleTag(i.TypeKey.Title,{level:e,title:t})},Bt=function(e){return Sr.handleTag(i.TypeKey.Anchor,e)},Ct=function(e){return Sr.handleTag(i.TypeKey.Reference,e)},kt=function(e,t){return Sr.handlePropertyTag(e,t)},xt=function(e){return Sr.handleTag(i.TypeKey.ItemLead,e)},Pt=function(e){return Sr.handleTag(i.TypeKey.Instruction,e)},wt=function(e){return Sr.handleTag(i.TypeKey.Hint,e)},St=function(e){return Sr.handleTag(i.TypeKey.True,e)},At=function(e){return Sr.handleTag(i.TypeKey.False,e)},Kt=function(e){return Sr.handleTag(i.TypeKey.SampleSolution,e)},_t=function(e){return Sr.handleTag(i.TypeKey.Gap,e)},It=function(e){return Sr.handleTag(i.TypeKey.Mark,e)},Ot=function(e,t){return Sr.handleResourceTag(e,t)},Rt=function(e){return e},Et=function(e){return e?e.trim():""},Lt=function(e){return e?e.trim():null},jt=function(e){return e?e.trim():""},Vt=function(){return!0},Ft=0,Gt=0,Nt=[{line:1,column:1}],Dt=0,Mt=[],Ut=0;if("startRule"in r){if(!(r.startRule in c))throw new Error("Can't start parsing from rule \""+r.startRule+'".');p=c[r.startRule]}function $t(){return t.substring(Gt,Ft)}function Jt(e,t){return{type:"literal",text:e,ignoreCase:t}}function zt(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function qt(e){return{type:"other",description:e}}function Ht(e){var r,i=Nt[e];if(i)return i;for(r=e-1;!Nt[r];)r--;for(i={line:(i=Nt[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return Nt[e]=i,i}function Wt(e,t,r){var i=Ht(e),o=Ht(t),n={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&&(n.start=u.offset(n.start),n.end=u.offset(n.end)),n}function Yt(e){Ft<Dt||(Ft>Dt&&(Dt=Ft,Mt=[]),Mt.push(e))}function Xt(e,t,r){return new a(a.buildMessage(e,t),e,t,r)}function Zt(){return function(){var e,r,i,o;e=Ft,r=[],i=xr();for(;i!==l;)r.push(i),i=xr();return i=function(){var e,r,i,o;e=Ft,r=Ft,i=[],o=er();for(;o!==l;)i.push(o),o=er();return r=t.substring(r,Ft),Gt=e,r=Ue(r),e=r,e}(),o=function(){var e,t;e=[],t=Qt();for(;t!==l;)e.push(t),t=Qt();return e}(),Gt=e,e=Me(i,o),e}()}function Qt(){var e,r,i,o;for(e=Ft,r=[],i=Br();i!==l;)r.push(i),i=Br();return(i=Cr())===l&&(i=null),o=function(){var e,r,i,o,n,a;if(e=Ft,r=Ft,i=Ft,o=function(){var e,r,i,o;e=Ft,t.substr(Ft,2)===g?(r=g,Ft+=2):(r=l,0===Ut&&Yt(Y));if(r!==l){for(i=[],$.test(t.charAt(Ft))?(o=t.charAt(Ft),Ft++):(o=l,0===Ut&&Yt(X));o!==l;)i.push(o),$.test(t.charAt(Ft))?(o=t.charAt(Ft),Ft++):(o=l,0===Ut&&Yt(X));93===t.charCodeAt(Ft)?(o=d,Ft++):(o=l,0===Ut&&Yt(Z)),o!==l?(Gt=e,e=ze(r)):(Ft=e,e=l)}else Ft=e,e=l;return e}(),o!==l){for(n=[],a=er();a!==l;)n.push(a),a=er();i=o=[o,n]}else Ft=i,i=l;r=i!==l?t.substring(r,Ft):i;r!==l&&(Gt=e,r=Je(r));return e=r,e}(),o!==l?(Gt=e,e=$e(o)):(Ft=e,e=l),e}function er(){var e,t,r,i;if(e=Ft,(t=Cr())!==l?(r=Ft,Ut++,i=rr(),Ut--,i===l?r=void 0:(Ft=r,r=l),r!==l?e=t=[t,r]:(Ft=e,e=l)):(Ft=e,e=l),e===l)if(e=[],(t=br())!==l)for(;t!==l;)e.push(t),t=br();else e=l;return e}function tr(){var e,r,i;return e=Ft,(r=rr())!==l?(i=function(){var e,t,r;e=Ft,t=[],r=ur(),r===l&&(r=pr())===l&&(r=nr())===l&&(r=lr());for(;r!==l;)t.push(r),(r=ur())===l&&(r=pr())===l&&(r=nr())===l&&(r=lr());return Gt=e,t=et(t),e=t,e}(),Gt=e,e=He(r,i)):(Ft=e,e=l),e===l&&(e=Ft,r=Ft,i=function(){var e,r;Ut++,e=[],t.length>Ft?(r=t.charAt(Ft),Ft++):(r=l,0===Ut&&Yt(te));for(;r!==l;)e.push(r),t.length>Ft?(r=t.charAt(Ft),Ft++):(r=l,0===Ut&&Yt(te));Ut--,r=l,0===Ut&&Yt(Ae);return e}(),r=t.substring(r,Ft),Gt=e,e=r=We(r)),e}function rr(){var e,r,i,o,n;return e=Ft,t.substr(Ft,2)===g?(r=g,Ft+=2):(r=l,0===Ut&&Yt(Y)),r!==l?(i=mr(),o=function(){var e,t,r;e=Ft,t=ir(),t===l&&(t=or());t===l&&(t=null);r=ir(),r===l&&(r=or());r===l&&(r=null);return Gt=e,e=Xe(t,r),e}(),93===t.charCodeAt(Ft)?(n=d,Ft++):(n=l,0===Ut&&Yt(Z)),n!==l?(Gt=e,e=Ye(i,o)):(Ft=e,e=l)):(Ft=e,e=l),e}function ir(){var e,r,i;return e=Ft,58===t.charCodeAt(Ft)?(r=y,Ft++):(r=l,0===Ut&&Yt(Q)),r!==l?(i=mr(),Gt=e,e=Ze(i)):(Ft=e,e=l),e}function or(){var e,r,i;return e=Ft,38===t.charCodeAt(Ft)?(r=f,Ft++):(r=l,0===Ut&&Yt(ee)),r!==l?(i=mr(),Gt=e,e=Qe(i)):(Ft=e,e=l),e}function nr(){var e,t,r,i,o;if(e=Ft,t=Ft,(r=sr())!==l){for(i=[],o=ar();o!==l;)i.push(o),o=ar();t=r=[r,i]}else Ft=t,t=l;return t!==l&&(Gt=e,t=tt(t)),e=t}function ar(){var e,t;return e=Ft,(t=sr())!==l&&(Gt=e,t=rt(t)),e=t}function sr(){var e,r;return e=Ft,r=function(){var e,r,i,o;e=Ft,t.substr(Ft,4)===C?(r=C,Ft+=4):(r=l,0===Ut&&Yt(le));r!==l&&(i=Tr())!==l?(o=function(){var e;93===t.charCodeAt(Ft)?(e=d,Ft++):(e=l,0===Ut&&Yt(Z));return e}(),o!==l?(Gt=e,e=bt(i)):(Ft=e,e=l)):(Ft=e,e=l);return e}(),r===l&&(r=function(){var e,r,i,o;e=Ft,t.substr(Ft,2)===S?(r=S,Ft+=2):(r=l,0===Ut&&Yt(de));r!==l&&(i=fr())!==l&&(o=Tr())!==l&&hr()!==l?(Gt=e,e=kt(i,o)):(Ft=e,e=l);return e}(),r===l&&(r=function(){var e,r,i,o;e=Ft,91===t.charCodeAt(Ft)?(r=k,Ft++):(r=l,0===Ut&&Yt(ue));if(r!==l){if(i=[],35===t.charCodeAt(Ft)?(o=x,Ft++):(o=l,0===Ut&&Yt(ce)),o!==l)for(;o!==l;)i.push(o),35===t.charCodeAt(Ft)?(o=x,Ft++):(o=l,0===Ut&&Yt(ce));else i=l;i!==l?(o=yr(),hr()!==l?(Gt=e,e=vt(i,o)):(Ft=e,e=l)):(Ft=e,e=l)}else Ft=e,e=l;return e}(),r===l&&(r=function(){var e,r,i;e=Ft,t.substr(Ft,2)===P?(r=P,Ft+=2):(r=l,0===Ut&&Yt(pe));r!==l?(i=yr(),hr()!==l?(Gt=e,e=Bt(i)):(Ft=e,e=l)):(Ft=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=Ft,t.substr(Ft,2)===w?(r=w,Ft+=2):(r=l,0===Ut&&Yt(ge));r!==l?(i=yr(),hr()!==l?(Gt=e,e=Ct(i)):(Ft=e,e=l)):(Ft=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=Ft,t.substr(Ft,2)===A?(r=A,Ft+=2):(r=l,0===Ut&&Yt(ye));r!==l?(i=yr(),hr()!==l?(Gt=e,e=xt(i)):(Ft=e,e=l)):(Ft=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=Ft,t.substr(Ft,2)===K?(r=K,Ft+=2):(r=l,0===Ut&&Yt(fe));r!==l?(i=yr(),hr()!==l?(Gt=e,e=Pt(i)):(Ft=e,e=l)):(Ft=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=Ft,t.substr(Ft,2)===_?(r=_,Ft+=2):(r=l,0===Ut&&Yt(he));r!==l?(i=yr(),hr()!==l?(Gt=e,e=wt(i)):(Ft=e,e=l)):(Ft=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=Ft,t.substr(Ft,2)===E?(r=E,Ft+=2):(r=l,0===Ut&&Yt(ve));r!==l?(i=yr(),hr()!==l?(Gt=e,e=_t(i)):(Ft=e,e=l)):(Ft=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=Ft,t.substr(Ft,2)===L?(r=L,Ft+=2):(r=l,0===Ut&&Yt(Be));r!==l?(i=yr(),hr()!==l?(Gt=e,e=It(i)):(Ft=e,e=l)):(Ft=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=Ft,t.substr(Ft,2)===R?(r=R,Ft+=2):(r=l,0===Ut&&Yt(be));r!==l?(i=yr(),hr()!==l?(Gt=e,e=Kt(i)):(Ft=e,e=l)):(Ft=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=Ft,t.substr(Ft,2)===I?(r=I,Ft+=2):(r=l,0===Ut&&Yt(me));r!==l?(i=yr(),hr()!==l?(Gt=e,e=St(i)):(Ft=e,e=l)):(Ft=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=Ft,t.substr(Ft,2)===O?(r=O,Ft+=2):(r=l,0===Ut&&Yt(Te));r!==l?(i=yr(),hr()!==l?(Gt=e,e=At(i)):(Ft=e,e=l)):(Ft=e,e=l);return e}(),r===l&&(r=function(){var e,r,i,o;e=Ft,t.substr(Ft,2)===j?(r=j,Ft+=2):(r=l,0===Ut&&Yt(Ce));r!==l&&(i=fr())!==l&&(o=Tr())!==l&&hr()!==l?(Gt=e,e=Ot(i,o)):(Ft=e,e=l);return e}()))))))))))))),r!==l&&(Gt=e,r=it(r)),e=r}function lr(){var e,r;return e=Ft,t.length>Ft?(r=t.charAt(Ft),Ft++):(r=l,0===Ut&&Yt(te)),r!==l&&(Gt=e,r=ot(r)),e=r}function ur(){var e,r,i,o,n;if(e=Ft,r=Ft,i=function(){var e,r,i,o,n,a;e=Ft,r=Cr(),r!==l?(i=Ft,Ut++,o=Ft,t.substr(Ft,4)===h?(n=h,Ft+=4):(n=l,0===Ut&&Yt(re)),n!==l&&(a=kr())!==l?o=n=[n,a]:(Ft=o,o=l),Ut--,o!==l?(Ft=i,i=void 0):i=l,i!==l?(Gt=e,e=at()):(Ft=e,e=l)):(Ft=e,e=l);return e}(),i!==l){for(o=[],n=cr();n!==l;)o.push(n),n=cr();n=function(){var e,r,i,o,n;e=Ft,r=Ft,t.substr(Ft,4)===m?(i=m,Ft+=4):(i=l,0===Ut&&Yt(ie));i===l&&(i=null);o=Ft,Ut++,n=Pr(),Ut--,n!==l?(Ft=o,o=void 0):o=l;o!==l?r=i=[i,o]:(Ft=r,r=l);r!==l&&(Gt=e,r=st());return e=r,e}(),n!==l?r=i=[i,o,n]:(Ft=r,r=l)}else Ft=r,r=l;return r!==l&&(Gt=e,r=nt(r)),e=r}function cr(){var e,r;return e=Ft,r=function(){var e,r,i,o;e=Ft,r=Ft,t.substr(Ft,4)===h?(i=h,Ft+=4):(i=l,0===Ut&&Yt(re));i!==l?((o=kr())===l&&(o=Pr()),o!==l?r=i=[i,o]:(Ft=r,r=l)):(Ft=r,r=l);r===l&&(r=Ft,t.substr(Ft,2)===T?(i=T,Ft+=2):(i=l,0===Ut&&Yt(oe)),i!==l?((o=kr())===l&&(o=Pr()),o!==l?r=i=[i,o]:(Ft=r,r=l)):(Ft=r,r=l),r===l&&(r=Ft,t.substr(Ft,2)===b?(i=b,Ft+=2):(i=l,0===Ut&&Yt(ne)),i!==l?((o=kr())===l&&(o=Pr()),o!==l?r=i=[i,o]:(Ft=r,r=l)):(Ft=r,r=l),r===l&&(r=function(){var e,r,i,o,n,a;e=Ft,r=Ft,Ut++,i=Ft,t.substr(Ft,4)===m?(o=m,Ft+=4):(o=l,0===Ut&&Yt(ie));o!==l&&(n=Pr())!==l?i=o=[o,n]:(Ft=i,i=l);Ut--,i===l?r=void 0:(Ft=r,r=l);if(r!==l){if(i=Ft,o=Ft,n=vr(),(a=Cr())!==l?o=n=[n,a]:(Ft=o,o=l),o===l){if(o=Ft,n=[],(a=br())!==l)for(;a!==l;)n.push(a),a=br();else n=l;n!==l?(a=function(){var e,r;e=Cr(),e===l&&(e=Ft,Ut++,t.length>Ft?(r=t.charAt(Ft),Ft++):(r=l,0===Ut&&Yt(te)),Ut--,r===l?e=void 0:(Ft=e,e=l));return e}(),a!==l?o=n=[n,a]:(Ft=o,o=l)):(Ft=o,o=l)}(i=o!==l?t.substring(i,Ft):o)!==l?(Gt=e,e=ct(i)):(Ft=e,e=l)}else Ft=e,e=l;return e}())));r!==l&&(Gt=e,r=ut(r));return e=r,e}(),r!==l&&(Gt=e,r=lt(r)),e=r}function pr(){var e,r,i,o,n;if(e=Ft,r=Ft,i=function(){var e,r,i,o,n,a;e=Ft,r=Cr(),r!==l?(i=Ft,Ut++,o=Ft,t.substr(Ft,3)===v?(n=v,Ft+=3):(n=l,0===Ut&&Yt(ae)),n!==l&&(a=kr())!==l?o=n=[n,a]:(Ft=o,o=l),Ut--,o!==l?(Ft=i,i=void 0):i=l,i!==l?(Gt=e,e=gt()):(Ft=e,e=l)):(Ft=e,e=l);return e}(),i!==l){for(o=[],n=gr();n!==l;)o.push(n),n=gr();n=function(){var e,r,i,o,n;e=Ft,r=Ft,t.substr(Ft,3)===v?(i=v,Ft+=3):(i=l,0===Ut&&Yt(ae));i!==l?(o=Ft,Ut++,n=Pr(),Ut--,n!==l?(Ft=o,o=void 0):o=l,o!==l?r=i=[i,o]:(Ft=r,r=l)):(Ft=r,r=l);r!==l&&(Gt=e,r=dt());return e=r,e}(),n!==l?r=i=[i,o,n]:(Ft=r,r=l)}else Ft=r,r=l;return r!==l&&(Gt=e,r=pt(r)),e=r}function gr(){var e,r,i,o,n,a,s,u,c,p,g;if(e=Ft,r=Ft,Ut++,i=Ft,t.substr(Ft,3)===v?(o=v,Ft+=3):(o=l,0===Ut&&Yt(ae)),o!==l){for(n=[],a=xr();a!==l;)n.push(a),a=xr();for(a=[],s=Ft,u=Ft,Ut++,c=Ft,(p=Cr())!==l?(t.substr(Ft,3)===v?(g=v,Ft+=3):(g=l,0===Ut&&Yt(ae)),g!==l?c=p=[p,g]:(Ft=c,c=l)):(Ft=c,c=l),Ut--,c===l?u=void 0:(Ft=u,u=l),u!==l?(t.length>Ft?(c=t.charAt(Ft),Ft++):(c=l,0===Ut&&Yt(te)),c!==l?s=u=[u,c]:(Ft=s,s=l)):(Ft=s,s=l);s!==l;)a.push(s),s=Ft,u=Ft,Ut++,c=Ft,(p=Cr())!==l?(t.substr(Ft,3)===v?(g=v,Ft+=3):(g=l,0===Ut&&Yt(ae)),g!==l?c=p=[p,g]:(Ft=c,c=l)):(Ft=c,c=l),Ut--,c===l?u=void 0:(Ft=u,u=l),u!==l?(t.length>Ft?(c=t.charAt(Ft),Ft++):(c=l,0===Ut&&Yt(te)),c!==l?s=u=[u,c]:(Ft=s,s=l)):(Ft=s,s=l);(s=wr())!==l?i=o=[o,n,a,s]:(Ft=i,i=l)}else Ft=i,i=l;return Ut--,i===l?r=void 0:(Ft=r,r=l),r!==l?(i=function(){var e,r,i,o;e=Ft,r=Ft,t.substr(Ft,3)===v?(i=v,Ft+=3):(i=l,0===Ut&&Yt(ae));i!==l&&(o=kr())!==l?r=i=[i,o]:(Ft=r,r=l);r===l&&(r=Ft,t.substr(Ft,2)===B?(i=B,Ft+=2):(i=l,0===Ut&&Yt(se)),i!==l&&(o=kr())!==l?r=i=[i,o]:(Ft=r,r=l),r===l&&(r=Ft,t.substr(Ft,2)===T?(i=T,Ft+=2):(i=l,0===Ut&&Yt(oe)),i!==l&&(o=kr())!==l?r=i=[i,o]:(Ft=r,r=l),r===l&&(r=function(){var e,r,i,o,n;e=Ft,r=Ft,i=Ft,o=vr(),n=Cr(),n!==l?i=o=[o,n]:(Ft=i,i=l);r=i!==l?t.substring(r,Ft):i;r!==l&&(Gt=e,r=ht(r));return e=r,e}())));r!==l&&(Gt=e,r=ft(r));return e=r,e}(),i!==l?(Gt=e,e=yt(i)):(Ft=e,e=l)):(Ft=e,e=l),e}function dr(){var e,r;return e=Ft,t.length>Ft?(r=t.charAt(Ft),Ft++):(r=l,0===Ut&&Yt(te)),r!==l&&(Gt=e,r=Tt(r)),e=r}function yr(){var e,r,i,o;for(e=Ft,r=Ft,i=[],t.substr(Ft,2)===V?(o=V,Ft+=2):(o=l,0===Ut&&Yt(ke)),o===l&&($.test(t.charAt(Ft))?(o=t.charAt(Ft),Ft++):(o=l,0===Ut&&Yt(X)));o!==l;)i.push(o),t.substr(Ft,2)===V?(o=V,Ft+=2):(o=l,0===Ut&&Yt(ke)),o===l&&($.test(t.charAt(Ft))?(o=t.charAt(Ft),Ft++):(o=l,0===Ut&&Yt(X)));return r=t.substring(r,Ft),Gt=e,e=r=Rt(r)}function fr(){var e,r,i,o,n;if(e=Ft,r=Ft,Ut++,t.substr(Ft,3)===F?(i=F,Ft+=3):(i=l,0===Ut&&Yt(xe)),Ut--,i===l?r=void 0:(Ft=r,r=l),r!==l){for(i=Ft,o=[],J.test(t.charAt(Ft))?(n=t.charAt(Ft),Ft++):(n=l,0===Ut&&Yt(Pe));n!==l;)o.push(n),J.test(t.charAt(Ft))?(n=t.charAt(Ft),Ft++):(n=l,0===Ut&&Yt(Pe));i=t.substring(i,Ft),Gt=e,e=Et(i)}else Ft=e,e=l;return e}function hr(){var e,r,i;if(93===t.charCodeAt(Ft)?(e=d,Ft++):(e=l,0===Ut&&Yt(Z)),e===l){for(e=Ft,r=[],i=xr();i!==l;)r.push(i),i=xr();(i=wr())!==l?e=r=[r,i]:(Ft=e,e=l)}return e}function mr(){var e,r,i,o;for(e=Ft,r=Ft,i=[],z.test(t.charAt(Ft))?(o=t.charAt(Ft),Ft++):(o=l,0===Ut&&Yt(we));o!==l;)i.push(o),z.test(t.charAt(Ft))?(o=t.charAt(Ft),Ft++):(o=l,0===Ut&&Yt(we));return r=t.substring(r,Ft),Gt=e,e=r=Lt(r)}function Tr(){var e,r,i;return e=Ft,58===t.charCodeAt(Ft)?(r=y,Ft++):(r=l,0===Ut&&Yt(Q)),r!==l?(i=yr(),Gt=e,e=jt(i)):(Ft=e,e=l),e===l&&(r="",Gt=e=Ft,e=r=Vt()),e}function br(){var e;return Ut++,H.test(t.charAt(Ft))?(e=t.charAt(Ft),Ft++):(e=l,0===Ut&&Yt(_e)),Ut--,e===l&&(l,0===Ut&&Yt(Ke)),e}function vr(){var e,t;for(Ut++,e=[],t=br();t!==l;)e.push(t),t=br();return Ut--,t=l,0===Ut&&Yt(Ie),e}function Br(){var e,r,i;for(Ut++,e=Ft,r=[],q.test(t.charAt(Ft))?(i=t.charAt(Ft),Ft++):(i=l,0===Ut&&Yt(Se));i!==l;)r.push(i),q.test(t.charAt(Ft))?(i=t.charAt(Ft),Ft++):(i=l,0===Ut&&Yt(Se));return(i=Cr())!==l?e=r=[r,i]:(Ft=e,e=l),Ut--,e===l&&(r=l,0===Ut&&Yt(Oe)),e}function Cr(){var e;return Ut++,10===t.charCodeAt(Ft)?(e=G,Ft++):(e=l,0===Ut&&Yt(Ee)),e===l&&(t.substr(Ft,2)===N?(e=N,Ft+=2):(e=l,0===Ut&&Yt(Le)),e===l&&(13===t.charCodeAt(Ft)?(e=D,Ft++):(e=l,0===Ut&&Yt(je)),e===l&&(8232===t.charCodeAt(Ft)?(e=M,Ft++):(e=l,0===Ut&&Yt(Ve)),e===l&&(8233===t.charCodeAt(Ft)?(e=U,Ft++):(e=l,0===Ut&&Yt(Fe)))))),Ut--,e===l&&(l,0===Ut&&Yt(Re)),e}function kr(){var e,r,i;for(Ut++,e=Ft,r=[],q.test(t.charAt(Ft))?(i=t.charAt(Ft),Ft++):(i=l,0===Ut&&Yt(Se));i!==l;)r.push(i),q.test(t.charAt(Ft))?(i=t.charAt(Ft),Ft++):(i=l,0===Ut&&Yt(Se));return(i=Cr())!==l?e=r=[r,i]:(Ft=e,e=l),Ut--,e===l&&(r=l,0===Ut&&Yt(Ge)),e}function xr(){var e;return Ut++,W.test(t.charAt(Ft))?(e=t.charAt(Ft),Ft++):(e=l,0===Ut&&Yt(De)),Ut--,e===l&&(l,0===Ut&&Yt(Ne)),e}function Pr(){var e,r;return(e=kr())===l&&(e=Ft,Ut++,t.length>Ft?(r=t.charAt(Ft),Ft++):(r=l,0===Ut&&Yt(te)),Ut--,r===l?e=void 0:(Ft=e,e=l)),e}function wr(){var e,r;return e=Ft,Ut++,t.length>Ft?(r=t.charAt(Ft),Ft++):(r=l,0===Ut&&Yt(te)),Ut--,r===l?e=void 0:(Ft=e,e=l),e}const Sr=new o.BitmarkPegParserHelper({parse:e,parserText:$t,parserLocation:Kr}),Ar=new n.BitmarkPegParserProcessor({parse:e,parserText:$t,parserLocation:Kr});function Kr(){const e=Wt(Gt,Ft);return e?(delete e.source,e):e}function Wt(e,t,r){var i=Ht(e),o=Ht(t),n={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&&(n.start=u.offset(n.start),n.end=u.offset(n.end)),n}if((s=p())!==l&&Ft===t.length)return s;throw s!==l&&Ft<t.length&&Yt({type:"end"}),Xt(Mt,Dt<t.length?t.charAt(Dt):null,Dt<t.length?Wt(Dt,Dt+1):Wt(Dt,Dt))}},4764:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=void 0;const i=r(8159);function o(e){let t=e||"";return t=i.Breakscape.unbreakscape(t),t}function n(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkPlusString"}):u(e,{startRule:"bitmarkPlusString"})}function a(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkMinusMinusString"}):u(e,{startRule:"bitmarkMinusMinusString"})}function s(e,t,r,i){var o=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(o,s.prototype),o.expected=t,o.found=r,o.location=i,o.name="SyntaxError",o}function l(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}function u(e,t){var r,i={},l=(t=void 0!==t?t:{}).grammarSource,u={bitmarkPlusPlus:ji,bitmarkPlus:function(){var e,t;Ai++,e=xi,t=oo(),e,t=Yr(t),e=t,Ai--,t=i,0===Ai&&Ei(je);return e},bitmarkMinusMinus:function(){var e,t;Ai++,e=xi,t=go(),e,t=fi(t),e=t,Ai--,t=i,0===Ai&&Ei($t);return e},bitmarkPlusString:function(){var e;Ai++,e=oo(),Ai--,i,0===Ai&&Ei(at);return e},bitmarkMinusMinusString:go},c=ji,p="|",g=":",d="### ",y="## ",f="# ",h="code",m="bitmark++",T="bitmark--",b="JavaScript",v="• ",B="•1 ",C="•+ ",k="•- ",x="\t",P="image",w=" ",S="#",A="@",K="width",_="height",I="=",O="𝑓",R="link:",E="var:",L="code:",j="color:",V="bold",F="italic",G="light",N="highlight",D="strike",M="sub",U="super",$="ins",J="del",z="aqua",q="black",H="blue",W="pink",Y="fuchsia",X="lightgrey",Z="gray",Q="darkgray",ee="green",te="lime",re="magenta",ie="maroon",oe="navy",ne="olive",ae="orange",se="purple",le="red",ue="silver",ce="teal",pe="violet",ge="white",de="yellow",ye="*",fe="_",he="`",me="!",Te="[!",be="]",ve="\n",Be="\r\n",Ce="\r",ke="\u2028",xe="\u2029",Pe="http",we="s",Se="://",Ae="mailto:",Ke="~",_e="^",Ie="'",Oe=/^[ \t]/,Re=/^[0-9]/,Ee=/^[^\n\r\u2028\u2029]/,Le=/^[a-zA-Z0-9!*'()=+-\/._?#@[\]$&(),;%:{}]/,je=Ii("StyledText"),Ve=Ki("|",!1),Fe=Ki(":",!1),Ge=Ki("### ",!1),Ne=Ki("## ",!1),De=Ki("# ",!1),Me=Ki("code",!1),Ue=_i([" ","\t"],!1,!1),$e=Ki("bitmark++",!1),Je=Ki("bitmark--",!1),ze=Ki("JavaScript",!1),qe=Ki("• ",!1),He=Ki("•1 ",!1),We=Ki("•+ ",!1),Ye=Ki("•- ",!1),Xe={type:"any"},Ze=Ki("\t",!1),Qe=Ki("image",!1),et=Ki(" ",!1),tt=Ki("#",!1),rt=Ki("@",!1),it=_i([["0","9"]],!1,!1),ot=Ki("width",!1),nt=Ki("height",!1),at=Ii("StyledString"),st=Ki("=",!1),lt=Ki("𝑓",!1),ut=Ki("link:",!1),ct=Ki("var:",!1),pt=Ki("code:",!1),gt=Ki("color:",!1),dt=Ki("bold",!1),yt=Ki("italic",!1),ft=Ki("light",!1),ht=Ki("highlight",!1),mt=Ki("strike",!1),Tt=Ki("sub",!1),bt=Ki("super",!1),vt=Ki("ins",!1),Bt=Ki("del",!1),Ct=Ki("aqua",!1),kt=Ki("black",!1),xt=Ki("blue",!1),Pt=Ki("pink",!1),wt=Ki("fuchsia",!1),St=Ki("lightgrey",!1),At=Ki("gray",!1),Kt=Ki("darkgray",!1),_t=Ki("green",!1),It=Ki("lime",!1),Ot=Ki("magenta",!1),Rt=Ki("maroon",!1),Et=Ki("navy",!1),Lt=Ki("olive",!1),jt=Ki("orange",!1),Vt=Ki("purple",!1),Ft=Ki("red",!1),Gt=Ki("silver",!1),Nt=Ki("teal",!1),Dt=Ki("violet",!1),Mt=Ki("white",!1),Ut=Ki("yellow",!1),$t=Ii("MinimalStyledText"),Jt=Ii("MinimalStyledString"),zt=Ki("*",!1),qt=Ki("_",!1),Ht=Ki("`",!1),Wt=Ki("!",!1),Yt=Ki("[!",!1),Xt=Ki("]",!1),Zt=Ii("Line Terminator"),Qt=Ki("\n",!1),er=Ki("\r\n",!1),tr=Ki("\r",!1),rr=Ki("\u2028",!1),ir=Ki("\u2029",!1),or=(Ii("whitespace in line"),Ii("space"),Ii("language tag separator"),Ii("white space, separator"),_i(["\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!1,!1),_i(["\n","\r","\u2028","\u2029"],!1,!1),_i(["\n","\r","\u2028","\u2029"],!0,!1)),nr=(_i(["\n","\r","\u2028","\u2029","\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!0,!1),Ki("http",!1)),ar=Ki("s",!1),sr=Ki("://",!1),lr=Ki("mailto:",!1),ur=_i([["a","z"],["A","Z"],["0","9"],"!","*","'","(",")","=",["+","/"],".","_","?","#","@","[","]","$","&","(",")",",",";","%",":","{","}"],!1,!1),cr=Ki("~",!1),pr=Ki("^",!1),gr=Ki("'",!1),dr=function(e){return Object.assign({},e)},yr=function(e){return Object.assign({},e)},fr=function(e){return Object.assign({},e)},hr=function(e){return Object.assign({},e)},mr=function(e){return Object.assign({},e)},Tr=function(){return[]},br=function(e,t){return{type:"heading",content:a(t),attrs:{level:e.length-1}}},vr=function(e){return e},Br=function(e,t){return Object.assign(Object.assign({},e),{content:t})},Cr=function(){return{type:"codeBlock",language:""}},kr=function(e){return{type:"codeBlock",attrs:{language:e.trim().toLowerCase()}}},xr=function(e){return[{type:"text",text:o(e.trim())}]},Pr=function(e){return e},wr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Sr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Ar=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Kr=function(){return{type:"bulletList"}},_r=function(){return{type:"orderedList"}},Ir=function(){return{type:"taskList"}},Or=function(e,t,r,i){return i},Rr=function(e,t,r,i){let o="bulletList";"•1 "==e&&(o="orderedList"),"•+ "!=e&&"•- "!=e||(o="taskList");let a=[{type:"paragraph",attrs:{},content:n((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),a.push(e)}let s="listItem",l={};if("taskList"==o){s="taskItem";let t=!1;"•+ "==e&&(t=!0),l={checked:t}}return{type:s,content:a,parent:o,attrs:l}},Er=function(e){return e},Lr=function(e){return e.join("")===Oo},jr=function(e){return e.length>Oo.length},Vr=function(e){Io.push(Oo),Oo=e.join("")},Fr=function(){return Oo=Io.pop(),!0},Gr=function(e){return{type:"paragraph",content:n(e.trim()),attrs:{}}},Nr=function(e){return{type:"paragraph",content:n(e.trim()),attrs:{}}},Dr=function(e){return{type:"paragraph",content:n(e.trim()),attrs:{}}},Mr=function(e){return e},Ur=function(e,t,r){const i=Object.assign({},...r);let o=i.captionAlign||"left";delete i.captionAlign;let n=i.alt||null;delete i.alt;let a=i.caption||null;delete i.caption;let s=i.align||"center";return delete i.align,{type:e,attrs:Object.assign({textAlign:o,src:t,alt:n,title:a,class:s},i)}},$r=function(e){return e},Jr=function(e){return{comment:e}},zr=function(e,t){return{[e]:parseInt(t)}},qr=function(e,t){return{type:"error",msg:e+" must be an positive integer.",found:t}},Hr=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()},Zr=function(){return{type:"hardBreak"}},Qr=function(e){return{text:o(e),type:"text"}},ei=function(e){return{index:+e,type:"bit"}},ti=function(e,t){return t||(t=[]),{marks:t,text:o(e),type:"text"}},ri=function(e){return{marks:[{type:"bold"}],text:o(e),type:"text"}},ii=function(e){return{marks:[{type:"italic"}],text:o(e),type:"text"}},oi=function(e){return{marks:[{type:"light"}],text:o(e),type:"text"}},ni=function(e){return{marks:[{type:"highlight"}],text:o(e),type:"text"}},ai=function(e){return{marks:[{type:"link",attrs:{href:(e.pr+e.t).trim(),target:"_blank"}}],text:e.t,type:"text"}},si=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"}}},pi=function(e){return{type:"code",attrs:{language:e.trim().toLowerCase()}}},gi=function(e){return{type:"color",attrs:{color:e}}},di=function(e){return{type:e}},yi=function(e){return{type:"comment",comment:e}},fi=function(e){return[{type:"paragraph",content:e,attrs:{}}]},hi=function(e,t){return e?[e,...t.flat()]:t.flat()},mi=function(e){return{text:o(e),type:"text"}},Ti=function(e){return{index:+e,type:"bit"}},bi=function(e){return{marks:[{type:"bold"}],text:o(e),type:"text"}},vi=function(e){return{marks:[{type:"italic"}],text:o(e),type:"text"}},Bi=function(e){return{marks:[{type:"light"}],text:o(e),type:"text"}},Ci=function(e){return{marks:[{type:"highlight"}],text:o(e),type:"text"}},ki=function(e,t){return{pr:e,t}},xi=0,Pi=[{line:1,column:1}],wi=0,Si=[],Ai=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 _i(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Ii(e){return{type:"other",description:e}}function Oi(t){var r,i=Pi[t];if(i)return i;for(r=t-1;!Pi[r];)r--;for(i={line:(i=Pi[r]).line,column:i.column};r<t;)10===e.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return Pi[t]=i,i}function Ri(e,t,r){var i=Oi(e),o=Oi(t),n={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&&(n.start=l.offset(n.start),n.end=l.offset(n.end)),n}function Ei(e){xi<wi||(xi>wi&&(wi=xi,Si=[]),Si.push(e))}function Li(e,t,r){return new s(s.buildMessage(e,t),e,t,r)}function ji(){var e,t;if(Ai++,e=[],(t=Vi())!==i)for(;t!==i;)e.push(t),t=Vi();else e=i;return e===i&&(e=function(){var e,t;return e=xi,t="",e,t=Tr(),e=t,e}()),Ai--,e===i&&(t=i,0===Ai&&Ei(je)),e}function Vi(){var t,r;return t=xi,r=function(){var t,r,o,n,a;if(t=xi,r=Ni(),r!==i){for(o=xi,n=[],a=Ao();a!==i;)n.push(a),a=Ao();o=e.substring(o,xi),(n=Ko())!==i?((a=So())===i&&(a=null),t,t=br(r,o)):(xi=t,t=i)}else xi=t,t=i;return t}(),r!==i&&(t,r=dr(r)),(t=r)===i&&(t=xi,r=function(){var e,t,r,o;if(e=xi,t=function(){var e,t,r;e=xi,t=xi,Ai++,r=$i(),Ai--,r!==i?(xi=t,t=void 0):t=i;t!==i&&(e,t=Kr());return e=t,e}(),t!==i){if(r=[],(o=Hi())!==i)for(;o!==i;)r.push(o),o=Hi();else r=i;r!==i?((o=So())===i&&(o=null),e,e=wr(t,r)):(xi=e,e=i)}else xi=e,e=i;if(e===i){if(e=xi,t=function(){var e,t,r;e=xi,t=xi,Ai++,r=Ji(),Ai--,r!==i?(xi=t,t=void 0):t=i;t!==i&&(e,t=_r());return e=t,e}(),t!==i){if(r=[],(o=Hi())!==i)for(;o!==i;)r.push(o),o=Hi();else r=i;r!==i?((o=So())===i&&(o=null),e,e=Sr(t,r)):(xi=e,e=i)}else xi=e,e=i;if(e===i)if(e=xi,t=function(){var e,t,r;e=xi,t=xi,Ai++,r=zi(),Ai--,r!==i?(xi=t,t=void 0):t=i;t!==i&&(e,t=Ir());return e=t,e}(),t!==i){if(r=[],(o=Hi())!==i)for(;o!==i;)r.push(o),o=Hi();else r=i;r!==i?((o=So())===i&&(o=null),e,e=Ar(t,r)):(xi=e,e=i)}else xi=e,e=i}return e}(),r!==i&&(t,r=yr(r)),(t=r)===i&&(t=xi,(r=to())!==i&&(t,r=fr(r)),(t=r)===i&&(t=xi,r=function(){var t,r,o;t=xi,r=Mi(),r!==i?(o=function(){var t,r,o,n;t=xi,r=xi,o=[],n=Ui();for(;n!==i;)o.push(n),n=Ui();return r=e.substring(r,xi),t,r=xr(r),t=r,t}(),t,t=Br(r,o)):(xi=t,t=i);return t}(),r!==i&&(t,r=hr(r)),(t=r)===i&&(t=xi,r=function(){var e,t,r;e=xi,t=xi,Ai++,r=Fi(),Ai--,r===i?t=void 0:(xi=t,t=i);t!==i&&(r=Xi())!==i?(e,e=Gr(r)):(xi=e,e=i);e===i&&(e=xi,(t=Qi())!==i&&(r=Xi())!==i?(e,e=Nr(r)):(xi=e,e=i),e===i&&(e=xi,(t=Qi())!==i?(e,e=Dr(r="")):(xi=e,e=i)));return e}(),r!==i&&(t,r=mr(r)),t=r)))),t}function Fi(){var e;return(e=Ni())===i&&(e=qi())===i&&(e=to())===i&&(e=Mi())===i&&(e=Qi()),e}function Gi(){var t;return 124===e.charCodeAt(xi)?(t=p,xi++):(t=i,0===Ai&&Ei(Ve)),t}function Ni(){var t;return e.substr(xi,4)===d?(t=d,xi+=4):(t=i,0===Ai&&Ei(Ge)),t===i&&(e.substr(xi,3)===y?(t=y,xi+=3):(t=i,0===Ai&&Ei(Ne)),t===i&&(e.substr(xi,2)===f?(t=f,xi+=2):(t=i,0===Ai&&Ei(De)))),t}function Di(){var t,r;return t=xi,Gi()!==i?(r=function(){var t;return e.substr(xi,4)===h?(t=h,xi+=4):(t=i,0===Ai&&Ei(Me)),t}(),r!==i?(t,t=vr(r)):(xi=t,t=i)):(xi=t,t=i),t}function Mi(){var t,r,o,n,a,s,l;if(t=xi,Di()!==i){for(r=xi,o=xi,n=[],Oe.test(e.charAt(xi))?(a=e.charAt(xi),xi++):(a=i,0===Ai&&Ei(Ue));a!==i;)n.push(a),Oe.test(e.charAt(xi))?(a=e.charAt(xi),xi++):(a=i,0===Ai&&Ei(Ue));(a=Ko())!==i?o=n=[n,a]:(xi=o,o=i),(r=o!==i?e.substring(r,xi):o)!==i?(t,t=Cr()):(xi=t,t=i)}else xi=t,t=i;if(t===i)if(t=xi,Di()!==i)if(58===e.charCodeAt(xi)?(r=g,xi++):(r=i,0===Ai&&Ei(Fe)),r!==i)if(o=function(){var t,r,o;e.substr(xi,9)===m?(t=m,xi+=9):(t=i,0===Ai&&Ei($e));if(t===i&&(e.substr(xi,9)===T?(t=T,xi+=9):(t=i,0===Ai&&Ei(Je)),t===i&&(e.substr(xi,10)===b?(t=b,xi+=10):(t=i,0===Ai&&Ei(ze)),t===i))){if(t=xi,r=[],(o=Ao())!==i)for(;o!==i;)r.push(o),o=Ao();else r=i;(t=r!==i?e.substring(t,xi):r)===i&&(t="")}return t}(),o!==i){for(n=xi,a=xi,s=[],Oe.test(e.charAt(xi))?(l=e.charAt(xi),xi++):(l=i,0===Ai&&Ei(Ue));l!==i;)s.push(l),Oe.test(e.charAt(xi))?(l=e.charAt(xi),xi++):(l=i,0===Ai&&Ei(Ue));(l=Ko())!==i?a=s=[s,l]:(xi=a,a=i),(n=a!==i?e.substring(n,xi):a)!==i?(t,t=kr(o)):(xi=t,t=i)}else xi=t,t=i;else xi=t,t=i;else xi=t,t=i;return t}function Ui(){var t,r,o,n,a,s;if(t=xi,r=xi,Ai++,o=Fi(),Ai--,o===i?r=void 0:(xi=r,r=i),r!==i){if(o=xi,n=xi,a=[],(s=Ao())!==i)for(;s!==i;)a.push(s),s=Ao();else a=i;a!==i&&(s=Ko())!==i?n=a=[a,s]:(xi=n,n=i),(o=n!==i?e.substring(o,xi):n)!==i?(t,t=Pr(o)):(xi=t,t=i)}else xi=t,t=i;return t===i&&(t=So()),t}function $i(){var t;return e.substr(xi,2)===v?(t=v,xi+=2):(t=i,0===Ai&&Ei(qe)),t}function Ji(){var t;return e.substr(xi,3)===B?(t=B,xi+=3):(t=i,0===Ai&&Ei(He)),t}function zi(){var t;return e.substr(xi,3)===C?(t=C,xi+=3):(t=i,0===Ai&&Ei(We)),t===i&&(e.substr(xi,3)===k?(t=k,xi+=3):(t=i,0===Ai&&Ei(Ye))),t}function qi(){var e;return(e=$i())===i&&(e=Ji())===i&&(e=zi()),e}function Hi(){var t,r,o,n,a,s,l,u;if(t=xi,Yi()!==i)if((r=qi())!==i){for(o=xi,n=xi,a=[],s=xi,l=xi,Ai++,u=So(),Ai--,u===i?l=void 0:(xi=l,l=i),l!==i?(e.length>xi?(u=e.charAt(xi),xi++):(u=i,0===Ai&&Ei(Xe)),u!==i?s=l=[l,u]:(xi=s,s=i)):(xi=s,s=i);s!==i;)a.push(s),s=xi,l=xi,Ai++,u=So(),Ai--,u===i?l=void 0:(xi=l,l=i),l!==i?(e.length>xi?(u=e.charAt(xi),xi++):(u=i,0===Ai&&Ei(Xe)),u!==i?s=l=[l,u]:(xi=s,s=i)):(xi=s,s=i);for((s=So())===i&&(s=null),n=a=[a,s],o=e.substring(o,xi),n=[],a=Wi();a!==i;)n.push(a),a=Wi();if(a=xi,s=function(){var t,r,o,n;t=xi,Ai++,r=xi,o=[],9===e.charCodeAt(xi)?(n=x,xi++):(n=i,0===Ai&&Ei(Ze));if(n!==i)for(;n!==i;)o.push(n),9===e.charCodeAt(xi)?(n=x,xi++):(n=i,0===Ai&&Ei(Ze));else o=i;o!==i?(xi,(n=(n=jr(o))?void 0:i)!==i?(r,r=Vr(o)):(xi=r,r=i)):(xi=r,r=i);Ai--,r!==i?(xi=t,t=void 0):t=i;return t}(),s!==i){for(l=[],u=Hi();u!==i;)l.push(u),u=Hi();u=function(){var e;xi,e=Fr(),e=e?void 0:i;return e}(),u!==i?(a,a=Or(r,o,n,l)):(xi=a,a=i)}else xi=a,a=i;a===i&&(a=null),t,t=Rr(r,o,n,a)}else xi=t,t=i;else xi=t,t=i;return t}function Wi(){var t,r,o,n,a,s,l,u,c,p;if(t=xi,r=xi,Ai++,o=function(){var t,r,o;t=xi,r=[],Oe.test(e.charAt(xi))?(o=e.charAt(xi),xi++):(o=i,0===Ai&&Ei(Ue));for(;o!==i;)r.push(o),Oe.test(e.charAt(xi))?(o=e.charAt(xi),xi++):(o=i,0===Ai&&Ei(Ue));o=So(),o!==i?t=r=[r,o]:(xi=t,t=i);return t}(),Ai--,o===i?r=void 0:(xi=r,r=i),r!==i)if((o=Yi())!==i)if(n=xi,Ai++,a=qi(),Ai--,a===i?n=void 0:(xi=n,n=i),n!==i){if(a=xi,s=xi,l=[],u=xi,c=xi,Ai++,p=So(),Ai--,p===i?c=void 0:(xi=c,c=i),c!==i?(e.length>xi?(p=e.charAt(xi),xi++):(p=i,0===Ai&&Ei(Xe)),p!==i?u=c=[c,p]:(xi=u,u=i)):(xi=u,u=i),u!==i)for(;u!==i;)l.push(u),u=xi,c=xi,Ai++,p=So(),Ai--,p===i?c=void 0:(xi=c,c=i),c!==i?(e.length>xi?(p=e.charAt(xi),xi++):(p=i,0===Ai&&Ei(Xe)),p!==i?u=c=[c,p]:(xi=u,u=i)):(xi=u,u=i);else l=i;l!==i&&(u=Ko())!==i?s=l=[l,u]:(xi=s,s=i),(a=s!==i?e.substring(a,xi):s)!==i?(t,t=Er(a)):(xi=t,t=i)}else xi=t,t=i;else xi=t,t=i;else xi=t,t=i;return t}function Yi(){var t,r,o;for(t=xi,r=[],9===e.charCodeAt(xi)?(o=x,xi++):(o=i,0===Ai&&Ei(Ze));o!==i;)r.push(o),9===e.charCodeAt(xi)?(o=x,xi++):(o=i,0===Ai&&Ei(Ze));return xi,(o=(o=Lr(r))?void 0:i)!==i?t=r=[r,o]:(xi=t,t=i),t}function Xi(){var t,r,o;if(t=xi,r=[],(o=Zi())!==i)for(;o!==i;)r.push(o),o=Zi();else r=i;return t=r!==i?e.substring(t,xi):r}function Zi(){var t,r,o,n,a,s;if(t=xi,r=xi,Ai++,o=Fi(),Ai--,o===i?r=void 0:(xi=r,r=i),r!==i){if(o=xi,n=xi,a=[],(s=Ao())!==i)for(;s!==i;)a.push(s),s=Ao();else a=i;a!==i&&(s=Ko())!==i?n=a=[a,s]:(xi=n,n=i),(o=n!==i?e.substring(o,xi):n)!==i?t=r=[r,o]:(xi=t,t=i)}else xi=t,t=i;return t===i&&(t=So()),t}function Qi(){var t,r,o,n,a,s;if(t=xi,(r=Gi())!==i){for(o=xi,n=xi,a=[],Oe.test(e.charAt(xi))?(s=e.charAt(xi),xi++):(s=i,0===Ai&&Ei(Ue));s!==i;)a.push(s),Oe.test(e.charAt(xi))?(s=e.charAt(xi),xi++):(s=i,0===Ai&&Ei(Ue));(s=Ko())!==i?n=a=[a,s]:(xi=n,n=i),(o=n!==i?e.substring(o,xi):n)!==i?((n=So())===i&&(n=null),t=r=[r,o,n]):(xi=t,t=i)}else xi=t,t=i;return t}function eo(){var t,r;return t=xi,Gi()!==i?(r=function(){var t;return e.substr(xi,5)===P?(t=P,xi+=5):(t=i,0===Ai&&Ei(Qe)),t}(),r!==i?(t,t=Mr(r)):(xi=t,t=i)):(xi=t,t=i),t}function to(){var t,r,o,n,a,s,l,u,c,p;if(t=xi,(r=eo())!==i)if(58===e.charCodeAt(xi)?(o=g,xi++):(o=i,0===Ai&&Ei(Fe)),o!==i)if(32===e.charCodeAt(xi)?(n=w,xi++):(n=i,0===Ai&&Ei(et)),n===i&&(n=null),a=function(){var t,r,o,n,a,s,l,u,c;t=xi,r=xi,e.substr(xi,4)===Pe?(o=Pe,xi+=4):(o=i,0===Ai&&Ei(nr));if(o!==i)if(115===e.charCodeAt(xi)?(n=we,xi++):(n=i,0===Ai&&Ei(ar)),n===i&&(n=null),e.substr(xi,3)===Se?(a=Se,xi+=3):(a=i,0===Ai&&Ei(sr)),a!==i){for(s=[],l=xi,u=xi,Ai++,c=Gi(),Ai--,c===i?u=void 0:(xi=u,u=i),u!==i&&(c=_o())!==i?l=u=[u,c]:(xi=l,l=i);l!==i;)s.push(l),l=xi,u=xi,Ai++,c=Gi(),Ai--,c===i?u=void 0:(xi=u,u=i),u!==i&&(c=_o())!==i?l=u=[u,c]:(xi=l,l=i);r=o=[o,n,a,s]}else xi=r,r=i;else xi=r,r=i;t=r!==i?e.substring(t,xi):r;return t}(),a!==i)if(Gi()!==i){for(s=function(){var e,t,r;e=xi,t=[],r=ro();for(;r!==i;)t.push(r),r=ro();return e,t=$r(t),e=t,e}(),l=xi,u=xi,c=[],Oe.test(e.charAt(xi))?(p=e.charAt(xi),xi++):(p=i,0===Ai&&Ei(Ue));p!==i;)c.push(p),Oe.test(e.charAt(xi))?(p=e.charAt(xi),xi++):(p=i,0===Ai&&Ei(Ue));(p=Ko())!==i?u=c=[c,p]:(xi=u,u=i),(l=u!==i?e.substring(l,xi):u)!==i?((u=So())===i&&(u=null),t,t=Ur(r,a,s)):(xi=t,t=i)}else xi=t,t=i;else xi=t,t=i;else xi=t,t=i;else xi=t,t=i;return t}function ro(){var t,r,o,n,a,s,l,u,c,p;if(t=xi,35===e.charCodeAt(xi)?(r=S,xi++):(r=i,0===Ai&&Ei(tt)),r!==i){for(o=xi,n=[],a=xi,s=xi,Ai++,l=Gi(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=Ao())!==i?a=s=[s,l]:(xi=a,a=i);a!==i;)n.push(a),a=xi,s=xi,Ai++,l=Gi(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=Ao())!==i?a=s=[s,l]:(xi=a,a=i);o=e.substring(o,xi),(n=Gi())!==i?(t,t=Jr(o)):(xi=t,t=i)}else xi=t,t=i;if(t===i){if(t=xi,64===e.charCodeAt(xi)?(r=A,xi++):(r=i,0===Ai&&Ei(rt)),r===i&&(r=null),(o=io())!==i)if(58===e.charCodeAt(xi)?(n=g,xi++):(n=i,0===Ai&&Ei(Fe)),n!==i){for(a=[],32===e.charCodeAt(xi)?(s=w,xi++):(s=i,0===Ai&&Ei(et));s!==i;)a.push(s),32===e.charCodeAt(xi)?(s=w,xi++):(s=i,0===Ai&&Ei(et));if(s=xi,l=[],u=xi,c=xi,Ai++,p=Gi(),Ai--,p===i?c=void 0:(xi=c,c=i),c!==i?(Re.test(e.charAt(xi))?(p=e.charAt(xi),xi++):(p=i,0===Ai&&Ei(it)),p!==i?u=c=[c,p]:(xi=u,u=i)):(xi=u,u=i),u!==i)for(;u!==i;)l.push(u),u=xi,c=xi,Ai++,p=Gi(),Ai--,p===i?c=void 0:(xi=c,c=i),c!==i?(Re.test(e.charAt(xi))?(p=e.charAt(xi),xi++):(p=i,0===Ai&&Ei(it)),p!==i?u=c=[c,p]:(xi=u,u=i)):(xi=u,u=i);else l=i;(s=l!==i?e.substring(s,xi):l)!==i&&(l=Gi())!==i?(t,t=zr(o,s)):(xi=t,t=i)}else xi=t,t=i;else xi=t,t=i;if(t===i){if(t=xi,64===e.charCodeAt(xi)?(r=A,xi++):(r=i,0===Ai&&Ei(rt)),r===i&&(r=null),(o=io())!==i)if(58===e.charCodeAt(xi)?(n=g,xi++):(n=i,0===Ai&&Ei(Fe)),n!==i){for(a=[],32===e.charCodeAt(xi)?(s=w,xi++):(s=i,0===Ai&&Ei(et));s!==i;)a.push(s),32===e.charCodeAt(xi)?(s=w,xi++):(s=i,0===Ai&&Ei(et));for(s=xi,l=[],u=xi,c=xi,Ai++,p=Gi(),Ai--,p===i?c=void 0:(xi=c,c=i),c!==i&&(p=Ao())!==i?u=c=[c,p]:(xi=u,u=i);u!==i;)l.push(u),u=xi,c=xi,Ai++,p=Gi(),Ai--,p===i?c=void 0:(xi=c,c=i),c!==i&&(p=Ao())!==i?u=c=[c,p]:(xi=u,u=i);s=e.substring(s,xi),(l=Gi())!==i?(t,t=qr(o,s)):(xi=t,t=i)}else xi=t,t=i;else xi=t,t=i;if(t===i){for(t=xi,64===e.charCodeAt(xi)?(r=A,xi++):(r=i,0===Ai&&Ei(rt)),r===i&&(r=null),o=xi,n=[],a=xi,s=xi,Ai++,(l=Gi())===i&&(58===e.charCodeAt(xi)?(l=g,xi++):(l=i,0===Ai&&Ei(Fe))),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=Ao())!==i?a=s=[s,l]:(xi=a,a=i);a!==i;)n.push(a),a=xi,s=xi,Ai++,(l=Gi())===i&&(58===e.charCodeAt(xi)?(l=g,xi++):(l=i,0===Ai&&Ei(Fe))),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=Ao())!==i?a=s=[s,l]:(xi=a,a=i);if(o=e.substring(o,xi),58===e.charCodeAt(xi)?(n=g,xi++):(n=i,0===Ai&&Ei(Fe)),n!==i){for(32===e.charCodeAt(xi)?(a=w,xi++):(a=i,0===Ai&&Ei(et)),a===i&&(a=null),s=xi,l=[],u=xi,c=xi,Ai++,p=Gi(),Ai--,p===i?c=void 0:(xi=c,c=i),c!==i&&(p=Ao())!==i?u=c=[c,p]:(xi=u,u=i);u!==i;)l.push(u),u=xi,c=xi,Ai++,p=Gi(),Ai--,p===i?c=void 0:(xi=c,c=i),c!==i&&(p=Ao())!==i?u=c=[c,p]:(xi=u,u=i);s=e.substring(s,xi),(l=Gi())!==i?(t,t=Hr(o,s)):(xi=t,t=i)}else xi=t,t=i;if(t===i){for(t=xi,64===e.charCodeAt(xi)?(r=A,xi++):(r=i,0===Ai&&Ei(rt)),r===i&&(r=null),o=xi,n=[],a=xi,s=xi,Ai++,l=Gi(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=Ao())!==i?a=s=[s,l]:(xi=a,a=i);a!==i;)n.push(a),a=xi,s=xi,Ai++,l=Gi(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=Ao())!==i?a=s=[s,l]:(xi=a,a=i);o=e.substring(o,xi),(n=Gi())!==i?(t,t=Wr(o)):(xi=t,t=i)}}}}return t}function io(){var t;return e.substr(xi,5)===K?(t=K,xi+=5):(t=i,0===Ai&&Ei(ot)),t===i&&(e.substr(xi,6)===_?(t=_,xi+=6):(t=i,0===Ai&&Ei(nt))),t}function oo(){var e,t,r,o;for(e=xi,(t=no())===i&&(t=null),r=[],(o=uo())===i&&(o=no());o!==i;)r.push(o),(o=uo())===i&&(o=no());return e,e=Xr(t,r)}function no(){var t,r,o,n,a,s,l;if(t=xi,(r=So())!==i&&(t,r=Zr()),(t=r)===i){if(t=xi,r=xi,o=[],n=xi,(a=co())===i&&(a=null),s=xi,Ai++,l=uo(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=Ao())!==i?n=a=[a,s,l]:(xi=n,n=i),n===i&&(n=xi,(a=co())!==i?(s=xi,Ai++,l=uo(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i?n=a=[a,s]:(xi=n,n=i)):(xi=n,n=i)),n!==i)for(;n!==i;)o.push(n),n=xi,(a=co())===i&&(a=null),s=xi,Ai++,l=uo(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=Ao())!==i?n=a=[a,s,l]:(xi=n,n=i),n===i&&(n=xi,(a=co())!==i?(s=xi,Ai++,l=uo(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i?n=a=[a,s]:(xi=n,n=i)):(xi=n,n=i));else o=i;(r=o!==i?e.substring(r,xi):o)!==i&&(t,r=Qr(r)),t=r}return t}function ao(){var t;return 61===e.charCodeAt(xi)?(t=I,xi++):(t=i,0===Ai&&Ei(st)),t}function so(){var t;return e.substr(xi,2)===O?(t=O,xi+=2):(t=i,0===Ai&&Ei(lt)),t}function lo(){var e,t,r;return e=xi,(t=ao())!==i&&(r=ao())!==i?e=t=[t,r]:(xi=e,e=i),e}function uo(){var t,r,o,n,a,s,l,u,c,g;if(t=xi,(r=ko())!==i){if(o=xi,n=[],Re.test(e.charAt(xi))?(a=e.charAt(xi),xi++):(a=i,0===Ai&&Ei(it)),a!==i)for(;a!==i;)n.push(a),Re.test(e.charAt(xi))?(a=e.charAt(xi),xi++):(a=i,0===Ai&&Ei(it));else n=i;(o=n!==i?e.substring(o,xi):n)!==i&&(n=xo())!==i?(t,t=ei(o)):(xi=t,t=i)}else xi=t,t=i;if(t===i){if(t=xi,(r=lo())!==i){for(32===e.charCodeAt(xi)?(o=w,xi++):(o=i,0===Ai&&Ei(et)),o===i&&(o=null),n=xi,a=[],s=xi,l=xi,Ai++,u=xi,32===e.charCodeAt(xi)?(c=w,xi++):(c=i,0===Ai&&Ei(et)),c===i&&(c=null),(g=lo())!==i?u=c=[c,g]:(xi=u,u=i),Ai--,u===i?l=void 0:(xi=l,l=i),l!==i?(e.length>xi?(u=e.charAt(xi),xi++):(u=i,0===Ai&&Ei(Xe)),u!==i?s=l=[l,u]:(xi=s,s=i)):(xi=s,s=i);s!==i;)a.push(s),s=xi,l=xi,Ai++,u=xi,32===e.charCodeAt(xi)?(c=w,xi++):(c=i,0===Ai&&Ei(et)),c===i&&(c=null),(g=lo())!==i?u=c=[c,g]:(xi=u,u=i),Ai--,u===i?l=void 0:(xi=l,l=i),l!==i?(e.length>xi?(u=e.charAt(xi),xi++):(u=i,0===Ai&&Ei(Xe)),u!==i?s=l=[l,u]:(xi=s,s=i)):(xi=s,s=i);n=e.substring(n,xi),32===e.charCodeAt(xi)?(a=w,xi++):(a=i,0===Ai&&Ei(et)),a===i&&(a=null),(s=lo())!==i?(l=function(){var t,r,o,n;t=xi,124===e.charCodeAt(xi)?(r=p,xi++):(r=i,0===Ai&&Ei(Ve));if(r!==i){for(o=[],n=po();n!==i;)o.push(n),n=po();t,t=si(o)}else xi=t,t=i;return t}(),l===i&&(l=null),t,t=ti(n,l)):(xi=t,t=i)}else xi=t,t=i;if(t===i){if(t=xi,(r=bo())!==i){for(32===e.charCodeAt(xi)?(o=w,xi++):(o=i,0===Ai&&Ei(et)),o===i&&(o=null),n=xi,a=[],s=xi,l=xi,Ai++,u=xi,32===e.charCodeAt(xi)?(c=w,xi++):(c=i,0===Ai&&Ei(et)),c===i&&(c=null),(g=bo())!==i?u=c=[c,g]:(xi=u,u=i),Ai--,u===i?l=void 0:(xi=l,l=i),l!==i?(e.length>xi?(u=e.charAt(xi),xi++):(u=i,0===Ai&&Ei(Xe)),u!==i?s=l=[l,u]:(xi=s,s=i)):(xi=s,s=i);s!==i;)a.push(s),s=xi,l=xi,Ai++,u=xi,32===e.charCodeAt(xi)?(c=w,xi++):(c=i,0===Ai&&Ei(et)),c===i&&(c=null),(g=bo())!==i?u=c=[c,g]:(xi=u,u=i),Ai--,u===i?l=void 0:(xi=l,l=i),l!==i?(e.length>xi?(u=e.charAt(xi),xi++):(u=i,0===Ai&&Ei(Xe)),u!==i?s=l=[l,u]:(xi=s,s=i)):(xi=s,s=i);n=e.substring(n,xi),32===e.charCodeAt(xi)?(a=w,xi++):(a=i,0===Ai&&Ei(et)),a===i&&(a=null),(s=bo())!==i?(t,t=ri(n)):(xi=t,t=i)}else xi=t,t=i;if(t===i){if(t=xi,(r=vo())!==i){for(32===e.charCodeAt(xi)?(o=w,xi++):(o=i,0===Ai&&Ei(et)),o===i&&(o=null),n=xi,a=[],s=xi,l=xi,Ai++,u=xi,32===e.charCodeAt(xi)?(c=w,xi++):(c=i,0===Ai&&Ei(et)),c===i&&(c=null),(g=vo())!==i?u=c=[c,g]:(xi=u,u=i),Ai--,u===i?l=void 0:(xi=l,l=i),l!==i?(e.length>xi?(u=e.charAt(xi),xi++):(u=i,0===Ai&&Ei(Xe)),u!==i?s=l=[l,u]:(xi=s,s=i)):(xi=s,s=i);s!==i;)a.push(s),s=xi,l=xi,Ai++,u=xi,32===e.charCodeAt(xi)?(c=w,xi++):(c=i,0===Ai&&Ei(et)),c===i&&(c=null),(g=vo())!==i?u=c=[c,g]:(xi=u,u=i),Ai--,u===i?l=void 0:(xi=l,l=i),l!==i?(e.length>xi?(u=e.charAt(xi),xi++):(u=i,0===Ai&&Ei(Xe)),u!==i?s=l=[l,u]:(xi=s,s=i)):(xi=s,s=i);n=e.substring(n,xi),32===e.charCodeAt(xi)?(a=w,xi++):(a=i,0===Ai&&Ei(et)),a===i&&(a=null),(s=vo())!==i?(t,t=ii(n)):(xi=t,t=i)}else xi=t,t=i;if(t===i){if(t=xi,(r=Bo())!==i){for(32===e.charCodeAt(xi)?(o=w,xi++):(o=i,0===Ai&&Ei(et)),o===i&&(o=null),n=xi,a=[],s=xi,l=xi,Ai++,u=xi,32===e.charCodeAt(xi)?(c=w,xi++):(c=i,0===Ai&&Ei(et)),c===i&&(c=null),(g=Bo())!==i?u=c=[c,g]:(xi=u,u=i),Ai--,u===i?l=void 0:(xi=l,l=i),l!==i?(e.length>xi?(u=e.charAt(xi),xi++):(u=i,0===Ai&&Ei(Xe)),u!==i?s=l=[l,u]:(xi=s,s=i)):(xi=s,s=i);s!==i;)a.push(s),s=xi,l=xi,Ai++,u=xi,32===e.charCodeAt(xi)?(c=w,xi++):(c=i,0===Ai&&Ei(et)),c===i&&(c=null),(g=Bo())!==i?u=c=[c,g]:(xi=u,u=i),Ai--,u===i?l=void 0:(xi=l,l=i),l!==i?(e.length>xi?(u=e.charAt(xi),xi++):(u=i,0===Ai&&Ei(Xe)),u!==i?s=l=[l,u]:(xi=s,s=i)):(xi=s,s=i);n=e.substring(n,xi),32===e.charCodeAt(xi)?(a=w,xi++):(a=i,0===Ai&&Ei(et)),a===i&&(a=null),(s=Bo())!==i?(t,t=oi(n)):(xi=t,t=i)}else xi=t,t=i;if(t===i){if(t=xi,(r=Co())!==i){for(32===e.charCodeAt(xi)?(o=w,xi++):(o=i,0===Ai&&Ei(et)),o===i&&(o=null),n=xi,a=[],s=xi,l=xi,Ai++,u=xi,32===e.charCodeAt(xi)?(c=w,xi++):(c=i,0===Ai&&Ei(et)),c===i&&(c=null),(g=Co())!==i?u=c=[c,g]:(xi=u,u=i),Ai--,u===i?l=void 0:(xi=l,l=i),l!==i?(e.length>xi?(u=e.charAt(xi),xi++):(u=i,0===Ai&&Ei(Xe)),u!==i?s=l=[l,u]:(xi=s,s=i)):(xi=s,s=i);s!==i;)a.push(s),s=xi,l=xi,Ai++,u=xi,32===e.charCodeAt(xi)?(c=w,xi++):(c=i,0===Ai&&Ei(et)),c===i&&(c=null),(g=Co())!==i?u=c=[c,g]:(xi=u,u=i),Ai--,u===i?l=void 0:(xi=l,l=i),l!==i?(e.length>xi?(u=e.charAt(xi),xi++):(u=i,0===Ai&&Ei(Xe)),u!==i?s=l=[l,u]:(xi=s,s=i)):(xi=s,s=i);n=e.substring(n,xi),32===e.charCodeAt(xi)?(a=w,xi++):(a=i,0===Ai&&Ei(et)),a===i&&(a=null),(s=Co())!==i?(t,t=ni(n)):(xi=t,t=i)}else xi=t,t=i;t===i&&(t=xi,r=function(){var t,r,o,n,a,s,l;t=xi,r=xi,o=xi,e.substr(xi,4)===Pe?(n=Pe,xi+=4):(n=i,0===Ai&&Ei(nr));n!==i?(115===e.charCodeAt(xi)?(a=we,xi++):(a=i,0===Ai&&Ei(ar)),a===i&&(a=null),e.substr(xi,3)===Se?(s=Se,xi+=3):(s=i,0===Ai&&Ei(sr)),s!==i?o=n=[n,a,s]:(xi=o,o=i)):(xi=o,o=i);o===i&&(e.substr(xi,7)===Ae?(o=Ae,xi+=7):(o=i,0===Ai&&Ei(lr)));r=o!==i?e.substring(r,xi):o;if(r!==i){for(o=xi,n=[],a=xi,s=xi,Ai++,l=Gi(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=_o())!==i?a=s=[s,l]:(xi=a,a=i);a!==i;)n.push(a),a=xi,s=xi,Ai++,l=Gi(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=_o())!==i?a=s=[s,l]:(xi=a,a=i);o=e.substring(o,xi),t,t=ki(r,o)}else xi=t,t=i;return t}(),r!==i&&(t,r=ai(r)),t=r)}}}}}return t}function co(){var t,r,o,n,a;if(t=xi,r=xi,(o=lo())!==i){if(n=[],(a=ao())!==i)for(;a!==i;)n.push(a),a=ao();else n=i;n!==i?r=o=[o,n]:(xi=r,r=i)}else xi=r,r=i;if((t=r!==i?e.substring(t,xi):r)===i){if(t=xi,r=xi,o=function(){var e,t,r;return e=xi,(t=so())!==i&&(r=so())!==i?e=t=[t,r]:(xi=e,e=i),e}(),o!==i){if(n=[],(a=so())!==i)for(;a!==i;)n.push(a),a=so();else n=i;n!==i?r=o=[o,n]:(xi=r,r=i)}else xi=r,r=i;if((t=r!==i?e.substring(t,xi):r)===i){if(t=xi,r=xi,(o=Bo())!==i){if(n=[],(a=mo())!==i)for(;a!==i;)n.push(a),a=mo();else n=i;n!==i?r=o=[o,n]:(xi=r,r=i)}else xi=r,r=i;if((t=r!==i?e.substring(t,xi):r)===i){if(t=xi,r=xi,(o=Co())!==i){if(n=[],(a=To())!==i)for(;a!==i;)n.push(a),a=To();else n=i;n!==i?r=o=[o,n]:(xi=r,r=i)}else xi=r,r=i;t=r!==i?e.substring(t,xi):r}}}return t}function po(){var t,r,o,n,a,s,l;if(t=xi,e.substr(xi,5)===R?(r=R,xi+=5):(r=i,0===Ai&&Ei(ut)),r!==i){for(o=xi,n=[],a=xi,s=xi,Ai++,l=Gi(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=Ao())!==i?a=s=[s,l]:(xi=a,a=i);a!==i;)n.push(a),a=xi,s=xi,Ai++,l=Gi(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=Ao())!==i?a=s=[s,l]:(xi=a,a=i);o=e.substring(o,xi),(n=Gi())!==i?(t,t=li(o)):(xi=t,t=i)}else xi=t,t=i;if(t===i){if(t=xi,e.substr(xi,4)===E?(r=E,xi+=4):(r=i,0===Ai&&Ei(ct)),r!==i){for(o=xi,n=[],a=xi,s=xi,Ai++,l=Gi(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=Ao())!==i?a=s=[s,l]:(xi=a,a=i);a!==i;)n.push(a),a=xi,s=xi,Ai++,l=Gi(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=Ao())!==i?a=s=[s,l]:(xi=a,a=i);o=e.substring(o,xi),(n=Gi())!==i?(t,t=ui(o)):(xi=t,t=i)}else xi=t,t=i;if(t===i&&(t=xi,e.substr(xi,4)===h?(r=h,xi+=4):(r=i,0===Ai&&Ei(Me)),r!==i&&(o=Gi())!==i?(t,t=ci()):(xi=t,t=i),t===i)){if(t=xi,e.substr(xi,5)===L?(r=L,xi+=5):(r=i,0===Ai&&Ei(pt)),r!==i){for(o=xi,n=[],a=xi,s=xi,Ai++,l=Gi(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=Ao())!==i?a=s=[s,l]:(xi=a,a=i);a!==i;)n.push(a),a=xi,s=xi,Ai++,l=Gi(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=Ao())!==i?a=s=[s,l]:(xi=a,a=i);o=e.substring(o,xi),(n=Gi())!==i?(t,t=pi(o)):(xi=t,t=i)}else xi=t,t=i;if(t===i&&(t=xi,e.substr(xi,6)===j?(r=j,xi+=6):(r=i,0===Ai&&Ei(gt)),r!==i?(o=function(){var t;e.substr(xi,4)===z?(t=z,xi+=4):(t=i,0===Ai&&Ei(Ct));t===i&&(e.substr(xi,5)===q?(t=q,xi+=5):(t=i,0===Ai&&Ei(kt)),t===i&&(e.substr(xi,4)===H?(t=H,xi+=4):(t=i,0===Ai&&Ei(xt)),t===i&&(e.substr(xi,4)===W?(t=W,xi+=4):(t=i,0===Ai&&Ei(Pt)),t===i&&(e.substr(xi,7)===Y?(t=Y,xi+=7):(t=i,0===Ai&&Ei(wt)),t===i&&(e.substr(xi,9)===X?(t=X,xi+=9):(t=i,0===Ai&&Ei(St)),t===i&&(e.substr(xi,4)===Z?(t=Z,xi+=4):(t=i,0===Ai&&Ei(At)),t===i&&(e.substr(xi,8)===Q?(t=Q,xi+=8):(t=i,0===Ai&&Ei(Kt)),t===i&&(e.substr(xi,5)===ee?(t=ee,xi+=5):(t=i,0===Ai&&Ei(_t)),t===i&&(e.substr(xi,4)===te?(t=te,xi+=4):(t=i,0===Ai&&Ei(It)),t===i&&(e.substr(xi,7)===re?(t=re,xi+=7):(t=i,0===Ai&&Ei(Ot)),t===i&&(e.substr(xi,6)===ie?(t=ie,xi+=6):(t=i,0===Ai&&Ei(Rt)),t===i&&(e.substr(xi,4)===oe?(t=oe,xi+=4):(t=i,0===Ai&&Ei(Et)),t===i&&(e.substr(xi,5)===ne?(t=ne,xi+=5):(t=i,0===Ai&&Ei(Lt)),t===i&&(e.substr(xi,6)===ae?(t=ae,xi+=6):(t=i,0===Ai&&Ei(jt)),t===i&&(e.substr(xi,6)===se?(t=se,xi+=6):(t=i,0===Ai&&Ei(Vt)),t===i&&(e.substr(xi,3)===le?(t=le,xi+=3):(t=i,0===Ai&&Ei(Ft)),t===i&&(e.substr(xi,6)===ue?(t=ue,xi+=6):(t=i,0===Ai&&Ei(Gt)),t===i&&(e.substr(xi,4)===ce?(t=ce,xi+=4):(t=i,0===Ai&&Ei(Nt)),t===i&&(e.substr(xi,6)===pe?(t=pe,xi+=6):(t=i,0===Ai&&Ei(Dt)),t===i&&(e.substr(xi,5)===ge?(t=ge,xi+=5):(t=i,0===Ai&&Ei(Mt)),t===i&&(e.substr(xi,6)===de?(t=de,xi+=6):(t=i,0===Ai&&Ei(Ut)))))))))))))))))))))));return t}(),o!==i&&(n=Gi())!==i?(t,t=gi(o)):(xi=t,t=i)):(xi=t,t=i),t===i&&(t=xi,r=function(){var t;e.substr(xi,4)===V?(t=V,xi+=4):(t=i,0===Ai&&Ei(dt));t===i&&(e.substr(xi,6)===F?(t=F,xi+=6):(t=i,0===Ai&&Ei(yt)),t===i&&(e.substr(xi,5)===G?(t=G,xi+=5):(t=i,0===Ai&&Ei(ft)),t===i&&(e.substr(xi,9)===N?(t=N,xi+=9):(t=i,0===Ai&&Ei(ht)),t===i&&(e.substr(xi,6)===D?(t=D,xi+=6):(t=i,0===Ai&&Ei(mt)),t===i&&(e.substr(xi,3)===M?(t=M,xi+=3):(t=i,0===Ai&&Ei(Tt)),t===i&&(e.substr(xi,5)===U?(t=U,xi+=5):(t=i,0===Ai&&Ei(bt)),t===i&&(e.substr(xi,3)===$?(t=$,xi+=3):(t=i,0===Ai&&Ei(vt)),t===i&&(e.substr(xi,3)===J?(t=J,xi+=3):(t=i,0===Ai&&Ei(Bt))))))))));return t}(),r!==i&&(o=Gi())!==i?(t,t=di(r)):(xi=t,t=i),t===i)))if(t=xi,35===e.charCodeAt(xi)?(r=S,xi++):(r=i,0===Ai&&Ei(tt)),r!==i){for(o=xi,n=[],a=xi,s=xi,Ai++,l=Gi(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=Ao())!==i?a=s=[s,l]:(xi=a,a=i);a!==i;)n.push(a),a=xi,s=xi,Ai++,l=Gi(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i&&(l=Ao())!==i?a=s=[s,l]:(xi=a,a=i);o=e.substring(o,xi),(n=Gi())!==i?(t,t=yi(o)):(xi=t,t=i)}else xi=t,t=i}}return t}function go(){var e,t,r,o;for(Ai++,e=xi,(t=yo())===i&&(t=null),r=[],(o=Po())===i&&(o=yo());o!==i;)r.push(o),(o=Po())===i&&(o=yo());return e,e=hi(t,r),Ai--,t=i,0===Ai&&Ei(Jt),e}function yo(){var t,r,o,n,a,s,l;if(t=xi,r=xi,o=[],n=xi,(a=wo())===i&&(a=null),s=xi,Ai++,l=Po(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i?(e.length>xi?(l=e.charAt(xi),xi++):(l=i,0===Ai&&Ei(Xe)),l!==i?n=a=[a,s,l]:(xi=n,n=i)):(xi=n,n=i),n!==i)for(;n!==i;)o.push(n),n=xi,(a=wo())===i&&(a=null),s=xi,Ai++,l=Po(),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i?(e.length>xi?(l=e.charAt(xi),xi++):(l=i,0===Ai&&Ei(Xe)),l!==i?n=a=[a,s,l]:(xi=n,n=i)):(xi=n,n=i);else o=i;return(r=o!==i?e.substring(r,xi):o)!==i&&(t,r=mi(r)),(t=r)===i&&(t=So()),t}function fo(){var t;return 42===e.charCodeAt(xi)?(t=ye,xi++):(t=i,0===Ai&&Ei(zt)),t}function ho(){var t;return 95===e.charCodeAt(xi)?(t=fe,xi++):(t=i,0===Ai&&Ei(qt)),t}function mo(){var t;return 96===e.charCodeAt(xi)?(t=he,xi++):(t=i,0===Ai&&Ei(Ht)),t}function To(){var t;return 33===e.charCodeAt(xi)?(t=me,xi++):(t=i,0===Ai&&Ei(Wt)),t}function bo(){var e,t,r;return e=xi,(t=fo())!==i&&(r=fo())!==i?e=t=[t,r]:(xi=e,e=i),e}function vo(){var e,t,r;return e=xi,(t=ho())!==i&&(r=ho())!==i?e=t=[t,r]:(xi=e,e=i),e}function Bo(){var e,t,r;return e=xi,(t=mo())!==i&&(r=mo())!==i?e=t=[t,r]:(xi=e,e=i),e}function Co(){var e,t,r;return e=xi,(t=To())!==i&&(r=To())!==i?e=t=[t,r]:(xi=e,e=i),e}function ko(){var t;return e.substr(xi,2)===Te?(t=Te,xi+=2):(t=i,0===Ai&&Ei(Yt)),t}function xo(){var t;return 93===e.charCodeAt(xi)?(t=be,xi++):(t=i,0===Ai&&Ei(Xt)),t}function Po(){var t,r,o,n,a,s,l,u,c;if(t=xi,ko()!==i){if(r=xi,o=[],Re.test(e.charAt(xi))?(n=e.charAt(xi),xi++):(n=i,0===Ai&&Ei(it)),n!==i)for(;n!==i;)o.push(n),Re.test(e.charAt(xi))?(n=e.charAt(xi),xi++):(n=i,0===Ai&&Ei(it));else o=i;(r=o!==i?e.substring(r,xi):o)!==i&&(o=xo())!==i?(t,t=Ti(r)):(xi=t,t=i)}else xi=t,t=i;if(t===i){if(t=xi,bo()!==i){for(32===e.charCodeAt(xi)?(r=w,xi++):(r=i,0===Ai&&Ei(et)),r===i&&(r=null),o=xi,n=[],a=xi,s=xi,Ai++,l=xi,32===e.charCodeAt(xi)?(u=w,xi++):(u=i,0===Ai&&Ei(et)),u===i&&(u=null),(c=bo())!==i?l=u=[u,c]:(xi=l,l=i),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i?(e.length>xi?(l=e.charAt(xi),xi++):(l=i,0===Ai&&Ei(Xe)),l!==i?a=s=[s,l]:(xi=a,a=i)):(xi=a,a=i);a!==i;)n.push(a),a=xi,s=xi,Ai++,l=xi,32===e.charCodeAt(xi)?(u=w,xi++):(u=i,0===Ai&&Ei(et)),u===i&&(u=null),(c=bo())!==i?l=u=[u,c]:(xi=l,l=i),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i?(e.length>xi?(l=e.charAt(xi),xi++):(l=i,0===Ai&&Ei(Xe)),l!==i?a=s=[s,l]:(xi=a,a=i)):(xi=a,a=i);o=e.substring(o,xi),32===e.charCodeAt(xi)?(n=w,xi++):(n=i,0===Ai&&Ei(et)),n===i&&(n=null),(a=bo())!==i?(t,t=bi(o)):(xi=t,t=i)}else xi=t,t=i;if(t===i){if(t=xi,vo()!==i){for(32===e.charCodeAt(xi)?(r=w,xi++):(r=i,0===Ai&&Ei(et)),r===i&&(r=null),o=xi,n=[],a=xi,s=xi,Ai++,l=xi,32===e.charCodeAt(xi)?(u=w,xi++):(u=i,0===Ai&&Ei(et)),u===i&&(u=null),(c=vo())!==i?l=u=[u,c]:(xi=l,l=i),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i?(e.length>xi?(l=e.charAt(xi),xi++):(l=i,0===Ai&&Ei(Xe)),l!==i?a=s=[s,l]:(xi=a,a=i)):(xi=a,a=i);a!==i;)n.push(a),a=xi,s=xi,Ai++,l=xi,32===e.charCodeAt(xi)?(u=w,xi++):(u=i,0===Ai&&Ei(et)),u===i&&(u=null),(c=vo())!==i?l=u=[u,c]:(xi=l,l=i),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i?(e.length>xi?(l=e.charAt(xi),xi++):(l=i,0===Ai&&Ei(Xe)),l!==i?a=s=[s,l]:(xi=a,a=i)):(xi=a,a=i);o=e.substring(o,xi),32===e.charCodeAt(xi)?(n=w,xi++):(n=i,0===Ai&&Ei(et)),n===i&&(n=null),(a=vo())!==i?(t,t=vi(o)):(xi=t,t=i)}else xi=t,t=i;if(t===i){if(t=xi,Bo()!==i){for(32===e.charCodeAt(xi)?(r=w,xi++):(r=i,0===Ai&&Ei(et)),r===i&&(r=null),o=xi,n=[],a=xi,s=xi,Ai++,l=xi,32===e.charCodeAt(xi)?(u=w,xi++):(u=i,0===Ai&&Ei(et)),u===i&&(u=null),(c=Bo())!==i?l=u=[u,c]:(xi=l,l=i),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i?(e.length>xi?(l=e.charAt(xi),xi++):(l=i,0===Ai&&Ei(Xe)),l!==i?a=s=[s,l]:(xi=a,a=i)):(xi=a,a=i);a!==i;)n.push(a),a=xi,s=xi,Ai++,l=xi,32===e.charCodeAt(xi)?(u=w,xi++):(u=i,0===Ai&&Ei(et)),u===i&&(u=null),(c=Bo())!==i?l=u=[u,c]:(xi=l,l=i),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i?(e.length>xi?(l=e.charAt(xi),xi++):(l=i,0===Ai&&Ei(Xe)),l!==i?a=s=[s,l]:(xi=a,a=i)):(xi=a,a=i);o=e.substring(o,xi),32===e.charCodeAt(xi)?(n=w,xi++):(n=i,0===Ai&&Ei(et)),n===i&&(n=null),(a=Bo())!==i?(t,t=Bi(o)):(xi=t,t=i)}else xi=t,t=i;if(t===i)if(t=xi,Co()!==i){for(32===e.charCodeAt(xi)?(r=w,xi++):(r=i,0===Ai&&Ei(et)),r===i&&(r=null),o=xi,n=[],a=xi,s=xi,Ai++,l=xi,32===e.charCodeAt(xi)?(u=w,xi++):(u=i,0===Ai&&Ei(et)),u===i&&(u=null),(c=Co())!==i?l=u=[u,c]:(xi=l,l=i),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i?(e.length>xi?(l=e.charAt(xi),xi++):(l=i,0===Ai&&Ei(Xe)),l!==i?a=s=[s,l]:(xi=a,a=i)):(xi=a,a=i);a!==i;)n.push(a),a=xi,s=xi,Ai++,l=xi,32===e.charCodeAt(xi)?(u=w,xi++):(u=i,0===Ai&&Ei(et)),u===i&&(u=null),(c=Co())!==i?l=u=[u,c]:(xi=l,l=i),Ai--,l===i?s=void 0:(xi=s,s=i),s!==i?(e.length>xi?(l=e.charAt(xi),xi++):(l=i,0===Ai&&Ei(Xe)),l!==i?a=s=[s,l]:(xi=a,a=i)):(xi=a,a=i);o=e.substring(o,xi),32===e.charCodeAt(xi)?(n=w,xi++):(n=i,0===Ai&&Ei(et)),n===i&&(n=null),(a=Co())!==i?(t,t=Ci(o)):(xi=t,t=i)}else xi=t,t=i}}}return t}function wo(){var t,r,o,n,a;if(t=xi,r=xi,(o=bo())!==i){if(n=[],(a=fo())!==i)for(;a!==i;)n.push(a),a=fo();else n=i;n!==i?r=o=[o,n]:(xi=r,r=i)}else xi=r,r=i;if((t=r!==i?e.substring(t,xi):r)===i){if(t=xi,r=xi,(o=vo())!==i){if(n=[],(a=ho())!==i)for(;a!==i;)n.push(a),a=ho();else n=i;n!==i?r=o=[o,n]:(xi=r,r=i)}else xi=r,r=i;if((t=r!==i?e.substring(t,xi):r)===i){if(t=xi,r=xi,(o=Bo())!==i){if(n=[],(a=mo())!==i)for(;a!==i;)n.push(a),a=mo();else n=i;n!==i?r=o=[o,n]:(xi=r,r=i)}else xi=r,r=i;if((t=r!==i?e.substring(t,xi):r)===i){if(t=xi,r=xi,(o=Co())!==i){if(n=[],(a=To())!==i)for(;a!==i;)n.push(a),a=To();else n=i;n!==i?r=o=[o,n]:(xi=r,r=i)}else xi=r,r=i;t=r!==i?e.substring(t,xi):r}}}return t}function So(){var t;return Ai++,10===e.charCodeAt(xi)?(t=ve,xi++):(t=i,0===Ai&&Ei(Qt)),t===i&&(e.substr(xi,2)===Be?(t=Be,xi+=2):(t=i,0===Ai&&Ei(er)),t===i&&(13===e.charCodeAt(xi)?(t=Ce,xi++):(t=i,0===Ai&&Ei(tr)),t===i&&(8232===e.charCodeAt(xi)?(t=ke,xi++):(t=i,0===Ai&&Ei(rr)),t===i&&(8233===e.charCodeAt(xi)?(t=xe,xi++):(t=i,0===Ai&&Ei(ir)))))),Ai--,t===i&&(i,0===Ai&&Ei(Zt)),t}function Ao(){var t;return Ee.test(e.charAt(xi))?(t=e.charAt(xi),xi++):(t=i,0===Ai&&Ei(or)),t}function Ko(){var t,r;return(t=So())===i&&(t=xi,Ai++,e.length>xi?(r=e.charAt(xi),xi++):(r=i,0===Ai&&Ei(Xe)),Ai--,r===i?t=void 0:(xi=t,t=i)),t}function _o(){var t;return Le.test(e.charAt(xi))?(t=e.charAt(xi),xi++):(t=i,0===Ai&&Ei(ur)),t===i&&(126===e.charCodeAt(xi)?(t=Ke,xi++):(t=i,0===Ai&&Ei(cr)),t===i&&(94===e.charCodeAt(xi)?(t=_e,xi++):(t=i,0===Ai&&Ei(pr)),t===i&&(39===e.charCodeAt(xi)?(t=Ie,xi++):(t=i,0===Ai&&Ei(gr))))),t}var Io=[],Oo="";if(e=e.trimStart(),(r=c())!==i&&xi===e.length)return r;throw r!==i&&xi<e.length&&Ei({type:"end"}),Li(Si,wi<e.length?e.charAt(wi):null,wi<e.length?Ri(wi,wi+1):Ri(wi,wi))}t.SyntaxError=s,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(s,Error),s.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,n=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,a=this.location.source+":"+n.line+":"+n.column;if(i){var s=this.location.end,u=l("",n.line.toString().length," "),c=i[o.line-1],p=(o.line===s.line?s.column:c.length+1)-o.column||1;t+="\n --\x3e "+a+"\n"+u+" |\n"+n.line+" | "+c+"\n"+u+" | "+l("",o.column-1," ")+l("",p,"^")}else t+="\n at "+a}return t},s.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)?n(e[0])+"-"+n(e[1]):n(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 n(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 a(e){return r[e.type](e)}return"Expected "+function(e){var t,r,i=e.map(a);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=u},297:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function s(e){try{l(i.throw(e))}catch(e){n(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(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkGenerator=void 0;const o=r(8256),n=r(2606),a=r(549),s=r(208),l=r(8791),u=r(1060),c=r(8565),p=r(7204),g=r(7953),d=r(9779),y=r(1353),f=r(672),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=l.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:l.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},h),null==t?void 0:t.bitmarkOptions),this.bitmarkVersion===l.BitmarkVersion.v2?void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=c.CardSetVersion.v1):void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=c.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,a.NodeType.bitmarkAst,this,void 0),this.writeLine()}enter(e,t,r){let i;const o=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[n]&&(i=o[n](e,t,r)),i}between(e,t,r,i,o){let n;const a=this,s=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof a[s]&&(n=a[s](e,t,r,i,o)),n}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){const i=e.value,o=n.Config.getBitConfig(i.bitType),a=n.Config.getBitResourcesConfig(i.bitType,i.resourceType);if(this.writeOPD(),this.writeString(i.bitType),i.textFormat){this.isWriteTextFormat(i.textFormat,o.textFormatDefault)&&(this.writeColon(),this.writeString(i.textFormat))}let s;if(o.resourceAttachmentAllowed&&i.resources&&i.resources.length>0){const e=a.comboResourceTagTypesMap;if(a.comboResourceTagTypesMap.size>0)for(const t of e.keys())s=t;else s=i.resources[0].type}s&&(this.writeAmpersand(),this.writeString(s)),this.writeCL(),this.writeNL()}between_bitsValue(e,t,r,i,o){const n=[a.NodeType.bitType,a.NodeType.textFormat,a.NodeType.level,a.NodeType.progress,a.NodeType.toc,a.NodeType.referenceEnd,a.NodeType.labelFalse];e.value.book&&n.push(a.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_internalComment(e,t,r){const i=e.value;if((null==t?void 0:t.key)===a.NodeType.bitsValue)for(let e=0;e<i.length;e++){const t=i[e],r=e===i.length-1;this.writeProperty("internalComment",t),r||this.writeNL()}}enter_labelTrue(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const o=null==t?void 0:t.value;o&&(""!=i&&this.writeProperty(g.PropertyTag.labelTrue,i,!0),o.labelFalse&&""!=o.labelFalse[0]&&this.writeProperty(g.PropertyTag.labelFalse,o.labelFalse,!0))}enter_imageSource(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==a.NodeType.bitsValue)return;const{url:o,mockupId:n,size:s,format:l,trim:u}=i;this.writeProperty("imageSource",o,!0),o&&(n&&this.writeProperty("mockupId",n,!0),s&&this.writeProperty("size",s,!0),l&&this.writeProperty("format",l,!0),f.BooleanUtils.isBoolean(u)&&this.writeProperty("trim",u,!0))}enter_partner(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==a.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)!==a.NodeType.markConfig)return;const{mark:o,color:n,emphasis:s}=i;o&&(this.writeProperty("mark",o,!0),n&&this.writeProperty("color",n,!0),s&&this.writeProperty("emphasis",s,!0),this.writeNL())}leaf_sampleSolution(e,t,r){this.writeProperty("sampleSolution",e.value)}leaf_reasonableNumOfChars(e,t,r){this.writeProperty("reasonableNumOfChars",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,n=null===(i=this.getParentNode(r,2))||void 0===i?void 0:i.value;(null==n?void 0:n.type)===u.BodyBitType.mark&&o&&(this.writeOPE(),this.writeString(o),this.writeCL())}leaf_mark(e,t,r){var i;const o=e.value,n=null===(i=this.getParentNode(r,2))||void 0===i?void 0:i.value;(null==n?void 0:n.type)===u.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.isOfBitType1(r)||(this.writeCardSetStart(),this.writeNL())}between_cardNode(e,t,r,i,o){this.isOfBitType1(o)||(this.writeNL(),this.writeCardSetCardDivider(),this.writeNL())}exit_cardNode(e,t,r){this.isOfBitType1(r)||(this.writeNL(),this.writeCardSetEnd(),this.writeNL())}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===a.NodeType.answer?(this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()):r.key===a.NodeType.alternativeAnswers&&(this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL())}leaf_answer(e,t,r){(null==t?void 0:t.key)===a.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)===a.NodeType.alternativeAnswers&&e.value&&this.writeString(e.value)}enter_statements(e,t,r){}between_statements(e,t,r,i,o){this.isOfBitType(o,s.BitType.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!==a.NodeType.choices&&r.key!==a.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===a.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()}enter_cardBits(e,t,r){}between_cardBits(e,t,r,i,o){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_cardBits(e,t,r){}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)}between_resources(e,t,r,i,o){this.writeNL()}enter_resourcesValue(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 n=e.value,a=null!==(i=null==t?void 0:t.value.isExample)&&void 0!==i&&i,s=null!==(o=null==t?void 0:t.value.isDefaultExample)&&void 0!==o&&o;a&&(s?(this.writeOPA(),this.writeString("example"),this.writeCL()):null!=n&&(this.writeOPA(),this.writeString("example"),this.writeColon(),!0===n?this.writeString("true"):!1===n?this.writeString("false"):this.writeString(n),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_isCaseSensitive(e,t,r){this.writeProperty("isCaseSensitive",e.value,!0,!1,!0)}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)!==a.NodeType.questionsValue&&(null==t?void 0:t.key)!==a.NodeType.flashcardsValue||e.value&&this.writeString(e.value)}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_zoomDisabled(e,t,r){this.writeProperty("zoomDisabled",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)!==a.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;const t=n.Config.getRawPropertiesConfig();for(const r of Object.values(t)){const t=null!==(e=r.astKey)&&void 0!==e?e:r.tag;if(t===g.PropertyTag.internalComment)continue;if(t===g.PropertyTag.example)continue;if(t===g.PropertyTag.labelTrue)continue;if(t===g.PropertyTag.labelFalse)continue;if(t===g.PropertyTag.posterImage)continue;if(t===g.PropertyTag.imageSource)continue;if(t===g.PropertyTag.partner)continue;if(t===p.PropertyAstKey.markConfig)continue;const i=`enter_${t}`;this[i]=(e,t,i)=>{null!=e.value&&(null==t?void 0:t.key)===a.NodeType.bitsValue&&this.writeProperty(r.tag,e.value,r.single,"false"===r.defaultValue,"true"===r.defaultValue)},this[i]=this[i].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===c.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetEnd(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("==="):this.write("~~~~")}writeCardSetCardDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetSideDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("=="):this.write("--")}writeCardSetVariantDivider(){this.options.cardSetVersion===c.CardSetVersion.v1?this.write("--"):this.write("++")}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeResource(e){var t;const r=e;e&&(this.writeOPAMP(),this.writeString(null!==(t=e.typeAlias)&&void 0!==t?t:e.type),e.type===d.ResourceTag.article&&r.value?(this.writeColon(),this.writeString(r.value),this.writeNL()):e.value&&(this.writeColon(),this.writeString(e.value)),this.writeCL())}writeProperty(e,t,r,i,o){let n,a=!1;if(void 0!==t&&(n=Array.isArray(t)?t:[t],n.length>0)){r&&(n=n.slice(n.length-1));for(const t of n)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(),a=!0}}a||(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,t){return!!(!(y.TextFormat.fromValue(e)===t)||this.options.explicitTextFormat)}isOfBitType1(e){return this.isOfBitType(e,[s.BitType.trueFalse1,s.BitType.multipleChoice1,s.BitType.multipleResponse1])}isOfBitType(e,t){const r=this.getBitType(e);return n.Config.isOfBitType(r,t)}getBitType(e){for(const t of e)if(t.key===a.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,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function s(e){try{l(i.throw(e))}catch(e){n(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(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkStringGenerator=void 0;const o=r(227),n=r(297);t.BitmarkStringGenerator=class{constructor(e){this.writer=new o.StringWriter,this.generator=new n.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,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function s(e){try{l(i.throw(e))}catch(e){n(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(a,s)}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 n=r(8256),a=r(8159),s=r(2606),l=r(549),u=r(208),c=r(8791),p=r(1060),g=r(7028),d=r(7204),y=r(7953),f=r(9779),h=r(1353),m=r(406),T=r(7646),b=r(672),v=r(3633),B=r(169),C={};t.JsonGenerator=class{constructor(e,t){var r;this.ast=new n.Ast,this.textParser=new m.TextParser,this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault=a.Breakscape.EMPTY_STRING,this.bodyDefault=a.Breakscape.EMPTY_STRING,this.bodyJson=this.bodyDefault,this.startPlaceholderIndex=0,this.printed=!1,this.bitmarkVersion=null!==(r=c.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:c.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},C),null==t?void 0:t.jsonOptions),this.jsonPrettifySpace=!0===this.options.prettify?2:this.options.prettify||void 0,this.bitmarkVersion===c.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?a.Breakscape.EMPTY_STRING:[],this.bodyDefault=this.options.textAsPlainText?a.Breakscape.EMPTY_STRING:[],this.bodyJson=this.bodyDefault,this.startPlaceholderIndex=0,this.printed=!1}walkAndWrite(e){this.ast.walk(e,l.NodeType.bitmarkAst,this,void 0)}enter(e,t,r){let i;const o=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[n]&&(i=o[n](e,t,r)),i}between(e,t,r,i,o){let n;const a=this,s=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof a[s]&&(n=a[s](e,t,r,i,o)),n}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,n;const a=e.value;this.bitWrapperJson={},this.json.push(this.bitWrapperJson),this.bitJson=this.createBitJson(a),this.bitWrapperJson.bit=this.bitJson;const l=s.Config.getBitConfig(a.bitType),c=!!l.rootExampleType,p=l.rootExampleType===g.ExampleType.boolean;if(c){let e;p?(e=!0,s.Config.isOfBitType(a.bitType,u.BitType.trueFalse1)&&void 0!==(null===(o=null===(i=a.cardNode)||void 0===i?void 0:i.statement)||void 0===o?void 0:o.isCorrect)&&(e=a.cardNode.statement.isCorrect)):e=null!==(n=a.sampleSolution)&&void 0!==n?n:"";const t=this.toExample(a,{defaultExample:e,isBoolean:p});this.bitJson.isExample=t.isExample,this.bitJson.example=t.example}else a.isExample&&(this.bitJson.isExample=!0)}exit_bitsValue(e,t,r){this.cleanAndSetDefaultsForBitJson(this.bitJson)}enter_imageSource(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==l.NodeType.bitsValue)return;const{url:o,mockupId:n,size:a,format:s,trim:u}=i,c={};this.addProperty(c,"url",null!=o?o:"",!0),this.addProperty(c,"mockupId",null!=n?n:"",!0),this.addProperty(c,"size",null!=a?a:null,!0),this.addProperty(c,"format",null!=s?s:null,!0),this.addProperty(c,"trim",b.BooleanUtils.isBoolean(u)?u:null,!0),this.bitJson.imageSource=c}enter_partner(e,t,r){const i=e.value,o=this.getBitType(r);if((null==t?void 0:t.key)!==l.NodeType.bitsValue||!o)return;const{name:n,avatarImage:a}=i,s={};if(this.addProperty(s,"name",null!=n?n:"",!0),a){const e=this.parseResourceToJson(o,a);e&&e.type===f.ResourceTag.image&&(s.avatarImage=e.image)}this.bitJson.partner=s}enter_markConfigValue(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==l.NodeType.markConfig)return;const{mark:o,color:n,emphasis:a}=i,s={};this.addProperty(s,"mark",null!=o?o:"unknown",!0),n&&this.addProperty(s,"color",null!=n?n:"",!0),a&&this.addProperty(s,"emphasis",null!=a?a:"",!0),this.bitJson.marks||(this.bitJson.marks=[]),this.bitJson.marks.push(s)}leaf_sampleSolution(e,t,r){(null==t?void 0:t.key)===l.NodeType.bitsValue&&null!=e.value&&this.addProperty(this.bitJson,"sampleSolution",e.value,!0)}enter_itemLead(e,t,r){const i=e.value,{item:o,lead:n}=i;(null==t?void 0:t.key)===l.NodeType.bitsValue&&(null!=o&&(this.bitJson.item=this.convertBreakscapedStringToJsonText(o,h.TextFormat.bitmarkMinusMinus)),null!=n&&(this.bitJson.lead=this.convertBreakscapedStringToJsonText(n,h.TextFormat.bitmarkMinusMinus)))}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_cardBitsValue(e,t,r){const i=this.getBitType(r);if(!i)return;let o;i===u.BitType.pageFooter?(this.bitJson.sections||(this.bitJson.sections=[]),o=this.bitJson.sections):(this.bitJson.listItems||(this.bitJson.listItems=[]),o=this.bitJson.listItems),this.listItem=Object.assign(Object.assign({},this.toItemLeadHintInstruction(e.value)),{body:this.bodyDefault}),o.push(this.listItem)}exit_cardBitsValue(e,t,r){this.listItem=void 0}enter_body(e,t,r){this.bodyJson=this.bodyDefault}exit_body(e,t,r){t&&(t.key===l.NodeType.bitsValue?this.bitJson.body=this.bodyJson:t.key===l.NodeType.cardBitsValue&&this.listItem&&(this.listItem.body=this.bodyJson))}enter_bodyParts(e,t,r){const i=e.value,o=this.options.textAsPlainText,n=this.getTextFormat(r);let s="",l=this.startPlaceholderIndex;const u=e=>({legacyPlaceholderKey:`{${e}}`,placeholderKey:`[!${e}]`});for(let e=0;e<i.length;e++){const t=i[e];if(t.type===p.BodyBitType.text){const e=t.data.bodyText;s=a.Breakscape.concatenate(s,e)}else{const{legacyPlaceholderKey:e,placeholderKey:t}=u(l);s=a.Breakscape.concatenate(s,o?e:t),l++}}this.bodyJson=this.convertBreakscapedStringToJsonText(s,n);const c=this.bodyJson;l=this.startPlaceholderIndex;for(let e=0;e<i.length;e++){const t=i[e];if(t.type===p.BodyBitType.text)continue;const r=t;let n;const{legacyPlaceholderKey:a}=u(l);switch(t.type){case p.BodyBitType.gap:{const e=r;n=this.createGapJson(e);break}case p.BodyBitType.mark:{const e=r;n=this.createMarkJson(e);break}case p.BodyBitType.select:{const e=r;n=this.createSelectJson(e);break}case p.BodyBitType.highlight:{const e=r;n=this.createHighlightJson(e);break}}n&&(o?(this.bitJson.placeholders||(this.bitJson.placeholders={}),this.bitJson.placeholders[a]=n):this.replacePlaceholderWithBodyBit(c,n,l)),l++}return this.startPlaceholderIndex=l,!1}enter_elements(e,t,r){const i=e.value;i&&i.length>0&&(this.bitJson.elements=a.Breakscape.unbreakscape(i))}enter_flashcards(e,t,r){var i,o,n,s;const u=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const c=[];if(u)for(const e of u){const t=Object.assign(Object.assign({question:null!==(i=a.Breakscape.unbreakscape(e.question))&&void 0!==i?i:"",answer:null!==(o=a.Breakscape.unbreakscape(e.answer))&&void 0!==o?o:"",alternativeAnswers:null!==(n=a.Breakscape.unbreakscape(e.alternativeAnswers))&&void 0!==n?n:[]},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:e.isDefaultExample,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,c.push(t)}c.length>0&&(this.bitJson.cards=c)}enter_statement(e,t,r){var i,o;const n=e.value;(null==t?void 0:t.key)===l.NodeType.cardNode&&n&&(this.bitJson.statement=null!==(i=a.Breakscape.unbreakscape(n.text))&&void 0!==i?i:"",this.bitJson.isCorrect=null!==(o=n.isCorrect)&&void 0!==o&&o)}enter_statements(e,t,r){var i,o,n;const s=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const u=[];if(s)for(const e of s){const t=Object.assign(Object.assign({statement:null!==(i=a.Breakscape.unbreakscape(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===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,null==(null==e?void 0:e.hint)&&delete t.hint,null==(null==e?void 0:e.instruction)&&delete t.instruction,u.push(t)}u.length>0&&(this.bitJson.statements=u)}enter_choices(e,t,r){var i,o,n;const s=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const u=[];if(s)for(const e of s){const t=Object.assign(Object.assign({choice:null!==(i=a.Breakscape.unbreakscape(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===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.choices=u)}enter_responses(e,t,r){var i,o,n;const s=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const u=[];if(s)for(const e of s){const t=Object.assign(Object.assign({response:null!==(i=a.Breakscape.unbreakscape(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===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.responses=u)}enter_quizzes(e,t,r){var i,o,n,s,l,u,c,p;const g=e.value,d=[];if(g)for(const e of g){const t=[];if(e.choices)for(const r of e.choices){const s=Object.assign(Object.assign({choice:null!==(i=a.Breakscape.unbreakscape(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===(n=e.itemLead)||void 0===n?void 0:n.lead)&&delete s.lead,t.push(s)}const r=[];if(e.responses)for(const t of e.responses){const i=Object.assign(Object.assign({response:null!==(s=a.Breakscape.unbreakscape(t.text))&&void 0!==s?s:"",isCorrect:null!==(l=t.isCorrect)&&void 0!==l&&l},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!!t.isCorrect,isBoolean:!0}));null==(null===(u=e.itemLead)||void 0===u?void 0:u.lead)&&delete i.lead,r.push(i)}const g=Object.assign(Object.assign({},this.toItemLeadHintInstruction(e)),{isExample:null!==(c=e.isExample)&&void 0!==c&&c,choices:e.choices?t:void 0,responses:e.responses?r:void 0});null==(null===(p=e.itemLead)||void 0===p?void 0:p.lead)&&delete g.lead,d.push(g)}d.length>0&&(this.bitJson.quizzes=d)}enter_heading(e,t,r){var i,o;const n=e.value;let s=!1;if(n&&n.forKeys&&(s=!0),!s)return!1;const l={forKeys:null!==(i=a.Breakscape.unbreakscape(n.forKeys))&&void 0!==i?i:""};Array.isArray(n.forValues)?n.forValues.length>1?l.forValues=a.Breakscape.unbreakscape(n.forValues):1===n.forValues.length?l.forValues=a.Breakscape.unbreakscape(n.forValues[0]):l.forValues=a.Breakscape.unbreakscape(n.forValues):l.forValues=null!==(o=a.Breakscape.unbreakscape(n.forValues))&&void 0!==o?o:"",this.bitJson.heading=l}enter_pairs(e,t,r){var i,o,n,s;const l=e.value,u=[],c=this.getBitType(r);if(l&&c)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=a.Breakscape.unbreakscape(e.key))&&void 0!==i?i:"",keyAudio:e.keyAudio?this.addAudioResource(c,e.keyAudio):void 0,keyImage:e.keyImage?this.addImageResource(c,e.keyImage):void 0,values:null!==(o=a.Breakscape.unbreakscape(e.values))&&void 0!==o?o:[]},this.toItemLeadHintInstruction(e)),{isCaseSensitive:null===(n=e.isCaseSensitive)||void 0===n||n}),this.toExample(e,{defaultExample:t,isBoolean:!1}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.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,n,s,l,u;const c=e.value,p=[];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(Object.assign({values:null!==(i=a.Breakscape.unbreakscape(r.values))&&void 0!==i?i:[]},this.toItemLeadHintInstruction(r)),{isCaseSensitive:null===(o=r.isCaseSensitive)||void 0===o||o}),this.toExample(r,{defaultExample:e,isBoolean:!1}));null==(null===(n=r.itemLead)||void 0===n?void 0:n.lead)&&delete s.lead,null==r.hint&&delete s.hint,t.push(s)}const r=Object.assign(Object.assign({key:null!==(s=a.Breakscape.unbreakscape(e.key))&&void 0!==s?s:"",cells:null!=t?t:[]},this.toItemLeadHintInstruction(e)),{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,p.push(r)}p.length>0&&(this.bitJson.matrix=p)}enter_questions(e,t,r){var i,o,n,s;const l=e.value,u=[];if(l)for(const e of l){const t=Object.assign(Object.assign(Object.assign({question:null!==(i=a.Breakscape.unbreakscape(e.question))&&void 0!==i?i:"",partialAnswer:null!==(o=a.Breakscape.unbreakscape(T.ArrayUtils.asSingle(e.partialAnswer)))&&void 0!==o?o:"",sampleSolution:null!==(n=a.Breakscape.unbreakscape(e.sampleSolution))&&void 0!==n?n:""},this.toItemLeadHintInstruction(e)),{reasonableNumOfChars:e.reasonableNumOfChars}),this.toExample(e,{defaultExample:e.sampleSolution||"",isBoolean:!1}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.questions=u)}enter_botResponses(e,t,r){var i,o,n,s;const u=e.value;if((null==t?void 0:t.key)!==l.NodeType.cardNode)return;const c=[];if(u)for(const e of u){const t=Object.assign({response:null!==(i=a.Breakscape.unbreakscape(e.response))&&void 0!==i?i:"",reaction:null!==(o=a.Breakscape.unbreakscape(e.reaction))&&void 0!==o?o:"",feedback:null!==(n=a.Breakscape.unbreakscape(e.feedback))&&void 0!==n?n:""},this.toItemLeadHintInstruction(e));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,null==e.hint&&delete t.hint,delete t.instruction,c.push(t)}c.length>0&&(this.bitJson.responses=c)}enter_resources(e,t,r){var i;const o=e.value,n=this.getBitType(r),a=this.getResourceType(r);if(!o||!n)return;let l;const u=s.Config.getBitConfig(n),c=s.Config.getBitResourcesConfig(n,a),p=c.comboResourceTagTypesMap;if(c.comboResourceTagTypesMap.size>0)for(const[e,t]of p.entries()){const r={type:e};for(const e of t){const t=o.find((t=>t.typeAlias===e));if(t){const e=s.Config.getTagConfigForTag(u.tags,t.typeAlias),o=null!==(i=null==e?void 0:e.jsonKey)&&void 0!==i?i:t.typeAlias,a=this.parseResourceToJson(n,t);if(a)for(const[e,t]of Object.entries(a))"type"!==e&&(r[o]=t)}}l=r}else o.length>=1&&(l=this.parseResourceToJson(n,o[0]));this.bitJson.resource=l}leaf_title(e,t,r){this.bitJson.title=this.convertBreakscapedStringToJsonText(e.value,h.TextFormat.bitmarkMinusMinus)}leaf_subtitle(e,t,r){this.bitJson.subtitle=this.convertBreakscapedStringToJsonText(e.value,h.TextFormat.bitmarkMinusMinus)}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)===l.NodeType.bitsValue&&(this.bitJson.hint=this.convertBreakscapedStringToJsonText(i,h.TextFormat.bitmarkMinusMinus))}leaf_instruction(e,t,r){const i=e.value;(null==t?void 0:t.key)===l.NodeType.bitsValue&&(this.bitJson.instruction=this.convertBreakscapedStringToJsonText(i,h.TextFormat.bitmarkMinusMinus))}leaf_footerText(e,t,r){const i=e.value;this.bitJson.footer=this.convertBreakscapedStringToJsonText(i,h.TextFormat.bitmarkMinusMinus)}leaf_markup(e,t,r){const i=e.value;i&&(this.bitWrapperJson.bitmark=i)}enter_parser(e,t,r){const i=e.value,n=this.getBitType(r);if(i&&n){const{version:e,excessResources:s,warnings:u,errors:c}=i,p=o(i,["version","excessResources","warnings","errors"]),g=`${this.bitmarkVersion}`;let d;if(Array.isArray(s)&&s.length>0){d=[];for(const e of s){const t=this.parseResourceToJson(n,e);t&&d.push(t)}}const y=a.Breakscape.unbreakscape(this.getInternalComments(r));(null==t?void 0:t.key)===l.NodeType.bitsValue&&(this.bitWrapperJson.parser=Object.assign(Object.assign({version:e,bitmarkVersion:g,internalComments:y},p),{warnings:u,errors:c,excessResources:d}),this.options.enableWarnings||delete this.bitWrapperJson.parser.warnings)}}generatePropertyHandlers(){var e;const t=s.Config.getRawPropertiesConfig();for(const r of Object.values(t)){const t=null!==(e=r.astKey)&&void 0!==e?e:r.tag;if(t===y.PropertyTag.internalComment)continue;if(t===y.PropertyTag.example)continue;if(t===y.PropertyTag.imageSource)continue;if(t===y.PropertyTag.partner)continue;if(t===d.PropertyAstKey.markConfig)continue;const i=`enter_${t}`;this[i]=(e,t,i)=>{var o;const n=e.value;if(null==n)return;if((null==t?void 0:t.key)!==l.NodeType.bitsValue)return;const a=null!==(o=r.jsonKey)&&void 0!==o?o:r.tag;this.addProperty(this.bitJson,a,n,r.single)},this[i]=this[i].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:a.Breakscape.unbreakscape(r.solutions)});return o.lead||delete o.lead,o}createMarkJson(e){const t=e.data,r=Object.assign(Object.assign({type:"mark",solution:a.Breakscape.unbreakscape(t.solution),mark:a.Breakscape.unbreakscape(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 n=e.data,s=[];for(const e of n.options){const r=Object.assign(Object.assign({text:a.Breakscape.unbreakscape(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,s.push(r)}const l=Object.assign(Object.assign({type:"select",prefix:null!==(r=a.Breakscape.unbreakscape(n.prefix))&&void 0!==r?r:"",postfix:null!==(i=a.Breakscape.unbreakscape(n.postfix))&&void 0!==i?i:""},this.toItemLeadHintInstruction(n)),{isExample:null!==(o=n.isExample)&&void 0!==o&&o,options:s});return l.lead||delete l.lead,l}createHighlightJson(e){var t,r,i,o,n;const s=e.data,l=[];for(const e of s.texts){const i=Object.assign(Object.assign({text:a.Breakscape.unbreakscape(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,l.push(i)}const u=Object.assign(Object.assign({type:"highlight",prefix:null!==(i=a.Breakscape.unbreakscape(s.prefix))&&void 0!==i?i:"",postfix:null!==(o=a.Breakscape.unbreakscape(s.postfix))&&void 0!==o?o:""},this.toItemLeadHintInstruction(s)),{isExample:null!==(n=s.isExample)&&void 0!==n&&n,texts:l});return u.lead||delete u.lead,u}parseResourceToJson(e,t){if(!t)return;let r;switch(t.type){case f.ResourceTag.image:r={type:f.ResourceTag.image,image:this.addImageResource(e,t)};break;case f.ResourceTag.imageLink:r={type:f.ResourceTag.imageLink,imageLink:this.addImageLinkResource(e,t)};break;case f.ResourceTag.audio:r={type:f.ResourceTag.audio,audio:this.addAudioResource(e,t)};break;case f.ResourceTag.audioEmbed:r={type:f.ResourceTag.audioEmbed,audioEmbed:this.addAudioEmbedResource(e,t)};break;case f.ResourceTag.audioLink:r={type:f.ResourceTag.audioLink,audioLink:this.addAudioLinkResource(e,t)};break;case f.ResourceTag.video:r={type:f.ResourceTag.video,video:this.addVideoResource(e,t)};break;case f.ResourceTag.videoEmbed:r={type:f.ResourceTag.videoEmbed,videoEmbed:this.addVideoEmbedResource(e,t)},r.videoEmbed=this.addVideoLinkResource(e,t);break;case f.ResourceTag.videoLink:r={type:f.ResourceTag.videoLink,videoLink:this.addVideoLinkResource(e,t)};break;case f.ResourceTag.stillImageFilmEmbed:r={type:f.ResourceTag.stillImageFilmEmbed,stillImageFilmEmbed:this.addStillImageFilmEmbedResource(e,t)};break;case f.ResourceTag.stillImageFilmLink:r={type:f.ResourceTag.stillImageFilmLink,stillImageFilmLink:this.addStillImageFilmLinkResource(e,t)};break;case f.ResourceTag.article:r={type:f.ResourceTag.article,article:this.addArticleResource(e,t)};break;case f.ResourceTag.document:r={type:f.ResourceTag.document,document:this.addDocumentResource(e,t)};break;case f.ResourceTag.documentEmbed:r={type:f.ResourceTag.documentEmbed,documentEmbed:this.addDocumentEmbedResource(e,t)};break;case f.ResourceTag.documentLink:r={type:f.ResourceTag.documentLink,documentLink:this.addDocumentLinkResource(e,t)};break;case f.ResourceTag.documentDownload:r={type:f.ResourceTag.documentDownload,documentDownload:this.addDocumentDownloadResource(e,t)};break;case f.ResourceTag.appLink:r={type:f.ResourceTag.appLink,appLink:this.addAppLinkResource(e,t)};break;case f.ResourceTag.websiteLink:r={type:f.ResourceTag.websiteLink,websiteLink:this.addWebsiteLinkResource(e,t)}}return r}addImageResource(e,t){var r,i,o;const n={};if(v.StringUtils.isString(t)){const e=t;t={type:f.ResourceTag.image,typeAlias:f.ResourceTag.image,value:e,format:B.UrlUtils.fileExtensionFromUrl(e),provider:B.UrlUtils.domainFromUrl(e)}}return null!=t.format&&(n.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(n.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(n.src=a.Breakscape.unbreakscape(t.value)),null!=t.src1x&&(n.src1x=a.Breakscape.unbreakscape(t.src1x)),null!=t.src2x&&(n.src2x=a.Breakscape.unbreakscape(t.src2x)),null!=t.src3x&&(n.src3x=a.Breakscape.unbreakscape(t.src3x)),null!=t.src4x&&(n.src4x=a.Breakscape.unbreakscape(t.src4x)),n.width=null!==(r=t.width)&&void 0!==r?r:null,n.height=null!==(i=t.height)&&void 0!==i?i:null,n.alt=null!==(o=a.Breakscape.unbreakscape(t.alt))&&void 0!==o?o:"",n.zoomDisabled=this.getZoomDisabled(e,t.zoomDisabled),this.addGenericResourceProperties(e,t,n),n}addImageLinkResource(e,t){var r,i,o;const n={};if(v.StringUtils.isString(t)){const e=t;t={type:f.ResourceTag.imageLink,typeAlias:f.ResourceTag.imageLink,value:e,format:B.UrlUtils.fileExtensionFromUrl(e),provider:B.UrlUtils.domainFromUrl(e)}}return null!=t.format&&(n.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(n.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(n.url=a.Breakscape.unbreakscape(t.value)),null!=t.src1x&&(n.src1x=a.Breakscape.unbreakscape(t.src1x)),null!=t.src2x&&(n.src2x=a.Breakscape.unbreakscape(t.src2x)),null!=t.src3x&&(n.src3x=a.Breakscape.unbreakscape(t.src3x)),null!=t.src4x&&(n.src4x=a.Breakscape.unbreakscape(t.src4x)),n.width=null!==(r=t.width)&&void 0!==r?r:null,n.height=null!==(i=t.height)&&void 0!==i?i:null,n.alt=null!==(o=a.Breakscape.unbreakscape(t.alt))&&void 0!==o?o:"",n.zoomDisabled=this.getZoomDisabled(e,t.zoomDisabled),this.addGenericResourceProperties(e,t,n),n}addAudioResource(e,t){const r={};return null!=t.format&&(r.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(r.src=a.Breakscape.unbreakscape(t.value)),null!=t.duration&&(r.duration=t.duration),null!=t.mute&&(r.mute=t.mute),null!=t.autoplay&&(r.autoplay=t.autoplay),this.addGenericResourceProperties(e,t,r),r}addAudioEmbedResource(e,t){const r={};return null!=t.format&&(r.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(r.src=a.Breakscape.unbreakscape(t.value)),null!=t.duration&&(r.duration=t.duration),null!=t.mute&&(r.mute=t.mute),null!=t.autoplay&&(r.autoplay=t.autoplay),this.addGenericResourceProperties(e,t,r),r}addAudioLinkResource(e,t){const r={};return null!=t.format&&(r.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(r.url=a.Breakscape.unbreakscape(t.value)),null!=t.duration&&(r.duration=t.duration),null!=t.mute&&(r.mute=t.mute),null!=t.autoplay&&(r.autoplay=t.autoplay),this.addGenericResourceProperties(e,t,r,!0),r}addVideoResource(e,t){var r,i;const o={};if(null!=t.format&&(o.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(o.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(o.src=a.Breakscape.unbreakscape(t.value)),o.width=null!==(r=t.width)&&void 0!==r?r:null,o.height=null!==(i=t.height)&&void 0!==i?i:null,null!=t.duration&&(o.duration=t.duration),null!=t.mute&&(o.mute=t.mute),null!=t.autoplay&&(o.autoplay=t.autoplay),null!=t.allowSubtitles&&(o.allowSubtitles=t.allowSubtitles),null!=t.showSubtitles&&(o.showSubtitles=t.showSubtitles),null!=t.alt&&(o.alt=a.Breakscape.unbreakscape(t.alt)),null!=t.posterImage&&(o.posterImage=this.addImageResource(e,t.posterImage)),null!=t.thumbnails&&t.thumbnails.length>0){o.thumbnails=[];for(const r of t.thumbnails)o.thumbnails.push(this.addImageResource(e,r))}return this.addGenericResourceProperties(e,t,o),o}addVideoEmbedResource(e,t){var r,i;const o={};if(null!=t.format&&(o.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(o.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(o.src=a.Breakscape.unbreakscape(t.value)),o.width=null!==(r=t.width)&&void 0!==r?r:null,o.height=null!==(i=t.height)&&void 0!==i?i:null,null!=t.duration&&(o.duration=t.duration),null!=t.mute&&(o.mute=t.mute),null!=t.autoplay&&(o.autoplay=t.autoplay),null!=t.allowSubtitles&&(o.allowSubtitles=t.allowSubtitles),null!=t.showSubtitles&&(o.showSubtitles=t.showSubtitles),null!=t.alt&&(o.alt=a.Breakscape.unbreakscape(t.alt)),null!=t.posterImage&&(o.posterImage=this.addImageResource(e,t.posterImage)),null!=t.thumbnails&&t.thumbnails.length>0){o.thumbnails=[];for(const r of t.thumbnails)o.thumbnails.push(this.addImageResource(e,r))}return this.addGenericResourceProperties(e,t,o),o}addVideoLinkResource(e,t){var r,i;const o={};if(null!=t.format&&(o.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(o.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(o.url=a.Breakscape.unbreakscape(t.value)),o.width=null!==(r=t.width)&&void 0!==r?r:null,o.height=null!==(i=t.height)&&void 0!==i?i:null,null!=t.duration&&(o.duration=t.duration),null!=t.mute&&(o.mute=t.mute),null!=t.autoplay&&(o.autoplay=t.autoplay),null!=t.allowSubtitles&&(o.allowSubtitles=t.allowSubtitles),null!=t.showSubtitles&&(o.showSubtitles=t.showSubtitles),null!=t.alt&&(o.alt=a.Breakscape.unbreakscape(t.alt)),null!=t.posterImage&&(o.posterImage=this.addImageResource(e,t.posterImage)),null!=t.thumbnails&&t.thumbnails.length>0){o.thumbnails=[];for(const r of t.thumbnails)o.thumbnails.push(this.addImageResource(e,r))}return this.addGenericResourceProperties(e,t,o),o}addStillImageFilmEmbedResource(e,t){var r,i;const o={};if(null!=t.format&&(o.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(o.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(o.url=a.Breakscape.unbreakscape(t.value)),o.width=null!==(r=t.width)&&void 0!==r?r:null,o.height=null!==(i=t.height)&&void 0!==i?i:null,null!=t.duration&&(o.duration=t.duration),null!=t.mute&&(o.mute=t.mute),null!=t.autoplay&&(o.autoplay=t.autoplay),null!=t.allowSubtitles&&(o.allowSubtitles=t.allowSubtitles),null!=t.showSubtitles&&(o.showSubtitles=t.showSubtitles),null!=t.alt&&(o.alt=a.Breakscape.unbreakscape(t.alt)),null!=t.posterImage&&(o.posterImage=this.addImageResource(e,t.posterImage)),null!=t.thumbnails&&t.thumbnails.length>0){o.thumbnails=[];for(const r of t.thumbnails)o.thumbnails.push(this.addImageResource(e,r))}return this.addGenericResourceProperties(e,t,o),o}addStillImageFilmLinkResource(e,t){var r,i;const o={};if(null!=t.format&&(o.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(o.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(o.url=a.Breakscape.unbreakscape(t.value)),o.width=null!==(r=t.width)&&void 0!==r?r:null,o.height=null!==(i=t.height)&&void 0!==i?i:null,null!=t.duration&&(o.duration=t.duration),null!=t.mute&&(o.mute=t.mute),null!=t.autoplay&&(o.autoplay=t.autoplay),null!=t.allowSubtitles&&(o.allowSubtitles=t.allowSubtitles),null!=t.showSubtitles&&(o.showSubtitles=t.showSubtitles),null!=t.alt&&(o.alt=a.Breakscape.unbreakscape(t.alt)),null!=t.posterImage&&(o.posterImage=this.addImageResource(e,t.posterImage)),null!=t.thumbnails&&t.thumbnails.length>0){o.thumbnails=[];for(const r of t.thumbnails)o.thumbnails.push(this.addImageResource(e,r))}return this.addGenericResourceProperties(e,t,o),o}addArticleResource(e,t){const r={};return null!=t.format&&(r.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(r.body=a.Breakscape.unbreakscape(t.value)),this.addGenericResourceProperties(e,t,r),r}addDocumentResource(e,t){const r={};return null!=t.format&&(r.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(r.url=a.Breakscape.unbreakscape(t.value)),this.addGenericResourceProperties(e,t,r),r}addDocumentEmbedResource(e,t){const r={};return null!=t.format&&(r.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(r.url=a.Breakscape.unbreakscape(t.value)),this.addGenericResourceProperties(e,t,r),r}addDocumentLinkResource(e,t){const r={};return null!=t.format&&(r.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(r.url=a.Breakscape.unbreakscape(t.value)),this.addGenericResourceProperties(e,t,r),r}addDocumentDownloadResource(e,t){const r={};return null!=t.format&&(r.format=a.Breakscape.unbreakscape(t.format)),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.value&&(r.url=a.Breakscape.unbreakscape(t.value)),this.addGenericResourceProperties(e,t,r),r}addAppLinkResource(e,t){const r={};return null!=t.value&&(r.url=a.Breakscape.unbreakscape(t.value)),this.addGenericResourceProperties(e,t,r),r}addWebsiteLinkResource(e,t){const r={};return null!=t.value&&(r.url=a.Breakscape.unbreakscape(t.value)),null!=t.siteName&&(r.siteName=a.Breakscape.unbreakscape(t.siteName)),this.addGenericResourceProperties(e,t,r),r}addGenericResourceProperties(e,t,r,i){var o,n,s,l,u,c,p,g;return i?(null!=t.license&&(r.license=null!==(o=a.Breakscape.unbreakscape(t.license))&&void 0!==o?o:""),null!=t.copyright&&(r.copyright=null!==(n=a.Breakscape.unbreakscape(t.copyright))&&void 0!==n?n:""),null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),null!=t.showInIndex&&(r.showInIndex=null!==(s=t.showInIndex)&&void 0!==s&&s),null!=t.caption&&(r.caption=this.convertBreakscapedStringToJsonText(null!==(l=t.caption)&&void 0!==l?l:"",h.TextFormat.bitmarkMinusMinus))):(r.license=null!==(u=a.Breakscape.unbreakscape(t.license))&&void 0!==u?u:"",r.copyright=null!==(c=a.Breakscape.unbreakscape(t.copyright))&&void 0!==c?c:"",null!=t.provider&&(r.provider=a.Breakscape.unbreakscape(t.provider)),r.showInIndex=null!==(p=t.showInIndex)&&void 0!==p&&p,r.caption=this.convertBreakscapedStringToJsonText(null!==(g=t.caption)&&void 0!==g?g:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus)),r}toItemLeadHintInstruction(e){var t,r,i,o,n,s;return{item:this.convertBreakscapedStringToJsonText(null!==(r=null===(t=e.itemLead)||void 0===t?void 0:t.item)&&void 0!==r?r:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus),lead:this.convertBreakscapedStringToJsonText(null!==(o=null===(i=e.itemLead)||void 0===i?void 0:i.lead)&&void 0!==o?o:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus),hint:this.convertBreakscapedStringToJsonText(null!==(n=e.hint)&&void 0!==n?n:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus),instruction:this.convertBreakscapedStringToJsonText(null!==(s=e.instruction)&&void 0!==s?s:a.Breakscape.EMPTY_STRING,h.TextFormat.bitmarkMinusMinus)}}toExample(e,t){const{isExample:r,example:i,isDefaultExample:o}=e,{defaultExample:n,isBoolean:a}=t;if(!r)return{isExample:!1,example:null};let s;return s=o?a?b.BooleanUtils.toBoolean(n):this.convertBreakscapedStringToJsonText(n,h.TextFormat.bitmarkMinusMinus):a?b.BooleanUtils.toBoolean(i):this.convertBreakscapedStringToJsonText(i,h.TextFormat.bitmarkMinusMinus),{isExample:!0,example:s}}addProperty(e,t,r,i){if(void 0!==r){let o;Array.isArray(r)||(r=[r]),Array.isArray(r)&&r.length>0&&(r=a.Breakscape.unbreakscape(r),o=Array.isArray(r)&&i&&r.length>=1?r[r.length-1]:r),e[t]=o}}getZoomDisabled(e,t){if(null!=t)return t;switch(e){case u.BitType.imageSeparator:case u.BitType.pageBanner:return!0}return!1}getBitType(e){for(const t of e)if(t.key===l.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getTextFormat(e){var t;const r=this.getBitType(e);if(r){const i=s.Config.getBitConfig(r);for(const r of e)if(r.key===l.NodeType.bitsValue){const e=r.value;return null!==(t=h.TextFormat.fromValue(null==e?void 0:e.textFormat))&&void 0!==t?t:i.textFormatDefault}}return h.TextFormat.bitmarkMinusMinus}getResourceType(e){for(const t of e)if(t.key===l.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.resourceType}}getInternalComments(e){if(this.getBitType(e))for(const t of e)if(t.key===l.NodeType.bitsValue){return t.value.internalComment}}convertBreakscapedStringToJsonText(e,t){if(this.options.textAsPlainText||t===h.TextFormat.text)return e||a.Breakscape.EMPTY_STRING;return this.textParser.toAst(e,{textFormat:t})}replacePlaceholderWithBodyBit(e,t,r){const i=(e,o,n)=>{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[n]=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,format:e.textFormat,id:void 0,internalComment:void 0,externalId:void 0,spaceId:void 0,padletId:void 0,jupyterId:void 0,jupyterExecutionCount:void 0,AIGenerated:void 0,releaseVersion:void 0,book:void 0,ageRange:void 0,lang:void 0,language:void 0,computerLanguage:void 0,target:void 0,tag:void 0,icon:void 0,iconTag:void 0,colorTag:void 0,flashcardSet:void 0,subtype:void 0,bookAlias: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,pointerLeft:void 0,pointerTop: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,content2Buy:void 0,quotedPerson:void 0,reasonableNumOfChars:void 0,resolved:void 0,resolvedDate:void 0,resolvedBy:void 0,maxCreatedBits:void 0,product:void 0,productVideo:void 0,productFolder: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,partialAnswer: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,listItems:void 0,sections:void 0,placeholders:void 0,footer:void 0}}cleanAndSetDefaultsForBitJson(e){const t=s.Config.getBitType(e.type),r=this.options.textAsPlainText;return e.item||(e.item=void 0),s.Config.isOfBitType(t,[u.BitType._error,u.BitType._comment])?delete e.format:s.Config.isOfBitType(t,[u.BitType.article,u.BitType.sampleSolution,u.BitType.page])?null==e.body&&(e.body=this.bodyDefault):s.Config.isOfBitType(t,[u.BitType.cloze,u.BitType.multipleChoice1,u.BitType.multipleResponse1,u.BitType.multipleChoiceText,u.BitType.highlightText,u.BitType.clozeAndMultipleChoiceText,u.BitType.sequence,u.BitType.mark,u.BitType.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)):s.Config.isOfBitType(t,[u.BitType.multipleChoice,u.BitType.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)):s.Config.isOfBitType(t,u.BitType.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="")):s.Config.isOfBitType(t,u.BitType.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)):s.Config.isOfBitType(t,u.BitType.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)):s.Config.isOfBitType(t,u.BitType.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)):s.Config.isOfBitType(t,u.BitType.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=[])):t===u.BitType.matchMatrix?(null==e.item&&(e.item=this.textDefault),null==e.body&&(e.body=this.bodyDefault)):s.Config.isOfBitType(t,u.BitType.match)?(null==e.item&&(e.item=this.textDefault),null==e.heading&&(e.heading={}),null==e.body&&(e.body=this.bodyDefault)):s.Config.isOfBitType(t,u.BitType.learningPathBook)?(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)):s.Config.isOfBitType(t,u.BitType.pageBuyButton)?(null==e.content2Buy&&(e.content2Buy=""),null==e.body&&(e.body=this.bodyDefault)):(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!==u.BitType.articleAi&&t!==u.BitType.noteAi&&t!==u.BitType.summaryAi||null==e.AIGenerated&&(e.AIGenerated=!0),s.Config.isOfBitType(t,u.BitType.reviewNote)&&(null==e.resolved&&(e.resolved=!1),null==e.resolvedDate&&(e.resolvedDate=""),null==e.resolvedBy&&(e.resolvedBy=""))),null==e.id&&delete e.id,null==e.internalComment&&delete e.internalComment,null==e.externalId&&delete e.externalId,null==e.spaceId&&delete e.spaceId,null==e.padletId&&delete e.padletId,null==e.jupyterId&&delete e.jupyterId,null==e.jupyterExecutionCount&&delete e.jupyterExecutionCount,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.lang&&delete e.lang,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.flashcardSet&&delete e.flashcardSet,null==e.subtype&&delete e.subtype,null==e.bookAlias&&delete e.bookAlias,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.content2Buy&&delete e.content2Buy,null==e.quotedPerson&&delete e.quotedPerson,null==e.resolved&&delete e.resolved,null==e.resolvedDate&&delete e.resolvedDate,null==e.resolvedBy&&delete e.resolvedBy,null==e.maxCreatedBits&&delete e.maxCreatedBits,null==e.product&&delete e.product,null==e.productVideo&&delete e.productVideo,null==e.productFolder&&delete e.productFolder,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,null==e.listItems&&delete e.listItems,null==e.sections&&delete e.sections,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,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function s(e){try{l(i.throw(e))}catch(e){n(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(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonObjectGenerator=void 0;const o=r(227),n=r(3857);t.JsonObjectGenerator=class{constructor(e){this.writer=new o.StringWriter,this.generator=new n.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,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function s(e){try{l(i.throw(e))}catch(e){n(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(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonStringGenerator=void 0;const o=r(227),n=r(3857);t.JsonStringGenerator=class{constructor(e){this.writer=new o.StringWriter,this.generator=new n.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,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function s(e){try{l(i.throw(e))}catch(e){n(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(a,s)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TextGenerator=void 0;const o=r(8256),n=r(8159),a=r(549),s=r(8791),l=r(1353),u=r(1888),c=r(2610),p={debugGenerationInline:!1},g="==",d={[u.TextMarkType.bold]:"**",[u.TextMarkType.light]:"``",[u.TextMarkType.italic]:"__",[u.TextMarkType.highlight]:"!!"},y=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=l.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=s.BitmarkVersion.fromValue(e))&&void 0!==r?r:s.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},p),t),this.bitmarkVersion,s.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=e,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,a.NodeType.textAst,this,void 0)}enter(e,t,r){let i;const o=this,n=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[n]&&(i=o[n](e,t,r)),i}between(e,t,r,i,o){let n;const a=this,s=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof a[s]&&(n=a[s](e,t,r,i,o)),n}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){return this.handleEnterNode(e.value)}between_textAstValue(e,t,r,i,o){return this.handleBetweenNode(e.value)}exit_textAstValue(e,t,r){return this.handleExitNode(e.value)}enter_contentValueValue(e,t,r){return this.handleEnterNode(e.value)}between_contentValueValue(e,t,r,i,o){this.handleBetweenNode(e.value)}exit_contentValueValue(e,t,r){return this.handleExitNode(e.value)}handleEnterNode(e){switch(this.handleIndent(e),e.type){case c.TextNodeType.paragraph:this.writeParagraph(e);break;case c.TextNodeType.hardBreak:this.writeHardBreak(e);break;case c.TextNodeType.text:this.writeMarks(e,!0),this.writeText(e);break;case c.TextNodeType.heading:this.writeHeading(e);break;case c.TextNodeType.section:this.writeSection(e);break;case c.TextNodeType.listItem:case c.TextNodeType.taskItem:this.writeBullet(e);break;case c.TextNodeType.image:this.writeImage(e);break;case c.TextNodeType.codeBlock:this.inCodeBlock=!0,this.writeCodeBlock(e);break;case c.TextNodeType.gap:case c.TextNodeType.select:case c.TextNodeType.highlight:case c.TextNodeType.mark:return this.writeBodyBit(e),!1}this.exitedCodeBlock=!1}handleBetweenNode(e){e.type}handleExitNode(e){switch(e.type){case c.TextNodeType.text:this.writeMarks(e,!1);break;case c.TextNodeType.paragraph:this.textFormat!==l.TextFormat.bitmarkMinusMinus&&this.writeNL();break;case c.TextNodeType.heading:case c.TextNodeType.section:case c.TextNodeType.image:this.writeNL(),this.writeNL();break;case c.TextNodeType.codeBlock:this.writeNL(),this.writeNL(),this.inCodeBlock=!1,this.exitedCodeBlock=!0;break;case c.TextNodeType.bulletList:case c.TextNodeType.orderedList:case c.TextNodeType.taskList:this.currentIndent<=1&&this.writeNL()}this.handleDedent(e)}handleIndent(e){switch(e.type){case c.TextNodeType.bulletList:case c.TextNodeType.orderedList:case c.TextNodeType.taskList:this.currentIndent++}}handleDedent(e){switch(e.type){case c.TextNodeType.bulletList:case c.TextNodeType.orderedList:case c.TextNodeType.taskList:this.currentIndent--}}getLinkHref(e){if(e.type===c.TextNodeType.text&&e.marks){const t=e.marks.reduce(((e,t)=>{var r;if(t.type===u.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;this.inCodeBlock;let t=e.text;if(t=n.Breakscape.breakscape(t),this.currentIndent>1){const e=this.getIndentationString();t=t.replace(y,`$1${e}`)}this.write(t)}writeLink(e){if(null==e.text)return!1;const t=this.getLinkHref(e);if(t){let r=n.Breakscape.breakscape(e.text);if(this.currentIndent>1){const e=this.getIndentationString();r=r.replace(y,`$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){if(0===e.marks.length)return void this.writeMarkTextWrapper(g);const r=1===e.marks.length,i=e.marks.reduce(((e,t)=>{if(e)return e;switch(t.type){case u.TextMarkType.bold:case u.TextMarkType.light:case u.TextMarkType.italic:case u.TextMarkType.highlight:return r?d[t.type]:g;case u.TextMarkType.strike:case u.TextMarkType.sub:case u.TextMarkType.super:case u.TextMarkType.ins:case u.TextMarkType.del:case u.TextMarkType.var:case u.TextMarkType.code:case u.TextMarkType.color:case u.TextMarkType.comment:return g;case u.TextMarkType.link:}return e}),void 0);if(null!=i&&(this.writeMarkTextWrapper(i),!t)){let t=!1;for(const i of e.marks)switch(i.type){case u.TextMarkType.bold:case u.TextMarkType.light:case u.TextMarkType.italic:case u.TextMarkType.highlight:r||(this.writeInlineMarkStartEnd(),this.writeInlineMark(i),t=!0);break;case u.TextMarkType.strike:case u.TextMarkType.sub:case u.TextMarkType.super:case u.TextMarkType.ins:case u.TextMarkType.del:case u.TextMarkType.var:case u.TextMarkType.code:case u.TextMarkType.color:this.writeInlineMarkStartEnd(),this.writeInlineMark(i),t=!0;break;case u.TextMarkType.comment:this.writeInlineMarkStartEnd(),this.writeCommentMark(i),t=!0;case u.TextMarkType.link:}t&&this.writeInlineMarkStartEnd()}}}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===c.TextNodeType.bulletList)i+="• ";else if(e.parent===c.TextNodeType.orderedList)i+="•1 ";else if(e.parent===c.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)}writeMarkTextWrapper(e){e&&this.write(e)}writeInlineMark(e){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}`);this.write(t)}writeCommentMark(e){if(e.comment){const t=`#${e.comment}`;this.write(t)}}writeInlineMarkStartEnd(){this.write("|")}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===a.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}}},9677:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoBuilder=void 0;const i=r(2606),o=r(208);t.InfoBuilder=class{getSupportedBits(e){var t,r;const n=null===(t=null==e?void 0:e.includeNonDeprecated)||void 0===t||t,a=null!==(r=null==e?void 0:e.includeDeprecated)&&void 0!==r&&r,s=[];for(const e of o.BitType.values()){if(e===o.BitType._error||e===o.BitType._comment)continue;const t=i.Config.getBitType(e),r=i.Config.getBitConfig(t),l=r.inheritedBitTypes.length>0?r.inheritedBitTypes:void 0;(n&&!r.deprecated||a&&r.deprecated)&&s.push({name:e,since:r.since,deprecated:r.deprecated,inheritedBitTypes:l})}return s}getSupportedBitConfigs(){const e=[];for(const t of o.BitType.values()){if(t===o.BitType._error||t===o.BitType._comment)continue;const r=i.Config.getBitType(t),n=i.Config.getBitConfig(r);e.push(n)}return e}}},7087:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const i=r(1022),o=r(671);r(2606);let n=!1;t.init=function(){n||((0,o.initEnv)(i.buildInfo.name,i.buildInfo.version),n=!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",cardBits:"cardBits",cardBitsValue:"cardBitsValue",id:"id",idValue:"idValue",internalComment:"internalComment",internalCommentValue:"internalCommentValue",externalId:"externalId",externalIdValue:"externalIdValue",spaceId:"spaceId",spaceIdValue:"spaceIdValue",releaseVersion:"releaseVersion",releaseVersionValue:"releaseVersionValue",padletId:"padletId",padletIdValue:"padletIdValue",jupyterId:"jupyterId",jupyterIdValue:"jupyterIdValue",jupyterExecutionCount:"jupyterExecutionCount",jupyterExecutionCountValue:"jupyterExecutionCountValue",aiGenerated:"aiGenerated",aiGeneratedValue:"aiGeneratedValue",ageRange:"ageRange",ageRangeValue:"ageRangeValue",lang:"lang",langValue:"langValue",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",flashcardSet:"flashcardSet",flashcardSetValue:"flashcardSetValue",subtype:"subtype",subtypeValue:"subtypeValue",bookAlias:"bookAlias",bookAliasValue:"bookAliasValue",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",pointerLeft:"pointerLeft",pointerLeftValue:"pointerLeftValue",pointerTop:"pointerTop",pointerTopValue:"pointerTopValue",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",content2Buy:"content2Buy",quotedPerson:"quotedPerson",partialAnswer:"partialAnswer",partialAnswerValue:"partialAnswerValue",reasonableNumOfChars:"reasonableNumOfChars",reasonableNumOfCharsValue:"reasonableNumOfCharsValue",resolved:"resolved",resolvedValue:"resolvedValue",resolvedDate:"resolvedDate",resolvedDateValue:"resolvedDateValue",resolvedBy:"resolvedBy",resolvedByValue:"resolvedByValue",maxCreatedBits:"maxCreatedBits",maxCreatedBitsValue:"maxCreatedBitsValue",product:"product",productValue:"productValue",productList:"productList",productListValue:"productListValue",productVideo:"productVideo",productVideoValue:"productVideoValue",productVideoList:"productVideoList",productVideoListValue:"productVideoListValue",productFolder:"productFolder",productFolderValue:"productFolderValue",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",anchor:"anchor",reference:"reference",referenceEnd:"referenceEnd",elementsValue:"elementsValue",solutionsValue:"solutionsValue",prefix:"prefix",postfix:"postfix",isCaseSensitive:"isCaseSensitive",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",imageSource:"imageSource",mockupId:"mockupId",size:"size",trim:"trim",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",resourceType:"resourceType",resources:"resources",resourcesValue:"resourcesValue",image:"image",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",audio:"audio",type:"type",typeAlias:"typeAlias",format:"format",value:"value",url:"url",src:"src",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",width:"width",height:"height",alt:"alt",zoomDisabled:"zoomDisabled",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",commentedBitType:"commentedBitType",warnings:"warnings",warningsValue:"warningsValue",errors:"errors",errorsValue:"errorsValue",message:"message",original:"original",start:"start",end:"end",offset:"offset",line:"line",column:"column",markup:"markup"});t.NodeType=i},7200:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractTagConfig=void 0;t.AbstractTagConfig=class{constructor(e,t,r,i,o,n,a,s,l){this.type=e,this.configKey=t,this.tag=r,this.maxCount=i,this.minCount=o,this.chain=n,this.jsonKey=a,this.astKey=s,this.deprecated=l}}},429:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitConfig=void 0;const i=r(1035);t.BitConfig=class{constructor(e,t,r,i,o,n,a,s,l,u,c,p,g,d){this.tags={},this.since=e,this.bitType=t,this.inheritedBitTypes=r,this.inheritedBitTypesSet=new Set(r),this.textFormatDefault=i,this.tags=o,this.cardSet=n,this.deprecated=a,this.bodyAllowed=s,this.bodyRequired=l,this.footerAllowed=u,this.footerRequired=c,this.resourceAttachmentAllowed=p,this.rootExampleType=g,this.comboResourceType=d}toString(e){const t=Object.assign({},e);let r=`[Bit]\n${this.bitType}`;this.inheritedBitTypes.length>0&&(r+="\n\n[Inheritance]",r+=`\n${this.inheritedBitTypes.join(" => ")}`),r+=`\n\n[Default text format]\n${this.textFormatDefault}`;const o=[];null!=this.since&&o.push(`since=${this.since}`),null!=this.deprecated&&o.push(`deprecated=${this.deprecated}`),this.bodyAllowed&&o.push("bodyAllowed"),this.bodyRequired&&o.push("bodyRequired"),this.footerAllowed&&o.push("footerAllowed"),this.footerRequired&&o.push("footerRequired"),this.resourceAttachmentAllowed&&o.push("resourceAttachmentAllowed"),null!=this.rootExampleType&&o.push(`rootExampleType=${this.rootExampleType}`),null!=this.comboResourceType&&o.push(`comboResourceType=${this.comboResourceType}`),r+=`\n\n[Flags]\n${o.join(", ")}`,r+="\n\n[Tags]";for(const e of Object.values(this.tags))(e.maxCount===i.Count.infinity||e.maxCount>0)&&(r+=`\n${e.toString(t)}`);return this.cardSet&&(r+=`\n\n${this.cardSet.toString(t)}`),r}}},2005:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetConfig=void 0;t.CardSetConfig=class{constructor(e,t){this.configKey=e,this.variants=t}toString(e){const t=Object.assign({},e);let r="",i=0,o=0;for(const e of this.variants){for(const n of e)r+=`[Card - Side ${i}, Variant ${o}]`,r+=`\n${n.toString(t)}`,o++;i++}return r}}},3585:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardVariantConfig=void 0;t.CardVariantConfig=class{constructor(e,t,r,i){this.tags=e,this.bodyAllowed=t,this.bodyRequired=r,this.repeatCount=i}toString(e){const t=Object.assign({},e);let r="";const i=[];this.bodyAllowed&&i.push("bodyAllowed"),this.bodyRequired&&i.push("bodyRequired"),null!=this.repeatCount&&i.push(`repeatCount=${this.repeatCount}`),r+=`[Flags]\n${i.join(", ")}`,r+="\n\n[Tags]";for(const e of Object.values(this.tags))r+=`\n${e.toString(t)}`;return r}}},6620:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MarkupTagConfig=void 0;const i=r(742),o=r(7200);class n extends o.AbstractTagConfig{constructor(e,t,r,o,n,a){super(i.BitTagType.tag,e,t,r,o,n,void 0,void 0,a),this.type=i.BitTagType.tag}toString(e){const t=Object.assign({},e);let r=`TAG[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const i of Object.values(this.chain))e||(r+=" "),r+=`${i.toString(t)}`,e=!1}return r}}t.MarkupTagConfig=n},6956:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyTagConfig=void 0;const i=r(742),o=r(7200);class n extends o.AbstractTagConfig{constructor(e,t,r,o,n,a,s,l,u,c,p){super(i.BitTagType.property,e,t,r,o,n,a,s,p),this.type=i.BitTagType.property,this.single=l,this.format=u,this.defaultValue=c}toString(e){const t=Object.assign({},e);let r=`PTY[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`),null!=this.single&&(r+=`, sgl=${this.single}`),null!=this.format&&(r+=`, fmt=${this.format}`),null!=this.defaultValue&&(r+=`, def=${this.defaultValue}`),null!=this.jsonKey&&(r+=`, json=${this.jsonKey}`),null!=this.astKey&&(r+=`, ast=${this.astKey}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const i of Object.values(this.chain))e||(r+=" "),r+=`${i.toString(t)}`,e=!1}return r}}t.PropertyTagConfig=n},7585:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceTagConfig=void 0;const i=r(742),o=r(7200);class n extends o.AbstractTagConfig{constructor(e,t,r,o,n,a,s){super(i.BitTagType.resource,e,t,r,o,n,a,void 0,s),this.type=i.BitTagType.resource}toString(e){const t=Object.assign({},e);let r=`RES[${this.tag}`;if(t.includeConfigs&&(null!=this.deprecated&&(r+=`, deprecated=${this.deprecated}`),null!=this.maxCount&&(r+=`, max=${this.maxCount}`),null!=this.minCount&&(r+=`, min=${this.minCount}`),null!=this.jsonKey&&(r+=`, json=${this.jsonKey}`)),r+="]",this.chain&&t.includeChains){r+="\n|__";let e=!0;for(const i of Object.values(this.chain))e||(r+=" "),r+=`${i.toString(t)}`,e=!1}return r}}t.ResourceTagConfig=n},3059:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourcesConfig=void 0;t.ResourcesConfig=class{constructor(e,t,r,i){this.tags=e,this.resourceAttachmentAllowed=null!=t&&t,this.resourceTypeAttachment=r,this.comboResourceTagTypesMap=i}getCountsMin(){const e=new Map;for(const t of Object.values(this.tags))null!=t.minCount&&e.set(t.tag,t.minCount);return e}getCountsMax(){const e=new Map;for(const t of Object.values(this.tags))null!=t.maxCount&&e.set(t.tag,t.maxCount);return e}}},2574:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetConfigKey=void 0;const i=(0,r(6688).superenum)({_flashcards:"_flashcards",_elements:"_elements",_statements:"_statements",_quiz:"_quiz",_questions:"_questions",_matchPairs:"_matchPairs",_matchAudioPairs:"_matchAudioPairs",_matchImagePairs:"_matchImagePairs",_matchMatrix:"_matchMatrix",_botActionResponses:"_botActionResponses",_exampleBitList:"_exampleBitList",_clozeList:"_clozeList"});t.CardSetConfigKey=i},8620:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigKey=void 0;const i=r(6688),o=r(177),n=r(3518),a=r(6194),s=r(1595),l=(0,i.superenum)(Object.assign(Object.assign(Object.assign(Object.assign({_unknown:"_unknown"},s.tagConfigKeys),n.propertyConfigKeys),a.resourceConfigKeys),o.groupConfigKeys));t.ConfigKey=l,function(){const e=new Set,t=[s.tagConfigKeys,n.propertyConfigKeys,a.resourceConfigKeys,o.groupConfigKeys];for(const r of t)for(const t in r){if(e.has(t))throw new Error(`Duplicate ConfigKey: ${t}`);e.add(t)}}()},177:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.groupConfigKeys=t.GroupConfigKey=void 0;const i=r(6688),o={group_standardAllBits:"group_standardAllBits",group_standardItemLeadInstructionHint:"group_standardItemLeadInstructionHint",group_standardExample:"group_standardExample",group_standardTags:"group_standardTags",group_imageSource:"group_imageSource",group_partner:"group_partner",group_gap:"group_gap",group_trueFalse:"group_trueFalse",group_markConfig:"group_markConfig",group_mark:"group_mark",group_bookCommon:"group_bookCommon",group_learningPathCommon:"group_learningPathCommon",group_resourceCommon:"group_resourceCommon",group_resourceImageCommon:"group_resourceImageCommon",group_resourceAudioCommon:"group_resourceAudioCommon",group_resourceVideoCommon:"group_resourceVideoCommon",group_resourceImage:"group_resourceImage",group_resourceImageEmbed:"group_resourceImageEmbed",group_resourceImageLink:"group_resourceImageLink",group_resourceImageResponsive:"group_resourceImageResponsive",group_resourceImagePortrait:"group_resourceImagePortrait",group_resourceImageLandscape:"group_resourceImageLandscape",group_resourceAudio:"group_resourceAudio",group_resourceAudioEmbed:"group_resourceAudioEmbed",group_resourceAudioLink:"group_resourceAudioLink",group_resourceVideo:"group_resourceVideo",group_resourceVideoEmbed:"group_resourceVideoEmbed",group_resourceVideoLink:"group_resourceVideoLink",group_resourceStillImageFilm:"group_resourceStillImageFilm",group_resourceStillImageFilmEmbed:"group_resourceStillImageFilmEmbed",group_resourceStillImageFilmLink:"group_resourceStillImageFilmLink",group_resourceArticle:"group_resourceArticle",group_resourceArticleEmbed:"group_resourceArticleEmbed",group_resourceArticleLink:"group_resourceArticleLink",group_resourceDocument:"group_resourceDocument",group_resourceDocumentEmbed:"group_resourceDocumentEmbed",group_resourceDocumentLink:"group_resourceDocumentLink",group_resourceDocumentDownload:"group_resourceDocumentDownload",group_resourceAppLink:"group_resourceAppLink",group_resourceWebsiteLink:"group_resourceWebsiteLink"};t.groupConfigKeys=o;const n=(0,i.superenum)(o);t.GroupConfigKey=n},5428:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GroupConfigType=void 0;const i=(0,r(6688).superenum)({standard:"standard",resource:"resource",comboResource:"comboResource"});t.GroupConfigType=i},3518:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propertyConfigKeys=t.PropertyConfigKey=void 0;const i=r(6688),o={action:"action",ageRange:"ageRange",aiGenerated:"aiGenerated",allowSubtitles:"allowSubtitles",alt:"alt",author:"author",autoplay:"autoplay",book:"book",bookAlias:"bookAlias",bot:"bot",caption:"caption",isCaseSensitive:"isCaseSensitive",color:"color",colorTag:"colorTag",computerLanguage:"computerLanguage",content2Buy:"content2Buy",copyright:"copyright",coverImage:"coverImage",date:"date",deeplink:"deeplink",duration:"duration",emphasis:"emphasis",example:"example",externalId:"externalId",externalLink:"externalLink",externalLinkText:"externalLinkText",flashcardSet:"flashcardSet",focusX:"focusX",focusY:"focusY",format:"format",height:"height",icon:"icon",iconTag:"iconTag",id:"id",imageSource:"imageSource",internalComment:"internalComment",isInfoOnly:"isInfoOnly",isTracked:"isTracked",jupyterExecutionCount:"jupyterExecutionCount",jupyterId:"jupyterId",kind:"kind",labelFalse:"labelFalse",labelTrue:"labelTrue",lang:"lang",language:"language",license:"license",list:"list",location:"location",markConfig:"markConfig",maxCreatedBits:"maxCreatedBits",mockupId:"mockupId",mute:"mute",padletId:"padletId",partialAnswer:"partialAnswer",partner:"partner",pointerLeft:"pointerLeft",pointerTop:"pointerTop",posterImage:"posterImage",product:"product",productList:"productList",productVideo:"productVideo",productVideoList:"productVideoList",productFolder:"productFolder",progress:"progress",property_mark:"property_mark",property_reference:"property_reference",property_sampleSolution:"property_sampleSolution",publications:"publications",publisher:"publisher",quotedPerson:"quotedPerson",reaction:"reaction",reasonableNumOfChars:"reasonableNumOfChars",releaseVersion:"releaseVersion",resolved:"resolved",resolvedDate:"resolvedDate",resolvedBy:"resolvedBy",showInIndex:"showInIndex",showSubtitles:"showSubtitles",siteName:"siteName",size:"size",spaceId:"spaceId",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",subject:"subject",subtype:"subtype",tag:"tag",target:"target",textReference:"textReference",theme:"theme",thumbImage:"thumbImage",toc:"toc",trim:"trim",videoCallLink:"videoCallLink",width:"width",zoomDisabled:"zoomDisabled"};t.propertyConfigKeys=o;const n=(0,i.superenum)(o);t.PropertyConfigKey=n},6194:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resourceConfigKeys=t.ResourceConfigKey=void 0;const i=r(6688),o={image:"image",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",imageEmbed:"imageEmbed",imageLink:"imageLink",audio:"audio",audioEmbed:"audioEmbed",audioLink:"audioLink",video:"video",videoEmbed:"videoEmbed",videoLink:"videoLink",stillImageFilmEmbed:"stillImageFilmEmbed",stillImageFilmLink:"stillImageFilmLink",article:"article",articleEmbed:"articleEmbed",articleLink:"articleLink",document:"document",documentEmbed:"documentEmbed",documentLink:"documentLink",documentDownload:"documentDownload",appLink:"appLink",websiteLink:"websiteLink"};t.resourceConfigKeys=o;const n=(0,i.superenum)(o);t.ResourceConfigKey=n},1595:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tagConfigKeys=t.TagConfigKey=void 0;const i=r(6688),o={title:"title",anchor:"anchor",tag_reference:"tag_reference",property:"property",itemLead:"itemLead",instruction:"instruction",hint:"hint",true:"true",false:"false",sampleSolution:"sampleSolution",gap:"gap",tag_mark:"tag_mark",resource:"resource"};t.tagConfigKeys=o;const n=(0,i.superenum)(o);t.TagConfigKey=n},742:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitTagType=void 0;const i=(0,r(6688).superenum)({tag:"tag",property:"property",resource:"resource",group:"group"});t.BitTagType=i},208:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitType=void 0;const i=(0,r(6688).superenum)({_error:"_error",_comment:"_comment",aiPrompt:"ai-prompt",anchor:"anchor",appAiPrompt:"app-ai-prompt",appBitmarkFromEditor:"app-bitmark-from-editor",appBitmarkFromJavascript:"app-bitmark-from-javascript",appCodeCell:"app-code-cell",appCodeEditor:"app-code-editor",appCodeIde:"app-code-ide",appCreateBitsFromImage:"app-create-bits-from-image",appFlashcards:"app-flashcards",appFlashcardsLearn:"app-flashcards-learn",appFlashcardsQuiz:"app-flashcards-quiz",appGetScreenshot:"app-get-screenshot",appLink:"app-link",article:"article",articleAi:"article-ai",articleAttachment:"article-attachment",articleEmbed:"article-embed",articleLink:"article-link",assignment:"assignment",assignmentList:"assignment-list",audio:"audio",audioEmbed:"audio-embed",audioLink:"audio-link",audioTranscript:"audio-transcript",bitAlias:"bit-alias",bitBookEnding:"bit-book-ending",bitBookSummary:"bit-book-summary",bitmarkExample:"bitmark-example",blogArticle:"blog-article",book:"book",bookAcknowledgments:"book-acknowledgments",bookAddendum:"book-addendum",bookAfterword:"book-afterword",bookAlias:"book-alias",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",bookLink:"book-link",bookLinkNext:"book-link-next",bookLinkPrev:"book-link-prev",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",botActionResponse:"bot-action-response",botActionSave:"bot-action-save",botActionSend:"bot-action-send",botActionTrueFalse:"bot-action-true-false",botInterview:"bot-interview",browserImage:"browser-image",bug:"bug",buttonCopyText:"button-copy-text",card1:"card-1",chapter:"chapter",chapterSubjectMatter:"chapter-subject-matter",chat:"chat",checklist:"checklist",cloze:"cloze",clozeAndMultipleChoiceText:"cloze-and-multiple-choice-text",clozeInstructionGrouped:"cloze-instruction-grouped",clozeList:"cloze-list",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",code:"code",codeRuntime:"code-runtime",conclusion:"conclusion",consoleLog:"console-log",conversationLeft1:"conversation-left-1",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",detailsImage:"details-image",document:"document",documentDownload:"document-download",documentEmbed:"document-embed",documentLink:"document-link",documentUpload:"document-upload",editorial:"editorial",editorNote:"editor-note",essay:"essay",example:"example",exampleList:"example-list",featured:"featured",figure:"figure",flashcard:"flashcard",flashcard1:"flashcard-1",focusImage:"focus-image",footNote:"foot-note",groupBorn:"group-born",groupDied:"group-died",help:"help",highlightText:"highlight-text",hint:"hint",image:"image",imageBanner:"image-banner",imageFigure:"image-figure",imageLandscape:"image-landscape",imageLink:"image-link",imageMood:"image-mood",imageOnDevice:"image-on-device",imagePortrait:"image-portrait",imagePrototype:"image-prototype",imageResponsive:"image-responsive",imageScreenshot:"image-screenshot",imageSeparator:"image-separator",imageStyled:"image-styled",imageSuperWide:"image-super-wide",imageZoom:"image-zoom",info:"info",internalLink:"internal-link",interview:"interview",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",learningPathBook:"learning-path-book",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",lifeSkillSticker:"life-skill-sticker",mark:"mark",match:"match",matchAll:"match-all",matchAllReverse:"match-all-reverse",matchAudio:"match-audio",matchMatrix:"match-matrix",matchPicture:"match-picture",matchReverse:"match-reverse",matchSolutionGrouped:"match-solution-grouped",message:"message",multipleChoice:"multiple-choice",multipleChoice1:"multiple-choice-1",multipleChoiceText:"multiple-choice-text",multipleResponse:"multiple-response",multipleResponse1:"multiple-response-1",newspaperArticle:"newspaper-article",note:"note",noteAi:"note-ai",notebookArticle:"notebook-article",output:"output",page:"page",pageBanner:"page-banner",pageBuyButton:"page-buy-button",pageFooter:"page-footer",pageProduct:"page-product",pageProductList:"page-product-list",pageProductVideo:"page-product-video",pageProductVideoList:"page-product-video-list",pageSectionFolder:"page-section-folder",photo:"photo",preparationNote:"preparation-note",question1:"question-1",quote:"quote",rating:"rating",recordAudio:"record-audio",releaseNote:"release-note",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",sampleSolution:"sample-solution",screenshot:"screenshot",selfAssessment:"self-assessment",separator:"separator",sequence:"sequence",sideNote:"side-note",statement:"statement",stdout:"stdout",step:"step",stepImageScreenshot:"step-image-screenshot",stepImageScreenshotWithPointer:"step-image-screenshot-with-pointer",stickyNote:"sticky-note",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",summary:"summary",summaryAi:"summary-ai",survey:"survey",survey1:"survey-1",surveyAnonymous:"survey-anonymous",surveyAnonymous1:"survey-anonymous-1",takePicture:"take-picture",toc:"toc",trueFalse:"true-false",trueFalse1:"true-false-1",vendorJupyterCellCode:"vendor-jupyter-cell-code",vendorJupyterCellMarkdown:"vendor-jupyter-cell-markdown",vendorJupyterCellRaw:"vendor-jupyter-cell-raw",vendorJupyterIpynb:"vendor-jupyter-ipynb",vendorJupyterOutput:"vendor-jupyter-output",vendorPadletEmbed:"vendor-padlet-embed",video:"video",videoEmbed:"video-embed",videoEmbedLandscape:"video-embed-landscape",videoEmbedPortrait:"video-embed-portrait",videoLandscape:"video-landscape",videoLink:"video-link",videoLinkLandscape:"video-link-landscape",videoLinkPortrait:"video-link-portrait",videoPortrait:"video-portrait",videoTranscript:"video-transcript",warning:"warning",websiteLink:"website-link",workbookArticle:"workbook-article"});t.BitType=i},6958:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParserType=void 0;const i=(0,r(6688).superenum)({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},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},1035:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Count=void 0;const i=(0,r(6688).superenum)({infinity:"infinity"});t.Count=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},7204:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyAstKey=void 0;const i=(0,r(6688).superenum)({aiGenerated:"aiGenerated",isCaseSensitive:"isCaseSensitive",referenceProperty:"referenceProperty",markConfig:"markConfig",productList:"productList",productVideoList:"productVideoList"});t.PropertyAstKey=i},5486:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyFormat=void 0;const i=(0,r(6688).superenum)({none:"none",string:"string",trimmedString:"trimmedString",number:"number",boolean:"boolean",invertedBoolean:"invertedBoolean"});t.PropertyFormat=i},7953:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyTag=void 0;const i=(0,r(6688).superenum)({action:"action",ageRange:"ageRange",aiGenerated:"AIGenerated",allowSubtitles:"allowSubtitles",alt:"alt",author:"author",autoplay:"autoplay",book:"book",bookAlias:"bookAlias",bot:"bot",caption:"caption",isCaseSensitive:"isCaseSensitive",color:"color",colorTag:"colorTag",computerLanguage:"computerLanguage",content2Buy:"content2Buy",copyright:"copyright",coverImage:"coverImage",date:"date",deeplink:"deeplink",duration:"duration",emphasis:"emphasis",example:"example",externalId:"externalId",externalLink:"externalLink",externalLinkText:"externalLinkText",flashcardSet:"flashcardSet",focusX:"focusX",focusY:"focusY",format:"format",height:"height",icon:"icon",iconTag:"iconTag",id:"id",imageSource:"imageSource",internalComment:"internalComment",isInfoOnly:"isInfoOnly",isTracked:"isTracked",jupyterExecutionCount:"jupyterExecutionCount",jupyterId:"jupyterId",kind:"kind",labelFalse:"labelFalse",labelTrue:"labelTrue",lang:"lang",language:"language",license:"license",list:"list",location:"location",mark:"mark",maxCreatedBits:"maxCreatedBits",mockupId:"mockupId",mute:"mute",padletId:"padletId",partialAnswer:"partialAnswer",partner:"partner",pointerLeft:"pointerLeft",pointerTop:"pointerTop",posterImage:"posterImage",product:"product",productVideo:"productVideo",productFolder:"productFolder",progress:"progress",publications:"publications",publisher:"publisher",quotedPerson:"quotedPerson",reaction:"reaction",reasonableNumOfChars:"reasonableNumOfChars",reference:"reference",releaseVersion:"releaseVersion",resolved:"resolved",resolvedDate:"resolvedDate",resolvedBy:"resolvedBy",sampleSolution:"sampleSolution",showInIndex:"showInIndex",showSubtitles:"showSubtitles",siteName:"siteName",size:"size",spaceId:"spaceId",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",subject:"subject",subtype:"subtype",tag:"tag",target:"target",textReference:"textReference",theme:"theme",thumbImage:"thumbImage",toc:"toc",trim:"trim",videoCallLink:"videoCallLink",width:"width",zoomDisabled:"zoomDisabled"});t.PropertyTag=i},9431:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceJsonKey=void 0;const i=(0,r(6688).superenum)({imageResponsive:"imageResponsive",imagePortrait:"imagePortrait",imageLandscape:"imageLandscape",imageEmbed:"imageEmbed",imageLink:"imageLink",audioEmbed:"audioEmbed",audioLink:"audioLink",videoEmbed:"videoEmbed",videoLink:"videoLink",stillImageFilm:"stillImageFilm",stillImageFilmEmbed:"stillImageFilmEmbed",stillImageFilmLink:"stillImageFilmLink",articleEmbed:"articleEmbed",articleLink:"articleLink",documentEmbed:"documentEmbed",documentLink:"documentLink",documentDownload:"documentDownload",appLink:"appLink",websiteLink:"websiteLink"});t.ResourceJsonKey=i},9779:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceTag=void 0;const i=(0,r(6688).superenum)({unknown:"unknown",image:"image",imageResponsive:"image-responsive",imagePortrait:"image-portrait",imageLandscape:"image-landscape",imageEmbed:"image-embed",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:"article-embed",articleLink:"article-link",document:"document",documentEmbed:"document-embed",documentLink:"document-link",documentDownload:"document-download",appLink:"app-link",websiteLink:"website-link"});t.ResourceTag=i},8739:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=void 0;const i=(0,r(6688).superenum)({title:"#",anchor:"▼",reference:"►",property:"@",itemLead:"%",instruction:"!",hint:"?",true:"+",false:"-",sampleSolution:"$",gap:"_",mark:"=",resource:"&"});t.Tag=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",mark:"mark"});t.TextNodeType=i},8681:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoFormat=void 0;const i=(0,r(6688).superenum)({text:"text",json:"json",pojo:"pojo"});t.InfoFormat=i},7347:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InfoType=void 0;const i=(0,r(6688).superenum)({list:"list",deprecated:"deprecated",all:"all",bit:"bit"});t.InfoType=i},9556:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParser=void 0;const i=r(2434),o=r(8030);t.BitmarkParser=class{constructor(){this.jsonParser=new i.JsonParser}toAst(e,t){return(0,o.parse)(e)}}},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),n=r(7542),a=r(6831);r(2606);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},a=this.parse(e,{startRule:"bit",grammarSource:new n.PeggyGrammarLocation("bit",o)});return a.value&&(a.value.markup=i),a}handleTextFormat(e){return{type:a.TypeKey.TextFormat,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceType(e){return{type:a.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:a.TypeKey.Property,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceTag(e,t){return{type:a.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!==a.TypeKey.Card)continue;const{cardIndex:n,cardSideIndex:s,cardVariantIndex:l,value:u}=i;let c=r.cards[n];c||(c={sides:[]},r.cards[n]=c);let p=c.sides[s];p||(p={variants:[]},c.sides[s]=p);p.variants[l]?p.variants[l].value+=u:p.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 n.PeggyGrammarLocation("card-content",i)});o=this.reduceToArrayOfTypes(o),this.debugPrint("parsedCardContent",o),t.variants.push({parser:e,content:o})}}}}return{type:a.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,n=!1;return Array.isArray(e)&&2===e.length&&(e=e[0],t===i.CardSetVersion.v1?(r=e===a.CARD_DIVIDER_V1,o=e===a.CARD_SIDE_DIVIDER_V1,n=e===a.CARD_VARIANT_DIVIDER_V1):(r=e===a.CARD_DIVIDER_V2,o=e===a.CARD_SIDE_DIVIDER_V2,n=e===a.CARD_VARIANT_DIVIDER_V2)),r?(this.cardIndex++,this.cardSideIndex=0,this.cardVariantIndex=0):o?(this.cardSideIndex++,this.cardVariantIndex=0):n&&this.cardVariantIndex++,this.isType(e,a.TypeKey.Card)?e:{type:a.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:""},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardLine(e){return{type:a.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,n,s;const l=[];let u,c;for(const p of e)switch(p.type){case a.TypeKey.BodyChar:if(u){const e=`${null!==(t=u.value)&&void 0!==t?t:""}${null!==(r=p.value)&&void 0!==r?r:""}`;u.value=e}else u={type:a.TypeKey.BodyText,value:null!==(i=p.value)&&void 0!==i?i:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;case a.TypeKey.CardChar:if(c){const e=`${null!==(o=c.value)&&void 0!==o?o:""}${null!==(n=p.value)&&void 0!==n?n:""}`;c.value=e}else c={type:a.TypeKey.CardText,value:null!==(s=p.value)&&void 0!==s?s:"",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(p)}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:!!a.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:n,value:a}=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(a)){const r=this.reduceToArrayOfTypes(a,t);e.push(...r)}else n&&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),n=r(8159),a=r(2606),s=r(208),l=r(1060),u=r(9779),c=r(1353),p=r(3633),g=r(8386),d=r(1182),y=r(8081),f=r(9577),h=r(2786),m=r(857),T=r(3287),b=r(3130),v=r(5516),B=r(1838),C=r(4177),k=r(6831),x=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),state:{}}}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 x.bitmark({bits:r,errors:i.length>0?i:void 0})}buildBit(e,t){var r;const{bitType:o,textFormat:n,resourceType:l}=e;if(!o||a.Config.isOfBitType(o,s.BitType._error))return this.invalidBit();if(a.Config.isOfBitType(o,s.BitType._comment))return this.commentBit();const u=a.Config.isOfBitType(o,s.BitType.trueFalse1),c=a.Config.isOfBitType(o,s.BitType.multipleChoice1),p=a.Config.isOfBitType(o,s.BitType.multipleResponse1);this.debugPrint("BIT CONTENT",t),this.resetParserState(),t=g.BitmarkPegParserValidator.validateBitTags(this.context,o,l,t);const y=a.Config.getBitConfig(o),f=this.bitContentProcessor(o,k.BitContentLevel.Bit,y.tags,t),{body:h,footer:m,cardSet:T,title:b,statement:C,statements:P,choices:w,responses:S,resources:A,internalComments:K}=f,_=i(f,["body","footer","cardSet","title","statement","statements","choices","responses","resources","internalComments"]);this.debugPrint("BIT TAGS",_),this.debugPrint("BIT BODY",h),this.debugPrint("BIT FOOTER",m);const I=(0,B.buildTitles)(this.context,o,b),O=(0,d.buildCards)(this.context,o,T,C,P,w,S),R=(0,v.buildResources)(this.context,o,l,A),E=[...null!=K?K:[],...null!==(r=O.internalComments)&&void 0!==r?r:[]],L=this.buildBitLevelWarnings(),j=this.buildBitLevelErrors();L&&(this.parser.warnings=L),j&&(this.parser.errors=j);return{value:x.bit(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({bitType:o,textFormat:n,resourceType:l},I),{statement:u?C:void 0,choices:c?w:void 0,responses:p?S:void 0}),_),{resources:R}),O),{body:h,footer:m,internalComment:E,parser:this.parser}))}}invalidBit(e){e&&this.addError("Invalid bit"),this.parser.errors=this.buildBitLevelErrors();return{value:x.bit({bitType:a.Config.getBitType(s.BitType._error),parser:this.parser})}}commentBit(){this.parser.errors=this.buildBitLevelErrors();return{value:x.bit({bitType:a.Config.getBitType(s.BitType._comment),parser:this.parser})}}buildBitHeader(e,t){const r=a.Config.getBitType(e);a.Config.isOfBitType(r,s.BitType._error)?this.addError(`Invalid bit type: '${e}'`):a.Config.isOfBitType(r,s.BitType._comment)&&(this.parser.commentedBitType=`[.${e.slice(1)}]`);const i=a.Config.getBitConfig(r);let o=c.TextFormat.fromValue(t.textFormat);t.textFormat&&!o&&this.addWarning(`Invalid text format '${t.textFormat}', defaulting to '${i.textFormatDefault}'`),o=null!=o?o:i.textFormatDefault;const n=u.ResourceTag.fromValue(t.resourceType);return t.resourceType&&!n&&this.addWarning(`Invalid resource type '${t.resourceType}', it will be ignored`),{bitType:r,textFormat:null!=o?o:i.textFormatDefault,resourceType:n}}buildTextAndResourceType(e,t){const r={},i=e=>{e&&(e.type===k.TypeKey.TextFormat?r.textFormat=p.StringUtils.string(e.value):r.resourceType=p.StringUtils.string(e.value))};return i(e),i(t),r}resetParserState(){this.context.state={}}bitContentProcessor(e,t,r,i){const o={};if(!i)return o;o.title=[],o.solutions=[],o.statements=[],o.choices=[],o.responses=[],o.resources=[],o.trueFalse=[],o.markConfig=[],o.extraProperties={},o.internalComments=[];let a=!1,s=!1,l=!1;const u=[];let c=n.Breakscape.EMPTY_STRING,p=n.Breakscape.EMPTY_STRING;const d=t===k.BitContentLevel.Bit,P=t===k.BitContentLevel.Card,w=t===k.BitContentLevel.Chain,S=()=>{if(c){c=g.BitmarkPegParserValidator.checkBodyPart(this.context,e,t,c);const r=x.bodyText({text:c});u.push(r)}c=n.Breakscape.EMPTY_STRING};return i.forEach(((i,g)=>{const{type:d,value:x}=i;switch(d){case k.TypeKey.ItemLead:(0,h.itemLeadTagContentProcessor)(this.context,e,t,r,i,o,a),a=!0;break;case k.TypeKey.Instruction:case k.TypeKey.Hint:case k.TypeKey.Anchor:case k.TypeKey.SampleSolution:(0,y.defaultTagContentProcessor)(this.context,e,t,r,i,o);break;case k.TypeKey.Reference:(0,b.referenceTagContentProcessor)(this.context,e,t,r,i,o,s),s=!0;break;case k.TypeKey.Title:(0,B.titleTagContentProcessor)(this.context,e,t,r,i,o);break;case k.TypeKey.Property:(0,T.propertyContentProcessor)(this.context,e,t,r,i,o);break;case k.TypeKey.Gap:w||S(),(0,f.gapChainContentProcessor)(this.context,e,t,r,i,o,u);break;case k.TypeKey.Mark:w||S(),(0,m.markChainContentProcessor)(this.context,e,t,r,i,o,u);break;case k.TypeKey.True:case k.TypeKey.False:w||S(),(0,C.trueFalseChainContentProcessor)(this.context,e,t,r,i,o,u);break;case k.TypeKey.Resource:(0,v.resourceContentProcessor)(this.context,e,t,r,i,o);break;case k.TypeKey.CardSet:o.cardSet=x,l=!0;break;case k.TypeKey.BodyText:case k.TypeKey.CardText:l?p=n.Breakscape.concatenate(p,x):c=n.Breakscape.concatenate(c,x)}})),S(),d?(o.body=u.length>0?x.body({bodyParts:this.trimBodyParts(u)}):void 0,g.BitmarkPegParserValidator.checkBody(this.context,e,t,o.body)):P&&(o.cardBody=u.length>0?x.body({bodyParts:this.trimBodyParts(u)}):void 0),p=p.trim(),p&&(p=g.BitmarkPegParserValidator.checkFooter(this.context,e,t,p),p&&(o.footer=x.footerText({text:p}))),0===Object.keys(o.extraProperties).length&&delete o.extraProperties,0===o.title.length&&delete o.title,0===o.solutions.length&&delete o.solutions,0===o.statements.length&&delete o.statements,0===o.choices.length&&delete o.choices,0===o.responses.length&&delete o.responses,0===o.trueFalse.length&&delete o.trueFalse,0===o.markConfig.length&&delete o.markConfig,0===o.resources.length&&delete o.resources,0===o.internalComments.length&&delete o.internalComments,o}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!==l.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!==l.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,n;const a={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!==(n=null==r?void 0:r.parser)&&void 0!==n?n:void 0};a.original||delete a.original,this.nonFatalWarnings.push(a)}addError(e,t,r){var i,o,n;const a={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!==(n=null==r?void 0:r.parser)&&void 0!==n?n:void 0};a.original||delete a.original,this.nonFatalErrors.push(a)}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),o=r(8739);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 n=(0,i.superenum)({TextFormat:"TextFormat",ResourceType:"ResourceType",Title:o.Tag.title,Anchor:o.Tag.anchor,Reference:o.Tag.reference,ItemLead:o.Tag.itemLead,Instruction:o.Tag.instruction,Hint:o.Tag.hint,True:o.Tag.true,False:o.Tag.false,Gap:o.Tag.gap,Mark:o.Tag.mark,SampleSolution:o.Tag.sampleSolution,Property:"Property",Resource:"Resource",TagChain:"TagChain",BodyChar:"BodyChar",BodyText:"BodyText",CardSet:"CardSet",Card:"Card",CardChar:"CardChar",CardText:"CardText",GapChain:"GapChain",TrueFalseChain:"TrueFalseChain"});t.TypeKey=n;const a=(0,i.superenum)({Bit:"Bit",Card:"Card",Chain:"Chain"});t.BitContentLevel=a},8386:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserValidator=void 0;const i=r(2606),o=r(742),n=r(1035),a=r(7953),s=r(8739),l=r(6831),u=["====","----","\n==\n","\n---\n","\n--\n",":::","::::","|||","||||"],c=["==\n","---\n","--\n"],p=["\n==","\n---","\n--"];const g=new class{validateBitTags(e,t,r,o){if(!o)return[];const n=i.Config.getBitConfig(t),{tags:a,cardSet:s}=n,u=i.Config.getBitResourcesConfig(t,r),c=Object.assign(Object.assign({},a),u.tags);return this.validateTagChainsRecursive(e,t,l.BitContentLevel.Bit,o,c,s)}checkBody(e,t,r,o){if(!o)return o;const n=i.Config.getBitConfig(t),{bodyAllowed:a}=n;return o.bodyParts.length>0&&!a&&e.addWarning(`Bit '${t}' should not have a body.`),o}checkBodyPart(e,t,r,i){return i?(this.checkBodyForCommonPotentialMistakes(e,r,t,i),i):i}checkFooter(e,t,r,o){if(!o)return o;const n=i.Config.getBitConfig(t),{footerAllowed:a}=n;return this.checkBodyForCommonPotentialMistakes(e,r,t,o),a||e.addWarning(`Bit '${t}' should not have a footer.`),o}checkCardBody(e,t,r,o,n,a,s){if(!o)return o;const l=i.Config.getBitConfig(t);if(!l.cardSet)return o;const u=this.getVariantConfig(l.cardSet.variants,a,s);if(!u)return o;const{bodyAllowed:c}=u;return o.bodyParts.length>0&&!c&&e.addWarning(`Bit '${t}' should not have a card body at card:${n+1}, side:${a+1}, variant:${s+1}.`),o}validateTagChainsRecursive(e,t,r,i,u,c){if(!i)return[];const p=[...i],g=this.convertTagsToTypeKeyMap(e,r,t,u),d=(e,t,r)=>{g.set(e,{maxCount:t,minCount:r,_type:e,_tag:e,_seenCount:0})};var y,f,h;y=a.PropertyTag.internalComment,f=n.Count.infinity,h=0,g.set(`${l.TypeKey.Property}:${y}`,{maxCount:f,minCount:h,_type:o.BitTagType.property,_tag:s.Tag.property,_seenCount:0}),r===l.BitContentLevel.Bit?(c&&d(l.TypeKey.CardSet,1,0),d(l.TypeKey.TextFormat,1,0),d(l.TypeKey.BodyText,n.Count.infinity,0)):r===l.BitContentLevel.Card&&d(l.TypeKey.CardText,n.Count.infinity,0);for(let i=0;i<p.length;i++){const o=p[i];if(!o)continue;const{type:n,key:a}=o,s=l.TypeKey.fromValue(n);if(!s)continue;let u=s;s!==l.TypeKey.Property&&s!==l.TypeKey.Resource||(u=`${s}:${a}`);const d=g.get(u),y=this.validateSingleTag(e,t,r,o,s,d,c);if(y||p.splice(i,1,null),y&&Array.isArray(y.chain)&&y.chain.length>0)if(d&&d.chain){const r=this.validateTagChainsRecursive(e,t,l.BitContentLevel.Chain,y.chain,d.chain);r&&r.length>0?y.chain=r:y.chain=void 0}else y.type!==l.TypeKey.Resource&&(p.splice(i+1,0,...y.chain),y.chain=void 0)}for(const t of g.values()){const{minCount:r,_seenCount:i}=t;if(null!=r&&i<r){const i=`${this.getTagSignature(t)} is required at least ${r} time(s)`;e.addWarning(i)}}return p.filter((e=>null!=e))}validateSingleTag(e,t,r,i,o,n,a){const{type:s,key:u}=i,c=n?this.getTagSignature(n):this.getUnknownTagSignature(s,u),p=" It will be ignored";let g,d,y="";if(n)switch(n._seenCount++,o){case l.TypeKey.Property:{const{content:o,warning:a}=this.validatePropertyTag(e,r,t,n,i);g=o,d=a;break}case l.TypeKey.Resource:{const{content:o,warning:a}=this.validateResourceTag(e,r,t,n,i);g=o,d=a;break}case l.TypeKey.CardSet:{const{content:r,warning:o}=this.validateCardSet(e,t,n,i,a);g=r,d=o;break}default:{const{content:o,warning:a}=this.validateStandardTag(e,r,t,n,i);g=o,d=a}}else switch(o){case l.TypeKey.Property:d={extraProperty:!0},g=i;break;case l.TypeKey.Resource:d={excessResource:!0},g=i;break;default:d={invalid:!0}}if(d){const t=null==n?void 0:n._previous;d.invalid||d.excessResource?y=`${c} is not valid here.${p}`:null!=d.tooMany?(y=`${c} is included more than ${d.tooMany} time(s).`,d.tooMany>0&&(y+=" The earlier ones will be ignored")):d.extraProperty?y=`${c} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`:d.unexpectedCardSet?y=`${c} is not expected here.${p}`:d.unexpectedCardSideVariant&&(y=`${c} has a card / side / variant that is not expected here.${p}`),e.addWarning(y,i,t)}return n&&(n._previous=i),g}validateStandardTag(e,t,r,i,o){const a=null==i.maxCount?1:i.maxCount;return a!==n.Count.infinity&&i._seenCount>a?{warning:{tooMany:a},content:o}:{content:o}}validatePropertyTag(e,t,r,i,o){const a=null==i.maxCount?1:i.maxCount;return a!==n.Count.infinity&&i._seenCount>a?{warning:{tooMany:a},content:o}:{content:o}}validateResourceTag(e,t,r,i,o){const a=null==i.maxCount?1:i.maxCount;return a!==n.Count.infinity&&i._seenCount>a?{warning:{tooMany:a},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 s,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 p=this.getVariantConfig(o.variants,u,c);p?a=this.validateTagChainsRecursive(e,t,l.BitContentLevel.Card,n,p.tags):s={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:s}}checkBodyForCommonPotentialMistakes(e,t,r,i){if(i){for(const t of u)i.includes(t)&&e.addWarning(`Bit '${r}' might contain a mistake: ${t}`);for(const t of c)i.startsWith(t)&&e.addWarning(`Bit '${r}' might contain a mistake: ${t}`);for(const t of p)i.endsWith(t)&&e.addWarning(`Bit '${r}' might contain a mistake: ${t}`)}}convertTagsToTypeKeyMap(e,t,r,i){const n=new Map;for(const e of Object.values(i)){const t={minCount:e.minCount,maxCount:e.maxCount,isTag:e.type===o.BitTagType.tag,isProperty:e.type===o.BitTagType.property,isResource:e.type===o.BitTagType.resource,chain:e.chain,_configKey:e.configKey,_type:e.type,_tag:e.tag,_seenCount:0,_previous:void 0};if(t.isProperty)n.set(`${l.TypeKey.Property}:${e.tag}`,t);else if(t.isResource)n.set(`${l.TypeKey.Resource}:${e.tag}`,t);else{const r=l.TypeKey.fromValue(e.tag);r&&n.set(r,t)}}return n}getVariantConfig(e,t,r){let i;if(0===e.length)return;const o=e[Math.min(t,e.length-1)],a=o.length-1;if(r>a){if(i=o[a],i.repeatCount!==n.Count.infinity)return}else i=o[r];return i}getTagSignature(e){switch(e._type){case o.BitTagType.tag:return`[${e._tag}]`;case o.BitTagType.property:return`[@${e._tag}]`;case o.BitTagType.resource:return`[&${e._tag}]`;default:return`'${e._type}' tag '${e._tag}'`}}getUnknownTagSignature(e,t){switch(e){case l.TypeKey.Property:return`[@${t}]`;case l.TypeKey.Resource:return`[&${t}]`;default:return`'${e}' tag '${t}'`}}};t.BitmarkPegParserValidator=g},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,n,a,s){if(r===o.BitContentLevel.Chain);else{const r=function(e,t,r,n,a){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("book content",a);const s=e.bitContentProcessor(t,o.BitContentLevel.Chain,n,a.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("book TAGS",s);const{reference:l,referenceEnd:u}=s,c=i.StringUtils.trimmedString(a.value);return{book:c,reference:l,referenceEnd:u}}(e,t,0,n,a);s.book=r.book,s.reference=r.reference,s.referenceEnd=r.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),n=r(8159),a=r(2606),s=r(2574),l=r(208),u=r(1060),c=r(9779),p=r(8386),g=r(6831),d=new o.Builder;function y(e){let t="";if(e&&e.bodyParts)for(const r of e.bodyParts)if(r.type===u.BodyBitType.text){t+=r.data.bodyText}return t}t.buildCards=function(e,t,r,o,u,f,h){var m;e.DEBUG_CARD_SET&&e.debugPrint("card set",r);let T={};const b=function(e,t,r){const i={cards:[],internalComments:[]};if(!r)return i;let o=0,n=0,s=0;for(const l of r.cards){const r={no:o++,sides:[]};i.cards.push(r);for(const o of l.sides){const l={no:n++,variants:[]};r.sides.push(l);for(const u of o.variants){const{parser:o,content:c}=u,d={parser:o,no:s++};l.variants.push(d);const f=a.Config.getTagsConfigForCardSet(t,n,s),h=e.bitContentProcessor(t,g.BitContentLevel.Card,f,c);e.DEBUG_CARD_TAGS&&e.debugPrint("card tags",h),h.cardBody=p.BitmarkPegParserValidator.checkCardBody(e,t,g.BitContentLevel.Card,h.cardBody,r.no,l.no,d.no),h.cardBodyStr=y(h.cardBody),d.data=h,h.internalComments&&i.internalComments.push(...h.internalComments)}s=0}n=0}return i}(e,t,r);switch(null===(m=a.Config.getBitConfig(t).cardSet)||void 0===m?void 0:m.configKey){case s.CardSetConfigKey._flashcards:T=function(e,t,r){const o=[];let a,s,u=n.Breakscape.EMPTY_STRING,c=[],p=0,g=0,y={};const f=t===l.BitType.flashcard1;for(const l of r.cards){u=n.Breakscape.EMPTY_STRING,a=void 0,c=[],g=0,y={};for(const e of l.sides)for(const t of e.variants){const e=t.data,{cardBodyStr:r}=e,o=i(e,["cardBodyStr"]);y=Object.assign(Object.assign({},y),o),0===g?(s=t,u=null!=r?r:n.Breakscape.EMPTY_STRING):1===g?a=null!=r?r:n.Breakscape.EMPTY_STRING:c.push(null!=r?r:n.Breakscape.EMPTY_STRING),g++}if(0!==p&&f){e.addWarning(`Bit '${t}' should only contain one card. Ignore subsequent card: '${u}'`,s);break}o.push(d.flashcard(Object.assign({question:u,answer:a,alternativeAnswers:c.length>0?c:void 0},y))),p++}return{flashcards:o.length>0?o:void 0}}(e,t,b);break;case s.CardSetConfigKey._elements:T=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.cardBodyStr)&&void 0!==i?i:n.Breakscape.EMPTY_STRING)}return{elements:o.length>0?o:void 0}}(0,0,b);break;case s.CardSetConfigKey._statements:T=function(e,t,r,o,n){const a=[];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=d.statement(Object.assign(Object.assign(Object.assign({},e),e.itemLead),o));a.push(t)}}o&&a.push(o);Array.isArray(n)&&n.length>0&&a.push(...n);return{statements:a.length>0?a:void 0}}(0,0,b,o,u);break;case s.CardSetConfigKey._quiz:T=function(e,t,r,o,s){const u=[],c=a.Config.isOfBitType(t,l.BitType.multipleChoice),p=a.Config.isOfBitType(t,l.BitType.multipleResponse);if(!c&&!p)return{};let g,y=!1;for(const e of r.cards){y=!1,g=n.Breakscape.EMPTY_STRING;for(const t of e.sides)for(const e of t.variants){const t=e.data,{isDefaultExample:r,example:o}=t,n=i(t,["isDefaultExample","example"]);if(y=!0===r||y,g=o||g,n.trueFalse&&n.trueFalse.length>0){const e=[],t=p?d.response:d.choice;for(const r of n.trueFalse){const{isDefaultExample:o,example:n}=r,a=i(r,["isDefaultExample","example"]),s=o||y,l=n||g,u=t(Object.assign(Object.assign({},a),{isDefaultExample:s,example:l}));e.push(u)}p?n.responses=e:n.choices=e}const a=d.quiz(Object.assign(Object.assign({},n),{isDefaultExample:y,example:g}));u.push(a)}}if(c&&Array.isArray(o)&&o.length>0){const e=d.quiz({choices:o});u.push(e)}if(p&&Array.isArray(s)&&s.length>0){const e=d.quiz({responses:s});u.push(e)}return{quizzes:u.length>0?u:void 0}}(0,t,b,f,h);break;case s.CardSetConfigKey._questions:T=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=d.question(Object.assign({question:null!==(i=t.cardBodyStr)&&void 0!==i?i:n.Breakscape.EMPTY_STRING},t));o.push(r)}return{questions:o.length>0?o:void 0}}(0,0,b);break;case s.CardSetConfigKey._matchPairs:T=function(e,t,r){let o,a=0;const s=[];let l;const u=[];let p,g,y,f,h,m=[],T={},b=!1,v=!1;for(const e of r.cards){l=void 0,p=void 0,m=[],g=void 0,y=void 0,a=0,T={},v=!1,h=n.Breakscape.EMPTY_STRING;for(const t of e.sides){for(const e of t.variants){const t=e.data,{cardBodyStr:r,title:o,resources:s,isDefaultExample:d,example:B}=t,C=i(t,["cardBodyStr","title","resources","isDefaultExample","example"]);v=!0===d||v,h=B||h;const k=o&&o[1];if(0===a)if(null!=k)l=k,b=!0===d||b,f=B||f;else if(Array.isArray(s)&&s.length>0){const e=s[0];e.type===c.ResourceTag.audio?g=e:e.type===c.ResourceTag.image&&(y=e)}else p=r;else if(null!=k)u.push(k),b=!0===d||b,f=B||f;else if(null==o){const e=null!=r?r:n.Breakscape.EMPTY_STRING;m.push(e),!b&&!v||h||(h=e)}T=Object.assign(Object.assign({},T),C)}a++}if(null!=l)o=d.heading({forKeys:l,forValues:u});else{v&&(f=void 0);const e=v||b,t=h||f,r=d.pair(Object.assign(Object.assign({key:null!=p?p:n.Breakscape.EMPTY_STRING,keyAudio:g,keyImage:y,values:m},T),{isDefaultExample:e,example:t}));s.push(r)}}return{heading:o,pairs:s.length>0?s:void 0}}(0,0,b);break;case s.CardSetConfigKey._matchMatrix:T=function(e,t,r){let o,a,s=0;const l=[];let u;const c=[];let p,g,y,f,h,m=[],T=[],b={},v=!1,B=!1,C=!1;for(const e of r.cards){a=void 0,u=void 0,m=[],T=[],s=0,B=!1,g=n.Breakscape.EMPTY_STRING,f=void 0;for(const t of e.sides){T=[],b={},C=!1,y=n.Breakscape.EMPTY_STRING,h=void 0;for(const e of t.variants){const t=e.data,{title:r,cardBodyStr:o,isDefaultExample:c,example:d,isCaseSensitive:m}=t,k=i(t,["title","cardBodyStr","isDefaultExample","example","isCaseSensitive"]);C=!0===c||C,y=d||y,Object.assign(b,k);const x=r&&r[1];if(0===s)null!=x?(a=x,v=!0===c||v,p=d||p):(u=o,B=!0===c||B,g=d||g,f=null!=m?m:f);else if(null!=x)l.push(x),v=!0===c||v,p=d||p;else if(null==t.title){const e=null!=o?o:n.Breakscape.EMPTY_STRING;T.push(e),!v&&!C||y||(y=e),h=null!=m?m:f}}if(s>0){C&&(g=p=void 0),B&&(p=void 0);const e=C||B||v,t=y||g||p,r=d.matrixCell(Object.assign(Object.assign({values:T},b),{isDefaultExample:e,example:t,isCaseSensitive:h}));m.push(r)}s++}if(null!=a)o=d.heading({forKeys:a,forValues:l});else{const e=d.matrix({key:null!=u?u:n.Breakscape.EMPTY_STRING,cells:m});c.push(e)}}return{heading:o,matrix:c.length>0?c:void 0}}(0,0,b);break;case s.CardSetConfigKey._botActionResponses:T=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:a,cardBodyStr:s}=t,l=i(t,["instruction","reaction","cardBodyStr"]),u=d.botResponse(Object.assign({response:null!=r?r:n.Breakscape.EMPTY_STRING,reaction:null!=a?a:n.Breakscape.EMPTY_STRING,feedback:null!=s?s:n.Breakscape.EMPTY_STRING},l));o.push(u)}return{botResponses:o.length>0?o:void 0}}(0,0,b);break;case s.CardSetConfigKey._clozeList:case s.CardSetConfigKey._exampleBitList:T=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,{cardBody:r}=t,n=i(t,["cardBody"]),a=d.cardBit(Object.assign({body:r},n));a&&o.push(a)}return{cardBits:o.length>0?o:void 0}}(0,0,b)}return T.internalComments=b.internalComments.length>0?b.internalComments:void 0,T}},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,n,a){const{value:s}=n,l=a.solutions;if(l&&i.StringUtils.isString(s)){const e=i.StringUtils.trimmedString(s);l.push(e)}}},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,n,a,s){const{type:l,value:u}=a,c=i.StringUtils.trimmedString(u);switch(l){case o.TypeKey.Instruction:s.instruction=c;break;case o.TypeKey.Hint:s.hint=c;break;case o.TypeKey.Anchor:s.anchor=c;break;case o.TypeKey.Reference:s.reference=c;break;case o.TypeKey.SampleSolution:s.sampleSolution=c,e.addWarning("[$...] tag is deprecated, use [@sampleSolution:...] instead",a)}}},4787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.exampleTagContentProcessor=void 0;const i=r(2606),o=r(208),n=r(672);function a(e,t,r,i,o){!0===i?(o.isDefaultExample=!0,o.example=void 0):o.example=i}t.exampleTagContentProcessor=function(e,t,r,s,l){const{value:u}=s,c=u;i.Config.isOfBitType(t,[o.BitType.cloze,o.BitType.clozeAndMultipleChoiceText,o.BitType.multipleChoiceText,o.BitType.highlightText,o.BitType.trueFalse,o.BitType.trueFalse1,o.BitType.multipleResponse,o.BitType.multipleResponse1,o.BitType.multipleChoice,o.BitType.multipleChoice1])?function(e,t,r,s,l){var u,c;let p;Array.isArray(l.trueFalse)&&l.trueFalse.length>0&&(p=null!==(u=l.trueFalse[l.trueFalse.length-1])&&void 0!==u?u:void 0);p?!0===s?(p.isDefaultExample=!0,p.example=void 0):n.BooleanUtils.isBooleanString(s)?p.example=s:(p.isDefaultExample=!0,p.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",r)):Array.isArray(l.solutions)&&l.solutions.length>0?l.example=!0===s?null!==(c=l.solutions[l.solutions.length-1])&&void 0!==c?c:void 0:s:(i.Config.isOfBitType(t,[o.BitType.multipleChoiceText,o.BitType.highlightText,o.BitType.trueFalse,o.BitType.trueFalse1,o.BitType.multipleResponse,o.BitType.multipleResponse1])&&function(e,t,r,i,o){!0===i?(o.isDefaultExample=!0,o.example=void 0):n.BooleanUtils.isBooleanString(i)?o.example=i:(o.isDefaultExample=!0,o.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",r))}(e,0,r,s,l),i.Config.isOfBitType(t,[o.BitType.clozeAndMultipleChoiceText,o.BitType.multipleChoice,o.BitType.multipleChoice1])?(l.isDefaultExample=!0,l.example=void 0,!0!==s&&e.addWarning("At this level, only default [@example] is allowed, using default",r)):a(e,t,r,s,l))}(e,t,s,c,l):i.Config.isOfBitType(t,o.BitType.mark)?function(e,t,r,i,o){o.isDefaultExample=!0,o.example=void 0,!0!==i&&e.addWarning("Only default [@example] is allowed, using default",r)}(e,0,s,c,l):a(e,t,s,c,l)}},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),n=r(2606),a=r(4471),s=r(6831),l=new o.Builder;t.gapChainContentProcessor=function(e,t,r,o,u,c,p){if(r===s.BitContentLevel.Chain)(0,a.clozeTagContentProcessor)(e,t,r,o,u,c);else{const r=function(e,t,r,o,a){var u;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("gap content",a);const c=n.Config.getTagConfigForTag(o,a.type),p=[a,...null!==(u=a.chain)&&void 0!==u?u:[]],g=e.bitContentProcessor(t,s.BitContentLevel.Chain,null==c?void 0:c.chain,p);e.DEBUG_CHAIN_TAGS&&e.debugPrint("gap TAGS",g);const{solutions:d}=g,y=i(g,["solutions"]),f=l.gap(Object.assign({solutions:null!=d?d:[]},y));return f}(e,t,0,o,u);r&&p.push(r)}}},8664: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.imageSourceChainContentProcessor=void 0;const o=r(9046),n=r(8159),a=r(2606),s=r(3633),l=r(6831),u=new o.Builder;t.imageSourceChainContentProcessor=function(e,t,r,o,c,p){r===l.BitContentLevel.Chain?function(e,t,r,i,o,n){const{value:a}=o,l=s.StringUtils.trimmedString(a);n.imageSourceUrl=l}(0,0,0,0,c,p):function(e,t,r,o,s,c){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("imageSource content",s);const{key:p}=s,g=a.Config.getTagConfigForTag(o,p),d=e.bitContentProcessor(t,l.BitContentLevel.Chain,o,[s]),y=e.bitContentProcessor(t,l.BitContentLevel.Chain,null==g?void 0:g.chain,s.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("imageSource TAGS",y);const{imageSourceUrl:f}=d,{mockupId:h}=y,m=i(y,["mockupId"]);f||e.addWarning("[@imageSource] is missing the image url",s);h||e.addWarning("[@mockupId:xxx] is missing from [@imageSource]",s);const T=u.imageSource(Object.assign({url:null!=f?f:n.Breakscape.EMPTY_STRING,mockupId:null!=h?h:n.Breakscape.EMPTY_STRING},m));c.imageSource=T}(e,t,0,o,c,p)}},5788:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.commentTagContentProcessor=void 0;const i=r(3633);t.commentTagContentProcessor=function(e,t,r,o,n){if(!n.internalComments)return;const{value:a}=o,s=i.StringUtils.isString(a)?i.StringUtils.trimmedString(a):void 0;s&&n.internalComments.push(s)}},2786:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.itemLeadTagContentProcessor=void 0;const i=r(3633);t.itemLeadTagContentProcessor=function(e,t,r,o,n,a,s){const{value:l}=n,u=i.StringUtils.trimmedString(l);s?a.lead=u:a.item=u}},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),n=r(8159),a=r(2606),s=r(7646),l=r(3298),u=r(6831),c=new o.Builder;t.markChainContentProcessor=function(e,t,r,o,p,g,d){if(r===u.BitContentLevel.Chain)(0,l.markTagContentProcessor)(e,u.BitContentLevel.Chain,t,p,g);else{const r=function(e,t,r,o,l){var p;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",l);const g=a.Config.getTagConfigForTag(o,l.type),d=e.bitContentProcessor(t,u.BitContentLevel.Chain,o,[l]),y=e.bitContentProcessor(t,u.BitContentLevel.Chain,null==g?void 0:g.chain,l.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",y);const{solution:f}=d,{mark:h}=y,m=i(y,["mark"]),T=c.mark(Object.assign({solution:null!=f?f:n.Breakscape.EMPTY_STRING,mark:null!==(p=s.ArrayUtils.asSingle(h))&&void 0!==p?p:n.Breakscape.EMPTY_STRING},m));return T}(e,t,0,o,p);r&&d.push(r)}}},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),n=r(2606),a=r(3633),s=r(6831),l=new o.Builder;t.markConfigChainContentProcessor=function(e,t,r,o,u,c){var p;const{key:g}=u;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",u);const d=c.markConfig;if(!d)return;const y=n.Config.getTagConfigForTag(o,g),f=e.bitContentProcessor(t,s.BitContentLevel.Chain,null==y?void 0:y.chain,u.chain),{mark:h}=f,m=i(f,["mark"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",m);const T=null!==(p=a.StringUtils.trimmedString(u.value))&&void 0!==p?p:"unknown",b=l.markConfig(Object.assign({mark:T,emphasis:"underline"},m));d.push(b)}},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,n){const{value:a}=o;i.StringUtils.isString(a)&&(n.solution=a)}},8326:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.partnerChainContentProcessor=void 0;const i=r(9046),o=r(9779),n=r(3633),a=r(6831),s=new i.Builder;t.partnerChainContentProcessor=function(e,t,r,i,l,u){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("partner content",l);const c=e.bitContentProcessor(t,a.BitContentLevel.Chain,i,l.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("partner TAGS",c);const{resources:p}=c,g=n.StringUtils.trimmedString(l.value),d=function(e,t){let r;const i=[];if(t)for(const e of t.reverse())r||o.ResourceTag.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,p),y=s.partner({name:g,avatarImage:d});u.partner=y}},3287:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propertyContentProcessor=void 0;const i=r(2606),o=r(3518),n=r(5486),a=r(7953),s=r(672),l=r(994),u=r(3633),c=r(4185),p=r(4787),g=r(8664),d=r(5788),y=r(2595),f=r(8326),h=r(6831);t.propertyContentProcessor=function(e,t,r,m,T,b){const{key:v,value:B}=T,C=r===h.BitContentLevel.Chain,k=i.Config.getTagConfigForTag(m,v),x=k?k.configKey:void 0;if(v===a.PropertyTag.internalComment)return void(0,d.commentTagContentProcessor)(e,t,r,T,b);if(k){if(x===o.PropertyConfigKey.example)return void(0,p.exampleTagContentProcessor)(e,t,r,T,b);if(x===o.PropertyConfigKey.partner)return void(0,f.partnerChainContentProcessor)(e,t,r,k.chain,T,b);if(x===o.PropertyConfigKey.imageSource)return void(0,g.imageSourceChainContentProcessor)(e,t,r,m,T,b);if(x===o.PropertyConfigKey.book)return void(0,c.bookChainContentProcessor)(e,t,r,k.chain,T,b);if(x===o.PropertyConfigKey.markConfig&&!C)return void(0,y.markConfigChainContentProcessor)(e,t,r,m,T,b)}const P=(e,t,r,i)=>{if(r=(e=>{if(null!=e){if(i)switch(i.format){case n.PropertyFormat.string:return u.StringUtils.isString(e)?u.StringUtils.string(e):void 0;case n.PropertyFormat.trimmedString:return u.StringUtils.isString(e)?u.StringUtils.trimmedString(e):void 0;case n.PropertyFormat.number:return l.NumberUtils.asNumber(e);case n.PropertyFormat.boolean:return s.BooleanUtils.toBoolean(e,!0);case n.PropertyFormat.invertedBoolean:return!s.BooleanUtils.toBoolean(e,!0)}return e}})(r),(null==i?void 0:i.astKey)&&(t=i.astKey),null==i?void 0:i.single)e[t]=r;else if(Object.prototype.hasOwnProperty.call(e,t)){const i=e[t];e[t]=[...i,r]}else e[t]=[r]};P(k?b:b.extraProperties,v,B,k)}},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,n,a,s){const{value:l}=n,u=i.StringUtils.trimmedString(l);s?a.referenceEnd=u:a.reference=u}},5516:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resourceContentProcessor=t.buildResources=void 0;const i=r(8703),o=r(2606),n=r(1035),a=r(9779),s=r(6831),l=new i.ResourceBuilder;t.buildResources=function(e,t,r,i){var s,l;const u=[],c=[],p=a.ResourceTag.fromValue(r),g=o.Config.getBitResourcesConfig(t,p),d=g.resourceAttachmentAllowed,y=g.getCountsMin(),f=g.getCountsMax();if(i)for(const e of i.reverse()){let t=null!==(s=y.get(e.typeAlias))&&void 0!==s?s:0,r=null!==(l=f.get(e.typeAlias))&&void 0!==l?l:0;t=Math.max(0,t-1),r===n.Count.infinity?u.unshift(e):r>0?(u.unshift(e),r--):c.unshift(e),y.set(e.typeAlias,t),f.set(e.typeAlias,r)}if(!d&&r){const t=`Resource type [&${r}] is specified in the bit header, but no extra resource is allowed for this bit.`;e.addWarning(t)}else 0===u.length&&r&&e.addWarning(`Resource type [&${r}] is specified in the bit header, but no such a resource is present`);return c.length>0&&(e.parser.excessResources=c),u},t.resourceContentProcessor=function(e,t,r,i,n,u){const{type:c,key:p,value:g,chain:d}=n,y=u.resources;if(!y)return;const f=a.ResourceTag.fromValue(p);if(f){const r=o.Config.getTagConfigForTag(i,p),n=e.bitContentProcessor(t,s.BitContentLevel.Chain,null==r?void 0:r.chain,d),a=l.resource(Object.assign({type:f,value:g},n));a&&y.push(a)}}},1838:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildTitles=t.titleTagContentProcessor=void 0;const i=r(2606),o=r(208),n=r(3633);t.titleTagContentProcessor=function(e,t,r,i,o,a){const{value:s}=o,l=a.title;if(!l)return;const u=s,c=n.StringUtils.trimmedString(u.title);l[u.level.length]=c},t.buildTitles=function(e,t,r){var n,a;if(r=null!=r?r:[],i.Config.isOfBitType(t,o.BitType.chapter)){let e;return r.length>0&&(e=r[r.length-1]),{title:e,level:r.length>0?r.length-1:void 0}}return{title:null!==(n=r[1])&&void 0!==n?n:void 0,subtitle:null!==(a=r[2])&&void 0!==a?a: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),n=r(2606),a=r(208),s=r(8660),l=r(6831),u=new o.Builder;t.trueFalseChainContentProcessor=function(e,t,r,o,c,p,g){r===l.BitContentLevel.Chain?(0,s.trueFalseTagContentProcessor)(e,l.BitContentLevel.Chain,t,c,p):function(e,t,r,o,s,c,p){var g;const d=[s,...null!==(g=s.chain)&&void 0!==g?g:[]],y=c.statements,f=c.choices,h=c.responses;if(!(y&&f&&h&&p))return;if(n.Config.isOfBitType(t,a.BitType.trueFalse1))c.statement=function(e,t,r,o){if(!n.Config.isOfBitType(t,a.BitType.trueFalse1))return;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (statement)",o);const s=e.bitContentProcessor(t,l.BitContentLevel.Chain,r,o),{trueFalse:c}=s,p=i(s,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (statement)",p);let g;c&&c.length>0&&(g=u.statement(Object.assign(Object.assign({},c[0]),p)));return g}(e,t,o,d);else if(n.Config.isOfBitType(t,[a.BitType.trueFalse,a.BitType.multipleChoice,a.BitType.multipleChoice1,a.BitType.multipleResponse,a.BitType.multipleResponse1])){const r=function(e,t,r,o){const s=n.Config.isOfBitType(t,a.BitType.trueFalse),c=n.Config.isOfBitType(t,[a.BitType.multipleChoice,a.BitType.multipleChoice1]),p=n.Config.isOfBitType(t,[a.BitType.multipleResponse,a.BitType.multipleResponse1]);if(!s&&!c&&!p)return{};const g=[],d=[],y=[],f=e.splitBitContent(o,[l.TypeKey.True,l.TypeKey.False]);e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (choices/responses)",f);for(const o of f){const n=e.bitContentProcessor(t,l.BitContentLevel.Chain,r,o),{trueFalse:a}=n,f=i(n,["trueFalse"]);if(e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (choices/responses)",f),s){if(a&&a.length>0){const e=u.statement(Object.assign(Object.assign({},a[0]),f));g.push(e)}}else if(c){if(a&&a.length>0){const e=u.choice(Object.assign(Object.assign({},a[0]),f));d.push(e)}}else if(p&&a&&a.length>0){const e=u.response(Object.assign(Object.assign({},a[0]),f));y.push(e)}}const h={};s?h.statements=g:c?h.choices=d:p&&(h.responses=y);return h}(e,t,o,d);r.statements&&y.push(...r.statements),r.choices&&f.push(...r.choices),r.responses&&h.push(...r.responses)}else if(n.Config.isOfBitType(t,a.BitType.highlightText)){const r=function(e,t,r,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("highlight content",o);const n=e.bitContentProcessor(t,l.BitContentLevel.Chain,r,o),{trueFalse:a}=n,s=i(n,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("highlight TAGS",Object.assign({trueFalse:a},s));const c=[];if(a)for(const e of a)c.push(u.highlightText(Object.assign(Object.assign({},e),{isHighlighted:!1})));const p=u.highlight(Object.assign({texts:c},s));return p}(e,t,o,d);r&&p.push(r)}else{const r=function(e,t,r,o){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("select content",o);const n=e.bitContentProcessor(t,l.BitContentLevel.Chain,r,o),{trueFalse:a}=n,s=i(n,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("select TAGS",Object.assign({trueFalse:a},s));const c=[];if(a)for(const e of a)c.push(u.selectOption(e));const p=u.select(Object.assign({options:c},s));return p}(e,t,o,d);r&&p.push(r)}}(e,t,0,o,c,p,g)}},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,n,a){const{type:s,value:l}=n,u=a.trueFalse;if(!u)return;const c=i.StringUtils.trimmedString(l);u.push({text:c,isCorrect:s===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),n=r(8159),a=r(2606),s=r(6300),l=r(208),u=r(1060),c=r(9779),p=r(1353),g=r(3633),d=r(406),y=new i.Builder,f=new o.ResourceBuilder;t.JsonParser=class{constructor(){this.textGenerator=new s.TextGenerator,this.textParser=new d.TextParser}toAst(e){const t=this.preprocessJson(e),r=[];for(const e of t){const{bit:t,parser:i}=e,o=this.bitToAst(t,null==i?void 0:i.internalComments);o&&r.push(o)}const i=r.length>0?{bits:r}:{};return y.bitmark(i)}preprocessJson(e){const t=[];if(g.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 a.Config.getBitType(t.type)!==l.BitType._error}return!1}bitToBitWrapper(e){return{bit:e}}bitToAst(e,t){var r;const{type:i,format:o,id:n,externalId:s,spaceId:l,padletId:u,jupyterId:c,jupyterExecutionCount:g,AIGenerated:d,releaseVersion:f,ageRange:h,lang:m,language:T,computerLanguage:b,target:v,tag:B,icon:C,iconTag:k,colorTag:x,flashcardSet:P,subtype:w,bookAlias:S,coverImage:A,publisher:K,publications:_,author:I,date:O,location:R,theme:E,kind:L,action:j,thumbImage:V,focusX:F,focusY:G,pointerLeft:N,pointerTop:D,duration:M,deeplink:U,externalLink:$,externalLinkText:J,videoCallLink:z,bot:q,list:H,textReference:W,isTracked:Y,isInfoOnly:X,labelTrue:Z,labelFalse:Q,content2Buy:ee,quotedPerson:te,reasonableNumOfChars:re,resolved:ie,resolvedDate:oe,resolvedBy:ne,maxCreatedBits:ae,product:se,productVideo:le,productFolder:ue,book:ce,title:pe,subtitle:ge,level:de,toc:ye,progress:fe,anchor:he,reference:me,referenceEnd:Te,item:be,lead:ve,hint:Be,instruction:Ce,example:ke,imageSource:xe,partner:Pe,marks:we,resource:Se,body:Ae,sampleSolution:Ke,elements:_e,statement:Ie,isCorrect:Oe,cards:Re,statements:Ee,responses:Le,quizzes:je,heading:Ve,pairs:Fe,matrix:Ge,choices:Ne,questions:De,listItems:Me,sections:Ue,footer:$e,placeholders:Je}=e,ze=a.Config.getBitType(i),qe=a.Config.getBitConfig(ze),He=null!==(r=p.TextFormat.fromValue(o))&&void 0!==r?r:qe.textFormatDefault,We=this.getResourceType(Se),Ye=this.resourceBitToAst(Se),Xe=this.bodyToAst(Ae,He,Je),Ze=this.imageSourceBitToAst(xe),Qe=this.partnerBitToAst(Pe),et=this.markConfigBitToAst(we),tt=this.flashcardBitsToAst(Re),rt=this.statementBitsToAst(Ie,Oe,Ee,ke),it=this.responseBitsToAst(ze,Le),ot=this.quizBitsToAst(ze,je),nt=this.headingBitToAst(Ve),at=this.pairBitsToAst(Fe),st=this.matrixBitsToAst(Ge),lt=this.choiceBitsToAst(Ne),ut=this.questionBitsToAst(De),ct=this.botResponseBitsToAst(ze,Le),pt=this.listItemsToAst(null!=Me?Me:Ue,He,Je),gt=this.footerToAst($e,He),{reference:dt,referenceProperty:yt}=this.referenceToAst(me);return y.bit(Object.assign(Object.assign(Object.assign({bitType:ze,textFormat:o,resourceType:We,id:this.convertStringToBreakscapedString(n),internalComment:this.convertStringToBreakscapedString(t),externalId:this.convertStringToBreakscapedString(s),spaceId:this.convertStringToBreakscapedString(l),padletId:this.convertStringToBreakscapedString(u),jupyterId:this.convertStringToBreakscapedString(c),jupyterExecutionCount:g,aiGenerated:d,releaseVersion:this.convertStringToBreakscapedString(f),ageRange:h,lang:this.convertStringToBreakscapedString(m),language:this.convertStringToBreakscapedString(T),computerLanguage:this.convertStringToBreakscapedString(b),target:this.convertStringToBreakscapedString(v),tag:this.convertStringToBreakscapedString(B),icon:this.convertStringToBreakscapedString(C),iconTag:this.convertStringToBreakscapedString(k),colorTag:this.convertStringToBreakscapedString(x),flashcardSet:this.convertStringToBreakscapedString(P),subtype:this.convertStringToBreakscapedString(w),bookAlias:this.convertStringToBreakscapedString(S),coverImage:this.convertStringToBreakscapedString(A),publisher:this.convertStringToBreakscapedString(K),publications:this.convertStringToBreakscapedString(_),author:this.convertStringToBreakscapedString(I),date:this.convertStringToBreakscapedString(O),location:this.convertStringToBreakscapedString(R),theme:this.convertStringToBreakscapedString(E),kind:this.convertStringToBreakscapedString(L),action:this.convertStringToBreakscapedString(j),duration:this.convertStringToBreakscapedString(M),referenceProperty:this.convertStringToBreakscapedString(yt),thumbImage:this.convertStringToBreakscapedString(V),focusX:F,focusY:G,pointerLeft:this.convertStringToBreakscapedString(N),pointerTop:this.convertStringToBreakscapedString(D),deeplink:this.convertStringToBreakscapedString(U),externalLink:this.convertStringToBreakscapedString($),externalLinkText:this.convertStringToBreakscapedString(J),videoCallLink:this.convertStringToBreakscapedString(z),bot:this.convertStringToBreakscapedString(q),list:this.convertStringToBreakscapedString(H),textReference:this.convertStringToBreakscapedString(W),isTracked:Y,isInfoOnly:X,labelTrue:this.convertStringToBreakscapedString(Z),labelFalse:this.convertStringToBreakscapedString(Q),content2Buy:this.convertStringToBreakscapedString(ee),quotedPerson:this.convertStringToBreakscapedString(te),reasonableNumOfChars:re,resolved:ie,resolvedDate:this.convertStringToBreakscapedString(oe),resolvedBy:this.convertStringToBreakscapedString(ne),maxCreatedBits:ae,productList:this.convertStringToBreakscapedString(se),productVideoList:this.convertStringToBreakscapedString(le),productFolder:this.convertStringToBreakscapedString(ue),book:this.convertStringToBreakscapedString(ce),title:this.convertJsonTextToBreakscapedString(pe),subtitle:this.convertJsonTextToBreakscapedString(ge),level:de,toc:ye,progress:fe,anchor:this.convertStringToBreakscapedString(he),reference:this.convertStringToBreakscapedString(dt),referenceEnd:this.convertStringToBreakscapedString(Te)},this.parseItemLeadHintInstruction(be,ve,Be,Ce)),this.parseExample(ke)),{imageSource:Ze,partner:Qe,markConfig:et,resources:Ye,body:Xe,sampleSolution:this.convertStringToBreakscapedString(Ke),elements:this.convertStringToBreakscapedString(_e),flashcards:tt,statements:rt,responses:it,quizzes:ot,heading:nt,pairs:at,matrix:st,choices:lt,questions:ut,botResponses:ct,cardBits:pt,footer:gt}))}imageSourceBitToAst(e){var t,r;let i;if(e){const{url:o,mockupId:a,format:s,size:l,trim:u}=e;i=y.imageSource({url:null!==(t=this.convertStringToBreakscapedString(o))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,mockupId:null!==(r=this.convertStringToBreakscapedString(a))&&void 0!==r?r:n.Breakscape.EMPTY_STRING,format:this.convertStringToBreakscapedString(s),size:l,trim:u})}return i}partnerBitToAst(e){var t;let r;if(e){const i=this.resourceDataToAst(c.ResourceTag.image,e.avatarImage);r=y.partner({name:null!==(t=this.convertStringToBreakscapedString(e.name))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,avatarImage:i})}return r}markConfigBitToAst(e){var t;const r=[];if(Array.isArray(e))for(const i of e){const{mark:e,color:o,emphasis:a}=i,s=y.markConfig({mark:null!==(t=this.convertStringToBreakscapedString(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,color:this.convertStringToBreakscapedString(o),emphasis:this.convertStringToBreakscapedString(a)});r.push(s)}if(0!==r.length)return r}flashcardBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const i of e){const{question:e,answer:o,alternativeAnswers:a,item:s,lead:l,hint:u,instruction:c,example:p}=i,g=y.flashcard(Object.assign(Object.assign({question:null!==(t=this.convertStringToBreakscapedString(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,answer:this.convertStringToBreakscapedString(o),alternativeAnswers:this.convertStringToBreakscapedString(a)},this.parseItemLeadHintInstruction(s,l,u,c)),this.parseExample(p)));r.push(g)}if(0!==r.length)return r}statementBitsToAst(e,t,r,i){var o,a;const s=[];if(e){const r=y.statement(Object.assign({text:null!==(o=this.convertStringToBreakscapedString(e))&&void 0!==o?o:n.Breakscape.EMPTY_STRING,isCorrect:null!=t&&t},this.parseExample(i)));s.push(r)}if(Array.isArray(r))for(const e of r){const{statement:t,isCorrect:r,item:i,lead:o,hint:l,instruction:u,example:c}=e,p=y.statement(Object.assign(Object.assign({text:null!==(a=this.convertStringToBreakscapedString(t))&&void 0!==a?a:n.Breakscape.EMPTY_STRING,isCorrect:r},this.parseItemLeadHintInstruction(i,o,l,u)),this.parseExample(c)));s.push(p)}if(0!==s.length)return s}choiceBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const i of e){const{choice:e,isCorrect:o,item:a,lead:s,hint:l,instruction:u,example:c}=i,p=y.choice(Object.assign(Object.assign({text:null!==(t=this.convertStringToBreakscapedString(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,isCorrect:o},this.parseItemLeadHintInstruction(a,s,l,u)),this.parseExample(c)));r.push(p)}if(0!==r.length)return r}responseBitsToAst(e,t){var r;const i=[];if(!a.Config.isOfBitType(e,l.BitType.botActionResponse)){if(Array.isArray(t))for(const e of t){const{response:t,isCorrect:o,item:a,lead:s,hint:l,instruction:u,example:c}=e,p=y.response(Object.assign(Object.assign({text:null!==(r=this.convertStringToBreakscapedString(t))&&void 0!==r?r:n.Breakscape.EMPTY_STRING,isCorrect:o},this.parseItemLeadHintInstruction(a,s,l,u)),this.parseExample(c)));i.push(p)}if(0!==i.length)return i}}selectOptionBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const i of e){const{text:e,isCorrect:o,item:a,lead:s,hint:l,instruction:u,example:c}=i,p=y.selectOption(Object.assign(Object.assign({text:null!==(t=this.convertStringToBreakscapedString(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,isCorrect:o},this.parseItemLeadHintInstruction(a,s,l,u)),this.parseExample(c)));r.push(p)}return r}highlightTextBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const i of e){const{text:e,isCorrect:o,isHighlighted:a,item:s,lead:l,hint:u,instruction:c,example:p}=i,g=y.highlightText(Object.assign(Object.assign({text:null!==(t=this.convertStringToBreakscapedString(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,isCorrect:o,isHighlighted:a},this.parseItemLeadHintInstruction(s,l,u,c)),this.parseExample(p)));r.push(g)}return r}quizBitsToAst(e,t){const r=[];if(Array.isArray(t))for(const i of t){const{item:t,lead:o,hint:n,instruction:a,choices:s,responses:l}=i,u=this.choiceBitsToAst(s),c=this.responseBitsToAst(e,l),p=y.quiz(Object.assign(Object.assign({},this.parseItemLeadHintInstruction(t,o,n,a)),{choices:u,responses:c}));r.push(p)}if(0!==r.length)return r}headingBitToAst(e){var t,r;let i;return e&&(i=y.heading({forKeys:null!==(t=this.convertStringToBreakscapedString(e.forKeys))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,forValues:null!==(r=this.convertStringToBreakscapedString(e.forValues))&&void 0!==r?r:[]})),i}pairBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const i of e){const{key:e,keyAudio:o,keyImage:n,values:a,item:s,lead:l,hint:u,instruction:p,example:g,isCaseSensitive:d}=i,f=this.resourceDataToAst(c.ResourceTag.audio,o),h=this.resourceDataToAst(c.ResourceTag.image,n),m=y.pair(Object.assign(Object.assign(Object.assign({key:this.convertStringToBreakscapedString(e),keyAudio:f,keyImage:h,values:null!==(t=this.convertStringToBreakscapedString(a))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(s,l,u,p)),this.parseExample(g)),{isCaseSensitive:d}));r.push(m)}if(0!==r.length)return r}matrixBitsToAst(e){var t,r;const i=[];if(Array.isArray(e))for(const o of e){const{key:e,cells:a,item:s,lead:l,hint:u,instruction:c,example:p}=o,g=y.matrix(Object.assign(Object.assign({key:null!==(t=this.convertStringToBreakscapedString(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,cells:null!==(r=this.matrixCellsToAst(a))&&void 0!==r?r:[]},this.parseItemLeadHintInstruction(s,l,u,c)),this.parseExample(p)));i.push(g)}if(0!==i.length)return i}matrixCellsToAst(e){var t;const r=[];if(Array.isArray(e))for(const i of e){const{values:e,item:o,lead:n,hint:a,instruction:s,isCaseSensitive:l,example:u}=i,c=y.matrixCell(Object.assign(Object.assign(Object.assign({values:null!==(t=this.convertStringToBreakscapedString(e))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(o,n,a,s)),{isCaseSensitive:l}),this.parseExample(u)));r.push(c)}if(0!==r.length)return r}questionBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const i of e){const{question:e,partialAnswer:o,sampleSolution:a,item:s,lead:l,hint:u,instruction:c,example:p,reasonableNumOfChars:g}=i,d=y.question(Object.assign(Object.assign(Object.assign({question:null!==(t=this.convertStringToBreakscapedString(e))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,partialAnswer:this.convertStringToBreakscapedString(o),sampleSolution:this.convertStringToBreakscapedString(a)},this.parseItemLeadHintInstruction(s,l,u,c)),this.parseExample(p)),{reasonableNumOfChars:g}));r.push(d)}if(0!==r.length)return r}botResponseBitsToAst(e,t){var r,i,o;const s=[];if(a.Config.isOfBitType(e,l.BitType.botActionResponse)){if(Array.isArray(t))for(const e of t){const{response:t,reaction:a,feedback:l,item:u,lead:c,hint:p}=e,g=y.botResponse({response:null!==(r=this.convertStringToBreakscapedString(t))&&void 0!==r?r:n.Breakscape.EMPTY_STRING,reaction:null!==(i=this.convertStringToBreakscapedString(a))&&void 0!==i?i:n.Breakscape.EMPTY_STRING,feedback:null!==(o=this.convertStringToBreakscapedString(l))&&void 0!==o?o:n.Breakscape.EMPTY_STRING,item:this.convertJsonTextToBreakscapedString(u),lead:this.convertJsonTextToBreakscapedString(c),hint:this.convertJsonTextToBreakscapedString(p)});s.push(g)}if(0!==s.length)return s}}listItemsToAst(e,t,r){const i=[];if(Array.isArray(e))for(const o of e){const{item:e,lead:n,hint:a,instruction:s,body:l}=o,u=y.cardBit({item:this.convertJsonTextToBreakscapedString(e),lead:this.convertJsonTextToBreakscapedString(n),hint:this.convertJsonTextToBreakscapedString(a),instruction:this.convertJsonTextToBreakscapedString(s),body:this.bodyToAst(l,t,r)});u&&i.push(u)}if(0!==i.length)return i}getResourceType(e){if(e){return c.ResourceTag.fromValue(e.type)}}resourceBitToAst(e){var t;const r=[];if(e){const i=null!==(t=c.ResourceTag.keyFromValue(e.type))&&void 0!==t?t:c.ResourceTag.unknown;let o;if(e.type===c.ResourceTag.imageResponsive){const t=e,i=this.resourceDataToAst(c.ResourceTag.imagePortrait,t.imagePortrait),o=this.resourceDataToAst(c.ResourceTag.imageLandscape,t.imageLandscape);i&&r.push(i),o&&r.push(o)}else if(e.type===c.ResourceTag.stillImageFilm){const t=e,i=this.resourceDataToAst(c.ResourceTag.image,t.image),o=this.resourceDataToAst(c.ResourceTag.audio,t.audio);i&&r.push(i),o&&r.push(o)}else{if(o=e[i],!o)return;const t=this.resourceDataToAst(e.type,o);t&&r.push(t)}}return r}resourceDataToAst(e,t){var r,i;let o;if(t){if(!t)return;const n=g.StringUtils.isString(t)?t:void 0,a=t.url||t.src||t.href||t.app||t.body||n,s=this.resourceDataToAst(c.ResourceTag.image,t.posterImage),l=t.thumbnails?t.thumbnails.map((e=>this.resourceDataToAst(c.ResourceTag.image,e))):void 0;o=f.resource({type:e,value:this.convertStringToBreakscapedString(a),format:this.convertStringToBreakscapedString(t.format),src1x:this.convertStringToBreakscapedString(t.src1x),src2x:this.convertStringToBreakscapedString(t.src2x),src3x:this.convertStringToBreakscapedString(t.src3x),src4x:this.convertStringToBreakscapedString(t.src4x),caption:this.convertJsonTextToBreakscapedString(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:this.convertStringToBreakscapedString(t.alt),zoomDisabled:t.zoomDisabled,duration:t.duration,mute:t.mute,autoplay:t.autoplay,allowSubtitles:t.allowSubtitles,showSubtitles:t.showSubtitles,posterImage:s,thumbnails:l,siteName:this.convertStringToBreakscapedString(t.siteName),license:this.convertStringToBreakscapedString(t.license),copyright:this.convertStringToBreakscapedString(t.copyright),showInIndex:t.showInIndex})}return o}bodyToAst(e,t,r){let i,o;const n={};if(Array.isArray(e)?(o=this.convertJsonTextToBreakscapedString(e,t),r=this.textGenerator.getPlaceholders()):o=e,r)for(const[e,t]of Object.entries(r)){const r=this.bodyBitToAst(t);n[e]=r}if(o){const e=[],t=g.StringUtils.splitPlaceholders(o,Object.keys(n));for(let r=0,i=t.length;r<i;r++){const i=t[r];if(n[i])e.push(n[i]);else{const t=this.bodyTextToAst(i);e.push(t)}}i=y.body({bodyParts:e})}return i}bodyTextToAst(e){return y.bodyText({text:null!=e?e:n.Breakscape.EMPTY_STRING})}bodyBitToAst(e){switch(e.type){case u.BodyBitType.gap:return this.gapBitToAst(e);case u.BodyBitType.mark:return this.markBitToAst(e);case u.BodyBitType.select:return this.selectBitToAst(e);case u.BodyBitType.highlight:return this.highlightBitToAst(e)}return this.bodyTextToAst(n.Breakscape.EMPTY_STRING)}footerToAst(e,t){const r=this.convertJsonTextToBreakscapedString(e,t);if(r)return y.footerText({text:r})}referenceToAst(e){return Array.isArray(e)&&e.length>0?{reference:void 0,referenceProperty:e}:{reference:e,referenceProperty:void 0}}gapBitToAst(e){var t;const{item:r,lead:i,hint:o,instruction:n,example:a,isCaseSensitive:s,solutions:l}=e;return y.gap(Object.assign(Object.assign(Object.assign({solutions:null!==(t=this.convertStringToBreakscapedString(l))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(r,i,o,n)),this.parseExample(a)),{isCaseSensitive:s}))}markBitToAst(e){var t;const{solution:r,mark:i,item:o,lead:a,hint:s,instruction:l,example:u}=e;return y.mark(Object.assign(Object.assign({solution:null!==(t=this.convertStringToBreakscapedString(r))&&void 0!==t?t:n.Breakscape.EMPTY_STRING,mark:this.convertStringToBreakscapedString(i)},this.parseItemLeadHintInstruction(o,a,s,l)),this.parseExample(u)))}selectBitToAst(e){const{options:t,prefix:r,postfix:i,item:o,lead:n,hint:a,instruction:s,example:l}=e,u=this.selectOptionBitsToAst(t);return y.select(Object.assign(Object.assign({options:u,prefix:this.convertStringToBreakscapedString(r),postfix:this.convertStringToBreakscapedString(i)},this.parseItemLeadHintInstruction(o,n,a,s)),this.parseExample(l)))}highlightBitToAst(e){const{texts:t,prefix:r,postfix:i,item:o,lead:n,hint:a,instruction:s,example:l}=e,u=this.highlightTextBitsToAst(t);return y.highlight(Object.assign(Object.assign({texts:u,prefix:this.convertStringToBreakscapedString(r),postfix:this.convertStringToBreakscapedString(i)},this.parseItemLeadHintInstruction(o,n,a,s)),this.parseExample(l)))}parseItemLeadHintInstruction(e,t,r,i){return{item:this.convertJsonTextToBreakscapedString(e),lead:this.convertJsonTextToBreakscapedString(t),hint:this.convertJsonTextToBreakscapedString(r),instruction:this.convertJsonTextToBreakscapedString(i)}}parseExample(e){if(null==e)return;const t=this.convertJsonTextToBreakscapedString(e);return t?{example:t}:{example:!!e}}convertJsonTextToBreakscapedString(e,t){if(t=null!=t?t:p.TextFormat.bitmarkMinusMinus,null!=e){if(this.textParser.isAst(e)){return this.textGenerator.generateSync(e,t)}if(Array.isArray(e)){const r=[];for(let i=0,o=e.length;i<o;i++){const o=e[i];if(this.textParser.isAst(o)){const e=this.textGenerator.generateSync(o,t);r[i]=e}else r[i]=o}return r}return e}}convertStringToBreakscapedString(e){if(null!=e){if(Array.isArray(e)){const t=[];for(let r=0,i=e.length;r<i;r++){const i=e[r];t[r]=n.Breakscape.breakscape(i)}return t}return n.Breakscape.breakscape(e)}}}},406:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextParser=void 0;const i=r(1353),o=r(3633),n=r(8436);t.TextParser=class{preprocessAst(e){if(o.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){if(Array.isArray(e)){if(0===e.length)return!0;if(Object.prototype.hasOwnProperty.call(e[0],"type"))return!0}return!1}toAst(e,t){var r;if(Array.isArray(e))return e;const o=null!==(r=e)&&void 0!==r?r:"";if(!o)return[];const a=Object.assign({},t);a.textFormat||(a.textFormat=i.TextFormat.bitmarkMinusMinus);const s=a.textFormat===i.TextFormat.bitmarkPlusPlus?"bitmarkPlusPlus":"bitmarkMinusMinus";return(0,n.parse)(o,{startRule:s})}}},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(672);const o=new class{fillStringExample(e,t,r,i){if(e){Array.isArray(e)||(e=[e]);for(const o of e)if(!o.isExample&&(t?(o.isDefaultExample=!0,o.isExample=!0):(o.isDefaultExample=!1,o.example=r),i))break}}fillBooleanExample(e,t,r,o){if(e){Array.isArray(e)||(e=[e]);for(const n of e)if(!n.isExample&&(!o||n.isCorrect)&&(t?(n.isDefaultExample=!0,n.isExample=!0):(n.isDefaultExample=!1,n.example=i.BooleanUtils.toBoolean(r)),o))break}}};t.BitUtils=o},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},3589:function(e,t,r){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUtils=void 0;const o=i(r(2093));const n=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}deepMerge(...e){return function e(...t){function r(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function i(t,i){for(const[n,a]of Object.entries(i)){const i=r(a);void 0!==t[n]&&r(t[n])===i&&["array","object"].includes(i)?t[n]=e(t[n],a):t[n]=(0,o.default)(a)}}let n=(0,o.default)(t.shift());for(const e of t){const t=r(e);r(n)===t?"array"===t?n=[...n,...(0,o.default)(e)]:"object"===t?i(n,e):n=e:n=(0,o.default)(e)}return n}(...e)}};t.ObjectUtils=n},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}string(e){return e?`${e}`:""}trimmedString(e){return this.string(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 n=e[i],a=i===o-1;r.push(n),a||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 n,a=0;for(;a<o;){let i;const o=a+t,s=e.indexOf("\n",a);if(s>-1&&s>a&&s<o){i=s-a,n=e.substr(a,i),a=a+i+1,r.push(n);continue}const l=e.lastIndexOf(" ",o);let u=0;l>-1&&l!=a-1?(i=l-a,i>0&&(u=a+i+1)):(i=t,u=a+t),n=e.substr(a,i),a=u,r.push(n.trim())}return a<i&&(n=e.substr(a),r.push(n)),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),n=r(306),a=r(9870);const s=new class{constructor(){Object.defineProperty(this,"userAgentInfo",{value:(0,a.parseUserAgent)(),enumerable:!1}),this.bootTimestamp=Date.now(),this.app="",this.appVersion=n.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):n.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(""):n.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 n.EMPTY_VERSION;e.startsWith("v")&&(e=e.substring(1));const t=e.split(".",1e3);let r="",i="",o="",a="";for(let e=0,n=t.length;e<n;e++){const n=t[e];0===e?r=n:1===e?i=n:2===e?a=n:3===e&&(o=n)}return{full:e,major:r,minor:i,patch:a,build:o}}};t.env=s;const l=s.init.bind(s);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 n=!1;for(let e=0;e<=9;e++)if(o.startsWith(`${e}`)){n=!0;break}n?r.versions[i]=o.replace("_","."):r.keys.add(o),i=o}return r}(window.navigator.userAgent),r=t.keys.has("firefox"),n=t.keys.has("chrome"),a=t.keys.has("chromium"),s=t.keys.has("safari"),l=n,u=r,c=t.keys.has("macintosh");return s&&!n&&!a?(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}},8797:(e,t,r)=>{const{VOID:i,PRIMITIVE:o,ARRAY:n,OBJECT:a,DATE:s,REGEXP:l,MAP:u,SET:c,ERROR:p,BIGINT:g}=r(7775),d="object"==typeof self?self:globalThis;t.deserialize=e=>((e,t)=>{const r=(t,r)=>(e.set(r,t),t),y=f=>{if(e.has(f))return e.get(f);const[h,m]=t[f];switch(h){case o:case i:return r(m,f);case n:{const e=r([],f);for(const t of m)e.push(y(t));return e}case a:{const e=r({},f);for(const[t,r]of m)e[y(t)]=y(r);return e}case s:return r(new Date(m),f);case l:{const{source:e,flags:t}=m;return r(new RegExp(e,t),f)}case u:{const e=r(new Map,f);for(const[t,r]of m)e.set(y(t),y(r));return e}case c:{const e=r(new Set,f);for(const t of m)e.add(y(t));return e}case p:{const{name:e,message:t}=m;return r(new d[e](t),f)}case g:return r(BigInt(m),f);case"BigInt":return r(Object(BigInt(m)),f)}return r(new d[h](m),f)};return y})(new Map,e)(0)},2093:(e,t,r)=>{const{deserialize:i}=r(8797),{serialize:o}=r(3687);Object.defineProperty(t,"__esModule",{value:!0}).default="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?i(o(e,t)):structuredClone(e):(e,t)=>i(o(e,t)),t.deserialize=i,t.serialize=o},3687:(e,t,r)=>{const{VOID:i,PRIMITIVE:o,ARRAY:n,OBJECT:a,DATE:s,REGEXP:l,MAP:u,SET:c,ERROR:p,BIGINT:g}=r(7775),d="",{toString:y}={},{keys:f}=Object,h=e=>{const t=typeof e;if("object"!==t||!e)return[o,t];const r=y.call(e).slice(8,-1);switch(r){case"Array":return[n,d];case"Object":return[a,d];case"Date":return[s,d];case"RegExp":return[l,d];case"Map":return[u,d];case"Set":return[c,d]}return r.includes("Array")?[n,r]:r.includes("Error")?[p,r]:[a,r]},m=([e,t])=>e===o&&("function"===t||"symbol"===t);t.serialize=(e,{json:t,lossy:r}={})=>{const p=[];return((e,t,r,p)=>{const d=(e,t)=>{const i=p.push(e)-1;return r.set(t,i),i},y=p=>{if(r.has(p))return r.get(p);let[T,b]=h(p);switch(T){case o:{let t=p;switch(b){case"bigint":T=g,t=p.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+b);t=null;break;case"undefined":return d([i],p)}return d([T,t],p)}case n:{if(b)return d([b,[...p]],p);const e=[],t=d([T,e],p);for(const t of p)e.push(y(t));return t}case a:{if(b)switch(b){case"BigInt":return d([b,p.toString()],p);case"Boolean":case"Number":case"String":return d([b,p.valueOf()],p)}if(t&&"toJSON"in p)return y(p.toJSON());const r=[],i=d([T,r],p);for(const t of f(p))!e&&m(h(p[t]))||r.push([y(t),y(p[t])]);return i}case s:return d([T,p.toISOString()],p);case l:{const{source:e,flags:t}=p;return d([T,{source:e,flags:t}],p)}case u:{const t=[],r=d([T,t],p);for(const[r,i]of p)(e||!m(h(r))&&!m(h(i)))&&t.push([y(r),y(i)]);return r}case c:{const t=[],r=d([T,t],p);for(const r of p)!e&&m(h(r))||t.push(y(r));return r}}const{message:v}=p;return d([T,{name:b,message:v}],p)};return y})(!(t||r),!!t,new Map,p)(e),p}},7775:(e,t)=>{t.VOID=-1;t.PRIMITIVE=0;t.ARRAY=1;t.OBJECT=2;t.DATE=3;t.REGEXP=4;t.MAP=5;t.SET=6;t.ERROR=7;t.BIGINT=8}},t={};function r(i){var o=t[i];if(void 0!==o)return o.exports;var n=t[i]={exports:{}};return e[i].call(n.exports,n,n.exports,r),n.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.InfoFormat=e.InfoType=e.CardSetVersion=e.BitmarkVersion=e.BitmarkParserType=e.NodeType=e.ResourceTag=e.TextFormat=e.BitType=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 n=r(9046);Object.defineProperty(e,"Builder",{enumerable:!0,get:function(){return n.Builder}});var a=r(8703);Object.defineProperty(e,"ResourceBuilder",{enumerable:!0,get:function(){return a.ResourceBuilder}});var s=r(8256);Object.defineProperty(e,"Ast",{enumerable:!0,get:function(){return s.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 p=r(9556);Object.defineProperty(e,"BitmarkParser",{enumerable:!0,get:function(){return p.BitmarkParser}});var g=r(297);Object.defineProperty(e,"BitmarkGenerator",{enumerable:!0,get:function(){return g.BitmarkGenerator}});var d=r(8582);Object.defineProperty(e,"BitmarkStringGenerator",{enumerable:!0,get:function(){return d.BitmarkStringGenerator}});var y=r(227);Object.defineProperty(e,"StringWriter",{enumerable:!0,get:function(){return y.StringWriter}});var f=r(208);Object.defineProperty(e,"BitType",{enumerable:!0,get:function(){return f.BitType}});var h=r(1353);Object.defineProperty(e,"TextFormat",{enumerable:!0,get:function(){return h.TextFormat}});var m=r(9779);Object.defineProperty(e,"ResourceTag",{enumerable:!0,get:function(){return m.ResourceTag}});var T=r(549);Object.defineProperty(e,"NodeType",{enumerable:!0,get:function(){return T.NodeType}});var b=r(6958);Object.defineProperty(e,"BitmarkParserType",{enumerable:!0,get:function(){return b.BitmarkParserType}});var v=r(8791);Object.defineProperty(e,"BitmarkVersion",{enumerable:!0,get:function(){return v.BitmarkVersion}});var B=r(8565);Object.defineProperty(e,"CardSetVersion",{enumerable:!0,get:function(){return B.CardSetVersion}});var C=r(7347);Object.defineProperty(e,"InfoType",{enumerable:!0,get:function(){return C.InfoType}});var k=r(8681);Object.defineProperty(e,"InfoFormat",{enumerable:!0,get:function(){return k.InfoFormat}});(0,t.init)()})(),i})()));
|