import{visit as e}from"unist-util-visit";import t from"cross-fetch";import{fromDom as r}from"hast-util-from-dom";import{parse as i,format as a}from"@citation-js/name";import{parse as u,format as o}from"@citation-js/date";import n from"citeproc";import s from"js-yaml";function l(){l=function(e,t){return new r(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function r(e,i,a){var u=new RegExp(e,i);return t.set(u,a||t.get(e)),m(u,r.prototype)}function i(e,r){var i=t.get(r);return Object.keys(i).reduce(function(t,r){var a=i[r];if("number"==typeof a)t[r]=e[a];else{for(var u=0;void 0===e[a[u]]&&u+1]+)>/g,function(e,t){var r=u[t];return"$"+(Array.isArray(r)?r.join("$"):r)}))}if("function"==typeof a){var o=this;return e[Symbol.replace].call(this,r,function(){var e=arguments;return"object"!=typeof e[e.length-1]&&(e=[].slice.call(e)).push(i(e,o)),a.apply(this,e)})}return e[Symbol.replace].call(this,r,a)},l.apply(this,arguments)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(b(e))return t(e).then(e=>e.text()).then(e=>e);throw new Error("Cannot read non valid URL in node env.")},b=e=>{let t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol},y=(e,t)=>[e.slice(0,t),e.slice(t)],F=(e,t)=>{const r=e.ref.author,i=t.ref.author;if(r.length!==i.length)return!1;for(let e=0;e{const t=document.createRange().createContextualFragment(e);return r(t).children[0]},A=["div","p","span","li","td","th"],x="CITATION",E=r=>(i={})=>async(a,u)=>{var o,n;let s=[];const l=i.csl||(null==u||null==(o=u.data)||null==(o=o.frontmatter)?void 0:o.csl)||"apa",m=i.lang||"en-US",D=r.plugins.config.get("@csl"),h=await(async(e,t,r="")=>{const i=e.plugins.config.get("@csl");if(Object.keys(i.templates.data).includes(t))return t;{const e=`customCSL-${Math.random().toString(36).slice(2,7)}`;let r="";b(t)&&(r=t);try{i.templates.add(e,await g(r))}catch(e){throw new Error(`Input CSL option, ${t}, is invalid or is an unknown file.`)}return e}})(r,l,i.path),E=await(async(e,t,r="")=>{const i=e.plugins.config.get("@csl");if(Object.keys(i.locales.data).includes(t))return t;{let e="";b(t)&&(e=t);try{const t=await g(e),r=t.match(/xml:lang="(.+)"/)[1];return i.locales.add(r,t),r}catch(e){throw new Error(`Input locale option, ${t}, is invalid or is an unknown file.`)}}})(r,m,i.path);let C=await(async(e,t)=>{var r;let i=[];if(e.bibliography)i="string"==typeof e.bibliography?[e.bibliography]:e.bibliography;else if(null!=t&&null!=(r=t.data)&&null!=(r=r.frontmatter)&&r.bibliography){i="string"==typeof t.data.frontmatter.bibliography?[t.data.frontmatter.bibliography]:t.data.frontmatter.bibliography;for(let e=0;ee.id),k=[],T={};let j=1;const S=D.engine(w.data,h,E,"html"),_=S.opt.xclass,O=(e=>e.cslXml.dataObj.children[0].children.find(e=>e.attrs&&e.attrs["citation-format"]).attrs["citation-format"])(S);if(e(a,"text",(e,t,r)=>{const a=e.value.match(p);if(!a||"tagName"in r&&!A.includes(r.tagName))return;let u=a.index,o=a.index+a[0].length;void 0!==a[2]&&u--;const n=[];0!==u&&n.push({type:"text",value:e.value.slice(0,u)});const[s,l]=(e=>{let t=[],r=!1;const i=e[1],a=e[2],u=e[3],o=e[4];if(void 0!==i)for(const e of i.split(";")){const r=f.exec(e.trim());if(null===r)continue;const i={id:r.groups.citekey.replace(/{(.+)}/,"$1"),prefix:void 0,locator:void 0,label:"page","suppress-author":!1,suffix:void 0},a=r.groups.prefix;void 0!==a&&(i["suppress-author"]=a.trim().endsWith("-"),i.prefix=i["suppress-author"]?a.substring(0,a.trim().length-1).trim():a.trim());const u=r.groups.explicitLocator,o=r.groups.explicitLocatorInSuffix,n=r.groups.suffix;let s,l=!0;void 0===u&&void 0===o?(s=n,l=!1):void 0===o&&void 0===u||(s=void 0!==u?u:o,i.suffix=null==n?void 0:n.trim());const{label:c,locator:m,suffix:p}=d(s,l);i.locator=m,void 0!==c&&(i.label=c),void 0===u&&void 0===o?i.suffix=p:void 0!==p&&void 0!==i.locator&&(i.locator+=p),t.push(i)}else r=!0,t.push(c({prefix:void 0,id:u.replace(/{(.+)}/,"$1"),"suppress-author":void 0!==a},d(o,!1)));return[t,r]})(a);for(const e of s)if(!B.includes(e.id))return;const[m,D]=((e,t,r,i,a,u,o,n,s)=>{const{inlineClass:l,linkCitations:c}=o,m=`${i}-${a}`,p=e.processCitationCluster({citationID:m,citationItems:r,properties:"in-text"===t?{noteIndex:0,mode:n?"composite":""}:{noteIndex:a,mode:n?"composite":""}},u.length>0?u:[],[])[1].find(e=>e[2]===m)[1],f=`citation--${r.map(e=>e.id.toLowerCase()).join("--")}--${a}`;if("note"===t)return[p,v(`${a}`)];if(c&&"numeric"===s){let e=0;const t=r.map(e=>e.id),i=p.replace(/\d+/g,function(r){const i=`${r}`;return e++,i});return[p,v(`${i}`)]}if(c&&"author-date"===s){if(1===r.length){const e=n?`${p}`:`${p.slice(0,1)}${p.slice(1,-1)}${p.slice(-1)}`;return[p,v(`${e}`)]}{const t=((e,t,r)=>{const i=[];if(r)for(const r of e.registry.reflist)t.includes(r.id)&&i.push(r);else for(const r of t)i.push(e.registry.reflist.find(e=>e.id===r));return i})(e,r.map(e=>e.id),e.opt.sort_citations),i=[];let a=p;for(const[e,r]of t.entries()){const u=r.id;let o=r.ambig;e>0&&F(t[e-1],r)&&-1===a.indexOf(o)&&(o=r.ref.issued.year.toString());const n=a.indexOf(o),[s,l]=y(a,n);i.push(s);const c=`${l.substring(0,o.length)}`;i.push(c),a=l.substr(o.length)}return i.push(a),[p,v(`${i.join("")}`)]}}return[p,v(`${p}`)]})(S,_,s,x,j,k,i,l,O);T[j]=m,k.push([`${x}-${j}`,0]),j+=1,n.push(D),oe.replace("@",""))),S.registry.mylist.length>=1&&(!i.suppressBibliography||(null==(n=i.inlineBibClass)?void 0:n.length)>0)){const t=(e=>{const[t,r]=e.makeBibliography(),i='
\n'+r.join("")+"
",a=v(i);return a.children.filter(e=>{var t;return null==(t=e.properties)||null==(t=t.className)?void 0:t.includes("csl-entry")}).forEach((e,r)=>{const i=t.entry_ids[r][0].toLowerCase();e.properties=e.properties||{},e.properties.id="bib-"+i}),a})(S);let r=!1;const u={};t.children.filter(e=>{var t;return null==(t=e.properties)||null==(t=t.className)?void 0:t.includes("csl-entry")}).forEach(e=>{const t=e.properties.id.split("-").slice(1).join("-");u[t]=c({},e),u[t].properties={id:"inlinebib-"+t}}),e(a,"element",(e,a,o)=>{var n,s;if((null==(n=i.inlineBibClass)?void 0:n.length)>0&&null!=(s=e.properties)&&null!=(s=s.id)&&s.toString().startsWith("citation-")){const[,...t]=e.properties.id.toString().split("--"),r=t.pop(),a={type:"element",tagName:"div",properties:{className:i.inlineBibClass,id:`inlineBib--${t.join("--")}--${r}`},children:t.map(e=>{const t=u[e];return t.properties={class:"inline-entry",id:`inline--${e}--${r}`},t})};o.children.push(a)}!i.suppressBibliography&&("p"===e.tagName||"div"===e.tagName)&&e.children.length>=1&&"text"===e.children[0].type&&"[^ref]"===e.children[0].value&&(o.children[a]=t,r=!0)}),i.suppressBibliography||r||a.children.push(t)}let R;if(e(a,"element",(e,t,r)=>{"section"===e.tagName&&e.properties.dataFootnotes&&(R=e,r.children.splice(t,1))}),"note"===_&&Object.keys(T).length>0){let t=[],r=1;e(a,"element",e=>{if("sup"===e.tagName&&"element"===e.children[0].type){let i=e.children[0];if("a"===i.tagName){const{href:e,id:a}=i.properties;if(e.includes("fn")&&a.includes("fnref")){const a=e.split("-").pop();t.push({type:e.includes("cite")?"citation":"existing",oldId:a}),i.properties.href=`#user-content-fn-${r}`,i.properties.id=`user-content-fnref-${r}`,i.children[0].value=r.toString(),r+=1}}}});const i=((e,t,r)=>{const i={type:"element",tagName:"ol",properties:{},children:[{type:"text",value:"\n"}]};let a;r&&(a=r.children.filter(e=>"element"==e.type).find(e=>"ol"===e.tagName));for(const[r,u]of t.entries()){const{type:t,oldId:o}=u;if("citation"===t)i.children.push({type:"element",tagName:"li",properties:{id:`user-content-fn-${r+1}`},children:[{type:"element",tagName:"p",properties:{},children:[v(`${e[o]}`),{type:"element",tagName:"a",properties:{href:`#user-content-fnref-${r+1}`,dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:"Back to content"},children:[{type:"text",value:"↩"}]}]},{type:"text",value:"\n"}]});else if("existing"===t){const e=a.children.find(e=>"li"===e.tagName&&e.properties.id===`user-content-fn-${o}`);e.properties.id=`user-content-fn-${r+1}`,e.children[1].children.find(e=>"a"===e.tagName).properties.href=`#user-content-fnref-${r+1}`,i.children.push(e)}}return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:"h2",properties:{className:["sr-only"],id:"footnote-label"},children:[{type:"text",value:"Footnotes"}]},{type:"text",value:"\n"},i]}})(T,t,R);a.children.push(i)}else R&&a.children.push(R)};var C={__proto__:null,currentVersion:function(){return this.log.length},retrieveVersion:function(e=1){if(e<=0||e>this.currentVersion())return null;{const[t,r]=this.log[e-1],i=new this.constructor(JSON.parse(t),JSON.parse(r));return i.log=this.log.slice(0,e),i}},retrieveLastVersion:function(){return this.retrieveVersion(this.currentVersion())},undo:function(e=1){return this.retrieveVersion(this.currentVersion()-e)},save:function(){return this.log.push([JSON.stringify(this.data),JSON.stringify(this._options)]),this}};const w=["real","string"],B=["json","html","string","rtf"],k=["csl","bibtex","bibtxt","citation-*","ris","ndjson"],T=["string","function"];function j(e){if("object"!=typeof e)throw new TypeError("Options not an object!");const{format:t,type:r,style:i,lang:a,append:u,prepend:o}=e;if(t&&!w.includes(t))throw new TypeError(`Option format ("${t}") should be one of: ${w}`);if(r&&!B.includes(r))throw new TypeError(`Option type ("${r}") should be one of: ${B}`);if(i&&!k.includes(i)&&!/^citation/.test(i))throw new TypeError(`Option style ("${i}") should be one of: ${k}`);if(a&&"string"!=typeof a)throw new TypeError("Option lang should be a string, but is a "+typeof a);if(o&&!T.includes(typeof o))throw new TypeError("Option prepend should be a string or a function, but is a "+typeof o);if(u&&!T.includes(typeof u))throw new TypeError("Option append should be a string or a function, but is a "+typeof u);if(/^citation/.test(i)&&"json"===r)throw new Error(`Combination type/style of json/citation-* is not valid: ${r}/${i}`);return!0}var S={__proto__:null,options:function(e,t){return j(e),t&&this.save(),Object.assign(this._options,e),this},defaultOptions:{format:"real",type:"json",style:"csl",lang:"en-US"}};function _(e){switch(e){case void 0:return"Undefined";case null:return"Null";default:return e.constructor.name}}function O(e){switch(typeof e){case"string":return"String";case"object":if(Array.isArray(e))return"Array";if("Object"===_(e))return"SimpleObject";if("Null"!==_(e))return"ComplexObject";default:return"Primitive"}}var R={__proto__:null,typeOf:_,dataTypeOf:O};function z(e,t){if(e._graph){const r=t.findIndex(({type:e})=>"@else/list+object"===e);-1!==r&&t.splice(r+1,0,...e._graph.slice(0,-1))}return e._graph=t,e}function I(e){return delete e._graph,e}var L={__proto__:null,applyGraph:z,removeGraph:I};const P={_output(e,t,r){this._log.push(t,r),this._levels.indexOf(e)P._output(e,t,r);P._console="function"==typeof console.Console?new console.Console(process.stderr):console;const $={},U={},N={};function M(e,t){switch(t){case"Array":return 0===e.length||e.every(e=>"@csl/object"===H(e))?"@csl/list+object":"@else/list+object";case"SimpleObject":case"ComplexObject":return"@csl/object";default:return"@invalid"}}function q(e=[],t){for(const r of e)if($[r].predicate(t))return q($[r].extensions,t)||r}function H(e){const t=O(e);return"Array"===t&&0===e.length?M(e,t):q(U[t],e)||M(e,t)}function J(e,{dataType:t,predicate:r,extends:i}){let a=[];if(e in N&&(a=N[e],delete N[e],P.debug("[core]",`Subclasses "${a}" finally registered to parent type "${e}"`)),$[e]={predicate:r,extensions:a},i){const t=$[i];t?t.extensions.push(e):(N[i]||(N[i]=[]),N[i].push(e),P.debug("[core]",`Subclass "${e}" is waiting on parent type "${i}"`))}else(U[t]||(U[t]=[])).push(e)}function G(e){delete $[e];const t=[...Object.keys(U).map(e=>U[e]),...Object.keys($).map(e=>$[e].extensions).filter(e=>e.length>0)];t.forEach(t=>{const r=t.indexOf(e);r>-1&&t.splice(r,1)})}const K=/^(?:@(.+?))(?:\/(?:(.+?)\+)?(?:(.+)))?$/;class V{constructor(e){this.validDataTypes=["String","Array","SimpleObject","ComplexObject","Primitive"],this.data=e}validateDataType(){const e=this.data.dataType;if(e&&!this.validDataTypes.includes(e))throw new RangeError(`dataType was ${e}; expected one of ${this.validDataTypes}`)}validateParseType(){const e=this.data.predicate;if(e&&!(e instanceof RegExp||"function"==typeof e))throw new TypeError(`predicate was ${typeof e}; expected RegExp or function`)}validateTokenList(){const e=this.data.tokenList;if(e&&"object"!=typeof e)throw new TypeError(`tokenList was ${typeof e}; expected object or RegExp`)}validatePropertyConstraint(){const e=this.data.propertyConstraint;if(e&&"object"!=typeof e)throw new TypeError(`propertyConstraint was ${typeof e}; expected array or object`)}validateElementConstraint(){const e=this.data.elementConstraint;if(e&&"string"!=typeof e)throw new TypeError(`elementConstraint was ${typeof e}; expected string`)}validateExtends(){const e=this.data.extends;if(e&&"string"!=typeof e)throw new TypeError(`extends was ${typeof e}; expected string`)}validate(){if(null===this.data||"object"!=typeof this.data)throw new TypeError(`typeParser was ${typeof this.data}; expected object`);this.validateDataType(),this.validateParseType(),this.validateTokenList(),this.validatePropertyConstraint(),this.validateElementConstraint(),this.validateExtends()}parseTokenList(){let e=this.data.tokenList;if(!e)return[];e instanceof RegExp&&(e={token:e});const{token:t,split:r=/\s+/,trim:i=!0,every:a=!0}=e,u=a?"every":"some";return[e=>(e=>i?e.trim():e)(e).split(r)[u](e=>t.test(e))]}parsePropertyConstraint(){return[].concat(this.data.propertyConstraint||[]).map(({props:e,match:t,value:r})=>{switch(e=[].concat(e),t){case"any":case"some":return t=>e.some(e=>e in t&&(!r||r(t[e])));case"none":return t=>!e.some(e=>e in t&&(!r||r(t[e])));default:return t=>e.every(e=>e in t&&(!r||r(t[e])))}})}parseElementConstraint(){const e=this.data.elementConstraint;return e?[t=>t.every(t=>H(t)===e)]:[]}parsePredicate(){return this.data.predicate instanceof RegExp?[this.data.predicate.test.bind(this.data.predicate)]:this.data.predicate?[this.data.predicate]:[]}getCombinedPredicate(){const e=[...this.parsePredicate(),...this.parseTokenList(),...this.parsePropertyConstraint(),...this.parseElementConstraint()];return 0===e.length?()=>!0:1===e.length?e[0]:t=>e.every(e=>e(t))}getDataType(){return this.data.dataType?this.data.dataType:this.data.predicate instanceof RegExp||this.data.tokenList?"String":this.data.elementConstraint?"Array":"Primitive"}get dataType(){return this.getDataType()}get predicate(){return this.getCombinedPredicate()}get extends(){return this.data.extends}}class W{constructor(e,{async:t}={}){this.parser=e,this.async=t}validate(){const e=this.parser;if("function"!=typeof e)throw new TypeError(`parser was ${typeof e}; expected function`)}}class Z{constructor(e,t={}){this.format=e,t.parseType&&(this.typeParser=new V(t.parseType)),t.parse&&(this.dataParser=new W(t.parse,{async:!1})),t.parseAsync&&(this.asyncDataParser=new W(t.parseAsync,{async:!0}))}validateFormat(){const e=this.format;if(!K.test(e))throw new TypeError(`format name was "${e}"; didn't match expected pattern`)}validate(){this.validateFormat(),this.typeParser&&this.typeParser.validate(),this.dataParser&&this.dataParser.validate(),this.asyncDataParser&&this.asyncDataParser.validate()}}var X={__proto__:null,TypeParser:V,DataParser:W,FormatParser:Z};const Y=1,Q=2,ee=3,te=4,re={article:!0,"article-journal":!0,"article-magazine":!0,"article-newspaper":!0,bill:!0,book:!0,broadcast:!0,chapter:!0,classic:!0,collection:!0,dataset:!0,document:!0,entry:!0,"entry-dictionary":!0,"entry-encyclopedia":!0,event:!0,figure:!0,graphic:!0,hearing:!0,interview:!0,legal_case:!0,legislation:!0,manuscript:!0,map:!0,motion_picture:!0,musical_score:!0,pamphlet:!0,"paper-conference":!0,patent:!0,performance:!0,periodical:!0,personal_communication:!0,post:!0,"post-weblog":!0,regulation:!0,report:!0,review:!0,"review-book":!0,software:!0,song:!0,speech:!0,standard:!0,thesis:!0,treaty:!0,webpage:!0,"journal-article":"article-journal","book-chapter":"chapter","posted-content":"manuscript","proceedings-article":"paper-conference"},ie={author:Q,chair:Q,"collection-editor":Q,compiler:Q,composer:Q,"container-author":Q,contributor:Q,curator:Q,director:Q,editor:Q,"editorial-director":Q,"executive-producer":Q,guest:Q,host:Q,interviewer:Q,illustrator:Q,narrator:Q,organizer:Q,"original-author":Q,performer:Q,producer:Q,"reviewed-author":Q,recipient:Q,"script-writer":Q,"series-creator":Q,translator:Q,accessed:ee,"available-date":ee,container:ee,"event-date":ee,issued:ee,"original-date":ee,submitted:ee,type:te,categories:"object",custom:"object",id:["string","number"],language:"string",journalAbbreviation:"string",shortTitle:"string",abstract:"string",annote:"string",archive:"string",archive_collection:"string",archive_location:"string","archive-place":"string",authority:"string","call-number":"string","chapter-number":"string","citation-number":"string","citation-key":"string","citation-label":"string","collection-number":"string","collection-title":"string","container-title":"string","container-title-short":"string",dimensions:"string",division:"string",DOI:"string",edition:["string","number"],event:"string","event-title":"string","event-place":"string","first-reference-note-number":"string",genre:"string",ISBN:"string",ISSN:"string",issue:["string","number"],jurisdiction:"string",keyword:"string",locator:"string",medium:"string",note:"string",number:["string","number"],"number-of-pages":"string","number-of-volumes":["string","number"],"original-publisher":"string","original-publisher-place":"string","original-title":"string",page:"string","page-first":"string","part-number":["string","number"],"part-title":"string",PMCID:"string",PMID:"string",printing:"string",publisher:"string","publisher-place":"string",references:"string","reviewed-title":"string","reviewed-genre":"string",scale:"string",section:"string",source:"string",status:"string",supplement:["string","number"],title:"string","title-short":"string",URL:"string",version:"string",volume:["string","number"],"volume-title":"string","volume-title-short":"string","year-suffix":"string"};function ae(e,t){return"object"==typeof e&&null!==e&&(e.literal||e.given||e.family)?e:t&&"string"==typeof e?i(e):void 0}function ue(e,t){return e.every(e=>"number"==typeof e)?e:!t||e.some(e=>isNaN(parseInt(e)))?void 0:e.map(e=>parseInt(e))}function oe(e,t,r){const i=[].concat(ie[e]);switch(ie[e]){case Y:return ae(t,r);case Q:return function(e,t){if(e instanceof Array){const r=e.map(e=>ae(e,t)).filter(Boolean);return r.length?r:void 0}}(t,r);case ee:return function(e,t){const r="date-parts";if("object"==typeof e&&null!==e){if(e[r]instanceof Array&&e[r].every(e=>e instanceof Array)){const i=e[r].map(e=>ue(e,t)).filter(Boolean);return i.length?c({},e,{"date-parts":i}):void 0}if(e instanceof Array&&e.every(e=>e[r]instanceof Array)){const i=e.map(e=>ue(e[r],t)).filter(Boolean);return i.length?{"date-parts":i}:void 0}if(e[r]instanceof Array){const i=ue(e[r],t);return i&&{"date-parts":[i]}}return"literal"in e||"raw"in e?e:void 0}}(t,r);case te:return function(e,t){return e=oe("language",e,t),!0===re[e]?e:t&&e in re?re[e]:void 0}(t,r)}if(r){if("string"==typeof t&&i.includes("number")&&!i.includes("string")&&!isNaN(+t))return parseFloat(t);if("number"==typeof t&&i.includes("string")&&!i.includes("number"))return t.toString();if(Array.isArray(t)&&t.length)return oe(e,t[0],r)}if(i.includes(typeof t))return t}function ne(e,t=!0){return e.map(function(e){const r={};for(const i in e){const a=oe(i,e[i],t);void 0!==a&&(r[i]=a)}return r})}var se={__proto__:null,clean:ne};function le(e){return Array.isArray(e)?e.map(le):("event"in(e=c({},e))&&(e["event-title"]=e.event,delete e.event),"book"===e.type&&"version"in e&&(e.type="software"),e)}function ce(e){return Array.isArray(e)?e.map(ce):("event-title"in(e=c({},e))&&(e.event=e["event-title"],delete e["event-title"]),"software"===e.type&&(e.type="book"),e)}function me(e,t=new Set){if("object"!=typeof e||null===e||e.constructor!==Object&&e.constructor!==Array)return e;if(t.has(e))throw new TypeError("Recursively copying circular structure");let r;if(t.add(e),e.constructor===Array)r=e.map(e=>me(e,t));else{const i={};for(const r in e)i[r]=me(e[r],t);r=i}return t.delete(e),r}var pe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function fe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function De(e){var t={exports:{}};return e(t,t.exports),t.exports}for(var he=[],de=[],ge="undefined"!=typeof Uint8Array?Uint8Array:Array,be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ye=0;ye<64;++ye)he[ye]=be[ye],de[be.charCodeAt(ye)]=ye;function Fe(e,t,r){for(var i,a=[],u=t;u>18&63]+he[i>>12&63]+he[i>>6&63]+he[63&i]);return a.join("")}de["-".charCodeAt(0)]=62,de["_".charCodeAt(0)]=63;var ve=function(e,t,r,i,a){var u,o,n=8*a-i-1,s=(1<>1,c=-7,m=r?a-1:0,p=r?-1:1,f=e[t+m];for(m+=p,u=f&(1<<-c)-1,f>>=-c,c+=n;c>0;u=256*u+e[t+m],m+=p,c-=8);for(o=u&(1<<-c)-1,u>>=-c,c+=i;c>0;o=256*o+e[t+m],m+=p,c-=8);if(0===u)u=1-l;else{if(u===s)return o?NaN:Infinity*(f?-1:1);o+=Math.pow(2,i),u-=l}return(f?-1:1)*o*Math.pow(2,u-i)},Ae=function(e,t,r,i,a,u){var o,n,s,l=8*u-a-1,c=(1<>1,p=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:u-1,D=i?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||Infinity===t?(n=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-o))<1&&(o--,s*=2),(t+=o+m>=1?p/s:p*Math.pow(2,1-m))*s>=2&&(o++,s/=2),o+m>=c?(n=0,o=c):o+m>=1?(n=(t*s-1)*Math.pow(2,a),o+=m):(n=t*Math.pow(2,m-1)*Math.pow(2,a),o=0));a>=8;e[r+f]=255&n,f+=D,n/=256,a-=8);for(o=o<0;e[r+f]=255&o,f+=D,o/=256,l-=8);e[r+f-D]|=128*h},xe=De(function(e,t){var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;var i=2147483647;function a(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return s(e)}return o(e,t,r)}function o(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|p(e,t),i=a(r),o=i.write(e,t);return o!==r&&(i=i.slice(0,o)),i}(e,t);if(ArrayBuffer.isView(e))return function(e){if(P(e,Uint8Array)){var t=new Uint8Array(e);return c(t.buffer,t.byteOffset,t.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(P(e,ArrayBuffer)||e&&P(e.buffer,ArrayBuffer))return c(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(P(e,SharedArrayBuffer)||e&&P(e.buffer,SharedArrayBuffer)))return c(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return u.from(i,t,r);var o=function(e){if(u.isBuffer(e)){var t=0|m(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||$(e.length)?a(0):l(e):"Buffer"===e.type&&Array.isArray(e.data)?l(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function n(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function s(e){return n(e),a(e<0?0:0|m(e))}function l(e){for(var t=e.length<0?0:0|m(e.length),r=a(t),i=0;i=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||P(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return I(e).length;default:if(a)return i?-1:z(e).length;t=(""+t).toLowerCase(),a=!0}}function f(e,t,r){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return C(this,t,r);case"latin1":case"binary":return w(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function D(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function h(e,t,r,i,a){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof t&&(t=u.from(t,i)),u.isBuffer(t))return 0===t.length?-1:d(e,t,r,i,a);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):d(e,[t],r,i,a);throw new TypeError("val must be string, number or Buffer")}function d(e,t,r,i,a){var u,o=1,n=e.length,s=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,n/=2,s/=2,r/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var c=-1;for(u=r;un&&(r=n-s),u=r;u>=0;u--){for(var m=!0,p=0;pa&&(i=a):i=a;var u=t.length;i>u/2&&(i=u/2);for(var o=0;o>8,a.push(r%256),a.push(i);return a}(t,e.length-r),e,r,i)}function A(e,t,r){return function(e){for(var t,r=e.length,i=r%3,a=[],u=16383,o=0,n=r-i;on?n:o+u));return 1===i?a.push(he[(t=e[r-1])>>2]+he[t<<4&63]+"=="):2===i&&a.push(he[(t=(e[r-2]<<8)+e[r-1])>>10]+he[t>>4&63]+he[t<<2&63]+"="),a.join("")}(0===t&&r===e.length?e:e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var i=[],a=t;a239?4:l>223?3:l>191?2:1;if(a+m<=r)switch(m){case 1:l<128&&(c=l);break;case 2:128==(192&(u=e[a+1]))&&(s=(31&l)<<6|63&u)>127&&(c=s);break;case 3:o=e[a+2],128==(192&(u=e[a+1]))&&128==(192&o)&&(s=(15&l)<<12|(63&u)<<6|63&o)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:o=e[a+2],n=e[a+3],128==(192&(u=e[a+1]))&&128==(192&o)&&128==(192&n)&&(s=(15&l)<<18|(63&u)<<12|(63&o)<<6|63&n)>65535&&s<1114112&&(c=s)}null===c?(c=65533,m=1):c>65535&&(i.push((c-=65536)>>>10&1023|55296),c=56320|1023&c),i.push(c),a+=m}return function(e){var t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);for(var r="",i=0;ii.length?u.from(o).copy(i,a):Uint8Array.prototype.set.call(i,o,a);else{if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a)}a+=o.length}return i},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},r&&(u.prototype[r]=u.prototype.inspect),u.prototype.compare=function(e,t,r,i,a){if(P(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===a&&(a=this.length),t<0||r>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=r)return 0;if(i>=a)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(a>>>=0)-(i>>>=0),n=(r>>>=0)-(t>>>=0),s=Math.min(o,n),l=this.slice(i,a),c=e.slice(t,r),m=0;m>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var a=this.length-t;if((void 0===r||r>a)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var u=!1;;)switch(i){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return b(this,e,t,r);case"ascii":case"latin1":case"binary":return y(this,e,t,r);case"base64":return F(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,e,t,r);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function C(e,t,r){var i="";r=Math.min(e.length,r);for(var a=t;ai)&&(r=i);for(var a="",u=t;ur)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,r,i,a,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||te.length)throw new RangeError("Index out of range")}function S(e,t,r,i,a,u){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function _(e,t,r,i,a){return t=+t,r>>>=0,a||S(e,0,r,4),Ae(e,t,r,i,23,4),r+4}function O(e,t,r,i,a){return t=+t,r>>>=0,a||S(e,0,r,8),Ae(e,t,r,i,52,8),r+8}u.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],a=1,u=0;++u>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=this[e],a=1,u=0;++u=(a*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var i=t,a=1,u=this[e+--i];i>0&&(a*=256);)u+=this[e+--i]*a;return u>=(a*=128)&&(u-=Math.pow(2,8*t)),u},u.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),ve(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),ve(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),ve(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),ve(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||j(this,e,t,r,Math.pow(2,8*r)-1,0);var a=1,u=0;for(this[t]=255&e;++u>>=0,r>>>=0,i||j(this,e,t,r,Math.pow(2,8*r)-1,0);var a=r-1,u=1;for(this[t+a]=255&e;--a>=0&&(u*=256);)this[t+a]=e/u&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var a=Math.pow(2,8*r-1);j(this,e,t,r,a-1,-a)}var u=0,o=1,n=0;for(this[t]=255&e;++u>0)-n&255;return t+r},u.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var a=Math.pow(2,8*r-1);j(this,e,t,r,a-1,-a)}var u=r-1,o=1,n=0;for(this[t+u]=255&e;--u>=0&&(o*=256);)e<0&&0===n&&0!==this[t+u+1]&&(n=1),this[t+u]=(e/o>>0)-n&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeFloatLE=function(e,t,r){return _(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return _(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return O(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return O(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,i){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&u.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&u.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&u.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(t-=3)>-1&&u.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;u.push(r)}else if(r<2048){if((t-=2)<0)break;u.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;u.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;u.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return u}function I(e){return function(e){var t,r,i=function(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}(e),a=i[0],u=i[1],o=new ge(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),n=0,s=u>0?a-4:a;for(r=0;r>16&255,o[n++]=t>>8&255,o[n++]=255&t;return 2===u&&(t=de[e.charCodeAt(r)]<<2|de[e.charCodeAt(r+1)]>>4,o[n++]=255&t),1===u&&(t=de[e.charCodeAt(r)]<<10|de[e.charCodeAt(r+1)]<<4|de[e.charCodeAt(r+2)]>>2,o[n++]=t>>8&255,o[n++]=255&t),o}(function(e){if((e=(e=e.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function L(e,t,r,i){for(var a=0;a=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function P(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function $(e){return e!=e}var U=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,a=0;a<16;++a)t[i+a]=e[r]+e[a];return t}()});const{Buffer:Ee}=xe;function Ce(...e){const t=new Ce.Request(...e),r=new XMLHttpRequest;r.withCredentials="include"===t.credentials,r.timeout=t[we].timeout,r.open(t.method,t.url,!1);let i=!1;try{r.responseType="arraybuffer"}catch(e){r.overrideMimeType("text/plain; charset=x-user-defined"),i=!0}for(const e of t.headers)r.setRequestHeader(...e);r.send(t.body||null);let a=r.getAllResponseHeaders();a=a&&a.split("\r\n").filter(Boolean).map(e=>e.split(": ",2));let u=r.response;if(i){const e=Ee.alloc(u.length);for(let t=0;t=200&&e<300}get redirected(){return this[we].redirected}get status(){return this[we].status}get statusText(){return this[we].statusText}get url(){return this[we].url}clone(){return this.redirect(this[we].url,this[we].status)}redirect(e,t){_e(this);const r=new je(this[we].body,{headers:this[we].headers,status:t||this[we].status,statusText:ke[t]||this[we].statusText});return r[we].url=e||this[we].url,r[we].redirected=this[we].redirected,r}}class Se{constructor(e){this[we]={body:Ee.from(e),bodyUsed:!1}}get bodyUsed(){return this[we].bodyUsed}static mixin(e){for(const t of Object.getOwnPropertyNames(Se.prototype)){if("constructor"===t)continue;const r=Object.getOwnPropertyDescriptor(Se.prototype,t);Object.defineProperty(e,t,{...r,enumerable:!0})}}arrayBuffer(){const e=Oe(this);return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}blob(){const e=this.headers&&this.headers.get("content-type");return new Blob([Oe(this)],e&&{type:e})}text(){return Oe(this).toString()}json(){try{return JSON.parse(Oe(this).toString())}catch(e){throw new TypeError(`invalid json response body at ${this.url} reason: ${e.message}`,"invalid-json")}}buffer(){return Oe(this).clone()}}function _e(e){if(e.bodyUsed)throw new TypeError(`body used already for: ${e.url}`)}function Oe(e){return _e(e),e[we].bodyUsed=!0,e[we].body||Ee.alloc(0)}Se.mixin(Te.prototype),Se.mixin(je.prototype);class Re{constructor(e){if(e instanceof Ce.Headers)this[we]={...e[we]};else if(this[we]={},Array.isArray(e))for(const[t,r]of e)this.append(t,r);else if("object"==typeof e)for(const t in e)this.set(t,e[t])}append(e,t){e=e.toLowerCase(),this[we][e]||(this[we][e]=[]),this[we][e].push(t)}delete(e){delete this[we][e.toLowerCase()]}set(e,t){this[we][e.toLowerCase()]=[t]}entries(){const e=[];for(const t in this[we])for(const r of this[we][t])e.push([t,r]);return e}get(e){return(e=e.toLowerCase())in this[we]?this[we][e].join(", "):null}keys(){return Object.keys(this[we])}has(e){return e.toLowerCase()in this[we]}values(){const e=[];for(const t in this[we])for(const r of this[we][t])e.push(r);return e}*[Symbol.iterator](){for(const e in this[we])for(const t of this[we][e])yield[e,t]}}Ce.Headers=Re,Ce.Request=Te,Ce.Response=je;var ze=De(function(e,t){!function(r){e.exports=function(e){var i=e&&e.Promise||r.Promise,a=e&&e.XMLHttpRequest||r.XMLHttpRequest;return function(){var e=Object.create(r,{fetch:{value:void 0,writable:!0}});return function(t){var r=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==r&&r,u="URLSearchParams"in r,o="Symbol"in r&&"iterator"in Symbol,n="FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in r,l="ArrayBuffer"in r;if(l)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function p(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function f(e){return"string"!=typeof e&&(e=String(e)),e}function D(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return o&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function d(e){if(e.bodyUsed)return i.reject(new TypeError("Already read"));e.bodyUsed=!0}function g(e){return new i(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function b(e){var t=new FileReader,r=g(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function F(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:n&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:u&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():l&&n&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l&&(ArrayBuffer.prototype.isPrototypeOf(e)||m(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return i.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return i.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return i.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?i.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):i.resolve(this._bodyArrayBuffer)):this.blob().then(b)}),this.text=function(){var e,t,r,a=d(this);if(a)return a;if(this._bodyBlob)return e=this._bodyBlob,r=g(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return i.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),i=0;i-1?i:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&a)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(a),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var u=/([?&])_=[^&]*/;u.test(this.url)?this.url=this.url.replace(u,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function x(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),i=r.shift().replace(/\+/g," "),a=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(a))}}),t}function E(e,t){if(!(this instanceof E))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"",this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}A.prototype.clone=function(){return new A(this,{body:this._bodyInit})},F.call(A.prototype),F.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},E.error=function(){var e=new E(null,{status:0,statusText:""});return e.type="error",e};var C=[301,302,303,307,308];E.redirect=function(e,t){if(-1===C.indexOf(t))throw new RangeError("Invalid status code");return new E(null,{status:t,headers:{location:e}})},t.DOMException=r.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function w(e,u){return new i(function(i,o){var s=new A(e,u);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var c=new a;function m(){c.abort()}c.onload=function(){var e,t,r={status:c.status,statusText:c.statusText,headers:(e=c.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var r=e.split(":"),i=r.shift().trim();if(i){var a=r.join(":").trim();t.append(i,a)}}),t)};r.url="responseURL"in c?c.responseURL:r.headers.get("X-Request-URL");var a="response"in c?c.response:c.responseText;setTimeout(function(){i(new E(a,r))},0)},c.onerror=function(){setTimeout(function(){o(new TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){o(new TypeError("Network request failed"))},0)},c.onabort=function(){setTimeout(function(){o(new t.DOMException("Aborted","AbortError"))},0)},c.open(s.method,function(e){try{return""===e&&r.location.href?r.location.href:e}catch(t){return e}}(s.url),!0),"include"===s.credentials?c.withCredentials=!0:"omit"===s.credentials&&(c.withCredentials=!1),"responseType"in c&&(n?c.responseType="blob":l&&s.headers.get("Content-Type")&&-1!==s.headers.get("Content-Type").indexOf("application/octet-stream")&&(c.responseType="arraybuffer")),!u||"object"!=typeof u.headers||u.headers instanceof h?s.headers.forEach(function(e,t){c.setRequestHeader(t,e)}):Object.getOwnPropertyNames(u.headers).forEach(function(e){c.setRequestHeader(e,f(u.headers[e]))}),s.signal&&(s.signal.addEventListener("abort",m),c.onreadystatechange=function(){4===c.readyState&&s.signal.removeEventListener("abort",m)}),c.send(void 0===s._bodyInit?null:s._bodyInit)})}w.polyfill=!0,r.fetch||(r.fetch=w,r.Headers=h,r.Request=A,r.Response=E),t.Headers=h,t.Request=A,t.Response=E,t.fetch=w,Object.defineProperty(t,"__esModule",{value:!0})}(t),{fetch:e.fetch,Headers:e.Headers,Request:e.Request,Response:e.Response,DOMException:e.DOMException}}()}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:pe)});function Ie(e,t){let r;for(;void 0===r||e.includes(r);)r=`${t}${Math.random().toString().slice(2)}`;return r}/*@__PURE__*/fe(ze)();class Le{constructor(e={}){this.data=e}set(e,t){return this.data[e]=t,this}add(...e){return this.set(...e)}delete(e){return delete this.data[e],this}remove(...e){return this.delete(...e)}get(e){return this.data[e]}has(e){return Object.prototype.hasOwnProperty.call(this.data,e)}list(){return Object.keys(this.data)}}class Pe{constructor(e,t){this.rules=e,this.defaultState=t,this.mainRule=Object.keys(e)[0],this.log=[]}parse(e,t){return this.lexer=e,this.token=this.lexer.next(),this.state=me(this.defaultState),this.log=[],this.consumeRule(t||this.mainRule)}matchEndOfFile(){return!this.token}matchToken(e){return this.token&&e===this.token.type}consumeToken(e,t){const r=this.token;if(!e||r&&r.type===e)return this.token=this.lexer.next(),r;if(!t){const t=new SyntaxError(this.lexer.formatError(r,`expected "${e}", got ${r?`"${r.type}"`:"EOF"}`));throw t.message+=` (${this.log.join("->")})`,t}}consumeRule(e){this.log.push(e);const t=this.rules[e].call(this);return this.log.pop(),t}}function $e(e,t){return t=t===Ue.CONVERT_TO_SOURCE,e=e.map(e=>function(e,t){let r,i,a,u;if("string"==typeof e)r=i=e;else{if(!e)return null;r=t?e.target:e.source,i=t?e.source:e.target,e.convert&&(a=t?e.convert.toSource:e.convert.toTarget),e.when&&(u=t?e.when.target:e.when.source,null!=u&&(u=function(e){return function(t){return"boolean"==typeof e?e:Object.keys(e).every(r=>{const i=e[r];return!0===i?r in t:!1===i?!(r in t):"function"==typeof i?i(t[r]):Array.isArray(i)?i.includes(t[r]):t[r]===i})}}(u)))}return r=[].concat(r).filter(Boolean),i=[].concat(i).filter(Boolean),{inputProp:r,outputProp:i,convert:a,condition:u}}(e,t)).filter(Boolean),function(t){const r={};for(const{inputProp:i,outputProp:a,convert:u,condition:o}of e){if(0===a.length)continue;if(o&&!o(t))continue;if(0!==i.length&&i.every(e=>!(e in t)))continue;let e=i.map(e=>t[e]);if(u)try{const r=u.apply(t,e);e=1===a.length?[r]:r}catch(e){throw new Error(`Failed to convert ${i} to ${a}`,{cause:e})}a.forEach((t,i)=>{const a=e[i];void 0!==a&&(r[t]=a)})}return r}}class Ue{constructor(e){this.convertToSource=$e(e,Ue.CONVERT_TO_SOURCE),this.convertToTarget=$e(e,Ue.CONVERT_TO_TARGET)}}Ue.CONVERT_TO_SOURCE=Symbol("convert to source"),Ue.CONVERT_TO_TARGET=Symbol("convert to target");class Ne{constructor(e,t={}){this.options=Object.assign({generateGraph:!0,forceType:H(e),maxChainLength:10,strict:!0,target:"@csl/list+object"},t),this.type=this.options.forceType,this.data="object"==typeof e?me(e):e,this.graph=[{type:this.type,data:e}],this.iteration=0}iterate(){if(0!==this.iteration){const e=et(this.type);this.type=e&&e.outputs?e.outputs:H(this.data),this.graph.push({type:this.type})}return!this.error&&this.type!==this.options.target&&(this.iteration>=this.options.maxChainLength?(this.error=new RangeError(`Max. number of parsing iterations reached (${function(e){return e.reduce((e,t)=>{const r=e[e.length-1];return r&&r.type===t.type?r.count=r.count+1||2:e.push(t),e},[]).map(e=>(e.count>1?e.count+"x ":"")+e.type).join(" -> ")}(this.graph)})`),!1):(this.iteration++,!0))}end(){if(this.error){if(P.error("[core]",this.error.message),!1!==this.options.strict)throw this.error;return[]}return"@csl/list+object"===this.options.target?le(this.data).map(this.options.generateGraph?e=>z(e,this.graph):I):this.data}}const Me=(...e)=>{const t=new Ne(...e);for(;t.iterate();)try{t.data=Ve(t.data,t.type)}catch(e){t.error=e}return t.end()},qe=async(...e)=>{const t=new Ne(...e);for(;t.iterate();)t.data=await We(t.data,t.type).catch(e=>{t.error=e});return t.end()},He={},Je={},Ge={"@csl/object":e=>[e],"@csl/list+object":e=>e,"@else/list+object":e=>e.map(Me).flat(),"@invalid":()=>{throw new Error("This format is not supported or recognized")}},Ke={"@else/list+object":async e=>(await Promise.all(e.map(qe))).flat()};function Ve(e,t){if("function"==typeof He[t])return He[t](e);throw new Error("This format is not supported or recognized")}async function We(e,t){if("function"==typeof Je[t])return Je[t](e);if("function"==typeof Ke[t])return Ke[t](e);if(Xe(t,!1))return Ve(e,t);throw new TypeError(`No parser found for ${t}`)}function Ze(e,{parser:t,async:r}){r?Je[e]=t:He[e]=t}function Xe(e,t){return t?Je[e]||Ke[e]:He[e]||Ge[e]}function Ye(e,t){delete(t?Je:He)[e]}const Qe={};function et(e){return Qe[e]}var tt={__proto__:null,util:Object.assign({},R,L,X,se),add:function(e,t){const r=new Z(e,t);r.validate();const i=Qe[e]||(Qe[e]={});r.typeParser&&(J(e,r.typeParser),i.type=!0),r.dataParser&&(Ze(e,r.dataParser),i.data=!0),r.asyncDataParser&&(Ze(e,r.asyncDataParser),i.asyncData=!0),t.outputs&&(i.outputs=t.outputs)},get:et,remove:function(e){const t=Qe[e];t&&(t.type&&G(e),t.data&&Ye(e),t.asyncData&&Ye(e,!0),delete Qe[e])},has:function(e){return e in Qe},list:function(){return Object.keys(Qe)},chain:Me,chainLink:e=>{const t=H(e);return Ve(t.match(/array|object/)?me(e):e,t)},chainAsync:qe,chainLinkAsync:async e=>{const t=H(e);return We(t.match(/array|object/)?me(e):e,t)},type:H,addTypeParser:J,hasTypeParser:function(e){return Object.prototype.hasOwnProperty.call($,e)},removeTypeParser:G,listTypeParser:function(){return Object.keys($)},treeTypeParser:function(){const e=t=>({name:t,children:$[t].extensions.map(e)});return{name:"Type tree",children:Object.keys(U).map(t=>({name:t,children:U[t].map(e)}))}},typeMatcher:K,data:Ve,dataAsync:We,addDataParser:Ze,hasDataParser:Xe,removeDataParser:Ye,listDataParser:function(e){return Object.keys(e?Je:He)}},rt={__proto__:null,add:function(e,t={},r=!1){return!0!==t&&!0!==r||this.save(),this.data.push(...Me(e,t)),this.data.filter(e=>!Object.prototype.hasOwnProperty.call(e,"id")).forEach(e=>{e.id=Ie(this.getIds(),"temp_id_")}),this},addAsync:async function(e,t={},r=!1){return!0!==t&&!0!==r||this.save(),this.data.push(...await qe(e,t)),this.data.filter(e=>!Object.prototype.hasOwnProperty.call(e,"id")).forEach(e=>{e.id=Ie(this.getIds(),"temp_id_")}),this},set:function(e,t={},r=!1){return!0!==t&&!0!==r||this.save(),this.data=[],"boolean"!=typeof t?this.add(e,t):this.add(e)},setAsync:async function(e,t={},r=!1){return!0!==t&&!0!==r||this.save(),this.data=[],"boolean"!=typeof t?this.addAsync(e,t):this.addAsync(e)},reset:function(e){return e&&this.save(),this.data=[],this._options={},this}};function it(e){if("citation-label"in e)return e["citation-label"];let t="";return e.author&&(t+=e.author[0].family||e.author[0].literal),e.issued&&e.issued["date-parts"]&&e.issued["date-parts"][0]&&(t+=e.issued["date-parts"][0][0]),e["year-suffix"]?t+=e["year-suffix"]:e.title&&(t+=e.title.replace(/<\/?.*?>/g,"").match(/^(?:(?:the|a|an)\s+)?(\S+)/i)[1]),t}var at={label:e=>e.reduce((e,t)=>(e[t.id]=it(t),e),{})};function ut(e,t,r="label"===t){let i=r?it(e):e[t];switch(t){case"author":case"editor":return i.map(e=>e.literal||e.family||a(e));case"accessed":case"issued":return i["date-parts"][0];case"page":return i.split("-").map(e=>parseInt(e));case"edition":case"issue":case"volume":return i=parseInt(i),isNaN(i)?-Infinity:i;default:return i||-Infinity}}function ot(e,t,r,i=/^!/.test(r)){const a=ut(e,r=r.replace(/^!/,"")),u=ut(t,r);return(i?-1:1)*(a>u?1:a{const i=e.slice();let a=0;for(;!a&&i.length;)a=ot(t,r,i.shift());return a}}(...e,"label")),this}};const st=new Le;function lt(e,t,...r){if(!st.has(e))throw new Error(`Output format "${e}" unavailable`);return st.get(e)(t,...r)}var ct={__proto__:null,register:st,add:function(e,t){!function(e,t){if("string"!=typeof e)throw new TypeError("Invalid output format name, expected string, got "+typeof e);if("function"!=typeof t)throw new TypeError("Invalid formatter, expected function, got "+typeof t)}(e,t),st.set(e,t)},remove:function(e){st.remove(e)},has:function(e){return st.has(e)},list:function(){return st.list()},format:lt},mt={__proto__:null,getIds:function(){return this.data.map(e=>e.id)},format:function(e,...t){return lt(e,ne(this.data),...t)},get:function(e={}){j(e);const t=Object.assign({},this.defaultOptions,this._options.output,e),{type:r,style:i}=t,[a,u]=i.split("-"),o="citation"===a?"bibliography":"csl"===a?"data":a,n="string"===r?"text":"json"===r?"object":r;let s;switch(o){case"bibliography":{const{lang:e,append:r,prepend:i}=t;s={template:u,lang:e,format:n,append:r,prepend:i};break}case"data":case"bibtex":case"bibtxt":case"ndjson":case"ris":s={type:n};break;default:throw new Error(`Invalid style "${o}"`)}const l=this.format(o,Object.assign(s,e._newOptions)),{format:c}=t;if("real"===c&&"html"===n&&"undefined"!=typeof document&&"function"==typeof document.createElement){const e=document.createElement("div");return e.innerHTML=l,e.firstChild}return"string"===c&&"object"==typeof l?JSON.stringify(l):l}},pt={__proto__:null,async:function(e,t,r){"function"!=typeof t||r||(r=t,t=void 0);const i=(new this).setAsync(e,t);return"function"==typeof r?void i.then(r):i},validateOutputOptions:j,validateOptions:function(e){if("object"!=typeof e)throw new TypeError("Options should be an object");if(e.output)j(e.output);else{if(e.maxChainLength&&"number"!=typeof e.maxChainLength)throw new TypeError("Option maxChainLength should be a number");if(e.forceType&&"string"!=typeof e.forceType)throw new TypeError("Option forceType should be a string");if(null!=e.generateGraph&&"boolean"!=typeof e.generateGraph)throw new TypeError("Option generateGraph should be a boolean");if(null!=e.strict&&"boolean"!=typeof e.strict)throw new TypeError("Option strict should be a boolean");if(null!=e.target&&"string"!=typeof e.target)throw new TypeError("Option target should be a boolean")}return!0}};function ft(e,t={}){return this instanceof ft?(this._options=t,this.log=[],this.data=[],e.forEach(e=>{this.add(e,t)}),this.options(t),this):new ft(e,t)}Object.assign(ft.prototype,C,S,rt,nt,mt),ft.prototype[Symbol.iterator]=function*(){yield*this.data},Object.assign(ft,pt);const Dt=new Le({html:{bibliographyContainer:['
',"
"],entry:['
',"
"],list:['
    ',"
"],listItem:["
  • ","
  • "]},text:{bibliographyContainer:["","\n"],entry:["","\n"],list:["\n",""],listItem:["\t","\n"]}});function ht(e){return Dt.has(e)}function dt(e){if(!Dt.has(e))throw new Error(`Dict "${e}" unavailable`);return Dt.get(e)}var gt={__proto__:null,register:Dt,add:function(e,t){!function(e,t){if("string"!=typeof e)throw new TypeError("Invalid dict name, expected string, got "+typeof e);if("object"!=typeof t)throw new TypeError("Invalid dict, expected object, got "+typeof t);for(const e in t){const r=t[e];if(!Array.isArray(r)||r.some(e=>"string"!=typeof e))throw new TypeError(`Invalid dict entry "${e}", expected array of strings`)}}(e,t),Dt.set(e,t)},remove:function(e){Dt.remove(e)},has:ht,list:function(){return Dt.list()},get:dt,htmlDict:{wr_start:'
    ',wr_end:"
    ",en_start:'
    ',en_end:"
    ",ul_start:'
      ',ul_end:"
    ",li_start:"
  • ",li_end:"
  • "},textDict:{wr_start:"",wr_end:"\n",en_start:"",en_end:"\n",ul_start:"\n",ul_end:"",li_start:"\t",li_end:"\n"}};const bt={};var yt={__proto__:null,add:function(e,t){bt[e]=t},get:function(e){return bt[e]},has:function(e){return Object.prototype.hasOwnProperty.call(bt,e)},remove:function(e){delete bt[e]},list:function(){return Object.keys(bt)}};const Ft={input:tt,output:ct,dict:gt,config:yt},vt={};function At(e,t={}){const r=vt[e]={};for(const i in t){if("config"===i){r.config={[e]:t.config},Ft.config.add(e,t.config);continue}const a=r[i]={},u=t[i];for(const e in u){const t=u[e];a[e]=!0,Ft[i].add(e,t)}}}var xt={__proto__:null,add:At,remove:function(e){const t=vt[e];for(const e in t){const r=t[e];for(const t in r)Ft[e].remove(t)}delete vt[e]},has:function(e){return e in vt},list:function(){return Object.keys(vt)},input:tt,output:ct,dict:gt,config:yt};function Et(){return[]}const Ct=[[/((?:\[|:|,)\s*)'((?:\\'|[^'])*?[^\\])?'(?=\s*(?:\]|}|,))/g,'$1"$2"'],[/((?:(?:"|]|}|\/[gmiuys]|\.|(?:\d|\.|-)*\d)\s*,|{)\s*)(?:"([^":\n]+?)"|'([^":\n]+?)'|([^":\n]+?))(\s*):/g,'$1"$2$3$4"$5:']],wt={"@empty/text":{parse:Et,parseType:{dataType:"String",predicate:e=>""===e}},"@empty/whitespace+text":{parse:Et,parseType:{dataType:"String",predicate:/^\s+$/}},"@empty":{parse:Et,parseType:{dataType:"Primitive",predicate:e=>null==e}},"@else/json":{parse:function(e){if("string"!=typeof e)return JSON.parse(e);try{return JSON.parse(e)}catch(t){return P.debug("[plugin-common]","Invalid JSON, switching to experimental parser"),Ct.forEach(([t,r])=>{e=e.replace(t,r)}),JSON.parse(e)}},parseType:{dataType:"String",predicate:/^\s*(\{[\S\s]*\}|\[[\S\s]*\])\s*$/}},"@else/url":{parseType:{dataType:"String",predicate:/^https?:\/\/(([\w-]+\.)*[\w-]+)(:\d+)?(\/[^?/]*)*(\?[^#]*)?(#.*)?$/i}},"@else/jquery":{parse:function(e){return e.val()||e.text()||e.html()},parseType:{dataType:"ComplexObject",predicate:e=>"undefined"!=typeof jQuery&&e instanceof jQuery}},"@else/html":{parse:function(e){return e.value||e.textContent},parseType:{dataType:"ComplexObject",predicate:e=>"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}}};function Bt(e,t,r){return e+(tTt(e,t)):Object.keys(e).filter(t=>JSON.stringify(e[t])).map(r=>`"${r}": ${Tt(e[r],t)}`),i=i.map(Bt).map(e=>t.listItem.join(e)),i=t.list.join(i.join("")),r?`[${i}]`:`{${i}}`}function Tt(e,t){return"object"==typeof e&&null!==e?0===e.length?"[]":0===Object.keys(e).length?"{}":kt(e,t):JSON.stringify(e)}var jt={data:(e,{type:t,format:r=t||"text",version:i="1.0.2"}={})=>(i<"1.0.2"&&(e=ce(e)),"object"===r?me(e):"text"===r?JSON.stringify(e,null,2):(P.warn("[core]","This feature (JSON output with special formatting) is unstable. See https://github.com/larsgw/citation.js/issues/144"),function(e,t){let r=e.map(e=>kt(e,t));return r=r.map(Bt).map(e=>t.entry.join(e)),r=r.join(""),t.bibliographyContainer.join(`[${r}]`)}(e,dt(r)))),ndjson:(e,{version:t="1.0.2"}={})=>(t<"1.0.2"&&(e=ce(e)),e.map(e=>JSON.stringify(e)).join("\n"))};function St(e){const{firstname:t,lastname:r,firstName:a=t,lastName:u=r}=e;return a&&u?{given:a,family:u}:e.name?i(e.name):void 0}At("@else",{input:wt,output:Object.assign({},jt,at)});const _t=["PMID","PMCID","DOI","ISBN"],Ot=["ISSN"];function Rt(e,t){const r={};for(const i in e){const a=i.toUpperCase();t.includes(a)&&(r[a]=e[i])}if(e.identifier)for(let{id:i,type:a=""}of e.identifier)a=a.toUpperCase(),t.includes(a)&&(r[a]=i);return r}const zt={article:"article",book:"book",booklet:"book",proceedings:"book",mastersthesis:"thesis",inbook:"chapter",incollection:"chapter",conference:"paper-conference",inproceedings:"paper-conference",manual:"report",misc:"document",online:"website",patent:"patent",phdthesis:"thesis",techreport:"report",unpublished:"manuscript"};function It(e){const t={type:zt[e.type]||"document",title:e.title};if(e.author&&(t.author=e.author.map(St).filter(Boolean)),e.editor&&(t.editor=e.editor.map(St).filter(Boolean)),e.reviewer&&(e.author&&(t["reviewed-author"]=t.author),t.author=e.reviewer.map(St).filter(Boolean)),Array.isArray(e.keywords)?t.keyword=e.keywords.join():e.keywords&&(t.keyword=e.keywords),e.publisher&&(t.publisher=e.publisher.name||e.publisher),e.date&&e.date.published?t.issued=u(e.date.published):e.year&&(t.issued={"date-parts":[[+e.year]]}),e.date&&e.date.submitted&&(t.submitted=u(e.date.submitted)),e.journal){const r=e.journal;r.name&&(t["container-title"]=r.name),r.volume&&(t.volume=r.volume),r.issue&&(t.issue=r.issue),Object.assign(t,Rt(r,Ot)),r.firstpage&&(t["page-first"]=r.firstpage),r.pages?t.page=r.pages.replace("--","-"):r.firstpage&&r.lastpage&&(t.page=r.firstpage+"-"+r.lastpage)}return e.link&&"object"==typeof e.link[0]&&(t.URL=e.link[0].url),Object.assign(t,Rt(e,_t)),e.cid?t.id=e.cid:t.DOI&&(t.id=t.DOI),t}const Lt=["fulltext_html","fulltext_xml","fulltext_pdf"],Pt=["name","lastname","lastName","firstname","firstName"],$t={"@bibjson/quickscrape+record+object":{parse:function(e){return Object.assign(It(e),{type:"article-journal"})},parseType:{propertyConstraint:{props:"link",value:e=>Lt.some(t=>e.find(({type:e})=>e===t))},extends:"@bibjson/record+object"}},"@bibjson/record+object":{parse:function(e){return It(e)},parseType:{dataType:"SimpleObject",propertyConstraint:[{props:"title"},{props:["author","editor"],match:"some",value:e=>Array.isArray(e)&&e[0]&&Pt.some(t=>t in e[0])}]}},"@bibjson/collection+object":{parse:e=>e.records,parseType:{dataType:"SimpleObject",propertyConstraint:[{props:"metadata",value:e=>"collection"in e},{props:"records",value:e=>Array.isArray(e)}]}}};At("@bibjson",{input:$t});var Ut=De(function(e){!function(t,r){e.exports?e.exports=r():t.moo=r()}(pe,function(){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r="boolean"==typeof(new RegExp).sticky;function i(e){return e&&"[object RegExp]"===t.call(e)}function a(e){return e&&"object"==typeof e&&!i(e)&&!Array.isArray(e)}function u(e){return e.length?"(?:"+e.map(function(e){return"(?:"+e+")"}).join("|")+")":"(?!)"}function o(e){if("string"==typeof e)return"(?:"+e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+")";if(i(e)){if(e.ignoreCase)throw new Error("RegExp /i flag not allowed");if(e.global)throw new Error("RegExp /g flag is implied");if(e.sticky)throw new Error("RegExp /y flag is implied");if(e.multiline)throw new Error("RegExp /m flag is implied");return e.source}throw new Error("Not a pattern: "+e)}function n(e,t){return e.length>t?e:Array(t-e.length+1).join(" ")+e}function s(t,r){if(a(r)||(r={match:r}),r.include)throw new Error("Matching rules cannot also include states");var u={defaultType:t,lineBreaks:!!r.error||!!r.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var o in r)e.call(r,o)&&(u[o]=r[o]);if("string"==typeof u.type&&t!==u.type)throw new Error("Type transform cannot be a string (type '"+u.type+"' for token '"+t+"')");var n=u.match;return u.match=Array.isArray(n)?n:n?[n]:[],u.match.sort(function(e,t){return i(e)&&i(t)?0:i(t)?-1:i(e)?1:t.length-e.length}),u}function l(e){return Array.isArray(e)?function(e){for(var t=[],r=0;r0)throw new Error("RegExp has capture groups: "+y+"\nUse (?: … ) instead");if(!D.lineBreaks&&y.test("\n"))throw new Error("Rule should declare lineBreaks: "+y);p.push("("+b+")")}}var F=a&&a.fallback,v=r&&!F?"ym":"gm",A=r||F?"":"|";return!0===l&&(v+="u"),{regexp:new RegExp(u(p)+A,v),groups:m,fast:n,error:a||c}}function p(e,t,r){var i=e&&(e.push||e.next);if(i&&!r[i])throw new Error("Missing state '"+i+"' (in token '"+e.defaultType+"' of state '"+t+"')");if(e&&e.pop&&1!=+e.pop)throw new Error("pop must be 1 (in token '"+e.defaultType+"' of state '"+t+"')")}var f=function(e,t){this.startState=t,this.states=e,this.buffer="",this.stack=[],this.reset()};f.prototype.reset=function(e,t){return this.buffer=e||"",this.index=0,this.line=t?t.line:1,this.col=t?t.col:1,this.queuedToken=t?t.queuedToken:null,this.queuedText=t?t.queuedText:"",this.queuedThrow=t?t.queuedThrow:null,this.setState(t?t.state:this.startState),this.stack=t&&t.stack?t.stack.slice():[],this},f.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},f.prototype.setState=function(e){if(e&&this.state!==e){this.state=e;var t=this.states[e];this.groups=t.groups,this.error=t.error,this.re=t.regexp,this.fast=t.fast}},f.prototype.popState=function(){this.setState(this.stack.pop())},f.prototype.pushState=function(e){this.stack.push(this.state),this.setState(e)};var D=r?function(e,t){return e.exec(t)}:function(e,t){var r=e.exec(t);return 0===r[0].length?null:r};function h(){return this.value}if(f.prototype._getGroup=function(e){for(var t=this.groups.length,r=0;r",textbackslash:"\\",textasciicircum:"^",textunderscore:"_",textbraceleft:"{",textbar:"|",textbraceright:"}",textasciitilde:"~",textexclamdown:"¡",textcent:"¢",textsterling:"£",textcurrency:"¤",textyen:"¥",textbrokenbar:"¦",textsection:"§",textasciidieresis:"¨",textcopyright:"©",textordfeminine:"ª",guillemetleft:"«",guillemotleft:"«",textlnot:"¬",textregistered:"®",textasciimacron:"¯",textdegree:"°",textpm:"±",texttwosuperior:"²",textthreesuperior:"³",textasciiacute:"´",textmu:"µ",textparagraph:"¶",textperiodcentered:"·",textonesuperior:"¹",textordmasculine:"º",guillemetright:"»",guillemotright:"»",textonequarter:"¼",textonehalf:"½",textthreequarters:"¾",textquestiondown:"¿",AE:"Æ",DH:"Ð",texttimes:"×",O:"Ø",TH:"Þ",ss:"ß",ae:"æ",dh:"ð",textdiv:"÷",o:"ø",th:"þ",DJ:"Đ",dj:"đ",i:"ı",IJ:"IJ",ij:"ij",L:"Ł",l:"ł",NG:"Ŋ",ng:"ŋ",OE:"Œ",oe:"œ",textflorin:"ƒ",j:"ȷ",textasciicaron:"ˇ",textasciibreve:"˘",textacutedbl:"˝",textgravedbl:"˵",texttildelow:"˷",textbaht:"฿",SS:"ẞ",textcompwordmark:"‌",textendash:"–",textemdash:"—",textbardbl:"‖",textquoteleft:"‘",textquoteright:"’",quotesinglbase:"‚",textquotedblleft:"“",textquotedblright:"”",quotedblbase:"„",textdagger:"†",textdaggerdbl:"‡",textbullet:"•",textellipsis:"…",textperthousand:"‰",textpertenthousand:"‱",guilsinglleft:"‹",guilsinglright:"›",textreferencemark:"※",textinterrobang:"‽",textfractionsolidus:"⁄",textlquill:"⁅",textrquill:"⁆",textdiscount:"⁒",textcolonmonetary:"₡",textlira:"₤",textnaira:"₦",textwon:"₩",textdong:"₫",texteuro:"€",textpeso:"₱",textcelsius:"℃",textnumero:"№",textcircledP:"℗",textrecipe:"℞",textservicemark:"℠",texttrademark:"™",textohm:"Ω",textmho:"℧",textestimated:"℮",textleftarrow:"←",textuparrow:"↑",textrightarrow:"→",textdownarrow:"↓",textminus:"−",Hwithstroke:"Ħ",hwithstroke:"ħ",textasteriskcentered:"∗",textsurd:"√",textlangle:"〈",textrangle:"〉",textblank:"␢",textvisiblespace:"␣",textopenbullet:"◦",textbigcircle:"◯",textmusicalnote:"♪",textmarried:"⚭",textdivorced:"⚮",textinterrobangdown:"⸘",textcommabelow:null,copyright:"©",Gamma:"Γ",Delta:"Δ",Theta:"Θ",Lambda:"Λ",Xi:"Ξ",Pi:"Π",Sigma:"Σ",Phi:"Φ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",varepsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",pi:"π",rho:"ρ",varsigma:"ς",sigma:"σ",tau:"τ",upsilon:"υ",varphi:"φ",chi:"χ",psi:"ψ",omega:"ω",vartheta:"ϑ",Upsilon:"ϒ",phi:"ϕ",varpi:"ϖ",varrho:"ϱ",epsilon:"ϵ"},Jt={jan:"01",feb:"02",mar:"03",apr:"04",may:"05",jun:"06",jul:"07",aug:"08",sep:"09",oct:"10",nov:"11",dec:"12",acmcs:"ACM Computing Surveys",acta:"Acta Informatica",cacm:"Communications of the ACM",ibmjrd:"IBM Journal of Research and Development",ibmsj:"IBM Systems Journal",ieeese:"IEEE Transactions on Software Engineering",ieeetc:"IEEE Transactions on Computers",ieeetcad:"IEEE Transactions on Computer-Aided Design of Integrated Circuits",ipl:"Information Processing Letters",jacm:"Journal of the ACM",jcss:"Journal of Computer and System Sciences",scp:"Science of Computer Programming",sicomp:"SIAM Journal on Computing",tocs:"ACM Transactions on Computer Systems",tods:"ACM Transactions on Database Systems",tog:"ACM Transactions on Graphics",toms:"ACM Transactions on Mathematical Software",toois:"ACM Transactions on Office Information Systems",toplas:"ACM Transactions on Programming Languages and Systems",tcs:"Theoretical Computer Science"},Gt={it:"italics",itshape:"italics",sl:"italics",slshape:"italics",em:"italics",bf:"bold",bfseries:"bold",sc:"smallcaps",scshape:"smallcaps",rm:void 0,sf:void 0,tt:void 0},Kt={textit:"italics",textsl:"italics",emph:"italics",mkbibitalic:"italics",mkbibemph:"italics",textbf:"bold",strong:"bold",mkbibbold:"bold",textsc:"smallcaps",textsuperscript:"superscript",textsubscript:"subscript",enquote:"quotes",mkbibquote:"quotes",textmd:void 0,textrm:void 0,textsf:void 0,texttt:void 0,textup:void 0},Vt={italics:["",""],bold:["",""],superscript:["",""],subscript:["",""],smallcaps:['',""],nocase:['',""],quotes:["“","”"]},Wt={ElsevierGlyph:e=>String.fromCharCode(parseInt(e,16)),href:(e,t)=>e,url:e=>e},Zt=/---?|''|``|~/g,Xt={"--":"–","---":"—","``":"“","''":"”","~":" "},Yt={"^":"superscript",sp:"superscript",_:"subscript",sb:"subscript",mathrm:void 0},Qt={"^":{0:"⁰",1:"¹",2:"²",3:"³",4:"⁴",5:"⁵",6:"⁶",7:"⁷",8:"⁸",9:"⁹","+":"⁺","-":"⁻","=":"⁼","(":"⁽",")":"⁾",i:"ⁱ",n:"ⁿ"},_:{0:"₀",1:"₁",2:"₂",3:"₃",4:"₄",5:"₅",6:"₆",7:"₇",8:"₈",9:"₉","+":"₊","-":"₋","=":"₌","(":"₍",")":"₎",a:"ₐ",e:"ₑ",o:"ₒ",x:"ₓ",ə:"ₔ",h:"ₕ",k:"ₖ",l:"ₗ",m:"ₘ",n:"ₙ",s:"ₚ",p:"ₛ",t:"ₜ"}},er=["american","british","canadian","english","australian","newzealand","usenglish","ukenglish","en","eng","en-au","en-bz","en-ca","en-cb","en-gb","en-ie","en-jm","en-nz","en-ph","en-tt","en-us","en-za","en-zw","anglais"];var tr={__proto__:null,required:Nt,fieldTypes:Mt,diacritics:qt,commands:Ht,defaultStrings:Jt,formattingEnvs:Gt,formattingCommands:Kt,formatting:Vt,argumentCommands:Wt,ligaturePattern:Zt,ligatures:Xt,mathScriptFormatting:Yt,mathScripts:Qt,sentenceCaseLanguages:er};const rr=/[a-zA-Z_][a-zA-Z0-9_:-]*/,ir={comment:/%.*/,whitespace:{match:/\s+/,lineBreaks:!0}},ar=Ut.states({main:{junk:{match:/@[cC][oO][mM][mM][eE][nN][tT].+|[^@]+/,lineBreaks:!0},at:{match:"@",push:"entry"}},entry:c({},ir,{otherEntryType:{match:/[sS][tT][rR][iI][nN][gG]|[pP][rR][eE][aA][mM][bB][lL][eE]/,next:"otherEntryContents"},dataEntryType:{match:rr,next:"dataEntryContents"}}),otherEntryContents:c({},ir,{lbrace:{match:/[{(]/,next:"fields"}}),dataEntryContents:c({},ir,{lbrace:{match:/[{(]/,next:"dataEntryContents"},label:/[^,\s]+/,comma:{match:",",next:"fields"}}),fields:c({},ir,{identifier:rr,number:/-?\d+/,hash:"#",equals:"=",comma:",",quote:{match:'"',push:"quotedLiteral"},lbrace:{match:"{",push:"bracedLiteral"},rbrace:{match:/[})]/,pop:!0}}),quotedLiteral:{lbrace:{match:"{",push:"bracedLiteral"},quote:{match:'"',pop:!0},text:{match:/(?:\\[\\{]|[^{"])+/,lineBreaks:!0}},bracedLiteral:{lbrace:{match:"{",push:"bracedLiteral"},rbrace:{match:"}",pop:!0},text:{match:/(?:\\[\\{}]|[^{}])+/,lineBreaks:!0}}}),ur={"(":")","{":"}"},or=new Pe({Main(){const e=[];for(;;){for(;this.matchToken("junk");)this.consumeToken("junk");if(this.matchEndOfFile())break;e.push(this.consumeRule("Entry"))}return e.filter(Boolean)},_(){let e;for(;e!==this.token;)e=this.token,this.consumeToken("whitespace",!0),this.consumeToken("comment",!0)},Entry(){this.consumeToken("at"),this.consumeRule("_");const e=(this.matchToken("otherEntryType")?this.consumeToken("otherEntryType"):this.consumeToken("dataEntryType")).value.toLowerCase();this.consumeRule("_");const t=this.consumeToken("lbrace").value;let r;if(this.consumeRule("_"),"string"===e){const[e,t]=this.consumeRule("Field");this.state.strings[e]=t}else if("preamble"===e)this.consumeRule("Expression");else{const t=this.consumeToken("label").value;this.consumeRule("_"),this.consumeToken("comma"),this.consumeRule("_"),r={type:e,label:t,properties:this.consumeRule("EntryBody")}}this.consumeRule("_");const i=this.consumeToken("rbrace").value;return i!==ur[t]&&P.warn("[plugin-bibtex]",`entry started with "${t}", but ends with "${i}"`),r},EntryBody(){const e={};for(;this.matchToken("identifier");){const[t,r]=this.consumeRule("Field");if(e[t]=r,this.consumeRule("_"),!this.consumeToken("comma",!0))break;this.consumeRule("_")}return e},Field(){const e=this.consumeToken("identifier").value.toLowerCase();return this.consumeRule("_"),this.consumeToken("equals"),this.consumeRule("_"),[e,this.consumeRule("Expression")]},Expression(){let e=this.consumeRule("ExpressionPart");for(this.consumeRule("_");this.matchToken("hash");)this.consumeToken("hash"),this.consumeRule("_"),e+=this.consumeRule("ExpressionPart").toString(),this.consumeRule("_");return e},ExpressionPart(){return this.matchToken("identifier")?this.state.strings[this.consumeToken("identifier").value.toLowerCase()]||"":this.matchToken("number")?parseInt(this.consumeToken("number")):this.matchToken("quote")?this.consumeRule("QuoteString"):this.consumeRule("BracketString")},QuoteString(){let e="";for(this.consumeToken("quote");!this.matchToken("quote");)e+=this.consumeRule("Text");return this.consumeToken("quote"),e},BracketString(){let e="";for(this.consumeToken("lbrace");!this.matchToken("rbrace");)e+=this.consumeRule("Text");return this.consumeToken("rbrace"),e},Text(){return this.matchToken("lbrace")?`{${this.consumeRule("BracketString")}}`:this.consumeToken("text").value}},{strings:Jt});function nr(e){return or.parse(ar.reset(e))}const sr=/\n\s*(?=\[)/g,lr=/^\[(.+?)\]\s*(?:\n([\s\S]+))?$/,cr=/((?=.)\s)*\n\s*/g,mr=/:(.*)/,pr=e=>{const[,t,r]=e.match(lr)||[];if(t&&r){const e={type:"book",label:t,properties:{}};return r.trim().split(cr).filter(e=>e).forEach(t=>{let[r,i]=t.split(mr);i&&(r=r.trim(),i=i.trim(),"type"===r?e.type=i:e.properties[r]=i)}),e}return{}},fr={source:{article:"article-journal",book:"book",mvbook:"book",inbook:"chapter",bookinbook:"book",booklet:"book",collection:"book",mvcollection:"book",incollection:"chapter",dataset:"dataset",online:"webpage",patent:"patent",periodical:"article-journal",proceedings:"book",mvproceedings:"book",inproceedings:"paper-conference",reference:"book",mvreference:"book",inreference:"entry",report:"report",software:"book",thesis:"thesis",unpublished:"manuscript",artwork:"graphic",audio:"song",image:"figure",jurisdiction:"legal_case",legislation:"legislation",legal:"treaty",letter:"personal_communication",movie:"motion_picture",music:"musical_score",review:"review",video:"motion_picture",conference:"paper-conference",electronic:"webpage",mastersthesis:"thesis",phdthesis:"thesis",techreport:"report",www:"webpage"},target:{article:"article","article-journal":"article","article-magazine":"article","article-newspaper":"article",bill:"legislation",book:"book",broadcast:"audio",chapter:"inbook",dataset:"dataset",entry:"inreference","entry-dictionary":"inreference","entry-encyclopedia":"inreference",figure:"artwork",graphic:"artwork",interview:"audio",legal_case:"jurisdiction",legislation:"legislation",manuscript:"unpublished",motion_picture:"movie",musical_score:"music","paper-conference":"inproceedings",patent:"patent",personal_communication:"letter",post:"online","post-weblog":"online",report:"report",review:"review","review-book":"review",song:"music",speech:"audio",thesis:"thesis",treaty:"legal",webpage:"online"}},Dr={source:{article:"article-journal",book:"book",booklet:"book",conference:"paper-conference",inbook:"chapter",incollection:"chapter",inproceedings:"paper-conference",mastersthesis:"thesis",phdthesis:"thesis",proceedings:"book",techreport:"report",unpublished:"manuscript"},target:{article:"article","article-journal":"article","article-magazine":"article","article-newspaper":"article",book:"book",chapter:"inbook",manuscript:"unpublished","paper-conference":"inproceedings",report:"techreport",review:"article","review-book":"article"}};var hr={constants:tr,types:{biblatex:fr,bibtex:Dr},parse:{biblatex:!0,strict:!1,sentenceCase:"never"},format:{useIdAsLabel:!1}};const dr=new Set(["the","a","an"]),gr=/(?:<\/?.*?>|[\u0020-\u002F\u003A-\u0040\u005B-\u005E\u0060\u007B-\u007F])+/g,br=/[^\u0020-\u007F]+/g;function yr(e){return e?e.normalize("NFKD").replace(br,"").split(gr).find(e=>e.length&&!dr.has(e.toLowerCase())):""}const Fr=new Ue([{source:"given",target:"given"},{source:"family",target:"family"},{source:"suffix",target:"suffix"},{source:"prefix",target:"non-dropping-particle"},{source:"family",target:"literal",when:{source:!1,target:{family:!1,given:!1}}}]),vr=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],Ar="BibTeX type",xr="BibTeX label",Er={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12,january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Cr={bathesis:"Bachelor's thesis",mathesis:"Master's thesis",phdthesis:"PhD thesis",candthesis:"Candidate thesis",techreport:"technical report",resreport:"research report",software:"computer software",datacd:"data cd",audiocd:"audio cd",patent:"patent",patentde:"German patent",patenteu:"European patent",patentfr:"French patent",patentuk:"British patent",patentus:"U.S. patent",patreq:"patent request",patreqde:"German patent request",patreqeu:"European patent request",patreqfr:"French patent request",patrequk:"British patent request",patrequs:"U.S. patent request"},wr=/(^(?:ISAN )?(?:[0-9a-f]{4}-){4}[0-9a-z](?:-(?:[0-9a-f]{4}-){2}[0-9a-z])?$)|(^(?:979-?0-?|M-?)(?:\d{9}|(?=[\d-]{11}$)\d+-\d+-\d)$)|(^ISRN .{1,36}$)|(^(?:ISWC )?T-?\d{9}-?\d$)/i;function Br(e){if(null==e)return[];if(+e)return[parseInt(e,10)];if((e=e.trim().toLowerCase())in Er)return[Er[e]];const t=e.split(/\s+/);let r,i;return t[0]in Er?(r=Er[t[0]],i=parseInt(t[1])):t[1]in Er&&(r=Er[t[1]],i=parseInt(t[0])),i?[r,i]:r?[r]:[]}const kr={PICK:{toTarget:(...e)=>e.find(Boolean),toSource:e=>[e]},DATE:{toTarget(e){const t=e.split("/").map(e=>e&&".."!==e?function(e){const t=e.split("T")[0].replace(/[?~%]$/,"").split("-"),r=+t[0].replace(/^Y(?=-?\d{4}\d+)/,"").replace(/X/g,"0"),i=+t[1],a=+t[2];return!i||i>20?[r]:a?[r,i,a]:[r,i]}(e):void 0);return isNaN(t[0][0])?{literal:e}:{"date-parts":t}},toSource(e){if("date-parts"in e)return e["date-parts"].map(e=>e.map(e=>e.toString().padStart(2,"0")).join("-")).join("/")}},YEAR_MONTH:{toTarget:(e,t,r)=>isNaN(+e)?{literal:e}:isNaN(+r)||isNaN(+t)?{"date-parts":[[+e,...Br(t)]]}:{"date-parts":[[+e,+t,+r]]},toSource(e){if("date-parts"in e){const[t,r,i]=e["date-parts"][0];return[t.toString(),r?i?`${vr[r-1]} ${i}`:r:void 0]}}},EPRINT:{toTarget(e,t){if("pubmed"===t)return e},toSource:e=>[e,"pubmed"]},HOW_PUBLISHED:{toTarget(e){if(e.startsWith("http"))return e}},KEYWORDS:{toTarget:e=>e.join(","),toSource:e=>e.split(",")},LABEL:{toTarget:e=>[e,e],toSource(e,t,r,i,a,u){let o;return o=null===e?"null":void 0===e?"undefined":e.toString().replace(gr,""),hr.format.useIdAsLabel?o:t&&!gr.test(t)?t:function(e,t,r,i){let a="";return e&&e[0]&&(a+=yr(e[0].family||e[0].literal)),t&&t["date-parts"]&&t["date-parts"][0]&&(a+=t["date-parts"][0][0]),r?a+=r:i&&(a+=yr(i)),a}(r,i,a,u)||o}},NAMES:{toTarget:e=>e.map(Fr.convertToTarget),toSource:e=>e.map(Fr.convertToSource)},STANDARD_NUMBERS:{toTarget:(...e)=>e.find(Boolean),toSource(e){const t=e.toString().match(wr);return t?t.slice(1,5):[]}},STATUS:{toSource(e){if(/^(inpreparation|submitted|forthcoming|inpress|prepublished)$/i.test(e))return e}},TITLE:{toTarget:(e,t,r)=>(t&&(e+=": "+t),e),toSource:e=>[e]}},Tr=[{source:"note",target:"accessed",when:{source:!1,target:{note:!1,addendum:!1}},convert:{toSource:e=>`[Online; accessed ${o(e)}]`}},{source:"numpages",target:"number-of-pages",when:{source:{pagetotal:!1},target:!1}},{source:"pmid",target:"PMID",when:{source:{eprinttype:e=>"pmid"!==e,archiveprefix:e=>"pmid"!==e},target:!1}},{source:"pmcid",target:"PMCID",when:{target:!1}},{source:"s2id",target:"custom",convert:{toTarget:e=>({S2ID:e}),toSource:({S2ID:e})=>e}}];var jr=new Ue([{source:"annote",target:"annote",when:{source:{annotation:!1},target:!1}},{source:"address",target:"publisher-place",convert:kr.PICK,when:{source:{location:!1},target:!1}},{source:["eprint","archiveprefix"],target:"PMID",convert:kr.EPRINT,when:{source:{eprinttype:!1},target:!1}},{source:"journal",target:"container-title",when:{source:{maintitle:!1,booktitle:!1,journaltitle:!1},target:!1}},{source:"school",target:"publisher",convert:kr.PICK,when:{source:{institution:!1,organization:!1,publisher:!1},target:!1}},...Tr,{source:"abstract",target:"abstract"},{source:"urldate",target:"accessed",convert:kr.DATE},{source:"annotation",target:"annote"},{source:"author",target:"author",convert:kr.NAMES},{source:"library",target:"call-number"},{source:"chapter",target:"chapter-number"},{source:"bookauthor",target:"container-author",convert:kr.NAMES},{source:["maintitle","mainsubtitle","maintitleaddon"],target:"container-title",when:{source:!0,target:{"number-of-volumes":!0}},convert:kr.TITLE},{source:["booktitle","booksubtitle","booktitleaddon"],target:"container-title",when:{source:{maintitle:!1},target:{"number-of-volumes":!1,type:e=>!e||!e.startsWith("article")}},convert:kr.TITLE},{source:["journaltitle","journalsubtitle","journaltitleaddon"],target:"container-title",when:{source:{[Ar]:"article"},target:{type:["article","article-newspaper","article-journal","article-magazine"]}},convert:kr.TITLE},{source:"shortjournal",target:"container-title-short",when:{source:{[Ar]:"article"},target:{type:["article","article-newspaper","article-journal","article-magazine"]}}},{source:"shortjournal",target:"journalAbbreviation",when:{source:!1,target:{"container-title-short":!1}}},{source:"number",target:"collection-number",when:{source:{[Ar]:["book","mvbook","inbook","bookinbook","suppbook","collection","mvcollection","incollection","suppcollection","manual","suppperiodical","proceedings","mvproceedings","refererence"]},target:{type:["bill","book","broadcast","chapter","dataset","entry","entry-dictionary","entry-encyclopedia","figure","graphic","interview","legislation","legal_case","manuscript","map","motion_picture","musical_score","pamphlet","post","post-weblog","personal_communication","review","review-book","song","speech","thesis","treaty","webpage"]}}},{source:"series",target:"collection-title"},{source:"shortseries",target:"collection-title-short"},{source:"doi",target:"DOI"},{source:"edition",target:"edition"},{source:"editor",target:"editor",convert:kr.NAMES},{source:[Ar,"entrysubtype","type"],target:["type","genre"],convert:{toTarget:(e,t,r)=>(r||("mastersthesis"===e&&(r="mathesis"),"phdthesis"===e&&(r="phdthesis"),"techreport"===e&&(r="techreport")),[fr.source[e]||"document",r||t]),toSource(e,t){const r=fr.target[e]||"misc";return t in Cr?[r,void 0,t]:[r,t]}}},{source:Ar,when:{target:{type:!1}},convert:{toSource:()=>"misc"}},{source:"eventdate",target:"event-date",convert:kr.DATE},{source:"venue",target:"event-place"},{source:["eventtitle","eventtitleaddon"],target:"event-title",convert:kr.EVENT_TITLE},{source:["eventtitle","eventtitleaddon"],target:"event",convert:kr.EVENT_TITLE,when:{source:!1,target:{"event-title":!1}}},{source:xr,target:["id","citation-key","author","issued","year-suffix","title"],convert:kr.LABEL},{source:"isbn",target:"ISBN"},{source:"issn",target:"ISSN"},{source:"issue",target:"issue",when:{source:{number:!1,[Ar]:["article","periodical"]},target:{issue:e=>"string"==typeof e&&!e.match(/\d+/),type:["article","article-journal","article-newspaper","article-magazine","periodical"]}}},{source:"number",target:"issue",when:{source:{[Ar]:["article","periodical","inproceedings"]},target:{issue:e=>e&&("number"==typeof e||e.match(/\d+/)),type:["article","article-journal","article-newspaper","article-magazine","paper-conference","periodical"]}}},{source:"date",target:"issued",convert:kr.DATE},{source:["year","month","day"],target:"issued",convert:kr.YEAR_MONTH,when:{source:{date:!1},target:!1}},{source:"location",target:"jurisdiction",when:{source:{type:"patent"},target:{type:"patent"}}},{source:"keywords",target:"keyword",convert:kr.KEYWORDS},{source:"language",target:"language",convert:kr.PICK},{source:"langid",target:"language",when:{source:{language:!1},target:!1}},{source:"note",target:"note"},{source:"addendum",target:"note",when:{source:{note:!1},target:!1}},{source:"eid",target:"number",when:{target:{type:["article-journal"]}}},{source:["isan","ismn","isrn","iswc"],target:"number",convert:kr.STANDARD_NUMBERS,when:{source:{[Ar]:e=>"patent"!==e},target:{type:e=>"patent"!==e}}},{source:"number",target:"number",when:{source:{[Ar]:["patent","report","techreport","legislation"]},target:{type:["patent","report","legislation"]}}},{source:"origdate",target:"original-date",convert:kr.DATE},{source:"origlocation",target:"original-publisher-place",convert:kr.PICK},{source:"origpublisher",target:"original-publisher",convert:kr.PICK},{source:"origtitle",target:"original-title"},{source:"pages",target:"page",when:{source:{bookpagination:[void 0,"page"]}},convert:kr.PAGES},{source:"pagetotal",target:"number-of-pages"},{source:"part",target:"part-number"},{source:["eprint","eprinttype"],target:"PMID",convert:kr.EPRINT},{source:"location",target:"publisher-place",convert:kr.PICK},{source:"publisher",target:"publisher",convert:kr.PICK,when:{source:!0,target:{type:["article","article-journal","article-magazine","article-newspaper","bill","book","broadcast","chapter","classic","collection","dataset","document","entry","entry-dictionary","entry-encyclopedia","event","figure","graphic","hearing","interview","legal_case","legislation","manuscript","map","motion_picture","musical_score","pamphlet","paper-conference","patent","performance","periodical","personal_communication","post","post-weblog","regulation","review","review-book","software","song","speech","standard","treaty"]}}},{source:"organization",target:"publisher",convert:kr.PICK,when:{source:{publisher:!1},target:{type:"webpage"}}},{source:"institution",target:"publisher",convert:kr.PICK,when:{source:{publisher:!1,organization:!1},target:{type:["report","thesis"]}}},{source:"howpublished",target:"publisher",convert:kr.PICK,when:{source:{howpublished:e=>e&&!e.startsWith("http"),publisher:!1,organization:!1,institution:!1},target:{type:"manuscript"}}},{source:["pages","bookpagination"],target:"section",when:{source:{bookpagination:"section"},target:{page:!1}},convert:{toTarget:e=>e,toSource:e=>[e,"section"]}},{source:"pubstate",target:"status",convert:kr.STATUS},{source:"shorttitle",target:"title-short"},{source:"shorttitle",target:"shortTitle",when:{source:!1,target:{"title-short":!1}}},{source:["title","subtitle","titleaddon"],target:"title",convert:kr.TITLE},{source:"translator",target:"translator",convert:kr.NAMES},{source:"url",target:"URL"},{source:"howpublished",target:"URL",convert:kr.HOW_PUBLISHED,when:{source:{url:!1},target:!1}},{source:"version",target:"version"},{source:"volume",target:"volume"},{source:"volumes",target:"number-of-volumes"},{source:["issuetitle","issuesubtitle","issuetitleaddon"],target:"volume-title",convert:kr.TITLE}]),Sr=new Ue([{source:"note",target:"accessed",when:{source:!1,target:{note:!1}},convert:{toSource:e=>`[Online; accessed ${o(e)}]`}},{source:"annote",target:"annote"},{source:"address",target:"publisher-place",convert:kr.PICK},{source:"author",target:"author",convert:kr.NAMES},{source:"chapter",target:"chapter-number"},{source:"number",target:"collection-number",when:{source:{[Ar]:["book","mvbook","inbook","collection","mvcollection","incollection","suppcollection","manual","suppperiodical","proceedings","mvproceedings","refererence"]},target:{type:["bill","book","broadcast","chapter","dataset","entry","entry-dictionary","entry-encyclopedia","figure","graphic","interview","legislation","legal_case","manuscript","map","motion_picture","musical_score","pamphlet","post","post-weblog","personal_communication","review","review-book","song","speech","thesis","treaty","webpage"]}}},{source:"series",target:"collection-title"},{source:"booktitle",target:"container-title",when:{target:{type:["chapter","paper-conference"]}}},{source:"journal",target:"container-title",when:{source:{[Ar]:"article"},target:{type:["article","article-newspaper","article-journal","article-magazine"]}}},{source:"edition",target:"edition"},{source:"editor",target:"editor",convert:kr.NAMES},{source:xr,target:["id","citation-key","author","issued","year-suffix","title"],convert:kr.LABEL},{source:"number",target:"issue",when:{source:{[Ar]:["article","periodical","inproceedings"]},target:{issue:e=>"number"==typeof e||"string"==typeof e&&e.match(/\d+/),type:["article","article-journal","article-newspaper","article-magazine","paper-conference","periodical"]}}},{source:["year","month","day"],target:"issued",convert:kr.YEAR_MONTH},{source:"note",target:"note"},{source:"number",target:"number",when:{source:{[Ar]:["patent","report","techreport"]},target:{type:["patent","report"]}}},{source:"pages",target:"page",convert:kr.PAGES},{source:"publisher",target:"publisher",convert:kr.PICK,when:{target:{type:["article","article-journal","article-magazine","article-newspaper","bill","book","broadcast","chapter","classic","collection","dataset","document","entry","entry-dictionary","entry-encyclopedia","event","figure","graphic","hearing","interview","legal_case","legislation","map","motion_picture","musical_score","pamphlet","patent","performance","periodical","personal_communication","post","post-weblog","regulation","review","review-book","software","song","speech","standard","treaty","webpage"]}}},{source:"organization",target:"publisher",convert:kr.PICK,when:{source:{publisher:!1},target:{type:"paper-conference"}}},{source:"institution",target:"publisher",convert:kr.PICK,when:{source:{publisher:!1,organization:!1},target:{type:"report"}}},{source:"school",target:"publisher",convert:kr.PICK,when:{source:{institution:!1,organization:!1,publisher:!1},target:{type:"thesis"}}},{source:"howpublished",target:"publisher",convert:kr.PICK,when:{source:{howpublished:e=>e&&!e.startsWith("http"),publisher:!1,organization:!1,institution:!1,school:!1},target:{type:"manuscript"}}},{source:"title",target:"title"},{source:[Ar,"type"],target:["type","genre"],convert:{toTarget(e,t){const r=Dr.source[e]||"document";return t?[r,t]:"mastersthesis"===e?[r,"Master's thesis"]:"phdthesis"===e?[r,"PhD thesis"]:[r]},toSource(e,t){const r=Dr.target[e]||"misc";return/^(master'?s|diploma) thesis$/i.test(t)?["mastersthesis"]:/^(phd|doctoral) thesis$/i.test(t)?["phdthesis"]:[r,t]}}},{source:Ar,when:{target:{type:!1}},convert:{toSource:()=>"misc"}},{source:"howpublished",target:"URL",convert:kr.HOW_PUBLISHED,when:{target:{publisher:!1}}},{source:"volume",target:"volume"}]);function _r(e,t){if(null==e)return{};var r,i,a=function(e,t){if(null==e)return{};var r,i,a={},u=Object.keys(e);for(i=0;i=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function Or(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}function Rr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function zr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ir(e,t){if(e.crossref in t){const r=t[e.crossref].properties;return r===e?e:Object.assign({},Ir(r,t),e)}return e}function Lr(e,t){const r={};for(const t of e)r[t.label]=t;return e.map(({type:e,label:i,properties:a})=>t.convertToTarget(function(e){for(var t=1;t{const r=t.convertToSource(e),{[Ar]:i,[xr]:a}=r;return{type:i,label:a,properties:_r(r,[Ar,xr].map(Or))}})}function $r(e){const t=e.toUpperCase(),r=e.toLowerCase();for(let i=0;i1;){const{value:r,hyphenated:i}=e.shift();t+=r+(i?"-":" ")}const r=t+e[0].value;return r[0]&&r}function Nr(e){if(e[0][0].label){const t={};for(const[{value:r,label:i}]of e)t[i]=r;return t}const t={},[r,i,a]=function(e,t=!0){const r=[],i=[];if(t)for(;e.length>1&&!1!==e[0].upperCase;){for(r.push(...i),i.length=0;e.length>1&&!1!==e[0].upperCase&&!e[0].hyphenated;)r.push(e.shift());for(;e.length>0&&!1!==e[0].upperCase&&e[0].hyphenated;)i.push(e.shift())}const a=[],u=[];for(;e.length>1;){for(a.push(...u),u.length=0;e.length>1&&!1===e[0].upperCase;)a.push(e.shift());for(;e.length>0&&!1!==e[0].upperCase;)u.push(e.shift())}return i.length&&u.unshift(...i),e.length&&u.push(e[0]),[Ur(r),Ur(a),Ur(u)]}(e[0],1===e.length);return a&&(t.family=a),i&&(t.prefix=i),3===e.length?(t.given=Ur(e[2]),t.suffix=Ur(e[1])):2===e.length?t.given=Ur(e[1]):r&&(t.given=r),t}const Mr={command:{match:/\\(?:[a-zA-Z]+|.) */,type:Ut.keywords({commandBegin:"\\begin",commandEnd:"\\end"}),value:e=>e.slice(1).trim()},lbrace:{match:"{",push:"bracedLiteral"},mathShift:{match:"$",push:"mathLiteral"},whitespace:{match:/[\s]+|~/,lineBreaks:!0,value:e=>"~"===e?" ":" "}},qr=Ut.states({stringLiteral:c({},Mr,{text:/[^{$}\s~\\]+/}),namesLiteral:c({and:/\s+[aA][nN][dD]\s+/,comma:",",hyphen:"-",equals:"="},Mr,{text:/[^{$}\s~\\,=-]+/}),listLiteral:c({and:/\s+and\s+/},Mr,{text:/[^{$}\s~\\]+/}),separatedLiteral:c({comma:","},Mr,{text:/[^{$}\s~\\,]+/}),bracedLiteral:c({},Mr,{rbrace:{match:"}",pop:!0},text:/[^{$}\s~\\]+/}),mathLiteral:c({},Mr,{mathShift:{match:"$",pop:!0},script:/[\^_]/,text:/[^{$}\s~\\^_]+/})});function Hr(e,t){return t in Vt?e&&Vt[t].join(e):e}const Jr=new Pe({String(){let e="";for(;!this.matchEndOfFile();)e+=this.consumeRule("Text");return e},StringNames(){const e=[];for(;;){if(this.consumeToken("whitespace",!0),e.push(this.consumeRule("Name")),this.consumeToken("whitespace",!0),this.matchEndOfFile())return e;this.consumeToken("and")}},Name(){const e=[];for(;;){if(e.push(this.consumeRule("NamePiece")),this.matchEndOfFile()||this.matchToken("and"))return Nr(e);this.consumeToken("comma"),this.consumeToken("whitespace",!0)}},NamePiece(){const e=[];for(;;){const t=this.consumeRule("NameToken");if(t.label)return t.label=Ur([...e,{value:t.label}]),[t];if(e.push(t),this.matchEndOfFile()||this.matchToken("and")||this.matchToken("comma"))return e;for(;this.matchToken("hyphen")||this.matchToken("whitespace");)this.consumeToken()}},NameToken(){let e=null,t="";for(;;)if(null===e&&this.matchToken("text")){const r=this.consumeToken().value;t+=r,e=$r(r)}else{if(this.matchEndOfFile()||this.matchToken("and")||this.matchToken("comma")||this.matchToken("whitespace"))return{value:t,upperCase:e};if(this.matchToken("hyphen"))return{value:t,upperCase:e,hyphenated:!0};if(this.matchToken("equals")){this.consumeToken("equals");const e=this.consumeRule("NamePiece");return e[0].label&&(t+="="+e[0].label),{value:Ur(e),label:t}}t+=this.consumeRule("Text")}},StringList(){const e=[];for(;!this.matchEndOfFile();){let t="";for(;!this.matchEndOfFile()&&!this.matchToken("and");)t+=this.consumeRule("Text");e.push(t),this.consumeToken("and",!0)}return 1===e.length?e[0]:e},StringSeparated(){const e=[];for(;!this.matchEndOfFile();){let t="";for(;!this.matchEndOfFile()&&!this.matchToken("comma");)t+=this.consumeRule("Text");e.push(t.trim()),this.consumeToken("comma",!0),this.consumeToken("whitespace",!0)}return e},StringVerbatim(){let e="";for(;!this.matchEndOfFile();)e+=this.consumeToken().text;return e},StringUri(){const e=this.consumeRule("StringVerbatim");try{return decodeURI(e)===e?encodeURI(e):e}catch(t){return encodeURI(e)}},StringTitleCase(){this.state.sentenceCase=!0;let e="";for(;!this.matchEndOfFile();)e+=this.consumeRule("Text");return e},BracketString(){var e;let t="";this.consumeToken("lbrace");const r=this.state.sentenceCase;for(this.state.sentenceCase=r&&this.matchToken("command"),(e=this.state).partlyLowercase&&(e.partlyLowercase=this.state.sentenceCase);!this.matchToken("rbrace");)t+=this.consumeRule("Text");const i=r&&!this.state.sentenceCase&&this.state.partlyLowercase;return this.state.sentenceCase=r,this.consumeToken("rbrace"),i?Hr(t,"nocase"):t},MathString(){let e="";for(this.consumeToken("mathShift");!this.matchToken("mathShift");)if(this.matchToken("script")){const t=this.consumeToken("script").value,r=this.consumeRule("Text").split("");r.every(e=>e in Qt[t])?e+=r.map(e=>Qt[t][e]).join(""):e+=Vt[Yt[t]].join(r.join(""))}else{if(this.matchToken("command")){const t=this.token.value;if(t in Yt){this.consumeToken("command"),e+=Hr(this.consumeRule("BracketString"),Yt[t]);continue}}e+=this.consumeRule("Text")}return this.consumeToken("mathShift"),e},Text(){if(this.matchToken("lbrace"))return this.consumeRule("BracketString");if(this.matchToken("mathShift"))return this.consumeRule("MathString");if(this.matchToken("whitespace"))return this.consumeToken("whitespace").value;if(this.matchToken("commandBegin"))return this.consumeRule("EnclosedEnv");if(this.matchToken("command"))return this.consumeRule("Command");const e=this.consumeToken("text").value.replace(Zt,e=>Xt[e]),t=this.state.afterPunctuation;var r;if(this.state.afterPunctuation=/[?!.:]$/.test(e),!this.state.sentenceCase)return(r=this.state).partlyLowercase||(r.partlyLowercase=e===e.toLowerCase()&&e!==e.toUpperCase()),e;const[i,...a]=e,u=a.join(""),o=u.toLowerCase();return u!==o?e:t?i+o:e.toLowerCase()},Command(){const e=this.consumeToken("command"),t=e.value;if(t in Gt)return Hr(this.consumeRule("Env"),Gt[t]);if(t in Kt)return Hr(this.consumeRule("BracketString"),Kt[t]);if(t in Ht)return Ht[t];if(t in qt&&!this.matchEndOfFile()){const e=this.consumeRule("Text");return(e[0]+qt[t]).normalize("NFC")+e.slice(1)}if(t in Wt){const e=Wt[t],r=[];let i=e.length;for(;i-- >0;)this.consumeToken("whitespace",!0),r.push(this.consumeRule("BracketString"));return e(...r)}return/^[&%$#_{}]$/.test(t)?e.text.slice(1):e.text},Env(){let e="";for(;!this.matchEndOfFile()&&!this.matchToken("rbrace");)e+=this.consumeRule("Text");return e},EnclosedEnv(){this.consumeToken("commandBegin");const e=this.consumeRule("BracketString");let t="";for(;!this.matchToken("commandEnd");)t+=this.consumeRule("Text");const r=this.consumeToken("commandEnd"),i=this.consumeRule("BracketString");if(e!==i)throw new SyntaxError(this.lexer.formatError(r,`environment started with "${e}", ended with "${i}"`));return Hr(t,Gt[e])}},{sentenceCase:!1,partlyLowercase:!1,afterPunctuation:!0});function Gr(e){return er.includes(e.toLowerCase())}function Kr(e){if("name"===e[1])return"namesLiteral";switch(e[0]){case"list":return"listLiteral";case"separated":return"separatedLiteral";default:return"stringLiteral"}}function Vr(e,t,r=[]){const i=Mt[t]||[];return Jr.parse(qr.reset(e,{state:Kr(i),line:0,col:0}),function(e,t){if("name"===e[1])return"list"===e[0]?"StringNames":"Name";if("title"===e[1]){const e=hr.parse.sentenceCase;return"always"===e||"english"===e&&function(e){return Array.isArray(e)?e.every(Gr):Gr(e)}(t)?"StringTitleCase":"String"}switch("field"===e[0]?e[1]:e[0]){case"list":return"StringList";case"separated":return"StringSeparated";case"verbatim":return"StringVerbatim";case"uri":return"StringUri";default:return"String"}}(i,r))}function Wr(e,t){const r=[];for(const{type:i,label:a,properties:u}of e)if(i in t){const e=[];for(const r of t[i])Array.isArray(r)&&!r.some(e=>e in u)?e.push(r.join("/")):"string"!=typeof r||r in u||e.push(r);e.length&&r.push([a,`missing fields: ${e.join(", ")}`])}else r.push([a,`invalid type: "${i}"`]);if(r.length)throw new RangeError(["Invalid entries:"].concat(r.map(([e,t])=>` - ${e} has ${t}`)).join("\n"))}function Zr(e){const t={};"language"in e.properties&&(t.language=Vr(e.properties.language,"language"));for(const r in e.properties){const i=e.properties[r];""!==i&&(t[r]=Vr(i+"",r,t.language))}return c({},e,{properties:t})}function Xr(e){return hr.parse.strict&&Wr(e,Nt.biblatex),function(e){return Lr(e,jr)}(e.map(Zr))}function Yr(e){return hr.parse.strict&&Wr(e,Nt.bibtex),function(e){return Lr(e,Sr)}(e.map(Zr))}const Qr={"@biblatex/text":{parse:nr,parseType:{dataType:"String",predicate:/@\s{0,5}[A-Za-z]{1,13}\s{0,5}\{\s{0,5}[^@{}"=,\\\s]{0,100}\s{0,5},[\s\S]*\}/}},"@biblatex/entry+object":{parse:e=>Xr([e]),parseType:{dataType:"SimpleObject",propertyConstraint:{props:["type","label","properties"]}}},"@biblatex/entries+list":{parse:Xr,parseType:{elementConstraint:"@biblatex/entry+object"}},"@bibtex/text":{parse:nr,outputs:"@bibtex/entries+list"},"@bibtex/entry+object":{parse:e=>Yr([e])},"@bibtex/entries+list":{parse:Yr},"@bibtxt/text":{parse:e=>e.trim().split(sr).map(pr),parseType:{dataType:"String",predicate:/^\s*(\[(?!\s*[{[]).*?\]\s*(\n\s*[^[]((?!:)\S)+\s*:\s*.+?\s*)*\s*)+$/}}},ei={};for(const e in Ht)ei[Ht[e]]=e;for(const e in qt)ei[qt[e]]=e;for(const e in Xt)ei[Xt[e]]=e;const ti=/[^a-zA-Z0-9\s!"#%&'()*+,\-./:;=?@[\]{}\u0300-\u0308\u030a-\u030c\u0332\u0323\u0327\u0328\u0361\u0326]/g,ri=/.[\u0300-\u0308\u030a-\u030c\u0332\u0323\u0327\u0328\u0361\u0326]+/g,ii={separated:",",list:" and "},ai={i:"\\textit{",b:"\\textbf{",sc:"\\textsc{",sup:"\\textsuperscript{",sub:"\\textsubscript{",'span style="font-variant:small-caps;"':"\\textsc{",'span class="nocase"':"{"};function ui(e){return e.normalize("NFKD").replace(ti,e=>e in ei?ei[e]in Xt?ei[e]:`\\${ei[e]}{}`:"").replace(ri,e=>Array.from(e).reduce((e,t)=>`{\\${ei[t]} ${e}}`))}function oi(e){const t=[];let r=e.split(/<(\/?(?:i|b|sc|sup|sub|span)|span .*?)>/g);return r=r.map((e,r)=>r%2==0?ui(e):e in ai?(t.push("/"+e.split(" ")[0]),ai[e]):e===t[t.length-1]?(t.pop(),"}"):""),r.join("")}function ni(e,t){switch(t){case"title":return oi(e).split(/(:\s*)/).map((e,t)=>t%2?e:e.replace(/(?!^)\b[a-z]*[A-Z].*?\b/g,"{$&}")).join("");case"literal":return oi(e.toString());case"name":return function(e){if(e.family&&!e.prefix&&!e.given&!e.suffix)return e.family.includes(ii.list)?e.family:`{${e.family}}`;const t=[""];return e.prefix&&e.family&&(t[0]+=e.prefix+" "),e.family&&(t[0]+=e.family),e.suffix?(t.push(e.suffix),t.push(e.given||"")):t.push(e.given),ui(t.join(", ").trim())}(e);case"verbatim":case"uri":return e.toString();default:return ui(e.toString())}}function si(e,t){if(!(e in Mt))return ni(t,"verbatim");const[r,i]=Mt[e];return r in ii?function(e,t,r){const i=ii[r];return e.map(e=>{const r=ni(e,t);return r.includes(i)?`{${r}}`:r}).join(i)}(t,i,r):ni(t,i)}function li({type:e,label:t,properties:r}){const i={};for(const e in r)i[e]=si(e,r[e]);return{type:e,label:t,properties:i}}function ci(e){return function(e){return Pr(e,Sr)}(e).map(li)}function mi(e,t){const r=e.map(e=>function({type:e,label:t,properties:r},i){const a=Object.entries(r).map(([e,t])=>i.listItem.join(`${e} = {${t}},`));return i.entry.join(`@${e}{${t},${i.list.join(a.join(""))}}`)}(e,t)).join("");return t.bibliographyContainer.join(r)}const pi=function(e,t){return function(r,i={}){const{type:a,format:u=a||"text"}=i;if(r=e(r),"object"===u)return r;if(ht(u))return t(r,dt(u),i);throw new RangeError(`Output dictionary "${u}" not available`)}};var fi={bibtex:pi(ci,mi),biblatex:pi(function(e){return function(e){return Pr(e,jr)}(e).map(li)},mi),bibtxt:pi(ci,function(e,t){const r=e.map(e=>function({type:e,label:t,properties:r},i){const a=Object.entries(r).concat([["type",e]]).map(([e,t])=>i.listItem.join(`${e}: ${t}`));return i.entry.join(`[${t}]${i.list.join(a.join(""))}`)}(e,t)).join("\n");return t.bibliographyContainer.join(r)})};At("@bibtex",{input:Qr,output:fi,config:hr});const Di=new Le({"en-US":'Andrew DunningSebastian KarcherRintze M. ZelleDenis MeierBrenton M. WiernikThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License2015-10-10T23:31:02+00:00advance online publicationalbumaudio recordingfilmhenceforthloc. cit.no placen.p.no publishern.p.onop. cit.original work publishedpersonal communicationpodcastpodcast episodepreprintradio broadcastradio seriesradio series episodespecial issuespecial sectiontelevision broadcasttelevision seriestelevision series episodevideoworking paperaccessedandand othersanonymousanon.atavailable atbycircac.citededitioneditionsed.et al.forthcomingfromibid.inin pressinternetinterviewletterno daten.d.onlinepresented at thereferencereferencesref.refs.retrievedscaleversionpreprintjournal articlemagazine articlenewspaper articlebillbookbroadcastbook chapterclassiccollectiondatasetdocumententrydictionary entryencyclopedia entryeventgraphichearinginterviewlegal caselegislationmanuscriptmapvideo recordingmusical scorepamphletconference paperpatentperformanceperiodicalpersonal communicationpostblog postregulationreportreviewbook reviewsoftwareaudio recordingpresentationstandardthesistreatywebpagejournal art.mag. art.newspaper art.bk.bk. chap.doc.graph.interv.MSvideo rec.rep.rev.bk. rev.audio rec.ADBCBCECE:,;thstndrdthththfirstsecondthirdfourthfifthsixthseventheighthninthtenthactactsappendixappendicesarticlearticlescanoncanonslocationlocationsequationequationsrulerulesscenescenestabletablestitletitlesbookbookschapterchapterscolumncolumnsfigurefiguresfoliofoliosnumbernumberslinelinesnotenotesopusoperapagepagespagepagesparagraphparagraphspartpartssectionsectionssub verbosub verbisverseversesvolumevolumesapp.apps.art.arts.loc.locs.eq.eqs.r.rr.sc.scs.tbl.tbls.tit.tits.bk.bks.chap.chaps.col.cols.fig.figs.fol.fols.no.nos.l.ll.n.nn.op.opp.p.pp.p.pp.para.paras.pt.pts.sec.secs.s.v.s.vv.v.vv.vol.vols.¶¶§§§chairchairscompilercompilerscontributorcontributorscuratorcuratorsexecutive producerexecutive producersguestguestshosthostsnarratornarratorsorganizerorganizersperformerperformersproducerproducerswriterwritersseries creatorseries creatorsdirectordirectorseditoreditorseditoreditorsillustratorillustratorstranslatortranslatorseditor & translatoreditors & translatorscomp.comps.contrib.contribs.cur.curs.exec. prod.exec. prods.narr.narrs.org.orgs.perf.perfs.prod.prods.writ.writs.cre.cres.dir.dirs.ed.eds.ed.eds.ill.ills.tran.trans.ed. & tran.eds. & trans.chaired bycompiled bywithcurated byexecutive produced bywith guesthosted bynarrated byorganized byperformed byproduced bywritten bycreated bybydirected byedited byedited byillustrated byinterview bytobytranslated byedited & translated bycomp. byw.cur. byexec. prod. byw. guesthosted bynarr. byorg. byperf. byprod. bywrit. bycre. bydir. byed. byed. byillus. bytrans. byed. & trans. byJanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecemberJan.Feb.Mar.Apr.MayJun.Jul.Aug.Sep.Oct.Nov.Dec.SpringSummerAutumnWinter'}),hi=new Le({apa:''}),di=Symbol.for("proxied"),gi=function(e){const t=function(t,r){if(t.sys.wrapBibliographyEntry){const[e,i]=t.sys.wrapBibliographyEntry(this.system_id);r=[e,r,i].join("")}return e.call(this,t,r)};return t[di]=!0,t};for(const e in n.Output.Formats){const t=n.Output.Formats[e]["@bibliography/entry"];t&&!t[di]&&(n.Output.Formats[e]["@bibliography/entry"]=gi(t))}function bi(e){if(Di.has(e))return Di.get(e);const t=e.replace("-","_");return Di.has(t)?Di.get(t):{}}const yi={},Fi=function(e,t,r,i){if(!n.Output.Formats[i]||!n.Output.Formats[i]["@bibliography/entry"])throw new TypeError(`Cannot find format '${i}'`);const a=e.reduce((e,t)=>(e[t.id]=t,e),{}),u=hi.get(hi.has(t)?t:"apa"),o=function(e,t,r,i,a){const u=`${e}|${t}`;let o;return yi[u]instanceof n.Engine?(o=yi[u],o.sys.retrieveItem=i,o.sys.wrapBibliographyEntry=void 0,o.updateItems([])):o=yi[u]=new n.Engine({retrieveLocale:a,retrieveItem:i},r,t,!0),o}(t,r=Di.has(r)?r:void 0,u,function(e){if(Object.prototype.hasOwnProperty.call(a,e))return a[e];throw new Error(`Cannot find entry with id '${e}'`)},bi);return o.setOutputFormat(i),o},vi=(e,t)=>"function"==typeof t?t(e):t||"";function Ai(e){return"object"==typeof e?e:{id:e}}function xi(e){return e.citationItems?e:{citationItems:[].concat(e).map(Ai),properties:{noteIndex:0}}}function Ei(e){return e?e.map(xi):[]}At("@csl",{output:{bibliography:function(e,t={}){const{template:r="apa",lang:i,format:a="text",nosort:u=!1}=t,o=t.entry?[].concat(t.entry):e.map(({id:e})=>e);e=ce(e);const n=Fi(e,r,i,a),s=n.updateItems(o,u);if(t.append||t.prepend){const r=e.reduce((e,t)=>(e[t.id]=t,e),{});n.sys.wrapBibliographyEntry=function(e){const i=r[e];return[vi(i,t.prepend),vi(i,t.append)]}}const l=n.makeBibliography(),[{bibstart:c,bibend:m},p]=l,f=p.map((e,t)=>e.replace(/^\s*<[a-z]+/i,`$& data-csl-entry-id="${s[t]}"`));return t.asEntryArray?f.map((e,t)=>[s[t],e]):c+f.join("")+m},citation:function(e,t={}){const{template:r="apa",lang:i,format:a="text"}=t,u=e.map(({id:e})=>e),o=t.entry?t.entry:u;e=ce(e);const n=Fi(e,r,i,a),s=Ei(t.citationsPre),l=xi(o),c=Ei(t.citationsPost);return n.rebuildProcessorState([...s,l,...c],a,[])[s.length][2]}},config:{engine:Fi,locales:Di,templates:hi}});const Ci="tag:yaml.org,2002:timestamp",wi=s.DEFAULT_SCHEMA.compiledTypeMap.scalar[Ci],Bi=new s.Type(Ci,{kind:"scalar",resolve:wi.resolve,construct:wi.construct,instanceOf:Date,represent:e=>e.toISOString().split("T")[0]}),ki=s.DEFAULT_SCHEMA.extend({implicit:[Bi],explicit:[]});At("@else",{input:{"@else/yaml":{parseType:{dataType:"String",tokenList:{split:/\n(\s{2})*(-\s)?/,token:/^[\w-]*: /,every:!1}},parse:e=>s.load(e,{json:!0})}},output:{yaml:e=>s.dump(e,{schema:ki})}});const Ti={art:"graphic",article:"article-journal",audiovisual:"motion_picture",bill:"bill",blog:"post-weblog",book:"book",catalogue:"collection",conference:"event","conference-paper":"paper-conference",data:"dataset",database:"dataset",dictionary:"entry-dictionary","edited-work":"document",encyclopedia:"entry-encyclopedia","film-broadcast":"broadcast",generic:"document","government-document":"regulation",grant:"document",hearing:"hearing","historical-work":"classic","legal-case":"legal_case","legal-rule":"legislation","magazine-article":"article-magazine",manual:"report",map:"map",multimedia:"motion_picture",music:"musical_score","newspaper-article":"article-newspaper",pamphlet:"pamphlet",patent:"patent","personal-communication":"personal_communication",proceedings:"book",report:"report",serial:"periodical",slides:"speech",software:"software","software-code":"software","software-container":"software","software-executable":"software","software-virtual-machine":"software","sound-recording":"song",standard:"standard",statute:"legislation",thesis:"thesis",unpublished:"article",video:"motion_picture",website:"webpage"},ji={article:"article","article-journal":"article","article-magazine":"magazine-article","article-newspaper":"newspaper-article",bill:"bill",book:"book",broadcast:"film-broadcast",chapter:"generic",classic:"historical-work",collection:"catalogue",dataset:"data",document:"generic",entry:"generic","entry-dictionary":"dictionary","entry-encyclopedia":"encyclopedia",event:"conference",figure:"generic",graphic:"art",hearing:"hearing",interview:"sound-recording",legal_case:"legal-case",legislation:"statute",manuscript:"historical-work",map:"map",motion_picture:"film-broadcast",musical_score:"music",pamphlet:"pamphlet","paper-conference":"conference-paper",patent:"patent",performance:"generic",periodical:"serial",personal_communication:"personal-communication",post:"serial","post-weblog":"blog",regulation:"government-document",report:"report",review:"generic","review-book":"generic",software:"software",song:"sound-recording",speech:"slides",standard:"standard",thesis:"thesis",treaty:"generic",webpage:"website"},Si=new Ue([{source:"family-names",target:"family"},{source:"given-names",target:"given"},{source:"name-particle",target:"non-dropping-particle"},{source:"name-suffix",target:"suffix"},{source:"name",target:"literal"},{source:"orcid",target:"_orcid"}]),_i={names:{toTarget:e=>e.map(Si.convertToTarget),toSource:e=>e.map(Si.convertToSource)},publisher:{toTarget:({name:e,city:t,region:r,country:i})=>[e,[t,r,i].filter(Boolean).join(", ")||void 0],toSource(e,t){const r={name:e};if(t){const e=t.split(", ");r.country=e.pop(),2===e.length&&(r.region=e.pop()),1===e.length&&(r.city=e.pop())}return r}},date:{toTarget:e=>e instanceof Date?u(e.toISOString()):u(new Date(e).toISOString()),toSource(e){if(e.raw)return e.raw;const[t,r,i]=e["date-parts"][0];return i?new Date(Date.UTC(t,r-1,i)):r?new Date(Date.UTC(t,r-1)):new Date(Date.UTC(t))}}},Oi=["abstract",{source:"authors",target:"author",convert:_i.names},{source:"date-released",target:"issued",when:{target:{type:"software"}},convert:_i.date},{source:"doi",target:"DOI"},{source:"identifiers",target:["DOI","ISBN","ISSN","PMCID","PMID","URL"],convert:{toTarget(e){const t=Array(6).fill(void 0);for(const{type:r,value:i}of e)this.doi||"doi"!==r||(t[0]=i),this.url||"url"!==r||(t[5]=i),"other"===r&&i.startsWith("urn:isbn:")&&(t[1]=i.slice(9)),"other"===r&&i.startsWith("urn:issn:")&&(t[2]=i.slice(9)),"other"===r&&i.startsWith("pmcid:")&&(t[3]=i.slice(6)),"other"===r&&i.startsWith("pmid:")&&(t[4]=i.slice(5));return t},toSource:(e,t,r,i,a,u)=>[e&&{type:"doi",value:e},u&&{type:"url",value:u},t&&{type:"other",value:`urn:isbn:${t}`},r&&{type:"other",value:`urn:issn:${r}`},i&&{type:"other",value:`pmcid:${i}`},a&&{type:"other",value:`pmid:${a}`}].filter(Boolean)}},{source:"keywords",target:"keyword",convert:{toTarget:e=>e.join(","),toSource:e=>e.split(/,\s*/g)}},{source:"title",target:"title",when:{source:{term:!1,entry:!1},target:{type:e=>!["entry","entry-dictionary","entry-encyclopedia"].includes(e)}}},{source:"title",target:"container-title",when:{source:{entry:!0,journal:!1},target:{type:["entry"]}}},{source:"title",target:"container-title",when:{source:{term:!0,journal:!1},target:{type:["entry-dictionary","entry-encyclopedia"]}}},{source:"url",target:"URL"},"version"],Ri=[{source:"type",target:"type",convert:{toSource:e=>"dataset"===e?"dataset":"software",toTarget:e=>"dataset"===e?"dataset":"software"}},...Oi],zi=[...Oi,{source:"abbreviation",target:"title-short"},{source:"abbreviation",target:"shortTitle"},"collection-title",{source:"recipients",target:"recipient",convert:_i.names},{source:"senders",target:"authors",convert:_i.names},{source:"conference",target:["event-title","event-date","event-place","event"],convert:{toSource(e,t,r,i){const a={name:e||i};return r&&(a.location=r),t&&(a["date-start"]=_i.date.toSource(t),t["date-parts"]&&2===t["date-parts"].length&&(a["date-end"]=_i.date.toSource({"date-parts":[t["date-parts"][1]]}))),a},toTarget:e=>[e.name,u(e["date-start"].toISOString(),e["date-end"].toISOString()),e.location]}},{source:"database",target:"source"},{source:"date-accessed",target:"accessed",convert:_i.date},{source:"date-downloaded",target:"accessed",convert:_i.date,when:{source:{"date-accessed":!1},target:!1}},{source:"date-published",target:"issued",convert:_i.date,when:{source:{"date-released":!1},target(){return"book"!==this.type||!this.version}}},{source:["year","month"],target:"issued",when:{source:{"date-published":!1,"date-released":!1,year:!0}},convert:{toTarget:(e,t)=>({"date-parts":[t?[e,t]:[e]]}),toSource(e){const[t,r]=e["date-parts"][0];return[t,r]}}},{source:"year-original",target:"original-date",convert:{toTarget:e=>({"date-parts":[[e]]}),toSource:e=>e["date-parts"][0][0]}},"edition",{source:"editors",target:"editor",convert:_i.names},{source:"editors-series",target:"collection-editor",convert:_i.names},{source:"entry",target:"title",when:{source:{term:!1},target:{type:"entry"}}},{source:"term",target:"title",when:{target:{type:["entry-dictionary","entry-encyclopedia"]}}},{source:"format",target:"dimensions"},"medium",{source:"data-type",target:"genre",when:{target:{type:e=>"thesis"!==e}}},{source:"thesis-type",target:"genre",when:{source:{"data-type":!1},target:{type:"thesis"}}},{source:"isbn",target:"ISBN"},{source:"issn",target:"ISSN"},{source:"pmcid",target:"PMCID"},"issue",{source:"journal",target:"container-title"},{source:"volume-title",target:"volume-title"},{source:"issue-title",target:"volume-title",when:{source:{"volume-title":!1},target:!1}},{source:"languages",target:"language",when:{target:!0,source:{language:e=>/[a-z]{2,3}/.test(e)}},convert:{toSource:e=>[e],toTarget:e=>e[0]}},{source:"location",target:["archive","archive-place"],convert:_i.publisher},{source:"notes",target:"note",when:{source:{scope:!1}}},{source:"scope",target:"note",when:{target:!1}},"number",{source:"patent-states",target:"jurisdiction",when:{target:!1},convert:{toTarget:e=>e.join(", ")}},{source:["institution","department"],target:["publisher","publisher-place"],when:{source:{publisher:!1},target:{type:"thesis"}},convert:{toTarget(e,t){const[r,i]=_i.publisher.toTarget(e);return[t?`${t}, ${r}`:r,i]},toSource:(e,t)=>[_i.publisher.toSource(e,t)]}},{source:"publisher",target:["publisher","publisher-place"],when:{target:{type:e=>"thesis"!==e}},convert:_i.publisher},"section",{source:"status",target:"status",when:{source:!0,target:{status:["in-preparation","abstract","submitted","in-press","advance-online","preprint"]}}},{source:"start",target:"page-first",when:{target:{page:!1}}},{source:["start","end"],target:"page",convert:{toTarget:(e,t)=>t?`${e}-${t}`:e,toSource(e){const[t,r]=e.split("-");return r?[t,r]:[t]}}},{source:"pages",target:"number-of-pages"},{source:"translators",target:"translator",convert:_i.names},{source:"type",target:"type",convert:{toTarget:e=>Ti[e]||"document",toSource(e){return"book"===e&&this["event-title"]?"proceedings":ji[e]||"generic"}}},"volume",{source:"number-volumes",target:"number-of-volumes"}],Ii=new Ue(Ri),Li=new Ue(zi),Pi="1.2.0";function $i(e){"DOI"in e?e.id=e.DOI:"URL"in e&&(e.id=e.URL.replace("http://","").replace("https://",""))}function Ui(e,t){if(!(this instanceof Ui))return new Ui(e,t);const r=new ft(e,t);this._options=r._options,this.log=r.log,this.data=r.data}At("@cff",{input:{"@cff/object":{parseType:{dataType:"SimpleObject",propertyConstraint:{props:"cff-version"}},parse:function(e){const t=Ii.convertToTarget(e);e["cff-version"]<="1.1.0"&&(t.type=Ti.software),t._cff_mainReference=!0,$i(t);const r=[t];if(e["preferred-citation"]){const t=Li.convertToTarget(e["preferred-citation"]);$i(t),r.push(t)}return Array.isArray(e.references)&&r.push(...e.references.map(Li.convertToTarget)),r}}},output:{cff(e,t={}){const r=function(e,t={}){e=e.slice();const{main:r,preferred:i,cffVersion:a=Pi,message:u="Please cite the following works when using this software."}=t;let o;const n=e.findIndex(e=>i&&e.id===i);a>="1.2.0"&&n>-1&&(o=Li.convertToSource(...e.splice(n,1)));let s=e.findIndex(e=>r?e.id===r:e._cff_mainReference);s=s>-1?s:0;const l=e[s]?Ii.convertToSource(...e.splice(s,1)):{};l&&a<"1.2.0"&&delete l.type;const m=c({"cff-version":a,message:u},l);return o&&(m["preferred-citation"]=o),e.length&&(m.references=e.map(Li.convertToSource)),m}(e,t);return"object"===t.type?r:lt("yaml",r)}}});const Ni=(Ui.plugins=function e(t){const r={};for(const i in t)r[i]="object"==typeof t[i]?e(t[i]):t[i];return r}(xt)).config.get("@csl");Ni.templates.add("vancouver",''),Ni.templates.add("harvard1",''),Ni.templates.add("mla",''),Ni.templates.add("chicago",'');const Mi=E(Ui);export{Ui as Cite,Mi as default,E as rehypeCitationGenerator}; //# sourceMappingURL=rehype-citation.mjs.map