"),a}},function(t,e,n){"use strict";var r=n(42),i=n(98),o="function"==typeof Symbol&&"symbol"==typeof Symbol(),s=Object.prototype.toString,a=Object.defineProperty&&function(){var t={};try{for(var e in Object.defineProperty(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch(t){return!1}}(),u=function(t,e,n,r){var i;e in t&&("function"!=typeof(i=r)||"[object Function]"!==s.call(i)||!r())||(a?Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)},c=function(t,e){var n=arguments.length>2?arguments[2]:{},s=r(e);o&&(s=s.concat(Object.getOwnPropertySymbols(e))),i(s,function(r){u(t,r,e[r],n[r])})};c.supportsDescriptors=!!a,t.exports=c},function(t,e,n){"use strict";var r=n(99);t.exports=Function.prototype.bind||r},function(t,e){var n=Object.prototype.toString,r=RegExp("^"+String(n).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$");t.exports=function(t){return"function"==typeof t&&r.test(t)}},function(t,e){t.exports={boolean:!1,function:!0,object:!0,number:!1,string:!1,undefined:!1}},function(t,e){t.exports=function(t,e,n){e||(e=0),void 0===n&&(n=t?t.length:0);for(var r=-1,i=n-e||0,o=Array(i<0?0:i);++r0;)t.insertBefore(e.childNodes[0],e);t.removeChild(e)}return{isInlineElement:function(e){return t.includes(e.nodeName)},isBlockElement:function(t){return e.includes(t.nodeName)},isEmptyInlineElement:function t(e){return!(e.children.length>1)&&(1!==e.children.length||""===e.textContent.trim())&&(0===e.children.length?""===e.textContent.trim():t(e.children[0]))},isText:r,isEmptyTextNode:function(t){var e=!1;try{e=r(t)&&""===t.data}catch(t){e=!0}return e},isWhitespaceOnlyTextNode:o,isTextNodeWithContent:function(t,e){return e.nodeType===t.TEXT_NODE&&!o(t,e)},isFragment:function(t){return t.nodeType===Node.DOCUMENT_FRAGMENT_NODE},isBefore:function(t,e){return t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING},isSelectionMarkerNode:function(t){return i(Node,"scribe-marker")(t)},isCaretPositionNode:function(t){return i(Node,"caret-position")(t)},firstDeepestChild:function t(e){var n=e.firstChild;return n&&"BR"!==n.nodeName?t(n):e},insertAfter:function(t,e){return e.parentNode.insertBefore(t,e.nextSibling)},removeNode:function(t){return t.parentNode.removeChild(t)},getAncestor:function(t,e,n){function r(t){return e===t}if(!r(t))for(var i=t.parentNode;i&&!r(i);){if(n(i))return i;i=i.parentNode}},nextSiblings:function(t){for(var e=n.List();t=t.nextSibling;)e=e.push(t);return e},wrap:function(t,e){return t[0].parentNode.insertBefore(e,t[0]),t.forEach(function(t){e.appendChild(t)}),e},unwrap:s,removeChromeArtifacts:function(e){var r=n.List(e.querySelectorAll(t.map(function(t){return t+'[style*="line-height"]'}).join(",")));r=r.filter(function(t,e){return window.getComputedStyle(e).lineHeight===t.lineHeight}.bind(null,window.getComputedStyle(e)));var i=n.List();r.forEach(function(t){t.style.lineHeight=null,""===t.getAttribute("style")&&t.removeAttribute("style"),"SPAN"===t.nodeName&&0===t.attributes.length&&(i=i.push(t))}),i.forEach(function(t){s(t.parentNode,t)})},elementHasClass:i,hasContent:function(t){return!!(t&&t.children&&t.children.length>0)||!(!t||"BR"!==t.nodeName)}}}.apply(e,r))||(t.exports=i)},function(t,e,n){"use strict";t.exports={mediatedEvents:{},eventNamespace:null,_bindMediatedEvents:function(){Object.keys(this.mediatedEvents).forEach(function(t){var e=this.mediatedEvents[t];t=this.eventNamespace?this.eventNamespace+":"+t:t,this.mediator.on(t,this[e].bind(this))},this)}}},function(t,e,n){"use strict";var r=n(24);t.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},function(t,e,n){"use strict";var r=Function.prototype.toString,i=/^\s*class\b/,o=function(t){try{var e=r.call(t);return i.test(e)}catch(t){return!1}},s=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(a)return function(t){try{return!o(t)&&(r.call(t),!0)}catch(t){return!1}}(t);if(o(t))return!1;var e=s.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},function(t,e,n){var r=n(25),i=n(57),o={configurable:!1,enumerable:!1,value:null,writable:!1},s=function(){try{var t={},e=r(e=Object.defineProperty)&&e,n=e(t,t,t)&&e}catch(t){}return n}(),a=s?function(t,e){o.value=e,s(t,"__bindData__",o)}:i;t.exports=a},function(t,e,n){"use strict";var r=n(1);t.exports={mixinName:"Ajaxable",ajaxable:!0,initializeAjaxable:function(){this._queued=[]},addQueuedItem:function(t,e){r.log("Adding queued item for "+this.blockID+" called "+t),this._queued.push({name:t,deferred:e})},removeQueuedItem:function(t){r.log("Removing queued item for "+this.blockID+" called "+t),this._queued=this._queued.filter(function(e){return e.name!==t})},hasItemsInQueue:function(){return this._queued.length>0},resolveAllInQueue:function(){this._queued.forEach(function(t){r.log("Aborting queued request: "+t.name),t.deferred.cancel()},this)}}},function(t,e,n){"use strict";function r(t){t.preventDefault(),t.stopPropagation()}function i(t){t.dataTransfer.dropEffect="copy",t.currentTarget.classList.add("st-drag-over"),t.preventDefault(),t.stopPropagation()}function o(t){t.currentTarget.classList.remove("st-drag-over"),t.preventDefault(),t.stopPropagation()}t.exports={dropArea:function(t){return t.addEventListener("dragenter",r),t.addEventListener("dragover",i),t.addEventListener("dragleave",o),t},noDropArea:function(t){return t.removeEventListener("dragenter"),t.removeEventListener("dragover"),t.removeEventListener("dragleave"),t}}},function(t,e,n){var r,i;r=[n(7),n(15)],void 0===(i=function(t,e){var n,r="[object Arguments]",i=Object.prototype.toString;return function(o){var s=e(o)?o.length:n;return t(s)&&i.call(o)==r||!1}}.apply(e,r))||(t.exports=i)},function(t,e,n){var r;void 0===(r=function(){var t=Math.pow(2,53)-1;return function(e,n){return n=null==n?t:n,(e=+e)>-1&&e%1==0&&e0;++l\n \n '),draggable:"true","data-icon":"move"}},initialize:function(){this.el.addEventListener("mousedown",this.onMouseDown),this.el.addEventListener("dragstart",this.onDragStart),this.el.addEventListener("dragend",this.onDragEnd),r.dropArea(this.block),this.block.addEventListener("drop",this.onDrop)},blockId:function(){return this.block.getAttribute("id")},onMouseDown:function(){i.trigger("block:reorder:down")},onDrop:function(t){t.preventDefault();var e=this.block,n=t.dataTransfer.getData("text/plain"),r=document.querySelector("#"+n);e.id!==n&&o.insertAfter(r,e),this.mediator.trigger("block:rerender",n),i.trigger("block:reorder:dropped",n)},onDragStart:function(t){var e=this.block;this.dragEl=e.cloneNode(!0),this.dragEl.classList.add("st-drag-element"),this.dragEl.style.top="".concat(e.offsetTop,"px"),this.dragEl.style.left="".concat(e.offsetLeft,"px"),e.parentNode.appendChild(this.dragEl),t.dataTransfer.setDragImage(this.dragEl,0,0),t.dataTransfer.setData("text/plain",this.blockId()),this.mediator.trigger("block-controls:hide"),i.trigger("block:reorder:dragstart"),e.classList.add("st-block--dragging")},onDragEnd:function(t){i.trigger("block:reorder:dragend"),this.block.classList.remove("st-block--dragging"),this.dragEl.parentNode.removeChild(this.dragEl)},render:function(){return this}}),t.exports=a},function(t,e,n){"use strict";t.exports=function(t){return function(e){var n=new e.api.Command("heading");n.queryEnabled=function(){return t.inline_editable},n.queryState=function(){return"heading"===t.type},n.execute=function(e){var r={format:"html",text:t.getScribeInnerContent()};t.mediator.trigger("block:replace",t.el,n.queryState()?"Text":"Heading",r)},e.commands.heading=n}}},function(t,e,n){"use strict";t.exports=function(t){return function(e){var n=new e.api.Command("quote");n.queryEnabled=function(){return t.inline_editable},n.queryState=function(){return"quote"===t.type},n.execute=function(e){var r={format:"html",text:t.getScribeInnerContent()};t.mediator.trigger("block:replace",t.el,n.queryState()?"Text":"Quote",r)},e.commands.quote=n}}},function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Array.prototype.slice,s=n(97),a=Object.prototype.propertyIsEnumerable,u=!a.call({toString:null},"toString"),c=a.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!h["$"+t]&&r.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),d=function(t){var e=null!==t&&"object"==typeof t,n="[object Function]"===i.call(t),o=s(t),a=e&&"[object String]"===i.call(t),h=[];if(!e&&!n&&!o)throw new TypeError("Object.keys called on a non-object");var d=c&&n;if(a&&t.length>0&&!r.call(t,0))for(var y=0;y0)for(var v=0;v1&&"boolean"!=typeof e)throw new TypeError('"allowMissing" argument must be a boolean');var n="$ "+t;if(!(n in u))throw new SyntaxError("intrinsic "+t+" does not exist!");if(void 0===u[n]&&!e)throw new TypeError("intrinsic "+t+" exists, but is not available. Please file an issue!");return u[n]}},function(t,e){t.exports=Number.isNaN||function(t){return t!=t}},function(t,e){var n=Number.isNaN||function(t){return t!=t};t.exports=Number.isFinite||function(t){return"number"==typeof t&&!n(t)&&t!==1/0&&t!==-1/0}},function(t,e){t.exports=function(t){return t>=0?1:-1}},function(t,e){t.exports=function(t,e){var n=t%e;return Math.floor(n>=0?n:n+e)}},function(t,e,n){"use strict";var r=n(46);t.exports=function(t){var e=r.ToObject(this),n=r.ToInteger(r.ToLength(e.length));if(!r.IsCallable(t))throw new TypeError("Array#find: predicate must be a function");if(0!==n)for(var i,o=arguments[1],s=0;s1)for(var n=1;n":">",'"':""","'":"'"}},function(t,e){t.exports=/<%=([\s\S]+?)%>/g},function(t,e,n){"use strict";var r=n(0),i=n(1),o=function(t,e){this.mediator=e,this.initialize(t?t.trim():"")};Object.assign(o.prototype,{initialize:function(t){this.store=this._parseData(t)||{data:[]}},retrieve:function(){return this.store},toString:function(t){return JSON.stringify(this.store,void 0,t)},reset:function(){i.log("Resetting the EditorStore"),this.store={data:[]}},addData:function(t){return this.store.data.push(t),this.store},_parseData:function(t){var e;if(0===t.length)return e;try{var n=JSON.parse(t);r.isUndefined(n.data)||(e=n)}catch(t){this.mediator.trigger("errors:add",{text:i18n.t("errors:load_fail")}),this.mediator.trigger("errors:render"),console.log("Sorry there has been a problem with parsing the JSON"),console.log(t)}return e}}),t.exports=o},function(t,e,n){"use strict";var r=n(1),i=n(4),o=function(t){this.form=t,this.initialize()};Object.assign(o.prototype,{initialize:function(){this.submitBtns=this.form.querySelectorAll("input[type='submit']");var t=[];Array.prototype.forEach.call(this.submitBtns,function(e,n){t.push(e.getAttribute("value"))}),this.submitBtnTitles=t,this.canSubmit=!0,this.globalUploadCount=0,this._bindEvents()},setSubmitButton:function(t,e){Array.prototype.forEach.call(this.submitBtns,function(t,n){t.setAttribute("value",e)})},resetSubmitButton:function(){var t=this.submitBtnTitles;Array.prototype.forEach.call(this.submitBtns,function(e,n){e.setAttribute("value",t[n])})},onUploadStart:function(t){this.globalUploadCount++,r.log("onUploadStart called "+this.globalUploadCount),1===this.globalUploadCount&&this._disableSubmitButton()},onUploadStop:function(t){this.globalUploadCount=this.globalUploadCount<=0?0:this.globalUploadCount-1,r.log("onUploadStop called "+this.globalUploadCount),0===this.globalUploadCount&&this._enableSubmitButton()},onError:function(t){r.log("onError called"),this.canSubmit=!1},_disableSubmitButton:function(t){this.setSubmitButton(null,t||i18n.t("general:wait")),Array.prototype.forEach.call(this.submitBtns,function(t,e){t.setAttribute("disabled","disabled"),t.classList.add("disabled")})},_enableSubmitButton:function(){this.resetSubmitButton(),Array.prototype.forEach.call(this.submitBtns,function(t,e){t.removeAttribute("disabled"),t.classList.remove("disabled")})},_events:{disableSubmitButton:"_disableSubmitButton",enableSubmitButton:"_enableSubmitButton",setSubmitButton:"setSubmitButton",resetSubmitButton:"resetSubmitButton",onError:"onError",onUploadStart:"onUploadStart",onUploadStop:"onUploadStop"},_bindEvents:function(){Object.keys(this._events).forEach(function(t){i.on(t,this[this._events[t]],this)},this)}}),t.exports=o},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(1),s=n(64),a=n(4);t.exports=function(t,e,n,u){var c=[t.blockID,(new Date).getTime(),"raw"].join("-"),l=new FormData,f=t.attachmentName||i.defaults.attachmentName,h=t.attachmentFile||i.defaults.attachmentFile,p=t.attachmentUid||i.defaults.attachmentUid;l.append(f,e.name),l.append(h,e),l.append(p,c),a.trigger("onUploadStart",l),t.resetMessages();var d=t.uploadUrl||i.defaults.uploadUrl,y=s.fetch(d,{body:l,method:"POST",dataType:"json"});return t.addQueuedItem(c,y),y.then(function(e){o.log("Upload callback called"),a.trigger("onUploadStop",e),!r.isUndefined(n)&&r.isFunction(n)&&n.apply(t,arguments,e),t.removeQueuedItem(c)}).catch(function(e,n,i){o.log("Upload callback error called"),a.trigger("onUploadStop",void 0,i,n,e),!r.isUndefined(u)&&r.isFunction(u)&&u.call(t,n),t.removeQueuedItem(c)}),y}},function(t,e,n){"use strict";n(142);var r=n(143),i=n(144),o=n(2),s=Object.create(null);s.fetch=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e=(n=Object.assign({},o.defaults.ajaxOptions,n)).jsonp?r(t).promise:fetch(t,n).then(function(t){return"json"===n.dataType?t.json():t.text()}),i(e)},t.exports=s},function(t,e,n){"use strict";t.exports={Ajaxable:n(34),Controllable:n(145),Droppable:n(146),Fetchable:n(147),Pastable:n(148),Uploadable:n(149),MultiEditable:n(150),Textable:n(221)}},function(t,e){t.exports=function(t,e){return!t!=!e}},function(t,e){var n=/\b(Array|Date|Object|Math|JSON)\b/g;t.exports=function(t,e){var r=function(t){for(var e=[],n=0;n",""].join("\n"),o=function(t){this.mediator=t,this._ensureElement(),this._bindFunctions(),this.initialize()};Object.assign(o.prototype,n(6),n(11),{total_blocks:0,bound:["onBlockCountChange","onSelectChange"],className:"st-block-positioner__inner",initialize:function(){this.el.insertAdjacentHTML("beforeend",i),this.select=this.el.querySelector(".st-block-positioner__select"),this.positioner=null,this.select.addEventListener("change",this.onSelectChange)},onBlockCountChange:function(t){t!==this.total_blocks&&(this.total_blocks=t,this.renderPositionList())},onSelectChange:function(){var t=this.select.value;0!==t&&(this.mediator.trigger("block:changePosition",this.positioner.block,t,1===t?"before":"after"),this.positioner.toggle())},renderPositionList:function(){for(var t="",e=1;e<=this.total_blocks;e++)t+="";this.select.innerHTML=t},renderInBlock:function(t){this.positioner&&this.positioner!==t&&this.positioner.hide(),this.positioner=t,this.select.value=0,r.remove(this.el),t.el.appendChild(this.el)}}),t.exports=o},function(t,e,n){"use strict";var r=n(2),i=function(){this._ensureElement(),this._bindFunctions()};Object.assign(i.prototype,n(6),n(11),{tagName:"a",className:"st-block-ui-btn__delete",attributes:{html:function(){return'')},"data-icon":"close"}}),t.exports=i},function(t,e,n){"use strict";var r=n(0),i=n(1),o=function(t){var e=t.getAttribute("data-st-name")||t.getAttribute("name");return e||(e="Field"),i.capitalize(e)};t.exports={errors:[],valid:function(){return this.performValidations(),0===this.errors.length},performValidations:function(){this.resetErrors();var t=this.$(".st-required");Array.prototype.forEach.call(t,function(t,e){this.validateField(t)}.bind(this)),this.validations.forEach(this.runValidator,this),this.el.classList.toggle("st-block--with-errors",this.errors.length>0)},validations:[],validateField:function(t){0===(t.getAttribute("contenteditable")?t.textContent:t.value).length&&this.setError(t,i18n.t("errors:block_empty",{name:o(t)}))},runValidator:function(t){r.isUndefined(this[t])||this[t].call(this)},setError:function(t,e){var n=this.addMessage(e,"st-msg--error");t.classList.add("st-error"),this.errors.push({field:t,reason:e,msg:n})},resetErrors:function(){this.errors.forEach(function(t){t.field.classList.remove("st-error"),t.msg.remove()}),this.messages.classList.remove("st-block__messages--is-visible"),this.errors=[]}}},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(4);t.exports={blockStorage:{},createStore:function(t){this.blockStorage={type:i.underscored(this.type),data:t||{}}},save:function(){var t=this._serializeData();r.isEmpty(t)||this.setData(t)},getData:function(){return this.save(),this.blockStorage},getBlockData:function(){return this.save(),this.blockStorage.data},_getData:function(){return this.blockStorage.data},setData:function(t){i.log("Setting data for block "+this.blockID),Object.assign(this.blockStorage.data,t||{})},setAndLoadData:function(t){this.setData(t),this.beforeLoadingData()},_serializeData:function(){},loadData:function(){},beforeLoadingData:function(){i.log("loadData for "+this.blockID),o.trigger("editor/block/loadData"),this.loadData(this._getData())},_loadData:function(){i.log("_loadData is deprecated and will be removed in the future. Please use beforeLoadingData instead."),this.beforeLoadingData()},checkAndLoadData:function(){r.isEmpty(this._getData())||this.beforeLoadingData()}}},function(t,e,n){"use strict";var r=n(13),i=n(0),o=n(1),s=n(2),a=n(4),u=n(21),c=n(3),l=["convertToMarkdown","convertFromMarkdown","formatBar"],f=function(t){this.options=t.options,this.blockOptions=l.reduce(function(e,n){return e[n]=t.options[n],e},{}),this.instance_scope=t.ID,this.mediator=t.mediator,this.wrapper=t.wrapper,this.blocks=[],this.blockCounts={},this.blockTypes=[],this._setBlocksTypes(),this._setRequired(),this._bindMediatedEvents(),this.initialize()};Object.assign(f.prototype,n(6),n(30),n(9),{eventNamespace:"block",mediatedEvents:{create:"createBlock",createBefore:"createBlockBefore",remove:"removeBlock",rerender:"rerenderBlock",replace:"replaceBlock",focusPrevious:"focusPreviousBlock",focusNext:"focusNextBlock",paste:"paste"},initialize:function(){},createBlock:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(r=Object.assign({autoFocus:!1,focusAtEnd:!1},r),t=o.classify(t),this.canCreateBlock(t)){var i=new u[t](e,this.instance_scope,this.mediator,this.blockOptions,this.options);this.blocks.push(i),this._incrementBlockTypeCount(t),this.renderBlock(i,n),r.autoFocus?i.focus():r.focusAtEnd&&i.focusAtEnd(),this.triggerBlockCountUpdate(),this.mediator.trigger("block:limitReached",this.blockLimitReached()),this.mediator.trigger("block:created",i),a.trigger(e?"block:create:existing":"block:create:new",i),o.log("Block created of type "+t)}},createBlockBefore:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(r=Object.assign({autoFocus:!1,focusAtEnd:!1},r),t=o.classify(t),this.canCreateBlock(t)){var i=new u[t](e,this.instance_scope,this.mediator,this.blockOptions,this.options);this.blocks.push(i),this._incrementBlockTypeCount(t);var s=this.getPreviousBlock(n);s?this.renderBlock(i,s.el):this.renderBlock(i,this.wrapper.querySelector(".st-top-controls")),r.autoFocus?i.focus():r.focusAtEnd&&i.focusAtEnd(),this.triggerBlockCountUpdate(),this.mediator.trigger("block:limitReached",this.blockLimitReached()),this.mediator.trigger("block:created",i),a.trigger(e?"block:create:existing":"block:create:new",i),o.log("Block created of type "+t)}},removeBlock:function(t,e){e=Object.assign({transposeContent:!1,focusOnPrevious:!1,focusOnNext:!1,createNextBlock:!1},e);var n=this.findBlockById(t),i=o.classify(n.type),s=this.getPreviousBlock(n),u=this.getNextBlock(n);if(e.transposeContent&&n.mergeable){if(!s&&1===this.blocks.length)return;if(s&&"list"===s.type)s.focusAtEnd(),s.appendToCurrentItem(n.getScribeInnerContent());else if(s&&s.mergeable)s.appendContent(n.getScribeInnerContent(),{keepCaretPosition:!0});else{if(""!==n.getScribeInnerContent())return;s?s.focusAtEnd():u&&u.focus()}}if(this.mediator.trigger("block-controls:reset"),this.blocks=this.blocks.filter(function(t){return t.blockID!==n.blockID}),n.remove(),s&&u&&this.options.joinListBlocksOnBlockRemove&&"list"===s.type&&"list"===u.type){var c=u._serializeData().listItems;u.remove();var l=s.getCurrentTextEditor(),f=r(l.scribe.el);c.forEach(function(t){s.addListItem(t.content)}),s.focusOn(l,{caretPosition:f.start})}e.focusOnPrevious&&s&&s.focusAtEnd(),e.focusOnNext&&(u?u.focus():e.createNextBlock&&this.createBlock("text",null,null,{autoFocus:!0})),this._decrementBlockTypeCount(i),this.triggerBlockCountUpdate(),this.mediator.trigger("block:limitReached",this.blockLimitReached()),a.trigger("block:remove",t)},replaceBlock:function(t,e,n){var r=this.findBlockById(t.id);this.createBlock(e,n||null,t),this.removeBlock(t.id),r.remove()},renderBlock:function(t,e){var n=this,r=t.render().el;e?c.insertAfter(r,e):this.wrapper.appendChild(r),t.trigger("onRender"),this.options.selectionMouse&&(r.addEventListener("mouseenter",function(){if(window.mouseDown){var e=n.getBlockPosition(t.el);n.mediator.trigger("selection:update",e)}}),r.addEventListener("mousedown",function(){var e=n.getBlockPosition(t.el);n.mediator.trigger("selection:start",e,{mouseEnabled:!0})}))},rerenderBlock:function(t){var e=this.findBlockById(t);i.isUndefined(e)||e.isEmpty()||!e.drop_options.re_render_on_reorder||e.beforeLoadingData()},getPreviousBlock:function(t){var e=this.getBlockPosition(t.el);if(!(e<1)){var n=this.wrapper.querySelectorAll(".st-block")[e-1];return this.findBlockById(n.getAttribute("id"))}},getNextBlock:function(t){var e=this.getBlockPosition(t.el);if(!(e<0||e>=this.blocks.length-1))return this.findBlockById(this.wrapper.querySelectorAll(".st-block")[e+1].getAttribute("id"))},getBlockPosition:function(t){return Array.prototype.indexOf.call(this.wrapper.querySelectorAll(".st-block"),t)},focusPreviousBlock:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=Object.assign({force:!1},e);var n=this.findBlockById(t);if(n&&(n.mergeable||e.force)){var r=this.getPreviousBlock(n);r&&r.mergeable?r.focusAtEnd():e.force&&n.focus()}},focusNextBlock:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=Object.assign({force:!1},e);var n=this.findBlockById(t);if(n&&(n.mergeable||e.force)){var r=this.getNextBlock(n);r&&r.mergeable?r.focusAtStart():e.force&&n.focusAtEnd()}},paste:function(t){var e=this,n=o.getBlockBySelection();if(n){n.split();var r=this.getNextBlock(n);if(n.isEmpty()&&this.removeBlock(n.blockID),r)return void t.forEach(function(t){e.createBlockBefore(t.type,t.data,r,{focusAtEnd:!0})})}t.forEach(function(t){e.createBlock(t.type,t.data,void 0,{focusAtEnd:!0})})},triggerBlockCountUpdate:function(){this.mediator.trigger("block:countUpdate",this.blocks.length)},canCreateBlock:function(t){return this.blockLimitReached()?(o.log("Cannot add any more blocks. Limit reached."),!1):this.isBlockTypeAvailable(t)?!!this.canAddBlockType(t)||(o.log("Block Limit reached for type "+t),!1):(o.log("Block type not available "+t),!1)},validateBlockTypesExist:function(t){if(s.skipValidation||!t)return!1;(this.required||[]).forEach(function(t,e){if(this.isBlockTypeAvailable(t))if(0===this._getBlockTypeCount(t))o.log("Failed validation on required block type "+t),this.mediator.trigger("errors:add",{text:i18n.t("errors:type_missing",{type:t})});else{if(this.getBlocksByType(t).filter(function(t){return!t.isEmpty()}).length>0)return!1;this.mediator.trigger("errors:add",{text:i18n.t("errors:required_type_empty",{type:t})}),o.log("A required block type "+t+" is empty")}},this)},findBlockById:function(t){return this.blocks.find(function(e){return e.blockID===t})},getBlocksByType:function(t){return this.blocks.filter(function(e){return o.classify(e.type)===t})},getBlocksByIDs:function(t){return this.blocks.filter(function(e){return t.includes(e.blockID)})},blockLimitReached:function(){return 0!==this.options.blockLimit&&this.blocks.length>=this.options.blockLimit},isBlockTypeAvailable:function(t){return this.blockTypes.includes(t)},canAddBlockType:function(t){var e=this._getBlockTypeLimit(t);return!(0!==e&&this._getBlockTypeCount(t)>=e)},_setBlocksTypes:function(){this.blockTypes=this.options.blockTypes||Object.keys(u)},_setRequired:function(){this.required=!1,Array.isArray(this.options.required)&&!i.isEmpty(this.options.required)&&(this.required=this.options.required)},_incrementBlockTypeCount:function(t){this.blockCounts[t]=i.isUndefined(this.blockCounts[t])?1:this.blockCounts[t]+1},_decrementBlockTypeCount:function(t){this.blockCounts[t]=i.isUndefined(this.blockCounts[t])?1:this.blockCounts[t]-1},_getBlockTypeCount:function(t){return i.isUndefined(this.blockCounts[t])?0:this.blockCounts[t]},_blockLimitReached:function(){return 0!==this.options.blockLimit&&this.blocks.length>=this.options.blockLimit},_getBlockTypeLimit:function(t){return this.isBlockTypeAvailable(t)?parseInt(i.isUndefined(this.options.blockTypeLimits[t])?0:this.options.blockTypeLimits[t],10):0}}),t.exports=f},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(3),s=n(10),a=n(39),u=n(223),c=function(t,e,n,i,o){this.createStore(t),this.blockID=r.uniqueId("st-block-"),this.instanceID=e,this.mediator=n,this.options=i||{},this.editorOptions=o||{},this._ensureElement(),this._bindFunctions(),this.initialize.apply(this,arguments)};Object.assign(c.prototype,n(6),n(9),n(11),n(85),{focus:function(){},valid:function(){return!0},className:"st-block",block_template:u,attributes:function(){return{id:this.blockID,"data-type":this.type,"data-instance":this.instanceID}},title:function(){return i18n.t("blocks:".concat(this.type,":title"))||i.titleize(this.type.replace(/[\W_]/g," "))},blockCSSClass:function(){return this.blockCSSClass=i.toSlug(this.type),this.blockCSSClass},type:"",class:function(){return i.classify(this.type)},editorHTML:"",initialize:function(){},onBlockRender:function(){},beforeBlockRender:function(){},_setBlockInner:function(){var t=r.result(this,"editorHTML");this.el.insertAdjacentHTML("beforeend",this.block_template(t)),this.inner=this.el.querySelector(".st-block__inner")},render:function(){return this.beforeBlockRender(),this._setBlockInner(),this._blockPrepare(),this},_blockPrepare:function(){this._initUI(),this._initMessages(),this.checkAndLoadData(),this.el.classList.add("st-item-ready"),this.on("onRender",this.onBlockRender),this.save()},_withUIComponent:function(t,e,n){this.ui.appendChild(t.render().el),e&&n&&s.delegate(this.ui,e,"click",n)},_initUI:function(){var t=o.createElement("div",{class:"st-block__ui"});this.el.appendChild(t),this.ui=t,this._initUIComponents()},_initMessages:function(){var t=o.createElement("div",{class:"st-block__messages"});this.inner.insertBefore(t,this.inner.firstChild),this.messages=t},addMessage:function(t,e){return t=o.createElement("span",{html:t,class:"st-msg "+e}),this.messages.appendChild(t),this.messages.classList.add("st-block__messages--is-visible"),t},resetMessages:function(){this.messages.innerHTML="",this.messages.classList.remove("st-block__messages--is-visible")},_initUIComponents:function(){this._withUIComponent(new a(this.el))}}),c.fn=c.prototype,c.extend=n(89),t.exports=c},function(t,e,n){"use strict";var r=n(2);t.exports=function(){return'\n \n ')}},function(t,e,n){"use strict";t.exports=function(t,e){var n,r=this;n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return r.apply(this,arguments)},Object.assign(n,r,e);var i=function(){this.constructor=n};return i.prototype=r.prototype,n.prototype=new i,t&&Object.assign(n.prototype,t),n.__super__=r.prototype,n}},function(t,e,n){"use strict";var r=n(16),i=r.createBlocksFromParagraphs,o=r.isAtStart,s=r.isAtEnd,a=r.isSelectedFromStart,u=r.isSelectedToEnd,c=r.selectToEnd;t.exports=function(t){return function(e){var n=!1;e.el.addEventListener("keydown",function(r){t.supressKeyListeners||("Enter"!==r.key||r.shiftKey?["Left","ArrowLeft","Up","ArrowUp"].indexOf(r.key)>-1?r.shiftKey&&a(e)?(r.preventDefault(),r.stopPropagation(),document.activeElement&&document.activeElement.blur(),t.mediator.trigger("selection:block",t)):o(e)&&(r.preventDefault(),r.stopPropagation(),t.mediator.trigger("block:focusPrevious",t.blockID)):8===r.keyCode&&o(e)?(r.preventDefault(),n=!0):["Right","ArrowRight","Down","ArrowDown"].indexOf(r.key)>-1&&(r.shiftKey&&u(e)?(r.preventDefault(),r.stopPropagation(),document.activeElement&&document.activeElement.blur(),t.mediator.trigger("selection:block",t)):s(e)&&(r.preventDefault(),t.mediator.trigger("block:focusNext",t.blockID))):(r.preventDefault(),s(e)?(c(e).extractContents(),t.mediator.trigger("block:create","Text",null,t.el,{autoFocus:!0})):i(t,e),e.allowsBlockElements()&&""===e.getTextContent()&&e.setContent("
")))}),e.el.addEventListener("keyup",function(e){t.supressKeyListeners||"Backspace"===e.key&&n&&(e.preventDefault(),t.mediator.trigger("block:remove",t.blockID,{transposeContent:!0}),n=!1)})}}},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(3),s=n(10),a=n(236),u=function(t,e,n){this.editor=n,this.options=Object.assign({},i.defaults.formatBar,t||{}),this.commands=this.options.commands,this.mediator=e,this.isShown=!1,this._ensureElement(),this._bindFunctions(),this._bindMediatedEvents(),this.initialize.apply(this,arguments)};Object.assign(u.prototype,n(6),n(30),n(9),n(11),{className:"st-format-bar",bound:["onFormatButtonClick","renderBySelection","hide"],eventNamespace:"formatter",mediatedEvents:{position:"renderBySelection",show:"show",hide:"hide"},initialize:function(){var t=this.commands.reduce(function(t,e){return t+a(e)},"");this.el.insertAdjacentHTML("beforeend",t),s.delegate(this.el,".st-format-btn","mousedown",this.onFormatButtonClick)},hide:function(){this.block=void 0,this.isShown=!1,this.el.classList.remove("st-format-bar--is-ready"),o.remove(this.el)},show:function(){this.isShown||(this.isShown=!0,this.editor.outer.appendChild(this.el),this.el.classList.add("st-format-bar--is-ready"))},remove:function(){o.remove(this.el)},renderBySelection:function(t){this.block=t,this.highlightSelectedButtons(),this.show(),this.calculatePosition()},calculatePosition:function(){var t=window.getSelection().getRangeAt(0).getBoundingClientRect(),e={},n=this.editor.outer.getBoundingClientRect();e.top=t.top-n.top+"px",e.left=(t.left+t.right)/2-this.el.offsetWidth/2-n.left+"px",this.el.style.top=e.top,this.el.style.left=e.left},highlightSelectedButtons:function(){var t=this;[].forEach.call(this.el.querySelectorAll(".st-format-btn"),function(e){var n=e.getAttribute("data-cmd");e.classList.toggle("st-format-btn--is-active",t.block.queryTextBlockCommandState(n)),e=null})},onFormatButtonClick:function(t){if(t.preventDefault(),t.stopPropagation(),r.isUndefined(this.block))throw"Associated block not found";var e=t.currentTarget.getAttribute("data-cmd");return!r.isUndefined(e)&&(this.block.execTextBlockCommand(e),this.highlightSelectedButtons(),document.activeElement.focus(),!1)}}),t.exports=u},function(t,e,n){"use strict";var r=n(2),i=n(1),o=n(4),s=n(62),a=!1,u={bindFormSubmit:function(t){a||(new s(t),t.addEventListener("submit",this.onFormSubmit),a=!0)},onBeforeSubmit:function(t){var e=0;return r.instances.forEach(function(n,r){e+=n.onFormSubmit(t)}),i.log("Total errors: "+e),e},onFormSubmit:function(t){u.onBeforeSubmit()>0&&(o.trigger("onError"),t.preventDefault())}};t.exports=u},function(t,e,n){t.exports=n(94),n(246)},function(t,e,n){"use strict";n(95),n(96).shim(),n(101).shim(),n(114),n(115).polyfill(),n(116),n(117),n(118);var r=n(1),i={config:n(2),log:r.log,Locales:n(140),Events:n(9),EventBus:n(4),EditorStore:n(61),Submittable:n(62),FileUploader:n(63),BlockMixins:n(65),BlockPositioner:n(81),BlockPositionerSelect:n(82),BlockReorder:n(39),BlockDeletion:n(83),BlockValidations:n(84),BlockStore:n(85),BlockManager:n(86),SimpleBlock:n(87),Block:n(8),Blocks:n(21),FormatBar:n(91),Editor:n(237),toMarkdown:n(245),toHTML:n(22),setDefaults:function(t){Object.assign(i.config.defaults,t||{})},getInstance:r.getInstance,setBlockOptions:function(t,e){var n=i.Blocks[t];void 0!==n&&Object.assign(n.prototype,e||{})},runOnAllInstances:function(t){if(i.Editor.prototype.hasOwnProperty(t)){var e=Array.prototype.slice.call(arguments,1);Array.prototype.forEach.call(i.config.instances,function(n){n[t].apply(null,e)})}else i.log("method doesn't exist")}};Object.assign(i,n(92)),t.exports=i},function(t,e,n){t.exports=n.p+"178289a66e4bc63fe9a24fba4c8acf36.svg"},function(t,e,n){"use strict";var r=n(23),i=n(43),o=n(45),s=n(100),a=o();r(a,{getPolyfill:o,implementation:i,shim:s}),t.exports=a},function(t,e,n){"use strict";var r=Object.prototype.toString;t.exports=function(t){var e=r.call(t),n="[object Arguments]"===e;return n||(n="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===r.call(t.callee)),n}},function(t,e){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,e,i){if("[object Function]"!==r.call(e))throw new TypeError("iterator must be a function");var o=t.length;if(o===+o)for(var s=0;s2?arguments[2]:[];if(!this.IsCallable(t))throw new s(t+" is not a function");return t.apply(e,n)},ToPrimitive:i,ToNumber:function(t){var e=w(t)?t:i(t,f);if("symbol"==typeof e)throw new s("Cannot convert a Symbol value to a number");if("string"==typeof e){if(T(e))return this.ToNumber(x(k(e,2),2));if(C(e))return this.ToNumber(x(k(e,2),8));if(B(e)||D(e))return NaN;var n=function(t){return q(t,F,"")}(e);if(n!==e)return this.ToNumber(n)}return f(e)},ToInt16:function(t){var e=this.ToUint16(t);return e>=32768?e-65536:e},ToInt8:function(t){var e=this.ToUint8(t);return e>=128?e-256:e},ToUint8:function(t){var e=this.ToNumber(t);if(y(e)||0===e||!v(e))return 0;var n=b(e)*P(I(e));return _(n,256)},ToUint8Clamp:function(t){var e=this.ToNumber(t);if(y(e)||e<=0)return 0;if(e>=255)return 255;var n=P(t);return n+.5g?g:e},CanonicalNumericIndexString:function(t){if("[object String]"!==M(t))throw new s("must be a string");if("-0"===t)return-0;var e=this.ToNumber(t);return this.SameValue(this.ToString(e),t)?e:void 0},RequireObjectCoercible:R.CheckObjectCoercible,IsArray:u.isArray||function(t){return"[object Array]"===M(t)},IsConstructor:function(t){return"function"==typeof t&&!!t.prototype},IsExtensible:Object.preventExtensions?function(t){return!w(t)&&N(t)}:function(t){return!0},IsInteger:function(t){if("number"!=typeof t||y(t)||!v(t))return!1;var e=I(t);return P(e)===e},IsPropertyKey:function(t){return"string"==typeof t||"symbol"==typeof t},IsRegExp:function(t){if(!t||"object"!=typeof t)return!1;if(d){var e=t[h.match];if(void 0!==e)return R.ToBoolean(e)}return $(t)},SameValueZero:function(t,e){return t===e||y(t)&&y(e)},GetV:function(t,e){if(!this.IsPropertyKey(e))throw new s("Assertion failed: IsPropertyKey(P) is not true");return this.ToObject(t)[e]},GetMethod:function(t,e){if(!this.IsPropertyKey(e))throw new s("Assertion failed: IsPropertyKey(P) is not true");var n=this.GetV(t,e);if(null!=n){if(!this.IsCallable(n))throw new s(e+"is not a function");return n}},Get:function(t,e){if("Object"!==this.Type(t))throw new s("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new s("Assertion failed: IsPropertyKey(P) is not true");return t[e]},Type:function(t){return"symbol"==typeof t?"Symbol":R.Type(t)},SpeciesConstructor:function(t,e){if("Object"!==this.Type(t))throw new s("Assertion failed: Type(O) is not Object");var n=t.constructor;if(void 0===n)return e;if("Object"!==this.Type(n))throw new s("O.constructor is not an Object");var r=d&&h.species?n[h.species]:void 0;if(null==r)return e;if(this.IsConstructor(r))return r;throw new s("no constructor found")},CompletePropertyDescriptor:function(t){if(!this.IsPropertyDescriptor(t))throw new s("Desc must be a Property Descriptor");return this.IsGenericDescriptor(t)||this.IsDataDescriptor(t)?(r(t,"[[Value]]")||(t["[[Value]]"]=void 0),r(t,"[[Writable]]")||(t["[[Writable]]"]=!1)):(r(t,"[[Get]]")||(t["[[Get]]"]=void 0),r(t,"[[Set]]")||(t["[[Set]]"]=void 0)),r(t,"[[Enumerable]]")||(t["[[Enumerable]]"]=!1),r(t,"[[Configurable]]")||(t["[[Configurable]]"]=!1),t},Set:function(t,e,n,r){if("Object"!==this.Type(t))throw new s("O must be an Object");if(!this.IsPropertyKey(e))throw new s("P must be a Property Key");if("Boolean"!==this.Type(r))throw new s("Throw must be a Boolean");if(r)return t[e]=n,!0;try{t[e]=n}catch(t){return!1}},HasOwnProperty:function(t,e){if("Object"!==this.Type(t))throw new s("O must be an Object");if(!this.IsPropertyKey(e))throw new s("P must be a Property Key");return r(t,e)},HasProperty:function(t,e){if("Object"!==this.Type(t))throw new s("O must be an Object");if(!this.IsPropertyKey(e))throw new s("P must be a Property Key");return e in t},IsConcatSpreadable:function(t){if("Object"!==this.Type(t))return!1;if(d&&"symbol"==typeof h.isConcatSpreadable){var e=this.Get(t,Symbol.isConcatSpreadable);if(void 0!==e)return this.ToBoolean(e)}return this.IsArray(t)},Invoke:function(t,e){if(!this.IsPropertyKey(e))throw new s("P must be a Property Key");var n=E(arguments,2),r=this.GetV(t,e);return this.Call(r,t,n)},GetIterator:function(t,e){if(!d)throw new SyntaxError("ES.GetIterator depends on native iterator support.");var n=e;arguments.length<2&&(n=this.GetMethod(t,h.iterator));var r=this.Call(n,t);if("Object"!==this.Type(r))throw new s("iterator must return an object");return r},IteratorNext:function(t,e){var n=this.Invoke(t,"next",arguments.length<2?[]:[e]);if("Object"!==this.Type(n))throw new s("iterator next must return an object");return n},IteratorComplete:function(t){if("Object"!==this.Type(t))throw new s("Assertion failed: Type(iterResult) is not Object");return this.ToBoolean(this.Get(t,"done"))},IteratorValue:function(t){if("Object"!==this.Type(t))throw new s("Assertion failed: Type(iterResult) is not Object");return this.Get(t,"value")},IteratorStep:function(t){var e=this.IteratorNext(t);return!0!==this.IteratorComplete(e)&&e},IteratorClose:function(t,e){if("Object"!==this.Type(t))throw new s("Assertion failed: Type(iterator) is not Object");if(!this.IsCallable(e))throw new s("Assertion failed: completion is not a thunk for a Completion Record");var n,r=e,i=this.GetMethod(t,"return");if(void 0===i)return r();try{var o=this.Call(i,t,[])}catch(t){throw n=r(),r=null,t}if(n=r(),r=null,"Object"!==this.Type(o))throw new s("iterator .return must return an object");return n},CreateIterResultObject:function(t,e){if("Boolean"!==this.Type(e))throw new s("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}},RegExpExec:function(t,e){if("Object"!==this.Type(t))throw new s("R must be an Object");if("String"!==this.Type(e))throw new s("S must be a String");var n=this.Get(t,"exec");if(this.IsCallable(n)){var r=this.Call(n,t,[e]);if(null===r||"Object"===this.Type(r))return r;throw new s('"exec" method must return `null` or an Object')}return O(t,e)},ArraySpeciesCreate:function(t,e){if(!this.IsInteger(e)||e<0)throw new s("Assertion failed: length must be an integer >= 0");var n,r=0===e?0:e;if(this.IsArray(t)&&(n=this.Get(t,"constructor"),"Object"===this.Type(n)&&d&&h.species&&null===(n=this.Get(n,h.species))&&(n=void 0)),void 0===n)return u(r);if(!this.IsConstructor(n))throw new s("C must be a constructor");return new n(r)},CreateDataProperty:function(t,e,n){if("Object"!==this.Type(t))throw new s("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new s("Assertion failed: IsPropertyKey(P) is not true");var r=U(t,e),i=r||"function"!=typeof N||N(t);if(r&&(!r.writable||!r.configurable)||!i)return!1;var o={configurable:!0,enumerable:!0,value:n,writable:!0};return Object.defineProperty(t,e,o),!0},CreateDataPropertyOrThrow:function(t,e,n){if("Object"!==this.Type(t))throw new s("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new s("Assertion failed: IsPropertyKey(P) is not true");var r=this.CreateDataProperty(t,e,n);if(!r)throw new s("unable to create data property");return r},ObjectCreate:function(t,e){if(null!==t&&"Object"!==this.Type(t))throw new s("Assertion failed: proto must be null or an object");if((arguments.length<2?[]:e).length>0)throw new a("es-abstract does not yet support internal slots");if(null===t&&!L)throw new a("native Object.create support is required to create null objects");return L(t)},AdvanceStringIndex:function(t,e,n){if("String"!==this.Type(t))throw new s("S must be a String");if(!this.IsInteger(e)||e<0||e>g)throw new s("Assertion failed: length must be an integer >= 0 and <= 2**53");if("Boolean"!==this.Type(n))throw new s("Assertion failed: unicode must be a Boolean");if(!n)return e+1;if(e+1>=t.length)return e+1;var r=j(t,e);if(r<55296||r>56319)return e+1;var i=j(t,e+1);return i<56320||i>57343?e+1:e+2}});delete H.CheckObjectCoercible,t.exports=H},function(t,e,n){"use strict";t.exports=n(104)},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=n(47),o=n(32),s=n(105),a=n(106);t.exports=function(t){if(i(t))return t;var e,n="default";if(arguments.length>1&&(arguments[1]===String?n="string":arguments[1]===Number&&(n="number")),r&&(Symbol.toPrimitive?e=function(t,e){var n=t[e];if(null!=n){if(!o(n))throw new TypeError(n+" returned for property "+e+" of object "+t+" is not a function");return n}}(t,Symbol.toPrimitive):a(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var u=e.call(t,n);if(i(u))return u;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(s(t)||a(t))&&(n="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var n,r,s,a="string"===e?["toString","valueOf"]:["valueOf","toString"];for(s=0;s>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(a(e)||0===e||!u(e))return 0;var n=c(e)*Math.floor(Math.abs(e));return l(n,65536)},ToString:function(t){return s(t)},ToObject:function(t){return this.CheckObjectCoercible(t),i(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new o(e||"Cannot call method on "+t);return t},IsCallable:f,SameValue:function(t,e){return t===e?0!==t||1/t==1/e:a(t)&&a(e)},Type:function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0},IsPropertyDescriptor:function(t){if("Object"!==this.Type(t))return!1;var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in t)if(p(t,n)&&!e[n])return!1;var r=p(t,"[[Value]]"),i=p(t,"[[Get]]")||p(t,"[[Set]]");if(r&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new o("Desc must be a Property Descriptor");return!(!p(t,"[[Get]]")&&!p(t,"[[Set]]"))},IsDataDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new o("Desc must be a Property Descriptor");return!(!p(t,"[[Value]]")&&!p(t,"[[Writable]]"))},IsGenericDescriptor:function(t){if(void 0===t)return!1;if(!this.IsPropertyDescriptor(t))throw new o("Desc must be a Property Descriptor");return!this.IsAccessorDescriptor(t)&&!this.IsDataDescriptor(t)},FromPropertyDescriptor:function(t){if(void 0===t)return t;if(!this.IsPropertyDescriptor(t))throw new o("Desc must be a Property Descriptor");if(this.IsDataDescriptor(t))return{value:t["[[Value]]"],writable:!!t["[[Writable]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};if(this.IsAccessorDescriptor(t))return{get:t["[[Get]]"],set:t["[[Set]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};throw new o("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(t){if("Object"!==this.Type(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(p(t,"enumerable")&&(e["[[Enumerable]]"]=this.ToBoolean(t.enumerable)),p(t,"configurable")&&(e["[[Configurable]]"]=this.ToBoolean(t.configurable)),p(t,"value")&&(e["[[Value]]"]=t.value),p(t,"writable")&&(e["[[Writable]]"]=this.ToBoolean(t.writable)),p(t,"get")){var n=t.get;if(void 0!==n&&!this.IsCallable(n))throw new TypeError("getter must be a function");e["[[Get]]"]=n}if(p(t,"set")){var r=t.set;if(void 0!==r&&!this.IsCallable(r))throw new o("setter must be a function");e["[[Set]]"]=r}if((p(e,"[[Get]]")||p(e,"[[Set]]"))&&(p(e,"[[Value]]")||p(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}};t.exports=d},function(t,e,n){"use strict";var r=Object.prototype.toString,i=n(47),o=n(32),s=function(t){var e;if((e=arguments.length>1?arguments[1]:"[object Date]"===r.call(t)?String:Number)===String||e===Number){var n,s,a=e===String?["toString","valueOf"]:["valueOf","toString"];for(s=0;s1?s(t,arguments[1]):s(t)}},function(t,e,n){"use strict";var r=n(31),i=RegExp.prototype.exec,o=Object.getOwnPropertyDescriptor,s=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!a)return"[object RegExp]"===s.call(t);var e=o(t,"lastIndex");return!(!e||!r(e,"value"))&&function(t){try{var e=t.lastIndex;return t.lastIndex=0,i.call(t),!0}catch(t){return!1}finally{t.lastIndex=e}}(t)}},function(t,e,n){"use strict";var r=n(23),i=n(54);t.exports=function(){var t=i();return r(Array.prototype,{find:t},{find:function(){return Array.prototype.find!==t}}),t}},function(t,e,n){"use strict";Array.prototype.includes||(Array.prototype.includes=function(t){var e=Object(this),n=parseInt(e.length)||0;if(0===n)return!1;var r,i,o=parseInt(arguments[1])||0;for(o>=0?r=o:(r=n+o)<0&&(r=0);r2?r(t,17,i(arguments,2),null,e):r(t,1,null,null,e)}},function(t,e,n){var r=n(124),i=n(125),o=n(28),s=n(27),a=[],u=a.push,c=a.unshift;t.exports=function t(e,n,a,l,f,h){var p=1&n,d=4&n,y=16&n,v=32&n;if(!(2&n||o(e)))throw new TypeError;y&&!a.length&&(n&=-17,y=a=!1),v&&!l.length&&(n&=-33,v=l=!1);var g=e&&e.__bindData__;return g&&!0!==g?((g=s(g))[2]&&(g[2]=s(g[2])),g[3]&&(g[3]=s(g[3])),!p||1&g[1]||(g[4]=f),!p&&1&g[1]&&(n|=8),!d||4&g[1]||(g[5]=h),y&&u.apply(g[2]||(g[2]=[]),a),v&&c.apply(g[3]||(g[3]=[]),l),g[1]|=n,t.apply(null,g)):(1==n||17===n?r:i)([e,n,a,l,f,h])}},function(t,e,n){var r=n(56),i=n(18),o=n(33),s=n(27),a=[].push;t.exports=function(t){var e=t[0],n=t[2],u=t[4];function c(){if(n){var t=s(n);a.apply(t,arguments)}if(this instanceof c){var o=r(e.prototype),l=e.apply(o,t||arguments);return i(l)?l:o}return e.apply(u,t||arguments)}return o(c,t),c}},function(t,e,n){var r=n(56),i=n(18),o=n(33),s=n(27),a=[].push;t.exports=function t(e){var n=e[0],u=e[1],c=e[2],l=e[3],f=e[4],h=e[5],p=1&u,d=2&u,y=4&u,v=8&u,g=n;function m(){var e=p?f:this;if(c){var o=s(c);a.apply(o,arguments)}if((l||y)&&(o||(o=s(arguments)),l&&a.apply(o,l),y&&o.length/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:n(60),variable:"",imports:{_:{escape:r}}};t.exports=i},function(t,e,n){var r=n(12);t.exports=function(t){for(var e=-1,n=r(t),i=n.length,o=Array(i);++e=0&&Object.keys(e).forEach(function(t){n=n.replace("__"+t+"__",e[t])}),n):""}}):(o.log("Using i18next"),i18n.init({resStore:s,fallbackLng:i.language,ns:{namespaces:["general","blocks"],defaultNs:"general"}})),t.exports=s},function(t,e,n){var r,i;i=this,void 0===(r=function(){return i.Eventable=function(){var t=[].slice,e={on:function(t,e,n){if(!r(this,"on",t,[e,n])||!e)return this;this._events||(this._events={});var i=this._events[t]||(this._events[t]=[]);return i.push({callback:e,context:n,ctx:n||this}),this},once:function(t,e,n){if(!r(this,"once",t,[e,n])||!e)return this;var i=this,o=function(t){var e,n=2;return function(){return--n>0?e=t.apply(this,arguments):t=null,e}}(function(){i.off(t,o),e.apply(this,arguments)});return o._callback=e,this.on(t,o,n)},off:function(t,e,n){var i,o,s,a,u,c,l,f;if(!this._events||!r(this,"off",t,[e,n]))return this;if(!t&&!e&&!n)return this._events={},this;for(a=t?[t]:Object.keys(this._events),u=0,c=a.length;u-1};function s(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function u(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r.iterable&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function l(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function f(t){return new Promise(function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}})}function h(t){var e=new FileReader,n=f(e);return e.readAsArrayBuffer(t),n}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:r.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:r.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():r.arrayBuffer&&r.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||o(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var t=l(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var t,e,n,r=l(this);if(r)return r;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,n=f(e),e.readAsText(t),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r-1?r:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function g(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}}),e}function m(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new c(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},d.call(v.prototype),d.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},m.error=function(){var t=new m(null,{status:0,statusText:""});return t.type="error",t};var b=[301,302,303,307,308];m.redirect=function(t,e){if(-1===b.indexOf(e))throw new RangeError("Invalid status code");return new m(null,{status:e,headers:{location:t}})};var _=self.DOMException;try{new _}catch(t){(_=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack}).prototype=Object.create(Error.prototype),_.prototype.constructor=_}function w(t,e){return new Promise(function(n,i){var o=new v(t,e);if(o.signal&&o.signal.aborted)return i(new _("Aborted","AbortError"));var s=new XMLHttpRequest;function a(){s.abort()}s.onload=function(){var t,e,r={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new c,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();e.append(r,i)}}),e)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new m(i,r))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new _("Aborted","AbortError"))},s.open(o.method,o.url,!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&r.blob&&(s.responseType="blob"),o.headers.forEach(function(t,e){s.setRequestHeader(e,t)}),o.signal&&(o.signal.addEventListener("abort",a),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",a)}),s.send(void 0===o._bodyInit?null:o._bodyInit)})}w.polyfill=!0,self.fetch||(self.fetch=w,self.Headers=c,self.Request=v,self.Response=m)},function(t,e){var n=0;t.exports=function(t,e){var r,i,o,s,a=(e=e||{}).prefix||"__jp",u=e.param||"callback",c=e.timeout?e.timeout:15e3,l=document.getElementsByTagName("script")[0]||document.head,f=function(){},h=a+n++;return o=function(){r&&r.parentNode&&r.parentNode.removeChild(r),window[h]=f,i&&clearTimeout(i)},{promise:new Promise(function(e,n){c&&(i=setTimeout(function(){o(),n(new Error("Timeout"))},c)),window[h]=function(t){o(),e(t)},t=(t+=(~t.indexOf("?")?"&":"?")+u+"="+encodeURIComponent(h)).replace("?&","?"),(r=document.createElement("script")).src=t,l.parentNode.insertBefore(r,l),s=function(){window[h]&&(o(),n(new Error("Canceled")))}}),cancel:s}}},function(t,e,n){"use strict";t.exports=function(t){var e,n,r=new Promise(function(t,r){e=t,n=r});return t.then(function(t){r.cancelled||e(t)},function(t){r.cancelled||n(t)}),r.cancel=function(){this.cancelled=!0},r}},function(t,e,n){"use strict";var r=n(1),i=n(2),o=n(3),s=n(10);t.exports={mixinName:"Controllable",initializeControllable:function(){r.log("Adding controllable to block "+this.blockID),this.inner.classList.add("st-block__inner--controllable"),this.control_ui=o.createElement("div",{class:"st-block__control-ui"}),Object.keys(this.controls).forEach(function(t){this.addUiControl(t,this.controls[t].bind(this))},this),this.inner.appendChild(this.control_ui)},getControlTemplate:function(t){return o.createElement("a",{"data-icon":t,class:"st-icon st-block-control-ui-btn st-block-control-ui-btn--"+t,html:'')})},addUiControl:function(t,e){var n=this;this.control_ui.appendChild(this.getControlTemplate(t)),s.delegate(this.control_ui,".st-block-control-ui-btn--"+t,"click",function(r){n.selectUiControl(t),e(r)})},selectUiControl:function(t){var e=this;Object.keys(this.controls).forEach(function(t){e.getControlUiBtn(t).classList.remove("st-block-control-ui-btn--selected")}),this.getControlUiBtn(t).classList.add("st-block-control-ui-btn--selected")},getControlUiBtn:function(t){return this.control_ui.querySelector(".st-block-control-ui-btn--"+t)}}},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(1),s=n(3),a=n(35),u=n(4);t.exports={mixinName:"Droppable",valid_drop_file_types:["File","Files","text/plain","text/uri-list"],requireInputs:!0,initializeDroppable:function(){o.log("Adding droppable to block "+this.blockID),this.drop_options=Object.assign({},i.defaults.Block.drop_options,this.drop_options),s.hide(this.editor),this.inputs.insertAdjacentHTML("beforeend",r.template(this.drop_options.html,{block:this,_:r,config:i})),a.dropArea(this.inputs.lastElementChild).addEventListener("drop",this._handleDrop.bind(this)),this.el.classList.add("st-block--droppable"),this.inner.classList.add("st-block__inner--droppable"),this._setupKeyEvents()},_handleDrop:function(t){t.preventDefault(),t.stopPropagation();var e=t.target,n=[].slice.call(t.dataTransfer.types);e.classList.remove("st-dropzone--dragover"),n&&n.some(function(t){return this.valid_drop_file_types.includes(t)},this)&&this.onDrop(t.dataTransfer),u.trigger("block:content:dropped",this.blockID)},focus:function(){this.inner.focus()},_setupKeyEvents:function(){var t=this;this.inner.setAttribute("tabindex",0),this.inner.addEventListener("keyup",function(e){if(e.target===t.inner)switch(e.keyCode){case 13:t.mediator.trigger("block:create","Text",null,t.el,{autoFocus:!0});break;case 8:return void t.onDeleteClick.call(t,new CustomEvent("click"))}})}}},function(t,e,n){"use strict";var r=n(0),i=n(64);t.exports={mixinName:"Fetchable",initializeFetchable:function(){this.withMixin(n(34))},fetch:function(t,e,n,o){var s=r.uniqueId(this.blockID+"_fetch"),a=i.fetch(t,e);function u(t,e){t.call(this,e),this.removeQueuedItem(s)}return this.resetMessages(),this.addQueuedItem(s,a),r.isUndefined(n)||a.then(u.bind(this,n)),r.isUndefined(o)||a.catch(u.bind(this,o)),a}}},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(1);t.exports={mixinName:"Pastable",requireInputs:!0,initializePastable:function(){var t=this;o.log("Adding pastable to block "+this.blockID),this.paste_options=Object.assign({},i.defaults.Block.paste_options,this.paste_options),this.inputs.insertAdjacentHTML("beforeend",r.template(this.paste_options.html,this)),Array.prototype.forEach.call(this.$(".st-paste-block"),function(e){e.addEventListener("click",function(){var t=document.createEvent("HTMLEvents");t.initEvent("select",!0,!1),this.dispatchEvent(t)}),e.addEventListener("paste",t._handleContentPaste),e.addEventListener("submit",t._handleContentPaste)})}}},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(1),s=n(63);t.exports={mixinName:"Uploadable",uploadsCount:0,requireInputs:!0,initializeUploadable:function(){o.log("Adding uploadable to block "+this.blockID),this.withMixin(n(34)),this.upload_options=Object.assign({},i.defaults.Block.upload_options,this.upload_options),this.inputs.insertAdjacentHTML("beforeend",r.template(this.upload_options.html,this)),Array.prototype.forEach.call(this.inputs.querySelectorAll("button"),function(t){t.addEventListener("click",function(t){t.preventDefault()})}),Array.prototype.forEach.call(this.inputs.querySelectorAll("input"),function(t){t.addEventListener("change",function(t){this.onDrop(t.currentTarget)}.bind(this))}.bind(this))},uploader:function(t,e,n){return s(this,t,e,n)}}},function(t,e,n){"use strict";var r=n(13),i=n(0),o=n(68),s=n(16).trimScribeContent;t.exports={mixinName:"MultiEditable",initializeMultiEditable:function(){this.editors={}},newTextEditor:function(t,e){var n,r,s;(r=void 0===t.tagName)?((s=document.createElement("div")).innerHTML=t,n=s.querySelector(".st-block__editor")):n=t;var a=i.uniqueId("editor-");n.setAttribute("data-editorId",a),n.addEventListener("keyup",this.getSelectionForFormatter),n.addEventListener("mouseup",this.getSelectionForFormatter);var u=i.isFunction(this.configureScribe)?this.configureScribe.bind(this):null,c=o.initScribeInstance(n,this.scribeOptions,u);c.setContent(e);var l={node:r?s.removeChild(s.firstChild):n,el:n,scribe:c,id:a};return this.editors[a]=l,l},getCurrentTextEditor:function(){var t=document.activeElement.getAttribute("data-editorId"),e=this.getTextEditor(t);return e&&(this.currentEditor=e),this.currentEditor},appendToTextEditor:function(t,e){var n=this.getTextEditor(t).scribe;s(n);var i=document.createRange();i.selectNodeContents(n.el),i.collapse(!1);var o=new n.api.Selection;o.selection.removeAllRanges(),o.selection.addRange(i);var a=r(n.el);e&&n.insertHTML(e),r(n.el,{start:a.start,end:a.end})},getCurrentScribeInstance:function(){return this.getCurrentTextEditor().scribe},getTextEditor:function(t){return this.editors[t]},removeTextEditor:function(t){delete this.editors[t]},execTextBlockCommand:function(t){return o.execTextBlockCommand(this.getCurrentScribeInstance(),t)},queryTextBlockCommandState:function(t){return o.queryTextBlockCommandState(this.getCurrentScribeInstance(),t)}}},function(t,e,n){var r,i;try{r=n(66)}catch(t){r=n(66)}try{i=n(67)}catch(t){i=n(67)}function o(t,e){if(!(this instanceof o))return new o(t,e);if(this.node=this.start=this.peeked=t,this.root=e,this.closingTag=!1,this._revisit=!0,this._selects=[],this._rejects=[],t&&this.higher(t))throw new Error("root must be a parent or ancestor to node")}function s(t,e){var n="nextSibling"==t;return function(i,o,s){i=this.compile(i),o=o&&o>0?o:1;for(var a=this.node,u=this.closingTag,c=this._revisit;a;){if(r(n,u)&&a[e])a=a[e],u=!n;else if(1==a.nodeType&&!a[e]&&r(n,u)){if(u=n,!c)continue}else if(a[t])a=a[t],u=!n;else if(a=a.parentNode,u=n,!c)continue;if(!a||this.higher(a,this.root))break;if(i(a)&&this.selects(a,s)&&this.rejects(a,s)){if(--o)continue;return s||(this.node=a),this.closingTag=u,a}}return null}}t.exports=o,o.prototype.reset=function(t){return this.node=t||this.start,this},o.prototype.revisit=function(t){return this._revisit=null==t||t,this},o.prototype.opening=function(){return 1==this.node.nodeType&&(this.closingTag=!1),this},o.prototype.atOpening=function(){return!this.closingTag},o.prototype.closing=function(){return 1==this.node.nodeType&&(this.closingTag=!0),this},o.prototype.atClosing=function(){return this.closingTag},o.prototype.next=s("nextSibling","firstChild"),o.prototype.previous=o.prototype.prev=s("previousSibling","lastChild"),o.prototype.select=function(t){return t=this.compile(t),this._selects.push(t),this},o.prototype.selects=function(t,e){var n=this._selects,r=n.length;if(!r)return!0;for(var i=0;i0?this.next(t,e,!0):this.prev(t,Math.abs(e),!0):this.node},o.prototype.use=function(t){return t(this),this}},function(t,e,n){var r,i;r=[n(153),n(160),n(168),n(171),n(174),n(182),n(187),n(188),n(189),n(29),n(5),n(190),n(70)],void 0===(i=function(t,e,n,r,i,o,s,a,u,c,l,f,h){"use strict";function p(c,h){u.call(this),this.el=c,this.commands={},this.options=f.checkOptions(h),this.commandPatches={},this._plainTextFormatterFactory=new d,this._htmlFormatterFactory=new y,this.api=new o(this),this.Immutable=l;var p=s(this);this.transactionManager=new p,this.undoManager=!1,this.options.undo.enabled&&(this.options.undo.manager?this.undoManager=this.options.undo.manager:this.undoManager=new a(this.options.undo.limit,this.el),this._merge=!1,this._forceMerge=!1,this._mergeTimer=0,this._lastItem={content:""}),this.setHTML(this.getHTML()),this.el.setAttribute("contenteditable",!0),function(){var t=!1,e=this,n={handleEvent:function(n){t||("compositionstart"!==n.type?"compositionend"===n.type?(t=!1,e.transactionManager.run()):e.transactionManager.run():t=!0)}};["compositionstart","compositionend","keydown","cut","paste"].forEach(function(t){this.el.addEventListener(t,n,!1)}.bind(this))}.call(this);var v=l.OrderedSet(this.options.defaultPlugins).sort(f.sortByPlugin("setRootPElement")).filter(f.filterByBlockLevelMode(this.allowsBlockElements())).map(function(e){return t[e]}),g=l.List(this.options.defaultFormatters).filter(function(t){return!!n[t]}).map(function(t){return n[t]}),m=l.List.of(i.events),b=l.List(this.options.defaultCommandPatches).map(function(t){return i.commands[t]}),_=l.List.of("indent","insertList","outdent","redo","subscript","superscript","undo").map(function(t){return e[t]});l.List().concat(v,g,m,b,_).forEach(function(t){this.use(t())}.bind(this)),this.use(r())}function d(){this.formatters=l.List()}function y(){this.formatters={sanitize:l.List(),normalize:l.List(),export:l.List()}}return p.prototype=Object.create(u.prototype),p.prototype.node=c,p.prototype.element=p.prototype.node,p.prototype.use=function(t){return t(this),this},p.prototype.setHTML=function(t,e){this.options.undo.enabled&&(this._lastItem.content=t),e&&(this._skipFormatters=!0),this.el.innerHTML!==t&&(this.el.innerHTML=t)},p.prototype.getHTML=function(){return this.el.innerHTML},p.prototype.getContent=function(){return this._htmlFormatterFactory.formatForExport(this.getHTML().replace(/ $/,""))},p.prototype.getTextContent=function(){return this.el.textContent},p.prototype.pushHistory=function(){var t=this;if(t.options.undo.enabled){var e=t._lastItem.content.replace(/]*class="scribe-marker"[^>]*>[^<]*?<\/em>/g,"");if(t.getHTML()!==e){var n=new t.api.Selection;n.placeMarkers();var r=t.getHTML();n.removeMarkers();var i=t.undoManager.item(t.undoManager.position);return(t._merge||t._forceMerge)&&i&&t._lastItem==i[0]?t._lastItem.content=r:(t._lastItem={previousItem:t._lastItem,content:r,scribe:t,execute:function(){},undo:function(){this.scribe.restoreFromHistory(this.previousItem)},redo:function(){this.scribe.restoreFromHistory(this)}},t.undoManager.transact(t._lastItem,!1)),clearTimeout(t._mergeTimer),t._merge=!0,t._mergeTimer=setTimeout(function(){t._merge=!1},t.options.undo.interval),!0}}return!1},p.prototype.getCommand=function(t){return this.commands[t]||this.commandPatches[t]||new this.api.Command(t)},p.prototype.restoreFromHistory=function(t){this._lastItem=t,this.setHTML(t.content,!0),(new this.api.Selection).selectMarkers(),this.trigger(h.legacyContentChanged),this.trigger(h.contentChanged)},p.prototype.allowsBlockElements=function(){return this.options.allowBlockElements},p.prototype.setContent=function(t){this.allowsBlockElements()||(t+=" "),this.setHTML(t),this.trigger(h.legacyContentChanged),this.trigger(h.contentChanged)},p.prototype.insertPlainText=function(t){this.insertHTML("
").replace(/\n/g," ")})}}}.call(e,n,e,t))||(t.exports=r)},function(t,e,n){var r,i;r=[n(193),n(194),n(195),n(196)],void 0===(i=function(t,e,n,r){"use strict";return function(i){i=e.init(i);return function(e){var o=new e.api.Command("createLink");o.nodeName="A",o.execute=function(o){var s,a=new e.api.Selection,u=a.range,c=a.getContaining(function(t){return t.nodeName===this.nodeName}.bind(this)),l=c?c.href:"";if(s=o||window.prompt("Enter a link.",l),s=r.run(i.transforms.pre,s),t.emptyLink(s)){if(i&&i.validation){var f=i.validation(s);if(!f.valid)return void window.alert(f.message||"The link is not valid")}c&&(u.selectNode(c),a.selection.removeAllRanges(),a.selection.addRange(u)),s&&(t.hasKnownProtocol(s)||(s=n.process(window,s)),s=r.run(i.transforms.post,s),e.api.SimpleCommand.prototype.execute.call(this,s))}else window.alert("This link appears empty")},o.queryState=function(){return!!(new e.api.Selection).getContaining(function(t){return t.nodeName===this.nodeName}.bind(this))},e.commands.linkPrompt=o}}}.apply(e,r))||(t.exports=i)},function(t,e,n){var r;void 0===(r=function(){"use strict";var t=[/^https?\:\/\//,/^mailto\:/,/^tel\:/];return{emptyLink:function(t){return/\w/.test(t)},hasKnownProtocol:function(e){return t.some(function(t){return t.test(e)})}}}.apply(e,[]))||(t.exports=r)},function(t,e,n){var r;void 0===(r=function(){return{init:function(t){return(t=t||{}).transforms||(t.transforms={}),["pre","post"].forEach(function(e){t.transforms[e]||(t.transforms[e]=[])}),t}}}.apply(e,[]))||(t.exports=r)},function(t,e,n){(function(n){var r;void 0===(r=function(){var t=[{regexp:/@/,message:"The URL you entered appears to be an email address. Do you want to add the required “mailto:” prefix?",action:function(t){return"mailto:"+t}},{regexp:/\+?\d+/,message:"The URL you entered appears to be a telephone number. Do you want to add the required “tel:” prefix?",action:function(t){return"tel:"+t}},{regexp:/.+/,message:"The URL you entered appears to be a link. Do you want to add the required “http://” prefix?",action:function(t){return"http://"+t}}];return{process:function(e,n){for(var r=0;r0;)e.insertBefore(u.childNodes[0],u);e.removeChild(u),this._sanitize(t,e);break}for(var y=0;y3&&"function"==typeof s?(s=t(s,a,5),i-=2):i-=(s=i>2&&"function"==typeof a?a:null)?1:0,u&&e(r[1],r[2],u)&&(s=3==i?null:s,i=2);for(var c=0;++c0&&r(this._scribe.el,{start:t})},selectText:function(){var t=document.createRange();this._scribe.allowsBlockElements()?t.setStartAfter(this._scribe.el.firstChild,0):t.selectNodeContents(this._scribe.el),t.collapse(!1);var e=new this._scribe.api.Selection;e.selection.removeAllRanges(),e.selection.addRange(t)},getScribeInnerContent:function(t){var e="";if(""!==this._scribe.getTextContent()){var n=document.createElement("div");return n.innerHTML=this.getTextBlockHTML(),(e=n.children&&Array.prototype.slice.call(n.children).reduce(function(t,e){return t+e.innerHTML},"")||n.innerHTML).replace(/^[\s\uFEFF\xA0]+|$/g,"")}return e},getCaretPositionAtEnd:function(){return this.selectText(),r(this._scribe.el)},appendContent:function(t,e){e=e||{},this.focusAtEnd();var n=this.getCaretPositionAtEnd(),i=this.getScribeInnerContent();""!==i&&(t=i+t),""===t&&(window.navigator.userAgent.match(/MSIE 10/)||(t=" ")),this.setTextBlockHTML(t),this.focus(),e.keepCaretPosition&&0!==n.start&&0!==n.end&&r(this._scribe.el,{start:n.start,end:n.end})},split:function(){o(this,this._scribe)}}},function(t,e,n){"use strict";var r=n(8),i=n(22),o=n(90),s=n(228),a=n(40),u=n(41);t.exports=r.extend({type:"text",editorHTML:'',icon_name:"text",mergeable:!0,textable:!0,toolbarEnabled:!1,configureScribe:function(t){t.use(new o(this)),t.use(new s(this)),t.use(new a(this)),t.use(new u(this)),t.on("content-changed",this.toggleEmptyClass.bind(this))},scribeOptions:{allowBlockElements:!0,tags:{p:!0}},loadData:function(t){this.options.convertFromMarkdown&&"html"!==t.format?this.setTextBlockHTML(i(t.text,this.type)):this.setTextBlockHTML(t.text)},onBlockRender:function(){this.toggleEmptyClass()},toggleEmptyClass:function(){this.el.classList.toggle("st-block--empty",this.isEmpty())},isEmpty:function(){return""===this._scribe.getTextContent()},asClipboardHTML:function(){var t=this.getBlockData();return"".concat(t.text)}})},function(t,e,n){"use strict";var r=n(224),i=n(88),o=n(225);t.exports=function(t){return"\n