!function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=133)}({13:function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=o=function(t){return n(t)}:t.exports=o=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},o(e)}t.exports=o},133:function(t,e,n){"use strict";n.r(e),n.d(e,"default",function(){return E});var o=n(2),r=n.n(o),i=n(9),a=n.n(i),c=n(14),s=n.n(c),l=n(3),u=n.n(l),d=n(4),f=n.n(d),h=n(7),y=n.n(h),v=n(6),p=n.n(v),m=n(8),b=n.n(m),g=(n(139),n(16)),E=function(t){function e(){var t;return u()(this,e),(t=y()(this,p()(e).apply(this,arguments))).editorCitationObserver=new MutationObserver(function(t){var e=!0,n=!1,o=void 0;try{for(var r,i=t[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var a=r.value,c=!0,s=!1,l=void 0;try{for(var u,d=a.removedNodes[Symbol.iterator]();!(c=(u=d.next()).done);c=!0){var f=u.value;f instanceof Element&&f.classList.contains(g.a.citationClass)&&dispatchEvent(new CustomEvent(g.a.events.CITATION_DELETED))}}catch(t){s=!0,l=t}finally{try{c||null==d.return||d.return()}finally{if(s)throw l}}}}catch(t){n=!0,o=t}finally{try{e||null==i.return||i.return()}finally{if(n)throw o}}}),t.selectionCache={fresh:!1,selection:"",bookmark:{rng:document.createRange()}},t}return b()(e,t),f()(e,[{key:"alert",value:function(t){this.editor.windowManager.alert(t)}},{key:"composeCitations",value:function(t,e,n){this.editor.focus();for(var o=this.editor.getDoc(),r=o.querySelectorAll("\n #".concat(g.a.footnoteId,",\n #").concat(g.a.bibliographyId,"\n ")),i=Array.from(r),a=0;a2&&void 0!==arguments[2]&&arguments[2]?this.setStaticBibliography(e):this.setStandardBibliography(t,e)}},{key:"setLoadingState",value:function(t){this.editor.setProgressState(t||!1)}},{key:"bindEvents",value:function(){var t=this;this.editor.on("focusin",function(){t.selectionCache=Object.assign({},t.selectionCache,{fresh:!1})}),this.editor.on("focusout",function(){t.selectionCache={fresh:!0,selection:t.selection,bookmark:t.editor.selection.getBookmark(1)}}),this.editor.on("hide",function(){dispatchEvent(new CustomEvent(g.a.events.UNAVAILABLE))}),this.editor.on("show",function(){dispatchEvent(new CustomEvent(g.a.events.AVAILABLE))}),this.editor.on("Undo",function(){dispatchEvent(new CustomEvent(g.a.events.UNDO))}),this.editor.addShortcut("meta+alt+r","Add Reference",function(){return dispatchEvent(new CustomEvent(g.a.events.ADD_REFERENCE))}),this.editor.addShortcut("meta+alt+p","Pin Reference List",function(){return dispatchEvent(new CustomEvent(g.a.events.TOGGLE_PINNED))}),this.editorCitationObserver.observe(this.editor.getBody(),{childList:!0,subtree:!0})}},{key:"composeFootnotes",value:function(){var t=this.editor.getDoc(),e=r()(t.querySelectorAll(".".concat(g.a.citationClass)).entries()).reduce(function(t,e){var n=s()(e,2),o=n[0],i=n[1];i.innerHTML="[".concat(o+1,"]");var a=i.getAttribute("data-footnote");return a?[].concat(r()(t),[a]):t},[]);if(0!==e.length){var n=this.editor.selection.getBookmark(),o=g.a.createFootnoteSection(e,["noselect","mceNonEditable"]),i=this.editor.getBody();this.editor.selection.setCursorLocation(i,i.childNodes.length),this.editor.insertContent(o.outerHTML),this.editor.selection.moveToBookmark(n)}}},{key:"setStandardBibliography",value:function(t,e){if("boolean"!=typeof e&&0!==e.length){var n=g.a.createBibliographyElement(t,e,["noselect","mceNonEditable"]),o=this.editor.selection.getBookmark(),r=this.editor.getBody();this.editor.selection.setCursorLocation(r,r.childNodes.length),this.editor.insertContent(n.outerHTML),this.editor.selection.moveToBookmark(o)}}},{key:"setStaticBibliography",value:function(t){var e="boolean"==typeof t?[]:t,n=g.a.createBibliographyElement({},e,["".concat(g.a.staticBibClass),"noselect","mceNonEditable"]);this.selectionCache.fresh&&this.editor.selection.moveToBookmark(this.selectionCache.bookmark),this.editor.insertContent(n.outerHTML)}},{key:"citationIds",get:function(){var t=this.editor.getDoc().querySelectorAll("*:not(.mce-offscreen-selection) > .".concat(g.a.citationClass));return r()(t).map(function(t){return t.id})}},{key:"citationsByIndex",get:function(){var t=this.editor.getDoc(),e=r()(t.querySelectorAll("\n *:not(.mce-offscreen-selection) >\n .".concat(g.a.citationClass,"\n "))),n=null!==t.querySelector("#".concat(g.a.footnoteId));return e.reduce(function(t,e,o){var i=e.getAttribute("data-reflist");if(!i)return t;var a=JSON.parse(i);return[].concat(r()(t),[{citationID:e.id,citationItems:a.map(function(t){return{id:t}}),properties:{index:o,noteIndex:n?1:0}}])},[])}},{key:"relativeCitationPositions",get:function(){var t=this,e=this.editor.getDoc(),n=(this.selectionCache.fresh?this.selectionCache.bookmark:this.editor.selection.getBookmark(1)).rng.startContainer;return r()(e.querySelectorAll("\n *:not(.mce-offscreen-selection) >\n .".concat(g.a.citationClass,"\n "))).reduce(function(e,o,i){if(!o.parentNode)throw new Error("parentNode not defined for citation");switch(n.compareDocumentPosition(o)){case Node.DOCUMENT_POSITION_PRECEDING:e.itemsPreceding=[].concat(r()(e.itemsPreceding),[[o.id,i]]);break;case Node.DOCUMENT_POSITION_FOLLOWING:e.itemsFollowing=[].concat(r()(e.itemsFollowing),[[o.id,i+1]]);break;default:o.parentElement.removeChild(o),t.editor.selection.moveToBookmark(t.selectionCache.bookmark)}return e},{itemsPreceding:[],itemsFollowing:[]})}},{key:"selection",get:function(){return this.selectionCache.fresh?this.selectionCache.selection:this.editor.selection.getContent({format:"html"})}}]),e}(g.a)},139:function(t,e,n){},14:function(t,e,n){var o=n(44),r=n(45),i=n(46);t.exports=function(t,e){return o(t)||r(t,e)||i()}},16:function(t,e,n){"use strict";var o,r=n(3),i=n.n(r),a=n(4),c=n.n(a),s=n(7),l=n.n(s),u=n(6),d=n.n(u),f=n(8),h=n.n(f),y=n(14),v=n.n(y),p=n(2),m=n.n(p),b=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r2&&void 0!==arguments[2]?arguments[2]:[],f=document.createElement("div");if(f.id=t.bibliographyId,f.setAttribute("data-reflist",JSON.stringify(n.map(function(t){return t.id}))),(o=f.classList).add.apply(o,[t.bibliographyId].concat(m()(d))),f.classList.contains(t.staticBibClass)&&(f.classList.remove(t.bibliographyId),f.removeAttribute("id"),0===n.length)){var h=top.ABT.i18n.errors.warnings;return f.innerHTML="".concat(h.warning,": ").concat(h.no_bib,"."),f}a&&("toggle"===u?((r=document.createElement("button")).classList.add("".concat(t.bibliographyId,"__heading"),"".concat(t.bibliographyId,"__heading_toggle")),r.setAttribute("aria-expanded","false"),r.setAttribute("aria-controls","".concat(this.bibliographyId,"__container")),r.setAttribute("data-heading-level",s)):(r=document.createElement(s)).classList.add("".concat(t.bibliographyId,"__heading")),r.textContent=a,f.appendChild(r));var y=document.createElement("div");y.id="".concat(this.bibliographyId,"__container"),y.classList.add("".concat(this.bibliographyId,"__container")),f.appendChild(y);var v=!0,p=!1,b=void 0;try{for(var g,E=n[Symbol.iterator]();!(v=(g=E.next()).done);v=!0){var C=g.value,I=document.createElement("div");I.id=C.id,I.innerHTML=C.html,y.appendChild(I)}}catch(t){p=!0,b=t}finally{try{v||null==E.return||E.return()}finally{if(p)throw b}}return f}},{key:"createFootnoteSection",value:function(e){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=document.createElement("div");r.id=t.footnoteId,(n=r.classList).add.apply(n,[t.footnoteId].concat(m()(o)));var i=document.createElement("div");i.classList.add("".concat(t.footnoteId,"__heading")),i.textContent=top.ABT.i18n.misc.footnotes,r.appendChild(i);for(var a=Array.from(e.entries()),c=0;c