From becb6a5fd6a5d61c9afc74bfcb68e95ba54cb57d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Tue, 23 Feb 2021 17:24:55 -0500 Subject: [PATCH] 1.0.0 --- DESCRIPTION | 2 +- Project.toml | 2 +- R/internal.R | 4 ++-- dash_textarea_autocomplete/DashTextareaAutocomplete.py | 7 +------ .../dash_textarea_autocomplete.min.js | 2 +- .../dash_textarea_autocomplete.min.js.map | 2 +- dash_textarea_autocomplete/metadata.json | 6 +----- dash_textarea_autocomplete/package-info.json | 3 ++- deps/dash_textarea_autocomplete.min.js | 2 +- deps/dash_textarea_autocomplete.min.js.map | 2 +- inst/deps/dash_textarea_autocomplete.min.js | 2 +- inst/deps/dash_textarea_autocomplete.min.js.map | 2 +- package-lock.json | 2 +- package.json | 2 +- src/DashTextareaAutocomplete.jl | 6 +++--- 15 files changed, 19 insertions(+), 27 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 84afd43..54fc3bc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: dashTextareaAutocomplete Title: Dash component wrapper for `react-textarea-autocomplete` -Version: 0.2.0 +Version: 1.0.0 Description: Dash component wrapper for `react-textarea-autocomplete` Depends: R (>= 3.0.2) Imports: diff --git a/Project.toml b/Project.toml index da0b01b..3016d05 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "DashTextareaAutocomplete" uuid = "1b08a953-4be3-4667-9a23-5aadec407a69" authors = ["Etienne Tetreault-Pinard "] -version = "0.2.0" +version = "1.0.0" [deps] Dash = "1b08a953-4be3-4667-9a23-3db579824955" diff --git a/R/internal.R b/R/internal.R index a8ee599..e0db0d9 100644 --- a/R/internal.R +++ b/R/internal.R @@ -1,12 +1,12 @@ .dashTextareaAutocomplete_js_metadata <- function() { deps_metadata <- list(`dash_textarea_autocomplete` = structure(list(name = "dash_textarea_autocomplete", -version = "0.2.0", src = list(href = NULL, +version = "1.0.0", src = list(href = NULL, file = "deps"), meta = NULL, script = 'dash_textarea_autocomplete.min.js', stylesheet = NULL, head = NULL, attachment = NULL, package = "dashTextareaAutocomplete", all_files = FALSE), class = "html_dependency"), `dash_textarea_autocomplete` = structure(list(name = "dash_textarea_autocomplete", -version = "0.2.0", src = list(href = NULL, +version = "1.0.0", src = list(href = NULL, file = "deps"), meta = NULL, script = 'dash_textarea_autocomplete.min.js.map', stylesheet = NULL, head = NULL, attachment = NULL, package = "dashTextareaAutocomplete", diff --git a/dash_textarea_autocomplete/DashTextareaAutocomplete.py b/dash_textarea_autocomplete/DashTextareaAutocomplete.py index 9bff7dc..e34f156 100644 --- a/dash_textarea_autocomplete/DashTextareaAutocomplete.py +++ b/dash_textarea_autocomplete/DashTextareaAutocomplete.py @@ -25,12 +25,7 @@ class DashTextareaAutocomplete(Component): - listStyle (dict; optional): Style of the list wrapper (from `react-textarea-autocomplete`). - itemStyle (dict; optional): Styles of the items wrapper. - loaderStyle (dict; optional): Style of the loader wrapper (from `react-textarea-autocomplete`). -- containerStyle (dict; default { - marginTop: 20, - width: 400, - height: 100, - margin: "20px auto" -}): Styles of the textarea container (from `react-textarea-autocomplete`). +- containerStyle (dict; optional): Styles of the textarea container (from `react-textarea-autocomplete`). - dropdownStyle (dict; optional): Styles of the dropdown wrapper.""" @_explicitize_args def __init__(self, id=Component.UNDEFINED, value=Component.UNDEFINED, placeholder=Component.UNDEFINED, wordList=Component.REQUIRED, triggerChar=Component.UNDEFINED, minChar=Component.UNDEFINED, className=Component.UNDEFINED, containerClassName=Component.UNDEFINED, style=Component.UNDEFINED, listStyle=Component.UNDEFINED, itemStyle=Component.UNDEFINED, loaderStyle=Component.UNDEFINED, containerStyle=Component.UNDEFINED, dropdownStyle=Component.UNDEFINED, **kwargs): diff --git a/dash_textarea_autocomplete/dash_textarea_autocomplete.min.js b/dash_textarea_autocomplete/dash_textarea_autocomplete.min.js index a5efdc2..e311947 100644 --- a/dash_textarea_autocomplete/dash_textarea_autocomplete.min.js +++ b/dash_textarea_autocomplete/dash_textarea_autocomplete.min.js @@ -1,2 +1,2 @@ -window.dash_textarea_autocomplete=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}([function(e,t){e.exports=window.React},function(e,t){e.exports=window.PropTypes},function(e,t){e.exports=window.ReactDOM},function(e,t,n){!function(){var t=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],n="undefined"!=typeof window,r=n&&null!=window.mozInnerScreenX;function o(e,o,i){if(!n)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var a=i&&i.debug||!1;if(a){var s=document.querySelector("#input-textarea-caret-position-mirror-div");s&&s.parentNode.removeChild(s)}var c=document.createElement("div");c.id="input-textarea-caret-position-mirror-div",document.body.appendChild(c);var l=c.style,u=window.getComputedStyle?getComputedStyle(e):e.currentStyle;l.whiteSpace="pre-wrap","INPUT"!==e.nodeName&&(l.wordWrap="break-word"),l.position="absolute",a||(l.visibility="hidden"),t.forEach((function(e){l[e]=u[e]})),r?e.scrollHeight>parseInt(u.height)&&(l.overflowY="scroll"):l.overflow="hidden",c.textContent=e.value.substring(0,o),"INPUT"===e.nodeName&&(c.textContent=c.textContent.replace(/\s/g," "));var f=document.createElement("span");f.textContent=e.value.substring(o)||".",c.appendChild(f);var p={top:f.offsetTop+parseInt(u.borderTopWidth),left:f.offsetLeft+parseInt(u.borderLeftWidth)};return a?f.style.backgroundColor="#aaa":document.body.removeChild(c),p}void 0!==e.exports?e.exports=o:n&&(window.getCaretCoordinates=o)}()},function(e,t,n){(function(t){var n=t.CustomEvent;e.exports=function(){try{var e=new n("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?n:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=Boolean(t.bubbles),n.cancelable=Boolean(t.cancelable),n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n}}).call(this,n(5))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(7);"string"==typeof r&&(r=[[e.i,r,""]]);var o={insertAt:"top",hmr:!0,transform:void 0,insertInto:void 0};n(9)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(t=n(8)(!1)).push([e.i,".rta {\n position: relative;\n font-size: 18px;\n width: 100%;\n height: 100%;\n}\n.rta__loader.rta__loader--empty-suggestion-data {\n border-radius: 3px;\n box-shadow: 0 0 5px rgba(27, 31, 35, 0.1);\n padding: 5px;\n}\n.rta--loading .rta__loader.rta__loader--suggestion-data {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(255, 255, 255, 0.8);\n}\n.rta--loading .rta__loader.rta__loader--suggestion-data > * {\n position: relative;\n top: 50%;\n}\n.rta__textarea {\n width: 100%;\n height: 100%;\n font-size: 1em;\n}\n.rta__autocomplete {\n position: absolute;\n display: block;\n margin-top: 1em;\n}\n.rta__autocomplete--top {\n margin-top: 0;\n margin-bottom: 1em;\n}\n.rta__list {\n margin: 0;\n padding: 0;\n background: #fff;\n border: 1px solid #dfe2e5;\n border-radius: 3px;\n box-shadow: 0 0 5px rgba(27, 31, 35, 0.1);\n list-style: none;\n}\n.rta__entity {\n background: white;\n width: 100%;\n text-align: left;\n outline: none;\n}\n.rta__entity:hover {\n cursor: pointer;\n}\n.rta__item:not(:last-child) {\n border-bottom: 1px solid #dfe2e5;\n}\n.rta__entity > * {\n padding-left: 4px;\n padding-right: 4px;\n}\n.rta__entity--selected {\n color: #fff;\n text-decoration: none;\n background: #0366d6;\n}\n",""]),e.exports=t},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(a=r,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(c," */")),i=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return[n].concat(i).concat([o]).join("\n")}var a,s,c;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i=0&&f.splice(t,1)}function y(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=function(){0;return n.nc}();r&&(e.attrs.nonce=r)}return v(t,e.attrs),g(e,t),t}function v(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function b(e,t){var n,r,o,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var a=u++;n=l||(l=y(t)),r=_.bind(null,n,a,!1),o=_.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",v(t,e.attrs),g(e,t),t}(t),r=S.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=y(t),r=T.bind(null,n),o=function(){m(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=h(e,t);return d(n,t),function(e){for(var r=[],o=0;o1&&void 0!==arguments[1]&&arguments[1],r=n.props.onItemHighlighted;n.state.selectedItem!==e&&n.setState({selectedItem:e},(function(){r(e),t&&n.props.dropdownScroll(n.itemsRef[n.getId(e)])}))},n.scroll=function(e){e.preventDefault();var t,r=n.props.values,o=e.keyCode||e.which,i=n.getPositionInList();switch(o){case S.DOWN:t=i+1;break;case S.UP:t=i-1;break;default:t=i}t=(t%r.length+r.length)%r.length,n.selectItem(r[t],[S.DOWN,S.UP].includes(o))},n.isSelected=function(e){var t=n.state.selectedItem;return!!t&&n.getId(t)===n.getId(e)},n}return _(t,e),m(t,[{key:"componentDidMount",value:function(){this.listeners.push(C.add([S.DOWN,S.UP],this.scroll),C.add([S.ENTER,S.TAB],this.onPressEnter));var e=this.props.values;e&&e[0]&&this.selectItem(e[0])}},{key:"componentDidUpdate",value:function(e){var t=this,n=e.values,r=this.props.values;n.map((function(e){return t.getId(e)})).join("")!==r.map((function(e){return t.getId(e)})).join("")&&r&&r[0]&&this.selectItem(r[0])}},{key:"componentWillUnmount",value:function(){for(var e;this.listeners.length;)e=this.listeners.pop(),C.remove(e)}},{key:"render",value:function(){var e=this,t=this.props,n=t.values,r=t.component,i=t.style,a=t.itemClassName,s=t.className,c=t.itemStyle;return o.a.createElement("ul",{className:"rta__list ".concat(s||""),style:i},n.map((function(t){return o.a.createElement(E,{key:e.getId(t),innerRef:function(n){e.itemsRef[e.getId(t)]=n},selected:e.isSelected(t),item:t,className:a,style:c,onClickHandler:e.onPressEnter,onSelectHandler:e.selectItem,component:r})})))}}]),t}(o.a.Component);var O={LEFT:"rta__autocomplete--left",RIGHT:"rta__autocomplete--right"},I={TOP:"rta__autocomplete--top",BOTTOM:"rta__autocomplete--bottom"},P=function(e){return console.error("RTA: dataProvider fails: ".concat(e,"\n \nCheck the documentation or create issue if you think it's bug. https://github.com/webscopeio/react-textarea-autocomplete/issues"))},k=[".","^","$","*","+","-","?","(",")","[","]","{","}","\\","|"],j=function(e){return T(e).map((function(e){return k.includes(e)?"\\".concat(e):e})).join("")},L=function(e){function t(){return h(this,t),b(this,w(t).apply(this,arguments))}return _(t,e),m(t,[{key:"componentDidMount",value:function(){var e=this.props.boundariesElement;if("string"==typeof e){var t=document.querySelector(e);if(!t)throw new Error("RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.");this.containerElem=t}else{if(!(e instanceof HTMLElement))throw new Error("RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.");this.containerElem=e}if(!this.containerElem||!this.containerElem.contains(this.ref))throw new Error("RTA: Invalid prop boundariesElement: it has to be one of the parents of the RTA.")}},{key:"componentDidUpdate",value:function(){var e,t,n=this.props.top||0,r=this.props.left||0,o=[],i=[],a=0,s=0,c=this.containerElem.getBoundingClientRect(),l=this.ref.getBoundingClientRect(),u=this.props.textareaRef.getBoundingClientRect(),f=window.getComputedStyle(this.ref),p=parseInt(f.getPropertyValue("margin-top"),10),d=parseInt(f.getPropertyValue("margin-bottom"),10),h=parseInt(f.getPropertyValue("margin-left"),10),g=parseInt(f.getPropertyValue("margin-right"),10),m=p+d+u.top+n+l.height;h+g+u.left+r+l.width>c.right?(s=r-l.width,o.push(O.LEFT),i.push(O.RIGHT)):(s=r,o.push(O.RIGHT),i.push(O.LEFT)),m>c.bottom?(a=n-l.height,o.push(I.TOP),i.push(I.BOTTOM)):(a=n,o.push(I.BOTTOM),i.push(I.TOP)),this.props.renderToBody&&(a+=u.top,s+=u.left),this.ref.style.top="".concat(a,"px"),this.ref.style.left="".concat(s,"px"),(e=this.ref.classList).remove.apply(e,i),(t=this.ref.classList).add.apply(t,o)}},{key:"render",value:function(){var e=this,t=this.props,n=t.style,r=t.className,i=t.innerRef,a=t.children,s=t.renderToBody,l=document.body,u=o.a.createElement("div",{ref:function(t){e.ref=t,i(t)},className:"rta__autocomplete ".concat(r||""),style:n},a);return s&&null!==l?c.a.createPortal(u,l):u}}]),t}(o.a.Component),A=function(e){function t(e){var n;h(this,t),(n=b(this,w(t).call(this,e))).state={top:null,left:null,currentTrigger:null,actualToken:"",data:null,value:"",dataLoading:!1,selectionEnd:0,component:null,textToReplace:null},n.escListenerInit=function(){n.escListener||(n.escListener=C.add(S.ESC,n._closeAutocomplete))},n.escListenerDestroy=function(){n.escListener&&(C.remove(n.escListener),n.escListener=null)},n.getSelectionPosition=function(){return n.textareaRef?{selectionStart:n.textareaRef.selectionStart,selectionEnd:n.textareaRef.selectionEnd}:null},n.getSelectedText=function(){if(!n.textareaRef)return null;var e=n.textareaRef,t=e.selectionStart,r=e.selectionEnd;return t===r?null:n.state.value.substr(t,r-t)},n.setCaretPosition=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;n.textareaRef&&(n.textareaRef.focus(),n.textareaRef.setSelectionRange(e,e))},n.getCaretPosition=function(){return n.textareaRef?n.textareaRef.selectionEnd:0},n._handleCaretChange=function(e){var t=function(){var e=n.getCaretPosition()-1;n.lastTrigger=n.lastTrigger?e:0};if("keydown"!==e.type)t();else switch(e.keyCode||e.which){case S.UP:case S.DOWN:n._isAutocompleteOpen()||t();break;case S.LEFT:case S.RIGHT:t()}},n._onSelect=function(e){var t=n.state,r=t.selectionEnd,o=t.currentTrigger,i=t.value,a=n.props,s=a.trigger,c=a.onItemSelected;if(o){var l=n._getTextToReplace(o);if(l){var u=l(e);if(u){c&&c({currentTrigger:o,item:e});var f=i.slice(0,r),p=f.search(new RegExp("".concat(j(o),"[^".concat(j(o)).concat(s[o].allowWhitespace?"":"\\s","]"),"*$"))),d="next"===u.caretPosition?"".concat(u.text," "):u.text,h=function(e,t,n){switch(e){case"start":return n;case"next":case"end":return n+t.length;default:if(!Number.isInteger(e))throw new Error('RTA: caretPosition should be "start", "next", "end" or number.');return e}}(u.caretPosition,d,p),g=f.substring(0,p)+d,m=i.replace(f,g);n.setState({value:m,dataLoading:!1},(function(){var e=n.tokenRegExpEnding.exec(d),t=e?e[0].length:1;n.lastTrigger=h?h-t:h,n.textareaRef.value=m,n.textareaRef.selectionEnd=h,n._changeHandler();var r=n.textareaRef.scrollTop;n.setCaretPosition(h),window.chrome&&(n.textareaRef.scrollTop=r)}))}else n._closeAutocomplete()}else n._closeAutocomplete()}},n._getTextToReplace=function(e){var t=n.props.trigger[e];if(!e||!t)return null;var r=t.output;return function(t){if("object"==typeof t&&(!r||"function"!=typeof r))throw new Error('Output functor is not defined! If you are using items as object you have to define "output" function. https://github.com/webscopeio/react-textarea-autocomplete#trigger-type');if(r){var n=r(t,e);if(void 0===n||"number"==typeof n)throw new Error('Output functor should return string or object in shape {text: string, caretPosition: string | number}.\nGot "'.concat(String(n),'". Check the implementation for trigger "').concat(e,'"\n\nSee https://github.com/webscopeio/react-textarea-autocomplete#trigger-type for more information.\n'));if(null===n)return null;if("string"==typeof n)return{text:n,caretPosition:"next"};if(!n.text&&"string"!=typeof n.text)throw new Error('Output "text" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "'.concat(e,'"\n'));if(!n.caretPosition)throw new Error('Output "caretPosition" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "'.concat(e,'"\n'));return n}if("string"!=typeof t)throw new Error("Output item should be string\n");return{text:"".concat(e).concat(t).concat(e),caretPosition:"next"}}},n._getCurrentTriggerSettings=function(){var e=n.state.currentTrigger;return e?n.props.trigger[e]:null},n._getValuesFromProvider=function(){var e=n.state,t=e.currentTrigger,r=e.actualToken,o=n._getCurrentTriggerSettings();if(t&&o){var i=o.dataProvider,a=o.component;if("function"!=typeof i)throw new Error("Trigger provider has to be a function!");n.setState({dataLoading:!0});var s=i(r);s instanceof Promise||(s=Promise.resolve(s)),s.then((function(e){if(!Array.isArray(e))throw new Error("Trigger provider has to provide an array!");if("function"!=typeof a)throw new Error("Component should be defined!");t===n.state.currentTrigger&&(e.length?n.setState({dataLoading:!1,data:e,component:a}):n._closeAutocomplete())})).catch((function(e){return P(e.message)}))}},n._getSuggestions=function(){var e=n.state,t=e.currentTrigger,r=e.data;return!t||!r||r&&!r.length?null:r},n._createRegExp=function(){var e=n.props.trigger;n.tokenRegExp=new RegExp("(".concat(Object.keys(e).sort((function(e,t){return et?-1:0})).map((function(e){return j(e)})).join("|"),")((?:(?!\\1)[^\\s])*$)")),n.tokenRegExpEnding=new RegExp("(".concat(Object.keys(e).sort((function(e,t){return et?-1:0})).map((function(e){return j(e)})).join("|"),")$"))},n._closeAutocomplete=function(){var e=n.state.currentTrigger;n.escListenerDestroy(),n.setState({data:null,dataLoading:!1,currentTrigger:null},(function(){e&&n._onItemHighlightedHandler(null)}))},n._cleanUpProps=function(){var e=function(e){for(var t=1;tparseInt(u.height)&&(l.overflowY="scroll"):l.overflow="hidden",c.textContent=e.value.substring(0,o),"INPUT"===e.nodeName&&(c.textContent=c.textContent.replace(/\s/g," "));var f=document.createElement("span");f.textContent=e.value.substring(o)||".",c.appendChild(f);var p={top:f.offsetTop+parseInt(u.borderTopWidth),left:f.offsetLeft+parseInt(u.borderLeftWidth)};return a?f.style.backgroundColor="#aaa":document.body.removeChild(c),p}void 0!==e.exports?e.exports=o:n&&(window.getCaretCoordinates=o)}()},function(e,t,n){(function(t){var n=t.CustomEvent;e.exports=function(){try{var e=new n("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?n:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=Boolean(t.bubbles),n.cancelable=Boolean(t.cancelable),n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n}}).call(this,n(5))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(7);"string"==typeof r&&(r=[[e.i,r,""]]);var o={insertAt:"top",hmr:!0,transform:void 0,insertInto:void 0};n(9)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){(t=n(8)(!1)).push([e.i,".rta {\n position: relative;\n font-size: 18px;\n width: 100%;\n height: 100%;\n}\n.rta__loader.rta__loader--empty-suggestion-data {\n border-radius: 3px;\n box-shadow: 0 0 5px rgba(27, 31, 35, 0.1);\n padding: 5px;\n}\n.rta--loading .rta__loader.rta__loader--suggestion-data {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(255, 255, 255, 0.8);\n}\n.rta--loading .rta__loader.rta__loader--suggestion-data > * {\n position: relative;\n top: 50%;\n}\n.rta__textarea {\n width: 100%;\n height: 100%;\n font-size: 1em;\n}\n.rta__autocomplete {\n position: absolute;\n display: block;\n margin-top: 1em;\n}\n.rta__autocomplete--top {\n margin-top: 0;\n margin-bottom: 1em;\n}\n.rta__list {\n margin: 0;\n padding: 0;\n background: #fff;\n border: 1px solid #dfe2e5;\n border-radius: 3px;\n box-shadow: 0 0 5px rgba(27, 31, 35, 0.1);\n list-style: none;\n}\n.rta__entity {\n background: white;\n width: 100%;\n text-align: left;\n outline: none;\n}\n.rta__entity:hover {\n cursor: pointer;\n}\n.rta__item:not(:last-child) {\n border-bottom: 1px solid #dfe2e5;\n}\n.rta__entity > * {\n padding-left: 4px;\n padding-right: 4px;\n}\n.rta__entity--selected {\n color: #fff;\n text-decoration: none;\n background: #0366d6;\n}\n",""]),e.exports=t},function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(a=r,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(c," */")),i=r.sources.map((function(e){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(e," */")}));return[n].concat(i).concat([o]).join("\n")}var a,s,c;return[n].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i=0&&f.splice(t,1)}function y(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=function(){0;return n.nc}();r&&(e.attrs.nonce=r)}return v(t,e.attrs),g(e,t),t}function v(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function b(e,t){var n,r,o,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var a=u++;n=l||(l=y(t)),r=_.bind(null,n,a,!1),o=_.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",v(t,e.attrs),g(e,t),t}(t),r=S.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=y(t),r=T.bind(null,n),o=function(){m(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=h(e,t);return d(n,t),function(e){for(var r=[],o=0;o1&&void 0!==arguments[1]&&arguments[1],r=n.props.onItemHighlighted;n.state.selectedItem!==e&&n.setState({selectedItem:e},(function(){r(e),t&&n.props.dropdownScroll(n.itemsRef[n.getId(e)])}))},n.scroll=function(e){e.preventDefault();var t,r=n.props.values,o=e.keyCode||e.which,i=n.getPositionInList();switch(o){case S.DOWN:t=i+1;break;case S.UP:t=i-1;break;default:t=i}t=(t%r.length+r.length)%r.length,n.selectItem(r[t],[S.DOWN,S.UP].includes(o))},n.isSelected=function(e){var t=n.state.selectedItem;return!!t&&n.getId(t)===n.getId(e)},n}return _(t,e),m(t,[{key:"componentDidMount",value:function(){this.listeners.push(C.add([S.DOWN,S.UP],this.scroll),C.add([S.ENTER,S.TAB],this.onPressEnter));var e=this.props.values;e&&e[0]&&this.selectItem(e[0])}},{key:"componentDidUpdate",value:function(e){var t=this,n=e.values,r=this.props.values;n.map((function(e){return t.getId(e)})).join("")!==r.map((function(e){return t.getId(e)})).join("")&&r&&r[0]&&this.selectItem(r[0])}},{key:"componentWillUnmount",value:function(){for(var e;this.listeners.length;)e=this.listeners.pop(),C.remove(e)}},{key:"render",value:function(){var e=this,t=this.props,n=t.values,r=t.component,i=t.style,a=t.itemClassName,s=t.className,c=t.itemStyle;return o.a.createElement("ul",{className:"rta__list ".concat(s||""),style:i},n.map((function(t){return o.a.createElement(E,{key:e.getId(t),innerRef:function(n){e.itemsRef[e.getId(t)]=n},selected:e.isSelected(t),item:t,className:a,style:c,onClickHandler:e.onPressEnter,onSelectHandler:e.selectItem,component:r})})))}}]),t}(o.a.Component);var O={LEFT:"rta__autocomplete--left",RIGHT:"rta__autocomplete--right"},I={TOP:"rta__autocomplete--top",BOTTOM:"rta__autocomplete--bottom"},P=function(e){return console.error("RTA: dataProvider fails: ".concat(e,"\n \nCheck the documentation or create issue if you think it's bug. https://github.com/webscopeio/react-textarea-autocomplete/issues"))},k=[".","^","$","*","+","-","?","(",")","[","]","{","}","\\","|"],j=function(e){return T(e).map((function(e){return k.includes(e)?"\\".concat(e):e})).join("")},L=function(e){function t(){return h(this,t),b(this,w(t).apply(this,arguments))}return _(t,e),m(t,[{key:"componentDidMount",value:function(){var e=this.props.boundariesElement;if("string"==typeof e){var t=document.querySelector(e);if(!t)throw new Error("RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.");this.containerElem=t}else{if(!(e instanceof HTMLElement))throw new Error("RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.");this.containerElem=e}if(!this.containerElem||!this.containerElem.contains(this.ref))throw new Error("RTA: Invalid prop boundariesElement: it has to be one of the parents of the RTA.")}},{key:"componentDidUpdate",value:function(){var e,t,n=this.props.top||0,r=this.props.left||0,o=[],i=[],a=0,s=0,c=this.containerElem.getBoundingClientRect(),l=this.ref.getBoundingClientRect(),u=this.props.textareaRef.getBoundingClientRect(),f=window.getComputedStyle(this.ref),p=parseInt(f.getPropertyValue("margin-top"),10),d=parseInt(f.getPropertyValue("margin-bottom"),10),h=parseInt(f.getPropertyValue("margin-left"),10),g=parseInt(f.getPropertyValue("margin-right"),10),m=p+d+u.top+n+l.height;h+g+u.left+r+l.width>c.right?(s=r-l.width,o.push(O.LEFT),i.push(O.RIGHT)):(s=r,o.push(O.RIGHT),i.push(O.LEFT)),m>c.bottom?(a=n-l.height,o.push(I.TOP),i.push(I.BOTTOM)):(a=n,o.push(I.BOTTOM),i.push(I.TOP)),this.props.renderToBody&&(a+=u.top,s+=u.left),this.ref.style.top="".concat(a,"px"),this.ref.style.left="".concat(s,"px"),(e=this.ref.classList).remove.apply(e,i),(t=this.ref.classList).add.apply(t,o)}},{key:"render",value:function(){var e=this,t=this.props,n=t.style,r=t.className,i=t.innerRef,a=t.children,s=t.renderToBody,l=document.body,u=o.a.createElement("div",{ref:function(t){e.ref=t,i(t)},className:"rta__autocomplete ".concat(r||""),style:n},a);return s&&null!==l?c.a.createPortal(u,l):u}}]),t}(o.a.Component),A=function(e){function t(e){var n;h(this,t),(n=b(this,w(t).call(this,e))).state={top:null,left:null,currentTrigger:null,actualToken:"",data:null,value:"",dataLoading:!1,selectionEnd:0,component:null,textToReplace:null},n.escListenerInit=function(){n.escListener||(n.escListener=C.add(S.ESC,n._closeAutocomplete))},n.escListenerDestroy=function(){n.escListener&&(C.remove(n.escListener),n.escListener=null)},n.getSelectionPosition=function(){return n.textareaRef?{selectionStart:n.textareaRef.selectionStart,selectionEnd:n.textareaRef.selectionEnd}:null},n.getSelectedText=function(){if(!n.textareaRef)return null;var e=n.textareaRef,t=e.selectionStart,r=e.selectionEnd;return t===r?null:n.state.value.substr(t,r-t)},n.setCaretPosition=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;n.textareaRef&&(n.textareaRef.focus(),n.textareaRef.setSelectionRange(e,e))},n.getCaretPosition=function(){return n.textareaRef?n.textareaRef.selectionEnd:0},n._handleCaretChange=function(e){var t=function(){var e=n.getCaretPosition()-1;n.lastTrigger=n.lastTrigger?e:0};if("keydown"!==e.type)t();else switch(e.keyCode||e.which){case S.UP:case S.DOWN:n._isAutocompleteOpen()||t();break;case S.LEFT:case S.RIGHT:t()}},n._onSelect=function(e){var t=n.state,r=t.selectionEnd,o=t.currentTrigger,i=t.value,a=n.props,s=a.trigger,c=a.onItemSelected;if(o){var l=n._getTextToReplace(o);if(l){var u=l(e);if(u){c&&c({currentTrigger:o,item:e});var f=i.slice(0,r),p=f.search(new RegExp("".concat(j(o),"[^".concat(j(o)).concat(s[o].allowWhitespace?"":"\\s","]"),"*$"))),d="next"===u.caretPosition?"".concat(u.text," "):u.text,h=function(e,t,n){switch(e){case"start":return n;case"next":case"end":return n+t.length;default:if(!Number.isInteger(e))throw new Error('RTA: caretPosition should be "start", "next", "end" or number.');return e}}(u.caretPosition,d,p),g=f.substring(0,p)+d,m=i.replace(f,g);n.setState({value:m,dataLoading:!1},(function(){var e=n.tokenRegExpEnding.exec(d),t=e?e[0].length:1;n.lastTrigger=h?h-t:h,n.textareaRef.value=m,n.textareaRef.selectionEnd=h,n._changeHandler();var r=n.textareaRef.scrollTop;n.setCaretPosition(h),window.chrome&&(n.textareaRef.scrollTop=r)}))}else n._closeAutocomplete()}else n._closeAutocomplete()}},n._getTextToReplace=function(e){var t=n.props.trigger[e];if(!e||!t)return null;var r=t.output;return function(t){if("object"==typeof t&&(!r||"function"!=typeof r))throw new Error('Output functor is not defined! If you are using items as object you have to define "output" function. https://github.com/webscopeio/react-textarea-autocomplete#trigger-type');if(r){var n=r(t,e);if(void 0===n||"number"==typeof n)throw new Error('Output functor should return string or object in shape {text: string, caretPosition: string | number}.\nGot "'.concat(String(n),'". Check the implementation for trigger "').concat(e,'"\n\nSee https://github.com/webscopeio/react-textarea-autocomplete#trigger-type for more information.\n'));if(null===n)return null;if("string"==typeof n)return{text:n,caretPosition:"next"};if(!n.text&&"string"!=typeof n.text)throw new Error('Output "text" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "'.concat(e,'"\n'));if(!n.caretPosition)throw new Error('Output "caretPosition" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "'.concat(e,'"\n'));return n}if("string"!=typeof t)throw new Error("Output item should be string\n");return{text:"".concat(e).concat(t).concat(e),caretPosition:"next"}}},n._getCurrentTriggerSettings=function(){var e=n.state.currentTrigger;return e?n.props.trigger[e]:null},n._getValuesFromProvider=function(){var e=n.state,t=e.currentTrigger,r=e.actualToken,o=n._getCurrentTriggerSettings();if(t&&o){var i=o.dataProvider,a=o.component;if("function"!=typeof i)throw new Error("Trigger provider has to be a function!");n.setState({dataLoading:!0});var s=i(r);s instanceof Promise||(s=Promise.resolve(s)),s.then((function(e){if(!Array.isArray(e))throw new Error("Trigger provider has to provide an array!");if("function"!=typeof a)throw new Error("Component should be defined!");t===n.state.currentTrigger&&(e.length?n.setState({dataLoading:!1,data:e,component:a}):n._closeAutocomplete())})).catch((function(e){return P(e.message)}))}},n._getSuggestions=function(){var e=n.state,t=e.currentTrigger,r=e.data;return!t||!r||r&&!r.length?null:r},n._createRegExp=function(){var e=n.props.trigger;n.tokenRegExp=new RegExp("(".concat(Object.keys(e).sort((function(e,t){return et?-1:0})).map((function(e){return j(e)})).join("|"),")((?:(?!\\1)[^\\s])*$)")),n.tokenRegExpEnding=new RegExp("(".concat(Object.keys(e).sort((function(e,t){return et?-1:0})).map((function(e){return j(e)})).join("|"),")$"))},n._closeAutocomplete=function(){var e=n.state.currentTrigger;n.escListenerDestroy(),n.setState({data:null,dataLoading:!1,currentTrigger:null},(function(){e&&n._onItemHighlightedHandler(null)}))},n._cleanUpProps=function(){var e=function(e){for(var t=1;t padding,\n// so we have to do every single property specifically.\nvar properties = [\n 'direction', // RTL support\n 'boxSizing',\n 'width', // on Chrome and IE, exclude the scrollbar, so the mirror div wraps exactly as the textarea does\n 'height',\n 'overflowX',\n 'overflowY', // copy the scrollbar for IE\n\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'borderStyle',\n\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/font\n 'fontStyle',\n 'fontVariant',\n 'fontWeight',\n 'fontStretch',\n 'fontSize',\n 'fontSizeAdjust',\n 'lineHeight',\n 'fontFamily',\n\n 'textAlign',\n 'textTransform',\n 'textIndent',\n 'textDecoration', // might not make a difference, but better be safe\n\n 'letterSpacing',\n 'wordSpacing',\n\n 'tabSize',\n 'MozTabSize'\n\n];\n\nvar isBrowser = (typeof window !== 'undefined');\nvar isFirefox = (isBrowser && window.mozInnerScreenX != null);\n\nfunction getCaretCoordinates(element, position, options) {\n if(!isBrowser) {\n throw new Error('textarea-caret-position#getCaretCoordinates should only be called in a browser');\n }\n\n var debug = options && options.debug || false;\n if (debug) {\n var el = document.querySelector('#input-textarea-caret-position-mirror-div');\n if ( el ) { el.parentNode.removeChild(el); }\n }\n\n // mirrored div\n var div = document.createElement('div');\n div.id = 'input-textarea-caret-position-mirror-div';\n document.body.appendChild(div);\n\n var style = div.style;\n var computed = window.getComputedStyle? getComputedStyle(element) : element.currentStyle; // currentStyle for IE < 9\n\n // default textarea styles\n style.whiteSpace = 'pre-wrap';\n if (element.nodeName !== 'INPUT')\n style.wordWrap = 'break-word'; // only for textarea-s\n\n // position off-screen\n style.position = 'absolute'; // required to return coordinates properly\n if (!debug)\n style.visibility = 'hidden'; // not 'display: none' because we want rendering\n\n // transfer the element's properties to the div\n properties.forEach(function (prop) {\n style[prop] = computed[prop];\n });\n\n if (isFirefox) {\n // Firefox lies about the overflow property for textareas: https://bugzilla.mozilla.org/show_bug.cgi?id=984275\n if (element.scrollHeight > parseInt(computed.height))\n style.overflowY = 'scroll';\n } else {\n style.overflow = 'hidden'; // for Chrome to not render a scrollbar; IE keeps overflowY = 'scroll'\n }\n\n div.textContent = element.value.substring(0, position);\n // the second special handling for input type=\"text\" vs textarea: spaces need to be replaced with non-breaking spaces - http://stackoverflow.com/a/13402035/1269037\n if (element.nodeName === 'INPUT')\n div.textContent = div.textContent.replace(/\\s/g, '\\u00a0');\n\n var span = document.createElement('span');\n // Wrapping must be replicated *exactly*, including when a long word gets\n // onto the next line, with whitespace at the end of the line before (#7).\n // The *only* reliable way to do that is to copy the *entire* rest of the\n // textarea's content into the created at the caret position.\n // for inputs, just '.' would be enough, but why bother?\n span.textContent = element.value.substring(position) || '.'; // || because a completely empty faux span doesn't render at all\n div.appendChild(span);\n\n var coordinates = {\n top: span.offsetTop + parseInt(computed['borderTopWidth']),\n left: span.offsetLeft + parseInt(computed['borderLeftWidth'])\n };\n\n if (debug) {\n span.style.backgroundColor = '#aaa';\n } else {\n document.body.removeChild(div);\n }\n\n return coordinates;\n}\n\nif (typeof module != 'undefined' && typeof module.exports != 'undefined') {\n module.exports = getCaretCoordinates;\n} else if(isBrowser){\n window.getCaretCoordinates = getCaretCoordinates;\n}\n\n}());\n","\nvar NativeCustomEvent = global.CustomEvent;\n\nfunction useNative () {\n try {\n var p = new NativeCustomEvent('cat', { detail: { foo: 'bar' } });\n return 'cat' === p.type && 'bar' === p.detail.foo;\n } catch (e) {\n }\n return false;\n}\n\n/**\n * Cross-browser `CustomEvent` constructor.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent.CustomEvent\n *\n * @public\n */\n\nmodule.exports = useNative() ? NativeCustomEvent :\n\n// IE >= 9\n'undefined' !== typeof document && 'function' === typeof document.createEvent ? function CustomEvent (type, params) {\n var e = document.createEvent('CustomEvent');\n if (params) {\n e.initCustomEvent(type, params.bubbles, params.cancelable, params.detail);\n } else {\n e.initCustomEvent(type, false, false, void 0);\n }\n return e;\n} :\n\n// IE <= 8\nfunction CustomEvent (type, params) {\n var e = document.createEventObject();\n e.type = type;\n if (params) {\n e.bubbles = Boolean(params.bubbles);\n e.cancelable = Boolean(params.cancelable);\n e.detail = params.detail;\n } else {\n e.bubbles = false;\n e.cancelable = false;\n e.detail = void 0;\n }\n return e;\n}\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","\nvar content = require(\"!!../../css-loader/dist/cjs.js!./style.css\");\n\nif(typeof content === 'string') content = [[module.id, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"insertAt\":\"top\",\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = require(\"!../../style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(module.hot) {\n\tmodule.hot.accept(\"!!../../css-loader/dist/cjs.js!./style.css\", function() {\n\t\tvar newContent = require(\"!!../../css-loader/dist/cjs.js!./style.css\");\n\n\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\n\t\tvar locals = (function(a, b) {\n\t\t\tvar key, idx = 0;\n\n\t\t\tfor(key in a) {\n\t\t\t\tif(!b || a[key] !== b[key]) return false;\n\t\t\t\tidx++;\n\t\t\t}\n\n\t\t\tfor(key in b) idx--;\n\n\t\t\treturn idx === 0;\n\t\t}(content.locals, newContent.locals));\n\n\t\tif(!locals) throw new Error('Aborting CSS HMR due to changed css-modules locals.');\n\n\t\tupdate(newContent);\n\t});\n\n\tmodule.hot.dispose(function() { update(); });\n}","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".rta {\\n position: relative;\\n font-size: 18px;\\n width: 100%;\\n height: 100%;\\n}\\n.rta__loader.rta__loader--empty-suggestion-data {\\n border-radius: 3px;\\n box-shadow: 0 0 5px rgba(27, 31, 35, 0.1);\\n padding: 5px;\\n}\\n.rta--loading .rta__loader.rta__loader--suggestion-data {\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n background: rgba(255, 255, 255, 0.8);\\n}\\n.rta--loading .rta__loader.rta__loader--suggestion-data > * {\\n position: relative;\\n top: 50%;\\n}\\n.rta__textarea {\\n width: 100%;\\n height: 100%;\\n font-size: 1em;\\n}\\n.rta__autocomplete {\\n position: absolute;\\n display: block;\\n margin-top: 1em;\\n}\\n.rta__autocomplete--top {\\n margin-top: 0;\\n margin-bottom: 1em;\\n}\\n.rta__list {\\n margin: 0;\\n padding: 0;\\n background: #fff;\\n border: 1px solid #dfe2e5;\\n border-radius: 3px;\\n box-shadow: 0 0 5px rgba(27, 31, 35, 0.1);\\n list-style: none;\\n}\\n.rta__entity {\\n background: white;\\n width: 100%;\\n text-align: left;\\n outline: none;\\n}\\n.rta__entity:hover {\\n cursor: pointer;\\n}\\n.rta__item:not(:last-child) {\\n border-bottom: 1px solid #dfe2e5;\\n}\\n.rta__entity > * {\\n padding-left: 4px;\\n padding-right: 4px;\\n}\\n.rta__entity--selected {\\n color: #fff;\\n text-decoration: none;\\n background: #0366d6;\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item, useSourceMap);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join('');\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === 'string') {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (useSourceMap && typeof btoa === 'function') {\n var sourceMapping = toComment(cssMapping);\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || '').concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n }\n\n return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n return \"/*# \".concat(data, \" */\");\n}","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getTarget = function (target, parent) {\n if (parent){\n return parent.querySelector(target);\n }\n return document.querySelector(target);\n};\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(target, parent) {\n // If passing function in options, then use it for resolve \"head\" element.\n // Useful for Shadow Root style i.e\n // {\n // insertInto: function () { return document.querySelector(\"#foo\").shadowRoot }\n // }\n if (typeof target === 'function') {\n return target();\n }\n if (typeof memo[target] === \"undefined\") {\n\t\t\tvar styleTarget = getTarget.call(this, target, parent);\n\t\t\t// Special case to return head of iframe instead of iframe itself\n\t\t\tif (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n\t\t\t\ttry {\n\t\t\t\t\t// This will throw an exception if access to iframe is blocked\n\t\t\t\t\t// due to cross-origin restrictions\n\t\t\t\t\tstyleTarget = styleTarget.contentDocument.head;\n\t\t\t\t} catch(e) {\n\t\t\t\t\tstyleTarget = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmemo[target] = styleTarget;\n\t\t}\n\t\treturn memo[target]\n\t};\n})();\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = require(\"./urls\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of