@gmb/bitmark-parser-generator 1.2.4 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/bitmark-parser-generator.min.js +1 -1
- package/dist/browser/bundle-report.html +2 -2
- package/dist/cjs/BitmarkParserGenerator.js +5 -26
- package/dist/cjs/BitmarkParserGenerator.js.map +1 -1
- package/dist/cjs/config/config.js +0 -1
- package/dist/cjs/config/config.js.map +1 -1
- package/dist/cjs/generated/build-info.js +1 -1
- package/dist/cjs/generator/text/TextGenerator.js +93 -32
- package/dist/cjs/generator/text/TextGenerator.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/model/enum/BitType.js +37 -4
- package/dist/cjs/model/enum/BitType.js.map +1 -1
- package/dist/cjs/model/enum/BitmarkParserType.js +0 -1
- package/dist/cjs/model/enum/BitmarkParserType.js.map +1 -1
- package/dist/cjs/parser/bitmark/BitmarkParser.js +3 -45
- package/dist/cjs/parser/bitmark/BitmarkParser.js.map +1 -1
- package/dist/esm/BitmarkParserGenerator.js +5 -23
- package/dist/esm/BitmarkParserGenerator.js.map +1 -1
- package/dist/esm/config/config.js +0 -1
- package/dist/esm/config/config.js.map +1 -1
- package/dist/esm/generated/build-info.js +1 -1
- package/dist/esm/generator/text/TextGenerator.js +93 -32
- package/dist/esm/generator/text/TextGenerator.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/model/enum/BitType.js +37 -4
- package/dist/esm/model/enum/BitType.js.map +1 -1
- package/dist/esm/model/enum/BitmarkParserType.js +0 -1
- package/dist/esm/model/enum/BitmarkParserType.js.map +1 -1
- package/dist/esm/parser/bitmark/BitmarkParser.js +3 -45
- package/dist/esm/parser/bitmark/BitmarkParser.js.map +1 -1
- package/dist/types/BitmarkParserGenerator.d.ts.map +1 -1
- package/dist/types/config/config.d.ts +0 -1
- package/dist/types/config/config.d.ts.map +1 -1
- package/dist/types/generator/text/TextGenerator.d.ts +21 -3
- package/dist/types/generator/text/TextGenerator.d.ts.map +1 -1
- package/dist/types/model/enum/BitType.d.ts +34 -8
- package/dist/types/model/enum/BitType.d.ts.map +1 -1
- package/dist/types/model/enum/BitmarkParserType.d.ts +1 -5
- package/dist/types/model/enum/BitmarkParserType.d.ts.map +1 -1
- package/dist/types/model/json/BitJson.d.ts.map +1 -1
- package/dist/types/parser/bitmark/BitmarkParser.d.ts +2 -9
- package/dist/types/parser/bitmark/BitmarkParser.d.ts.map +1 -1
- package/package.json +2 -15
- package/dist/browser/bitmark-parser-generator-antlr.min.js +0 -2
- package/dist/browser/bitmark-parser-generator-antlr.min.js.LICENSE.txt +0 -22
- package/dist/cjs/config/bits/screenshotBitConfig.js +0 -14
- package/dist/cjs/config/bits/screenshotBitConfig.js.map +0 -1
- package/dist/esm/config/bits/screenshotBitConfig.js +0 -12
- package/dist/esm/config/bits/screenshotBitConfig.js.map +0 -1
- package/dist/types/config/bits/screenshotBitConfig.d.ts +0 -2
- package/dist/types/config/bits/screenshotBitConfig.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.bitmarkParserGenerator=t():e.bitmarkParserGenerator=t()}(this,(()=>(()=>{"use strict";var e={6688:(e,t,r)=>{function i(e,t){var r;const i=Object.freeze,o=Object.defineProperty,s=Object.assign,n={enumerable:!1},a=new Map,l=new Map,u=new Map,c=new Map,d=new Map,p=(null!==(r=null==t?void 0:t.iterationKeys)&&void 0!==r?r:Object.keys(e)).map((e=>`${e}`));for(const[t,r]of Object.entries(e))a.set(t,r),u.set(t.toLowerCase(),r);for(const[e,t]of a){const r="string"==typeof t?t.toLowerCase():t;l.set(t,e),c.set(r,e)}const h=p.map((e=>a.get(e))),y=p.map((e=>[e,a.get(e)]));return(t=>{let r=e;function m(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?a.get(c.get(e.toLowerCase())):!e||l.has(e)?e:void 0}Object.isExtensible(e)||(r=s({},e)),o(r,"fromKey",s({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?u.get(e.toLowerCase()):a.get(`${e}`)}},n)),o(r,"fromValue",s({value:m},n)),o(r,"keyFromValue",s({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?c.get(e.toLowerCase()):l.get(e)}},n)),o(r,"setMetadata",s({value:function(e,t,r){const i=m(e);i&&d.set(i,t)}},n)),o(r,"getMetadata",s({value:function(e,t){return d.get(e)}},n)),o(r,Symbol.iterator,s({value:function(){let e=0;return{next:()=>e<p.length?{value:a.get(`${p[e++]}`),done:!1}:{done:!0}}}},n)),o(r,"values",s({value:()=>h},n)),o(r,"keys",s({value:()=>p},n)),o(r,"entries",s({value:()=>y},n));let g=r;return(null==t?void 0:t.noFreeze)||(g=i(r),i(p),i(h),i(y)),g})(t)}r.r(t),r.d(t,{superenum:()=>o});const o=i;o.fromObject=i,o.fromArray=function(e,t){Array.isArray(e)||(e=[]);const r=e.reduce(((e,t)=>(e[`${t}`]=t,e)),{});return(!t||t&&!t.iterationKeys)&&((t=Object.assign({},t)).iterationKeys=e),i(r,t)}},390:function(e,t,r){var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,o)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=(this&&this.__importStar,this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))});this&&this.__importDefault;Object.defineProperty(t,"__esModule",{value:!0}),t.Output=t.BitmarkParserGenerator=void 0;const n=r(6688),a=r(8256),l=r(8582),u=r(4275),c=r(6958),d=r(9556),p=r(2434),h=r(671),y=(0,n.superenum)({bitmark:"bitmark",json:"json",ast:"ast"});t.Output=y;t.BitmarkParserGenerator=class{constructor(){this.ast=new a.Ast,this.jsonParser=new p.JsonParser,this.bitmarkParser=new d.BitmarkParser,this.jsonStringifyPrettify=(e,t,r)=>{const i=!0===t.prettify?2:t.prettify||void 0;return r||!0===t.stringify||void 0!==i?JSON.stringify(e,null,i):e}}version(){return h.env.appVersion.full}convert(e,t){return s(this,void 0,void 0,(function*(){let r;const i=Object.assign({},t),o=Object.assign({},i.fileOptions),n=Object.assign({},i.jsonOptions),a=i.outputFormat,d=a===y.bitmark,p=a===y.json,m=a===y.ast,g=i.bitmarkParserType;let f=e;if(h.env.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");h.env.isNode&&fs.existsSync(f)&&(f=fs.readFileSync(f,{encoding:"utf8"}));let b=this.ast.preprocessAst(f);const v=!!b;v||(b=this.jsonParser.toAst(f));const T=!!(null==b?void 0:b.bits),A=e=>s(this,void 0,void 0,(function*(){yield _(e),yield S(r)})),_=e=>s(this,void 0,void 0,(function*(){r=this.bitmarkParser.toAst(e,{parserType:g})})),P=e=>s(this,void 0,void 0,(function*(){if(g===c.BitmarkParserType.antlr){const t=this.bitmarkParser.parseUsingAntlr(e);if(i.outputFile){const e=this.jsonStringifyPrettify(t,n,!0),r=o.append?"a":"w";fs.ensureDirSync(path_1.default.dirname(i.outputFile.toString())),fs.writeFileSync(i.outputFile,e,{flag:r})}else r=this.jsonStringifyPrettify(t,n)}else if(b=this.bitmarkParser.toAst(e,{parserType:g}),i.outputFile){const e=new JsonFileGenerator_1.JsonFileGenerator(i.outputFile,i);yield e.generate(b)}else{const e=new u.JsonObjectGenerator(i),t=yield e.generate(b);r=this.jsonStringifyPrettify(t,n)}})),S=e=>s(this,void 0,void 0,(function*(){if(i.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(i.outputFile,i);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(i);r=yield t.generate(e)}})),x=e=>s(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,n)})),w=e=>s(this,void 0,void 0,(function*(){if(i.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(i.outputFile,i);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(i),o=yield t.generate(e);r=this.jsonStringifyPrettify(o,n)}})),R=e=>s(this,void 0,void 0,(function*(){if(i.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(i.outputFile,i);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(i);r=yield t.generate(e)}})),O=e=>s(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,n)})),k=e=>s(this,void 0,void 0,(function*(){yield w(e)}));return!T&&!v?d?yield A(f):m?yield _(f):yield P(f):v?m?yield x(b):p?yield w(b):yield S(b):p?yield k(b):m?yield O(b):yield R(b),r}))}upgrade(e,t){return s(this,void 0,void 0,(function*(){let r;const i=Object.assign({},t),o=Object.assign({},i.jsonOptions),n=i.bitmarkParserType;let a=e;if(h.env.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");h.env.isNode&&fs.existsSync(a)&&(a=fs.readFileSync(a,{encoding:"utf8"}));let c=this.jsonParser.toAst(a);const d=e=>s(this,void 0,void 0,(function*(){const t=this.bitmarkParser.toAst(e,{parserType:n});if(i.outputFile){const e=new BitmarkFileGenerator_1.BitmarkFileGenerator(i.outputFile,i);yield e.generate(t)}else{const e=new l.BitmarkStringGenerator(i);r=yield e.generate(t)}})),p=e=>s(this,void 0,void 0,(function*(){if(i.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(i.outputFile,i);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(i),s=yield t.generate(e);r=this.jsonStringifyPrettify(s,o)}}));return!!!(null==c?void 0:c.bits)?yield d(a):yield p(c),r}))}createAst(e){let t,r=e;h.env.isNode&&fs.existsSync(r)&&(r=fs.readFileSync(r,{encoding:"utf8"}));let i=this.ast.preprocessAst(r);const o=!!i;o||(i=this.jsonParser.toAst(r));return t=!!!(null==i?void 0:i.bits)&&!o?this.bitmarkParser.toAst(r):i,t}}},8256:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Ast=void 0;const i=r(7087),o=r(549),s=r(3633);t.Ast=class{constructor(){(0,i.init)()}walk(e,t,r,i){this.walkRecursive(e,void 0,r,[{index:0,key:t,value:e}],i)}getRouteKey(e){return e.reduce(((t,r,i)=>(+r.key!==r.index&&(t+=`${r.key}`,i<e.length-1&&(t+="_")),t)),"")}printTree(e,t=o.NodeType.bitmarkAst){this.walkRecursive(e,void 0,{enter:(e,t,r)=>{console.log("Enter: "+this.getRouteKey(r))},between:(e,t,r,i,o)=>{console.log("Between: "+this.getRouteKey(o))},exit:(e,t,r)=>{console.log("Exit: "+this.getRouteKey(r))},leaf:(e,t,r)=>{console.log("Leaf: "+this.getRouteKey(r))}},[{index:0,key:t,value:e}],void 0)}preprocessAst(e){if(s.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){return!(!Object.prototype.hasOwnProperty.call(e,"bits")||!Array.isArray(e.bits))}walkRecursive(e,t,r,i,o){const{enter:s,between:n,exit:a,leaf:l}=r,u=i[i.length-1].key,c=!this.isValue(e),d=i[i.length-1];if(c){if(s){if(!1===s(d,t,i,o))return}}else l&&l(d,t,i,o);if(c){const s=this.isArray(e),a=Object.keys(e);for(let l=0,c=a.length;l<c;l++){const p=a[l],h=l===c-1,y=e,m=y[p];if(null!=m){const e={key:this.getAstKey(p,u,s),index:l,value:m},c=i.slice();if(c.push(e),this.walkRecursive(m,d,r,c,o),!h){const r=a[l+1],c=y[r],p={key:this.getAstKey(r,u,s),index:l+1,value:c};if(n){if(!1===n(d,e,p,t,i,o))break}}}}}c&&a&&a(d,t,i,o)}getAstKey(e,t,r){let i=e;return r&&t&&(i=`${t}Value`),o.NodeType.fromKey(i)||`unknown(${i})`}isArray(e){return Array.isArray(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}}},423:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseBuilder=void 0;const i=r(4719),o=r(7646),s=r(672),n=r(994),a=r(3633);t.BaseBuilder=class{toExample(e,t){return null!=t?(!0===t&&(t="true"),!1===t&&(t="false"),{isDefaultExample:!1,isExample:!0,example:t}):e?{isDefaultExample:!0,isExample:!0}:{isDefaultExample:!1,isExample:!1}}toExampleBoolean(e,t){const r=null!=t&&!s.BooleanUtils.isBooleanString(t);return null==t||r?e||r?{isDefaultExample:!0,isExample:!0}:{isDefaultExample:!1,isExample:!1}:{isDefaultExample:!1,isExample:!0,example:s.BooleanUtils.toBoolean(t)}}toAstProperty(e,t){var r;const l=null!==(r=i.PropertyKey.getMetadata(e))&&void 0!==r?r:{};if(null==t)return;const u=e=>{if(null!=e)return l.isTrimmedString&&(e=a.StringUtils.isString(e)?a.StringUtils.trimmedString(e):void 0),l.isNumber&&(e=n.NumberUtils.asNumber(e)),l.isBoolean&&(e=s.BooleanUtils.toBoolean(e,!0)),l.isInvertedBoolean&&(e=!s.BooleanUtils.toBoolean(e,!0)),e};if(Array.isArray(t)){const e=t;for(let t=0,r=e.length;t<r;t++)e[t]=u(e[t])}else t=u(t);return o.ArrayUtils.asArray(t)}}},9046:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=void 0;const i=r(208),o=r(1060),s=r(4719),n=r(1353),a=r(7646),l=r(4598),u=r(994),c=r(4309),d=r(671),p=r(423),h=r(2377);class y extends p.BaseBuilder{bitmark(e){const{bits:t,errors:r}=e,i={bits:t,errors:r};return c.ObjectUtils.removeUnwantedProperties(i),i}bit(e){var t;const{bitType:r,textFormat:i,resourceType:o,id:d,externalId:p,spaceId:y,padletId:m,aiGenerated:g,releaseVersion:f,ageRange:b,language:v,computerLanguage:T,target:A,tag:_,icon:P,iconTag:S,colorTag:x,flashcardSet:w,subtype:R,coverImage:O,publisher:k,publications:C,author:E,subject:I,date:j,location:B,theme:L,kind:N,action:M,thumbImage:U,focusX:D,focusY:V,duration:K,referenceProperty:F,deeplink:G,externalLink:H,externalLinkText:$,videoCallLink:q,bot:J,list:z,textReference:W,isTracked:Y,isInfoOnly:X,labelTrue:Q,labelFalse:Z,book:ee,quotedPerson:te,partialAnswer:re,levelProperty:ie,title:oe,subtitle:se,level:ne,toc:ae,progress:le,anchor:ue,reference:ce,referenceEnd:de,item:pe,lead:he,hint:ye,instruction:me,isDefaultExample:ge,example:fe,imageSource:be,partner:ve,markConfig:Te,extraProperties:Ae,resource:_e,body:Pe,sampleSolution:Se,footer:xe,markup:we,parser:Re}=e,Oe=this.cardNode(e),ke=Object.assign(Object.assign({bitType:r,textFormat:null!==(t=n.TextFormat.fromValue(i))&&void 0!==t?t:n.TextFormat.bitmarkMinusMinus,resourceType:l.BitUtils.calculateValidResourceType(r,o,_e),id:this.toAstProperty(s.PropertyKey.id,d),externalId:this.toAstProperty(s.PropertyKey.externalId,p),spaceId:this.toAstProperty(s.PropertyKey.spaceId,y),padletId:this.toAstProperty(s.PropertyKey.padletId,m),aiGenerated:this.toAstProperty(s.PropertyKey.aiGenerated,g),releaseVersion:this.toAstProperty(s.PropertyKey.releaseVersion,f),book:ee,ageRange:this.toAstProperty(s.PropertyKey.ageRange,b),language:this.toAstProperty(s.PropertyKey.language,v),computerLanguage:this.toAstProperty(s.PropertyKey.computerLanguage,T),target:this.toAstProperty(s.PropertyKey.target,A),tag:this.toAstProperty(s.PropertyKey.tag,_),icon:this.toAstProperty(s.PropertyKey.icon,P),iconTag:this.toAstProperty(s.PropertyKey.iconTag,S),colorTag:this.toAstProperty(s.PropertyKey.colorTag,x),flashcardSet:this.toAstProperty(s.PropertyKey.flashcardSet,w),subtype:this.toAstProperty(s.PropertyKey.subtype,R),coverImage:this.toAstProperty(s.PropertyKey.coverImage,O),publisher:this.toAstProperty(s.PropertyKey.publisher,k),publications:this.toAstProperty(s.PropertyKey.publications,C),author:this.toAstProperty(s.PropertyKey.author,E),subject:this.toAstProperty(s.PropertyKey.subject,I),date:this.toAstProperty(s.PropertyKey.date,j),location:this.toAstProperty(s.PropertyKey.location,B),theme:this.toAstProperty(s.PropertyKey.theme,L),kind:this.toAstProperty(s.PropertyKey.kind,N),action:this.toAstProperty(s.PropertyKey.action,M),thumbImage:this.toAstProperty(s.PropertyKey.thumbImage,U),focusX:this.toAstProperty(s.PropertyKey.focusX,D),focusY:this.toAstProperty(s.PropertyKey.focusY,V),deeplink:this.toAstProperty(s.PropertyKey.deeplink,G),externalLink:this.toAstProperty(s.PropertyKey.externalLink,H),externalLinkText:this.toAstProperty(s.PropertyKey.externalLinkText,$),videoCallLink:this.toAstProperty(s.PropertyKey.videoCallLink,q),bot:this.toAstProperty(s.PropertyKey.bot,J),duration:this.toAstProperty(s.PropertyKey.duration,K),referenceProperty:this.toAstProperty(s.PropertyKey.reference,F),list:this.toAstProperty(s.PropertyKey.list,z),textReference:this.toAstProperty(s.PropertyKey.textReference,W),isTracked:this.toAstProperty(s.PropertyKey.isTracked,Y),isInfoOnly:this.toAstProperty(s.PropertyKey.isInfoOnly,X),labelTrue:this.toAstProperty(s.PropertyKey.labelTrue,Q),labelFalse:this.toAstProperty(s.PropertyKey.labelFalse,Z),quotedPerson:this.toAstProperty(s.PropertyKey.quotedPerson,te),partialAnswer:this.toAstProperty(s.PropertyKey.partialAnswer,re),levelProperty:this.toAstProperty(s.PropertyKey.level,ie),title:oe,subtitle:se,level:u.NumberUtils.asNumber(ne),toc:this.toAstProperty(s.PropertyKey.toc,ae),progress:this.toAstProperty(s.PropertyKey.progress,le),anchor:ue,reference:ce,referenceEnd:de,markConfig:Te,itemLead:this.itemLead(pe,he),hint:ye,instruction:me},this.toExample(ge,fe)),{imageSource:be,partner:ve,resource:_e,body:Pe,sampleSolution:a.ArrayUtils.asArray(Se),cardNode:Oe,footer:xe,markup:we,parser:Re,extraProperties:this.parseExtraProperties(Ae)});return this.pushExampleDownTree(Pe,Oe,ge,fe),this.setDefaultBitValues(ke),this.setIsExampleFlags(ke),this.addVersionToParserInfo(ke),c.ObjectUtils.removeUnwantedProperties(ke,{ignoreAllFalse:!0,ignoreEmptyString:["example"]}),h.NodeValidator.validateBit(ke)}choice(e){const{text:t,isCorrect:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:s,instruction:n},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}response(e){const{text:t,isCorrect:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:s,instruction:n},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}botResponse(e){const{response:t,reaction:r,feedback:i,item:o,lead:s,hint:n}=e,a={response:t,reaction:r,feedback:i,itemLead:this.itemLead(o,s),hint:n};return c.ObjectUtils.removeUnwantedProperties(a,{ignoreEmptyString:["response","reaction","feedback"]}),a}quiz(e){const{choices:t,responses:r,item:i,lead:o,hint:s,instruction:n,isDefaultExample:a,example:l}=e;this.pushExampleDownTreeBoolean(a,l,!0,t),this.pushExampleDownTreeBoolean(a,l,!1,r);const u={itemLead:this.itemLead(i,o),hint:s,instruction:n,isExample:a||null!=l,choices:t,responses:r};return c.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}heading(e){var t;const{forKeys:r,forValues:i}=e;if(null==r)return;const o={forKeys:r||"",forValues:null!==(t=a.ArrayUtils.asArray(i))&&void 0!==t?t:[]};return c.ObjectUtils.removeUnwantedProperties(o),o}pair(e){const{key:t,keyAudio:r,keyImage:i,values:o,item:s,lead:n,hint:a,instruction:l,isCaseSensitive:u,isShortAnswer:d,isDefaultExample:p,example:h}=e,y=Object.assign(Object.assign({key:t,keyAudio:r,keyImage:i,itemLead:this.itemLead(s,n),hint:a,instruction:l},this.toExample(p,h)),{isCaseSensitive:u,isShortAnswer:d,values:o});return c.ObjectUtils.removeUnwantedProperties(y,{ignoreAllFalse:!0}),y}matrix(e){const{key:t,cells:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isShortAnswer:l,isDefaultExample:u}=e;let d=!1;for(const e of null!=r?r:[])u&&!e.isExample&&(e.isDefaultExample=!0,e.isExample=!0),d=!!e.isExample||d;const p={key:t,itemLead:this.itemLead(i,o),hint:s,instruction:n,isCaseSensitive:a,isShortAnswer:l,isExample:d,cells:r};return c.ObjectUtils.removeUnwantedProperties(p,{ignoreAllFalse:!0}),p}matrixCell(e){const{values:t,item:r,lead:i,hint:o,instruction:s,isDefaultExample:n,example:a}=e,l=Object.assign({values:t,itemLead:this.itemLead(r,i),hint:o,instruction:s},this.toExample(n,a));return c.ObjectUtils.removeUnwantedProperties(l,{ignoreAllFalse:!0}),l}question(e){const{question:t,partialAnswer:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isShortAnswer:l,sampleSolution:u,isDefaultExample:d,example:p}=e,h=Object.assign(Object.assign({itemLead:this.itemLead(i,o),question:t,partialAnswer:r,hint:s,instruction:n},this.toExample(d,p)),{isCaseSensitive:a,isShortAnswer:l,sampleSolution:u});return c.ObjectUtils.removeUnwantedProperties(h,{ignoreEmptyString:["question"],ignoreAllFalse:!0}),h}body(e){const{bodyParts:t}=e;return{bodyParts:t}}bodyText(e){const{text:t}=e;return{type:o.BodyBitType.text,data:{bodyText:t}}}footerText(e){const{text:t}=e;return{footerText:t}}gap(e){const{solutions:t,item:r,lead:i,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d={type:o.BodyBitType.gap,data:Object.assign(Object.assign({solutions:t,itemLead:this.itemLead(r,i),hint:s,instruction:n},this.toExample(l,u)),{isCaseSensitive:a})};return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}markConfig(e){const{mark:t,color:r,emphasis:i}=e,o={mark:t,color:r,emphasis:i};return c.ObjectUtils.removeUnwantedProperties(o),o}mark(e){const{solution:t,mark:r,item:i,lead:s,hint:n,instruction:a,isDefaultExample:l,example:u}=e,d={type:o.BodyBitType.mark,data:Object.assign({solution:t,mark:r,itemLead:this.itemLead(i,s),hint:n,instruction:a},this.toExample(l,u))};return c.ObjectUtils.removeUnwantedProperties(d),d}select(e){const{options:t,prefix:r,postfix:i,item:s,lead:n,hint:a,instruction:l,isCaseSensitive:u}=e,d={type:o.BodyBitType.select,data:{prefix:r,options:t,postfix:i,itemLead:this.itemLead(s,n),hint:a,instruction:l,isCaseSensitive:u}};return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}selectOption(e){const{text:t,isCorrect:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:s,instruction:n},this.toExample(l,u)),{isCaseSensitive:a});return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}highlight(e){const{texts:t,prefix:r,postfix:i,item:s,lead:n,hint:a,instruction:l,isCaseSensitive:u}=e,d={type:o.BodyBitType.highlight,data:{prefix:r,texts:t,postfix:i,itemLead:this.itemLead(s,n),hint:a,instruction:l,isCaseSensitive:u}};return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}highlightText(e){const{text:t,isCorrect:r,isHighlighted:i,item:o,lead:s,hint:n,instruction:a,isCaseSensitive:l,isDefaultExample:u,example:d}=e,p=Object.assign(Object.assign({text:t,isCorrect:!!r,isHighlighted:!!i,itemLead:this.itemLead(o,s),hint:n,instruction:a},this.toExample(u,d)),{isCaseSensitive:l});return c.ObjectUtils.removeUnwantedProperties(p,{ignoreAllFalse:!0}),p}flashcard(e){const{question:t,answer:r,alternativeAnswers:i,item:o,lead:s,hint:n,instruction:a,isDefaultExample:l,example:u}=e,d=Object.assign({question:t,answer:r,alternativeAnswers:i,itemLead:this.itemLead(o,s),hint:n,instruction:a},this.toExampleBoolean(l,u));return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}statement(e){const{text:t,isCorrect:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:s,instruction:n},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}imageSource(e){const{url:t,mockupId:r,size:i,format:o,trim:s}=e,n={url:t,mockupId:r,size:i,format:o,trim:s};return c.ObjectUtils.removeUnwantedProperties(n,{ignoreFalse:["trim"]}),n}partner(e){const{name:t,avatarImage:r}=e,i={name:t,avatarImage:r};return c.ObjectUtils.removeUnwantedProperties(i),i}comment(e){const{text:t,location:r}=e,i={text:t,location:r};return c.ObjectUtils.removeUnwantedProperties(i),i}itemLead(e,t){let r;return(e||t)&&(r={item:e,lead:t}),r}cardNode(e){let t;const{questions:r,elements:i,flashcards:o,statement:s,statements:n,choices:a,responses:l,quizzes:u,heading:d,pairs:p,matrix:h,botResponses:y}=e;return(r||i||o||s||n||a||l||u||d||p||h||y)&&(t={questions:r,elements:i,flashcards:o,statement:s,statements:n,choices:a,responses:l,quizzes:u,heading:d,pairs:p,matrix:h,botResponses:y},c.ObjectUtils.removeUnwantedProperties(t)),t}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];l.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];l.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 o.BodyBitType.gap:{const r=i;l.BitUtils.fillStringExample([r.data],e,t,!1);break}case o.BodyBitType.mark:{const r=i;l.BitUtils.fillBooleanExample([r.data],e,t,!1);break}case o.BodyBitType.select:{const r=i;l.BitUtils.fillBooleanExample(r.data.options,e,t,!0);break}case o.BodyBitType.highlight:{const r=i;l.BitUtils.fillBooleanExample(r.data.texts,e,t,!0);break}}}parseExtraProperties(e){if(!e)return;const t=Object.entries(e);if(0===t.length)return;const r={};for(const[e,i]of t)r[e]=a.ArrayUtils.asArray(i)||[i];return r}setIsExampleFlags(e){var t,r,i,s,n,a,l,u,c,d,p,h,y;e.isExample=!1;const m=t=>!!t&&(t.isDefaultExample||null!=t.example?(t.isExample=!0,e.isExample=!0):t.isExample=t===e&&!!e.isExample,t.isExample),{body:g,cardNode:f}=e;if(g&&g.bodyParts)for(const e of g.bodyParts)switch(e.type){case o.BodyBitType.gap:case o.BodyBitType.mark:m(e.data);break;case o.BodyBitType.select:{const t=e;let r=!1;for(const e of t.data.options)r=!!m(e)||r;t.data.isExample=r;break}case o.BodyBitType.highlight:{const t=e;let r=!1;for(const e of t.data.texts)r=!!m(e)||r;t.data.isExample=r;break}}if(f){for(const e of null!==(t=f.flashcards)&&void 0!==t?t:[])m(e);for(const e of null!==(r=f.pairs)&&void 0!==r?r:[])m(e);for(const e of null!==(i=f.matrix)&&void 0!==i?i:[]){let t=!1;for(const r of null!==(s=e.cells)&&void 0!==s?s:[])t=!!m(r)||t;e.isExample=t}for(const e of null!==(n=f.quizzes)&&void 0!==n?n:[]){let t=!1;for(const r of null!==(a=e.responses)&&void 0!==a?a:[])t=!!m(r)||t;for(const r of null!==(l=e.choices)&&void 0!==l?l:[])t=!!m(r)||t;e.isExample=t}for(const e of null!==(u=f.responses)&&void 0!==u?u:[])m(e);for(const e of null!==(c=f.choices)&&void 0!==c?c:[])m(e);for(const e of null!==(d=f.statements)&&void 0!==d?d:[])m(e);m(f.statement);for(const e of null!==(p=f.questions)&&void 0!==p?p:[])m(e)}m(e.statement);for(const t of null!==(h=e.responses)&&void 0!==h?h:[])m(t);for(const t of null!==(y=e.choices)&&void 0!==y?y:[])m(t);m(e)}setDefaultBitValues(e){switch(e.bitType.alias){case i.AliasBitType.articleAi:case i.AliasBitType.noteAi:case i.AliasBitType.summaryAi:e.aiGenerated=this.toAstProperty(s.PropertyKey.aiGenerated,!0)}}addVersionToParserInfo(e){var t;const r=null!==(t=e.parser)&&void 0!==t?t:{};r.version=d.env.appVersion.full,e.parser=r}}t.Builder=y},8703:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceBuilder=void 0;const o=r(1895),s=r(4309),n=r(169),a=r(423),l=r(2377);class u extends a.BaseBuilder{resource(e){var t,r,s,n,a;let l;const{type:u,value:c,format:d}=e,p=i(e,["type","value","format"]),h=Object.assign({type:u,value:null!=c?c:"",format:null!=d?d:""},p);switch(u){case o.ResourceType.video:case o.ResourceType.videoEmbed:case o.ResourceType.videoLink:case o.ResourceType.stillImageFilmEmbed:case o.ResourceType.stillImageFilmLink:{const r=["src1x","src2x","src3x","src4x"],i=[];for(const t of r){const r=e[t];if(r){const e=this.resource({type:o.ResourceType.image,value:r});e&&i.push(e)}}h.thumbnails=[...null!==(t=h.thumbnails)&&void 0!==t?t:[],...i]}}switch(u){case o.ResourceType.image:case o.ResourceType.imagePortrait:case o.ResourceType.imageLandscape:l=this.imageResource(h,u);break;case o.ResourceType.imageResponsive:l=this.imageResponsiveResource({imagePortrait:this.imageResource(null!==(r=h.imagePortrait)&&void 0!==r?r:{format:"",value:""}),imageLandscape:this.imageResource(null!==(s=h.imageLandscape)&&void 0!==s?s:{format:"",value:""})});break;case o.ResourceType.imageLink:l=this.imageLinkResource(h);break;case o.ResourceType.audio:l=this.audioResource(h);break;case o.ResourceType.audioEmbed:l=this.audioEmbedResource(h);break;case o.ResourceType.audioLink:l=this.audioLinkResource(h);break;case o.ResourceType.video:l=this.videoResource(h);break;case o.ResourceType.videoEmbed:l=this.videoEmbedResource(h);break;case o.ResourceType.videoLink:l=this.videoLinkResource(h);break;case o.ResourceType.stillImageFilm:l=this.stillImageFilmResource({image:this.imageResource(null!==(n=h.image)&&void 0!==n?n:{format:"",value:""}),audio:this.audioResource(null!==(a=h.audio)&&void 0!==a?a:{format:"",value:""})});break;case o.ResourceType.stillImageFilmEmbed:l=this.stillImageFilmEmbedResource(h);break;case o.ResourceType.stillImageFilmLink:l=this.stillImageFilmLinkResource(h);break;case o.ResourceType.article:l=this.articleResource(h);break;case o.ResourceType.document:l=this.documentResource(h);break;case o.ResourceType.documentEmbed:l=this.documentEmbedResource(h);break;case o.ResourceType.documentLink:l=this.documentLinkResource(h);break;case o.ResourceType.documentDownload:l=this.documentDownloadResource(h);break;case o.ResourceType.appLink:l=this.appLinkResource(h);break;case o.ResourceType.websiteLink:l=this.websiteLinkResource(h)}return l}imageResource(e,t){const{value:r,src1x:i,src2x:a,src3x:u,src4x:c,width:d,height:p,alt:h,license:y,copyright:m,showInIndex:g,caption:f}=e,b={type:o.ResourceType.image,typeAlias:null!=t?t:o.ResourceType.image,format:n.UrlUtils.fileExtensionFromUrl(r),provider:n.UrlUtils.domainFromUrl(r),value:r,src1x:i,src2x:a,src3x:u,src4x:c,width:d,height:p,alt:h,license:y,copyright:m,showInIndex:g,caption:f};return s.ObjectUtils.removeUnwantedProperties(b),l.NodeValidator.validateResource(b)}imageResponsiveResource(e){const{imagePortrait:t,imageLandscape:r}=e,i={type:o.ResourceType.imageResponsive,typeAlias:o.ResourceType.imageResponsive,imagePortrait:null!=t?t:this.imageResource({format:"",value:""}),imageLandscape:null!=r?r:this.imageResource({format:"",value:""})};return s.ObjectUtils.removeUnwantedProperties(i),l.NodeValidator.validateResource(i)}imageLinkResource(e){const{value:t,src1x:r,src2x:i,src3x:a,src4x:u,width:c,height:d,alt:p,license:h,copyright:y,showInIndex:m,caption:g}=e,f={type:o.ResourceType.imageLink,typeAlias:o.ResourceType.imageLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,src1x:r,src2x:i,src3x:a,src4x:u,width:c,height:d,alt:p,license:h,copyright:y,showInIndex:m,caption:g};return s.ObjectUtils.removeUnwantedProperties(f),l.NodeValidator.validateResource(f)}audioResource(e){const{value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p}=e,h={type:o.ResourceType.audio,typeAlias:o.ResourceType.audio,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p};return s.ObjectUtils.removeUnwantedProperties(h),l.NodeValidator.validateResource(h)}audioEmbedResource(e){const{value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p}=e,h={type:o.ResourceType.audioEmbed,typeAlias:o.ResourceType.audioEmbed,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p};return s.ObjectUtils.removeUnwantedProperties(h),l.NodeValidator.validateResource(h)}audioLinkResource(e){const{value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p}=e,h={type:o.ResourceType.audioLink,typeAlias:o.ResourceType.audioLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p};return s.ObjectUtils.removeUnwantedProperties(h),l.NodeValidator.validateResource(h)}videoResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v}=e,T={type:o.ResourceType.video,typeAlias:o.ResourceType.video,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}videoEmbedResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v}=e,T={type:o.ResourceType.videoEmbed,typeAlias:o.ResourceType.videoEmbed,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}videoLinkResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v}=e,T={type:o.ResourceType.videoLink,typeAlias:o.ResourceType.videoLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}stillImageFilmResource(e){const{image:t,audio:r}=e,i={type:o.ResourceType.stillImageFilm,typeAlias:o.ResourceType.stillImageFilm,image:null!=t?t:this.imageResource({format:"",value:""}),audio:null!=r?r:this.audioResource({format:"",value:""})};return s.ObjectUtils.removeUnwantedProperties(i),l.NodeValidator.validateResource(i)}stillImageFilmEmbedResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v}=e,T={type:o.ResourceType.stillImageFilmEmbed,typeAlias:o.ResourceType.stillImageFilmEmbed,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}stillImageFilmLinkResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v}=e,T={type:o.ResourceType.stillImageFilmLink,typeAlias:o.ResourceType.stillImageFilmLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}articleResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.article,typeAlias:o.ResourceType.article,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.document,typeAlias:o.ResourceType.document,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentEmbedResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.documentEmbed,typeAlias:o.ResourceType.documentEmbed,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentLinkResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.documentLink,typeAlias:o.ResourceType.documentLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentDownloadResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.documentDownload,typeAlias:o.ResourceType.documentDownload,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}appLinkResource(e){const{value:t,license:r,copyright:i,showInIndex:n,caption:a}=e,u={type:o.ResourceType.appLink,typeAlias:o.ResourceType.appLink,value:t,license:r,copyright:i,showInIndex:n,caption:a};return s.ObjectUtils.removeUnwantedProperties(u),l.NodeValidator.validateResource(u)}websiteLinkResource(e){const{value:t,siteName:r,license:i,copyright:n,showInIndex:a,caption:u}=e,c={type:o.ResourceType.websiteLink,typeAlias:o.ResourceType.websiteLink,value:t,siteName:r,license:i,copyright:n,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}}t.ResourceBuilder=u},2377:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValidator=void 0;const i=r(208),o=r(1895),s=r(3633);const n=new class{validateBit(e){if(!e)return e;let t=e;if(e.bitType.root===i.RootBitType.interview)t=this.validateInterviewBit(e);return t}validateResource(e){var t,r,i,s;if(!e)return;let n=e,a=!1;switch(e.type){case o.ResourceType.imageResponsive:{const i=e;i.imagePortrait=null!==(t=this.validateResource(i.imagePortrait))&&void 0!==t?t:{type:o.ResourceType.image,typeAlias:o.ResourceType.imagePortrait},i.imageLandscape=null!==(r=this.validateResource(i.imageLandscape))&&void 0!==r?r:{type:o.ResourceType.image,typeAlias:o.ResourceType.imageLandscape},a=!0;break}case o.ResourceType.stillImageFilm:{const t=e;t.image=null!==(i=this.validateResource(t.image))&&void 0!==i?i:{type:o.ResourceType.image,typeAlias:o.ResourceType.image},t.audio=null!==(s=this.validateResource(t.audio))&&void 0!==s?s:{type:o.ResourceType.audio,typeAlias:o.ResourceType.image},a=!0;break}default:a=!!e.value}return a||e.type&&(n={type:e.type,typeAlias:e.type}),n}isRequired(e,t){if(!e)throw new Error(`${t} is required but is not set`)}isOneOfRequired(e,t){if(Array.isArray(e))for(const t of e)if(t)return;throw new Error(`One of '${t.join(", ")}' is required but none is set`)}isString(e,t){if(!s.StringUtils.isString(e))throw new Error(`${t} is required to be a string`)}isNonEmptyString(e,t){if(!s.StringUtils.isString(e)||""===e)throw new Error(`${t} is required to be a non-empty string`)}isStringOrBoolean(e,t){if(!s.StringUtils.isString(e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a string or a boolean`)}isNonEmptyStringOrBoolean(e,t){if((!s.StringUtils.isString(e)||""===e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a non-empty string or a boolean`)}isArray(e,t){if(!Array.isArray(e))throw new Error(`${t} is required to be a array`)}isNonEmptyArray(e,t){if(!(Array.isArray(e)&&e.length>0))throw new Error(`${t} is required to be a non-empty array`)}isNumber(e,t){if(!Number.isFinite(e))throw new Error(`${t} is required to be a number`)}isBoolean(e,t){if(!0!==e&&!1!==e)throw new Error(`${t} is required to be a boolean`)}isStringOrNumberOrBooleanOrNullOrUndefined(e,t){if(!s.StringUtils.isString(e)&&!Number.isFinite(e)&&!0!==e&&!1!==e&&null!=e)throw new Error(`${t} is required to be a string or a number or a boolean or null or undefined`)}validateInterviewBit(e){return e.cardNode||(e.cardNode={}),e.cardNode.questions||(e.cardNode.questions=[]),e}};t.NodeValidator=n},227:function(e,t){var r=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;t.StringWriter=class{constructor(){this._string="",this.endOfLineString="\n"}get isSync(){return!0}getString(){return this._string}open(){return r(this,void 0,void 0,(function*(){this.openSync(),Promise.resolve()}))}close(){return r(this,void 0,void 0,(function*(){try{this.closeSync()}catch(e){return Promise.reject(e)}Promise.resolve()}))}openSync(){this._buffer=[],this._string=""}closeSync(){if(!this._buffer)throw new Error("open() or openSync() never called");this._string=this._buffer.join(""),this._buffer=[]}writeLine(e){return this._buffer?(null!=e?this._buffer.push(e+this.endOfLineString):this._buffer.push(this.endOfLineString),this):this}writeLines(e,t){if(!this._buffer)return this;if(!e)return this;for(let r=0,i=e.length;r<i;r++){const o=e[r];this._buffer.push(o),t&&r<i-1&&this._buffer.push(t),this._buffer.push(this.endOfLineString)}return this}write(e){return this._buffer?(null==e||this._buffer.push(e),this):this}writeWhiteSpace(){return this.write(" "),this}}},4842:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208);i.RootBitType.setMetadata(i.RootBitType._error,{tags:{},resourceAttachmentAllowed:!1,bodyAllowed:!0})},7537:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(9881),o=r(208),s=r(7028),n=r(4719),a=r(6562),l=r(5319),u=r(6027);o.RootBitType.setMetadata(o.RootBitType.appFlashcards,{tags:Object.assign(Object.assign(Object.assign({},u.TAGS_DEFAULT),{[a.TagType.Title]:{},[n.PropertyKey.flashcardSet]:{isProperty:!0,maxCount:i.INFINITE_COUNT}}),l.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:s.ExampleType.string})},3616:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.appLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_APP_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.appLink,bodyAllowed:!1})},4373:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.article,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),{[o.TagType.Title]:{}}),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},2773:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.articleEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ARTICLE_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.articleEmbed,bodyAllowed:!0})},6360:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.articleLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ARTICLE_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.articleLink,bodyAllowed:!0})},6246:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.audio,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_AUDIO_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.audio,bodyAllowed:!0})},9309:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.audioEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_AUDIO_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.audioEmbed,bodyAllowed:!0})},591:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.audioLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_AUDIO_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.audioLink,bodyAllowed:!0})},3851:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.bitAlias,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.TagType.Reference]:{},[o.TagType.Anchor]:{}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},980:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(9881),o=r(208),s=r(4719),n=r(6562),a=r(6027);o.RootBitType.setMetadata(o.RootBitType.book,{tags:Object.assign(Object.assign({},a.TAGS_DEFAULT),{[s.PropertyKey.spaceId]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[n.TagType.Title]:{maxCount:2},[s.PropertyKey.subtype]:{isProperty:!0},[s.PropertyKey.coverImage]:{isProperty:!0},[s.PropertyKey.publisher]:{isProperty:!0},[s.PropertyKey.subject]:{isProperty:!0},[s.PropertyKey.author]:{isProperty:!0},[s.PropertyKey.theme]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},8788:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.botActionResponse,{tags:Object.assign({},s.TAGS_DEFAULT),resourceAttachmentAllowed:!1,cardSet:o.CARD_SET_BOT_ACTION_RESPONSES,bodyAllowed:!0,footerAllowed:!0})},1:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.botActionSend,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.PropertyKey.date]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},7386:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(1895),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.browserImage,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_IMAGE_RESOURCE),{[o.PropertyKey.focusX]:{isProperty:!0},[o.PropertyKey.focusY]:{isProperty:!0}}),resourceAttachmentAllowed:!1,resourceType:s.ResourceType.image,bodyAllowed:!0})},4865:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(5319),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.card1,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},3890:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.chapter,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.TagType.Anchor]:{},[o.TagType.Title]:{}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},3707:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.clozeAndMultipleChoiceText,{tags:Object.assign(Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),o.TAGS_CHAIN_GAP),o.TAGS_CHAIN_TRUE_FALSE),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},2585:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027),a={tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),o.TAGS_CHAIN_GAP),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0};i.RootBitType.setMetadata(i.RootBitType.cloze,a)},8161:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.code,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.PropertyKey.computerLanguage]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},5912:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.conversationLeft1,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),o.TAGS_CHAIN_PARTNER),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},8305:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.document,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_DOCUMENT_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.document,bodyAllowed:!0})},2438:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.documentDownload,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_DOCUMENT_DOWNLOAD_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.documentDownload,bodyAllowed:!0})},5983:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.documentEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_DOCUMENT_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.documentEmbed,bodyAllowed:!0})},1363:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.documentLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_DOCUMENT_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.documentLink,bodyAllowed:!0})},1934:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(7028),s=r(4719),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.essay,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),{[s.PropertyKey.sampleSolution]:{isProperty:!0}}),resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:o.ExampleType.string})},4954:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(7028),s=r(6562),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.example,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),{[s.TagType.Title]:{}}),n.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:o.ExampleType.string})},8157:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.flashcard,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:o.CARD_SET_FLASHCARDS,bodyAllowed:!0,footerAllowed:!0})},8253:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(1895),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.focusImage,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_IMAGE_RESOURCE),{[o.PropertyKey.focusX]:{isProperty:!0},[o.PropertyKey.focusY]:{isProperty:!0}}),resourceAttachmentAllowed:!1,resourceType:s.ResourceType.image,bodyAllowed:!0})},1614:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARD_SET_BOT_ACTION_RESPONSES=t.CARD_SET_MATCH_MATRIX=t.CARD_SET_MATCH_IMAGE_PAIRS=t.CARD_SET_MATCH_AUDIO_PAIRS=t.CARD_SET_MATCH_PAIRS=t.CARD_SET_QUESTIONS=t.CARD_SET_QUIZ=t.CARD_SET_STATEMENTS=t.CARD_SET_ELEMENTS=t.CARD_SET_FLASHCARDS=void 0;const i=r(7210),o=r(4719),s=r(1895),n=r(6562),a=r(781),l=r(6027),u={type:i.CardSetType.flashcards,variants:[[{tags:Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_FLASHCARDS=u;const c={type:i.CardSetType.elements,variants:[[{tags:Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_ELEMENTS=c;const d={type:i.CardSetType.statements,variants:[[{tags:Object.assign(Object.assign({[n.TagType.True]:{maxCount:1},[n.TagType.False]:{maxCount:1}},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE)}]]};t.CARD_SET_STATEMENTS=d;const p={type:i.CardSetType.quiz,variants:[[{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_CHAIN_TRUE_FALSE),l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE)}]]};t.CARD_SET_QUIZ=p;const h={type:i.CardSetType.questions,variants:[[{tags:Object.assign(Object.assign({[n.TagType.SampleSolution]:{},[o.PropertyKey.sampleSolution]:{isProperty:!0},[o.PropertyKey.shortAnswer]:{isProperty:!0}},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),bodyAllowed:!0}]]};t.CARD_SET_QUESTIONS=h;const y={type:i.CardSetType.matchPairs,variants:[[{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),{[n.TagType.Title]:{}}),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_MATCH_PAIRS=y;const m={type:i.CardSetType.matchPairs,variants:[[{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),{[n.TagType.Title]:{},[s.ResourceType.audio]:{isResource:!0}}),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_MATCH_AUDIO_PAIRS=m;const g={type:i.CardSetType.matchPairs,variants:[[{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),{[n.TagType.Title]:{},[s.ResourceType.image]:{isResource:!0}}),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_MATCH_IMAGE_PAIRS=g;const f={type:i.CardSetType.matchMatrix,variants:[[{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),{[n.TagType.Title]:{}}),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_MATCH_MATRIX=f;const b={type:i.CardSetType.botActionResponses,variants:[[{tags:Object.assign(Object.assign({[o.PropertyKey.reaction]:{isProperty:!0}},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),bodyAllowed:!0}]]};t.CARD_SET_BOT_ACTION_RESPONSES=b},781:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS_CHAIN_MARK=t.TAGS_CHAIN_MARK_CONFIG=t.TAGS_CHAIN_TRUE_FALSE=t.TAGS_CHAIN_GAP=t.TAGS_CHAIN_PARTNER=t.TAGS_CHAIN_IMAGE_SOURCE=void 0;const i=r(9881),o=r(4719),s=r(6562),n=r(5319),a=r(6027),l={[o.PropertyKey.imageSource]:{isProperty:!0,chain:{[o.PropertyKey.mockupId]:{isProperty:!0},[o.PropertyKey.size]:{isProperty:!0},[o.PropertyKey.format]:{isProperty:!0},[o.PropertyKey.trim]:{isProperty:!0}}}};t.TAGS_CHAIN_IMAGE_SOURCE=l;const u={[o.PropertyKey.partner]:{isProperty:!0,chain:Object.assign({},n.TAGS_CHAIN_IMAGE_RESOURCE)}};t.TAGS_CHAIN_PARTNER=u;const c={[s.TagType.Gap]:{maxCount:i.INFINITE_COUNT,chain:Object.assign(Object.assign({[s.TagType.Gap]:{maxCount:i.INFINITE_COUNT}},a.TAGS_ITEM_LEAD_INSTRUCTION_HINT),a.TAGS_PROPERTY_EXAMPLE)}};t.TAGS_CHAIN_GAP=c;const d={[s.TagType.True]:{maxCount:i.INFINITE_COUNT,chain:Object.assign(Object.assign({[s.TagType.True]:{maxCount:i.INFINITE_COUNT},[s.TagType.False]:{maxCount:i.INFINITE_COUNT}},a.TAGS_ITEM_LEAD_INSTRUCTION_HINT),a.TAGS_PROPERTY_EXAMPLE)},[s.TagType.False]:{maxCount:i.INFINITE_COUNT,chain:Object.assign(Object.assign({[s.TagType.True]:{maxCount:i.INFINITE_COUNT},[s.TagType.False]:{maxCount:i.INFINITE_COUNT}},a.TAGS_ITEM_LEAD_INSTRUCTION_HINT),a.TAGS_PROPERTY_EXAMPLE)}};t.TAGS_CHAIN_TRUE_FALSE=d;const p={[o.PropertyKey.mark]:{isProperty:!0,maxCount:i.INFINITE_COUNT,chain:{[o.PropertyKey.color]:{isProperty:!0},[o.PropertyKey.emphasis]:{isProperty:!0}}}};t.TAGS_CHAIN_MARK_CONFIG=p;const h={[s.TagType.Mark]:{maxCount:i.INFINITE_COUNT,chain:Object.assign({[o.PropertyKey.mark]:{isProperty:!0}},a.TAGS_PROPERTY_EXAMPLE)}};t.TAGS_CHAIN_MARK=h},5319:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS_CHAIN_ANY_RESOURCE=t.TAGS_CHAIN_WEBSITE_LINK_RESOURCE=t.TAGS_CHAIN_APP_LINK_RESOURCE=t.TAGS_CHAIN_DOCUMENT_DOWNLOAD_RESOURCE=t.TAGS_CHAIN_DOCUMENT_LINK_RESOURCE=t.TAGS_CHAIN_DOCUMENT_EMBED_RESOURCE=t.TAGS_CHAIN_DOCUMENT_RESOURCE=t.TAGS_CHAIN_ARTICLE_LINK_RESOURCE=t.TAGS_CHAIN_ARTICLE_EMBED_RESOURCE=t.TAGS_CHAIN_ARTICLE_RESOURCE=t.TAGS_CHAIN_STILL_IMAGE_FILM_LINK_RESOURCE=t.TAGS_CHAIN_STILL_IMAGE_FILM_EMBED_RESOURCE=t.TAGS_CHAIN_STILL_IMAGE_FILM_RESOURCE=t.TAGS_CHAIN_VIDEO_LINK_RESOURCE=t.TAGS_CHAIN_VIDEO_EMBED_RESOURCE=t.TAGS_CHAIN_VIDEO_RESOURCE=t.TAGS_CHAIN_AUDIO_LINK_RESOURCE=t.TAGS_CHAIN_AUDIO_EMBED_RESOURCE=t.TAGS_CHAIN_AUDIO_RESOURCE=t.TAGS_CHAIN_IMAGE_RESPONSIVE_RESOURCE=t.TAGS_CHAIN_IMAGE_LINK_RESOURCE=t.TAGS_CHAIN_IMAGE_EMBED_RESOURCE=t.TAGS_CHAIN_IMAGE_RESOURCE=void 0;const i=r(4719),o=r(1895),s={[i.PropertyKey.license]:{isProperty:!0},[i.PropertyKey.copyright]:{isProperty:!0},[i.PropertyKey.caption]:{isProperty:!0},[i.PropertyKey.showInIndex]:{isProperty:!0}},n=Object.assign(Object.assign({},s),{[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0},[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0}}),a={[o.ResourceType.image]:{isResource:!0,chain:Object.assign({},n)}};t.TAGS_CHAIN_IMAGE_RESOURCE=a;const l={[o.ResourceType.imageEmbed]:{isResource:!0,chain:Object.assign({},n)}};t.TAGS_CHAIN_IMAGE_EMBED_RESOURCE=l;const u={[o.ResourceType.imageLink]:{isResource:!0,chain:Object.assign({},n)}};t.TAGS_CHAIN_IMAGE_LINK_RESOURCE=u;const c={[o.ResourceType.imagePortrait]:{isResource:!0,chain:Object.assign({},n)},[o.ResourceType.imageLandscape]:{isResource:!0,chain:Object.assign({},n)}};t.TAGS_CHAIN_IMAGE_RESPONSIVE_RESOURCE=c;const d=Object.assign(Object.assign({},s),{[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0}}),p={[o.ResourceType.audio]:{isResource:!0,chain:Object.assign({},d)}};t.TAGS_CHAIN_AUDIO_RESOURCE=p;const h={[o.ResourceType.audioEmbed]:{isResource:!0,chain:Object.assign({},d)}};t.TAGS_CHAIN_AUDIO_EMBED_RESOURCE=h;const y={[o.ResourceType.audioLink]:{isResource:!0,chain:Object.assign({},d)}};t.TAGS_CHAIN_AUDIO_LINK_RESOURCE=y;const m=Object.assign(Object.assign({},s),{[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0},[i.PropertyKey.allowSubtitles]:{isProperty:!0},[i.PropertyKey.showSubtitles]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0},[i.PropertyKey.posterImage]:{isProperty:!0},[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0}}),g={[o.ResourceType.video]:{isResource:!0,chain:Object.assign({},m)}};t.TAGS_CHAIN_VIDEO_RESOURCE=g;const f={[o.ResourceType.videoEmbed]:{isResource:!0,chain:Object.assign({},m)}};t.TAGS_CHAIN_VIDEO_EMBED_RESOURCE=f;const b={[o.ResourceType.videoLink]:{isResource:!0,chain:Object.assign({},m)}};t.TAGS_CHAIN_VIDEO_LINK_RESOURCE=b;const v={[o.ResourceType.image]:{isResource:!0,chain:Object.assign({},n)},[o.ResourceType.audio]:{isResource:!0,chain:Object.assign({},d)}};t.TAGS_CHAIN_STILL_IMAGE_FILM_RESOURCE=v;const T={[o.ResourceType.stillImageFilmEmbed]:{isResource:!0,chain:Object.assign({},m)}};t.TAGS_CHAIN_STILL_IMAGE_FILM_EMBED_RESOURCE=T;const A={[o.ResourceType.stillImageFilmLink]:{isResource:!0,chain:Object.assign({},m)}};t.TAGS_CHAIN_STILL_IMAGE_FILM_LINK_RESOURCE=A;const _={[o.ResourceType.article]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_ARTICLE_RESOURCE=_;const P={[o.ResourceType.articleEmbed]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_ARTICLE_EMBED_RESOURCE=P;const S={[o.ResourceType.articleLink]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_ARTICLE_LINK_RESOURCE=S;const x={[o.ResourceType.document]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_DOCUMENT_RESOURCE=x;const w={[o.ResourceType.documentEmbed]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_DOCUMENT_EMBED_RESOURCE=w;const R={[o.ResourceType.documentLink]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_DOCUMENT_LINK_RESOURCE=R;const O={[o.ResourceType.documentDownload]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_DOCUMENT_DOWNLOAD_RESOURCE=O;const k={[o.ResourceType.appLink]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_APP_LINK_RESOURCE=k;const C={[o.ResourceType.websiteLink]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.siteName]:{isProperty:!0}})}};t.TAGS_CHAIN_WEBSITE_LINK_RESOURCE=C;const E=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),l),u),c),p),h),y),g),f),b),v),T),A),_),P),S),x),w),R),O),k),C);t.TAGS_CHAIN_ANY_RESOURCE=E},6027:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS_PROPERTY_EXAMPLE=t.TAGS_ITEM_LEAD_INSTRUCTION_HINT=t.TAGS_ALL_BITS=t.TAGS_DEFAULT=void 0;const i=r(9881),o=r(4719),s=r(6562),n={[o.PropertyKey.id]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.externalId]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.aiGenerated]:{isProperty:!0},[o.PropertyKey.ageRange]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.language]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.target]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.tag]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.icon]:{isProperty:!0},[o.PropertyKey.iconTag]:{isProperty:!0},[o.PropertyKey.colorTag]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[s.TagType.Anchor]:{}};t.TAGS_ALL_BITS=n;const a={[s.TagType.ItemLead]:{maxCount:2},[s.TagType.Instruction]:{},[s.TagType.Hint]:{}};t.TAGS_ITEM_LEAD_INSTRUCTION_HINT=a;const l={[o.PropertyKey.example]:{isProperty:!0}};t.TAGS_PROPERTY_EXAMPLE=l;const u=Object.assign(Object.assign(Object.assign({},n),a),l);t.TAGS_DEFAULT=u},1559:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.highlightText,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),o.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},5046:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.image,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.image,bodyAllowed:!0})},76:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.imageLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.imageLink,bodyAllowed:!0})},1193:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(781),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.imageOnDevice,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_IMAGE_RESOURCE),s.TAGS_CHAIN_IMAGE_SOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.image,resourceOptional:!0,bodyAllowed:!0})},2664:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.imageResponsive,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_RESPONSIVE_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.imageResponsive,bodyAllowed:!0})},4861:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.internalLink,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.TagType.Reference]:{}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},2161:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.interview,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:o.CARD_SET_QUESTIONS,bodyAllowed:!0,footerAllowed:!0})},9338:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(9881),o=r(208),s=r(4719),n=r(6562),a=r(5319),l=r(6027),u={[s.PropertyKey.action]:{isProperty:!0},[s.PropertyKey.duration]:{isProperty:!0},[s.PropertyKey.date]:{isProperty:!0},[s.PropertyKey.location]:{isProperty:!0},[s.PropertyKey.list]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[s.PropertyKey.textReference]:{isProperty:!0},[s.PropertyKey.isTracked]:{isProperty:!0},[s.PropertyKey.isInfoOnly]:{isProperty:!0},[s.PropertyKey.book]:{isProperty:!0,chain:{[n.TagType.Reference]:{maxCount:2}}}};o.RootBitType.setMetadata(o.RootBitType.learningPathBook,{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_DEFAULT),a.TAGS_CHAIN_ANY_RESOURCE),u),resourceAttachmentAllowed:!0,bodyAllowed:!0}),o.RootBitType.setMetadata(o.RootBitType.learningPathExternalLink,{tags:Object.assign(Object.assign(Object.assign(Object.assign({},l.TAGS_DEFAULT),a.TAGS_CHAIN_ANY_RESOURCE),u),{[s.PropertyKey.externalLink]:{isProperty:!0},[s.PropertyKey.externalLinkText]:{isProperty:!0}}),resourceAttachmentAllowed:!0,bodyAllowed:!0}),o.RootBitType.setMetadata(o.RootBitType.learningPathVideoCall,{tags:Object.assign(Object.assign(Object.assign(Object.assign({},l.TAGS_DEFAULT),a.TAGS_CHAIN_ANY_RESOURCE),u),{[s.PropertyKey.videoCallLink]:{isProperty:!0}}),resourceAttachmentAllowed:!0,bodyAllowed:!0})},700:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.mark,{tags:Object.assign(Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),o.TAGS_CHAIN_MARK_CONFIG),o.TAGS_CHAIN_MARK),resourceAttachmentAllowed:!0,bodyAllowed:!0})},8371:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(5319),s=r(6027),n=r(1614);i.RootBitType.setMetadata(i.RootBitType.match,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:n.CARD_SET_MATCH_PAIRS,bodyAllowed:!0,footerAllowed:!0}),i.RootBitType.setMetadata(i.RootBitType.matchMatrix,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:n.CARD_SET_MATCH_MATRIX,bodyAllowed:!0,footerAllowed:!0}),i.RootBitType.setMetadata(i.RootBitType.matchAudio,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:n.CARD_SET_MATCH_AUDIO_PAIRS,bodyAllowed:!0,footerAllowed:!0}),i.RootBitType.setMetadata(i.RootBitType.matchPicture,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:n.CARD_SET_MATCH_IMAGE_PAIRS,bodyAllowed:!0,footerAllowed:!0})},5730:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleChoice1,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),o.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},3947:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(781),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleChoice,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),s.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,cardSet:o.CARD_SET_QUIZ,bodyAllowed:!0,footerAllowed:!0})},9745:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleChoiceText,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),o.TAGS_CHAIN_TRUE_FALSE),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},2033:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleResponse1,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),o.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},9780:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(781),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleResponse,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),s.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,cardSet:o.CARD_SET_QUIZ,bodyAllowed:!0,footerAllowed:!0})},8801:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.photo,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.image,bodyAllowed:!0})},4446:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.quote,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.PropertyKey.quotedPerson]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},1417:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6027);i.RootBitType.setMetadata(i.RootBitType.rating,{tags:Object.assign({},o.TAGS_DEFAULT),resourceAttachmentAllowed:!1,bodyAllowed:!0})},5309:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.releaseNote,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),{[o.PropertyKey.releaseVersion]:{isProperty:!0}}),resourceAttachmentAllowed:!0,bodyAllowed:!0})},543:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.sampleSolution,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),{[o.TagType.Anchor]:{},[o.TagType.Reference]:{}}),resourceAttachmentAllowed:!0,bodyAllowed:!0})},149:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.screenshot,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.image,bodyAllowed:!0})},9330:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(7028),s=r(1614),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.sequence,{tags:Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:s.CARD_SET_ELEMENTS,bodyAllowed:!0,footerAllowed:!0,rootExampleType:o.ExampleType.boolean})},3983:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.stillImageFilm,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_STILL_IMAGE_FILM_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.stillImageFilm,bodyAllowed:!0})},7030:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.stillImageFilmEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_STILL_IMAGE_FILM_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.stillImageFilmEmbed,bodyAllowed:!0})},2527:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.stillImageFilmLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_STILL_IMAGE_FILM_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.stillImageFilmLink,bodyAllowed:!0})},8388:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(5319),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.surveyAnonymous,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},8424:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(5319),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.survey,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},4157:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6027);i.RootBitType.setMetadata(i.RootBitType.toc,{tags:Object.assign({},o.TAGS_DEFAULT),resourceAttachmentAllowed:!1,bodyAllowed:!0})},3194:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(7028),s=r(4719),n=r(6562),a=r(5319),l=r(6027);i.RootBitType.setMetadata(i.RootBitType.trueFalse1,{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_DEFAULT),a.TAGS_CHAIN_ANY_RESOURCE),{[s.PropertyKey.labelTrue]:{isProperty:!0},[s.PropertyKey.labelFalse]:{isProperty:!0},[n.TagType.True]:{},[n.TagType.False]:{}}),resourceAttachmentAllowed:!0,bodyAllowed:!1,rootExampleType:o.ExampleType.boolean})},4238:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(1614),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.trueFalse,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),{[o.PropertyKey.labelTrue]:{isProperty:!0},[o.PropertyKey.labelFalse]:{isProperty:!0}}),resourceAttachmentAllowed:!0,cardSet:s.CARD_SET_STATEMENTS,bodyAllowed:!0,footerAllowed:!0})},9755:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.vendorPadletEmbed,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.PropertyKey.padletId]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},5297:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.video,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_VIDEO_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.video,bodyAllowed:!0})},2787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.videoEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_VIDEO_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.videoEmbed,bodyAllowed:!0})},7159:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.videoLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_VIDEO_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.videoLink,bodyAllowed:!0})},1703:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.websiteLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_WEBSITE_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.websiteLink,bodyAllowed:!0})},2093:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),r(4842),r(7537),r(3616),r(4373),r(2773),r(6360),r(6246),r(9309),r(591),r(3851),r(980),r(8788),r(1),r(7386),r(4865),r(3890),r(3707),r(2585),r(8161),r(5912),r(8305),r(2438),r(5983),r(1363),r(1934),r(4954),r(8157),r(8253),r(1559),r(5046),r(76),r(1193),r(2664),r(4861),r(2161),r(9338),r(700),r(8371),r(5730),r(3947),r(9745),r(2033),r(9780),r(8801),r(4446),r(1417),r(5309),r(543),r(149),r(9330),r(3983),r(7030),r(2527),r(8388),r(8424),r(4157),r(3194),r(4238),r(9755),r(5297),r(2787),r(7159),r(1703),r(5595),r(6138),r(7243),r(1197),r(3828),r(9787),r(3728),r(3589),r(460),r(3544),r(4681),r(9678),r(4303),r(5805),r(8634),r(5158),r(374),r(9851),r(9551),r(2853),r(1128),r(6514),r(9546),r(2347),r(1802),r(9251),r(6263),r(6321),r(3904),r(7582),r(209),r(2737),r(5243),r(1285),r(6367),r(7443),r(4245),r(5635),r(8558),r(8856),r(2786),r(2375),r(8699),r(6667),r(7538),r(4648),r(9448),r(1500),r(759),r(8e3),r(2706),r(5044),r(5820),r(1502),r(3477),r(7882),r(5175),r(5804),r(2675),r(9404),r(6625),r(3908),r(757),r(3739),r(2891)},5595:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.action,{isSingle:!0,isTrimmedString:!0})},6138:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.ageRange,{isTrimmedString:!0})},7243:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.aiGenerated,{astKey:"aiGenerated",isSingle:!0,isBoolean:!0})},1197:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.author,{isTrimmedString:!0})},3828:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.book,{isTrimmedString:!0,isSingle:!0})},9787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.bot,{})},3728:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.caseSensitive,{isSingle:!0,isBoolean:!0,astKey:"isCaseSensitive",jsonKey:"isCaseSensitive"})},3589:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.color,{isSingle:!0,isTrimmedString:!0})},460:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.colorTag,{isTrimmedString:!0})},3544:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.computerLanguage,{isSingle:!0,isTrimmedString:!0})},4681:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.coverImage,{isTrimmedString:!0})},9678:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.date,{isSingle:!0})},4303:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.deeplink,{isTrimmedString:!0})},5805:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.duration,{isSingle:!0,isTrimmedString:!0})},8634:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.example,{isSingle:!0})},5158:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.externalId,{isTrimmedString:!0})},374:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.externalLink,{isSingle:!0,isTrimmedString:!0})},9851:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.externalLinkText,{isSingle:!0,isTrimmedString:!0})},9551:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.flashcardSet,{isTrimmedString:!0})},2853:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.focusX,{isSingle:!0,isNumber:!0})},1128:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.focusY,{isSingle:!0,isNumber:!0})},6514:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.format,{isSingle:!0,isTrimmedString:!0})},9546:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.icon,{isSingle:!0,isTrimmedString:!0})},2347:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.iconTag,{isSingle:!0,isTrimmedString:!0})},1802:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.id,{isTrimmedString:!0})},9251:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.imageSource,{isSingle:!0,isTrimmedString:!0})},6263:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.emphasis,{isSingle:!0,isTrimmedString:!0})},6321:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.isInfoOnly,{isSingle:!0,isBoolean:!0})},3904:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.isTracked,{isSingle:!0,isBoolean:!0})},7582:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.kind,{isSingle:!0,isTrimmedString:!0})},209:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.labelFalse,{isSingle:!0,isTrimmedString:!0})},2737:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.labelTrue,{isSingle:!0,isTrimmedString:!0})},5243:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.language,{isTrimmedString:!0})},1285:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.level,{isSingle:!0,astKey:"levelProperty"})},6367:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.list,{isTrimmedString:!0})},7443:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.location,{isSingle:!0,isTrimmedString:!0})},4245:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.longAnswer,{isSingle:!0,isInvertedBoolean:!0,astKey:"isShortAnswer",jsonKey:"isShortAnswer"})},5635:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.mark,{isTrimmedString:!0})},8558:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.mockupId,{isSingle:!0,isTrimmedString:!0})},8856:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.padletId,{isTrimmedString:!0,isSingle:!0})},2786:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.partialAnswer,{isSingle:!0,isTrimmedString:!0})},2375:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.partner,{isTrimmedString:!0,isSingle:!0})},8699:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.progress,{isSingle:!0,isBoolean:!0,ignoreTrue:!0})},6667:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.publications,{isTrimmedString:!0})},7538:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.publisher,{isTrimmedString:!0})},4648:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.quotedPerson,{isSingle:!0,isTrimmedString:!0})},9448:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.reaction,{isSingle:!0,isTrimmedString:!0})},1500:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.reference,{isSingle:!1,isTrimmedString:!0,astKey:"referenceProperty"})},759:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.releaseVersion,{isTrimmedString:!0,isSingle:!0})},8e3:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.width,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.height,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.license,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.copyright,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.caption,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.showInIndex,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.alt,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.src1x,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.src2x,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.src3x,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.src4x,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.mute,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.autoplay,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.allowSubtitles,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.showSubtitles,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.siteName,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.posterImage,{isSingle:!0,isTrimmedString:!0})},2706:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.sampleSolution,{isSingle:!0,isTrimmedString:!0})},5044:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.shortAnswer,{isSingle:!0,isBoolean:!0,astKey:"isShortAnswer",jsonKey:"isShortAnswer"})},5820:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.size,{isSingle:!0,isNumber:!0})},1502:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.spaceId,{isTrimmedString:!0})},3477:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.subject,{isTrimmedString:!0})},7882:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.subtype,{isSingle:!0,isTrimmedString:!0})},5175:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.tag,{isTrimmedString:!0})},5804:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.target,{isTrimmedString:!0})},2675:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.textReference,{isSingle:!0,isTrimmedString:!0})},9404:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.theme,{isTrimmedString:!0})},6625:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.thumbImage,{isSingle:!0,isTrimmedString:!0})},3908:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.toc,{isSingle:!0,isBoolean:!0,ignoreTrue:!0})},757:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.trim,{isSingle:!0,isBoolean:!0})},3739:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.type,{isSingle:!0,isTrimmedString:!0})},2891:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.videoCallLink,{isSingle:!0,isTrimmedString:!0})},1022:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildInfo=void 0,t.buildInfo={name:"@gmb/bitmark-parser-generator",version:"1.2.4",author:"Richard Sewell",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),s=r(7448);function n(e,t,r,i){var o=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(o,n.prototype),o.expected=t,o.found=r,o.location=i,o.name="SyntaxError",o}function a(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}t.SyntaxError=n,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(n,Error),n.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){i=e[r].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,s=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,n=this.location.source+":"+s.line+":"+s.column;if(i){var l=this.location.end,u=a("",s.line.toString().length," "),c=i[o.line-1],d=(o.line===l.line?l.column:c.length+1)-o.column||1;t+="\n --\x3e "+n+"\n"+u+" |\n"+s.line+" | "+c+"\n"+u+" | "+a("",o.column-1," ")+a("",d,"^")}else t+="\n at "+n}return t},n.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?s(e[0])+"-"+s(e[1]):s(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function i(e){return e.charCodeAt(0).toString(16).toUpperCase()}function o(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function s(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function n(e){return r[e.type](e)}return"Expected "+function(e){var t,r,i=e.map(n);if(i.sort(),i.length>0){for(t=1,r=1;t<i.length;t++)i[t-1]!==i[t]&&(i[r]=i[t],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(e)+" but "+function(e){return e?'"'+o(e)+'"':"end of input"}(t)+" found."},t.parse=function e(t,r){var a,l={},u=(r=void 0!==r?r:{}).grammarSource,c={bitmark:sr,bit:function(){var e,t,r,i,o;e=$t,t=[],r=kr();for(;r!==l;)t.push(r),r=kr();if((r=lr())!==l){for(i=[],o=kr();o!==l;)i.push(o),o=kr();qt=e,e=We(r)}else $t=e,e=l;return e},cardContent:function(){var e,t,r;e=$t,t=[],(r=pr())===l&&(r=Tr());for(;r!==l;)t.push(r),(r=pr())===l&&(r=Tr());return qt=e,t=vt(t),e=t}},d=sr,p="[.",h="]",y=":",m="&",g="====",f="~~~~",b="--",v="++",T="===",A="==",_="[@id",P="[",S="#",x="[▼",w="[►",R="[@",O="[%",k="[!",C="[?",E="[+",I="[-",j="[$",B="[_",L="[=",N="[&",M="::",U="||",D="id:",V="\n",K="\r\n",F="\r",G="\u2028",H="\u2029",$=/^[^\]]/,q=/^[^:\]]/,J=/^[^&:\]]/,z=/^[ \t]/,W=/^[^\n\r\u2028\u2029]/,Y=/^[ \t\n\r\u2028\u2029]/,X=Qt("[.",!1),Q=Zt(["]"],!0,!1),Z=Qt("]",!1),ee=Qt(":",!1),te=Qt("&",!1),re={type:"any"},ie=Qt("====",!1),oe=Qt("~~~~",!1),se=Qt("--",!1),ne=Qt("++",!1),ae=Qt("===",!1),le=Qt("==",!1),ue=Qt("[@id",!1),ce=Qt("[",!1),de=Qt("#",!1),pe=Qt("[▼",!1),he=Qt("[►",!1),ye=Qt("[@",!1),me=Qt("[%",!1),ge=Qt("[!",!1),fe=Qt("[?",!1),be=Qt("[+",!1),ve=Qt("[-",!1),Te=Qt("[$",!1),Ae=Qt("[_",!1),_e=Qt("[=",!1),Pe=Qt("[&",!1),Se=Qt("::",!1),xe=Qt("||",!1),we=Qt("id:",!1),Re=Zt([":","]"],!0,!1),Oe=Zt(["&",":","]"],!0,!1),ke=(er("Empty"),Zt([" ","\t"],!1,!1)),Ce=er("Anything"),Ee=er("Character"),Ie=Zt(["\n","\r","\u2028","\u2029"],!0,!1),je=er("Line"),Be=(er("whitespace in line"),er("Blank Line")),Le=er("Line Terminator"),Ne=Qt("\n",!1),Me=Qt("\r\n",!1),Ue=Qt("\r",!1),De=Qt("\u2028",!1),Ve=Qt("\u2029",!1),Ke=er("Whitespace, then Line Terminator"),Fe=er("whitespace"),Ge=Zt([" ","\t","\n","\r","\u2028","\u2029"],!1,!1),He=function(e,t){return Nr.buildBits([e,...t])},$e=function(e){return Lr.handleRawBit(e)},qe=function(e){return e},Je=function(e){return Lr.handleRawBit(e)},ze=function(e){return e},We=function(e){return e},Ye=function(e,t){return Nr.buildBit(e,t)},Xe=function(e){return Nr.invalidBit(e)},Qe=function(e,t){return Nr.buildBitHeader(e,t)},Ze=function(e,t){return Nr.buildTextAndResourceType(e,t)},et=function(e){return Lr.handleTextFormat(e)},tt=function(e){return Lr.handleResourceType(e)},rt=function(e){return Lr.handleBitContent(e)},it=function(e){return Lr.handleTagChain(e)},ot=function(e){return e},st=function(e){return Lr.handleBitTag(e)},nt=function(e){return{type:i.TypeKey.BodyChar,value:e}},at=function(e){return Lr.handleCardSet(e[1].flat())},lt=function(){Lr.handleCardSetStart()},ut=function(){Lr.handleCardSetEnd()},ct=function(e){return Lr.handleCards(e)},dt=function(e){return Lr.handleCardLineOrDivider(e,2)},pt=function(e){return Lr.handleCardLine(e)},ht=function(e){return Lr.handleCardSet(e[1].flat())},yt=function(){Lr.handleCardSetStart()},mt=function(){Lr.handleCardSetEnd()},gt=function(e){return Lr.handleCards(e)},ft=function(e){return Lr.handleCardLineOrDivider(e,1)},bt=function(e){return Lr.handleCardLine(e)},vt=function(e){return Lr.handleCardContent(e)},Tt=function(e){return{type:i.TypeKey.CardChar,value:e}},At=function(e){return Lr.handlePropertyTag("id",e)},_t=function(e,t){return Lr.handleTag(i.TypeKey.Title,{level:e,title:t})},Pt=function(e){return Lr.handleTag(i.TypeKey.Anchor,e)},St=function(e){return Lr.handleTag(i.TypeKey.Reference,e)},xt=function(e,t){return Lr.handlePropertyTag(e,t)},wt=function(e){return Lr.handleTag(i.TypeKey.ItemLead,e)},Rt=function(e){return Lr.handleTag(i.TypeKey.Instruction,e)},Ot=function(e){return Lr.handleTag(i.TypeKey.Hint,e)},kt=function(e){return Lr.handleTag(i.TypeKey.True,e)},Ct=function(e){return Lr.handleTag(i.TypeKey.False,e)},Et=function(e){return Lr.handleTag(i.TypeKey.SampleSolution,e)},It=function(e){return Lr.handleTag(i.TypeKey.Gap,e)},jt=function(e){return Lr.handleTag(i.TypeKey.Mark,e)},Bt=function(e,t){return Lr.handleResourceTag(e,t)},Lt=function(e){return Lr.handleTag(i.TypeKey.BodyText,e)},Nt=function(e){return Lr.handleTag(i.TypeKey.Comment,e)},Mt=function(e){return e},Ut=function(e){return e?e.trim():""},Dt=function(e){return e?e.trim():null},Vt=function(e){return e?e.trim():""},Kt=function(){return!0},Ft=function(e){return e},Gt=function(e){return e},Ht=function(e){return e},$t=0,qt=0,Jt=[{line:1,column:1}],zt=0,Wt=[],Yt=0;if("startRule"in r){if(!(r.startRule in c))throw new Error("Can't start parsing from rule \""+r.startRule+'".');d=c[r.startRule]}function Xt(){return t.substring(qt,$t)}function Qt(e,t){return{type:"literal",text:e,ignoreCase:t}}function Zt(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function er(e){return{type:"other",description:e}}function tr(e){var r,i=Jt[e];if(i)return i;for(r=e-1;!Jt[r];)r--;for(i={line:(i=Jt[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return Jt[e]=i,i}function rr(e,t,r){var i=tr(e),o=tr(t),s={source:u,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:o.line,column:o.column}};return r&&u&&"function"==typeof u.offset&&(s.start=u.offset(s.start),s.end=u.offset(s.end)),s}function ir(e){$t<zt||($t>zt&&(zt=$t,Wt=[]),Wt.push(e))}function or(e,t,r){return new n(n.buildMessage(e,t),e,t,r)}function sr(){return function(){var e,r,i,o;e=$t,r=[],(i=Ir())===l&&(i=Ar());for(;i!==l;)r.push(i),(i=Ir())===l&&(i=Ar());return i=function(){var e,r,i,o;e=$t,r=$t,i=[],o=ar();for(;o!==l;)i.push(o),o=ar();return r=t.substring(r,$t),qt=e,r=$e(r),e=r,e}(),o=function(){var e,t;e=[],t=nr();for(;t!==l;)e.push(t),t=nr();return e}(),qt=e,e=He(i,o),e}()}function nr(){var e,r,i,o;for(e=$t,r=[],i=kr();i!==l;)r.push(i),i=kr();return(i=Cr())===l&&(i=null),o=function(){var e,r,i,o,s,n;if(e=$t,r=$t,i=$t,o=function(){var e,r,i,o;e=$t,t.substr($t,2)===p?(r=p,$t+=2):(r=l,0===Yt&&ir(X));if(r!==l){for(i=[],$.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Q));o!==l;)i.push(o),$.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Q));93===t.charCodeAt($t)?(o=h,$t++):(o=l,0===Yt&&ir(Z)),o!==l?(qt=e,e=ze(r)):($t=e,e=l)}else $t=e,e=l;return e}(),o!==l){for(s=[],n=ar();n!==l;)s.push(n),n=ar();i=o=[o,s]}else $t=i,i=l;r=i!==l?t.substring(r,$t):i;r!==l&&(qt=e,r=Je(r));return e=r,e}(),o!==l?(qt=e,e=qe(o)):($t=e,e=l),e}function ar(){var e,t,r,i;if(e=$t,(t=Cr())!==l?(r=$t,Yt++,i=ur(),Yt--,i===l?r=void 0:($t=r,r=l),r!==l?e=t=[t,r]:($t=e,e=l)):($t=e,e=l),e===l)if(e=[],(t=Rr())!==l)for(;t!==l;)e.push(t),t=Rr();else e=l;return e}function lr(){var e,r,i;return e=$t,(r=ur())!==l?(i=function(){var e,t,r;e=$t,t=[],r=gr(),r===l&&(r=br())===l&&(r=pr())===l&&(r=mr());for(;r!==l;)t.push(r),(r=gr())===l&&(r=br())===l&&(r=pr())===l&&(r=mr());return qt=e,t=rt(t),e=t,e}(),qt=e,e=Ye(r,i)):($t=e,e=l),e===l&&(e=$t,r=$t,i=function(){var e,r;Yt++,e=[],t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re));for(;r!==l;)e.push(r),t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re));Yt--,r=l,0===Yt&&ir(Ce);return e}(),r=t.substring(r,$t),qt=e,e=r=Xe(r)),e}function ur(){var e,r,i,o,s;return e=$t,t.substr($t,2)===p?(r=p,$t+=2):(r=l,0===Yt&&ir(X)),r!==l?(i=xr(),o=function(){var e,t,r;e=$t,t=cr(),t===l&&(t=dr());t===l&&(t=null);r=cr(),r===l&&(r=dr());r===l&&(r=null);return qt=e,e=Ze(t,r),e}(),93===t.charCodeAt($t)?(s=h,$t++):(s=l,0===Yt&&ir(Z)),s!==l?(qt=e,e=Qe(i,o)):($t=e,e=l)):($t=e,e=l),e}function cr(){var e,r,i;return e=$t,58===t.charCodeAt($t)?(r=y,$t++):(r=l,0===Yt&&ir(ee)),r!==l?(i=xr(),qt=e,e=et(i)):($t=e,e=l),e}function dr(){var e,r,i;return e=$t,38===t.charCodeAt($t)?(r=m,$t++):(r=l,0===Yt&&ir(te)),r!==l?(i=xr(),qt=e,e=tt(i)):($t=e,e=l),e}function pr(){var e,t,r,i,o;if(e=$t,t=$t,(r=yr())!==l){for(i=[],o=hr();o!==l;)i.push(o),o=hr();t=r=[r,i]}else $t=t,t=l;return t!==l&&(qt=e,t=it(t)),e=t}function hr(){var e,t;return e=$t,(t=yr())!==l&&(qt=e,t=ot(t)),e=t}function yr(){var e,r;return e=$t,(r=Ar())===l&&(r=function(){var e,r,i,o,s,n,a,u;e=$t,r=$t,i=$t,t.substr($t,2)===M?(o=M,$t+=2):(o=l,0===Yt&&ir(Se));o!==l?(s=function(){var e,r,i,o,s,n;e=$t,r=$t,i=[],o=$t,s=$t,Yt++,t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(Se));Yt--,n===l?s=void 0:($t=s,s=l);s!==l&&(n=Rr())!==l?o=s=[s,n]:($t=o,o=l);for(;o!==l;)i.push(o),o=$t,s=$t,Yt++,t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(Se)),Yt--,n===l?s=void 0:($t=s,s=l),s!==l&&(n=Rr())!==l?o=s=[s,n]:($t=o,o=l);return r=t.substring(r,$t),qt=e,r=Ft(r),e=r,e}(),t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(Se)),n!==l?(a=function(){var e,r,i,o,s,n;e=$t,r=$t,i=[],o=$t,s=$t,Yt++,t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(Se));Yt--,n===l?s=void 0:($t=s,s=l);s!==l?(t.length>$t?(n=t.charAt($t),$t++):(n=l,0===Yt&&ir(re)),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l);for(;o!==l;)i.push(o),o=$t,s=$t,Yt++,t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(Se)),Yt--,n===l?s=void 0:($t=s,s=l),s!==l?(t.length>$t?(n=t.charAt($t),$t++):(n=l,0===Yt&&ir(re)),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l);return r=t.substring(r,$t),qt=e,r=Gt(r),e=r,e}(),u=function(){var e,r,i;t.substr($t,2)===M?(e=M,$t+=2):(e=l,0===Yt&&ir(Se));if(e===l){for(e=$t,r=[],i=Ir();i!==l;)r.push(i),i=Ir();(i=Br())!==l?e=r=[r,i]:($t=e,e=l)}return e}(),u!==l?i=o=[o,s,n,a,u]:($t=i,i=l)):($t=i,i=l)):($t=i,i=l);r=i!==l?t.substring(r,$t):i;r!==l&&(qt=e,r=Lt(r));return e=r,e}(),r===l&&(r=function(){var e,r,i,o;e=$t,t.substr($t,4)===_?(r=_,$t+=4):(r=l,0===Yt&&ir(ue));r!==l&&(i=wr())!==l?(o=function(){var e;93===t.charCodeAt($t)?(e=h,$t++):(e=l,0===Yt&&ir(Z));return e}(),o!==l?(qt=e,e=At(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i,o;e=$t,t.substr($t,2)===R?(r=R,$t+=2):(r=l,0===Yt&&ir(ye));r!==l&&(i=Pr())!==l&&(o=wr())!==l&&Sr()!==l?(qt=e,e=xt(i,o)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i,o;e=$t,91===t.charCodeAt($t)?(r=P,$t++):(r=l,0===Yt&&ir(ce));if(r!==l){if(i=[],35===t.charCodeAt($t)?(o=S,$t++):(o=l,0===Yt&&ir(de)),o!==l)for(;o!==l;)i.push(o),35===t.charCodeAt($t)?(o=S,$t++):(o=l,0===Yt&&ir(de));else i=l;i!==l?(o=_r(),Sr()!==l?(qt=e,e=_t(i,o)):($t=e,e=l)):($t=e,e=l)}else $t=e,e=l;return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===x?(r=x,$t+=2):(r=l,0===Yt&&ir(pe));r!==l?(i=_r(),Sr()!==l?(qt=e,e=Pt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===w?(r=w,$t+=2):(r=l,0===Yt&&ir(he));r!==l?(i=_r(),Sr()!==l?(qt=e,e=St(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===O?(r=O,$t+=2):(r=l,0===Yt&&ir(me));r!==l?(i=_r(),Sr()!==l?(qt=e,e=wt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===k?(r=k,$t+=2):(r=l,0===Yt&&ir(ge));r!==l?(i=_r(),Sr()!==l?(qt=e,e=Rt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===C?(r=C,$t+=2):(r=l,0===Yt&&ir(fe));r!==l?(i=_r(),Sr()!==l?(qt=e,e=Ot(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===B?(r=B,$t+=2):(r=l,0===Yt&&ir(Ae));r!==l?(i=_r(),Sr()!==l?(qt=e,e=It(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===L?(r=L,$t+=2):(r=l,0===Yt&&ir(_e));r!==l?(i=_r(),Sr()!==l?(qt=e,e=jt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===j?(r=j,$t+=2):(r=l,0===Yt&&ir(Te));r!==l?(i=_r(),Sr()!==l?(qt=e,e=Et(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===E?(r=E,$t+=2):(r=l,0===Yt&&ir(be));r!==l?(i=_r(),Sr()!==l?(qt=e,e=kt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===I?(r=I,$t+=2):(r=l,0===Yt&&ir(ve));r!==l?(i=_r(),Sr()!==l?(qt=e,e=Ct(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i,o;e=$t,t.substr($t,2)===N?(r=N,$t+=2):(r=l,0===Yt&&ir(Pe));r!==l&&(i=Pr())!==l&&(o=wr())!==l&&Sr()!==l?(qt=e,e=Bt(i,o)):($t=e,e=l);return e}()))))))))))))))),r!==l&&(qt=e,r=st(r)),e=r}function mr(){var e,r;return e=$t,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),r!==l&&(qt=e,r=nt(r)),e=r}function gr(){var e,r,i,o,s;if(e=$t,r=$t,i=function(){var e,r,i,o,s,n;e=$t,r=Cr(),r!==l?(i=$t,Yt++,o=$t,t.substr($t,4)===g?(s=g,$t+=4):(s=l,0===Yt&&ir(ie)),s!==l&&(n=Er())!==l?o=s=[s,n]:($t=o,o=l),Yt--,o!==l?($t=i,i=void 0):i=l,i!==l?(qt=e,e=lt()):($t=e,e=l)):($t=e,e=l);return e}(),i!==l){for(o=[],s=fr();s!==l;)o.push(s),s=fr();s=function(){var e,r,i,o,s;e=$t,r=$t,t.substr($t,4)===f?(i=f,$t+=4):(i=l,0===Yt&&ir(oe));i===l&&(i=null);o=$t,Yt++,s=jr(),Yt--,s!==l?($t=o,o=void 0):o=l;o!==l?r=i=[i,o]:($t=r,r=l);r!==l&&(qt=e,r=ut());return e=r,e}(),s!==l?r=i=[i,o,s]:($t=r,r=l)}else $t=r,r=l;return r!==l&&(qt=e,r=at(r)),e=r}function fr(){var e,r;return e=$t,r=function(){var e,r,i,o;e=$t,r=$t,t.substr($t,4)===g?(i=g,$t+=4):(i=l,0===Yt&&ir(ie));i!==l?((o=Er())===l&&(o=jr()),o!==l?r=i=[i,o]:($t=r,r=l)):($t=r,r=l);r===l&&(r=$t,t.substr($t,2)===b?(i=b,$t+=2):(i=l,0===Yt&&ir(se)),i!==l?((o=Er())===l&&(o=jr()),o!==l?r=i=[i,o]:($t=r,r=l)):($t=r,r=l),r===l&&(r=$t,t.substr($t,2)===v?(i=v,$t+=2):(i=l,0===Yt&&ir(ne)),i!==l?((o=Er())===l&&(o=jr()),o!==l?r=i=[i,o]:($t=r,r=l)):($t=r,r=l),r===l&&(r=function(){var e,r,i,o,s,n;e=$t,r=$t,Yt++,i=$t,t.substr($t,4)===f?(o=f,$t+=4):(o=l,0===Yt&&ir(oe));o!==l&&(s=jr())!==l?i=o=[o,s]:($t=i,i=l);Yt--,i===l?r=void 0:($t=r,r=l);if(r!==l){if(i=$t,o=$t,s=Or(),(n=Cr())!==l?o=s=[s,n]:($t=o,o=l),o===l){if(o=$t,s=[],(n=Rr())!==l)for(;n!==l;)s.push(n),n=Rr();else s=l;s!==l?(n=function(){var e,r;e=Cr(),e===l&&(e=$t,Yt++,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),Yt--,r===l?e=void 0:($t=e,e=l));return e}(),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l)}(i=o!==l?t.substring(i,$t):o)!==l?(qt=e,e=pt(i)):($t=e,e=l)}else $t=e,e=l;return e}())));r!==l&&(qt=e,r=dt(r));return e=r,e}(),r!==l&&(qt=e,r=ct(r)),e=r}function br(){var e,r,i,o,s;if(e=$t,r=$t,i=function(){var e,r,i,o,s,n;e=$t,r=Cr(),r!==l?(i=$t,Yt++,o=$t,t.substr($t,3)===T?(s=T,$t+=3):(s=l,0===Yt&&ir(ae)),s!==l&&(n=Er())!==l?o=s=[s,n]:($t=o,o=l),Yt--,o!==l?($t=i,i=void 0):i=l,i!==l?(qt=e,e=yt()):($t=e,e=l)):($t=e,e=l);return e}(),i!==l){for(o=[],s=vr();s!==l;)o.push(s),s=vr();s=function(){var e,r,i,o,s;e=$t,r=$t,t.substr($t,3)===T?(i=T,$t+=3):(i=l,0===Yt&&ir(ae));i!==l?(o=$t,Yt++,s=jr(),Yt--,s!==l?($t=o,o=void 0):o=l,o!==l?r=i=[i,o]:($t=r,r=l)):($t=r,r=l);r!==l&&(qt=e,r=mt());return e=r,e}(),s!==l?r=i=[i,o,s]:($t=r,r=l)}else $t=r,r=l;return r!==l&&(qt=e,r=ht(r)),e=r}function vr(){var e,r,i,o,s,n,a,u,c,d,p;if(e=$t,r=$t,Yt++,i=$t,t.substr($t,3)===T?(o=T,$t+=3):(o=l,0===Yt&&ir(ae)),o!==l){for(s=[],n=Ir();n!==l;)s.push(n),n=Ir();for(n=[],a=$t,u=$t,Yt++,c=$t,(d=Cr())!==l?(t.substr($t,3)===T?(p=T,$t+=3):(p=l,0===Yt&&ir(ae)),p!==l?c=d=[d,p]:($t=c,c=l)):($t=c,c=l),Yt--,c===l?u=void 0:($t=u,u=l),u!==l?(t.length>$t?(c=t.charAt($t),$t++):(c=l,0===Yt&&ir(re)),c!==l?a=u=[u,c]:($t=a,a=l)):($t=a,a=l);a!==l;)n.push(a),a=$t,u=$t,Yt++,c=$t,(d=Cr())!==l?(t.substr($t,3)===T?(p=T,$t+=3):(p=l,0===Yt&&ir(ae)),p!==l?c=d=[d,p]:($t=c,c=l)):($t=c,c=l),Yt--,c===l?u=void 0:($t=u,u=l),u!==l?(t.length>$t?(c=t.charAt($t),$t++):(c=l,0===Yt&&ir(re)),c!==l?a=u=[u,c]:($t=a,a=l)):($t=a,a=l);(a=Br())!==l?i=o=[o,s,n,a]:($t=i,i=l)}else $t=i,i=l;return Yt--,i===l?r=void 0:($t=r,r=l),r!==l?(i=function(){var e,r,i,o;e=$t,r=$t,t.substr($t,3)===T?(i=T,$t+=3):(i=l,0===Yt&&ir(ae));i!==l&&(o=Er())!==l?r=i=[i,o]:($t=r,r=l);r===l&&(r=$t,t.substr($t,2)===A?(i=A,$t+=2):(i=l,0===Yt&&ir(le)),i!==l&&(o=Er())!==l?r=i=[i,o]:($t=r,r=l),r===l&&(r=$t,t.substr($t,2)===b?(i=b,$t+=2):(i=l,0===Yt&&ir(se)),i!==l&&(o=Er())!==l?r=i=[i,o]:($t=r,r=l),r===l&&(r=function(){var e,r,i,o,s;e=$t,r=$t,i=$t,o=Or(),s=Cr(),s!==l?i=o=[o,s]:($t=i,i=l);r=i!==l?t.substring(r,$t):i;r!==l&&(qt=e,r=bt(r));return e=r,e}())));r!==l&&(qt=e,r=ft(r));return e=r,e}(),i!==l?(qt=e,e=gt(i)):($t=e,e=l)):($t=e,e=l),e}function Tr(){var e,r;return e=$t,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),r!==l&&(qt=e,r=Tt(r)),e=r}function Ar(){var e,r,i,o;return e=$t,t.substr($t,2)===U?(r=U,$t+=2):(r=l,0===Yt&&ir(xe)),r!==l?(i=function(){var e,r,i,o,s,n;e=$t,r=$t,i=[],o=$t,s=$t,Yt++,t.substr($t,2)===U?(n=U,$t+=2):(n=l,0===Yt&&ir(xe));Yt--,n===l?s=void 0:($t=s,s=l);s!==l?(t.length>$t?(n=t.charAt($t),$t++):(n=l,0===Yt&&ir(re)),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l);for(;o!==l;)i.push(o),o=$t,s=$t,Yt++,t.substr($t,2)===U?(n=U,$t+=2):(n=l,0===Yt&&ir(xe)),Yt--,n===l?s=void 0:($t=s,s=l),s!==l?(t.length>$t?(n=t.charAt($t),$t++):(n=l,0===Yt&&ir(re)),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l);return r=t.substring(r,$t),qt=e,r=Ht(r),e=r,e}(),o=function(){var e,r,i;t.substr($t,2)===U?(e=U,$t+=2):(e=l,0===Yt&&ir(xe));if(e===l){for(e=$t,r=[],i=Ir();i!==l;)r.push(i),i=Ir();(i=Br())!==l?e=r=[r,i]:($t=e,e=l)}return e}(),o!==l?(qt=e,e=Nt(i)):($t=e,e=l)):($t=e,e=l),e}function _r(){var e,r,i,o;for(e=$t,r=$t,i=[],$.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Q));o!==l;)i.push(o),$.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Q));return r=t.substring(r,$t),qt=e,e=r=Mt(r)}function Pr(){var e,r,i,o,s;if(e=$t,r=$t,Yt++,t.substr($t,3)===D?(i=D,$t+=3):(i=l,0===Yt&&ir(we)),Yt--,i===l?r=void 0:($t=r,r=l),r!==l){for(i=$t,o=[],q.test(t.charAt($t))?(s=t.charAt($t),$t++):(s=l,0===Yt&&ir(Re));s!==l;)o.push(s),q.test(t.charAt($t))?(s=t.charAt($t),$t++):(s=l,0===Yt&&ir(Re));i=t.substring(i,$t),qt=e,e=Ut(i)}else $t=e,e=l;return e}function Sr(){var e,r,i;if(93===t.charCodeAt($t)?(e=h,$t++):(e=l,0===Yt&&ir(Z)),e===l){for(e=$t,r=[],i=Ir();i!==l;)r.push(i),i=Ir();(i=Br())!==l?e=r=[r,i]:($t=e,e=l)}return e}function xr(){var e,r,i,o;for(e=$t,r=$t,i=[],J.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Oe));o!==l;)i.push(o),J.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Oe));return r=t.substring(r,$t),qt=e,e=r=Dt(r)}function wr(){var e,r,i;return e=$t,58===t.charCodeAt($t)?(r=y,$t++):(r=l,0===Yt&&ir(ee)),r!==l?(i=_r(),qt=e,e=Vt(i)):($t=e,e=l),e===l&&(r="",qt=e=$t,e=r=Kt()),e}function Rr(){var e;return Yt++,W.test(t.charAt($t))?(e=t.charAt($t),$t++):(e=l,0===Yt&&ir(Ie)),Yt--,e===l&&(l,0===Yt&&ir(Ee)),e}function Or(){var e,t;for(Yt++,e=[],t=Rr();t!==l;)e.push(t),t=Rr();return Yt--,t=l,0===Yt&&ir(je),e}function kr(){var e,r,i;for(Yt++,e=$t,r=[],z.test(t.charAt($t))?(i=t.charAt($t),$t++):(i=l,0===Yt&&ir(ke));i!==l;)r.push(i),z.test(t.charAt($t))?(i=t.charAt($t),$t++):(i=l,0===Yt&&ir(ke));return(i=Cr())!==l?e=r=[r,i]:($t=e,e=l),Yt--,e===l&&(r=l,0===Yt&&ir(Be)),e}function Cr(){var e;return Yt++,10===t.charCodeAt($t)?(e=V,$t++):(e=l,0===Yt&&ir(Ne)),e===l&&(t.substr($t,2)===K?(e=K,$t+=2):(e=l,0===Yt&&ir(Me)),e===l&&(13===t.charCodeAt($t)?(e=F,$t++):(e=l,0===Yt&&ir(Ue)),e===l&&(8232===t.charCodeAt($t)?(e=G,$t++):(e=l,0===Yt&&ir(De)),e===l&&(8233===t.charCodeAt($t)?(e=H,$t++):(e=l,0===Yt&&ir(Ve)))))),Yt--,e===l&&(l,0===Yt&&ir(Le)),e}function Er(){var e,r,i;for(Yt++,e=$t,r=[],z.test(t.charAt($t))?(i=t.charAt($t),$t++):(i=l,0===Yt&&ir(ke));i!==l;)r.push(i),z.test(t.charAt($t))?(i=t.charAt($t),$t++):(i=l,0===Yt&&ir(ke));return(i=Cr())!==l?e=r=[r,i]:($t=e,e=l),Yt--,e===l&&(r=l,0===Yt&&ir(Ke)),e}function Ir(){var e;return Yt++,Y.test(t.charAt($t))?(e=t.charAt($t),$t++):(e=l,0===Yt&&ir(Ge)),Yt--,e===l&&(l,0===Yt&&ir(Fe)),e}function jr(){var e,r;return(e=Er())===l&&(e=$t,Yt++,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),Yt--,r===l?e=void 0:($t=e,e=l)),e}function Br(){var e,r;return e=$t,Yt++,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),Yt--,r===l?e=void 0:($t=e,e=l),e}const Lr=new o.BitmarkPegParserHelper({parse:e,parserText:Xt,parserLocation:Mr}),Nr=new s.BitmarkPegParserProcessor({parse:e,parserText:Xt,parserLocation:Mr});function Mr(){const e=rr(qt,$t);return e?(delete e.source,e):e}function rr(e,t,r){var i=tr(e),o=tr(t),s={source:u,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:o.line,column:o.column}};return u&&"function"==typeof u.offset&&(s.start=u.offset(s.start),s.end=u.offset(s.end)),s}if((a=d())!==l&&$t===t.length)return a;throw a!==l&&$t<t.length&&ir({type:"end"}),or(Wt,zt<t.length?t.charAt(zt):null,zt<t.length?rr(zt,zt+1):rr(zt,zt))}},4764:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=void 0;const r=new RegExp(/=\^(\^*)(?==)|\*\^(\^*)(?=\*)|_\^(\^*)(?=_)|`\^(\^*)(?=`)|!\^(\^*)(?=!)|\[\^(\^*)|•\^(\^*)|#\^(\^*)|\|\^(\^*)|\|\^(\^*)/,"g");function i(e){let t=e||"";let i=r;return t=t.replace(i,(function(e,t,r,i,o){return e.replace("^","")})),t}function o(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkPlusString"}):l(e,{startRule:"bitmarkPlusString"})}function s(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkMinusMinusString"}):l(e,{startRule:"bitmarkMinusMinusString"})}function n(e,t,r,i){var o=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(o,n.prototype),o.expected=t,o.found=r,o.location=i,o.name="SyntaxError",o}function a(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}function l(e,t){var r,a={},l=(t=void 0!==t?t:{}).grammarSource,u={bitmarkPlusPlus:Ni,bitmarkPlus:function(){var e,t;Oi++,e=Si,t=oo(),e,t=Yr(t),e=t,Oi--,t=a,0===Oi&&Bi(Ne);return e},bitmarkMinusMinus:function(){var e,t;Oi++,e=Si,t=ho(),e,t=mi(t),e=t,Oi--,t=a,0===Oi&&Bi(Ht);return e},bitmarkPlusString:function(){var e;Oi++,e=oo(),Oi--,a,0===Oi&&Bi(nt);return e},bitmarkMinusMinusString:ho},c=Ni,d="|",p=":",h="### ",y="## ",m="# ",g="code",f="bitmark++",b="bitmark--",v="JavaScript",T="• ",A="•1 ",_="•+ ",P="•- ",S="\t",x="image",w=" ",R="#",O="@",k="width",C="height",E="=",I="𝑓",j="link:",B="var:",L="code:",N="color:",M="bold",U="italic",D="light",V="highlight",K="strike",F="sub",G="super",H="ins",$="del",q="aqua",J="black",z="blue",W="pink",Y="fuchsia",X="lightgrey",Q="gray",Z="darkgray",ee="green",te="lime",re="magenta",ie="maroon",oe="navy",se="olive",ne="orange",ae="purple",le="red",ue="silver",ce="teal",de="violet",pe="white",he="yellow",ye="*",me="_",ge="`",fe="!",be="[!",ve="]",Te="\n",Ae="\r\n",_e="\r",Pe="\u2028",Se="\u2029",xe="http",we="s",Re="://",Oe="mailto:",ke="~",Ce="^",Ee="'",Ie=/^[ \t]/,je=/^[0-9]/,Be=/^[^\n\r\u2028\u2029]/,Le=/^[a-zA-Z0-9!*'()=+-\/._?#@[\]$&(),;%:{}]/,Ne=Ei("StyledText"),Me=ki("|",!1),Ue=ki(":",!1),De=ki("### ",!1),Ve=ki("## ",!1),Ke=ki("# ",!1),Fe=ki("code",!1),Ge=Ci([" ","\t"],!1,!1),He=ki("bitmark++",!1),$e=ki("bitmark--",!1),qe=ki("JavaScript",!1),Je=ki("• ",!1),ze=ki("•1 ",!1),We=ki("•+ ",!1),Ye=ki("•- ",!1),Xe={type:"any"},Qe=ki("\t",!1),Ze=ki("image",!1),et=ki(" ",!1),tt=ki("#",!1),rt=ki("@",!1),it=Ci([["0","9"]],!1,!1),ot=ki("width",!1),st=ki("height",!1),nt=Ei("StyledString"),at=ki("=",!1),lt=ki("𝑓",!1),ut=ki("link:",!1),ct=ki("var:",!1),dt=ki("code:",!1),pt=ki("color:",!1),ht=ki("bold",!1),yt=ki("italic",!1),mt=ki("light",!1),gt=ki("highlight",!1),ft=ki("strike",!1),bt=ki("sub",!1),vt=ki("super",!1),Tt=ki("ins",!1),At=ki("del",!1),_t=ki("aqua",!1),Pt=ki("black",!1),St=ki("blue",!1),xt=ki("pink",!1),wt=ki("fuchsia",!1),Rt=ki("lightgrey",!1),Ot=ki("gray",!1),kt=ki("darkgray",!1),Ct=ki("green",!1),Et=ki("lime",!1),It=ki("magenta",!1),jt=ki("maroon",!1),Bt=ki("navy",!1),Lt=ki("olive",!1),Nt=ki("orange",!1),Mt=ki("purple",!1),Ut=ki("red",!1),Dt=ki("silver",!1),Vt=ki("teal",!1),Kt=ki("violet",!1),Ft=ki("white",!1),Gt=ki("yellow",!1),Ht=Ei("MinimalStyledText"),$t=Ei("MinimalStyledString"),qt=ki("*",!1),Jt=ki("_",!1),zt=ki("`",!1),Wt=ki("!",!1),Yt=ki("[!",!1),Xt=ki("]",!1),Qt=Ei("Line Terminator"),Zt=ki("\n",!1),er=ki("\r\n",!1),tr=ki("\r",!1),rr=ki("\u2028",!1),ir=ki("\u2029",!1),or=(Ei("whitespace in line"),Ei("space"),Ei("language tag separator"),Ei("white space, separator"),Ci(["\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!1,!1),Ci(["\n","\r","\u2028","\u2029"],!1,!1),Ci(["\n","\r","\u2028","\u2029"],!0,!1)),sr=(Ci(["\n","\r","\u2028","\u2029","\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!0,!1),ki("http",!1)),nr=ki("s",!1),ar=ki("://",!1),lr=ki("mailto:",!1),ur=Ci([["a","z"],["A","Z"],["0","9"],"!","*","'","(",")","=",["+","/"],".","_","?","#","@","[","]","$","&","(",")",",",";","%",":","{","}"],!1,!1),cr=ki("~",!1),dr=ki("^",!1),pr=ki("'",!1),hr=function(e){return Object.assign({},e)},yr=function(e){return Object.assign({},e)},mr=function(e){return Object.assign({},e)},gr=function(e){return Object.assign({},e)},fr=function(e){return Object.assign({},e)},br=function(){return[]},vr=function(e,t){return{type:"heading",content:s(t),attrs:{level:e.length-1}}},Tr=function(e){return e},Ar=function(e,t){return Object.assign(Object.assign({},e),{content:t})},_r=function(){return{type:"codeBlock",language:""}},Pr=function(e){return{type:"codeBlock",attrs:{language:e.trim().toLowerCase()}}},Sr=function(e){return[{type:"text",text:i(e.trim())}]},xr=function(e){return e},wr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Rr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Or=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},kr=function(){return{type:"bulletList"}},Cr=function(){return{type:"orderedList"}},Er=function(){return{type:"taskList"}},Ir=function(e,t,r,i){return i},jr=function(e,t,r,i){let s="bulletList";"•1 "==e&&(s="orderedList"),"•+ "!=e&&"•- "!=e||(s="taskList");let n=[{type:"paragraph",attrs:{},content:o((t+r.join("")).trim())}];if(i&&i[0]&&i[0].parent){let e={type:i[0].parent,attrs:{start:1},content:i,parent:""};"orderedList"==e.parent&&(e.attrs.start=1),n.push(e)}let a="listItem",l={};if("taskList"==s){a="taskItem";let t=!1;"•+ "==e&&(t=!0),l={checked:t}}return{type:a,content:n,parent:s,attrs:l}},Br=function(e){return e},Lr=function(e){return e.join("")===Io},Nr=function(e){return e.length>Io.length},Mr=function(e){Eo.push(Io),Io=e.join("")},Ur=function(){return Io=Eo.pop(),!0},Dr=function(e){return{type:"paragraph",content:o(e.trim()),attrs:{}}},Vr=function(e){return{type:"paragraph",content:o(e.trim()),attrs:{}}},Kr=function(e){return{type:"paragraph",content:o(e.trim()),attrs:{}}},Fr=function(e){return e},Gr=function(e,t,r){const i=Object.assign({},...r);let o=i.captionAlign||"left";delete i.captionAlign;let s=i.alt||null;delete i.alt;let n=i.caption||null;delete i.caption;let a=i.align||"center";return delete i.align,{type:e,attrs:Object.assign({textAlign:o,src:t,alt:s,title:n,class:a},i)}},Hr=function(e){return e},$r=function(e){return{comment:e}},qr=function(e,t){return{[e]:parseInt(t)}},Jr=function(e,t){return{type:"error",msg:e+" must be an positive integer.",found:t}},zr=function(e,t){return{[e]:t}},Wr=function(e){return{[e]:!0}},Yr=function(e){return[{type:"paragraph",content:e,attrs:{}}]},Xr=function(e,t){return e?[e,...t.flat()]:t.flat()},Qr=function(){return{type:"hardBreak"}},Zr=function(e){return{text:i(e),type:"text"}},ei=function(e){return{index:+e,type:"bit"}},ti=function(e,t){return t||(t=[]),{marks:t,text:i(e),type:"text"}},ri=function(e){return{marks:[{type:"bold"}],text:i(e),type:"text"}},ii=function(e){return{marks:[{type:"italic"}],text:i(e),type:"text"}},oi=function(e){return{marks:[{type:"light"}],text:i(e),type:"text"}},si=function(e){return{marks:[{type:"highlight"}],text:i(e),type:"text"}},ni=function(e){return{marks:[{type:"link",attrs:{href:(e.pr+e.t).trim(),target:"_blank"}}],text:e.t,type:"text"}},ai=function(e){return e},li=function(e){return{type:"link",attrs:{href:e.trim(),target:"_blank"}}},ui=function(e){return{type:"var",attrs:{name:e.trim()}}},ci=function(){return{type:"code",attrs:{language:"plain text"}}},di=function(e){return{type:"code",attrs:{language:e.trim().toLowerCase()}}},pi=function(e){return{type:"color",attrs:{color:e}}},hi=function(e){return{type:e}},yi=function(e){return{type:"comment",comment:e}},mi=function(e){return[{type:"paragraph",content:e,attrs:{}}]},gi=function(e,t){return e?[e,...t.flat()]:t.flat()},fi=function(e){return{text:i(e),type:"text"}},bi=function(e){return{index:+e,type:"bit"}},vi=function(e){return{marks:[{type:"bold"}],text:i(e),type:"text"}},Ti=function(e){return{marks:[{type:"italic"}],text:i(e),type:"text"}},Ai=function(e){return{marks:[{type:"light"}],text:i(e),type:"text"}},_i=function(e){return{marks:[{type:"highlight"}],text:i(e),type:"text"}},Pi=function(e,t){return{pr:e,t}},Si=0,xi=[{line:1,column:1}],wi=0,Ri=[],Oi=0;if("startRule"in t){if(!(t.startRule in u))throw new Error("Can't start parsing from rule \""+t.startRule+'".');c=u[t.startRule]}function ki(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ci(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Ei(e){return{type:"other",description:e}}function Ii(t){var r,i=xi[t];if(i)return i;for(r=t-1;!xi[r];)r--;for(i={line:(i=xi[r]).line,column:i.column};r<t;)10===e.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return xi[t]=i,i}function ji(e,t,r){var i=Ii(e),o=Ii(t),s={source:l,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:o.line,column:o.column}};return r&&l&&"function"==typeof l.offset&&(s.start=l.offset(s.start),s.end=l.offset(s.end)),s}function Bi(e){Si<wi||(Si>wi&&(wi=Si,Ri=[]),Ri.push(e))}function Li(e,t,r){return new n(n.buildMessage(e,t),e,t,r)}function Ni(){var e,t;if(Oi++,e=[],(t=Mi())!==a)for(;t!==a;)e.push(t),t=Mi();else e=a;return e===a&&(e=function(){var e,t;return e=Si,t="",e,t=br(),e=t,e}()),Oi--,e===a&&(t=a,0===Oi&&Bi(Ne)),e}function Mi(){var t,r;return t=Si,r=function(){var t,r,i,o,s;if(t=Si,r=Vi(),r!==a){for(i=Si,o=[],s=Oo();s!==a;)o.push(s),s=Oo();i=e.substring(i,Si),(o=ko())!==a?((s=Ro())===a&&(s=null),t,t=vr(r,i)):(Si=t,t=a)}else Si=t,t=a;return t}(),r!==a&&(t,r=hr(r)),(t=r)===a&&(t=Si,r=function(){var e,t,r,i;if(e=Si,t=function(){var e,t,r;e=Si,t=Si,Oi++,r=Hi(),Oi--,r!==a?(Si=t,t=void 0):t=a;t!==a&&(e,t=kr());return e=t,e}(),t!==a){if(r=[],(i=zi())!==a)for(;i!==a;)r.push(i),i=zi();else r=a;r!==a?((i=Ro())===a&&(i=null),e,e=wr(t,r)):(Si=e,e=a)}else Si=e,e=a;if(e===a){if(e=Si,t=function(){var e,t,r;e=Si,t=Si,Oi++,r=$i(),Oi--,r!==a?(Si=t,t=void 0):t=a;t!==a&&(e,t=Cr());return e=t,e}(),t!==a){if(r=[],(i=zi())!==a)for(;i!==a;)r.push(i),i=zi();else r=a;r!==a?((i=Ro())===a&&(i=null),e,e=Rr(t,r)):(Si=e,e=a)}else Si=e,e=a;if(e===a)if(e=Si,t=function(){var e,t,r;e=Si,t=Si,Oi++,r=qi(),Oi--,r!==a?(Si=t,t=void 0):t=a;t!==a&&(e,t=Er());return e=t,e}(),t!==a){if(r=[],(i=zi())!==a)for(;i!==a;)r.push(i),i=zi();else r=a;r!==a?((i=Ro())===a&&(i=null),e,e=Or(t,r)):(Si=e,e=a)}else Si=e,e=a}return e}(),r!==a&&(t,r=yr(r)),(t=r)===a&&(t=Si,(r=to())!==a&&(t,r=mr(r)),(t=r)===a&&(t=Si,r=function(){var t,r,i;t=Si,r=Fi(),r!==a?(i=function(){var t,r,i,o;t=Si,r=Si,i=[],o=Gi();for(;o!==a;)i.push(o),o=Gi();return r=e.substring(r,Si),t,r=Sr(r),t=r,t}(),t,t=Ar(r,i)):(Si=t,t=a);return t}(),r!==a&&(t,r=gr(r)),(t=r)===a&&(t=Si,r=function(){var e,t,r;e=Si,t=Si,Oi++,r=Ui(),Oi--,r===a?t=void 0:(Si=t,t=a);t!==a&&(r=Xi())!==a?(e,e=Dr(r)):(Si=e,e=a);e===a&&(e=Si,(t=Zi())!==a&&(r=Xi())!==a?(e,e=Vr(r)):(Si=e,e=a),e===a&&(e=Si,(t=Zi())!==a?(e,e=Kr(r="")):(Si=e,e=a)));return e}(),r!==a&&(t,r=fr(r)),t=r)))),t}function Ui(){var e;return(e=Vi())===a&&(e=Ji())===a&&(e=to())===a&&(e=Fi())===a&&(e=Zi()),e}function Di(){var t;return 124===e.charCodeAt(Si)?(t=d,Si++):(t=a,0===Oi&&Bi(Me)),t}function Vi(){var t;return e.substr(Si,4)===h?(t=h,Si+=4):(t=a,0===Oi&&Bi(De)),t===a&&(e.substr(Si,3)===y?(t=y,Si+=3):(t=a,0===Oi&&Bi(Ve)),t===a&&(e.substr(Si,2)===m?(t=m,Si+=2):(t=a,0===Oi&&Bi(Ke)))),t}function Ki(){var t,r;return t=Si,Di()!==a?(r=function(){var t;return e.substr(Si,4)===g?(t=g,Si+=4):(t=a,0===Oi&&Bi(Fe)),t}(),r!==a?(t,t=Tr(r)):(Si=t,t=a)):(Si=t,t=a),t}function Fi(){var t,r,i,o,s,n,l;if(t=Si,Ki()!==a){for(r=Si,i=Si,o=[],Ie.test(e.charAt(Si))?(s=e.charAt(Si),Si++):(s=a,0===Oi&&Bi(Ge));s!==a;)o.push(s),Ie.test(e.charAt(Si))?(s=e.charAt(Si),Si++):(s=a,0===Oi&&Bi(Ge));(s=ko())!==a?i=o=[o,s]:(Si=i,i=a),(r=i!==a?e.substring(r,Si):i)!==a?(t,t=_r()):(Si=t,t=a)}else Si=t,t=a;if(t===a)if(t=Si,Ki()!==a)if(58===e.charCodeAt(Si)?(r=p,Si++):(r=a,0===Oi&&Bi(Ue)),r!==a)if(i=function(){var t,r,i;e.substr(Si,9)===f?(t=f,Si+=9):(t=a,0===Oi&&Bi(He));if(t===a&&(e.substr(Si,9)===b?(t=b,Si+=9):(t=a,0===Oi&&Bi($e)),t===a&&(e.substr(Si,10)===v?(t=v,Si+=10):(t=a,0===Oi&&Bi(qe)),t===a))){if(t=Si,r=[],(i=Oo())!==a)for(;i!==a;)r.push(i),i=Oo();else r=a;(t=r!==a?e.substring(t,Si):r)===a&&(t="")}return t}(),i!==a){for(o=Si,s=Si,n=[],Ie.test(e.charAt(Si))?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Ge));l!==a;)n.push(l),Ie.test(e.charAt(Si))?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Ge));(l=ko())!==a?s=n=[n,l]:(Si=s,s=a),(o=s!==a?e.substring(o,Si):s)!==a?(t,t=Pr(i)):(Si=t,t=a)}else Si=t,t=a;else Si=t,t=a;else Si=t,t=a;return t}function Gi(){var t,r,i,o,s,n;if(t=Si,r=Si,Oi++,i=Ui(),Oi--,i===a?r=void 0:(Si=r,r=a),r!==a){if(i=Si,o=Si,s=[],(n=Oo())!==a)for(;n!==a;)s.push(n),n=Oo();else s=a;s!==a&&(n=ko())!==a?o=s=[s,n]:(Si=o,o=a),(i=o!==a?e.substring(i,Si):o)!==a?(t,t=xr(i)):(Si=t,t=a)}else Si=t,t=a;return t===a&&(t=Ro()),t}function Hi(){var t;return e.substr(Si,2)===T?(t=T,Si+=2):(t=a,0===Oi&&Bi(Je)),t}function $i(){var t;return e.substr(Si,3)===A?(t=A,Si+=3):(t=a,0===Oi&&Bi(ze)),t}function qi(){var t;return e.substr(Si,3)===_?(t=_,Si+=3):(t=a,0===Oi&&Bi(We)),t===a&&(e.substr(Si,3)===P?(t=P,Si+=3):(t=a,0===Oi&&Bi(Ye))),t}function Ji(){var e;return(e=Hi())===a&&(e=$i())===a&&(e=qi()),e}function zi(){var t,r,i,o,s,n,l,u;if(t=Si,Yi()!==a)if((r=Ji())!==a){for(i=Si,o=Si,s=[],n=Si,l=Si,Oi++,u=Ro(),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);n!==a;)s.push(n),n=Si,l=Si,Oi++,u=Ro(),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);for((n=Ro())===a&&(n=null),o=s=[s,n],i=e.substring(i,Si),o=[],s=Wi();s!==a;)o.push(s),s=Wi();if(s=Si,n=function(){var t,r,i,o;t=Si,Oi++,r=Si,i=[],9===e.charCodeAt(Si)?(o=S,Si++):(o=a,0===Oi&&Bi(Qe));if(o!==a)for(;o!==a;)i.push(o),9===e.charCodeAt(Si)?(o=S,Si++):(o=a,0===Oi&&Bi(Qe));else i=a;i!==a?(Si,(o=(o=Nr(i))?void 0:a)!==a?(r,r=Mr(i)):(Si=r,r=a)):(Si=r,r=a);Oi--,r!==a?(Si=t,t=void 0):t=a;return t}(),n!==a){for(l=[],u=zi();u!==a;)l.push(u),u=zi();u=function(){var e;Si,e=Ur(),e=e?void 0:a;return e}(),u!==a?(s,s=Ir(r,i,o,l)):(Si=s,s=a)}else Si=s,s=a;s===a&&(s=null),t,t=jr(r,i,o,s)}else Si=t,t=a;else Si=t,t=a;return t}function Wi(){var t,r,i,o,s,n,l,u,c,d;if(t=Si,r=Si,Oi++,i=function(){var t,r,i;t=Si,r=[],Ie.test(e.charAt(Si))?(i=e.charAt(Si),Si++):(i=a,0===Oi&&Bi(Ge));for(;i!==a;)r.push(i),Ie.test(e.charAt(Si))?(i=e.charAt(Si),Si++):(i=a,0===Oi&&Bi(Ge));i=Ro(),i!==a?t=r=[r,i]:(Si=t,t=a);return t}(),Oi--,i===a?r=void 0:(Si=r,r=a),r!==a)if((i=Yi())!==a)if(o=Si,Oi++,s=Ji(),Oi--,s===a?o=void 0:(Si=o,o=a),o!==a){if(s=Si,n=Si,l=[],u=Si,c=Si,Oi++,d=Ro(),Oi--,d===a?c=void 0:(Si=c,c=a),c!==a?(e.length>Si?(d=e.charAt(Si),Si++):(d=a,0===Oi&&Bi(Xe)),d!==a?u=c=[c,d]:(Si=u,u=a)):(Si=u,u=a),u!==a)for(;u!==a;)l.push(u),u=Si,c=Si,Oi++,d=Ro(),Oi--,d===a?c=void 0:(Si=c,c=a),c!==a?(e.length>Si?(d=e.charAt(Si),Si++):(d=a,0===Oi&&Bi(Xe)),d!==a?u=c=[c,d]:(Si=u,u=a)):(Si=u,u=a);else l=a;l!==a&&(u=ko())!==a?n=l=[l,u]:(Si=n,n=a),(s=n!==a?e.substring(s,Si):n)!==a?(t,t=Br(s)):(Si=t,t=a)}else Si=t,t=a;else Si=t,t=a;else Si=t,t=a;return t}function Yi(){var t,r,i;for(t=Si,r=[],9===e.charCodeAt(Si)?(i=S,Si++):(i=a,0===Oi&&Bi(Qe));i!==a;)r.push(i),9===e.charCodeAt(Si)?(i=S,Si++):(i=a,0===Oi&&Bi(Qe));return Si,(i=(i=Lr(r))?void 0:a)!==a?t=r=[r,i]:(Si=t,t=a),t}function Xi(){var t,r,i;if(t=Si,r=[],(i=Qi())!==a)for(;i!==a;)r.push(i),i=Qi();else r=a;return t=r!==a?e.substring(t,Si):r}function Qi(){var t,r,i,o,s,n;if(t=Si,r=Si,Oi++,i=Ui(),Oi--,i===a?r=void 0:(Si=r,r=a),r!==a){if(i=Si,o=Si,s=[],(n=Oo())!==a)for(;n!==a;)s.push(n),n=Oo();else s=a;s!==a&&(n=ko())!==a?o=s=[s,n]:(Si=o,o=a),(i=o!==a?e.substring(i,Si):o)!==a?t=r=[r,i]:(Si=t,t=a)}else Si=t,t=a;return t===a&&(t=Ro()),t}function Zi(){var t,r,i,o,s,n;if(t=Si,(r=Di())!==a){for(i=Si,o=Si,s=[],Ie.test(e.charAt(Si))?(n=e.charAt(Si),Si++):(n=a,0===Oi&&Bi(Ge));n!==a;)s.push(n),Ie.test(e.charAt(Si))?(n=e.charAt(Si),Si++):(n=a,0===Oi&&Bi(Ge));(n=ko())!==a?o=s=[s,n]:(Si=o,o=a),(i=o!==a?e.substring(i,Si):o)!==a?((o=Ro())===a&&(o=null),t=r=[r,i,o]):(Si=t,t=a)}else Si=t,t=a;return t}function eo(){var t,r;return t=Si,Di()!==a?(r=function(){var t;return e.substr(Si,5)===x?(t=x,Si+=5):(t=a,0===Oi&&Bi(Ze)),t}(),r!==a?(t,t=Fr(r)):(Si=t,t=a)):(Si=t,t=a),t}function to(){var t,r,i,o,s,n,l,u,c,d;if(t=Si,(r=eo())!==a)if(58===e.charCodeAt(Si)?(i=p,Si++):(i=a,0===Oi&&Bi(Ue)),i!==a)if(32===e.charCodeAt(Si)?(o=w,Si++):(o=a,0===Oi&&Bi(et)),o===a&&(o=null),s=function(){var t,r,i,o,s,n,l,u,c;t=Si,r=Si,e.substr(Si,4)===xe?(i=xe,Si+=4):(i=a,0===Oi&&Bi(sr));if(i!==a)if(115===e.charCodeAt(Si)?(o=we,Si++):(o=a,0===Oi&&Bi(nr)),o===a&&(o=null),e.substr(Si,3)===Re?(s=Re,Si+=3):(s=a,0===Oi&&Bi(ar)),s!==a){for(n=[],l=Si,u=Si,Oi++,c=Di(),Oi--,c===a?u=void 0:(Si=u,u=a),u!==a&&(c=Co())!==a?l=u=[u,c]:(Si=l,l=a);l!==a;)n.push(l),l=Si,u=Si,Oi++,c=Di(),Oi--,c===a?u=void 0:(Si=u,u=a),u!==a&&(c=Co())!==a?l=u=[u,c]:(Si=l,l=a);r=i=[i,o,s,n]}else Si=r,r=a;else Si=r,r=a;t=r!==a?e.substring(t,Si):r;return t}(),s!==a)if(Di()!==a){for(n=function(){var e,t,r;e=Si,t=[],r=ro();for(;r!==a;)t.push(r),r=ro();return e,t=Hr(t),e=t,e}(),l=Si,u=Si,c=[],Ie.test(e.charAt(Si))?(d=e.charAt(Si),Si++):(d=a,0===Oi&&Bi(Ge));d!==a;)c.push(d),Ie.test(e.charAt(Si))?(d=e.charAt(Si),Si++):(d=a,0===Oi&&Bi(Ge));(d=ko())!==a?u=c=[c,d]:(Si=u,u=a),(l=u!==a?e.substring(l,Si):u)!==a?((u=Ro())===a&&(u=null),t,t=Gr(r,s,n)):(Si=t,t=a)}else Si=t,t=a;else Si=t,t=a;else Si=t,t=a;else Si=t,t=a;return t}function ro(){var t,r,i,o,s,n,l,u,c,d;if(t=Si,35===e.charCodeAt(Si)?(r=R,Si++):(r=a,0===Oi&&Bi(tt)),r!==a){for(i=Si,o=[],s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);i=e.substring(i,Si),(o=Di())!==a?(t,t=$r(i)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,64===e.charCodeAt(Si)?(r=O,Si++):(r=a,0===Oi&&Bi(rt)),r===a&&(r=null),(i=io())!==a)if(58===e.charCodeAt(Si)?(o=p,Si++):(o=a,0===Oi&&Bi(Ue)),o!==a){for(s=[],32===e.charCodeAt(Si)?(n=w,Si++):(n=a,0===Oi&&Bi(et));n!==a;)s.push(n),32===e.charCodeAt(Si)?(n=w,Si++):(n=a,0===Oi&&Bi(et));if(n=Si,l=[],u=Si,c=Si,Oi++,d=Di(),Oi--,d===a?c=void 0:(Si=c,c=a),c!==a?(je.test(e.charAt(Si))?(d=e.charAt(Si),Si++):(d=a,0===Oi&&Bi(it)),d!==a?u=c=[c,d]:(Si=u,u=a)):(Si=u,u=a),u!==a)for(;u!==a;)l.push(u),u=Si,c=Si,Oi++,d=Di(),Oi--,d===a?c=void 0:(Si=c,c=a),c!==a?(je.test(e.charAt(Si))?(d=e.charAt(Si),Si++):(d=a,0===Oi&&Bi(it)),d!==a?u=c=[c,d]:(Si=u,u=a)):(Si=u,u=a);else l=a;(n=l!==a?e.substring(n,Si):l)!==a&&(l=Di())!==a?(t,t=qr(i,n)):(Si=t,t=a)}else Si=t,t=a;else Si=t,t=a;if(t===a){if(t=Si,64===e.charCodeAt(Si)?(r=O,Si++):(r=a,0===Oi&&Bi(rt)),r===a&&(r=null),(i=io())!==a)if(58===e.charCodeAt(Si)?(o=p,Si++):(o=a,0===Oi&&Bi(Ue)),o!==a){for(s=[],32===e.charCodeAt(Si)?(n=w,Si++):(n=a,0===Oi&&Bi(et));n!==a;)s.push(n),32===e.charCodeAt(Si)?(n=w,Si++):(n=a,0===Oi&&Bi(et));for(n=Si,l=[],u=Si,c=Si,Oi++,d=Di(),Oi--,d===a?c=void 0:(Si=c,c=a),c!==a&&(d=Oo())!==a?u=c=[c,d]:(Si=u,u=a);u!==a;)l.push(u),u=Si,c=Si,Oi++,d=Di(),Oi--,d===a?c=void 0:(Si=c,c=a),c!==a&&(d=Oo())!==a?u=c=[c,d]:(Si=u,u=a);n=e.substring(n,Si),(l=Di())!==a?(t,t=Jr(i,n)):(Si=t,t=a)}else Si=t,t=a;else Si=t,t=a;if(t===a){for(t=Si,64===e.charCodeAt(Si)?(r=O,Si++):(r=a,0===Oi&&Bi(rt)),r===a&&(r=null),i=Si,o=[],s=Si,n=Si,Oi++,(l=Di())===a&&(58===e.charCodeAt(Si)?(l=p,Si++):(l=a,0===Oi&&Bi(Ue))),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,(l=Di())===a&&(58===e.charCodeAt(Si)?(l=p,Si++):(l=a,0===Oi&&Bi(Ue))),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);if(i=e.substring(i,Si),58===e.charCodeAt(Si)?(o=p,Si++):(o=a,0===Oi&&Bi(Ue)),o!==a){for(32===e.charCodeAt(Si)?(s=w,Si++):(s=a,0===Oi&&Bi(et)),s===a&&(s=null),n=Si,l=[],u=Si,c=Si,Oi++,d=Di(),Oi--,d===a?c=void 0:(Si=c,c=a),c!==a&&(d=Oo())!==a?u=c=[c,d]:(Si=u,u=a);u!==a;)l.push(u),u=Si,c=Si,Oi++,d=Di(),Oi--,d===a?c=void 0:(Si=c,c=a),c!==a&&(d=Oo())!==a?u=c=[c,d]:(Si=u,u=a);n=e.substring(n,Si),(l=Di())!==a?(t,t=zr(i,n)):(Si=t,t=a)}else Si=t,t=a;if(t===a){for(t=Si,64===e.charCodeAt(Si)?(r=O,Si++):(r=a,0===Oi&&Bi(rt)),r===a&&(r=null),i=Si,o=[],s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);i=e.substring(i,Si),(o=Di())!==a?(t,t=Wr(i)):(Si=t,t=a)}}}}return t}function io(){var t;return e.substr(Si,5)===k?(t=k,Si+=5):(t=a,0===Oi&&Bi(ot)),t===a&&(e.substr(Si,6)===C?(t=C,Si+=6):(t=a,0===Oi&&Bi(st))),t}function oo(){var e,t,r,i;for(e=Si,(t=so())===a&&(t=null),r=[],(i=uo())===a&&(i=so());i!==a;)r.push(i),(i=uo())===a&&(i=so());return e,e=Xr(t,r)}function so(){var t,r,i,o,s,n,l;if(t=Si,(r=Ro())!==a&&(t,r=Qr()),(t=r)===a){if(t=Si,r=Si,i=[],o=Si,(s=co())===a&&(s=null),n=Si,Oi++,l=uo(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?o=s=[s,n,l]:(Si=o,o=a),o===a&&(o=Si,(s=co())!==a?(n=Si,Oi++,l=uo(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?o=s=[s,n]:(Si=o,o=a)):(Si=o,o=a)),o!==a)for(;o!==a;)i.push(o),o=Si,(s=co())===a&&(s=null),n=Si,Oi++,l=uo(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?o=s=[s,n,l]:(Si=o,o=a),o===a&&(o=Si,(s=co())!==a?(n=Si,Oi++,l=uo(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?o=s=[s,n]:(Si=o,o=a)):(Si=o,o=a));else i=a;(r=i!==a?e.substring(r,Si):i)!==a&&(t,r=Zr(r)),t=r}return t}function no(){var t;return 61===e.charCodeAt(Si)?(t=E,Si++):(t=a,0===Oi&&Bi(at)),t}function ao(){var t;return e.substr(Si,2)===I?(t=I,Si+=2):(t=a,0===Oi&&Bi(lt)),t}function lo(){var e,t,r;return e=Si,(t=no())!==a&&(r=no())!==a?e=t=[t,r]:(Si=e,e=a),e}function uo(){var t,r,i,o,s,n,l,u,c,p;if(t=Si,(r=Po())!==a){if(i=Si,o=[],je.test(e.charAt(Si))?(s=e.charAt(Si),Si++):(s=a,0===Oi&&Bi(it)),s!==a)for(;s!==a;)o.push(s),je.test(e.charAt(Si))?(s=e.charAt(Si),Si++):(s=a,0===Oi&&Bi(it));else o=a;(i=o!==a?e.substring(i,Si):o)!==a&&(o=So())!==a?(t,t=ei(i)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,(r=lo())!==a){for(32===e.charCodeAt(Si)?(i=w,Si++):(i=a,0===Oi&&Bi(et)),i===a&&(i=null),o=Si,s=[],n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=lo())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);n!==a;)s.push(n),n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=lo())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);o=e.substring(o,Si),32===e.charCodeAt(Si)?(s=w,Si++):(s=a,0===Oi&&Bi(et)),s===a&&(s=null),(n=lo())!==a?(l=function(){var t,r,i,o;t=Si,124===e.charCodeAt(Si)?(r=d,Si++):(r=a,0===Oi&&Bi(Me));if(r!==a){for(i=[],o=po();o!==a;)i.push(o),o=po();t,t=ai(i)}else Si=t,t=a;return t}(),l===a&&(l=null),t,t=ti(o,l)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,(r=vo())!==a){for(32===e.charCodeAt(Si)?(i=w,Si++):(i=a,0===Oi&&Bi(et)),i===a&&(i=null),o=Si,s=[],n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=vo())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);n!==a;)s.push(n),n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=vo())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);o=e.substring(o,Si),32===e.charCodeAt(Si)?(s=w,Si++):(s=a,0===Oi&&Bi(et)),s===a&&(s=null),(n=vo())!==a?(t,t=ri(o)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,(r=To())!==a){for(32===e.charCodeAt(Si)?(i=w,Si++):(i=a,0===Oi&&Bi(et)),i===a&&(i=null),o=Si,s=[],n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=To())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);n!==a;)s.push(n),n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=To())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);o=e.substring(o,Si),32===e.charCodeAt(Si)?(s=w,Si++):(s=a,0===Oi&&Bi(et)),s===a&&(s=null),(n=To())!==a?(t,t=ii(o)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,(r=Ao())!==a){for(32===e.charCodeAt(Si)?(i=w,Si++):(i=a,0===Oi&&Bi(et)),i===a&&(i=null),o=Si,s=[],n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=Ao())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);n!==a;)s.push(n),n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=Ao())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);o=e.substring(o,Si),32===e.charCodeAt(Si)?(s=w,Si++):(s=a,0===Oi&&Bi(et)),s===a&&(s=null),(n=Ao())!==a?(t,t=oi(o)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,(r=_o())!==a){for(32===e.charCodeAt(Si)?(i=w,Si++):(i=a,0===Oi&&Bi(et)),i===a&&(i=null),o=Si,s=[],n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=_o())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);n!==a;)s.push(n),n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=_o())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);o=e.substring(o,Si),32===e.charCodeAt(Si)?(s=w,Si++):(s=a,0===Oi&&Bi(et)),s===a&&(s=null),(n=_o())!==a?(t,t=si(o)):(Si=t,t=a)}else Si=t,t=a;t===a&&(t=Si,r=function(){var t,r,i,o,s,n,l;t=Si,r=Si,i=Si,e.substr(Si,4)===xe?(o=xe,Si+=4):(o=a,0===Oi&&Bi(sr));o!==a?(115===e.charCodeAt(Si)?(s=we,Si++):(s=a,0===Oi&&Bi(nr)),s===a&&(s=null),e.substr(Si,3)===Re?(n=Re,Si+=3):(n=a,0===Oi&&Bi(ar)),n!==a?i=o=[o,s,n]:(Si=i,i=a)):(Si=i,i=a);i===a&&(e.substr(Si,7)===Oe?(i=Oe,Si+=7):(i=a,0===Oi&&Bi(lr)));r=i!==a?e.substring(r,Si):i;if(r!==a){for(i=Si,o=[],s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Co())!==a?s=n=[n,l]:(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Co())!==a?s=n=[n,l]:(Si=s,s=a);i=e.substring(i,Si),t,t=Pi(r,i)}else Si=t,t=a;return t}(),r!==a&&(t,r=ni(r)),t=r)}}}}}return t}function co(){var t,r,i,o,s;if(t=Si,r=Si,(i=lo())!==a){if(o=[],(s=no())!==a)for(;s!==a;)o.push(s),s=no();else o=a;o!==a?r=i=[i,o]:(Si=r,r=a)}else Si=r,r=a;if((t=r!==a?e.substring(t,Si):r)===a){if(t=Si,r=Si,i=function(){var e,t,r;return e=Si,(t=ao())!==a&&(r=ao())!==a?e=t=[t,r]:(Si=e,e=a),e}(),i!==a){if(o=[],(s=ao())!==a)for(;s!==a;)o.push(s),s=ao();else o=a;o!==a?r=i=[i,o]:(Si=r,r=a)}else Si=r,r=a;if((t=r!==a?e.substring(t,Si):r)===a){if(t=Si,r=Si,(i=Ao())!==a){if(o=[],(s=fo())!==a)for(;s!==a;)o.push(s),s=fo();else o=a;o!==a?r=i=[i,o]:(Si=r,r=a)}else Si=r,r=a;if((t=r!==a?e.substring(t,Si):r)===a){if(t=Si,r=Si,(i=_o())!==a){if(o=[],(s=bo())!==a)for(;s!==a;)o.push(s),s=bo();else o=a;o!==a?r=i=[i,o]:(Si=r,r=a)}else Si=r,r=a;t=r!==a?e.substring(t,Si):r}}}return t}function po(){var t,r,i,o,s,n,l;if(t=Si,e.substr(Si,5)===j?(r=j,Si+=5):(r=a,0===Oi&&Bi(ut)),r!==a){for(i=Si,o=[],s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);i=e.substring(i,Si),(o=Di())!==a?(t,t=li(i)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,e.substr(Si,4)===B?(r=B,Si+=4):(r=a,0===Oi&&Bi(ct)),r!==a){for(i=Si,o=[],s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);i=e.substring(i,Si),(o=Di())!==a?(t,t=ui(i)):(Si=t,t=a)}else Si=t,t=a;if(t===a&&(t=Si,e.substr(Si,4)===g?(r=g,Si+=4):(r=a,0===Oi&&Bi(Fe)),r!==a&&(i=Di())!==a?(t,t=ci()):(Si=t,t=a),t===a)){if(t=Si,e.substr(Si,5)===L?(r=L,Si+=5):(r=a,0===Oi&&Bi(dt)),r!==a){for(i=Si,o=[],s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);i=e.substring(i,Si),(o=Di())!==a?(t,t=di(i)):(Si=t,t=a)}else Si=t,t=a;if(t===a&&(t=Si,e.substr(Si,6)===N?(r=N,Si+=6):(r=a,0===Oi&&Bi(pt)),r!==a?(i=function(){var t;e.substr(Si,4)===q?(t=q,Si+=4):(t=a,0===Oi&&Bi(_t));t===a&&(e.substr(Si,5)===J?(t=J,Si+=5):(t=a,0===Oi&&Bi(Pt)),t===a&&(e.substr(Si,4)===z?(t=z,Si+=4):(t=a,0===Oi&&Bi(St)),t===a&&(e.substr(Si,4)===W?(t=W,Si+=4):(t=a,0===Oi&&Bi(xt)),t===a&&(e.substr(Si,7)===Y?(t=Y,Si+=7):(t=a,0===Oi&&Bi(wt)),t===a&&(e.substr(Si,9)===X?(t=X,Si+=9):(t=a,0===Oi&&Bi(Rt)),t===a&&(e.substr(Si,4)===Q?(t=Q,Si+=4):(t=a,0===Oi&&Bi(Ot)),t===a&&(e.substr(Si,8)===Z?(t=Z,Si+=8):(t=a,0===Oi&&Bi(kt)),t===a&&(e.substr(Si,5)===ee?(t=ee,Si+=5):(t=a,0===Oi&&Bi(Ct)),t===a&&(e.substr(Si,4)===te?(t=te,Si+=4):(t=a,0===Oi&&Bi(Et)),t===a&&(e.substr(Si,7)===re?(t=re,Si+=7):(t=a,0===Oi&&Bi(It)),t===a&&(e.substr(Si,6)===ie?(t=ie,Si+=6):(t=a,0===Oi&&Bi(jt)),t===a&&(e.substr(Si,4)===oe?(t=oe,Si+=4):(t=a,0===Oi&&Bi(Bt)),t===a&&(e.substr(Si,5)===se?(t=se,Si+=5):(t=a,0===Oi&&Bi(Lt)),t===a&&(e.substr(Si,6)===ne?(t=ne,Si+=6):(t=a,0===Oi&&Bi(Nt)),t===a&&(e.substr(Si,6)===ae?(t=ae,Si+=6):(t=a,0===Oi&&Bi(Mt)),t===a&&(e.substr(Si,3)===le?(t=le,Si+=3):(t=a,0===Oi&&Bi(Ut)),t===a&&(e.substr(Si,6)===ue?(t=ue,Si+=6):(t=a,0===Oi&&Bi(Dt)),t===a&&(e.substr(Si,4)===ce?(t=ce,Si+=4):(t=a,0===Oi&&Bi(Vt)),t===a&&(e.substr(Si,6)===de?(t=de,Si+=6):(t=a,0===Oi&&Bi(Kt)),t===a&&(e.substr(Si,5)===pe?(t=pe,Si+=5):(t=a,0===Oi&&Bi(Ft)),t===a&&(e.substr(Si,6)===he?(t=he,Si+=6):(t=a,0===Oi&&Bi(Gt)))))))))))))))))))))));return t}(),i!==a&&(o=Di())!==a?(t,t=pi(i)):(Si=t,t=a)):(Si=t,t=a),t===a&&(t=Si,r=function(){var t;e.substr(Si,4)===M?(t=M,Si+=4):(t=a,0===Oi&&Bi(ht));t===a&&(e.substr(Si,6)===U?(t=U,Si+=6):(t=a,0===Oi&&Bi(yt)),t===a&&(e.substr(Si,5)===D?(t=D,Si+=5):(t=a,0===Oi&&Bi(mt)),t===a&&(e.substr(Si,9)===V?(t=V,Si+=9):(t=a,0===Oi&&Bi(gt)),t===a&&(e.substr(Si,6)===K?(t=K,Si+=6):(t=a,0===Oi&&Bi(ft)),t===a&&(e.substr(Si,3)===F?(t=F,Si+=3):(t=a,0===Oi&&Bi(bt)),t===a&&(e.substr(Si,5)===G?(t=G,Si+=5):(t=a,0===Oi&&Bi(vt)),t===a&&(e.substr(Si,3)===H?(t=H,Si+=3):(t=a,0===Oi&&Bi(Tt)),t===a&&(e.substr(Si,3)===$?(t=$,Si+=3):(t=a,0===Oi&&Bi(At))))))))));return t}(),r!==a&&(i=Di())!==a?(t,t=hi(r)):(Si=t,t=a),t===a)))if(t=Si,35===e.charCodeAt(Si)?(r=R,Si++):(r=a,0===Oi&&Bi(tt)),r!==a){for(i=Si,o=[],s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);i=e.substring(i,Si),(o=Di())!==a?(t,t=yi(i)):(Si=t,t=a)}else Si=t,t=a}}return t}function ho(){var e,t,r,i;for(Oi++,e=Si,(t=yo())===a&&(t=null),r=[],(i=xo())===a&&(i=yo());i!==a;)r.push(i),(i=xo())===a&&(i=yo());return e,e=gi(t,r),Oi--,t=a,0===Oi&&Bi($t),e}function yo(){var t,r,i,o,s,n,l;if(t=Si,r=Si,i=[],o=Si,(s=wo())===a&&(s=null),n=Si,Oi++,l=xo(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?o=s=[s,n,l]:(Si=o,o=a)):(Si=o,o=a),o!==a)for(;o!==a;)i.push(o),o=Si,(s=wo())===a&&(s=null),n=Si,Oi++,l=xo(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?o=s=[s,n,l]:(Si=o,o=a)):(Si=o,o=a);else i=a;return(r=i!==a?e.substring(r,Si):i)!==a&&(t,r=fi(r)),(t=r)===a&&(t=Ro()),t}function mo(){var t;return 42===e.charCodeAt(Si)?(t=ye,Si++):(t=a,0===Oi&&Bi(qt)),t}function go(){var t;return 95===e.charCodeAt(Si)?(t=me,Si++):(t=a,0===Oi&&Bi(Jt)),t}function fo(){var t;return 96===e.charCodeAt(Si)?(t=ge,Si++):(t=a,0===Oi&&Bi(zt)),t}function bo(){var t;return 33===e.charCodeAt(Si)?(t=fe,Si++):(t=a,0===Oi&&Bi(Wt)),t}function vo(){var e,t,r;return e=Si,(t=mo())!==a&&(r=mo())!==a?e=t=[t,r]:(Si=e,e=a),e}function To(){var e,t,r;return e=Si,(t=go())!==a&&(r=go())!==a?e=t=[t,r]:(Si=e,e=a),e}function Ao(){var e,t,r;return e=Si,(t=fo())!==a&&(r=fo())!==a?e=t=[t,r]:(Si=e,e=a),e}function _o(){var e,t,r;return e=Si,(t=bo())!==a&&(r=bo())!==a?e=t=[t,r]:(Si=e,e=a),e}function Po(){var t;return e.substr(Si,2)===be?(t=be,Si+=2):(t=a,0===Oi&&Bi(Yt)),t}function So(){var t;return 93===e.charCodeAt(Si)?(t=ve,Si++):(t=a,0===Oi&&Bi(Xt)),t}function xo(){var t,r,i,o,s,n,l,u,c;if(t=Si,Po()!==a){if(r=Si,i=[],je.test(e.charAt(Si))?(o=e.charAt(Si),Si++):(o=a,0===Oi&&Bi(it)),o!==a)for(;o!==a;)i.push(o),je.test(e.charAt(Si))?(o=e.charAt(Si),Si++):(o=a,0===Oi&&Bi(it));else i=a;(r=i!==a?e.substring(r,Si):i)!==a&&(i=So())!==a?(t,t=bi(r)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,vo()!==a){for(32===e.charCodeAt(Si)?(r=w,Si++):(r=a,0===Oi&&Bi(et)),r===a&&(r=null),i=Si,o=[],s=Si,n=Si,Oi++,l=Si,32===e.charCodeAt(Si)?(u=w,Si++):(u=a,0===Oi&&Bi(et)),u===a&&(u=null),(c=vo())!==a?l=u=[u,c]:(Si=l,l=a),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?s=n=[n,l]:(Si=s,s=a)):(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Si,32===e.charCodeAt(Si)?(u=w,Si++):(u=a,0===Oi&&Bi(et)),u===a&&(u=null),(c=vo())!==a?l=u=[u,c]:(Si=l,l=a),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?s=n=[n,l]:(Si=s,s=a)):(Si=s,s=a);i=e.substring(i,Si),32===e.charCodeAt(Si)?(o=w,Si++):(o=a,0===Oi&&Bi(et)),o===a&&(o=null),(s=vo())!==a?(t,t=vi(i)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,To()!==a){for(32===e.charCodeAt(Si)?(r=w,Si++):(r=a,0===Oi&&Bi(et)),r===a&&(r=null),i=Si,o=[],s=Si,n=Si,Oi++,l=Si,32===e.charCodeAt(Si)?(u=w,Si++):(u=a,0===Oi&&Bi(et)),u===a&&(u=null),(c=To())!==a?l=u=[u,c]:(Si=l,l=a),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?s=n=[n,l]:(Si=s,s=a)):(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Si,32===e.charCodeAt(Si)?(u=w,Si++):(u=a,0===Oi&&Bi(et)),u===a&&(u=null),(c=To())!==a?l=u=[u,c]:(Si=l,l=a),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?s=n=[n,l]:(Si=s,s=a)):(Si=s,s=a);i=e.substring(i,Si),32===e.charCodeAt(Si)?(o=w,Si++):(o=a,0===Oi&&Bi(et)),o===a&&(o=null),(s=To())!==a?(t,t=Ti(i)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,Ao()!==a){for(32===e.charCodeAt(Si)?(r=w,Si++):(r=a,0===Oi&&Bi(et)),r===a&&(r=null),i=Si,o=[],s=Si,n=Si,Oi++,l=Si,32===e.charCodeAt(Si)?(u=w,Si++):(u=a,0===Oi&&Bi(et)),u===a&&(u=null),(c=Ao())!==a?l=u=[u,c]:(Si=l,l=a),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?s=n=[n,l]:(Si=s,s=a)):(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Si,32===e.charCodeAt(Si)?(u=w,Si++):(u=a,0===Oi&&Bi(et)),u===a&&(u=null),(c=Ao())!==a?l=u=[u,c]:(Si=l,l=a),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?s=n=[n,l]:(Si=s,s=a)):(Si=s,s=a);i=e.substring(i,Si),32===e.charCodeAt(Si)?(o=w,Si++):(o=a,0===Oi&&Bi(et)),o===a&&(o=null),(s=Ao())!==a?(t,t=Ai(i)):(Si=t,t=a)}else Si=t,t=a;if(t===a)if(t=Si,_o()!==a){for(32===e.charCodeAt(Si)?(r=w,Si++):(r=a,0===Oi&&Bi(et)),r===a&&(r=null),i=Si,o=[],s=Si,n=Si,Oi++,l=Si,32===e.charCodeAt(Si)?(u=w,Si++):(u=a,0===Oi&&Bi(et)),u===a&&(u=null),(c=_o())!==a?l=u=[u,c]:(Si=l,l=a),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?s=n=[n,l]:(Si=s,s=a)):(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Si,32===e.charCodeAt(Si)?(u=w,Si++):(u=a,0===Oi&&Bi(et)),u===a&&(u=null),(c=_o())!==a?l=u=[u,c]:(Si=l,l=a),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?s=n=[n,l]:(Si=s,s=a)):(Si=s,s=a);i=e.substring(i,Si),32===e.charCodeAt(Si)?(o=w,Si++):(o=a,0===Oi&&Bi(et)),o===a&&(o=null),(s=_o())!==a?(t,t=_i(i)):(Si=t,t=a)}else Si=t,t=a}}}return t}function wo(){var t,r,i,o,s;if(t=Si,r=Si,(i=vo())!==a){if(o=[],(s=mo())!==a)for(;s!==a;)o.push(s),s=mo();else o=a;o!==a?r=i=[i,o]:(Si=r,r=a)}else Si=r,r=a;if((t=r!==a?e.substring(t,Si):r)===a){if(t=Si,r=Si,(i=To())!==a){if(o=[],(s=go())!==a)for(;s!==a;)o.push(s),s=go();else o=a;o!==a?r=i=[i,o]:(Si=r,r=a)}else Si=r,r=a;if((t=r!==a?e.substring(t,Si):r)===a){if(t=Si,r=Si,(i=Ao())!==a){if(o=[],(s=fo())!==a)for(;s!==a;)o.push(s),s=fo();else o=a;o!==a?r=i=[i,o]:(Si=r,r=a)}else Si=r,r=a;if((t=r!==a?e.substring(t,Si):r)===a){if(t=Si,r=Si,(i=_o())!==a){if(o=[],(s=bo())!==a)for(;s!==a;)o.push(s),s=bo();else o=a;o!==a?r=i=[i,o]:(Si=r,r=a)}else Si=r,r=a;t=r!==a?e.substring(t,Si):r}}}return t}function Ro(){var t;return Oi++,10===e.charCodeAt(Si)?(t=Te,Si++):(t=a,0===Oi&&Bi(Zt)),t===a&&(e.substr(Si,2)===Ae?(t=Ae,Si+=2):(t=a,0===Oi&&Bi(er)),t===a&&(13===e.charCodeAt(Si)?(t=_e,Si++):(t=a,0===Oi&&Bi(tr)),t===a&&(8232===e.charCodeAt(Si)?(t=Pe,Si++):(t=a,0===Oi&&Bi(rr)),t===a&&(8233===e.charCodeAt(Si)?(t=Se,Si++):(t=a,0===Oi&&Bi(ir)))))),Oi--,t===a&&(a,0===Oi&&Bi(Qt)),t}function Oo(){var t;return Be.test(e.charAt(Si))?(t=e.charAt(Si),Si++):(t=a,0===Oi&&Bi(or)),t}function ko(){var t,r;return(t=Ro())===a&&(t=Si,Oi++,e.length>Si?(r=e.charAt(Si),Si++):(r=a,0===Oi&&Bi(Xe)),Oi--,r===a?t=void 0:(Si=t,t=a)),t}function Co(){var t;return Le.test(e.charAt(Si))?(t=e.charAt(Si),Si++):(t=a,0===Oi&&Bi(ur)),t===a&&(126===e.charCodeAt(Si)?(t=ke,Si++):(t=a,0===Oi&&Bi(cr)),t===a&&(94===e.charCodeAt(Si)?(t=Ce,Si++):(t=a,0===Oi&&Bi(dr)),t===a&&(39===e.charCodeAt(Si)?(t=Ee,Si++):(t=a,0===Oi&&Bi(pr))))),t}var Eo=[],Io="";if(e=e.trimStart(),(r=c())!==a&&Si===e.length)return r;throw r!==a&&Si<e.length&&Bi({type:"end"}),Li(Ri,wi<e.length?e.charAt(wi):null,wi<e.length?ji(wi,wi+1):ji(wi,wi))}t.SyntaxError=n,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(n,Error),n.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){i=e[r].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,s=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,n=this.location.source+":"+s.line+":"+s.column;if(i){var l=this.location.end,u=a("",s.line.toString().length," "),c=i[o.line-1],d=(o.line===l.line?l.column:c.length+1)-o.column||1;t+="\n --\x3e "+n+"\n"+u+" |\n"+s.line+" | "+c+"\n"+u+" | "+a("",o.column-1," ")+a("",d,"^")}else t+="\n at "+n}return t},n.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?s(e[0])+"-"+s(e[1]):s(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function i(e){return e.charCodeAt(0).toString(16).toUpperCase()}function o(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function s(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function n(e){return r[e.type](e)}return"Expected "+function(e){var t,r,i=e.map(n);if(i.sort(),i.length>0){for(t=1,r=1;t<i.length;t++)i[t-1]!==i[t]&&(i[r]=i[t],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(e)+" but "+function(e){return e?'"'+o(e)+'"':"end of input"}(t)+" found."},t.parse=l},297:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkGenerator=void 0;const o=r(8256),s=r(549),n=r(208),a=r(8791),l=r(1060),u=r(8565),c=r(4719),d=r(1895),p=r(1353),h=r(672),y={debugGenerationInline:!1};t.BitmarkGenerator=class{constructor(e,t){var r;this.ast=new o.Ast,this.skipNLBetweenBitsValue=!1,this.printed=!1,this.bitmarkVersion=null!==(r=a.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:a.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},y),null==t?void 0:t.bitmarkOptions),this.bitmarkVersion===a.BitmarkVersion.v2?void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=u.CardSetVersion.v1):void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=u.CardSetVersion.v2),this.writer=e,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this),this.generatePropertyHandlers()}generate(e){return i(this,void 0,void 0,(function*(){this.resetState(),yield this.writer.open(),this.walkAndWrite(e),this.writeLine(),yield this.writer.close()}))}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.skipNLBetweenBitsValue=!1,this.printed=!1}walkAndWrite(e){this.ast.walk(e,s.NodeType.bitmarkAst,this,void 0),this.writeLine()}enter(e,t,r){let i;const o=this,s=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[s]&&(i=o[s](e,t,r)),i}between(e,t,r,i,o){let s;const n=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof n[a]&&(s=n[a](e,t,r,i,o)),s}exit(e,t,r){const i=this,o=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof i[o]&&i[o](e,t,r)}leaf(e,t,r){const i=this,o=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[o]&&i[o](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}between_bits(e,t,r,i,o){this.writeNL(),this.writeNL(),this.writeNL()}enter_bitsValue(e,t,r){var i,o;const s=e.value;if(this.writeOPD(),this.writeString(s.bitType.alias),s.textFormat){this.isWriteTextFormat(s.textFormat)&&(this.writeColon(),this.writeString(s.textFormat))}const n=null===(i=s.resource)||void 0===i?void 0:i.type;n&&n!==s.bitType.root&&(this.writeAmpersand(),this.writeString(null===(o=s.resource)||void 0===o?void 0:o.type)),this.writeCL(),this.writeNL()}between_bitsValue(e,t,r,i,o){const n=[s.NodeType.bitType,s.NodeType.textFormat,s.NodeType.level,s.NodeType.progress,s.NodeType.toc,s.NodeType.referenceEnd,s.NodeType.labelFalse];e.value.book&&n.push(s.NodeType.reference);(()=>{if(this.skipNLBetweenBitsValue)return this.skipNLBetweenBitsValue=!1,!0;for(const e of n)if(t.key===e)return!0;return!1})()||this.writeNL()}enter_labelTrue(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==s.NodeType.bitsValue)return;const o=null==t?void 0:t.value;o&&(""!=i&&this.writeProperty(c.PropertyKey.labelTrue,i,!0),o.labelFalse&&""!=o.labelFalse[0]&&this.writeProperty(c.PropertyKey.labelFalse,o.labelFalse,!0))}enter_imageSource(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==s.NodeType.bitsValue)return;const{url:o,mockupId:n,size:a,format:l,trim:u}=i;this.writeProperty("imageSource",o,!0),o&&(n&&this.writeProperty("mockupId",n,!0),a&&this.writeProperty("size",a,!0),l&&this.writeProperty("format",l,!0),h.BooleanUtils.isBoolean(u)&&this.writeProperty("trim",u,!0))}enter_partner(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==s.NodeType.bitsValue)return;const{name:o,avatarImage:n}=i;this.writeProperty("partner",o,!0),n&&this.writeResource(n)}enter_markConfigValue(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==s.NodeType.markConfig)return;const{mark:o,color:n,emphasis:a}=i;o&&(this.writeProperty("mark",o,!0),n&&this.writeProperty("color",n,!0),a&&this.writeProperty("emphasis",a,!0),this.writeNL())}enter_sampleSolution(e,t,r){this.writeProperty("sampleSolution",e.value)}leaf_sampleSolution(e,t,r){this.writeProperty("sampleSolution",e.value)}enter_itemLead(e,t,r){const i=e.value;i&&(i.item||i.lead)&&(this.writeOPC(),this.writeString(i.item||""),this.writeCL(),i.lead&&(this.writeOPC(),this.writeString(i.lead),this.writeCL()))}enter_body(e,t,r){e.value.bodyParts.length>0&&this.writeNL()}enter_solutions(e,t,r){const i=e.value;i&&0===i.length&&(this.writeOPU(),this.writeCL())}leaf_solution(e,t,r){var i;const o=e.value,s=null===(i=this.getParentNode(r,2))||void 0===i?void 0:i.value;(null==s?void 0:s.type)===l.BodyBitType.mark&&o&&(this.writeOPE(),this.writeString(o),this.writeCL())}leaf_mark(e,t,r){var i;const o=e.value,s=null===(i=this.getParentNode(r,2))||void 0===i?void 0:i.value;(null==s?void 0:s.type)===l.BodyBitType.mark&&o&&this.writeProperty("mark",o,!0)}enter_optionsValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}enter_textsValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}enter_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeCardSetStart(),this.writeNL())}between_cardNode(e,t,r,i,o){this.isRootBitType1(o)||(this.writeNL(),this.writeCardSetCardDivider(),this.writeNL())}exit_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeNL(),this.writeCardSetEnd())}enter_elements(e,t,r){}between_elements(e,t,r,i,o){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}exit_elements(e,t,r){}between_flashcards(e,t,r,i,o){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}between_flashcardsValue(e,t,r,i,o){r.key===s.NodeType.answer?(this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()):r.key===s.NodeType.alternativeAnswers&&(this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL())}leaf_answer(e,t,r){(null==t?void 0:t.key)===s.NodeType.flashcardsValue&&e.value&&this.writeString(e.value)}between_alternativeAnswers(e,t,r){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}leaf_alternativeAnswersValue(e,t,r){(null==t?void 0:t.key)===s.NodeType.alternativeAnswers&&e.value&&this.writeString(e.value)}enter_statements(e,t,r){}between_statements(e,t,r,i,o){this.isRootBitType(o,n.RootBitType.trueFalse1)||(this.writeNL(),this.writeCardSetCardDivider()),this.writeNL()}exit_statements(e,t,r){}enter_statementsValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}between_choices(e,t,r,i,o){this.writeNL()}exit_choices(e,t,r){this.writeNL()}enter_choicesValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}between_responses(e,t,r,i,o){this.writeNL()}exit_responses(e,t,r){this.writeNL()}enter_responsesValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}enter_quizzes(e,t,r){}between_quizzes(e,t,r,i,o){this.writeCardSetCardDivider(),this.writeNL()}exit_quizzes(e,t,r){}between_quizzesValue(e,t,r,i,o){r.key!==s.NodeType.choices&&r.key!==s.NodeType.responses||this.writeNL()}enter_heading(e,t,r){}between_heading(e,t,r,i,o){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_heading(e,t,r){}enter_forValues(e,t,r){}between_forValues(e,t,r,i,o){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_forValues(e,t,r){}enter_pairs(e,t,r){}between_pairs(e,t,r,i,o){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_pairs(e,t,r){}between_pairsValue(e,t,r,i,o){}enter_keyAudio(e,t,r){const i=e.value;this.writeResource(i)}enter_keyImage(e,t,r){const i=e.value;this.writeResource(i)}enter_matrix(e,t,r){}between_matrix(e,t,r,i,o){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_matrix(e,t,r){}between_matrixValue(e,t,r,i,o){}enter_values(e,t,r){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}between_values(e,t,r,i,o){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}enter_questions(e,t,r){}between_questions(e,t,r,i,o){this.writeCardSetCardDivider(),this.writeNL()}exit_questions(e,t,r){}between_questionsValue(e,t,r,i,o){r.key===s.NodeType.sampleSolution&&this.writeNL()}exit_questionsValue(e,t,r){this.writeNL()}enter_botResponses(e,t,r){}between_botResponses(e,t,r,i,o){this.writeCardSetCardDivider(),this.writeNL()}exit_botResponses(e,t,r){}between_botResponsesValue(e,t,r,i,o){this.writeNL()}exit_botResponsesValue(e,t,r){this.writeNL()}leaf_response(e,t,r){this.writeOPB(),this.writeString(e.value),this.writeCL()}leaf_reaction(e,t,r){this.writeProperty("reaction",e.value,!0)}leaf_feedback(e,t,r){const i=e.value;i&&this.write(i)}enter_resource(e,t,r){const i=e.value;this.writeResource(i)}enter_posterImage(e,t,r){const i=e.value;i&&i.value&&this.writeProperty("posterImage",i.value)}enter_thumbnails(e,t,r){const i=e.value;if(Array.isArray(i)){const e=["src1x","src2x","src3x","src4x"];for(let t=0;t<i.length&&t!==e.length;t++){const r=i[t],o=e[t];this.writeProperty(o,r.value,!0)}}}leaf_title(e,t,r){const i=e.value,o=(null==t?void 0:t.value).level||1;if(o&&i){this.writeOP();for(let e=0;e<+o;e++)this.writeHash();this.writeString(i),this.writeCL()}}leaf_subtitle(e,t,r){const i=e.value;if(i){this.writeOP();for(let e=0;e<2;e++)this.writeHash();this.writeString(i),this.writeCL()}}leaf_book(e,t,r){const i=null==t?void 0:t.value;i&&e.value&&(this.writeProperty("book",e.value),i.reference&&(this.writeOPRANGLE(),this.writeString(i.reference),this.writeCL(),i.referenceEnd&&(this.writeOPRANGLE(),this.writeString(i.referenceEnd),this.writeCL())))}leaf_anchor(e,t,r){e.value&&(this.writeOPDANGLE(),this.writeString(e.value),this.writeCL())}leaf_reference(e,t,r){const i=null==t?void 0:t.value;i&&e.value&&(i.book||(this.writeOPRANGLE(),this.writeString(e.value),this.writeCL()))}leaf_hint(e,t,r){const i=e.value;i&&(this.writeOPQ(),this.writeString(i),this.writeCL())}leaf_instruction(e,t,r){const i=e.value;i&&(this.writeOPB(),this.writeString(i),this.writeCL())}leaf_example(e,t,r){var i,o;const s=e.value,n=null!==(i=null==t?void 0:t.value.isExample)&&void 0!==i&&i,a=null!==(o=null==t?void 0:t.value.isDefaultExample)&&void 0!==o&&o;n&&(a?(this.writeOPA(),this.writeString("example"),this.writeCL()):null!=s&&(this.writeOPA(),this.writeString("example"),this.writeColon(),!0===s?this.writeString("true"):!1===s?this.writeString("false"):this.writeString(s),this.writeCL()))}leaf_bodyText(e,t,r){const i=e.value;i&&this.writeString(i)}leaf_footerText(e,t,r){const i=e.value;i&&this.writeString(i)}leaf_elementsValue(e,t,r){e.value&&this.writeString(e.value)}leaf_solutionsValue(e,t,r){e.value&&(this.writeOPU(),this.writeString(e.value),this.writeCL())}leaf_prefix(e,t,r){e.value&&(this.writeOPPRE(),this.writeString(e.value),this.writeCL())}leaf_postfix(e,t,r){e.value&&(this.writeOPPOST(),this.writeString(e.value),this.writeCL())}leaf_forKeys(e,t,r){this.writeOPHASH(),this.writeString(e.value),this.writeCL()}leaf_forValuesValue(e,t,r){this.writeOPHASH(),this.writeString(e.value),this.writeCL()}leaf_key(e,t,r){e.value&&this.writeString(e.value)}leaf_valuesValue(e,t,r){e.value&&this.writeString(e.value)}leaf_question(e,t,r){(null==t?void 0:t.key)!==s.NodeType.questionsValue&&(null==t?void 0:t.key)!==s.NodeType.flashcardsValue||e.value&&this.writeString(e.value)}leaf_isShortAnswer(e,t,r){!1===e.value&&(this.writeOPA(),this.writeString("longAnswer"),this.writeCL())}leaf_src1x(e,t,r){this.writeProperty("src1x",e.value)}leaf_src2x(e,t,r){this.writeProperty("src2x",e.value)}leaf_src3x(e,t,r){this.writeProperty("src3x",e.value)}leaf_src4x(e,t,r){this.writeProperty("src4x",e.value)}leaf_width(e,t,r){this.writeProperty("width",e.value)}leaf_height(e,t,r){this.writeProperty("height",e.value)}leaf_alt(e,t,r){this.writeProperty("alt",e.value)}leaf_license(e,t,r){this.writeProperty("license",e.value)}leaf_copyright(e,t,r){this.writeProperty("copyright",e.value)}leaf_provider(e,t,r){}leaf_showInIndex(e,t,r){this.writeProperty("showInIndex",e.value)}leaf_caption(e,t,r){const i=e.value;this.writeProperty("caption",i)}leaf_duration(e,t,r){(null==t?void 0:t.key)!==s.NodeType.bitsValue&&this.writeProperty("duration",e.value)}leaf_mute(e,t,r){this.writeProperty("mute",e.value)}leaf_autoplay(e,t,r){this.writeProperty("autoplay",e.value)}leaf_allowSubtitles(e,t,r){this.writeProperty("allowSubtitles",e.value)}leaf_showSubtitles(e,t,r){this.writeProperty("showSubtitles",e.value)}generatePropertyHandlers(){var e;for(const t of c.PropertyKey.values()){const r=null!==(e=c.PropertyKey.getMetadata(c.PropertyKey.fromValue(t)))&&void 0!==e?e:{},i=r.astKey?r.astKey:t,o=`enter_${i}`;i!==c.PropertyKey.example&&(i!==c.PropertyKey.labelTrue&&i!==c.PropertyKey.labelFalse&&i!==c.PropertyKey.posterImage&&i!==c.PropertyKey.imageSource&&i!==c.PropertyKey.partner&&(this[o]=(e,i,o)=>{null!=e.value&&(null==i?void 0:i.key)===s.NodeType.bitsValue&&this.writeProperty(t,e.value,r.isSingle,r.ignoreFalse,r.ignoreTrue)},this[o]=this[o].bind(this)))}}writeString(e){null!=e&&this.write(`${e}`)}writeOPBUL(){this.write("[•")}writeOPESC(){this.write("[^")}writeOPRANGLE(){this.write("[►")}writeOPDANGLE(){this.write("[▼")}writeOPD(){this.write("[.")}writeOPU(){this.write("[_")}writeOPE(){this.write("[=")}writeOPB(){this.write("[!")}writeOPQ(){this.write("[?")}writeOPA(){this.write("[@")}writeOPP(){this.write("[+")}writeOPM(){this.write("[-")}writeOPS(){this.write("[\\")}writeOPR(){this.write("[*")}writeOPC(){this.write("[%")}writeOPAMP(){this.write("[&")}writeOPDOLLAR(){this.write("[$")}writeOPHASH(){this.write("[#")}writeOPPRE(){this.write("['")}writeOPPOST(){this.write("[")}writeOP(){this.write("[")}writeCL(){this.write("]")}writeAmpersand(){this.write("&")}writeColon(){this.write(":")}writeHash(){this.write("#")}writeCardSetStart(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetEnd(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("==="):this.write("~~~~")}writeCardSetCardDivider(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetSideDivider(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("=="):this.write("--")}writeCardSetVariantDivider(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("--"):this.write("++")}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeResource(e){var t;const r=e;if(e)if(e.type===d.ResourceType.imageResponsive){const t=e;this.writeResource(t.imagePortrait),this.writeNL(),this.writeResource(t.imageLandscape)}else if(e.type===d.ResourceType.stillImageFilm){const t=e;this.writeResource(t.image),this.writeNL(),this.writeResource(t.audio)}else this.writeOPAMP(),this.writeString(null!==(t=e.typeAlias)&&void 0!==t?t:e.type),e.type===d.ResourceType.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 s,n=!1;if(void 0!==t&&(s=Array.isArray(t)?t:[t],s.length>0)){r&&(s=s.slice(s.length-1));for(const t of s)if(void 0!==t){if(i&&!1===t)continue;if(o&&!0===t)continue;this.writeOPA(),this.writeString(e),this.writeColon(),this.writeString(`${t}`),this.writeCL(),n=!0}}n||(this.skipNLBetweenBitsValue=!0)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}isWriteTextFormat(e){return!!(!(p.TextFormat.fromValue(e)===p.TextFormat.bitmarkMinusMinus)||this.options.explicitTextFormat)}isRootBitType1(e){return this.isRootBitType(e,n.RootBitType.trueFalse1)||this.isRootBitType(e,n.RootBitType.multipleChoice1)||this.isRootBitType(e,n.RootBitType.multipleResponse1)}isRootBitType(e,t){const r=this.getBitType(e);return(null==r?void 0:r.root)===t}getBitType(e){for(const t of e)if(t.key===s.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getParentNode(e,t=1){if(e.length>t+1)return e[e.length-t-1]}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}}},8582:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkStringGenerator=void 0;const o=r(227),s=r(297);t.BitmarkStringGenerator=class{constructor(e){this.writer=new o.StringWriter,this.generator=new s.BitmarkGenerator(this.writer,e)}generate(e){return i(this,void 0,void 0,(function*(){return yield this.generator.generate(e),this.writer.getString()}))}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}}},3857:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))},o=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonGenerator=void 0;const s=r(8256),n=r(549),a=r(208),l=r(8791),u=r(1060),c=r(7028),d=r(4719),p=r(1895),h=r(1353),y=r(406),m=r(7646),g=r(672),f=r(3633),b=r(169),v={};t.JsonGenerator=class{constructor(e,t){var r;this.ast=new s.Ast,this.textParser=new y.TextParser,this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault="",this.bodyDefault="",this.printed=!1,this.bitmarkVersion=null!==(r=l.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:l.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},v),null==t?void 0:t.jsonOptions),this.jsonPrettifySpace=!0===this.options.prettify?2:this.options.prettify||void 0,this.bitmarkVersion===l.BitmarkVersion.v2?void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!0):void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!1),this.writer=e,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this),this.generatePropertyHandlers()}generate(e){return i(this,void 0,void 0,(function*(){this.resetState(),yield this.writer.open(),this.walkAndWrite(e),this.write(JSON.stringify(this.json,null,this.jsonPrettifySpace)),yield this.writer.close()}))}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault=this.options.textAsPlainText?"":[],this.bodyDefault=this.options.textAsPlainText?"":[],this.printed=!1}walkAndWrite(e){this.ast.walk(e,n.NodeType.bitmarkAst,this,void 0)}enter(e,t,r){let i;const o=this,s=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[s]&&(i=o[s](e,t,r)),i}between(e,t,r,i,o){let s;const n=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof n[a]&&(s=n[a](e,t,r,i,o)),s}exit(e,t,r){const i=this,o=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof i[o]&&i[o](e,t,r)}leaf(e,t,r){const i=this,o=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[o]&&i[o](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_bitmarkAst(e,t,r){this.json=[]}enter_bitsValue(e,t,r){var i,o,s;const n=e.value;this.bitWrapperJson={},this.json.push(this.bitWrapperJson),this.bitJson=this.createBitJson(n),this.bitWrapperJson.bit=this.bitJson;const l=a.RootBitType.getMetadata(n.bitType.root),u=!!(null==l?void 0:l.rootExampleType),d=(null==l?void 0:l.rootExampleType)===c.ExampleType.boolean;if(u){let e;d?(e=!0,n.bitType.root===a.RootBitType.trueFalse1&&void 0!==(null===(o=null===(i=n.cardNode)||void 0===i?void 0:i.statement)||void 0===o?void 0:o.isCorrect)&&(e=n.cardNode.statement.isCorrect)):e=null!==(s=m.ArrayUtils.asSingle(n.sampleSolution))&&void 0!==s?s:"";const t=this.toExample(n,{defaultExample:e,isBoolean:d});this.bitJson.isExample=t.isExample,this.bitJson.example=t.example}else n.isExample&&(this.bitJson.isExample=!0)}exit_bitsValue(e,t,r){this.cleanAndSetDefaultsForBitJson(this.bitJson)}enter_imageSource(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==n.NodeType.bitsValue)return;const{url:o,mockupId:s,size:a,format:l,trim:u}=i,c={};this.addProperty(c,"url",null!=o?o:"",!0),this.addProperty(c,"mockupId",null!=s?s:"",!0),this.addProperty(c,"size",null!=a?a:null,!0),this.addProperty(c,"format",null!=l?l:null,!0),this.addProperty(c,"trim",g.BooleanUtils.isBoolean(u)?u:null,!0),this.bitJson.imageSource=c}enter_partner(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==n.NodeType.bitsValue)return;const{name:o,avatarImage:s}=i,a={};if(this.addProperty(a,"name",null!=o?o:"",!0),s){const e=this.parseResourceToJson(s);e&&e.type===p.ResourceType.image&&(a.avatarImage=e.image)}this.bitJson.partner=a}enter_markConfigValue(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==n.NodeType.markConfig)return;const{mark:o,color:s,emphasis:a}=i,l={};this.addProperty(l,"mark",null!=o?o:"unknown",!0),s&&this.addProperty(l,"color",null!=s?s:"",!0),a&&this.addProperty(l,"emphasis",null!=a?a:"",!0),this.bitJson.marks||(this.bitJson.marks=[]),this.bitJson.marks.push(l)}enter_sampleSolution(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"sampleSolution",e.value,!0)}enter_itemLead(e,t,r){const i=e.value,{item:o,lead:s}=i;(null==t?void 0:t.key)===n.NodeType.bitsValue&&(null!=o&&(this.bitJson.item=this.toTextAstOrString(o)),null!=s&&(this.bitJson.lead=this.toTextAstOrString(s)))}enter_extraProperties(e,t,r){const i=e.value;if(!this.options.excludeUnknownProperties&&i)for(const[e,t]of Object.entries(i)){let r=e;Object.prototype.hasOwnProperty.call(this.bitJson,e)&&(r=`_${e}`),this.addProperty(this.bitJson,r,t)}}enter_bodyParts(e,t,r){const i=e.value,o=this.options.textAsPlainText,s=this.getTextFormat(r);let n="",a=0;null==this.bitJson.body&&(this.bitJson.body=this.bodyDefault);const l=e=>({legacyPlaceholderKey:`{${e}}`,placeholderKey:`[!${e}]`});for(let e=0;e<i.length;e++){const t=i[e];if(t.type===u.BodyBitType.text){n+=t.data.bodyText}else{const{legacyPlaceholderKey:e,placeholderKey:t}=l(a);n+=o?e:t,a++}}this.bitJson.body=this.toTextAstOrString(n,s);const c=this.bitJson.body;a=0;for(let e=0;e<i.length;e++){const t=i[e];if(t.type===u.BodyBitType.text)continue;const r=t;let s;const{legacyPlaceholderKey:n}=l(a);switch(t.type){case u.BodyBitType.gap:{const e=r;s=this.createGapJson(e);break}case u.BodyBitType.mark:{const e=r;s=this.createMarkJson(e);break}case u.BodyBitType.select:{const e=r;s=this.createSelectJson(e);break}case u.BodyBitType.highlight:{const e=r;s=this.createHighlightJson(e);break}}s&&(o?(this.bitJson.placeholders||(this.bitJson.placeholders={}),this.bitJson.placeholders[n]=s):this.replacePlaceholderWithBodyBit(c,s,a)),a++}return!1}enter_elements(e,t,r){const i=e.value;i&&i.length>0&&(this.bitJson.elements=i)}enter_flashcards(e,t,r){var i,o,s,a;const l=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const u=[];if(l)for(const e of l){const t=Object.assign(Object.assign({question:null!==(i=e.question)&&void 0!==i?i:"",answer:null!==(o=e.answer)&&void 0!==o?o:"",alternativeAnswers:null!==(s=e.alternativeAnswers)&&void 0!==s?s:[]},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:e.isDefaultExample,isBoolean:!0}));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.cards=u)}enter_statement(e,t,r){var i,o;const s=e.value;(null==t?void 0:t.key)===n.NodeType.cardNode&&s&&(this.bitJson.statement=null!==(i=s.text)&&void 0!==i?i:"",this.bitJson.isCorrect=null!==(o=s.isCorrect)&&void 0!==o&&o)}enter_statements(e,t,r){var i,o,s;const a=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const l=[];if(a)for(const e of a){const t=Object.assign(Object.assign({statement:null!==(i=e.text)&&void 0!==i?i:"",isCorrect:!!e.isCorrect},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(o=e.itemLead)||void 0===o?void 0:o.item)&&delete t.item,null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,null==(null==e?void 0:e.hint)&&delete t.hint,null==(null==e?void 0:e.instruction)&&delete t.instruction,l.push(t)}l.length>0&&(this.bitJson.statements=l)}enter_choices(e,t,r){var i,o,s;const a=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const l=[];if(a)for(const e of a){const t=Object.assign(Object.assign({choice:null!==(i=e.text)&&void 0!==i?i:"",isCorrect:null!==(o=e.isCorrect)&&void 0!==o&&o},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,l.push(t)}l.length>0&&(this.bitJson.choices=l)}enter_responses(e,t,r){var i,o,s;const a=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const l=[];if(a)for(const e of a){const t=Object.assign(Object.assign({response:null!==(i=e.text)&&void 0!==i?i:"",isCorrect:null!==(o=e.isCorrect)&&void 0!==o&&o},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,l.push(t)}l.length>0&&(this.bitJson.responses=l)}enter_quizzes(e,t,r){var i,o,s,n,a,l,u,c;const d=e.value,p=[];if(d)for(const e of d){const t=[];if(e.choices)for(const r of e.choices){const n=Object.assign(Object.assign({choice:null!==(i=r.text)&&void 0!==i?i:"",isCorrect:null!==(o=r.isCorrect)&&void 0!==o&&o},this.toItemLeadHintInstruction(r)),this.toExample(r,{defaultExample:!!r.isCorrect,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete n.lead,t.push(n)}const r=[];if(e.responses)for(const t of e.responses){const i=Object.assign(Object.assign({response:null!==(n=t.text)&&void 0!==n?n:"",isCorrect:null!==(a=t.isCorrect)&&void 0!==a&&a},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!!t.isCorrect,isBoolean:!0}));null==(null===(l=e.itemLead)||void 0===l?void 0:l.lead)&&delete i.lead,r.push(i)}const d=Object.assign(Object.assign({},this.toItemLeadHintInstruction(e)),{isExample:null!==(u=e.isExample)&&void 0!==u&&u,choices:e.choices?t:void 0,responses:e.responses?r:void 0});null==(null===(c=e.itemLead)||void 0===c?void 0:c.lead)&&delete d.lead,p.push(d)}p.length>0&&(this.bitJson.quizzes=p)}enter_heading(e,t,r){var i,o;const s=e.value;let n=!1;if(s&&s.forKeys&&(n=!0),!n)return!1;const a={forKeys:null!==(i=s.forKeys)&&void 0!==i?i:""};Array.isArray(s.forValues)?s.forValues.length>1?a.forValues=s.forValues:1===s.forValues.length?a.forValues=s.forValues[0]:a.forValues=s.forValues:a.forValues=null!==(o=s.forValues)&&void 0!==o?o:"",this.bitJson.heading=a}enter_pairs(e,t,r){var i,o,s,n,a;const l=e.value,u=[];if(l)for(const e of l){const t=Array.isArray(e.values)&&e.values.length>0&&e.values[0],r=Object.assign(Object.assign(Object.assign({key:null!==(i=e.key)&&void 0!==i?i:"",keyAudio:e.keyAudio?this.addAudioResource(e.keyAudio):void 0,keyImage:e.keyImage?this.addImageResource(e.keyImage):void 0,values:null!==(o=e.values)&&void 0!==o?o:[]},this.toItemLeadHintInstruction(e)),{isCaseSensitive:null===(s=e.isCaseSensitive)||void 0===s||s,isLongAnswer:null!==(n=!e.isShortAnswer)&&void 0!==n&&n}),this.toExample(e,{defaultExample:t,isBoolean:!1}));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete r.lead,r.key&&(delete r.keyAudio,delete r.keyImage),null!=r.keyAudio&&(delete r.key,delete r.keyImage),null!=r.keyImage&&(delete r.key,delete r.keyAudio),u.push(r)}u.length>0&&(this.bitJson.pairs=u)}enter_matrix(e,t,r){var i,o,s,n,a,l,u;const c=e.value,d=[];if(c)for(const e of c){const t=[];if(e.cells)for(const r of e.cells){const e=Array.isArray(r.values)&&r.values.length>0&&r.values[0],s=Object.assign(Object.assign({values:null!==(i=r.values)&&void 0!==i?i:[]},this.toItemLeadHintInstruction(r)),this.toExample(r,{defaultExample:e,isBoolean:!1}));null==(null===(o=r.itemLead)||void 0===o?void 0:o.lead)&&delete s.lead,null==r.hint&&delete s.hint,t.push(s)}const r=Object.assign(Object.assign({key:null!==(s=e.key)&&void 0!==s?s:"",cells:null!=t?t:[]},this.toItemLeadHintInstruction(e)),{isCaseSensitive:null===(n=e.isCaseSensitive)||void 0===n||n,isLongAnswer:null!==(a=!e.isShortAnswer)&&void 0!==a&&a,isExample:null!==(l=e.isExample)&&void 0!==l&&l});null==(null===(u=e.itemLead)||void 0===u?void 0:u.lead)&&delete r.lead,null==e.instruction&&delete r.instruction,d.push(r)}d.length>0&&(this.bitJson.matrix=d)}enter_questions(e,t,r){var i,o,s,n,a;const l=e.value,u=[];if(l)for(const e of l){const t=Object.assign(Object.assign(Object.assign({question:null!==(i=e.question)&&void 0!==i?i:"",partialAnswer:null!==(o=m.ArrayUtils.asSingle(e.partialAnswer))&&void 0!==o?o:"",sampleSolution:null!==(s=e.sampleSolution)&&void 0!==s?s:""},this.toItemLeadHintInstruction(e)),{isShortAnswer:null===(n=e.isShortAnswer)||void 0===n||n}),this.toExample(e,{defaultExample:e.sampleSolution||"",isBoolean:!1}));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.questions=u)}enter_botResponses(e,t,r){var i,o,s,a;const l=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const u=[];if(l)for(const e of l){const t=Object.assign({response:null!==(i=e.response)&&void 0!==i?i:"",reaction:null!==(o=e.reaction)&&void 0!==o?o:"",feedback:null!==(s=e.feedback)&&void 0!==s?s:""},this.toItemLeadHintInstruction(e));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete t.lead,null==e.hint&&delete t.hint,delete t.instruction,u.push(t)}u.length>0&&(this.bitJson.responses=u)}enter_resource(e,t,r){const i=e.value;this.bitJson.resource=this.parseResourceToJson(i)}leaf_title(e,t,r){this.bitJson.title=this.toTextAstOrString(e.value)}leaf_subtitle(e,t,r){this.bitJson.subtitle=this.toTextAstOrString(e.value)}leaf_level(e,t,r){var i;null!=e.value&&this.addProperty(this.bitJson,"level",null!==(i=e.value)&&void 0!==i?i:1,!0)}leaf_book(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"book",e.value,!0)}leaf_anchor(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"anchor",e.value,!0)}leaf_reference(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"reference",e.value,!0)}leaf_referenceEnd(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"referenceEnd",e.value,!0)}leaf_hint(e,t,r){const i=e.value;(null==t?void 0:t.key)===n.NodeType.bitsValue&&(this.bitJson.hint=this.toTextAstOrString(i))}leaf_instruction(e,t,r){const i=e.value;(null==t?void 0:t.key)===n.NodeType.bitsValue&&(this.bitJson.instruction=this.toTextAstOrString(i))}leaf_footerText(e,t,r){const i=e.value;this.bitJson.footer=this.toTextAstOrString(i)}leaf_markup(e,t,r){const i=e.value;i&&(this.bitWrapperJson.bitmark=i)}enter_parser(e,t,r){const i=e.value;if(i){const{version:e,excessResources:r,warnings:s,errors:a}=i,l=o(i,["version","excessResources","warnings","errors"]),u=`${this.bitmarkVersion}`;let c;if(Array.isArray(r)&&r.length>0){c=[];for(const e of r){const t=this.parseResourceToJson(e);t&&c.push(t)}}(null==t?void 0:t.key)===n.NodeType.bitsValue&&(this.bitWrapperJson.parser=Object.assign(Object.assign({version:e,bitmarkVersion:u},l),{warnings:s,errors:a,excessResources:c}),this.options.enableWarnings||delete this.bitWrapperJson.parser.warnings)}}generatePropertyHandlers(){var e;for(const t of d.PropertyKey.values()){const r=d.PropertyKey.fromValue(t),i=null!==(e=d.PropertyKey.getMetadata(r))&&void 0!==e?e:{},o=i.astKey?i.astKey:t,s=`enter_${o}`;o!==d.PropertyKey.example&&(o!==d.PropertyKey.imageSource&&o!==d.PropertyKey.partner&&(this[s]=(e,r,o)=>{const s=e.value;if(null==s)return;if((null==r?void 0:r.key)!==n.NodeType.bitsValue)return;let a=t;i.jsonKey&&(a=i.jsonKey),this.addProperty(this.bitJson,a,s,i.isSingle)},this[s]=this[s].bind(this)))}}createGapJson(e){var t;const r=e.data,i=r.solutions&&r.solutions.length>0?r.solutions[0]:"",o=Object.assign(Object.assign(Object.assign(Object.assign({type:"gap"},this.toItemLeadHintInstruction(r)),{isCaseSensitive:null===(t=r.isCaseSensitive)||void 0===t||t}),this.toExample(r,{defaultExample:i,isBoolean:!1})),{solutions:r.solutions});return o.lead||delete o.lead,o}createMarkJson(e){const t=e.data,r=Object.assign(Object.assign({type:"mark",solution:t.solution,mark:t.mark},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!0,isBoolean:!0}));return r.lead||delete r.lead,r}createSelectJson(e){var t,r,i,o;const s=e.data,n=[];for(const e of s.options){const r=Object.assign(Object.assign({text:e.text,isCorrect:null!==(t=e.isCorrect)&&void 0!==t&&t},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));r.item||delete r.item,r.lead||delete r.lead,r.instruction||delete r.instruction,r.isCaseSensitive||delete r.isCaseSensitive,n.push(r)}const a=Object.assign(Object.assign({type:"select",prefix:null!==(r=s.prefix)&&void 0!==r?r:"",postfix:null!==(i=s.postfix)&&void 0!==i?i:""},this.toItemLeadHintInstruction(s)),{isExample:null!==(o=s.isExample)&&void 0!==o&&o,options:n});return a.lead||delete a.lead,a}createHighlightJson(e){var t,r,i,o,s;const n=e.data,a=[];for(const e of n.texts){const i=Object.assign(Object.assign({text:e.text,isCorrect:null!==(t=e.isCorrect)&&void 0!==t&&t,isHighlighted:null!==(r=e.isHighlighted)&&void 0!==r&&r},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));i.item||delete i.item,i.lead||delete i.lead,i.hint||delete i.hint,i.isCaseSensitive||delete i.isCaseSensitive,a.push(i)}const l=Object.assign(Object.assign({type:"highlight",prefix:null!==(i=n.prefix)&&void 0!==i?i:"",postfix:null!==(o=n.postfix)&&void 0!==o?o:""},this.toItemLeadHintInstruction(n)),{isExample:null!==(s=n.isExample)&&void 0!==s&&s,texts:a});return l.lead||delete l.lead,l}parseResourceToJson(e){if(!e)return;let t;switch(e.type){case p.ResourceType.image:t={type:p.ResourceType.image,image:this.addImageResource(e)};break;case p.ResourceType.imageResponsive:{const r=e;null!=r.imagePortrait.value&&null!=r.imageLandscape.value&&(t={type:p.ResourceType.imageResponsive,imagePortrait:this.addImageResource(r.imagePortrait),imageLandscape:this.addImageResource(r.imageLandscape)});break}case p.ResourceType.imageLink:t={type:p.ResourceType.imageLink,imageLink:this.addImageLinkResource(e)};break;case p.ResourceType.audio:t={type:p.ResourceType.audio,audio:this.addAudioResource(e)};break;case p.ResourceType.audioEmbed:t={type:p.ResourceType.audioEmbed,audioEmbed:this.addAudioEmbedResource(e)};break;case p.ResourceType.audioLink:t={type:p.ResourceType.audioLink,audioLink:this.addAudioLinkResource(e)};break;case p.ResourceType.video:t={type:p.ResourceType.video,video:this.addVideoResource(e)};break;case p.ResourceType.videoEmbed:t={type:p.ResourceType.videoEmbed,videoEmbed:this.addVideoEmbedResource(e)},t.videoEmbed=this.addVideoLinkResource(e);break;case p.ResourceType.videoLink:t={type:p.ResourceType.videoLink,videoLink:this.addVideoLinkResource(e)};break;case p.ResourceType.stillImageFilm:{const r=e;null!=r.image.value&&null!=r.audio.value&&(t={type:p.ResourceType.stillImageFilm,image:this.addImageResource(r.image),audio:this.addAudioResource(r.audio)});break}case p.ResourceType.stillImageFilmEmbed:t={type:p.ResourceType.stillImageFilmEmbed,stillImageFilmEmbed:this.addStillImageFilmEmbedResource(e)};break;case p.ResourceType.stillImageFilmLink:t={type:p.ResourceType.stillImageFilmLink,stillImageFilmLink:this.addStillImageFilmLinkResource(e)};break;case p.ResourceType.article:t={type:p.ResourceType.article,article:this.addArticleResource(e)};break;case p.ResourceType.document:t={type:p.ResourceType.document,document:this.addDocumentResource(e)};break;case p.ResourceType.documentEmbed:t={type:p.ResourceType.documentEmbed,documentEmbed:this.addDocumentEmbedResource(e)};break;case p.ResourceType.documentLink:t={type:p.ResourceType.documentLink,documentLink:this.addDocumentLinkResource(e)};break;case p.ResourceType.documentDownload:t={type:p.ResourceType.documentDownload,documentDownload:this.addDocumentDownloadResource(e)};break;case p.ResourceType.appLink:t={type:p.ResourceType.appLink,appLink:this.addAppLinkResource(e)};break;case p.ResourceType.websiteLink:t={type:p.ResourceType.websiteLink,websiteLink:this.addWebsiteLinkResource(e)}}return t}addImageResource(e){var t,r,i;const o={};if(f.StringUtils.isString(e)){const t=e;e={type:p.ResourceType.image,typeAlias:p.ResourceType.image,value:t,format:b.UrlUtils.fileExtensionFromUrl(t),provider:b.UrlUtils.domainFromUrl(t)}}return null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.src=e.value),null!=e.src1x&&(o.src1x=e.src1x),null!=e.src2x&&(o.src2x=e.src2x),null!=e.src3x&&(o.src3x=e.src3x),null!=e.src4x&&(o.src4x=e.src4x),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,o.alt=null!==(i=e.alt)&&void 0!==i?i:"",this.addGenericResourceProperties(e,o),o}addImageLinkResource(e){var t,r,i;const o={};if(f.StringUtils.isString(e)){const t=e;e={type:p.ResourceType.imageLink,typeAlias:p.ResourceType.imageLink,value:t,format:b.UrlUtils.fileExtensionFromUrl(t),provider:b.UrlUtils.domainFromUrl(t)}}return null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.url=e.value),null!=e.src1x&&(o.src1x=e.src1x),null!=e.src2x&&(o.src2x=e.src2x),null!=e.src3x&&(o.src3x=e.src3x),null!=e.src4x&&(o.src4x=e.src4x),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,o.alt=null!==(i=e.alt)&&void 0!==i?i:"",this.addGenericResourceProperties(e,o),o}addAudioResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.src=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t),t}addAudioEmbedResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.src=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t),t}addAudioLinkResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t,!0),t}addVideoResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.src=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addVideoEmbedResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.src=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addVideoLinkResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.url=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addStillImageFilmEmbedResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.url=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addStillImageFilmLinkResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.url=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addArticleResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.body=e.value),this.addGenericResourceProperties(e,t),t}addDocumentResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentEmbedResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentLinkResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentDownloadResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addAppLinkResource(e){const t={};return null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addWebsiteLinkResource(e){const t={};return null!=e.value&&(t.url=e.value),null!=e.siteName&&(t.siteName=e.siteName),this.addGenericResourceProperties(e,t),t}addGenericResourceProperties(e,t,r){var i,o,s,n,a,l,u,c;return r?(null!=e.license&&(t.license=null!==(i=e.license)&&void 0!==i?i:""),null!=e.copyright&&(t.copyright=null!==(o=e.copyright)&&void 0!==o?o:""),null!=e.provider&&(t.provider=e.provider),null!=e.showInIndex&&(t.showInIndex=null!==(s=e.showInIndex)&&void 0!==s&&s),null!=e.caption&&(t.caption=this.toTextAstOrString(null!==(n=e.caption)&&void 0!==n?n:""))):(t.license=null!==(a=e.license)&&void 0!==a?a:"",t.copyright=null!==(l=e.copyright)&&void 0!==l?l:"",null!=e.provider&&(t.provider=e.provider),t.showInIndex=null!==(u=e.showInIndex)&&void 0!==u&&u,t.caption=this.toTextAstOrString(null!==(c=e.caption)&&void 0!==c?c:"")),t}toItemLeadHintInstruction(e){var t,r,i,o,s,n;return{item:this.toTextAstOrString(null!==(r=null===(t=e.itemLead)||void 0===t?void 0:t.item)&&void 0!==r?r:""),lead:this.toTextAstOrString(null!==(o=null===(i=e.itemLead)||void 0===i?void 0:i.lead)&&void 0!==o?o:""),hint:this.toTextAstOrString(null!==(s=e.hint)&&void 0!==s?s:""),instruction:this.toTextAstOrString(null!==(n=e.instruction)&&void 0!==n?n:"")}}toExample(e,t){const{isExample:r,example:i,isDefaultExample:o}=e,{defaultExample:s,isBoolean:n}=t;if(!r)return{isExample:!1,example:null};let a;return a=o?n?g.BooleanUtils.toBoolean(s):this.toTextAstOrString(s):n?g.BooleanUtils.toBoolean(i):this.toTextAstOrString(i),{isExample:!0,example:a}}addProperty(e,t,r,i){void 0!==r&&(Array.isArray(r)||(r=[r]),Array.isArray(r)&&r.length>0&&(i&&r.length>=1?e[t]=r[r.length-1]:e[t]=r))}getBitType(e){for(const t of e)if(t.key===n.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getTextFormat(e){for(const t of e)if(t.key===n.NodeType.bitsValue){const e=t.value;return h.TextFormat.fromValue(null==e?void 0:e.textFormat)}}toTextAstOrString(e,t=h.TextFormat.bitmarkMinusMinus){if(this.options.textAsPlainText)return e;return this.textParser.toAst(e,{textFormat:t})}replacePlaceholderWithBodyBit(e,t,r){const i=(e,o,s)=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){const r=e[t];if(i(r,e,t))return!0}else{if("bit"===e.type&&e.index===r)return o[s]=t,!0;if(e.content){if(i(e.content,e,"content"))return!0}}return!1};i(e,null,null)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}writeString(e){null!=e&&this.write(`${e}`)}createBitJson(e){return{type:e.bitType.alias,format:e.textFormat,id:void 0,externalId:void 0,spaceId:void 0,padletId:void 0,AIGenerated:void 0,releaseVersion:void 0,book:void 0,ageRange:void 0,language:void 0,computerLanguage:void 0,target:void 0,tag:void 0,icon:void 0,iconTag:void 0,colorTag:void 0,flashcardSet:void 0,subtype:void 0,coverImage:void 0,publisher:void 0,publications:void 0,author:void 0,subject:void 0,date:void 0,location:void 0,theme:void 0,kind:void 0,action:void 0,thumbImage:void 0,focusX:void 0,focusY:void 0,deeplink:void 0,externalLink:void 0,externalLinkText:void 0,videoCallLink:void 0,duration:void 0,list:void 0,textReference:void 0,isTracked:void 0,isInfoOnly:void 0,labelTrue:void 0,labelFalse:void 0,quotedPerson:void 0,partialAnswer:void 0,title:void 0,subtitle:void 0,level:void 0,toc:void 0,progress:void 0,anchor:void 0,reference:void 0,referenceEnd:void 0,item:void 0,lead:void 0,hint:void 0,instruction:void 0,isExample:void 0,example:void 0,partner:void 0,marks:void 0,extraProperties:void 0,body:void 0,resource:void 0,statement:void 0,isCorrect:void 0,sampleSolution:void 0,elements:void 0,statements:void 0,responses:void 0,quizzes:void 0,heading:void 0,pairs:void 0,matrix:void 0,choices:void 0,questions:void 0,placeholders:void 0,footer:void 0}}cleanAndSetDefaultsForBitJson(e){const t=a.BitTypeUtils.getBitType(e.type),r=this.options.textAsPlainText;switch(e.item||(e.item=void 0),t.root){case a.RootBitType._error:break;case a.RootBitType.article:case a.RootBitType.sampleSolution:null==e.body&&(e.body=this.bodyDefault);break;default:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.body&&(e.body=this.bodyDefault),t.alias!==a.AliasBitType.articleAi&&t.alias!==a.AliasBitType.noteAi&&t.alias!==a.AliasBitType.summaryAi||null==e.AIGenerated&&(e.AIGenerated=!0);break;case a.RootBitType.cloze:case a.RootBitType.multipleChoice1:case a.RootBitType.multipleResponse1:case a.RootBitType.multipleChoiceText:case a.RootBitType.highlightText:case a.RootBitType.clozeAndMultipleChoiceText:case a.RootBitType.sequence:case a.RootBitType.mark:case a.RootBitType.flashcard:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.multipleChoice:case a.RootBitType.multipleResponse:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault);break;case a.RootBitType.essay:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.body&&(e.body=this.bodyDefault),null==e.partialAnswer&&(e.partialAnswer="");break;case a.RootBitType.trueFalse1:null==e.item&&(e.item=this.textDefault),null==e.lead&&(e.lead=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.isCorrect&&(e.isCorrect=!1),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.trueFalse:null==e.item&&(e.item=this.textDefault),null==e.lead&&(e.lead=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.labelFalse&&(e.labelFalse=""),null==e.labelTrue&&(e.labelTrue=""),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.chapter:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.toc&&(e.toc=!0),null==e.progress&&(e.progress=!0),null==e.level&&(e.level=1),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.interview:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault),null==e.questions&&(e.questions=[]);break;case a.RootBitType.match:null==e.item&&(e.item=this.textDefault),null==e.heading&&(e.heading={}),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.matchMatrix:null==e.item&&(e.item=this.textDefault),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.learningPathBook:case a.RootBitType.learningPathExternalLink:case a.RootBitType.learningPathVideoCall:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.isTracked&&(e.isTracked=!0),null==e.isInfoOnly&&(e.isInfoOnly=!1),null==e.body&&(e.body=this.bodyDefault)}return null==e.id&&delete e.id,null==e.externalId&&delete e.externalId,null==e.spaceId&&delete e.spaceId,null==e.padletId&&delete e.padletId,null==e.AIGenerated&&delete e.AIGenerated,null==e.releaseVersion&&delete e.releaseVersion,null==e.book&&delete e.book,null==e.ageRange&&delete e.ageRange,null==e.language&&delete e.language,null==e.computerLanguage&&delete e.computerLanguage,null==e.target&&delete e.target,null==e.tag&&delete e.tag,null==e.icon&&delete e.icon,null==e.iconTag&&delete e.iconTag,null==e.colorTag&&delete e.colorTag,null==e.flashcardSet&&delete e.flashcardSet,null==e.subtype&&delete e.subtype,null==e.coverImage&&delete e.coverImage,null==e.publisher&&delete e.publisher,null==e.publications&&delete e.publications,null==e.author&&delete e.author,null==e.subject&&delete e.subject,null==e.date&&delete e.date,null==e.location&&delete e.location,null==e.theme&&delete e.theme,null==e.kind&&delete e.kind,null==e.action&&delete e.action,null==e.thumbImage&&delete e.thumbImage,null==e.deeplink&&delete e.deeplink,null==e.externalLink&&delete e.externalLink,null==e.externalLinkText&&delete e.externalLinkText,null==e.videoCallLink&&delete e.videoCallLink,null==e.duration&&delete e.duration,null==e.list&&delete e.list,null==e.textReference&&delete e.textReference,null==e.isTracked&&delete e.isTracked,null==e.isInfoOnly&&delete e.isInfoOnly,null==e.labelTrue&&delete e.labelTrue,null==e.labelFalse&&delete e.labelFalse,null==e.quotedPerson&&delete e.quotedPerson,null==e.title&&delete e.title,null==e.subtitle&&delete e.subtitle,null==e.level&&delete e.level,null==e.toc&&delete e.toc,null==e.progress&&delete e.progress,null==e.anchor&&delete e.anchor,null==e.reference&&delete e.reference,null==e.referenceEnd&&delete e.referenceEnd,null==e.item&&delete e.item,null==e.lead&&delete e.lead,null==e.hint&&delete e.hint,null==e.instruction&&delete e.instruction,void 0===e.example&&delete e.example,null==e.isExample&&delete e.isExample,null==e.marks&&delete e.marks,null==e.extraProperties&&delete e.extraProperties,null==e.body&&delete e.body,null!=e.placeholders&&0!==Object.keys(e.placeholders).length||delete e.placeholders,null==e.resource&&delete e.resource,null==e.statement&&delete e.statement,null==e.isCorrect&&delete e.isCorrect,null==e.sampleSolution&&delete e.sampleSolution,null==e.partialAnswer&&delete e.partialAnswer,null==e.elements&&delete e.elements,null==e.statements&&delete e.statements,null==e.responses&&delete e.responses,null==e.quizzes&&delete e.quizzes,null==e.heading&&delete e.heading,null==e.pairs&&delete e.pairs,null==e.matrix&&delete e.matrix,null==e.choices&&delete e.choices,null==e.questions&&delete e.questions,r&&null!=e.placeholders||delete e.placeholders,null==e.footer&&delete e.footer,e}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}}},4275:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonObjectGenerator=void 0;const o=r(227),s=r(3857);t.JsonObjectGenerator=class{constructor(e){this.writer=new o.StringWriter,this.generator=new s.JsonGenerator(this.writer,e)}generate(e){return i(this,void 0,void 0,(function*(){return yield this.generator.generate(e),JSON.parse(this.writer.getString())}))}generateSync(e){return this.generator.generateSync(e),JSON.parse(this.writer.getString())}}},5132:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonStringGenerator=void 0;const o=r(227),s=r(3857);t.JsonStringGenerator=class{constructor(e){this.writer=new o.StringWriter,this.generator=new s.JsonGenerator(this.writer,e)}generate(e){return i(this,void 0,void 0,(function*(){return yield this.generator.generate(e),this.writer.getString()}))}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}}},6300:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TextGenerator=void 0;const o=r(8256),s=r(549),n=r(8791),a=r(1353),l=r(1888),u=r(2610),c={debugGenerationInline:!1},d={[l.TextMarkType.bold]:"**",[l.TextMarkType.light]:"``",[l.TextMarkType.italic]:"__",[l.TextMarkType.highlight]:"!!"},p=new RegExp("([=*_`!])([\\^]*)\\1|([\\|\\[])","g"),h="$1$3^$2$1",y=new RegExp("^(\\||•|#)","gm"),m=new RegExp(/(\n|\r\n)/,"g"),g=new RegExp(/https?:\/\/|mailto:(.*)/,"g");t.TextGenerator=class{constructor(e,t){var r;this.ast=new o.Ast,this.textFormat=a.TextFormat.bitmarkMinusMinus,this.writerText="",this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.placeholderIndex=0,this.placeholders={},this.printed=!1,this.bitmarkVersion=null!==(r=n.BitmarkVersion.fromValue(e))&&void 0!==r?r:n.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},c),t),this.bitmarkVersion,n.BitmarkVersion.v2,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this)}generate(e,t){return i(this,void 0,void 0,(function*(){return this.resetState(t),this.walkAndWrite(e),this.writerText}))}generateSync(e,t){return this.resetState(t),this.walkAndWrite(e),this.writerText}getPlaceholders(){return this.placeholders}resetState(e){this.printed=!1,this.textFormat=null!=e?e:a.TextFormat.bitmarkMinusMinus,this.writerText="",this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.placeholderIndex=0,this.placeholders={}}walkAndWrite(e){this.ast.walk(e,s.NodeType.textAst,this,void 0)}enter(e,t,r){let i;const o=this,s=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[s]&&(i=o[s](e,t,r)),i}between(e,t,r,i,o){let s;const n=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof n[a]&&(s=n[a](e,t,r,i,o)),s}exit(e,t,r){const i=this,o=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof i[o]&&i[o](e,t,r)}leaf(e,t,r){const i=this,o=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[o]&&i[o](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_textAstValue(e,t,r){this.handleEnterNode(e.value)}between_textAstValue(e,t,r,i,o){this.handleBetweenNode(e.value)}exit_textAstValue(e,t,r){this.handleExitNode(e.value)}enter_contentValueValue(e,t,r){this.handleEnterNode(e.value)}between_contentValueValue(e,t,r,i,o){this.handleBetweenNode(e.value)}exit_contentValueValue(e,t,r){this.handleExitNode(e.value)}handleEnterNode(e){switch(this.handleIndent(e),e.type){case u.TextNodeType.paragraph:this.writeParagraph(e);break;case u.TextNodeType.hardBreak:this.writeHardBreak(e);break;case u.TextNodeType.text:this.writeMarks(e,!0),this.writeText(e);break;case u.TextNodeType.heading:this.writeHeading(e);break;case u.TextNodeType.section:this.writeSection(e);break;case u.TextNodeType.listItem:case u.TextNodeType.taskItem:this.writeBullet(e);break;case u.TextNodeType.image:this.writeImage(e);break;case u.TextNodeType.codeBlock:this.inCodeBlock=!0,this.writeCodeBlock(e);break;case u.TextNodeType.gap:case u.TextNodeType.select:case u.TextNodeType.highlight:this.writeBodyBit(e)}this.exitedCodeBlock=!1}handleBetweenNode(e){e.type}handleExitNode(e){switch(e.type){case u.TextNodeType.text:this.writeMarks(e,!1);break;case u.TextNodeType.paragraph:this.textFormat!==a.TextFormat.bitmarkMinusMinus&&this.writeNL();break;case u.TextNodeType.heading:case u.TextNodeType.section:case u.TextNodeType.image:this.writeNL(),this.writeNL();break;case u.TextNodeType.codeBlock:this.writeNL(),this.writeNL(),this.inCodeBlock=!1,this.exitedCodeBlock=!0;break;case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent<=1&&this.writeNL()}this.handleDedent(e)}handleIndent(e){switch(e.type){case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent++}}handleDedent(e){switch(e.type){case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent--}}getLinkHref(e){if(e.type===u.TextNodeType.text&&e.marks){const t=e.marks.reduce(((e,t)=>{var r;if(t.type===l.TextMarkType.link){const e=null===(r=t.attrs)||void 0===r?void 0:r.href;if(e)return e}return e}),"");if(t)return t}return!1}getIndentationString(){if(this.currentIndent===this.prevIndent)return this.indentationStringCache;let e="";for(let t=1;t<this.currentIndent;t++)e+="\t";return this.indentationStringCache=e,this.prevIndent=this.currentIndent,e}writeBodyBit(e){const t=`[!${this.placeholderIndex}]`;this.writerText+=t,this.placeholders[t]=e,this.placeholderIndex++}writeText(e){if(null==e.text)return;if(this.writeLink(e))return;const t=this.inCodeBlock;let r=e.text;if(r=t?r.replace(y,"$1^"):r.replace(p,h),this.currentIndent>1){const e=this.getIndentationString();r=r.replace(m,`$1${e}`)}this.write(r)}writeLink(e){if(null==e.text)return!1;const t=this.getLinkHref(e);if(t){let r=e.text.replace(p,h);if(this.currentIndent>1){const e=this.getIndentationString();r=r.replace(m,`$1${e}`)}return t.replace(g,"$1")===r?this.write(t):(r=`==${r}==|link:${t}|`,this.write(r)),!0}return!1}writeMarks(e,t){if(e.marks)for(const r of e.marks)switch(r.type){case l.TextMarkType.bold:case l.TextMarkType.light:case l.TextMarkType.italic:case l.TextMarkType.highlight:this.writeStandardMark(r);break;case l.TextMarkType.strike:case l.TextMarkType.sub:case l.TextMarkType.super:case l.TextMarkType.ins:case l.TextMarkType.del:case l.TextMarkType.var:case l.TextMarkType.code:case l.TextMarkType.color:this.writeInlineMark(r,t);break;case l.TextMarkType.comment:this.writeCommentMark(r,t);case l.TextMarkType.link:}}writeParagraph(e){this.exitedCodeBlock&&(this.write("|"),this.writeNL(),this.writeNL())}writeHardBreak(e){if(this.writeNL(),this.currentIndent>1){const e=this.getIndentationString();this.write(e)}}writeHeading(e){var t,r;let i="";const o=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.level)&&void 0!==r?r:1;for(let e=0;e<+o;e++)i+="#";i+=" ",this.write(i)}writeSection(e){let t="";t=e.section?`|${e.section}: `:"|",this.write(t)}writeBullet(e){var t,r;let i=this.getIndentationString();if(e.parent===u.TextNodeType.bulletList)i+="• ";else if(e.parent===u.TextNodeType.orderedList)i+="•1 ";else if(e.parent===u.TextNodeType.taskList){i+=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.checked)&&void 0!==r&&r?"•+ ":"•- "}i&&this.write(i)}writeImage(e){if(null==e.attrs||!e.attrs.src)return;const t=e.attrs;let r=`|image:${t.src}|`;for(const[e,i]of Object.entries(t))switch(e){case"textAlign":"left"!==i&&(r+=`@captionAlign:${i}|`);break;case"title":i&&(r+=`@caption:${i}|`);break;case"class":"center"!==i&&i&&(r+=`@align:${i}|`);break;case"comment":i&&(r+=`#${i}|`);break;case"alt":case"width":case"height":default:i&&(r+=`@${e}:${i}|`);case"src":}this.write(r)}writeCodeBlock(e){if(null==e.attrs||!e.attrs.language)return;const t=`|code:${e.attrs.language}\n`;this.write(t)}writeStandardMark(e){const t=d[e.type];t&&this.write(t)}writeInlineMark(e,t){if(t)this.write("==");else{let t=`==|${e.type}`;if(e.attrs)for(const[r,i]of Object.entries(e.attrs))("language"===r&&"plain text"!==i||"color"===r)&&(t=`${t}:${i}`);t=`${t}|`,this.write(t)}}writeCommentMark(e,t){if(t);else if(e.comment){const t=`#${e.comment}|`;this.write(t)}}writeString(e){null!=e&&this.write(`${e}`)}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}getBitType(e){for(const t of e)if(t.key===s.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}write(e){return this.writerText+=e,this}writeLine(e){return this.write(`${e}\n`),this}writeLines(e,t){for(const r of e)this.write(`${r}${null!=t?t:""}\n`);return this}writeWhiteSpace(){return this.write(" "),this}}},7087:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const i=r(1022),o=r(671);r(2093);let s=!1;t.init=function(){s||((0,o.initEnv)(i.buildInfo.name,i.buildInfo.version),s=!0)}},549:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeType=void 0;const i=(0,r(6688).superenum)({unknown:"unknown",bitType:"bitType",alias:"alias",root:"root",textFormat:"textFormat",bitmarkAst:"bitmarkAst",bits:"bits",bitsValue:"bitsValue",properties:"properties",property:"property",propertyValues:"propertyValues",itemLead:"itemLead",body:"body",bodyParts:"bodyParts",bodyPartsValue:"bodyPartsValue",bodyPartText:"bodyPartText",data:"data",bodyText:"bodyText",footer:"footer",footerText:"footerText",gap:"gap",select:"select",highlight:"highlight",cardNode:"cardNode",elements:"elements",solutions:"solutions",options:"options",optionsValue:"optionsValue",texts:"texts",textsValue:"textsValue",statement:"statement",statements:"statements",statementsValue:"statementsValue",choices:"choices",choicesValue:"choicesValue",responses:"responses",responsesValue:"responsesValue",quizzes:"quizzes",quizzesValue:"quizzesValue",heading:"heading",forValues:"forValues",pairs:"pairs",pairsValue:"pairsValue",values:"values",matrix:"matrix",matrixValue:"matrixValue",cells:"cells",cellsValue:"cellsValue",questions:"questions",questionsValue:"questionsValue",botResponses:"botResponses",botResponsesValue:"botResponsesValue",id:"id",idValue:"idValue",externalId:"externalId",externalIdValue:"externalIdValue",spaceId:"spaceId",spaceIdValue:"spaceIdValue",releaseVersion:"releaseVersion",releaseVersionValue:"releaseVersionValue",padletId:"padletId",padletIdValue:"padletIdValue",aiGenerated:"aiGenerated",aiGeneratedValue:"aiGeneratedValue",ageRange:"ageRange",ageRangeValue:"ageRangeValue",language:"language",languageValue:"languageValue",computerLanguage:"computerLanguage",computerLanguageValue:"computerLanguageValue",target:"target",targetValue:"targetValue",tag:"tag",tagValue:"tagValue",icon:"icon",iconValue:"iconValue",iconTag:"iconTag",iconTagValue:"iconTagValue",colorTag:"colorTag",colorTagValue:"colorTagValue",flashcardSet:"flashcardSet",flashcardSetValue:"flashcardSetValue",subtype:"subtype",subtypeValue:"subtypeValue",coverImage:"coverImage",coverImageValue:"coverImageValue",publisher:"publisher",publisherValue:"publisherValue",publications:"publications",publicationsValue:"publicationsValue",author:"author",authorValue:"authorValue",subject:"subject",subjectValue:"subjectValue",date:"date",dateValue:"dateValue",location:"location",locationValue:"locationValue",theme:"theme",themeValue:"themeValue",kind:"kind",kindValue:"kindValue",action:"action",actionValue:"actionValue",thumbImage:"thumbImage",thumbImageValue:"thumbImageValue",focusX:"focusX",focusXValue:"focusXValue",focusY:"focusY",focusYValue:"focusYValue",duration:"duration",durationValue:"durationValue",deeplink:"deeplink",deeplinkValue:"deeplinkValue",externalLink:"externalLink",externalLinkText:"externalLinkText",videoCallLink:"videoCallLink",videoCallLinkValue:"videoCallLinkValue",bot:"bot",botValue:"botValue",referenceProperty:"referenceProperty",referencePropertyValue:"referencePropertyValue",list:"list",listValue:"listValue",textReference:"textReference",textReferenceValue:"textReferenceValue",isTracked:"isTracked",isTrackedValue:"isTrackedValue",isInfoOnly:"isInfoOnly",isInfoOnlyValue:"isInfoOnlyValue",labelTrue:"labelTrue",labelFalse:"labelFalse",quotedPerson:"quotedPerson",partialAnswer:"partialAnswer",partialAnswerValue:"partialAnswerValue",book:"book",item:"item",lead:"lead",hint:"hint",instruction:"instruction",isDefaultExample:"isDefaultExample",isExample:"isExample",example:"example",exampleValue:"exampleValue",extraProperties:"extraProperties",title:"title",subtitle:"subtitle",level:"level",toc:"toc",tocValue:"tocValue",progress:"progress",progressValue:"progressValue",levelProperty:"levelProperty",levelPropertyValue:"LevelPropertyValue",anchor:"anchor",reference:"reference",referenceEnd:"referenceEnd",elementsValue:"elementsValue",solutionsValue:"solutionsValue",prefix:"prefix",postfix:"postfix",isCaseSensitive:"isCaseSensitive",isShortAnswer:"isShortAnswer",isCorrect:"isCorrect",forKeys:"forKeys",forValuesValue:"forValuesValue",key:"key",valuesValue:"valuesValue",question:"question",sampleSolution:"sampleSolution",sampleSolutionValue:"sampleSolutionValue",statementText:"statementText",text:"text",propertyKey:"propertyKey",propertyValue:"propertyValue",keyAudio:"keyAudio",keyImage:"keyImage",response:"response",reaction:"reaction",feedback:"feedback",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",resource:"resource",resourceType:"resourceType",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",license:"license",copyright:"copyright",provider:"provider",showInIndex:"showInIndex",caption:"caption",posterImage:"posterImage",thumbnails:"thumbnails",thumbnailsValue:"thumbnailsValue",textAst:"textAst",textAstValue:"textAstValue",content:"contentValue",contentValue:"contentValue",contentValueValue:"contentValueValue",attrs:"attrs",section:"section",parent:"parent",marks:"marks",marksValue:"marksValue",comment:"comment",parser:"parser",version:"version",bitmarkVersion:"bitmarkVersion",warnings:"warnings",warningsValue:"warningsValue",errors:"errors",errorsValue:"errorsValue",message:"message",start:"start",end:"end",offset:"offset",line:"line",column:"column",markup:"markup"});t.NodeType=i},9881:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INFINITE_COUNT=void 0;t.INFINITE_COUNT=-1},208:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitTypeUtils=t.AliasBitType=t.RootBitType=void 0;const i=r(6688),o=(0,i.superenum)({_error:"_error",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",botActionResponse:"bot-action-response",botActionSend:"bot-action-send",browserImage:"browser-image",card1:"card-1",chapter:"chapter",cloze:"cloze",clozeAndMultipleChoiceText:"cloze-and-multiple-choice-text",code:"code",conversationLeft1:"conversation-left-1",document:"document",documentDownload:"document-download",documentEmbed:"document-embed",documentLink:"document-link",essay:"essay",example:"example",flashcard:"flashcard",focusImage:"focus-image",highlightText:"highlight-text",image:"image",imageLink:"image-link",imageOnDevice:"image-on-device",imageResponsive:"image-responsive",internalLink:"internal-link",interview:"interview",learningPathBook:"learning-path-book",learningPathExternalLink:"learning-path-external-link",learningPathVideoCall:"learning-path-video-call",mark:"mark",match:"match",matchAudio:"match-audio",matchMatrix:"match-matrix",matchPicture:"match-picture",multipleChoice:"multiple-choice",multipleChoice1:"multiple-choice-1",multipleChoiceText:"multiple-choice-text",multipleResponse:"multiple-response",multipleResponse1:"multiple-response-1",photo:"photo",quote:"quote",rating:"rating",releaseNote:"release-note",sampleSolution:"sample-solution",screenshot:"screenshot",sequence:"sequence",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",survey:"survey",surveyAnonymous:"survey-anonymous",toc:"toc",trueFalse:"true-false",trueFalse1:"true-false-1",vendorPadletEmbed:"vendor-padlet-embed",video:"video",videoEmbed:"video-embed",videoLink:"video-link",websiteLink:"website-link"});t.RootBitType=o;const s=(0,i.superenum)({aiPrompt:"ai-prompt",anchor:"anchor",appAiPrompt:"app-ai-prompt",appFlashcardsQuiz:"app-flashcards-quiz",appFlashcardsLearn:"app-flashcards-learn",articleAi:"article-ai",articleAttachment:"article-attachment",assignment:"assignment",audioTranscript:"audio-transcript",bitBookEnding:"bit-book-ending",bitBookSummary:"bit-book-summary",bitmarkExample:"bitmark-example",blogArticle:"blog-article",bookAcknowledgments:"book-acknowledgments",bookAddendum:"book-addendum",bookAfterword:"book-afterword",bookAppendix:"book-appendix",bookArticle:"book-article",bookAutherBio:"book-author-bio",bookBibliography:"book-bibliography",bookComingSoon:"book-coming-soon",bookConclusion:"book-conclusion",bookCopyright:"book-copyright",bookCopyrightPermissions:"book-copyright-permissions",bookDedication:"book-dedication",bookEndnotes:"book-endnotes",bookEpigraph:"book-epigraph",bookEpilogue:"book-epilogue",bookForword:"book-foreword",bookFrontispiece:"book-frontispiece",bookImprint:"book-imprint",bookIncitingIncident:"book-inciting-incident",bookIntroduction:"book-introduction",bookListOfContributors:"book-list-of-contributors",bookNotes:"book-notes",bookLink:"book-link",bookLinkNext:"book-link-next",bookLinkPrev:"book-link-prev",bookPostscript:"book-postscript",bookPreface:"book-preface",bookPrologue:"book-prologue",bookReadMore:"book-read-more",bookReferenceList:"book-reference-list",bookRequestForABookReview:"book-request-for-a-book-review",bookSummary:"book-summary",bookTeaser:"book-teaser",bookTitle:"book-title",botActionAnnounce:"bot-action-announce",botActionRatingNumber:"bot-action-rating-number",botActionRemind:"bot-action-remind",botActionSave:"bot-action-save",botActionTrueFalse:"bot-action-true-false",botInterview:"bot-interview",bug:"bug",chapterSubjectMatter:"chapter-subject-matter",chat:"chat",checklist:"checklist",clozeInstructionGrouped:"cloze-instruction-grouped",clozeSolutionGrouped:"cloze-solution-grouped",coachAudioTranscript:"coach-audio-transcript",coachCallToActionChecklist:"coach-call-to-action-checklist",coachCallToActionCloze:"coach-call-to-action-cloze",coachCallToActionClozeAndMultipleChoiceText:"coach-call-to-action-cloze-and-multiple-choice-text",coachCallToActionEssay:"coach-call-to-action-essay",coachCallToActionMultipleChoiceText:"coach-call-to-action-multiple-choice-text",coachHomeRules:"coach-home-rules",coachSelfReflectionCloze:"coach-self-reflection-cloze",coachSelfReflectionEssay:"coach-self-reflection-essay",coachSelfReflectionMultipleChoice:"coach-self-reflection-multiple-choice",coachSelfReflectionMultipleChoice1:"coach-self-reflection-multiple-choice-1",coachSelfReflectionMultipleChoiceText:"coach-self-reflection-multiple-choice-text",coachSelfReflectionMultipleResponse:"coach-self-reflection-multiple-response",coachSelfReflectionMultipleResponse1:"coach-self-reflection-multiple-response-1",coachSelfReflectionRating:"coach-self-reflection-rating",coachVideoTranscript:"coach-video-transcript",conclusion:"conclusion",conversationLeft1Scream:"conversation-left-1-scream",conversationLeft1Thought:"conversation-left-1-thought",conversationRight1:"conversation-right-1",conversationRight1Scream:"conversation-right-1-scream",conversationRight1Thought:"conversation-right-1-thought",cookArrangement:"cook-arrangement",cookIngredients:"cook-ingredients",cookInsert:"cook-insert",cookPersonalRecommendation:"cook-personal-recommendation",cookPlate:"cook-plate",cookPracticeAdvise:"cook-practice-advise",cookPreparation:"cook-preparation",cookRecommendation:"cook-recommendation",cookRemark:"cook-remark",cookSideDish:"cook-side-dish",cookSideDrink:"cook-side-drink",cookStep:"cook-step",cookTimer:"cook-timer",cookVariation:"cook-variation",correction:"correction",danger:"danger",details:"details",details1:"details-1",documentUpload:"document-upload",editorial:"editorial",editorNote:"editor-note",featured:"featured",figure:"figure",flashcard1:"flashcard-1",footNote:"foot-note",groupBorn:"group-born",groupDied:"group-died",help:"help",hint:"hint",imageLandscape:"image-landscape",imagePortrait:"image-portrait",imagePrototype:"image-prototype",imageSuperWide:"image-super-wide",imageZoom:"image-zoom",info:"info",interviewInstructionGrouped:"interview-instruction-grouped",langAudioScript:"lang-audio-script",langEnablingLanguageSkills:"lang-enabling-language-skills",langEnglishAroundWorld:"lang-english-around-world",langExtraActivity:"lang-extra-activity",langGoodToKnow:"lang-good-to-know",langHomework:"lang-homework",langLearningGoal:"lang-learning-goal",langLearningOutcomes:"lang-learning-outcomes",langLearningStrategy:"lang-learning-strategy",langLevelDown:"lang-level-down",langLevelUp:"lang-level-up",langLifeSkillIcon:"lang-life-skill-icon",langLifeSkills:"lang-life-skills",langLikeALocal:"lang-like-a-local",langMaterial:"lang-material",langTeacherNote:"lang-teacher-note",langTeacherPronunciation:"lang-teacher-pronunciation",langUsefulPhrases:"lang-useful-phrases",langVideoScript:"lang-video-script",langVocabulary:"lang-vocabulary",learningPathBotTraining:"learning-path-bot-training",learningPathClassroomEvent:"learning-path-classroom-event",learningPathClassroomTraining:"learning-path-classroom-training",learningPathClosing:"learning-path-closing",learningPathExternalLink:"learning-path-external-link",learningPathFeedback:"learning-path-feedback",learningPathLearningGoal:"learning-path-learning-goal",learningPathLti:"learning-path-lti",learningPathSign:"learning-path-sign",learningPathStep:"learning-path-step",learningPathVideoCall:"learning-path-video-call",matchAll:"match-all",matchAllReverse:"match-all-reverse",matchReverse:"match-reverse",matchSolutionGrouped:"match-solution-grouped",message:"message",newspaperArticle:"newspaper-article",note:"note",noteAi:"note-ai",notebookArticle:"notebook-article",page:"page",preparationNote:"preparation-note",question1:"question-1",recordAudio:"record-audio",releaseNotesSummary:"release-notes-summary",remark:"remark",reviewApprovedNote:"review-approved-note",reviewAuthorNote:"review-author-note",reviewNote:"review-note",reviewRequestForReviewNote:"review-request-for-review-note",reviewReviewerNote:"review-reviewer-note",selfAssessment:"self-assessment",sideNote:"side-note",statement:"statement",stickyNote:"sticky-note",summary:"summary",summaryAi:"summary-ai",survey1:"survey-1",surveyAnonymous1:"survey-anonymous-1",takePicture:"take-picture",videoLandscape:"video-landscape",videoPortrait:"video-portrait",videoTranscript:"video-transcript",warning:"warning",workbookArticle:"workbook-article"});t.AliasBitType=s;const n={[o.appFlashcards]:[s.appFlashcardsQuiz,s.appFlashcardsLearn],[o.article]:[s.page,s.statement],[o.book]:[s.bookAcknowledgments,s.bookAddendum,s.bookAfterword,s.bookAppendix,s.bookArticle,s.bookAutherBio,s.bookBibliography,s.bookComingSoon,s.bookConclusion,s.bookCopyright,s.bookCopyrightPermissions,s.bookDedication,s.bookEndnotes,s.bookEpigraph,s.bookEpilogue,s.bookForword,s.bookFrontispiece,s.bookImprint,s.bookIncitingIncident,s.bookIntroduction,s.bookListOfContributors,s.bookNotes,s.bookPostscript,s.bookPreface,s.bookPrologue,s.bookReadMore,s.bookReferenceList,s.bookRequestForABookReview,s.bookSummary,s.bookTeaser,s.bookTitle],[o.cloze]:[s.clozeInstructionGrouped,s.clozeSolutionGrouped,s.coachSelfReflectionCloze,s.coachCallToActionCloze],[o.clozeAndMultipleChoiceText]:[s.coachCallToActionClozeAndMultipleChoiceText],[o.conversationLeft1]:[s.conversationLeft1Scream,s.conversationLeft1Thought,s.conversationRight1,s.conversationRight1Scream,s.conversationRight1Thought],[o.essay]:[s.coachSelfReflectionEssay,s.coachCallToActionEssay],[o.example]:[s.appAiPrompt,s.aiPrompt,s.articleAi,s.articleAttachment,s.assignment,s.audioTranscript,s.bitmarkExample,s.blogArticle,s.bug,s.checklist,s.coachAudioTranscript,s.coachCallToActionChecklist,s.coachHomeRules,s.coachVideoTranscript,s.correction,s.cookPreparation,s.cookStep,s.cookIngredients,s.cookRemark,s.cookVariation,s.cookInsert,s.cookArrangement,s.cookPracticeAdvise,s.cookPlate,s.cookRecommendation,s.cookPersonalRecommendation,s.cookSideDrink,s.cookSideDish,s.cookTimer,s.danger,s.details1,s.details,s.editorial,s.editorNote,s.featured,s.help,s.hint,s.info,s.langLearningOutcomes,s.langEnablingLanguageSkills,s.langLifeSkills,s.langEnglishAroundWorld,s.langGoodToKnow,s.langLearningGoal,s.langLearningStrategy,s.langLikeALocal,s.langMaterial,s.langUsefulPhrases,s.langLevelDown,s.langLevelUp,s.langExtraActivity,s.langVideoScript,s.langAudioScript,s.langVocabulary,s.langHomework,s.langTeacherNote,s.langTeacherPronunciation,s.message,s.newspaperArticle,s.note,s.noteAi,s.notebookArticle,s.preparationNote,s.releaseNotesSummary,s.remark,s.reviewNote,s.reviewAuthorNote,s.reviewReviewerNote,s.reviewRequestForReviewNote,s.reviewApprovedNote,s.selfAssessment,s.sideNote,s.summary,s.summaryAi,s.videoTranscript,s.warning,s.workbookArticle],[o.flashcard]:[s.flashcard1],[o.image]:[s.figure,s.imageLandscape,s.imagePortrait,s.imagePrototype,s.imageSuperWide,s.imageZoom,s.langLifeSkillIcon],[o.interview]:[s.interviewInstructionGrouped,s.botInterview],[o.learningPathBook]:[s.bookLink,s.bookLinkNext,s.bookLinkPrev,s.learningPathBotTraining,s.learningPathClassroomEvent,s.learningPathClassroomTraining,s.learningPathClosing,s.learningPathFeedback,s.learningPathLearningGoal,s.learningPathLti,s.learningPathSign,s.learningPathStep],[o.card1]:[s.question1,s.survey1,s.surveyAnonymous1],[o.match]:[s.matchAll,s.matchReverse,s.matchAllReverse,s.matchSolutionGrouped],[o.multipleChoice1]:[s.coachSelfReflectionMultipleChoice1],[o.multipleChoice]:[s.coachSelfReflectionMultipleChoice],[o.multipleChoiceText]:[s.coachCallToActionMultipleChoiceText,s.coachSelfReflectionMultipleChoiceText],[o.multipleResponse1]:[s.coachSelfReflectionMultipleResponse1],[o.multipleResponse]:[s.coachSelfReflectionMultipleResponse],[o.rating]:[s.coachSelfReflectionRating],[o.toc]:[s.anchor,s.bitBookEnding,s.bitBookSummary,s.botActionAnnounce,s.botActionRatingNumber,s.botActionRemind,s.botActionSave,s.botActionTrueFalse,s.chapterSubjectMatter,s.chat,s.conclusion,s.documentUpload,s.footNote,s.groupBorn,s.groupDied,s.recordAudio,s.stickyNote,s.takePicture],[o.video]:[s.videoLandscape,s.videoPortrait]},a=new Map;class l{static getBitType(e){const t=l.getAliasedBitType(e);return{alias:t,root:l.getRootBitType(t)}}static getRootBitType(e){var t;return e&&null!==(t=a.get(e))&&void 0!==t?t:o._error}static getAliasedBitType(e){var t,r;return null!==(r=null!==(t=s.fromValue(e))&&void 0!==t?t:o.fromValue(e))&&void 0!==r?r:o._error}}t.BitTypeUtils=l,function(){for(const e of o.values())a.set(e,e);for(const[e,t]of Object.entries(n))for(const r of t)a.set(r,e)}()},6958:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParserType=void 0;const i=(0,r(6688).superenum)({antlr:"antlr",peggy:"peggy"});t.BitmarkParserType=i},8791:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_BITMARK_VERSION=t.BitmarkVersion=void 0;const i=(0,r(6688).superenum)({v2:2,v3:3});t.BitmarkVersion=i;const o=i.v3;t.DEFAULT_BITMARK_VERSION=o},1060:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BodyBitType=void 0;const i=(0,r(6688).superenum)({text:"text",gap:"gap",mark:"mark",select:"select",highlight:"highlight"});t.BodyBitType=i},7210:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetType=void 0;const i=(0,r(6688).superenum)({flashcards:"flashcards",elements:"elements",statements:"statements",quiz:"quiz",questions:"questions",matchPairs:"matchPairs",matchMatrix:"matchMatrix",botActionResponses:"botActionResponses"});t.CardSetType=i},8565:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetVersion=void 0;const i=(0,r(6688).superenum)({v1:1,v2:2});t.CardSetVersion=i},7028:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExampleType=void 0;const i=(0,r(6688).superenum)({none:"none",string:"string",boolean:"boolean"});t.ExampleType=i},4719:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyKey=void 0;const i=(0,r(6688).superenum)({id:"id",externalId:"externalId",spaceId:"spaceId",padletId:"padletId",aiGenerated:"AIGenerated",releaseVersion:"releaseVersion",ageRange:"ageRange",language:"language",computerLanguage:"computerLanguage",target:"target",tag:"tag",icon:"icon",iconTag:"iconTag",colorTag:"colorTag",flashcardSet:"flashcardSet",subtype:"subtype",coverImage:"coverImage",publisher:"publisher",publications:"publications",author:"author",subject:"subject",date:"date",location:"location",theme:"theme",kind:"kind",action:"action",thumbImage:"thumbImage",focusX:"focusX",focusY:"focusY",deeplink:"deeplink",externalLink:"externalLink",externalLinkText:"externalLinkText",videoCallLink:"videoCallLink",bot:"bot",duration:"duration",reference:"reference",list:"list",textReference:"textReference",isTracked:"isTracked",isInfoOnly:"isInfoOnly",labelTrue:"labelTrue",labelFalse:"labelFalse",quotedPerson:"quotedPerson",partialAnswer:"partialAnswer",example:"example",toc:"toc",progress:"progress",level:"level",book:"book",partner:"partner",sampleSolution:"sampleSolution",mark:"mark",type:"type",color:"color",emphasis:"emphasis",shortAnswer:"shortAnswer",longAnswer:"longAnswer",caseSensitive:"caseSensitive",reaction:"reaction",imageSource:"imageSource",mockupId:"mockupId",size:"size",format:"format",trim:"trim",width:"width",height:"height",license:"license",copyright:"copyright",caption:"caption",showInIndex:"showInIndex",alt:"alt",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",mute:"mute",autoplay:"autoplay",allowSubtitles:"allowSubtitles",showSubtitles:"showSubtitles",siteName:"siteName",posterImage:"posterImage"});t.PropertyKey=i},1895:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceType=void 0;const i=(0,r(6688).superenum)({unknown:"unknown",image:"image",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.ResourceType=i},6562:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TagType=void 0;const i=(0,r(6688).superenum)({Title:"Title",Anchor:"Anchor",Reference:"Reference",Property:"Property",ItemLead:"ItemLead",Instruction:"Instruction",Hint:"Hint",True:"True",False:"False",SampleSolution:"SampleSolution",Gap:"Gap",Mark:"Mark",Resource:"Resource",Remark:"Remark",Comment:"Comment"});t.TagType=i},1353:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextFormat=void 0;const i=(0,r(6688).superenum)({text:"text",bitmarkMinusMinus:"bitmark--",bitmarkPlusPlus:"bitmark++"});t.TextFormat=i},1888:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextMarkType=void 0;const i=(0,r(6688).superenum)({bold:"bold",light:"light",italic:"italic",highlight:"highlight",strike:"strike",sub:"sub",super:"super",ins:"ins",del:"del",link:"link",var:"var",code:"code",color:"color",hash:"#",comment:"comment"});t.TextMarkType=i},2610:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextNodeType=void 0;const i=(0,r(6688).superenum)({text:"text",hardBreak:"hardBreak",paragraph:"paragraph",heading:"heading",section:"section",bulletList:"bulletList",orderedList:"orderedList",taskList:"taskList",listItem:"listItem",taskItem:"taskItem",image:"image",codeBlock:"codeBlock",gap:"gap",select:"select",highlight:"highlight"});t.TextNodeType=i},9556:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParser=void 0;const i=r(6958),o=r(2434),s=r(8030);t.BitmarkParser=class{constructor(){this.jsonParser=new o.JsonParser}toAst(e,t){return Object.assign({},t).parserType===i.BitmarkParserType.antlr?this.jsonParser.toAst(this.parseUsingAntlr(e)):(0,s.parse)(e)}parseUsingAntlr(e){if(!function(){let e=!1;return e}())throw new Error("ANTLR parser is not available");const t=(0,bitmark_grammar_1.parse)(e);return JSON.parse(t)}}},8030:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const i=r(4369).parse;t.parse=i},2892:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserHelper=void 0;const i=r(8565),o=r(3633),s=r(7542),n=r(6831);r(2093);t.BitmarkPegParserHelper=class{constructor(e){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0,this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation}handleRawBit(e){var t,r;const i=e.trim();if(this.debugPrint("RAW BIT",i),!i)return;const o=null!==(r=null===(t=this.parserLocation())||void 0===t?void 0:t.start)&&void 0!==r?r:{line:1,column:1,offset:0},n=this.parse(e,{startRule:"bit",grammarSource:new s.PeggyGrammarLocation("bit",o)});return n.value&&(n.value.markup=i),n}handleTextFormat(e){return{type:n.TypeKey.TextFormat,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceType(e){return{type:n.TypeKey.ResourceType,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleBitContent(e){let t=this.reduceToArrayOfTypes(e);return t=this.mergeCharToText(t),t}handleBitTag(e){return e}handleTag(e,t){return{type:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handlePropertyTag(e,t){return{type:n.TypeKey.Property,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceTag(e,t){return{type:n.TypeKey.Resource,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleTagChain(e){const t=this.reduceToArrayOfTypes(e);let r=t;if(t.length>1){const e=t[0];e.chain=t.slice(1),r=[e]}return r}handleCardSet(e){const t=e,r={cards:[]},i={cards:[]};if(t){const e={text:this.parserText(),location:this.parserLocation()};for(const e of t){if(!e)continue;const{type:t,value:i,parser:o}=e;if(!t||t!==n.TypeKey.Card)continue;const{cardIndex:s,cardSideIndex:a,cardVariantIndex:l,value:u}=i;let c=r.cards[s];c||(c={sides:[]},r.cards[s]=c);let d=c.sides[a];d||(d={variants:[]},c.sides[a]=d);d.variants[l]?d.variants[l].value+=u:d.variants[l]={value:u,parser:o}}r.cards=r.cards.filter((e=>e.sides.some((e=>e.variants.some((e=>0!==o.StringUtils.trimmedString(e.value).length))))));for(const t of r.cards){const r={sides:[]};i.cards.push(r);for(const i of t.sides){const t={variants:[]};r.sides.push(t);for(const r of i.variants){let i={line:1,column:1,offset:0};if(r.parser.location){i=r.parser.location.start;const e=r.parser.text,t=e?e.length:0,o=1;i.offset+=t,i.line+=o}let o=this.parse(r.value,{startRule:"cardContent",grammarSource:new s.PeggyGrammarLocation("card-content",i)});o=this.reduceToArrayOfTypes(o),this.debugPrint("parsedCardContent",o),t.variants.push({parser:e,content:o})}}}}return{type:n.TypeKey.CardSet,value:i,parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardSetStart(){this.cardIndex=-1,this.cardSideIndex=0,this.cardVariantIndex=0}handleCardSetEnd(){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0}handleCards(e){return e}handleCardLineOrDivider(e,t){let r=!1,o=!1,s=!1;return Array.isArray(e)&&2===e.length&&(e=e[0],t===i.CardSetVersion.v1?(r=e===n.CARD_DIVIDER_V1,o=e===n.CARD_SIDE_DIVIDER_V1,s=e===n.CARD_VARIANT_DIVIDER_V1):(r=e===n.CARD_DIVIDER_V2,o=e===n.CARD_SIDE_DIVIDER_V2,s=e===n.CARD_VARIANT_DIVIDER_V2)),r?(this.cardIndex++,this.cardSideIndex=0,this.cardVariantIndex=0):o?(this.cardSideIndex++,this.cardVariantIndex=0):s&&this.cardVariantIndex++,this.isType(e,n.TypeKey.Card)?e:{type:n.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:""},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardLine(e){return{type:n.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:e},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardContent(e){return this.mergeCharToText(e)}handleCardTags(e){return e}mergeCharToText(e){var t,r,i,o,s,a;const l=[];let u,c;for(const d of e)switch(d.type){case n.TypeKey.BodyChar:if(u){const e=`${null!==(t=u.value)&&void 0!==t?t:""}${null!==(r=d.value)&&void 0!==r?r:""}`;u.value=e}else u={type:n.TypeKey.BodyText,value:null!==(i=d.value)&&void 0!==i?i:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;case n.TypeKey.CardChar:if(c){const e=`${null!==(o=c.value)&&void 0!==o?o:""}${null!==(s=d.value)&&void 0!==s?s:""}`;c.value=e}else c={type:n.TypeKey.CardText,value:null!==(a=d.value)&&void 0!==a?a:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;default:u&&(l.push(u),u=void 0),c&&(l.push(c),c=void 0),l.push(d)}return u&&l.push(u),c&&l.push(c),l}isType(e,t){if(!e)return!1;const{type:r}=e;return t?Array.isArray(t)?t.indexOf(r)>=0:t===r:!!n.TypeKey.fromValue(r)}reduceToArrayOfTypes(e,t,r){if(!Array.isArray(e))return[];return e.reduce(((e,i,o)=>{if(null==i)return e;const{type:s,value:n}=i;if(Array.isArray(i)){const r=this.reduceToArrayOfTypes(i,t);e.push(...r)}else{if(!this.isType(i,t))return e;if(r&&Array.isArray(n)){const r=this.reduceToArrayOfTypes(n,t);e.push(...r)}else s&&e.push(i)}return e}),[])}debugPrint(e,t){}}},7448:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserProcessor=void 0;const o=r(9046),s=r(208),n=r(1060),a=r(1895),l=r(1353),u=r(8386),c=r(1182),d=r(6934),p=r(8081),h=r(9577),y=r(9457),m=r(857),g=r(3287),f=r(3130),b=r(5516),v=r(1838),T=r(4177),A=r(6831),_=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 _.bitmark({bits:r,errors:i.length>0?i:void 0})}buildBit(e,t){const{bitType:r,textFormat:o,resourceType:n}=e;if(!r||r.root===s.RootBitType._error)return this.invalidBit();const a=r.root===s.RootBitType.trueFalse1,l=r.root===s.RootBitType.multipleChoice1,d=r.root===s.RootBitType.multipleResponse1;this.debugPrint("BIT CONTENT",t),this.resetParserState(),t=u.BitmarkPegParserValidator.validateBitTags(this.context,r,t);const p=this.bitContentProcessor(A.BitContentLevel.Bit,r,t),{body:h,footer:y,cardSet:m,title:g,statement:f,statements:T,choices:P,responses:S,resources:x,comments:w}=p,R=i(p,["body","footer","cardSet","title","statement","statements","choices","responses","resources","comments"]);this.debugPrint("BIT TAGS",R),this.debugPrint("BIT BODY",h),this.debugPrint("BIT FOOTER",y);const O=(0,v.buildTitles)(this.context,r,g),k=(0,c.buildCards)(this.context,r,m,f,T,P,S),C=(0,b.buildResource)(this.context,r,n,x);(w||k.comments)&&(this.parser.comments=[],w&&this.parser.comments.push(...w),k.comments&&this.parser.comments.push(...k.comments));const E=this.buildBitLevelWarnings(),I=this.buildBitLevelErrors();E&&(this.parser.warnings=E),I&&(this.parser.errors=I);return{value:_.bit(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({bitType:r,textFormat:o,resourceType:n},O),{statement:a?f:void 0,choices:l?P:void 0,responses:d?S:void 0}),R),{resource:C}),k),{body:h,footer:y,parser:this.parser}))}}invalidBit(e){e&&this.addError("Invalid bit"),this.parser.errors=this.buildBitLevelErrors();return{value:_.bit({bitType:s.BitTypeUtils.getBitType(s.RootBitType._error),parser:this.parser})}}buildBitHeader(e,t){var r;const i=s.BitTypeUtils.getBitType(e);return i.root===s.RootBitType._error&&this.addError(`Invalid bit type: '${e}'`),{bitType:i,textFormat:null!==(r=t.textFormat)&&void 0!==r?r:l.TextFormat.bitmarkMinusMinus,resourceType:t.resourceType}}buildTextAndResourceType(e,t){const r={textFormat:l.TextFormat.bitmarkMinusMinus},i=e=>{var t;e&&(e.type===A.TypeKey.TextFormat?(r.textFormat=l.TextFormat.fromValue(e.value),e.value&&!r.textFormat&&this.addWarning(`Invalid text format '${e.value}', defaulting to '${l.TextFormat.bitmarkMinusMinus}'`),r.textFormat=null!==(t=r.textFormat)&&void 0!==t?t:l.TextFormat.bitmarkMinusMinus):(r.resourceType=a.ResourceType.fromValue(e.value),e.value&&!r.resourceType&&this.addWarning(`Invalid resource type '${e.value}', it will be ignored`)))};return i(e),i(t),r}resetParserState(){this.context.state={}}bitContentProcessor(e,t,r){const i={};if(!r)return i;i.title=[],i.solutions=[],i.statements=[],i.choices=[],i.responses=[],i.resources=[],i.trueFalse=[],i.markConfig=[],i.extraProperties={},i.comments=[];let o=!1,s=!1,n=!1;const a=[];let l="",c="",P="";const S=e===A.BitContentLevel.Chain,x=()=>{if(l){l=u.BitmarkPegParserValidator.checkBodyPart(this.context,e,t,l);const r=_.bodyText({text:l});a.push(r)}l=""};return r.forEach(((r,u)=>{const{type:_,value:w}=r;switch(_){case A.TypeKey.Comment:(0,d.commentTagContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.ItemLead:(0,y.itemLeadTagContentProcessor)(this.context,e,t,r,i,o),o=!0;break;case A.TypeKey.Instruction:case A.TypeKey.Hint:case A.TypeKey.Anchor:case A.TypeKey.SampleSolution:(0,p.defaultTagContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.Reference:(0,f.referenceTagContentProcessor)(this.context,e,t,r,i,s),s=!0;break;case A.TypeKey.Title:(0,v.titleTagContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.Property:(0,g.propertyContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.Gap:S||x(),(0,h.gapChainContentProcessor)(this.context,e,t,r,i,a);break;case A.TypeKey.Mark:S||x(),(0,m.markChainContentProcessor)(this.context,e,t,r,i,a);break;case A.TypeKey.True:case A.TypeKey.False:S||x(),(0,T.trueFalseChainContentProcessor)(this.context,e,t,r,i,a);break;case A.TypeKey.Resource:(0,b.resourceContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.CardSet:i.cardSet=w,n=!0;break;case A.TypeKey.BodyText:n?c+=w:l+=w;break;case A.TypeKey.CardText:P+=w}})),x(),i.body=a.length>0?_.body({bodyParts:this.trimBodyParts(a)}):void 0,u.BitmarkPegParserValidator.checkBody(this.context,e,t,i.body),c=c.trim(),c&&(c=u.BitmarkPegParserValidator.checkFooter(this.context,e,t,c),c&&(i.footer=_.footerText({text:c}))),P=P.trim(),P&&(i.cardBody=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 i=[];for(const o of e)t.includes(o.type)&&(i.length>0&&r.push(i),i=[]),i.push(o);return i.length>0&&r.push(i),r}trimBodyParts(e){let t=!1,r=e.reduce(((e,r)=>{const i=r;if(t||i.type!==n.BodyBitType.text)t=!0,e.push(r);else{const r=i.data.bodyText.trimStart();r&&(t=!0,i.data.bodyText=r,e.push(i))}return e}),[]);return t=!1,r=r.reduceRight(((e,r)=>{const i=r;if(t||i.type!==n.BodyBitType.text)t=!0,e.unshift(r);else{const r=i.data.bodyText.trimEnd();r&&(t=!0,i.data.bodyText=r,e.unshift(i))}return e}),[]),r}addWarning(e,t,r){var i,o,s;const n={message:e,text:null!==(i=null==t?void 0:t.parser.text)&&void 0!==i?i:this.parserText(),location:null!==(o=null==t?void 0:t.parser.location)&&void 0!==o?o:this.parserLocation(),original:null!==(s=null==r?void 0:r.parser)&&void 0!==s?s:void 0};n.original||delete n.original,this.nonFatalWarnings.push(n)}addError(e,t,r){var i,o,s;const n={message:e,text:null!==(i=null==t?void 0:t.parser.text)&&void 0!==i?i:this.parserText(),location:null!==(o=null==t?void 0:t.parser.location)&&void 0!==o?o:this.parserLocation(),original:null!==(s=null==r?void 0:r.parser)&&void 0!==s?s:void 0};n.original||delete n.original,this.nonFatalErrors.push(n)}debugPrint(e,t){}}},6831:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARD_VARIANT_DIVIDER_V1=t.CARD_SIDE_DIVIDER_V1=t.CARD_DIVIDER_V1=t.CARD_VARIANT_DIVIDER_V2=t.CARD_SIDE_DIVIDER_V2=t.CARD_DIVIDER_V2=t.BitContentLevel=t.TypeKey=void 0;const i=r(6688);t.CARD_DIVIDER_V2="====";t.CARD_SIDE_DIVIDER_V2="--";t.CARD_VARIANT_DIVIDER_V2="++";t.CARD_DIVIDER_V1="===";t.CARD_SIDE_DIVIDER_V1="==";t.CARD_VARIANT_DIVIDER_V1="--";const o=(0,i.superenum)({TextFormat:"TextFormat",ResourceType:"ResourceType",Title:"Title",Anchor:"Anchor",Reference:"Reference",ItemLead:"ItemLead",Instruction:"Instruction",Hint:"Hint",True:"True",False:"False",Gap:"Gap",Mark:"Mark",SampleSolution:"SampleSolution",Comment:"Comment",Property:"Property",Resource:"Resource",TagChain:"TagChain",BodyChar:"BodyChar",BodyText:"BodyText",CardSet:"CardSet",Card:"Card",CardChar:"CardChar",CardText:"CardText",GapChain:"GapChain",TrueFalseChain:"TrueFalseChain"});t.TypeKey=o;const s=(0,i.superenum)({Bit:"Bit",Card:"Card",Chain:"Chain"});t.BitContentLevel=s},8386:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserValidator=void 0;const i=r(9881),o=r(208),s=r(6831),n=["====","----","\n==\n","\n---\n","\n--\n",":::","::::","|||","||||"],a=["==\n","---\n","--\n"],l=["\n==","\n---","\n--"];const u=new class{validateBitTags(e,t,r){if(!r)return[];const i=this.getMetadataForBitType(t),{tags:o,cardSet:n}=i;return this.validateTagChainsRecursive(e,s.BitContentLevel.Bit,t,r,o,n)}checkBody(e,t,r,i){if(!i)return i;const o=this.getMetadataForBitType(r),{bodyAllowed:s}=o;return i.bodyParts.length>0&&!s&&e.addWarning(`Bit '${r.alias}' should not have a body.`),i}checkBodyPart(e,t,r,i){return i?(this.checkBodyForCommonPotentialMistakes(e,t,r,i),i):i}checkFooter(e,t,r,i){if(!i)return i;const o=this.getMetadataForBitType(r),{footerAllowed:s}=o;return this.checkBodyForCommonPotentialMistakes(e,t,r,i),s||e.addWarning(`Bit '${r.alias}' should not have a footer.`),i}checkCardBody(e,t,r,i,o,s,n){if(!i)return i;const a=this.getMetadataForBitType(r);if(!a.cardSet)return i;const l=this.getVariantConfig(a.cardSet.variants,s,n);if(!l)return i;const{bodyAllowed:u}=l;return this.checkBodyForCommonPotentialMistakes(e,t,r,i),u||e.addWarning(`Bit '${r.alias}' should not have a card body at card:${o+1}, side:${s+1}, variant:${n+1}.`),i}validateTagChainsRecursive(e,t,r,o,n,a){if(!o)return[];const l=[...o],u=new Map,c=this.convertTagsToTypeKeyMap(n);c.set(s.TypeKey.Comment,{maxCount:i.INFINITE_COUNT}),t===s.BitContentLevel.Bit?(a&&c.set(s.TypeKey.CardSet,{_key:a.type}),c.set(s.TypeKey.TextFormat,{}),c.set(s.TypeKey.BodyText,{maxCount:i.INFINITE_COUNT})):t===s.BitContentLevel.Card&&c.set(s.TypeKey.CardText,{maxCount:i.INFINITE_COUNT});for(let i=0;i<l.length;i++){const o=l[i];if(!o)continue;const{type:n,key:d}=o,p=s.TypeKey.fromValue(n);if(!p)continue;let h=p;p!==s.TypeKey.Property&&p!==s.TypeKey.Resource||(h=`${p}:${d}`);const y=c.get(h),m=this.validateSingleTag(e,t,r,o,p,h,y,u,a);if(m||l.splice(i,1,null),m&&Array.isArray(m.chain)&&m.chain.length>0)if(y&&y.chain){const t=this.validateTagChainsRecursive(e,s.BitContentLevel.Chain,r,m.chain,y.chain);t&&t.length>0?m.chain=t:m.chain=void 0}else l.splice(i+1,0,...m.chain),m.chain=void 0}return l.filter((e=>null!=e))}validateSingleTag(e,t,r,i,o,n,a,l,u){const{type:c,key:d}=i,p=c===s.TypeKey.Property||c===s.TypeKey.Resource?` with key '${d}'`:"",h=" It will be ignored";let y,m,g="",f=l.get(n);null==f&&(f={count:0},l.set(n,f));let b=f.previous;if(f.count++,a)switch(o){case s.TypeKey.Property:{const{content:o,warning:s}=this.validatePropertyTag(e,t,r,a,i,f);y=o,m=s;break}case s.TypeKey.Resource:{const{content:o,warning:s}=this.validateResourceTag(e,t,r,a,i,f);y=o,m=s;break}case s.TypeKey.CardSet:{const{content:t,warning:o}=this.validateCardSet(e,r,a,i,u);y=t,m=o;break}default:{const{content:o,warning:s}=this.validateStandardTag(e,t,r,a,i,f);y=o,m=s}}else switch(o){case s.TypeKey.Property:m={extraProperty:!0},y=i;break;case s.TypeKey.Resource:m={excessResource:!0},y=i;break;default:m={invalid:!0}}return m&&(b=f.previous,m.invalid||m.excessResource?g=`'${c}'${p} is not valid here.${h}`:m.tooMany?g=`'${c}'${p} is included more than ${m.tooMany} time(s). The earlier ones will be ignored`:m.extraProperty?g=`'${c}'${p} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`:m.unexpectedCardSet?g=`'${c}'${p} is not expected here.${h}`:m.unexpectedCardSideVariant&&(g=`'${c}'${p} has a card / side / variant that is not expected here.${h}`),e.addWarning(g,i,b)),f.previous=i,y}validateStandardTag(e,t,r,i,o,s){const n=null==i.maxCount?1:i.maxCount;return n>0&&s.count>n?{warning:{tooMany:n},content:o}:{content:o}}validatePropertyTag(e,t,r,i,o,s){const n=null==i.maxCount?1:i.maxCount;return n>0&&s.count>n?{warning:{tooMany:n},content:o}:{content:o}}validateResourceTag(e,t,r,i,o,s){const n=null==i.maxCount?1:i.maxCount;return n>0&&s&&s.count>n?{warning:{tooMany:n},content:o}:{content:o}}validateCardSet(e,t,r,i,o){if(!o||!o.variants||0===o.variants.length)return{warning:{unexpectedCardSet:!0}};const{value:n}=i,a=n;let l,u=0,c=0;for(const r of a.cards){u=0;for(const i of r.sides){c=0;for(const r of i.variants){const n=r.content;let a;const d=this.getVariantConfig(o.variants,u,c);d?a=this.validateTagChainsRecursive(e,s.BitContentLevel.Card,t,n,d.tags):l={unexpectedCardSideVariant:!0},a&&a.length>0?i.variants[c]={parser:r.parser,content:a}:i.variants[c]={parser:r.parser,content:[]},c++}u++}}return{content:i,warning:l}}checkBodyForCommonPotentialMistakes(e,t,r,i){if(i){for(const t of n)i.includes(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of a)i.startsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of l)i.endsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`)}}convertTagsToTypeKeyMap(e){const t=new Map;for(const[r,i]of Object.entries(e))if(i._key=r,i.isProperty)t.set(`${s.TypeKey.Property}:${r}`,i);else if(i.isResource)t.set(`${s.TypeKey.Resource}:${r}`,i);else{const e=s.TypeKey.fromValue(r);e&&t.set(e,i)}return t}getVariantConfig(e,t,r){let i;if(0===e.length)return;const o=e[Math.min(t,e.length-1)],s=o.length-1;if(r>s){if(i=o[s],!i.infiniteRepeat)return}else i=o[r];return i}getMetadataForBitType(e){const t=o.RootBitType.getMetadata(e.root);if(!t)throw new Error(`Root bit type ${e.root} has no metadata`);return t}};t.BitmarkPegParserValidator=u},7542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PeggyGrammarLocation=void 0;t.PeggyGrammarLocation=class{constructor(e,t){this.source=e,this.start=t}toString(){return String(this.source)}offset(e){return{line:e.line+this.start.line-1,column:1===e.line?e.column+this.start.column-1:e.column,offset:e.offset+this.start.offset}}static offsetStart(e){return e.source&&"function"==typeof e.source.offset?e.source.offset(e.start):e.start}static offsetEnd(e){return e.source&&"function"==typeof e.source.offset?e.source.offset(e.end):e.end}}},4185:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.bookChainContentProcessor=void 0;const i=r(3633),o=r(6831);t.bookChainContentProcessor=function(e,t,r,s,n){if(t===o.BitContentLevel.Chain);else{const t=function(e,t,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("book content",r);const s=e.bitContentProcessor(o.BitContentLevel.Chain,t,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("book TAGS",s);const{reference:n,referenceEnd:a}=s,l=i.StringUtils.trimmedString(r.value);return{book:l,reference:n,referenceEnd:a}}(e,r,s);n.book=t.book,n.reference=t.reference,n.referenceEnd=t.referenceEnd}}},1182:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.buildCards=void 0;const o=r(9046),s=r(208),n=r(7210),a=r(1895),l=r(8386),u=r(6831),c=new o.Builder;t.buildCards=function(e,t,r,o,d,p,h){var y;e.DEBUG_CARD_SET&&e.debugPrint("card set",r);let m={};const g=function(e,t,r){const i={cards:[],comments:[]};if(!r)return i;let o=0,s=0,n=0;for(const a of r.cards){const r={no:o++,sides:[]};i.cards.push(r);for(const o of a.sides){const a={no:s++,variants:[]};r.sides.push(a);for(const s of o.variants){const{parser:o,content:c}=s,d={parser:o,no:n++};a.variants.push(d);const p=e.bitContentProcessor(u.BitContentLevel.Card,t,c);e.DEBUG_CARD_TAGS&&e.debugPrint("card tags",p),p.cardBody=l.BitmarkPegParserValidator.checkCardBody(e,u.BitContentLevel.Card,t,p.cardBody,r.no,a.no,d.no),d.data=p,p.comments&&i.comments.push(...p.comments)}n=0}s=0}return i}(e,t,r),f=s.RootBitType.getMetadata(t.root);switch(f&&(null===(y=f.cardSet)||void 0===y?void 0:y.type)){case n.CardSetType.flashcards:m=function(e,t,r){const o=[];let n,a,l="",u=[],d=0,p=0,h={};const y=t.alias===s.AliasBitType.flashcard1;for(const s of r.cards){l="",n=void 0,u=[],p=0,h={};for(const e of s.sides)for(const t of e.variants){const e=t.data,{cardBody:r}=e,o=i(e,["cardBody"]);h=Object.assign(Object.assign({},h),o),0===p?(a=t,l=null!=r?r:""):1===p?n=null!=r?r:"":u.push(null!=r?r:""),p++}if(0!==d&&y){e.addWarning(`Bit '${t.alias}' should only contain one card. Ignore subsequent card: '${l}'`,a);break}o.push(c.flashcard(Object.assign({question:l,answer:n,alternativeAnswers:u.length>0?u:void 0},h))),d++}return{flashcards:o.length>0?o:void 0}}(e,t,g);break;case n.CardSetType.elements:m=function(e,t,r){var i;const o=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data;o.push(null!==(i=t.cardBody)&&void 0!==i?i:"")}return{elements:o.length>0?o:void 0}}(0,0,g);break;case n.CardSetType.statements:m=function(e,t,r,o,s){const n=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{statements:r}=t,o=i(t,["statements"]);if(Array.isArray(r))for(const e of r){const t=c.statement(Object.assign(Object.assign(Object.assign({},e),e.itemLead),o));n.push(t)}}o&&n.push(o);Array.isArray(s)&&s.length>0&&n.push(...s);return{statements:n.length>0?n:void 0}}(0,0,g,o,d);break;case n.CardSetType.quiz:m=function(e,t,r,o,n){const a=[],l=t.root===s.RootBitType.multipleChoice,u=t.root===s.RootBitType.multipleResponse;if(!l&&!u)return{};let d,p=!1;for(const e of r.cards){p=!1,d="";for(const t of e.sides)for(const e of t.variants){const t=e.data,{isDefaultExample:r,example:o}=t,s=i(t,["isDefaultExample","example"]);if(p=!0===r||p,d=o||d,s.trueFalse&&s.trueFalse.length>0){const e=[],t=u?c.response:c.choice;for(const r of s.trueFalse){const{isDefaultExample:o,example:s}=r,n=i(r,["isDefaultExample","example"]),a=o||p,l=s||d,u=t(Object.assign(Object.assign({},n),{isDefaultExample:a,example:l}));e.push(u)}u?s.responses=e:s.choices=e}const n=c.quiz(Object.assign(Object.assign({},s),{isDefaultExample:p,example:d}));a.push(n)}}if(l&&Array.isArray(o)&&o.length>0){const e=c.quiz({choices:o});a.push(e)}if(u&&Array.isArray(n)&&n.length>0){const e=c.quiz({responses:n});a.push(e)}return{quizzes:a.length>0?a:void 0}}(0,t,g,p,h);break;case n.CardSetType.questions:m=function(e,t,r){var i;const o=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,r=c.question(Object.assign({question:null!==(i=t.cardBody)&&void 0!==i?i:""},t));o.push(r)}return{questions:o.length>0?o:void 0}}(0,0,g);break;case n.CardSetType.matchPairs:m=function(e,t,r){let o,s=0;const n=[];let l;const u=[];let d,p,h,y,m,g=[],f={},b=!1,v=!1;for(const e of r.cards){l=void 0,d=void 0,g=[],p=void 0,h=void 0,s=0,f={},v=!1,m="";for(const t of e.sides){for(const e of t.variants){const t=e.data,{cardBody:r,title:o,resources:n,isDefaultExample:c,example:T}=t,A=i(t,["cardBody","title","resources","isDefaultExample","example"]);v=!0===c||v,m=T||m;const _=o&&o[1];if(0===s)if(null!=_)l=_,b=!0===c||b,y=T||y;else if(Array.isArray(n)&&n.length>0){const e=n[0];e.type===a.ResourceType.audio?p=e:e.type===a.ResourceType.image&&(h=e)}else d=r;else if(null!=_)u.push(_),b=!0===c||b,y=T||y;else if(null==o){const e=null!=r?r:"";g.push(e),!b&&!v||m||(m=e)}f=Object.assign(Object.assign(Object.assign({},f),A),{isCaseSensitive:!0})}s++}if(null!=l)o=c.heading({forKeys:l,forValues:u});else{v&&(y=void 0);const e=v||b,t=m||y,r=c.pair(Object.assign(Object.assign({key:null!=d?d:"",keyAudio:p,keyImage:h,values:g,isShortAnswer:!0},f),{isDefaultExample:e,example:t}));n.push(r)}}return{heading:o,pairs:n.length>0?n:void 0}}(0,0,g);break;case n.CardSetType.matchMatrix:m=function(e,t,r){let o,s,n=0;const a=[];let l;const u=[];let d,p,h,y=[],m=[],g={},f=!1,b=!1,v=!1;for(const e of r.cards){s=void 0,l=void 0,y=[],m=[],n=0,b=!1,p="";for(const t of e.sides){m=[],g={},v=!1,h="";for(const e of t.variants){const t=e.data,{title:r,cardBody:o,isDefaultExample:u,example:c}=t,y=i(t,["title","cardBody","isDefaultExample","example"]);v=!0===u||v,h=c||h,Object.assign(g,y);const T=r&&r[1];if(0===n)null!=T?(s=T,f=!0===u||f,d=c||d):(l=o,b=!0===u||b,p=c||p);else if(null!=T)a.push(T),f=!0===u||f,d=c||d;else if(null==t.title){const e=null!=o?o:"";m.push(e),!f&&!v||h||(h=e)}}if(n>0){v&&(p=d=void 0),b&&(d=void 0);const e=v||b||f,t=h||p||d,r=c.matrixCell(Object.assign(Object.assign({values:m},g),{isDefaultExample:e,example:t}));y.push(r)}n++}if(null!=s)o=c.heading({forKeys:s,forValues:a});else{const e=c.matrix({key:null!=l?l:"",cells:y,isShortAnswer:!0,isCaseSensitive:!0});u.push(e)}}return{heading:o,matrix:u.length>0?u:void 0}}(0,0,g);break;case n.CardSetType.botActionResponses:m=function(e,t,r){const o=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{instruction:r,reaction:s,cardBody:n}=t,a=i(t,["instruction","reaction","cardBody"]),l=c.botResponse(Object.assign({response:null!=r?r:"",reaction:null!=s?s:"",feedback:null!=n?n:""},a));o.push(l)}return{botResponses:o.length>0?o:void 0}}(0,0,g)}return m.comments=g.comments.length>0?g.comments:void 0,m}},4471:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clozeTagContentProcessor=void 0;const i=r(3633);t.clozeTagContentProcessor=function(e,t,r,o,s){const{value:n}=o,a=s.solutions;if(a&&i.StringUtils.isString(n)){const e=i.StringUtils.trimmedString(n);a.push(e)}}},6934:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.commentTagContentProcessor=void 0;const i=r(9046),o=r(3633),s=new i.Builder;t.commentTagContentProcessor=function(e,t,r,i,n){if(!n.comments)return;const{value:a}=i,l=o.StringUtils.isString(a)?a:"",u=s.comment({text:l,location:i.parser.location});n.comments.push(u)}},8081:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTagContentProcessor=void 0;const i=r(3633),o=r(6831);t.defaultTagContentProcessor=function(e,t,r,s,n){const{type:a,value:l}=s,u=i.StringUtils.trimmedString(l);switch(a){case o.TypeKey.Instruction:n.instruction=u;break;case o.TypeKey.Hint:n.hint=u;break;case o.TypeKey.Anchor:n.anchor=u;break;case o.TypeKey.Reference:n.reference=u;break;case o.TypeKey.SampleSolution:n.sampleSolution=u,e.addWarning("[$...] tag is deprecated, use [@sampleSolution:...] instead",s)}}},4787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.exampleTagContentProcessor=void 0;const i=r(208),o=r(672);function s(e,t,r,i,o){!0===i?(o.isDefaultExample=!0,o.example=void 0):o.example=i}t.exampleTagContentProcessor=function(e,t,r,n,a){const{value:l}=n,u=l;switch(r.root){case i.RootBitType.cloze:case i.RootBitType.clozeAndMultipleChoiceText:case i.RootBitType.multipleChoiceText:case i.RootBitType.highlightText:case i.RootBitType.trueFalse:case i.RootBitType.trueFalse1:case i.RootBitType.multipleResponse:case i.RootBitType.multipleResponse1:case i.RootBitType.multipleChoice:case i.RootBitType.multipleChoice1:!function(e,t,r,n,a){var l,u;let c;Array.isArray(a.trueFalse)&&a.trueFalse.length>0&&(c=null!==(l=a.trueFalse[a.trueFalse.length-1])&&void 0!==l?l:void 0);if(c)!0===n?(c.isDefaultExample=!0,c.example=void 0):o.BooleanUtils.isBooleanString(n)?c.example=n:(c.isDefaultExample=!0,c.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",r));else if(Array.isArray(a.solutions)&&a.solutions.length>0)a.example=!0===n?null!==(u=a.solutions[a.solutions.length-1])&&void 0!==u?u:void 0:n;else switch(t.root){default:case i.RootBitType.cloze:s(e,t,r,n,a);break;case i.RootBitType.multipleChoiceText:case i.RootBitType.highlightText:case i.RootBitType.trueFalse:case i.RootBitType.trueFalse1:case i.RootBitType.multipleResponse:case i.RootBitType.multipleResponse1:!function(e,t,r,i,s){!0===i?(s.isDefaultExample=!0,s.example=void 0):o.BooleanUtils.isBooleanString(i)?s.example=i:(s.isDefaultExample=!0,s.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",r))}(e,0,r,n,a);break;case i.RootBitType.clozeAndMultipleChoiceText:case i.RootBitType.multipleChoice:case i.RootBitType.multipleChoice1:a.isDefaultExample=!0,a.example=void 0,!0!==n&&e.addWarning("At this level, only default [@example] is allowed, using default",r)}}(e,r,n,u,a);break;case i.RootBitType.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,n,u,a);break;default:s(e,r,n,u,a)}}},9577:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.gapChainContentProcessor=void 0;const o=r(9046),s=r(4471),n=r(6831),a=new o.Builder;t.gapChainContentProcessor=function(e,t,r,o,l,u){if(t===n.BitContentLevel.Chain)(0,s.clozeTagContentProcessor)(e,t,r,o,l);else{const t=function(e,t,r){var o;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("gap content",r);const s=[r,...null!==(o=r.chain)&&void 0!==o?o:[]],l=e.bitContentProcessor(n.BitContentLevel.Chain,t,s);e.DEBUG_CHAIN_TAGS&&e.debugPrint("gap TAGS",l);const{solutions:u}=l,c=i(l,["solutions"]),d=a.gap(Object.assign(Object.assign({solutions:null!=u?u:[]},c),{isCaseSensitive:!0}));return d}(e,r,o);t&&u.push(t)}}},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),s=r(3633),n=r(6831),a=new o.Builder;t.imageSourceChainContentProcessor=function(e,t,r,o,l){t===n.BitContentLevel.Chain?function(e,t,r,i,o){const{value:n}=i,a=s.StringUtils.trimmedString(n);o.imageSourceUrl=a}(0,0,0,o,l):function(e,t,r,o,s){var l;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("imageSource content",o);const u=[o,...null!==(l=o.chain)&&void 0!==l?l:[]],c=e.bitContentProcessor(n.BitContentLevel.Chain,r,u);e.DEBUG_CHAIN_TAGS&&e.debugPrint("imageSource TAGS",c);const{imageSourceUrl:d,mockupId:p}=c,h=i(c,["imageSourceUrl","mockupId"]);d||e.addWarning("[@imageSource] is missing the image url",o);p||e.addWarning("[@mockupId:xxx] is missing from [@imageSource]",o);const y=a.imageSource(Object.assign({url:null!=d?d:"",mockupId:null!=p?p:""},h));s.imageSource=y}(e,0,r,o,l)}},9457:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.itemLeadTagContentProcessor=void 0;const i=r(3633);t.itemLeadTagContentProcessor=function(e,t,r,o,s,n){const{value:a}=o,l=i.StringUtils.trimmedString(a);n?s.lead=l:s.item=l}},857:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markChainContentProcessor=void 0;const o=r(9046),s=r(7646),n=r(3298),a=r(6831),l=new o.Builder;t.markChainContentProcessor=function(e,t,r,o,u,c){if(t===a.BitContentLevel.Chain)(0,n.markTagContentProcessor)(e,a.BitContentLevel.Chain,r,o,u);else{const t=function(e,t,r){var o,n;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",r);const u=[r,...null!==(o=r.chain)&&void 0!==o?o:[]],c=e.bitContentProcessor(a.BitContentLevel.Chain,t,u);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",c);const{solution:d,mark:p}=c,h=i(c,["solution","mark"]),y=l.mark(Object.assign({solution:null!=d?d:"",mark:null!==(n=s.ArrayUtils.asSingle(p))&&void 0!==n?n:""},h));return y}(e,r,o);t&&c.push(t)}}},2595:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markConfigChainContentProcessor=void 0;const o=r(9046),s=r(3633),n=r(6831),a=new o.Builder;t.markConfigChainContentProcessor=function(e,t,r,o,l){var u;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",o);const c=l.markConfig;if(!c)return;const d=e.bitContentProcessor(n.BitContentLevel.Chain,r,o.chain),{mark:p}=d,h=i(d,["mark"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",h);const y=null!==(u=s.StringUtils.trimmedString(o.value))&&void 0!==u?u:"unknown",m=a.markConfig(Object.assign({mark:y,emphasis:"underline"},h));c.push(m)}},3298:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.markTagContentProcessor=void 0;const i=r(3633);t.markTagContentProcessor=function(e,t,r,o,s){const{value:n}=o;i.StringUtils.isString(n)&&(s.solution=n)}},8326:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.partnerChainContentProcessor=void 0;const i=r(9046),o=r(1895),s=r(3633),n=r(6831),a=new i.Builder;t.partnerChainContentProcessor=function(e,t,r,i,l){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("partner content",i);const u=e.bitContentProcessor(n.BitContentLevel.Chain,r,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("partner TAGS",u);const{resources:c}=u,d=s.StringUtils.trimmedString(i.value),p=function(e,t){let r;const i=[];if(t)for(const e of t.reverse())r||o.ResourceType.image!==e.type?i.push(e):r=e;i.length>0&&(e.parser.excessResources=i,e.addWarning(`${i.length} excess resource(s) present in the [@parter] chain.`));return r}(e,c),h=a.partner({name:d,avatarImage:p});l.partner=h}},3287:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propertyContentProcessor=void 0;const i=r(4719),o=r(672),s=r(994),n=r(3633),a=r(4185),l=r(4787),u=r(8664),c=r(2595),d=r(8326),p=r(6831);t.propertyContentProcessor=function(e,t,r,h,y){const{key:m,value:g}=h,f=t===p.BitContentLevel.Chain;if(m===i.PropertyKey.example)return void(0,l.exampleTagContentProcessor)(e,t,r,h,y);if(m===i.PropertyKey.partner)return void(0,d.partnerChainContentProcessor)(e,t,r,h,y);if(m===i.PropertyKey.imageSource)return void(0,u.imageSourceChainContentProcessor)(e,t,r,h,y);if(m===i.PropertyKey.book)return void(0,a.bookChainContentProcessor)(e,t,r,h,y);if(m===i.PropertyKey.mark&&!f)return void(0,c.markConfigChainContentProcessor)(e,t,r,h,y);const b=(e,t,r)=>{var a;const l=null!==(a=i.PropertyKey.getMetadata(i.PropertyKey.fromValue(t)))&&void 0!==a?a:{};if(l.astKey&&(t=l.astKey),l.isTrimmedString&&(r=n.StringUtils.isString(r)?n.StringUtils.trimmedString(r):void 0),l.isNumber&&(r=s.NumberUtils.asNumber(r)),l.isBoolean&&(r=o.BooleanUtils.toBoolean(r,!0)),l.isInvertedBoolean&&(r=!o.BooleanUtils.toBoolean(r,!0)),l.isSingle)e[t]=r;else if(Object.prototype.hasOwnProperty.call(e,t)){const i=e[t];e[t]=[...i,r]}else e[t]=[r]};i.PropertyKey.fromValue(m)?b(y,m,g):b(y.extraProperties,m,g)}},3130:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.referenceTagContentProcessor=void 0;const i=r(3633);t.referenceTagContentProcessor=function(e,t,r,o,s,n){const{value:a}=o,l=i.StringUtils.trimmedString(a);n?s.referenceEnd=l:s.reference=l}},5516:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resourceContentProcessor=t.buildResource=void 0;const i=r(8703),o=r(208),s=r(1895),n=r(4598),a=r(6831),l=" The expected resource types are [&image-portrait] and [&image-landscape]",u=" The expected resource types are [&image] and [&audio]",c=new i.ResourceBuilder;t.buildResource=function(e,t,r,i){let a,d;const p=[],h=o.RootBitType.getMetadata(t.root),y=null==h?void 0:h.resourceAttachmentAllowed,m=null==h?void 0:h.resourceOptional,g=y?r:void 0,f=n.BitUtils.calculateValidResourceType(t,g,void 0);if(f===s.ResourceType.imageResponsive){if(i){let e,t;d=[];for(const r of i.reverse())e||s.ResourceType.imagePortrait!==r.typeAlias?t||s.ResourceType.imageLandscape!==r.typeAlias?d.push(r):t=r:e=r;e&&t&&(a=c.imageResponsiveResource({imagePortrait:e,imageLandscape:t}))}}else if(f===s.ResourceType.stillImageFilm){if(i){let e,t;d=[];for(const r of i.reverse())e||s.ResourceType.image!==r.type?t||s.ResourceType.audio!==r.type?d.push(r):t=r:e=r;e&&t&&(a=c.stillImageFilmResource({image:e,audio:t}))}}else d=i;if(d)for(const e of d.reverse())a||f!==e.type?p.push(e):a=e;if(!y&&r){let t=`Resource type [&${r}] is specified in the bit header, but no extra resource is allowed for this bit.`;f&&(t+=` The resource type [&${f}] is automatically expected and should not be added.`),e.addWarning(t)}if(!a)if(r)e.addWarning(`Resource type [&${r}] is specified in the bit header, but no such a resource is present in the bit`);else if(f&&!m){let t="A resource is required but is not present in the bit.";if(f===o.RootBitType.imageResponsive)t+=l;else if(f===o.RootBitType.stillImageFilm)t+=u;else{t+=` The expected resource type is ${`[&${f}]`}`}e.addWarning(t)}if(p.length>0){e.parser.excessResources=p;let t=`${p.length} excess resource(s) present in the bit.`;if(f===o.RootBitType.imageResponsive)t+=l;else if(f===o.RootBitType.stillImageFilm)t+=u;else{t+=` The expected resource type is ${f?`[&${f}]`:"NONE"}`}e.addWarning(t)}return a},t.resourceContentProcessor=function(e,t,r,i,o){const{type:n,key:l,value:u,chain:d}=i,p=o.resources;if(!p)return;const h=s.ResourceType.fromValue(l);if(h){const t=e.bitContentProcessor(a.BitContentLevel.Chain,r,d),i=c.resource(Object.assign({type:h,value:u},t));i&&p.push(i)}}},1838:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildTitles=t.titleTagContentProcessor=void 0;const i=r(208),o=r(3633);t.titleTagContentProcessor=function(e,t,r,i,s){const{value:n}=i,a=s.title;if(!a)return;const l=n,u=o.StringUtils.trimmedString(l.title);a[l.level.length]=u},t.buildTitles=function(e,t,r){var o,s;switch(r=null!=r?r:[],t.root){case i.RootBitType.chapter:{let e;return r.length>0&&(e=r[r.length-1]),{title:e,level:r.length>0?r.length-1:void 0}}case i.RootBitType.book:default:return{title:null!==(o=r[1])&&void 0!==o?o:void 0,subtitle:null!==(s=r[2])&&void 0!==s?s:void 0}}}},4177:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseChainContentProcessor=void 0;const o=r(9046),s=r(208),n=r(8660),a=r(6831),l=new o.Builder;t.trueFalseChainContentProcessor=function(e,t,r,o,u,c){t===a.BitContentLevel.Chain?(0,n.trueFalseTagContentProcessor)(e,a.BitContentLevel.Chain,r,o,u):function(e,t,r,o,n,u){var c;const d=[o,...null!==(c=o.chain)&&void 0!==c?c:[]],p=n.statements,h=n.choices,y=n.responses;if(!(p&&h&&y&&u))return;if(r.root===s.RootBitType.trueFalse1)n.statement=function(e,t,r){if(t.root!==s.RootBitType.trueFalse1)return;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (statement)",r);const o=e.bitContentProcessor(a.BitContentLevel.Chain,t,r),{trueFalse:n}=o,u=i(o,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (statement)",u);let c;n&&n.length>0&&(c=l.statement(Object.assign(Object.assign({},n[0]),u)));return c}(e,r,d);else if(r.root===s.RootBitType.trueFalse||r.root===s.RootBitType.multipleChoice||r.root===s.RootBitType.multipleChoice1||r.root===s.RootBitType.multipleResponse||r.root===s.RootBitType.multipleResponse1){const t=function(e,t,r){const o=t.root===s.RootBitType.trueFalse,n=t.root===s.RootBitType.multipleChoice||t.root===s.RootBitType.multipleChoice1,u=t.root===s.RootBitType.multipleResponse||t.root===s.RootBitType.multipleResponse1;if(!o&&!n&&!u)return{};const c=[],d=[],p=[],h=e.splitBitContent(r,[a.TypeKey.True,a.TypeKey.False]);e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (choices/responses)",h);for(const r of h){const s=e.bitContentProcessor(a.BitContentLevel.Chain,t,r),{trueFalse:h}=s,y=i(s,["trueFalse"]);if(e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (choices/responses)",y),o){if(h&&h.length>0){const e=l.statement(Object.assign(Object.assign({},h[0]),y));c.push(e)}}else if(n){if(h&&h.length>0){const e=l.choice(Object.assign(Object.assign({},h[0]),y));d.push(e)}}else if(u&&h&&h.length>0){const e=l.response(Object.assign(Object.assign({},h[0]),y));p.push(e)}}const y={};o?y.statements=c:n?y.choices=d:u&&(y.responses=p);return y}(e,r,d);t.statements&&p.push(...t.statements),t.choices&&h.push(...t.choices),t.responses&&y.push(...t.responses)}else if(r.root===s.RootBitType.highlightText){const t=function(e,t,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("highlight content",r);const o=e.bitContentProcessor(a.BitContentLevel.Chain,t,r),{trueFalse:s}=o,n=i(o,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("highlight TAGS",Object.assign({trueFalse:s},n));const u=[];if(s)for(const e of s)u.push(l.highlightText(Object.assign(Object.assign({},e),{isHighlighted:!1})));const c=l.highlight(Object.assign({texts:u},n));return c}(e,r,d);t&&u.push(t)}else{const t=function(e,t,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("select content",r);const o=e.bitContentProcessor(a.BitContentLevel.Chain,t,r),{trueFalse:s}=o,n=i(o,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("select TAGS",Object.assign({trueFalse:s},n));const u=[];if(s)for(const e of s)u.push(l.selectOption(e));const c=l.select(Object.assign({options:u},n));return c}(e,r,d);t&&u.push(t)}}(e,0,r,o,u,c)}},8660:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseTagContentProcessor=void 0;const i=r(3633),o=r(6831);t.trueFalseTagContentProcessor=function(e,t,r,s,n){const{type:a,value:l}=s,u=n.trueFalse;if(!u)return;const c=i.StringUtils.trimmedString(l);u.push({text:c,isCorrect:a===o.TypeKey.True,isDefaultExample:!1})}},2434:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JsonParser=void 0;const i=r(9046),o=r(8703),s=r(6300),n=r(208),a=r(1060),l=r(1895),u=r(1353),c=r(3633),d=new i.Builder,p=new o.ResourceBuilder;t.JsonParser=class{constructor(){this.textGenerator=new s.TextGenerator}toAst(e){const t=this.preprocessJson(e),r=[];for(const e of t){const{bit:t}=e,i=this.bitToAst(t);i&&r.push(i)}const i=r.length>0?{bits:r}:{};return d.bitmark(i)}preprocessJson(e){const t=[];if(c.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return[]}}const r=e=>{if(this.isBitWrapper(e)){const r=e;t.push(r)}else if(this.isBit(e)){const r=e;t.push(this.bitToBitWrapper(r))}};if(Array.isArray(e))for(const t of e)r(t);else r(e);return t}isBitWrapper(e){if(Object.prototype.hasOwnProperty.call(e,"bit")){const t=e;return this.isBit(t.bit)}return!1}isBit(e){if(Object.prototype.hasOwnProperty.call(e,"type")){const t=e;return n.BitTypeUtils.getBitType(t.type).root!==n.RootBitType._error}return!1}bitToBitWrapper(e){return{bit:e}}bitToAst(e){var t;const{type:r,format:i,id:o,externalId:s,spaceId:a,padletId:l,AIGenerated:c,releaseVersion:p,ageRange:h,language:y,computerLanguage:m,target:g,tag:f,icon:b,iconTag:v,colorTag:T,flashcardSet:A,subtype:_,coverImage:P,publisher:S,publications:x,author:w,date:R,location:O,theme:k,kind:C,action:E,thumbImage:I,focusX:j,focusY:B,duration:L,deeplink:N,externalLink:M,externalLinkText:U,videoCallLink:D,bot:V,list:K,textReference:F,isTracked:G,isInfoOnly:H,labelTrue:$,labelFalse:q,quotedPerson:J,book:z,title:W,subtitle:Y,level:X,toc:Q,progress:Z,anchor:ee,reference:te,referenceEnd:re,item:ie,lead:oe,hint:se,instruction:ne,example:ae,imageSource:le,partner:ue,marks:ce,resource:de,body:pe,sampleSolution:he,elements:ye,statement:me,isCorrect:ge,cards:fe,statements:be,responses:ve,quizzes:Te,heading:Ae,pairs:_e,matrix:Pe,choices:Se,questions:xe,footer:we,placeholders:Re}=e,Oe=n.BitTypeUtils.getBitType(r),ke=null!==(t=u.TextFormat.fromValue(i))&&void 0!==t?t:u.TextFormat.bitmarkMinusMinus,Ce=this.resourceBitToAst(de),Ee=this.bodyToAst(pe,ke,Re),Ie=this.imageSourceBitToAst(le),je=this.partnerBitToAst(ue),Be=this.markConfigBitToAst(ce),Le=this.flashcardBitsToAst(fe),Ne=this.statementBitsToAst(me,ge,be,ae),Me=this.responseBitsToAst(Oe,ve),Ue=this.quizBitsToAst(Oe,Te),De=this.headingBitToAst(Ae),Ve=this.pairBitsToAst(_e),Ke=this.matrixBitsToAst(Pe),Fe=this.choiceBitsToAst(Se),Ge=this.questionBitsToAst(xe),He=this.botResponseBitsToAst(Oe,ve),$e=this.footerToAst(we,ke),{reference:qe,referenceProperty:Je}=this.referenceToAst(te);return d.bit(Object.assign(Object.assign(Object.assign({bitType:Oe,textFormat:i,id:o,externalId:s,spaceId:a,padletId:l,aiGenerated:c,releaseVersion:p,ageRange:h,language:y,computerLanguage:m,target:g,tag:f,icon:b,iconTag:v,colorTag:T,flashcardSet:A,subtype:_,coverImage:P,publisher:S,publications:x,author:w,date:R,location:O,theme:k,kind:C,action:E,duration:L,referenceProperty:Je,thumbImage:I,focusX:j,focusY:B,deeplink:N,externalLink:M,externalLinkText:U,videoCallLink:D,bot:V,list:K,textReference:F,isTracked:G,isInfoOnly:H,labelTrue:$,labelFalse:q,quotedPerson:J,book:z,title:this.parseText(W),subtitle:this.parseText(Y),level:X,toc:Q,progress:Z,anchor:ee,reference:qe,referenceEnd:re},this.parseItemLeadHintInstruction(ie,oe,se,ne)),this.parseExample(ae)),{imageSource:Ie,partner:je,markConfig:Be,resource:Ce,body:Ee,sampleSolution:he,elements:ye,flashcards:Le,statements:Ne,responses:Me,quizzes:Ue,heading:De,pairs:Ve,matrix:Ke,choices:Fe,questions:Ge,botResponses:He,footer:$e}))}imageSourceBitToAst(e){let t;if(e){const{url:r,mockupId:i,format:o,size:s,trim:n}=e;t=d.imageSource({url:r,mockupId:i,format:o,size:s,trim:n})}return t}partnerBitToAst(e){let t;if(e){const r=this.resourceDataToAst(l.ResourceType.image,e.avatarImage);t=d.partner({name:e.name,avatarImage:r})}return t}markConfigBitToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{mark:e,color:i,emphasis:o}=r,s=d.markConfig({mark:e,color:i,emphasis:o});t.push(s)}if(0!==t.length)return t}flashcardBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{question:e,answer:i,alternativeAnswers:o,item:s,lead:n,hint:a,instruction:l,example:u}=r,c=d.flashcard(Object.assign(Object.assign({question:e,answer:i,alternativeAnswers:o},this.parseItemLeadHintInstruction(s,n,a,l)),this.parseExample(u)));t.push(c)}if(0!==t.length)return t}statementBitsToAst(e,t,r,i){const o=[];if(e){const r=d.statement(Object.assign({text:e,isCorrect:null!=t&&t},this.parseExample(i)));o.push(r)}if(Array.isArray(r))for(const e of r){const{statement:t,isCorrect:r,item:i,lead:s,hint:n,instruction:a,example:l,isCaseSensitive:u}=e,c=d.statement(Object.assign(Object.assign(Object.assign({text:t,isCorrect:r},this.parseItemLeadHintInstruction(i,s,n,a)),this.parseExample(l)),{isCaseSensitive:u}));o.push(c)}if(0!==o.length)return o}choiceBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{choice:e,isCorrect:i,item:o,lead:s,hint:n,instruction:a,example:l,isCaseSensitive:u}=r,c=d.choice(Object.assign(Object.assign(Object.assign({text:e,isCorrect:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:u}));t.push(c)}if(0!==t.length)return t}responseBitsToAst(e,t){const r=[];if(e.root!==n.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,isCorrect:i,item:o,lead:s,hint:n,instruction:a,example:l,isCaseSensitive:u}=e,c=d.response(Object.assign(Object.assign(Object.assign({text:t,isCorrect:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:u}));r.push(c)}if(0!==r.length)return r}}selectOptionBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{text:e,isCorrect:i,item:o,lead:s,hint:n,instruction:a,example:l,isCaseSensitive:u}=r,c=d.selectOption(Object.assign(Object.assign(Object.assign({text:e,isCorrect:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:u}));t.push(c)}return t}highlightTextBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{text:e,isCorrect:i,isHighlighted:o,item:s,lead:n,hint:a,instruction:l,example:u,isCaseSensitive:c}=r,p=d.highlightText(Object.assign(Object.assign(Object.assign({text:e,isCorrect:i,isHighlighted:o},this.parseItemLeadHintInstruction(s,n,a,l)),this.parseExample(u)),{isCaseSensitive:c}));t.push(p)}return t}quizBitsToAst(e,t){const r=[];if(Array.isArray(t))for(const i of t){const{item:t,lead:o,hint:s,instruction:n,choices:a,responses:l}=i,u=this.choiceBitsToAst(a),c=this.responseBitsToAst(e,l),p=d.quiz(Object.assign(Object.assign({},this.parseItemLeadHintInstruction(t,o,s,n)),{choices:u,responses:c}));r.push(p)}if(0!==r.length)return r}headingBitToAst(e){let t;return e&&(t=d.heading({forKeys:e.forKeys,forValues:e.forValues})),t}pairBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{key:e,keyAudio:i,keyImage:o,values:s,item:n,lead:a,hint:u,instruction:c,example:p,isCaseSensitive:h,isLongAnswer:y}=r,m=this.resourceDataToAst(l.ResourceType.audio,i),g=this.resourceDataToAst(l.ResourceType.image,o),f=d.pair(Object.assign(Object.assign(Object.assign({key:e,keyAudio:m,keyImage:g,values:s},this.parseItemLeadHintInstruction(n,a,u,c)),this.parseExample(p)),{isCaseSensitive:h,isShortAnswer:!y}));t.push(f)}if(0!==t.length)return t}matrixBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const i of e){const{key:e,cells:o,item:s,lead:n,hint:a,instruction:l,example:u,isCaseSensitive:c,isLongAnswer:p}=i,h=d.matrix(Object.assign(Object.assign(Object.assign({key:e,cells:null!==(t=this.matrixCellsToAst(o))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(s,n,a,l)),this.parseExample(u)),{isCaseSensitive:c,isShortAnswer:!p}));r.push(h)}if(0!==r.length)return r}matrixCellsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{values:e,item:i,lead:o,hint:s,instruction:n,example:a}=r,l=d.matrixCell(Object.assign(Object.assign({values:e},this.parseItemLeadHintInstruction(i,o,s,n)),this.parseExample(a)));t.push(l)}if(0!==t.length)return t}questionBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{question:e,partialAnswer:i,sampleSolution:o,item:s,lead:n,hint:a,instruction:l,example:u,isCaseSensitive:c,isShortAnswer:p}=r,h=d.question(Object.assign(Object.assign(Object.assign({question:e,partialAnswer:i,sampleSolution:o},this.parseItemLeadHintInstruction(s,n,a,l)),this.parseExample(u)),{isCaseSensitive:c,isShortAnswer:p}));t.push(h)}if(0!==t.length)return t}botResponseBitsToAst(e,t){const r=[];if(e.root===n.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,reaction:i,feedback:o,item:s,lead:n,hint:a}=e,l=d.botResponse({response:t,reaction:i,feedback:o,item:this.parseText(s),lead:this.parseText(n),hint:this.parseText(a)});r.push(l)}if(0!==r.length)return r}}resourceBitToAst(e){var t;let r;if(e){const i=null!==(t=l.ResourceType.keyFromValue(e.type))&&void 0!==t?t:l.ResourceType.unknown;let o;if(e.type===l.ResourceType.imageResponsive){const t=e,i=this.resourceDataToAst(l.ResourceType.imagePortrait,t.imagePortrait),o=this.resourceDataToAst(l.ResourceType.imageLandscape,t.imageLandscape);r=p.imageResponsiveResource({imagePortrait:i,imageLandscape:o})}else if(e.type===l.ResourceType.stillImageFilm){const t=e,i=this.resourceDataToAst(l.ResourceType.image,t.image),o=this.resourceDataToAst(l.ResourceType.audio,t.audio);r=p.stillImageFilmResource({image:i,audio:o})}else{if(o=e[i],!o)return;r=this.resourceDataToAst(e.type,o)}}return r}resourceDataToAst(e,t){var r,i;let o;if(t){if(!t)return;const s=c.StringUtils.isString(t)?t:void 0,n=t.url||t.src||t.href||t.app||t.body||s,a=this.resourceDataToAst(l.ResourceType.image,t.posterImage),u=t.thumbnails?t.thumbnails.map((e=>this.resourceDataToAst(l.ResourceType.image,e))):void 0;o=p.resource({type:e,value:n,format:t.format,src1x:t.src1x,src2x:t.src2x,src3x:t.src3x,src4x:t.src4x,caption:this.parseText(t.caption),width:null!==(r=t.width)&&void 0!==r?r:void 0,height:null!==(i=t.height)&&void 0!==i?i:void 0,alt:t.alt,duration:t.duration,mute:t.mute,autoplay:t.autoplay,allowSubtitles:t.allowSubtitles,showSubtitles:t.showSubtitles,posterImage:a,thumbnails:u,siteName:t.siteName,license:t.license,copyright:t.copyright,showInIndex:t.showInIndex})}return o}bodyToAst(e,t,r){let i,o;const s={};if(Array.isArray(e)?(o=this.parseText(e,t),r=this.textGenerator.getPlaceholders()):o=e,r)for(const[e,t]of Object.entries(r)){const r=this.bodyBitToAst(t);s[e]=r}if(o){const e=[],t=c.StringUtils.splitPlaceholders(o,Object.keys(s));for(let r=0,i=t.length;r<i;r++){const i=t[r];if(s[i])e.push(s[i]);else{const t=this.bodyTextToAst(i);e.push(t)}}i=d.body({bodyParts:e})}return i}bodyTextToAst(e){return d.bodyText({text:e})}bodyBitToAst(e){switch(e.type){case a.BodyBitType.gap:return this.gapBitToAst(e);case a.BodyBitType.mark:return this.markBitToAst(e);case a.BodyBitType.select:return this.selectBitToAst(e);case a.BodyBitType.highlight:return this.highlightBitToAst(e)}return this.bodyTextToAst("")}footerToAst(e,t){const r=this.parseText(e,t);if(r)return d.footerText({text:r})}referenceToAst(e){return Array.isArray(e)&&e.length>0?{reference:void 0,referenceProperty:e}:{reference:e,referenceProperty:void 0}}gapBitToAst(e){const{item:t,lead:r,hint:i,instruction:o,example:s,isCaseSensitive:n,solutions:a}=e;return d.gap(Object.assign(Object.assign(Object.assign({solutions:a},this.parseItemLeadHintInstruction(t,r,i,o)),this.parseExample(s)),{isCaseSensitive:n}))}markBitToAst(e){const{solution:t,mark:r,item:i,lead:o,hint:s,instruction:n,example:a}=e;return d.mark(Object.assign(Object.assign({solution:t,mark:r},this.parseItemLeadHintInstruction(i,o,s,n)),this.parseExample(a)))}selectBitToAst(e){const{options:t,prefix:r,postfix:i,item:o,lead:s,hint:n,instruction:a,example:l}=e,u=this.selectOptionBitsToAst(t);return d.select(Object.assign(Object.assign(Object.assign({options:u,prefix:r,postfix:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:!0}))}highlightBitToAst(e){const{texts:t,prefix:r,postfix:i,item:o,lead:s,hint:n,instruction:a,example:l}=e,u=this.highlightTextBitsToAst(t);return d.highlight(Object.assign(Object.assign(Object.assign({texts:u,prefix:r,postfix:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:!0}))}parseItemLeadHintInstruction(e,t,r,i){return{item:this.parseText(e),lead:this.parseText(t),hint:this.parseText(r),instruction:this.parseText(i)}}parseExample(e){if(null==e)return;const t=this.parseText(e);return t?{example:t}:{example:!!e}}parseText(e,t){if(null!=e){if(Array.isArray(e)){return this.textGenerator.generateSync(e,t)}return e}}}},406:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextParser=void 0;const i=r(1353),o=r(8436);t.TextParser=class{toAst(e,t){if(Array.isArray(e))return e;const r=e,s=Object.assign({},t);s.textFormat||(s.textFormat=i.TextFormat.bitmarkMinusMinus);const n=s.textFormat===i.TextFormat.bitmarkPlusPlus?"bitmarkPlusPlus":"bitmarkMinusMinus";return(0,o.parse)(null!=r?r:"",{startRule:n})}}},8436:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const i=r(4764).parse;t.parse=i},7646:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayUtils=void 0;const r=new class{asArray(e){if(null!=e)return Array.isArray(e)?e:[e]}asSingle(e,t){if(null!=e)return Array.isArray(e)?e.length>0?t?e[e.length-1]:e[0]:void 0:e}};t.ArrayUtils=r},4598:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitUtils=void 0;const i=r(208),o=r(1895),s=r(672);const n=new class{calculateValidResourceType(e,t,r){let s;if(t&&(s=o.ResourceType.fromValue(t)),!s&&r&&(s=r.type),!s){const t=i.RootBitType.getMetadata(e.root);t&&(s=t.resourceType)}return s}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,i){if(e){Array.isArray(e)||(e=[e]);for(const o of e)if(!o.isExample&&(!i||o.isCorrect)&&(t?(o.isDefaultExample=!0,o.isExample=!0):(o.isDefaultExample=!1,o.example=s.BooleanUtils.toBoolean(r)),i))break}}};t.BitUtils=n},672:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanUtils=void 0;const r=new class{isBoolean(e){return!0===e||!1===e}isBooleanString(e){return!!this.isBoolean(e)||("true"===e||"false"===e)}toBoolean(e,t){return t?!1!==e&&"false"!==e:!0===e||"true"===e}};t.BooleanUtils=r},994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NumberUtils=void 0;const r=new class{asNumber(e,t){if(null==e)return null!=t?t:void 0;const r=+e;return Number.isNaN(r)?null!=t?t:void 0:r}};t.NumberUtils=r},4309:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUtils=void 0;const r=new class{isFunction(e){return"[object Function]"===Object.prototype.toString.call(e)}isArray(e){return Array.isArray(e)}isDate(e){return"[object Date]"===Object.prototype.toString.call(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}orderProperties(e,t){const r=e,i=Object.assign({},r);for(const e of Object.keys(r))delete r[e];for(const e of t)Object.prototype.hasOwnProperty.call(i,e)&&(r[e]=i[e])}removeUndefinedProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||null==i&&delete r[e]}removeFalseProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||!1===i&&delete r[e]}removeEmptyStringProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||""===i&&delete r[e]}removeEmptyArrayProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||Array.isArray(i)&&0===i.length&&delete r[e]}removeEmptyObjectProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||this.isObject(i)&&0===Object.keys(i).length&&delete r[e]}removeUnwantedProperties(e,t){(t=Object.assign({},t)).ignoreAllUndefined||this.removeUndefinedProperties(e,t.ignoreUndefined),t.ignoreAllFalse||this.removeFalseProperties(e,t.ignoreFalse),t.ignoreAllEmptyString||this.removeEmptyStringProperties(e,t.ignoreEmptyString),t.ignoreAllEmptyArrays||this.removeEmptyArrayProperties(e,t.ignoreEmptyArrays),t.ignoreAllEmptyObjects||this.removeEmptyObjectProperties(e,t.ignoreEmptyObjects)}extractSingleValue(e,t){if(!e)return;const r=e;if(null==r[t])return;let i=r[t];if(Array.isArray(i)){if(0===i.length)return;i=i[i.length-1]}return i}};t.ObjectUtils=r},3633:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StringUtils=void 0;const r=new class{isString(e){return"string"==typeof e||e instanceof String}trimmedString(e){return e?`${e}`.trim():""}splitPlaceholders(e,t){let r=[e];const i=(e,t)=>{const r=[];for(const i of e){const e=i.split(t);for(let i=0,o=e.length;i<o;i++){const s=e[i],n=i===o-1;r.push(s),n||r.push(t)}}return r};for(const e of t)r=i(r,e);return r}firstLine(e,t){const r=e;if(null==t&&(t=e.length),t<1||null==e||e.length<=t)return r;const i=e.split("\n");return i.length>0?i[0].substring(0,t):r}wordWrap(e,t){const r=[];if(t<1||null==e||e.length<=t)return r;const i=e.length,o=i-t;let s,n=0;for(;n<o;){let i;const o=n+t,a=e.indexOf("\n",n);if(a>-1&&a>n&&a<o){i=a-n,s=e.substr(n,i),n=n+i+1,r.push(s);continue}const l=e.lastIndexOf(" ",o);let u=0;l>-1&&l!=n-1?(i=l-n,i>0&&(u=n+i+1)):(i=t,u=n+t),s=e.substr(n,i),n=u,r.push(s.trim())}return n<i&&(s=e.substr(n),r.push(s)),r}};t.StringUtils=r},169:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UrlUtils=void 0;const r=new class{fileExtensionFromUrl(e){let t;if(e)try{const r=new URL(e).pathname.split(".");r.length>1&&(t=r[r.length-1])}catch(e){}return t}domainFromUrl(e){let t;if(e)try{t=new URL(e).hostname}catch(e){}return t}};t.UrlUtils=r},671:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.initEnv=t.env=void 0;const i=r(2164),o=r(7619),s=r(306),n=r(9870);const a=new class{constructor(){Object.defineProperty(this,"userAgentInfo",{value:(0,n.parseUserAgent)(),enumerable:!1}),this.bootTimestamp=Date.now(),this.app="",this.appVersion=s.EMPTY_VERSION,this.environment=this.getEnvironment(),this.environmentVersion=this.getEnvironmentVersion(),this.isBrowser=this.getIsBrowser(),this.isNode=this.environment===i.Environment.node,this.isCI=this.getIsCI(),this.NODE_ENV=this.getNodeEnv(),this.os=this.getOs(),this.osVersion=this.getOsVersion()}init(e,t){this.app=e,this.appVersion=this.parseMMBVersion(t)}get upTimestamp(){return Date.now()-this.bootTimestamp}getEnvironment(){return this.userAgentInfo?this.userAgentInfo.browser:"undefined"!=typeof process&&void 0!==process.versions&&process.versions.node?i.Environment.node:i.Environment.unknown}getEnvironmentVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.browserVersion):"undefined"!=typeof process?this.parseMMBVersion(process.version):s.EMPTY_VERSION}getOs(){return this.userAgentInfo?this.userAgentInfo.os:("undefined"!=typeof process&&void 0!==process.versions&&process.versions.node,o.Os.unknown)}getOsVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.osVersion):"undefined"!=typeof process?this.parseMMBVersion(""):s.EMPTY_VERSION}getIsBrowser(){return!("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof navigator||!navigator.userAgent)}getIsCI(){return!("undefined"==typeof process||!process.env||!process.env.CI)}getNodeEnv(){return"undefined"!=typeof process&&process.env?"production":""}parseMMBVersion(e){if(!e)return s.EMPTY_VERSION;e.startsWith("v")&&(e=e.substring(1));const t=e.split(".",1e3);let r="",i="",o="",n="";for(let e=0,s=t.length;e<s;e++){const s=t[e];0===e?r=s:1===e?i=s:2===e?n=s:3===e&&(o=s)}return{full:e,major:r,minor:i,patch:n,build:o}}};t.env=a;const l=a.init.bind(a);t.initEnv=l},2164:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Environment=void 0;const i=(0,r(6688).superenum)({unknown:"",node:"node",chrome:"chrome",safari:"safari",firefox:"firefox",edge:"edge",ie:"ie"});t.Environment=i},7619:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Os=void 0;const i=(0,r(6688).superenum)({unknown:"",macos:"macos",windows:"windows",linux:"linux",android:"android",ios:"ios"});t.Os=i},306:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_VERSION=void 0;t.EMPTY_VERSION={full:"",major:"",minor:"",patch:"",build:""}},9870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUserAgent=void 0;const i=r(2164),o=r(7619);t.parseUserAgent=function(){if("undefined"==typeof window||!window.navigator||!window.navigator.userAgent)return;const e={browser:i.Environment.unknown,os:o.Os.unknown},t=function(e){const t=e.toLowerCase().split(new RegExp("[ /,;()]","g")).reduce(((e,t)=>(t&&e.push(t),e)),[]),r={keys:new Set,versions:{}};let i="";for(let e=0,o=t.length;e<o;e++){const o=t[e];let s=!1;for(let e=0;e<=9;e++)if(o.startsWith(`${e}`)){s=!0;break}s?r.versions[i]=o.replace("_","."):r.keys.add(o),i=o}return r}(window.navigator.userAgent),r=t.keys.has("firefox"),s=t.keys.has("chrome"),n=t.keys.has("chromium"),a=t.keys.has("safari"),l=s,u=r,c=t.keys.has("macintosh");return a&&!s&&!n?(e.browser=i.Environment.safari,e.browserVersion=t.versions.version):l?(e.browser=i.Environment.chrome,e.browserVersion=t.versions.chrome):u&&(e.browser=i.Environment.firefox,e.browserVersion=t.versions.firefox),c&&(e.os=o.Os.macos,e.osVersion=t.versions.x),e}}},t={};function r(i){var o=t[i];if(void 0!==o)return o.exports;var s=t[i]={exports:{}};return e[i].call(s.exports,s,s.exports,r),s.exports}r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{var e=i;Object.defineProperty(e,"__esModule",{value:!0}),e.StreamWriter=e.FileWriter=e.BitmarkFileGenerator=e.JsonFileGenerator=e.CardSetVersion=e.BitmarkVersion=e.BitmarkParserType=e.NodeType=e.ResourceType=e.TextFormat=e.BitTypeUtils=e.AliasBitType=e.RootBitType=e.StringWriter=e.BitmarkStringGenerator=e.BitmarkGenerator=e.BitmarkParser=e.JsonStringGenerator=e.JsonGenerator=e.JsonParser=e.Ast=e.ResourceBuilder=e.Builder=e.Output=e.BitmarkParserGenerator=void 0;const t=r(7087);var o=r(390);Object.defineProperty(e,"BitmarkParserGenerator",{enumerable:!0,get:function(){return o.BitmarkParserGenerator}}),Object.defineProperty(e,"Output",{enumerable:!0,get:function(){return o.Output}});var s=r(9046);Object.defineProperty(e,"Builder",{enumerable:!0,get:function(){return s.Builder}});var n=r(8703);Object.defineProperty(e,"ResourceBuilder",{enumerable:!0,get:function(){return n.ResourceBuilder}});var a=r(8256);Object.defineProperty(e,"Ast",{enumerable:!0,get:function(){return a.Ast}});var l=r(2434);Object.defineProperty(e,"JsonParser",{enumerable:!0,get:function(){return l.JsonParser}});var u=r(3857);Object.defineProperty(e,"JsonGenerator",{enumerable:!0,get:function(){return u.JsonGenerator}});var c=r(5132);Object.defineProperty(e,"JsonStringGenerator",{enumerable:!0,get:function(){return c.JsonStringGenerator}});var d=r(9556);Object.defineProperty(e,"BitmarkParser",{enumerable:!0,get:function(){return d.BitmarkParser}});var p=r(297);Object.defineProperty(e,"BitmarkGenerator",{enumerable:!0,get:function(){return p.BitmarkGenerator}});var h=r(8582);Object.defineProperty(e,"BitmarkStringGenerator",{enumerable:!0,get:function(){return h.BitmarkStringGenerator}});var y=r(227);Object.defineProperty(e,"StringWriter",{enumerable:!0,get:function(){return y.StringWriter}});var m=r(208);Object.defineProperty(e,"RootBitType",{enumerable:!0,get:function(){return m.RootBitType}}),Object.defineProperty(e,"AliasBitType",{enumerable:!0,get:function(){return m.AliasBitType}}),Object.defineProperty(e,"BitTypeUtils",{enumerable:!0,get:function(){return m.BitTypeUtils}});var g=r(1353);Object.defineProperty(e,"TextFormat",{enumerable:!0,get:function(){return g.TextFormat}});var f=r(1895);Object.defineProperty(e,"ResourceType",{enumerable:!0,get:function(){return f.ResourceType}});var b=r(549);Object.defineProperty(e,"NodeType",{enumerable:!0,get:function(){return b.NodeType}});var v=r(6958);Object.defineProperty(e,"BitmarkParserType",{enumerable:!0,get:function(){return v.BitmarkParserType}});var T=r(8791);Object.defineProperty(e,"BitmarkVersion",{enumerable:!0,get:function(){return T.BitmarkVersion}});var A=r(8565);Object.defineProperty(e,"CardSetVersion",{enumerable:!0,get:function(){return A.CardSetVersion}});(0,t.init)()})(),i})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.bitmarkParserGenerator=t():e.bitmarkParserGenerator=t()}(this,(()=>(()=>{"use strict";var e={6688:(e,t,r)=>{function i(e,t){var r;const i=Object.freeze,o=Object.defineProperty,s=Object.assign,n={enumerable:!1},a=new Map,l=new Map,u=new Map,c=new Map,d=new Map,p=(null!==(r=null==t?void 0:t.iterationKeys)&&void 0!==r?r:Object.keys(e)).map((e=>`${e}`));for(const[t,r]of Object.entries(e))a.set(t,r),u.set(t.toLowerCase(),r);for(const[e,t]of a){const r="string"==typeof t?t.toLowerCase():t;l.set(t,e),c.set(r,e)}const h=p.map((e=>a.get(e))),y=p.map((e=>[e,a.get(e)]));return(t=>{let r=e;function m(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?a.get(c.get(e.toLowerCase())):!e||l.has(e)?e:void 0}Object.isExtensible(e)||(r=s({},e)),o(r,"fromKey",s({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?u.get(e.toLowerCase()):a.get(`${e}`)}},n)),o(r,"fromValue",s({value:m},n)),o(r,"keyFromValue",s({value:function(e,t){return(null==t?void 0:t.ignoreCase)&&"string"==typeof e?c.get(e.toLowerCase()):l.get(e)}},n)),o(r,"setMetadata",s({value:function(e,t,r){const i=m(e);i&&d.set(i,t)}},n)),o(r,"getMetadata",s({value:function(e,t){return d.get(e)}},n)),o(r,Symbol.iterator,s({value:function(){let e=0;return{next:()=>e<p.length?{value:a.get(`${p[e++]}`),done:!1}:{done:!0}}}},n)),o(r,"values",s({value:()=>h},n)),o(r,"keys",s({value:()=>p},n)),o(r,"entries",s({value:()=>y},n));let g=r;return(null==t?void 0:t.noFreeze)||(g=i(r),i(p),i(h),i(y)),g})(t)}r.r(t),r.d(t,{superenum:()=>o});const o=i;o.fromObject=i,o.fromArray=function(e,t){Array.isArray(e)||(e=[]);const r=e.reduce(((e,t)=>(e[`${t}`]=t,e)),{});return(!t||t&&!t.iterationKeys)&&((t=Object.assign({},t)).iterationKeys=e),i(r,t)}},390:function(e,t,r){var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,o)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=(this&&this.__importStar,this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))});Object.defineProperty(t,"__esModule",{value:!0}),t.Output=t.BitmarkParserGenerator=void 0;const n=r(6688),a=r(8256),l=r(8582),u=r(4275),c=r(6958),d=r(9556),p=r(2434),h=r(671),y=(0,n.superenum)({bitmark:"bitmark",json:"json",ast:"ast"});t.Output=y;t.BitmarkParserGenerator=class{constructor(){this.ast=new a.Ast,this.jsonParser=new p.JsonParser,this.bitmarkParser=new d.BitmarkParser,this.jsonStringifyPrettify=(e,t,r)=>{const i=!0===t.prettify?2:t.prettify||void 0;return r||!0===t.stringify||void 0!==i?JSON.stringify(e,null,i):e}}version(){return h.env.appVersion.full}convert(e,t){return s(this,void 0,void 0,(function*(){let r;const i=Object.assign({},t),o=Object.assign({},i.jsonOptions),n=i.outputFormat,a=n===y.bitmark,d=n===y.json,p=n===y.ast,m=c.BitmarkParserType.peggy;let g=e;if(h.env.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");h.env.isNode&&fs.existsSync(g)&&(g=fs.readFileSync(g,{encoding:"utf8"}));let f=this.ast.preprocessAst(g);const b=!!f;b||(f=this.jsonParser.toAst(g));const v=!!(null==f?void 0:f.bits),T=e=>s(this,void 0,void 0,(function*(){yield A(e),yield P(r)})),A=e=>s(this,void 0,void 0,(function*(){r=this.bitmarkParser.toAst(e,{parserType:m})})),_=e=>s(this,void 0,void 0,(function*(){if(m===c.BitmarkParserType.peggy)if(f=this.bitmarkParser.toAst(e,{parserType:m}),i.outputFile){const e=new JsonFileGenerator_1.JsonFileGenerator(i.outputFile,i);yield e.generate(f)}else{const e=new u.JsonObjectGenerator(i),t=yield e.generate(f);r=this.jsonStringifyPrettify(t,o)}})),P=e=>s(this,void 0,void 0,(function*(){if(i.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(i.outputFile,i);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(i);r=yield t.generate(e)}})),S=e=>s(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,o)})),x=e=>s(this,void 0,void 0,(function*(){if(i.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(i.outputFile,i);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(i),s=yield t.generate(e);r=this.jsonStringifyPrettify(s,o)}})),w=e=>s(this,void 0,void 0,(function*(){if(i.outputFile){const t=new BitmarkFileGenerator_1.BitmarkFileGenerator(i.outputFile,i);yield t.generate(e)}else{const t=new l.BitmarkStringGenerator(i);r=yield t.generate(e)}})),R=e=>s(this,void 0,void 0,(function*(){r=this.jsonStringifyPrettify(e,o)})),O=e=>s(this,void 0,void 0,(function*(){yield x(e)}));return!v&&!b?a?yield T(g):p?yield A(g):yield _(g):b?p?yield S(f):d?yield x(f):yield P(f):d?yield O(f):p?yield R(f):yield w(f),r}))}upgrade(e,t){return s(this,void 0,void 0,(function*(){let r;const i=Object.assign({},t),o=Object.assign({},i.jsonOptions),n=i.bitmarkParserType;let a=e;if(h.env.isBrowser&&i.outputFile)throw new Error("Cannot write to file in browser environment");h.env.isNode&&fs.existsSync(a)&&(a=fs.readFileSync(a,{encoding:"utf8"}));let c=this.jsonParser.toAst(a);const d=e=>s(this,void 0,void 0,(function*(){const t=this.bitmarkParser.toAst(e,{parserType:n});if(i.outputFile){const e=new BitmarkFileGenerator_1.BitmarkFileGenerator(i.outputFile,i);yield e.generate(t)}else{const e=new l.BitmarkStringGenerator(i);r=yield e.generate(t)}})),p=e=>s(this,void 0,void 0,(function*(){if(i.outputFile){const t=new JsonFileGenerator_1.JsonFileGenerator(i.outputFile,i);yield t.generate(e)}else{const t=new u.JsonObjectGenerator(i),s=yield t.generate(e);r=this.jsonStringifyPrettify(s,o)}}));return!!!(null==c?void 0:c.bits)?yield d(a):yield p(c),r}))}createAst(e){let t,r=e;h.env.isNode&&fs.existsSync(r)&&(r=fs.readFileSync(r,{encoding:"utf8"}));let i=this.ast.preprocessAst(r);const o=!!i;o||(i=this.jsonParser.toAst(r));return t=!!!(null==i?void 0:i.bits)&&!o?this.bitmarkParser.toAst(r):i,t}}},8256:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Ast=void 0;const i=r(7087),o=r(549),s=r(3633);t.Ast=class{constructor(){(0,i.init)()}walk(e,t,r,i){this.walkRecursive(e,void 0,r,[{index:0,key:t,value:e}],i)}getRouteKey(e){return e.reduce(((t,r,i)=>(+r.key!==r.index&&(t+=`${r.key}`,i<e.length-1&&(t+="_")),t)),"")}printTree(e,t=o.NodeType.bitmarkAst){this.walkRecursive(e,void 0,{enter:(e,t,r)=>{console.log("Enter: "+this.getRouteKey(r))},between:(e,t,r,i,o)=>{console.log("Between: "+this.getRouteKey(o))},exit:(e,t,r)=>{console.log("Exit: "+this.getRouteKey(r))},leaf:(e,t,r)=>{console.log("Leaf: "+this.getRouteKey(r))}},[{index:0,key:t,value:e}],void 0)}preprocessAst(e){if(s.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return}}if(this.isAst(e))return e}isAst(e){return!(!Object.prototype.hasOwnProperty.call(e,"bits")||!Array.isArray(e.bits))}walkRecursive(e,t,r,i,o){const{enter:s,between:n,exit:a,leaf:l}=r,u=i[i.length-1].key,c=!this.isValue(e),d=i[i.length-1];if(c){if(s){if(!1===s(d,t,i,o))return}}else l&&l(d,t,i,o);if(c){const s=this.isArray(e),a=Object.keys(e);for(let l=0,c=a.length;l<c;l++){const p=a[l],h=l===c-1,y=e,m=y[p];if(null!=m){const e={key:this.getAstKey(p,u,s),index:l,value:m},c=i.slice();if(c.push(e),this.walkRecursive(m,d,r,c,o),!h){const r=a[l+1],c=y[r],p={key:this.getAstKey(r,u,s),index:l+1,value:c};if(n){if(!1===n(d,e,p,t,i,o))break}}}}}c&&a&&a(d,t,i,o)}getAstKey(e,t,r){let i=e;return r&&t&&(i=`${t}Value`),o.NodeType.fromKey(i)||`unknown(${i})`}isArray(e){return Array.isArray(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}}},423:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseBuilder=void 0;const i=r(4719),o=r(7646),s=r(672),n=r(994),a=r(3633);t.BaseBuilder=class{toExample(e,t){return null!=t?(!0===t&&(t="true"),!1===t&&(t="false"),{isDefaultExample:!1,isExample:!0,example:t}):e?{isDefaultExample:!0,isExample:!0}:{isDefaultExample:!1,isExample:!1}}toExampleBoolean(e,t){const r=null!=t&&!s.BooleanUtils.isBooleanString(t);return null==t||r?e||r?{isDefaultExample:!0,isExample:!0}:{isDefaultExample:!1,isExample:!1}:{isDefaultExample:!1,isExample:!0,example:s.BooleanUtils.toBoolean(t)}}toAstProperty(e,t){var r;const l=null!==(r=i.PropertyKey.getMetadata(e))&&void 0!==r?r:{};if(null==t)return;const u=e=>{if(null!=e)return l.isTrimmedString&&(e=a.StringUtils.isString(e)?a.StringUtils.trimmedString(e):void 0),l.isNumber&&(e=n.NumberUtils.asNumber(e)),l.isBoolean&&(e=s.BooleanUtils.toBoolean(e,!0)),l.isInvertedBoolean&&(e=!s.BooleanUtils.toBoolean(e,!0)),e};if(Array.isArray(t)){const e=t;for(let t=0,r=e.length;t<r;t++)e[t]=u(e[t])}else t=u(t);return o.ArrayUtils.asArray(t)}}},9046:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=void 0;const i=r(208),o=r(1060),s=r(4719),n=r(1353),a=r(7646),l=r(4598),u=r(994),c=r(4309),d=r(671),p=r(423),h=r(2377);class y extends p.BaseBuilder{bitmark(e){const{bits:t,errors:r}=e,i={bits:t,errors:r};return c.ObjectUtils.removeUnwantedProperties(i),i}bit(e){var t;const{bitType:r,textFormat:i,resourceType:o,id:d,externalId:p,spaceId:y,padletId:m,aiGenerated:g,releaseVersion:f,ageRange:b,language:v,computerLanguage:T,target:A,tag:_,icon:P,iconTag:S,colorTag:x,flashcardSet:w,subtype:R,coverImage:O,publisher:k,publications:C,author:E,subject:I,date:j,location:B,theme:L,kind:N,action:M,thumbImage:U,focusX:D,focusY:V,duration:K,referenceProperty:F,deeplink:G,externalLink:H,externalLinkText:$,videoCallLink:q,bot:J,list:z,textReference:W,isTracked:Y,isInfoOnly:X,labelTrue:Q,labelFalse:Z,book:ee,quotedPerson:te,partialAnswer:re,levelProperty:ie,title:oe,subtitle:se,level:ne,toc:ae,progress:le,anchor:ue,reference:ce,referenceEnd:de,item:pe,lead:he,hint:ye,instruction:me,isDefaultExample:ge,example:fe,imageSource:be,partner:ve,markConfig:Te,extraProperties:Ae,resource:_e,body:Pe,sampleSolution:Se,footer:xe,markup:we,parser:Re}=e,Oe=this.cardNode(e),ke=Object.assign(Object.assign({bitType:r,textFormat:null!==(t=n.TextFormat.fromValue(i))&&void 0!==t?t:n.TextFormat.bitmarkMinusMinus,resourceType:l.BitUtils.calculateValidResourceType(r,o,_e),id:this.toAstProperty(s.PropertyKey.id,d),externalId:this.toAstProperty(s.PropertyKey.externalId,p),spaceId:this.toAstProperty(s.PropertyKey.spaceId,y),padletId:this.toAstProperty(s.PropertyKey.padletId,m),aiGenerated:this.toAstProperty(s.PropertyKey.aiGenerated,g),releaseVersion:this.toAstProperty(s.PropertyKey.releaseVersion,f),book:ee,ageRange:this.toAstProperty(s.PropertyKey.ageRange,b),language:this.toAstProperty(s.PropertyKey.language,v),computerLanguage:this.toAstProperty(s.PropertyKey.computerLanguage,T),target:this.toAstProperty(s.PropertyKey.target,A),tag:this.toAstProperty(s.PropertyKey.tag,_),icon:this.toAstProperty(s.PropertyKey.icon,P),iconTag:this.toAstProperty(s.PropertyKey.iconTag,S),colorTag:this.toAstProperty(s.PropertyKey.colorTag,x),flashcardSet:this.toAstProperty(s.PropertyKey.flashcardSet,w),subtype:this.toAstProperty(s.PropertyKey.subtype,R),coverImage:this.toAstProperty(s.PropertyKey.coverImage,O),publisher:this.toAstProperty(s.PropertyKey.publisher,k),publications:this.toAstProperty(s.PropertyKey.publications,C),author:this.toAstProperty(s.PropertyKey.author,E),subject:this.toAstProperty(s.PropertyKey.subject,I),date:this.toAstProperty(s.PropertyKey.date,j),location:this.toAstProperty(s.PropertyKey.location,B),theme:this.toAstProperty(s.PropertyKey.theme,L),kind:this.toAstProperty(s.PropertyKey.kind,N),action:this.toAstProperty(s.PropertyKey.action,M),thumbImage:this.toAstProperty(s.PropertyKey.thumbImage,U),focusX:this.toAstProperty(s.PropertyKey.focusX,D),focusY:this.toAstProperty(s.PropertyKey.focusY,V),deeplink:this.toAstProperty(s.PropertyKey.deeplink,G),externalLink:this.toAstProperty(s.PropertyKey.externalLink,H),externalLinkText:this.toAstProperty(s.PropertyKey.externalLinkText,$),videoCallLink:this.toAstProperty(s.PropertyKey.videoCallLink,q),bot:this.toAstProperty(s.PropertyKey.bot,J),duration:this.toAstProperty(s.PropertyKey.duration,K),referenceProperty:this.toAstProperty(s.PropertyKey.reference,F),list:this.toAstProperty(s.PropertyKey.list,z),textReference:this.toAstProperty(s.PropertyKey.textReference,W),isTracked:this.toAstProperty(s.PropertyKey.isTracked,Y),isInfoOnly:this.toAstProperty(s.PropertyKey.isInfoOnly,X),labelTrue:this.toAstProperty(s.PropertyKey.labelTrue,Q),labelFalse:this.toAstProperty(s.PropertyKey.labelFalse,Z),quotedPerson:this.toAstProperty(s.PropertyKey.quotedPerson,te),partialAnswer:this.toAstProperty(s.PropertyKey.partialAnswer,re),levelProperty:this.toAstProperty(s.PropertyKey.level,ie),title:oe,subtitle:se,level:u.NumberUtils.asNumber(ne),toc:this.toAstProperty(s.PropertyKey.toc,ae),progress:this.toAstProperty(s.PropertyKey.progress,le),anchor:ue,reference:ce,referenceEnd:de,markConfig:Te,itemLead:this.itemLead(pe,he),hint:ye,instruction:me},this.toExample(ge,fe)),{imageSource:be,partner:ve,resource:_e,body:Pe,sampleSolution:a.ArrayUtils.asArray(Se),cardNode:Oe,footer:xe,markup:we,parser:Re,extraProperties:this.parseExtraProperties(Ae)});return this.pushExampleDownTree(Pe,Oe,ge,fe),this.setDefaultBitValues(ke),this.setIsExampleFlags(ke),this.addVersionToParserInfo(ke),c.ObjectUtils.removeUnwantedProperties(ke,{ignoreAllFalse:!0,ignoreEmptyString:["example"]}),h.NodeValidator.validateBit(ke)}choice(e){const{text:t,isCorrect:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:s,instruction:n},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}response(e){const{text:t,isCorrect:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:s,instruction:n},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}botResponse(e){const{response:t,reaction:r,feedback:i,item:o,lead:s,hint:n}=e,a={response:t,reaction:r,feedback:i,itemLead:this.itemLead(o,s),hint:n};return c.ObjectUtils.removeUnwantedProperties(a,{ignoreEmptyString:["response","reaction","feedback"]}),a}quiz(e){const{choices:t,responses:r,item:i,lead:o,hint:s,instruction:n,isDefaultExample:a,example:l}=e;this.pushExampleDownTreeBoolean(a,l,!0,t),this.pushExampleDownTreeBoolean(a,l,!1,r);const u={itemLead:this.itemLead(i,o),hint:s,instruction:n,isExample:a||null!=l,choices:t,responses:r};return c.ObjectUtils.removeUnwantedProperties(u,{ignoreAllFalse:!0}),u}heading(e){var t;const{forKeys:r,forValues:i}=e;if(null==r)return;const o={forKeys:r||"",forValues:null!==(t=a.ArrayUtils.asArray(i))&&void 0!==t?t:[]};return c.ObjectUtils.removeUnwantedProperties(o),o}pair(e){const{key:t,keyAudio:r,keyImage:i,values:o,item:s,lead:n,hint:a,instruction:l,isCaseSensitive:u,isShortAnswer:d,isDefaultExample:p,example:h}=e,y=Object.assign(Object.assign({key:t,keyAudio:r,keyImage:i,itemLead:this.itemLead(s,n),hint:a,instruction:l},this.toExample(p,h)),{isCaseSensitive:u,isShortAnswer:d,values:o});return c.ObjectUtils.removeUnwantedProperties(y,{ignoreAllFalse:!0}),y}matrix(e){const{key:t,cells:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isShortAnswer:l,isDefaultExample:u}=e;let d=!1;for(const e of null!=r?r:[])u&&!e.isExample&&(e.isDefaultExample=!0,e.isExample=!0),d=!!e.isExample||d;const p={key:t,itemLead:this.itemLead(i,o),hint:s,instruction:n,isCaseSensitive:a,isShortAnswer:l,isExample:d,cells:r};return c.ObjectUtils.removeUnwantedProperties(p,{ignoreAllFalse:!0}),p}matrixCell(e){const{values:t,item:r,lead:i,hint:o,instruction:s,isDefaultExample:n,example:a}=e,l=Object.assign({values:t,itemLead:this.itemLead(r,i),hint:o,instruction:s},this.toExample(n,a));return c.ObjectUtils.removeUnwantedProperties(l,{ignoreAllFalse:!0}),l}question(e){const{question:t,partialAnswer:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isShortAnswer:l,sampleSolution:u,isDefaultExample:d,example:p}=e,h=Object.assign(Object.assign({itemLead:this.itemLead(i,o),question:t,partialAnswer:r,hint:s,instruction:n},this.toExample(d,p)),{isCaseSensitive:a,isShortAnswer:l,sampleSolution:u});return c.ObjectUtils.removeUnwantedProperties(h,{ignoreEmptyString:["question"],ignoreAllFalse:!0}),h}body(e){const{bodyParts:t}=e;return{bodyParts:t}}bodyText(e){const{text:t}=e;return{type:o.BodyBitType.text,data:{bodyText:t}}}footerText(e){const{text:t}=e;return{footerText:t}}gap(e){const{solutions:t,item:r,lead:i,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d={type:o.BodyBitType.gap,data:Object.assign(Object.assign({solutions:t,itemLead:this.itemLead(r,i),hint:s,instruction:n},this.toExample(l,u)),{isCaseSensitive:a})};return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}markConfig(e){const{mark:t,color:r,emphasis:i}=e,o={mark:t,color:r,emphasis:i};return c.ObjectUtils.removeUnwantedProperties(o),o}mark(e){const{solution:t,mark:r,item:i,lead:s,hint:n,instruction:a,isDefaultExample:l,example:u}=e,d={type:o.BodyBitType.mark,data:Object.assign({solution:t,mark:r,itemLead:this.itemLead(i,s),hint:n,instruction:a},this.toExample(l,u))};return c.ObjectUtils.removeUnwantedProperties(d),d}select(e){const{options:t,prefix:r,postfix:i,item:s,lead:n,hint:a,instruction:l,isCaseSensitive:u}=e,d={type:o.BodyBitType.select,data:{prefix:r,options:t,postfix:i,itemLead:this.itemLead(s,n),hint:a,instruction:l,isCaseSensitive:u}};return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}selectOption(e){const{text:t,isCorrect:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:s,instruction:n},this.toExample(l,u)),{isCaseSensitive:a});return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}highlight(e){const{texts:t,prefix:r,postfix:i,item:s,lead:n,hint:a,instruction:l,isCaseSensitive:u}=e,d={type:o.BodyBitType.highlight,data:{prefix:r,texts:t,postfix:i,itemLead:this.itemLead(s,n),hint:a,instruction:l,isCaseSensitive:u}};return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}highlightText(e){const{text:t,isCorrect:r,isHighlighted:i,item:o,lead:s,hint:n,instruction:a,isCaseSensitive:l,isDefaultExample:u,example:d}=e,p=Object.assign(Object.assign({text:t,isCorrect:!!r,isHighlighted:!!i,itemLead:this.itemLead(o,s),hint:n,instruction:a},this.toExample(u,d)),{isCaseSensitive:l});return c.ObjectUtils.removeUnwantedProperties(p,{ignoreAllFalse:!0}),p}flashcard(e){const{question:t,answer:r,alternativeAnswers:i,item:o,lead:s,hint:n,instruction:a,isDefaultExample:l,example:u}=e,d=Object.assign({question:t,answer:r,alternativeAnswers:i,itemLead:this.itemLead(o,s),hint:n,instruction:a},this.toExampleBoolean(l,u));return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}statement(e){const{text:t,isCorrect:r,item:i,lead:o,hint:s,instruction:n,isCaseSensitive:a,isDefaultExample:l,example:u}=e,d=Object.assign(Object.assign({text:t,isCorrect:!!r,itemLead:this.itemLead(i,o),hint:s,instruction:n},this.toExampleBoolean(l,u)),{isCaseSensitive:a});return c.ObjectUtils.removeUnwantedProperties(d,{ignoreAllFalse:!0}),d}imageSource(e){const{url:t,mockupId:r,size:i,format:o,trim:s}=e,n={url:t,mockupId:r,size:i,format:o,trim:s};return c.ObjectUtils.removeUnwantedProperties(n,{ignoreFalse:["trim"]}),n}partner(e){const{name:t,avatarImage:r}=e,i={name:t,avatarImage:r};return c.ObjectUtils.removeUnwantedProperties(i),i}comment(e){const{text:t,location:r}=e,i={text:t,location:r};return c.ObjectUtils.removeUnwantedProperties(i),i}itemLead(e,t){let r;return(e||t)&&(r={item:e,lead:t}),r}cardNode(e){let t;const{questions:r,elements:i,flashcards:o,statement:s,statements:n,choices:a,responses:l,quizzes:u,heading:d,pairs:p,matrix:h,botResponses:y}=e;return(r||i||o||s||n||a||l||u||d||p||h||y)&&(t={questions:r,elements:i,flashcards:o,statement:s,statements:n,choices:a,responses:l,quizzes:u,heading:d,pairs:p,matrix:h,botResponses:y},c.ObjectUtils.removeUnwantedProperties(t)),t}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];l.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];l.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 o.BodyBitType.gap:{const r=i;l.BitUtils.fillStringExample([r.data],e,t,!1);break}case o.BodyBitType.mark:{const r=i;l.BitUtils.fillBooleanExample([r.data],e,t,!1);break}case o.BodyBitType.select:{const r=i;l.BitUtils.fillBooleanExample(r.data.options,e,t,!0);break}case o.BodyBitType.highlight:{const r=i;l.BitUtils.fillBooleanExample(r.data.texts,e,t,!0);break}}}parseExtraProperties(e){if(!e)return;const t=Object.entries(e);if(0===t.length)return;const r={};for(const[e,i]of t)r[e]=a.ArrayUtils.asArray(i)||[i];return r}setIsExampleFlags(e){var t,r,i,s,n,a,l,u,c,d,p,h,y;e.isExample=!1;const m=t=>!!t&&(t.isDefaultExample||null!=t.example?(t.isExample=!0,e.isExample=!0):t.isExample=t===e&&!!e.isExample,t.isExample),{body:g,cardNode:f}=e;if(g&&g.bodyParts)for(const e of g.bodyParts)switch(e.type){case o.BodyBitType.gap:case o.BodyBitType.mark:m(e.data);break;case o.BodyBitType.select:{const t=e;let r=!1;for(const e of t.data.options)r=!!m(e)||r;t.data.isExample=r;break}case o.BodyBitType.highlight:{const t=e;let r=!1;for(const e of t.data.texts)r=!!m(e)||r;t.data.isExample=r;break}}if(f){for(const e of null!==(t=f.flashcards)&&void 0!==t?t:[])m(e);for(const e of null!==(r=f.pairs)&&void 0!==r?r:[])m(e);for(const e of null!==(i=f.matrix)&&void 0!==i?i:[]){let t=!1;for(const r of null!==(s=e.cells)&&void 0!==s?s:[])t=!!m(r)||t;e.isExample=t}for(const e of null!==(n=f.quizzes)&&void 0!==n?n:[]){let t=!1;for(const r of null!==(a=e.responses)&&void 0!==a?a:[])t=!!m(r)||t;for(const r of null!==(l=e.choices)&&void 0!==l?l:[])t=!!m(r)||t;e.isExample=t}for(const e of null!==(u=f.responses)&&void 0!==u?u:[])m(e);for(const e of null!==(c=f.choices)&&void 0!==c?c:[])m(e);for(const e of null!==(d=f.statements)&&void 0!==d?d:[])m(e);m(f.statement);for(const e of null!==(p=f.questions)&&void 0!==p?p:[])m(e)}m(e.statement);for(const t of null!==(h=e.responses)&&void 0!==h?h:[])m(t);for(const t of null!==(y=e.choices)&&void 0!==y?y:[])m(t);m(e)}setDefaultBitValues(e){switch(e.bitType.alias){case i.AliasBitType.articleAi:case i.AliasBitType.noteAi:case i.AliasBitType.summaryAi:e.aiGenerated=this.toAstProperty(s.PropertyKey.aiGenerated,!0)}}addVersionToParserInfo(e){var t;const r=null!==(t=e.parser)&&void 0!==t?t:{};r.version=d.env.appVersion.full,e.parser=r}}t.Builder=y},8703:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceBuilder=void 0;const o=r(1895),s=r(4309),n=r(169),a=r(423),l=r(2377);class u extends a.BaseBuilder{resource(e){var t,r,s,n,a;let l;const{type:u,value:c,format:d}=e,p=i(e,["type","value","format"]),h=Object.assign({type:u,value:null!=c?c:"",format:null!=d?d:""},p);switch(u){case o.ResourceType.video:case o.ResourceType.videoEmbed:case o.ResourceType.videoLink:case o.ResourceType.stillImageFilmEmbed:case o.ResourceType.stillImageFilmLink:{const r=["src1x","src2x","src3x","src4x"],i=[];for(const t of r){const r=e[t];if(r){const e=this.resource({type:o.ResourceType.image,value:r});e&&i.push(e)}}h.thumbnails=[...null!==(t=h.thumbnails)&&void 0!==t?t:[],...i]}}switch(u){case o.ResourceType.image:case o.ResourceType.imagePortrait:case o.ResourceType.imageLandscape:l=this.imageResource(h,u);break;case o.ResourceType.imageResponsive:l=this.imageResponsiveResource({imagePortrait:this.imageResource(null!==(r=h.imagePortrait)&&void 0!==r?r:{format:"",value:""}),imageLandscape:this.imageResource(null!==(s=h.imageLandscape)&&void 0!==s?s:{format:"",value:""})});break;case o.ResourceType.imageLink:l=this.imageLinkResource(h);break;case o.ResourceType.audio:l=this.audioResource(h);break;case o.ResourceType.audioEmbed:l=this.audioEmbedResource(h);break;case o.ResourceType.audioLink:l=this.audioLinkResource(h);break;case o.ResourceType.video:l=this.videoResource(h);break;case o.ResourceType.videoEmbed:l=this.videoEmbedResource(h);break;case o.ResourceType.videoLink:l=this.videoLinkResource(h);break;case o.ResourceType.stillImageFilm:l=this.stillImageFilmResource({image:this.imageResource(null!==(n=h.image)&&void 0!==n?n:{format:"",value:""}),audio:this.audioResource(null!==(a=h.audio)&&void 0!==a?a:{format:"",value:""})});break;case o.ResourceType.stillImageFilmEmbed:l=this.stillImageFilmEmbedResource(h);break;case o.ResourceType.stillImageFilmLink:l=this.stillImageFilmLinkResource(h);break;case o.ResourceType.article:l=this.articleResource(h);break;case o.ResourceType.document:l=this.documentResource(h);break;case o.ResourceType.documentEmbed:l=this.documentEmbedResource(h);break;case o.ResourceType.documentLink:l=this.documentLinkResource(h);break;case o.ResourceType.documentDownload:l=this.documentDownloadResource(h);break;case o.ResourceType.appLink:l=this.appLinkResource(h);break;case o.ResourceType.websiteLink:l=this.websiteLinkResource(h)}return l}imageResource(e,t){const{value:r,src1x:i,src2x:a,src3x:u,src4x:c,width:d,height:p,alt:h,license:y,copyright:m,showInIndex:g,caption:f}=e,b={type:o.ResourceType.image,typeAlias:null!=t?t:o.ResourceType.image,format:n.UrlUtils.fileExtensionFromUrl(r),provider:n.UrlUtils.domainFromUrl(r),value:r,src1x:i,src2x:a,src3x:u,src4x:c,width:d,height:p,alt:h,license:y,copyright:m,showInIndex:g,caption:f};return s.ObjectUtils.removeUnwantedProperties(b),l.NodeValidator.validateResource(b)}imageResponsiveResource(e){const{imagePortrait:t,imageLandscape:r}=e,i={type:o.ResourceType.imageResponsive,typeAlias:o.ResourceType.imageResponsive,imagePortrait:null!=t?t:this.imageResource({format:"",value:""}),imageLandscape:null!=r?r:this.imageResource({format:"",value:""})};return s.ObjectUtils.removeUnwantedProperties(i),l.NodeValidator.validateResource(i)}imageLinkResource(e){const{value:t,src1x:r,src2x:i,src3x:a,src4x:u,width:c,height:d,alt:p,license:h,copyright:y,showInIndex:m,caption:g}=e,f={type:o.ResourceType.imageLink,typeAlias:o.ResourceType.imageLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,src1x:r,src2x:i,src3x:a,src4x:u,width:c,height:d,alt:p,license:h,copyright:y,showInIndex:m,caption:g};return s.ObjectUtils.removeUnwantedProperties(f),l.NodeValidator.validateResource(f)}audioResource(e){const{value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p}=e,h={type:o.ResourceType.audio,typeAlias:o.ResourceType.audio,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p};return s.ObjectUtils.removeUnwantedProperties(h),l.NodeValidator.validateResource(h)}audioEmbedResource(e){const{value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p}=e,h={type:o.ResourceType.audioEmbed,typeAlias:o.ResourceType.audioEmbed,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p};return s.ObjectUtils.removeUnwantedProperties(h),l.NodeValidator.validateResource(h)}audioLinkResource(e){const{value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p}=e,h={type:o.ResourceType.audioLink,typeAlias:o.ResourceType.audioLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,duration:r,mute:i,autoplay:a,license:u,copyright:c,showInIndex:d,caption:p};return s.ObjectUtils.removeUnwantedProperties(h),l.NodeValidator.validateResource(h)}videoResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v}=e,T={type:o.ResourceType.video,typeAlias:o.ResourceType.video,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}videoEmbedResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v}=e,T={type:o.ResourceType.videoEmbed,typeAlias:o.ResourceType.videoEmbed,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}videoLinkResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v}=e,T={type:o.ResourceType.videoLink,typeAlias:o.ResourceType.videoLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}stillImageFilmResource(e){const{image:t,audio:r}=e,i={type:o.ResourceType.stillImageFilm,typeAlias:o.ResourceType.stillImageFilm,image:null!=t?t:this.imageResource({format:"",value:""}),audio:null!=r?r:this.audioResource({format:"",value:""})};return s.ObjectUtils.removeUnwantedProperties(i),l.NodeValidator.validateResource(i)}stillImageFilmEmbedResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v}=e,T={type:o.ResourceType.stillImageFilmEmbed,typeAlias:o.ResourceType.stillImageFilmEmbed,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}stillImageFilmLinkResource(e){const{value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v}=e,T={type:o.ResourceType.stillImageFilmLink,typeAlias:o.ResourceType.stillImageFilmLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,width:r,height:i,duration:a,mute:u,autoplay:c,allowSubtitles:d,showSubtitles:p,alt:h,posterImage:y,thumbnails:m,license:g,copyright:f,showInIndex:b,caption:v};return s.ObjectUtils.removeUnwantedProperties(T),l.NodeValidator.validateResource(T)}articleResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.article,typeAlias:o.ResourceType.article,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.document,typeAlias:o.ResourceType.document,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentEmbedResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.documentEmbed,typeAlias:o.ResourceType.documentEmbed,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentLinkResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.documentLink,typeAlias:o.ResourceType.documentLink,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}documentDownloadResource(e){const{value:t,license:r,copyright:i,showInIndex:a,caption:u}=e,c={type:o.ResourceType.documentDownload,typeAlias:o.ResourceType.documentDownload,format:n.UrlUtils.fileExtensionFromUrl(t),provider:n.UrlUtils.domainFromUrl(t),value:t,license:r,copyright:i,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}appLinkResource(e){const{value:t,license:r,copyright:i,showInIndex:n,caption:a}=e,u={type:o.ResourceType.appLink,typeAlias:o.ResourceType.appLink,value:t,license:r,copyright:i,showInIndex:n,caption:a};return s.ObjectUtils.removeUnwantedProperties(u),l.NodeValidator.validateResource(u)}websiteLinkResource(e){const{value:t,siteName:r,license:i,copyright:n,showInIndex:a,caption:u}=e,c={type:o.ResourceType.websiteLink,typeAlias:o.ResourceType.websiteLink,value:t,siteName:r,license:i,copyright:n,showInIndex:a,caption:u};return s.ObjectUtils.removeUnwantedProperties(c),l.NodeValidator.validateResource(c)}}t.ResourceBuilder=u},2377:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeValidator=void 0;const i=r(208),o=r(1895),s=r(3633);const n=new class{validateBit(e){if(!e)return e;let t=e;if(e.bitType.root===i.RootBitType.interview)t=this.validateInterviewBit(e);return t}validateResource(e){var t,r,i,s;if(!e)return;let n=e,a=!1;switch(e.type){case o.ResourceType.imageResponsive:{const i=e;i.imagePortrait=null!==(t=this.validateResource(i.imagePortrait))&&void 0!==t?t:{type:o.ResourceType.image,typeAlias:o.ResourceType.imagePortrait},i.imageLandscape=null!==(r=this.validateResource(i.imageLandscape))&&void 0!==r?r:{type:o.ResourceType.image,typeAlias:o.ResourceType.imageLandscape},a=!0;break}case o.ResourceType.stillImageFilm:{const t=e;t.image=null!==(i=this.validateResource(t.image))&&void 0!==i?i:{type:o.ResourceType.image,typeAlias:o.ResourceType.image},t.audio=null!==(s=this.validateResource(t.audio))&&void 0!==s?s:{type:o.ResourceType.audio,typeAlias:o.ResourceType.image},a=!0;break}default:a=!!e.value}return a||e.type&&(n={type:e.type,typeAlias:e.type}),n}isRequired(e,t){if(!e)throw new Error(`${t} is required but is not set`)}isOneOfRequired(e,t){if(Array.isArray(e))for(const t of e)if(t)return;throw new Error(`One of '${t.join(", ")}' is required but none is set`)}isString(e,t){if(!s.StringUtils.isString(e))throw new Error(`${t} is required to be a string`)}isNonEmptyString(e,t){if(!s.StringUtils.isString(e)||""===e)throw new Error(`${t} is required to be a non-empty string`)}isStringOrBoolean(e,t){if(!s.StringUtils.isString(e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a string or a boolean`)}isNonEmptyStringOrBoolean(e,t){if((!s.StringUtils.isString(e)||""===e)&&!0!==e&&!1!==e)throw new Error(`${t} is required to be a non-empty string or a boolean`)}isArray(e,t){if(!Array.isArray(e))throw new Error(`${t} is required to be a array`)}isNonEmptyArray(e,t){if(!(Array.isArray(e)&&e.length>0))throw new Error(`${t} is required to be a non-empty array`)}isNumber(e,t){if(!Number.isFinite(e))throw new Error(`${t} is required to be a number`)}isBoolean(e,t){if(!0!==e&&!1!==e)throw new Error(`${t} is required to be a boolean`)}isStringOrNumberOrBooleanOrNullOrUndefined(e,t){if(!s.StringUtils.isString(e)&&!Number.isFinite(e)&&!0!==e&&!1!==e&&null!=e)throw new Error(`${t} is required to be a string or a number or a boolean or null or undefined`)}validateInterviewBit(e){return e.cardNode||(e.cardNode={}),e.cardNode.questions||(e.cardNode.questions=[]),e}};t.NodeValidator=n},227:function(e,t){var r=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.StringWriter=void 0;t.StringWriter=class{constructor(){this._string="",this.endOfLineString="\n"}get isSync(){return!0}getString(){return this._string}open(){return r(this,void 0,void 0,(function*(){this.openSync(),Promise.resolve()}))}close(){return r(this,void 0,void 0,(function*(){try{this.closeSync()}catch(e){return Promise.reject(e)}Promise.resolve()}))}openSync(){this._buffer=[],this._string=""}closeSync(){if(!this._buffer)throw new Error("open() or openSync() never called");this._string=this._buffer.join(""),this._buffer=[]}writeLine(e){return this._buffer?(null!=e?this._buffer.push(e+this.endOfLineString):this._buffer.push(this.endOfLineString),this):this}writeLines(e,t){if(!this._buffer)return this;if(!e)return this;for(let r=0,i=e.length;r<i;r++){const o=e[r];this._buffer.push(o),t&&r<i-1&&this._buffer.push(t),this._buffer.push(this.endOfLineString)}return this}write(e){return this._buffer?(null==e||this._buffer.push(e),this):this}writeWhiteSpace(){return this.write(" "),this}}},4842:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208);i.RootBitType.setMetadata(i.RootBitType._error,{tags:{},resourceAttachmentAllowed:!1,bodyAllowed:!0})},7537:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(9881),o=r(208),s=r(7028),n=r(4719),a=r(6562),l=r(5319),u=r(6027);o.RootBitType.setMetadata(o.RootBitType.appFlashcards,{tags:Object.assign(Object.assign(Object.assign({},u.TAGS_DEFAULT),{[a.TagType.Title]:{},[n.PropertyKey.flashcardSet]:{isProperty:!0,maxCount:i.INFINITE_COUNT}}),l.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:s.ExampleType.string})},3616:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.appLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_APP_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.appLink,bodyAllowed:!1})},4373:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.article,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),{[o.TagType.Title]:{}}),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},2773:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.articleEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ARTICLE_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.articleEmbed,bodyAllowed:!0})},6360:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.articleLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ARTICLE_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.articleLink,bodyAllowed:!0})},6246:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.audio,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_AUDIO_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.audio,bodyAllowed:!0})},9309:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.audioEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_AUDIO_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.audioEmbed,bodyAllowed:!0})},591:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.audioLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_AUDIO_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.audioLink,bodyAllowed:!0})},3851:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.bitAlias,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.TagType.Reference]:{},[o.TagType.Anchor]:{}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},980:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(9881),o=r(208),s=r(4719),n=r(6562),a=r(6027);o.RootBitType.setMetadata(o.RootBitType.book,{tags:Object.assign(Object.assign({},a.TAGS_DEFAULT),{[s.PropertyKey.spaceId]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[n.TagType.Title]:{maxCount:2},[s.PropertyKey.subtype]:{isProperty:!0},[s.PropertyKey.coverImage]:{isProperty:!0},[s.PropertyKey.publisher]:{isProperty:!0},[s.PropertyKey.subject]:{isProperty:!0},[s.PropertyKey.author]:{isProperty:!0},[s.PropertyKey.theme]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},8788:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.botActionResponse,{tags:Object.assign({},s.TAGS_DEFAULT),resourceAttachmentAllowed:!1,cardSet:o.CARD_SET_BOT_ACTION_RESPONSES,bodyAllowed:!0,footerAllowed:!0})},1:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.botActionSend,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.PropertyKey.date]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},7386:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(1895),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.browserImage,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_IMAGE_RESOURCE),{[o.PropertyKey.focusX]:{isProperty:!0},[o.PropertyKey.focusY]:{isProperty:!0}}),resourceAttachmentAllowed:!1,resourceType:s.ResourceType.image,bodyAllowed:!0})},4865:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(5319),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.card1,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},3890:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.chapter,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.TagType.Anchor]:{},[o.TagType.Title]:{}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},3707:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.clozeAndMultipleChoiceText,{tags:Object.assign(Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),o.TAGS_CHAIN_GAP),o.TAGS_CHAIN_TRUE_FALSE),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},2585:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027),a={tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),o.TAGS_CHAIN_GAP),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0};i.RootBitType.setMetadata(i.RootBitType.cloze,a)},8161:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.code,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.PropertyKey.computerLanguage]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},5912:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.conversationLeft1,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),o.TAGS_CHAIN_PARTNER),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},8305:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.document,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_DOCUMENT_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.document,bodyAllowed:!0})},2438:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.documentDownload,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_DOCUMENT_DOWNLOAD_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.documentDownload,bodyAllowed:!0})},5983:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.documentEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_DOCUMENT_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.documentEmbed,bodyAllowed:!0})},1363:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.documentLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_DOCUMENT_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.documentLink,bodyAllowed:!0})},1934:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(7028),s=r(4719),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.essay,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),{[s.PropertyKey.sampleSolution]:{isProperty:!0}}),resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:o.ExampleType.string})},4954:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(7028),s=r(6562),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.example,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),{[s.TagType.Title]:{}}),n.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0,rootExampleType:o.ExampleType.string})},8157:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.flashcard,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:o.CARD_SET_FLASHCARDS,bodyAllowed:!0,footerAllowed:!0})},8253:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(1895),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.focusImage,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_IMAGE_RESOURCE),{[o.PropertyKey.focusX]:{isProperty:!0},[o.PropertyKey.focusY]:{isProperty:!0}}),resourceAttachmentAllowed:!1,resourceType:s.ResourceType.image,bodyAllowed:!0})},1614:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARD_SET_BOT_ACTION_RESPONSES=t.CARD_SET_MATCH_MATRIX=t.CARD_SET_MATCH_IMAGE_PAIRS=t.CARD_SET_MATCH_AUDIO_PAIRS=t.CARD_SET_MATCH_PAIRS=t.CARD_SET_QUESTIONS=t.CARD_SET_QUIZ=t.CARD_SET_STATEMENTS=t.CARD_SET_ELEMENTS=t.CARD_SET_FLASHCARDS=void 0;const i=r(7210),o=r(4719),s=r(1895),n=r(6562),a=r(781),l=r(6027),u={type:i.CardSetType.flashcards,variants:[[{tags:Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_FLASHCARDS=u;const c={type:i.CardSetType.elements,variants:[[{tags:Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_ELEMENTS=c;const d={type:i.CardSetType.statements,variants:[[{tags:Object.assign(Object.assign({[n.TagType.True]:{maxCount:1},[n.TagType.False]:{maxCount:1}},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE)}]]};t.CARD_SET_STATEMENTS=d;const p={type:i.CardSetType.quiz,variants:[[{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_CHAIN_TRUE_FALSE),l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE)}]]};t.CARD_SET_QUIZ=p;const h={type:i.CardSetType.questions,variants:[[{tags:Object.assign(Object.assign({[n.TagType.SampleSolution]:{},[o.PropertyKey.sampleSolution]:{isProperty:!0},[o.PropertyKey.shortAnswer]:{isProperty:!0}},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),bodyAllowed:!0}]]};t.CARD_SET_QUESTIONS=h;const y={type:i.CardSetType.matchPairs,variants:[[{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),{[n.TagType.Title]:{}}),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_MATCH_PAIRS=y;const m={type:i.CardSetType.matchPairs,variants:[[{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),{[n.TagType.Title]:{},[s.ResourceType.audio]:{isResource:!0}}),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_MATCH_AUDIO_PAIRS=m;const g={type:i.CardSetType.matchPairs,variants:[[{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),{[n.TagType.Title]:{},[s.ResourceType.image]:{isResource:!0}}),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_MATCH_IMAGE_PAIRS=g;const f={type:i.CardSetType.matchMatrix,variants:[[{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),{[n.TagType.Title]:{}}),bodyAllowed:!0,infiniteRepeat:!0}]]};t.CARD_SET_MATCH_MATRIX=f;const b={type:i.CardSetType.botActionResponses,variants:[[{tags:Object.assign(Object.assign({[o.PropertyKey.reaction]:{isProperty:!0}},l.TAGS_ITEM_LEAD_INSTRUCTION_HINT),l.TAGS_PROPERTY_EXAMPLE),bodyAllowed:!0}]]};t.CARD_SET_BOT_ACTION_RESPONSES=b},781:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS_CHAIN_MARK=t.TAGS_CHAIN_MARK_CONFIG=t.TAGS_CHAIN_TRUE_FALSE=t.TAGS_CHAIN_GAP=t.TAGS_CHAIN_PARTNER=t.TAGS_CHAIN_IMAGE_SOURCE=void 0;const i=r(9881),o=r(4719),s=r(6562),n=r(5319),a=r(6027),l={[o.PropertyKey.imageSource]:{isProperty:!0,chain:{[o.PropertyKey.mockupId]:{isProperty:!0},[o.PropertyKey.size]:{isProperty:!0},[o.PropertyKey.format]:{isProperty:!0},[o.PropertyKey.trim]:{isProperty:!0}}}};t.TAGS_CHAIN_IMAGE_SOURCE=l;const u={[o.PropertyKey.partner]:{isProperty:!0,chain:Object.assign({},n.TAGS_CHAIN_IMAGE_RESOURCE)}};t.TAGS_CHAIN_PARTNER=u;const c={[s.TagType.Gap]:{maxCount:i.INFINITE_COUNT,chain:Object.assign(Object.assign({[s.TagType.Gap]:{maxCount:i.INFINITE_COUNT}},a.TAGS_ITEM_LEAD_INSTRUCTION_HINT),a.TAGS_PROPERTY_EXAMPLE)}};t.TAGS_CHAIN_GAP=c;const d={[s.TagType.True]:{maxCount:i.INFINITE_COUNT,chain:Object.assign(Object.assign({[s.TagType.True]:{maxCount:i.INFINITE_COUNT},[s.TagType.False]:{maxCount:i.INFINITE_COUNT}},a.TAGS_ITEM_LEAD_INSTRUCTION_HINT),a.TAGS_PROPERTY_EXAMPLE)},[s.TagType.False]:{maxCount:i.INFINITE_COUNT,chain:Object.assign(Object.assign({[s.TagType.True]:{maxCount:i.INFINITE_COUNT},[s.TagType.False]:{maxCount:i.INFINITE_COUNT}},a.TAGS_ITEM_LEAD_INSTRUCTION_HINT),a.TAGS_PROPERTY_EXAMPLE)}};t.TAGS_CHAIN_TRUE_FALSE=d;const p={[o.PropertyKey.mark]:{isProperty:!0,maxCount:i.INFINITE_COUNT,chain:{[o.PropertyKey.color]:{isProperty:!0},[o.PropertyKey.emphasis]:{isProperty:!0}}}};t.TAGS_CHAIN_MARK_CONFIG=p;const h={[s.TagType.Mark]:{maxCount:i.INFINITE_COUNT,chain:Object.assign({[o.PropertyKey.mark]:{isProperty:!0}},a.TAGS_PROPERTY_EXAMPLE)}};t.TAGS_CHAIN_MARK=h},5319:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS_CHAIN_ANY_RESOURCE=t.TAGS_CHAIN_WEBSITE_LINK_RESOURCE=t.TAGS_CHAIN_APP_LINK_RESOURCE=t.TAGS_CHAIN_DOCUMENT_DOWNLOAD_RESOURCE=t.TAGS_CHAIN_DOCUMENT_LINK_RESOURCE=t.TAGS_CHAIN_DOCUMENT_EMBED_RESOURCE=t.TAGS_CHAIN_DOCUMENT_RESOURCE=t.TAGS_CHAIN_ARTICLE_LINK_RESOURCE=t.TAGS_CHAIN_ARTICLE_EMBED_RESOURCE=t.TAGS_CHAIN_ARTICLE_RESOURCE=t.TAGS_CHAIN_STILL_IMAGE_FILM_LINK_RESOURCE=t.TAGS_CHAIN_STILL_IMAGE_FILM_EMBED_RESOURCE=t.TAGS_CHAIN_STILL_IMAGE_FILM_RESOURCE=t.TAGS_CHAIN_VIDEO_LINK_RESOURCE=t.TAGS_CHAIN_VIDEO_EMBED_RESOURCE=t.TAGS_CHAIN_VIDEO_RESOURCE=t.TAGS_CHAIN_AUDIO_LINK_RESOURCE=t.TAGS_CHAIN_AUDIO_EMBED_RESOURCE=t.TAGS_CHAIN_AUDIO_RESOURCE=t.TAGS_CHAIN_IMAGE_RESPONSIVE_RESOURCE=t.TAGS_CHAIN_IMAGE_LINK_RESOURCE=t.TAGS_CHAIN_IMAGE_EMBED_RESOURCE=t.TAGS_CHAIN_IMAGE_RESOURCE=void 0;const i=r(4719),o=r(1895),s={[i.PropertyKey.license]:{isProperty:!0},[i.PropertyKey.copyright]:{isProperty:!0},[i.PropertyKey.caption]:{isProperty:!0},[i.PropertyKey.showInIndex]:{isProperty:!0}},n=Object.assign(Object.assign({},s),{[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0},[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0}}),a={[o.ResourceType.image]:{isResource:!0,chain:Object.assign({},n)}};t.TAGS_CHAIN_IMAGE_RESOURCE=a;const l={[o.ResourceType.imageEmbed]:{isResource:!0,chain:Object.assign({},n)}};t.TAGS_CHAIN_IMAGE_EMBED_RESOURCE=l;const u={[o.ResourceType.imageLink]:{isResource:!0,chain:Object.assign({},n)}};t.TAGS_CHAIN_IMAGE_LINK_RESOURCE=u;const c={[o.ResourceType.imagePortrait]:{isResource:!0,chain:Object.assign({},n)},[o.ResourceType.imageLandscape]:{isResource:!0,chain:Object.assign({},n)}};t.TAGS_CHAIN_IMAGE_RESPONSIVE_RESOURCE=c;const d=Object.assign(Object.assign({},s),{[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0}}),p={[o.ResourceType.audio]:{isResource:!0,chain:Object.assign({},d)}};t.TAGS_CHAIN_AUDIO_RESOURCE=p;const h={[o.ResourceType.audioEmbed]:{isResource:!0,chain:Object.assign({},d)}};t.TAGS_CHAIN_AUDIO_EMBED_RESOURCE=h;const y={[o.ResourceType.audioLink]:{isResource:!0,chain:Object.assign({},d)}};t.TAGS_CHAIN_AUDIO_LINK_RESOURCE=y;const m=Object.assign(Object.assign({},s),{[i.PropertyKey.width]:{isProperty:!0},[i.PropertyKey.height]:{isProperty:!0},[i.PropertyKey.duration]:{isProperty:!0},[i.PropertyKey.mute]:{isProperty:!0},[i.PropertyKey.autoplay]:{isProperty:!0},[i.PropertyKey.allowSubtitles]:{isProperty:!0},[i.PropertyKey.showSubtitles]:{isProperty:!0},[i.PropertyKey.alt]:{isProperty:!0},[i.PropertyKey.posterImage]:{isProperty:!0},[i.PropertyKey.src1x]:{isProperty:!0},[i.PropertyKey.src2x]:{isProperty:!0},[i.PropertyKey.src3x]:{isProperty:!0},[i.PropertyKey.src4x]:{isProperty:!0}}),g={[o.ResourceType.video]:{isResource:!0,chain:Object.assign({},m)}};t.TAGS_CHAIN_VIDEO_RESOURCE=g;const f={[o.ResourceType.videoEmbed]:{isResource:!0,chain:Object.assign({},m)}};t.TAGS_CHAIN_VIDEO_EMBED_RESOURCE=f;const b={[o.ResourceType.videoLink]:{isResource:!0,chain:Object.assign({},m)}};t.TAGS_CHAIN_VIDEO_LINK_RESOURCE=b;const v={[o.ResourceType.image]:{isResource:!0,chain:Object.assign({},n)},[o.ResourceType.audio]:{isResource:!0,chain:Object.assign({},d)}};t.TAGS_CHAIN_STILL_IMAGE_FILM_RESOURCE=v;const T={[o.ResourceType.stillImageFilmEmbed]:{isResource:!0,chain:Object.assign({},m)}};t.TAGS_CHAIN_STILL_IMAGE_FILM_EMBED_RESOURCE=T;const A={[o.ResourceType.stillImageFilmLink]:{isResource:!0,chain:Object.assign({},m)}};t.TAGS_CHAIN_STILL_IMAGE_FILM_LINK_RESOURCE=A;const _={[o.ResourceType.article]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_ARTICLE_RESOURCE=_;const P={[o.ResourceType.articleEmbed]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_ARTICLE_EMBED_RESOURCE=P;const S={[o.ResourceType.articleLink]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_ARTICLE_LINK_RESOURCE=S;const x={[o.ResourceType.document]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_DOCUMENT_RESOURCE=x;const w={[o.ResourceType.documentEmbed]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_DOCUMENT_EMBED_RESOURCE=w;const R={[o.ResourceType.documentLink]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_DOCUMENT_LINK_RESOURCE=R;const O={[o.ResourceType.documentDownload]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_DOCUMENT_DOWNLOAD_RESOURCE=O;const k={[o.ResourceType.appLink]:{isResource:!0,chain:Object.assign({},s)}};t.TAGS_CHAIN_APP_LINK_RESOURCE=k;const C={[o.ResourceType.websiteLink]:{isResource:!0,chain:Object.assign(Object.assign({},s),{[i.PropertyKey.siteName]:{isProperty:!0}})}};t.TAGS_CHAIN_WEBSITE_LINK_RESOURCE=C;const E=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),l),u),c),p),h),y),g),f),b),v),T),A),_),P),S),x),w),R),O),k),C);t.TAGS_CHAIN_ANY_RESOURCE=E},6027:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS_PROPERTY_EXAMPLE=t.TAGS_ITEM_LEAD_INSTRUCTION_HINT=t.TAGS_ALL_BITS=t.TAGS_DEFAULT=void 0;const i=r(9881),o=r(4719),s=r(6562),n={[o.PropertyKey.id]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.externalId]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.aiGenerated]:{isProperty:!0},[o.PropertyKey.ageRange]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.language]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.target]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.tag]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[o.PropertyKey.icon]:{isProperty:!0},[o.PropertyKey.iconTag]:{isProperty:!0},[o.PropertyKey.colorTag]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[s.TagType.Anchor]:{}};t.TAGS_ALL_BITS=n;const a={[s.TagType.ItemLead]:{maxCount:2},[s.TagType.Instruction]:{},[s.TagType.Hint]:{}};t.TAGS_ITEM_LEAD_INSTRUCTION_HINT=a;const l={[o.PropertyKey.example]:{isProperty:!0}};t.TAGS_PROPERTY_EXAMPLE=l;const u=Object.assign(Object.assign(Object.assign({},n),a),l);t.TAGS_DEFAULT=u},1559:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.highlightText,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),o.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},5046:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.image,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.image,bodyAllowed:!0})},76:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.imageLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.imageLink,bodyAllowed:!0})},1193:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(781),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.imageOnDevice,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_IMAGE_RESOURCE),s.TAGS_CHAIN_IMAGE_SOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.image,resourceOptional:!0,bodyAllowed:!0})},2664:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.imageResponsive,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_RESPONSIVE_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.imageResponsive,bodyAllowed:!0})},4861:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.internalLink,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.TagType.Reference]:{}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},2161:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.interview,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:o.CARD_SET_QUESTIONS,bodyAllowed:!0,footerAllowed:!0})},9338:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(9881),o=r(208),s=r(4719),n=r(6562),a=r(5319),l=r(6027),u={[s.PropertyKey.action]:{isProperty:!0},[s.PropertyKey.duration]:{isProperty:!0},[s.PropertyKey.date]:{isProperty:!0},[s.PropertyKey.location]:{isProperty:!0},[s.PropertyKey.list]:{isProperty:!0,maxCount:i.INFINITE_COUNT},[s.PropertyKey.textReference]:{isProperty:!0},[s.PropertyKey.isTracked]:{isProperty:!0},[s.PropertyKey.isInfoOnly]:{isProperty:!0},[s.PropertyKey.book]:{isProperty:!0,chain:{[n.TagType.Reference]:{maxCount:2}}}};o.RootBitType.setMetadata(o.RootBitType.learningPathBook,{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_DEFAULT),a.TAGS_CHAIN_ANY_RESOURCE),u),resourceAttachmentAllowed:!0,bodyAllowed:!0}),o.RootBitType.setMetadata(o.RootBitType.learningPathExternalLink,{tags:Object.assign(Object.assign(Object.assign(Object.assign({},l.TAGS_DEFAULT),a.TAGS_CHAIN_ANY_RESOURCE),u),{[s.PropertyKey.externalLink]:{isProperty:!0},[s.PropertyKey.externalLinkText]:{isProperty:!0}}),resourceAttachmentAllowed:!0,bodyAllowed:!0}),o.RootBitType.setMetadata(o.RootBitType.learningPathVideoCall,{tags:Object.assign(Object.assign(Object.assign(Object.assign({},l.TAGS_DEFAULT),a.TAGS_CHAIN_ANY_RESOURCE),u),{[s.PropertyKey.videoCallLink]:{isProperty:!0}}),resourceAttachmentAllowed:!0,bodyAllowed:!0})},700:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.mark,{tags:Object.assign(Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),o.TAGS_CHAIN_MARK_CONFIG),o.TAGS_CHAIN_MARK),resourceAttachmentAllowed:!0,bodyAllowed:!0})},8371:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(5319),s=r(6027),n=r(1614);i.RootBitType.setMetadata(i.RootBitType.match,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:n.CARD_SET_MATCH_PAIRS,bodyAllowed:!0,footerAllowed:!0}),i.RootBitType.setMetadata(i.RootBitType.matchMatrix,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:n.CARD_SET_MATCH_MATRIX,bodyAllowed:!0,footerAllowed:!0}),i.RootBitType.setMetadata(i.RootBitType.matchAudio,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:n.CARD_SET_MATCH_AUDIO_PAIRS,bodyAllowed:!0,footerAllowed:!0}),i.RootBitType.setMetadata(i.RootBitType.matchPicture,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:n.CARD_SET_MATCH_IMAGE_PAIRS,bodyAllowed:!0,footerAllowed:!0})},5730:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleChoice1,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),o.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},3947:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(781),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleChoice,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),s.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,cardSet:o.CARD_SET_QUIZ,bodyAllowed:!0,footerAllowed:!0})},9745:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleChoiceText,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),o.TAGS_CHAIN_TRUE_FALSE),s.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},2033:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(781),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleResponse1,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),o.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},9780:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1614),s=r(781),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.multipleResponse,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),s.TAGS_CHAIN_TRUE_FALSE),resourceAttachmentAllowed:!0,cardSet:o.CARD_SET_QUIZ,bodyAllowed:!0,footerAllowed:!0})},8801:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.photo,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_IMAGE_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.image,bodyAllowed:!0})},4446:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.quote,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.PropertyKey.quotedPerson]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},1417:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6027);i.RootBitType.setMetadata(i.RootBitType.rating,{tags:Object.assign({},o.TAGS_DEFAULT),resourceAttachmentAllowed:!1,bodyAllowed:!0})},5309:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.releaseNote,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),{[o.PropertyKey.releaseVersion]:{isProperty:!0}}),resourceAttachmentAllowed:!0,bodyAllowed:!0})},543:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6562),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.sampleSolution,{tags:Object.assign(Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_ANY_RESOURCE),{[o.TagType.Anchor]:{},[o.TagType.Reference]:{}}),resourceAttachmentAllowed:!0,bodyAllowed:!0})},9330:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(7028),s=r(1614),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.sequence,{tags:Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,cardSet:s.CARD_SET_ELEMENTS,bodyAllowed:!0,footerAllowed:!0,rootExampleType:o.ExampleType.boolean})},3983:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.stillImageFilm,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_STILL_IMAGE_FILM_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.stillImageFilm,bodyAllowed:!0})},7030:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.stillImageFilmEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_STILL_IMAGE_FILM_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.stillImageFilmEmbed,bodyAllowed:!0})},2527:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.stillImageFilmLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_STILL_IMAGE_FILM_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.stillImageFilmLink,bodyAllowed:!0})},8388:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(5319),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.surveyAnonymous,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},8424:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(5319),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.survey,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),o.TAGS_CHAIN_ANY_RESOURCE),resourceAttachmentAllowed:!0,bodyAllowed:!0})},4157:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(6027);i.RootBitType.setMetadata(i.RootBitType.toc,{tags:Object.assign({},o.TAGS_DEFAULT),resourceAttachmentAllowed:!1,bodyAllowed:!0})},3194:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(7028),s=r(4719),n=r(6562),a=r(5319),l=r(6027);i.RootBitType.setMetadata(i.RootBitType.trueFalse1,{tags:Object.assign(Object.assign(Object.assign({},l.TAGS_DEFAULT),a.TAGS_CHAIN_ANY_RESOURCE),{[s.PropertyKey.labelTrue]:{isProperty:!0},[s.PropertyKey.labelFalse]:{isProperty:!0},[n.TagType.True]:{},[n.TagType.False]:{}}),resourceAttachmentAllowed:!0,bodyAllowed:!1,rootExampleType:o.ExampleType.boolean})},4238:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(1614),n=r(5319),a=r(6027);i.RootBitType.setMetadata(i.RootBitType.trueFalse,{tags:Object.assign(Object.assign(Object.assign({},a.TAGS_DEFAULT),n.TAGS_CHAIN_ANY_RESOURCE),{[o.PropertyKey.labelTrue]:{isProperty:!0},[o.PropertyKey.labelFalse]:{isProperty:!0}}),resourceAttachmentAllowed:!0,cardSet:s.CARD_SET_STATEMENTS,bodyAllowed:!0,footerAllowed:!0})},9755:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(4719),s=r(6027);i.RootBitType.setMetadata(i.RootBitType.vendorPadletEmbed,{tags:Object.assign(Object.assign({},s.TAGS_DEFAULT),{[o.PropertyKey.padletId]:{isProperty:!0}}),resourceAttachmentAllowed:!1,bodyAllowed:!0})},5297:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.video,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_VIDEO_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.video,bodyAllowed:!0})},2787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.videoEmbed,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_VIDEO_EMBED_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.videoEmbed,bodyAllowed:!0})},7159:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.videoLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_VIDEO_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.videoLink,bodyAllowed:!0})},1703:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(208),o=r(1895),s=r(5319),n=r(6027);i.RootBitType.setMetadata(i.RootBitType.websiteLink,{tags:Object.assign(Object.assign({},n.TAGS_DEFAULT),s.TAGS_CHAIN_WEBSITE_LINK_RESOURCE),resourceAttachmentAllowed:!1,resourceType:o.ResourceType.websiteLink,bodyAllowed:!0})},2093:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),r(4842),r(7537),r(3616),r(4373),r(2773),r(6360),r(6246),r(9309),r(591),r(3851),r(980),r(8788),r(1),r(7386),r(4865),r(3890),r(3707),r(2585),r(8161),r(5912),r(8305),r(2438),r(5983),r(1363),r(1934),r(4954),r(8157),r(8253),r(1559),r(5046),r(76),r(1193),r(2664),r(4861),r(2161),r(9338),r(700),r(8371),r(5730),r(3947),r(9745),r(2033),r(9780),r(8801),r(4446),r(1417),r(5309),r(543),r(9330),r(3983),r(7030),r(2527),r(8388),r(8424),r(4157),r(3194),r(4238),r(9755),r(5297),r(2787),r(7159),r(1703),r(5595),r(6138),r(7243),r(1197),r(3828),r(9787),r(3728),r(3589),r(460),r(3544),r(4681),r(9678),r(4303),r(5805),r(8634),r(5158),r(374),r(9851),r(9551),r(2853),r(1128),r(6514),r(9546),r(2347),r(1802),r(9251),r(6263),r(6321),r(3904),r(7582),r(209),r(2737),r(5243),r(1285),r(6367),r(7443),r(4245),r(5635),r(8558),r(8856),r(2786),r(2375),r(8699),r(6667),r(7538),r(4648),r(9448),r(1500),r(759),r(8e3),r(2706),r(5044),r(5820),r(1502),r(3477),r(7882),r(5175),r(5804),r(2675),r(9404),r(6625),r(3908),r(757),r(3739),r(2891)},5595:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.action,{isSingle:!0,isTrimmedString:!0})},6138:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.ageRange,{isTrimmedString:!0})},7243:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.aiGenerated,{astKey:"aiGenerated",isSingle:!0,isBoolean:!0})},1197:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.author,{isTrimmedString:!0})},3828:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.book,{isTrimmedString:!0,isSingle:!0})},9787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.bot,{})},3728:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.caseSensitive,{isSingle:!0,isBoolean:!0,astKey:"isCaseSensitive",jsonKey:"isCaseSensitive"})},3589:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.color,{isSingle:!0,isTrimmedString:!0})},460:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.colorTag,{isTrimmedString:!0})},3544:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.computerLanguage,{isSingle:!0,isTrimmedString:!0})},4681:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.coverImage,{isTrimmedString:!0})},9678:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.date,{isSingle:!0})},4303:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.deeplink,{isTrimmedString:!0})},5805:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.duration,{isSingle:!0,isTrimmedString:!0})},8634:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.example,{isSingle:!0})},5158:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.externalId,{isTrimmedString:!0})},374:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.externalLink,{isSingle:!0,isTrimmedString:!0})},9851:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.externalLinkText,{isSingle:!0,isTrimmedString:!0})},9551:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.flashcardSet,{isTrimmedString:!0})},2853:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.focusX,{isSingle:!0,isNumber:!0})},1128:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.focusY,{isSingle:!0,isNumber:!0})},6514:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.format,{isSingle:!0,isTrimmedString:!0})},9546:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.icon,{isSingle:!0,isTrimmedString:!0})},2347:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.iconTag,{isSingle:!0,isTrimmedString:!0})},1802:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.id,{isTrimmedString:!0})},9251:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.imageSource,{isSingle:!0,isTrimmedString:!0})},6263:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.emphasis,{isSingle:!0,isTrimmedString:!0})},6321:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.isInfoOnly,{isSingle:!0,isBoolean:!0})},3904:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.isTracked,{isSingle:!0,isBoolean:!0})},7582:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.kind,{isSingle:!0,isTrimmedString:!0})},209:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.labelFalse,{isSingle:!0,isTrimmedString:!0})},2737:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.labelTrue,{isSingle:!0,isTrimmedString:!0})},5243:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.language,{isTrimmedString:!0})},1285:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.level,{isSingle:!0,astKey:"levelProperty"})},6367:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.list,{isTrimmedString:!0})},7443:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.location,{isSingle:!0,isTrimmedString:!0})},4245:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.longAnswer,{isSingle:!0,isInvertedBoolean:!0,astKey:"isShortAnswer",jsonKey:"isShortAnswer"})},5635:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.mark,{isTrimmedString:!0})},8558:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.mockupId,{isSingle:!0,isTrimmedString:!0})},8856:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.padletId,{isTrimmedString:!0,isSingle:!0})},2786:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.partialAnswer,{isSingle:!0,isTrimmedString:!0})},2375:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.partner,{isTrimmedString:!0,isSingle:!0})},8699:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.progress,{isSingle:!0,isBoolean:!0,ignoreTrue:!0})},6667:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.publications,{isTrimmedString:!0})},7538:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.publisher,{isTrimmedString:!0})},4648:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.quotedPerson,{isSingle:!0,isTrimmedString:!0})},9448:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.reaction,{isSingle:!0,isTrimmedString:!0})},1500:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.reference,{isSingle:!1,isTrimmedString:!0,astKey:"referenceProperty"})},759:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.releaseVersion,{isTrimmedString:!0,isSingle:!0})},8e3:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.width,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.height,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.license,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.copyright,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.caption,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.showInIndex,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.alt,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.src1x,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.src2x,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.src3x,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.src4x,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.mute,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.autoplay,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.allowSubtitles,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.showSubtitles,{isSingle:!0,isBoolean:!0}),i.PropertyKey.setMetadata(i.PropertyKey.siteName,{isSingle:!0,isTrimmedString:!0}),i.PropertyKey.setMetadata(i.PropertyKey.posterImage,{isSingle:!0,isTrimmedString:!0})},2706:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.sampleSolution,{isSingle:!0,isTrimmedString:!0})},5044:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.shortAnswer,{isSingle:!0,isBoolean:!0,astKey:"isShortAnswer",jsonKey:"isShortAnswer"})},5820:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.size,{isSingle:!0,isNumber:!0})},1502:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.spaceId,{isTrimmedString:!0})},3477:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.subject,{isTrimmedString:!0})},7882:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.subtype,{isSingle:!0,isTrimmedString:!0})},5175:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.tag,{isTrimmedString:!0})},5804:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.target,{isTrimmedString:!0})},2675:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.textReference,{isSingle:!0,isTrimmedString:!0})},9404:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.theme,{isTrimmedString:!0})},6625:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.thumbImage,{isSingle:!0,isTrimmedString:!0})},3908:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.toc,{isSingle:!0,isBoolean:!0,ignoreTrue:!0})},757:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.trim,{isSingle:!0,isBoolean:!0})},3739:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.type,{isSingle:!0,isTrimmedString:!0})},2891:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const i=r(4719);i.PropertyKey.setMetadata(i.PropertyKey.videoCallLink,{isSingle:!0,isTrimmedString:!0})},1022:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildInfo=void 0,t.buildInfo={name:"@gmb/bitmark-parser-generator",version:"1.3.1",author:"Richard Sewell",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),s=r(7448);function n(e,t,r,i){var o=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(o,n.prototype),o.expected=t,o.found=r,o.location=i,o.name="SyntaxError",o}function a(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}t.SyntaxError=n,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(n,Error),n.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){i=e[r].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,s=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,n=this.location.source+":"+s.line+":"+s.column;if(i){var l=this.location.end,u=a("",s.line.toString().length," "),c=i[o.line-1],d=(o.line===l.line?l.column:c.length+1)-o.column||1;t+="\n --\x3e "+n+"\n"+u+" |\n"+s.line+" | "+c+"\n"+u+" | "+a("",o.column-1," ")+a("",d,"^")}else t+="\n at "+n}return t},n.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?s(e[0])+"-"+s(e[1]):s(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function i(e){return e.charCodeAt(0).toString(16).toUpperCase()}function o(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function s(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function n(e){return r[e.type](e)}return"Expected "+function(e){var t,r,i=e.map(n);if(i.sort(),i.length>0){for(t=1,r=1;t<i.length;t++)i[t-1]!==i[t]&&(i[r]=i[t],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(e)+" but "+function(e){return e?'"'+o(e)+'"':"end of input"}(t)+" found."},t.parse=function e(t,r){var a,l={},u=(r=void 0!==r?r:{}).grammarSource,c={bitmark:sr,bit:function(){var e,t,r,i,o;e=$t,t=[],r=kr();for(;r!==l;)t.push(r),r=kr();if((r=lr())!==l){for(i=[],o=kr();o!==l;)i.push(o),o=kr();qt=e,e=We(r)}else $t=e,e=l;return e},cardContent:function(){var e,t,r;e=$t,t=[],(r=pr())===l&&(r=Tr());for(;r!==l;)t.push(r),(r=pr())===l&&(r=Tr());return qt=e,t=vt(t),e=t}},d=sr,p="[.",h="]",y=":",m="&",g="====",f="~~~~",b="--",v="++",T="===",A="==",_="[@id",P="[",S="#",x="[▼",w="[►",R="[@",O="[%",k="[!",C="[?",E="[+",I="[-",j="[$",B="[_",L="[=",N="[&",M="::",U="||",D="id:",V="\n",K="\r\n",F="\r",G="\u2028",H="\u2029",$=/^[^\]]/,q=/^[^:\]]/,J=/^[^&:\]]/,z=/^[ \t]/,W=/^[^\n\r\u2028\u2029]/,Y=/^[ \t\n\r\u2028\u2029]/,X=Qt("[.",!1),Q=Zt(["]"],!0,!1),Z=Qt("]",!1),ee=Qt(":",!1),te=Qt("&",!1),re={type:"any"},ie=Qt("====",!1),oe=Qt("~~~~",!1),se=Qt("--",!1),ne=Qt("++",!1),ae=Qt("===",!1),le=Qt("==",!1),ue=Qt("[@id",!1),ce=Qt("[",!1),de=Qt("#",!1),pe=Qt("[▼",!1),he=Qt("[►",!1),ye=Qt("[@",!1),me=Qt("[%",!1),ge=Qt("[!",!1),fe=Qt("[?",!1),be=Qt("[+",!1),ve=Qt("[-",!1),Te=Qt("[$",!1),Ae=Qt("[_",!1),_e=Qt("[=",!1),Pe=Qt("[&",!1),Se=Qt("::",!1),xe=Qt("||",!1),we=Qt("id:",!1),Re=Zt([":","]"],!0,!1),Oe=Zt(["&",":","]"],!0,!1),ke=(er("Empty"),Zt([" ","\t"],!1,!1)),Ce=er("Anything"),Ee=er("Character"),Ie=Zt(["\n","\r","\u2028","\u2029"],!0,!1),je=er("Line"),Be=(er("whitespace in line"),er("Blank Line")),Le=er("Line Terminator"),Ne=Qt("\n",!1),Me=Qt("\r\n",!1),Ue=Qt("\r",!1),De=Qt("\u2028",!1),Ve=Qt("\u2029",!1),Ke=er("Whitespace, then Line Terminator"),Fe=er("whitespace"),Ge=Zt([" ","\t","\n","\r","\u2028","\u2029"],!1,!1),He=function(e,t){return Nr.buildBits([e,...t])},$e=function(e){return Lr.handleRawBit(e)},qe=function(e){return e},Je=function(e){return Lr.handleRawBit(e)},ze=function(e){return e},We=function(e){return e},Ye=function(e,t){return Nr.buildBit(e,t)},Xe=function(e){return Nr.invalidBit(e)},Qe=function(e,t){return Nr.buildBitHeader(e,t)},Ze=function(e,t){return Nr.buildTextAndResourceType(e,t)},et=function(e){return Lr.handleTextFormat(e)},tt=function(e){return Lr.handleResourceType(e)},rt=function(e){return Lr.handleBitContent(e)},it=function(e){return Lr.handleTagChain(e)},ot=function(e){return e},st=function(e){return Lr.handleBitTag(e)},nt=function(e){return{type:i.TypeKey.BodyChar,value:e}},at=function(e){return Lr.handleCardSet(e[1].flat())},lt=function(){Lr.handleCardSetStart()},ut=function(){Lr.handleCardSetEnd()},ct=function(e){return Lr.handleCards(e)},dt=function(e){return Lr.handleCardLineOrDivider(e,2)},pt=function(e){return Lr.handleCardLine(e)},ht=function(e){return Lr.handleCardSet(e[1].flat())},yt=function(){Lr.handleCardSetStart()},mt=function(){Lr.handleCardSetEnd()},gt=function(e){return Lr.handleCards(e)},ft=function(e){return Lr.handleCardLineOrDivider(e,1)},bt=function(e){return Lr.handleCardLine(e)},vt=function(e){return Lr.handleCardContent(e)},Tt=function(e){return{type:i.TypeKey.CardChar,value:e}},At=function(e){return Lr.handlePropertyTag("id",e)},_t=function(e,t){return Lr.handleTag(i.TypeKey.Title,{level:e,title:t})},Pt=function(e){return Lr.handleTag(i.TypeKey.Anchor,e)},St=function(e){return Lr.handleTag(i.TypeKey.Reference,e)},xt=function(e,t){return Lr.handlePropertyTag(e,t)},wt=function(e){return Lr.handleTag(i.TypeKey.ItemLead,e)},Rt=function(e){return Lr.handleTag(i.TypeKey.Instruction,e)},Ot=function(e){return Lr.handleTag(i.TypeKey.Hint,e)},kt=function(e){return Lr.handleTag(i.TypeKey.True,e)},Ct=function(e){return Lr.handleTag(i.TypeKey.False,e)},Et=function(e){return Lr.handleTag(i.TypeKey.SampleSolution,e)},It=function(e){return Lr.handleTag(i.TypeKey.Gap,e)},jt=function(e){return Lr.handleTag(i.TypeKey.Mark,e)},Bt=function(e,t){return Lr.handleResourceTag(e,t)},Lt=function(e){return Lr.handleTag(i.TypeKey.BodyText,e)},Nt=function(e){return Lr.handleTag(i.TypeKey.Comment,e)},Mt=function(e){return e},Ut=function(e){return e?e.trim():""},Dt=function(e){return e?e.trim():null},Vt=function(e){return e?e.trim():""},Kt=function(){return!0},Ft=function(e){return e},Gt=function(e){return e},Ht=function(e){return e},$t=0,qt=0,Jt=[{line:1,column:1}],zt=0,Wt=[],Yt=0;if("startRule"in r){if(!(r.startRule in c))throw new Error("Can't start parsing from rule \""+r.startRule+'".');d=c[r.startRule]}function Xt(){return t.substring(qt,$t)}function Qt(e,t){return{type:"literal",text:e,ignoreCase:t}}function Zt(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function er(e){return{type:"other",description:e}}function tr(e){var r,i=Jt[e];if(i)return i;for(r=e-1;!Jt[r];)r--;for(i={line:(i=Jt[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return Jt[e]=i,i}function rr(e,t,r){var i=tr(e),o=tr(t),s={source:u,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:o.line,column:o.column}};return r&&u&&"function"==typeof u.offset&&(s.start=u.offset(s.start),s.end=u.offset(s.end)),s}function ir(e){$t<zt||($t>zt&&(zt=$t,Wt=[]),Wt.push(e))}function or(e,t,r){return new n(n.buildMessage(e,t),e,t,r)}function sr(){return function(){var e,r,i,o;e=$t,r=[],(i=Ir())===l&&(i=Ar());for(;i!==l;)r.push(i),(i=Ir())===l&&(i=Ar());return i=function(){var e,r,i,o;e=$t,r=$t,i=[],o=ar();for(;o!==l;)i.push(o),o=ar();return r=t.substring(r,$t),qt=e,r=$e(r),e=r,e}(),o=function(){var e,t;e=[],t=nr();for(;t!==l;)e.push(t),t=nr();return e}(),qt=e,e=He(i,o),e}()}function nr(){var e,r,i,o;for(e=$t,r=[],i=kr();i!==l;)r.push(i),i=kr();return(i=Cr())===l&&(i=null),o=function(){var e,r,i,o,s,n;if(e=$t,r=$t,i=$t,o=function(){var e,r,i,o;e=$t,t.substr($t,2)===p?(r=p,$t+=2):(r=l,0===Yt&&ir(X));if(r!==l){for(i=[],$.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Q));o!==l;)i.push(o),$.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Q));93===t.charCodeAt($t)?(o=h,$t++):(o=l,0===Yt&&ir(Z)),o!==l?(qt=e,e=ze(r)):($t=e,e=l)}else $t=e,e=l;return e}(),o!==l){for(s=[],n=ar();n!==l;)s.push(n),n=ar();i=o=[o,s]}else $t=i,i=l;r=i!==l?t.substring(r,$t):i;r!==l&&(qt=e,r=Je(r));return e=r,e}(),o!==l?(qt=e,e=qe(o)):($t=e,e=l),e}function ar(){var e,t,r,i;if(e=$t,(t=Cr())!==l?(r=$t,Yt++,i=ur(),Yt--,i===l?r=void 0:($t=r,r=l),r!==l?e=t=[t,r]:($t=e,e=l)):($t=e,e=l),e===l)if(e=[],(t=Rr())!==l)for(;t!==l;)e.push(t),t=Rr();else e=l;return e}function lr(){var e,r,i;return e=$t,(r=ur())!==l?(i=function(){var e,t,r;e=$t,t=[],r=gr(),r===l&&(r=br())===l&&(r=pr())===l&&(r=mr());for(;r!==l;)t.push(r),(r=gr())===l&&(r=br())===l&&(r=pr())===l&&(r=mr());return qt=e,t=rt(t),e=t,e}(),qt=e,e=Ye(r,i)):($t=e,e=l),e===l&&(e=$t,r=$t,i=function(){var e,r;Yt++,e=[],t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re));for(;r!==l;)e.push(r),t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re));Yt--,r=l,0===Yt&&ir(Ce);return e}(),r=t.substring(r,$t),qt=e,e=r=Xe(r)),e}function ur(){var e,r,i,o,s;return e=$t,t.substr($t,2)===p?(r=p,$t+=2):(r=l,0===Yt&&ir(X)),r!==l?(i=xr(),o=function(){var e,t,r;e=$t,t=cr(),t===l&&(t=dr());t===l&&(t=null);r=cr(),r===l&&(r=dr());r===l&&(r=null);return qt=e,e=Ze(t,r),e}(),93===t.charCodeAt($t)?(s=h,$t++):(s=l,0===Yt&&ir(Z)),s!==l?(qt=e,e=Qe(i,o)):($t=e,e=l)):($t=e,e=l),e}function cr(){var e,r,i;return e=$t,58===t.charCodeAt($t)?(r=y,$t++):(r=l,0===Yt&&ir(ee)),r!==l?(i=xr(),qt=e,e=et(i)):($t=e,e=l),e}function dr(){var e,r,i;return e=$t,38===t.charCodeAt($t)?(r=m,$t++):(r=l,0===Yt&&ir(te)),r!==l?(i=xr(),qt=e,e=tt(i)):($t=e,e=l),e}function pr(){var e,t,r,i,o;if(e=$t,t=$t,(r=yr())!==l){for(i=[],o=hr();o!==l;)i.push(o),o=hr();t=r=[r,i]}else $t=t,t=l;return t!==l&&(qt=e,t=it(t)),e=t}function hr(){var e,t;return e=$t,(t=yr())!==l&&(qt=e,t=ot(t)),e=t}function yr(){var e,r;return e=$t,(r=Ar())===l&&(r=function(){var e,r,i,o,s,n,a,u;e=$t,r=$t,i=$t,t.substr($t,2)===M?(o=M,$t+=2):(o=l,0===Yt&&ir(Se));o!==l?(s=function(){var e,r,i,o,s,n;e=$t,r=$t,i=[],o=$t,s=$t,Yt++,t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(Se));Yt--,n===l?s=void 0:($t=s,s=l);s!==l&&(n=Rr())!==l?o=s=[s,n]:($t=o,o=l);for(;o!==l;)i.push(o),o=$t,s=$t,Yt++,t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(Se)),Yt--,n===l?s=void 0:($t=s,s=l),s!==l&&(n=Rr())!==l?o=s=[s,n]:($t=o,o=l);return r=t.substring(r,$t),qt=e,r=Ft(r),e=r,e}(),t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(Se)),n!==l?(a=function(){var e,r,i,o,s,n;e=$t,r=$t,i=[],o=$t,s=$t,Yt++,t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(Se));Yt--,n===l?s=void 0:($t=s,s=l);s!==l?(t.length>$t?(n=t.charAt($t),$t++):(n=l,0===Yt&&ir(re)),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l);for(;o!==l;)i.push(o),o=$t,s=$t,Yt++,t.substr($t,2)===M?(n=M,$t+=2):(n=l,0===Yt&&ir(Se)),Yt--,n===l?s=void 0:($t=s,s=l),s!==l?(t.length>$t?(n=t.charAt($t),$t++):(n=l,0===Yt&&ir(re)),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l);return r=t.substring(r,$t),qt=e,r=Gt(r),e=r,e}(),u=function(){var e,r,i;t.substr($t,2)===M?(e=M,$t+=2):(e=l,0===Yt&&ir(Se));if(e===l){for(e=$t,r=[],i=Ir();i!==l;)r.push(i),i=Ir();(i=Br())!==l?e=r=[r,i]:($t=e,e=l)}return e}(),u!==l?i=o=[o,s,n,a,u]:($t=i,i=l)):($t=i,i=l)):($t=i,i=l);r=i!==l?t.substring(r,$t):i;r!==l&&(qt=e,r=Lt(r));return e=r,e}(),r===l&&(r=function(){var e,r,i,o;e=$t,t.substr($t,4)===_?(r=_,$t+=4):(r=l,0===Yt&&ir(ue));r!==l&&(i=wr())!==l?(o=function(){var e;93===t.charCodeAt($t)?(e=h,$t++):(e=l,0===Yt&&ir(Z));return e}(),o!==l?(qt=e,e=At(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i,o;e=$t,t.substr($t,2)===R?(r=R,$t+=2):(r=l,0===Yt&&ir(ye));r!==l&&(i=Pr())!==l&&(o=wr())!==l&&Sr()!==l?(qt=e,e=xt(i,o)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i,o;e=$t,91===t.charCodeAt($t)?(r=P,$t++):(r=l,0===Yt&&ir(ce));if(r!==l){if(i=[],35===t.charCodeAt($t)?(o=S,$t++):(o=l,0===Yt&&ir(de)),o!==l)for(;o!==l;)i.push(o),35===t.charCodeAt($t)?(o=S,$t++):(o=l,0===Yt&&ir(de));else i=l;i!==l?(o=_r(),Sr()!==l?(qt=e,e=_t(i,o)):($t=e,e=l)):($t=e,e=l)}else $t=e,e=l;return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===x?(r=x,$t+=2):(r=l,0===Yt&&ir(pe));r!==l?(i=_r(),Sr()!==l?(qt=e,e=Pt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===w?(r=w,$t+=2):(r=l,0===Yt&&ir(he));r!==l?(i=_r(),Sr()!==l?(qt=e,e=St(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===O?(r=O,$t+=2):(r=l,0===Yt&&ir(me));r!==l?(i=_r(),Sr()!==l?(qt=e,e=wt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===k?(r=k,$t+=2):(r=l,0===Yt&&ir(ge));r!==l?(i=_r(),Sr()!==l?(qt=e,e=Rt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===C?(r=C,$t+=2):(r=l,0===Yt&&ir(fe));r!==l?(i=_r(),Sr()!==l?(qt=e,e=Ot(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===B?(r=B,$t+=2):(r=l,0===Yt&&ir(Ae));r!==l?(i=_r(),Sr()!==l?(qt=e,e=It(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===L?(r=L,$t+=2):(r=l,0===Yt&&ir(_e));r!==l?(i=_r(),Sr()!==l?(qt=e,e=jt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===j?(r=j,$t+=2):(r=l,0===Yt&&ir(Te));r!==l?(i=_r(),Sr()!==l?(qt=e,e=Et(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===E?(r=E,$t+=2):(r=l,0===Yt&&ir(be));r!==l?(i=_r(),Sr()!==l?(qt=e,e=kt(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i;e=$t,t.substr($t,2)===I?(r=I,$t+=2):(r=l,0===Yt&&ir(ve));r!==l?(i=_r(),Sr()!==l?(qt=e,e=Ct(i)):($t=e,e=l)):($t=e,e=l);return e}(),r===l&&(r=function(){var e,r,i,o;e=$t,t.substr($t,2)===N?(r=N,$t+=2):(r=l,0===Yt&&ir(Pe));r!==l&&(i=Pr())!==l&&(o=wr())!==l&&Sr()!==l?(qt=e,e=Bt(i,o)):($t=e,e=l);return e}()))))))))))))))),r!==l&&(qt=e,r=st(r)),e=r}function mr(){var e,r;return e=$t,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),r!==l&&(qt=e,r=nt(r)),e=r}function gr(){var e,r,i,o,s;if(e=$t,r=$t,i=function(){var e,r,i,o,s,n;e=$t,r=Cr(),r!==l?(i=$t,Yt++,o=$t,t.substr($t,4)===g?(s=g,$t+=4):(s=l,0===Yt&&ir(ie)),s!==l&&(n=Er())!==l?o=s=[s,n]:($t=o,o=l),Yt--,o!==l?($t=i,i=void 0):i=l,i!==l?(qt=e,e=lt()):($t=e,e=l)):($t=e,e=l);return e}(),i!==l){for(o=[],s=fr();s!==l;)o.push(s),s=fr();s=function(){var e,r,i,o,s;e=$t,r=$t,t.substr($t,4)===f?(i=f,$t+=4):(i=l,0===Yt&&ir(oe));i===l&&(i=null);o=$t,Yt++,s=jr(),Yt--,s!==l?($t=o,o=void 0):o=l;o!==l?r=i=[i,o]:($t=r,r=l);r!==l&&(qt=e,r=ut());return e=r,e}(),s!==l?r=i=[i,o,s]:($t=r,r=l)}else $t=r,r=l;return r!==l&&(qt=e,r=at(r)),e=r}function fr(){var e,r;return e=$t,r=function(){var e,r,i,o;e=$t,r=$t,t.substr($t,4)===g?(i=g,$t+=4):(i=l,0===Yt&&ir(ie));i!==l?((o=Er())===l&&(o=jr()),o!==l?r=i=[i,o]:($t=r,r=l)):($t=r,r=l);r===l&&(r=$t,t.substr($t,2)===b?(i=b,$t+=2):(i=l,0===Yt&&ir(se)),i!==l?((o=Er())===l&&(o=jr()),o!==l?r=i=[i,o]:($t=r,r=l)):($t=r,r=l),r===l&&(r=$t,t.substr($t,2)===v?(i=v,$t+=2):(i=l,0===Yt&&ir(ne)),i!==l?((o=Er())===l&&(o=jr()),o!==l?r=i=[i,o]:($t=r,r=l)):($t=r,r=l),r===l&&(r=function(){var e,r,i,o,s,n;e=$t,r=$t,Yt++,i=$t,t.substr($t,4)===f?(o=f,$t+=4):(o=l,0===Yt&&ir(oe));o!==l&&(s=jr())!==l?i=o=[o,s]:($t=i,i=l);Yt--,i===l?r=void 0:($t=r,r=l);if(r!==l){if(i=$t,o=$t,s=Or(),(n=Cr())!==l?o=s=[s,n]:($t=o,o=l),o===l){if(o=$t,s=[],(n=Rr())!==l)for(;n!==l;)s.push(n),n=Rr();else s=l;s!==l?(n=function(){var e,r;e=Cr(),e===l&&(e=$t,Yt++,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),Yt--,r===l?e=void 0:($t=e,e=l));return e}(),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l)}(i=o!==l?t.substring(i,$t):o)!==l?(qt=e,e=pt(i)):($t=e,e=l)}else $t=e,e=l;return e}())));r!==l&&(qt=e,r=dt(r));return e=r,e}(),r!==l&&(qt=e,r=ct(r)),e=r}function br(){var e,r,i,o,s;if(e=$t,r=$t,i=function(){var e,r,i,o,s,n;e=$t,r=Cr(),r!==l?(i=$t,Yt++,o=$t,t.substr($t,3)===T?(s=T,$t+=3):(s=l,0===Yt&&ir(ae)),s!==l&&(n=Er())!==l?o=s=[s,n]:($t=o,o=l),Yt--,o!==l?($t=i,i=void 0):i=l,i!==l?(qt=e,e=yt()):($t=e,e=l)):($t=e,e=l);return e}(),i!==l){for(o=[],s=vr();s!==l;)o.push(s),s=vr();s=function(){var e,r,i,o,s;e=$t,r=$t,t.substr($t,3)===T?(i=T,$t+=3):(i=l,0===Yt&&ir(ae));i!==l?(o=$t,Yt++,s=jr(),Yt--,s!==l?($t=o,o=void 0):o=l,o!==l?r=i=[i,o]:($t=r,r=l)):($t=r,r=l);r!==l&&(qt=e,r=mt());return e=r,e}(),s!==l?r=i=[i,o,s]:($t=r,r=l)}else $t=r,r=l;return r!==l&&(qt=e,r=ht(r)),e=r}function vr(){var e,r,i,o,s,n,a,u,c,d,p;if(e=$t,r=$t,Yt++,i=$t,t.substr($t,3)===T?(o=T,$t+=3):(o=l,0===Yt&&ir(ae)),o!==l){for(s=[],n=Ir();n!==l;)s.push(n),n=Ir();for(n=[],a=$t,u=$t,Yt++,c=$t,(d=Cr())!==l?(t.substr($t,3)===T?(p=T,$t+=3):(p=l,0===Yt&&ir(ae)),p!==l?c=d=[d,p]:($t=c,c=l)):($t=c,c=l),Yt--,c===l?u=void 0:($t=u,u=l),u!==l?(t.length>$t?(c=t.charAt($t),$t++):(c=l,0===Yt&&ir(re)),c!==l?a=u=[u,c]:($t=a,a=l)):($t=a,a=l);a!==l;)n.push(a),a=$t,u=$t,Yt++,c=$t,(d=Cr())!==l?(t.substr($t,3)===T?(p=T,$t+=3):(p=l,0===Yt&&ir(ae)),p!==l?c=d=[d,p]:($t=c,c=l)):($t=c,c=l),Yt--,c===l?u=void 0:($t=u,u=l),u!==l?(t.length>$t?(c=t.charAt($t),$t++):(c=l,0===Yt&&ir(re)),c!==l?a=u=[u,c]:($t=a,a=l)):($t=a,a=l);(a=Br())!==l?i=o=[o,s,n,a]:($t=i,i=l)}else $t=i,i=l;return Yt--,i===l?r=void 0:($t=r,r=l),r!==l?(i=function(){var e,r,i,o;e=$t,r=$t,t.substr($t,3)===T?(i=T,$t+=3):(i=l,0===Yt&&ir(ae));i!==l&&(o=Er())!==l?r=i=[i,o]:($t=r,r=l);r===l&&(r=$t,t.substr($t,2)===A?(i=A,$t+=2):(i=l,0===Yt&&ir(le)),i!==l&&(o=Er())!==l?r=i=[i,o]:($t=r,r=l),r===l&&(r=$t,t.substr($t,2)===b?(i=b,$t+=2):(i=l,0===Yt&&ir(se)),i!==l&&(o=Er())!==l?r=i=[i,o]:($t=r,r=l),r===l&&(r=function(){var e,r,i,o,s;e=$t,r=$t,i=$t,o=Or(),s=Cr(),s!==l?i=o=[o,s]:($t=i,i=l);r=i!==l?t.substring(r,$t):i;r!==l&&(qt=e,r=bt(r));return e=r,e}())));r!==l&&(qt=e,r=ft(r));return e=r,e}(),i!==l?(qt=e,e=gt(i)):($t=e,e=l)):($t=e,e=l),e}function Tr(){var e,r;return e=$t,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),r!==l&&(qt=e,r=Tt(r)),e=r}function Ar(){var e,r,i,o;return e=$t,t.substr($t,2)===U?(r=U,$t+=2):(r=l,0===Yt&&ir(xe)),r!==l?(i=function(){var e,r,i,o,s,n;e=$t,r=$t,i=[],o=$t,s=$t,Yt++,t.substr($t,2)===U?(n=U,$t+=2):(n=l,0===Yt&&ir(xe));Yt--,n===l?s=void 0:($t=s,s=l);s!==l?(t.length>$t?(n=t.charAt($t),$t++):(n=l,0===Yt&&ir(re)),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l);for(;o!==l;)i.push(o),o=$t,s=$t,Yt++,t.substr($t,2)===U?(n=U,$t+=2):(n=l,0===Yt&&ir(xe)),Yt--,n===l?s=void 0:($t=s,s=l),s!==l?(t.length>$t?(n=t.charAt($t),$t++):(n=l,0===Yt&&ir(re)),n!==l?o=s=[s,n]:($t=o,o=l)):($t=o,o=l);return r=t.substring(r,$t),qt=e,r=Ht(r),e=r,e}(),o=function(){var e,r,i;t.substr($t,2)===U?(e=U,$t+=2):(e=l,0===Yt&&ir(xe));if(e===l){for(e=$t,r=[],i=Ir();i!==l;)r.push(i),i=Ir();(i=Br())!==l?e=r=[r,i]:($t=e,e=l)}return e}(),o!==l?(qt=e,e=Nt(i)):($t=e,e=l)):($t=e,e=l),e}function _r(){var e,r,i,o;for(e=$t,r=$t,i=[],$.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Q));o!==l;)i.push(o),$.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Q));return r=t.substring(r,$t),qt=e,e=r=Mt(r)}function Pr(){var e,r,i,o,s;if(e=$t,r=$t,Yt++,t.substr($t,3)===D?(i=D,$t+=3):(i=l,0===Yt&&ir(we)),Yt--,i===l?r=void 0:($t=r,r=l),r!==l){for(i=$t,o=[],q.test(t.charAt($t))?(s=t.charAt($t),$t++):(s=l,0===Yt&&ir(Re));s!==l;)o.push(s),q.test(t.charAt($t))?(s=t.charAt($t),$t++):(s=l,0===Yt&&ir(Re));i=t.substring(i,$t),qt=e,e=Ut(i)}else $t=e,e=l;return e}function Sr(){var e,r,i;if(93===t.charCodeAt($t)?(e=h,$t++):(e=l,0===Yt&&ir(Z)),e===l){for(e=$t,r=[],i=Ir();i!==l;)r.push(i),i=Ir();(i=Br())!==l?e=r=[r,i]:($t=e,e=l)}return e}function xr(){var e,r,i,o;for(e=$t,r=$t,i=[],J.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Oe));o!==l;)i.push(o),J.test(t.charAt($t))?(o=t.charAt($t),$t++):(o=l,0===Yt&&ir(Oe));return r=t.substring(r,$t),qt=e,e=r=Dt(r)}function wr(){var e,r,i;return e=$t,58===t.charCodeAt($t)?(r=y,$t++):(r=l,0===Yt&&ir(ee)),r!==l?(i=_r(),qt=e,e=Vt(i)):($t=e,e=l),e===l&&(r="",qt=e=$t,e=r=Kt()),e}function Rr(){var e;return Yt++,W.test(t.charAt($t))?(e=t.charAt($t),$t++):(e=l,0===Yt&&ir(Ie)),Yt--,e===l&&(l,0===Yt&&ir(Ee)),e}function Or(){var e,t;for(Yt++,e=[],t=Rr();t!==l;)e.push(t),t=Rr();return Yt--,t=l,0===Yt&&ir(je),e}function kr(){var e,r,i;for(Yt++,e=$t,r=[],z.test(t.charAt($t))?(i=t.charAt($t),$t++):(i=l,0===Yt&&ir(ke));i!==l;)r.push(i),z.test(t.charAt($t))?(i=t.charAt($t),$t++):(i=l,0===Yt&&ir(ke));return(i=Cr())!==l?e=r=[r,i]:($t=e,e=l),Yt--,e===l&&(r=l,0===Yt&&ir(Be)),e}function Cr(){var e;return Yt++,10===t.charCodeAt($t)?(e=V,$t++):(e=l,0===Yt&&ir(Ne)),e===l&&(t.substr($t,2)===K?(e=K,$t+=2):(e=l,0===Yt&&ir(Me)),e===l&&(13===t.charCodeAt($t)?(e=F,$t++):(e=l,0===Yt&&ir(Ue)),e===l&&(8232===t.charCodeAt($t)?(e=G,$t++):(e=l,0===Yt&&ir(De)),e===l&&(8233===t.charCodeAt($t)?(e=H,$t++):(e=l,0===Yt&&ir(Ve)))))),Yt--,e===l&&(l,0===Yt&&ir(Le)),e}function Er(){var e,r,i;for(Yt++,e=$t,r=[],z.test(t.charAt($t))?(i=t.charAt($t),$t++):(i=l,0===Yt&&ir(ke));i!==l;)r.push(i),z.test(t.charAt($t))?(i=t.charAt($t),$t++):(i=l,0===Yt&&ir(ke));return(i=Cr())!==l?e=r=[r,i]:($t=e,e=l),Yt--,e===l&&(r=l,0===Yt&&ir(Ke)),e}function Ir(){var e;return Yt++,Y.test(t.charAt($t))?(e=t.charAt($t),$t++):(e=l,0===Yt&&ir(Ge)),Yt--,e===l&&(l,0===Yt&&ir(Fe)),e}function jr(){var e,r;return(e=Er())===l&&(e=$t,Yt++,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),Yt--,r===l?e=void 0:($t=e,e=l)),e}function Br(){var e,r;return e=$t,Yt++,t.length>$t?(r=t.charAt($t),$t++):(r=l,0===Yt&&ir(re)),Yt--,r===l?e=void 0:($t=e,e=l),e}const Lr=new o.BitmarkPegParserHelper({parse:e,parserText:Xt,parserLocation:Mr}),Nr=new s.BitmarkPegParserProcessor({parse:e,parserText:Xt,parserLocation:Mr});function Mr(){const e=rr(qt,$t);return e?(delete e.source,e):e}function rr(e,t,r){var i=tr(e),o=tr(t),s={source:u,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:o.line,column:o.column}};return u&&"function"==typeof u.offset&&(s.start=u.offset(s.start),s.end=u.offset(s.end)),s}if((a=d())!==l&&$t===t.length)return a;throw a!==l&&$t<t.length&&ir({type:"end"}),or(Wt,zt<t.length?t.charAt(zt):null,zt<t.length?rr(zt,zt+1):rr(zt,zt))}},4764:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=t.SyntaxError=void 0;const r=new RegExp(/=\^(\^*)(?==)|\*\^(\^*)(?=\*)|_\^(\^*)(?=_)|`\^(\^*)(?=`)|!\^(\^*)(?=!)|\[\^(\^*)|•\^(\^*)|#\^(\^*)|\|\^(\^*)|\|\^(\^*)/,"g");function i(e){let t=e||"";let i=r;return t=t.replace(i,(function(e,t,r,i,o){return e.replace("^","")})),t}function o(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkPlusString"}):l(e,{startRule:"bitmarkPlusString"})}function s(e){return"undefined"!=typeof parser?parser.parse(e,{startRule:"bitmarkMinusMinusString"}):l(e,{startRule:"bitmarkMinusMinusString"})}function n(e,t,r,i){var o=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(o,n.prototype),o.expected=t,o.found=r,o.location=i,o.name="SyntaxError",o}function a(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}function l(e,t){var r,a={},l=(t=void 0!==t?t:{}).grammarSource,u={bitmarkPlusPlus:Ni,bitmarkPlus:function(){var e,t;Oi++,e=Si,t=oo(),e,t=Yr(t),e=t,Oi--,t=a,0===Oi&&Bi(Ne);return e},bitmarkMinusMinus:function(){var e,t;Oi++,e=Si,t=ho(),e,t=mi(t),e=t,Oi--,t=a,0===Oi&&Bi(Ht);return e},bitmarkPlusString:function(){var e;Oi++,e=oo(),Oi--,a,0===Oi&&Bi(nt);return e},bitmarkMinusMinusString:ho},c=Ni,d="|",p=":",h="### ",y="## ",m="# ",g="code",f="bitmark++",b="bitmark--",v="JavaScript",T="• ",A="•1 ",_="•+ ",P="•- ",S="\t",x="image",w=" ",R="#",O="@",k="width",C="height",E="=",I="𝑓",j="link:",B="var:",L="code:",N="color:",M="bold",U="italic",D="light",V="highlight",K="strike",F="sub",G="super",H="ins",$="del",q="aqua",J="black",z="blue",W="pink",Y="fuchsia",X="lightgrey",Q="gray",Z="darkgray",ee="green",te="lime",re="magenta",ie="maroon",oe="navy",se="olive",ne="orange",ae="purple",le="red",ue="silver",ce="teal",de="violet",pe="white",he="yellow",ye="*",me="_",ge="`",fe="!",be="[!",ve="]",Te="\n",Ae="\r\n",_e="\r",Pe="\u2028",Se="\u2029",xe="http",we="s",Re="://",Oe="mailto:",ke="~",Ce="^",Ee="'",Ie=/^[ \t]/,je=/^[0-9]/,Be=/^[^\n\r\u2028\u2029]/,Le=/^[a-zA-Z0-9!*'()=+-\/._?#@[\]$&(),;%:{}]/,Ne=Ei("StyledText"),Me=ki("|",!1),Ue=ki(":",!1),De=ki("### ",!1),Ve=ki("## ",!1),Ke=ki("# ",!1),Fe=ki("code",!1),Ge=Ci([" ","\t"],!1,!1),He=ki("bitmark++",!1),$e=ki("bitmark--",!1),qe=ki("JavaScript",!1),Je=ki("• ",!1),ze=ki("•1 ",!1),We=ki("•+ ",!1),Ye=ki("•- ",!1),Xe={type:"any"},Qe=ki("\t",!1),Ze=ki("image",!1),et=ki(" ",!1),tt=ki("#",!1),rt=ki("@",!1),it=Ci([["0","9"]],!1,!1),ot=ki("width",!1),st=ki("height",!1),nt=Ei("StyledString"),at=ki("=",!1),lt=ki("𝑓",!1),ut=ki("link:",!1),ct=ki("var:",!1),dt=ki("code:",!1),pt=ki("color:",!1),ht=ki("bold",!1),yt=ki("italic",!1),mt=ki("light",!1),gt=ki("highlight",!1),ft=ki("strike",!1),bt=ki("sub",!1),vt=ki("super",!1),Tt=ki("ins",!1),At=ki("del",!1),_t=ki("aqua",!1),Pt=ki("black",!1),St=ki("blue",!1),xt=ki("pink",!1),wt=ki("fuchsia",!1),Rt=ki("lightgrey",!1),Ot=ki("gray",!1),kt=ki("darkgray",!1),Ct=ki("green",!1),Et=ki("lime",!1),It=ki("magenta",!1),jt=ki("maroon",!1),Bt=ki("navy",!1),Lt=ki("olive",!1),Nt=ki("orange",!1),Mt=ki("purple",!1),Ut=ki("red",!1),Dt=ki("silver",!1),Vt=ki("teal",!1),Kt=ki("violet",!1),Ft=ki("white",!1),Gt=ki("yellow",!1),Ht=Ei("MinimalStyledText"),$t=Ei("MinimalStyledString"),qt=ki("*",!1),Jt=ki("_",!1),zt=ki("`",!1),Wt=ki("!",!1),Yt=ki("[!",!1),Xt=ki("]",!1),Qt=Ei("Line Terminator"),Zt=ki("\n",!1),er=ki("\r\n",!1),tr=ki("\r",!1),rr=ki("\u2028",!1),ir=ki("\u2029",!1),or=(Ei("whitespace in line"),Ei("space"),Ei("language tag separator"),Ei("white space, separator"),Ci(["\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!1,!1),Ci(["\n","\r","\u2028","\u2029"],!1,!1),Ci(["\n","\r","\u2028","\u2029"],!0,!1)),sr=(Ci(["\n","\r","\u2028","\u2029","\t","\v","\f"," "," ","\ufeff"," "," "," ",[" "," "]," "," "," "],!0,!1),ki("http",!1)),nr=ki("s",!1),ar=ki("://",!1),lr=ki("mailto:",!1),ur=Ci([["a","z"],["A","Z"],["0","9"],"!","*","'","(",")","=",["+","/"],".","_","?","#","@","[","]","$","&","(",")",",",";","%",":","{","}"],!1,!1),cr=ki("~",!1),dr=ki("^",!1),pr=ki("'",!1),hr=function(e){return Object.assign({},e)},yr=function(e){return Object.assign({},e)},mr=function(e){return Object.assign({},e)},gr=function(e){return Object.assign({},e)},fr=function(e){return Object.assign({},e)},br=function(){return[]},vr=function(e,t){return{type:"heading",content:s(t),attrs:{level:e.length-1}}},Tr=function(e){return e},Ar=function(e,t){return Object.assign(Object.assign({},e),{content:t})},_r=function(){return{type:"codeBlock",language:""}},Pr=function(e){return{type:"codeBlock",attrs:{language:e.trim().toLowerCase()}}},Sr=function(e){return[{type:"text",text:i(e.trim())}]},xr=function(e){return e},wr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Rr=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},Or=function(e,t){return Object.assign(Object.assign({},e),{content:t,attrs:{}})},kr=function(){return{type:"bulletList"}},Cr=function(){return{type:"orderedList"}},Er=function(){return{type:"taskList"}},Ir=function(e,t,r,i){return i},jr=function(e,t,r,i){let s="bulletList";"•1 "==e&&(s="orderedList"),"•+ "!=e&&"•- "!=e||(s="taskList");let n=[{type:"paragraph",attrs:{},content:o((t+r.join("")).trim())}];if(i&&i[0]&&i[0].parent){let e={type:i[0].parent,attrs:{start:1},content:i,parent:""};"orderedList"==e.parent&&(e.attrs.start=1),n.push(e)}let a="listItem",l={};if("taskList"==s){a="taskItem";let t=!1;"•+ "==e&&(t=!0),l={checked:t}}return{type:a,content:n,parent:s,attrs:l}},Br=function(e){return e},Lr=function(e){return e.join("")===Io},Nr=function(e){return e.length>Io.length},Mr=function(e){Eo.push(Io),Io=e.join("")},Ur=function(){return Io=Eo.pop(),!0},Dr=function(e){return{type:"paragraph",content:o(e.trim()),attrs:{}}},Vr=function(e){return{type:"paragraph",content:o(e.trim()),attrs:{}}},Kr=function(e){return{type:"paragraph",content:o(e.trim()),attrs:{}}},Fr=function(e){return e},Gr=function(e,t,r){const i=Object.assign({},...r);let o=i.captionAlign||"left";delete i.captionAlign;let s=i.alt||null;delete i.alt;let n=i.caption||null;delete i.caption;let a=i.align||"center";return delete i.align,{type:e,attrs:Object.assign({textAlign:o,src:t,alt:s,title:n,class:a},i)}},Hr=function(e){return e},$r=function(e){return{comment:e}},qr=function(e,t){return{[e]:parseInt(t)}},Jr=function(e,t){return{type:"error",msg:e+" must be an positive integer.",found:t}},zr=function(e,t){return{[e]:t}},Wr=function(e){return{[e]:!0}},Yr=function(e){return[{type:"paragraph",content:e,attrs:{}}]},Xr=function(e,t){return e?[e,...t.flat()]:t.flat()},Qr=function(){return{type:"hardBreak"}},Zr=function(e){return{text:i(e),type:"text"}},ei=function(e){return{index:+e,type:"bit"}},ti=function(e,t){return t||(t=[]),{marks:t,text:i(e),type:"text"}},ri=function(e){return{marks:[{type:"bold"}],text:i(e),type:"text"}},ii=function(e){return{marks:[{type:"italic"}],text:i(e),type:"text"}},oi=function(e){return{marks:[{type:"light"}],text:i(e),type:"text"}},si=function(e){return{marks:[{type:"highlight"}],text:i(e),type:"text"}},ni=function(e){return{marks:[{type:"link",attrs:{href:(e.pr+e.t).trim(),target:"_blank"}}],text:e.t,type:"text"}},ai=function(e){return e},li=function(e){return{type:"link",attrs:{href:e.trim(),target:"_blank"}}},ui=function(e){return{type:"var",attrs:{name:e.trim()}}},ci=function(){return{type:"code",attrs:{language:"plain text"}}},di=function(e){return{type:"code",attrs:{language:e.trim().toLowerCase()}}},pi=function(e){return{type:"color",attrs:{color:e}}},hi=function(e){return{type:e}},yi=function(e){return{type:"comment",comment:e}},mi=function(e){return[{type:"paragraph",content:e,attrs:{}}]},gi=function(e,t){return e?[e,...t.flat()]:t.flat()},fi=function(e){return{text:i(e),type:"text"}},bi=function(e){return{index:+e,type:"bit"}},vi=function(e){return{marks:[{type:"bold"}],text:i(e),type:"text"}},Ti=function(e){return{marks:[{type:"italic"}],text:i(e),type:"text"}},Ai=function(e){return{marks:[{type:"light"}],text:i(e),type:"text"}},_i=function(e){return{marks:[{type:"highlight"}],text:i(e),type:"text"}},Pi=function(e,t){return{pr:e,t}},Si=0,xi=[{line:1,column:1}],wi=0,Ri=[],Oi=0;if("startRule"in t){if(!(t.startRule in u))throw new Error("Can't start parsing from rule \""+t.startRule+'".');c=u[t.startRule]}function ki(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ci(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Ei(e){return{type:"other",description:e}}function Ii(t){var r,i=xi[t];if(i)return i;for(r=t-1;!xi[r];)r--;for(i={line:(i=xi[r]).line,column:i.column};r<t;)10===e.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return xi[t]=i,i}function ji(e,t,r){var i=Ii(e),o=Ii(t),s={source:l,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:o.line,column:o.column}};return r&&l&&"function"==typeof l.offset&&(s.start=l.offset(s.start),s.end=l.offset(s.end)),s}function Bi(e){Si<wi||(Si>wi&&(wi=Si,Ri=[]),Ri.push(e))}function Li(e,t,r){return new n(n.buildMessage(e,t),e,t,r)}function Ni(){var e,t;if(Oi++,e=[],(t=Mi())!==a)for(;t!==a;)e.push(t),t=Mi();else e=a;return e===a&&(e=function(){var e,t;return e=Si,t="",e,t=br(),e=t,e}()),Oi--,e===a&&(t=a,0===Oi&&Bi(Ne)),e}function Mi(){var t,r;return t=Si,r=function(){var t,r,i,o,s;if(t=Si,r=Vi(),r!==a){for(i=Si,o=[],s=Oo();s!==a;)o.push(s),s=Oo();i=e.substring(i,Si),(o=ko())!==a?((s=Ro())===a&&(s=null),t,t=vr(r,i)):(Si=t,t=a)}else Si=t,t=a;return t}(),r!==a&&(t,r=hr(r)),(t=r)===a&&(t=Si,r=function(){var e,t,r,i;if(e=Si,t=function(){var e,t,r;e=Si,t=Si,Oi++,r=Hi(),Oi--,r!==a?(Si=t,t=void 0):t=a;t!==a&&(e,t=kr());return e=t,e}(),t!==a){if(r=[],(i=zi())!==a)for(;i!==a;)r.push(i),i=zi();else r=a;r!==a?((i=Ro())===a&&(i=null),e,e=wr(t,r)):(Si=e,e=a)}else Si=e,e=a;if(e===a){if(e=Si,t=function(){var e,t,r;e=Si,t=Si,Oi++,r=$i(),Oi--,r!==a?(Si=t,t=void 0):t=a;t!==a&&(e,t=Cr());return e=t,e}(),t!==a){if(r=[],(i=zi())!==a)for(;i!==a;)r.push(i),i=zi();else r=a;r!==a?((i=Ro())===a&&(i=null),e,e=Rr(t,r)):(Si=e,e=a)}else Si=e,e=a;if(e===a)if(e=Si,t=function(){var e,t,r;e=Si,t=Si,Oi++,r=qi(),Oi--,r!==a?(Si=t,t=void 0):t=a;t!==a&&(e,t=Er());return e=t,e}(),t!==a){if(r=[],(i=zi())!==a)for(;i!==a;)r.push(i),i=zi();else r=a;r!==a?((i=Ro())===a&&(i=null),e,e=Or(t,r)):(Si=e,e=a)}else Si=e,e=a}return e}(),r!==a&&(t,r=yr(r)),(t=r)===a&&(t=Si,(r=to())!==a&&(t,r=mr(r)),(t=r)===a&&(t=Si,r=function(){var t,r,i;t=Si,r=Fi(),r!==a?(i=function(){var t,r,i,o;t=Si,r=Si,i=[],o=Gi();for(;o!==a;)i.push(o),o=Gi();return r=e.substring(r,Si),t,r=Sr(r),t=r,t}(),t,t=Ar(r,i)):(Si=t,t=a);return t}(),r!==a&&(t,r=gr(r)),(t=r)===a&&(t=Si,r=function(){var e,t,r;e=Si,t=Si,Oi++,r=Ui(),Oi--,r===a?t=void 0:(Si=t,t=a);t!==a&&(r=Xi())!==a?(e,e=Dr(r)):(Si=e,e=a);e===a&&(e=Si,(t=Zi())!==a&&(r=Xi())!==a?(e,e=Vr(r)):(Si=e,e=a),e===a&&(e=Si,(t=Zi())!==a?(e,e=Kr(r="")):(Si=e,e=a)));return e}(),r!==a&&(t,r=fr(r)),t=r)))),t}function Ui(){var e;return(e=Vi())===a&&(e=Ji())===a&&(e=to())===a&&(e=Fi())===a&&(e=Zi()),e}function Di(){var t;return 124===e.charCodeAt(Si)?(t=d,Si++):(t=a,0===Oi&&Bi(Me)),t}function Vi(){var t;return e.substr(Si,4)===h?(t=h,Si+=4):(t=a,0===Oi&&Bi(De)),t===a&&(e.substr(Si,3)===y?(t=y,Si+=3):(t=a,0===Oi&&Bi(Ve)),t===a&&(e.substr(Si,2)===m?(t=m,Si+=2):(t=a,0===Oi&&Bi(Ke)))),t}function Ki(){var t,r;return t=Si,Di()!==a?(r=function(){var t;return e.substr(Si,4)===g?(t=g,Si+=4):(t=a,0===Oi&&Bi(Fe)),t}(),r!==a?(t,t=Tr(r)):(Si=t,t=a)):(Si=t,t=a),t}function Fi(){var t,r,i,o,s,n,l;if(t=Si,Ki()!==a){for(r=Si,i=Si,o=[],Ie.test(e.charAt(Si))?(s=e.charAt(Si),Si++):(s=a,0===Oi&&Bi(Ge));s!==a;)o.push(s),Ie.test(e.charAt(Si))?(s=e.charAt(Si),Si++):(s=a,0===Oi&&Bi(Ge));(s=ko())!==a?i=o=[o,s]:(Si=i,i=a),(r=i!==a?e.substring(r,Si):i)!==a?(t,t=_r()):(Si=t,t=a)}else Si=t,t=a;if(t===a)if(t=Si,Ki()!==a)if(58===e.charCodeAt(Si)?(r=p,Si++):(r=a,0===Oi&&Bi(Ue)),r!==a)if(i=function(){var t,r,i;e.substr(Si,9)===f?(t=f,Si+=9):(t=a,0===Oi&&Bi(He));if(t===a&&(e.substr(Si,9)===b?(t=b,Si+=9):(t=a,0===Oi&&Bi($e)),t===a&&(e.substr(Si,10)===v?(t=v,Si+=10):(t=a,0===Oi&&Bi(qe)),t===a))){if(t=Si,r=[],(i=Oo())!==a)for(;i!==a;)r.push(i),i=Oo();else r=a;(t=r!==a?e.substring(t,Si):r)===a&&(t="")}return t}(),i!==a){for(o=Si,s=Si,n=[],Ie.test(e.charAt(Si))?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Ge));l!==a;)n.push(l),Ie.test(e.charAt(Si))?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Ge));(l=ko())!==a?s=n=[n,l]:(Si=s,s=a),(o=s!==a?e.substring(o,Si):s)!==a?(t,t=Pr(i)):(Si=t,t=a)}else Si=t,t=a;else Si=t,t=a;else Si=t,t=a;return t}function Gi(){var t,r,i,o,s,n;if(t=Si,r=Si,Oi++,i=Ui(),Oi--,i===a?r=void 0:(Si=r,r=a),r!==a){if(i=Si,o=Si,s=[],(n=Oo())!==a)for(;n!==a;)s.push(n),n=Oo();else s=a;s!==a&&(n=ko())!==a?o=s=[s,n]:(Si=o,o=a),(i=o!==a?e.substring(i,Si):o)!==a?(t,t=xr(i)):(Si=t,t=a)}else Si=t,t=a;return t===a&&(t=Ro()),t}function Hi(){var t;return e.substr(Si,2)===T?(t=T,Si+=2):(t=a,0===Oi&&Bi(Je)),t}function $i(){var t;return e.substr(Si,3)===A?(t=A,Si+=3):(t=a,0===Oi&&Bi(ze)),t}function qi(){var t;return e.substr(Si,3)===_?(t=_,Si+=3):(t=a,0===Oi&&Bi(We)),t===a&&(e.substr(Si,3)===P?(t=P,Si+=3):(t=a,0===Oi&&Bi(Ye))),t}function Ji(){var e;return(e=Hi())===a&&(e=$i())===a&&(e=qi()),e}function zi(){var t,r,i,o,s,n,l,u;if(t=Si,Yi()!==a)if((r=Ji())!==a){for(i=Si,o=Si,s=[],n=Si,l=Si,Oi++,u=Ro(),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);n!==a;)s.push(n),n=Si,l=Si,Oi++,u=Ro(),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);for((n=Ro())===a&&(n=null),o=s=[s,n],i=e.substring(i,Si),o=[],s=Wi();s!==a;)o.push(s),s=Wi();if(s=Si,n=function(){var t,r,i,o;t=Si,Oi++,r=Si,i=[],9===e.charCodeAt(Si)?(o=S,Si++):(o=a,0===Oi&&Bi(Qe));if(o!==a)for(;o!==a;)i.push(o),9===e.charCodeAt(Si)?(o=S,Si++):(o=a,0===Oi&&Bi(Qe));else i=a;i!==a?(Si,(o=(o=Nr(i))?void 0:a)!==a?(r,r=Mr(i)):(Si=r,r=a)):(Si=r,r=a);Oi--,r!==a?(Si=t,t=void 0):t=a;return t}(),n!==a){for(l=[],u=zi();u!==a;)l.push(u),u=zi();u=function(){var e;Si,e=Ur(),e=e?void 0:a;return e}(),u!==a?(s,s=Ir(r,i,o,l)):(Si=s,s=a)}else Si=s,s=a;s===a&&(s=null),t,t=jr(r,i,o,s)}else Si=t,t=a;else Si=t,t=a;return t}function Wi(){var t,r,i,o,s,n,l,u,c,d;if(t=Si,r=Si,Oi++,i=function(){var t,r,i;t=Si,r=[],Ie.test(e.charAt(Si))?(i=e.charAt(Si),Si++):(i=a,0===Oi&&Bi(Ge));for(;i!==a;)r.push(i),Ie.test(e.charAt(Si))?(i=e.charAt(Si),Si++):(i=a,0===Oi&&Bi(Ge));i=Ro(),i!==a?t=r=[r,i]:(Si=t,t=a);return t}(),Oi--,i===a?r=void 0:(Si=r,r=a),r!==a)if((i=Yi())!==a)if(o=Si,Oi++,s=Ji(),Oi--,s===a?o=void 0:(Si=o,o=a),o!==a){if(s=Si,n=Si,l=[],u=Si,c=Si,Oi++,d=Ro(),Oi--,d===a?c=void 0:(Si=c,c=a),c!==a?(e.length>Si?(d=e.charAt(Si),Si++):(d=a,0===Oi&&Bi(Xe)),d!==a?u=c=[c,d]:(Si=u,u=a)):(Si=u,u=a),u!==a)for(;u!==a;)l.push(u),u=Si,c=Si,Oi++,d=Ro(),Oi--,d===a?c=void 0:(Si=c,c=a),c!==a?(e.length>Si?(d=e.charAt(Si),Si++):(d=a,0===Oi&&Bi(Xe)),d!==a?u=c=[c,d]:(Si=u,u=a)):(Si=u,u=a);else l=a;l!==a&&(u=ko())!==a?n=l=[l,u]:(Si=n,n=a),(s=n!==a?e.substring(s,Si):n)!==a?(t,t=Br(s)):(Si=t,t=a)}else Si=t,t=a;else Si=t,t=a;else Si=t,t=a;return t}function Yi(){var t,r,i;for(t=Si,r=[],9===e.charCodeAt(Si)?(i=S,Si++):(i=a,0===Oi&&Bi(Qe));i!==a;)r.push(i),9===e.charCodeAt(Si)?(i=S,Si++):(i=a,0===Oi&&Bi(Qe));return Si,(i=(i=Lr(r))?void 0:a)!==a?t=r=[r,i]:(Si=t,t=a),t}function Xi(){var t,r,i;if(t=Si,r=[],(i=Qi())!==a)for(;i!==a;)r.push(i),i=Qi();else r=a;return t=r!==a?e.substring(t,Si):r}function Qi(){var t,r,i,o,s,n;if(t=Si,r=Si,Oi++,i=Ui(),Oi--,i===a?r=void 0:(Si=r,r=a),r!==a){if(i=Si,o=Si,s=[],(n=Oo())!==a)for(;n!==a;)s.push(n),n=Oo();else s=a;s!==a&&(n=ko())!==a?o=s=[s,n]:(Si=o,o=a),(i=o!==a?e.substring(i,Si):o)!==a?t=r=[r,i]:(Si=t,t=a)}else Si=t,t=a;return t===a&&(t=Ro()),t}function Zi(){var t,r,i,o,s,n;if(t=Si,(r=Di())!==a){for(i=Si,o=Si,s=[],Ie.test(e.charAt(Si))?(n=e.charAt(Si),Si++):(n=a,0===Oi&&Bi(Ge));n!==a;)s.push(n),Ie.test(e.charAt(Si))?(n=e.charAt(Si),Si++):(n=a,0===Oi&&Bi(Ge));(n=ko())!==a?o=s=[s,n]:(Si=o,o=a),(i=o!==a?e.substring(i,Si):o)!==a?((o=Ro())===a&&(o=null),t=r=[r,i,o]):(Si=t,t=a)}else Si=t,t=a;return t}function eo(){var t,r;return t=Si,Di()!==a?(r=function(){var t;return e.substr(Si,5)===x?(t=x,Si+=5):(t=a,0===Oi&&Bi(Ze)),t}(),r!==a?(t,t=Fr(r)):(Si=t,t=a)):(Si=t,t=a),t}function to(){var t,r,i,o,s,n,l,u,c,d;if(t=Si,(r=eo())!==a)if(58===e.charCodeAt(Si)?(i=p,Si++):(i=a,0===Oi&&Bi(Ue)),i!==a)if(32===e.charCodeAt(Si)?(o=w,Si++):(o=a,0===Oi&&Bi(et)),o===a&&(o=null),s=function(){var t,r,i,o,s,n,l,u,c;t=Si,r=Si,e.substr(Si,4)===xe?(i=xe,Si+=4):(i=a,0===Oi&&Bi(sr));if(i!==a)if(115===e.charCodeAt(Si)?(o=we,Si++):(o=a,0===Oi&&Bi(nr)),o===a&&(o=null),e.substr(Si,3)===Re?(s=Re,Si+=3):(s=a,0===Oi&&Bi(ar)),s!==a){for(n=[],l=Si,u=Si,Oi++,c=Di(),Oi--,c===a?u=void 0:(Si=u,u=a),u!==a&&(c=Co())!==a?l=u=[u,c]:(Si=l,l=a);l!==a;)n.push(l),l=Si,u=Si,Oi++,c=Di(),Oi--,c===a?u=void 0:(Si=u,u=a),u!==a&&(c=Co())!==a?l=u=[u,c]:(Si=l,l=a);r=i=[i,o,s,n]}else Si=r,r=a;else Si=r,r=a;t=r!==a?e.substring(t,Si):r;return t}(),s!==a)if(Di()!==a){for(n=function(){var e,t,r;e=Si,t=[],r=ro();for(;r!==a;)t.push(r),r=ro();return e,t=Hr(t),e=t,e}(),l=Si,u=Si,c=[],Ie.test(e.charAt(Si))?(d=e.charAt(Si),Si++):(d=a,0===Oi&&Bi(Ge));d!==a;)c.push(d),Ie.test(e.charAt(Si))?(d=e.charAt(Si),Si++):(d=a,0===Oi&&Bi(Ge));(d=ko())!==a?u=c=[c,d]:(Si=u,u=a),(l=u!==a?e.substring(l,Si):u)!==a?((u=Ro())===a&&(u=null),t,t=Gr(r,s,n)):(Si=t,t=a)}else Si=t,t=a;else Si=t,t=a;else Si=t,t=a;else Si=t,t=a;return t}function ro(){var t,r,i,o,s,n,l,u,c,d;if(t=Si,35===e.charCodeAt(Si)?(r=R,Si++):(r=a,0===Oi&&Bi(tt)),r!==a){for(i=Si,o=[],s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);i=e.substring(i,Si),(o=Di())!==a?(t,t=$r(i)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,64===e.charCodeAt(Si)?(r=O,Si++):(r=a,0===Oi&&Bi(rt)),r===a&&(r=null),(i=io())!==a)if(58===e.charCodeAt(Si)?(o=p,Si++):(o=a,0===Oi&&Bi(Ue)),o!==a){for(s=[],32===e.charCodeAt(Si)?(n=w,Si++):(n=a,0===Oi&&Bi(et));n!==a;)s.push(n),32===e.charCodeAt(Si)?(n=w,Si++):(n=a,0===Oi&&Bi(et));if(n=Si,l=[],u=Si,c=Si,Oi++,d=Di(),Oi--,d===a?c=void 0:(Si=c,c=a),c!==a?(je.test(e.charAt(Si))?(d=e.charAt(Si),Si++):(d=a,0===Oi&&Bi(it)),d!==a?u=c=[c,d]:(Si=u,u=a)):(Si=u,u=a),u!==a)for(;u!==a;)l.push(u),u=Si,c=Si,Oi++,d=Di(),Oi--,d===a?c=void 0:(Si=c,c=a),c!==a?(je.test(e.charAt(Si))?(d=e.charAt(Si),Si++):(d=a,0===Oi&&Bi(it)),d!==a?u=c=[c,d]:(Si=u,u=a)):(Si=u,u=a);else l=a;(n=l!==a?e.substring(n,Si):l)!==a&&(l=Di())!==a?(t,t=qr(i,n)):(Si=t,t=a)}else Si=t,t=a;else Si=t,t=a;if(t===a){if(t=Si,64===e.charCodeAt(Si)?(r=O,Si++):(r=a,0===Oi&&Bi(rt)),r===a&&(r=null),(i=io())!==a)if(58===e.charCodeAt(Si)?(o=p,Si++):(o=a,0===Oi&&Bi(Ue)),o!==a){for(s=[],32===e.charCodeAt(Si)?(n=w,Si++):(n=a,0===Oi&&Bi(et));n!==a;)s.push(n),32===e.charCodeAt(Si)?(n=w,Si++):(n=a,0===Oi&&Bi(et));for(n=Si,l=[],u=Si,c=Si,Oi++,d=Di(),Oi--,d===a?c=void 0:(Si=c,c=a),c!==a&&(d=Oo())!==a?u=c=[c,d]:(Si=u,u=a);u!==a;)l.push(u),u=Si,c=Si,Oi++,d=Di(),Oi--,d===a?c=void 0:(Si=c,c=a),c!==a&&(d=Oo())!==a?u=c=[c,d]:(Si=u,u=a);n=e.substring(n,Si),(l=Di())!==a?(t,t=Jr(i,n)):(Si=t,t=a)}else Si=t,t=a;else Si=t,t=a;if(t===a){for(t=Si,64===e.charCodeAt(Si)?(r=O,Si++):(r=a,0===Oi&&Bi(rt)),r===a&&(r=null),i=Si,o=[],s=Si,n=Si,Oi++,(l=Di())===a&&(58===e.charCodeAt(Si)?(l=p,Si++):(l=a,0===Oi&&Bi(Ue))),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,(l=Di())===a&&(58===e.charCodeAt(Si)?(l=p,Si++):(l=a,0===Oi&&Bi(Ue))),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);if(i=e.substring(i,Si),58===e.charCodeAt(Si)?(o=p,Si++):(o=a,0===Oi&&Bi(Ue)),o!==a){for(32===e.charCodeAt(Si)?(s=w,Si++):(s=a,0===Oi&&Bi(et)),s===a&&(s=null),n=Si,l=[],u=Si,c=Si,Oi++,d=Di(),Oi--,d===a?c=void 0:(Si=c,c=a),c!==a&&(d=Oo())!==a?u=c=[c,d]:(Si=u,u=a);u!==a;)l.push(u),u=Si,c=Si,Oi++,d=Di(),Oi--,d===a?c=void 0:(Si=c,c=a),c!==a&&(d=Oo())!==a?u=c=[c,d]:(Si=u,u=a);n=e.substring(n,Si),(l=Di())!==a?(t,t=zr(i,n)):(Si=t,t=a)}else Si=t,t=a;if(t===a){for(t=Si,64===e.charCodeAt(Si)?(r=O,Si++):(r=a,0===Oi&&Bi(rt)),r===a&&(r=null),i=Si,o=[],s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);i=e.substring(i,Si),(o=Di())!==a?(t,t=Wr(i)):(Si=t,t=a)}}}}return t}function io(){var t;return e.substr(Si,5)===k?(t=k,Si+=5):(t=a,0===Oi&&Bi(ot)),t===a&&(e.substr(Si,6)===C?(t=C,Si+=6):(t=a,0===Oi&&Bi(st))),t}function oo(){var e,t,r,i;for(e=Si,(t=so())===a&&(t=null),r=[],(i=uo())===a&&(i=so());i!==a;)r.push(i),(i=uo())===a&&(i=so());return e,e=Xr(t,r)}function so(){var t,r,i,o,s,n,l;if(t=Si,(r=Ro())!==a&&(t,r=Qr()),(t=r)===a){if(t=Si,r=Si,i=[],o=Si,(s=co())===a&&(s=null),n=Si,Oi++,l=uo(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?o=s=[s,n,l]:(Si=o,o=a),o===a&&(o=Si,(s=co())!==a?(n=Si,Oi++,l=uo(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?o=s=[s,n]:(Si=o,o=a)):(Si=o,o=a)),o!==a)for(;o!==a;)i.push(o),o=Si,(s=co())===a&&(s=null),n=Si,Oi++,l=uo(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?o=s=[s,n,l]:(Si=o,o=a),o===a&&(o=Si,(s=co())!==a?(n=Si,Oi++,l=uo(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?o=s=[s,n]:(Si=o,o=a)):(Si=o,o=a));else i=a;(r=i!==a?e.substring(r,Si):i)!==a&&(t,r=Zr(r)),t=r}return t}function no(){var t;return 61===e.charCodeAt(Si)?(t=E,Si++):(t=a,0===Oi&&Bi(at)),t}function ao(){var t;return e.substr(Si,2)===I?(t=I,Si+=2):(t=a,0===Oi&&Bi(lt)),t}function lo(){var e,t,r;return e=Si,(t=no())!==a&&(r=no())!==a?e=t=[t,r]:(Si=e,e=a),e}function uo(){var t,r,i,o,s,n,l,u,c,p;if(t=Si,(r=Po())!==a){if(i=Si,o=[],je.test(e.charAt(Si))?(s=e.charAt(Si),Si++):(s=a,0===Oi&&Bi(it)),s!==a)for(;s!==a;)o.push(s),je.test(e.charAt(Si))?(s=e.charAt(Si),Si++):(s=a,0===Oi&&Bi(it));else o=a;(i=o!==a?e.substring(i,Si):o)!==a&&(o=So())!==a?(t,t=ei(i)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,(r=lo())!==a){for(32===e.charCodeAt(Si)?(i=w,Si++):(i=a,0===Oi&&Bi(et)),i===a&&(i=null),o=Si,s=[],n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=lo())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);n!==a;)s.push(n),n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=lo())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);o=e.substring(o,Si),32===e.charCodeAt(Si)?(s=w,Si++):(s=a,0===Oi&&Bi(et)),s===a&&(s=null),(n=lo())!==a?(l=function(){var t,r,i,o;t=Si,124===e.charCodeAt(Si)?(r=d,Si++):(r=a,0===Oi&&Bi(Me));if(r!==a){for(i=[],o=po();o!==a;)i.push(o),o=po();t,t=ai(i)}else Si=t,t=a;return t}(),l===a&&(l=null),t,t=ti(o,l)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,(r=vo())!==a){for(32===e.charCodeAt(Si)?(i=w,Si++):(i=a,0===Oi&&Bi(et)),i===a&&(i=null),o=Si,s=[],n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=vo())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);n!==a;)s.push(n),n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=vo())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);o=e.substring(o,Si),32===e.charCodeAt(Si)?(s=w,Si++):(s=a,0===Oi&&Bi(et)),s===a&&(s=null),(n=vo())!==a?(t,t=ri(o)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,(r=To())!==a){for(32===e.charCodeAt(Si)?(i=w,Si++):(i=a,0===Oi&&Bi(et)),i===a&&(i=null),o=Si,s=[],n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=To())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);n!==a;)s.push(n),n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=To())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);o=e.substring(o,Si),32===e.charCodeAt(Si)?(s=w,Si++):(s=a,0===Oi&&Bi(et)),s===a&&(s=null),(n=To())!==a?(t,t=ii(o)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,(r=Ao())!==a){for(32===e.charCodeAt(Si)?(i=w,Si++):(i=a,0===Oi&&Bi(et)),i===a&&(i=null),o=Si,s=[],n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=Ao())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);n!==a;)s.push(n),n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=Ao())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);o=e.substring(o,Si),32===e.charCodeAt(Si)?(s=w,Si++):(s=a,0===Oi&&Bi(et)),s===a&&(s=null),(n=Ao())!==a?(t,t=oi(o)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,(r=_o())!==a){for(32===e.charCodeAt(Si)?(i=w,Si++):(i=a,0===Oi&&Bi(et)),i===a&&(i=null),o=Si,s=[],n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=_o())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);n!==a;)s.push(n),n=Si,l=Si,Oi++,u=Si,32===e.charCodeAt(Si)?(c=w,Si++):(c=a,0===Oi&&Bi(et)),c===a&&(c=null),(p=_o())!==a?u=c=[c,p]:(Si=u,u=a),Oi--,u===a?l=void 0:(Si=l,l=a),l!==a?(e.length>Si?(u=e.charAt(Si),Si++):(u=a,0===Oi&&Bi(Xe)),u!==a?n=l=[l,u]:(Si=n,n=a)):(Si=n,n=a);o=e.substring(o,Si),32===e.charCodeAt(Si)?(s=w,Si++):(s=a,0===Oi&&Bi(et)),s===a&&(s=null),(n=_o())!==a?(t,t=si(o)):(Si=t,t=a)}else Si=t,t=a;t===a&&(t=Si,r=function(){var t,r,i,o,s,n,l;t=Si,r=Si,i=Si,e.substr(Si,4)===xe?(o=xe,Si+=4):(o=a,0===Oi&&Bi(sr));o!==a?(115===e.charCodeAt(Si)?(s=we,Si++):(s=a,0===Oi&&Bi(nr)),s===a&&(s=null),e.substr(Si,3)===Re?(n=Re,Si+=3):(n=a,0===Oi&&Bi(ar)),n!==a?i=o=[o,s,n]:(Si=i,i=a)):(Si=i,i=a);i===a&&(e.substr(Si,7)===Oe?(i=Oe,Si+=7):(i=a,0===Oi&&Bi(lr)));r=i!==a?e.substring(r,Si):i;if(r!==a){for(i=Si,o=[],s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Co())!==a?s=n=[n,l]:(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Co())!==a?s=n=[n,l]:(Si=s,s=a);i=e.substring(i,Si),t,t=Pi(r,i)}else Si=t,t=a;return t}(),r!==a&&(t,r=ni(r)),t=r)}}}}}return t}function co(){var t,r,i,o,s;if(t=Si,r=Si,(i=lo())!==a){if(o=[],(s=no())!==a)for(;s!==a;)o.push(s),s=no();else o=a;o!==a?r=i=[i,o]:(Si=r,r=a)}else Si=r,r=a;if((t=r!==a?e.substring(t,Si):r)===a){if(t=Si,r=Si,i=function(){var e,t,r;return e=Si,(t=ao())!==a&&(r=ao())!==a?e=t=[t,r]:(Si=e,e=a),e}(),i!==a){if(o=[],(s=ao())!==a)for(;s!==a;)o.push(s),s=ao();else o=a;o!==a?r=i=[i,o]:(Si=r,r=a)}else Si=r,r=a;if((t=r!==a?e.substring(t,Si):r)===a){if(t=Si,r=Si,(i=Ao())!==a){if(o=[],(s=fo())!==a)for(;s!==a;)o.push(s),s=fo();else o=a;o!==a?r=i=[i,o]:(Si=r,r=a)}else Si=r,r=a;if((t=r!==a?e.substring(t,Si):r)===a){if(t=Si,r=Si,(i=_o())!==a){if(o=[],(s=bo())!==a)for(;s!==a;)o.push(s),s=bo();else o=a;o!==a?r=i=[i,o]:(Si=r,r=a)}else Si=r,r=a;t=r!==a?e.substring(t,Si):r}}}return t}function po(){var t,r,i,o,s,n,l;if(t=Si,e.substr(Si,5)===j?(r=j,Si+=5):(r=a,0===Oi&&Bi(ut)),r!==a){for(i=Si,o=[],s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);i=e.substring(i,Si),(o=Di())!==a?(t,t=li(i)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,e.substr(Si,4)===B?(r=B,Si+=4):(r=a,0===Oi&&Bi(ct)),r!==a){for(i=Si,o=[],s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);i=e.substring(i,Si),(o=Di())!==a?(t,t=ui(i)):(Si=t,t=a)}else Si=t,t=a;if(t===a&&(t=Si,e.substr(Si,4)===g?(r=g,Si+=4):(r=a,0===Oi&&Bi(Fe)),r!==a&&(i=Di())!==a?(t,t=ci()):(Si=t,t=a),t===a)){if(t=Si,e.substr(Si,5)===L?(r=L,Si+=5):(r=a,0===Oi&&Bi(dt)),r!==a){for(i=Si,o=[],s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);i=e.substring(i,Si),(o=Di())!==a?(t,t=di(i)):(Si=t,t=a)}else Si=t,t=a;if(t===a&&(t=Si,e.substr(Si,6)===N?(r=N,Si+=6):(r=a,0===Oi&&Bi(pt)),r!==a?(i=function(){var t;e.substr(Si,4)===q?(t=q,Si+=4):(t=a,0===Oi&&Bi(_t));t===a&&(e.substr(Si,5)===J?(t=J,Si+=5):(t=a,0===Oi&&Bi(Pt)),t===a&&(e.substr(Si,4)===z?(t=z,Si+=4):(t=a,0===Oi&&Bi(St)),t===a&&(e.substr(Si,4)===W?(t=W,Si+=4):(t=a,0===Oi&&Bi(xt)),t===a&&(e.substr(Si,7)===Y?(t=Y,Si+=7):(t=a,0===Oi&&Bi(wt)),t===a&&(e.substr(Si,9)===X?(t=X,Si+=9):(t=a,0===Oi&&Bi(Rt)),t===a&&(e.substr(Si,4)===Q?(t=Q,Si+=4):(t=a,0===Oi&&Bi(Ot)),t===a&&(e.substr(Si,8)===Z?(t=Z,Si+=8):(t=a,0===Oi&&Bi(kt)),t===a&&(e.substr(Si,5)===ee?(t=ee,Si+=5):(t=a,0===Oi&&Bi(Ct)),t===a&&(e.substr(Si,4)===te?(t=te,Si+=4):(t=a,0===Oi&&Bi(Et)),t===a&&(e.substr(Si,7)===re?(t=re,Si+=7):(t=a,0===Oi&&Bi(It)),t===a&&(e.substr(Si,6)===ie?(t=ie,Si+=6):(t=a,0===Oi&&Bi(jt)),t===a&&(e.substr(Si,4)===oe?(t=oe,Si+=4):(t=a,0===Oi&&Bi(Bt)),t===a&&(e.substr(Si,5)===se?(t=se,Si+=5):(t=a,0===Oi&&Bi(Lt)),t===a&&(e.substr(Si,6)===ne?(t=ne,Si+=6):(t=a,0===Oi&&Bi(Nt)),t===a&&(e.substr(Si,6)===ae?(t=ae,Si+=6):(t=a,0===Oi&&Bi(Mt)),t===a&&(e.substr(Si,3)===le?(t=le,Si+=3):(t=a,0===Oi&&Bi(Ut)),t===a&&(e.substr(Si,6)===ue?(t=ue,Si+=6):(t=a,0===Oi&&Bi(Dt)),t===a&&(e.substr(Si,4)===ce?(t=ce,Si+=4):(t=a,0===Oi&&Bi(Vt)),t===a&&(e.substr(Si,6)===de?(t=de,Si+=6):(t=a,0===Oi&&Bi(Kt)),t===a&&(e.substr(Si,5)===pe?(t=pe,Si+=5):(t=a,0===Oi&&Bi(Ft)),t===a&&(e.substr(Si,6)===he?(t=he,Si+=6):(t=a,0===Oi&&Bi(Gt)))))))))))))))))))))));return t}(),i!==a&&(o=Di())!==a?(t,t=pi(i)):(Si=t,t=a)):(Si=t,t=a),t===a&&(t=Si,r=function(){var t;e.substr(Si,4)===M?(t=M,Si+=4):(t=a,0===Oi&&Bi(ht));t===a&&(e.substr(Si,6)===U?(t=U,Si+=6):(t=a,0===Oi&&Bi(yt)),t===a&&(e.substr(Si,5)===D?(t=D,Si+=5):(t=a,0===Oi&&Bi(mt)),t===a&&(e.substr(Si,9)===V?(t=V,Si+=9):(t=a,0===Oi&&Bi(gt)),t===a&&(e.substr(Si,6)===K?(t=K,Si+=6):(t=a,0===Oi&&Bi(ft)),t===a&&(e.substr(Si,3)===F?(t=F,Si+=3):(t=a,0===Oi&&Bi(bt)),t===a&&(e.substr(Si,5)===G?(t=G,Si+=5):(t=a,0===Oi&&Bi(vt)),t===a&&(e.substr(Si,3)===H?(t=H,Si+=3):(t=a,0===Oi&&Bi(Tt)),t===a&&(e.substr(Si,3)===$?(t=$,Si+=3):(t=a,0===Oi&&Bi(At))))))))));return t}(),r!==a&&(i=Di())!==a?(t,t=hi(r)):(Si=t,t=a),t===a)))if(t=Si,35===e.charCodeAt(Si)?(r=R,Si++):(r=a,0===Oi&&Bi(tt)),r!==a){for(i=Si,o=[],s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Di(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a&&(l=Oo())!==a?s=n=[n,l]:(Si=s,s=a);i=e.substring(i,Si),(o=Di())!==a?(t,t=yi(i)):(Si=t,t=a)}else Si=t,t=a}}return t}function ho(){var e,t,r,i;for(Oi++,e=Si,(t=yo())===a&&(t=null),r=[],(i=xo())===a&&(i=yo());i!==a;)r.push(i),(i=xo())===a&&(i=yo());return e,e=gi(t,r),Oi--,t=a,0===Oi&&Bi($t),e}function yo(){var t,r,i,o,s,n,l;if(t=Si,r=Si,i=[],o=Si,(s=wo())===a&&(s=null),n=Si,Oi++,l=xo(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?o=s=[s,n,l]:(Si=o,o=a)):(Si=o,o=a),o!==a)for(;o!==a;)i.push(o),o=Si,(s=wo())===a&&(s=null),n=Si,Oi++,l=xo(),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?o=s=[s,n,l]:(Si=o,o=a)):(Si=o,o=a);else i=a;return(r=i!==a?e.substring(r,Si):i)!==a&&(t,r=fi(r)),(t=r)===a&&(t=Ro()),t}function mo(){var t;return 42===e.charCodeAt(Si)?(t=ye,Si++):(t=a,0===Oi&&Bi(qt)),t}function go(){var t;return 95===e.charCodeAt(Si)?(t=me,Si++):(t=a,0===Oi&&Bi(Jt)),t}function fo(){var t;return 96===e.charCodeAt(Si)?(t=ge,Si++):(t=a,0===Oi&&Bi(zt)),t}function bo(){var t;return 33===e.charCodeAt(Si)?(t=fe,Si++):(t=a,0===Oi&&Bi(Wt)),t}function vo(){var e,t,r;return e=Si,(t=mo())!==a&&(r=mo())!==a?e=t=[t,r]:(Si=e,e=a),e}function To(){var e,t,r;return e=Si,(t=go())!==a&&(r=go())!==a?e=t=[t,r]:(Si=e,e=a),e}function Ao(){var e,t,r;return e=Si,(t=fo())!==a&&(r=fo())!==a?e=t=[t,r]:(Si=e,e=a),e}function _o(){var e,t,r;return e=Si,(t=bo())!==a&&(r=bo())!==a?e=t=[t,r]:(Si=e,e=a),e}function Po(){var t;return e.substr(Si,2)===be?(t=be,Si+=2):(t=a,0===Oi&&Bi(Yt)),t}function So(){var t;return 93===e.charCodeAt(Si)?(t=ve,Si++):(t=a,0===Oi&&Bi(Xt)),t}function xo(){var t,r,i,o,s,n,l,u,c;if(t=Si,Po()!==a){if(r=Si,i=[],je.test(e.charAt(Si))?(o=e.charAt(Si),Si++):(o=a,0===Oi&&Bi(it)),o!==a)for(;o!==a;)i.push(o),je.test(e.charAt(Si))?(o=e.charAt(Si),Si++):(o=a,0===Oi&&Bi(it));else i=a;(r=i!==a?e.substring(r,Si):i)!==a&&(i=So())!==a?(t,t=bi(r)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,vo()!==a){for(32===e.charCodeAt(Si)?(r=w,Si++):(r=a,0===Oi&&Bi(et)),r===a&&(r=null),i=Si,o=[],s=Si,n=Si,Oi++,l=Si,32===e.charCodeAt(Si)?(u=w,Si++):(u=a,0===Oi&&Bi(et)),u===a&&(u=null),(c=vo())!==a?l=u=[u,c]:(Si=l,l=a),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?s=n=[n,l]:(Si=s,s=a)):(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Si,32===e.charCodeAt(Si)?(u=w,Si++):(u=a,0===Oi&&Bi(et)),u===a&&(u=null),(c=vo())!==a?l=u=[u,c]:(Si=l,l=a),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?s=n=[n,l]:(Si=s,s=a)):(Si=s,s=a);i=e.substring(i,Si),32===e.charCodeAt(Si)?(o=w,Si++):(o=a,0===Oi&&Bi(et)),o===a&&(o=null),(s=vo())!==a?(t,t=vi(i)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,To()!==a){for(32===e.charCodeAt(Si)?(r=w,Si++):(r=a,0===Oi&&Bi(et)),r===a&&(r=null),i=Si,o=[],s=Si,n=Si,Oi++,l=Si,32===e.charCodeAt(Si)?(u=w,Si++):(u=a,0===Oi&&Bi(et)),u===a&&(u=null),(c=To())!==a?l=u=[u,c]:(Si=l,l=a),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?s=n=[n,l]:(Si=s,s=a)):(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Si,32===e.charCodeAt(Si)?(u=w,Si++):(u=a,0===Oi&&Bi(et)),u===a&&(u=null),(c=To())!==a?l=u=[u,c]:(Si=l,l=a),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?s=n=[n,l]:(Si=s,s=a)):(Si=s,s=a);i=e.substring(i,Si),32===e.charCodeAt(Si)?(o=w,Si++):(o=a,0===Oi&&Bi(et)),o===a&&(o=null),(s=To())!==a?(t,t=Ti(i)):(Si=t,t=a)}else Si=t,t=a;if(t===a){if(t=Si,Ao()!==a){for(32===e.charCodeAt(Si)?(r=w,Si++):(r=a,0===Oi&&Bi(et)),r===a&&(r=null),i=Si,o=[],s=Si,n=Si,Oi++,l=Si,32===e.charCodeAt(Si)?(u=w,Si++):(u=a,0===Oi&&Bi(et)),u===a&&(u=null),(c=Ao())!==a?l=u=[u,c]:(Si=l,l=a),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?s=n=[n,l]:(Si=s,s=a)):(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Si,32===e.charCodeAt(Si)?(u=w,Si++):(u=a,0===Oi&&Bi(et)),u===a&&(u=null),(c=Ao())!==a?l=u=[u,c]:(Si=l,l=a),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?s=n=[n,l]:(Si=s,s=a)):(Si=s,s=a);i=e.substring(i,Si),32===e.charCodeAt(Si)?(o=w,Si++):(o=a,0===Oi&&Bi(et)),o===a&&(o=null),(s=Ao())!==a?(t,t=Ai(i)):(Si=t,t=a)}else Si=t,t=a;if(t===a)if(t=Si,_o()!==a){for(32===e.charCodeAt(Si)?(r=w,Si++):(r=a,0===Oi&&Bi(et)),r===a&&(r=null),i=Si,o=[],s=Si,n=Si,Oi++,l=Si,32===e.charCodeAt(Si)?(u=w,Si++):(u=a,0===Oi&&Bi(et)),u===a&&(u=null),(c=_o())!==a?l=u=[u,c]:(Si=l,l=a),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?s=n=[n,l]:(Si=s,s=a)):(Si=s,s=a);s!==a;)o.push(s),s=Si,n=Si,Oi++,l=Si,32===e.charCodeAt(Si)?(u=w,Si++):(u=a,0===Oi&&Bi(et)),u===a&&(u=null),(c=_o())!==a?l=u=[u,c]:(Si=l,l=a),Oi--,l===a?n=void 0:(Si=n,n=a),n!==a?(e.length>Si?(l=e.charAt(Si),Si++):(l=a,0===Oi&&Bi(Xe)),l!==a?s=n=[n,l]:(Si=s,s=a)):(Si=s,s=a);i=e.substring(i,Si),32===e.charCodeAt(Si)?(o=w,Si++):(o=a,0===Oi&&Bi(et)),o===a&&(o=null),(s=_o())!==a?(t,t=_i(i)):(Si=t,t=a)}else Si=t,t=a}}}return t}function wo(){var t,r,i,o,s;if(t=Si,r=Si,(i=vo())!==a){if(o=[],(s=mo())!==a)for(;s!==a;)o.push(s),s=mo();else o=a;o!==a?r=i=[i,o]:(Si=r,r=a)}else Si=r,r=a;if((t=r!==a?e.substring(t,Si):r)===a){if(t=Si,r=Si,(i=To())!==a){if(o=[],(s=go())!==a)for(;s!==a;)o.push(s),s=go();else o=a;o!==a?r=i=[i,o]:(Si=r,r=a)}else Si=r,r=a;if((t=r!==a?e.substring(t,Si):r)===a){if(t=Si,r=Si,(i=Ao())!==a){if(o=[],(s=fo())!==a)for(;s!==a;)o.push(s),s=fo();else o=a;o!==a?r=i=[i,o]:(Si=r,r=a)}else Si=r,r=a;if((t=r!==a?e.substring(t,Si):r)===a){if(t=Si,r=Si,(i=_o())!==a){if(o=[],(s=bo())!==a)for(;s!==a;)o.push(s),s=bo();else o=a;o!==a?r=i=[i,o]:(Si=r,r=a)}else Si=r,r=a;t=r!==a?e.substring(t,Si):r}}}return t}function Ro(){var t;return Oi++,10===e.charCodeAt(Si)?(t=Te,Si++):(t=a,0===Oi&&Bi(Zt)),t===a&&(e.substr(Si,2)===Ae?(t=Ae,Si+=2):(t=a,0===Oi&&Bi(er)),t===a&&(13===e.charCodeAt(Si)?(t=_e,Si++):(t=a,0===Oi&&Bi(tr)),t===a&&(8232===e.charCodeAt(Si)?(t=Pe,Si++):(t=a,0===Oi&&Bi(rr)),t===a&&(8233===e.charCodeAt(Si)?(t=Se,Si++):(t=a,0===Oi&&Bi(ir)))))),Oi--,t===a&&(a,0===Oi&&Bi(Qt)),t}function Oo(){var t;return Be.test(e.charAt(Si))?(t=e.charAt(Si),Si++):(t=a,0===Oi&&Bi(or)),t}function ko(){var t,r;return(t=Ro())===a&&(t=Si,Oi++,e.length>Si?(r=e.charAt(Si),Si++):(r=a,0===Oi&&Bi(Xe)),Oi--,r===a?t=void 0:(Si=t,t=a)),t}function Co(){var t;return Le.test(e.charAt(Si))?(t=e.charAt(Si),Si++):(t=a,0===Oi&&Bi(ur)),t===a&&(126===e.charCodeAt(Si)?(t=ke,Si++):(t=a,0===Oi&&Bi(cr)),t===a&&(94===e.charCodeAt(Si)?(t=Ce,Si++):(t=a,0===Oi&&Bi(dr)),t===a&&(39===e.charCodeAt(Si)?(t=Ee,Si++):(t=a,0===Oi&&Bi(pr))))),t}var Eo=[],Io="";if(e=e.trimStart(),(r=c())!==a&&Si===e.length)return r;throw r!==a&&Si<e.length&&Bi({type:"end"}),Li(Ri,wi<e.length?e.charAt(wi):null,wi<e.length?ji(wi,wi+1):ji(wi,wi))}t.SyntaxError=n,function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(n,Error),n.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){i=e[r].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,s=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,n=this.location.source+":"+s.line+":"+s.column;if(i){var l=this.location.end,u=a("",s.line.toString().length," "),c=i[o.line-1],d=(o.line===l.line?l.column:c.length+1)-o.column||1;t+="\n --\x3e "+n+"\n"+u+" |\n"+s.line+" | "+c+"\n"+u+" | "+a("",o.column-1," ")+a("",d,"^")}else t+="\n at "+n}return t},n.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?s(e[0])+"-"+s(e[1]):s(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function i(e){return e.charCodeAt(0).toString(16).toUpperCase()}function o(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function s(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+i(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+i(e)}))}function n(e){return r[e.type](e)}return"Expected "+function(e){var t,r,i=e.map(n);if(i.sort(),i.length>0){for(t=1,r=1;t<i.length;t++)i[t-1]!==i[t]&&(i[r]=i[t],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(e)+" but "+function(e){return e?'"'+o(e)+'"':"end of input"}(t)+" found."},t.parse=l},297:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkGenerator=void 0;const o=r(8256),s=r(549),n=r(208),a=r(8791),l=r(1060),u=r(8565),c=r(4719),d=r(1895),p=r(1353),h=r(672),y={debugGenerationInline:!1};t.BitmarkGenerator=class{constructor(e,t){var r;this.ast=new o.Ast,this.skipNLBetweenBitsValue=!1,this.printed=!1,this.bitmarkVersion=null!==(r=a.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:a.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},y),null==t?void 0:t.bitmarkOptions),this.bitmarkVersion===a.BitmarkVersion.v2?void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=u.CardSetVersion.v1):void 0===this.options.cardSetVersion&&(this.options.cardSetVersion=u.CardSetVersion.v2),this.writer=e,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this),this.generatePropertyHandlers()}generate(e){return i(this,void 0,void 0,(function*(){this.resetState(),yield this.writer.open(),this.walkAndWrite(e),this.writeLine(),yield this.writer.close()}))}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.skipNLBetweenBitsValue=!1,this.printed=!1}walkAndWrite(e){this.ast.walk(e,s.NodeType.bitmarkAst,this,void 0),this.writeLine()}enter(e,t,r){let i;const o=this,s=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[s]&&(i=o[s](e,t,r)),i}between(e,t,r,i,o){let s;const n=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof n[a]&&(s=n[a](e,t,r,i,o)),s}exit(e,t,r){const i=this,o=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof i[o]&&i[o](e,t,r)}leaf(e,t,r){const i=this,o=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[o]&&i[o](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}between_bits(e,t,r,i,o){this.writeNL(),this.writeNL(),this.writeNL()}enter_bitsValue(e,t,r){var i,o;const s=e.value;if(this.writeOPD(),this.writeString(s.bitType.alias),s.textFormat){this.isWriteTextFormat(s.textFormat)&&(this.writeColon(),this.writeString(s.textFormat))}const n=null===(i=s.resource)||void 0===i?void 0:i.type;n&&n!==s.bitType.root&&(this.writeAmpersand(),this.writeString(null===(o=s.resource)||void 0===o?void 0:o.type)),this.writeCL(),this.writeNL()}between_bitsValue(e,t,r,i,o){const n=[s.NodeType.bitType,s.NodeType.textFormat,s.NodeType.level,s.NodeType.progress,s.NodeType.toc,s.NodeType.referenceEnd,s.NodeType.labelFalse];e.value.book&&n.push(s.NodeType.reference);(()=>{if(this.skipNLBetweenBitsValue)return this.skipNLBetweenBitsValue=!1,!0;for(const e of n)if(t.key===e)return!0;return!1})()||this.writeNL()}enter_labelTrue(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==s.NodeType.bitsValue)return;const o=null==t?void 0:t.value;o&&(""!=i&&this.writeProperty(c.PropertyKey.labelTrue,i,!0),o.labelFalse&&""!=o.labelFalse[0]&&this.writeProperty(c.PropertyKey.labelFalse,o.labelFalse,!0))}enter_imageSource(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==s.NodeType.bitsValue)return;const{url:o,mockupId:n,size:a,format:l,trim:u}=i;this.writeProperty("imageSource",o,!0),o&&(n&&this.writeProperty("mockupId",n,!0),a&&this.writeProperty("size",a,!0),l&&this.writeProperty("format",l,!0),h.BooleanUtils.isBoolean(u)&&this.writeProperty("trim",u,!0))}enter_partner(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==s.NodeType.bitsValue)return;const{name:o,avatarImage:n}=i;this.writeProperty("partner",o,!0),n&&this.writeResource(n)}enter_markConfigValue(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==s.NodeType.markConfig)return;const{mark:o,color:n,emphasis:a}=i;o&&(this.writeProperty("mark",o,!0),n&&this.writeProperty("color",n,!0),a&&this.writeProperty("emphasis",a,!0),this.writeNL())}enter_sampleSolution(e,t,r){this.writeProperty("sampleSolution",e.value)}leaf_sampleSolution(e,t,r){this.writeProperty("sampleSolution",e.value)}enter_itemLead(e,t,r){const i=e.value;i&&(i.item||i.lead)&&(this.writeOPC(),this.writeString(i.item||""),this.writeCL(),i.lead&&(this.writeOPC(),this.writeString(i.lead),this.writeCL()))}enter_body(e,t,r){e.value.bodyParts.length>0&&this.writeNL()}enter_solutions(e,t,r){const i=e.value;i&&0===i.length&&(this.writeOPU(),this.writeCL())}leaf_solution(e,t,r){var i;const o=e.value,s=null===(i=this.getParentNode(r,2))||void 0===i?void 0:i.value;(null==s?void 0:s.type)===l.BodyBitType.mark&&o&&(this.writeOPE(),this.writeString(o),this.writeCL())}leaf_mark(e,t,r){var i;const o=e.value,s=null===(i=this.getParentNode(r,2))||void 0===i?void 0:i.value;(null==s?void 0:s.type)===l.BodyBitType.mark&&o&&this.writeProperty("mark",o,!0)}enter_optionsValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}enter_textsValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}enter_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeCardSetStart(),this.writeNL())}between_cardNode(e,t,r,i,o){this.isRootBitType1(o)||(this.writeNL(),this.writeCardSetCardDivider(),this.writeNL())}exit_cardNode(e,t,r){this.isRootBitType1(r)||(this.writeNL(),this.writeCardSetEnd())}enter_elements(e,t,r){}between_elements(e,t,r,i,o){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}exit_elements(e,t,r){}between_flashcards(e,t,r,i,o){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}between_flashcardsValue(e,t,r,i,o){r.key===s.NodeType.answer?(this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()):r.key===s.NodeType.alternativeAnswers&&(this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL())}leaf_answer(e,t,r){(null==t?void 0:t.key)===s.NodeType.flashcardsValue&&e.value&&this.writeString(e.value)}between_alternativeAnswers(e,t,r){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}leaf_alternativeAnswersValue(e,t,r){(null==t?void 0:t.key)===s.NodeType.alternativeAnswers&&e.value&&this.writeString(e.value)}enter_statements(e,t,r){}between_statements(e,t,r,i,o){this.isRootBitType(o,n.RootBitType.trueFalse1)||(this.writeNL(),this.writeCardSetCardDivider()),this.writeNL()}exit_statements(e,t,r){}enter_statementsValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}between_choices(e,t,r,i,o){this.writeNL()}exit_choices(e,t,r){this.writeNL()}enter_choicesValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}between_responses(e,t,r,i,o){this.writeNL()}exit_responses(e,t,r){this.writeNL()}enter_responsesValue(e,t,r){const i=e.value;i.isCorrect?this.writeOPP():this.writeOPM(),this.write(i.text),this.writeCL()}enter_quizzes(e,t,r){}between_quizzes(e,t,r,i,o){this.writeCardSetCardDivider(),this.writeNL()}exit_quizzes(e,t,r){}between_quizzesValue(e,t,r,i,o){r.key!==s.NodeType.choices&&r.key!==s.NodeType.responses||this.writeNL()}enter_heading(e,t,r){}between_heading(e,t,r,i,o){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_heading(e,t,r){}enter_forValues(e,t,r){}between_forValues(e,t,r,i,o){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}exit_forValues(e,t,r){}enter_pairs(e,t,r){}between_pairs(e,t,r,i,o){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_pairs(e,t,r){}between_pairsValue(e,t,r,i,o){}enter_keyAudio(e,t,r){const i=e.value;this.writeResource(i)}enter_keyImage(e,t,r){const i=e.value;this.writeResource(i)}enter_matrix(e,t,r){}between_matrix(e,t,r,i,o){this.writeNL(),this.writeCardSetCardDivider(),this.writeNL()}exit_matrix(e,t,r){}between_matrixValue(e,t,r,i,o){}enter_values(e,t,r){this.writeNL(),this.writeCardSetSideDivider(),this.writeNL()}between_values(e,t,r,i,o){this.writeNL(),this.writeCardSetVariantDivider(),this.writeNL()}enter_questions(e,t,r){}between_questions(e,t,r,i,o){this.writeCardSetCardDivider(),this.writeNL()}exit_questions(e,t,r){}between_questionsValue(e,t,r,i,o){r.key===s.NodeType.sampleSolution&&this.writeNL()}exit_questionsValue(e,t,r){this.writeNL()}enter_botResponses(e,t,r){}between_botResponses(e,t,r,i,o){this.writeCardSetCardDivider(),this.writeNL()}exit_botResponses(e,t,r){}between_botResponsesValue(e,t,r,i,o){this.writeNL()}exit_botResponsesValue(e,t,r){this.writeNL()}leaf_response(e,t,r){this.writeOPB(),this.writeString(e.value),this.writeCL()}leaf_reaction(e,t,r){this.writeProperty("reaction",e.value,!0)}leaf_feedback(e,t,r){const i=e.value;i&&this.write(i)}enter_resource(e,t,r){const i=e.value;this.writeResource(i)}enter_posterImage(e,t,r){const i=e.value;i&&i.value&&this.writeProperty("posterImage",i.value)}enter_thumbnails(e,t,r){const i=e.value;if(Array.isArray(i)){const e=["src1x","src2x","src3x","src4x"];for(let t=0;t<i.length&&t!==e.length;t++){const r=i[t],o=e[t];this.writeProperty(o,r.value,!0)}}}leaf_title(e,t,r){const i=e.value,o=(null==t?void 0:t.value).level||1;if(o&&i){this.writeOP();for(let e=0;e<+o;e++)this.writeHash();this.writeString(i),this.writeCL()}}leaf_subtitle(e,t,r){const i=e.value;if(i){this.writeOP();for(let e=0;e<2;e++)this.writeHash();this.writeString(i),this.writeCL()}}leaf_book(e,t,r){const i=null==t?void 0:t.value;i&&e.value&&(this.writeProperty("book",e.value),i.reference&&(this.writeOPRANGLE(),this.writeString(i.reference),this.writeCL(),i.referenceEnd&&(this.writeOPRANGLE(),this.writeString(i.referenceEnd),this.writeCL())))}leaf_anchor(e,t,r){e.value&&(this.writeOPDANGLE(),this.writeString(e.value),this.writeCL())}leaf_reference(e,t,r){const i=null==t?void 0:t.value;i&&e.value&&(i.book||(this.writeOPRANGLE(),this.writeString(e.value),this.writeCL()))}leaf_hint(e,t,r){const i=e.value;i&&(this.writeOPQ(),this.writeString(i),this.writeCL())}leaf_instruction(e,t,r){const i=e.value;i&&(this.writeOPB(),this.writeString(i),this.writeCL())}leaf_example(e,t,r){var i,o;const s=e.value,n=null!==(i=null==t?void 0:t.value.isExample)&&void 0!==i&&i,a=null!==(o=null==t?void 0:t.value.isDefaultExample)&&void 0!==o&&o;n&&(a?(this.writeOPA(),this.writeString("example"),this.writeCL()):null!=s&&(this.writeOPA(),this.writeString("example"),this.writeColon(),!0===s?this.writeString("true"):!1===s?this.writeString("false"):this.writeString(s),this.writeCL()))}leaf_bodyText(e,t,r){const i=e.value;i&&this.writeString(i)}leaf_footerText(e,t,r){const i=e.value;i&&this.writeString(i)}leaf_elementsValue(e,t,r){e.value&&this.writeString(e.value)}leaf_solutionsValue(e,t,r){e.value&&(this.writeOPU(),this.writeString(e.value),this.writeCL())}leaf_prefix(e,t,r){e.value&&(this.writeOPPRE(),this.writeString(e.value),this.writeCL())}leaf_postfix(e,t,r){e.value&&(this.writeOPPOST(),this.writeString(e.value),this.writeCL())}leaf_forKeys(e,t,r){this.writeOPHASH(),this.writeString(e.value),this.writeCL()}leaf_forValuesValue(e,t,r){this.writeOPHASH(),this.writeString(e.value),this.writeCL()}leaf_key(e,t,r){e.value&&this.writeString(e.value)}leaf_valuesValue(e,t,r){e.value&&this.writeString(e.value)}leaf_question(e,t,r){(null==t?void 0:t.key)!==s.NodeType.questionsValue&&(null==t?void 0:t.key)!==s.NodeType.flashcardsValue||e.value&&this.writeString(e.value)}leaf_isShortAnswer(e,t,r){!1===e.value&&(this.writeOPA(),this.writeString("longAnswer"),this.writeCL())}leaf_src1x(e,t,r){this.writeProperty("src1x",e.value)}leaf_src2x(e,t,r){this.writeProperty("src2x",e.value)}leaf_src3x(e,t,r){this.writeProperty("src3x",e.value)}leaf_src4x(e,t,r){this.writeProperty("src4x",e.value)}leaf_width(e,t,r){this.writeProperty("width",e.value)}leaf_height(e,t,r){this.writeProperty("height",e.value)}leaf_alt(e,t,r){this.writeProperty("alt",e.value)}leaf_license(e,t,r){this.writeProperty("license",e.value)}leaf_copyright(e,t,r){this.writeProperty("copyright",e.value)}leaf_provider(e,t,r){}leaf_showInIndex(e,t,r){this.writeProperty("showInIndex",e.value)}leaf_caption(e,t,r){const i=e.value;this.writeProperty("caption",i)}leaf_duration(e,t,r){(null==t?void 0:t.key)!==s.NodeType.bitsValue&&this.writeProperty("duration",e.value)}leaf_mute(e,t,r){this.writeProperty("mute",e.value)}leaf_autoplay(e,t,r){this.writeProperty("autoplay",e.value)}leaf_allowSubtitles(e,t,r){this.writeProperty("allowSubtitles",e.value)}leaf_showSubtitles(e,t,r){this.writeProperty("showSubtitles",e.value)}generatePropertyHandlers(){var e;for(const t of c.PropertyKey.values()){const r=null!==(e=c.PropertyKey.getMetadata(c.PropertyKey.fromValue(t)))&&void 0!==e?e:{},i=r.astKey?r.astKey:t,o=`enter_${i}`;i!==c.PropertyKey.example&&(i!==c.PropertyKey.labelTrue&&i!==c.PropertyKey.labelFalse&&i!==c.PropertyKey.posterImage&&i!==c.PropertyKey.imageSource&&i!==c.PropertyKey.partner&&(this[o]=(e,i,o)=>{null!=e.value&&(null==i?void 0:i.key)===s.NodeType.bitsValue&&this.writeProperty(t,e.value,r.isSingle,r.ignoreFalse,r.ignoreTrue)},this[o]=this[o].bind(this)))}}writeString(e){null!=e&&this.write(`${e}`)}writeOPBUL(){this.write("[•")}writeOPESC(){this.write("[^")}writeOPRANGLE(){this.write("[►")}writeOPDANGLE(){this.write("[▼")}writeOPD(){this.write("[.")}writeOPU(){this.write("[_")}writeOPE(){this.write("[=")}writeOPB(){this.write("[!")}writeOPQ(){this.write("[?")}writeOPA(){this.write("[@")}writeOPP(){this.write("[+")}writeOPM(){this.write("[-")}writeOPS(){this.write("[\\")}writeOPR(){this.write("[*")}writeOPC(){this.write("[%")}writeOPAMP(){this.write("[&")}writeOPDOLLAR(){this.write("[$")}writeOPHASH(){this.write("[#")}writeOPPRE(){this.write("['")}writeOPPOST(){this.write("[")}writeOP(){this.write("[")}writeCL(){this.write("]")}writeAmpersand(){this.write("&")}writeColon(){this.write(":")}writeHash(){this.write("#")}writeCardSetStart(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetEnd(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("==="):this.write("~~~~")}writeCardSetCardDivider(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("==="):this.write("====")}writeCardSetSideDivider(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("=="):this.write("--")}writeCardSetVariantDivider(){this.options.cardSetVersion===u.CardSetVersion.v1?this.write("--"):this.write("++")}writeNL(){this.options.debugGenerationInline?this.write("\\n"):this.write("\n")}writeResource(e){var t;const r=e;if(e)if(e.type===d.ResourceType.imageResponsive){const t=e;this.writeResource(t.imagePortrait),this.writeNL(),this.writeResource(t.imageLandscape)}else if(e.type===d.ResourceType.stillImageFilm){const t=e;this.writeResource(t.image),this.writeNL(),this.writeResource(t.audio)}else this.writeOPAMP(),this.writeString(null!==(t=e.typeAlias)&&void 0!==t?t:e.type),e.type===d.ResourceType.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 s,n=!1;if(void 0!==t&&(s=Array.isArray(t)?t:[t],s.length>0)){r&&(s=s.slice(s.length-1));for(const t of s)if(void 0!==t){if(i&&!1===t)continue;if(o&&!0===t)continue;this.writeOPA(),this.writeString(e),this.writeColon(),this.writeString(`${t}`),this.writeCL(),n=!0}}n||(this.skipNLBetweenBitsValue=!0)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}isWriteTextFormat(e){return!!(!(p.TextFormat.fromValue(e)===p.TextFormat.bitmarkMinusMinus)||this.options.explicitTextFormat)}isRootBitType1(e){return this.isRootBitType(e,n.RootBitType.trueFalse1)||this.isRootBitType(e,n.RootBitType.multipleChoice1)||this.isRootBitType(e,n.RootBitType.multipleResponse1)}isRootBitType(e,t){const r=this.getBitType(e);return(null==r?void 0:r.root)===t}getBitType(e){for(const t of e)if(t.key===s.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getParentNode(e,t=1){if(e.length>t+1)return e[e.length-t-1]}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}}},8582:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkStringGenerator=void 0;const o=r(227),s=r(297);t.BitmarkStringGenerator=class{constructor(e){this.writer=new o.StringWriter,this.generator=new s.BitmarkGenerator(this.writer,e)}generate(e){return i(this,void 0,void 0,(function*(){return yield this.generator.generate(e),this.writer.getString()}))}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}}},3857:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))},o=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonGenerator=void 0;const s=r(8256),n=r(549),a=r(208),l=r(8791),u=r(1060),c=r(7028),d=r(4719),p=r(1895),h=r(1353),y=r(406),m=r(7646),g=r(672),f=r(3633),b=r(169),v={};t.JsonGenerator=class{constructor(e,t){var r;this.ast=new s.Ast,this.textParser=new y.TextParser,this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault="",this.bodyDefault="",this.printed=!1,this.bitmarkVersion=null!==(r=l.BitmarkVersion.fromValue(null==t?void 0:t.bitmarkVersion))&&void 0!==r?r:l.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},v),null==t?void 0:t.jsonOptions),this.jsonPrettifySpace=!0===this.options.prettify?2:this.options.prettify||void 0,this.bitmarkVersion===l.BitmarkVersion.v2?void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!0):void 0===this.options.textAsPlainText&&(this.options.textAsPlainText=!1),this.writer=e,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this),this.generatePropertyHandlers()}generate(e){return i(this,void 0,void 0,(function*(){this.resetState(),yield this.writer.open(),this.walkAndWrite(e),this.write(JSON.stringify(this.json,null,this.jsonPrettifySpace)),yield this.writer.close()}))}generateSync(e){this.resetState(),this.writer.openSync(),this.walkAndWrite(e),this.writer.closeSync()}resetState(){this.json=[],this.bitWrapperJson={},this.bitJson={},this.textDefault=this.options.textAsPlainText?"":[],this.bodyDefault=this.options.textAsPlainText?"":[],this.printed=!1}walkAndWrite(e){this.ast.walk(e,n.NodeType.bitmarkAst,this,void 0)}enter(e,t,r){let i;const o=this,s=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[s]&&(i=o[s](e,t,r)),i}between(e,t,r,i,o){let s;const n=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof n[a]&&(s=n[a](e,t,r,i,o)),s}exit(e,t,r){const i=this,o=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof i[o]&&i[o](e,t,r)}leaf(e,t,r){const i=this,o=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[o]&&i[o](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_bitmarkAst(e,t,r){this.json=[]}enter_bitsValue(e,t,r){var i,o,s;const n=e.value;this.bitWrapperJson={},this.json.push(this.bitWrapperJson),this.bitJson=this.createBitJson(n),this.bitWrapperJson.bit=this.bitJson;const l=a.RootBitType.getMetadata(n.bitType.root),u=!!(null==l?void 0:l.rootExampleType),d=(null==l?void 0:l.rootExampleType)===c.ExampleType.boolean;if(u){let e;d?(e=!0,n.bitType.root===a.RootBitType.trueFalse1&&void 0!==(null===(o=null===(i=n.cardNode)||void 0===i?void 0:i.statement)||void 0===o?void 0:o.isCorrect)&&(e=n.cardNode.statement.isCorrect)):e=null!==(s=m.ArrayUtils.asSingle(n.sampleSolution))&&void 0!==s?s:"";const t=this.toExample(n,{defaultExample:e,isBoolean:d});this.bitJson.isExample=t.isExample,this.bitJson.example=t.example}else n.isExample&&(this.bitJson.isExample=!0)}exit_bitsValue(e,t,r){this.cleanAndSetDefaultsForBitJson(this.bitJson)}enter_imageSource(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==n.NodeType.bitsValue)return;const{url:o,mockupId:s,size:a,format:l,trim:u}=i,c={};this.addProperty(c,"url",null!=o?o:"",!0),this.addProperty(c,"mockupId",null!=s?s:"",!0),this.addProperty(c,"size",null!=a?a:null,!0),this.addProperty(c,"format",null!=l?l:null,!0),this.addProperty(c,"trim",g.BooleanUtils.isBoolean(u)?u:null,!0),this.bitJson.imageSource=c}enter_partner(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==n.NodeType.bitsValue)return;const{name:o,avatarImage:s}=i,a={};if(this.addProperty(a,"name",null!=o?o:"",!0),s){const e=this.parseResourceToJson(s);e&&e.type===p.ResourceType.image&&(a.avatarImage=e.image)}this.bitJson.partner=a}enter_markConfigValue(e,t,r){const i=e.value;if((null==t?void 0:t.key)!==n.NodeType.markConfig)return;const{mark:o,color:s,emphasis:a}=i,l={};this.addProperty(l,"mark",null!=o?o:"unknown",!0),s&&this.addProperty(l,"color",null!=s?s:"",!0),a&&this.addProperty(l,"emphasis",null!=a?a:"",!0),this.bitJson.marks||(this.bitJson.marks=[]),this.bitJson.marks.push(l)}enter_sampleSolution(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"sampleSolution",e.value,!0)}enter_itemLead(e,t,r){const i=e.value,{item:o,lead:s}=i;(null==t?void 0:t.key)===n.NodeType.bitsValue&&(null!=o&&(this.bitJson.item=this.toTextAstOrString(o)),null!=s&&(this.bitJson.lead=this.toTextAstOrString(s)))}enter_extraProperties(e,t,r){const i=e.value;if(!this.options.excludeUnknownProperties&&i)for(const[e,t]of Object.entries(i)){let r=e;Object.prototype.hasOwnProperty.call(this.bitJson,e)&&(r=`_${e}`),this.addProperty(this.bitJson,r,t)}}enter_bodyParts(e,t,r){const i=e.value,o=this.options.textAsPlainText,s=this.getTextFormat(r);let n="",a=0;null==this.bitJson.body&&(this.bitJson.body=this.bodyDefault);const l=e=>({legacyPlaceholderKey:`{${e}}`,placeholderKey:`[!${e}]`});for(let e=0;e<i.length;e++){const t=i[e];if(t.type===u.BodyBitType.text){n+=t.data.bodyText}else{const{legacyPlaceholderKey:e,placeholderKey:t}=l(a);n+=o?e:t,a++}}this.bitJson.body=this.toTextAstOrString(n,s);const c=this.bitJson.body;a=0;for(let e=0;e<i.length;e++){const t=i[e];if(t.type===u.BodyBitType.text)continue;const r=t;let s;const{legacyPlaceholderKey:n}=l(a);switch(t.type){case u.BodyBitType.gap:{const e=r;s=this.createGapJson(e);break}case u.BodyBitType.mark:{const e=r;s=this.createMarkJson(e);break}case u.BodyBitType.select:{const e=r;s=this.createSelectJson(e);break}case u.BodyBitType.highlight:{const e=r;s=this.createHighlightJson(e);break}}s&&(o?(this.bitJson.placeholders||(this.bitJson.placeholders={}),this.bitJson.placeholders[n]=s):this.replacePlaceholderWithBodyBit(c,s,a)),a++}return!1}enter_elements(e,t,r){const i=e.value;i&&i.length>0&&(this.bitJson.elements=i)}enter_flashcards(e,t,r){var i,o,s,a;const l=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const u=[];if(l)for(const e of l){const t=Object.assign(Object.assign({question:null!==(i=e.question)&&void 0!==i?i:"",answer:null!==(o=e.answer)&&void 0!==o?o:"",alternativeAnswers:null!==(s=e.alternativeAnswers)&&void 0!==s?s:[]},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:e.isDefaultExample,isBoolean:!0}));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.cards=u)}enter_statement(e,t,r){var i,o;const s=e.value;(null==t?void 0:t.key)===n.NodeType.cardNode&&s&&(this.bitJson.statement=null!==(i=s.text)&&void 0!==i?i:"",this.bitJson.isCorrect=null!==(o=s.isCorrect)&&void 0!==o&&o)}enter_statements(e,t,r){var i,o,s;const a=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const l=[];if(a)for(const e of a){const t=Object.assign(Object.assign({statement:null!==(i=e.text)&&void 0!==i?i:"",isCorrect:!!e.isCorrect},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(o=e.itemLead)||void 0===o?void 0:o.item)&&delete t.item,null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,null==(null==e?void 0:e.hint)&&delete t.hint,null==(null==e?void 0:e.instruction)&&delete t.instruction,l.push(t)}l.length>0&&(this.bitJson.statements=l)}enter_choices(e,t,r){var i,o,s;const a=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const l=[];if(a)for(const e of a){const t=Object.assign(Object.assign({choice:null!==(i=e.text)&&void 0!==i?i:"",isCorrect:null!==(o=e.isCorrect)&&void 0!==o&&o},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,l.push(t)}l.length>0&&(this.bitJson.choices=l)}enter_responses(e,t,r){var i,o,s;const a=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const l=[];if(a)for(const e of a){const t=Object.assign(Object.assign({response:null!==(i=e.text)&&void 0!==i?i:"",isCorrect:null!==(o=e.isCorrect)&&void 0!==o&&o},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete t.lead,l.push(t)}l.length>0&&(this.bitJson.responses=l)}enter_quizzes(e,t,r){var i,o,s,n,a,l,u,c;const d=e.value,p=[];if(d)for(const e of d){const t=[];if(e.choices)for(const r of e.choices){const n=Object.assign(Object.assign({choice:null!==(i=r.text)&&void 0!==i?i:"",isCorrect:null!==(o=r.isCorrect)&&void 0!==o&&o},this.toItemLeadHintInstruction(r)),this.toExample(r,{defaultExample:!!r.isCorrect,isBoolean:!0}));null==(null===(s=e.itemLead)||void 0===s?void 0:s.lead)&&delete n.lead,t.push(n)}const r=[];if(e.responses)for(const t of e.responses){const i=Object.assign(Object.assign({response:null!==(n=t.text)&&void 0!==n?n:"",isCorrect:null!==(a=t.isCorrect)&&void 0!==a&&a},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!!t.isCorrect,isBoolean:!0}));null==(null===(l=e.itemLead)||void 0===l?void 0:l.lead)&&delete i.lead,r.push(i)}const d=Object.assign(Object.assign({},this.toItemLeadHintInstruction(e)),{isExample:null!==(u=e.isExample)&&void 0!==u&&u,choices:e.choices?t:void 0,responses:e.responses?r:void 0});null==(null===(c=e.itemLead)||void 0===c?void 0:c.lead)&&delete d.lead,p.push(d)}p.length>0&&(this.bitJson.quizzes=p)}enter_heading(e,t,r){var i,o;const s=e.value;let n=!1;if(s&&s.forKeys&&(n=!0),!n)return!1;const a={forKeys:null!==(i=s.forKeys)&&void 0!==i?i:""};Array.isArray(s.forValues)?s.forValues.length>1?a.forValues=s.forValues:1===s.forValues.length?a.forValues=s.forValues[0]:a.forValues=s.forValues:a.forValues=null!==(o=s.forValues)&&void 0!==o?o:"",this.bitJson.heading=a}enter_pairs(e,t,r){var i,o,s,n,a;const l=e.value,u=[];if(l)for(const e of l){const t=Array.isArray(e.values)&&e.values.length>0&&e.values[0],r=Object.assign(Object.assign(Object.assign({key:null!==(i=e.key)&&void 0!==i?i:"",keyAudio:e.keyAudio?this.addAudioResource(e.keyAudio):void 0,keyImage:e.keyImage?this.addImageResource(e.keyImage):void 0,values:null!==(o=e.values)&&void 0!==o?o:[]},this.toItemLeadHintInstruction(e)),{isCaseSensitive:null===(s=e.isCaseSensitive)||void 0===s||s,isLongAnswer:null!==(n=!e.isShortAnswer)&&void 0!==n&&n}),this.toExample(e,{defaultExample:t,isBoolean:!1}));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete r.lead,r.key&&(delete r.keyAudio,delete r.keyImage),null!=r.keyAudio&&(delete r.key,delete r.keyImage),null!=r.keyImage&&(delete r.key,delete r.keyAudio),u.push(r)}u.length>0&&(this.bitJson.pairs=u)}enter_matrix(e,t,r){var i,o,s,n,a,l,u;const c=e.value,d=[];if(c)for(const e of c){const t=[];if(e.cells)for(const r of e.cells){const e=Array.isArray(r.values)&&r.values.length>0&&r.values[0],s=Object.assign(Object.assign({values:null!==(i=r.values)&&void 0!==i?i:[]},this.toItemLeadHintInstruction(r)),this.toExample(r,{defaultExample:e,isBoolean:!1}));null==(null===(o=r.itemLead)||void 0===o?void 0:o.lead)&&delete s.lead,null==r.hint&&delete s.hint,t.push(s)}const r=Object.assign(Object.assign({key:null!==(s=e.key)&&void 0!==s?s:"",cells:null!=t?t:[]},this.toItemLeadHintInstruction(e)),{isCaseSensitive:null===(n=e.isCaseSensitive)||void 0===n||n,isLongAnswer:null!==(a=!e.isShortAnswer)&&void 0!==a&&a,isExample:null!==(l=e.isExample)&&void 0!==l&&l});null==(null===(u=e.itemLead)||void 0===u?void 0:u.lead)&&delete r.lead,null==e.instruction&&delete r.instruction,d.push(r)}d.length>0&&(this.bitJson.matrix=d)}enter_questions(e,t,r){var i,o,s,n,a;const l=e.value,u=[];if(l)for(const e of l){const t=Object.assign(Object.assign(Object.assign({question:null!==(i=e.question)&&void 0!==i?i:"",partialAnswer:null!==(o=m.ArrayUtils.asSingle(e.partialAnswer))&&void 0!==o?o:"",sampleSolution:null!==(s=e.sampleSolution)&&void 0!==s?s:""},this.toItemLeadHintInstruction(e)),{isShortAnswer:null===(n=e.isShortAnswer)||void 0===n||n}),this.toExample(e,{defaultExample:e.sampleSolution||"",isBoolean:!1}));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete t.lead,u.push(t)}u.length>0&&(this.bitJson.questions=u)}enter_botResponses(e,t,r){var i,o,s,a;const l=e.value;if((null==t?void 0:t.key)!==n.NodeType.cardNode)return;const u=[];if(l)for(const e of l){const t=Object.assign({response:null!==(i=e.response)&&void 0!==i?i:"",reaction:null!==(o=e.reaction)&&void 0!==o?o:"",feedback:null!==(s=e.feedback)&&void 0!==s?s:""},this.toItemLeadHintInstruction(e));null==(null===(a=e.itemLead)||void 0===a?void 0:a.lead)&&delete t.lead,null==e.hint&&delete t.hint,delete t.instruction,u.push(t)}u.length>0&&(this.bitJson.responses=u)}enter_resource(e,t,r){const i=e.value;this.bitJson.resource=this.parseResourceToJson(i)}leaf_title(e,t,r){this.bitJson.title=this.toTextAstOrString(e.value)}leaf_subtitle(e,t,r){this.bitJson.subtitle=this.toTextAstOrString(e.value)}leaf_level(e,t,r){var i;null!=e.value&&this.addProperty(this.bitJson,"level",null!==(i=e.value)&&void 0!==i?i:1,!0)}leaf_book(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"book",e.value,!0)}leaf_anchor(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"anchor",e.value,!0)}leaf_reference(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"reference",e.value,!0)}leaf_referenceEnd(e,t,r){null!=e.value&&this.addProperty(this.bitJson,"referenceEnd",e.value,!0)}leaf_hint(e,t,r){const i=e.value;(null==t?void 0:t.key)===n.NodeType.bitsValue&&(this.bitJson.hint=this.toTextAstOrString(i))}leaf_instruction(e,t,r){const i=e.value;(null==t?void 0:t.key)===n.NodeType.bitsValue&&(this.bitJson.instruction=this.toTextAstOrString(i))}leaf_footerText(e,t,r){const i=e.value;this.bitJson.footer=this.toTextAstOrString(i)}leaf_markup(e,t,r){const i=e.value;i&&(this.bitWrapperJson.bitmark=i)}enter_parser(e,t,r){const i=e.value;if(i){const{version:e,excessResources:r,warnings:s,errors:a}=i,l=o(i,["version","excessResources","warnings","errors"]),u=`${this.bitmarkVersion}`;let c;if(Array.isArray(r)&&r.length>0){c=[];for(const e of r){const t=this.parseResourceToJson(e);t&&c.push(t)}}(null==t?void 0:t.key)===n.NodeType.bitsValue&&(this.bitWrapperJson.parser=Object.assign(Object.assign({version:e,bitmarkVersion:u},l),{warnings:s,errors:a,excessResources:c}),this.options.enableWarnings||delete this.bitWrapperJson.parser.warnings)}}generatePropertyHandlers(){var e;for(const t of d.PropertyKey.values()){const r=d.PropertyKey.fromValue(t),i=null!==(e=d.PropertyKey.getMetadata(r))&&void 0!==e?e:{},o=i.astKey?i.astKey:t,s=`enter_${o}`;o!==d.PropertyKey.example&&(o!==d.PropertyKey.imageSource&&o!==d.PropertyKey.partner&&(this[s]=(e,r,o)=>{const s=e.value;if(null==s)return;if((null==r?void 0:r.key)!==n.NodeType.bitsValue)return;let a=t;i.jsonKey&&(a=i.jsonKey),this.addProperty(this.bitJson,a,s,i.isSingle)},this[s]=this[s].bind(this)))}}createGapJson(e){var t;const r=e.data,i=r.solutions&&r.solutions.length>0?r.solutions[0]:"",o=Object.assign(Object.assign(Object.assign(Object.assign({type:"gap"},this.toItemLeadHintInstruction(r)),{isCaseSensitive:null===(t=r.isCaseSensitive)||void 0===t||t}),this.toExample(r,{defaultExample:i,isBoolean:!1})),{solutions:r.solutions});return o.lead||delete o.lead,o}createMarkJson(e){const t=e.data,r=Object.assign(Object.assign({type:"mark",solution:t.solution,mark:t.mark},this.toItemLeadHintInstruction(t)),this.toExample(t,{defaultExample:!0,isBoolean:!0}));return r.lead||delete r.lead,r}createSelectJson(e){var t,r,i,o;const s=e.data,n=[];for(const e of s.options){const r=Object.assign(Object.assign({text:e.text,isCorrect:null!==(t=e.isCorrect)&&void 0!==t&&t},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));r.item||delete r.item,r.lead||delete r.lead,r.instruction||delete r.instruction,r.isCaseSensitive||delete r.isCaseSensitive,n.push(r)}const a=Object.assign(Object.assign({type:"select",prefix:null!==(r=s.prefix)&&void 0!==r?r:"",postfix:null!==(i=s.postfix)&&void 0!==i?i:""},this.toItemLeadHintInstruction(s)),{isExample:null!==(o=s.isExample)&&void 0!==o&&o,options:n});return a.lead||delete a.lead,a}createHighlightJson(e){var t,r,i,o,s;const n=e.data,a=[];for(const e of n.texts){const i=Object.assign(Object.assign({text:e.text,isCorrect:null!==(t=e.isCorrect)&&void 0!==t&&t,isHighlighted:null!==(r=e.isHighlighted)&&void 0!==r&&r},this.toItemLeadHintInstruction(e)),this.toExample(e,{defaultExample:!!e.isCorrect,isBoolean:!0}));i.item||delete i.item,i.lead||delete i.lead,i.hint||delete i.hint,i.isCaseSensitive||delete i.isCaseSensitive,a.push(i)}const l=Object.assign(Object.assign({type:"highlight",prefix:null!==(i=n.prefix)&&void 0!==i?i:"",postfix:null!==(o=n.postfix)&&void 0!==o?o:""},this.toItemLeadHintInstruction(n)),{isExample:null!==(s=n.isExample)&&void 0!==s&&s,texts:a});return l.lead||delete l.lead,l}parseResourceToJson(e){if(!e)return;let t;switch(e.type){case p.ResourceType.image:t={type:p.ResourceType.image,image:this.addImageResource(e)};break;case p.ResourceType.imageResponsive:{const r=e;null!=r.imagePortrait.value&&null!=r.imageLandscape.value&&(t={type:p.ResourceType.imageResponsive,imagePortrait:this.addImageResource(r.imagePortrait),imageLandscape:this.addImageResource(r.imageLandscape)});break}case p.ResourceType.imageLink:t={type:p.ResourceType.imageLink,imageLink:this.addImageLinkResource(e)};break;case p.ResourceType.audio:t={type:p.ResourceType.audio,audio:this.addAudioResource(e)};break;case p.ResourceType.audioEmbed:t={type:p.ResourceType.audioEmbed,audioEmbed:this.addAudioEmbedResource(e)};break;case p.ResourceType.audioLink:t={type:p.ResourceType.audioLink,audioLink:this.addAudioLinkResource(e)};break;case p.ResourceType.video:t={type:p.ResourceType.video,video:this.addVideoResource(e)};break;case p.ResourceType.videoEmbed:t={type:p.ResourceType.videoEmbed,videoEmbed:this.addVideoEmbedResource(e)},t.videoEmbed=this.addVideoLinkResource(e);break;case p.ResourceType.videoLink:t={type:p.ResourceType.videoLink,videoLink:this.addVideoLinkResource(e)};break;case p.ResourceType.stillImageFilm:{const r=e;null!=r.image.value&&null!=r.audio.value&&(t={type:p.ResourceType.stillImageFilm,image:this.addImageResource(r.image),audio:this.addAudioResource(r.audio)});break}case p.ResourceType.stillImageFilmEmbed:t={type:p.ResourceType.stillImageFilmEmbed,stillImageFilmEmbed:this.addStillImageFilmEmbedResource(e)};break;case p.ResourceType.stillImageFilmLink:t={type:p.ResourceType.stillImageFilmLink,stillImageFilmLink:this.addStillImageFilmLinkResource(e)};break;case p.ResourceType.article:t={type:p.ResourceType.article,article:this.addArticleResource(e)};break;case p.ResourceType.document:t={type:p.ResourceType.document,document:this.addDocumentResource(e)};break;case p.ResourceType.documentEmbed:t={type:p.ResourceType.documentEmbed,documentEmbed:this.addDocumentEmbedResource(e)};break;case p.ResourceType.documentLink:t={type:p.ResourceType.documentLink,documentLink:this.addDocumentLinkResource(e)};break;case p.ResourceType.documentDownload:t={type:p.ResourceType.documentDownload,documentDownload:this.addDocumentDownloadResource(e)};break;case p.ResourceType.appLink:t={type:p.ResourceType.appLink,appLink:this.addAppLinkResource(e)};break;case p.ResourceType.websiteLink:t={type:p.ResourceType.websiteLink,websiteLink:this.addWebsiteLinkResource(e)}}return t}addImageResource(e){var t,r,i;const o={};if(f.StringUtils.isString(e)){const t=e;e={type:p.ResourceType.image,typeAlias:p.ResourceType.image,value:t,format:b.UrlUtils.fileExtensionFromUrl(t),provider:b.UrlUtils.domainFromUrl(t)}}return null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.src=e.value),null!=e.src1x&&(o.src1x=e.src1x),null!=e.src2x&&(o.src2x=e.src2x),null!=e.src3x&&(o.src3x=e.src3x),null!=e.src4x&&(o.src4x=e.src4x),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,o.alt=null!==(i=e.alt)&&void 0!==i?i:"",this.addGenericResourceProperties(e,o),o}addImageLinkResource(e){var t,r,i;const o={};if(f.StringUtils.isString(e)){const t=e;e={type:p.ResourceType.imageLink,typeAlias:p.ResourceType.imageLink,value:t,format:b.UrlUtils.fileExtensionFromUrl(t),provider:b.UrlUtils.domainFromUrl(t)}}return null!=e.format&&(o.format=e.format),null!=e.provider&&(o.provider=e.provider),null!=e.value&&(o.url=e.value),null!=e.src1x&&(o.src1x=e.src1x),null!=e.src2x&&(o.src2x=e.src2x),null!=e.src3x&&(o.src3x=e.src3x),null!=e.src4x&&(o.src4x=e.src4x),o.width=null!==(t=e.width)&&void 0!==t?t:null,o.height=null!==(r=e.height)&&void 0!==r?r:null,o.alt=null!==(i=e.alt)&&void 0!==i?i:"",this.addGenericResourceProperties(e,o),o}addAudioResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.src=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t),t}addAudioEmbedResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.src=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t),t}addAudioLinkResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),null!=e.duration&&(t.duration=e.duration),null!=e.mute&&(t.mute=e.mute),null!=e.autoplay&&(t.autoplay=e.autoplay),this.addGenericResourceProperties(e,t,!0),t}addVideoResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.src=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addVideoEmbedResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.src=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addVideoLinkResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.url=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addStillImageFilmEmbedResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.url=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addStillImageFilmLinkResource(e){var t,r;const i={};if(null!=e.format&&(i.format=e.format),null!=e.provider&&(i.provider=e.provider),null!=e.value&&(i.url=e.value),i.width=null!==(t=e.width)&&void 0!==t?t:null,i.height=null!==(r=e.height)&&void 0!==r?r:null,null!=e.duration&&(i.duration=e.duration),null!=e.mute&&(i.mute=e.mute),null!=e.autoplay&&(i.autoplay=e.autoplay),null!=e.allowSubtitles&&(i.allowSubtitles=e.allowSubtitles),null!=e.showSubtitles&&(i.showSubtitles=e.showSubtitles),null!=e.alt&&(i.alt=e.alt),null!=e.posterImage&&(i.posterImage=this.addImageResource(e.posterImage)),null!=e.thumbnails&&e.thumbnails.length>0){i.thumbnails=[];for(const t of e.thumbnails)i.thumbnails.push(this.addImageResource(t))}return this.addGenericResourceProperties(e,i),i}addArticleResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.body=e.value),this.addGenericResourceProperties(e,t),t}addDocumentResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentEmbedResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentLinkResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addDocumentDownloadResource(e){const t={};return null!=e.format&&(t.format=e.format),null!=e.provider&&(t.provider=e.provider),null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addAppLinkResource(e){const t={};return null!=e.value&&(t.url=e.value),this.addGenericResourceProperties(e,t),t}addWebsiteLinkResource(e){const t={};return null!=e.value&&(t.url=e.value),null!=e.siteName&&(t.siteName=e.siteName),this.addGenericResourceProperties(e,t),t}addGenericResourceProperties(e,t,r){var i,o,s,n,a,l,u,c;return r?(null!=e.license&&(t.license=null!==(i=e.license)&&void 0!==i?i:""),null!=e.copyright&&(t.copyright=null!==(o=e.copyright)&&void 0!==o?o:""),null!=e.provider&&(t.provider=e.provider),null!=e.showInIndex&&(t.showInIndex=null!==(s=e.showInIndex)&&void 0!==s&&s),null!=e.caption&&(t.caption=this.toTextAstOrString(null!==(n=e.caption)&&void 0!==n?n:""))):(t.license=null!==(a=e.license)&&void 0!==a?a:"",t.copyright=null!==(l=e.copyright)&&void 0!==l?l:"",null!=e.provider&&(t.provider=e.provider),t.showInIndex=null!==(u=e.showInIndex)&&void 0!==u&&u,t.caption=this.toTextAstOrString(null!==(c=e.caption)&&void 0!==c?c:"")),t}toItemLeadHintInstruction(e){var t,r,i,o,s,n;return{item:this.toTextAstOrString(null!==(r=null===(t=e.itemLead)||void 0===t?void 0:t.item)&&void 0!==r?r:""),lead:this.toTextAstOrString(null!==(o=null===(i=e.itemLead)||void 0===i?void 0:i.lead)&&void 0!==o?o:""),hint:this.toTextAstOrString(null!==(s=e.hint)&&void 0!==s?s:""),instruction:this.toTextAstOrString(null!==(n=e.instruction)&&void 0!==n?n:"")}}toExample(e,t){const{isExample:r,example:i,isDefaultExample:o}=e,{defaultExample:s,isBoolean:n}=t;if(!r)return{isExample:!1,example:null};let a;return a=o?n?g.BooleanUtils.toBoolean(s):this.toTextAstOrString(s):n?g.BooleanUtils.toBoolean(i):this.toTextAstOrString(i),{isExample:!0,example:a}}addProperty(e,t,r,i){void 0!==r&&(Array.isArray(r)||(r=[r]),Array.isArray(r)&&r.length>0&&(i&&r.length>=1?e[t]=r[r.length-1]:e[t]=r))}getBitType(e){for(const t of e)if(t.key===n.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}getTextFormat(e){for(const t of e)if(t.key===n.NodeType.bitsValue){const e=t.value;return h.TextFormat.fromValue(null==e?void 0:e.textFormat)}}toTextAstOrString(e,t=h.TextFormat.bitmarkMinusMinus){if(this.options.textAsPlainText)return e;return this.textParser.toAst(e,{textFormat:t})}replacePlaceholderWithBodyBit(e,t,r){const i=(e,o,s)=>{if(Array.isArray(e))for(let t=0;t<e.length;t++){const r=e[t];if(i(r,e,t))return!0}else{if("bit"===e.type&&e.index===r)return o[s]=t,!0;if(e.content){if(i(e.content,e,"content"))return!0}}return!1};i(e,null,null)}writeInlineDebug(e,t){let r=e;t.open?r=`<${e}>`:t.close?r=`</${e}>`:t.single&&(r=`<${e} />`),this.writeString(r)}writeString(e){null!=e&&this.write(`${e}`)}createBitJson(e){return{type:e.bitType.alias,format:e.textFormat,id:void 0,externalId:void 0,spaceId:void 0,padletId:void 0,AIGenerated:void 0,releaseVersion:void 0,book:void 0,ageRange:void 0,language:void 0,computerLanguage:void 0,target:void 0,tag:void 0,icon:void 0,iconTag:void 0,colorTag:void 0,flashcardSet:void 0,subtype:void 0,coverImage:void 0,publisher:void 0,publications:void 0,author:void 0,subject:void 0,date:void 0,location:void 0,theme:void 0,kind:void 0,action:void 0,thumbImage:void 0,focusX:void 0,focusY:void 0,deeplink:void 0,externalLink:void 0,externalLinkText:void 0,videoCallLink:void 0,duration:void 0,list:void 0,textReference:void 0,isTracked:void 0,isInfoOnly:void 0,labelTrue:void 0,labelFalse:void 0,quotedPerson:void 0,partialAnswer:void 0,title:void 0,subtitle:void 0,level:void 0,toc:void 0,progress:void 0,anchor:void 0,reference:void 0,referenceEnd:void 0,item:void 0,lead:void 0,hint:void 0,instruction:void 0,isExample:void 0,example:void 0,partner:void 0,marks:void 0,extraProperties:void 0,body:void 0,resource:void 0,statement:void 0,isCorrect:void 0,sampleSolution:void 0,elements:void 0,statements:void 0,responses:void 0,quizzes:void 0,heading:void 0,pairs:void 0,matrix:void 0,choices:void 0,questions:void 0,placeholders:void 0,footer:void 0}}cleanAndSetDefaultsForBitJson(e){const t=a.BitTypeUtils.getBitType(e.type),r=this.options.textAsPlainText;switch(e.item||(e.item=void 0),t.root){case a.RootBitType._error:break;case a.RootBitType.article:case a.RootBitType.sampleSolution:null==e.body&&(e.body=this.bodyDefault);break;default:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.body&&(e.body=this.bodyDefault),t.alias!==a.AliasBitType.articleAi&&t.alias!==a.AliasBitType.noteAi&&t.alias!==a.AliasBitType.summaryAi||null==e.AIGenerated&&(e.AIGenerated=!0);break;case a.RootBitType.cloze:case a.RootBitType.multipleChoice1:case a.RootBitType.multipleResponse1:case a.RootBitType.multipleChoiceText:case a.RootBitType.highlightText:case a.RootBitType.clozeAndMultipleChoiceText:case a.RootBitType.sequence:case a.RootBitType.mark:case a.RootBitType.flashcard:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.multipleChoice:case a.RootBitType.multipleResponse:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault);break;case a.RootBitType.essay:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.body&&(e.body=this.bodyDefault),null==e.partialAnswer&&(e.partialAnswer="");break;case a.RootBitType.trueFalse1:null==e.item&&(e.item=this.textDefault),null==e.lead&&(e.lead=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.isCorrect&&(e.isCorrect=!1),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.trueFalse:null==e.item&&(e.item=this.textDefault),null==e.lead&&(e.lead=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.labelFalse&&(e.labelFalse=""),null==e.labelTrue&&(e.labelTrue=""),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.chapter:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.toc&&(e.toc=!0),null==e.progress&&(e.progress=!0),null==e.level&&(e.level=1),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.interview:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.instruction&&(e.instruction=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.body&&(e.body=this.bodyDefault),null==e.footer&&(e.footer=this.textDefault),null==e.questions&&(e.questions=[]);break;case a.RootBitType.match:null==e.item&&(e.item=this.textDefault),null==e.heading&&(e.heading={}),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.matchMatrix:null==e.item&&(e.item=this.textDefault),null==e.body&&(e.body=this.bodyDefault);break;case a.RootBitType.learningPathBook:case a.RootBitType.learningPathExternalLink:case a.RootBitType.learningPathVideoCall:null==e.item&&(e.item=this.textDefault),null==e.hint&&(e.hint=this.textDefault),null==e.isExample&&(e.isExample=!1),null==e.example&&(e.example=null),null==e.isTracked&&(e.isTracked=!0),null==e.isInfoOnly&&(e.isInfoOnly=!1),null==e.body&&(e.body=this.bodyDefault)}return null==e.id&&delete e.id,null==e.externalId&&delete e.externalId,null==e.spaceId&&delete e.spaceId,null==e.padletId&&delete e.padletId,null==e.AIGenerated&&delete e.AIGenerated,null==e.releaseVersion&&delete e.releaseVersion,null==e.book&&delete e.book,null==e.ageRange&&delete e.ageRange,null==e.language&&delete e.language,null==e.computerLanguage&&delete e.computerLanguage,null==e.target&&delete e.target,null==e.tag&&delete e.tag,null==e.icon&&delete e.icon,null==e.iconTag&&delete e.iconTag,null==e.colorTag&&delete e.colorTag,null==e.flashcardSet&&delete e.flashcardSet,null==e.subtype&&delete e.subtype,null==e.coverImage&&delete e.coverImage,null==e.publisher&&delete e.publisher,null==e.publications&&delete e.publications,null==e.author&&delete e.author,null==e.subject&&delete e.subject,null==e.date&&delete e.date,null==e.location&&delete e.location,null==e.theme&&delete e.theme,null==e.kind&&delete e.kind,null==e.action&&delete e.action,null==e.thumbImage&&delete e.thumbImage,null==e.deeplink&&delete e.deeplink,null==e.externalLink&&delete e.externalLink,null==e.externalLinkText&&delete e.externalLinkText,null==e.videoCallLink&&delete e.videoCallLink,null==e.duration&&delete e.duration,null==e.list&&delete e.list,null==e.textReference&&delete e.textReference,null==e.isTracked&&delete e.isTracked,null==e.isInfoOnly&&delete e.isInfoOnly,null==e.labelTrue&&delete e.labelTrue,null==e.labelFalse&&delete e.labelFalse,null==e.quotedPerson&&delete e.quotedPerson,null==e.title&&delete e.title,null==e.subtitle&&delete e.subtitle,null==e.level&&delete e.level,null==e.toc&&delete e.toc,null==e.progress&&delete e.progress,null==e.anchor&&delete e.anchor,null==e.reference&&delete e.reference,null==e.referenceEnd&&delete e.referenceEnd,null==e.item&&delete e.item,null==e.lead&&delete e.lead,null==e.hint&&delete e.hint,null==e.instruction&&delete e.instruction,void 0===e.example&&delete e.example,null==e.isExample&&delete e.isExample,null==e.marks&&delete e.marks,null==e.extraProperties&&delete e.extraProperties,null==e.body&&delete e.body,null!=e.placeholders&&0!==Object.keys(e.placeholders).length||delete e.placeholders,null==e.resource&&delete e.resource,null==e.statement&&delete e.statement,null==e.isCorrect&&delete e.isCorrect,null==e.sampleSolution&&delete e.sampleSolution,null==e.partialAnswer&&delete e.partialAnswer,null==e.elements&&delete e.elements,null==e.statements&&delete e.statements,null==e.responses&&delete e.responses,null==e.quizzes&&delete e.quizzes,null==e.heading&&delete e.heading,null==e.pairs&&delete e.pairs,null==e.matrix&&delete e.matrix,null==e.choices&&delete e.choices,null==e.questions&&delete e.questions,r&&null!=e.placeholders||delete e.placeholders,null==e.footer&&delete e.footer,e}write(e){return this.writer.write(e),this}writeLine(e){return this.writer.writeLine(e),this}writeLines(e,t){return this.writer.writeLines(e,t),this}writeWhiteSpace(){return this.writer.writeWhiteSpace(),this}}},4275:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonObjectGenerator=void 0;const o=r(227),s=r(3857);t.JsonObjectGenerator=class{constructor(e){this.writer=new o.StringWriter,this.generator=new s.JsonGenerator(this.writer,e)}generate(e){return i(this,void 0,void 0,(function*(){return yield this.generator.generate(e),JSON.parse(this.writer.getString())}))}generateSync(e){return this.generator.generateSync(e),JSON.parse(this.writer.getString())}}},5132:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonStringGenerator=void 0;const o=r(227),s=r(3857);t.JsonStringGenerator=class{constructor(e){this.writer=new o.StringWriter,this.generator=new s.JsonGenerator(this.writer,e)}generate(e){return i(this,void 0,void 0,(function*(){return yield this.generator.generate(e),this.writer.getString()}))}generateSync(e){return this.generator.generateSync(e),this.writer.getString()}}},6300:function(e,t,r){var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))((function(o,s){function n(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(n,a)}l((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.TextGenerator=void 0;const o=r(8256),s=r(549),n=r(8791),a=r(1353),l=r(1888),u=r(2610),c={debugGenerationInline:!1},d={[l.TextMarkType.bold]:"**",[l.TextMarkType.light]:"``",[l.TextMarkType.italic]:"__",[l.TextMarkType.highlight]:"!!"},p=new RegExp("([=*_`!])([\\^]*)\\1|([\\|\\[])","g"),h="$1$3^$2$1",y=new RegExp("^(\\||•|#)","gm"),m=new RegExp(/(\n|\r\n)/,"g"),g=new RegExp(/https?:\/\/|mailto:(.*)/,"g");t.TextGenerator=class{constructor(e,t){var r;this.ast=new o.Ast,this.textFormat=a.TextFormat.bitmarkMinusMinus,this.writerText="",this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.placeholderIndex=0,this.placeholders={},this.printed=!1,this.bitmarkVersion=null!==(r=n.BitmarkVersion.fromValue(e))&&void 0!==r?r:n.DEFAULT_BITMARK_VERSION,this.options=Object.assign(Object.assign({},c),t),this.bitmarkVersion,n.BitmarkVersion.v2,this.enter=this.enter.bind(this),this.between=this.between.bind(this),this.exit=this.exit.bind(this),this.leaf=this.leaf.bind(this)}generate(e,t){return i(this,void 0,void 0,(function*(){return this.resetState(t),this.walkAndWrite(e),this.writerText}))}generateSync(e,t){return this.resetState(t),this.walkAndWrite(e),this.writerText}getPlaceholders(){return this.placeholders}resetState(e){this.printed=!1,this.textFormat=null!=e?e:a.TextFormat.bitmarkMinusMinus,this.writerText="",this.currentIndent=0,this.prevIndent=0,this.indentationStringCache="",this.inCodeBlock=!1,this.exitedCodeBlock=!1,this.placeholderIndex=0,this.placeholders={}}walkAndWrite(e){this.ast.walk(e,s.NodeType.textAst,this,void 0)}enter(e,t,r){let i;const o=this,s=`enter_${e.key}`;return this.printed||(this.printed=!0),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof o[s]&&(i=o[s](e,t,r)),i}between(e,t,r,i,o){let s;const n=this,a=`between_${e.key}`;return this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{single:!0}),"function"==typeof n[a]&&(s=n[a](e,t,r,i,o)),s}exit(e,t,r){const i=this,o=`exit_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0}),"function"==typeof i[o]&&i[o](e,t,r)}leaf(e,t,r){const i=this,o=`leaf_${e.key}`;this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{open:!0}),"function"==typeof i[o]&&i[o](e,t,r),this.options.debugGenerationInline&&this.writeInlineDebug(e.key,{close:!0})}enter_textAstValue(e,t,r){this.handleEnterNode(e.value)}between_textAstValue(e,t,r,i,o){this.handleBetweenNode(e.value)}exit_textAstValue(e,t,r){this.handleExitNode(e.value)}enter_contentValueValue(e,t,r){this.handleEnterNode(e.value)}between_contentValueValue(e,t,r,i,o){this.handleBetweenNode(e.value)}exit_contentValueValue(e,t,r){this.handleExitNode(e.value)}handleEnterNode(e){switch(this.handleIndent(e),e.type){case u.TextNodeType.paragraph:this.writeParagraph(e);break;case u.TextNodeType.hardBreak:this.writeHardBreak(e);break;case u.TextNodeType.text:this.writeMarks(e,!0),this.writeText(e);break;case u.TextNodeType.heading:this.writeHeading(e);break;case u.TextNodeType.section:this.writeSection(e);break;case u.TextNodeType.listItem:case u.TextNodeType.taskItem:this.writeBullet(e);break;case u.TextNodeType.image:this.writeImage(e);break;case u.TextNodeType.codeBlock:this.inCodeBlock=!0,this.writeCodeBlock(e);break;case u.TextNodeType.gap:case u.TextNodeType.select:case u.TextNodeType.highlight:this.writeBodyBit(e)}this.exitedCodeBlock=!1}handleBetweenNode(e){e.type}handleExitNode(e){switch(e.type){case u.TextNodeType.text:this.writeMarks(e,!1);break;case u.TextNodeType.paragraph:this.textFormat!==a.TextFormat.bitmarkMinusMinus&&this.writeNL();break;case u.TextNodeType.heading:case u.TextNodeType.section:case u.TextNodeType.image:this.writeNL(),this.writeNL();break;case u.TextNodeType.codeBlock:this.writeNL(),this.writeNL(),this.inCodeBlock=!1,this.exitedCodeBlock=!0;break;case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent<=1&&this.writeNL()}this.handleDedent(e)}handleIndent(e){switch(e.type){case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent++}}handleDedent(e){switch(e.type){case u.TextNodeType.bulletList:case u.TextNodeType.orderedList:case u.TextNodeType.taskList:this.currentIndent--}}getLinkHref(e){if(e.type===u.TextNodeType.text&&e.marks){const t=e.marks.reduce(((e,t)=>{var r;if(t.type===l.TextMarkType.link){const e=null===(r=t.attrs)||void 0===r?void 0:r.href;if(e)return e}return e}),"");if(t)return t}return!1}getIndentationString(){if(this.currentIndent===this.prevIndent)return this.indentationStringCache;let e="";for(let t=1;t<this.currentIndent;t++)e+="\t";return this.indentationStringCache=e,this.prevIndent=this.currentIndent,e}writeBodyBit(e){const t=`[!${this.placeholderIndex}]`;this.writerText+=t,this.placeholders[t]=e,this.placeholderIndex++}writeText(e){if(null==e.text)return;if(this.writeLink(e))return;const t=this.inCodeBlock;let r=e.text;if(r=t?r.replace(y,"$1^"):r.replace(p,h),this.currentIndent>1){const e=this.getIndentationString();r=r.replace(m,`$1${e}`)}this.write(r)}writeLink(e){if(null==e.text)return!1;const t=this.getLinkHref(e);if(t){let r=e.text.replace(p,h);if(this.currentIndent>1){const e=this.getIndentationString();r=r.replace(m,`$1${e}`)}return t.replace(g,"$1")===r?this.write(t):(r=`==${r}==|link:${t}|`,this.write(r)),!0}return!1}writeMarks(e,t){if(e.marks){const r=1===e.marks.length,i=e.marks.reduce(((e,t)=>{if(e)return e;switch(t.type){case l.TextMarkType.bold:case l.TextMarkType.light:case l.TextMarkType.italic:case l.TextMarkType.highlight:return r?d[t.type]:"==";case l.TextMarkType.strike:case l.TextMarkType.sub:case l.TextMarkType.super:case l.TextMarkType.ins:case l.TextMarkType.del:case l.TextMarkType.var:case l.TextMarkType.code:case l.TextMarkType.color:case l.TextMarkType.comment:return"==";case l.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 l.TextMarkType.bold:case l.TextMarkType.light:case l.TextMarkType.italic:case l.TextMarkType.highlight:r||(this.writeInlineMarkStartEnd(),this.writeInlineMark(i),t=!0);break;case l.TextMarkType.strike:case l.TextMarkType.sub:case l.TextMarkType.super:case l.TextMarkType.ins:case l.TextMarkType.del:case l.TextMarkType.var:case l.TextMarkType.code:case l.TextMarkType.color:this.writeInlineMarkStartEnd(),this.writeInlineMark(i),t=!0;break;case l.TextMarkType.comment:this.writeInlineMarkStartEnd(),this.writeCommentMark(i),t=!0;case l.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===u.TextNodeType.bulletList)i+="• ";else if(e.parent===u.TextNodeType.orderedList)i+="•1 ";else if(e.parent===u.TextNodeType.taskList){i+=null!==(r=null===(t=e.attrs)||void 0===t?void 0:t.checked)&&void 0!==r&&r?"•+ ":"•- "}i&&this.write(i)}writeImage(e){if(null==e.attrs||!e.attrs.src)return;const t=e.attrs;let r=`|image:${t.src}|`;for(const[e,i]of Object.entries(t))switch(e){case"textAlign":"left"!==i&&(r+=`@captionAlign:${i}|`);break;case"title":i&&(r+=`@caption:${i}|`);break;case"class":"center"!==i&&i&&(r+=`@align:${i}|`);break;case"comment":i&&(r+=`#${i}|`);break;case"alt":case"width":case"height":default:i&&(r+=`@${e}:${i}|`);case"src":}this.write(r)}writeCodeBlock(e){if(null==e.attrs||!e.attrs.language)return;const t=`|code:${e.attrs.language}\n`;this.write(t)}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===s.NodeType.bitsValue){const e=t.value;return null==e?void 0:e.bitType}}write(e){return this.writerText+=e,this}writeLine(e){return this.write(`${e}\n`),this}writeLines(e,t){for(const r of e)this.write(`${r}${null!=t?t:""}\n`);return this}writeWhiteSpace(){return this.write(" "),this}}},7087:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;const i=r(1022),o=r(671);r(2093);let s=!1;t.init=function(){s||((0,o.initEnv)(i.buildInfo.name,i.buildInfo.version),s=!0)}},549:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NodeType=void 0;const i=(0,r(6688).superenum)({unknown:"unknown",bitType:"bitType",alias:"alias",root:"root",textFormat:"textFormat",bitmarkAst:"bitmarkAst",bits:"bits",bitsValue:"bitsValue",properties:"properties",property:"property",propertyValues:"propertyValues",itemLead:"itemLead",body:"body",bodyParts:"bodyParts",bodyPartsValue:"bodyPartsValue",bodyPartText:"bodyPartText",data:"data",bodyText:"bodyText",footer:"footer",footerText:"footerText",gap:"gap",select:"select",highlight:"highlight",cardNode:"cardNode",elements:"elements",solutions:"solutions",options:"options",optionsValue:"optionsValue",texts:"texts",textsValue:"textsValue",statement:"statement",statements:"statements",statementsValue:"statementsValue",choices:"choices",choicesValue:"choicesValue",responses:"responses",responsesValue:"responsesValue",quizzes:"quizzes",quizzesValue:"quizzesValue",heading:"heading",forValues:"forValues",pairs:"pairs",pairsValue:"pairsValue",values:"values",matrix:"matrix",matrixValue:"matrixValue",cells:"cells",cellsValue:"cellsValue",questions:"questions",questionsValue:"questionsValue",botResponses:"botResponses",botResponsesValue:"botResponsesValue",id:"id",idValue:"idValue",externalId:"externalId",externalIdValue:"externalIdValue",spaceId:"spaceId",spaceIdValue:"spaceIdValue",releaseVersion:"releaseVersion",releaseVersionValue:"releaseVersionValue",padletId:"padletId",padletIdValue:"padletIdValue",aiGenerated:"aiGenerated",aiGeneratedValue:"aiGeneratedValue",ageRange:"ageRange",ageRangeValue:"ageRangeValue",language:"language",languageValue:"languageValue",computerLanguage:"computerLanguage",computerLanguageValue:"computerLanguageValue",target:"target",targetValue:"targetValue",tag:"tag",tagValue:"tagValue",icon:"icon",iconValue:"iconValue",iconTag:"iconTag",iconTagValue:"iconTagValue",colorTag:"colorTag",colorTagValue:"colorTagValue",flashcardSet:"flashcardSet",flashcardSetValue:"flashcardSetValue",subtype:"subtype",subtypeValue:"subtypeValue",coverImage:"coverImage",coverImageValue:"coverImageValue",publisher:"publisher",publisherValue:"publisherValue",publications:"publications",publicationsValue:"publicationsValue",author:"author",authorValue:"authorValue",subject:"subject",subjectValue:"subjectValue",date:"date",dateValue:"dateValue",location:"location",locationValue:"locationValue",theme:"theme",themeValue:"themeValue",kind:"kind",kindValue:"kindValue",action:"action",actionValue:"actionValue",thumbImage:"thumbImage",thumbImageValue:"thumbImageValue",focusX:"focusX",focusXValue:"focusXValue",focusY:"focusY",focusYValue:"focusYValue",duration:"duration",durationValue:"durationValue",deeplink:"deeplink",deeplinkValue:"deeplinkValue",externalLink:"externalLink",externalLinkText:"externalLinkText",videoCallLink:"videoCallLink",videoCallLinkValue:"videoCallLinkValue",bot:"bot",botValue:"botValue",referenceProperty:"referenceProperty",referencePropertyValue:"referencePropertyValue",list:"list",listValue:"listValue",textReference:"textReference",textReferenceValue:"textReferenceValue",isTracked:"isTracked",isTrackedValue:"isTrackedValue",isInfoOnly:"isInfoOnly",isInfoOnlyValue:"isInfoOnlyValue",labelTrue:"labelTrue",labelFalse:"labelFalse",quotedPerson:"quotedPerson",partialAnswer:"partialAnswer",partialAnswerValue:"partialAnswerValue",book:"book",item:"item",lead:"lead",hint:"hint",instruction:"instruction",isDefaultExample:"isDefaultExample",isExample:"isExample",example:"example",exampleValue:"exampleValue",extraProperties:"extraProperties",title:"title",subtitle:"subtitle",level:"level",toc:"toc",tocValue:"tocValue",progress:"progress",progressValue:"progressValue",levelProperty:"levelProperty",levelPropertyValue:"LevelPropertyValue",anchor:"anchor",reference:"reference",referenceEnd:"referenceEnd",elementsValue:"elementsValue",solutionsValue:"solutionsValue",prefix:"prefix",postfix:"postfix",isCaseSensitive:"isCaseSensitive",isShortAnswer:"isShortAnswer",isCorrect:"isCorrect",forKeys:"forKeys",forValuesValue:"forValuesValue",key:"key",valuesValue:"valuesValue",question:"question",sampleSolution:"sampleSolution",sampleSolutionValue:"sampleSolutionValue",statementText:"statementText",text:"text",propertyKey:"propertyKey",propertyValue:"propertyValue",keyAudio:"keyAudio",keyImage:"keyImage",response:"response",reaction:"reaction",feedback:"feedback",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",resource:"resource",resourceType:"resourceType",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",license:"license",copyright:"copyright",provider:"provider",showInIndex:"showInIndex",caption:"caption",posterImage:"posterImage",thumbnails:"thumbnails",thumbnailsValue:"thumbnailsValue",textAst:"textAst",textAstValue:"textAstValue",content:"contentValue",contentValue:"contentValue",contentValueValue:"contentValueValue",attrs:"attrs",section:"section",parent:"parent",marks:"marks",marksValue:"marksValue",comment:"comment",parser:"parser",version:"version",bitmarkVersion:"bitmarkVersion",warnings:"warnings",warningsValue:"warningsValue",errors:"errors",errorsValue:"errorsValue",message:"message",start:"start",end:"end",offset:"offset",line:"line",column:"column",markup:"markup"});t.NodeType=i},9881:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INFINITE_COUNT=void 0;t.INFINITE_COUNT=-1},208:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitTypeUtils=t.AliasBitType=t.RootBitType=void 0;const i=r(6688),o=(0,i.superenum)({_error:"_error",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",botActionResponse:"bot-action-response",botActionSend:"bot-action-send",browserImage:"browser-image",card1:"card-1",chapter:"chapter",cloze:"cloze",clozeAndMultipleChoiceText:"cloze-and-multiple-choice-text",code:"code",conversationLeft1:"conversation-left-1",document:"document",documentDownload:"document-download",documentEmbed:"document-embed",documentLink:"document-link",essay:"essay",example:"example",flashcard:"flashcard",focusImage:"focus-image",highlightText:"highlight-text",image:"image",imageLink:"image-link",imageOnDevice:"image-on-device",imageResponsive:"image-responsive",internalLink:"internal-link",interview:"interview",learningPathBook:"learning-path-book",learningPathExternalLink:"learning-path-external-link",learningPathVideoCall:"learning-path-video-call",mark:"mark",match:"match",matchAudio:"match-audio",matchMatrix:"match-matrix",matchPicture:"match-picture",multipleChoice:"multiple-choice",multipleChoice1:"multiple-choice-1",multipleChoiceText:"multiple-choice-text",multipleResponse:"multiple-response",multipleResponse1:"multiple-response-1",photo:"photo",quote:"quote",rating:"rating",releaseNote:"release-note",sampleSolution:"sample-solution",sequence:"sequence",stillImageFilm:"still-image-film",stillImageFilmEmbed:"still-image-film-embed",stillImageFilmLink:"still-image-film-link",survey:"survey",surveyAnonymous:"survey-anonymous",toc:"toc",trueFalse:"true-false",trueFalse1:"true-false-1",vendorPadletEmbed:"vendor-padlet-embed",video:"video",videoEmbed:"video-embed",videoLink:"video-link",websiteLink:"website-link"});t.RootBitType=o;const s=(0,i.superenum)({aiPrompt:"ai-prompt",anchor:"anchor",appAiPrompt:"app-ai-prompt",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",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",chapterSubjectMatter:"chapter-subject-matter",chat:"chat",checklist:"checklist",clozeInstructionGrouped:"cloze-instruction-grouped",clozeSolutionGrouped:"cloze-solution-grouped",coachAudioTranscript:"coach-audio-transcript",coachCallToActionChecklist:"coach-call-to-action-checklist",coachCallToActionCloze:"coach-call-to-action-cloze",coachCallToActionClozeAndMultipleChoiceText:"coach-call-to-action-cloze-and-multiple-choice-text",coachCallToActionEssay:"coach-call-to-action-essay",coachCallToActionMultipleChoiceText:"coach-call-to-action-multiple-choice-text",coachHomeRules:"coach-home-rules",coachSelfReflectionCloze:"coach-self-reflection-cloze",coachSelfReflectionEssay:"coach-self-reflection-essay",coachSelfReflectionMultipleChoice:"coach-self-reflection-multiple-choice",coachSelfReflectionMultipleChoice1:"coach-self-reflection-multiple-choice-1",coachSelfReflectionMultipleChoiceText:"coach-self-reflection-multiple-choice-text",coachSelfReflectionMultipleResponse:"coach-self-reflection-multiple-response",coachSelfReflectionMultipleResponse1:"coach-self-reflection-multiple-response-1",coachSelfReflectionRating:"coach-self-reflection-rating",coachVideoTranscript:"coach-video-transcript",conclusion:"conclusion",conversationLeft1Scream:"conversation-left-1-scream",conversationLeft1Thought:"conversation-left-1-thought",conversationRight1:"conversation-right-1",conversationRight1Scream:"conversation-right-1-scream",conversationRight1Thought:"conversation-right-1-thought",cookArrangement:"cook-arrangement",cookIngredients:"cook-ingredients",cookInsert:"cook-insert",cookPersonalRecommendation:"cook-personal-recommendation",cookPlate:"cook-plate",cookPracticeAdvise:"cook-practice-advise",cookPreparation:"cook-preparation",cookRecommendation:"cook-recommendation",cookRemark:"cook-remark",cookSideDish:"cook-side-dish",cookSideDrink:"cook-side-drink",cookStep:"cook-step",cookTimer:"cook-timer",cookVariation:"cook-variation",correction:"correction",danger:"danger",details:"details",details1:"details-1",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",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",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",matchAll:"match-all",matchAllReverse:"match-all-reverse",matchReverse:"match-reverse",matchSolutionGrouped:"match-solution-grouped",message:"message",newspaperArticle:"newspaper-article",note:"note",noteAi:"note-ai",notebookArticle:"notebook-article",page:"page",preparationNote:"preparation-note",question1:"question-1",recordAudio:"record-audio",releaseNotesSummary:"release-notes-summary",remark:"remark",reviewApprovedNote:"review-approved-note",reviewAuthorNote:"review-author-note",reviewNote:"review-note",reviewRequestForReviewNote:"review-request-for-review-note",reviewReviewerNote:"review-reviewer-note",screenshot:"screenshot",selfAssessment:"self-assessment",sideNote:"side-note",statement:"statement",stickyNote:"sticky-note",summary:"summary",summaryAi:"summary-ai",survey1:"survey-1",surveyAnonymous1:"survey-anonymous-1",takePicture:"take-picture",videoLandscape:"video-landscape",videoPortrait:"video-portrait",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=s;const n={[o.appFlashcards]:[s.appFlashcardsQuiz,s.appFlashcardsLearn],[o.article]:[s.page,s.statement],[o.book]:[s.bookAcknowledgments,s.bookAddendum,s.bookAfterword,s.bookAppendix,s.bookArticle,s.bookAutherBio,s.bookBibliography,s.bookComingSoon,s.bookConclusion,s.bookCopyright,s.bookCopyrightPermissions,s.bookDedication,s.bookEndnotes,s.bookEpigraph,s.bookEpilogue,s.bookForword,s.bookFrontispiece,s.bookImprint,s.bookIncitingIncident,s.bookIntroduction,s.bookListOfContributors,s.bookNotes,s.bookPostscript,s.bookPreface,s.bookPrologue,s.bookReadMore,s.bookReferenceList,s.bookRequestForABookReview,s.bookSummary,s.bookTeaser,s.bookTitle],[o.cloze]:[s.clozeInstructionGrouped,s.clozeSolutionGrouped,s.coachSelfReflectionCloze,s.coachCallToActionCloze],[o.clozeAndMultipleChoiceText]:[s.coachCallToActionClozeAndMultipleChoiceText],[o.conversationLeft1]:[s.conversationLeft1Scream,s.conversationLeft1Thought,s.conversationRight1,s.conversationRight1Scream,s.conversationRight1Thought],[o.essay]:[s.coachSelfReflectionEssay,s.coachCallToActionEssay],[o.example]:[s.appAiPrompt,s.aiPrompt,s.articleAi,s.articleAttachment,s.assignment,s.audioTranscript,s.bitmarkExample,s.blogArticle,s.bug,s.checklist,s.coachAudioTranscript,s.coachCallToActionChecklist,s.coachHomeRules,s.coachVideoTranscript,s.correction,s.cookPreparation,s.cookStep,s.cookIngredients,s.cookRemark,s.cookVariation,s.cookInsert,s.cookArrangement,s.cookPracticeAdvise,s.cookPlate,s.cookRecommendation,s.cookPersonalRecommendation,s.cookSideDrink,s.cookSideDish,s.cookTimer,s.danger,s.details1,s.details,s.editorial,s.editorNote,s.featured,s.help,s.hint,s.info,s.langLearningOutcomes,s.langEnablingLanguageSkills,s.langLifeSkills,s.langEnglishAroundWorld,s.langGoodToKnow,s.langLearningGoal,s.langLearningStrategy,s.langLikeALocal,s.langMaterial,s.langUsefulPhrases,s.langLevelDown,s.langLevelUp,s.langExtraActivity,s.langVideoScript,s.langAudioScript,s.langVocabulary,s.langHomework,s.langTeacherNote,s.langTeacherPronunciation,s.message,s.newspaperArticle,s.note,s.noteAi,s.notebookArticle,s.preparationNote,s.releaseNotesSummary,s.remark,s.reviewNote,s.reviewAuthorNote,s.reviewReviewerNote,s.reviewRequestForReviewNote,s.reviewApprovedNote,s.selfAssessment,s.sideNote,s.summary,s.summaryAi,s.videoTranscript,s.warning,s.workbookArticle],[o.flashcard]:[s.flashcard1],[o.image]:[s.appCreateBitsFromImage,s.appGetScreenshot,s.detailsImage,s.figure,s.imageBanner,s.imageFigure,s.imageLandscape,s.imageMood,s.imagePortrait,s.imagePrototype,s.imageScreenshot,s.imageStyled,s.imageSuperWide,s.imageZoom,s.langLifeSkillIcon,s.lifeSkillSticker,s.screenshot],[o.interview]:[s.interviewInstructionGrouped,s.botInterview],[o.learningPathBook]:[s.bookLink,s.bookLinkNext,s.bookLinkPrev,s.learningPathBotTraining,s.learningPathClassroomEvent,s.learningPathClassroomTraining,s.learningPathClosing,s.learningPathFeedback,s.learningPathLearningGoal,s.learningPathLti,s.learningPathSign,s.learningPathStep],[o.card1]:[s.question1,s.survey1,s.surveyAnonymous1],[o.match]:[s.matchAll,s.matchReverse,s.matchAllReverse,s.matchSolutionGrouped],[o.multipleChoice1]:[s.coachSelfReflectionMultipleChoice1],[o.multipleChoice]:[s.coachSelfReflectionMultipleChoice],[o.multipleChoiceText]:[s.coachCallToActionMultipleChoiceText,s.coachSelfReflectionMultipleChoiceText],[o.multipleResponse1]:[s.coachSelfReflectionMultipleResponse1],[o.multipleResponse]:[s.coachSelfReflectionMultipleResponse],[o.rating]:[s.coachSelfReflectionRating],[o.toc]:[s.anchor,s.bitBookEnding,s.bitBookSummary,s.botActionAnnounce,s.botActionRatingNumber,s.botActionRemind,s.botActionSave,s.botActionTrueFalse,s.chapterSubjectMatter,s.chat,s.conclusion,s.documentUpload,s.footNote,s.groupBorn,s.groupDied,s.recordAudio,s.stickyNote,s.takePicture],[o.video]:[s.videoLandscape,s.videoPortrait],[o.videoEmbed]:[s.videoEmbedLandscape,s.videoEmbedPortrait],[o.videoLink]:[s.videoLinkLandscape,s.videoLinkPortrait]},a=new Map;class l{static getBitType(e){const t=l.getAliasedBitType(e);return{alias:t,root:l.getRootBitType(t)}}static getRootBitType(e){var t;return e&&null!==(t=a.get(e))&&void 0!==t?t:o._error}static getAliasedBitType(e){var t,r;return null!==(r=null!==(t=s.fromValue(e))&&void 0!==t?t:o.fromValue(e))&&void 0!==r?r:o._error}}t.BitTypeUtils=l,function(){for(const e of o.values())a.set(e,e);for(const[e,t]of Object.entries(n))for(const r of t)a.set(r,e)}()},6958:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParserType=void 0;const i=(0,r(6688).superenum)({peggy:"peggy"});t.BitmarkParserType=i},8791:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_BITMARK_VERSION=t.BitmarkVersion=void 0;const i=(0,r(6688).superenum)({v2:2,v3:3});t.BitmarkVersion=i;const o=i.v3;t.DEFAULT_BITMARK_VERSION=o},1060:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BodyBitType=void 0;const i=(0,r(6688).superenum)({text:"text",gap:"gap",mark:"mark",select:"select",highlight:"highlight"});t.BodyBitType=i},7210:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetType=void 0;const i=(0,r(6688).superenum)({flashcards:"flashcards",elements:"elements",statements:"statements",quiz:"quiz",questions:"questions",matchPairs:"matchPairs",matchMatrix:"matchMatrix",botActionResponses:"botActionResponses"});t.CardSetType=i},8565:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardSetVersion=void 0;const i=(0,r(6688).superenum)({v1:1,v2:2});t.CardSetVersion=i},7028:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExampleType=void 0;const i=(0,r(6688).superenum)({none:"none",string:"string",boolean:"boolean"});t.ExampleType=i},4719:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropertyKey=void 0;const i=(0,r(6688).superenum)({id:"id",externalId:"externalId",spaceId:"spaceId",padletId:"padletId",aiGenerated:"AIGenerated",releaseVersion:"releaseVersion",ageRange:"ageRange",language:"language",computerLanguage:"computerLanguage",target:"target",tag:"tag",icon:"icon",iconTag:"iconTag",colorTag:"colorTag",flashcardSet:"flashcardSet",subtype:"subtype",coverImage:"coverImage",publisher:"publisher",publications:"publications",author:"author",subject:"subject",date:"date",location:"location",theme:"theme",kind:"kind",action:"action",thumbImage:"thumbImage",focusX:"focusX",focusY:"focusY",deeplink:"deeplink",externalLink:"externalLink",externalLinkText:"externalLinkText",videoCallLink:"videoCallLink",bot:"bot",duration:"duration",reference:"reference",list:"list",textReference:"textReference",isTracked:"isTracked",isInfoOnly:"isInfoOnly",labelTrue:"labelTrue",labelFalse:"labelFalse",quotedPerson:"quotedPerson",partialAnswer:"partialAnswer",example:"example",toc:"toc",progress:"progress",level:"level",book:"book",partner:"partner",sampleSolution:"sampleSolution",mark:"mark",type:"type",color:"color",emphasis:"emphasis",shortAnswer:"shortAnswer",longAnswer:"longAnswer",caseSensitive:"caseSensitive",reaction:"reaction",imageSource:"imageSource",mockupId:"mockupId",size:"size",format:"format",trim:"trim",width:"width",height:"height",license:"license",copyright:"copyright",caption:"caption",showInIndex:"showInIndex",alt:"alt",src1x:"src1x",src2x:"src2x",src3x:"src3x",src4x:"src4x",mute:"mute",autoplay:"autoplay",allowSubtitles:"allowSubtitles",showSubtitles:"showSubtitles",siteName:"siteName",posterImage:"posterImage"});t.PropertyKey=i},1895:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceType=void 0;const i=(0,r(6688).superenum)({unknown:"unknown",image:"image",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.ResourceType=i},6562:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TagType=void 0;const i=(0,r(6688).superenum)({Title:"Title",Anchor:"Anchor",Reference:"Reference",Property:"Property",ItemLead:"ItemLead",Instruction:"Instruction",Hint:"Hint",True:"True",False:"False",SampleSolution:"SampleSolution",Gap:"Gap",Mark:"Mark",Resource:"Resource",Remark:"Remark",Comment:"Comment"});t.TagType=i},1353:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextFormat=void 0;const i=(0,r(6688).superenum)({text:"text",bitmarkMinusMinus:"bitmark--",bitmarkPlusPlus:"bitmark++"});t.TextFormat=i},1888:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextMarkType=void 0;const i=(0,r(6688).superenum)({bold:"bold",light:"light",italic:"italic",highlight:"highlight",strike:"strike",sub:"sub",super:"super",ins:"ins",del:"del",link:"link",var:"var",code:"code",color:"color",hash:"#",comment:"comment"});t.TextMarkType=i},2610:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextNodeType=void 0;const i=(0,r(6688).superenum)({text:"text",hardBreak:"hardBreak",paragraph:"paragraph",heading:"heading",section:"section",bulletList:"bulletList",orderedList:"orderedList",taskList:"taskList",listItem:"listItem",taskItem:"taskItem",image:"image",codeBlock:"codeBlock",gap:"gap",select:"select",highlight:"highlight"});t.TextNodeType=i},9556:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkParser=void 0;const i=r(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),s=r(7542),n=r(6831);r(2093);t.BitmarkPegParserHelper=class{constructor(e){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0,this.parse=e.parse,this.parserText=e.parserText,this.parserLocation=e.parserLocation}handleRawBit(e){var t,r;const i=e.trim();if(this.debugPrint("RAW BIT",i),!i)return;const o=null!==(r=null===(t=this.parserLocation())||void 0===t?void 0:t.start)&&void 0!==r?r:{line:1,column:1,offset:0},n=this.parse(e,{startRule:"bit",grammarSource:new s.PeggyGrammarLocation("bit",o)});return n.value&&(n.value.markup=i),n}handleTextFormat(e){return{type:n.TypeKey.TextFormat,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceType(e){return{type:n.TypeKey.ResourceType,value:e,parser:{text:this.parserText(),location:this.parserLocation()}}}handleBitContent(e){let t=this.reduceToArrayOfTypes(e);return t=this.mergeCharToText(t),t}handleBitTag(e){return e}handleTag(e,t){return{type:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handlePropertyTag(e,t){return{type:n.TypeKey.Property,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleResourceTag(e,t){return{type:n.TypeKey.Resource,key:e,value:t,parser:{text:this.parserText(),location:this.parserLocation()}}}handleTagChain(e){const t=this.reduceToArrayOfTypes(e);let r=t;if(t.length>1){const e=t[0];e.chain=t.slice(1),r=[e]}return r}handleCardSet(e){const t=e,r={cards:[]},i={cards:[]};if(t){const e={text:this.parserText(),location:this.parserLocation()};for(const e of t){if(!e)continue;const{type:t,value:i,parser:o}=e;if(!t||t!==n.TypeKey.Card)continue;const{cardIndex:s,cardSideIndex:a,cardVariantIndex:l,value:u}=i;let c=r.cards[s];c||(c={sides:[]},r.cards[s]=c);let d=c.sides[a];d||(d={variants:[]},c.sides[a]=d);d.variants[l]?d.variants[l].value+=u:d.variants[l]={value:u,parser:o}}r.cards=r.cards.filter((e=>e.sides.some((e=>e.variants.some((e=>0!==o.StringUtils.trimmedString(e.value).length))))));for(const t of r.cards){const r={sides:[]};i.cards.push(r);for(const i of t.sides){const t={variants:[]};r.sides.push(t);for(const r of i.variants){let i={line:1,column:1,offset:0};if(r.parser.location){i=r.parser.location.start;const e=r.parser.text,t=e?e.length:0,o=1;i.offset+=t,i.line+=o}let o=this.parse(r.value,{startRule:"cardContent",grammarSource:new s.PeggyGrammarLocation("card-content",i)});o=this.reduceToArrayOfTypes(o),this.debugPrint("parsedCardContent",o),t.variants.push({parser:e,content:o})}}}}return{type:n.TypeKey.CardSet,value:i,parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardSetStart(){this.cardIndex=-1,this.cardSideIndex=0,this.cardVariantIndex=0}handleCardSetEnd(){this.cardIndex=0,this.cardSideIndex=0,this.cardVariantIndex=0}handleCards(e){return e}handleCardLineOrDivider(e,t){let r=!1,o=!1,s=!1;return Array.isArray(e)&&2===e.length&&(e=e[0],t===i.CardSetVersion.v1?(r=e===n.CARD_DIVIDER_V1,o=e===n.CARD_SIDE_DIVIDER_V1,s=e===n.CARD_VARIANT_DIVIDER_V1):(r=e===n.CARD_DIVIDER_V2,o=e===n.CARD_SIDE_DIVIDER_V2,s=e===n.CARD_VARIANT_DIVIDER_V2)),r?(this.cardIndex++,this.cardSideIndex=0,this.cardVariantIndex=0):o?(this.cardSideIndex++,this.cardVariantIndex=0):s&&this.cardVariantIndex++,this.isType(e,n.TypeKey.Card)?e:{type:n.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:""},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardLine(e){return{type:n.TypeKey.Card,value:{cardIndex:this.cardIndex,cardSideIndex:this.cardSideIndex,cardVariantIndex:this.cardVariantIndex,value:e},parser:{text:this.parserText(),location:this.parserLocation()}}}handleCardContent(e){return this.mergeCharToText(e)}handleCardTags(e){return e}mergeCharToText(e){var t,r,i,o,s,a;const l=[];let u,c;for(const d of e)switch(d.type){case n.TypeKey.BodyChar:if(u){const e=`${null!==(t=u.value)&&void 0!==t?t:""}${null!==(r=d.value)&&void 0!==r?r:""}`;u.value=e}else u={type:n.TypeKey.BodyText,value:null!==(i=d.value)&&void 0!==i?i:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;case n.TypeKey.CardChar:if(c){const e=`${null!==(o=c.value)&&void 0!==o?o:""}${null!==(s=d.value)&&void 0!==s?s:""}`;c.value=e}else c={type:n.TypeKey.CardText,value:null!==(a=d.value)&&void 0!==a?a:"",parser:{text:this.parserText(),location:this.parserLocation()}};break;default:u&&(l.push(u),u=void 0),c&&(l.push(c),c=void 0),l.push(d)}return u&&l.push(u),c&&l.push(c),l}isType(e,t){if(!e)return!1;const{type:r}=e;return t?Array.isArray(t)?t.indexOf(r)>=0:t===r:!!n.TypeKey.fromValue(r)}reduceToArrayOfTypes(e,t,r){if(!Array.isArray(e))return[];return e.reduce(((e,i,o)=>{if(null==i)return e;const{type:s,value:n}=i;if(Array.isArray(i)){const r=this.reduceToArrayOfTypes(i,t);e.push(...r)}else{if(!this.isType(i,t))return e;if(r&&Array.isArray(n)){const r=this.reduceToArrayOfTypes(n,t);e.push(...r)}else s&&e.push(i)}return e}),[])}debugPrint(e,t){}}},7448:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserProcessor=void 0;const o=r(9046),s=r(208),n=r(1060),a=r(1895),l=r(1353),u=r(8386),c=r(1182),d=r(6934),p=r(8081),h=r(9577),y=r(9457),m=r(857),g=r(3287),f=r(3130),b=r(5516),v=r(1838),T=r(4177),A=r(6831),_=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 _.bitmark({bits:r,errors:i.length>0?i:void 0})}buildBit(e,t){const{bitType:r,textFormat:o,resourceType:n}=e;if(!r||r.root===s.RootBitType._error)return this.invalidBit();const a=r.root===s.RootBitType.trueFalse1,l=r.root===s.RootBitType.multipleChoice1,d=r.root===s.RootBitType.multipleResponse1;this.debugPrint("BIT CONTENT",t),this.resetParserState(),t=u.BitmarkPegParserValidator.validateBitTags(this.context,r,t);const p=this.bitContentProcessor(A.BitContentLevel.Bit,r,t),{body:h,footer:y,cardSet:m,title:g,statement:f,statements:T,choices:P,responses:S,resources:x,comments:w}=p,R=i(p,["body","footer","cardSet","title","statement","statements","choices","responses","resources","comments"]);this.debugPrint("BIT TAGS",R),this.debugPrint("BIT BODY",h),this.debugPrint("BIT FOOTER",y);const O=(0,v.buildTitles)(this.context,r,g),k=(0,c.buildCards)(this.context,r,m,f,T,P,S),C=(0,b.buildResource)(this.context,r,n,x);(w||k.comments)&&(this.parser.comments=[],w&&this.parser.comments.push(...w),k.comments&&this.parser.comments.push(...k.comments));const E=this.buildBitLevelWarnings(),I=this.buildBitLevelErrors();E&&(this.parser.warnings=E),I&&(this.parser.errors=I);return{value:_.bit(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({bitType:r,textFormat:o,resourceType:n},O),{statement:a?f:void 0,choices:l?P:void 0,responses:d?S:void 0}),R),{resource:C}),k),{body:h,footer:y,parser:this.parser}))}}invalidBit(e){e&&this.addError("Invalid bit"),this.parser.errors=this.buildBitLevelErrors();return{value:_.bit({bitType:s.BitTypeUtils.getBitType(s.RootBitType._error),parser:this.parser})}}buildBitHeader(e,t){var r;const i=s.BitTypeUtils.getBitType(e);return i.root===s.RootBitType._error&&this.addError(`Invalid bit type: '${e}'`),{bitType:i,textFormat:null!==(r=t.textFormat)&&void 0!==r?r:l.TextFormat.bitmarkMinusMinus,resourceType:t.resourceType}}buildTextAndResourceType(e,t){const r={textFormat:l.TextFormat.bitmarkMinusMinus},i=e=>{var t;e&&(e.type===A.TypeKey.TextFormat?(r.textFormat=l.TextFormat.fromValue(e.value),e.value&&!r.textFormat&&this.addWarning(`Invalid text format '${e.value}', defaulting to '${l.TextFormat.bitmarkMinusMinus}'`),r.textFormat=null!==(t=r.textFormat)&&void 0!==t?t:l.TextFormat.bitmarkMinusMinus):(r.resourceType=a.ResourceType.fromValue(e.value),e.value&&!r.resourceType&&this.addWarning(`Invalid resource type '${e.value}', it will be ignored`)))};return i(e),i(t),r}resetParserState(){this.context.state={}}bitContentProcessor(e,t,r){const i={};if(!r)return i;i.title=[],i.solutions=[],i.statements=[],i.choices=[],i.responses=[],i.resources=[],i.trueFalse=[],i.markConfig=[],i.extraProperties={},i.comments=[];let o=!1,s=!1,n=!1;const a=[];let l="",c="",P="";const S=e===A.BitContentLevel.Chain,x=()=>{if(l){l=u.BitmarkPegParserValidator.checkBodyPart(this.context,e,t,l);const r=_.bodyText({text:l});a.push(r)}l=""};return r.forEach(((r,u)=>{const{type:_,value:w}=r;switch(_){case A.TypeKey.Comment:(0,d.commentTagContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.ItemLead:(0,y.itemLeadTagContentProcessor)(this.context,e,t,r,i,o),o=!0;break;case A.TypeKey.Instruction:case A.TypeKey.Hint:case A.TypeKey.Anchor:case A.TypeKey.SampleSolution:(0,p.defaultTagContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.Reference:(0,f.referenceTagContentProcessor)(this.context,e,t,r,i,s),s=!0;break;case A.TypeKey.Title:(0,v.titleTagContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.Property:(0,g.propertyContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.Gap:S||x(),(0,h.gapChainContentProcessor)(this.context,e,t,r,i,a);break;case A.TypeKey.Mark:S||x(),(0,m.markChainContentProcessor)(this.context,e,t,r,i,a);break;case A.TypeKey.True:case A.TypeKey.False:S||x(),(0,T.trueFalseChainContentProcessor)(this.context,e,t,r,i,a);break;case A.TypeKey.Resource:(0,b.resourceContentProcessor)(this.context,e,t,r,i);break;case A.TypeKey.CardSet:i.cardSet=w,n=!0;break;case A.TypeKey.BodyText:n?c+=w:l+=w;break;case A.TypeKey.CardText:P+=w}})),x(),i.body=a.length>0?_.body({bodyParts:this.trimBodyParts(a)}):void 0,u.BitmarkPegParserValidator.checkBody(this.context,e,t,i.body),c=c.trim(),c&&(c=u.BitmarkPegParserValidator.checkFooter(this.context,e,t,c),c&&(i.footer=_.footerText({text:c}))),P=P.trim(),P&&(i.cardBody=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 i=[];for(const o of e)t.includes(o.type)&&(i.length>0&&r.push(i),i=[]),i.push(o);return i.length>0&&r.push(i),r}trimBodyParts(e){let t=!1,r=e.reduce(((e,r)=>{const i=r;if(t||i.type!==n.BodyBitType.text)t=!0,e.push(r);else{const r=i.data.bodyText.trimStart();r&&(t=!0,i.data.bodyText=r,e.push(i))}return e}),[]);return t=!1,r=r.reduceRight(((e,r)=>{const i=r;if(t||i.type!==n.BodyBitType.text)t=!0,e.unshift(r);else{const r=i.data.bodyText.trimEnd();r&&(t=!0,i.data.bodyText=r,e.unshift(i))}return e}),[]),r}addWarning(e,t,r){var i,o,s;const n={message:e,text:null!==(i=null==t?void 0:t.parser.text)&&void 0!==i?i:this.parserText(),location:null!==(o=null==t?void 0:t.parser.location)&&void 0!==o?o:this.parserLocation(),original:null!==(s=null==r?void 0:r.parser)&&void 0!==s?s:void 0};n.original||delete n.original,this.nonFatalWarnings.push(n)}addError(e,t,r){var i,o,s;const n={message:e,text:null!==(i=null==t?void 0:t.parser.text)&&void 0!==i?i:this.parserText(),location:null!==(o=null==t?void 0:t.parser.location)&&void 0!==o?o:this.parserLocation(),original:null!==(s=null==r?void 0:r.parser)&&void 0!==s?s:void 0};n.original||delete n.original,this.nonFatalErrors.push(n)}debugPrint(e,t){}}},6831:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CARD_VARIANT_DIVIDER_V1=t.CARD_SIDE_DIVIDER_V1=t.CARD_DIVIDER_V1=t.CARD_VARIANT_DIVIDER_V2=t.CARD_SIDE_DIVIDER_V2=t.CARD_DIVIDER_V2=t.BitContentLevel=t.TypeKey=void 0;const i=r(6688);t.CARD_DIVIDER_V2="====";t.CARD_SIDE_DIVIDER_V2="--";t.CARD_VARIANT_DIVIDER_V2="++";t.CARD_DIVIDER_V1="===";t.CARD_SIDE_DIVIDER_V1="==";t.CARD_VARIANT_DIVIDER_V1="--";const o=(0,i.superenum)({TextFormat:"TextFormat",ResourceType:"ResourceType",Title:"Title",Anchor:"Anchor",Reference:"Reference",ItemLead:"ItemLead",Instruction:"Instruction",Hint:"Hint",True:"True",False:"False",Gap:"Gap",Mark:"Mark",SampleSolution:"SampleSolution",Comment:"Comment",Property:"Property",Resource:"Resource",TagChain:"TagChain",BodyChar:"BodyChar",BodyText:"BodyText",CardSet:"CardSet",Card:"Card",CardChar:"CardChar",CardText:"CardText",GapChain:"GapChain",TrueFalseChain:"TrueFalseChain"});t.TypeKey=o;const s=(0,i.superenum)({Bit:"Bit",Card:"Card",Chain:"Chain"});t.BitContentLevel=s},8386:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitmarkPegParserValidator=void 0;const i=r(9881),o=r(208),s=r(6831),n=["====","----","\n==\n","\n---\n","\n--\n",":::","::::","|||","||||"],a=["==\n","---\n","--\n"],l=["\n==","\n---","\n--"];const u=new class{validateBitTags(e,t,r){if(!r)return[];const i=this.getMetadataForBitType(t),{tags:o,cardSet:n}=i;return this.validateTagChainsRecursive(e,s.BitContentLevel.Bit,t,r,o,n)}checkBody(e,t,r,i){if(!i)return i;const o=this.getMetadataForBitType(r),{bodyAllowed:s}=o;return i.bodyParts.length>0&&!s&&e.addWarning(`Bit '${r.alias}' should not have a body.`),i}checkBodyPart(e,t,r,i){return i?(this.checkBodyForCommonPotentialMistakes(e,t,r,i),i):i}checkFooter(e,t,r,i){if(!i)return i;const o=this.getMetadataForBitType(r),{footerAllowed:s}=o;return this.checkBodyForCommonPotentialMistakes(e,t,r,i),s||e.addWarning(`Bit '${r.alias}' should not have a footer.`),i}checkCardBody(e,t,r,i,o,s,n){if(!i)return i;const a=this.getMetadataForBitType(r);if(!a.cardSet)return i;const l=this.getVariantConfig(a.cardSet.variants,s,n);if(!l)return i;const{bodyAllowed:u}=l;return this.checkBodyForCommonPotentialMistakes(e,t,r,i),u||e.addWarning(`Bit '${r.alias}' should not have a card body at card:${o+1}, side:${s+1}, variant:${n+1}.`),i}validateTagChainsRecursive(e,t,r,o,n,a){if(!o)return[];const l=[...o],u=new Map,c=this.convertTagsToTypeKeyMap(n);c.set(s.TypeKey.Comment,{maxCount:i.INFINITE_COUNT}),t===s.BitContentLevel.Bit?(a&&c.set(s.TypeKey.CardSet,{_key:a.type}),c.set(s.TypeKey.TextFormat,{}),c.set(s.TypeKey.BodyText,{maxCount:i.INFINITE_COUNT})):t===s.BitContentLevel.Card&&c.set(s.TypeKey.CardText,{maxCount:i.INFINITE_COUNT});for(let i=0;i<l.length;i++){const o=l[i];if(!o)continue;const{type:n,key:d}=o,p=s.TypeKey.fromValue(n);if(!p)continue;let h=p;p!==s.TypeKey.Property&&p!==s.TypeKey.Resource||(h=`${p}:${d}`);const y=c.get(h),m=this.validateSingleTag(e,t,r,o,p,h,y,u,a);if(m||l.splice(i,1,null),m&&Array.isArray(m.chain)&&m.chain.length>0)if(y&&y.chain){const t=this.validateTagChainsRecursive(e,s.BitContentLevel.Chain,r,m.chain,y.chain);t&&t.length>0?m.chain=t:m.chain=void 0}else l.splice(i+1,0,...m.chain),m.chain=void 0}return l.filter((e=>null!=e))}validateSingleTag(e,t,r,i,o,n,a,l,u){const{type:c,key:d}=i,p=c===s.TypeKey.Property||c===s.TypeKey.Resource?` with key '${d}'`:"",h=" It will be ignored";let y,m,g="",f=l.get(n);null==f&&(f={count:0},l.set(n,f));let b=f.previous;if(f.count++,a)switch(o){case s.TypeKey.Property:{const{content:o,warning:s}=this.validatePropertyTag(e,t,r,a,i,f);y=o,m=s;break}case s.TypeKey.Resource:{const{content:o,warning:s}=this.validateResourceTag(e,t,r,a,i,f);y=o,m=s;break}case s.TypeKey.CardSet:{const{content:t,warning:o}=this.validateCardSet(e,r,a,i,u);y=t,m=o;break}default:{const{content:o,warning:s}=this.validateStandardTag(e,t,r,a,i,f);y=o,m=s}}else switch(o){case s.TypeKey.Property:m={extraProperty:!0},y=i;break;case s.TypeKey.Resource:m={excessResource:!0},y=i;break;default:m={invalid:!0}}return m&&(b=f.previous,m.invalid||m.excessResource?g=`'${c}'${p} is not valid here.${h}`:m.tooMany?g=`'${c}'${p} is included more than ${m.tooMany} time(s). The earlier ones will be ignored`:m.extraProperty?g=`'${c}'${p} is an unknown property. It can be excluded from the output using the 'excludeUnknownProperties' flag`:m.unexpectedCardSet?g=`'${c}'${p} is not expected here.${h}`:m.unexpectedCardSideVariant&&(g=`'${c}'${p} has a card / side / variant that is not expected here.${h}`),e.addWarning(g,i,b)),f.previous=i,y}validateStandardTag(e,t,r,i,o,s){const n=null==i.maxCount?1:i.maxCount;return n>0&&s.count>n?{warning:{tooMany:n},content:o}:{content:o}}validatePropertyTag(e,t,r,i,o,s){const n=null==i.maxCount?1:i.maxCount;return n>0&&s.count>n?{warning:{tooMany:n},content:o}:{content:o}}validateResourceTag(e,t,r,i,o,s){const n=null==i.maxCount?1:i.maxCount;return n>0&&s&&s.count>n?{warning:{tooMany:n},content:o}:{content:o}}validateCardSet(e,t,r,i,o){if(!o||!o.variants||0===o.variants.length)return{warning:{unexpectedCardSet:!0}};const{value:n}=i,a=n;let l,u=0,c=0;for(const r of a.cards){u=0;for(const i of r.sides){c=0;for(const r of i.variants){const n=r.content;let a;const d=this.getVariantConfig(o.variants,u,c);d?a=this.validateTagChainsRecursive(e,s.BitContentLevel.Card,t,n,d.tags):l={unexpectedCardSideVariant:!0},a&&a.length>0?i.variants[c]={parser:r.parser,content:a}:i.variants[c]={parser:r.parser,content:[]},c++}u++}}return{content:i,warning:l}}checkBodyForCommonPotentialMistakes(e,t,r,i){if(i){for(const t of n)i.includes(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of a)i.startsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`);for(const t of l)i.endsWith(t)&&e.addWarning(`Bit '${r.alias}' might contain a mistake: ${t}`)}}convertTagsToTypeKeyMap(e){const t=new Map;for(const[r,i]of Object.entries(e))if(i._key=r,i.isProperty)t.set(`${s.TypeKey.Property}:${r}`,i);else if(i.isResource)t.set(`${s.TypeKey.Resource}:${r}`,i);else{const e=s.TypeKey.fromValue(r);e&&t.set(e,i)}return t}getVariantConfig(e,t,r){let i;if(0===e.length)return;const o=e[Math.min(t,e.length-1)],s=o.length-1;if(r>s){if(i=o[s],!i.infiniteRepeat)return}else i=o[r];return i}getMetadataForBitType(e){const t=o.RootBitType.getMetadata(e.root);if(!t)throw new Error(`Root bit type ${e.root} has no metadata`);return t}};t.BitmarkPegParserValidator=u},7542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PeggyGrammarLocation=void 0;t.PeggyGrammarLocation=class{constructor(e,t){this.source=e,this.start=t}toString(){return String(this.source)}offset(e){return{line:e.line+this.start.line-1,column:1===e.line?e.column+this.start.column-1:e.column,offset:e.offset+this.start.offset}}static offsetStart(e){return e.source&&"function"==typeof e.source.offset?e.source.offset(e.start):e.start}static offsetEnd(e){return e.source&&"function"==typeof e.source.offset?e.source.offset(e.end):e.end}}},4185:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.bookChainContentProcessor=void 0;const i=r(3633),o=r(6831);t.bookChainContentProcessor=function(e,t,r,s,n){if(t===o.BitContentLevel.Chain);else{const t=function(e,t,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("book content",r);const s=e.bitContentProcessor(o.BitContentLevel.Chain,t,r.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("book TAGS",s);const{reference:n,referenceEnd:a}=s,l=i.StringUtils.trimmedString(r.value);return{book:l,reference:n,referenceEnd:a}}(e,r,s);n.book=t.book,n.reference=t.reference,n.referenceEnd=t.referenceEnd}}},1182:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.buildCards=void 0;const o=r(9046),s=r(208),n=r(7210),a=r(1895),l=r(8386),u=r(6831),c=new o.Builder;t.buildCards=function(e,t,r,o,d,p,h){var y;e.DEBUG_CARD_SET&&e.debugPrint("card set",r);let m={};const g=function(e,t,r){const i={cards:[],comments:[]};if(!r)return i;let o=0,s=0,n=0;for(const a of r.cards){const r={no:o++,sides:[]};i.cards.push(r);for(const o of a.sides){const a={no:s++,variants:[]};r.sides.push(a);for(const s of o.variants){const{parser:o,content:c}=s,d={parser:o,no:n++};a.variants.push(d);const p=e.bitContentProcessor(u.BitContentLevel.Card,t,c);e.DEBUG_CARD_TAGS&&e.debugPrint("card tags",p),p.cardBody=l.BitmarkPegParserValidator.checkCardBody(e,u.BitContentLevel.Card,t,p.cardBody,r.no,a.no,d.no),d.data=p,p.comments&&i.comments.push(...p.comments)}n=0}s=0}return i}(e,t,r),f=s.RootBitType.getMetadata(t.root);switch(f&&(null===(y=f.cardSet)||void 0===y?void 0:y.type)){case n.CardSetType.flashcards:m=function(e,t,r){const o=[];let n,a,l="",u=[],d=0,p=0,h={};const y=t.alias===s.AliasBitType.flashcard1;for(const s of r.cards){l="",n=void 0,u=[],p=0,h={};for(const e of s.sides)for(const t of e.variants){const e=t.data,{cardBody:r}=e,o=i(e,["cardBody"]);h=Object.assign(Object.assign({},h),o),0===p?(a=t,l=null!=r?r:""):1===p?n=null!=r?r:"":u.push(null!=r?r:""),p++}if(0!==d&&y){e.addWarning(`Bit '${t.alias}' should only contain one card. Ignore subsequent card: '${l}'`,a);break}o.push(c.flashcard(Object.assign({question:l,answer:n,alternativeAnswers:u.length>0?u:void 0},h))),d++}return{flashcards:o.length>0?o:void 0}}(e,t,g);break;case n.CardSetType.elements:m=function(e,t,r){var i;const o=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data;o.push(null!==(i=t.cardBody)&&void 0!==i?i:"")}return{elements:o.length>0?o:void 0}}(0,0,g);break;case n.CardSetType.statements:m=function(e,t,r,o,s){const n=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{statements:r}=t,o=i(t,["statements"]);if(Array.isArray(r))for(const e of r){const t=c.statement(Object.assign(Object.assign(Object.assign({},e),e.itemLead),o));n.push(t)}}o&&n.push(o);Array.isArray(s)&&s.length>0&&n.push(...s);return{statements:n.length>0?n:void 0}}(0,0,g,o,d);break;case n.CardSetType.quiz:m=function(e,t,r,o,n){const a=[],l=t.root===s.RootBitType.multipleChoice,u=t.root===s.RootBitType.multipleResponse;if(!l&&!u)return{};let d,p=!1;for(const e of r.cards){p=!1,d="";for(const t of e.sides)for(const e of t.variants){const t=e.data,{isDefaultExample:r,example:o}=t,s=i(t,["isDefaultExample","example"]);if(p=!0===r||p,d=o||d,s.trueFalse&&s.trueFalse.length>0){const e=[],t=u?c.response:c.choice;for(const r of s.trueFalse){const{isDefaultExample:o,example:s}=r,n=i(r,["isDefaultExample","example"]),a=o||p,l=s||d,u=t(Object.assign(Object.assign({},n),{isDefaultExample:a,example:l}));e.push(u)}u?s.responses=e:s.choices=e}const n=c.quiz(Object.assign(Object.assign({},s),{isDefaultExample:p,example:d}));a.push(n)}}if(l&&Array.isArray(o)&&o.length>0){const e=c.quiz({choices:o});a.push(e)}if(u&&Array.isArray(n)&&n.length>0){const e=c.quiz({responses:n});a.push(e)}return{quizzes:a.length>0?a:void 0}}(0,t,g,p,h);break;case n.CardSetType.questions:m=function(e,t,r){var i;const o=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,r=c.question(Object.assign({question:null!==(i=t.cardBody)&&void 0!==i?i:""},t));o.push(r)}return{questions:o.length>0?o:void 0}}(0,0,g);break;case n.CardSetType.matchPairs:m=function(e,t,r){let o,s=0;const n=[];let l;const u=[];let d,p,h,y,m,g=[],f={},b=!1,v=!1;for(const e of r.cards){l=void 0,d=void 0,g=[],p=void 0,h=void 0,s=0,f={},v=!1,m="";for(const t of e.sides){for(const e of t.variants){const t=e.data,{cardBody:r,title:o,resources:n,isDefaultExample:c,example:T}=t,A=i(t,["cardBody","title","resources","isDefaultExample","example"]);v=!0===c||v,m=T||m;const _=o&&o[1];if(0===s)if(null!=_)l=_,b=!0===c||b,y=T||y;else if(Array.isArray(n)&&n.length>0){const e=n[0];e.type===a.ResourceType.audio?p=e:e.type===a.ResourceType.image&&(h=e)}else d=r;else if(null!=_)u.push(_),b=!0===c||b,y=T||y;else if(null==o){const e=null!=r?r:"";g.push(e),!b&&!v||m||(m=e)}f=Object.assign(Object.assign(Object.assign({},f),A),{isCaseSensitive:!0})}s++}if(null!=l)o=c.heading({forKeys:l,forValues:u});else{v&&(y=void 0);const e=v||b,t=m||y,r=c.pair(Object.assign(Object.assign({key:null!=d?d:"",keyAudio:p,keyImage:h,values:g,isShortAnswer:!0},f),{isDefaultExample:e,example:t}));n.push(r)}}return{heading:o,pairs:n.length>0?n:void 0}}(0,0,g);break;case n.CardSetType.matchMatrix:m=function(e,t,r){let o,s,n=0;const a=[];let l;const u=[];let d,p,h,y=[],m=[],g={},f=!1,b=!1,v=!1;for(const e of r.cards){s=void 0,l=void 0,y=[],m=[],n=0,b=!1,p="";for(const t of e.sides){m=[],g={},v=!1,h="";for(const e of t.variants){const t=e.data,{title:r,cardBody:o,isDefaultExample:u,example:c}=t,y=i(t,["title","cardBody","isDefaultExample","example"]);v=!0===u||v,h=c||h,Object.assign(g,y);const T=r&&r[1];if(0===n)null!=T?(s=T,f=!0===u||f,d=c||d):(l=o,b=!0===u||b,p=c||p);else if(null!=T)a.push(T),f=!0===u||f,d=c||d;else if(null==t.title){const e=null!=o?o:"";m.push(e),!f&&!v||h||(h=e)}}if(n>0){v&&(p=d=void 0),b&&(d=void 0);const e=v||b||f,t=h||p||d,r=c.matrixCell(Object.assign(Object.assign({values:m},g),{isDefaultExample:e,example:t}));y.push(r)}n++}if(null!=s)o=c.heading({forKeys:s,forValues:a});else{const e=c.matrix({key:null!=l?l:"",cells:y,isShortAnswer:!0,isCaseSensitive:!0});u.push(e)}}return{heading:o,matrix:u.length>0?u:void 0}}(0,0,g);break;case n.CardSetType.botActionResponses:m=function(e,t,r){const o=[];for(const e of r.cards)for(const t of e.sides)for(const e of t.variants){const t=e.data,{instruction:r,reaction:s,cardBody:n}=t,a=i(t,["instruction","reaction","cardBody"]),l=c.botResponse(Object.assign({response:null!=r?r:"",reaction:null!=s?s:"",feedback:null!=n?n:""},a));o.push(l)}return{botResponses:o.length>0?o:void 0}}(0,0,g)}return m.comments=g.comments.length>0?g.comments:void 0,m}},4471:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clozeTagContentProcessor=void 0;const i=r(3633);t.clozeTagContentProcessor=function(e,t,r,o,s){const{value:n}=o,a=s.solutions;if(a&&i.StringUtils.isString(n)){const e=i.StringUtils.trimmedString(n);a.push(e)}}},6934:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.commentTagContentProcessor=void 0;const i=r(9046),o=r(3633),s=new i.Builder;t.commentTagContentProcessor=function(e,t,r,i,n){if(!n.comments)return;const{value:a}=i,l=o.StringUtils.isString(a)?a:"",u=s.comment({text:l,location:i.parser.location});n.comments.push(u)}},8081:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTagContentProcessor=void 0;const i=r(3633),o=r(6831);t.defaultTagContentProcessor=function(e,t,r,s,n){const{type:a,value:l}=s,u=i.StringUtils.trimmedString(l);switch(a){case o.TypeKey.Instruction:n.instruction=u;break;case o.TypeKey.Hint:n.hint=u;break;case o.TypeKey.Anchor:n.anchor=u;break;case o.TypeKey.Reference:n.reference=u;break;case o.TypeKey.SampleSolution:n.sampleSolution=u,e.addWarning("[$...] tag is deprecated, use [@sampleSolution:...] instead",s)}}},4787:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.exampleTagContentProcessor=void 0;const i=r(208),o=r(672);function s(e,t,r,i,o){!0===i?(o.isDefaultExample=!0,o.example=void 0):o.example=i}t.exampleTagContentProcessor=function(e,t,r,n,a){const{value:l}=n,u=l;switch(r.root){case i.RootBitType.cloze:case i.RootBitType.clozeAndMultipleChoiceText:case i.RootBitType.multipleChoiceText:case i.RootBitType.highlightText:case i.RootBitType.trueFalse:case i.RootBitType.trueFalse1:case i.RootBitType.multipleResponse:case i.RootBitType.multipleResponse1:case i.RootBitType.multipleChoice:case i.RootBitType.multipleChoice1:!function(e,t,r,n,a){var l,u;let c;Array.isArray(a.trueFalse)&&a.trueFalse.length>0&&(c=null!==(l=a.trueFalse[a.trueFalse.length-1])&&void 0!==l?l:void 0);if(c)!0===n?(c.isDefaultExample=!0,c.example=void 0):o.BooleanUtils.isBooleanString(n)?c.example=n:(c.isDefaultExample=!0,c.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",r));else if(Array.isArray(a.solutions)&&a.solutions.length>0)a.example=!0===n?null!==(u=a.solutions[a.solutions.length-1])&&void 0!==u?u:void 0:n;else switch(t.root){default:case i.RootBitType.cloze:s(e,t,r,n,a);break;case i.RootBitType.multipleChoiceText:case i.RootBitType.highlightText:case i.RootBitType.trueFalse:case i.RootBitType.trueFalse1:case i.RootBitType.multipleResponse:case i.RootBitType.multipleResponse1:!function(e,t,r,i,s){!0===i?(s.isDefaultExample=!0,s.example=void 0):o.BooleanUtils.isBooleanString(i)?s.example=i:(s.isDefaultExample=!0,s.example=void 0,e.addWarning("Only 'true' / 'false' / default are allowed here, using default",r))}(e,0,r,n,a);break;case i.RootBitType.clozeAndMultipleChoiceText:case i.RootBitType.multipleChoice:case i.RootBitType.multipleChoice1:a.isDefaultExample=!0,a.example=void 0,!0!==n&&e.addWarning("At this level, only default [@example] is allowed, using default",r)}}(e,r,n,u,a);break;case i.RootBitType.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,n,u,a);break;default:s(e,r,n,u,a)}}},9577:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.gapChainContentProcessor=void 0;const o=r(9046),s=r(4471),n=r(6831),a=new o.Builder;t.gapChainContentProcessor=function(e,t,r,o,l,u){if(t===n.BitContentLevel.Chain)(0,s.clozeTagContentProcessor)(e,t,r,o,l);else{const t=function(e,t,r){var o;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("gap content",r);const s=[r,...null!==(o=r.chain)&&void 0!==o?o:[]],l=e.bitContentProcessor(n.BitContentLevel.Chain,t,s);e.DEBUG_CHAIN_TAGS&&e.debugPrint("gap TAGS",l);const{solutions:u}=l,c=i(l,["solutions"]),d=a.gap(Object.assign(Object.assign({solutions:null!=u?u:[]},c),{isCaseSensitive:!0}));return d}(e,r,o);t&&u.push(t)}}},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),s=r(3633),n=r(6831),a=new o.Builder;t.imageSourceChainContentProcessor=function(e,t,r,o,l){t===n.BitContentLevel.Chain?function(e,t,r,i,o){const{value:n}=i,a=s.StringUtils.trimmedString(n);o.imageSourceUrl=a}(0,0,0,o,l):function(e,t,r,o,s){var l;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("imageSource content",o);const u=[o,...null!==(l=o.chain)&&void 0!==l?l:[]],c=e.bitContentProcessor(n.BitContentLevel.Chain,r,u);e.DEBUG_CHAIN_TAGS&&e.debugPrint("imageSource TAGS",c);const{imageSourceUrl:d,mockupId:p}=c,h=i(c,["imageSourceUrl","mockupId"]);d||e.addWarning("[@imageSource] is missing the image url",o);p||e.addWarning("[@mockupId:xxx] is missing from [@imageSource]",o);const y=a.imageSource(Object.assign({url:null!=d?d:"",mockupId:null!=p?p:""},h));s.imageSource=y}(e,0,r,o,l)}},9457:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.itemLeadTagContentProcessor=void 0;const i=r(3633);t.itemLeadTagContentProcessor=function(e,t,r,o,s,n){const{value:a}=o,l=i.StringUtils.trimmedString(a);n?s.lead=l:s.item=l}},857:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markChainContentProcessor=void 0;const o=r(9046),s=r(7646),n=r(3298),a=r(6831),l=new o.Builder;t.markChainContentProcessor=function(e,t,r,o,u,c){if(t===a.BitContentLevel.Chain)(0,n.markTagContentProcessor)(e,a.BitContentLevel.Chain,r,o,u);else{const t=function(e,t,r){var o,n;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",r);const u=[r,...null!==(o=r.chain)&&void 0!==o?o:[]],c=e.bitContentProcessor(a.BitContentLevel.Chain,t,u);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",c);const{solution:d,mark:p}=c,h=i(c,["solution","mark"]),y=l.mark(Object.assign({solution:null!=d?d:"",mark:null!==(n=s.ArrayUtils.asSingle(p))&&void 0!==n?n:""},h));return y}(e,r,o);t&&c.push(t)}}},2595:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.markConfigChainContentProcessor=void 0;const o=r(9046),s=r(3633),n=r(6831),a=new o.Builder;t.markConfigChainContentProcessor=function(e,t,r,o,l){var u;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("mark content",o);const c=l.markConfig;if(!c)return;const d=e.bitContentProcessor(n.BitContentLevel.Chain,r,o.chain),{mark:p}=d,h=i(d,["mark"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("mark TAGS",h);const y=null!==(u=s.StringUtils.trimmedString(o.value))&&void 0!==u?u:"unknown",m=a.markConfig(Object.assign({mark:y,emphasis:"underline"},h));c.push(m)}},3298:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.markTagContentProcessor=void 0;const i=r(3633);t.markTagContentProcessor=function(e,t,r,o,s){const{value:n}=o;i.StringUtils.isString(n)&&(s.solution=n)}},8326:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.partnerChainContentProcessor=void 0;const i=r(9046),o=r(1895),s=r(3633),n=r(6831),a=new i.Builder;t.partnerChainContentProcessor=function(e,t,r,i,l){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("partner content",i);const u=e.bitContentProcessor(n.BitContentLevel.Chain,r,i.chain);e.DEBUG_CHAIN_TAGS&&e.debugPrint("partner TAGS",u);const{resources:c}=u,d=s.StringUtils.trimmedString(i.value),p=function(e,t){let r;const i=[];if(t)for(const e of t.reverse())r||o.ResourceType.image!==e.type?i.push(e):r=e;i.length>0&&(e.parser.excessResources=i,e.addWarning(`${i.length} excess resource(s) present in the [@parter] chain.`));return r}(e,c),h=a.partner({name:d,avatarImage:p});l.partner=h}},3287:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propertyContentProcessor=void 0;const i=r(4719),o=r(672),s=r(994),n=r(3633),a=r(4185),l=r(4787),u=r(8664),c=r(2595),d=r(8326),p=r(6831);t.propertyContentProcessor=function(e,t,r,h,y){const{key:m,value:g}=h,f=t===p.BitContentLevel.Chain;if(m===i.PropertyKey.example)return void(0,l.exampleTagContentProcessor)(e,t,r,h,y);if(m===i.PropertyKey.partner)return void(0,d.partnerChainContentProcessor)(e,t,r,h,y);if(m===i.PropertyKey.imageSource)return void(0,u.imageSourceChainContentProcessor)(e,t,r,h,y);if(m===i.PropertyKey.book)return void(0,a.bookChainContentProcessor)(e,t,r,h,y);if(m===i.PropertyKey.mark&&!f)return void(0,c.markConfigChainContentProcessor)(e,t,r,h,y);const b=(e,t,r)=>{var a;const l=null!==(a=i.PropertyKey.getMetadata(i.PropertyKey.fromValue(t)))&&void 0!==a?a:{};if(l.astKey&&(t=l.astKey),l.isTrimmedString&&(r=n.StringUtils.isString(r)?n.StringUtils.trimmedString(r):void 0),l.isNumber&&(r=s.NumberUtils.asNumber(r)),l.isBoolean&&(r=o.BooleanUtils.toBoolean(r,!0)),l.isInvertedBoolean&&(r=!o.BooleanUtils.toBoolean(r,!0)),l.isSingle)e[t]=r;else if(Object.prototype.hasOwnProperty.call(e,t)){const i=e[t];e[t]=[...i,r]}else e[t]=[r]};i.PropertyKey.fromValue(m)?b(y,m,g):b(y.extraProperties,m,g)}},3130:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.referenceTagContentProcessor=void 0;const i=r(3633);t.referenceTagContentProcessor=function(e,t,r,o,s,n){const{value:a}=o,l=i.StringUtils.trimmedString(a);n?s.referenceEnd=l:s.reference=l}},5516:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resourceContentProcessor=t.buildResource=void 0;const i=r(8703),o=r(208),s=r(1895),n=r(4598),a=r(6831),l=" The expected resource types are [&image-portrait] and [&image-landscape]",u=" The expected resource types are [&image] and [&audio]",c=new i.ResourceBuilder;t.buildResource=function(e,t,r,i){let a,d;const p=[],h=o.RootBitType.getMetadata(t.root),y=null==h?void 0:h.resourceAttachmentAllowed,m=null==h?void 0:h.resourceOptional,g=y?r:void 0,f=n.BitUtils.calculateValidResourceType(t,g,void 0);if(f===s.ResourceType.imageResponsive){if(i){let e,t;d=[];for(const r of i.reverse())e||s.ResourceType.imagePortrait!==r.typeAlias?t||s.ResourceType.imageLandscape!==r.typeAlias?d.push(r):t=r:e=r;e&&t&&(a=c.imageResponsiveResource({imagePortrait:e,imageLandscape:t}))}}else if(f===s.ResourceType.stillImageFilm){if(i){let e,t;d=[];for(const r of i.reverse())e||s.ResourceType.image!==r.type?t||s.ResourceType.audio!==r.type?d.push(r):t=r:e=r;e&&t&&(a=c.stillImageFilmResource({image:e,audio:t}))}}else d=i;if(d)for(const e of d.reverse())a||f!==e.type?p.push(e):a=e;if(!y&&r){let t=`Resource type [&${r}] is specified in the bit header, but no extra resource is allowed for this bit.`;f&&(t+=` The resource type [&${f}] is automatically expected and should not be added.`),e.addWarning(t)}if(!a)if(r)e.addWarning(`Resource type [&${r}] is specified in the bit header, but no such a resource is present in the bit`);else if(f&&!m){let t="A resource is required but is not present in the bit.";if(f===o.RootBitType.imageResponsive)t+=l;else if(f===o.RootBitType.stillImageFilm)t+=u;else{t+=` The expected resource type is ${`[&${f}]`}`}e.addWarning(t)}if(p.length>0){e.parser.excessResources=p;let t=`${p.length} excess resource(s) present in the bit.`;if(f===o.RootBitType.imageResponsive)t+=l;else if(f===o.RootBitType.stillImageFilm)t+=u;else{t+=` The expected resource type is ${f?`[&${f}]`:"NONE"}`}e.addWarning(t)}return a},t.resourceContentProcessor=function(e,t,r,i,o){const{type:n,key:l,value:u,chain:d}=i,p=o.resources;if(!p)return;const h=s.ResourceType.fromValue(l);if(h){const t=e.bitContentProcessor(a.BitContentLevel.Chain,r,d),i=c.resource(Object.assign({type:h,value:u},t));i&&p.push(i)}}},1838:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildTitles=t.titleTagContentProcessor=void 0;const i=r(208),o=r(3633);t.titleTagContentProcessor=function(e,t,r,i,s){const{value:n}=i,a=s.title;if(!a)return;const l=n,u=o.StringUtils.trimmedString(l.title);a[l.level.length]=u},t.buildTitles=function(e,t,r){var o,s;switch(r=null!=r?r:[],t.root){case i.RootBitType.chapter:{let e;return r.length>0&&(e=r[r.length-1]),{title:e,level:r.length>0?r.length-1:void 0}}case i.RootBitType.book:default:return{title:null!==(o=r[1])&&void 0!==o?o:void 0,subtitle:null!==(s=r[2])&&void 0!==s?s:void 0}}}},4177:function(e,t,r){var i=this&&this.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseChainContentProcessor=void 0;const o=r(9046),s=r(208),n=r(8660),a=r(6831),l=new o.Builder;t.trueFalseChainContentProcessor=function(e,t,r,o,u,c){t===a.BitContentLevel.Chain?(0,n.trueFalseTagContentProcessor)(e,a.BitContentLevel.Chain,r,o,u):function(e,t,r,o,n,u){var c;const d=[o,...null!==(c=o.chain)&&void 0!==c?c:[]],p=n.statements,h=n.choices,y=n.responses;if(!(p&&h&&y&&u))return;if(r.root===s.RootBitType.trueFalse1)n.statement=function(e,t,r){if(t.root!==s.RootBitType.trueFalse1)return;e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (statement)",r);const o=e.bitContentProcessor(a.BitContentLevel.Chain,t,r),{trueFalse:n}=o,u=i(o,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (statement)",u);let c;n&&n.length>0&&(c=l.statement(Object.assign(Object.assign({},n[0]),u)));return c}(e,r,d);else if(r.root===s.RootBitType.trueFalse||r.root===s.RootBitType.multipleChoice||r.root===s.RootBitType.multipleChoice1||r.root===s.RootBitType.multipleResponse||r.root===s.RootBitType.multipleResponse1){const t=function(e,t,r){const o=t.root===s.RootBitType.trueFalse,n=t.root===s.RootBitType.multipleChoice||t.root===s.RootBitType.multipleChoice1,u=t.root===s.RootBitType.multipleResponse||t.root===s.RootBitType.multipleResponse1;if(!o&&!n&&!u)return{};const c=[],d=[],p=[],h=e.splitBitContent(r,[a.TypeKey.True,a.TypeKey.False]);e.DEBUG_CHAIN_CONTENT&&e.debugPrint("trueFalse V1 content (choices/responses)",h);for(const r of h){const s=e.bitContentProcessor(a.BitContentLevel.Chain,t,r),{trueFalse:h}=s,y=i(s,["trueFalse"]);if(e.DEBUG_CHAIN_TAGS&&e.debugPrint("trueFalse V1 tags (choices/responses)",y),o){if(h&&h.length>0){const e=l.statement(Object.assign(Object.assign({},h[0]),y));c.push(e)}}else if(n){if(h&&h.length>0){const e=l.choice(Object.assign(Object.assign({},h[0]),y));d.push(e)}}else if(u&&h&&h.length>0){const e=l.response(Object.assign(Object.assign({},h[0]),y));p.push(e)}}const y={};o?y.statements=c:n?y.choices=d:u&&(y.responses=p);return y}(e,r,d);t.statements&&p.push(...t.statements),t.choices&&h.push(...t.choices),t.responses&&y.push(...t.responses)}else if(r.root===s.RootBitType.highlightText){const t=function(e,t,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("highlight content",r);const o=e.bitContentProcessor(a.BitContentLevel.Chain,t,r),{trueFalse:s}=o,n=i(o,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("highlight TAGS",Object.assign({trueFalse:s},n));const u=[];if(s)for(const e of s)u.push(l.highlightText(Object.assign(Object.assign({},e),{isHighlighted:!1})));const c=l.highlight(Object.assign({texts:u},n));return c}(e,r,d);t&&u.push(t)}else{const t=function(e,t,r){e.DEBUG_CHAIN_CONTENT&&e.debugPrint("select content",r);const o=e.bitContentProcessor(a.BitContentLevel.Chain,t,r),{trueFalse:s}=o,n=i(o,["trueFalse"]);e.DEBUG_CHAIN_TAGS&&e.debugPrint("select TAGS",Object.assign({trueFalse:s},n));const u=[];if(s)for(const e of s)u.push(l.selectOption(e));const c=l.select(Object.assign({options:u},n));return c}(e,r,d);t&&u.push(t)}}(e,0,r,o,u,c)}},8660:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trueFalseTagContentProcessor=void 0;const i=r(3633),o=r(6831);t.trueFalseTagContentProcessor=function(e,t,r,s,n){const{type:a,value:l}=s,u=n.trueFalse;if(!u)return;const c=i.StringUtils.trimmedString(l);u.push({text:c,isCorrect:a===o.TypeKey.True,isDefaultExample:!1})}},2434:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JsonParser=void 0;const i=r(9046),o=r(8703),s=r(6300),n=r(208),a=r(1060),l=r(1895),u=r(1353),c=r(3633),d=new i.Builder,p=new o.ResourceBuilder;t.JsonParser=class{constructor(){this.textGenerator=new s.TextGenerator}toAst(e){const t=this.preprocessJson(e),r=[];for(const e of t){const{bit:t}=e,i=this.bitToAst(t);i&&r.push(i)}const i=r.length>0?{bits:r}:{};return d.bitmark(i)}preprocessJson(e){const t=[];if(c.StringUtils.isString(e)){const t=e;try{e=JSON.parse(t)}catch(e){return[]}}const r=e=>{if(this.isBitWrapper(e)){const r=e;t.push(r)}else if(this.isBit(e)){const r=e;t.push(this.bitToBitWrapper(r))}};if(Array.isArray(e))for(const t of e)r(t);else r(e);return t}isBitWrapper(e){if(Object.prototype.hasOwnProperty.call(e,"bit")){const t=e;return this.isBit(t.bit)}return!1}isBit(e){if(Object.prototype.hasOwnProperty.call(e,"type")){const t=e;return n.BitTypeUtils.getBitType(t.type).root!==n.RootBitType._error}return!1}bitToBitWrapper(e){return{bit:e}}bitToAst(e){var t;const{type:r,format:i,id:o,externalId:s,spaceId:a,padletId:l,AIGenerated:c,releaseVersion:p,ageRange:h,language:y,computerLanguage:m,target:g,tag:f,icon:b,iconTag:v,colorTag:T,flashcardSet:A,subtype:_,coverImage:P,publisher:S,publications:x,author:w,date:R,location:O,theme:k,kind:C,action:E,thumbImage:I,focusX:j,focusY:B,duration:L,deeplink:N,externalLink:M,externalLinkText:U,videoCallLink:D,bot:V,list:K,textReference:F,isTracked:G,isInfoOnly:H,labelTrue:$,labelFalse:q,quotedPerson:J,book:z,title:W,subtitle:Y,level:X,toc:Q,progress:Z,anchor:ee,reference:te,referenceEnd:re,item:ie,lead:oe,hint:se,instruction:ne,example:ae,imageSource:le,partner:ue,marks:ce,resource:de,body:pe,sampleSolution:he,elements:ye,statement:me,isCorrect:ge,cards:fe,statements:be,responses:ve,quizzes:Te,heading:Ae,pairs:_e,matrix:Pe,choices:Se,questions:xe,footer:we,placeholders:Re}=e,Oe=n.BitTypeUtils.getBitType(r),ke=null!==(t=u.TextFormat.fromValue(i))&&void 0!==t?t:u.TextFormat.bitmarkMinusMinus,Ce=this.resourceBitToAst(de),Ee=this.bodyToAst(pe,ke,Re),Ie=this.imageSourceBitToAst(le),je=this.partnerBitToAst(ue),Be=this.markConfigBitToAst(ce),Le=this.flashcardBitsToAst(fe),Ne=this.statementBitsToAst(me,ge,be,ae),Me=this.responseBitsToAst(Oe,ve),Ue=this.quizBitsToAst(Oe,Te),De=this.headingBitToAst(Ae),Ve=this.pairBitsToAst(_e),Ke=this.matrixBitsToAst(Pe),Fe=this.choiceBitsToAst(Se),Ge=this.questionBitsToAst(xe),He=this.botResponseBitsToAst(Oe,ve),$e=this.footerToAst(we,ke),{reference:qe,referenceProperty:Je}=this.referenceToAst(te);return d.bit(Object.assign(Object.assign(Object.assign({bitType:Oe,textFormat:i,id:o,externalId:s,spaceId:a,padletId:l,aiGenerated:c,releaseVersion:p,ageRange:h,language:y,computerLanguage:m,target:g,tag:f,icon:b,iconTag:v,colorTag:T,flashcardSet:A,subtype:_,coverImage:P,publisher:S,publications:x,author:w,date:R,location:O,theme:k,kind:C,action:E,duration:L,referenceProperty:Je,thumbImage:I,focusX:j,focusY:B,deeplink:N,externalLink:M,externalLinkText:U,videoCallLink:D,bot:V,list:K,textReference:F,isTracked:G,isInfoOnly:H,labelTrue:$,labelFalse:q,quotedPerson:J,book:z,title:this.parseText(W),subtitle:this.parseText(Y),level:X,toc:Q,progress:Z,anchor:ee,reference:qe,referenceEnd:re},this.parseItemLeadHintInstruction(ie,oe,se,ne)),this.parseExample(ae)),{imageSource:Ie,partner:je,markConfig:Be,resource:Ce,body:Ee,sampleSolution:he,elements:ye,flashcards:Le,statements:Ne,responses:Me,quizzes:Ue,heading:De,pairs:Ve,matrix:Ke,choices:Fe,questions:Ge,botResponses:He,footer:$e}))}imageSourceBitToAst(e){let t;if(e){const{url:r,mockupId:i,format:o,size:s,trim:n}=e;t=d.imageSource({url:r,mockupId:i,format:o,size:s,trim:n})}return t}partnerBitToAst(e){let t;if(e){const r=this.resourceDataToAst(l.ResourceType.image,e.avatarImage);t=d.partner({name:e.name,avatarImage:r})}return t}markConfigBitToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{mark:e,color:i,emphasis:o}=r,s=d.markConfig({mark:e,color:i,emphasis:o});t.push(s)}if(0!==t.length)return t}flashcardBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{question:e,answer:i,alternativeAnswers:o,item:s,lead:n,hint:a,instruction:l,example:u}=r,c=d.flashcard(Object.assign(Object.assign({question:e,answer:i,alternativeAnswers:o},this.parseItemLeadHintInstruction(s,n,a,l)),this.parseExample(u)));t.push(c)}if(0!==t.length)return t}statementBitsToAst(e,t,r,i){const o=[];if(e){const r=d.statement(Object.assign({text:e,isCorrect:null!=t&&t},this.parseExample(i)));o.push(r)}if(Array.isArray(r))for(const e of r){const{statement:t,isCorrect:r,item:i,lead:s,hint:n,instruction:a,example:l,isCaseSensitive:u}=e,c=d.statement(Object.assign(Object.assign(Object.assign({text:t,isCorrect:r},this.parseItemLeadHintInstruction(i,s,n,a)),this.parseExample(l)),{isCaseSensitive:u}));o.push(c)}if(0!==o.length)return o}choiceBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{choice:e,isCorrect:i,item:o,lead:s,hint:n,instruction:a,example:l,isCaseSensitive:u}=r,c=d.choice(Object.assign(Object.assign(Object.assign({text:e,isCorrect:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:u}));t.push(c)}if(0!==t.length)return t}responseBitsToAst(e,t){const r=[];if(e.root!==n.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,isCorrect:i,item:o,lead:s,hint:n,instruction:a,example:l,isCaseSensitive:u}=e,c=d.response(Object.assign(Object.assign(Object.assign({text:t,isCorrect:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:u}));r.push(c)}if(0!==r.length)return r}}selectOptionBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{text:e,isCorrect:i,item:o,lead:s,hint:n,instruction:a,example:l,isCaseSensitive:u}=r,c=d.selectOption(Object.assign(Object.assign(Object.assign({text:e,isCorrect:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:u}));t.push(c)}return t}highlightTextBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{text:e,isCorrect:i,isHighlighted:o,item:s,lead:n,hint:a,instruction:l,example:u,isCaseSensitive:c}=r,p=d.highlightText(Object.assign(Object.assign(Object.assign({text:e,isCorrect:i,isHighlighted:o},this.parseItemLeadHintInstruction(s,n,a,l)),this.parseExample(u)),{isCaseSensitive:c}));t.push(p)}return t}quizBitsToAst(e,t){const r=[];if(Array.isArray(t))for(const i of t){const{item:t,lead:o,hint:s,instruction:n,choices:a,responses:l}=i,u=this.choiceBitsToAst(a),c=this.responseBitsToAst(e,l),p=d.quiz(Object.assign(Object.assign({},this.parseItemLeadHintInstruction(t,o,s,n)),{choices:u,responses:c}));r.push(p)}if(0!==r.length)return r}headingBitToAst(e){let t;return e&&(t=d.heading({forKeys:e.forKeys,forValues:e.forValues})),t}pairBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{key:e,keyAudio:i,keyImage:o,values:s,item:n,lead:a,hint:u,instruction:c,example:p,isCaseSensitive:h,isLongAnswer:y}=r,m=this.resourceDataToAst(l.ResourceType.audio,i),g=this.resourceDataToAst(l.ResourceType.image,o),f=d.pair(Object.assign(Object.assign(Object.assign({key:e,keyAudio:m,keyImage:g,values:s},this.parseItemLeadHintInstruction(n,a,u,c)),this.parseExample(p)),{isCaseSensitive:h,isShortAnswer:!y}));t.push(f)}if(0!==t.length)return t}matrixBitsToAst(e){var t;const r=[];if(Array.isArray(e))for(const i of e){const{key:e,cells:o,item:s,lead:n,hint:a,instruction:l,example:u,isCaseSensitive:c,isLongAnswer:p}=i,h=d.matrix(Object.assign(Object.assign(Object.assign({key:e,cells:null!==(t=this.matrixCellsToAst(o))&&void 0!==t?t:[]},this.parseItemLeadHintInstruction(s,n,a,l)),this.parseExample(u)),{isCaseSensitive:c,isShortAnswer:!p}));r.push(h)}if(0!==r.length)return r}matrixCellsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{values:e,item:i,lead:o,hint:s,instruction:n,example:a}=r,l=d.matrixCell(Object.assign(Object.assign({values:e},this.parseItemLeadHintInstruction(i,o,s,n)),this.parseExample(a)));t.push(l)}if(0!==t.length)return t}questionBitsToAst(e){const t=[];if(Array.isArray(e))for(const r of e){const{question:e,partialAnswer:i,sampleSolution:o,item:s,lead:n,hint:a,instruction:l,example:u,isCaseSensitive:c,isShortAnswer:p}=r,h=d.question(Object.assign(Object.assign(Object.assign({question:e,partialAnswer:i,sampleSolution:o},this.parseItemLeadHintInstruction(s,n,a,l)),this.parseExample(u)),{isCaseSensitive:c,isShortAnswer:p}));t.push(h)}if(0!==t.length)return t}botResponseBitsToAst(e,t){const r=[];if(e.root===n.RootBitType.botActionResponse){if(Array.isArray(t))for(const e of t){const{response:t,reaction:i,feedback:o,item:s,lead:n,hint:a}=e,l=d.botResponse({response:t,reaction:i,feedback:o,item:this.parseText(s),lead:this.parseText(n),hint:this.parseText(a)});r.push(l)}if(0!==r.length)return r}}resourceBitToAst(e){var t;let r;if(e){const i=null!==(t=l.ResourceType.keyFromValue(e.type))&&void 0!==t?t:l.ResourceType.unknown;let o;if(e.type===l.ResourceType.imageResponsive){const t=e,i=this.resourceDataToAst(l.ResourceType.imagePortrait,t.imagePortrait),o=this.resourceDataToAst(l.ResourceType.imageLandscape,t.imageLandscape);r=p.imageResponsiveResource({imagePortrait:i,imageLandscape:o})}else if(e.type===l.ResourceType.stillImageFilm){const t=e,i=this.resourceDataToAst(l.ResourceType.image,t.image),o=this.resourceDataToAst(l.ResourceType.audio,t.audio);r=p.stillImageFilmResource({image:i,audio:o})}else{if(o=e[i],!o)return;r=this.resourceDataToAst(e.type,o)}}return r}resourceDataToAst(e,t){var r,i;let o;if(t){if(!t)return;const s=c.StringUtils.isString(t)?t:void 0,n=t.url||t.src||t.href||t.app||t.body||s,a=this.resourceDataToAst(l.ResourceType.image,t.posterImage),u=t.thumbnails?t.thumbnails.map((e=>this.resourceDataToAst(l.ResourceType.image,e))):void 0;o=p.resource({type:e,value:n,format:t.format,src1x:t.src1x,src2x:t.src2x,src3x:t.src3x,src4x:t.src4x,caption:this.parseText(t.caption),width:null!==(r=t.width)&&void 0!==r?r:void 0,height:null!==(i=t.height)&&void 0!==i?i:void 0,alt:t.alt,duration:t.duration,mute:t.mute,autoplay:t.autoplay,allowSubtitles:t.allowSubtitles,showSubtitles:t.showSubtitles,posterImage:a,thumbnails:u,siteName:t.siteName,license:t.license,copyright:t.copyright,showInIndex:t.showInIndex})}return o}bodyToAst(e,t,r){let i,o;const s={};if(Array.isArray(e)?(o=this.parseText(e,t),r=this.textGenerator.getPlaceholders()):o=e,r)for(const[e,t]of Object.entries(r)){const r=this.bodyBitToAst(t);s[e]=r}if(o){const e=[],t=c.StringUtils.splitPlaceholders(o,Object.keys(s));for(let r=0,i=t.length;r<i;r++){const i=t[r];if(s[i])e.push(s[i]);else{const t=this.bodyTextToAst(i);e.push(t)}}i=d.body({bodyParts:e})}return i}bodyTextToAst(e){return d.bodyText({text:e})}bodyBitToAst(e){switch(e.type){case a.BodyBitType.gap:return this.gapBitToAst(e);case a.BodyBitType.mark:return this.markBitToAst(e);case a.BodyBitType.select:return this.selectBitToAst(e);case a.BodyBitType.highlight:return this.highlightBitToAst(e)}return this.bodyTextToAst("")}footerToAst(e,t){const r=this.parseText(e,t);if(r)return d.footerText({text:r})}referenceToAst(e){return Array.isArray(e)&&e.length>0?{reference:void 0,referenceProperty:e}:{reference:e,referenceProperty:void 0}}gapBitToAst(e){const{item:t,lead:r,hint:i,instruction:o,example:s,isCaseSensitive:n,solutions:a}=e;return d.gap(Object.assign(Object.assign(Object.assign({solutions:a},this.parseItemLeadHintInstruction(t,r,i,o)),this.parseExample(s)),{isCaseSensitive:n}))}markBitToAst(e){const{solution:t,mark:r,item:i,lead:o,hint:s,instruction:n,example:a}=e;return d.mark(Object.assign(Object.assign({solution:t,mark:r},this.parseItemLeadHintInstruction(i,o,s,n)),this.parseExample(a)))}selectBitToAst(e){const{options:t,prefix:r,postfix:i,item:o,lead:s,hint:n,instruction:a,example:l}=e,u=this.selectOptionBitsToAst(t);return d.select(Object.assign(Object.assign(Object.assign({options:u,prefix:r,postfix:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:!0}))}highlightBitToAst(e){const{texts:t,prefix:r,postfix:i,item:o,lead:s,hint:n,instruction:a,example:l}=e,u=this.highlightTextBitsToAst(t);return d.highlight(Object.assign(Object.assign(Object.assign({texts:u,prefix:r,postfix:i},this.parseItemLeadHintInstruction(o,s,n,a)),this.parseExample(l)),{isCaseSensitive:!0}))}parseItemLeadHintInstruction(e,t,r,i){return{item:this.parseText(e),lead:this.parseText(t),hint:this.parseText(r),instruction:this.parseText(i)}}parseExample(e){if(null==e)return;const t=this.parseText(e);return t?{example:t}:{example:!!e}}parseText(e,t){if(null!=e){if(Array.isArray(e)){return this.textGenerator.generateSync(e,t)}return e}}}},406:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextParser=void 0;const i=r(1353),o=r(8436);t.TextParser=class{toAst(e,t){if(Array.isArray(e))return e;const r=e,s=Object.assign({},t);s.textFormat||(s.textFormat=i.TextFormat.bitmarkMinusMinus);const n=s.textFormat===i.TextFormat.bitmarkPlusPlus?"bitmarkPlusPlus":"bitmarkMinusMinus";return(0,o.parse)(null!=r?r:"",{startRule:n})}}},8436:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0;const i=r(4764).parse;t.parse=i},7646:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayUtils=void 0;const r=new class{asArray(e){if(null!=e)return Array.isArray(e)?e:[e]}asSingle(e,t){if(null!=e)return Array.isArray(e)?e.length>0?t?e[e.length-1]:e[0]:void 0:e}};t.ArrayUtils=r},4598:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BitUtils=void 0;const i=r(208),o=r(1895),s=r(672);const n=new class{calculateValidResourceType(e,t,r){let s;if(t&&(s=o.ResourceType.fromValue(t)),!s&&r&&(s=r.type),!s){const t=i.RootBitType.getMetadata(e.root);t&&(s=t.resourceType)}return s}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,i){if(e){Array.isArray(e)||(e=[e]);for(const o of e)if(!o.isExample&&(!i||o.isCorrect)&&(t?(o.isDefaultExample=!0,o.isExample=!0):(o.isDefaultExample=!1,o.example=s.BooleanUtils.toBoolean(r)),i))break}}};t.BitUtils=n},672:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanUtils=void 0;const r=new class{isBoolean(e){return!0===e||!1===e}isBooleanString(e){return!!this.isBoolean(e)||("true"===e||"false"===e)}toBoolean(e,t){return t?!1!==e&&"false"!==e:!0===e||"true"===e}};t.BooleanUtils=r},994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NumberUtils=void 0;const r=new class{asNumber(e,t){if(null==e)return null!=t?t:void 0;const r=+e;return Number.isNaN(r)?null!=t?t:void 0:r}};t.NumberUtils=r},4309:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUtils=void 0;const r=new class{isFunction(e){return"[object Function]"===Object.prototype.toString.call(e)}isArray(e){return Array.isArray(e)}isDate(e){return"[object Date]"===Object.prototype.toString.call(e)}isObject(e){return"[object Object]"===Object.prototype.toString.call(e)}isValue(e){return!this.isObject(e)&&!this.isArray(e)}orderProperties(e,t){const r=e,i=Object.assign({},r);for(const e of Object.keys(r))delete r[e];for(const e of t)Object.prototype.hasOwnProperty.call(i,e)&&(r[e]=i[e])}removeUndefinedProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||null==i&&delete r[e]}removeFalseProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||!1===i&&delete r[e]}removeEmptyStringProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||""===i&&delete r[e]}removeEmptyArrayProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||Array.isArray(i)&&0===i.length&&delete r[e]}removeEmptyObjectProperties(e,t){const r=e;for(const[e,i]of Object.entries(r))t&&t.indexOf(e)>=0||this.isObject(i)&&0===Object.keys(i).length&&delete r[e]}removeUnwantedProperties(e,t){(t=Object.assign({},t)).ignoreAllUndefined||this.removeUndefinedProperties(e,t.ignoreUndefined),t.ignoreAllFalse||this.removeFalseProperties(e,t.ignoreFalse),t.ignoreAllEmptyString||this.removeEmptyStringProperties(e,t.ignoreEmptyString),t.ignoreAllEmptyArrays||this.removeEmptyArrayProperties(e,t.ignoreEmptyArrays),t.ignoreAllEmptyObjects||this.removeEmptyObjectProperties(e,t.ignoreEmptyObjects)}extractSingleValue(e,t){if(!e)return;const r=e;if(null==r[t])return;let i=r[t];if(Array.isArray(i)){if(0===i.length)return;i=i[i.length-1]}return i}};t.ObjectUtils=r},3633:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StringUtils=void 0;const r=new class{isString(e){return"string"==typeof e||e instanceof String}trimmedString(e){return e?`${e}`.trim():""}splitPlaceholders(e,t){let r=[e];const i=(e,t)=>{const r=[];for(const i of e){const e=i.split(t);for(let i=0,o=e.length;i<o;i++){const s=e[i],n=i===o-1;r.push(s),n||r.push(t)}}return r};for(const e of t)r=i(r,e);return r}firstLine(e,t){const r=e;if(null==t&&(t=e.length),t<1||null==e||e.length<=t)return r;const i=e.split("\n");return i.length>0?i[0].substring(0,t):r}wordWrap(e,t){const r=[];if(t<1||null==e||e.length<=t)return r;const i=e.length,o=i-t;let s,n=0;for(;n<o;){let i;const o=n+t,a=e.indexOf("\n",n);if(a>-1&&a>n&&a<o){i=a-n,s=e.substr(n,i),n=n+i+1,r.push(s);continue}const l=e.lastIndexOf(" ",o);let u=0;l>-1&&l!=n-1?(i=l-n,i>0&&(u=n+i+1)):(i=t,u=n+t),s=e.substr(n,i),n=u,r.push(s.trim())}return n<i&&(s=e.substr(n),r.push(s)),r}};t.StringUtils=r},169:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UrlUtils=void 0;const r=new class{fileExtensionFromUrl(e){let t;if(e)try{const r=new URL(e).pathname.split(".");r.length>1&&(t=r[r.length-1])}catch(e){}return t}domainFromUrl(e){let t;if(e)try{t=new URL(e).hostname}catch(e){}return t}};t.UrlUtils=r},671:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.initEnv=t.env=void 0;const i=r(2164),o=r(7619),s=r(306),n=r(9870);const a=new class{constructor(){Object.defineProperty(this,"userAgentInfo",{value:(0,n.parseUserAgent)(),enumerable:!1}),this.bootTimestamp=Date.now(),this.app="",this.appVersion=s.EMPTY_VERSION,this.environment=this.getEnvironment(),this.environmentVersion=this.getEnvironmentVersion(),this.isBrowser=this.getIsBrowser(),this.isNode=this.environment===i.Environment.node,this.isCI=this.getIsCI(),this.NODE_ENV=this.getNodeEnv(),this.os=this.getOs(),this.osVersion=this.getOsVersion()}init(e,t){this.app=e,this.appVersion=this.parseMMBVersion(t)}get upTimestamp(){return Date.now()-this.bootTimestamp}getEnvironment(){return this.userAgentInfo?this.userAgentInfo.browser:"undefined"!=typeof process&&void 0!==process.versions&&process.versions.node?i.Environment.node:i.Environment.unknown}getEnvironmentVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.browserVersion):"undefined"!=typeof process?this.parseMMBVersion(process.version):s.EMPTY_VERSION}getOs(){return this.userAgentInfo?this.userAgentInfo.os:("undefined"!=typeof process&&void 0!==process.versions&&process.versions.node,o.Os.unknown)}getOsVersion(){return this.userAgentInfo?this.parseMMBVersion(this.userAgentInfo.osVersion):"undefined"!=typeof process?this.parseMMBVersion(""):s.EMPTY_VERSION}getIsBrowser(){return!("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof navigator||!navigator.userAgent)}getIsCI(){return!("undefined"==typeof process||!process.env||!process.env.CI)}getNodeEnv(){return"undefined"!=typeof process&&process.env?"production":""}parseMMBVersion(e){if(!e)return s.EMPTY_VERSION;e.startsWith("v")&&(e=e.substring(1));const t=e.split(".",1e3);let r="",i="",o="",n="";for(let e=0,s=t.length;e<s;e++){const s=t[e];0===e?r=s:1===e?i=s:2===e?n=s:3===e&&(o=s)}return{full:e,major:r,minor:i,patch:n,build:o}}};t.env=a;const l=a.init.bind(a);t.initEnv=l},2164:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Environment=void 0;const i=(0,r(6688).superenum)({unknown:"",node:"node",chrome:"chrome",safari:"safari",firefox:"firefox",edge:"edge",ie:"ie"});t.Environment=i},7619:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Os=void 0;const i=(0,r(6688).superenum)({unknown:"",macos:"macos",windows:"windows",linux:"linux",android:"android",ios:"ios"});t.Os=i},306:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_VERSION=void 0;t.EMPTY_VERSION={full:"",major:"",minor:"",patch:"",build:""}},9870:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseUserAgent=void 0;const i=r(2164),o=r(7619);t.parseUserAgent=function(){if("undefined"==typeof window||!window.navigator||!window.navigator.userAgent)return;const e={browser:i.Environment.unknown,os:o.Os.unknown},t=function(e){const t=e.toLowerCase().split(new RegExp("[ /,;()]","g")).reduce(((e,t)=>(t&&e.push(t),e)),[]),r={keys:new Set,versions:{}};let i="";for(let e=0,o=t.length;e<o;e++){const o=t[e];let s=!1;for(let e=0;e<=9;e++)if(o.startsWith(`${e}`)){s=!0;break}s?r.versions[i]=o.replace("_","."):r.keys.add(o),i=o}return r}(window.navigator.userAgent),r=t.keys.has("firefox"),s=t.keys.has("chrome"),n=t.keys.has("chromium"),a=t.keys.has("safari"),l=s,u=r,c=t.keys.has("macintosh");return a&&!s&&!n?(e.browser=i.Environment.safari,e.browserVersion=t.versions.version):l?(e.browser=i.Environment.chrome,e.browserVersion=t.versions.chrome):u&&(e.browser=i.Environment.firefox,e.browserVersion=t.versions.firefox),c&&(e.os=o.Os.macos,e.osVersion=t.versions.x),e}}},t={};function r(i){var o=t[i];if(void 0!==o)return o.exports;var s=t[i]={exports:{}};return e[i].call(s.exports,s,s.exports,r),s.exports}r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{var e=i;Object.defineProperty(e,"__esModule",{value:!0}),e.StreamWriter=e.FileWriter=e.BitmarkFileGenerator=e.JsonFileGenerator=e.CardSetVersion=e.BitmarkVersion=e.BitmarkParserType=e.NodeType=e.ResourceType=e.TextFormat=e.BitTypeUtils=e.AliasBitType=e.RootBitType=e.StringWriter=e.BitmarkStringGenerator=e.BitmarkGenerator=e.BitmarkParser=e.JsonStringGenerator=e.JsonGenerator=e.JsonParser=e.Ast=e.ResourceBuilder=e.Builder=e.Output=e.BitmarkParserGenerator=void 0;const t=r(7087);var o=r(390);Object.defineProperty(e,"BitmarkParserGenerator",{enumerable:!0,get:function(){return o.BitmarkParserGenerator}}),Object.defineProperty(e,"Output",{enumerable:!0,get:function(){return o.Output}});var s=r(9046);Object.defineProperty(e,"Builder",{enumerable:!0,get:function(){return s.Builder}});var n=r(8703);Object.defineProperty(e,"ResourceBuilder",{enumerable:!0,get:function(){return n.ResourceBuilder}});var a=r(8256);Object.defineProperty(e,"Ast",{enumerable:!0,get:function(){return a.Ast}});var l=r(2434);Object.defineProperty(e,"JsonParser",{enumerable:!0,get:function(){return l.JsonParser}});var u=r(3857);Object.defineProperty(e,"JsonGenerator",{enumerable:!0,get:function(){return u.JsonGenerator}});var c=r(5132);Object.defineProperty(e,"JsonStringGenerator",{enumerable:!0,get:function(){return c.JsonStringGenerator}});var d=r(9556);Object.defineProperty(e,"BitmarkParser",{enumerable:!0,get:function(){return d.BitmarkParser}});var p=r(297);Object.defineProperty(e,"BitmarkGenerator",{enumerable:!0,get:function(){return p.BitmarkGenerator}});var h=r(8582);Object.defineProperty(e,"BitmarkStringGenerator",{enumerable:!0,get:function(){return h.BitmarkStringGenerator}});var y=r(227);Object.defineProperty(e,"StringWriter",{enumerable:!0,get:function(){return y.StringWriter}});var m=r(208);Object.defineProperty(e,"RootBitType",{enumerable:!0,get:function(){return m.RootBitType}}),Object.defineProperty(e,"AliasBitType",{enumerable:!0,get:function(){return m.AliasBitType}}),Object.defineProperty(e,"BitTypeUtils",{enumerable:!0,get:function(){return m.BitTypeUtils}});var g=r(1353);Object.defineProperty(e,"TextFormat",{enumerable:!0,get:function(){return g.TextFormat}});var f=r(1895);Object.defineProperty(e,"ResourceType",{enumerable:!0,get:function(){return f.ResourceType}});var b=r(549);Object.defineProperty(e,"NodeType",{enumerable:!0,get:function(){return b.NodeType}});var v=r(6958);Object.defineProperty(e,"BitmarkParserType",{enumerable:!0,get:function(){return v.BitmarkParserType}});var T=r(8791);Object.defineProperty(e,"BitmarkVersion",{enumerable:!0,get:function(){return T.BitmarkVersion}});var A=r(8565);Object.defineProperty(e,"CardSetVersion",{enumerable:!0,get:function(){return A.CardSetVersion}});(0,t.init)()})(),i})()));
|