diff --git a/CHANGES.md b/CHANGES.md index dcae219f519c91c3a8eab06005b718eb6015df94..ff9454b58c258644bf04e41305e52c79eea3680a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,8 @@ ## Development (): +* **Update**: Updated the TEI editor dependency + ## 0.9.0 (24.01.2020): * **Update**: Updated to use the new TEI editor diff --git a/editor/static/editor/css/tei-editor.css b/editor/static/editor/css/tei-editor.css index 16e015da1bd484ef028daee124e2da9d9f19ae92..4aef65522cca74e9b369ef194ffdc72d4fa01386 100644 --- a/editor/static/editor/css/tei-editor.css +++ b/editor/static/editor/css/tei-editor.css @@ -1 +1 @@ -ul[role=menubar]{margin:0;padding:0;position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}ul[role=menubar] li{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;vertical-align:top}ul[role=menubar] li a{cursor:pointer}ul[role=menubar] [aria-hidden=true]{display:none}ul[role=menubar] ul[role=menu]{margin:0;padding:0}ul[role=menubar] ul[role=menu][aria-hidden=false]{position:absolute}#tei-editor,ul[role=menubar] ul[role=menu][aria-hidden=false]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}#tei-editor{height:100%;max-height:100%}#tei-editor>nav{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}#tei-editor>div{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;overflow:auto}#tei-editor svg{width:24px;height:24px}#tei-editor ol,#tei-editor ul{margin:0;padding:0}#tei-editor ol.multi-row>li,#tei-editor ul.multi-row>li{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}#tei-editor ol.multi-row>li>div,#tei-editor ul.multi-row>li>div{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto}#tei-editor ol.multi-row>li>ul,#tei-editor ul.multi-row>li>ul{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}#tei-editor ol.multi-field,#tei-editor ul.multi-field{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}#tei-editor ol.multi-field>li,#tei-editor ul.multi-field>li{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto}#tei-editor ol li,#tei-editor ul li{list-style-type:none}#tei-editor .text-editor{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;height:100%;width:100%;position:relative}#tei-editor .text-editor>div:first-child{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto}#tei-editor .text-editor>div.sidebar{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}#tei-editor .text-editor>div.nested{position:absolute;width:100%;height:100%} \ No newline at end of file +ul[role=menubar]{margin:0;padding:0;position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}ul[role=menubar] li{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;vertical-align:top}ul[role=menubar] li a{cursor:pointer}ul[role=menubar] [aria-hidden=true]{display:none}ul[role=menubar] ul[role=menu]{margin:0;padding:0}ul[role=menubar] ul[role=menu][aria-hidden=false]{position:absolute}#tei-editor,ul[role=menubar] ul[role=menu][aria-hidden=false]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}#tei-editor{height:100%;max-height:100%}#tei-editor>nav{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}#tei-editor>div{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;overflow:auto}#tei-editor svg{width:24px;height:24px}#tei-editor ol,#tei-editor ul{margin:0;padding:0}#tei-editor ol.multi-row>li,#tei-editor ul.multi-row>li{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}#tei-editor ol.multi-row>li>div,#tei-editor ul.multi-row>li>div{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto}#tei-editor ol.multi-row>li>ul,#tei-editor ul.multi-row>li>ul{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}#tei-editor ol.multi-field,#tei-editor ul.multi-field{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}#tei-editor ol.multi-field>li,#tei-editor ul.multi-field>li{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto}#tei-editor ol li,#tei-editor ul li{list-style-type:none}#tei-editor .text-editor{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;height:100%;width:100%;position:relative}#tei-editor .text-editor>div:first-child{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;overflow-y:auto}#tei-editor .text-editor>div.sidebar{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;overflow-y:auto}#tei-editor .text-editor>div.sidebar>div{display:none}#tei-editor .text-editor>div.sidebar>div.is-active{display:block}#tei-editor .text-editor>div.nested{position:absolute;width:100%;height:100%} \ No newline at end of file diff --git a/editor/static/editor/js/tei-editor.js b/editor/static/editor/js/tei-editor.js index fdbe62e7cad466c616e1f2f83b2e9ffbd20e1db0..987662f7a84a5ecb04421559980bcb2d79763052 100644 --- a/editor/static/editor/js/tei-editor.js +++ b/editor/static/editor/js/tei-editor.js @@ -29,5 +29,5 @@ function o(t){return i(t)||s(t)||a()}function i(t){if(Array.isArray(t)){for(var */ function or(t){return or="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},or(t)}function ir(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ar(t,e,n){return e&&sr(t.prototype,e),n&&sr(t,n),t}function cr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ur(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?lr(Object(n),!0).forEach((function(e){cr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function fr(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&dr(t,e)}function pr(t){return pr=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},pr(t)}function dr(t,e){return dr=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},dr(t,e)}function hr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vr(t,e){return!e||"object"!==typeof e&&"function"!==typeof e?hr(t):e}function mr(t,e){return br(t)||Sr(t,e)||kr()}function gr(t){return yr(t)||wr(t)||xr()}function yr(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}function br(t){if(Array.isArray(t))return t}function wr(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function Sr(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var n=[],r=!0,o=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done);r=!0)if(n.push(s.value),e&&n.length===e)break}catch(c){o=!0,i=c}finally{try{r||null==a["return"]||a["return"]()}finally{if(o)throw i}}return n}}function xr(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function kr(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Cr(t){return t.replace(/(?:^\w|[A-Z]|\b\w)/g,(function(t,e){return 0===e?t.toLowerCase():t.toUpperCase()})).replace(/\s+/g,"")}n.d(e,"a",(function(){return Pr})),n.d(e,"b",(function(){return jr})),n.d(e,"c",(function(){return zr})),n.d(e,"d",(function(){return Br})),n.d(e,"e",(function(){return Tr})),n.d(e,"f",(function(){return Er})),n.d(e,"g",(function(){return $r}));var Or=function(){function t(e,n){var r=n.editor,o=n.extension,i=n.parent,s=n.node,a=n.view,c=n.decorations,l=n.getPos;ir(this,t),this.component=e,this.editor=r,this.extension=o,this.parent=i,this.node=s,this.view=a,this.decorations=c,this.isNode=!!this.node.marks,this.isMark=!this.isNode,this.getPos=this.isMark?this.getMarkPos:l,this.captureEvents=!0,this.dom=this.createDOM(),this.contentDOM=this.vm.$refs.content}return ar(t,[{key:"createDOM",value:function(){var t=this,e=nr["a"].extend(this.component),n={editor:this.editor,node:this.node,view:this.view,getPos:function(){return t.getPos()},decorations:this.decorations,selected:!1,options:this.extension.options,updateAttrs:function(e){return t.updateAttrs(e)}};return"function"===typeof this.extension.setSelection&&(this.setSelection=this.extension.setSelection),this.vm=new e({parent:this.parent,propsData:n}).$mount(),this.vm.$el}},{key:"update",value:function(t,e){return t.type===this.node.type&&(t===this.node&&this.decorations===e||(this.node=t,this.decorations=e,this.updateComponentProps({node:t,decorations:e}),!0))}},{key:"updateComponentProps",value:function(t){var e=this;if(this.vm._props){var n=nr["a"].config.silent;nr["a"].config.silent=!0,Object.entries(t).forEach((function(t){var n=mr(t,2),r=n[0],o=n[1];e.vm._props[r]=o})),nr["a"].config.silent=n}}},{key:"updateAttrs",value:function(t){if(this.view.editable){var e=this.view.state,n=this.node.type,r=this.getPos(),o=ur({},this.node.attrs,{},t),i=this.isMark?e.tr.removeMark(r.from,r.to,n).addMark(r.from,r.to,n.create(o)):e.tr.setNodeMarkup(r,null,o);this.view.dispatch(i)}}},{key:"ignoreMutation",value:function(t){return"selection"!==t.type&&(!this.contentDOM||!this.contentDOM.contains(t.target))}},{key:"stopEvent",value:function(t){var e=this;if("function"===typeof this.extension.stopEvent)return this.extension.stopEvent(t);var n=!!this.extension.schema.draggable;if(n&&"mousedown"===t.type){var r=t.target.closest&&t.target.closest("[data-drag-handle]"),o=r&&(this.dom===r||this.dom.contains(r));o&&(this.captureEvents=!1,document.addEventListener("dragend",(function(){e.captureEvents=!0}),{once:!0}))}var i="copy"===t.type,s="paste"===t.type,a="cut"===t.type,c=t.type.startsWith("drag")||"drop"===t.type;return!(n&&c||i||s||a)&&this.captureEvents}},{key:"selectNode",value:function(){this.updateComponentProps({selected:!0})}},{key:"deselectNode",value:function(){this.updateComponentProps({selected:!1})}},{key:"getMarkPos",value:function(){var t=this.view.posAtDOM(this.dom),e=this.view.state.doc.resolve(t),n=Object(er["b"])(e,this.node.type);return n}},{key:"destroy",value:function(){this.vm.$destroy()}}]),t}(),Mr=function(){function t(){ir(this,t)}return ar(t,[{key:"on",value:function(t,e){return this._callbacks=this._callbacks||{},this._callbacks[t]||(this._callbacks[t]=[]),this._callbacks[t].push(e),this}},{key:"emit",value:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this._callbacks=this._callbacks||{};var i=this._callbacks[t];return i&&i.forEach((function(t){return t.apply(e,r)})),this}},{key:"off",value:function(t,e){if(arguments.length){var n=this._callbacks?this._callbacks[t]:null;n&&(e?this._callbacks[t]=n.filter((function(t){return t!==e})):delete this._callbacks[t])}else this._callbacks={};return this}}]),t}(),Nr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ir(this,t),this.options=ur({},this.defaultOptions,{},e)}return ar(t,[{key:"init",value:function(){return null}},{key:"bindEditor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.editor=t}},{key:"inputRules",value:function(){return[]}},{key:"pasteRules",value:function(){return[]}},{key:"keys",value:function(){return{}}},{key:"name",get:function(){return null}},{key:"type",get:function(){return"extension"}},{key:"update",get:function(){return function(){}}},{key:"defaultOptions",get:function(){return{}}},{key:"plugins",get:function(){return[]}}]),t}(),Ar=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;ir(this,t),e.forEach((function(t){t.bindEditor(n),t.init()})),this.extensions=e}return ar(t,[{key:"keymaps",value:function(t){var e=t.schema,n=this.extensions.filter((function(t){return["extension"].includes(t.type)})).filter((function(t){return t.keys})).map((function(t){return t.keys({schema:e})})),r=this.extensions.filter((function(t){return["node","mark"].includes(t.type)})).filter((function(t){return t.keys})).map((function(t){return t.keys({type:e["".concat(t.type,"s")][t.name],schema:e})}));return[].concat(gr(n),gr(r)).map((function(t){return Object(Ln["b"])(t)}))}},{key:"inputRules",value:function(t){var e=t.schema,n=t.excludedExtensions;if(!(n instanceof Array)&&n)return[];var r=n instanceof Array?this.extensions.filter((function(t){return!n.includes(t.name)})):this.extensions,o=r.filter((function(t){return["extension"].includes(t.type)})).filter((function(t){return t.inputRules})).map((function(t){return t.inputRules({schema:e})})),i=r.filter((function(t){return["node","mark"].includes(t.type)})).filter((function(t){return t.inputRules})).map((function(t){return t.inputRules({type:e["".concat(t.type,"s")][t.name],schema:e})}));return[].concat(gr(o),gr(i)).reduce((function(t,e){return[].concat(gr(t),gr(e))}),[])}},{key:"pasteRules",value:function(t){var e=t.schema,n=t.excludedExtensions;if(!(n instanceof Array)&&n)return[];var r=n instanceof Array?this.extensions.filter((function(t){return!n.includes(t.name)})):this.extensions,o=r.filter((function(t){return["extension"].includes(t.type)})).filter((function(t){return t.pasteRules})).map((function(t){return t.pasteRules({schema:e})})),i=r.filter((function(t){return["node","mark"].includes(t.type)})).filter((function(t){return t.pasteRules})).map((function(t){return t.pasteRules({type:e["".concat(t.type,"s")][t.name],schema:e})}));return[].concat(gr(o),gr(i)).reduce((function(t,e){return[].concat(gr(t),gr(e))}),[])}},{key:"commands",value:function(t){var e=t.schema,n=t.view;return this.extensions.filter((function(t){return t.commands})).reduce((function(t,r){var o=r.name,i=r.type,s={},a=r.commands(ur({schema:e},["node","mark"].includes(i)?{type:e["".concat(i,"s")][o]}:{})),c=function(t,e){return!!n.editable&&(n.focus(),t(e)(n.state,n.dispatch,n))},l=function(t,e){Array.isArray(e)?s[t]=function(t){return e.forEach((function(e){return c(e,t)}))}:"function"===typeof e&&(s[t]=function(t){return c(e,t)})};return"object"===or(a)?Object.entries(a).forEach((function(t){var e=mr(t,2),n=e[0],r=e[1];l(n,r)})):l(o,a),ur({},t,{},s)}),{})}},{key:"nodes",get:function(){return this.extensions.filter((function(t){return"node"===t.type})).reduce((function(t,e){var n=e.name,r=e.schema;return ur({},t,cr({},n,r))}),{})}},{key:"options",get:function(){var t=this.view;return this.extensions.reduce((function(e,n){return ur({},e,cr({},n.name,new Proxy(n.options,{set:function(e,r,o){var i=e[r]!==o;return Object.assign(e,cr({},r,o)),i&&n.update(t),!0}})))}),{})}},{key:"marks",get:function(){return this.extensions.filter((function(t){return"mark"===t.type})).reduce((function(t,e){var n=e.name,r=e.schema;return ur({},t,cr({},n,r))}),{})}},{key:"plugins",get:function(){return this.extensions.filter((function(t){return t.plugins})).reduce((function(t,e){var n=e.plugins;return[].concat(gr(t),gr(n))}),[])}}]),t}();function _r(t){var e=document.createElement("style");e.type="text/css",e.textContent=t;var n=document,r=n.head,o=r.firstChild;o?r.insertBefore(e,o):r.appendChild(e)}var Tr=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ir(this,e),vr(this,pr(e).call(this,t))}return fr(e,t),ar(e,[{key:"command",value:function(){return function(){}}},{key:"type",get:function(){return"mark"}},{key:"view",get:function(){return null}},{key:"schema",get:function(){return null}}]),e}(Nr);function Dr(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Math.min(Math.max(parseInt(t,10),e),n)}var Er=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ir(this,e),vr(this,pr(e).call(this,t))}return fr(e,t),ar(e,[{key:"command",value:function(){return function(){}}},{key:"type",get:function(){return"node"}},{key:"view",get:function(){return null}},{key:"schema",get:function(){return null}}]),e}(Nr),Pr=function(t){function e(){return ir(this,e),vr(this,pr(e).apply(this,arguments))}return fr(e,t),ar(e,[{key:"name",get:function(){return"doc"}},{key:"schema",get:function(){return{content:"block+"}}}]),e}(Er),Rr=function(t){function e(){return ir(this,e),vr(this,pr(e).apply(this,arguments))}return fr(e,t),ar(e,[{key:"commands",value:function(t){var e=t.type;return function(){return Object(rr["b"])(e)}}},{key:"name",get:function(){return"paragraph"}},{key:"schema",get:function(){return{content:"inline*",group:"block",draggable:!1,parseDOM:[{tag:"p"}],toDOM:function(){return["p",0]}}}}]),e}(Er),$r=function(t){function e(){return ir(this,e),vr(this,pr(e).apply(this,arguments))}return fr(e,t),ar(e,[{key:"name",get:function(){return"text"}},{key:"schema",get:function(){return{group:"inline"}}}]),e}(Er),Ir='.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n',jr=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ir(this,e),t=vr(this,pr(e).call(this)),t.defaultOptions={editorProps:{},editable:!0,autoFocus:null,extensions:[],content:"",topNode:"doc",emptyDocument:{type:"doc",content:[{type:"paragraph"}]},useBuiltInExtensions:!0,disableInputRules:!1,disablePasteRules:!1,dropCursor:{},parseOptions:{},injectCSS:!0,onInit:function(){},onTransaction:function(){},onUpdate:function(){},onFocus:function(){},onBlur:function(){},onPaste:function(){},onDrop:function(){}},t.events=["init","transaction","update","focus","blur","paste","drop"],t.init(n),t}return fr(e,t),ar(e,[{key:"init",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setOptions(ur({},this.defaultOptions,{},e)),this.focused=!1,this.selection={from:0,to:0},this.element=document.createElement("div"),this.extensions=this.createExtensions(),this.nodes=this.createNodes(),this.marks=this.createMarks(),this.schema=this.createSchema(),this.plugins=this.createPlugins(),this.keymaps=this.createKeymaps(),this.inputRules=this.createInputRules(),this.pasteRules=this.createPasteRules(),this.view=this.createView(),this.commands=this.createCommands(),this.setActiveNodesAndMarks(),this.options.injectCSS&&_r(Ir),null!==this.options.autoFocus&&this.focus(this.options.autoFocus),this.events.forEach((function(e){t.on(e,t.options[Cr("on ".concat(e))]||function(){})})),this.emit("init",{view:this.view,state:this.state}),this.extensions.view=this.view}},{key:"setOptions",value:function(t){this.options=ur({},this.options,{},t),this.view&&this.state&&this.view.updateState(this.state)}},{key:"createExtensions",value:function(){return new Ar([].concat(gr(this.builtInExtensions),gr(this.options.extensions)),this)}},{key:"createPlugins",value:function(){return this.extensions.plugins}},{key:"createKeymaps",value:function(){return this.extensions.keymaps({schema:this.schema})}},{key:"createInputRules",value:function(){return this.extensions.inputRules({schema:this.schema,excludedExtensions:this.options.disableInputRules})}},{key:"createPasteRules",value:function(){return this.extensions.pasteRules({schema:this.schema,excludedExtensions:this.options.disablePasteRules})}},{key:"createCommands",value:function(){return this.extensions.commands({schema:this.schema,view:this.view})}},{key:"createNodes",value:function(){return this.extensions.nodes}},{key:"createMarks",value:function(){return this.extensions.marks}},{key:"createSchema",value:function(){return new o["Schema"]({topNode:this.options.topNode,nodes:this.nodes,marks:this.marks})}},{key:"createState",value:function(){var t=this;return r["EditorState"].create({schema:this.schema,doc:this.createDocument(this.options.content),plugins:[].concat(gr(this.plugins),[Object(tr["b"])({rules:this.inputRules})],gr(this.pasteRules),gr(this.keymaps),[Object(Ln["b"])({Backspace:tr["c"]}),Object(Ln["b"])(Zn["a"]),Vn(this.options.dropCursor),Un(),new r["Plugin"]({key:new r["PluginKey"]("editable"),props:{editable:function(){return t.options.editable}}}),new r["Plugin"]({props:{attributes:{tabindex:0},handleDOMEvents:{focus:function(e,n){t.focused=!0,t.emit("focus",{event:n,state:e.state,view:e});var r=t.state.tr.setMeta("focused",!0);t.view.dispatch(r)},blur:function(e,n){t.focused=!1,t.emit("blur",{event:n,state:e.state,view:e});var r=t.state.tr.setMeta("focused",!1);t.view.dispatch(r)}}}}),new r["Plugin"]({props:this.options.editorProps})])})}},{key:"createDocument",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.parseOptions;if(null===t)return this.schema.nodeFromJSON(this.options.emptyDocument);if("object"===or(t))try{return this.schema.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),this.schema.nodeFromJSON(this.options.emptyDocument)}if("string"===typeof t){var n=document.createElement("div");return n.innerHTML=t.trim(),o["DOMParser"].fromSchema(this.schema).parse(n,e)}return!1}},{key:"createView",value:function(){var t=this;return new Dn(this.element,{state:this.createState(),handlePaste:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.emit.apply(t,["paste"].concat(n))},handleDrop:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.emit.apply(t,["drop"].concat(n))},dispatchTransaction:this.dispatchTransaction.bind(this)})}},{key:"setParentComponent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t&&this.view.setProps({nodeViews:this.initNodeViews({parent:t,extensions:[].concat(gr(this.builtInExtensions),gr(this.options.extensions))})})}},{key:"initNodeViews",value:function(t){var e=this,n=t.parent,r=t.extensions;return r.filter((function(t){return["node","mark"].includes(t.type)})).filter((function(t){return t.view})).reduce((function(t,r){var o=function(t,o,i,s){var a=r.view;return new Or(a,{editor:e,extension:r,parent:n,node:t,view:o,getPos:i,decorations:s})};return ur({},t,cr({},r.name,o))}),{})}},{key:"dispatchTransaction",value:function(t){var e=this.state.apply(t);this.view.updateState(e),this.selection={from:this.state.selection.from,to:this.state.selection.to},this.setActiveNodesAndMarks(),this.emit("transaction",{getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:t}),t.docChanged&&!t.getMeta("preventUpdate")&&this.emitUpdate(t)}},{key:"emitUpdate",value:function(t){this.emit("update",{getHTML:this.getHTML.bind(this),getJSON:this.getJSON.bind(this),state:this.state,transaction:t})}},{key:"resolveSelection",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.selection&&null===t)return this.selection;if("start"===t||!0===t)return{from:0,to:0};if("end"===t){var e=this.state.doc;return{from:e.content.size,to:e.content.size}}return{from:t,to:t}}},{key:"focus",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!(this.view.focused&&null===e||!1===e)){var n=this.resolveSelection(e),r=n.from,o=n.to;this.setSelection(r,o),setTimeout((function(){return t.view.focus()}),10)}}},{key:"setSelection",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.state,o=n.doc,i=n.tr,s=Dr(t,0,o.content.size),a=Dr(e,0,o.content.size),c=r["TextSelection"].create(o,s,a),l=i.setSelection(c);this.view.dispatch(l)}},{key:"blur",value:function(){this.view.dom.blur()}},{key:"getSchemaJSON",value:function(){return JSON.parse(JSON.stringify({nodes:this.extensions.nodes,marks:this.extensions.marks}))}},{key:"getHTML",value:function(){var t=document.createElement("div"),e=o["DOMSerializer"].fromSchema(this.schema).serializeFragment(this.state.doc.content);return t.appendChild(e),t.innerHTML}},{key:"getJSON",value:function(){return this.state.doc.toJSON()}},{key:"setContent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,o=this.state,i=o.doc,s=o.tr,a=this.createDocument(t,n),c=r["TextSelection"].create(i,0,i.content.size),l=s.setSelection(c).replaceSelectionWith(a,!1).setMeta("preventUpdate",!e);this.view.dispatch(l)}},{key:"clearContent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.setContent(this.options.emptyDocument,t)}},{key:"setActiveNodesAndMarks",value:function(){var t=this;this.activeMarks=Object.entries(this.schema.marks).reduce((function(e,n){var r=mr(n,2),o=r[0],i=r[1];return ur({},e,cr({},o,(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(er["c"])(t.state,i,e)})))}),{}),this.activeMarkAttrs=Object.entries(this.schema.marks).reduce((function(e,n){var r=mr(n,2),o=r[0],i=r[1];return ur({},e,cr({},o,Object(er["a"])(t.state,i)))}),{}),this.activeNodes=Object.entries(this.schema.nodes).reduce((function(e,n){var r=mr(n,2),o=r[0],i=r[1];return ur({},e,cr({},o,(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(er["d"])(t.state,i,e)})))}),{})}},{key:"getMarkAttrs",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.activeMarkAttrs[t]}},{key:"registerPlugin",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(t){var e=this.state.reconfigure({plugins:this.state.plugins.concat([t])});this.view.updateState(e)}}},{key:"unregisterPlugin",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(t&&this.view.docView){var e=this.state.reconfigure({plugins:this.state.plugins.filter((function(e){return!e.key.startsWith("".concat(t,"$"))}))});this.view.updateState(e)}}},{key:"destroy",value:function(){this.view&&this.view.destroy()}},{key:"builtInExtensions",get:function(){return this.options.useBuiltInExtensions?[new Pr,new $r,new Rr]:[]}},{key:"state",get:function(){return this.view?this.view.state:null}},{key:"isActive",get:function(){return Object.entries(ur({},this.activeMarks,{},this.activeNodes)).reduce((function(t,e){var n=mr(e,2),r=n[0],o=n[1];return ur({},t,cr({},r,(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(t)})))}),{})}}]),e}(Mr),zr={props:{editor:{default:null,type:Object}},watch:{editor:{immediate:!0,handler:function(t){var e=this;t&&t.element&&this.$nextTick((function(){e.$el.appendChild(t.element.firstChild),t.setParentComponent(e)}))}}},render:function(t){return t("div")},beforeDestroy:function(){this.editor.element=this.$el}},Fr=function(){function t(e){var n=this,r=e.options;ir(this,t),this.options=r,this.preventHide=!1,this.mousedownHandler=this.handleClick.bind(this),this.options.element.addEventListener("mousedown",this.mousedownHandler),this.options.editor.on("blur",(function(){n.preventHide?n.preventHide=!1:n.options.editor.emit("menubar:focusUpdate",!1)}))}return ar(t,[{key:"handleClick",value:function(){this.preventHide=!0}},{key:"destroy",value:function(){this.options.element.removeEventListener("mousedown",this.mousedownHandler)}}]),t}();function Vr(t){return new r["Plugin"]({key:new r["PluginKey"]("menu_bar"),view:function(e){return new Fr({editorView:e,options:t})}})}var Br={props:{editor:{default:null,type:Object}},data:function(){return{focused:!1}},watch:{editor:{immediate:!0,handler:function(t){var e=this;t&&this.$nextTick((function(){t.registerPlugin(Vr({editor:t,element:e.$el})),e.focused=t.focused,t.on("focus",(function(){e.focused=!0})),t.on("menubar:focusUpdate",(function(t){e.focused=t}))}))}}},render:function(){return this.editor?this.$scopedSlots.default({focused:this.focused,focus:this.editor.focus,commands:this.editor.commands,isActive:this.editor.isActive,getMarkAttrs:this.editor.getMarkAttrs.bind(this.editor)}):null}};function Lr(t,e,n){var r=document.createRange();return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r}function Wr(t,e){var n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}function qr(t,e){var n,r,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=t.docView.domFromPos(e),s=i.node,a=i.offset;if(3===s.nodeType)o&&a<s.nodeValue.length?(r=Wr(Lr(s,a-1,a),-1),n="right"):a<s.nodeValue.length&&(r=Wr(Lr(s,a,a+1),-1),n="left");else if(s.firstChild){if(a<s.childNodes.length){var c=s.childNodes[a];r=Wr(3===c.nodeType?Lr(c):c,-1),n="left"}if((!r||r.top===r.bottom)&&a){var l=s.childNodes[a-1];r=Wr(3===l.nodeType?Lr(l):l,1),n="right"}}else r=s.getBoundingClientRect(),n="left";var u=r[n];return{top:r.top,bottom:r.bottom,left:u,right:u}}var Kr=function(){function t(e){var n=this,r=e.options,o=e.editorView;ir(this,t),this.options=ur({},{element:null,keepInBounds:!0,onUpdate:function(){return!1}},{},r),this.editorView=o,this.isActive=!1,this.left=0,this.bottom=0,this.top=0,this.preventHide=!1,this.mousedownHandler=this.handleClick.bind(this),this.options.element.addEventListener("mousedown",this.mousedownHandler),this.options.editor.on("focus",(function(t){var e=t.view;n.update(e)})),this.options.editor.on("blur",(function(t){var e=t.event;n.preventHide?n.preventHide=!1:n.hide(e)}))}return ar(t,[{key:"handleClick",value:function(){this.preventHide=!0}},{key:"update",value:function(t,e){var n=t.state;if(!t.composing&&!(e&&e.doc.eq(n.doc)&&e.selection.eq(n.selection)))if(n.selection.empty)this.hide();else{var r=n.selection,o=r.from,i=r.to,s=qr(t,o),a=qr(t,i,!0),c=this.options.element.offsetParent;if(c){var l=c.getBoundingClientRect(),u=this.options.element.getBoundingClientRect(),f=(s.left+a.left)/2-l.left;this.left=Math.round(this.options.keepInBounds?Math.min(l.width-u.width/2,Math.max(f,u.width/2)):f),this.bottom=Math.round(l.bottom-s.top),this.top=Math.round(a.bottom-l.top),this.isActive=!0,this.sendUpdate()}else this.hide()}}},{key:"sendUpdate",value:function(){this.options.onUpdate({isActive:this.isActive,left:this.left,bottom:this.bottom,top:this.top})}},{key:"hide",value:function(t){t&&t.relatedTarget&&this.options.element.parentNode.contains(t.relatedTarget)||(this.isActive=!1,this.sendUpdate())}},{key:"destroy",value:function(){this.options.element.removeEventListener("mousedown",this.mousedownHandler)}}]),t}();function Hr(t){return new r["Plugin"]({key:new r["PluginKey"]("menu_bubble"),view:function(e){return new Kr({editorView:e,options:t})}})}Boolean},cdf9:function(t,e,n){var r=n("825a"),o=n("861d"),i=n("f069");t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t),s=n.resolve;return s(e),n.promise}},ce4e:function(t,e,n){var r=n("da84"),o=n("9112");t.exports=function(t,e){try{o(r,t,e)}catch(n){r[t]=e}return e}},d012:function(t,e){t.exports={}},d039:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},d066:function(t,e,n){var r=n("428f"),o=n("da84"),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t])||i(o[t]):r[t]&&r[t][e]||o[t]&&o[t][e]}},d1e7:function(t,e,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:r},d28b:function(t,e,n){var r=n("746f");r("iterator")},d2bb:function(t,e,n){var r=n("825a"),o=n("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(n,[]),e=n instanceof Array}catch(i){}return function(n,i){return r(n),o(i),e?t.call(n,i):n.__proto__=i,n}}():void 0)},d3b7:function(t,e,n){var r=n("00ee"),o=n("6eeb"),i=n("b041");r||o(Object.prototype,"toString",i,{unsafe:!0})},d44e:function(t,e,n){var r=n("9bf2").f,o=n("5135"),i=n("b622"),s=i("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,s)&&r(t,s,{configurable:!0,value:e})}},d4ec:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",(function(){return r}))},d784:function(t,e,n){"use strict";var r=n("9112"),o=n("6eeb"),i=n("d039"),s=n("b622"),a=n("9263"),c=s("species"),l=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),u=!i((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));t.exports=function(t,e,n,f){var p=s(t),d=!i((function(){var e={};return e[p]=function(){return 7},7!=""[t](e)})),h=d&&!i((function(){var e=!1,n=/a/;return"split"===t&&(n={},n.constructor={},n.constructor[c]=function(){return n},n.flags="",n[p]=/./[p]),n.exec=function(){return e=!0,null},n[p](""),!e}));if(!d||!h||"replace"===t&&!l||"split"===t&&!u){var v=/./[p],m=n(p,""[t],(function(t,e,n,r,o){return e.exec===a?d&&!o?{done:!0,value:v.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),g=m[0],y=m[1];o(String.prototype,t,g),o(RegExp.prototype,p,2==e?function(t,e){return y.call(t,this,e)}:function(t){return y.call(t,this)}),f&&r(RegExp.prototype[p],"sham",!0)}}},d81d:function(t,e,n){"use strict";var r=n("23e7"),o=n("b727").map,i=n("d039"),s=n("1dde"),a=s("map"),c=a&&!i((function(){[].map.call({length:-1,0:1},(function(t){throw t}))}));r({target:"Array",proto:!0,forced:!a||!c},{map:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},da84:function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")()}).call(this,n("c8ba"))},dbb4:function(t,e,n){var r=n("23e7"),o=n("83ab"),i=n("56ef"),s=n("fc6a"),a=n("06cf"),c=n("8418");r({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function(t){var e,n,r=s(t),o=a.f,l=i(r),u={},f=0;while(l.length>f)n=o(r,e=l[f++]),void 0!==n&&c(u,e,n);return u}})},ddb0:function(t,e,n){var r=n("da84"),o=n("fdbc"),i=n("e260"),s=n("9112"),a=n("b622"),c=a("iterator"),l=a("toStringTag"),u=i.values;for(var f in o){var p=r[f],d=p&&p.prototype;if(d){if(d[c]!==u)try{s(d,c,u)}catch(v){d[c]=u}if(d[l]||s(d,l,f),o[f])for(var h in i)if(d[h]!==i[h])try{s(d,h,i[h])}catch(v){d[h]=i[h]}}}},df75:function(t,e,n){var r=n("ca84"),o=n("7839");t.exports=Object.keys||function(t){return r(t,o)}},e01a:function(t,e,n){"use strict";var r=n("23e7"),o=n("83ab"),i=n("da84"),s=n("5135"),a=n("861d"),c=n("9bf2").f,l=n("e893"),u=i.Symbol;if(o&&"function"==typeof u&&(!("description"in u.prototype)||void 0!==u().description)){var f={},p=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof p?new u(t):void 0===t?u():u(t);return""===t&&(f[e]=!0),e};l(p,u);var d=p.prototype=u.prototype;d.constructor=p;var h=d.toString,v="Symbol(test)"==String(u("test")),m=/^Symbol\((.*)\)[^)]+$/;c(d,"description",{configurable:!0,get:function(){var t=a(this)?this.valueOf():this,e=h.call(t);if(s(f,t))return"";var n=v?e.slice(7,-1):e.replace(m,"$1");return""===n?void 0:n}}),r({global:!0,forced:!0},{Symbol:p})}},e163:function(t,e,n){var r=n("5135"),o=n("7b0b"),i=n("f772"),s=n("e177"),a=i("IE_PROTO"),c=Object.prototype;t.exports=s?Object.getPrototypeOf:function(t){return t=o(t),r(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?c:null}},e177:function(t,e,n){var r=n("d039");t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},e260:function(t,e,n){"use strict";var r=n("fc6a"),o=n("44d2"),i=n("3f8c"),s=n("69f3"),a=n("7dd0"),c="Array Iterator",l=s.set,u=s.getterFor(c);t.exports=a(Array,"Array",(function(t,e){l(this,{type:c,target:r(t),index:0,kind:e})}),(function(){var t=u(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},e2cc:function(t,e,n){var r=n("6eeb");t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},e439:function(t,e,n){var r=n("23e7"),o=n("d039"),i=n("fc6a"),s=n("06cf").f,a=n("83ab"),c=o((function(){s(1)})),l=!a||c;r({target:"Object",stat:!0,forced:l,sham:!a},{getOwnPropertyDescriptor:function(t,e){return s(i(t),e)}})},e583:function(t,e,n){var r=n("da84"),o=n("58a8").trim,i=n("5899"),s=r.parseInt,a=/^[+-]?0[Xx]/,c=8!==s(i+"08")||22!==s(i+"0x16");t.exports=c?function(t,e){var n=o(String(t));return s(n,e>>>0||(a.test(n)?16:10))}:s},e667:function(t,e){t.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},e6cf:function(t,e,n){"use strict";var r,o,i,s,a=n("23e7"),c=n("c430"),l=n("da84"),u=n("d066"),f=n("fea9"),p=n("6eeb"),d=n("e2cc"),h=n("d44e"),v=n("2626"),m=n("861d"),g=n("1c0b"),y=n("19aa"),b=n("c6b6"),w=n("8925"),S=n("2266"),x=n("1c7e"),k=n("4840"),C=n("2cf4").set,O=n("b575"),M=n("cdf9"),N=n("44de"),A=n("f069"),_=n("e667"),T=n("69f3"),D=n("94ca"),E=n("b622"),P=n("60ae"),R=E("species"),$="Promise",I=T.get,j=T.set,z=T.getterFor($),F=f,V=l.TypeError,B=l.document,L=l.process,W=u("fetch"),q=A.f,K=q,H="process"==b(L),J=!!(B&&B.createEvent&&l.dispatchEvent),U="unhandledrejection",G="rejectionhandled",X=0,Y=1,Q=2,Z=1,tt=2,et=D($,(function(){var t=w(F)!==String(F);if(!t){if(66===P)return!0;if(!H&&"function"!=typeof PromiseRejectionEvent)return!0}if(c&&!F.prototype["finally"])return!0;if(P>=51&&/native code/.test(F))return!1;var e=F.resolve(1),n=function(t){t((function(){}),(function(){}))},r=e.constructor={};return r[R]=n,!(e.then((function(){}))instanceof n)})),nt=et||!x((function(t){F.all(t)["catch"]((function(){}))})),rt=function(t){var e;return!(!m(t)||"function"!=typeof(e=t.then))&&e},ot=function(t,e,n){if(!e.notified){e.notified=!0;var r=e.reactions;O((function(){var o=e.value,i=e.state==Y,s=0;while(r.length>s){var a,c,l,u=r[s++],f=i?u.ok:u.fail,p=u.resolve,d=u.reject,h=u.domain;try{f?(i||(e.rejection===tt&&ct(t,e),e.rejection=Z),!0===f?a=o:(h&&h.enter(),a=f(o),h&&(h.exit(),l=!0)),a===u.promise?d(V("Promise-chain cycle")):(c=rt(a))?c.call(a,p,d):p(a)):d(o)}catch(v){h&&!l&&h.exit(),d(v)}}e.reactions=[],e.notified=!1,n&&!e.rejection&&st(t,e)}))}},it=function(t,e,n){var r,o;J?(r=B.createEvent("Event"),r.promise=e,r.reason=n,r.initEvent(t,!1,!0),l.dispatchEvent(r)):r={promise:e,reason:n},(o=l["on"+t])?o(r):t===U&&N("Unhandled promise rejection",n)},st=function(t,e){C.call(l,(function(){var n,r=e.value,o=at(e);if(o&&(n=_((function(){H?L.emit("unhandledRejection",r,t):it(U,t,r)})),e.rejection=H||at(e)?tt:Z,n.error))throw n.value}))},at=function(t){return t.rejection!==Z&&!t.parent},ct=function(t,e){C.call(l,(function(){H?L.emit("rejectionHandled",t):it(G,t,e.value)}))},lt=function(t,e,n,r){return function(o){t(e,n,o,r)}},ut=function(t,e,n,r){e.done||(e.done=!0,r&&(e=r),e.value=n,e.state=Q,ot(t,e,!0))},ft=function(t,e,n,r){if(!e.done){e.done=!0,r&&(e=r);try{if(t===n)throw V("Promise can't be resolved itself");var o=rt(n);o?O((function(){var r={done:!1};try{o.call(n,lt(ft,t,r,e),lt(ut,t,r,e))}catch(i){ut(t,r,i,e)}})):(e.value=n,e.state=Y,ot(t,e,!1))}catch(i){ut(t,{done:!1},i,e)}}};et&&(F=function(t){y(this,F,$),g(t),r.call(this);var e=I(this);try{t(lt(ft,this,e),lt(ut,this,e))}catch(n){ut(this,e,n)}},r=function(t){j(this,{type:$,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:X,value:void 0})},r.prototype=d(F.prototype,{then:function(t,e){var n=z(this),r=q(k(this,F));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=H?L.domain:void 0,n.parent=!0,n.reactions.push(r),n.state!=X&&ot(this,n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r,e=I(t);this.promise=t,this.resolve=lt(ft,t,e),this.reject=lt(ut,t,e)},A.f=q=function(t){return t===F||t===i?new o(t):K(t)},c||"function"!=typeof f||(s=f.prototype.then,p(f.prototype,"then",(function(t,e){var n=this;return new F((function(t,e){s.call(n,t,e)})).then(t,e)}),{unsafe:!0}),"function"==typeof W&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return M(F,W.apply(l,arguments))}}))),a({global:!0,wrap:!0,forced:et},{Promise:F}),h(F,$,!1,!0),v($),i=u($),a({target:$,stat:!0,forced:et},{reject:function(t){var e=q(this);return e.reject.call(void 0,t),e.promise}}),a({target:$,stat:!0,forced:c||et},{resolve:function(t){return M(c&&this===i?F:this,t)}}),a({target:$,stat:!0,forced:nt},{all:function(t){var e=this,n=q(e),r=n.resolve,o=n.reject,i=_((function(){var n=g(e.resolve),i=[],s=0,a=1;S(t,(function(t){var c=s++,l=!1;i.push(void 0),a++,n.call(e,t).then((function(t){l||(l=!0,i[c]=t,--a||r(i))}),o)})),--a||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=q(e),r=n.reject,o=_((function(){var o=g(e.resolve);S(t,(function(t){o.call(e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}})},e893:function(t,e,n){var r=n("5135"),o=n("56ef"),i=n("06cf"),s=n("9bf2");t.exports=function(t,e){for(var n=o(e),a=s.f,c=i.f,l=0;l<n.length;l++){var u=n[l];r(t,u)||a(t,u,c(e,u))}}},e8b5:function(t,e,n){var r=n("c6b6");t.exports=Array.isArray||function(t){return"Array"==r(t)}},e95a:function(t,e,n){var r=n("b622"),o=n("3f8c"),i=r("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||s[i]===t)}},f069:function(t,e,n){"use strict";var r=n("1c0b"),o=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new o(t)}},f183:function(t,e,n){var r=n("d012"),o=n("861d"),i=n("5135"),s=n("9bf2").f,a=n("90e3"),c=n("bb2f"),l=a("meta"),u=0,f=Object.isExtensible||function(){return!0},p=function(t){s(t,l,{value:{objectID:"O"+ ++u,weakData:{}}})},d=function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,l)){if(!f(t))return"F";if(!e)return"E";p(t)}return t[l].objectID},h=function(t,e){if(!i(t,l)){if(!f(t))return!0;if(!e)return!1;p(t)}return t[l].weakData},v=function(t){return c&&m.REQUIRED&&f(t)&&!i(t,l)&&p(t),t},m=t.exports={REQUIRED:!1,fastKey:d,getWeakData:h,onFreeze:v};r[l]=!0},f5df:function(t,e,n){var r=n("00ee"),o=n("c6b6"),i=n("b622"),s=i("toStringTag"),a="Arguments"==o(function(){return arguments}()),c=function(t,e){try{return t[e]}catch(n){}};t.exports=r?o:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=c(e=Object(t),s))?n:a?o(e):"Object"==(r=o(e))&&"function"==typeof e.callee?"Arguments":r}},f772:function(t,e,n){var r=n("5692"),o=n("90e3"),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},f8c2:function(t,e,n){var r=n("1c0b");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},f95e:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return l}));var r=n("5313"),o=(n("0ac0"),function(t,e){this.match=t,this.handler="string"==typeof e?i(e):e});function i(t){return function(e,n,r,o){var i=t;if(n[1]){var s=n[0].lastIndexOf(n[1]);i+=n[0].slice(s+n[1].length),r+=s;var a=r-o;a>0&&(i=n[0].slice(s-a,s)+i,r=o)}return e.tr.insertText(i,r,o)}}var s=500;function a(t){var e=t.rules,n=new r["Plugin"]({state:{init:function(){return null},apply:function(t,e){var n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:function(t,r,o,i){return c(t,r,o,i,e,n)},handleDOMEvents:{compositionend:function(t){setTimeout((function(){var r=t.state.selection,o=r.$cursor;o&&c(t,o.pos,o.pos,"",e,n)}))}}},isInputRules:!0});return n}function c(t,e,n,r,o,i){if(t.composing)return!1;var a=t.state,c=a.doc.resolve(e);if(c.parent.type.spec.code)return!1;for(var l=c.parent.textBetween(Math.max(0,c.parentOffset-s),c.parentOffset,null,"")+r,u=0;u<o.length;u++){var f=o[u].match.exec(l),p=f&&o[u].handler(a,f,e-(f[0].length-r.length),n);if(p)return t.dispatch(p.setMeta(i,{transform:p,from:e,to:n,text:r})),!0}return!1}function l(t,e){for(var n=t.plugins,r=0;r<n.length;r++){var o=n[r],i=void 0;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){for(var s=t.tr,a=i.transform,c=a.steps.length-1;c>=0;c--)s.step(a.steps[c].invert(a.docs[c]));var l=s.doc.resolve(i.from).marks();e(s.replaceWith(i.from,i.to,t.schema.text(i.text,l)))}return!0}}return!1}new o(/--$/,"—"),new o(/\.\.\.$/,"…"),new o(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new o(/"$/,"”"),new o(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new o(/'$/,"’")},fb6a:function(t,e,n){"use strict";var r=n("23e7"),o=n("861d"),i=n("e8b5"),s=n("23cb"),a=n("50c4"),c=n("fc6a"),l=n("8418"),u=n("1dde"),f=n("b622"),p=f("species"),d=[].slice,h=Math.max;r({target:"Array",proto:!0,forced:!u("slice")},{slice:function(t,e){var n,r,u,f=c(this),v=a(f.length),m=s(t,v),g=s(void 0===e?v:e,v);if(i(f)&&(n=f.constructor,"function"!=typeof n||n!==Array&&!i(n.prototype)?o(n)&&(n=n[p],null===n&&(n=void 0)):n=void 0,n===Array||void 0===n))return d.call(f,m,g);for(r=new(void 0===n?Array:n)(h(g-m,0)),u=0;m<g;m++,u++)m in f&&l(r,u,f[m]);return r.length=u,r}})},fc6a:function(t,e,n){var r=n("44ad"),o=n("1d80");t.exports=function(t){return r(o(t))}},fdbc:function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},fdbf:function(t,e,n){var r=n("4930");t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol()},fea9:function(t,e,n){var r=n("da84");t.exports=r.Promise}}]); //# sourceMappingURL=chunk-vendors.js.map -(function(t){function e(e){for(var a,s,o=e[0],c=e[1],u=e[2],d=0,f=[];d<o.length;d++)s=o[d],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&f.push(r[s][0]),r[s]=0;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(t[a]=c[a]);l&&l(e);while(f.length)f.shift()();return i.push.apply(i,u||[]),n()}function n(){for(var t,e=0;e<i.length;e++){for(var n=i[e],a=!0,o=1;o<n.length;o++){var c=n[o];0!==r[c]&&(a=!1)}a&&(i.splice(e--,1),t=s(s.s=n[0]))}return t}var a={},r={app:0},i=[];function s(e){if(a[e])return a[e].exports;var n=a[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=t,s.c=a,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},s.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)s.d(n,a,function(e){return t[e]}.bind(null,a));return n},s.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="/";var o=window["webpackJsonp"]=window["webpackJsonp"]||[],c=o.push.bind(o);o.push=e,o=o.slice();for(var u=0;u<o.length;u++)e(o[u]);var l=c;i.push([0,"chunk-vendors"]),n()})({0:function(t,e,n){t.exports=n("cd49")},"37ba":function(t,e,n){},"6d73":function(t,e,n){"use strict";var a=n("37ba"),r=n.n(a);e["default"]=r.a},ba8f:function(t,e,n){},cd49:function(t,e,n){"use strict";n.r(e);n("e260"),n("e6cf"),n("cca6"),n("a79d");var a=n("2b0e"),r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("tei-editor")],1)},i=[],s=n("d4ec"),o=n("bee2"),c=n("99de"),u=n("7e84"),l=n("262e"),d=n("9ab4"),f=n("60a3"),h=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"tei-editor"}},[n("nav",[n("aria-menubar",{scopedSlots:t._u([{key:"default",fn:function(e){var a=e.keyboardNav,r=e.mouseClickNav;return[n("ul",{attrs:{role:"menubar"}},[t.hasSaveCallback||t.hasLoadCallback?n("li",{attrs:{role:"presentation"}},[n("a",{attrs:{role:"menuitem",tabindex:"0","aria-expanded":"false"},on:{keyup:a,click:r}},[t._v("File")]),n("aria-menu",{scopedSlots:t._u([{key:"default",fn:function(e){var a=e.keyboardNav,r=e.mouseClickNav;return[n("ul",{attrs:{role:"menu","aria-hidden":"true"}},[t.hasLoadCallback?n("li",{attrs:{role:"presentation"}},[n("a",{attrs:{role:"menuitem",tabindex:"-1"},on:{click:function(e){r(e),t.load()},keyup:a}},[t._v("Load")])]):t._e(),t.hasSaveCallback?n("li",{attrs:{role:"presentation"}},[n("a",{attrs:{role:"menuitem",tabindex:"-1"},on:{click:function(e){r(e),t.save()},keyup:a}},[t._v("Save")])]):t._e()])]}}],null,!0)})],1):t._e(),t._l(t.sections,(function(e,i,s){return n("li",{key:s,attrs:{role:"presentation"}},[n("a",{attrs:{role:"menuitem",tabindex:"-1","aria-checked":i===t.currentSection?"true":"false"},on:{click:function(e){r(e),t.setCurrentSection(i)},keyup:a}},[t._v(t._s(e.label))])])}))],2)]}}])})],1),n("div",[t._l(t.sections,(function(e,a,r){return[a===t.currentSection?["MetadataEditor"===e.type?n("metadata-editor",{key:r,attrs:{config:e}}):t._e(),"TextEditor"===e.type?n("text-editor",{key:r,attrs:{section:a}}):t._e()]:t._e()]}))],2)])},p=[],v=(n("b64b"),n("a4d3"),n("e01a"),n("d28b"),n("d3b7"),n("3ca3"),n("ddb0"),function(t){function e(){return Object(s["a"])(this,e),Object(c["a"])(this,Object(u["a"])(e).apply(this,arguments))}return Object(l["a"])(e,t),Object(o["a"])(e,[{key:"render",value:function(){if(this.$scopedSlots.default)return this.$scopedSlots.default({keyboardNav:this.keyboardNavigation,mouseClickNav:this.mouseClickNavigation})}},{key:"keyboardNavigation",value:function(t){var e=t.target;if(e)if(39===t.keyCode){var n=this.findNextMenuitem(this.getParentMenubar(e),e,"next");n&&n.focus()}else if(37===t.keyCode){var a=this.findNextMenuitem(this.getParentMenubar(e),e,"previous");a&&a.focus()}else if(38===t.keyCode||40===t.keyCode){var r=!0,i=!1,s=void 0;try{for(var o,c=e.parentElement.children[Symbol.iterator]();!(r=(o=c.next()).done);r=!0){var u=o.value;if("menu"===u.getAttribute("role")){u.setAttribute("aria-hidden","false"),e.setAttribute("aria-expanded","true");var l=this.findNextMenuitem(u,null,"next");l&&l.focus()}}}catch(m){i=!0,s=m}finally{try{r||null==c.return||c.return()}finally{if(i)throw s}}}else if(13===t.keyCode||32==t.keyCode){var d=!0,f=!1,h=void 0;try{for(var p,v=e.parentElement.children[Symbol.iterator]();!(d=(p=v.next()).done);d=!0){var b=p.value;if("menu"===b.getAttribute("role"))if("false"===b.getAttribute("aria-hidden"))b.setAttribute("aria-hidden","true"),e.setAttribute("aria-expanded","false");else{b.setAttribute("aria-hidden","false"),e.setAttribute("aria-expanded","true");var g=this.findNextMenuitem(b,null,"next");if(g)return void g.focus()}}}catch(m){f=!0,h=m}finally{try{d||null==v.return||v.return()}finally{if(f)throw h}}e.click()}}},{key:"mouseClickNavigation",value:function(t){var e=t.target;if(e){var n=!0,a=!1,r=void 0;try{for(var i,s=e.parentElement.children[Symbol.iterator]();!(n=(i=s.next()).done);n=!0){var o=i.value;if("menu"===o.getAttribute("role"))if("false"===o.getAttribute("aria-hidden"))o.setAttribute("aria-hidden","true"),e.setAttribute("aria-expanded","false");else{o.setAttribute("aria-hidden","false"),e.setAttribute("aria-expanded","true");var c=this.findNextMenuitem(o,null,"next");if(c)return void c.focus()}}}catch(u){a=!0,r=u}finally{try{n||null==s.return||s.return()}finally{if(a)throw r}}}}},{key:"getParentMenubar",value:function(t){return t?"menubar"===t.getAttribute("role")?t:this.getParentMenubar(t.parentElement):null}},{key:"findNextMenuitem",value:function(t,e,n){if(!t)return null;var a=[];if("next"===n)for(var r=t.children.length-1;r>=0;r--)a.push(t.children[r]);else for(var i=0;i<t.children.length;i++)a.push(t.children[i]);var s=0;e||(s=1);while(a.length>0){var o=a.pop();if(0===s&&o===e)s=1;else if(1===s&&"menuitem"===o.getAttribute("role")&&"true"!==o.getAttribute("aria-disabled"))return o;if("menu"!==o.getAttribute("role"))if("next"===n)for(var c=o.children.length-1;c>=0;c--)a.push(o.children[c]);else for(var u=0;u<o.children.length;u++)a.push(o.children[u])}return null}}]),e}(f["c"]));v=d["a"]([Object(f["a"])({})],v);var b,g,m=v,y=m,k=n("6d73"),O=n("2877");function x(t){this["$style"]=k["default"].locals||k["default"]}var j=Object(O["a"])(y,b,g,!1,x,null,null),_=j.exports,A=function(t){function e(){return Object(s["a"])(this,e),Object(c["a"])(this,Object(u["a"])(e).apply(this,arguments))}return Object(l["a"])(e,t),Object(o["a"])(e,[{key:"render",value:function(){if(this.$scopedSlots.default)return this.$scopedSlots.default({keyboardNav:this.keyboardNavigation,mouseClickNav:this.mouseClickNavigation})}},{key:"keyboardNavigation",value:function(t){var e=t.target;if(e)if(39===t.keyCode);else if(37===t.keyCode);else if(38===t.keyCode){var n=this.findNextMenuitem(this.getParentMenu(e),e,"previous");n&&n.focus()}else if(40===t.keyCode){var a=this.findNextMenuitem(this.getParentMenu(e),e,"next");a&&a.focus()}else if(13===t.keyCode||32==t.keyCode)if(e.getAttribute("aria-expanded")){var r=!0,i=!1,s=void 0;try{for(var o,c=e.parentElement.children[Symbol.iterator]();!(r=(o=c.next()).done);r=!0){var u=o.value;if("menu"===u.getAttribute("role"))if("false"===u.getAttribute("aria-hidden"))u.setAttribute("aria-hidden","true"),e.setAttribute("aria-expanded","false");else{u.setAttribute("aria-hidden","false"),e.setAttribute("aria-expanded","true");var l=this.findNextMenuitem(u,null,"next");l&&l.focus()}}}catch(m){i=!0,s=m}finally{try{r||null==c.return||c.return()}finally{if(i)throw s}}}else e.click();else if(27===t.keyCode){var d=this.getParentMenu(e);if(d){d.setAttribute("aria-hidden","true");var f=!0,h=!1,p=void 0;try{for(var v,b=d.parentElement.children[Symbol.iterator]();!(f=(v=b.next()).done);f=!0){var g=v.value;"menuitem"===g.getAttribute("role")&&(g.setAttribute("aria-expanded","false"),g.focus())}}catch(m){h=!0,p=m}finally{try{f||null==b.return||b.return()}finally{if(h)throw p}}}}}},{key:"mouseClickNavigation",value:function(t){var e=t.target;if(e)if(e.getAttribute("aria-expanded")){var n=!0,a=!1,r=void 0;try{for(var i,s=e.parentElement.children[Symbol.iterator]();!(n=(i=s.next()).done);n=!0){var o=i.value;if("menu"===o.getAttribute("role"))if("false"===o.getAttribute("aria-hidden"))o.setAttribute("aria-hidden","true"),e.setAttribute("aria-expanded","false");else{o.setAttribute("aria-hidden","false"),e.setAttribute("aria-expanded","true");var c=this.findNextMenuitem(o,null,"next");c&&c.focus()}}}catch(b){a=!0,r=b}finally{try{n||null==s.return||s.return()}finally{if(a)throw r}}}else{var u=this.getParentMenu(e);if(u){u.setAttribute("aria-hidden","true");var l=!0,d=!1,f=void 0;try{for(var h,p=u.parentElement.children[Symbol.iterator]();!(l=(h=p.next()).done);l=!0){var v=h.value;"menuitem"===v.getAttribute("role")&&(v.setAttribute("aria-expanded","false"),v.focus())}}catch(b){d=!0,f=b}finally{try{l||null==p.return||p.return()}finally{if(d)throw f}}}}}},{key:"getParentMenu",value:function(t){return t?"menu"===t.getAttribute("role")?t:this.getParentMenu(t.parentElement):null}},{key:"getParentMenuOrMenubar",value:function(t){return t?"menu"===t.getAttribute("role")||"menubar"===t.getAttribute("role")?t:this.getParentMenuOrMenubar(t.parentElement):null}}]),e}(_);A=d["a"]([Object(f["a"])({})],A);var N,M,E=A,w=E,S=Object(O["a"])(w,N,M,!1,null,null,null),$=S.exports,C=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"metadata-editor"},t._l(t.config.ui,(function(e,a){return n("section",{key:a},[n("h2",[t._v(t._s(e.label))]),t._l(e.entries,(function(t,e){return n("div",{key:e},[n("metadata-field",{attrs:{config:t}})],1)}))],2)})),0)},T=[],V=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",["single-text"==t.config.type?[n("label",[n("span",{staticClass:"label-text"},[t._v(t._s(t.config.label))]),n("input",{attrs:{type:"text"},domProps:{value:t.value},on:{change:t.update}})])]:t._e(),"multi-row"==t.config.type?[n("ol",{staticClass:"multi-row"},t._l(t.value,(function(e,a){return n("li",{key:a},[t._l(t.config.entries,(function(e,r){return n("metadata-field",{key:r,attrs:{config:e,parent:t.parent+t.config.path+".["+a+"]"}})})),n("aria-menubar",{attrs:{items:t.modifyMenuItems(a)},on:{action:t.menuAction}}),n("aria-menubar",{scopedSlots:t._u([{key:"default",fn:function(e){var r=e.keyboardNav;return[n("ul",{attrs:{role:"menubar"}},[n("li",{attrs:{role:"presentation"}},[n("a",0===a?{attrs:{role:"menuitem","aria-disabled":!0}}:{attrs:{role:"menuitem",tabindex:1===t.value.length?null:0},on:{click:function(e){return t.menuAction("move-up:"+a)},keyup:r}},[n("svg",{attrs:{viewBox:"0 0 24 24","aria-label":"Move up"}},[n("path",{attrs:{d:"M19,3H5A2,2 0 0,0 3,5V19C3,20.11 3.9,21 5,21H19C20.11,21 21,20.11 21,19V5A2,2 0 0,0 19,3M16.59,15.71L12,11.12L7.41,15.71L6,14.29L12,8.29L18,14.29L16.59,15.71Z"}})])])]),n("li",{attrs:{role:"presentation"}},[a===t.value.length-1?n("a",{attrs:{role:"menuitem","aria-disabled":!0}},[n("svg",{attrs:{viewBox:"0 0 24 24","aria-label":"Move down"}},[n("path",{attrs:{d:"M19,3H5A2,2 0 0,0 3,5V19C3,20.11 3.9,21 5,21H19C20.11,21 21,20.11 21,19V5A2,2 0 0,0 19,3M12,15.71L6,9.71L7.41,8.29L12,12.88L16.59,8.29L18,9.71L12,15.71Z"}})])]):n("a",{attrs:{role:"menuitem",tabindex:1===t.value.length?null:0},on:{click:function(e){return t.menuAction("move-down:"+a)},keyup:r}},[n("svg",{attrs:{viewBox:"0 0 24 24","aria-label":"Move down"}},[n("path",{attrs:{d:"M19,3H5A2,2 0 0,0 3,5V19C3,20.11 3.9,21 5,21H19C20.11,21 21,20.11 21,19V5A2,2 0 0,0 19,3M12,15.71L6,9.71L7.41,8.29L12,12.88L16.59,8.29L18,9.71L12,15.71Z"}})])])]),n("li",{attrs:{role:"presentation"}},[n("a",{attrs:{role:"menuitem",tabindex:1===t.value.length?0:-1},on:{click:function(e){return t.menuAction("delete:"+a)},keyup:r}},[n("svg",{attrs:{viewBox:"0 0 24 24","aria-label":"Delete"}},[n("path",{attrs:{d:"M17,13H7V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z"}})])])])])]}}],null,!0)})],2)})),0),n("aria-menubar",{scopedSlots:t._u([{key:"default",fn:function(e){var a=e.keyboardNav;return[n("ul",{attrs:{role:"menubar"}},[n("li",{attrs:{role:"presentation"}},[n("a",{attrs:{role:"menuitem",tabindex:"0"},on:{click:function(e){return t.menuAction("add")},keyup:a}},[n("svg",{attrs:{viewBox:"0 0 24 24","aria-label":"Add"}},[n("path",{attrs:{d:"M17,13H13V17H11V13H7V11H11V7H13V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z"}})])])])])]}}],null,!1,3190783598)})]:t._e(),"multi-field"==t.config.type?[n("ol",{staticClass:"multi-field"},t._l(t.config.entries,(function(e,a){return n("li",{key:a},[n("metadata-field",{attrs:{config:e,parent:t.parent+t.config.path}})],1)})),0)]:t._e()],2)},P=[];n("c975"),n("a9e3"),n("25eb"),n("159b"),n("fb6a"),n("1276");function D(t,e){var n=e.split(".");while(t&&n.length>0){if("["===n[0][0]&&"]"===n[0][n[0].length-1]){var a=Number.parseInt(n[0].substring(1,n[0].length-1));a>=0&&a<t.length&&(t=t[a])}else t=t[n[0]];n=n.slice(1)}return t}var L=function(t){function e(){var t;return Object(s["a"])(this,e),t=Object(c["a"])(this,Object(u["a"])(e).apply(this,arguments)),t.addMenuItems=[{label:'<svg viewBox="0 0 24 24" aria-label="Add"><path d="M17,13H13V17H11V13H7V11H11V7H13V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z" /></svg>',action:"add"}],t}return Object(l["a"])(e,t),Object(o["a"])(e,[{key:"update",value:function(t){t&&t.target&&this.$store.commit("setMetadataValue",{path:this.$props.parent+this.$props.config.path,value:t.target.value})}},{key:"modifyMenuItems",value:function(t){return[{label:'<svg viewBox="0 0 24 24" aria-label="Move up"><path d="M19,3H5A2,2 0 0,0 3,5V19C3,20.11 3.9,21 5,21H19C20.11,21 21,20.11 21,19V5A2,2 0 0,0 19,3M16.59,15.71L12,11.12L7.41,15.71L6,14.29L12,8.29L18,14.29L16.59,15.71Z" /></svg>',action:"move-up:"+t,disabled:0===t},{label:'<svg viewBox="0 0 24 24" aria-label="Move down"><path d="M19,3H5A2,2 0 0,0 3,5V19C3,20.11 3.9,21 5,21H19C20.11,21 21,20.11 21,19V5A2,2 0 0,0 19,3M12,15.71L6,9.71L7.41,8.29L12,12.88L16.59,8.29L18,9.71L12,15.71Z" /></svg>',action:"move-down:"+t,disabled:t===this.value.length-1},{label:'<svg viewBox="0 0 24 24" aria-label="Delete"><path d="M17,13H7V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z" /></svg>',action:"delete:"+t}]}},{key:"menuAction",value:function(t){if("add"===t){var e={};this.$props.config.entries.forEach((function(t){var n=t.path;"."===n[0]&&(n=n.substring(1)),"single-text"===t.type?e[n]="":"multi-row"===t.type?e[n]=[]:"multi-field"===t.type&&t.entries.forEach((function(t){var n=t.path;"."===n[0]&&(n=n.substring(1)),"single-text"===t.type?e[n]="":"multi-row"===t.type&&(e[n]=[])}))})),this.$store.commit("addMetadataMuliRow",{path:this.$props.parent+this.$props.config.path,value:e})}else 0===t.indexOf("move-up:")?this.$store.commit("moveMetadataMultiRow",{path:this.$props.parent+this.$props.config.path,idx:Number.parseInt(t.substring(8)),move:-1}):0===t.indexOf("move-down:")?this.$store.commit("moveMetadataMultiRow",{path:this.$props.parent+this.$props.config.path,idx:Number.parseInt(t.substring(10)),move:1}):0===t.indexOf("delete:")&&this.$store.commit("removeMetadataMultiRow",{path:this.$props.parent+this.$props.config.path,value:Number.parseInt(t.substring(7))})}},{key:"value",get:function(){var t=D(this.$store.state.content[this.$store.state.settings.metadataSection],this.$props.parent+this.$props.config.path);return t||""}}]),e}(f["c"]);L=d["a"]([Object(f["a"])({components:{AriaMenubar:_},props:{config:Object,parent:{type:String,default:""}},name:"metadata-field"})],L);var H=L,I=H,R=Object(O["a"])(I,V,P,!1,null,null,null),B=R.exports,U=function(t){function e(){return Object(s["a"])(this,e),Object(c["a"])(this,Object(u["a"])(e).apply(this,arguments))}return Object(l["a"])(e,t),e}(f["c"]);U=d["a"]([Object(f["a"])({components:{MetadataField:B},props:{config:Object}})],U);var Z=U,F=Z,X=Object(O["a"])(F,C,T,!1,null,null,null),Y=X.exports,J=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"text-editor"},[n("editor-content",{attrs:{editor:t.editor}}),n("editor-menu-bar",{attrs:{editor:t.editor},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.commands,r=e.isActive;e.getMarkAttrs;return[n("div",{staticClass:"sidebar"},t._l(t.activeUIBlocks,(function(e,i){return n("div",{key:i},[n("h2",[t._v(t._s(e.label))]),t._l(e.entities,(function(e,i){return["list"===e.type?n("ul",{key:i},t._l(e.entities,(function(e,r){return n("li",{key:r,attrs:{role:"presentation"}},[n("label",[t._v(t._s(e.label)+" "),"setNodeAttrString"===e.type?n("input",{domProps:{value:t.getNodeAttributeValue(e.nodeType,e.attr)},on:{change:function(n){return t.setNodeAttributeValue(a,e.nodeType,e.attr,n.target.value)}}}):t._e()])])})),0):t._e(),"menubar"===e.type?n("aria-menubar",{key:i,scopedSlots:t._u([{key:"default",fn:function(i){var s=i.keyboardNav;return[n("ul",{attrs:{role:"menubar"}},t._l(e.entities,(function(e,i){return n("li",{key:i,class:"separator"===e.type?"separator":null,attrs:{role:"presentation"}},["setNodeType"===e.type?n("a",{attrs:{role:"menuitem",tabindex:0===i?"0":"-1","aria-checked":r[e.nodeType]()?"true":"false"},domProps:{innerHTML:t._s(e.label)},on:{keyup:s,click:function(t){a[e.nodeType]()}}}):t._e(),"setNodeAttrValue"===e.type?n("a",{attrs:{role:"menuitem",tabindex:0===i?"0":"-1","aria-checked":t.hasNodeAttributeValue(e.nodeType,e.attr,e.value)?"true":"false"},domProps:{innerHTML:t._s(e.label)},on:{keyup:s,click:function(n){return t.setNodeAttributeValue(a,e.nodeType,e.attr,e.value)}}}):t._e(),"toggleMark"===e.type?n("a",{attrs:{role:"menuitem",tabindex:0===i?"0":"-1","aria-checked":r[e.markType]()?"true":"false"},domProps:{innerHTML:t._s(e.label)},on:{keyup:s,click:function(t){a[e.markType]()}}}):t._e(),"selectNodeAttr"===e.type?n("select",{attrs:{role:"menuitem",tabindex:0===i?"0":"-1"},on:{keyup:s,change:function(n){return t.setNodeAttributeValue(a,e.nodeType,e.attr,n.target.value)}}},t._l(e.values,(function(a){return n("option",{key:a.value,domProps:{selected:t.hasNodeAttributeValue(e.nodeType,e.attr,a.value),value:a.value}},[t._v(t._s(a.label))])})),0):t._e(),"selectMarkAttr"===e.type?n("select",{attrs:{role:"menuitem",tabindex:0===i?"0":"-1"},on:{keyup:s,change:function(n){return t.setMarkAttributeValue(e.markType,e.attr,n.target.value)}}},t._l(e.values,(function(a){return n("option",{key:a.value,domProps:{selected:t.hasMarkAttributeValue(e.markType,e.attr,a.value),value:a.value}},[t._v(t._s(a.label))])})),0):t._e(),"editNestedDoc"===e.type?n("a",{attrs:{role:"menuitem",tabindex:0===i?"0":"-1"},domProps:{innerHTML:t._s(e.label)},on:{keyup:s,click:function(n){return t.editNestedDoc(a,e.nodeType,e.attr,e.targetNodeType)}}}):t._e(),"closeNested"===e.type?n("a",{attrs:{role:"menuitem",tabindex:0===i?"0":"-1"},domProps:{innerHTML:t._s(e.label)},on:{keyup:s,click:t.closeNestedAction}}):t._e(),"linkNestedDoc"===e.type?n("select",{attrs:{role:"menuitem",tabindex:0===i?"0":"-1"},on:{keyup:s,change:function(n){return t.setNodeAttributeValue(a,e.nodeType,e.attr,n.target.value)}}},t._l(t.getNestedIds(e.targetNodeType),(function(a){return n("option",{key:a.value,domProps:{selected:t.hasNodeAttributeValue(e.nodeType,e.attr,a.value),value:a.value}},[t._v(t._s(a.label))])})),0):t._e()])})),0)]}}],null,!0)}):t._e()]}))],2)})),0)]}}])}),t.showNested?n("div",{staticClass:"nested"},[n("text-editor",{attrs:{section:t.section,nestedSection:t.nestedSettings.section,nestedId:t.nestedSettings.id,closeNestedAction:t.closeNestedEditor}})],1):t._e()],1)},W=[],z=(n("4de4"),n("b0c0"),n("e439"),n("dbb4"),n("ade3")),G=n("cd42"),q=n("a9de"),K=(n("4fad"),n("3835")),Q=function(t){function e(t){var n;return Object(s["a"])(this,e),n=Object(c["a"])(this,Object(u["a"])(e).call(this)),n._config={},n._config=t,n}return Object(l["a"])(e,t),Object(o["a"])(e,[{key:"commands",value:function(t){var e,n=t.type;return e={},Object(z["a"])(e,n.name,(function(t){return Object(q["b"])(n,t)})),Object(z["a"])(e,n.name+"_setAttribute",(function(t){return Object(q["b"])(n,t)})),e}},{key:"name",get:function(){return this._config.name}},{key:"schema",get:function(){var t=this;return{content:"inline*",group:"block",draggable:!1,attrs:this._config.attrs,parseDOM:[{tag:"div.node-".concat(this._config.name),getAttrs:function(e){var n={};return t._config.attrs&&Object.keys(t._config.attrs).forEach((function(t){var a=e.getAttribute("data-".concat(t));a&&(n[t]=a)})),n}}],toDOM:function(e){var n={class:"node-".concat(t._config.name)};return Object.entries(e.attrs).forEach((function(t){var e=Object(K["a"])(t,2),a=e[0],r=e[1];n["data-".concat(a)]=r})),["div",n,0]}}}}]),e}(G["f"]),tt=n("986d"),et=n("0ac0"),nt=function(t){function e(t){var n;return Object(s["a"])(this,e),n=Object(c["a"])(this,Object(u["a"])(e).call(this)),n._config={},n._config=t,n}return Object(l["a"])(e,t),Object(o["a"])(e,[{key:"commands",value:function(t){var e=t.type,n=t.schema,a=n.nodes[this._config.content];return function(){return function(t,r){var i=t.selection,s=i.$from,o=i.$to,c=i.from,u=i.to,l=s.blockRange(o),d=l&&Object(et["i"])(l);if(!l||null===d)return!1;var f=Object(tt["findParentNode"])((function(t){return t.type===e}))(i);if(l.depth>=1&&f&&l.depth-f.depth<=1&&f.node.type===e){var h=t.tr.lift(l,d);return h=h.setBlockType(c,u,n.nodes.paragraph),r(h),!0}var p=t.tr.setBlockType(c,u,a);return p=p.wrap(l,[{type:e}]),r(p),!0}}}},{key:"name",get:function(){return this._config.name}},{key:"schema",get:function(){var t=this;return{content:this._config.content+"+",group:"block",draggable:!1,attrs:this._config.attrs,parseDOM:[{tag:"div.node-".concat(this._config.name),getAttrs:function(e){var n={};return t._config.attrs&&Object.keys(t._config.attrs).forEach((function(t){var a=e.getAttribute("data-".concat(t));a&&(n[t]=a)})),n}}],toDOM:function(e){var n={class:"node-".concat(t._config.name)};return Object.entries(e.attrs).forEach((function(t){var e=Object(K["a"])(t,2),a=e[0],r=e[1];n["data-".concat(a)]=r})),["div",n,0]}}}}]),e}(G["f"]),at=function(t){function e(t){var n;return Object(s["a"])(this,e),n=Object(c["a"])(this,Object(u["a"])(e).call(this)),n._config={},n._config=t,n}return Object(l["a"])(e,t),Object(o["a"])(e,[{key:"commands",value:function(t){var e,n=t.type;return e={},Object(z["a"])(e,n.name,(function(t){return function(e,a){var r=e.selection,i=r.$from,s=r.$to,o=r.from,c=r.to,u=!1;e.doc.nodesBetween(o,c,(function(t){t.type===n&&(u=!0)}));var l=i.parent.slice(i.parentOffset,s.parentOffset);return a(u?e.tr.replaceRange(o-1,c+1,l):e.tr.replaceRangeWith(o,c,n.create(t,l.content))),!0}})),Object(z["a"])(e,n.name+"_setAttribute",(function(t){return function(e,a){var r=e.selection,i=r.$from,s=r.$to,o=(r.from,r.to,i.blockRange(s));if(!o)return!1;var c=e.doc.slice(o.start+1,o.end-1);return a(e.tr.replaceRangeWith(o.start,o.end,n.create(t,c.content))),!0}})),e}},{key:"name",get:function(){return this._config.name}},{key:"schema",get:function(){var t=this;return{content:"inline*",group:"inline",inline:!0,attrs:this._config.attrs,parseDOM:[{tag:"span.node-".concat(this._config.name),getAttrs:function(e){var n={};return t._config.attrs&&Object.keys(t._config.attrs).forEach((function(t){var a=e.getAttribute("data-".concat(t));a&&(n[t]=a)})),n}}],toDOM:function(e){var n={class:"node-".concat(t._config.name)};return Object.entries(e.attrs).forEach((function(t){var e=Object(K["a"])(t,2),a=e[0],r=e[1];n["data-".concat(a)]=r})),["span",n,0]}}}}]),e}(G["f"]),rt=function(t){function e(t){var n;return Object(s["a"])(this,e),n=Object(c["a"])(this,Object(u["a"])(e).call(this)),n._config={},n._config=t,n}return Object(l["a"])(e,t),Object(o["a"])(e,[{key:"commands",value:function(t){var e=t.type;return function(){return Object(q["c"])(e)}}},{key:"name",get:function(){return this._config.name}},{key:"schema",get:function(){var t=this;return{attrs:this._config.attrs,parseDOM:[{tag:"span.mark-".concat(this._config.name),getAttrs:function(e){var n={};return t._config.attrs&&Object.keys(t._config.attrs).forEach((function(t){var a=e.getAttribute("data-".concat(t));a&&(n[t]=a)})),n}}],toDOM:function(e){var n={class:"mark-".concat(t._config.name)};return Object.entries(e.attrs).forEach((function(t){var e=Object(K["a"])(t,2),a=e[0],r=e[1];r&&(n["data-".concat(a)]=r)})),["span",n,0]}}}}]),e}(G["e"]);function it(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function st(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?it(Object(n),!0).forEach((function(e){Object(z["a"])(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ot=function(t){function e(){var t;return Object(s["a"])(this,e),t=Object(c["a"])(this,Object(u["a"])(e).apply(this,arguments)),t.editor=null,t.showNested=!1,t.nestedSettings=null,t.internalContentUpdate=!1,t.defaultNodeName="",t}return Object(l["a"])(e,t),Object(o["a"])(e,[{key:"mounted",value:function(){var t=this,e=[new G["a"],new G["g"]];this.defaultNodeName="",this.schema.forEach((function(n){"block"===n.type?(e.push(new Q(n)),""===t.defaultNodeName&&(t.defaultNodeName=n.name)):"wrapping"===n.type?e.push(new nt(n)):"inline"===n.type&&"text"!==n.name?e.push(new at(n)):"mark"===n.type&&e.push(new rt(n))})),this.editor=new G["b"]({useBuiltInExtensions:!1,extensions:e,content:{type:"doc",content:[{type:this.defaultNodeName,content:[]}]},onUpdate:function(e){var n=e.getJSON;t.internalContentUpdate=!0,t.$props.nestedSection&&t.$props.nestedId?t.$store.commit("setTextDoc",{path:t.$props.section+".nestedId."+t.$props.nestedSection+"."+t.$props.nestedId,doc:n()}):t.$store.commit("setTextDoc",{path:t.$props.section+".doc",doc:n()})}}),this.doc&&this.editor.setContent(this.doc),this.editor.focus()}},{key:"beforeDestroy",value:function(){this.editor&&this.editor.destroy()}},{key:"updateContent",value:function(t){!this.internalContentUpdate&&this.editor&&this.editor.setContent(t),this.internalContentUpdate=!1}},{key:"getNodeAttributeValue",value:function(t,e){var n=this.editor.state.selection,a=n.from,r=n.to,i="";return this.editor.state.doc.nodesBetween(a,r,(function(n){n.type.name===t&&void 0!==n.attrs[e]&&null!==n.attrs[e]&&(i=n.attrs[e])})),i}},{key:"hasNodeAttributeValue",value:function(t,e,n){return this.getNodeAttributeValue(t,e)===n}},{key:"setNodeAttributeValue",value:function(t,e,n,a){var r=this.editor.state.selection,i=r.from,s=r.to,o={};this.editor.state.doc.nodesBetween(i,s,(function(t){t.type.name===e&&(o=st({},o,{},t.attrs))})),o[n]=a,t[e+"_setAttribute"](o)}},{key:"getMarkAttributeValue",value:function(t,e){var n=this.editor.state.selection,a=n.from,r=n.to,i="";return this.editor.state.doc.nodesBetween(a,r,(function(n){n.marks&&n.marks.forEach((function(n){n.type.name===t&&(i=n.attrs[e])}))})),i}},{key:"hasMarkAttributeValue",value:function(t,e,n){return this.getMarkAttributeValue(t,e)===n}},{key:"setMarkAttributeValue",value:function(t,e,n){if(n){var a=this.editor.state.selection,r=a.from,i=a.to,s={};this.editor.state.doc.nodesBetween(r,i,(function(e){e.marks&&e.marks.forEach((function(e){e.type.name===t&&(s=st({},s,{},e.attrs))}))})),s[e]=n,Object(q["d"])(this.editor.schema.marks[t],s)(this.editor.state,this.editor.dispatchTransaction.bind(this.editor))}else Object(q["a"])(this.editor.schema.marks[t])(this.editor.state,this.editor.dispatchTransaction.bind(this.editor))}},{key:"getNestedIds",value:function(t){var e=[{value:"",label:"New"}];return Object.keys(this.$store.state.content[this.$props.section].nested[t]).forEach((function(t){e.push({value:t,label:t})})),e}},{key:"editNestedDoc",value:function(t,e,n,a){var r=this.getNodeAttributeValue(e,n);if(!r){var i=this.$store.state.content[this.$props.section].nested[a];r=a+"-1";var s=1;while(i&&i[r])s+=1,r=a+"-"+s;this.setNodeAttributeValue(t,e,n,r),this.$store.commit("addNestedDoc",{path:this.$props.section+".nested."+a+"."+r,doc:{type:"doc",content:[{type:"paragraph",content:[]}]}})}this.showNested=!0,this.nestedSettings={section:a,id:r}}},{key:"closeNestedEditor",value:function(){this.showNested=!1,this.nestedSettings=null}},{key:"schema",get:function(){return this.$store.state.sections[this.$props.section].schema}},{key:"content",get:function(){return this.$store.state.content[this.$props.section]}},{key:"doc",get:function(){if(this.content){if(!this.$props.nestedSection||!this.$props.nestedId)return this.content.doc;if(this.content.nested&&this.content.nested[this.$props.nestedSection]&&this.content.nested[this.$props.nestedSection][this.$props.nestedId])return this.content.nested[this.$props.nestedSection][this.$props.nestedId].content[0]}return null}},{key:"ui",get:function(){return this.$props.nestedSection&&this.$store.state.sections[this.$props.section].ui[this.$props.nestedSection]?this.$store.state.sections[this.$props.section].ui[this.$props.nestedSection]:this.$store.state.sections[this.$props.section].ui.doc}},{key:"activeUIBlocks",get:function(){var t=this.editor.isActive;return this.ui.filter((function(e){return!e.condition||"isActive"===e.condition.type&&t[e.condition.activeType]()}))}}]),e}(f["c"]);d["a"]([Object(f["b"])({type:String})],ot.prototype,"section",void 0),d["a"]([Object(f["b"])({type:String})],ot.prototype,"nestedSection",void 0),d["a"]([Object(f["b"])({type:String})],ot.prototype,"nestedId",void 0),d["a"]([Object(f["b"])({type:Function})],ot.prototype,"closeNestedAction",void 0),d["a"]([Object(f["d"])("doc")],ot.prototype,"updateContent",null),ot=d["a"]([Object(f["a"])({components:{EditorContent:G["c"],EditorMenuBar:G["d"],AriaMenubar:_},name:"text-editor"})],ot);var ct=ot,ut=ct,lt=Object(O["a"])(ut,J,W,!1,null,null,null),dt=lt.exports,ft=(n("99af"),n("a15b"),n("d81d"),n("4e82"),n("a434"),n("25f0"),n("6062"),n("5319"),n("53ca")),ht=function(){function t(){Object(s["a"])(this,t)}return Object(o["a"])(t,[{key:"serialise",value:function(t,e){var n=this,a={node:"tei:TEI",attrs:{"xmlns:tei":["http://www.tei-c.org/ns/1.0"]},children:[]};Object.entries(e).forEach((function(e){var r=Object(K["a"])(e,2),i=r[0],s=r[1];"MetadataEditor"===s.type&&n.mergeTrees(a,n.serialiseHeader(t[i],s))})),Object.entries(e).forEach((function(e){var r=Object(K["a"])(e,2),i=r[0],s=r[1];"TextEditor"===s.type&&n.mergeTrees(a,n.serialiseSingleText(t[i],s))}));var r=this.toString(a,"");return r.splice(0,0,'<?xml version="1.0" encoding="UTF-8"?>'),r.push(""),r.join("\n")}},{key:"mergeTrees",value:function(t,e){if(t&&e)for(var n=0;n<e.children.length;n++){for(var a=!1,r=0;r<t.children.length;r++)t.children[r].node===e.children[n].node&&this.objectsMatch(t.children[r].attrs,e.children[n].attrs)&&(this.mergeTrees(t.children[r],e.children[n]),a=!0);a||t.children.push(e.children[n])}}},{key:"objectsMatch",value:function(t,e){var n=this;if(t&&e){if(Object(ft["a"])(t)!==Object(ft["a"])(e))return!1;if("string"===typeof t||"number"===typeof t||"boolean"===typeof t)return t===e;var a=Object.keys(t),r=Object.keys(e);return a.forEach((function(a){return!(r.indexOf(a)<0)&&(!!n.objectsMatch(t[a],e[a])&&void r.splice(r.indexOf(a),1))})),!(r.length>0)}return!t&&!e}},{key:"serialiseSingleText",value:function(t,e){var n=this;if(t){var a=e.serialiser.tag.split("/");this.nested={};var r={node:a[a.length-1],children:t.doc.content.map((function(t){return n.serialiseTextNode(t,e.schema)})),attrs:{}};e.serialiser.attrs&&Object.entries(e.serialiser.attrs).forEach((function(t){var e=Object(K["a"])(t,2),n=e[0],a=e[1];r.attrs[n]?r.attrs[n].push(a):r.attrs[n]=[a]})),Object.entries(this.nested).forEach((function(a){var i=Object(K["a"])(a,2),s=i[0],o=i[1];new Set(o).forEach((function(a){t.nested[s]&&t.nested[s][a]&&r.children.push(n.serialiseTextNode(t.nested[s][a],e.schema))}))}));for(var i=a.length-2;i>=0;i--)r={node:a[i],children:[r]};return{node:"tei:TEI",children:[r]}}return null}},{key:"serialiseTextNode",value:function(t,e){var n=this,a=e.filter((function(e){return e.name===t.type&&e.serialiser}));if(1===a.length){a=a[0];var r={node:a.serialiser.tag,attrs:{},children:[],text:null};if(a.serialiser.attrs&&Object.entries(a.serialiser.attrs).forEach((function(t){r.attrs[t[0]]=[t[1]]})),t.attrs&&Object.entries(t.attrs).forEach((function(t){var e=a.attrs[t[0]].serialiser;if(e){var n=void 0;e.values?e.values[t[1]]&&(n=e.values[t[1]]):n=e.value?e.value.replace("{value}",t[1]):t[1],void 0!==n&&("text()"===e.attr?r.text=n:r.attrs[e.attr]?r.attrs[e.attr].push(n):r.attrs[e.attr]=[n])}})),"inline"===a.type){if(t.content)if(t.content.length>1||t.content[0].marks&&t.content[0].marks.length>0)t.content.forEach((function(t){r.children.push(n.serialiseTextNode(t,e))}));else{var i=this.serialiseTextNode(t.content[0],e);a.serialiser.text?r.attrs[a.serialiser.text.attr]?r.attrs[a.serialiser.text.attr].push(i.text):r.attrs[a.serialiser.text.attr]=[i.text]:r.text=i.text}else t.text&&(a.serialiser.text?r.attrs[a.serialiser.text.attr]?r.attrs[a.serialiser.text.attr].push(t.text):r.attrs[a.serialiser.text.attr]=[t.text]:r.text=t.text);if(t.marks){var s=t.marks.map((function(t){var n=e.filter((function(e){return e.name===t.type&&e.serialiser}));if(1===n.length){n=n[0];var a={node:r.node,attrs:{}},i=n.serialiser;return i.tag&&(a.node=i.tag),i.attrs&&Object.entries(i.attrs).forEach((function(t){t[1].value&&(a.attrs[t[0]]?a.attrs[t[0]].push(t[1].value):a.attrs[t[0]]=[t[1].value])})),t.attrs&&Object.entries(t.attrs).forEach((function(t){var e=void 0;n.attrs[t[0]].serialiser.value?e=n.attrs[t[0]].serialiser.value.replace("{value}",t[1]):n.attrs[t[0]].serialiser.values&&n.attrs[t[0]].serialiser.values[t[1]]&&(e=n.attrs[t[0]].serialiser.values[t[1]]),void 0!==e&&(a.attrs[n.attrs[t[0]].serialiser.attr]?a.attrs[n.attrs[t[0]].serialiser.attr].push(e):a.attrs[n.attrs[t[0]].serialiser.attr]=[e])})),a}return null})).filter((function(t){return t}));if(new Set(s.map((function(t){return t.node}))).size>1){s.sort((function(t,e){return t.node<e.node?-1:t.node>e.node?1:t.node===e.node?0:void 0}));var o=r;o.node=null,s.forEach((function(t){if(null===o.node||o.node===t.node)o.node=t.node,Object.entries(t.attrs).forEach((function(t){o.attrs[t[0]]?o.attrs[t[0]]=o.attrs[t[0]].concat(t[1]):o.attrs[t[0]]=t[1]}));else{var e={node:t.node,attrs:t.attrs,children:[],text:o.text};o.text=null,o.children.push(e),o=e}}))}else s.forEach((function(t){t&&(t.node&&(r.node=t.node),t.attrs&&Object.entries(t.attrs).forEach((function(t){r.attrs[t[0]]?r.attrs[t[0]]=r.attrs[t[0]].concat(t[1]):r.attrs[t[0]]=t[1]})))}))}}else t.content&&t.content.forEach((function(t){"doc"===t.type?t.content&&t.content.forEach((function(t){r.children.push(n.serialiseTextNode(t,e))})):r.children.push(n.serialiseTextNode(t,e))}));return a.reference&&(this.nested[a.reference.type]||(this.nested[a.reference.type]=[]),this.nested[a.reference.type].push(t.attrs[a.reference.attr])),r}return null}},{key:"serialiseHeader",value:function(t,e){var n=this;return{node:"tei:TEI",children:[{node:"tei:teiHeader",children:e.schema.map((function(e){return n.serialiseMetadataNode(t[e.tag.substring(4)],e)}))}]}}},{key:"serialiseMetadataNode",value:function(t,e){var n=this;if(e.multiple){var a=t.map((function(t){var a={node:e.tag};if(t._text&&(a.text=t._text),t._attrs&&(a.attrs={},Object.entries(t._attrs).forEach((function(t){a.attrs[t[0]]=[t[1]]}))),e.children){a.children=[];for(var r=0;r<e.children.length;r++)if(t[e.children[r].tag.substring(4)]){var i=n.serialiseMetadataNode(t[e.children[r].tag.substring(4)],e.children[r]);Array.isArray(i)?a.children=a.children.concat(i):a.children.push(i)}}return a}));return a}var r={node:e.tag};if(t&&(t._text&&(r.text=t._text),t._attrs&&(r.attrs={},Object.entries(t._attrs).forEach((function(t){r.attrs[t[0]]=[t[1]]}))),e.children)){r.children=[];for(var i=0;i<e.children.length;i++)if(t[e.children[i].tag.substring(4)]){var s=this.serialiseMetadataNode(t[e.children[i].tag.substring(4)],e.children[i]);Array.isArray(s)?r.children=r.children.concat(s):r.children.push(s)}}return r}},{key:"toString",value:function(t,e){var n=this;function a(t){return t.replace("&","&").replace("<","<").replace(">",">")}var r=[];if(t){var i=[e,"<",t.node];t.attrs&&Object.entries(t.attrs).forEach((function(t){t[1].length>0&&(t[1].sort(),i.push(" "+t[0]+'="'+a(t[1].join(" "))+'"'))})),t.children&&t.children.length>0?(i.push(">"),r.push(i.join("")),t.children.forEach((function(t){r=r.concat(n.toString(t,e+" "))})),r.push(e+"</"+t.node+">")):(t.text?(i.push(">"),i.push(a(t.text)),i.push("</"+t.node+">")):i.push("/>"),r.push(i.join("")))}return r}}]),t}(),pt=function(t){function e(){var t;return Object(s["a"])(this,e),t=Object(c["a"])(this,Object(u["a"])(e).apply(this,arguments)),t.currentSection=null,t}return Object(l["a"])(e,t),Object(o["a"])(e,[{key:"setCurrentSection",value:function(t){this.currentSection=t}},{key:"getContentForSection",value:function(t){return D(this.$store.state.content,t)}},{key:"setContentForSection",value:function(t,e){this.$store.commit("setTextDoc",{path:t,doc:e})}},{key:"mounted",value:function(){var t=Object.keys(this.sections);t.length>0&&(this.currentSection=t[0])}},{key:"save",value:function(){if(this.hasSaveCallback){var t=new ht;this.$store.state.callbacks.save(t.serialise(this.$store.state.content,this.$store.state.sections))}}},{key:"load",value:function(){var t=this;this.hasLoadCallback&&this.$store.state.callbacks.load((function(e){t.$store.dispatch("load",e)}))}},{key:"updateSections",value:function(){var t=Object.keys(this.sections);t.length>0&&(this.currentSection=t[0])}},{key:"sections",get:function(){return this.$store.state.sections}},{key:"hasSaveCallback",get:function(){return!!this.$store.state.callbacks.save}},{key:"hasLoadCallback",get:function(){return!!this.$store.state.callbacks.load}}]),e}(f["c"]);d["a"]([Object(f["d"])("sections")],pt.prototype,"updateSections",null),pt=d["a"]([Object(f["a"])({components:{AriaMenubar:_,AriaMenu:$,MetadataEditor:Y,TextEditor:dt}})],pt);var vt=pt,bt=vt,gt=(n("e215"),Object(O["a"])(bt,h,p,!1,null,null,null)),mt=gt.exports,yt=function(t){function e(){return Object(s["a"])(this,e),Object(c["a"])(this,Object(u["a"])(e).apply(this,arguments))}return Object(l["a"])(e,t),Object(o["a"])(e,[{key:"mounted",value:function(){var t=this,e=document.getElementById("TEIEditorConfig");if(e){var n=JSON.parse(e.innerHTML);n&&this.$store.commit("init",n)}this.$store.state.callbacks&&this.$store.state.callbacks.autoLoad&&this.$store.state.callbacks.autoLoad((function(e){t.$store.dispatch("load",e)}))}}]),e}(f["c"]);yt=d["a"]([Object(f["a"])({components:{TeiEditor:mt}})],yt);var kt=yt,Ot=kt,xt=Object(O["a"])(Ot,r,i,!1,null,null,null),jt=xt.exports,_t=n("2f62");function At(t){return"tei"===t?"http://www.tei-c.org/ns/1.0":"xml"===t?"http://www.w3.org/XML/1998/namespace":"http://www.tei-c.org/ns/1.0"}var Nt=function(){function t(e){Object(s["a"])(this,t),this.dom=e}return Object(o["a"])(t,[{key:"evaluate",value:function(t,e,n){return this.dom.evaluate(e,t,At,n,null)}},{key:"firstNode",value:function(t,e){return this.evaluate(t,e,XPathResult.FIRST_ORDERED_NODE_TYPE).singleNodeValue}},{key:"nodeIterator",value:function(t,e){return this.evaluate(t,e,XPathResult.ORDERED_NODE_ITERATOR_TYPE)}},{key:"stringValue",value:function(t,e){return this.evaluate(t,e,XPathResult.STRING_TYPE).stringValue}},{key:"booleanValue",value:function(t,e){return this.evaluate(t,e,XPathResult.BOOLEAN_TYPE).booleanValue}},{key:"numberValue",value:function(t,e){return this.evaluate(t,e,XPathResult.NUMBER_TYPE).numberValue}}]),t}(),Mt=function(){function t(e,n){Object(s["a"])(this,t),this.dom=e,this.xpath=new Nt(this.dom),this.config=n}return Object(o["a"])(t,[{key:"get",value:function(){if(!this.data){var t=this.xpath.firstNode(this.dom.documentElement,"/tei:TEI/tei:teiHeader");this.data={};for(var e=0;e<this.config.schema.length;e++){var n=this.parseHeaderNode(t,this.config.schema[e]);n&&(this.data[this.config.schema[e].tag.substring(4)]=n)}}return this.data}},{key:"parseHeaderNode",value:function(t,e){var n=this.xpath.nodeIterator(t,e.tag),a=[],r=n.iterateNext();while(r){for(var i={_attrs:{},_text:0===r.children.length?this.xpath.stringValue(r,"text()"):null},s=0;s<r.attributes.length;s++)i._attrs[r.attributes[s].name]=r.attributes[s].value;if(e.children)for(var o=0;o<e.children.length;o++){var c=this.parseHeaderNode(r,e.children[o]);c&&(i[e.children[o].tag.substring(e.children[o].tag.indexOf(":")+1)]=c)}a.push(i),r=n.iterateNext()}return 0===a.length?null:e.multiple?a:a[0]}}]),t}(),Et=function(){function t(e,n){Object(s["a"])(this,t),this.dom=e,this.xpath=new Nt(this.dom),this.config=n}return Object(o["a"])(t,[{key:"get",value:function(){if(!this.doc&&(this.doc={type:"doc",content:[]},this.nestedDocs={},this.config.parser&&this.config.parser.selector)){var t=this.xpath.firstNode(this.dom.documentElement,this.config.parser.selector);if(t)for(var e=0;e<t.children.length;e++){var n=this.parseContentNode(t.children[e],this.config);n&&!n.nestedDoc?this.doc.content.push(n):n&&n.nestedDoc&&this.addNestedDoc(n)}}return[this.doc,this.nestedDocs]}},{key:"parseContentAttributes",value:function(t,e){var n=this,a={};return Object.entries(e).forEach((function(e){var r=Object(K["a"])(e,2),i=r[0],s=r[1],o=[];s.parser?o.push(s.parser):s.parsers&&(o=s.parsers);for(var c=0;c<o.length;c++){var u=o[c];if("boolean"===u.type)a[i]=n.xpath.booleanValue(t,u.selector);else if("number"===u.type)try{a[i]=n.xpath.numberValue(t,u.selector)}catch(d){console.log(d)}else if("static"===u.type)n.xpath.booleanValue(t,u.selector)&&(a[i]=u.value);else try{var l=n.xpath.stringValue(t,u.selector);l&&(a[i]=l)}catch(d){console.log(d)}}})),a}},{key:"parseContentMarks",value:function(t,e){var n=this,a=[];return e.forEach((function(e){if("mark"===e.type){var r=[];e.parser?r.push(e.parser):e.parsers&&(r=e.parsers);for(var i=0;i<r.length;i++)if(n.xpath.booleanValue(t,r[i].selector)){var s={type:e.name};e.attrs&&(s.attrs=n.parseContentAttributes(t,e.attrs)),a.push(s)}}})),a}},{key:"parseContentNode",value:function(t,e){for(var n=Object.entries(e.schema),a=0;a<n.length;a++){var r=n[a][1],i=[];r.parser?i.push(r.parser):r.parsers&&(i=i.concat(r.parsers));for(var s=0;s<i.length;s++){var o=i[s];if(null!==this.xpath.firstNode(t,"self::"+o.selector)){var c={type:r.name};if(r.attrs&&(c.attrs=this.parseContentAttributes(t,r.attrs)),"nested"===r.type&&(c.nestedDoc=!0),"inline"===r.type)if("text"===r.name){if(c.text=this.xpath.stringValue(t,o.text),c.marks=this.parseContentMarks(t,e.schema),1===t.children.length){var u=this.parseContentNode(t.children[0],e);u.text&&""!==u.text&&(c.text=u.text),c.marks=c.marks.concat(u.marks)}}else if(0===t.children.length)this.xpath.stringValue(t,o.text)&&(c.content=[{type:"text",text:this.xpath.stringValue(t,o.text),marks:this.parseContentMarks(t,e.schema)}]);else{for(var l=[],d=0;d<t.children.length;d++){var f=this.parseContentNode(t.children[d],e);f&&l.push(f)}c.content=l}else{for(var h=[],p=0;p<t.children.length;p++){var v=this.parseContentNode(t.children[p],e);v&&!v.nestedDoc?h.push(v):v&&v.nestedDoc&&this.addNestedDoc(v)}c.content=h}return c}}}return null}},{key:"addNestedDoc",value:function(t){if(t.attrs&&t.attrs.id){this.nestedDocs[t.type]||(this.nestedDocs[t.type]={}),this.nestedDocs[t.type][t.attrs.id]=t;var e={type:"doc",content:t.content};t.content=[e]}}}]),t}();function wt(t){if(void 0!==t){if(null===t)return null;if(Array.isArray(t))return t.map((function(t){return wt(t)}));if("object"===Object(ft["a"])(t)){var e={};return Object.keys(t).forEach((function(n){e[n]=wt(t[n])})),e}return t}}a["a"].use(_t["a"]);var St={settings:{metadataSection:""},sections:{},content:{},callbacks:{save:void 0,load:void 0,autoLoad:void 0}},$t=new _t["a"].Store({state:St,mutations:{init:function(t,e){t.sections=e.sections,Object.keys(e.sections).forEach((function(n,r){"MetadataEditor"===e.sections[n].type&&(t.settings.metadataSection=n),a["a"].set(t.content,n,{}),a["a"].set(t.content[n],"doc",null),a["a"].set(t.content[n],"nested",{})})),window.TEIEditor&&window.TEIEditor.callbacks&&(a["a"].set(t.callbacks,"save",window.TEIEditor.callbacks.save),a["a"].set(t.callbacks,"load",window.TEIEditor.callbacks.load),a["a"].set(t.callbacks,"autoLoad",window.TEIEditor.callbacks.autoLoad))},setMetadata:function(t,e){a["a"].set(t.content,t.settings.metadataSection,e)},setMetadataValue:function(t,e){var n=t.content[t.settings.metadataSection];if(n){n=wt(n);var r=n,i=e.path.split(".");while(i.length>0){var s=i[0];if("["===s[0]&&"]"===s[s.length-1]&&Array.isArray(r)){var o=Number.parseInt(s.substring(1,s.length-1));o>=0&&o<r.length&&(i.length>1?r=r[o]:r[o]=e.value)}else r[s]?i.length>1?r=r[s]:r[s]=e.value:i.length>1?(r[s]={},r=r[s]):r[s]=e.value;i.splice(0,1)}a["a"].set(t.content,t.settings.metadataSection,n)}},addMetadataMuliRow:function(t,e){var n=t.content[t.settings.metadataSection];if(n){n=wt(n);var r=D(n,e.path);r&&(r.push(e.value),a["a"].set(t.content,t.settings.metadataSection,n))}},removeMetadataMultiRow:function(t,e){var n=t.content[t.settings.metadataSection];if(n){n=wt(n);var r=D(n,e.path);r&&e.value>=0&&e.value<r.length&&(r.splice(e.value,1),a["a"].set(t.content,t.settings.metadataSection,n))}},moveMetadataMultiRow:function(t,e){var n=t.content[t.settings.metadataSection];if(n){n=wt(n);var r=D(n,e.path);if(r&&e.idx>=0&&e.idx<r.length&&e.idx+e.move>=0&&e.idx+e.move<r.length){var i=r[e.idx];r.splice(e.idx,1),r.splice(e.idx+e.move,0,i),a["a"].set(t.content,t.settings.metadataSection,n)}}},setTextDoc:function(t,e){var n=e.path.split(".");2===n.length?a["a"].set(t.content[n[0]],n[1],e.doc):4===n.length&&a["a"].set(t.content[n[0]].nested[n[2]][n[3]],"content",[e.doc])},addNestedDoc:function(t,e){var n=e.path.split(".");4===n.length&&(t.content[n[0]].nested[n[2]]||a["a"].set(t.content[n[0]].nested,n[2],{}),a["a"].set(t.content[n[0]].nested[n[2]],n[3],{attrs:{id:n[3]},content:[e.doc],nestedDoc:!0,type:n[2]}))}},actions:{load:function(t,e){var n=t.commit,r=t.state,i=new DOMParser,s=i.parseFromString(e,"application/xml");a["a"].set(r,"content",{}),Object.keys(r.sections).forEach((function(t,e){a["a"].set(r.content,t,{}),a["a"].set(r.content[t],"doc",null),a["a"].set(r.content[t],"nested",{})})),Object.entries(r.sections).forEach((function(t){var e=Object(K["a"])(t,2),a=e[0],r=e[1];if("MetadataEditor"===r.type)n("setMetadata",new Mt(s,r).get());else if("TextEditor"===r.type){var i=new Et(s,r).get(),o=Object(K["a"])(i,2),c=o[0],u=o[1];n("setTextDoc",{path:a+".doc",doc:c}),Object.entries(u).forEach((function(t){var e=Object(K["a"])(t,2),r=e[0],i=e[1];Object.entries(i).forEach((function(t){var e=Object(K["a"])(t,2),i=e[0],s=e[1];n("addNestedDoc",{path:a+".nested."+r+"."+i,doc:s.content[0]})}))}))}}))}},modules:{}});a["a"].config.productionTip=!1,new a["a"]({store:$t,render:function(t){return t(jt)}}).$mount("#app")},e215:function(t,e,n){"use strict";var a=n("ba8f"),r=n.n(a);r.a}}); +(function(t){function e(e){for(var a,s,o=e[0],c=e[1],l=e[2],d=0,h=[];d<o.length;d++)s=o[d],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&h.push(r[s][0]),r[s]=0;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(t[a]=c[a]);u&&u(e);while(h.length)h.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var t,e=0;e<i.length;e++){for(var n=i[e],a=!0,o=1;o<n.length;o++){var c=n[o];0!==r[c]&&(a=!1)}a&&(i.splice(e--,1),t=s(s.s=n[0]))}return t}var a={},r={app:0},i=[];function s(e){if(a[e])return a[e].exports;var n=a[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=t,s.c=a,s.d=function(t,e,n){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},s.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)s.d(n,a,function(e){return t[e]}.bind(null,a));return n},s.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="/";var o=window["webpackJsonp"]=window["webpackJsonp"]||[],c=o.push.bind(o);o.push=e,o=o.slice();for(var l=0;l<o.length;l++)e(o[l]);var u=c;i.push([0,"chunk-vendors"]),n()})({0:function(t,e,n){t.exports=n("cd49")},"37ba":function(t,e,n){},"6d73":function(t,e,n){"use strict";var a=n("37ba"),r=n.n(a);e["default"]=r.a},ba8f:function(t,e,n){},cd49:function(t,e,n){"use strict";n.r(e);n("e260"),n("e6cf"),n("cca6"),n("a79d");var a=n("2b0e"),r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("tei-editor")],1)},i=[],s=n("d4ec"),o=n("bee2"),c=n("99de"),l=n("7e84"),u=n("262e"),d=n("9ab4"),h=n("60a3"),f=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"tei-editor"}},[n("nav",[n("aria-menubar",{scopedSlots:t._u([{key:"default",fn:function(e){var a=e.keyboardNav,r=e.mouseClickNav;return[n("ul",{attrs:{role:"menubar"}},[t.hasSaveCallback||t.hasLoadCallback?n("li",{attrs:{role:"presentation"}},[n("a",{attrs:{role:"menuitem",tabindex:"0","aria-expanded":"false"},on:{keyup:a,click:r}},[t._v("File")]),n("aria-menu",{scopedSlots:t._u([{key:"default",fn:function(e){var a=e.keyboardNav,r=e.mouseClickNav;return[n("ul",{attrs:{role:"menu","aria-hidden":"true"}},[t.hasLoadCallback?n("li",{attrs:{role:"presentation"}},[n("a",{attrs:{role:"menuitem",tabindex:"-1"},on:{click:function(e){r(e),t.load()},keyup:a}},[t._v("Load")])]):t._e(),t.hasSaveCallback?n("li",{attrs:{role:"presentation"}},[n("a",{attrs:{role:"menuitem",tabindex:"-1"},on:{click:function(e){r(e),t.save()},keyup:a}},[t._v("Save")])]):t._e()])]}}],null,!0)})],1):t._e(),t._l(t.sections,(function(e,i,s){return n("li",{key:s,attrs:{role:"presentation"}},[n("a",{attrs:{role:"menuitem",tabindex:"-1","aria-checked":i===t.currentSection?"true":"false"},on:{click:function(e){r(e),t.setCurrentSection(i)},keyup:a}},[t._v(t._s(e.label))])])}))],2)]}}])})],1),n("div",[t._l(t.sections,(function(e,a,r){return[a===t.currentSection?["MetadataEditor"===e.type?n("metadata-editor",{key:r,attrs:{config:e}}):t._e(),"TextEditor"===e.type?n("text-editor",{key:r,attrs:{section:a}}):t._e()]:t._e()]}))],2)])},p=[],v=(n("b64b"),n("a4d3"),n("e01a"),n("d28b"),n("d3b7"),n("3ca3"),n("ddb0"),function(t){function e(){return Object(s["a"])(this,e),Object(c["a"])(this,Object(l["a"])(e).apply(this,arguments))}return Object(u["a"])(e,t),Object(o["a"])(e,[{key:"render",value:function(){if(this.$scopedSlots.default)return this.$scopedSlots.default({keyboardNav:this.keyboardNavigation,mouseClickNav:this.mouseClickNavigation})}},{key:"keyboardNavigation",value:function(t){var e=t.target;if(e)if(39===t.keyCode){var n=this.findNextMenuitem(this.getParentMenubar(e),e,"next");n&&n.focus()}else if(37===t.keyCode){var a=this.findNextMenuitem(this.getParentMenubar(e),e,"previous");a&&a.focus()}else if(38===t.keyCode||40===t.keyCode){var r=!0,i=!1,s=void 0;try{for(var o,c=e.parentElement.children[Symbol.iterator]();!(r=(o=c.next()).done);r=!0){var l=o.value;if("menu"===l.getAttribute("role")){l.setAttribute("aria-hidden","false"),e.setAttribute("aria-expanded","true");var u=this.findNextMenuitem(l,null,"next");u&&u.focus()}}}catch(y){i=!0,s=y}finally{try{r||null==c.return||c.return()}finally{if(i)throw s}}}else if(13===t.keyCode||32==t.keyCode){var d=!0,h=!1,f=void 0;try{for(var p,v=e.parentElement.children[Symbol.iterator]();!(d=(p=v.next()).done);d=!0){var b=p.value;if("menu"===b.getAttribute("role"))if("false"===b.getAttribute("aria-hidden"))b.setAttribute("aria-hidden","true"),e.setAttribute("aria-expanded","false");else{b.setAttribute("aria-hidden","false"),e.setAttribute("aria-expanded","true");var g=this.findNextMenuitem(b,null,"next");if(g)return void g.focus()}}}catch(y){h=!0,f=y}finally{try{d||null==v.return||v.return()}finally{if(h)throw f}}e.click()}}},{key:"mouseClickNavigation",value:function(t){var e=t.target;if(e){var n=!0,a=!1,r=void 0;try{for(var i,s=e.parentElement.children[Symbol.iterator]();!(n=(i=s.next()).done);n=!0){var o=i.value;if("menu"===o.getAttribute("role"))if("false"===o.getAttribute("aria-hidden"))o.setAttribute("aria-hidden","true"),e.setAttribute("aria-expanded","false");else{o.setAttribute("aria-hidden","false"),e.setAttribute("aria-expanded","true");var c=this.findNextMenuitem(o,null,"next");if(c)return void c.focus()}}}catch(l){a=!0,r=l}finally{try{n||null==s.return||s.return()}finally{if(a)throw r}}}}},{key:"getParentMenubar",value:function(t){return t?"menubar"===t.getAttribute("role")?t:this.getParentMenubar(t.parentElement):null}},{key:"findNextMenuitem",value:function(t,e,n){if(!t)return null;var a=[];if("next"===n)for(var r=t.children.length-1;r>=0;r--)a.push(t.children[r]);else for(var i=0;i<t.children.length;i++)a.push(t.children[i]);var s=0;e||(s=1);while(a.length>0){var o=a.pop();if(0===s&&o===e)s=1;else if(1===s&&"menuitem"===o.getAttribute("role")&&"true"!==o.getAttribute("aria-disabled"))return o;if("menu"!==o.getAttribute("role"))if("next"===n)for(var c=o.children.length-1;c>=0;c--)a.push(o.children[c]);else for(var l=0;l<o.children.length;l++)a.push(o.children[l])}return null}}]),e}(h["c"]));v=d["a"]([Object(h["a"])({})],v);var b,g,y=v,m=y,k=n("6d73"),O=n("2877");function x(t){this["$style"]=k["default"].locals||k["default"]}var j=Object(O["a"])(m,b,g,!1,x,null,null),N=j.exports,A=function(t){function e(){return Object(s["a"])(this,e),Object(c["a"])(this,Object(l["a"])(e).apply(this,arguments))}return Object(u["a"])(e,t),Object(o["a"])(e,[{key:"render",value:function(){if(this.$scopedSlots.default)return this.$scopedSlots.default({keyboardNav:this.keyboardNavigation,mouseClickNav:this.mouseClickNavigation})}},{key:"keyboardNavigation",value:function(t){var e=t.target;if(e)if(39===t.keyCode);else if(37===t.keyCode);else if(38===t.keyCode){var n=this.findNextMenuitem(this.getParentMenu(e),e,"previous");n&&n.focus()}else if(40===t.keyCode){var a=this.findNextMenuitem(this.getParentMenu(e),e,"next");a&&a.focus()}else if(13===t.keyCode||32==t.keyCode)if(e.getAttribute("aria-expanded")){var r=!0,i=!1,s=void 0;try{for(var o,c=e.parentElement.children[Symbol.iterator]();!(r=(o=c.next()).done);r=!0){var l=o.value;if("menu"===l.getAttribute("role"))if("false"===l.getAttribute("aria-hidden"))l.setAttribute("aria-hidden","true"),e.setAttribute("aria-expanded","false");else{l.setAttribute("aria-hidden","false"),e.setAttribute("aria-expanded","true");var u=this.findNextMenuitem(l,null,"next");u&&u.focus()}}}catch(y){i=!0,s=y}finally{try{r||null==c.return||c.return()}finally{if(i)throw s}}}else e.click();else if(27===t.keyCode){var d=this.getParentMenu(e);if(d){d.setAttribute("aria-hidden","true");var h=!0,f=!1,p=void 0;try{for(var v,b=d.parentElement.children[Symbol.iterator]();!(h=(v=b.next()).done);h=!0){var g=v.value;"menuitem"===g.getAttribute("role")&&(g.setAttribute("aria-expanded","false"),g.focus())}}catch(y){f=!0,p=y}finally{try{h||null==b.return||b.return()}finally{if(f)throw p}}}}}},{key:"mouseClickNavigation",value:function(t){var e=t.target;if(e)if(e.getAttribute("aria-expanded")){var n=!0,a=!1,r=void 0;try{for(var i,s=e.parentElement.children[Symbol.iterator]();!(n=(i=s.next()).done);n=!0){var o=i.value;if("menu"===o.getAttribute("role"))if("false"===o.getAttribute("aria-hidden"))o.setAttribute("aria-hidden","true"),e.setAttribute("aria-expanded","false");else{o.setAttribute("aria-hidden","false"),e.setAttribute("aria-expanded","true");var c=this.findNextMenuitem(o,null,"next");c&&c.focus()}}}catch(b){a=!0,r=b}finally{try{n||null==s.return||s.return()}finally{if(a)throw r}}}else{var l=this.getParentMenu(e);if(l){l.setAttribute("aria-hidden","true");var u=!0,d=!1,h=void 0;try{for(var f,p=l.parentElement.children[Symbol.iterator]();!(u=(f=p.next()).done);u=!0){var v=f.value;"menuitem"===v.getAttribute("role")&&(v.setAttribute("aria-expanded","false"),v.focus())}}catch(b){d=!0,h=b}finally{try{u||null==p.return||p.return()}finally{if(d)throw h}}}}}},{key:"getParentMenu",value:function(t){return t?"menu"===t.getAttribute("role")?t:this.getParentMenu(t.parentElement):null}},{key:"getParentMenuOrMenubar",value:function(t){return t?"menu"===t.getAttribute("role")||"menubar"===t.getAttribute("role")?t:this.getParentMenuOrMenubar(t.parentElement):null}}]),e}(N);A=d["a"]([Object(h["a"])({})],A);var _,M,E=A,w=E,S=Object(O["a"])(w,_,M,!1,null,null,null),T=S.exports,$=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"metadata-editor"},t._l(t.config.ui,(function(e,a){return n("section",{key:a},[n("h2",[t._v(t._s(e.label))]),t._l(e.entries,(function(t,e){return n("div",{key:e},[n("metadata-field",{attrs:{config:t}})],1)}))],2)})),0)},C=[],V=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",["single-text"==t.config.type?[n("label",[n("span",{staticClass:"label-text"},[t._v(t._s(t.config.label))]),n("input",{attrs:{type:"text"},domProps:{value:t.value},on:{change:t.update}})])]:t._e(),"multi-row"==t.config.type?[n("ol",{staticClass:"multi-row"},t._l(t.value,(function(e,a){return n("li",{key:a},[t._l(t.config.entries,(function(e,r){return n("metadata-field",{key:r,attrs:{config:e,parent:t.parent+t.config.path+".["+a+"]"}})})),n("aria-menubar",{attrs:{items:t.modifyMenuItems(a)},on:{action:t.menuAction}}),n("aria-menubar",{scopedSlots:t._u([{key:"default",fn:function(e){var r=e.keyboardNav;return[n("ul",{attrs:{role:"menubar"}},[n("li",{attrs:{role:"presentation"}},[n("a",0===a?{attrs:{role:"menuitem","aria-disabled":!0}}:{attrs:{role:"menuitem",tabindex:1===t.value.length?null:0},on:{click:function(e){return t.menuAction("move-up:"+a)},keyup:r}},[n("svg",{attrs:{viewBox:"0 0 24 24","aria-label":"Move up"}},[n("path",{attrs:{d:"M19,3H5A2,2 0 0,0 3,5V19C3,20.11 3.9,21 5,21H19C20.11,21 21,20.11 21,19V5A2,2 0 0,0 19,3M16.59,15.71L12,11.12L7.41,15.71L6,14.29L12,8.29L18,14.29L16.59,15.71Z"}})])])]),n("li",{attrs:{role:"presentation"}},[a===t.value.length-1?n("a",{attrs:{role:"menuitem","aria-disabled":!0}},[n("svg",{attrs:{viewBox:"0 0 24 24","aria-label":"Move down"}},[n("path",{attrs:{d:"M19,3H5A2,2 0 0,0 3,5V19C3,20.11 3.9,21 5,21H19C20.11,21 21,20.11 21,19V5A2,2 0 0,0 19,3M12,15.71L6,9.71L7.41,8.29L12,12.88L16.59,8.29L18,9.71L12,15.71Z"}})])]):n("a",{attrs:{role:"menuitem",tabindex:1===t.value.length?null:0},on:{click:function(e){return t.menuAction("move-down:"+a)},keyup:r}},[n("svg",{attrs:{viewBox:"0 0 24 24","aria-label":"Move down"}},[n("path",{attrs:{d:"M19,3H5A2,2 0 0,0 3,5V19C3,20.11 3.9,21 5,21H19C20.11,21 21,20.11 21,19V5A2,2 0 0,0 19,3M12,15.71L6,9.71L7.41,8.29L12,12.88L16.59,8.29L18,9.71L12,15.71Z"}})])])]),n("li",{attrs:{role:"presentation"}},[n("a",{attrs:{role:"menuitem",tabindex:1===t.value.length?0:-1},on:{click:function(e){return t.menuAction("delete:"+a)},keyup:r}},[n("svg",{attrs:{viewBox:"0 0 24 24","aria-label":"Delete"}},[n("path",{attrs:{d:"M17,13H7V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z"}})])])])])]}}],null,!0)})],2)})),0),n("aria-menubar",{scopedSlots:t._u([{key:"default",fn:function(e){var a=e.keyboardNav;return[n("ul",{attrs:{role:"menubar"}},[n("li",{attrs:{role:"presentation"}},[n("a",{attrs:{role:"menuitem",tabindex:"0"},on:{click:function(e){return t.menuAction("add")},keyup:a}},[n("svg",{attrs:{viewBox:"0 0 24 24","aria-label":"Add"}},[n("path",{attrs:{d:"M17,13H13V17H11V13H7V11H11V7H13V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z"}})])])])])]}}],null,!1,3190783598)})]:t._e(),"multi-field"==t.config.type?[n("ol",{staticClass:"multi-field"},t._l(t.config.entries,(function(e,a){return n("li",{key:a},[n("metadata-field",{attrs:{config:e,parent:t.parent+t.config.path}})],1)})),0)]:t._e()],2)},L=[];n("c975"),n("a9e3"),n("25eb"),n("159b"),n("fb6a"),n("1276");function D(t,e){var n=e.split(".");while(t&&n.length>0){if("["===n[0][0]&&"]"===n[0][n[0].length-1]){var a=Number.parseInt(n[0].substring(1,n[0].length-1));a>=0&&a<t.length&&(t=t[a])}else t=t[n[0]];n=n.slice(1)}return t}var H=function(t){function e(){var t;return Object(s["a"])(this,e),t=Object(c["a"])(this,Object(l["a"])(e).apply(this,arguments)),t.addMenuItems=[{label:'<svg viewBox="0 0 24 24" aria-label="Add"><path d="M17,13H13V17H11V13H7V11H11V7H13V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z" /></svg>',action:"add"}],t}return Object(u["a"])(e,t),Object(o["a"])(e,[{key:"update",value:function(t){t&&t.target&&this.$store.commit("setMetadataValue",{path:this.$props.parent+this.$props.config.path,value:t.target.value})}},{key:"modifyMenuItems",value:function(t){return[{label:'<svg viewBox="0 0 24 24" aria-label="Move up"><path d="M19,3H5A2,2 0 0,0 3,5V19C3,20.11 3.9,21 5,21H19C20.11,21 21,20.11 21,19V5A2,2 0 0,0 19,3M16.59,15.71L12,11.12L7.41,15.71L6,14.29L12,8.29L18,14.29L16.59,15.71Z" /></svg>',action:"move-up:"+t,disabled:0===t},{label:'<svg viewBox="0 0 24 24" aria-label="Move down"><path d="M19,3H5A2,2 0 0,0 3,5V19C3,20.11 3.9,21 5,21H19C20.11,21 21,20.11 21,19V5A2,2 0 0,0 19,3M12,15.71L6,9.71L7.41,8.29L12,12.88L16.59,8.29L18,9.71L12,15.71Z" /></svg>',action:"move-down:"+t,disabled:t===this.value.length-1},{label:'<svg viewBox="0 0 24 24" aria-label="Delete"><path d="M17,13H7V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z" /></svg>',action:"delete:"+t}]}},{key:"menuAction",value:function(t){if("add"===t){var e={};this.$props.config.entries.forEach((function(t){var n=t.path;"."===n[0]&&(n=n.substring(1)),"single-text"===t.type?e[n]="":"multi-row"===t.type?e[n]=[]:"multi-field"===t.type&&t.entries.forEach((function(t){var n=t.path;"."===n[0]&&(n=n.substring(1)),"single-text"===t.type?e[n]="":"multi-row"===t.type&&(e[n]=[])}))})),this.$store.commit("addMetadataMuliRow",{path:this.$props.parent+this.$props.config.path,value:e})}else 0===t.indexOf("move-up:")?this.$store.commit("moveMetadataMultiRow",{path:this.$props.parent+this.$props.config.path,idx:Number.parseInt(t.substring(8)),move:-1}):0===t.indexOf("move-down:")?this.$store.commit("moveMetadataMultiRow",{path:this.$props.parent+this.$props.config.path,idx:Number.parseInt(t.substring(10)),move:1}):0===t.indexOf("delete:")&&this.$store.commit("removeMetadataMultiRow",{path:this.$props.parent+this.$props.config.path,value:Number.parseInt(t.substring(7))})}},{key:"value",get:function(){var t=D(this.$store.state.content[this.$store.state.settings.metadataSection],this.$props.parent+this.$props.config.path);return t||""}}]),e}(h["c"]);H=d["a"]([Object(h["a"])({components:{AriaMenubar:N},props:{config:Object,parent:{type:String,default:""}},name:"metadata-field"})],H);var P=H,I=P,R=Object(O["a"])(I,V,L,!1,null,null,null),B=R.exports,Z=function(t){function e(){return Object(s["a"])(this,e),Object(c["a"])(this,Object(l["a"])(e).apply(this,arguments))}return Object(u["a"])(e,t),e}(h["c"]);Z=d["a"]([Object(h["a"])({components:{MetadataField:B},props:{config:Object}})],Z);var F=Z,U=F,X=Object(O["a"])(U,$,C,!1,null,null,null),Y=X.exports,J=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"text-editor"},[n("editor-content",{attrs:{editor:t.editor}}),n("aria-menubar",{scopedSlots:t._u([{key:"default",fn:function(e){var a=e.keyboardNav;return[n("editor-menu-bar",{attrs:{editor:t.editor},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.commands;e.isActive,e.getMarkAttrs;return[n("div",{staticClass:"sidebar"},t._l(t.activeSidebar,(function(e,i){return n("div",{key:i,class:{"is-active":e.active}},[n("h2",[t._v(t._s(e.label))]),t._l(e.entities,(function(e,i){return["list"===e.type?n("ul",{key:i},t._l(e.entities,(function(e,a){return n("li",{key:a,attrs:{role:"presentation"}},[n("label",[n("span",{domProps:{innerHTML:t._s(e.label)}}),"setNodeAttrString"===e.type?n("input",{domProps:{value:e.value},on:{change:function(n){return t.setNodeAttributeValue(r,e.nodeType,e.attr,n.target.value)}}}):t._e()])])})),0):t._e(),"menubar"===e.type?n("ul",{key:i,attrs:{role:"menubar"}},t._l(e.entities,(function(e,i){return n("li",{key:i,class:"separator"===e.type?"separator":null,attrs:{role:"presentation"}},["setNodeType"===e.type?n("a",{attrs:{role:"menuitem",tabindex:e.tabindex,"aria-label":e.ariaLabel,title:e.ariaLabel,"aria-checked":e.checked},domProps:{innerHTML:t._s(e.label)},on:{keyup:a,click:function(t){r[e.nodeType]()}}}):"setNodeAttrValue"===e.type?n("a",{attrs:{role:"menuitem",tabindex:e.tabindex,"aria-label":e.ariaLabel,title:e.ariaLabel,"aria-checked":e.checked},domProps:{innerHTML:t._s(e.label)},on:{keyup:a,click:function(n){return t.setNodeAttributeValue(r,e.nodeType,e.attr,e.value)}}}):"selectNodeAttr"===e.type?n("select",{attrs:{role:"menuitem",tabindex:e.tabindex},on:{keyup:a,change:function(n){return t.setNodeAttributeValue(r,e.nodeType,e.attr,n.target.value)}}},t._l(e.values,(function(e){return n("option",{key:e.value,domProps:{value:e.value,selected:e.checked,innerHTML:t._s(e.label)}})})),0):"toggleMark"===e.type?n("a",{attrs:{role:"menuitem",tabindex:e.tabindex,"aria-label":e.ariaLabel,title:e.ariaLabel,"aria-checked":e.checked},domProps:{innerHTML:t._s(e.label)},on:{keyup:a,click:function(t){r[e.nodeType]()}}}):"selectMarkAttr"===e.type?n("select",{attrs:{role:"menuitem",tabindex:e.tabindex},on:{keyup:a,change:function(n){return t.setMarkAttributeValue(e.nodeType,e.attr,n.target.value)}}},t._l(e.values,(function(e){return n("option",{key:e.value,domProps:{value:e.value,selected:e.checked,innerHTML:t._s(e.label)}})})),0):"editNestedDoc"===e.type?n("a",{attrs:{role:"menuitem",tabindex:e.tabindex,"aria-label":e.ariaLabel,title:e.ariaLabel},domProps:{innerHTML:t._s(e.label)},on:{keyup:a,click:function(n){return t.editNestedDoc(r,e.nodeType,e.attr,e.targetType)}}}):"closeNested"===e.type?n("a",{attrs:{role:"menuitem",tabindex:e.tabindex,"aria-label":e.ariaLabel,title:e.ariaLabel},domProps:{innerHTML:t._s(e.label)},on:{keyup:a,click:t.closeNestedAction}}):"linkNestedDoc"===e.type?n("select",{attrs:{role:"menuitem",tabindex:e.tabindex},on:{keyup:a,change:function(n){return t.setNodeAttributeValue(r,e.nodeType,e.attr,n.target.value)}}},t._l(e.values,(function(e){return n("option",{key:e.value,domProps:{value:e.value,selected:e.checked,innerHTML:t._s(e.label)}})})),0):t._e()])})),0):t._e()]}))],2)})),0)]}}],null,!0)})]}}])}),t.showNested?n("div",{staticClass:"nested"},[n("text-editor",{attrs:{section:t.section,nestedSection:t.nestedSettings.section,nestedId:t.nestedSettings.id,closeNestedAction:t.closeNestedEditor}})],1):t._e()],1)},W=[],z=(n("4de4"),n("d81d"),n("a434"),n("b0c0"),n("4fad"),n("e439"),n("dbb4"),n("3835")),G=n("ade3"),q=n("cd42"),K=n("a9de"),Q=function(t){function e(t){var n;return Object(s["a"])(this,e),n=Object(c["a"])(this,Object(l["a"])(e).call(this)),n._config={},n._config=t,n}return Object(u["a"])(e,t),Object(o["a"])(e,[{key:"commands",value:function(t){var e,n=t.type;return e={},Object(G["a"])(e,n.name,(function(t){return Object(K["b"])(n,t)})),Object(G["a"])(e,n.name+"_setAttribute",(function(t){return Object(K["b"])(n,t)})),e}},{key:"name",get:function(){return this._config.name}},{key:"schema",get:function(){var t=this;return{content:"inline*",group:"block",draggable:!1,attrs:this._config.attrs,parseDOM:[{tag:"div.node-".concat(this._config.name),getAttrs:function(e){var n={};return t._config.attrs&&Object.keys(t._config.attrs).forEach((function(t){var a=e.getAttribute("data-".concat(t));a&&(n[t]=a)})),n}}],toDOM:function(e){var n={class:"node-".concat(t._config.name)};return Object.entries(e.attrs).forEach((function(t){var e=Object(z["a"])(t,2),a=e[0],r=e[1];n["data-".concat(a)]=r})),["div",n,0]}}}}]),e}(q["f"]),tt=n("986d"),et=n("0ac0"),nt=function(t){function e(t){var n;return Object(s["a"])(this,e),n=Object(c["a"])(this,Object(l["a"])(e).call(this)),n._config={},n._config=t,n}return Object(u["a"])(e,t),Object(o["a"])(e,[{key:"commands",value:function(t){var e=t.type,n=t.schema,a=n.nodes[this._config.content];return function(){return function(t,r){var i=t.selection,s=i.$from,o=i.$to,c=i.from,l=i.to,u=s.blockRange(o),d=u&&Object(et["i"])(u);if(!u||null===d)return!1;var h=Object(tt["findParentNode"])((function(t){return t.type===e}))(i);if(u.depth>=1&&h&&u.depth-h.depth<=1&&h.node.type===e){var f=t.tr.lift(u,d);return f=f.setBlockType(c,l,n.nodes.paragraph),r(f),!0}var p=t.tr.setBlockType(c,l,a);return p=p.wrap(u,[{type:e}]),r(p),!0}}}},{key:"name",get:function(){return this._config.name}},{key:"schema",get:function(){var t=this;return{content:this._config.content+"+",group:"block",draggable:!1,attrs:this._config.attrs,parseDOM:[{tag:"div.node-".concat(this._config.name),getAttrs:function(e){var n={};return t._config.attrs&&Object.keys(t._config.attrs).forEach((function(t){var a=e.getAttribute("data-".concat(t));a&&(n[t]=a)})),n}}],toDOM:function(e){var n={class:"node-".concat(t._config.name)};return Object.entries(e.attrs).forEach((function(t){var e=Object(z["a"])(t,2),a=e[0],r=e[1];n["data-".concat(a)]=r})),["div",n,0]}}}}]),e}(q["f"]),at=function(t){function e(t){var n;return Object(s["a"])(this,e),n=Object(c["a"])(this,Object(l["a"])(e).call(this)),n._config={},n._config=t,n}return Object(u["a"])(e,t),Object(o["a"])(e,[{key:"commands",value:function(t){var e,n=t.type;return e={},Object(G["a"])(e,n.name,(function(t){return function(e,a){var r=e.selection,i=r.$from,s=r.$to,o=r.from,c=r.to,l=!1;e.doc.nodesBetween(o,c,(function(t){t.type===n&&(l=!0)}));var u=i.parent.slice(i.parentOffset,s.parentOffset);return a(l?e.tr.replaceRange(o-1,c+1,u):e.tr.replaceRangeWith(o,c,n.create(t,u.content))),!0}})),Object(G["a"])(e,n.name+"_setAttribute",(function(t){return function(e,a){var r=e.selection,i=r.$from,s=r.$to,o=(r.from,r.to,i.blockRange(s));if(!o)return!1;var c=e.doc.slice(o.start+1,o.end-1);return a(e.tr.replaceRangeWith(o.start,o.end,n.create(t,c.content))),!0}})),e}},{key:"name",get:function(){return this._config.name}},{key:"schema",get:function(){var t=this;return{content:"inline*",group:"inline",inline:!0,attrs:this._config.attrs,parseDOM:[{tag:"span.node-".concat(this._config.name),getAttrs:function(e){var n={};return t._config.attrs&&Object.keys(t._config.attrs).forEach((function(t){var a=e.getAttribute("data-".concat(t));a&&(n[t]=a)})),n}}],toDOM:function(e){var n={class:"node-".concat(t._config.name)};return Object.entries(e.attrs).forEach((function(t){var e=Object(z["a"])(t,2),a=e[0],r=e[1];n["data-".concat(a)]=r})),["span",n,0]}}}}]),e}(q["f"]),rt=function(t){function e(t){var n;return Object(s["a"])(this,e),n=Object(c["a"])(this,Object(l["a"])(e).call(this)),n._config={},n._config=t,n}return Object(u["a"])(e,t),Object(o["a"])(e,[{key:"commands",value:function(t){var e=t.type;return function(){return Object(K["c"])(e)}}},{key:"name",get:function(){return this._config.name}},{key:"schema",get:function(){var t=this;return{attrs:this._config.attrs,parseDOM:[{tag:"span.mark-".concat(this._config.name),getAttrs:function(e){var n={};return t._config.attrs&&Object.keys(t._config.attrs).forEach((function(t){var a=e.getAttribute("data-".concat(t));a&&(n[t]=a)})),n}}],toDOM:function(e){var n={class:"mark-".concat(t._config.name)};return Object.entries(e.attrs).forEach((function(t){var e=Object(z["a"])(t,2),a=e[0],r=e[1];r&&(n["data-".concat(a)]=r)})),["span",n,0]}}}}]),e}(q["e"]);function it(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function st(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?it(Object(n),!0).forEach((function(e){Object(G["a"])(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ot=function(t){function e(){var t;return Object(s["a"])(this,e),t=Object(c["a"])(this,Object(l["a"])(e).apply(this,arguments)),t.editor=null,t.showNested=!1,t.nestedSettings=null,t.internalContentUpdate=!1,t.defaultNodeName="",t.sidebar=[],t}return Object(u["a"])(e,t),Object(o["a"])(e,[{key:"mounted",value:function(){var t=this,e=[new q["a"],new q["g"]];this.defaultNodeName="",this.schema.forEach((function(n){"block"===n.type?(e.push(new Q(n)),""===t.defaultNodeName&&(t.defaultNodeName=n.name)):"wrapping"===n.type?e.push(new nt(n)):"inline"===n.type&&"text"!==n.name?e.push(new at(n)):"mark"===n.type&&e.push(new rt(n))})),this.editor=new q["b"]({useBuiltInExtensions:!1,extensions:e,content:{type:"doc",content:[{type:this.defaultNodeName,content:[]}]},onUpdate:function(e){var n=e.getJSON;t.internalContentUpdate=!0,t.$props.nestedSection&&t.$props.nestedId?t.$store.commit("setTextDoc",{path:t.$props.section+".nestedId."+t.$props.nestedSection+"."+t.$props.nestedId,doc:n()}):t.$store.commit("setTextDoc",{path:t.$props.section+".doc",doc:n()})}}),this.doc&&this.editor.setContent(this.doc),this.editor.focus(),this.sidebar=this.ui.map((function(t){var e={label:t.label,active:!0};return t.condition&&(e.condition=t.condition.activeType),t.entities&&(e.entities=t.entities.map((function(t){var e={type:t.type};return t.entities&&(e.entities=t.entities.map((function(t,e){var n={type:t.type,label:t.label,nodeType:t.nodeType||t.markType,attr:t.attr,value:"",checked:"false",tabindex:0===e?0:-1,ariaLabel:t.ariaLabel};return"selectNodeAttr"===t.type||"selectMarkAttr"===t.type?n.values=t.values.map((function(t){return{label:t.label,value:t.value,checked:!1}})):"setNodeAttrValue"===t.type?n.value=t.value:"editNestedDoc"===t.type?n.targetType=t.targetNodeType:"linkNestedDoc"===t.type&&(n.targetType=t.targetNodeType,n.values=[]),n}))),e}))),e}))}},{key:"beforeDestroy",value:function(){this.editor&&this.editor.destroy()}},{key:"updateContent",value:function(t){!this.internalContentUpdate&&this.editor&&this.editor.setContent(t),this.internalContentUpdate=!1}},{key:"getNodeAttributeValue",value:function(t,e){for(var n=0;n<this.selectedNodes.length;n++){var a=this.selectedNodes[n];if(a.type.name===t&&void 0!==a.attrs[e]&&null!==a.attrs[e])return a.attrs[e]}return""}},{key:"hasNodeAttributeValue",value:function(t,e,n){return this.getNodeAttributeValue(t,e)===n}},{key:"setNodeAttributeValue",value:function(t,e,n,a){var r=this.editor.state.selection,i=r.from,s=r.to,o={};this.editor.state.doc.nodesBetween(i,s,(function(t){t.type.name===e&&(o=st({},o,{},t.attrs))})),o[n]=a,t[e+"_setAttribute"](o)}},{key:"getMarkAttributeValue",value:function(t,e){for(var n=0;n<this.selectedNodes.length;n++){var a=this.selectedNodes[n];if(a.marks)for(var r=0;r<a.marks.length;r++){var i=a.marks[r];if(i.type.name===t)return i.attrs[e]}}return""}},{key:"hasMarkAttributeValue",value:function(t,e,n){return this.getMarkAttributeValue(t,e)===n}},{key:"setMarkAttributeValue",value:function(t,e,n){if(n){var a=this.editor.state.selection,r=a.from,i=a.to,s={};this.editor.state.doc.nodesBetween(r,i,(function(e){e.marks&&e.marks.forEach((function(e){e.type.name===t&&(s=st({},s,{},e.attrs))}))})),s[e]=n,Object(K["d"])(this.editor.schema.marks[t],s)(this.editor.state,this.editor.dispatchTransaction.bind(this.editor))}else Object(K["a"])(this.editor.schema.marks[t])(this.editor.state,this.editor.dispatchTransaction.bind(this.editor))}},{key:"editNestedDoc",value:function(t,e,n,a){var r=this.getNodeAttributeValue(e,n);if(!r){var i=this.$store.state.content[this.$props.section].nested[a];r=a+"-1";var s=1;while(i&&i[r])s+=1,r=a+"-"+s;this.setNodeAttributeValue(t,e,n,r),this.$store.commit("addNestedDoc",{path:this.$props.section+".nested."+a+"."+r,doc:{type:"doc",content:[{type:"paragraph",content:[]}]}})}this.showNested=!0,this.nestedSettings={section:a,id:r}}},{key:"closeNestedEditor",value:function(){this.showNested=!1,this.nestedSettings=null}},{key:"schema",get:function(){return this.$store.state.sections[this.$props.section].schema}},{key:"content",get:function(){return this.$store.state.content[this.$props.section]}},{key:"doc",get:function(){if(this.content){if(!this.$props.nestedSection||!this.$props.nestedId)return this.content.doc;if(this.content.nested&&this.content.nested[this.$props.nestedSection]&&this.content.nested[this.$props.nestedSection][this.$props.nestedId])return this.content.nested[this.$props.nestedSection][this.$props.nestedId].content[0]}return null}},{key:"ui",get:function(){return this.$props.nestedSection&&this.$store.state.sections[this.$props.section].ui[this.$props.nestedSection]?this.$store.state.sections[this.$props.section].ui[this.$props.nestedSection]:this.$store.state.sections[this.$props.section].ui.doc}},{key:"selectedNodes",get:function(){if(this.editor){var t=this.editor.state.selection,e=t.from,n=t.to,a=[];return this.editor.state.doc.nodesBetween(e,n,(function(t){a.push(t)})),a}return[]}},{key:"activeSidebar",get:function(){var t=this,e=this.editor.isActive;return this.sidebar.forEach((function(n){n.condition&&(n.active=e[n.condition]()),n.entities.forEach((function(n){n.entities.forEach((function(n){"setNodeAttrString"===n.type?n.value=t.getNodeAttributeValue(n.nodeType,n.attr):"setNodeType"===n.type||"toggleMark"===n.type?n.checked=e[n.nodeType]()?"true":"false":"setNodeAttrValue"===n.type?n.checked=t.hasNodeAttributeValue(n.nodeType,n.attr,n.value)?"true":"false":"selectNodeAttr"===n.type?n.values.forEach((function(e){e.checked=!!t.hasNodeAttributeValue(n.nodeType,n.attr,e.value)})):"selectMarkAttr"===n.type?n.values.forEach((function(e){e.checked=!!t.hasMarkAttributeValue(n.nodeType,n.attr,e.value)})):"linkNestedDoc"===n.type&&(t.nestedDocIds[n.targetType]?(n.values=t.nestedDocIds[n.targetType],n.values.forEach((function(e){e.checked=t.hasNodeAttributeValue(n.nodeType,n.attr,e.value)}))):n.values=[{label:"New",value:"",checked:!1}])}))}))})),this.sidebar}},{key:"nestedDocIds",get:function(){var t={};return Object.entries(this.$store.state.content[this.$props.section].nested).forEach((function(e){var n=Object(z["a"])(e,2),a=n[0],r=n[1];t[a]=Object.keys(r).map((function(t){return{label:t,value:t,checked:!1}})),t[a].splice(0,0,{label:"New",value:"",checked:!1})})),t}}]),e}(h["c"]);d["a"]([Object(h["b"])({type:String})],ot.prototype,"section",void 0),d["a"]([Object(h["b"])({type:String})],ot.prototype,"nestedSection",void 0),d["a"]([Object(h["b"])({type:String})],ot.prototype,"nestedId",void 0),d["a"]([Object(h["b"])({type:Function})],ot.prototype,"closeNestedAction",void 0),d["a"]([Object(h["d"])("doc")],ot.prototype,"updateContent",null),ot=d["a"]([Object(h["a"])({components:{EditorContent:q["c"],EditorMenuBar:q["d"],AriaMenubar:N},name:"text-editor"})],ot);var ct=ot,lt=ct,ut=Object(O["a"])(lt,J,W,!1,null,null,null),dt=ut.exports,ht=(n("99af"),n("a15b"),n("4e82"),n("25f0"),n("6062"),n("5319"),n("53ca")),ft=function(){function t(){Object(s["a"])(this,t)}return Object(o["a"])(t,[{key:"serialise",value:function(t,e){var n=this,a={node:"tei:TEI",attrs:{"xmlns:tei":["http://www.tei-c.org/ns/1.0"]},children:[]};Object.entries(e).forEach((function(e){var r=Object(z["a"])(e,2),i=r[0],s=r[1];"MetadataEditor"===s.type&&n.mergeTrees(a,n.serialiseHeader(t[i],s))})),Object.entries(e).forEach((function(e){var r=Object(z["a"])(e,2),i=r[0],s=r[1];"TextEditor"===s.type&&n.mergeTrees(a,n.serialiseSingleText(t[i],s))}));var r=this.toString(a,"");return r.splice(0,0,'<?xml version="1.0" encoding="UTF-8"?>'),r.push(""),r.join("\n")}},{key:"mergeTrees",value:function(t,e){if(t&&e)for(var n=0;n<e.children.length;n++){for(var a=!1,r=0;r<t.children.length;r++)t.children[r].node===e.children[n].node&&this.objectsMatch(t.children[r].attrs,e.children[n].attrs)&&(this.mergeTrees(t.children[r],e.children[n]),a=!0);a||t.children.push(e.children[n])}}},{key:"objectsMatch",value:function(t,e){var n=this;if(t&&e){if(Object(ht["a"])(t)!==Object(ht["a"])(e))return!1;if("string"===typeof t||"number"===typeof t||"boolean"===typeof t)return t===e;var a=Object.keys(t),r=Object.keys(e);return a.forEach((function(a){return!(r.indexOf(a)<0)&&(!!n.objectsMatch(t[a],e[a])&&void r.splice(r.indexOf(a),1))})),!(r.length>0)}return!t&&!e}},{key:"serialiseSingleText",value:function(t,e){var n=this;if(t){var a=e.serialiser.tag.split("/");this.nested={};var r={node:a[a.length-1],children:t.doc.content.map((function(t){return n.serialiseTextNode(t,e.schema)})),attrs:{}};e.serialiser.attrs&&Object.entries(e.serialiser.attrs).forEach((function(t){var e=Object(z["a"])(t,2),n=e[0],a=e[1];r.attrs[n]?r.attrs[n].push(a):r.attrs[n]=[a]})),Object.entries(this.nested).forEach((function(a){var i=Object(z["a"])(a,2),s=i[0],o=i[1];new Set(o).forEach((function(a){t.nested[s]&&t.nested[s][a]&&r.children.push(n.serialiseTextNode(t.nested[s][a],e.schema))}))}));for(var i=a.length-2;i>=0;i--)r={node:a[i],children:[r]};return{node:"tei:TEI",children:[r]}}return null}},{key:"serialiseTextNode",value:function(t,e){var n=this,a=e.filter((function(e){return e.name===t.type&&e.serialiser}));if(1===a.length){a=a[0];var r={node:a.serialiser.tag,attrs:{},children:[],text:null};if(a.serialiser.attrs&&Object.entries(a.serialiser.attrs).forEach((function(t){r.attrs[t[0]]=[t[1]]})),t.attrs&&Object.entries(t.attrs).forEach((function(t){var e=a.attrs[t[0]].serialiser;if(e){var n=void 0;e.values?e.values[t[1]]&&(n=e.values[t[1]]):n=e.value?e.value.replace("{value}",t[1]):t[1],void 0!==n&&("text()"===e.attr?r.text=n:r.attrs[e.attr]?r.attrs[e.attr].push(n):r.attrs[e.attr]=[n])}})),"inline"===a.type){if(t.content)if(t.content.length>1||t.content[0].marks&&t.content[0].marks.length>0)t.content.forEach((function(t){r.children.push(n.serialiseTextNode(t,e))}));else{var i=this.serialiseTextNode(t.content[0],e);a.serialiser.text?r.attrs[a.serialiser.text.attr]?r.attrs[a.serialiser.text.attr].push(i.text):r.attrs[a.serialiser.text.attr]=[i.text]:r.text=i.text}else t.text&&(a.serialiser.text?r.attrs[a.serialiser.text.attr]?r.attrs[a.serialiser.text.attr].push(t.text):r.attrs[a.serialiser.text.attr]=[t.text]:r.text=t.text);if(t.marks){var s=t.marks.map((function(t){var n=e.filter((function(e){return e.name===t.type&&e.serialiser}));if(1===n.length){n=n[0];var a={node:r.node,attrs:{}},i=n.serialiser;return i.tag&&(a.node=i.tag),i.attrs&&Object.entries(i.attrs).forEach((function(t){t[1].value&&(a.attrs[t[0]]?a.attrs[t[0]].push(t[1].value):a.attrs[t[0]]=[t[1].value])})),t.attrs&&Object.entries(t.attrs).forEach((function(t){var e=void 0;n.attrs[t[0]].serialiser.value?e=n.attrs[t[0]].serialiser.value.replace("{value}",t[1]):n.attrs[t[0]].serialiser.values&&n.attrs[t[0]].serialiser.values[t[1]]&&(e=n.attrs[t[0]].serialiser.values[t[1]]),void 0!==e&&(a.attrs[n.attrs[t[0]].serialiser.attr]?a.attrs[n.attrs[t[0]].serialiser.attr].push(e):a.attrs[n.attrs[t[0]].serialiser.attr]=[e])})),a}return null})).filter((function(t){return t}));if(new Set(s.map((function(t){return t.node}))).size>1){s.sort((function(t,e){return t.node<e.node?-1:t.node>e.node?1:t.node===e.node?0:void 0}));var o=r;o.node=null,s.forEach((function(t){if(null===o.node||o.node===t.node)o.node=t.node,Object.entries(t.attrs).forEach((function(t){o.attrs[t[0]]?o.attrs[t[0]]=o.attrs[t[0]].concat(t[1]):o.attrs[t[0]]=t[1]}));else{var e={node:t.node,attrs:t.attrs,children:[],text:o.text};o.text=null,o.children.push(e),o=e}}))}else s.forEach((function(t){t&&(t.node&&(r.node=t.node),t.attrs&&Object.entries(t.attrs).forEach((function(t){r.attrs[t[0]]?r.attrs[t[0]]=r.attrs[t[0]].concat(t[1]):r.attrs[t[0]]=t[1]})))}))}}else t.content&&t.content.forEach((function(t){"doc"===t.type?t.content&&t.content.forEach((function(t){r.children.push(n.serialiseTextNode(t,e))})):r.children.push(n.serialiseTextNode(t,e))}));return a.reference&&(this.nested[a.reference.type]||(this.nested[a.reference.type]=[]),this.nested[a.reference.type].push(t.attrs[a.reference.attr])),r.children.length>0||r.text||Object.keys(r.attrs).length>0?r:null}return null}},{key:"serialiseHeader",value:function(t,e){var n=this;return{node:"tei:TEI",children:[{node:"tei:teiHeader",children:e.schema.map((function(e){return n.serialiseMetadataNode(t[e.tag.substring(4)],e)}))}]}}},{key:"serialiseMetadataNode",value:function(t,e){var n=this;if(e.multiple){var a=t.map((function(t){var a={node:e.tag};if(t._text&&(a.text=t._text),t._attrs&&(a.attrs={},Object.entries(t._attrs).forEach((function(t){a.attrs[t[0]]=[t[1]]}))),e.children){a.children=[];for(var r=0;r<e.children.length;r++)if(t[e.children[r].tag.substring(4)]){var i=n.serialiseMetadataNode(t[e.children[r].tag.substring(4)],e.children[r]);Array.isArray(i)?a.children=a.children.concat(i):a.children.push(i)}}return a}));return a}var r={node:e.tag};if(t&&(t._text&&(r.text=t._text),t._attrs&&(r.attrs={},Object.entries(t._attrs).forEach((function(t){r.attrs[t[0]]=[t[1]]}))),e.children)){r.children=[];for(var i=0;i<e.children.length;i++)if(t[e.children[i].tag.substring(4)]){var s=this.serialiseMetadataNode(t[e.children[i].tag.substring(4)],e.children[i]);Array.isArray(s)?r.children=r.children.concat(s):r.children.push(s)}}return r}},{key:"toString",value:function(t,e){var n=this;function a(t){return t.replace("&","&").replace("<","<").replace(">",">")}var r=[];if(t){var i=[e,"<",t.node];t.attrs&&Object.entries(t.attrs).forEach((function(t){t[1].length>0&&(t[1].sort(),i.push(" "+t[0]+'="'+a(t[1].join(" "))+'"'))})),t.children&&t.children.length>0?(i.push(">"),r.push(i.join("")),t.children.forEach((function(t){r=r.concat(n.toString(t,e+" "))})),r.push(e+"</"+t.node+">")):(t.text?(i.push(">"),i.push(a(t.text)),i.push("</"+t.node+">")):i.push("/>"),r.push(i.join("")))}return r}}]),t}(),pt=function(t){function e(){var t;return Object(s["a"])(this,e),t=Object(c["a"])(this,Object(l["a"])(e).apply(this,arguments)),t.currentSection=null,t}return Object(u["a"])(e,t),Object(o["a"])(e,[{key:"setCurrentSection",value:function(t){this.currentSection=t}},{key:"getContentForSection",value:function(t){return D(this.$store.state.content,t)}},{key:"setContentForSection",value:function(t,e){this.$store.commit("setTextDoc",{path:t,doc:e})}},{key:"mounted",value:function(){var t=Object.keys(this.sections);t.length>0&&(this.currentSection=t[0])}},{key:"save",value:function(){if(this.hasSaveCallback){var t=new ft;this.$store.state.callbacks.save(t.serialise(this.$store.state.content,this.$store.state.sections))}}},{key:"load",value:function(){var t=this;this.hasLoadCallback&&this.$store.state.callbacks.load((function(e){t.$store.dispatch("load",e)}))}},{key:"updateSections",value:function(){var t=Object.keys(this.sections);t.length>0&&(this.currentSection=t[0])}},{key:"sections",get:function(){return this.$store.state.sections}},{key:"hasSaveCallback",get:function(){return!!this.$store.state.callbacks.save}},{key:"hasLoadCallback",get:function(){return!!this.$store.state.callbacks.load}}]),e}(h["c"]);d["a"]([Object(h["d"])("sections")],pt.prototype,"updateSections",null),pt=d["a"]([Object(h["a"])({components:{AriaMenubar:N,AriaMenu:T,MetadataEditor:Y,TextEditor:dt}})],pt);var vt=pt,bt=vt,gt=(n("e215"),Object(O["a"])(bt,f,p,!1,null,null,null)),yt=gt.exports,mt=function(t){function e(){return Object(s["a"])(this,e),Object(c["a"])(this,Object(l["a"])(e).apply(this,arguments))}return Object(u["a"])(e,t),Object(o["a"])(e,[{key:"mounted",value:function(){var t=this,e=document.getElementById("TEIEditorConfig");if(e){var n=JSON.parse(e.innerHTML);n&&this.$store.commit("init",n)}this.$store.state.callbacks&&this.$store.state.callbacks.autoLoad&&this.$store.state.callbacks.autoLoad((function(e){t.$store.dispatch("load",e)}))}}]),e}(h["c"]);mt=d["a"]([Object(h["a"])({components:{TeiEditor:yt}})],mt);var kt=mt,Ot=kt,xt=Object(O["a"])(Ot,r,i,!1,null,null,null),jt=xt.exports,Nt=n("2f62");function At(t){return"tei"===t?"http://www.tei-c.org/ns/1.0":"xml"===t?"http://www.w3.org/XML/1998/namespace":"http://www.tei-c.org/ns/1.0"}var _t=function(){function t(e){Object(s["a"])(this,t),this.dom=e}return Object(o["a"])(t,[{key:"evaluate",value:function(t,e,n){return this.dom.evaluate(e,t,At,n,null)}},{key:"firstNode",value:function(t,e){return this.evaluate(t,e,XPathResult.FIRST_ORDERED_NODE_TYPE).singleNodeValue}},{key:"nodeIterator",value:function(t,e){return this.evaluate(t,e,XPathResult.ORDERED_NODE_ITERATOR_TYPE)}},{key:"stringValue",value:function(t,e){return this.evaluate(t,e,XPathResult.STRING_TYPE).stringValue}},{key:"booleanValue",value:function(t,e){return this.evaluate(t,e,XPathResult.BOOLEAN_TYPE).booleanValue}},{key:"numberValue",value:function(t,e){return this.evaluate(t,e,XPathResult.NUMBER_TYPE).numberValue}}]),t}(),Mt=function(){function t(e,n){Object(s["a"])(this,t),this.dom=e,this.xpath=new _t(this.dom),this.config=n}return Object(o["a"])(t,[{key:"get",value:function(){if(!this.data){var t=this.xpath.firstNode(this.dom.documentElement,"/tei:TEI/tei:teiHeader");this.data={};for(var e=0;e<this.config.schema.length;e++){var n=this.parseHeaderNode(t,this.config.schema[e]);n&&(this.data[this.config.schema[e].tag.substring(4)]=n)}}return this.data}},{key:"parseHeaderNode",value:function(t,e){var n=this.xpath.nodeIterator(t,e.tag),a=[],r=n.iterateNext();while(r){for(var i={_attrs:{},_text:0===r.children.length?this.xpath.stringValue(r,"text()"):null},s=0;s<r.attributes.length;s++)i._attrs[r.attributes[s].name]=r.attributes[s].value;if(e.children)for(var o=0;o<e.children.length;o++){var c=this.parseHeaderNode(r,e.children[o]);c&&(i[e.children[o].tag.substring(e.children[o].tag.indexOf(":")+1)]=c)}a.push(i),r=n.iterateNext()}return 0===a.length?null:e.multiple?a:a[0]}}]),t}(),Et=function(){function t(e,n){Object(s["a"])(this,t),this.dom=e,this.xpath=new _t(this.dom),this.config=n}return Object(o["a"])(t,[{key:"get",value:function(){if(!this.doc&&(this.doc={type:"doc",content:[]},this.nestedDocs={},this.config.parser&&this.config.parser.selector)){var t=this.xpath.firstNode(this.dom.documentElement,this.config.parser.selector);if(t)for(var e=0;e<t.children.length;e++){var n=this.parseContentNode(t.children[e],this.config);n&&!n.nestedDoc?this.doc.content.push(n):n&&n.nestedDoc&&this.addNestedDoc(n)}}return[this.doc,this.nestedDocs]}},{key:"parseContentAttributes",value:function(t,e){var n=this,a={};return Object.entries(e).forEach((function(e){var r=Object(z["a"])(e,2),i=r[0],s=r[1],o=[];s.parser?o.push(s.parser):s.parsers&&(o=s.parsers);for(var c=0;c<o.length;c++){var l=o[c];if("boolean"===l.type)a[i]=n.xpath.booleanValue(t,l.selector);else if("number"===l.type)try{a[i]=n.xpath.numberValue(t,l.selector)}catch(d){console.log(d)}else if("static"===l.type)n.xpath.booleanValue(t,l.selector)&&(a[i]=l.value);else try{var u=n.xpath.stringValue(t,l.selector);u&&(a[i]=u)}catch(d){console.log(d)}}})),a}},{key:"parseContentMarks",value:function(t,e){var n=this,a=[];return e.forEach((function(e){if("mark"===e.type){var r=[];e.parser?r.push(e.parser):e.parsers&&(r=e.parsers);for(var i=0;i<r.length;i++)if(n.xpath.booleanValue(t,r[i].selector)){var s={type:e.name};e.attrs&&(s.attrs=n.parseContentAttributes(t,e.attrs)),a.push(s)}}})),a}},{key:"parseContentNode",value:function(t,e){for(var n=Object.entries(e.schema),a=0;a<n.length;a++){var r=n[a][1],i=[];r.parser?i.push(r.parser):r.parsers&&(i=i.concat(r.parsers));for(var s=0;s<i.length;s++){var o=i[s];if(null!==this.xpath.firstNode(t,"self::"+o.selector)){var c={type:r.name};if(r.attrs&&(c.attrs=this.parseContentAttributes(t,r.attrs)),"nested"===r.type&&(c.nestedDoc=!0),"inline"===r.type)if("text"===r.name){if(c.text=this.xpath.stringValue(t,o.text),c.marks=this.parseContentMarks(t,e.schema),1===t.children.length){var l=this.parseContentNode(t.children[0],e);l.text&&""!==l.text&&(c.text=l.text),c.marks=c.marks.concat(l.marks)}}else if(0===t.children.length)this.xpath.stringValue(t,o.text)&&(c.content=[{type:"text",text:this.xpath.stringValue(t,o.text),marks:this.parseContentMarks(t,e.schema)}]);else{for(var u=[],d=0;d<t.children.length;d++){var h=this.parseContentNode(t.children[d],e);h&&u.push(h)}c.content=u}else{for(var f=[],p=0;p<t.children.length;p++){var v=this.parseContentNode(t.children[p],e);v&&!v.nestedDoc?f.push(v):v&&v.nestedDoc&&this.addNestedDoc(v)}c.content=f}return c}}}return null}},{key:"addNestedDoc",value:function(t){if(t.attrs&&t.attrs.id){this.nestedDocs[t.type]||(this.nestedDocs[t.type]={}),this.nestedDocs[t.type][t.attrs.id]=t;var e={type:"doc",content:t.content};t.content=[e]}}}]),t}();function wt(t){if(void 0!==t){if(null===t)return null;if(Array.isArray(t))return t.map((function(t){return wt(t)}));if("object"===Object(ht["a"])(t)){var e={};return Object.keys(t).forEach((function(n){e[n]=wt(t[n])})),e}return t}}a["a"].use(Nt["a"]);var St={settings:{metadataSection:""},sections:{},content:{},callbacks:{save:void 0,load:void 0,autoLoad:void 0}},Tt=new Nt["a"].Store({state:St,mutations:{init:function(t,e){t.sections=e.sections,Object.keys(e.sections).forEach((function(n,r){"MetadataEditor"===e.sections[n].type&&(t.settings.metadataSection=n),a["a"].set(t.content,n,{}),a["a"].set(t.content[n],"doc",null),a["a"].set(t.content[n],"nested",{})})),window.TEIEditor&&window.TEIEditor.callbacks&&(a["a"].set(t.callbacks,"save",window.TEIEditor.callbacks.save),a["a"].set(t.callbacks,"load",window.TEIEditor.callbacks.load),a["a"].set(t.callbacks,"autoLoad",window.TEIEditor.callbacks.autoLoad))},setMetadata:function(t,e){a["a"].set(t.content,t.settings.metadataSection,e)},setMetadataValue:function(t,e){var n=t.content[t.settings.metadataSection];if(n){n=wt(n);var r=n,i=e.path.split(".");while(i.length>0){var s=i[0];if("["===s[0]&&"]"===s[s.length-1]&&Array.isArray(r)){var o=Number.parseInt(s.substring(1,s.length-1));o>=0&&o<r.length&&(i.length>1?r=r[o]:r[o]=e.value)}else r[s]?i.length>1?r=r[s]:r[s]=e.value:i.length>1?(r[s]={},r=r[s]):r[s]=e.value;i.splice(0,1)}a["a"].set(t.content,t.settings.metadataSection,n)}},addMetadataMuliRow:function(t,e){var n=t.content[t.settings.metadataSection];if(n){n=wt(n);var r=D(n,e.path);r&&(r.push(e.value),a["a"].set(t.content,t.settings.metadataSection,n))}},removeMetadataMultiRow:function(t,e){var n=t.content[t.settings.metadataSection];if(n){n=wt(n);var r=D(n,e.path);r&&e.value>=0&&e.value<r.length&&(r.splice(e.value,1),a["a"].set(t.content,t.settings.metadataSection,n))}},moveMetadataMultiRow:function(t,e){var n=t.content[t.settings.metadataSection];if(n){n=wt(n);var r=D(n,e.path);if(r&&e.idx>=0&&e.idx<r.length&&e.idx+e.move>=0&&e.idx+e.move<r.length){var i=r[e.idx];r.splice(e.idx,1),r.splice(e.idx+e.move,0,i),a["a"].set(t.content,t.settings.metadataSection,n)}}},setTextDoc:function(t,e){var n=e.path.split(".");2===n.length?a["a"].set(t.content[n[0]],n[1],e.doc):4===n.length&&a["a"].set(t.content[n[0]].nested[n[2]][n[3]],"content",[e.doc])},addNestedDoc:function(t,e){var n=e.path.split(".");4===n.length&&(t.content[n[0]].nested[n[2]]||a["a"].set(t.content[n[0]].nested,n[2],{}),a["a"].set(t.content[n[0]].nested[n[2]],n[3],{attrs:{id:n[3]},content:[e.doc],nestedDoc:!0,type:n[2]}))}},actions:{load:function(t,e){var n=t.commit,r=t.state,i=new DOMParser,s=i.parseFromString(e,"application/xml");a["a"].set(r,"content",{}),Object.keys(r.sections).forEach((function(t,e){a["a"].set(r.content,t,{}),a["a"].set(r.content[t],"doc",null),a["a"].set(r.content[t],"nested",{})})),Object.entries(r.sections).forEach((function(t){var e=Object(z["a"])(t,2),a=e[0],r=e[1];if("MetadataEditor"===r.type)n("setMetadata",new Mt(s,r).get());else if("TextEditor"===r.type){var i=new Et(s,r).get(),o=Object(z["a"])(i,2),c=o[0],l=o[1];n("setTextDoc",{path:a+".doc",doc:c}),Object.entries(l).forEach((function(t){var e=Object(z["a"])(t,2),r=e[0],i=e[1];Object.entries(i).forEach((function(t){var e=Object(z["a"])(t,2),i=e[0],s=e[1];n("addNestedDoc",{path:a+".nested."+r+"."+i,doc:s.content[0]})}))}))}}))}},modules:{}});a["a"].config.productionTip=!1,new a["a"]({store:Tt,render:function(t){return t(jt)}}).$mount("#app")},e215:function(t,e,n){"use strict";var a=n("ba8f"),r=n.n(a);r.a}}); //# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/package.json b/package.json index 4f2e4ef44ca838fc695fe66f1a9c94b45f46dca9..a2f6e4f945fd759cb0779854f50a99e1c9b4f393 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "gulp-concat": "^2.6.1", "gulp-sass": "^4.0.2", "pump": "^3.0.0", - "tei-editor": "^0.5.0" + "tei-editor": "^0.6.0" }, "browserslist": [ "last 2 versions", diff --git a/yarn.lock b/yarn.lock index 7f866b202aaff7a0303edc3d5fc96845748a8a82..78569a838a0809a2c295edaeda5ebeb02eee57b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -467,11 +467,6 @@ chokidar@^2.0.0: optionalDependencies: fsevents "^1.2.7" -chownr@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.3.tgz#42d837d5239688d55f303003a508230fa6727142" - integrity sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw== - class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" @@ -660,13 +655,6 @@ debug@^2.2.0, debug@^2.3.3: dependencies: ms "2.0.0" -debug@^3.2.6: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -677,11 +665,6 @@ decode-uri-component@^0.2.0: resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - default-compare@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/default-compare/-/default-compare-1.0.0.tgz#cb61131844ad84d84788fb68fd01681ca7781a2f" @@ -738,11 +721,6 @@ detect-file@^1.0.0: resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= - duplexify@^3.6.0: version "3.7.1" resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" @@ -1025,13 +1003,6 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" -fs-minipass@^1.2.5: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" - integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== - dependencies: - minipass "^2.6.0" - fs-mkdirp-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz#0b7815fc3201c6a69e14db98ce098c16935259eb" @@ -1363,20 +1334,6 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" -iconv-lite@^0.4.4: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore-walk@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.3.tgz#017e2447184bfeade7c238e4aefdd1e8f95b1e37" - integrity sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw== - dependencies: - minimatch "^3.0.4" - in-publish@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/in-publish/-/in-publish-2.0.0.tgz#e20ff5e3a2afc2690320b6dc552682a9c7fadf51" @@ -1402,7 +1359,7 @@ inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -ini@^1.3.4, ini@~1.3.0: +ini@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== @@ -1865,26 +1822,11 @@ minimist@0.0.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= -minimist@^1.1.3, minimist@^1.2.0: +minimist@^1.1.3: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= -minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" - integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.2.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" - integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== - dependencies: - minipass "^2.9.0" - mixin-deep@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" @@ -1905,11 +1847,6 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= -ms@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - mute-stdout@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" @@ -1937,15 +1874,6 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -needle@^2.2.1: - version "2.4.0" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.4.0.tgz#6833e74975c444642590e15a750288c5f939b57c" - integrity sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg== - dependencies: - debug "^3.2.6" - iconv-lite "^0.4.4" - sax "^1.2.4" - next-tick@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" @@ -1969,22 +1897,6 @@ node-gyp@^3.8.0: tar "^2.0.0" which "1" -node-pre-gyp@*: - version "0.14.0" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83" - integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA== - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4.4.2" - node-releases@^1.1.46: version "1.1.47" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.47.tgz#c59ef739a1fd7ecbd9f0b7cf5b7871e8a8b591e4" @@ -2022,14 +1934,6 @@ node-sass@^4.8.3: dependencies: abbrev "1" -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= - dependencies: - abbrev "1" - osenv "^0.1.4" - normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -2064,28 +1968,7 @@ now-and-later@^2.0.0: dependencies: once "^1.3.2" -npm-bundled@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.1.tgz#1edd570865a94cdb1bc8220775e29466c9fb234b" - integrity sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA== - dependencies: - npm-normalize-package-bin "^1.0.1" - -npm-normalize-package-bin@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2" - integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== - -npm-packlist@^1.1.6: - version "1.4.8" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.8.tgz#56ee6cc135b9f98ad3d51c1c95da22bbb9b2ef3e" - integrity sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A== - dependencies: - ignore-walk "^3.0.1" - npm-bundled "^1.0.1" - npm-normalize-package-bin "^1.0.1" - -"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.0, npmlog@^4.0.2: +"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.0: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== @@ -2215,7 +2098,7 @@ os-tmpdir@^1.0.0: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= -osenv@0, osenv@^0.1.4: +osenv@0: version "0.1.5" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== @@ -2465,9 +2348,9 @@ prosemirror-view@1.13.4: prosemirror-transform "^1.1.0" prosemirror-view@^1.0.0, prosemirror-view@^1.1.0, prosemirror-view@^1.13.3: - version "1.13.8" - resolved "https://registry.yarnpkg.com/prosemirror-view/-/prosemirror-view-1.13.8.tgz#ee0998f67edb95d8558e76fb289641deacf68b4f" - integrity sha512-gz3msc9ocWo0m7PxCeNTLxaBZ8VSD9J+A/x16GwXnROAtyKalEMvZInwk+lH2kIEIM3tC/m90xe5U/vf+vM9IA== + version "1.13.11" + resolved "https://registry.yarnpkg.com/prosemirror-view/-/prosemirror-view-1.13.11.tgz#2a284ccb290720242f4aae49f99d67d1109f0194" + integrity sha512-/PISZHY3HeTZGR+ptbK7HP4wTuxZa0WJCsNMDVC8z98YW+uMwl5ZpiO+FBDAHNYPas0+SUxNu2C547hcRjQLkw== dependencies: prosemirror-model "^1.1.0" prosemirror-state "^1.0.0" @@ -2523,16 +2406,6 @@ qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -2725,7 +2598,7 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -rimraf@2, rimraf@^2.6.1: +rimraf@2: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -2749,7 +2622,7 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== @@ -2764,11 +2637,6 @@ sass-graph@^2.2.4: scss-tokenizer "^0.2.3" yargs "^7.0.0" -sax@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== - scss-tokenizer@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz#8eb06db9a9723333824d3f5530641149847ce5d1" @@ -2784,7 +2652,7 @@ semver-greatest-satisfied-range@^1.1.0: dependencies: sver-compat "^1.5.0" -"semver@2 || 3 || 4 || 5", semver@^5.3.0: +"semver@2 || 3 || 4 || 5": version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -3024,11 +2892,6 @@ strip-indent@^1.0.1: dependencies: get-stdin "^4.0.1" -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" @@ -3065,23 +2928,10 @@ tar@^2.0.0: fstream "^1.0.12" inherits "2" -tar@^4.4.2: - version "4.4.13" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" - integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.8.6" - minizlib "^1.2.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.3" - -tei-editor@^0.5.0: - version "0.5.2" - resolved "https://registry.yarnpkg.com/tei-editor/-/tei-editor-0.5.2.tgz#8d9111911838809efddf9e7bffaf851f1811ad7d" - integrity sha512-gW7NlAXHGMp6Z7YO+NFJa1+4ZMYijK7My0WB10uaJU3oWt7wIq+ZfZXomC2XvwwPmBAhM51vc2k9/CWYHHETbQ== +tei-editor@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tei-editor/-/tei-editor-0.6.0.tgz#6e6c6f50783202b365486ccb133eb76f8f3a42a2" + integrity sha512-2TP9LaZYXbxjjU33VCpt8GcAE6fGfFbN7lwJ6SYJEFed934YnEH95CIMA1VC0dGCo+p2zra5UKHHcNu/hXG4Fw== dependencies: "@types/prosemirror-model" "^1.7.2" "@types/prosemirror-state" "^1.2.3" @@ -3488,11 +3338,6 @@ yallist@^2.1.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= -yallist@^3.0.0, yallist@^3.0.3: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - yargs-parser@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a"