From 1eecc7f718eb45e7a8f9a3f684aa6de2b4855b76 Mon Sep 17 00:00:00 2001 From: Robin de Mourat Date: Mon, 1 Apr 2019 15:14:24 +0200 Subject: [PATCH] update web buid --- docs/build/bundle.js | 2 +- docs/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/build/bundle.js b/docs/build/bundle.js index 7729229..11972db 100644 --- a/docs/build/bundle.js +++ b/docs/build/bundle.js @@ -263,4 +263,4 @@ e.exports=n(2485)},function(e){e.exports={"application/1d-interleaved-parityfec" Licensed under the MIT License (MIT), see http://jedwatson.github.io/react-select */ -var D=function(e){return"string"==typeof e?e:null!==e&&JSON.stringify(e)||""},A=u.a.oneOfType([u.a.string,u.a.node]),j=u.a.oneOfType([u.a.string,u.a.number]),L=1,I=function(e,t){var n=void 0===e?"undefined":_(e);if("string"!==n&&"number"!==n&&"boolean"!==n)return e;var r=t.options,i=t.valueKey;if(r)for(var o=0;oa||od.bottom?l.scrollTop=u.offsetTop+u.clientHeight-l.offsetHeight:c.topt.offsetHeight&&t.scrollHeight-t.offsetHeight-t.scrollTop<=0&&this.props.onMenuScrollToBottom()}}},{key:"getOptionLabel",value:function(e){return e[this.props.labelKey]}},{key:"getValueArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n="object"===(void 0===t?"undefined":_(t))?t:this.props;if(n.multi){if("string"==typeof e&&(e=e.split(n.delimiter)),!Array.isArray(e)){if(null==e)return[];e=[e]}return e.map(function(e){return I(e,n)}).filter(function(e){return e})}var r=I(e,n);return r?[r]:[]}},{key:"setValue",value:function(e){var t=this;if(this.props.autoBlur&&this.blurInput(),this.props.required){var n=P(e,this.props.multi);this.setState({required:n})}this.props.simpleValue&&e&&(e=this.props.multi?e.map(function(e){return e[t.props.valueKey]}).join(this.props.delimiter):e[this.props.valueKey]),this.props.onChange&&this.props.onChange(e)}},{key:"selectValue",value:function(e){var t=this;this.props.closeOnSelect&&(this.hasScrolledToOption=!1);var n=this.props.onSelectResetsInput?"":this.state.inputValue;this.props.multi?this.setState({focusedIndex:null,inputValue:this.handleInputValueChange(n),isOpen:!this.props.closeOnSelect},function(){t.getValueArray(t.props.value).some(function(n){return n[t.props.valueKey]===e[t.props.valueKey]})?t.removeValue(e):t.addValue(e)}):this.setState({inputValue:this.handleInputValueChange(n),isOpen:!this.props.closeOnSelect,isPseudoFocused:this.state.isFocused},function(){t.setValue(e)})}},{key:"addValue",value:function(e){var t=this.getValueArray(this.props.value),n=this._visibleOptions.filter(function(e){return!e.disabled}),r=n.indexOf(e);this.setValue(t.concat(e)),this.props.closeOnSelect&&(n.length-1===r?this.focusOption(n[r-1]):n.length>r&&this.focusOption(n[r+1]))}},{key:"popValue",value:function(){var e=this.getValueArray(this.props.value);e.length&&!1!==e[e.length-1].clearableValue&&this.setValue(this.props.multi?e.slice(0,e.length-1):null)}},{key:"removeValue",value:function(e){var t=this,n=this.getValueArray(this.props.value);this.setValue(n.filter(function(n){return n[t.props.valueKey]!==e[t.props.valueKey]})),this.focus()}},{key:"clearValue",value:function(e){e&&"mousedown"===e.type&&0!==e.button||(e.preventDefault(),this.setValue(this.getResetValue()),this.setState({inputValue:this.handleInputValueChange(""),isOpen:!1},this.focus),this._focusAfterClear=!0)}},{key:"getResetValue",value:function(){return void 0!==this.props.resetValue?this.props.resetValue:this.props.multi?[]:null}},{key:"focusOption",value:function(e){this.setState({focusedOption:e})}},{key:"focusNextOption",value:function(){this.focusAdjacentOption("next")}},{key:"focusPreviousOption",value:function(){this.focusAdjacentOption("previous")}},{key:"focusPageUpOption",value:function(){this.focusAdjacentOption("page_up")}},{key:"focusPageDownOption",value:function(){this.focusAdjacentOption("page_down")}},{key:"focusStartOption",value:function(){this.focusAdjacentOption("start")}},{key:"focusEndOption",value:function(){this.focusAdjacentOption("end")}},{key:"focusAdjacentOption",value:function(e){var t=this._visibleOptions.map(function(e,t){return{option:e,index:t}}).filter(function(e){return!e.option.disabled});if(this._scrollToFocusedOptionOnUpdate=!0,!this.state.isOpen){var n={focusedOption:this._focusedOption||(t.length?t["next"===e?0:t.length-1].option:null),isOpen:!0};return this.props.onSelectResetsInput&&(n.inputValue=""),void this.setState(n)}if(t.length){for(var r=-1,i=0;i0?r-=1:r=t.length-1;else if("start"===e)r=0;else if("end"===e)r=t.length-1;else if("page_up"===e){var o=r-this.props.pageSize;r=o<0?0:o}else if("page_down"===e){var a=r+this.props.pageSize;r=a>t.length-1?t.length-1:a}-1===r&&(r=0),this.setState({focusedIndex:t[r].index,focusedOption:t[r].option})}}},{key:"getFocusedOption",value:function(){return this._focusedOption}},{key:"selectFocusedOption",value:function(){if(this._focusedOption)return this.selectValue(this._focusedOption)}},{key:"renderLoading",value:function(){if(this.props.isLoading)return c.a.createElement("span",{className:"Select-loading-zone","aria-hidden":"true"},c.a.createElement("span",{className:"Select-loading"}))}},{key:"renderValue",value:function(e,t){var n=this,r=this.props.valueRenderer||this.getOptionLabel,i=this.props.valueComponent;if(!e.length)return function(e,t,n){var r=e.inputValue,i=e.isPseudoFocused,o=e.isFocused,a=t.onSelectResetsInput;return!r||!a&&!n&&!i&&!o}(this.state,this.props,t)?c.a.createElement("div",{className:"Select-placeholder"},this.props.placeholder):null;var o,a,s,u,l,f,d=this.props.onValueClick?this.handleValueClick:null;return this.props.multi?e.map(function(t,o){return c.a.createElement(i,{disabled:n.props.disabled||!1===t.clearableValue,id:n._instancePrefix+"-value-"+o,instancePrefix:n._instancePrefix,key:"value-"+o+"-"+t[n.props.valueKey],onClick:d,onRemove:n.removeValue,placeholder:n.props.placeholder,value:t,values:e},r(t,o),c.a.createElement("span",{className:"Select-aria-only"}," "))}):(o=this.state,a=this.props,s=o.inputValue,u=o.isPseudoFocused,l=o.isFocused,f=a.onSelectResetsInput,s&&(f||!l&&u||l&&!u)?void 0:(t&&(d=null),c.a.createElement(i,{disabled:this.props.disabled,id:this._instancePrefix+"-value-item",instancePrefix:this._instancePrefix,onClick:d,placeholder:this.props.placeholder,value:e[0]},r(e[0]))))}},{key:"renderInput",value:function(e,t){var n,r=this,o=a()("Select-input",this.props.inputProps.className),s=this.state.isOpen,u=a()((E(n={},this._instancePrefix+"-list",s),E(n,this._instancePrefix+"-backspace-remove-message",this.props.multi&&!this.props.disabled&&this.state.isFocused&&!this.state.inputValue),n)),l=this.state.inputValue;!l||this.props.onSelectResetsInput||this.state.isFocused||(l="");var f=M({},this.props.inputProps,{"aria-activedescendant":s?this._instancePrefix+"-option-"+t:this._instancePrefix+"-value","aria-describedby":this.props["aria-describedby"],"aria-expanded":""+s,"aria-haspopup":""+s,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-owns":u,onBlur:this.handleInputBlur,onChange:this.handleInputChange,onFocus:this.handleInputFocus,ref:function(e){return r.input=e},role:"combobox",required:this.state.required,tabIndex:this.props.tabIndex,value:l});if(this.props.inputRenderer)return this.props.inputRenderer(f);if(this.props.disabled||!this.props.searchable){var d=O(this.props.inputProps,[]),p=a()(E({},this._instancePrefix+"-list",s));return c.a.createElement("div",M({},d,{"aria-expanded":s,"aria-owns":p,"aria-activedescendant":s?this._instancePrefix+"-option-"+t:this._instancePrefix+"-value","aria-disabled":""+this.props.disabled,"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],className:o,onBlur:this.handleInputBlur,onFocus:this.handleInputFocus,ref:function(e){return r.input=e},role:"combobox",style:{border:0,width:1,display:"inline-block"},tabIndex:this.props.tabIndex||0}))}return this.props.autosize?c.a.createElement(i.a,M({id:this.props.id},f,{className:o,minWidth:"5"})):c.a.createElement("div",{className:o,key:"input-wrap",style:{display:"inline-block"}},c.a.createElement("input",M({id:this.props.id},f)))}},{key:"renderClear",value:function(){var e=this.getValueArray(this.props.value);if(this.props.clearable&&e.length&&!this.props.disabled&&!this.props.isLoading){var t=this.props.multi?this.props.clearAllText:this.props.clearValueText,n=this.props.clearRenderer();return c.a.createElement("span",{"aria-label":t,className:"Select-clear-zone",onMouseDown:this.clearValue,onTouchEnd:this.handleTouchEndClearValue,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,title:t},n)}}},{key:"renderArrow",value:function(){if(this.props.arrowRenderer){var e=this.handleMouseDownOnArrow,t=this.state.isOpen,n=this.props.arrowRenderer({onMouseDown:e,isOpen:t});return n?c.a.createElement("span",{className:"Select-arrow-zone",onMouseDown:e},n):null}}},{key:"filterOptions",value:function(e){var t=this.state.inputValue,n=this.props.options||[];if(this.props.filterOptions){var r="function"==typeof this.props.filterOptions?this.props.filterOptions:v;return r(n,t,e,{filterOption:this.props.filterOption,ignoreAccents:this.props.ignoreAccents,ignoreCase:this.props.ignoreCase,labelKey:this.props.labelKey,matchPos:this.props.matchPos,matchProp:this.props.matchProp,trimFilter:this.props.trimFilter,valueKey:this.props.valueKey})}return n}},{key:"onOptionRef",value:function(e,t){t&&(this.focused=e)}},{key:"renderMenu",value:function(e,t,n){return e&&e.length?this.props.menuRenderer({focusedOption:n,focusOption:this.focusOption,inputValue:this.state.inputValue,instancePrefix:this._instancePrefix,labelKey:this.props.labelKey,onFocus:this.focusOption,onOptionRef:this.onOptionRef,onSelect:this.selectValue,optionClassName:this.props.optionClassName,optionComponent:this.props.optionComponent,optionRenderer:this.props.optionRenderer||this.getOptionLabel,options:e,removeValue:this.removeValue,selectValue:this.selectValue,valueArray:t,valueKey:this.props.valueKey}):this.props.noResultsText?c.a.createElement("div",{className:"Select-noresults"},this.props.noResultsText):null}},{key:"renderHiddenField",value:function(e){var t=this;if(this.props.name){if(this.props.joinValues){var n=e.map(function(e){return D(e[t.props.valueKey])}).join(this.props.delimiter);return c.a.createElement("input",{disabled:this.props.disabled,name:this.props.name,ref:function(e){return t.value=e},type:"hidden",value:n})}return e.map(function(e,n){return c.a.createElement("input",{disabled:t.props.disabled,key:"hidden."+n,name:t.props.name,ref:"value"+n,type:"hidden",value:D(e[t.props.valueKey])})})}}},{key:"getFocusableOptionIndex",value:function(e){var t=this._visibleOptions;if(!t.length)return null;var n=this.props.valueKey,r=this.state.focusedOption||e;if(r&&!r.disabled){var i=-1;if(t.some(function(e,t){var o=e[n]===r[n];return o&&(i=t),o}),-1!==i)return i}for(var o=0;o .Select-control {\n background-color: #f9f9f9;\n}\n.Select.is-disabled > .Select-control:hover {\n box-shadow: none;\n}\n.Select.is-open > .Select-control {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n background: #fff;\n border-color: #b3b3b3 #ccc #d9d9d9;\n}\n.Select.is-open > .Select-control .Select-arrow {\n top: -2px;\n border-color: transparent transparent #999;\n border-width: 0 5px 5px;\n}\n.Select.is-searchable.is-open > .Select-control {\n cursor: text;\n}\n.Select.is-searchable.is-focused:not(.is-open) > .Select-control {\n cursor: text;\n}\n.Select.is-focused > .Select-control {\n background: #fff;\n}\n.Select.is-focused:not(.is-open) > .Select-control {\n border-color: #007eff;\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 0 3px rgba(0, 126, 255, 0.1);\n background: #fff;\n}\n.Select.has-value.is-clearable.Select--single > .Select-control .Select-value {\n padding-right: 42px;\n}\n.Select.has-value.Select--single > .Select-control .Select-value .Select-value-label,\n.Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value .Select-value-label {\n color: #333;\n}\n.Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label,\n.Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label {\n cursor: pointer;\n text-decoration: none;\n}\n.Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:hover,\n.Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:hover,\n.Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:focus,\n.Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:focus {\n color: #007eff;\n outline: none;\n text-decoration: underline;\n}\n.Select.has-value.Select--single > .Select-control .Select-value a.Select-value-label:focus,\n.Select.has-value.is-pseudo-focused.Select--single > .Select-control .Select-value a.Select-value-label:focus {\n background: #fff;\n}\n.Select.has-value.is-pseudo-focused .Select-input {\n opacity: 0;\n}\n.Select.is-open .Select-arrow,\n.Select .Select-arrow-zone:hover > .Select-arrow {\n border-top-color: #666;\n}\n.Select.Select--rtl {\n direction: rtl;\n text-align: right;\n}\n.Select-control {\n background-color: #fff;\n border-color: #d9d9d9 #ccc #b3b3b3;\n border-radius: 4px;\n border: 1px solid #ccc;\n color: #333;\n cursor: default;\n display: table;\n border-spacing: 0;\n border-collapse: separate;\n height: 36px;\n outline: none;\n overflow: hidden;\n position: relative;\n width: 100%;\n}\n.Select-control:hover {\n box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);\n}\n.Select-control .Select-input:focus {\n outline: none;\n background: #fff;\n}\n.Select-placeholder,\n.Select--single > .Select-control .Select-value {\n bottom: 0;\n color: #aaa;\n left: 0;\n line-height: 34px;\n padding-left: 10px;\n padding-right: 10px;\n position: absolute;\n right: 0;\n top: 0;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.Select-input {\n height: 34px;\n padding-left: 10px;\n padding-right: 10px;\n vertical-align: middle;\n}\n.Select-input > input {\n width: 100%;\n background: none transparent;\n border: 0 none;\n box-shadow: none;\n cursor: default;\n display: inline-block;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n outline: none;\n line-height: 17px;\n /* For IE 8 compatibility */\n padding: 8px 0 12px;\n /* For IE 8 compatibility */\n -webkit-appearance: none;\n}\n.is-focused .Select-input > input {\n cursor: text;\n}\n.has-value.is-pseudo-focused .Select-input {\n opacity: 0;\n}\n.Select-control:not(.is-searchable) > .Select-input {\n outline: none;\n}\n.Select-loading-zone {\n cursor: pointer;\n display: table-cell;\n position: relative;\n text-align: center;\n vertical-align: middle;\n width: 16px;\n}\n.Select-loading {\n -webkit-animation: Select-animation-spin 400ms infinite linear;\n -o-animation: Select-animation-spin 400ms infinite linear;\n animation: Select-animation-spin 400ms infinite linear;\n width: 16px;\n height: 16px;\n box-sizing: border-box;\n border-radius: 50%;\n border: 2px solid #ccc;\n border-right-color: #333;\n display: inline-block;\n position: relative;\n vertical-align: middle;\n}\n.Select-clear-zone {\n -webkit-animation: Select-animation-fadeIn 200ms;\n -o-animation: Select-animation-fadeIn 200ms;\n animation: Select-animation-fadeIn 200ms;\n color: #999;\n cursor: pointer;\n display: table-cell;\n position: relative;\n text-align: center;\n vertical-align: middle;\n width: 17px;\n}\n.Select-clear-zone:hover {\n color: #D0021B;\n}\n.Select-clear {\n display: inline-block;\n font-size: 18px;\n line-height: 1;\n}\n.Select--multi .Select-clear-zone {\n width: 17px;\n}\n.Select-arrow-zone {\n cursor: pointer;\n display: table-cell;\n position: relative;\n text-align: center;\n vertical-align: middle;\n width: 25px;\n padding-right: 5px;\n}\n.Select--rtl .Select-arrow-zone {\n padding-right: 0;\n padding-left: 5px;\n}\n.Select-arrow {\n border-color: #999 transparent transparent;\n border-style: solid;\n border-width: 5px 5px 2.5px;\n display: inline-block;\n height: 0;\n width: 0;\n position: relative;\n}\n.Select-control > *:last-child {\n padding-right: 5px;\n}\n.Select--multi .Select-multi-value-wrapper {\n display: inline-block;\n}\n.Select .Select-aria-only {\n position: absolute;\n display: inline-block;\n height: 1px;\n width: 1px;\n margin: -1px;\n clip: rect(0, 0, 0, 0);\n overflow: hidden;\n float: left;\n}\n@-webkit-keyframes Select-animation-fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes Select-animation-fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n.Select-menu-outer {\n border-bottom-right-radius: 4px;\n border-bottom-left-radius: 4px;\n background-color: #fff;\n border: 1px solid #ccc;\n border-top-color: #e6e6e6;\n box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);\n box-sizing: border-box;\n margin-top: -1px;\n max-height: 200px;\n position: absolute;\n left: 0;\n top: 100%;\n width: 100%;\n z-index: 1;\n -webkit-overflow-scrolling: touch;\n}\n.Select-menu {\n max-height: 198px;\n overflow-y: auto;\n}\n.Select-option {\n box-sizing: border-box;\n background-color: #fff;\n color: #666666;\n cursor: pointer;\n display: block;\n padding: 8px 10px;\n}\n.Select-option:last-child {\n border-bottom-right-radius: 4px;\n border-bottom-left-radius: 4px;\n}\n.Select-option.is-selected {\n background-color: #f5faff;\n /* Fallback color for IE 8 */\n background-color: rgba(0, 126, 255, 0.04);\n color: #333;\n}\n.Select-option.is-focused {\n background-color: #ebf5ff;\n /* Fallback color for IE 8 */\n background-color: rgba(0, 126, 255, 0.08);\n color: #333;\n}\n.Select-option.is-disabled {\n color: #cccccc;\n cursor: default;\n}\n.Select-noresults {\n box-sizing: border-box;\n color: #999999;\n cursor: default;\n display: block;\n padding: 8px 10px;\n}\n.Select--multi .Select-input {\n vertical-align: middle;\n margin-left: 10px;\n padding: 0;\n}\n.Select--multi.Select--rtl .Select-input {\n margin-left: 0;\n margin-right: 10px;\n}\n.Select--multi.has-value .Select-input {\n margin-left: 5px;\n}\n.Select--multi .Select-value {\n background-color: #ebf5ff;\n /* Fallback color for IE 8 */\n background-color: rgba(0, 126, 255, 0.08);\n border-radius: 2px;\n border: 1px solid #c2e0ff;\n /* Fallback color for IE 8 */\n border: 1px solid rgba(0, 126, 255, 0.24);\n color: #007eff;\n display: inline-block;\n font-size: 0.9em;\n line-height: 1.4;\n margin-left: 5px;\n margin-top: 5px;\n vertical-align: top;\n}\n.Select--multi .Select-value-icon,\n.Select--multi .Select-value-label {\n display: inline-block;\n vertical-align: middle;\n}\n.Select--multi .Select-value-label {\n border-bottom-right-radius: 2px;\n border-top-right-radius: 2px;\n cursor: default;\n padding: 2px 5px;\n}\n.Select--multi a.Select-value-label {\n color: #007eff;\n cursor: pointer;\n text-decoration: none;\n}\n.Select--multi a.Select-value-label:hover {\n text-decoration: underline;\n}\n.Select--multi .Select-value-icon {\n cursor: pointer;\n border-bottom-left-radius: 2px;\n border-top-left-radius: 2px;\n border-right: 1px solid #c2e0ff;\n /* Fallback color for IE 8 */\n border-right: 1px solid rgba(0, 126, 255, 0.24);\n padding: 1px 5px 3px;\n}\n.Select--multi .Select-value-icon:hover,\n.Select--multi .Select-value-icon:focus {\n background-color: #d8eafd;\n /* Fallback color for IE 8 */\n background-color: rgba(0, 113, 230, 0.08);\n color: #0071e6;\n}\n.Select--multi .Select-value-icon:active {\n background-color: #c2e0ff;\n /* Fallback color for IE 8 */\n background-color: rgba(0, 126, 255, 0.24);\n}\n.Select--multi.Select--rtl .Select-value {\n margin-left: 0;\n margin-right: 5px;\n}\n.Select--multi.Select--rtl .Select-value-icon {\n border-right: none;\n border-left: 1px solid #c2e0ff;\n /* Fallback color for IE 8 */\n border-left: 1px solid rgba(0, 126, 255, 0.24);\n}\n.Select--multi.is-disabled .Select-value {\n background-color: #fcfcfc;\n border: 1px solid #e3e3e3;\n color: #333;\n}\n.Select--multi.is-disabled .Select-value-icon {\n cursor: not-allowed;\n border-right: 1px solid #e3e3e3;\n}\n.Select--multi.is-disabled .Select-value-icon:hover,\n.Select--multi.is-disabled .Select-value-icon:focus,\n.Select--multi.is-disabled .Select-value-icon:active {\n background-color: #fcfcfc;\n}\n@keyframes Select-animation-spin {\n to {\n transform: rotate(1turn);\n }\n}\n@-webkit-keyframes Select-animation-spin {\n to {\n -webkit-transform: rotate(1turn);\n }\n}\n",""])},function(e,t,n){"use strict";const r=n(664);function i(e){const t=e.split("."),n=[];for(let e=0;e{switch(t){case"text/plain":case"text/html":return(0,f.getFileAsText)(e).then(e=>n(null,e)).catch(n);case"application/json":(0,f.getFileAsText)(e).catch(n).then(e=>{try{const t=JSON.parse(e);n(null,t)}catch(e){n(e)}});break;case"text/csv":case"text/tsv":case"text/comma-separated-values":case"text/tab-separated-values":(0,f.getFileAsText)(e).catch(n).then(e=>{try{let r;r="text/comma-separated-values"===t||"text/csv"===t?(0,s.csvParse)(e):(0,s.tsvParse)(e),n(null,r)}catch(e){n(e)}});break;case"image/png":case"image/jpeg":case"image/jpg":case"image/gif":case"image/tiff":(0,u.loadImage)(e).catch(n).then(e=>n(null,e));break;default:return(0,f.getFileAsBinary)(e,n)}}),this.onDrop=(e=>{const{assetId:t,onAssetChange:n}=this.props,r=e[0],i=r.name,s=t||(0,o.v4)(),u=a.default.lookup(i);this.getFileFromUpload(r,u,(e,t)=>{e||n(s,{id:s,filename:i,data:t,mimetype:u,lastUploadAt:(new Date).getTime()})})})}shouldComponentUpdate(){return!0}render(){const{assetId:e,assets:t={},onDelete:n,accept:r=[],translate:o}=this.props,a=t&&t[e],s=this.onDrop;return t?i.default.createElement("div",{className:"ovide-AssetWidget"},i.default.createElement("div",{className:"column"},i.default.createElement(c.DropZone,{accept:r,onDrop:s},o(a?"update asset":"add a new asset"))),i.default.createElement("div",{className:"column"},i.default.createElement(l.default,{asset:a})),a&&i.default.createElement("div",null,i.default.createElement(c.Button,{onClick:n},o("Delete asset")))):i.default.createElement("div",null,o("loading"))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2699),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(3)),i=a(n(2)),o=a(n(1174));function a(e){return e&&e.__esModule?e:{default:e}}n(992),n(2700);t.default=(({asset:e},{})=>e?i.default.createElement("div",{className:"ovide-PrimitiveAssetPreview"},(e=>{switch(e.mimetype){case"image/png":case"image/jpg":case"image/jpeg":case"image/gif":case"image/svg+xml":return i.default.createElement("img",{src:e.data});case"text/csv":case"text/tsv":case"text/comma-separated-values":case"text/tab-separated-values":const t=e.data||[],n=t.length?t[0]:{},a=Object.keys(n).filter(e=>e.trim().length).map(e=>({Header:e,accessor:e}));return i.default.createElement(o.default,(0,r.default)({data:t,columns:a},{showPagination:!1,showPageSizeOptions:!1,defaultPageSize:5,sortable:!1,filterable:!1}));default:return i.default.createElement("div",null,"No preview available ",e.mimetype)}})(e)):null)},function(e,t,n){var r=n(2701);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(33)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(32)(!1)).push([e.i,".ovide-PrimitiveAssetPreview {\n max-height: 40rem;\n overflow: auto;\n position: relative; }\n .ovide-PrimitiveAssetPreview img,\n .ovide-PrimitiveAssetPreview .media-player,\n .ovide-PrimitiveAssetPreview video {\n max-height: 30rem; }\n",""])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2703),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i,o=d(n(3)),a=n(2),s=d(a),u=d(n(0)),l=n(6),c=d(n(1120)),f=d(n(986));function d(e){return e&&e.__esModule?e:{default:e}}let p=(i=r=class extends a.Component{constructor(e){super(e),this.componentWillReceiveProps=(e=>{this.props.value!==e.value&&this.setState({value:e.value})}),this.render=(()=>{const{state:{edited:e,value:t={}},props:{translate:n,value:r={active:!1},onChange:i},context:{production:a={}}}=this,{active:u=!1,summary:d=[]}=t,p=()=>{const n=e?r:t;this.setState({edited:!e,value:n})},h=e=>{const n=(0,o.default)({},t,{active:e});this.setState({value:n})},m=e=>{const n=[...d,e];this.setState({value:(0,o.default)({},t,{summary:n})})},{sectionsOrder:g=[],sections:v={}}=a,y=g.map(e=>{if(v[e]){const t=v[e];return{title:t.metadata.title,level:t.metadata.level,id:e}}}).filter(e=>e),b=d.map(({level:e,id:t})=>{const n=v[t]||{metadata:{}};return(0,o.default)({},n,{metadata:(0,o.default)({},n.metadata,{level:e})})}),_=({oldIndex:e,newIndex:n})=>{const r=d.map(e=>e.id),i=(0,c.default)(r,e,n).map(e=>{return d.find(t=>t.id===e)});this.setState({value:(0,o.default)({},t,{summary:i})})};return s.default.createElement("div",null,s.default.createElement("div",{style:{display:"flex",flexFlow:"row nowrap",alignItems:"center"}},r.active?n("Custom summary activated"):n("Custom summary deactivated"),s.default.createElement(l.Button,{onClick:p},n("Edit"))),s.default.createElement(l.ModalCard,{isActive:e,headerContent:n("Edit custom summary"),onClose:p,style:{maxHeight:"85vh"},mainContent:s.default.createElement("div",null,s.default.createElement(l.Label,null,n("Use a custom sections composition")),s.default.createElement(l.Field,null,s.default.createElement(l.Control,null,s.default.createElement(l.Radio,{onChange:()=>h(!0),checked:u,name:"question"},n("yes")),s.default.createElement(l.Radio,{onChange:()=>h(!1),checked:!u,name:"question"},n("no")))),u&&s.default.createElement(l.Columns,null,s.default.createElement(l.Column,{isSize:6},s.default.createElement(l.StretchedLayoutContainer,{style:{minHeight:"100%"}},s.default.createElement(l.StretchedLayoutItem,null,s.default.createElement(l.Title,null,n("Custom summary"))),s.default.createElement(l.StretchedLayoutItem,{style:{overflow:"auto"},isFlex:1},s.default.createElement(f.default,{productionId:a.id,items:b,onSortEnd:_,setSectionIndex:(e,t)=>{_({oldIndex:e,newIndex:t})},maxSectionIndex:d.length-1,setSectionLevel:({sectionId:e,level:n})=>{const r=d.map(t=>t.id===e?(0,o.default)({},t,{level:n}):t);this.setState({value:(0,o.default)({},t,{summary:r})})},onDeleteSection:e=>{const n=d.filter(t=>t.id!==e);this.setState({value:(0,o.default)({},t,{summary:n})})},useDragHandle:!0})))),s.default.createElement(l.Column,{isSize:6},s.default.createElement(l.StretchedLayoutContainer,null,s.default.createElement(l.StretchedLayoutItem,null,s.default.createElement(l.Title,null,n("Default summary"))),s.default.createElement(l.StretchedLayoutItem,{style:{overflow:"auto"},isFlex:1},y.map((e,t)=>{const r=void 0!==b.find(t=>t.id===e.id);return s.default.createElement(l.Column,{style:{maxWidth:"100%",opacity:r?.5:1},key:t},s.default.createElement(l.Card,{style:{marginLeft:`${.5*e.level}rem`},bodyContent:s.default.createElement(l.StretchedLayoutContainer,{isDirection:"horizontal"},s.default.createElement(l.StretchedLayoutItem,{isFlex:1},e.title||n("Untitled section")),s.default.createElement(l.StretchedLayoutItem,null,s.default.createElement(l.Button,{onClick:()=>{m({id:e.id,level:e.level})},style:{margin:".1rem"},isDisabled:r},n("Add"))))}))})))))),footerContent:[s.default.createElement(l.Button,{type:"submit",isFullWidth:!0,key:0,onClick:()=>{i(t),p()},isColor:"primary"},n("Update")),s.default.createElement(l.Button,{onClick:p,isFullWidth:!0,key:1,isColor:"warning"},n("Cancel"))]}))}),this.state={edited:!1,value:e.value}}},r.contextTypes={production:u.default.object},i);t.default=p},function(e,t,n){var r=n(2705);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(33)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(32)(!1)).push([e.i,"/**\n * global style parameters for the whole app\n *\n * @module ovide\n */\n.ovide-SchemaForm .schema-item {\n background: rgba(0, 0, 0, 0.01);\n padding: .5rem;\n margin-bottom: 1rem;\n margin-top: 1rem; }\n\n.ovide-SchemaForm .items-list li {\n list-style-type: none; }\n\n.ovide-SchemaForm .items-list.checkbox-list {\n padding: 0; }\n .ovide-SchemaForm .items-list.checkbox-list li {\n margin: 0; }\n",""])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2707),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i,o=y(n(40)),a=y(n(3)),s=n(2),u=y(s),l=y(n(0)),c=y(n(568)),f=n(201),d=n(6),p=y(n(446)),h=n(61),m=y(n(39)),g=n(16),v=n(70);function y(e){return e&&e.__esModule?e:{default:e}}n(2708);const b=({addMode:e=!1,imageMode:t,assets:n={},value:r={},images:i,data:o,setCurrentAssetIndex:s,onAssetChange:l,onAfterChange:c,currentAssetIndex:f,itemIndex:h,schema:g})=>{const v=n[r[`${t}ImageAssetId`]],y=h===f;return u.default.createElement("div",{onClick:t=>{if(e)return(e=>{e.stopPropagation(),e.preventDefault();const t=(0,p.default)(g.properties.images.items),n=[...i,t],r=(0,a.default)({},o,{images:n});c(r),s(i.length)})(t);t.stopPropagation(),s(h)},className:`image-thumbnail ${e?"add-mode":""} ${y?"is-active":""}`},u.default.createElement("div",{className:"content-container"},v&&!e&&u.default.createElement("img",{src:v.data}),e&&u.default.createElement(d.Image,{src:m.default.asset.black.svg})),!e&&u.default.createElement("div",{onClick:e=>{let t;e.stopPropagation(),f===h&&(t=h>0?h-1:0),t&&s(t);const n=i.filter((e,t)=>t!==h),u=(0,a.default)({},o,{images:n});c(u),Object.keys(r).map(e=>r[e]).filter(e=>e).forEach(e=>{l(e,void 0)})},className:"remove-btn"},u.default.createElement(d.Image,{src:m.default.asset.black.svg})))},_=(0,f.SortableElement)(e=>u.default.createElement(b,e)),w=(0,f.SortableContainer)(e=>{let{items:t}=e,n=(0,o.default)(e,["items"]);return u.default.createElement("div",null,t.map((e,t)=>u.default.createElement(_,(0,a.default)({},n,{key:t,index:t,itemIndex:t,value:e}))))});let x=(i=r=class extends s.Component{constructor(e){super(e),this.getFileFromUpload=((e,t)=>{(0,v.loadImage)(e).catch(t).then(e=>t(null,e))}),this.onDrop=((e,t,n)=>{const{onAssetChange:r,data:i={},onAfterChange:o}=this.props,{currentAssetIndex:a=0}=this.state,{images:s=[]}=i,u=e[0],l=u.name,f=t||(0,h.v4)(),d=c.default.lookup(l);this.getFileFromUpload(u,(e,t)=>{if(!e){r(f,{id:f,filename:l,data:t,mimetype:d,lastUploadAt:(new Date).getTime()});const e=[...s];if(e[a]){const t=`${n}ImageAssetId`;e[a][t]=f,o({images:e})}}})}),this.render=(()=>{const{props:{data:e={},assets:t={},schema:n,onAfterChange:r,onAssetChange:i},state:{currentAssetIndex:o=0,imageMode:s="rgb"},context:{t:l},onDrop:c}=this,{images:p=[]}=e,h=(0,g.translateNameSpacer)(l,"Components.ImageGalleryEditor"),m=o{this.setState({imageMode:e})},E=e=>{this.setState({currentAssetIndex:e})};return u.default.createElement("div",{className:"ovide-ImageGalleryEditor"},u.default.createElement(d.Columns,{className:"main-row"},u.default.createElement(d.Column,{isSize:6},v?u.default.createElement("img",{src:v.data}):u.default.createElement("div",null,h("No image yet")),v?u.default.createElement("input",{className:"input",value:m.caption||"",placeholder:h("Image specific caption"),onChange:e=>{const t=e.target.value,n={images:p.map((e,n)=>n===o?(0,a.default)({},e,{caption:t}):e)};r(n)}}):null),u.default.createElement(d.Column,{isSize:6,style:{marginTop:0}},u.default.createElement(d.Tabs,null,u.default.createElement(d.TabList,null,u.default.createElement(d.Tab,{onClick:()=>x("rgb"),isActive:"rgb"===s},u.default.createElement(d.TabLink,null,u.default.createElement("span",null,h("web")))),u.default.createElement(d.Tab,{onClick:()=>x("cmyb"),isActive:"cmyb"===s},u.default.createElement(d.TabLink,null,u.default.createElement("span",null,h("print")))))),u.default.createElement("div",null,u.default.createElement(d.DropZone,{accept:_,onDrop:e=>{c(e,y,s)}},h(v?"update asset":"add a new asset"))))),u.default.createElement("div",{className:"list-row"},u.default.createElement(w,{items:p,assets:t,imageMode:s,onAfterChange:r,onAssetChange:i,setCurrentAssetIndex:E,images:p,data:e,currentAssetIndex:o,onSortEnd:({oldIndex:t,newIndex:n})=>{const i=(0,f.arrayMove)(p,t,n),o=(0,a.default)({},e,{images:i});r(o),E(n)},axis:"x",pressDelay:100}),u.default.createElement(b,{addMode:!0,setCurrentAssetIndex:E,onAfterChange:r,schema:n,itemIndex:"none",images:p,data:e})))}),this.state={currentAssetIndex:0,imageMode:"rgb"}}},r.contextTypes={t:l.default.func},i);t.default=x},function(e,t,n){var r=n(2709);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(33)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(32)(!1)).push([e.i,".ovide-ImageGalleryEditor .list-row {\n overflow-x: auto;\n overflow-y: hidden;\n height: 5rem;\n display: flex;\n flex-flow: row nowrap; }\n .ovide-ImageGalleryEditor .list-row > div {\n display: flex;\n flex-flow: row nowrap; }\n\n.ovide-ImageGalleryEditor .image-thumbnail {\n position: relative;\n width: 5rem;\n height: 5rem;\n min-width: 5rem;\n min-height: 5rem;\n display: inline-block;\n margin-right: 1rem;\n background: rgba(0, 0, 0, 0.1);\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: center;\n cursor: move; }\n .ovide-ImageGalleryEditor .image-thumbnail.add-mode {\n cursor: pointer; }\n .ovide-ImageGalleryEditor .image-thumbnail.is-active {\n border: .2rem solid black;\n cursor: auto; }\n .ovide-ImageGalleryEditor .image-thumbnail .content-container {\n display: flex;\n flex-flow: column nowrap;\n align-items: center;\n justify-content: center; }\n .ovide-ImageGalleryEditor .image-thumbnail img {\n max-width: 100%;\n max-height: 100%;\n pointer-events: none; }\n .ovide-ImageGalleryEditor .image-thumbnail .remove-btn {\n position: absolute;\n top: .5rem;\n right: .5rem;\n border-radius: 50%;\n cursor: pointer;\n max-height: 1rem;\n max-width: 1rem;\n background: white; }\n .ovide-ImageGalleryEditor .image-thumbnail .remove-btn img {\n max-height: 1rem;\n max-width: 1rem;\n transform: rotate(45deg); }\n",""])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i,o=h(n(3)),a=n(2),s=h(a),u=h(n(0)),l=n(6),c=n(16),f=h(n(181)),d=h(n(2711)),p=h(n(2717));function h(e){return e&&e.__esModule?e:{default:e}}const m=f.default.definitions.glossary.properties.entryType.enum;let g=(i=r=class extends a.Component{constructor(...e){var t;return t=super(...e),this.render=(()=>{const{props:{onChange:e,data:t={}},context:{t:n}}=this,r=(0,c.translateNameSpacer)(n,"Components.GlossaryForm"),{name:i="",description:a="",entryType:u="person",location:f={},dates:h={}}=t,g={name:i,description:a,entryType:u,location:f,dates:h};return s.default.createElement("div",null,s.default.createElement(l.Field,null,s.default.createElement(l.Label,null,r("Type of the entry")),s.default.createElement(l.Control,null,s.default.createElement(l.Select,{onChange:t=>{const n=t.target.value;e((0,o.default)({},g,{entryType:n,location:{},dates:{}}))},value:u},m.map((e,t)=>s.default.createElement("option",{key:t,id:e,value:e},r(e)))))),"place"===u&&s.default.createElement("div",{style:{marginBottom:"1rem"}},s.default.createElement(d.default,{location:f,onChange:t=>e((0,o.default)({},g,{location:t}))})),"event"===u&&s.default.createElement("div",{style:{marginBottom:"1rem"}},s.default.createElement(p.default,{dates:h,onChange:t=>e((0,o.default)({},g,{dates:t}))})),s.default.createElement(l.Field,null,s.default.createElement(l.Label,null,r("Name")),s.default.createElement(l.Control,null,s.default.createElement("input",{className:"input",placeholder:r("Glossary name"),value:i,onChange:t=>e((0,o.default)({},g,{name:t.target.value}))}))),s.default.createElement(l.Field,null,s.default.createElement(l.Label,null,r("Description of the entry")),s.default.createElement(l.Control,null,s.default.createElement("textarea",{className:"textarea",placeholder:r("Glossary entry"),value:a,onChange:t=>e((0,o.default)({},g,{description:t.target.value}))}))))}),t}},r.contextTypes={t:u.default.func},i);t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=n(2712),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(2),a=h(o),s=h(n(0)),u=n(2713),l=h(u),c=h(n(906)),f=h(n(551)),d=n(16),p=n(6);function h(e){return e&&e.__esModule?e:{default:e}}const{googleApiKey:m}=(0,f.default)(),g=()=>a.default.createElement("span",{style:{color:"red",width:"10px",height:"10px",borderRadius:"50%",border:"1px red solid",padding:"1em",display:"flex",flexFlow:"column nowrap",alignItems:"center",justifyContent:"center"}},a.default.createElement("i",{className:"fas fa-map-marker"})),v=()=>a.default.createElement("span",{style:{background:"pink",width:"10px",height:"10px",borderRadius:"50%",display:"inline-block"}});let y=(i=r=class extends o.Component{constructor(e){super(e),this.componentWillReceiveProps=(e=>{this.props.location&&this.props.location.latitude&&e.location&&e.location.latitude&&this.props.location.latitude!==e.location.latitude&&this.setState({latitude:e.location.latitude}),this.props.location&&this.props.location.longitude&&e.location&&e.location.longitude&&this.props.location.longitude!==e.location.longitude&&this.setState({longitude:e.location.longitude})}),this.toggleEdited=(e=>{e.stopPropagation(),e.preventDefault(),this.setState({isEdited:!this.state.isEdited})}),this.setLatitude=(e=>{this.setState({latitude:e})}),this.setLongitude=(e=>{this.setState({longitude:e})}),this.setAddress=(e=>{this.setState({address:e})}),this.handleAddressSubmit=(e=>{e.preventDefault(),(0,u.geocodeByAddress)(this.state.address).then(e=>(0,u.getLatLng)(e[0])).then(e=>{const{lat:t,lng:n}=e;this.setState({latitude:t,longitude:n}),this.handleSubmit(!0)}).catch(()=>{})}),this.onMapChange=(({center:{lat:e,lng:t}})=>{this.setState({latitude:e,longitude:t,isEdited:!0}),this.handleSubmit(!0)}),this.handleSubmit=((e=!1)=>{const{latitude:t,longitude:n,address:r}=this.state;this.setState({isEdited:e}),this.props.onChange({latitude:t,longitude:n,address:r})}),this.onReset=(()=>{this.setState({latitude:void 0,longitude:void 0,address:void 0,isEdited:!1}),this.props.onChange({latitude:void 0,longitude:void 0,address:void 0})}),this.handleCancel=(()=>{this.setState({isEdited:!1,latitude:this.props.location&&this.props.location.latitude,longitude:this.props.location&&this.props.location.longitude,address:this.props.location&&this.props.location.address})}),this.render=(()=>{const{state:{isEdited:e,latitude:t,longitude:n,address:r=""},props:{location:i},context:{t:o},toggleEdited:s,setLatitude:u,setLongitude:f,setAddress:h,handleAddressSubmit:y,onMapChange:b,onReset:_}=this,w=(0,d.translateNameSpacer)(o,"Components.LocationPicker"),x=i&&i.latitude;return a.default.createElement("div",{onClick:e=>{e.stopPropagation(),e.preventDefault()}},!x&&!e&&a.default.createElement(p.Button,{isFullWidth:!0,onClick:s},w("add location")),a.default.createElement(p.StretchedLayoutContainer,{isDirection:"horizontal"},a.default.createElement(p.StretchedLayoutItem,{style:{paddingRight:"1rem"}},e?a.default.createElement(p.StretchedLayoutContainer,{isDirection:"vertical"},a.default.createElement(p.StretchedLayoutItem,{isFlex:1},a.default.createElement("h6",{className:"title is-6"},w("Search location by address")),a.default.createElement("form",{onSubmit:y,className:"stretched-columns"},a.default.createElement(p.StretchedLayoutContainer,{isDirection:"horizontal"},a.default.createElement(p.StretchedLayoutItem,null,a.default.createElement(l.default,{className:"input",inputProps:{value:r,placeholder:w("input an address"),onChange:h,onSubmit:y}})),a.default.createElement(p.StretchedLayoutItem,null,a.default.createElement(p.Button,{style:{height:"100%",marginLeft:"1rem"},isColor:"info",onClick:y},a.default.createElement("span",{className:"icon"},a.default.createElement("i",{className:"fas fa-search"})))))))):null,e?a.default.createElement("div",{style:{paddingTop:"1rem"}},a.default.createElement("div",{className:"field"},a.default.createElement("label",{className:"label"},w("Latitude")),a.default.createElement("div",{className:"control"},a.default.createElement("input",{className:"input",value:t||"",placeholder:w("input latitude"),onChange:e=>!isNaN(+e.target.value)&&u(+e.target.value)}))),a.default.createElement("div",null,a.default.createElement("label",{className:"label"},w("Longitude")),a.default.createElement("div",{className:"control"},a.default.createElement("input",{className:"input",value:n||"",placeholder:w("input longitude"),onChange:e=>!isNaN(+e.target.value)&&f(+e.target.value)})))):null,t?a.default.createElement("div",{style:{marginTop:"1rem"},className:""},a.default.createElement("button",{onClick:_,className:"button is-danger is-fullwidth"},w("delete location"))):null),t&&n&&a.default.createElement(p.StretchedLayoutItem,{isFlex:1},a.default.createElement("div",{style:{width:"100%",height:"20rem"}},a.default.createElement(c.default,{bootstrapURLKeys:{key:[m]},defaultCenter:{lat:t,lng:n},defaultZoom:11,onChange:b},i&&i.latitude&&i.latitude!==t&&i.longitude!==n&&a.default.createElement(v,{lat:i.latitude,lng:i.longitude}),a.default.createElement(g,{lat:t,lng:n}))))))}),this.state={isEdited:!1,latitude:e.location&&e.location.latitude,longitude:e.location&&e.location.longitude,address:e.location&&e.location.address}}},r.contextTypes={t:s.default.func},i);t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLatLng=t.geocodeByPlaceId=t.geocodeByAddress=void 0;var r,i=n(2714),o=(r=i)&&r.__esModule?r:{default:r},a=n(2716);t.geocodeByAddress=a.geocodeByAddress,t.geocodeByPlaceId=a.geocodeByPlaceId,t.getLatLng=a.getLatLng,t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0}},{key:"getInputProps",value:function(){var e=this,t=this.shouldRenderDropdown(),n=this.getActiveItem(),i=n?"PlacesAutocomplete__autocomplete-item-"+n.placeId:null;return r({},{type:"text",autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-controls":"PlacesAutocomplete__autocomplete-container","aria-expanded":t,"aria-haspopup":t,"aria-activedescendant":i},this.props.inputProps,{onChange:function(t){e.handleInputChange(t)},onKeyDown:function(t){e.handleInputKeyDown(t)},onBlur:function(t){e.handleInputOnBlur(t)},style:this.inlineStyleFor("input"),className:this.classNameFor("input")})}},{key:"handleSuggestionMouseEnter",value:function(e){this.setActiveItemAtIndex(e)}},{key:"handleSuggestionMouseLeave",value:function(){this.mousedownOnSuggestion=!1,this.clearActive()}},{key:"handleSuggestionMouseDown",value:function(e){e.preventDefault(),this.mousedownOnSuggestion=!0}},{key:"handleSuggestionTouchStart",value:function(){this.mousedownOnSuggestion=!0}},{key:"handleSuggestionMouseUp",value:function(){this.mousedownOnSuggestion=!1}},{key:"handleSuggestionClick",value:function(e,t){var n=this,r=e.suggestion,i=e.placeId;this.selectAddress(r,i,t),setTimeout(function(){n.mousedownOnSuggestion=!1})}},{key:"render",value:function(){var e=this,t=this.state.autocompleteItems,n=this.getInputProps();return a.default.createElement("div",{id:"PlacesAutocomplete__root",style:this.inlineStyleFor("root"),className:this.classNameFor("root")},a.default.createElement("input",n),this.shouldRenderDropdown()&&a.default.createElement("div",{role:"listbox",id:"PlacesAutocomplete__autocomplete-container",style:this.inlineStyleFor("autocompleteContainer"),className:this.classNameFor("autocompleteContainer")},t.map(function(t,n){return a.default.createElement("div",{key:t.placeId,id:"PlacesAutocomplete__autocomplete-item-"+t.placeId,role:"option",onMouseEnter:e.handleSuggestionMouseEnter.bind(e,n),onMouseLeave:e.handleSuggestionMouseLeave.bind(e),onMouseDown:e.handleSuggestionMouseDown.bind(e),onMouseUp:e.handleSuggestionMouseUp.bind(e),onTouchStart:e.handleSuggestionTouchStart.bind(e),onTouchEnd:e.handleSuggestionMouseUp.bind(e),onClick:e.handleSuggestionClick.bind(e,t),style:t.active?e.inlineStyleFor("autocompleteItem","autocompleteItemActive"):e.inlineStyleFor("autocompleteItem"),className:t.active?e.classNameFor("autocompleteItem","autocompleteItemActive"):e.classNameFor("autocompleteItem")},e.props.renderSuggestion({suggestion:t.suggestion,formattedSuggestion:t.formattedSuggestion}))}),this.props.renderFooter&&this.props.renderFooter()))}}]),t}();f.propTypes={inputProps:function(e,t){var n=e[t];if(!n.hasOwnProperty("value"))throw new Error("'inputProps' must have 'value'.");if(!n.hasOwnProperty("onChange"))throw new Error("'inputProps' must have 'onChange'.")},onError:s.default.func,onSelect:s.default.func,renderSuggestion:s.default.func,classNames:s.default.shape({root:s.default.string,input:s.default.string,autocompleteContainer:s.default.string,autocompleteItem:s.default.string,autocompleteItemActive:s.default.string}),styles:s.default.shape({root:s.default.object,input:s.default.object,autocompleteContainer:s.default.object,autocompleteItem:s.default.object,autocompleteItemActive:s.default.object}),options:s.default.shape({bounds:s.default.object,componentRestrictions:s.default.object,location:s.default.object,offset:s.default.oneOfType([s.default.number,s.default.string]),radius:s.default.oneOfType([s.default.number,s.default.string]),types:s.default.array}),debounce:s.default.number,highlightFirstSuggestion:s.default.bool,renderFooter:s.default.func,shouldFetchSuggestions:s.default.func.isRequired},f.defaultProps={onError:function(e,t){return console.error("[react-places-autocomplete]: error happened when fetching data from Google Maps API.\nPlease check the docs here (https://developers.google.com/maps/documentation/javascript/places#place_details_responses)\nStatus: ",e)},classNames:{},renderSuggestion:function(e){var t=e.suggestion;return a.default.createElement("div",null,t)},styles:{},options:{},debounce:200,highlightFirstSuggestion:!1,shouldFetchSuggestions:function(){return!0}},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={root:{position:"relative",paddingBottom:"0px"},input:{display:"inline-block",width:"100%",padding:"10px"},autocompleteContainer:{position:"absolute",top:"100%",backgroundColor:"white",border:"1px solid #555555",width:"100%"},autocompleteItem:{backgroundColor:"#ffffff",padding:"10px",color:"#555555",cursor:"pointer"},autocompleteItemActive:{backgroundColor:"#fafafa"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.geocodeByAddress=function(e,t){var n=new google.maps.Geocoder,r=google.maps.GeocoderStatus.OK;return new Promise(function(i,o){n.geocode({address:e},function(e,n){if(n!==r){if(t)return console.warn('Deprecated: Passing a callback to geocodeByAddress is deprecated. Please see "https://github.com/kenny-hibino/react-places-autocomplete#geocodebyaddress-api"'),void t({status:n},null,e);o(n)}if(t){var a={lat:e[0].geometry.location.lat(),lng:e[0].geometry.location.lng()};console.warn('Deprecated: Passing a callback to geocodeByAddress is deprecated. Please see "https://github.com/kenny-hibino/react-places-autocomplete#geocodebyaddress-api"'),t(null,a,e)}i(e)})})},t.getLatLng=function(e){return new Promise(function(t,n){try{t({lat:e.geometry.location.lat(),lng:e.geometry.location.lng()})}catch(e){n(e)}})},t.geocodeByPlaceId=function(e,t){var n=new google.maps.Geocoder,r=google.maps.GeocoderStatus.OK;return new Promise(function(i,o){n.geocode({placeId:e},function(e,n){if(n!==r){if(t)return console.warn('Deprecated: Passing a callback to geocodeByAddress is deprecated. Please see "https://github.com/kenny-hibino/react-places-autocomplete#geocodebyplaceid-api"'),void t({status:n},null,e);o(n)}if(t){var a={lat:e[0].geometry.location.lat(),lng:e[0].geometry.location.lng()};console.warn('Deprecated: Passing a callback to geocodeByPlaceId is deprecated. Please see "https://github.com/kenny-hibino/react-places-autocomplete#geocodebyplaceid-api"'),t(null,a,e)}i(e)})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=n(2718),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(2),a=f(o),s=f(n(0));n(2719);var u=n(2732),l=f(n(4)),c=n(16);function f(e){return e&&e.__esModule?e:{default:e}}n(2765);let d=(i=r=class extends o.Component{constructor(e){super(e),this.componentWillReceiveProps=(e=>{let t={};this.props.dates&&this.props.dates.start&&e.dates&&e.dates.start&&this.props.dates.start!==e.dates.start&&(t.start=(0,l.default)(e.dates.start)),this.props.dates&&this.props.dates.end&&e.dates&&e.dates.end&&this.props.dates.end!==e.dates.end&&(t.end=(0,l.default)(e.dates.end)),e.dates||(t={start:void 0,end:void 0}),Object.keys(t)&&this.setState(t)}),this.toggleEdited=(e=>{e.stopPropagation(),e.preventDefault(),this.setState({isEdited:!this.state.isEdited})}),this.handleChange=(({startDate:e,endDate:t})=>{this.setState({start:e||this.state.start,end:t||this.state.end}),this.props.onChange({start:e?e.valueOf():this.props.dates&&this.props.dates.start,end:t?t.valueOf():this.props.dates&&this.props.dates.end})}),this.handleSubmit=(()=>{const{start:e,end:t}=this.state,n=e?e.valueOf():this.props.dates&&this.props.dates.start,r=t?t.valueOf():this.props.dates&&this.props.dates.end;this.props.onChange({start:n,end:r}),this.setState({isEdited:!1,start:e,end:t})}),this.handleDelete=(()=>{this.props.onChange(void 0),this.setState({start:void 0,end:void 0})}),this.handleCancel=(()=>{this.setState({isEdited:!1,start:this.props.dates&&this.props.dates.start&&(0,l.default)(this.props.dates.start),end:this.props.dates&&this.props.dates.end&&(0,l.default)(this.props.dates.end)})}),this.onFocusChange=(e=>{this.setState({focusedInput:e,isEdited:!!e}),e||this.handleSubmit()}),this.render=(()=>{const{state:{isEdited:e,focusedInput:t,start:n,end:r},props:{dates:i,id:o},context:{t:s},toggleEdited:l,handleChange:f,onFocusChange:d,handleDelete:p}=this,h=(0,c.translateNameSpacer)(s,"Components.DatesPicker"),m=i&&i.start,g=e=>{e.stopPropagation(),e.preventDefault()};return a.default.createElement("div",{onClick:g},a.default.createElement("div",{className:"level"},!m&&!e&&a.default.createElement("button",{className:"button is-primary is-fullwidth",onClick:l},h("add-dates"))),a.default.createElement("div",{onKeyUp:g,onClick:g,className:"level"},m||e?a.default.createElement(u.DateRangePicker,{openDirection:"down",startDate:n,startDateId:`${o} start`,isOutsideRange:()=>!1,startDatePlaceholderText:h("start date"),endDatePlaceholderText:h("end date"),displayFormat:"DD/MM/YYYY",endDate:r,endDateId:`${o} end`,onDatesChange:f,onFocusChange:d,focusedInput:t}):null),a.default.createElement("div",{className:"level"},m&&!e&&a.default.createElement("button",{className:"button is-danger",onClick:p},h("delete dates"))))}),this.state={isEdited:!1,focusedInput:void 0,start:e.dates&&e.dates.start&&(0,l.default)(e.dates.start),end:e.dates&&e.dates.end&&(0,l.default)(e.dates.end)}}},r.contextTypes={t:s.default.func},i);t.default=d},function(e,t,n){n(2720)},function(e,t,n){"use strict";var r,i=n(2721);(0,((r=i)&&r.__esModule?r:{default:r}).default)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){(0,i.default)(r.default)};var r=o(n(2722)),i=o(n(2731));function o(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){e.exports=n(2723).default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(2724)),i=u(n(2727)),o=n(2728),a=u(n(2729)),s=u(n(2730));function u(e){return e&&e.__esModule?e:{default:e}}t.default={create:function(e){var t={},n=Object.keys(e),r=(i.default.get(o.GLOBAL_CACHE_KEY)||{}).namespace,s=void 0===r?"":r;return n.forEach(function(e){var n=(0,a.default)(s,e);t[e]=n}),t},resolve:function(e){var t=(0,r.default)(e,1/0),n=(0,s.default)(t),i=n.classNames,o=n.hasInlineStyles,a=n.inlineStyles,u={className:i.map(function(e,t){return String(e)+" "+String(e)+"_"+String(t+1)}).join(" ")};return o&&(u.style=a),u}}},function(e,t,n){"use strict";var r=n(128),i=n(207),o=n(1122),a=n(1124),s=a(),u=n(2726),l=i.call(Function.call,s);r(l,{getPolyfill:a,implementation:o,shim:u}),e.exports=l},function(e,t,n){"use strict";var r=n(1123),i=n(418),o=i(i({},r),{ToIndex:function(e){if(void 0===e)return 0;var t=this.ToInteger(e);if(t<0)throw new RangeError("index must be >= 0");var n=this.ToLength(t);if(!this.SameValueZero(t,n))throw new RangeError("index must be >= 0 and < 2 ** 53 - 1");return n}});delete o.EnumerableOwnNames,e.exports=o},function(e,t,n){"use strict";var r=n(128),i=n(1124);e.exports=function(){var e=i();return r(Array.prototype,{flat:e},{flat:function(){return Array.prototype.flat!==e}}),e}},function(e,t,n){"use strict";(function(t){var r=n(128),i=n(614),o="__ global cache key __";"function"==typeof Symbol&&i(Symbol("foo"))&&"function"==typeof Symbol.for&&(o=Symbol.for(o));var a=function(){return!0},s=function(){if(!t[o]){var e={};e[o]={};var n={};n[o]=a,r(t,e,n)}return t[o]},u=s(),l=function(e){return i(e)?Symbol.prototype.valueOf.call(e):typeof e+" | "+String(e)},c=function(e){if(!function(e){return null===e||"object"!=typeof e&&"function"!=typeof e}(e))throw new TypeError("key must not be an object")},f={clear:function(){delete t[o],u=s()},delete:function(e){return c(e),delete u[l(e)],!f.has(e)},get:function(e){return c(e),u[l(e)]},has:function(e){return c(e),l(e)in u},set:function(e,t){c(e);var n=l(e),i={};i[n]=t;var o={};return o[n]=a,r(u,i,o),f.has(e)},setIfMissingThenGet:function(e,t){if(f.has(e))return f.get(e);var n=t();return f.set(e,n),n}};e.exports=f}).call(this,n(18))},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.GLOBAL_CACHE_KEY="reactWithStylesInterfaceCSS",t.MAX_SPECIFICITY=20},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(e.length>0?String(e)+"__":"")+String(t)}},function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){for(var t=[],n=!1,r={},i=0;i>",baseInvalidMessage:"Invalid "};function r(e){if("function"!=typeof e)throw new Error(n.invalidPropValidator);var t=e.bind(null,!1,null);return t.isRequired=e.bind(null,!0,null),t.withPredicate=function(t){if("function"!=typeof t)throw new Error(n.invalidPredicate);var r=e.bind(null,!1,t);return r.isRequired=e.bind(null,!0,t),r},t}function i(e,t,r){return new Error("The prop `"+e+"` "+n.requiredCore+" in `"+t+"`, but its value is `"+r+"`.")}var o=-1;e.exports={constructPropValidatorVariations:r,createMomentChecker:function(e,t,a,s){return r(function(r,u,l,c,f,d,p){var h=l[c],m=typeof h,g=function(e,t,n,r){var a=void 0===r,s=null===r;if(e){if(a)return i(n,t,"undefined");if(s)return i(n,t,"null")}return a||s?null:o}(r,f=f||n.anonymousMessage,p=p||c,h);if(g!==o)return g;if(t&&!t(h))return new Error(n.invalidTypeCore+": `"+c+"` of type `"+m+"` supplied to `"+f+"`, expected `"+e+"`.");if(!a(h))return new Error(n.baseInvalidMessage+d+" `"+c+"` of type `"+m+"` supplied to `"+f+"`, expected `"+s+"`.");if(u&&!u(h)){var v=u.name||n.anonymousMessage;return new Error(n.baseInvalidMessage+d+" `"+c+"` of type `"+m+"` supplied to `"+f+"`. "+n.predicateFailureCore+" `"+v+"`.")}return null})},messages:n}},function(e,t){function n(){return null}function r(){return n}n.isRequired=n,e.exports={and:r,between:r,booleanSome:r,childrenHavePropXorChildren:r,childrenOf:r,childrenOfType:r,childrenSequenceOf:r,componentWithName:r,disallowedIf:r,elementType:r,explicitNull:r,forbidExtraProps:Object,integer:r,keysOf:r,mutuallyExclusiveProps:r,mutuallyExclusiveTrueProps:r,nChildren:r,nonNegativeInteger:n,nonNegativeNumber:r,numericString:r,object:r,or:r,range:r,requiredBy:r,restrictedProp:r,sequenceOf:r,shape:r,stringStartsWith:r,uniqueArray:r,uniqueArrayOf:r,valuesOf:r,withShape:r}},function(e,t,n){"use strict";var r=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)};var i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(e,t){var n;return t&&!0===t.clone&&r(e)?s((n=e,Array.isArray(n)?[]:{}),e,t):e}function a(e,t,n){var i=e.slice();return t.forEach(function(t,a){void 0===i[a]?i[a]=o(t,n):r(t)?i[a]=s(e[a],t,n):-1===e.indexOf(t)&&i.push(o(t,n))}),i}function s(e,t,n){var i=Array.isArray(t);return i===Array.isArray(e)?i?((n||{arrayMerge:a}).arrayMerge||a)(e,t,n):function(e,t,n){var i={};return r(e)&&Object.keys(e).forEach(function(t){i[t]=o(e[t],n)}),Object.keys(t).forEach(function(a){r(t[a])&&e[a]?i[a]=s(e[a],t[a],n):i[a]=o(t[a],n)}),i}(e,t,n):o(t,n)}s.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce(function(e,n){return s(e,n,t)})};var u=s;e.exports=u},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.CHANNEL="__direction__",t.DIRECTIONS={LTR:"ltr",RTL:"rtl"}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(0),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default.shape({getState:o.default.func,setState:o.default.func,subscribe:o.default.func})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"==typeof e)return e;if("function"==typeof e)return e(t);return""}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=s(n(2)),i=n(64),o=s(n(577)),a=s(n(2744));function s(e){return e&&e.__esModule?e:{default:e}}var u=(0,i.forbidExtraProps)({children:(0,i.or)([(0,i.childrenOfType)(o.default),(0,i.childrenOfType)(a.default)]).isRequired});function l(e){var t=e.children;return r.default.createElement("tr",null,t)}l.propTypes=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PureCustomizableCalendarDay=t.selectedStyles=t.lastInRangeStyles=t.selectedSpanStyles=t.hoveredSpanStyles=t.blockedOutOfRangeStyles=t.blockedCalendarStyles=t.blockedMinNightsStyles=t.highlightedCalendarStyles=t.outsideStyles=t.defaultStyles=void 0;var r=Object.assign||function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:o.default.localeData().firstDayOfWeek();if(!o.default.isMoment(e)||!e.isValid())throw new TypeError("`month` must be a valid moment object");if(-1===a.WEEKDAYS.indexOf(n))throw new TypeError("`firstDayOfWeek` must be an integer between 0 and 6");for(var r=e.clone().startOf("month").hour(12),i=e.clone().endOf("month").hour(12),s=(r.day()+7-n)%7,u=(n+6-i.day())%7,l=r.clone().subtract(s,"day"),c=i.clone().add(u,"day").diff(l,"days")+1,f=l.clone(),d=[],p=0;p=s&&p2&&void 0!==arguments[2]?arguments[2]:r;return e?n(e(t.clone())):t};var r=function(e){return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t{e.contextualization&&e.resource&&this.refreshAssets(e)}),this.refreshAssets=(e=>{const{assets:t,resource:n={},productionId:r}=e;(0,d.getRelatedAssetsIds)(n.data).map(e=>t[e]).filter(e=>e).reduce((e,t)=>e.then(()=>new Promise((e,n)=>{(0,p.requestAssetData)(r,t).then(n=>(this.setState({assets:(0,o.default)({},this.state.assets,{[t.id]:(0,o.default)({},t,{data:n})})}),e())).catch(n)})),Promise.resolve())}),this.render=(()=>{const{props:{onClose:e,contextualization:t,contextualizer:n,resource:r,productionId:i,updateContextualization:a,updateContextualizer:u},context:{t:d}}=this,p=(0,f.translateNameSpacer)(d,"Components.ContextualizationEditor");if(!t||!r)return null;return s.default.createElement(l.StretchedLayoutContainer,{isDirection:"vertical",style:{height:"100%",overflow:"hidden"}},s.default.createElement(l.StretchedLayoutItem,null,s.default.createElement(l.StretchedLayoutContainer,{isDirection:"horizontal"},s.default.createElement(l.StretchedLayoutItem,{isFlex:1},s.default.createElement(l.Title,{isSize:4},p("Mention settings"))),s.default.createElement(l.StretchedLayoutItem,null,s.default.createElement(l.Delete,{onClick:e})))),s.default.createElement(l.StretchedLayoutItem,{style:{overflow:"auto"},isFlex:1},s.default.createElement(c.default,{translate:p,contextualizer:n,contextualization:t,resource:r,onChange:(e,r)=>new Promise((n,s)=>{if("contextualization"!==e)return n();{const e=(0,o.default)({},t,r);a({productionId:i,contextualizationId:e.id,contextualization:e},e=>{e?s(e):n()})}}).then(()=>new Promise((t,a)=>{if("contextualizer"!==e)return t();{const e=(0,o.default)({},n,r);u({productionId:i,contextualizerId:e.id,contextualizer:e},e=>{e?a(e):t()})}}))})))})},r);m.contextTypes={t:u.default.func},t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i,o=m(n(3)),a=n(2),s=m(a),u=m(n(0)),l=n(68),c=n(6),f=m(n(152)),d=m(n(82)),p=n(16),h=m(n(2770));function m(e){return e&&e.__esModule?e:{default:e}}let g=(i=r=class extends a.Component{constructor(e){super(e),this.componentWillReceiveProps=(e=>{this.props.contextualization!==e.contextualization&&this.setState({contextualization:e.contextualization}),this.props.resource!==e.resource&&this.setState({resource:e.resource}),this.props.contextualizer!==e.contextualizer&&this.setState({contextualizer:e.contextualizer})}),this.propagateOnChange=((e,t)=>{this.props.onChange(e,t)}),this.onChange=((e,t)=>{const n=this.props[e],r=(0,o.default)({},n,t);this.propagateOnChange(e,r),this.setState({[e]:r})}),this.render=(()=>{const{state:{contextualization:e={},contextualizer:t={},resource:n={}},context:{t:r},onChange:i}=this,{title:a="",legend:u="",visibility:l={screened:!0,paged:!0}}=e,m=d.default.contextualizers[t.type],g=m&&m.meta&&m.meta.profile.block||{},v=(0,p.translateNameSpacer)(r,"Components.ContextualizationEditor"),y=g.options||{},b=Object.keys(d.default.contextualizers).filter(e=>{return void 0!==d.default.contextualizers[e].meta.acceptedResourceTypes.find(e=>{if(e.test){return e.test(n)}if(e.type)return e.type===n.metadata.type})});return s.default.createElement("form",null,s.default.createElement(c.Control,null,s.default.createElement(f.default,{title:v("Custom title"),explanation:v("By default, item title will be used for legending the figure")}),s.default.createElement("input",{className:"input",value:a||"",placeholder:v("Custom title"),onChange:t=>{const n=t.target.value,r=(0,o.default)({},e,{title:n});i("contextualization",r)}})),s.default.createElement(c.Control,null,s.default.createElement(f.default,{title:v("Custom legend"),explanation:v("By default, item description will be used for legending the figure")}),s.default.createElement("input",{className:"input",value:u||"",placeholder:v("Custom legend"),onChange:t=>{const n=t.target.value,r=(0,o.default)({},e,{legend:n});i("contextualization",r)}})),s.default.createElement(c.Control,null,s.default.createElement(f.default,{title:v("Mention visibility"),explanation:v("Choose whether to show this figure in screened and/or paged editions")}),s.default.createElement(c.StretchedLayoutContainer,{isDirection:"horizontal"},d.default.renderingModes.map((t,n)=>{return s.default.createElement(c.StretchedLayoutItem,{isFlex:1,key:n},s.default.createElement(c.Button,{isColor:l[t]?"primary":"warning",onClick:()=>{(t=>{const n=!l[t],r=(0,o.default)({},e,{visibility:(0,o.default)({},l,{[t]:n})});i("contextualization",r)})(t)},isFullWidth:!0},v(t)))}))),s.default.createElement(c.Control,null,s.default.createElement(f.default,{title:v("Mention type"),explanation:v("Choose how to present the item in the document")}),s.default.createElement("div",null,b.map((e,n)=>{return s.default.createElement(c.Button,{key:n,isColor:t.type===e&&"primary",onClick:()=>{(e=>{const n=d.default.contextualizers[e]&&d.default.contextualizers[e].meta&&d.default.contextualizers[e].meta.profile.block&&d.default.contextualizers[e].meta.profile.block.options||{},r=Object.keys(n).reduce((e,t)=>(0,o.default)({},e,{[t]:n[t].default}),{}),a=(0,o.default)({},t,{type:e,parameters:r});i("contextualizer",a)})(e)}},v(e))}))),Object.keys(y).length>0&&s.default.createElement("div",null,s.default.createElement(c.Title,{isSize:5},v("Mention settings")),s.default.createElement(h.default,{translate:v,optionsSchema:y,contextualizer:t,onChange:e=>{const n=(0,o.default)({},t,{parameters:e});i("contextualizer",n)}})))}),this.state={contextualization:e.contextualization,contextualizer:e.contextualizer,resource:e.resource},this.propagateOnChange=(0,l.debounce)(this.propagateOnChange,500)}},r.contextTypes={t:u.default.func},i);t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(3)),i=s(n(2)),o=n(6),a=s(n(152));function s(e){return e&&e.__esModule?e:{default:e}}t.default=(({translate:e,optionsSchema:t,contextualizer:n={},onChange:s})=>{const{parameters:u={}}=n,l=(e,t)=>{const n=(0,r.default)({},u,{[e]:t});s(n)};return i.default.createElement("div",null,Object.keys(t).map(r=>{const s=t[r],c=u[r],f=void 0===c;return i.default.createElement(o.Control,{key:r},i.default.createElement(a.default,{title:e(r),explanation:e(`Explanation about ${r} parameter for contextualizer ${n.type}`)}),i.default.createElement("div",{style:{opacity:f?.5:1}},(()=>{switch(s.type){case"number":const t=e=>{let t=e.target.value;t=+t,isNaN(t)||l(r,t)};return i.default.createElement("input",{className:"input",placeholder:e(r),value:c,onChange:t});case"string":if(s.code){const e=e=>{l(r,e)};return i.default.createElement(o.CodeEditor,{value:c||"",onChange:e,changeDelay:2e3})}const n=e=>{const t=e.target.value;l(r,t)};return i.default.createElement("input",{className:"input",placeHolder:e(r),value:c,onChange:n});case"boolean":const a=e=>{let t=e.target.value;l(r,t="true"===t)};return i.default.createElement(o.Select,{value:c,onChange:a},i.default.createElement("option",{value:!0},e("yes")),i.default.createElement("option",{value:!1},e("no")));default:return null}})()))}))})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(2)),i=s(n(0)),o=n(6),a=n(16);function s(e){return e&&e.__esModule?e:{default:e}}const u=({isActive:e,onClose:t},{t:n})=>{const i=(0,a.translateNameSpacer)(n,"Features.SectionView");return r.default.createElement(o.ModalCard,{isActive:e,headerContent:i("Shortcuts help"),onClose:t,style:{maxHeight:"80%"},mainContent:r.default.createElement("div",null,r.default.createElement("p",null,i("All the shortcuts presented below are also accessible through the editor graphical interface (move cursor/select text)")),r.default.createElement("table",{className:"table"},r.default.createElement("thead",null,r.default.createElement("tr",null,r.default.createElement("th",null,i("Shortcut")),r.default.createElement("th",null,i("Where")),r.default.createElement("th",null,i("Effect")))),r.default.createElement("tbody",null,r.default.createElement("tr",null,r.default.createElement("th",null,r.default.createElement("code",null,"cmd+l")),r.default.createElement("th",null,i("Anywhere")),r.default.createElement("th",null,i("Open item citation widget"))),r.default.createElement("tr",null,r.default.createElement("th",null,r.default.createElement("code",null,"cmd+m")),r.default.createElement("th",null,i("Anywhere")),r.default.createElement("th",null,i("Add a new note"))),r.default.createElement("tr",null,r.default.createElement("th",null,r.default.createElement("code",null,i('"#" then space'))),r.default.createElement("th",null,i("Begining of a paragraph")),r.default.createElement("th",null,i("Add a title"))),r.default.createElement("tr",null,r.default.createElement("th",null,r.default.createElement("code",null,i('">" then space'))),r.default.createElement("th",null,i("Begining of a paragraph")),r.default.createElement("th",null,i("Add a citation block"))),r.default.createElement("tr",null,r.default.createElement("th",null,r.default.createElement("code",null,i('"*" then content then "*"'))),r.default.createElement("th",null,i("Anywhere")),r.default.createElement("th",null,i("Write italic text"))),r.default.createElement("tr",null,r.default.createElement("th",null,r.default.createElement("code",null,i('"**" then content then "**"'))),r.default.createElement("th",null,i("Anywhere")),r.default.createElement("th",null,i("Write bold text"))),r.default.createElement("tr",null,r.default.createElement("th",null,r.default.createElement("code",null,i('"*" then space'))),r.default.createElement("th",null,i("Begining of a paragraph")),r.default.createElement("th",null,i("Begin a list"))))))})};u.contextTypes={t:i.default.func},t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(2)),i=u(n(0)),o=n(6),a=n(153),s=n(16);function u(e){return e&&e.__esModule?e:{default:e}}const l=({onClose:e,onDeleteConfirm:t,id:n,production:i,deleteType:u,isActive:l,isDisabled:c=!1},{t:f})=>{const d=(0,s.translateNameSpacer)(f,"Components.ConfirmToDeleteModal");let p,h;if("section"===u)p=i&&i.sections[n]?d('Are you sure you want to delete the section "{s}" ? All its content will be lost without possible recovery.',{s:i.sections[n].metadata.title}):d("Are you sure you want to delete this section ?");else{const{contextualizations:e}=i;h=Object.keys(e).map(t=>e[t]).filter(e=>e.resourceId===n),p=i&&i.resources[n]?d('Are you sure you want to delete the resource "{s}" ?',{s:(0,a.getResourceTitle)(i.resources[n])}):d("Are you sure you want to delete this resource ?")}return r.default.createElement(o.ModalCard,{isActive:l,headerContent:d("section"===u?"Delete Section":"Delete Resource"),onClose:e,mainContent:r.default.createElement("div",null,"resource"===u&&h.length>0&&r.default.createElement("div",null,d(["You will destroy one item mention in your content if you delete this item.","You will destroy {n} item mentions in your content if your delete this item.","n"],{n:h.length})),r.default.createElement("div",null,p)),footerContent:[r.default.createElement(o.Button,{type:"submit",isFullWidth:!0,key:0,onClick:t,isDisabled:c,isColor:"danger"},d("Delete")),r.default.createElement(o.Button,{onClick:e,isFullWidth:!0,key:1,isColor:"warning"},d("Cancel"))]})};l.contextTypes={t:i.default.func},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(2)),i=s(n(0)),o=n(6),a=n(16);function s(e){return e&&e.__esModule?e:{default:e}}const u=({},{t:e})=>{const t=(0,a.translateNameSpacer)(e,"Components.LoadingScreen");return r.default.createElement(o.AbsoluteContainer,null,r.default.createElement(o.FlexContainer,{style:{height:"100%"},flexDirection:"row",alignItems:"center"},r.default.createElement(o.FlexContainer,{style:{flex:1},alignItems:"center",flexDirection:"column"},r.default.createElement("div",null,t("loading...")))))};u.contextTypes={t:i.default.func.isRequired},t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2775),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),a=d(o),s=d(n(0)),u=n(6),l=d(n(39)),c=n(16),f=n(41);function d(e){return e&&e.__esModule?e:{default:e}}let p=(i=r=class extends o.Component{constructor(e){super(e),this.componentWillReceiveProps=(e=>{e.isActive||this.setState({dropdownOpen:!1,choosenResource:void 0,title:"",url:""})}),this.render=(()=>{const{props:{onClose:e,hyperlinks:t=[],isActive:n,onCreateHyperlink:r,onContextualizeHyperlink:i,focusData:o},state:{dropdownOpen:s,choosenResource:d,title:p,url:h},context:{t:m}}=this,g=d&&t.find(e=>e.id===d),v=(0,c.translateNameSpacer)(m,"Components.LinkModal");return a.default.createElement(u.ModalCard,{isActive:n,headerContent:v("Add a hyperlink"),onClose:e,mainContent:a.default.createElement("div",null,t.length>0&&a.default.createElement(u.Field,{style:{pointerEvents:h&&h.length?"none":"all",opacity:h&&h.length?.5:1}},a.default.createElement(u.Title,{isSize:4},v("Pick an existing hyperlink from your library")),a.default.createElement(u.Control,null,a.default.createElement(u.Dropdown,{onToggle:()=>this.setState({dropdownOpen:!s}),isActive:s,closeOnChange:!0,onChange:e=>this.setState({choosenResource:d===e?void 0:e}),value:{id:d},options:t.sort((e,t)=>e.metadata.title>t.metadata.title?1:-1).map(e=>({id:e.id,label:a.default.createElement(u.FlexContainer,{alignItems:"center",flexDirection:"row"},a.default.createElement(u.Image,{style:{display:"inline-block",marginRight:"1em"},isSize:"16x16",src:l.default.webpage.black.svg}),a.default.createElement("span",null,`${(0,f.abbrevString)(e.metadata.title,30)} (${(0,f.abbrevString)(e.data.url,30)})`))}))},d&&g?(0,f.abbrevString)(`${g.metadata.title} (${g.data.url})`,60):v("Choose an existing hyperlink")))),a.default.createElement("div",null,a.default.createElement(u.Title,{isSize:4},v("Create a new hyperlink")),a.default.createElement(u.Field,null,a.default.createElement(u.Label,null,v("URL address")),a.default.createElement(u.Control,null,a.default.createElement("input",{className:"input",placeholder:v("Hyperlink URL"),value:h,onChange:e=>this.setState({url:e.target.value})}))),a.default.createElement(u.Field,null,a.default.createElement(u.Label,null,v("Title of the webpage")),a.default.createElement(u.Control,null,a.default.createElement("input",{className:"input",placeholder:v("Hyperlink title"),value:p,onChange:e=>this.setState({title:e.target.value})}))))),footerContent:[a.default.createElement(u.Button,{type:"submit",isFullWidth:!0,key:0,onClick:()=>{h&&h.length?r({url:h,title:p},o.focusId,o.selection):i(d,o.focusId,o.selection)},isDisabled:!(d||h&&h.length),isColor:"primary"},v("Add hyperlink")),a.default.createElement(u.Button,{onClick:e,isFullWidth:!0,key:1,isColor:"warning"},v("Cancel"))]})}),this.state={dropdownOpen:!1,choosenResource:void 0,title:"",url:""}}},r.contextTypes={t:s.default.func},i);t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2777),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),a=p(o),s=p(n(0)),u=n(6),l=p(n(39)),c=n(16),f=n(41),d=p(n(1121));function p(e){return e&&e.__esModule?e:{default:e}}let h=(i=r=class extends o.Component{constructor(e){super(e),this.componentWillReceiveProps=(e=>{e.isActive||this.setState({dropdownOpen:!1,choosenResource:void 0,name:"",description:"",entryType:"person"})}),this.render=(()=>{const{props:{onClose:e,glossaries:t=[],isActive:n,onCreateGlossary:r,onContextualizeGlossary:i,focusData:o},state:{dropdownOpen:s,choosenResource:p,name:h,description:m,entryType:g},context:{t:v}}=this,y=p&&t.find(e=>e.id===p),b=(0,c.translateNameSpacer)(v,"Components.GlossaryModal");return a.default.createElement(u.ModalCard,{isActive:n,headerContent:b("Add a glossary item"),onClose:e,mainContent:a.default.createElement("div",null,t.length>0&&a.default.createElement(u.Field,{style:{pointerEvents:h&&h.length&&g?"none":"all",opacity:h&&h.length&&g?.5:1}},a.default.createElement(u.Title,{isSize:4},b("Pick an existing glossary item from your library")),a.default.createElement(u.Control,null,a.default.createElement(u.Dropdown,{onToggle:()=>this.setState({dropdownOpen:!s}),isActive:s,closeOnChange:!0,onChange:e=>this.setState({choosenResource:p===e?void 0:e}),value:{id:p},options:t.sort((e,t)=>e.metadata.title>t.metadata.title?1:-1).map(e=>({id:e.id,label:a.default.createElement(u.FlexContainer,{alignItems:"center",flexDirection:"row"},a.default.createElement(u.Image,{style:{display:"inline-block",marginRight:"1em"},isSize:"16x16",src:l.default.glossary.black.svg}),a.default.createElement("span",null,`${(0,f.abbrevString)(e.data.name,30)} (${(0,f.abbrevString)(e.data.entryType,30)})`))}))},p&&y?(0,f.abbrevString)(`${y.data.name} (${y.data.entryType})`,60):b("Choose an existing glossary item")))),a.default.createElement("div",null,a.default.createElement(u.Title,{isSize:4},b("Create a new glossary item")),a.default.createElement(d.default,{data:{name:h,description:m,entryType:g},onChange:e=>this.setState(e),translate:b}))),footerContent:[a.default.createElement(u.Button,{type:"submit",isFullWidth:!0,key:0,onClick:()=>{h&&h.length&&g?r({name:h,description:m,entryType:g},o.focusId,o.selection):i(p,o.focusId,o.selection)},isDisabled:!(p||h&&h.length&&g),isColor:"primary"},b("Add glossary item")),a.default.createElement(u.Button,{onClick:e,isFullWidth:!0,key:1,isColor:"warning"},b("Cancel"))]})}),this.state={dropdownOpen:!1,choosenResource:void 0,name:"",description:"",entryType:"person"}}},r.contextTypes={t:s.default.func},i);t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2779),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";var r,i,o;Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),s=p(a),u=p(n(0)),l=n(6),c=p(n(39)),f=n(16),d=n(41);function p(e){return e&&e.__esModule?e:{default:e}}let h=(i=r=class extends a.Component{constructor(e){super(e),o.call(this),this.state={selectedSectionId:void 0,dropdownOpen:!1}}},r.contextTypes={t:u.default.func},o=function(){this.componentDidMount=(()=>{this.updateSelection(this.props)}),this.componentWillReceiveProps=(e=>{this.props.focusData&&e.focusData&&this.updateSelection(e)}),this.updateSelection=(e=>{e.focusData&&e.focusData.selectedSectionId&&this.setState({selectedSectionId:e.focusData.selectedSectionId})}),this.render=(()=>{const{props:{onClose:e,isActive:t,onCreateInternalLink:n,inactiveSections:r,focusData:i},state:{selectedSectionId:o,dropdownOpen:a},context:{t:u}}=this,p=(0,f.translateNameSpacer)(u,"Components.InternalLinkModal");return s.default.createElement(l.ModalCard,{isActive:t,headerContent:p("Add a link to another section"),onClose:e,mainContent:s.default.createElement("div",null,s.default.createElement(l.StretchedLayoutContainer,{style:{alignItems:"center"},isDirection:"horizontal"},s.default.createElement(l.StretchedLayoutItem,null,p("Link to section")),s.default.createElement(l.StretchedLayoutItem,{isFlex:1,style:{padding:"1rem"}},s.default.createElement(l.Dropdown,{onToggle:()=>{this.setState({dropdownOpen:!a})},isActive:a,closeOnChange:!0,onChange:e=>{this.setState({selectedSectionId:e})},value:{id:o},options:r.filter(e=>e).map(e=>({id:e.id,label:s.default.createElement(l.FlexContainer,{alignItems:"center",flexDirection:"row"},s.default.createElement(l.Image,{style:{display:"inline-block",marginRight:"1em"},isSize:"16x16",src:c.default.section.black.svg}),s.default.createElement("span",null,`${e&&e.title?(0,d.abbrevString)(e.title,30):p("No section")}`))}))},o?(0,d.abbrevString)(`${(e=>{const t=r.find(t=>t.id===e);return t?t.title:p("No section")})(o)}`,60):p("Choose a section"))))),footerContent:[s.default.createElement(l.Button,{type:"submit",isFullWidth:!0,key:0,onClick:()=>{n({contentId:i.focusId,selection:i.selection,selectedSectionId:o})},isDisabled:!o,isColor:"primary"},p("Add section link")),s.default.createElement(l.Button,{onClick:e,isFullWidth:!0,key:1,isColor:"warning"},p("Cancel"))]})})},i);t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2781),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=m(n(3)),o=n(2),a=m(o),s=n(43),u=n(69),l=h(n(927)),c=h(n(143)),f=h(n(286)),d=m(n(2782)),p=m(n(237));function h(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function m(e){return e&&e.__esModule?e:{default:e}}let g=(0,u.connect)(e=>(0,i.default)({},l.selector(e.summary),c.selector(e.editedProduction),f.selector(e.sectionsManagement)),e=>({actions:(0,s.bindActionCreators)((0,i.default)({},c,f,l),e)}))(r=class extends o.Component{constructor(e){super(e),this.componentWillMount=(()=>{const{match:{params:{productionId:e}}}=this.props;this.props.editedProduction&&this.props.editedProduction.id===e||this.props.actions.activateProduction({productionId:e})}),this.shouldComponentUpdate=(()=>!0),this.goToSection=(e=>{const{editedProduction:{id:t}}=this.props;this.props.history.push(`/productions/${t}/sections/${e}`)})}render(){return this.props.editedProduction?a.default.createElement(p.default,null,a.default.createElement(d.default,(0,i.default)({},this.props,{goToSection:this.goToSection}))):null}})||r;t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=v(n(3)),i=v(n(2)),o=v(n(0)),a=n(201),s=n(61),u=v(n(79)),l=n(6),c=n(16),f=n(132),d=n(41),p=v(n(967)),h=v(n(994)),m=v(n(398)),g=v(n(2783));function v(e){return e&&e.__esModule?e:{default:e}}const y=({editedProduction:e,metadataOpen:t,newSectionOpen:n,promptedToDeleteSectionId:o,isSorting:v,actions:{updateProductionMetadata:y,setNewSectionOpen:b,setPromptedToDeleteSectionId:_,setIsSorting:w,setMetadataOpen:x,createSection:E,deleteSection:M,updateSectionsOrder:S,setSectionLevel:O},goToSection:k},{t:C})=>{const{metadata:{title:T,subtitle:D,authors:A,abstract:j},sections:L,sectionsOrder:I,id:P}=e,N=(0,c.translateNameSpacer)(C,"Features.SummaryView"),R=I.filter(e=>L[e]).map(e=>L[e]),z=(0,f.createDefaultSection)(),F=z.metadata,U=()=>{x(!t)},Y=()=>b(!1);return i.default.createElement(l.Container,{style:{position:"relative",height:"100%"}},i.default.createElement(l.StretchedLayoutContainer,{isFluid:!0,isDirection:"horizontal",isAbsolute:!0},i.default.createElement(l.StretchedLayoutItem,{style:{marginTop:"1rem"},isFluid:!0,isFlex:1,isFlowing:!0},i.default.createElement(l.Column,null,i.default.createElement(l.Level,{style:{marginBottom:".4rem"}},i.default.createElement(l.Collapsable,{maxHeight:"100%",isCollapsed:t},i.default.createElement(l.Title,{isSize:3},(0,d.abbrevString)(T,60)),D&&i.default.createElement(l.Title,{isSize:5},i.default.createElement("i",null,(0,d.abbrevString)(D,60))),i.default.createElement("div",{style:{maxHeight:"15rem",overflow:"auto"}},A.map((e,t)=>i.default.createElement(l.Level,{key:t},i.default.createElement(l.LevelLeft,null,i.default.createElement(l.LevelItem,null,i.default.createElement(l.Icon,{isSize:"small",isAlign:"left",className:"fa fa-user"})),i.default.createElement(l.LevelItem,null,"string"==typeof e?(0,d.abbrevString)(e,60):`${(0,d.abbrevString)(e.given,60)} ${(0,d.abbrevString)(e.family,60)}`))))),i.default.createElement(l.Content,null,i.default.createElement("i",null,(0,d.abbrevString)(j,300))))),i.default.createElement(l.Level,{isFullWidth:!0},i.default.createElement(l.Button,{isFullWidth:!0,isColor:t?"primary":"info",onClick:U},i.default.createElement(l.StretchedLayoutContainer,{isAbsolute:!0,style:{alignItems:"center",justifyContent:"space-around",padding:"1rem"},isDirection:"horizontal"},i.default.createElement(l.StretchedLayoutItem,null,i.default.createElement(l.StatusMarker,null)),i.default.createElement(l.StretchedLayoutItem,{isFlex:1},N(t?"Close production settings":"Edit production settings")),t&&i.default.createElement(l.StretchedLayoutItem,null,i.default.createElement(l.Delete,{isSize:"medium"}))))),i.default.createElement(l.Collapsable,{isCollapsed:!t,maxHeight:"100%"},t&&i.default.createElement("div",{style:{marginTop:"1rem"}},i.default.createElement(p.default,{production:e,onSubmit:({payload:{metadata:e}})=>{y({productionId:P,metadata:e}),x(!1)},onCancel:U}))),i.default.createElement(l.Level,null),i.default.createElement(l.Level,null),i.default.createElement(l.Level,null))),n?i.default.createElement(l.StretchedLayoutItem,{isFluid:!0,isFlex:2,isFlowing:!0},i.default.createElement(l.Column,{isWrapper:!0},i.default.createElement(l.Column,{isWrapper:!0},i.default.createElement(l.StretchedLayoutContainer,{isAbsolute:!0,isDirection:"vertical"},i.default.createElement(l.StretchedLayoutItem,null,i.default.createElement(l.Title,{isSize:2},i.default.createElement(l.StretchedLayoutContainer,{style:{paddingTop:"1rem"},isDirection:"horizontal"},i.default.createElement(l.StretchedLayoutItem,{isFlex:11},N("New section")),i.default.createElement(l.StretchedLayoutItem,null,i.default.createElement(l.Delete,{onClick:Y})))),i.default.createElement(l.Level,null)),i.default.createElement(l.StretchedLayoutItem,{isFlex:1},i.default.createElement(h.default,{metadata:(0,r.default)({},F),onSubmit:e=>{const t=(0,r.default)({},z,{metadata:e,id:(0,s.v4)()});E({sectionId:t.id,section:t,productionId:P,sectionIndex:R.length-1}),b(!1),k(t.id)},onCancel:Y})))))):i.default.createElement(l.StretchedLayoutItem,{isFluid:!0,isFlex:2,isFlowing:!0},i.default.createElement(l.Column,null,i.default.createElement(l.Column,null,i.default.createElement(l.Title,{isSize:2},N("Summary"))),i.default.createElement(l.Level,null,i.default.createElement(l.Column,null,i.default.createElement(l.Button,{onClick:()=>b(!0),isFullWidth:!0,isColor:"primary"},N("New section")))),i.default.createElement(g.default,{items:R,production:e,onSortEnd:({oldIndex:e,newIndex:t})=>{w(!1);const n=R.map(e=>e.id),r=(0,a.arrayMove)(n,e,t);S({productionId:P,sectionsOrder:r}),u.default.rebuild()},renderNoItem:()=>i.default.createElement("div",null,N("No sections to display")),goToSection:k,setSectionIndex:(e,t)=>{const n=R.map(e=>e.id),r=(0,a.arrayMove)(n,e,t);S({productionId:P,sectionsOrder:r}),w(!1)},onSortStart:()=>w(!0),isSorting:v,onDelete:e=>{_(e)},setSectionLevel:({sectionId:e,level:t})=>{O({productionId:P,sectionId:e,level:t})},useDragHandle:!0}))),i.default.createElement(m.default,{isActive:void 0!==o,deleteType:"section",production:e,id:o,onClose:()=>_(void 0),onDeleteConfirm:()=>{(e=>{M({sectionId:e,productionId:P,blockId:e,blockType:"sections"})})(o),_(void 0)}})))};y.contextTypes={t:o.default.func},t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n(3)),i=c(n(40)),o=c(n(2)),a=n(201),s=n(6),u=c(n(2784)),l=c(n(244));function c(e){return e&&e.__esModule?e:{default:e}}const f=(0,a.SortableElement)(({value:e,production:t,goToSection:n,onDelete:r,setSectionLevel:i,reverseSectionLockMap:a={},isSorting:l,sectionIndex:c,maxSectionIndex:f,setSectionIndex:d})=>o.default.createElement(s.Level,{style:{marginBottom:0,width:"100%"}},o.default.createElement(s.Column,{isSize:12-e.metadata.level,isOffset:e.metadata.level},o.default.createElement(u.default,{section:e,minified:l,sectionIndex:c,maxSectionIndex:f,goTo:n,production:t,onDelete:r,setSectionIndex:d,setSectionLevel:i,lockData:a[e.id]})))),d=(0,a.SortableContainer)(e=>{let{items:t,renderNoItem:n}=e,a=(0,i.default)(e,["items","renderNoItem"]);return o.default.createElement(l.default,{items:t,defaultColumns:1,renderNoItem:n,renderItem:(e,n)=>o.default.createElement(f,(0,r.default)({},a,{key:e.id,maxSectionIndex:t.length-1,sectionIndex:n,index:n,value:e}))})});t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=h(n(2)),i=h(n(0)),o=n(201),a=n(155),s=n(6),u=h(n(39)),l=n(41),c=n(16),f=h(n(388)),d=h(n(84)),p=h(n(144));function h(e){return e&&e.__esModule?e:{default:e}}const m=({section:e,goTo:t,setSectionLevel:n,sectionIndex:i,maxSectionIndex:h,production:m,onDelete:g,setSectionIndex:v},{t:y})=>{const b=(0,c.translateNameSpacer)(y,"Components.SectionCard"),_=r.default.createElement("span",{"data-for":"tooltip","data-place":"right","data-html":!0,"data-tip":`
${e.metadata.title}

${(0,l.computeSectionFirstWords)(e)}

`},(0,l.abbrevString)(e.metadata.title||b("Untitled section"),30)),w=(r,i)=>{switch(i.stopPropagation(),r){case"delete":g(e.id);break;case"higher":n({sectionId:e.id,level:e.metadata.level-1});break;case"lower":n({sectionId:e.id,level:e.metadata.level+1});break;case"edit":default:t(e.id)}};return r.default.createElement("div",{className:"is-clickable",onClick:n=>{n.stopPropagation(),t(e.id)}},r.default.createElement(s.Card,{onAction:w,bodyContent:r.default.createElement("div",null,r.default.createElement(s.Columns,{style:{marginBottom:0}},r.default.createElement(s.Column,{style:{paddingBottom:0},isSize:1},r.default.createElement(d.default,{src:u.default.section.black.svg,isSize:"32x32"})),r.default.createElement(s.Column,{style:{paddingBottom:0},isSize:7},r.default.createElement(s.Title,{isSize:5},r.default.createElement(a.Link,{to:`/productions/${m.id}/sections/${e.id}`,"data-tip":e.metadata.title.length>30?e.metadata.title:void 0,"data-for":"tooltip","data-place":"bottom"},r.default.createElement("span",null,_))))),r.default.createElement(s.Columns,null,r.default.createElement(s.Column,{isOffset:1,isSize:7},r.default.createElement("i",null,(0,l.computeSectionFirstWords)(e)),r.default.createElement("div",{style:{marginTop:"1rem"}},r.default.createElement(s.Button,{onClick:e=>w("edit",e),"data-effect":"solid","data-place":"left","data-for":"tooltip","data-tip":b("edit section")},r.default.createElement(d.default,{src:u.default.edit.black.svg})),r.default.createElement(s.Button,{onClick:e=>w("delete",e),"data-effect":"solid","data-place":"left","data-for":"tooltip","data-tip":b("delete this section")},r.default.createElement(d.default,{src:u.default.remove.black.svg})))),r.default.createElement(s.Column,{style:{position:"relative"},isSize:2},r.default.createElement(f.default,{style:{position:"absolute",top:"-3rem",right:"1rem"},chevronsData:{left:{tooltip:b("Title level {n}",{n:e.metadata.level}),isDisabled:0===e.metadata.level,onClick:()=>n({sectionId:e.id,level:e.metadata.level-1})},right:{tooltip:b("Title level {n}",{n:e.metadata.level+2}),isDisabled:e.metadata.level>=p.default.maxSectionLevel-1,onClick:()=>n({sectionId:e.id,level:e.metadata.level+1})},up:{isDisabled:0===i,tooltip:b("Move up in the summary"),onClick:()=>v(i,i-1)},down:{isDisabled:i===h,tooltip:b("Move down in the summary"),onClick:()=>v(i,i+1)}},moveComponentToolTip:b("Move section in summary"),MoveComponent:(0,o.SortableHandle)(()=>r.default.createElement("span",{onClick:l.silentEvent,onMouseUp:l.silentEvent,style:{cursor:"move"},className:"button"},r.default.createElement(s.Icon,{className:"fa fa-arrows-alt"})))}))))}))};m.contextTypes={t:i.default.func},t.default=m},function(e,t,n){"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(2),a=d(o),s=d(n(0)),u=d(n(79)),l=d(n(2786)),c=d(n(559)),f=n(16);function d(e){return e&&e.__esModule?e:{default:e}}n(2787);let p=(i=r=class extends o.Component{constructor(e){super(e),this.componentDidMount=(()=>{this.updatePaginationItems(this.props),setTimeout(()=>{u.default.rebuild()})}),this.componentWillReceiveProps=(e=>{this.props.items.length!==e.length&&this.updatePaginationItems(e),u.default.rebuild()}),this.updatePaginationItems=(({items:e,itemsPerPage:t=10})=>{const{paginationPosition:n}=this.state,r=Math.ceil(e.length/t);let i=n0?i:0;const o=[];for(let e=0;e5&&(s=[i>0?o[0]:void 0,i>2?{index:i-2,content:a.default.createElement("span",{className:"pagination-ellipsis"},"…")}:void 0,i>1?o[i-1]:void 0,o[i],i+1e));let u=i*t;u=0===u?u:u-1;let l=i*t+t;l=l{this.setState({paginationPosition:e}),setTimeout(()=>{this.updatePaginationItems(this.props),this.scrollContainer&&(this.scrollContainer.scrollTop=0)})}),this.onPaginationClick=(e=>{this.setPaginationPosition(e.index)}),this.onPaginationPrev=(()=>{const{paginationPosition:e}=this.state;e>0&&this.setPaginationPosition(e-1)}),this.onPaginationNext=(()=>{const{paginationPosition:e,numberOfPages:t}=this.state;e{const{props:{renderItem:e,minified:t,renderNoItem:n=(()=>a.default.createElement("div",null,"No items to display")),className:r="",defaultColumns:i=2,itemsContainerClassName:o="",style:s,id:d},state:{displayedItems:p=[],displayedPaginationItems:h,paginationPosition:m,numberOfPages:g},context:{t:v},onPaginationClick:y,onPaginationPrev:b,onPaginationNext:_}=this,w=(0,f.translateNameSpacer)(v,"Components.PaginatedList");return a.default.createElement("div",{style:s,id:d,className:`ovide-PaginatedList ${r}`},a.default.createElement("div",{ref:e=>{this.scrollContainer=e},className:`items-container is-flex-1 is-scrollable ${o}`},1===i?a.default.createElement(c.default,{style:{minHeight:"100%"}},p.length?p.map(e):n()):a.default.createElement(l.default,{breakpointCols:{default:i,1024:2,500:1},className:"my-masonry-grid",columnClassName:"my-masonry-grid_column"},p.length?p.map(e):n()),a.default.createElement(u.default,{id:"tooltip"})),h&&h.length>1?a.default.createElement("nav",{className:"pagination is-rounded is-centered",role:"navigation","aria-label":"pagination"},a.default.createElement("a",{onClick:b,className:`pagination-previous ${0===m?"is-disabled":""}`},t?a.default.createElement("i",{className:"fas fa-chevron-left"}):w("previous")),a.default.createElement("a",{onClick:_,className:`pagination-next ${m===g-1?"is-disabled":""}`},t?a.default.createElement("i",{className:"fas fa-chevron-right"}):w("next")),a.default.createElement("ul",{className:"pagination-list"},h.map((e,t)=>{return a.default.createElement("li",{className:e.active?"is-current":"",key:t,onClick:()=>{y(e)}},a.default.createElement("a",{className:"pagination-link"},e.content))}))):null)}),this.state={displayedPaginationItems:void 0,paginationPosition:0}}},r.contextTypes={t:s.default.func},i);t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0&&(t={default:t});var n=1/0,r=t.default||2;for(var i in t){var o=parseInt(i);o>0&&e<=o&&o=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["breakpointCols","columnClassName","column"]));return o.default.createElement("div",t,this.renderColumns())}}]),t}();u.propTypes={breakpointCols:a.default.object,columnClassName:a.default.string},u.defaultProps={breakpointCols:{},className:"my-masonry-grid",columnClassName:"my-masonry-grid_column"},t.default=u},function(e,t,n){var r=n(2788);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(33)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(32)(!1)).push([e.i,".ovide-PaginatedList {\n display: flex;\n overflow: hidden;\n flex-flow: column nowrap;\n justify-content: stretch; }\n .ovide-PaginatedList .items-container {\n overflow: auto;\n flex: 1; }\n .ovide-PaginatedList .items-container > div {\n display: flex;\n overflow-y: auto;\n flex-flow: row wrap; }\n .ovide-PaginatedList .pagination {\n min-height: 5rem; }\n .ovide-PaginatedList .pagination-previous.is-disabled,\n .ovide-PaginatedList .pagination-next.is-disabled {\n opacity: .5;\n cursor: not-allowed;\n pointer-events: none; }\n .ovide-PaginatedList .pagination-list li.is-current a {\n color: white !important;\n background: brown; }\n .ovide-PaginatedList .my-masonry-grid {\n display: flex;\n width: auto;\n margin-left: -1rem;\n /* gutter size offset */ }\n .ovide-PaginatedList .my-masonry-grid_column {\n padding-left: 1rem;\n /* gutter size */\n background-clip: padding-box; }\n .ovide-PaginatedList .my-masonry-grid_column > div {\n width: 100%; }\n",""])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2790),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=E(n(3)),o=n(2),a=E(o),s=n(43),u=n(69),l=E(n(79)),c=n(153),f=n(70),d=x(n(550)),p=x(n(143)),h=x(n(286)),m=x(n(234)),g=x(n(83)),v=E(n(2791)),y=E(n(237)),b=E(n(383)),_=E(n(569)),w=E(n(144));function x(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function E(e){return e&&e.__esModule?e:{default:e}}const{maxBatchNumber:M}=w.default;let S=(0,u.connect)(e=>(0,i.default)({},d.selector(e.library),p.selector(e.editedProduction),h.selector(e.sectionsManagement)),e=>({actions:(0,s.bindActionCreators)((0,i.default)({},g,p,h,m,d),e)}))(r=class extends o.Component{constructor(e){super(e),this.componentDidMount=(()=>{const e=this.props.match.params.productionId;this.props.editedProduction&&this.props.editedProduction.id===e||this.props.actions.activateProduction({productionId:e})}),this.componentWillReceiveProps=(e=>{!this.props.editedResourceId!==e.editedResourceId&&l.default.hide()}),this.shouldComponentUpdate=(()=>!0),this.componentWillUnmount=(()=>{this.props.actions.resetViewsUi()}),this.submitMultiResources=(e=>{this.props.actions.setUploadStatus({status:"initializing",errors:[]}),setTimeout(()=>{const{setErrorMessage:t}=this.props.actions;if(e.length>M)return t({type:"SUBMIT_MULTI_RESOURCES_FAIL",error:"Too many files uploaded"}),void this.props.actions.setUploadStatus(void 0);const n=(0,c.validateFiles)(e);if(0===n.length)return t({type:"SUBMIT_MULTI_RESOURCES_FAIL",error:"No valid files to upload"}),void this.props.actions.setUploadStatus(void 0);if(n.lengthvoid 0===n.find(t=>t.name===e.name));this.props.actions.setUploadStatus((0,i.default)({},this.props.uploadStatus,{errors:r.map(e=>({fileName:e.name,reason:"too big"}))})),t({type:"SUBMIT_MULTI_RESOURCES_FAIL",error:"Some files larger than maximum size"})}const r=[];n.reduce((e,t)=>e.then(()=>(this.props.actions.setUploadStatus({status:"uploading",currentFileName:t.name,errors:this.props.uploadStatus.errors}),(0,c.createResourceData)(t,this.props).then(e=>{e&&!e.success&&r.push(e)}))),Promise.resolve()).then(()=>{r.length>0&&t({type:"SUBMIT_MULTI_RESOURCES_FAIL",error:r}),this.props.actions.setMainColumnMode("edition"),this.props.actions.setUploadStatus(void 0)}).catch(e=>{this.props.actions.setUploadStatus(void 0),t({type:"SUBMIT_MULTI_RESOURCES_FAIL",error:e})})},100)}),this.deleteResource=((e,t)=>{const{actions:{deleteResource:n,deleteAsset:r}}=this.props,i=(0,f.getRelatedAssetsIds)(e.resource);i.length?i.reduce((t,n)=>t.then(()=>new Promise((t,i)=>{const o={assetId:n,productionId:e.productionId,asset:this.props.editedProduction.assets[n]};r(o,e=>e?i(e):t())})),Promise.resolve()).then(()=>{n(e,t)}).catch(t):n(e,t)})}render(){const{props:{uploadStatus:e,editedProduction:t},submitMultiResources:n,deleteResource:r}=this;return t?a.default.createElement(b.default,{productionId:t.id,serverUrl:w.default.apiUrl},a.default.createElement(y.default,null,a.default.createElement(v.default,(0,i.default)({},this.props,{submitMultiResources:n,deleteResource:r})),a.default.createElement(_.default,{uploadStatus:e}))):null}})||r;t.default=S},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=x(n(3)),i=n(2),o=x(i),a=x(n(0)),s=n(61),u=n(68),l=n(6),c=n(153),f=n(70),d=n(16),p=n(41),h=x(n(244)),m=x(n(2792)),g=x(n(2793)),v=x(n(398)),y=x(n(576)),b=x(n(2794)),_=x(n(144)),w=n(82);function x(e){return e&&e.__esModule?e:{default:e}}const{maxBatchNumber:E,maxResourceSize:M}=_.default,S=(0,p.base64ToBytesLength)(M),O=Object.keys(w.resourcesSchemas);let k=class extends i.Component{constructor(e){super(e),this.componentDidMount=(()=>{const{searchString:e}=this.props;this.setState({searchString:e})}),this.componentWillReceiveProps=(()=>{}),this.setResourceSearchString=(e=>this.props.actions.setSearchString(e)),this.setResourceSearchStringDebounce=(e=>{this.setState({searchString:e}),this.setResourceSearchString(e)}),this.renderMainColumn=(()=>{const{editedProduction:e={},mainColumnMode:t,optionsVisible:n,filterValues:i,sortValue:a,statusFilterValue:p,searchString:_,promptedToDeleteResourceId:w,selectedResourcesIds:x,resourcesPromptedToDelete:E,editedResourceId:M,actions:{setOptionsVisible:S,setMainColumnMode:k,setFilterValues:C,setSortValue:T,setStatusFilterValue:D,setPromptedToDeleteResourceId:A,setUploadStatus:j,createResource:L,updateResource:I,createAsset:P,updateAsset:N,deleteAsset:R,updateSection:z,setSelectedResourcesIds:F,setResourcesPromptedToDelete:U,setIsBatchDeleting:Y,setResourceDeleteStep:H,setEditedResourceId:W},deleteResource:B}=this.props,{t:V}=this.context,{resources:q={},id:G,metadata:{coverImage:K={}},assets:Q}=e,X=(0,d.translateNameSpacer)(V,"Features.LibraryView"),J=K.resourceId,Z=Object.keys(i).filter(e=>i[e]),$=[{id:"all",label:X("all items")},{id:"unused",label:X("only unused items (not mentionned anywhere in the production)")}],ee=E,te=Object.keys(q).map(e=>q[e]);let ne=0===_.length?te:(0,c.searchResources)(te,_);const re={},ie=(0,u.uniq)(Object.keys(e.contextualizations).map(t=>{const n=e.contextualizations[t].resourceId;return re[n]=re[n]?re[n]+1:1,n}));ne=ne.filter(e=>!Z.length||Z.indexOf(e.metadata.type)>-1).filter(e=>{switch(p){case"unused":return-1===ie.indexOf(e.id);case"all":default:return!0}}).sort((e,t)=>{switch(a){case"edited recently":return!t.lastUpdateAt||e.lastUpdateAt>t.lastUpdateAt?-1:1;case"most mentioned":return(re[e.id]||0)>(re[t.id]||0)?-1:1;case"title":default:const n=(0,c.getResourceTitle)(e),r=(0,c.getResourceTitle)(t);return n&&r&&n.toLowerCase().trim()>r.toLowerCase().trim()?1:-1}});let oe=0;ee.length&&(oe=ee.reduce((t,n)=>t+Object.keys(e.contextualizations).filter(t=>e.contextualizations[t].resourceId===n).length,0));const ae=t=>{const n="string"==typeof t?t:w,i=q[n];if(!i)return;const o={productionId:G,resourceId:i.id,resource:i},a=Object.keys(e.contextualizations).map(t=>e.contextualizations[t]).filter(e=>e.resourceId===n),s=a.map(e=>e.id),l=(0,u.uniq)(a.map(e=>e.sectionId));if(s.length){const t=l.reduce((t,n)=>{const i=t[n]||e.sections[n],o=a.filter(e=>e.sectionId===n);let s;const u=(0,r.default)({},i,{contents:o.reduce((e,t)=>{const{changed:n,result:r}=(0,f.removeContextualizationReferenceFromRawContents)(e,t.id);return n&&!s&&(s=!0),r},(0,r.default)({},i.contents)),notes:Object.keys(i.notes).reduce((e,t)=>(0,r.default)({},e,{[t]:(0,r.default)({},i.notes[t],{contents:o.reduce((e,t)=>{const{changed:n,result:r}=(0,f.removeContextualizationReferenceFromRawContents)(e,t.id);return n&&!s&&(s=!0),r},(0,r.default)({},i.notes[t].contents))})}),{})});return s?(0,r.default)({},t,{[n]:u}):t},{});Object.keys(t).forEach(n=>{z({sectionId:n,productionId:e.id,section:t[n]})}),A(void 0)}B(o),A(void 0)},se=()=>{Y(!0);const t=ee.reduce((t,n)=>{if(!q[n])return;const i=Object.keys(e.contextualizations).map(t=>e.contextualizations[t]).filter(e=>e.resourceId===n),o=i.map(e=>e.id),a=(0,u.uniq)(i.map(e=>e.sectionId));if(o.length){const n=a.reduce((t,n)=>{const o=t[n]||e.sections[n],a=i.filter(e=>e.sectionId===n);let s;const u=(0,r.default)({},o,{contents:a.reduce((e,t)=>{const{changed:n,result:r}=(0,f.removeContextualizationReferenceFromRawContents)(e,t.id);return n&&!s&&(s=!0),r},(0,r.default)({},o.contents||{})),notes:Object.keys(o.notes).reduce((e,t)=>(0,r.default)({},e,{[t]:(0,r.default)({},o.notes[t],{contents:a.reduce((e,t)=>{const{changed:n,result:r}=(0,f.removeContextualizationReferenceFromRawContents)(e,t.id);return n&&!s&&(s=!0),r},(0,r.default)({},o.notes[t].contents))})}),{})});return s?(0,r.default)({},t,{[n]:u}):t},t);if(Object.keys(n).length)return(0,r.default)({},t,n)}return t},{});Object.keys(t||{}).reduce((n,r)=>n.then(()=>new Promise((n,i)=>{z({sectionId:r,productionId:e.id,section:t[r]},e=>{e?i(e):n()})})),Promise.resolve()).then(()=>ee.reduce((t,n,r)=>t.then(()=>new Promise(t=>{const i=e.resources[n],o={productionId:G,resourceId:n,resource:i};H(r),B(o,e=>{e&&console.error(e),t()})})),Promise.resolve())).then(()=>{H(0),U([]),F([]),Y(!1),A(void 0)}).catch(e=>{H(0),U([]),F([]),Y(!1),A(void 0),console.error(e)})};if(M){const t=q[M],n=(0,f.getRelatedAssetsIds)(t.data),r=n.map(t=>e.assets[t]).filter(e=>e),i=(t,r)=>{const{id:i}=t,o={resourceId:i,resource:t,productionId:G};"bib"===t.metadata.type?(0,c.createBibData)(t,this.props):I(o);const a=n.filter(e=>{if(!r[e])return!0}),s=Object.keys(r).filter(e=>!Q[e]),u=Object.keys(r).filter(e=>Q[e]&&r[e]&&Q[e].lastUploadAt!==r[e].lastUploadAt);s.reduce((e,t)=>e.then(()=>{const e=r[t];return P({productionId:G,assetId:t,asset:e})}),Promise.resolve()).then(()=>u.reduce((e,t)=>e.then(()=>{const e=r[t];return N({productionId:G,assetId:t,asset:e})}),Promise.resolve())).then(()=>a.reduce((t,n)=>t.then(()=>{const t=e.assets[n];return R({productionId:G,assetId:n,asset:t})}),Promise.resolve())).then(()=>{W(void 0)})},a=()=>{W(void 0)};return o.default.createElement(y.default,{onCancel:a,onSubmit:i,bigSelectColumnsNumber:3,productionId:G,resource:t,existingAssets:r,asNewResource:!1})}switch(t){case"new":const u=(e,t)=>{const n=(0,s.v4)();let i;i="bib"===e.metadata.type?e.data&&e.data.length&&e.data[0].title:!e.metadata.title.length&&Object.keys(t).length?t[Object.keys(t)[0]].filename:e.metadata.title;const o={resourceId:n,resource:(0,r.default)({},e,{id:n,metadata:(0,r.default)({},e.metadata,{title:i})}),productionId:G};if("bib"===e.metadata.type)j({status:"initializing",errors:[]}),setTimeout(()=>{(0,c.createBibData)(e,this.props).then(()=>{j(void 0)}).catch(e=>{console.error(e),j(void 0)})},100);else{Object.keys(t).filter(e=>!Q[e]).reduce((e,n)=>e.then(()=>{const e=t[n];return new Promise((t,r)=>{P({productionId:G,assetId:n,asset:e},e=>{e?r(e):t()})})}),Promise.resolve()).then(()=>{L(o,e=>console.log("done creating",e))}).catch(console.error)}k("list")},d=()=>k("list");return o.default.createElement(y.default,{onCancel:d,onSubmit:u,bigSelectColumnsNumber:3,asNewResource:!0});case"list":default:const _=(e,t)=>{"filter"===t?(e=>{C((0,r.default)({},i,{[e]:!i[e]}))})(e):"sort"===t?(T(e),S(!1)):"status"===t&&(D(e),S(!1))},M=e=>this.setResourceSearchStringDebounce(e.target.value),I=()=>{S(!n)},N=()=>F(ne.map(e=>e.id)),R=()=>F([]),z=()=>U([...x]),Y=()=>o.default.createElement("div",null,X("No item in your library yet")),H=t=>{const n=(0,f.getRelatedAssetsIds)(t.data).map(t=>e.assets[t]).filter(e=>e),r=x.indexOf(t.id)>-1;return o.default.createElement(b.default,{isActive:r,onClick:()=>{let e;e=r?x.filter(e=>e!==t.id):[...x,t.id],F(e)},onEdit:e=>{e.stopPropagation(),W(t.id)},onDelete:()=>{A(t.id)},coverImageId:J,numberOfMentions:re[t.id],resource:t,assets:n,productionId:G,getTitle:c.getResourceTitle,key:t.id})},B=()=>A(void 0),V=()=>U([]);return o.default.createElement(l.StretchedLayoutContainer,{isAbsolute:!0},o.default.createElement(l.StretchedLayoutItem,null,o.default.createElement(l.Level,null),o.default.createElement(l.Column,{style:{paddingRight:0}},o.default.createElement(g.default,{filterValues:i,onDeleteSelection:z,onDeselectAllVisibleResources:R,onSearchStringChange:M,searchString:this.state.searchString,onSelectAllVisibleResources:N,onToggleOptionsVisibility:I,optionsVisible:n,resourceTypes:O,selectedResourcesIds:x,onChange:_,sortValue:a,statusFilterValue:p,statusFilterValues:$,translate:X,visibleResources:ne}))),o.default.createElement(l.StretchedLayoutItem,{isFlex:1},o.default.createElement(l.StretchedLayoutContainer,{isAbsolute:!0,isDirection:"vertical"},o.default.createElement(h.default,{items:ne,itemsPerPage:30,style:{height:"100%"},renderNoItem:Y,renderItem:H}))),o.default.createElement(v.default,{isActive:void 0!==w,deleteType:"resource",production:e,id:w,onClose:B,onDeleteConfirm:ae}),o.default.createElement(m.default,{translate:X,isActive:ee.length>0,actualResourcesPromptedToDelete:ee,resourcesPromptedToDelete:E,endangeredContextualizationsLength:oe,onDelete:se,onCancel:V}))}}),this.render=(()=>{const{mainColumnMode:e,resourcesPromptedToDelete:t,isBatchDeleting:n,resourceDeleteStep:r,actions:{setMainColumnMode:i},submitMultiResources:a}=this.props,{t:s}=this.context,u=t,c=(0,d.translateNameSpacer)(s,"Features.LibraryView");return o.default.createElement(l.Container,{style:{position:"relative",height:"100%"}},o.default.createElement(l.StretchedLayoutContainer,{isFluid:!0,isDirection:"horizontal",isAbsolute:!0},o.default.createElement(l.StretchedLayoutItem,{className:"is-hidden-mobile",isFlex:"1"},o.default.createElement(l.Column,null,o.default.createElement(l.Level,null),o.default.createElement(l.Level,null,o.default.createElement(l.Content,null,c("Your library contains all the items that can be used within the production."))),o.default.createElement(l.Level,null,o.default.createElement(l.Button,{isFullWidth:!0,onClick:()=>{i("new"===e?"list":"new")},isColor:"new"===e?"primary":"info"},c("New item"))),o.default.createElement(l.Level,null,o.default.createElement(l.DropZone,{onDrop:a,accept:".jpeg,.jpg,.gif,.png,.csv,.tsv,.bib"},c("Drop files to include in your library"),o.default.createElement(l.HelpPin,{place:"right"},`${c("Accepted file formats: jpeg, jpg, gif, png, csv, tsv, bib")}. ${c("Up to {n} files, with a maximum size of {s} Mb each",{n:E,s:Math.floor(S/1e6)})}`))))),o.default.createElement(l.StretchedLayoutItem,{isFlex:"3"},o.default.createElement(l.Column,{isWrapper:!0},this.renderMainColumn()))),o.default.createElement(l.ModalCard,{isActive:n,headerContent:c(["Deleting an item","Deleting {n} items","n"],{n:u.length}),mainContent:o.default.createElement("div",null,c("Deleting item {k} of {n}",{k:r+1,n:u.length}))}))}),this.state={searchString:""},this.setResourceSearchString=(0,u.debounce)(this.setResourceSearchString,500)}};k.contextTypes={t:a.default.func},t.default=k},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2),o=(r=i)&&r.__esModule?r:{default:r},a=n(6);t.default=(({translate:e,isActive:t,actualResourcesPromptedToDelete:n,resourcesPromptedToDelete:r,endangeredContextualizationsLength:i,onDelete:s,onCancel:u})=>o.default.createElement(a.ModalCard,{isActive:t,headerContent:e(["Delete an item","Delete {n} items","n"],{n:n.length}),onClose:u,mainContent:o.default.createElement("div",null,i>0&&o.default.createElement("p",null,e(["You will destroy one item mention in your content if you delete these items.","You will destroy {n} item mentions in your content if your delete these items.","n"],{n:i})),o.default.createElement("p",null,e(["Are you sure you want to delete this item ?","Are you sure you want to delete these items ?","n"],{n:r.length}))),footerContent:[o.default.createElement(a.Button,{type:"submit",isFullWidth:!0,key:0,onClick:s,isColor:"danger"},e("Delete")),o.default.createElement(a.Button,{onClick:u,isFullWidth:!0,key:1,isColor:"warning"},e("Cancel"))]}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(2)),i=l(n(0)),o=n(6),a=l(n(39)),s=l(n(84)),u=n(16);function l(e){return e&&e.__esModule?e:{default:e}}const c=({filterValues:e,onDeleteSelection:t,onDeselectAllVisibleResources:n,onSearchStringChange:i,onSelectAllVisibleResources:l,onToggleOptionsVisibility:c,optionsVisible:f,resourceTypes:d,searchString:p,selectedResourcesIds:h,onChange:m,sortValue:g,statusFilterValue:v,statusFilterValues:y,visibleResources:b},{t:_})=>{const w=(0,u.translateNameSpacer)(_,"Features.LibraryView");return r.default.createElement(o.Level,{isMobile:!0,style:{flexFlow:"row wrap"}},r.default.createElement(o.LevelLeft,null,r.default.createElement(o.Field,{hasAddons:!0},r.default.createElement(o.Input,{value:p,onChange:i,placeholder:w("Find a resource")})),r.default.createElement(o.LevelItem,null,r.default.createElement(o.Dropdown,{closeOnChange:!1,menuAlign:"left",onToggle:c,onChange:m,isActive:f,isColor:Object.keys(e).filter(t=>e[t]).length>0?"info":"",value:{sort:{value:g},filter:{value:Object.keys(e).filter(t=>e[t])},status:{value:v}},options:[{label:w("Sort items by"),id:"sort",options:[{id:"edited recently",label:w("edited recently")},{id:"title",label:w("title")},{id:"most mentioned",label:w("most mentioned")}]},{label:w("Show items of type"),id:"filter",options:d.map(e=>({id:e,label:r.default.createElement(o.FlexContainer,{flexDirection:"row",alignItems:"center"},r.default.createElement(s.default,{src:a.default[e].black.svg,style:{minWidth:"1rem",marginRight:"1rem"}}),r.default.createElement("span",null,w(e)))}))},{label:w("Show ..."),id:"status",options:y.map(e=>({id:e.id,label:e.label}))}]},w("Filters")))),r.default.createElement(o.LevelRight,null,r.default.createElement(o.LevelItem,null,r.default.createElement(o.Button,{onClick:l,isDisabled:h.length===b.length},w("Select all")," (",b.length,")")),r.default.createElement(o.LevelItem,null,r.default.createElement(o.Button,{onClick:n,isDisabled:0===h.length},w("Deselect all"))),r.default.createElement(o.LevelItem,null,r.default.createElement(o.Button,{isColor:"danger",onClick:t,isDisabled:0===h.length},w("Delete selection")))))};c.contextTypes={t:i.default.func},t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i,o=g(n(3)),a=n(2),s=g(a),u=g(n(0)),l=n(6),c=g(n(39)),f=n(41),d=n(16),p=n(112),h=g(n(392)),m=g(n(84));function g(e){return e&&e.__esModule?e:{default:e}}n(2795);let v=(r=class extends a.Component{constructor(e){super(e),i.call(this),this.state={assets:{}},this.refreshAssets(e)}},i=function(){this.componentWillReceiveProps=(e=>{this.props.resource!==e.resource&&this.refreshAssets(e)}),this.refreshAssets=(e=>{const{productionId:t,assets:n=[]}=e;n.reduce((e,n)=>e.then(()=>new Promise((e,r)=>{(0,p.requestAssetData)(t,n).then(t=>(this.setState({assets:(0,o.default)({},this.state.assets,{[n.id]:(0,o.default)({},n,{data:t})})}),e())).catch(r)})),Promise.resolve())}),this.render=(()=>{const{props:{resource:e,getTitle:t,onEdit:n,onDelete:r,numberOfMentions:i=0,isActive:o,onClick:a,isSelectable:u,productionId:p},context:{t:g},state:{assets:v={}}}=this,{data:y,metadata:b={}}=e,{type:_}=b,w=(0,d.translateNameSpacer)(g,"Features.LibraryView");let x,E;x="bib"===_&&y&&y[0]?s.default.createElement("div",{className:"bib-wrapper",dangerouslySetInnerHTML:{__html:y[0].htmlPreview}}):(0,f.abbrevString)(t(e)||w("untitled resource"),40),e.metadata.type,E={mobile:12,tablet:6,desktop:4,widescreen:4};const M=e.data.url||Array.isArray(e.data)&&e.data[0]&&e.data[0].URL;return s.default.createElement(l.Column,{isSize:E},s.default.createElement(l.Card,{isSelectable:u,isActive:o,onClick:a,bodyContent:s.default.createElement("div",{className:"ovide-ResourceCard"},s.default.createElement(l.Columns,{style:{marginBottom:0}},s.default.createElement(l.Column,{isSize:2},s.default.createElement(m.default,{src:c.default[_].black.svg,isSize:"32x32"})),s.default.createElement(l.Column,{style:{transition:"none"},isSize:8},s.default.createElement(l.Title,{style:{paddingTop:".5rem"},isSize:6},s.default.createElement("span",null,x,["webpage","video"].includes(e.metadata.type)?s.default.createElement("a",{style:{marginLeft:".5rem"},onClick:f.silentEvent,target:"blank",href:M},s.default.createElement(l.Icon,{className:"fa fa-external-link"})):null)))),!["webpage","glossary","bib"].includes(e.metadata.type)&&s.default.createElement(l.Columns,null,s.default.createElement(l.Column,{style:{position:"relative"},isSize:12},s.default.createElement("div",{style:{maxWidth:"100%",overflow:"hidden",maxHeight:"20rem"}},s.default.createElement(h.default,{resource:e,silentPreviewClick:!1,assets:v,productionId:p})))),i>0?s.default.createElement("div",{style:{padding:"1rem",paddingBottom:".5rem",paddingTop:".5rem",paddingLeft:"4rem",fontSize:".6rem"}},s.default.createElement("i",null,w(["one mention in contents","{n} mentions in contents","n"],{n:i}))):null,e.lastUpdateAt&&s.default.createElement("div",{style:{padding:"1rem",paddingLeft:"4rem",fontSize:".6rem"}},s.default.createElement("i",null,w("Last update:")," ",new Date(e.lastUpdateAt).toLocaleString())),s.default.createElement(l.Columns,null,s.default.createElement(l.Column,{isOffset:2,isSize:7},s.default.createElement(l.Button,{onClick:n,"data-place":"left","data-effect":"solid","data-for":"tooltip","data-tip":w("settings")},s.default.createElement(m.default,{src:c.default.settings.black.svg})),s.default.createElement(l.Button,{onClick:r,"data-place":"left","data-effect":"solid","data-for":"tooltip","data-tip":w(`delete this ${_}`)},s.default.createElement(m.default,{src:c.default.remove.black.svg})))))}))})},r);v.contextTypes={t:u.default.func.isRequired,getResourceDataUrl:u.default.func},t.default=v},function(e,t,n){var r=n(2796);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(33)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(32)(!1)).push([e.i,".ovide-ResourceCard .bib-wrapper .Bibliography .csl-entry {\n position: relative;\n overflow: hidden;\n max-height: 9rem;\n word-break: break-all; }\n .ovide-ResourceCard .bib-wrapper .Bibliography .csl-entry:before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n content: ''; }\n\n.ovide-ResourceCard .bib-wrapper .Bibliography a {\n pointer-events: none; }\n\n.ovide-ResourceCard .preview-container {\n overflow: hidden; }\n\n.ovide-ResourceCard .ReactTable .-pagination {\n display: none; }\n\n.ovide-ResourceCard .ReactTable .rt-tbody {\n overflow-y: hidden; }\n",""])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2798),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=x(n(3)),o=n(2),a=x(o),s=n(43),u=n(69),l=x(n(79)),c=n(70),f=w(n(929)),d=w(n(143)),p=w(n(286)),h=w(n(234)),m=w(n(83)),g=x(n(2799)),v=x(n(237)),y=x(n(383)),b=x(n(569)),_=x(n(144));function w(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function x(e){return e&&e.__esModule?e:{default:e}}let E=(0,u.connect)(e=>(0,i.default)({},f.selector(e.glossary),d.selector(e.editedProduction),p.selector(e.sectionsManagement)),e=>({actions:(0,s.bindActionCreators)((0,i.default)({},m,d,p,h,f),e)}))(r=class extends o.Component{constructor(e){super(e),this.componentDidMount=(()=>{const e=this.props.match.params.productionId;this.props.editedProduction&&this.props.editedProduction.id===e||this.props.actions.activateProduction({productionId:e})}),this.componentWillReceiveProps=(e=>{!this.props.editedResourceId!==e.editedResourceId&&l.default.hide()}),this.shouldComponentUpdate=(()=>!0),this.componentWillUnmount=(()=>{this.props.actions.resetViewsUi()}),this.deleteResource=((e,t)=>{const{actions:{deleteResource:n,deleteAsset:r}}=this.props,i=(0,c.getRelatedAssetsIds)(e.resource);i.length?i.reduce((t,n)=>t.then(()=>new Promise((t,i)=>{const o={assetId:n,productionId:e.productionId,asset:this.props.editedProduction.assets[n]};r(o,e=>e?i(e):t())})),Promise.resolve()).then(()=>{n(e,t)}).catch(t):n(e,t)})}render(){const{props:{uploadStatus:e,editedProduction:t},deleteResource:n}=this;return t?a.default.createElement(y.default,{productionId:t.id,serverUrl:_.default.apiUrl},a.default.createElement(v.default,null,a.default.createElement(g.default,(0,i.default)({},this.props,{deleteResource:n})),a.default.createElement(b.default,{uploadStatus:e}))):null}})||r;t.default=E},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=_(n(3)),i=n(2),o=_(i),a=_(n(0)),s=n(61),u=n(68),l=n(6),c=n(153),f=n(70),d=n(16),p=_(n(244)),h=_(n(2800)),m=_(n(2801)),g=_(n(398)),v=_(n(576)),y=_(n(2802)),b=_(n(2805));function _(e){return e&&e.__esModule?e:{default:e}}let w=class extends i.Component{constructor(e){super(e),this.componentDidMount=(()=>{const{searchString:e}=this.props;this.setState({searchString:e})}),this.componentWillReceiveProps=(()=>{}),this.setResourceSearchString=(e=>this.props.actions.setSearchString(e)),this.setResourceSearchStringDebounce=(e=>{this.setState({searchString:e}),this.setResourceSearchString(e)}),this.renderMainColumn=(()=>{const{editedProduction:e={},mainColumnMode:t,optionsVisible:n,filterValues:i,sortValue:a,statusFilterValue:b,searchString:_,promptedToDeleteResourceId:w,selectedResourcesIds:x,resourcesPromptedToDelete:E,editedResourceId:M,actions:{setOptionsVisible:S,setMainColumnMode:O,setFilterValues:k,setSortValue:C,setStatusFilterValue:T,setPromptedToDeleteResourceId:D,setUploadStatus:A,createResource:j,updateResource:L,createAsset:I,updateAsset:P,deleteAsset:N,updateSection:R,setSelectedResourcesIds:z,setResourcesPromptedToDelete:F,setMentionsSearchString:U,setIsBatchDeleting:Y,setResourceDeleteStep:H,setEditedResourceId:W,setMentionMode:B},deleteResource:V}=this.props,{t:q}=this.context,{resources:G={},id:K,metadata:{coverImage:Q={}},assets:X}=e,J=(0,d.translateNameSpacer)(q,"Features.GlossaryView"),Z=Q.resourceId,$=[{id:"all",label:J("all items")},{id:"unused",label:J("only unused items (not mentionned anywhere in the production)")}],ee=E,te=Object.keys(G).map(e=>G[e]);let ne=0===_.length?te:(0,c.searchResources)(te,_);const re={},ie=(0,u.uniq)(Object.keys(e.contextualizations).map(t=>{const n=e.contextualizations[t].resourceId;return re[n]=re[n]?re[n]+1:1,n}));ne=ne.filter(e=>"glossary"===e.metadata.type).filter(e=>{switch(b){case"unused":return-1===ie.indexOf(e.id);case"all":default:return!0}}).sort((e,t)=>{switch(a){case"edited recently":return!t.lastUpdateAt||e.lastUpdateAt>t.lastUpdateAt?-1:1;case"most mentioned":return(re[e.id]||0)>(re[t.id]||0)?-1:1;case"title":default:const n=(0,c.getResourceTitle)(e),r=(0,c.getResourceTitle)(t);return n&&r&&n.toLowerCase().trim()>r.toLowerCase().trim()?1:-1}});let oe=0;ee.length&&(oe=ee.reduce((t,n)=>t+Object.keys(e.contextualizations).filter(t=>e.contextualizations[t].resourceId===n).length,0));const ae=t=>{const n="string"==typeof t?t:w,i=G[n];if(!i)return;const o={productionId:K,resourceId:i.id,resource:i},a=Object.keys(e.contextualizations).map(t=>e.contextualizations[t]).filter(e=>e.resourceId===n),s=a.map(e=>e.id),l=(0,u.uniq)(a.map(e=>e.sectionId));if(s.length){const t=l.reduce((t,n)=>{const i=t[n]||e.sections[n],o=a.filter(e=>e.sectionId===n);let s;const u=(0,r.default)({},i,{contents:o.reduce((e,t)=>{const{changed:n,result:r}=(0,f.removeContextualizationReferenceFromRawContents)(e,t.id);return n&&!s&&(s=!0),r},(0,r.default)({},i.contents)),notes:Object.keys(i.notes).reduce((e,t)=>(0,r.default)({},e,{[t]:(0,r.default)({},i.notes[t],{contents:o.reduce((e,t)=>{const{changed:n,result:r}=(0,f.removeContextualizationReferenceFromRawContents)(e,t.id);return n&&!s&&(s=!0),r},(0,r.default)({},i.notes[t].contents))})}),{})});return s?(0,r.default)({},t,{[n]:u}):t},{});Object.keys(t).forEach(n=>{R({sectionId:n,productionId:e.id,section:t[n]})}),D(void 0)}V(o),D(void 0)},se=()=>{Y(!0);const t=ee.reduce((t,n)=>{if(!G[n])return;const i=Object.keys(e.contextualizations).map(t=>e.contextualizations[t]).filter(e=>e.resourceId===n),o=i.map(e=>e.id),a=(0,u.uniq)(i.map(e=>e.sectionId));if(o.length){const n=a.reduce((t,n)=>{const o=t[n]||e.sections[n],a=i.filter(e=>e.sectionId===n);let s;const u=(0,r.default)({},o,{contents:a.reduce((e,t)=>{const{changed:n,result:r}=(0,f.removeContextualizationReferenceFromRawContents)(e,t.id);return n&&!s&&(s=!0),r},(0,r.default)({},o.contents||{})),notes:Object.keys(o.notes).reduce((e,t)=>(0,r.default)({},e,{[t]:(0,r.default)({},o.notes[t],{contents:a.reduce((e,t)=>{const{changed:n,result:r}=(0,f.removeContextualizationReferenceFromRawContents)(e,t.id);return n&&!s&&(s=!0),r},(0,r.default)({},o.notes[t].contents))})}),{})});return s?(0,r.default)({},t,{[n]:u}):t},t);if(Object.keys(n).length)return(0,r.default)({},t,n)}return t},{});Object.keys(t||{}).reduce((n,r)=>n.then(()=>new Promise((n,i)=>{R({sectionId:r,productionId:e.id,section:t[r]},e=>{e?i(e):n()})})),Promise.resolve()).then(()=>ee.reduce((t,n,r)=>t.then(()=>new Promise(t=>{const i=e.resources[n],o={productionId:K,resourceId:n,resource:i};H(r),V(o,e=>{e&&console.error(e),t()})})),Promise.resolve())).then(()=>{H(0),F([]),z([]),Y(!1),D(void 0)}).catch(e=>{H(0),F([]),z([]),Y(!1),D(void 0),console.error(e)})};if(M){const t=G[M],n=(0,f.getRelatedAssetsIds)(t.data),r=n.map(t=>e.assets[t]).filter(e=>e),i=(t,r)=>{const{id:i}=t,o={resourceId:i,resource:t,productionId:K};"bib"===t.metadata.type?(0,c.createBibData)(t,this.props):L(o);const a=n.filter(e=>{if(!r[e])return!0}),s=Object.keys(r).filter(e=>!X[e]),u=Object.keys(r).filter(e=>X[e]&&r[e]&&X[e].lastUploadAt!==r[e].lastUploadAt);s.reduce((e,t)=>e.then(()=>{const e=r[t];return I({productionId:K,assetId:t,asset:e})}),Promise.resolve()).then(()=>u.reduce((e,t)=>e.then(()=>{const e=r[t];return P({productionId:K,assetId:t,asset:e})}),Promise.resolve())).then(()=>a.reduce((t,n)=>t.then(()=>{const t=e.assets[n];return N({productionId:K,assetId:n,asset:t})}),Promise.resolve())).then(()=>{W(void 0)})},a=()=>{W(void 0)};return o.default.createElement(v.default,{onCancel:a,onSubmit:i,bigSelectColumnsNumber:3,productionId:K,resource:t,existingAssets:r,asNewResource:!1})}switch(t){case"new":const u=(e,t)=>{const n=(0,s.v4)();let i;i="bib"===e.metadata.type?e.data&&e.data.length&&e.data[0].title:!e.metadata.title.length&&Object.keys(t).length?t[Object.keys(t)[0]].filename:e.metadata.title;const o={resourceId:n,resource:(0,r.default)({},e,{id:n,metadata:(0,r.default)({},e.metadata,{title:i})}),productionId:K};if("bib"===e.metadata.type)A({status:"initializing",errors:[]}),setTimeout(()=>{(0,c.createBibData)(e,this.props).then(()=>{A(void 0)}).catch(e=>{console.error(e),A(void 0)})},100);else{Object.keys(t).filter(e=>!X[e]).reduce((e,n)=>e.then(()=>{const e=t[n];return new Promise((t,r)=>{I({productionId:K,assetId:n,asset:e},e=>{e?r(e):t()})})}),Promise.resolve()).then(()=>{j(o,()=>{z([n]),B("add"),setTimeout(()=>{U(e.data.name||"")})})}).catch(console.error)}O("list")},d=()=>O("list");return o.default.createElement(v.default,{onCancel:d,onSubmit:u,bigSelectColumnsNumber:3,resourceType:"glossary",asNewResource:!0});case"list":default:const _=(e,t)=>{"filter"===t?(e=>{k((0,r.default)({},i,{[e]:!i[e]}))})(e):"sort"===t?(C(e),S(!1)):"status"===t&&(T(e),S(!1))},M=e=>this.setResourceSearchStringDebounce(e.target.value),L=()=>{S(!n)},P=()=>z(ne.map(e=>e.id)),N=()=>z([]),R=()=>F([...x]),Y=()=>o.default.createElement(l.Column,null,J("No item in your glossary yet")),H=t=>{const n=(0,f.getRelatedAssetsIds)(t.data).map(t=>e.assets[t]).filter(e=>e),r=x.indexOf(t.id)>-1;return o.default.createElement(y.default,{isActive:r,onClick:()=>{let e;r?e=x.filter(e=>e!==t.id):(e=[t.id],re[t.id]?(B("review"),U("")):(B("add"),U(t.data.name||""))),z(e)},key:t.id,onEdit:e=>{e.stopPropagation(),W(t.id)},onDelete:()=>{D(t.id)},coverImageId:Z,numberOfMentions:re[t.id],resource:t,assets:n,productionId:K,getTitle:c.getResourceTitle})},V=()=>D(void 0),q=()=>F([]),G=()=>{O("new"===t?"list":"new")};return o.default.createElement(l.StretchedLayoutContainer,{isAbsolute:!0,className:"column",style:{paddingLeft:0}},o.default.createElement(l.StretchedLayoutItem,null,o.default.createElement(l.Column,{style:{paddingLeft:0}},o.default.createElement(m.default,{filterValues:i,onDeleteSelection:R,onDeselectAllVisibleResources:N,onSearchStringChange:M,searchString:this.state.searchString,onSelectAllVisibleResources:P,onToggleOptionsVisibility:L,optionsVisible:n,selectedResourcesIds:x,onChange:_,sortValue:a,statusFilterValue:b,statusFilterValues:$,translate:J,visibleResources:ne}))),o.default.createElement(l.StretchedLayoutItem,{isFlex:1},o.default.createElement(l.StretchedLayoutContainer,{isAbsolute:!0,isDirection:"vertical"},o.default.createElement(p.default,{items:ne,itemsPerPage:30,defaultColumns:1,style:{height:"100%"},renderNoItem:Y,renderItem:H}))),o.default.createElement(l.StretchedLayoutItem,null,o.default.createElement(l.Column,null,o.default.createElement(l.Button,{isFullWidth:!0,onClick:G,isColor:"new"===t?"primary":"info"},J("New glossary item")))),o.default.createElement(g.default,{isActive:void 0!==w,deleteType:"resource",production:e,id:w,onClose:V,onDeleteConfirm:ae}),o.default.createElement(h.default,{translate:J,isActive:ee.length>0,actualResourcesPromptedToDelete:ee,resourcesPromptedToDelete:E,endangeredContextualizationsLength:oe,onDelete:se,onCancel:q}))}}),this.addProspect=(e=>{const{selectedResourcesIds:t,editedProduction:n={},actions:{updateSection:i,createContextualization:o,createContextualizer:a}}=this.props,u=n.id,l=t[0],c=(0,s.v4)(),f={type:"glossary",id:c},d=(0,s.v4)(),p={id:d,contextualizerId:c,resourceId:l,sectionId:e.sectionId},h=n.sections[e.sectionId],{notes:m}=h,g="main"===e.contentId?h.contents:m[e.contentId].contents,v=+(Object.keys(g.entityMap).pop()||0)+1,y=(0,r.default)({},g,{entityMap:(0,r.default)({},g.entityMap,{[v]:{type:"INLINE_ASSET",data:{asset:{id:d}}}}),blocks:g.blocks.map(t=>t.key===e.blockKey?(0,r.default)({},t,{entityRanges:[...t.entityRanges.filter(t=>t.key!==v&&!(t.offset===e.offset&&t.length===e.length)),{offset:e.offset,length:e.length,key:v}]}):t)}),b=(0,r.default)({},h);return"main"===e.contentId?b.contents=y:b.notes[e.contentId].contents=y,new Promise((t,n)=>{Promise.resolve().then(()=>new Promise((e,t)=>{a({contextualizerId:c,contextualizer:f,productionId:u},n=>{n?t(n):e()})})).then(()=>new Promise((e,t)=>{o({contextualizationId:d,contextualization:p,productionId:u},n=>{n?t(n):e()})})).then(()=>new Promise((t,n)=>{i({sectionId:e.sectionId,section:b,productionId:u},e=>{e?n(e):t()})})).then(()=>{t()}).catch(e=>{n(e)})})}),this.removeMention=(e=>{const{editedProduction:t={},actions:{updateSection:n,deleteContextualization:i,deleteContextualizer:o}}=this.props,a=t.id,{contextualizationId:s,sectionId:u,contentId:l}=e,c=t.contextualizations[s].contextualizer,d=t.sections[u],p=(0,r.default)({},d);if(l){const e="main"===l?d.contents:d.notes[l].contents,{result:t}=(0,f.removeContextualizationReferenceFromRawContents)(e,s);"main"===l?p.contents=t:p.notes[l].contents=t}return new Promise((e,t)=>{Promise.resolve().then(()=>new Promise((e,t)=>{n({sectionId:u,section:p,productionId:a},n=>{n?t(n):e()})})).then(()=>new Promise((e,t)=>{i({contextualizationId:s,productionId:a},n=>{n?t(n):e()})})).then(()=>new Promise((e,t)=>{o({contextualizerId:c,productionId:a},n=>{n?t(n):e()})})).then(()=>{e()}).catch(e=>{t(e)})})}),this.render=(()=>{const{mainColumnMode:e,editedResourceId:t,isBatchDeleting:n,mentionDeleteStep:r,selectedResourcesIds:i,editedProduction:a={},mentionMode:s,mentionsSearchString:u,isBatchCreating:c,mentionCreationStep:f,mentionsToDeleteNumber:p,mentionsToCreateNumber:h,actions:{setMentionMode:m,setMentionsSearchString:g,setMentionDeleteStep:v,setIsBatchDeleting:y,setIsBatchCreating:_,setMentionCreationStep:w,setMentionsToDeleteNumber:x,setMentionsToCreateNumber:E}}=this.props,{addProspect:M,removeMention:S}=this,{t:O}=this.context,k=(0,d.translateNameSpacer)(O,"Features.GlossaryView");return o.default.createElement(l.Container,{style:{position:"relative",height:"100%"}},o.default.createElement(l.StretchedLayoutContainer,{isFluid:!0,isDirection:"horizontal",isAbsolute:!0},o.default.createElement(l.StretchedLayoutItem,{isFlex:"3"},o.default.createElement(l.Column,{style:{paddingLeft:0},isWrapper:!0},this.renderMainColumn())),o.default.createElement(l.StretchedLayoutItem,{style:{maxWidth:"new"===e||t?0:"100%",overflowX:"hidden"},isFlex:"new"===e||t?0:"3"},o.default.createElement(l.StretchedLayoutContainer,{className:"column",style:{paddingRight:0},isAbsolute:!0},o.default.createElement(l.Column,{style:{paddingRight:0},isWrapper:!0},0===i.length?o.default.createElement(l.Column,{style:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}},o.default.createElement(l.Title,{isSize:3},k("Select a glossary entry in the list to edit its mentions"))):o.default.createElement(b.default,{resource:a.resources[i[0]],mentionMode:s,isBatchDeleting:n,setIsBatchDeleting:y,mentionDeleteStep:r,setMentionDeleteStep:v,isBatchCreating:c,mentionCreationStep:f,setMentionMode:m,addProspect:M,addProspects:e=>{_(!0),E(e.length),setTimeout(()=>e.reduce((e,t,n)=>e.then(()=>new Promise((e,r)=>{w(n),M(t).then(()=>{setTimeout(e)}).catch(r)})),Promise.resolve()).then(()=>_(!1)).catch(()=>_(!1)))},removeMention:S,removeMentions:e=>{y(!0),x(e.length),setTimeout(()=>e.reduce((e,t,n)=>e.then(()=>new Promise((e,r)=>{v(n),S(t).then(()=>{setTimeout(e)}).catch(r)})),Promise.resolve()).then(()=>y(!1)).catch(()=>y(!1)))},mentionsToDeleteNumber:p,mentionsToCreateNumber:h,production:a,onSearchStringChange:g,searchString:u}))))))}),this.state={searchString:""},this.setResourceSearchString=(0,u.debounce)(this.setResourceSearchString,500)}};w.contextTypes={t:a.default.func},t.default=w},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2),o=(r=i)&&r.__esModule?r:{default:r},a=n(6);t.default=(({translate:e,isActive:t,actualResourcesPromptedToDelete:n,resourcesPromptedToDelete:r,endangeredContextualizationsLength:i,onDelete:s,onCancel:u})=>o.default.createElement(a.ModalCard,{isActive:t,headerContent:e(["Delete an item","Delete {n} items","n"],{n:n.length}),onClose:u,mainContent:o.default.createElement("div",null,i>0&&o.default.createElement("p",null,e(["You will destroy one item mention in your content if you delete these items.","You will destroy {n} item mentions in your content if your delete these items.","n"],{n:i})),o.default.createElement("p",null,e(["Are you sure you want to delete this item ?","Are you sure you want to delete these items ?","n"],{n:r.length}))),footerContent:[o.default.createElement(a.Button,{type:"submit",isFullWidth:!0,key:0,onClick:s,isColor:"danger"},e("Delete")),o.default.createElement(a.Button,{onClick:u,isFullWidth:!0,key:1,isColor:"warning"},e("Cancel"))]}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(2)),i=s(n(0)),o=n(6),a=n(16);function s(e){return e&&e.__esModule?e:{default:e}}const u=({filterValues:e,onSearchStringChange:t,onToggleOptionsVisibility:n,optionsVisible:i,searchString:s,onChange:u,sortValue:l,statusFilterValue:c,statusFilterValues:f},{t:d})=>{const p=(0,a.translateNameSpacer)(d,"Features.GlossaryView");return r.default.createElement(o.Level,{isMobile:!0,style:{flexFlow:"row wrap"}},r.default.createElement(o.Title,{isSize:5},p("Your glossary entries"),r.default.createElement(o.HelpPin,null,p("This view allows you to manage your glossary entries and to handle where to mention them in your sections contents"))),r.default.createElement(o.StretchedLayoutContainer,{style:{width:"100%"},isDirection:"horizontal"},r.default.createElement(o.StretchedLayoutItem,{isFlex:1},r.default.createElement(o.Column,null,r.default.createElement(o.Input,{value:s,onChange:t,placeholder:p("Find a resource")}))),r.default.createElement(o.StretchedLayoutItem,null,r.default.createElement(o.Column,null,r.default.createElement(o.Dropdown,{closeOnChange:!1,menuAlign:"left",onToggle:n,onChange:u,isActive:i,isColor:Object.keys(e).filter(t=>e[t]).length>0?"info":"",value:{sort:{value:l},filter:{value:Object.keys(e).filter(t=>e[t])},status:{value:c}},options:[{label:p("Sort items by"),id:"sort",options:[{id:"edited recently",label:p("edited recently")},{id:"title",label:p("title")},{id:"most mentioned",label:p("most mentioned")}]},{label:p("Show ..."),id:"status",options:f.map(e=>({id:e.id,label:e.label}))}]},p("Filters"))))))};u.contextTypes={t:i.default.func},t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i,o=g(n(3)),a=n(2),s=g(a),u=g(n(0)),l=n(6),c=g(n(39)),f=n(41),d=n(16),p=n(112),h=g(n(392)),m=g(n(84));function g(e){return e&&e.__esModule?e:{default:e}}n(2803);let v=(r=class extends a.Component{constructor(e){super(e),i.call(this),this.state={assets:{}},this.refreshAssets(e)}},i=function(){this.componentWillReceiveProps=(e=>{this.props.resource!==e.resource&&this.refreshAssets(e)}),this.refreshAssets=(e=>{const{productionId:t,assets:n=[]}=e;n.reduce((e,n)=>e.then(()=>new Promise((e,r)=>{(0,p.requestAssetData)(t,n).then(t=>(this.setState({assets:(0,o.default)({},this.state.assets,{[n.id]:(0,o.default)({},n,{data:t})})}),e())).catch(r)})),Promise.resolve())}),this.render=(()=>{const{props:{resource:e,getTitle:t,onEdit:n,onDelete:r,numberOfMentions:i=0,isActive:o,onClick:a,isSelectable:u,productionId:p},context:{t:g},state:{assets:v={}}}=this,{data:y,metadata:b={}}=e,{type:_}=b,w=(0,d.translateNameSpacer)(g,"Features.GlossaryView");let x,E;x="bib"===_&&y&&y[0]?s.default.createElement("div",{className:"bib-wrapper",dangerouslySetInnerHTML:{__html:y[0].htmlPreview}}):(0,f.abbrevString)(t(e)||w("untitled resource"),40),e.metadata.type,E={mobile:12,tablet:12,desktop:12,widescreen:12};const M=e.data.url||Array.isArray(e.data)&&e.data[0]&&e.data[0].URL;return s.default.createElement(l.Column,{isSize:E,style:{cursor:"pointer"}},s.default.createElement(l.Card,{isSelectable:u,isActive:o,onClick:a,bodyContent:s.default.createElement("div",{className:"ovide-ResourceCard"},s.default.createElement(l.Columns,{style:{marginBottom:0}},s.default.createElement(l.Column,{isSize:2},s.default.createElement(m.default,{src:c.default[_].black.svg,isSize:"32x32"})),s.default.createElement(l.Column,{style:{transition:"none"},isSize:8},s.default.createElement(l.Title,{style:{paddingTop:".5rem"},isSize:6},s.default.createElement("span",null,x," (",w(["one mention","{n} mentions","n"],{n:i}),")",["webpage","video"].includes(e.metadata.type)?s.default.createElement("a",{style:{marginLeft:".5rem"},onClick:f.silentEvent,target:"blank",href:M},s.default.createElement(l.Icon,{className:"fa fa-external-link"})):null)))),!["webpage","glossary","bib"].includes(e.metadata.type)&&s.default.createElement(l.Columns,null,s.default.createElement(l.Column,{style:{position:"relative"},isSize:12},s.default.createElement("div",{style:{maxWidth:"100%",overflow:"hidden",maxHeight:"20rem"}},s.default.createElement(h.default,{resource:e,silentPreviewClick:!1,assets:v,productionId:p})))),s.default.createElement(l.Columns,null,s.default.createElement(l.Column,{isOffset:2,isSize:7},s.default.createElement(l.Button,{onClick:n,"data-place":"left","data-effect":"solid","data-for":"tooltip","data-tip":w("settings")},s.default.createElement(m.default,{src:c.default.settings.black.svg})),s.default.createElement(l.Button,{onClick:r,"data-place":"left","data-effect":"solid","data-for":"tooltip","data-tip":w(`delete this ${_}`)},s.default.createElement(m.default,{src:c.default.remove.black.svg})))))}))})},r);v.contextTypes={t:u.default.func.isRequired,getResourceDataUrl:u.default.func},t.default=v},function(e,t,n){var r=n(2804);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(33)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(32)(!1)).push([e.i,".ovide-ResourceCard .bib-wrapper .Bibliography .csl-entry {\n position: relative;\n overflow: hidden;\n max-height: 9rem;\n word-break: break-all; }\n .ovide-ResourceCard .bib-wrapper .Bibliography .csl-entry:before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n content: ''; }\n\n.ovide-ResourceCard .bib-wrapper .Bibliography a {\n pointer-events: none; }\n\n.ovide-ResourceCard .preview-container {\n overflow: hidden; }\n\n.ovide-ResourceCard .ReactTable .-pagination {\n display: none; }\n\n.ovide-ResourceCard .ReactTable .rt-tbody {\n overflow-y: hidden; }\n",""])},function(e,t,n){"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),a=m(o),s=m(n(0)),u=m(n(381)),l=n(6),c=n(80),f=n(16),d=m(n(2806)),p=m(n(2809)),h=n(2811);function m(e){return e&&e.__esModule?e:{default:e}}let g=(r=class extends o.Component{constructor(e){super(e),i.call(this),this.state={prospections:[],citations:this.updateCitations(e)},this.updateProspections=(0,u.default)(this.updateProspections,1e3)}},i=function(){this.componentDidMount=(()=>{setTimeout(()=>{this.updateProspections(this.props.searchString)})}),this.componentWillReceiveProps=(e=>{e.production&&this.props.production.id!==e.production.id&&this.setState({citations:this.updateCitations(e)}),(this.props.production.contextualizations!==e.production.contextualizations||this.props.production.resources!==e.production.resources||this.props.searchString!==e.searchString&&e.searchString.length>=2)&&setTimeout(()=>{this.updateProspections(e.searchString)})}),this.updateProspections=(e=>{if(!this.props.resource)return;const{production:t}=this.props,{contextualizations:n,resources:r}=t,i=t.sectionsOrder.reduce((i,o)=>{const a=t.sections[o];return[...i,...(0,h.findProspectionMatches)({contents:a.contents,sectionId:o,contentId:"main",value:e,contextualizations:n,resources:r}),...a.notesOrder.reduce((t,i)=>[...t,...(0,h.findProspectionMatches)({contents:a.notes[i].contents,sectionId:o,noteId:i,value:e,contextualizations:n,resources:r})],[])]},[]);this.setState({prospections:i})}),this.onSearchStringChange=(e=>{this.props.onSearchStringChange(e)}),this.updateCitations=(e=>{const{production:t}=e,n=(0,h.computeAssets)({production:t});return(0,h.buildCitations)(n,{production:t})}),this.render=(()=>{const{props:{resource:e={},mentionMode:t="add",addProspect:n,addProspects:r,removeMention:i,removeMentions:o,mentionsToDeleteNumber:s,mentionsToCreateNumber:u,setMentionMode:m,searchString:g,production:v,isBatchDeleting:y,mentionDeleteStep:b,isBatchCreating:_,mentionCreationStep:w},state:{prospections:x=[],citations:E},context:{t:M},onSearchStringChange:S}=this,{id:O}=e,{style:k,locale:C}=(0,h.getCitationModels)(v),{citationItems:T,citationData:D}=E,A=(0,f.translateNameSpacer)(M,"Features.GlossaryView"),j=Object.keys(v.contextualizations).filter(e=>v.contextualizations[e].resourceId===O),L=g.toLowerCase(),I=j.map(e=>{const t=v.contextualizations[e].sectionId,n=v.sections[t],r=["main",...v.sections[t].notesOrder];let i={sectionId:t,contextualizationId:e};return r.find(r=>{let o;return o="main"===r?n.contents:n.notes[r].contents,Object.keys(o.entityMap).find(n=>{const a=o.entityMap[n];if("INLINE_ASSET"===a.type&&a.data.asset.id===e)return o.blocks.find(o=>{const a=o.entityRanges.find(e=>+e.key==+n);if(a)return i={offset:a.offset,length:a.length,blockKey:o.key,sectionId:t,contentId:r,contextualizationId:e},!0}),!0})}),i}).filter(e=>{if(g.length>2&&e.contentId&&e.blockKey){const t=v.sections[e.sectionId];return("main"===e.contentId?t.contents:t.notes[e.contentId].contents).blocks.find(t=>t.key===e.blockKey).text.toLowerCase().includes(L)}return!0});return a.default.createElement(c.ReferencesManager,{style:k,locale:C,items:T,citations:D},a.default.createElement(l.StretchedLayoutContainer,{isAbsolute:!0},a.default.createElement(l.StretchedLayoutItem,null,a.default.createElement(l.Column,null,a.default.createElement(l.Title,{isSize:5},e&&e.data&&e.data.name&&e.data.name.trim().length?e.data.name:A("Unnamed glossary entry")," - ",a.default.createElement("i",null,A("add"===t?"add new mentions":"existing mentions"))),(({mentionMode:e="",searchString:t,onSearchStringChange:n,translate:r,addAllProspects:i,removeAllMentions:o,prospections:s,mentions:u})=>"add"===e?a.default.createElement(l.StretchedLayoutContainer,{isDirection:"horizontal"},a.default.createElement(l.StretchedLayoutItem,{isFlex:1},a.default.createElement(l.StretchedLayoutContainer,null,a.default.createElement(l.Column,{style:{paddingLeft:0}},a.default.createElement(l.Input,{value:t,onChange:n,placeholder:r("Find matches")})))),a.default.createElement(l.StretchedLayoutItem,null,a.default.createElement(l.Column,{style:{paddingRight:0}},a.default.createElement(l.Button,{isDisabled:0===s.length,isColor:"primary",onClick:i},r(["Add one match","Add {n} matches","n"],{n:s.length}))))):a.default.createElement(l.StretchedLayoutContainer,{isDirection:"horizontal"},a.default.createElement(l.StretchedLayoutItem,{isFlex:1},a.default.createElement(l.Column,{style:{paddingLeft:0}},a.default.createElement(l.Input,{value:t,onChange:n,placeholder:r("Find mentions")}))),a.default.createElement(l.StretchedLayoutItem,null,a.default.createElement(l.Column,{style:{paddingRight:0}},a.default.createElement(l.Button,{isDisabled:0===u.length,isColor:"danger",onClick:o},r(["Remove one mention","Remove {n} mentions","n"],{n:u.length}))))))({mentionMode:t,searchString:g,onSearchStringChange:e=>{S(e.target.value)},addAllProspects:()=>{r(x)},prospections:x,mentions:I,removeAllMentions:()=>{o(I)},translate:A}))),a.default.createElement(l.StretchedLayoutItem,{isFlex:1},a.default.createElement(l.StretchedLayoutContainer,{isAbsolute:!0},"add"===t?a.default.createElement(p.default,{searchString:g,translate:A,prospections:x,production:v,addProspect:n,minSearchLength:2}):a.default.createElement(d.default,{resourceId:e.id,production:v,translate:A,searchString:g,mentions:I,removeMention:i,removeMentions:o}))),a.default.createElement(l.StretchedLayoutItem,null,a.default.createElement(l.Column,null,a.default.createElement(l.StretchedLayoutContainer,{isDirection:"horizontal"},a.default.createElement(l.StretchedLayoutItem,{isFlex:1},a.default.createElement(l.Button,{onClick:()=>{m("add"),S("")},isColor:"add"===t?"primary":"info",isFullWidth:!0},A("Add new mentions"))),a.default.createElement(l.StretchedLayoutItem,{isFlex:1},a.default.createElement(l.Button,{onClick:()=>{m("review"),S("")},isColor:"review"===t?"primary":"info",isFullWidth:!0},A("Review existing mentions")," (",I.length,")")))))),a.default.createElement(l.ModalCard,{isActive:y,headerContent:A(["Deleting a mention","Deleting {n} mentions","n"],{n:s}),mainContent:a.default.createElement("div",null,A("Deleting mention {k} of {n}",{k:b+1,n:s}))}),a.default.createElement(l.ModalCard,{isActive:_,headerContent:A(["Creating a mention","Creating {n} mentions","n"],{n:u}),mainContent:a.default.createElement("div",null,A("Creating mention {k} of {n}",{k:w+1,n:u}))}))})},r);g.contextTypes={t:s.default.func},t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(2)),i=s(n(244)),o=s(n(2807)),a=n(6);function s(e){return e&&e.__esModule?e:{default:e}}t.default=(({production:e,mentions:t,removeMention:n,translate:s})=>{return r.default.createElement(i.default,{items:t,itemsPerPage:30,defaultColumns:1,style:{height:"100%"},renderNoItem:()=>r.default.createElement(a.Column,{style:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}},r.default.createElement(a.Title,{isSize:4},s("No mentions yet for this glossary entry"))),renderItem:t=>r.default.createElement(o.default,{mention:t,production:e,key:t.contextualizationId,removeMention:n})})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p(n(3)),i=n(2),o=p(i),a=p(n(0)),s=n(6),u=p(n(39)),l=n(82),c=n(16),f=p(n(84)),d=p(n(1157));function p(e){return e&&e.__esModule?e:{default:e}}let h=class extends i.Component{constructor(e){super(e),this.getChildContext=(()=>({production:this.props.production,renderingMode:"paged",contextualizers:l.contextualizers})),this.render=(()=>{const{props:{mention:e,production:t,removeMention:n},context:{t:i}}=this,a=(0,c.translateNameSpacer)(i,"Features.GlosaryView");let l;e.contentId&&e.blockKey&&(l=(({mention:e,production:t})=>{const n=t.sections[e.sectionId],i="main"===e.contentId?n.contents:n.notes[e.contentId];if(!i||!i.entityMap||!i.blocks)return;const o=`${+Object.keys(i.entityMap||{}).pop()+1}`,a={},s=Object.keys(i.entityMap||{}).find(t=>"INLINE_ASSET"===i.entityMap[t].type&&i.entityMap[t].data.asset.id===e.contextualizationId);return(0,r.default)({},i,{blocks:i.blocks.filter(t=>t.key===e.blockKey).map(t=>(0,r.default)({},t,{entityRanges:[...t.entityRanges,{offset:e.offset,length:e.length,key:o}].filter(e=>{if(+e.key!=+s&&(e.key===o||i.entityMap[e.key]&&!a[e.key]))return a[e.key]=!0,!0})})),entityMap:(0,r.default)({},i.entityMap,{[o]:{type:"MENTION_MARKER",data:{id:e.id}}})})})({mention:e,production:t}));return o.default.createElement(s.Column,{isSize:12},o.default.createElement(s.Card,{isSelectable:!1,isActive:void 0,bodyContent:o.default.createElement(s.StretchedLayoutContainer,{isDirection:"horizontal",className:"ovide-MentionCard"},o.default.createElement(s.StretchedLayoutItem,{isFlex:1},l?o.default.createElement(s.Content,null,o.default.createElement(d.default,{raw:l})):o.default.createElement(s.Notification,{isColor:"danger"},a("Bugged glossary mention")),o.default.createElement("p",null,o.default.createElement("i",null,t.sections[e.sectionId].metadata.title))),o.default.createElement(s.StretchedLayoutItem,null,o.default.createElement(s.Button,{onClick:()=>{n(e)},isRounded:!0,isColor:"warning","data-place":"left","data-effect":"solid","data-for":"tooltip","data-tip":a("remove mention")},o.default.createElement(f.default,{src:u.default.remove.black.svg}))))}))})}};h.childContextTypes={production:a.default.object,renderingMode:a.default.string,contextualizers:a.default.object},h.contextTypes={t:a.default.func.isRequired,getResourceDataUrl:a.default.func},t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(2)),i=a(n(0)),o=n(44);function a(e){return e&&e.__esModule?e:{default:e}}const s=({data:e,children:t},{production:n,contextualizers:i,openedContextualizationId:a,openAsideContextualization:s,bindContextualizationElement:u,renderingMode:l="screened"})=>{const c=e.asset&&e.asset.id;if(!c||!n)return null;const f=n.contextualizations[c];if(!f)return null;const d=n.contextualizers[f.contextualizerId],p=n.resources[f.resourceId],h=i[d.type],m=h&&h.Inline,g=()=>{"function"==typeof s&&s(f.id)},v=()=>{"glossary"===p.metadata.type&&g()},y=c===a,b=e=>{"function"==typeof u&&u(f.id,e)};return d&&m?r.default.createElement("span",{className:`InlineAssetWrapper inline-${d.type}${y?" active":""}`,id:c,ref:b,onClick:v},"glossary"!==p.metadata.type&&r.default.createElement(o.StructuredCOinS,{resource:p}),r.default.createElement(m,{contextualization:f,contextualizer:d,resource:p,renderingMode:"screen"},t),"screened"===l&&r.default.createElement("sup",{className:"link mention-context-pointer",onClick:g},"◈")):null};s.propTypes={data:i.default.shape({asset:i.default.shape({id:i.default.string})})},s.contextTypes={production:i.default.object,contextualizers:i.default.object,onAssetContextRequest:i.default.func,openedContextualizationId:i.default.string,openAsideContextualization:i.default.func,bindContextualizationElement:i.default.func,renderingMode:i.default.string},t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(2)),i=n(6),o=s(n(244)),a=s(n(2810));function s(e){return e&&e.__esModule?e:{default:e}}t.default=(({searchString:e="",translate:t,prospections:n,production:s,addProspect:u,minSearchLength:l})=>{if(e.lengthr.default.createElement(i.Column,{style:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}},r.default.createElement(i.Title,{isSize:4},t('No unmentionned matches for "{s}"',{s:e}))),renderItem:(e,t)=>r.default.createElement(a.default,{key:t,prospect:e,production:s,addProspect:u})})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p(n(3)),i=n(2),o=p(i),a=p(n(0)),s=n(6),u=p(n(39)),l=n(82),c=n(16),f=p(n(84)),d=p(n(1157));function p(e){return e&&e.__esModule?e:{default:e}}let h=class extends i.Component{constructor(e){super(e),this.getChildContext=(()=>({production:this.props.production,renderingMode:"paged",contextualizers:l.contextualizers})),this.render=(()=>{const{props:{prospect:e,production:t,addProspect:n},context:{t:i}}=this,a=(0,c.translateNameSpacer)(i,"Features.GlosaryView"),l=(({prospect:e,production:t})=>{const n=t.sections[e.sectionId],i="main"===e.contentId?n.contents:n.notes[e.contentId];if(!i||!i.entityMap)return;const o=`${+(Object.keys(i.entityMap).pop()||0)+1}`,a={},s=(0,r.default)({},i,{blocks:[...i.blocks.filter(t=>t.key===e.blockKey).map(t=>(0,r.default)({},t,{entityRanges:[...t.entityRanges.filter(e=>{if(e.key!==+o&&i.entityMap[e.key]&&!a[e.key])return a[e.key]=!0,!0}),{offset:e.offset,length:e.length,key:+o}]}))],entityMap:(0,r.default)({},i.entityMap,{[o]:{type:"MATCH_MARKER",data:{id:e.id}}})});return(0,r.default)({},s)})({prospect:e,production:t});return o.default.createElement(s.Column,{isSize:12},o.default.createElement(s.Card,{isSelectable:!1,isActive:void 0,bodyContent:o.default.createElement(s.StretchedLayoutContainer,{isDirection:"horizontal",className:"ovide-ProspectionCard"},o.default.createElement(s.StretchedLayoutItem,{isFlex:1},o.default.createElement(s.Content,null,o.default.createElement(d.default,{raw:l})),o.default.createElement("p",null,o.default.createElement("i",null,t.sections[e.sectionId].metadata.title))),o.default.createElement(s.StretchedLayoutItem,null,o.default.createElement(s.Button,{onClick:()=>{n(e)},isRounded:!0,isColor:"info","data-place":"left","data-effect":"solid","data-for":"tooltip","data-tip":a("add mention")},o.default.createElement(f.default,{src:u.default.asset.black.svg}))))}))})}};h.childContextTypes={production:a.default.object,renderingMode:a.default.string,contextualizers:a.default.object},h.contextTypes={t:a.default.func.isRequired,getResourceDataUrl:a.default.func},t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findProspectionMatches=t.buildCitations=t.getCitationModels=t.computeAssets=void 0;var r=u(n(3)),i=n(138),o=n(44),a=u(n(2812)),s=u(n(2813));function u(e){return e&&e.__esModule?e:{default:e}}const{INLINE_ASSET:l}=i.constants;t.computeAssets=(e=>{const{production:{contextualizers:t,contextualizations:n,resources:i}}=e;return Object.keys(n).reduce((e,o)=>{const a=n[o],s=t[a.contextualizerId],u=i[a.resourceId];return s&&u?(0,r.default)({},e,{[o]:(0,r.default)({},a,{resource:u,contextualizer:s,type:s?s.type:l})}):(0,r.default)({},e)},{})}),t.getCitationModels=(e=>{return{style:e&&e.settings&&e.settings.citationStyle&&e.settings.citationStyle.data||a.default,locale:e&&e.settings&&e.settings.citationLocale&&e.settings.citationLocale.data||s.default}}),t.buildCitations=((e,t)=>{const{production:{contextualizations:n,resources:i,contextualizers:a,sectionsOrder:s,sections:u}}=t,l=s.reduce((t,n)=>{const r=u[n];return r.notesOrder.reduce((e,t)=>[...e,r.notes[t].contents],[r.contents]).reduce((t,n)=>[...t,...Object.keys(n&&n.entityMap||{}).reduce((t,r)=>{const i=n.entityMap[r];return("INLINE_ASSET"===i.type||"BLOCK_ASSET"===i.type)&&e&&e[i.data.asset.id]?[...t,i.data.asset.id]:t},[])],t)},[]).filter(t=>"bib"===e[t].type).map(t=>e[t]),c=Object.keys(l).reduce((e,t)=>{const n=l[t],i=(0,o.resourceToCslJSON)(n.resource).reduce((e,t)=>(0,r.default)({},e,{[t.id]:t}),{});return(0,r.default)({},e,i)},{}),f=l.map((e,t)=>{const r=e.id,s=n[r],u=a[s.contextualizerId],l=i[s.resourceId];return{citationID:r,citationItems:(0,o.resourceToCslJSON)(l).map(e=>({locator:u.locator,prefix:u.prefix,suffix:u.suffix,id:e.id})),properties:{noteIndex:t+1}}}).filter(e=>e);return{citationItems:c,citationData:f.map((e,t)=>[e,f.slice(0,0===t?0:t).map(e=>[e.citationID,e.properties.noteIndex]),[]])}}),t.findProspectionMatches=(({contents:e,sectionId:t,contentId:n,value:r,contextualizations:i,resources:o})=>{if(!r.length)return[];const a=new RegExp(r,"gi");let s=0;return e.blocks.filter(e=>"atomic"!==e.type).reduce((u,l)=>{const c=[];let f=null;const d=l.text;do{if(f=a.exec(d)){const a=f.index,u=f.index+r.length;let d=!0;l.entityRanges&&l.entityRanges.length&&l.entityRanges.find(t=>{const{key:n}=t,s=e.entityMap[n];if(s&&"INLINE_ASSET"===s.type&&(t.offset===a&&t.length===r.length||a>=t.offset&&a<=t.offset+t.length||u>=t.offset&&u<=t.offset+t.length)){const e=s.data.asset.id,t=i[e];if(t&&o[t.resourceId])return d=!1,!0}}),d&&(s++,c.push({sectionId:t,contentId:n,blockKey:l.key,offset:a,id:s,endIndex:u,length:r.length}))}}while(f);return[...u,...c]},[])})},function(e,t){e.exports='\n'},function(e,t){e.exports='\n\n \n This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License\n 2015-10-10T23:31:02+00:00\n \n \n \n \n \n \n \n \n \n \n \n \n \n accessed\n and\n and others\n anonymous\n anon.\n at\n available at\n by\n circa\n c.\n cited\n \n edition\n editions\n \n ed.\n et al.\n forthcoming\n from\n ibid.\n in\n in press\n internet\n interview\n letter\n no date\n n.d.\n online\n presented at the\n \n reference\n references\n \n \n ref.\n refs.\n \n retrieved\n scale\n version\n\n \x3c!-- ANNO DOMINI; BEFORE CHRIST --\x3e\n AD\n BC\n\n \x3c!-- PUNCTUATION --\x3e\n \n \n \n \n \n\n \x3c!-- ORDINALS --\x3e\n th\n st\n nd\n rd\n th\n th\n th\n\n \x3c!-- LONG ORDINALS --\x3e\n first\n second\n third\n fourth\n fifth\n sixth\n seventh\n eighth\n ninth\n tenth\n\n \x3c!-- LONG LOCATOR FORMS --\x3e\n \n book\n books\n \n \n chapter\n chapters\n \n \n column\n columns\n \n \n figure\n figures\n \n \n folio\n folios\n \n \n number\n numbers\n \n \n line\n lines\n \n \n note\n notes\n \n \n opus\n opera\n \n \n page\n pages\n \n \n page\n pages\n \n \n paragraph\n paragraphs\n \n \n part\n parts\n \n \n section\n sections\n \n \n sub verbo\n sub verbis\n \n \n verse\n verses\n \n \n volume\n volumes\n \n\n \x3c!-- SHORT LOCATOR FORMS --\x3e\n \n bk.\n bks.\n \n \n chap.\n chaps.\n \n \n col.\n cols.\n \n \n fig.\n figs.\n \n \n fol.\n fols.\n \n \n no.\n nos.\n \n \n l.\n ll.\n \n \n n.\n nn.\n \n \n op.\n opp.\n \n \n p.\n pp.\n \n \n p.\n pp.\n \n \n para.\n paras.\n \n \n pt.\n pts.\n \n \n sec.\n secs.\n \n \n s.v.\n s.vv.\n \n \n v.\n vv.\n \n \n vol.\n vols.\n \n\n \x3c!-- SYMBOL LOCATOR FORMS --\x3e\n \n \n ¶¶\n \n \n §\n §§\n \n\n \x3c!-- LONG ROLE FORMS --\x3e\n \n director\n directors\n \n \n editor\n editors\n \n \n editor\n editors\n \n \n illustrator\n illustrators\n \n \n translator\n translators\n \n \n editor & translator\n editors & translators\n \n\n \x3c!-- SHORT ROLE FORMS --\x3e\n \n dir.\n dirs.\n \n \n ed.\n eds.\n \n \n ed.\n eds.\n \n \n ill.\n ills.\n \n \n tran.\n trans.\n \n \n ed. & tran.\n eds. & trans.\n \n\n \x3c!-- VERB ROLE FORMS --\x3e\n by\n directed by\n edited by\n edited by\n illustrated by\n interview by\n to\n by\n translated by\n edited & translated by\n\n \x3c!-- SHORT VERB ROLE FORMS --\x3e\n dir. by\n ed. by\n ed. by\n illus. by\n trans. by\n ed. & trans. by\n\n \x3c!-- LONG MONTH FORMS --\x3e\n January\n February\n March\n April\n May\n June\n July\n August\n September\n October\n November\n December\n\n \x3c!-- SHORT MONTH FORMS --\x3e\n Jan.\n Feb.\n Mar.\n Apr.\n May\n Jun.\n Jul.\n Aug.\n Sep.\n Oct.\n Nov.\n Dec.\n\n \x3c!-- SEASONS --\x3e\n Spring\n Summer\n Autumn\n Winter\n \n'},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2815),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=v(n(3)),o=n(2),a=v(o),s=n(43),u=n(69),l=g(n(930)),c=g(n(143)),f=g(n(234)),d=g(n(83)),p=v(n(2816)),h=v(n(237)),m=v(n(383));function g(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function v(e){return e&&e.__esModule?e:{default:e}}let y=(0,u.connect)(e=>(0,i.default)({},l.selector(e.editions),c.selector(e.editedProduction)),e=>({actions:(0,s.bindActionCreators)((0,i.default)({},d,c,f,l),e)}))(r=class extends o.Component{constructor(e){super(e),this.componentDidMount=(()=>{const e=this.props.match.params.productionId;this.props.editedProduction&&this.props.editedProduction.id===e||this.props.actions.activateProduction({productionId:e})}),this.shouldComponentUpdate=(()=>!0),this.componentWillUnmount=(()=>{this.props.actions.resetViewsUi()})}render(){const{props:{editedProduction:e}}=this;return e?a.default.createElement(m.default,{productionId:e.id},a.default.createElement(h.default,null,a.default.createElement(p.default,(0,i.default)({production:e},this.props)))):null}})||r;t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=m(n(3)),i=n(2),o=m(i),a=m(n(0)),s=n(61),u=n(6),l=n(16),c=n(82),f=m(n(2817)),d=m(n(244)),p=m(n(2823)),h=m(n(2824));function m(e){return e&&e.__esModule?e:{default:e}}const g=m(n(180)).default.definitions.edition.properties.metadata.properties.type.enum;let v=class extends i.Component{constructor(e){super(e),this.componentWillReceiveProps=(()=>{}),this.renderMainColumn=(()=>{const{props:{newEditionPrompted:e,editedProduction:t,searchString:n,optionsVisibility:i,sortValue:a,filterValues:m,history:v,actions:{setNewEditionPrompted:y,setPromptedToDeleteEditionId:b,setOptionsVisibility:_,setSearchString:w,createEdition:x,setSortValue:E,setFilterValues:M}},context:{t:S}}=this,{editions:O={},id:k}=t,C=Object.keys(m).filter(e=>m[e]),T=Object.keys(O).map(e=>O[e]).filter(e=>!(n&&n.length>2)||e.metadata.title.toLowerCase().includes(n.toLowerCase())).filter(e=>!C.length||C.indexOf(e.metadata.type)>-1).sort((e,t)=>{switch(a){case"edited recently":return e.lastUpdateAt>t.lastUpdateAt?-1:1;case"title":default:const n=e.metadata.title,r=t.metadata.title;return n&&r&&n.toLowerCase().trim()>r.toLowerCase().trim()?1:-1}}),D=(0,l.translateNameSpacer)(S,"Features.EditionsView"),A=()=>{y(void 0)},j=e=>{const t=e.metadata.templateId,n=c.templates.find(e=>e.meta.id===t),{meta:{defaultPlan:i}}=n,o=(0,r.default)({},i,{summary:i.summary.map(e=>(0,r.default)({},e,{id:(0,s.v4)()}))}),a=(0,r.default)({},e,{data:(0,r.default)({},e.data,{plan:o}),id:(0,s.v4)()});a.data.bibType=n.meta.defaultBibType,a.data.additionalHTML=n.meta.defaultAdditionalHTML||"",x({edition:a,editionId:a.id,productionId:k},e=>{e||v.push(`/productions/${k}/editions/${a.id}`)}),y(!1)};if(e)return o.default.createElement(f.default,{onCancel:A,onSubmit:j,availableTemplates:c.templates});{const e=()=>o.default.createElement("div",null,D("No edition yet")),t=e=>{return o.default.createElement(p.default,{onClick:()=>{v.push(`/productions/${k}/editions/${e.id}`)},onEdit:()=>{},onDelete:t=>{t.stopPropagation(),b(e.id)},href:`/productions/${k}/editions/${e.id}`,edition:e,key:e.id})},s=e=>{w(e.target.value)},l=()=>{_(!i)},c=(e,t)=>{switch(t){case"sort":E(e);break;case"filter":default:const n=e;M((0,r.default)({},m,{[n]:!m[n]}))}};return o.default.createElement(u.StretchedLayoutContainer,{isAbsolute:!0},o.default.createElement(u.StretchedLayoutItem,null,o.default.createElement(u.Level,null),o.default.createElement(u.Column,{style:{paddingRight:0}},o.default.createElement(h.default,{filterValues:m,onSearchStringChange:s,searchString:n,onToggleOptionsVisibility:l,optionsVisible:i,editionsTypes:g,onOptionChange:c,sortValue:a,translate:D,visibleEditions:T}))),o.default.createElement(u.StretchedLayoutItem,{isFlex:1},o.default.createElement(u.StretchedLayoutContainer,{isAbsolute:!0,isDirection:"vertical"},o.default.createElement(d.default,{items:T,itemsPerPage:30,defaultColumns:2,style:{height:"100%"},renderNoItem:e,renderItem:t}))))}}),this.render=(()=>{const{props:{newEditionPrompted:e,promptedToDeleteEditionId:t,production:n,actions:{setNewEditionPrompted:r,setPromptedToDeleteEditionId:i,deleteEdition:a}},context:{t:s},renderMainColumn:c}=this,{id:f}=n,d=(0,l.translateNameSpacer)(s,"Features.EditionsView"),p=()=>{i(void 0)};return o.default.createElement(u.Container,{style:{position:"relative",height:"100%"}},o.default.createElement(u.StretchedLayoutContainer,{isFluid:!0,isDirection:"horizontal",isAbsolute:!0},o.default.createElement(u.StretchedLayoutItem,{className:"is-hidden-mobile",isFlex:"1"},o.default.createElement(u.Column,null,o.default.createElement(u.Level,null),o.default.createElement(u.Level,null,o.default.createElement(u.Content,null,d("Editions view aside"))),o.default.createElement(u.Level,null,o.default.createElement(u.Button,{isFullWidth:!0,onClick:()=>{r(!e)},isColor:e?"primary":"info"},d("New edition"))))),o.default.createElement(u.StretchedLayoutItem,{isFlex:"3"},o.default.createElement(u.Column,{isWrapper:!0},c()))),o.default.createElement(u.ModalCard,{isActive:void 0!==t,headerContent:d("Delete an edition"),onClose:p,mainContent:o.default.createElement("div",null,o.default.createElement("p",null,d("Are you sure you want to delete this edition ?"))),footerContent:[o.default.createElement(u.Button,{type:"submit",isFullWidth:!0,key:0,onClick:()=>{a({editionId:t,productionId:f}),i(void 0)},isColor:"danger"},d("Delete")),o.default.createElement(u.Button,{onClick:p,isFullWidth:!0,key:1,isColor:"warning"},d("Cancel"))]}))})}};v.contextTypes={t:a.default.func},t.default=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2818),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";var r,i;Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),a=m(o),s=m(n(0)),u=n(289),l=n(6),c=m(n(39)),f=m(n(180)),d=n(16),p=n(132),h=m(n(152));function m(e){return e&&e.__esModule?e:{default:e}}const g=f.default.definitions.edition.properties.metadata.properties.type.enum,v=(e,t)=>t.filter(t=>t.meta.renderingTypes.includes(e));let y=(r=class extends o.Component{constructor(e,t){super(e),i.call(this);const n=e.edition||(0,p.createDefaultEdition)();this.state={edition:n},this.translate=(0,d.translateNameSpacer)(t.t,"Components.EditionForm")}},i=function(){this.componentDidMount=(()=>{setTimeout(()=>{if(this.form){const e=this.form.getElementsByTagName("input");e&&e.length&&e[0].focus();const t=this.form.getElementsByClassName("is-flowing");t&&t.length&&Array.prototype.forEach.call(t,e=>{e.scrollTop=0})}})}),this.componentWillReceiveProps=((e,t)=>{if(this.props.edition!==e.edition){const t=e.edition||(0,p.createDefaultEdition)();this.setState({edition:t})}this.context.t!==t.t&&(this.translate=(0,d.translateNameSpacer)(t.t,"Components.EditionForm"))}),this.componentWillUnmount=(()=>{const{asNewEdition:e}=this.props;e||this.props.onCancel()}),this.render=(()=>{const{props:{asNewEdition:e=!0,onCancel:t,onSubmit:r,editionType:i,showTitle:o=!0,bigSelectColumnsNumber:s=2,availableTemplates:f},state:{edition:d={}},translate:m}=this,y=(e,t)=>{void 0===e&&t.resetAll();const n=(0,p.createDefaultEdition)(),r=v(e,this.props.availableTemplates),i=r.length&&r[0]&&r[0].meta.id;t.setAllValues(n),t.setValue("metadata.type",e),t.setValue("metadata.title",m(e)),t.setValue("metadata.templateId",i)},b=e=>{this.form=e},_=()=>t(),w={paged:n(582),screened:n(583),pyrrah:{black:n(2819),white:n(2820)},deucalion:{black:n(2821),white:n(2822)}};return a.default.createElement(u.Form,{defaultValues:d,validate:()=>({}),validateOnSubmit:!0,handleSubmitFailure:e=>{console.error(e)},onSubmit:e=>{r(e)}},n=>{const r=n.submitForm;return a.default.createElement("form",{ref:b,className:"is-wrapper",onSubmit:r},a.default.createElement(l.StretchedLayoutContainer,{isAbsolute:!0},o&&a.default.createElement(l.StretchedLayoutItem,null,a.default.createElement(l.Column,null,a.default.createElement(l.Title,{isSize:3},a.default.createElement(l.StretchedLayoutContainer,{isDirection:"horizontal"},a.default.createElement(l.StretchedLayoutItem,{isFlex:1},m(e?"Create a new edition":"Edit edition")),a.default.createElement(l.StretchedLayoutItem,null,a.default.createElement(l.Delete,{onClick:_})))),a.default.createElement(l.Level,null))),a.default.createElement(l.StretchedLayoutItem,{isFlowing:!0,isFlex:1},e&&!i&&a.default.createElement(l.Column,null,a.default.createElement(l.BigSelect,{activeOptionId:n.getValue("metadata.type"),columns:s,onChange:e=>y(e,n),boxStyle:{textAlign:"center"},options:n.getValue("metadata.type")?[{id:n.getValue("metadata.type"),label:a.default.createElement("span",null,m(n.getValue("metadata.type")),a.default.createElement(l.HelpPin,null,m(`Explanation about rendering mode ${n.getValue("metadata.type")}`))),iconUrl:w[n.getValue("metadata.type")]},{id:void 0,label:a.default.createElement("span",null,m("reset type")),iconUrl:c.default.remove.black.svg}]:g.map(e=>({id:e,label:a.default.createElement("span",null,m(e),a.default.createElement(l.HelpPin,null,m(`Explanation about rendering mode ${e}`))),iconUrl:w[e]}))})),n.getValue("metadata.type")&&v(n.getValue("metadata.type"),f).length>0&&a.default.createElement(l.Column,null,a.default.createElement(l.Column,null,a.default.createElement(l.Label,null,m("Choose a template"))),a.default.createElement(l.Column,null,a.default.createElement(l.BigSelect,{activeOptionId:n.getValue("metadata.templateId"),columns:s,onChange:e=>((e,t)=>{void 0===e&&t.setValue("metadata.templateId",void 0),t.setValue("metadata.templateId",e)})(e,n),boxStyle:{textAlign:"center"},options:n.getValue("metadata.templateId")?[{id:n.getValue("metadata.templateId"),label:a.default.createElement("span",null,m(n.getValue("metadata.templateId")),a.default.createElement(l.HelpPin,null,m(`Explanation about template ${n.getValue("metadata.templateId")}`))),iconUrl:w[n.getValue("metadata.templateId")].white},{id:void 0,label:m("reset template"),iconUrl:c.default.remove.black.svg}]:v(n.getValue("metadata.type"),f).map(e=>({id:e.meta.id,label:a.default.createElement("span",null,m(e.meta.id),a.default.createElement(l.HelpPin,null,m(`Explanation about template ${e.meta.id}`))),iconUrl:w[e.meta.id].black}))}))),n.getValue("metadata.type")&&a.default.createElement(l.Column,null,a.default.createElement(l.Column,null,a.default.createElement(l.Field,null,a.default.createElement(l.Control,null,a.default.createElement(h.default,{title:m("Title of the edition"),explanation:m("Explanation about the edition title")}),a.default.createElement(u.Text,{className:"input",type:"text",id:"metadata.title",field:"metadata.title",placeholder:m("Edition title")}))))),n.getValue("metadata.type")&&a.default.createElement(l.Column,null,a.default.createElement(l.Column,null,a.default.createElement(l.Field,null,a.default.createElement(l.Control,null,a.default.createElement(h.default,{title:m("Description of the edition"),explanation:m("Explanation about the edition description")}),a.default.createElement(u.TextArea,{className:"textarea",type:"text",id:"metadata.description",field:"metadata.description",placeholder:m("Edition description")}))))),n.getValue("metadata.type")&&a.default.createElement(l.Column,null,a.default.createElement(l.Column,null,a.default.createElement(l.Field,null,a.default.createElement(l.Control,null,a.default.createElement(l.Label,null,m("Description of the edition"),a.default.createElement(l.HelpPin,{place:"right"},m("Explanation about the edition description"))),a.default.createElement(u.TextArea,{className:"textarea",type:"text",id:"metadata.description",field:"metadata.description",placeholder:m("Edition description")}))))),a.default.createElement(l.Level,null)),a.default.createElement(l.StretchedLayoutItem,null,a.default.createElement(l.StretchedLayoutItem,null,a.default.createElement(l.Column,null,a.default.createElement(l.Columns,null,a.default.createElement(l.Column,{isSize:6},a.default.createElement(l.Button,{type:"submit",isFullWidth:!0,onClick:r,isDisabled:!n.getValue("metadata.type")||!n.getValue("metadata.templateId"),isColor:"success"},m(e?"Create edition":"Update edition"))),a.default.createElement(l.Column,{isSize:6},a.default.createElement(l.Button,{isFullWidth:!0,isColor:"danger",onClick:t},m("Cancel")))))))))})})},r);y.contextTypes={t:s.default.func},t.default=y},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKoAAAC/CAMAAABZs7eYAAAAM1BMVEVHcEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADbQS4qAAAAEHRSTlMA0KAwEPBgwIBAIOCQcLBQJfWYHQAAAtJJREFUeNrt3Em24zAIBVAsq3XL/lf7ZzU1cpAwp542kHuIog4CkeOxNs0xlFpYeyzlqrWtHqj/yFdt0QeVmZn3kDcnVGbm5Vi9UJl519DOoTLzfkYvVOYUNi9UZv4JO5f6E3Y2lfmIbqicshsqc9ncUDndbqjMIbqh8rK5oXJa3VC7VwJDKnP2Q+2z2lK7rMbUHqs1lZsfqnzNMqfyHt1Q+fJD5dMPlVc/1MUPlaseNYjeAXOtZXm3Ym1q1Nqx/7X64psKJlQiirk7uM2ISkStM7TFjkrUFuWwjqMSVd09aySV1tRh3UypFDsmwWFL7bEmYyrFXWy9jakd8/WyptItDqs5lYLSDJhAjUnnIDCBSll6y7Kn0q6yC0yhZpXJOoUqDevxAeqpcRKcQ9009tY5VBIeBeIHqMIZ0D5AbQpPmJOopPAeMIta/FDD76vVLGr1Q81+qA1UUEEFFevq/7pbyc4A4QvUxc/Jys95VXgL+MKF5VBItn7rxvqBy/Wq8b42hyr8/i97qvSFtdpTpbm2Zk4VP1vbPwULZ+pTSngCVbj8P5bbjKfKk2yrNVWcC9qt81byTPthTM1i6WOWfTC1Q/pYbDWWesilz5WsI6lbT6nNYznASOrZUw4i+Ihh1Lz3QDlFI2o8+6CiTxhA3c6Le4cgqLrUteVaEr8YkkL2bxSFFnJDXd1QZfPrC1RZ/fIXqGlzQ5X+T9CeepAXaiAv1CV6oXZIjak9Ultql9SUWvr+IVw8/PatqSc5oab+Jj1G1DcdAmyor27AxUlITahvW1lMp6b6uqnNZGr4oftO8RHRudQl/9jPaBI1KXSJmkHdj5sUxmhquk6tjnEjqUs4NRvbDaHuJdRbvf2ejFqqcOSBfQ1nldmACiqooIIKKqigggoqqKCCCiqooIIKKqigggoqqKCCCiqooIIKKqigggoqqKCCCiqooIIKKqigfpf6Bw73iWs2ODQzAAAAAElFTkSuQmCC"},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKoAAAC/CAMAAABZs7eYAAAAM1BMVEVHcEz////////////////////////////////////////////////////////////////P0YphAAAAEHRSTlMA0KAwEPBgwIBAIOCQcLBQJfWYHQAAAtJJREFUeNrt3Em24zAIBVAsq3XL/lf7ZzU1cpAwp542kHuIog4Ckd+xNs0xlFpYeyzlqrWtHqj/yFdt0QeVmZn3kDcnVGbm5Vi9UJl519DOoTLzfkYvVOYUNi9UZv4JO5f6E3Y2lfmIbqicshsqc9ncUDndbqjMIbqh8rK5oXJa3VC7VwJDKnP2Q+2z2lK7rMbUHqs1lZsfqnzNMqfyHt1Q+fJD5dMPlVc/1MUPlaseNYjeAXOtZXm3Ym1q1Nqx/7X64psKJlQiirk7uM2ISkStM7TFjkrUFuWwjqMSVd09aySV1tRh3UypFDsmwWFL7bEmYyrFXWy9jakd8/WyptItDqs5lYLSDJhAjUnnIDCBSll6y7Kn0q6yC0yhZpXJOoUqDevxAeqpcRKcQ9009tY5VBIeBeIHqMIZ0D5AbQpPmJOopPAeMIta/FDD76vVLGr1Q81+qA1UUEEFFevq/7pbyc4A4QvUxc/Jys95VXgL+MKF5VBItn7rxvqBy/Wq8b42hyr8/i97qvSFtdpTpbm2Zk4VP1vbPwULZ+pTSngCVbj8P5bbjKfKk2yrNVWcC9qt81byTPthTM1i6WOWfTC1Q/pYbDWWesilz5WsI6lbT6nNYznASOrZUw4i+Ihh1Lz3QDlFI2o8+6CiTxhA3c6Le4cgqLrUteVaEr8YkkL2bxSFFnJDXd1QZfPrC1RZ/fIXqGlzQ5X+T9CeepAXaiAv1CV6oXZIjak9Ultql9SUWvr+IVw8/PatqSc5oab+Jj1G1DcdAmyor27AxUlITahvW1lMp6b6uqnNZGr4oftO8RHRudQl/9jPaBI1KXSJmkHdj5sUxmhquk6tjnEjqUs4NRvbDaHuJdRbvf2ejFqqcOSBfQ1nldmACiqooIIKKqigggoqqKCCCiqooIIKKqigggoqqKCCCiqooIIKKqigggoqqKCCCiqooIIKKqigfpj6B5hhiWvWrj6JAAAAAElFTkSuQmCC"},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALAAAAC/CAMAAABpP6a5AAAAM1BMVEVHcEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADbQS4qAAAAEHRSTlMAYOCg8DAQwECA0CBQkLBwQ4kgWwAAA0xJREFUeNrt3VuS5SAIAFB8xRjzYP+rna/5nBq0EaELN9DnppDY9woAmF/lZFmHGLgi27rq276z2wH/XfUJxRQYETHXr5gCIyLmdNsCIyLymxeDEfPTbYERsd7GwIgxGAMzkqXAiPE0Bkas3RgYsVkDM8SFMPjnD1kcjFcxBsYcjIERH2tgrIcxMF7dGBhzMQaeFm8Dz4r3gSfFG8Fz4p3gKfFW8Ix4LxjjYQyMlzUwpiXg9J8vL1t7pz95WAEmnbpLePOMuOwCAwDcKS/eeMxggCPEpWHMDgaAYfK9GQzQxgIjH7vB0MeSxrMdDNCGxOd+MJx5yQtvHRhKXvH6WAiG41qQjFeCh8RNAxh6Zk9ta8EjcdxUgOGmR7EO8EA+DjrA9H8RLiVg+sY7dYDhYz1mCoDJQUHKbBLgk3PbSYAhEcGvFnCnPuJDCZj8iIMWcOeLCRkwvMQ8oQZ8s707hMAQuY5sUuCH+AOeGnAhxoQaMDUmihowMSY+NWBinnjUgIFp18mBL55dJwd+eM4/cuDA866TAxeeA5scGHhezoLgyJLXBMGVJa8JgpM1MO1Lq2gNjHrAp4Md7GAHO9jBDnawgx3sYAc72MEOdrCDHexgBzvYwQ52sIPVgA9/wg52MBP4tgZuvxOs6Nd8c/clzN1IoVXMJD1ga7eqiGlYz701YkmSnpuBxFqOrgZs7XbrgSxZTd0N7aQGTAxhPXfgI0+S8DqOfy1zlTIZmf6QEJh4AV5PtVflCmEhMHXLqalYtFYTSq667UrAxIpQUjsBrxyfP1iS6rAlwOSWGEq6HxRr/SXIARFBBfhBzi23HhzIXmKjH+/zM+tV0UnpGOjFp6FXVR/orZUVdAMb6rf2wXbwPeKNsB1srGfgYFfGFzaDjfW9tNVZdKJ36wv7wKa645aQpvoPjw1B4enw/LU03eH5gwXghWtND+116zpsgbOxPvDWOu2bm2UwM9VpJ3hq3NDGiSdz45F8psxir89FIv4cZ2zylLHZXvlHUzirofDdAzY2AfD68YxhUXA2NsXytTUntNqaxBq5JgrLgBkHIEuA0wlgBxybpYnY+WGf7b4QfD0rJtEvAscUOixZ/ODrbecByxYbONf6tnYyR8EfJ38cBgHdaFAAAAAASUVORK5CYII="},function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALAAAAC/CAMAAABpP6a5AAAAM1BMVEVHcEz////////////////////////////////////////////////////////////////P0YphAAAAEHRSTlMAYOCg8DAQwECA0CBQkLBwQ4kgWwAAA0xJREFUeNrt3VuS5SAIAFB8xRjzYP+rna/5nBq0EaELN9DnppDY9woAmF/lZFmHGLgi27rq276z2wH/XfUJxRQYETHXr5gCIyLmdNsCIyLymxeDEfPTbYERsd7GwIgxGAMzkqXAiPE0Bkas3RgYsVkDM8SFMPjnD1kcjFcxBsYcjIERH2tgrIcxMF7dGBhzMQaeFm8Dz4r3gSfFG8Fz4p3gKfFW8Ix4LxjjYQyMlzUwpiXg9J8vL1t7pz95WAEmnbpLePOMuOwCAwDcKS/eeMxggCPEpWHMDgaAYfK9GQzQxgIjH7vB0MeSxrMdDNCGxOd+MJx5yQtvHRhKXvH6WAiG41qQjFeCh8RNAxh6Zk9ta8EjcdxUgOGmR7EO8EA+DjrA9H8RLiVg+sY7dYDhYz1mCoDJQUHKbBLgk3PbSYAhEcGvFnCnPuJDCZj8iIMWcOeLCRkwvMQ8oQZ8s707hMAQuY5sUuCH+AOeGnAhxoQaMDUmihowMSY+NWBinnjUgIFp18mBL55dJwd+eM4/cuDA866TAxeeA5scGHhezoLgyJLXBMGVJa8JgpM1MO1Lq2gNjHrAp4Md7GAHO9jBDnawgx3sYAc72MEOdrCDHexgBzvYwQ52sIPVgA9/wg52MBP4tgZuvxOs6Nd8c/clzN1IoVXMJD1ga7eqiGlYz701YkmSnpuBxFqOrgZs7XbrgSxZTd0N7aQGTAxhPXfgI0+S8DqOfy1zlTIZmf6QEJh4AV5PtVflCmEhMHXLqalYtFYTSq667UrAxIpQUjsBrxyfP1iS6rAlwOSWGEq6HxRr/SXIARFBBfhBzi23HhzIXmKjH+/zM+tV0UnpGOjFp6FXVR/orZUVdAMb6rf2wXbwPeKNsB1srGfgYFfGFzaDjfW9tNVZdKJ36wv7wKa645aQpvoPjw1B4enw/LU03eH5gwXghWtND+116zpsgbOxPvDWOu2bm2UwM9VpJ3hq3NDGiSdz45F8psxir89FIv4cZ2zylLHZXvlHUzirofDdAzY2AfD68YxhUXA2NsXytTUntNqaxBq5JgrLgBkHIEuA0wlgBxybpYnY+WGf7b4QfD0rJtEvAscUOixZ/ODrbecByxYbONf6tnYyR8EfJ38cBgHdaFAAAAAASUVORK5CYII="},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=d(r),o=d(n(0)),a=n(155),s=n(6),u=d(n(39)),l=n(41),c=n(16),f=d(n(84));function d(e){return e&&e.__esModule?e:{default:e}}let p=class extends r.Component{constructor(...e){var t;return t=super(...e),this.render=(()=>{const{props:{edition:e,href:t,onDelete:r,onClick:o},context:{t:d}}=this,{metadata:p={}}=e,h=(0,c.translateNameSpacer)(d,"Features.EditionView"),m={paged:n(582),screened:n(583)};return i.default.createElement(s.Column,{isSize:"12"},i.default.createElement(s.Card,{onClick:o,bodyContent:i.default.createElement("div",{className:"ovide-EditionCard"},i.default.createElement(s.Columns,{style:{marginBottom:0}},i.default.createElement(s.Column,{isSize:2},i.default.createElement(f.default,{src:m[p.type]})),i.default.createElement(s.Column,{style:{transition:"none",paddingTop:".2rem"},isSize:8},i.default.createElement(s.Title,{style:{paddingTop:".5rem"},isSize:6},i.default.createElement(a.Link,{to:t},p.title&&p.title.length?(0,l.abbrevString)(p.title,30):h("Untitled edition")),e.lastUpdateAt&&i.default.createElement("p",{style:{fontSize:".7rem",marginTop:"1rem",marginBottom:"1rem",opacity:.5}},i.default.createElement("i",null,h("Last modification"),": ",new Date(e.lastUpdateAt).toLocaleString()))))),i.default.createElement(s.Columns,null,i.default.createElement(s.Column,{style:{paddingTop:0},isOffset:2,isSize:7},i.default.createElement(s.Button,{onClick:o,"data-place":"left","data-effect":"solid","data-for":"tooltip","data-tip":h("edit this edition")},i.default.createElement(f.default,{src:u.default.edit.black.svg})),i.default.createElement(s.Button,{onClick:r,"data-place":"left","data-effect":"solid","data-for":"tooltip","data-tip":h("delete this edition")},i.default.createElement(f.default,{src:u.default.remove.black.svg})))))}))}),t}};p.contextTypes={t:o.default.func.isRequired,getResourceDataUrl:o.default.func},t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(2)),i=u(n(0)),o=n(6),a=u(n(84)),s=n(16);function u(e){return e&&e.__esModule?e:{default:e}}const l=({filterValues:e,onSearchStringChange:t,onToggleOptionsVisibility:i,optionsVisible:u,editionsTypes:l,searchString:c,onOptionChange:f,sortValue:d},{t:p})=>{const h={paged:n(582),screened:n(583)},m=(0,s.translateNameSpacer)(p,"Features.EditionsView");return r.default.createElement(o.Level,{isMobile:!0,style:{flexFlow:"row wrap"}},r.default.createElement(o.LevelLeft,null,r.default.createElement(o.Field,{hasAddons:!0},r.default.createElement(o.Input,{value:c,onChange:t,placeholder:m("Find an edition")})),r.default.createElement(o.LevelItem,null,r.default.createElement(o.Dropdown,{closeOnChange:!1,menuAlign:"left",onToggle:i,onChange:(e,t)=>{f(e,t)},isActive:u,isColor:Object.keys(e).filter(t=>e[t]).length>0?"info":"",value:{sort:{value:d},filter:{value:Object.keys(e).filter(t=>e[t])}},options:[{label:m("Sort editions by"),id:"sort",options:[{id:"edited recently",label:m("edited recently")},{id:"title",label:m("title")}]},{label:m("Show editions of type"),id:"filter",options:l.map(e=>({id:e,label:r.default.createElement(o.FlexContainer,{flexDirection:"row",alignItems:"center"},r.default.createElement(a.default,{src:h[e],style:{minWidth:"1rem",marginRight:"1rem"}}),r.default.createElement("span",null,m(e)))}))}]},m("Filters")))))};l.contextTypes={t:i.default.func},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2826),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i,o,a,s=C(n(3)),u=n(2),l=C(u),c=C(n(0)),f=n(43),d=n(69),p=n(68),h=n(175),m=n(310),g=n(16),v=n(70),y=n(112),b=n(127),_=C(n(551)),w=k(n(931)),x=k(n(143)),E=k(n(83)),M=C(n(2827)),S=C(n(237)),O=n(82);function k(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function C(e){return e&&e.__esModule?e:{default:e}}let T;b.inElectron&&(T=n(626));const D=(0,_.default)();let A=(0,d.connect)(e=>(0,s.default)({lang:e.i18nState&&e.i18nState.lang},x.selector(e.editedProduction),w.selector(e.edition)),e=>({actions:(0,f.bindActionCreators)((0,s.default)({},E,x,w),e)}))((o=i=class extends u.Component{constructor(e){super(e),a.call(this)}render(){const{props:{match:{params:{editionId:e}},editedProduction:t},downloadEdition:n}=this;if(t){const r=t.editions[e];if(r)return l.default.createElement(S.default,{withLargeHeader:!0},l.default.createElement(M.default,(0,s.default)({production:this.props.editedProduction,edition:r,downloadEdition:n},this.props)))}return null}},i.childContextTypes={production:c.default.object,googleApiKey:c.default.string},i.contextTypes={t:c.default.func},a=function(){this.getChildContext=(()=>({production:this.props.editedProduction,googleApiKey:D.googleApiKey})),this.componentDidMount=(()=>{const e=this.props.match.params.productionId;this.props.editedProduction&&this.props.editedProduction.id===e||this.props.actions.activateProduction({productionId:e}),this.props.actions.getCitationStylesList(),this.props.actions.getCitationLocalesList()}),this.componentWillReceiveProps=(e=>{const{editedProduction:t,match:{params:{editionId:n}}}=this.props,{editedProduction:r,match:{params:{editionId:i}}}=e,o=t&&t.editions[n],a=r&&r.editions[i];t===r&&o===a||this.updateAssetsData(e,a)}),this.componentWillUnmount=(()=>{this.props.actions.resetViewsUi()}),this.updateAssetsData=((e,t={})=>{const{editedProduction:n={},loadedAssets:r={},actions:{setLoadedAsset:i}}=e,{contextualizations:o={},resources:a={},assets:u={},sectionsOrder:l=[],id:c}=n,{data:f={}}=t,{plan:d={}}=f;if("linear"===d.type){const{summary:e=[]}=d,t=e.filter(e=>"sections"===e.type).reduce(e=>e.concat(l),[]),n=(0,p.uniq)(t.reduce((e,t)=>[...e,...Object.keys(o).filter(e=>o[e].sectionId===t).map(e=>a[o[e].resourceId])],[]));(0,p.uniq)(n.reduce((e,t={})=>{const{data:n={}}=t;return[...e,...(0,v.getRelatedAssetsIds)(n)]},[])).filter(e=>!r[e]).map(e=>u[e]).filter(e=>e).reduce((e,t)=>e.then(()=>new Promise((e,n)=>{(0,y.requestAssetData)(c,t).then(n=>{const r=(0,s.default)({},t,{data:n});return i(r),e()}).catch(n)})),Promise.resolve())}}),this.downloadEdition=((e={},t={})=>{const{props:{match:{params:{editionId:n}},editedProduction:r},context:{t:i}}=this,o=r.editions[n],{id:a}=e,s=(0,g.translateNameSpacer)(i,"Features.EditionView");b.inElectron?T.remote.dialog.showSaveDialog({properties:["createDirectory"],title:"Download edition",defaultPath:`${r.metadata.title}.${e.outputFormat}`},e=>{m.toastr.info(s("Bundling the edition for download"),s("You will be notified when your file is ready.")),(0,y.requestEditionDownload)({production:r,edition:o,locale:t,outputPath:e,generatorId:a}).then(()=>{m.toastr.success(s("The edition was downloaded successfully"))}).catch(e=>{console.error("error during saving !",e),m.toastr.error(s("An error occured during edition download"))})}):(0,y.requestEditionDownload)({production:r,edition:o,contextualizers:O.contextualizers,locale:t,generatorId:a})})},r=o))||r;t.default=(0,h.withRouter)(A)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=m(n(3)),i=m(n(2)),o=m(n(0)),a=n(6),s=m(n(39)),u=m(n(79)),l=n(16),c=n(127),f=n(82),d=m(n(152)),p=m(n(2828)),h=m(n(2834));function m(e){return e&&e.__esModule?e:{default:e}}const g=({editionAsideTabMode:e,editionAsideTabCollapsed:t,editedProduction:n={},edition:o,addItemsToSummaryVisible:m,downloadModalOpen:g,citationStylesList:v,citationLocalesList:y,summaryEdited:b,lang:_,actions:{setEditionAsideTabMode:w,setEditionAsideTabCollapsed:x,updateEdition:E,updateCitationStyle:M,updateCitationLocale:S,setAddItemsToSummaryVisible:O,setDownloadModalOpen:k,setSummaryEdited:C},downloadEdition:T},{t:D})=>{const A=(0,l.translateNameSpacer)(D,"Features.EditionView"),j=n.id,L=f.templates.find(e=>e.meta.id===o.metadata.templateId),I=Object.keys(f.generators).filter(e=>L.meta.generatorsTypes.includes(f.generators[e].generatorType)).filter(e=>{let t;return t=c.inElectron?"desktop":"web",f.generators[e].interfaceCoverage.includes(t)}).map(e=>f.generators[e]),P=e=>{E({edition:e,editionId:e.id,productionId:j})},N=()=>k(!0),R={"Table of contents":A("Table of contents"),Notes:A("Notes"),Mentions:A("Mentions"),mentions:A("mentions"),mention:A("mention"),Glossary:A("Glossary"),References:A("References"),Source:A("Source"),"More informations":A("More informations"),"Mention context":A("Mention context"),"Go to mention":A("Go to mention"),"Print mentions":A("Print mentions"),"Point of view of":A("Point of view of"),"untitled section":A("untitled section"),references:A("references"),events:A("events"),places:A("places"),resourcesMap:A("resourcesMap"),"This item is mentionned in":A("This item is mentionned in"),"Browse online":A("Browse online"),"Mentions of the item":A("Mentions of the item"),glossary:A("glossary"),webpage:A("webpage"),bib:A("bib"),video:A("video"),embed:A("embed"),table:A("table"),image:A("image"),"See mentions":A("See mentions"),"Mentions about this place":A("Mentions about this place"),"Mentions about an event":A("Mentions about an event"),"Nothing to see here!":A("Nothing to see here!"),"There is not content to display for this URL.":A("There is not content to display for this URL."),"Glossary list":A("Glossary list")};return i.default.createElement(a.StretchedLayoutContainer,{isDirection:"horizontal",isAbsolute:!0},i.default.createElement(p.default,(0,r.default)({style:{minWidth:t?void 0:"30%"},className:`aside-edition-container ${t?"is-collapsed":""} is-hidden-mobile`},{production:n,edition:o,template:L,onEditionChange:P,summaryEdited:b,setSummaryEdited:C,citationStylesList:v,availableGenerators:I,promptDownloadModal:N,citationLocalesList:y,editionAsideTabMode:e,onCitationStyleChange:(e,t,n)=>{M({citationStyleId:e,editionId:n.id,title:t,edition:n,productionId:j})},setEditionAsideTabMode:w,onCitationLocaleChange:(e,t,n)=>{S({citationLocaleId:e,editionId:o.id,edition:n,names:t,productionId:j})},editionAsideTabCollapsed:t,addItemsToSummaryVisible:m,setEditionAsideTabCollapsed:x,setAddItemsToSummaryVisible:O})),i.default.createElement(h.default,{lang:_,production:n,locale:R,edition:o,template:L,translate:A,contextualizers:f.contextualizers,onEditionChange:P,availableGenerators:I,summaryEdited:b,setSummaryEdited:C,onClickOnDownload:N}),i.default.createElement(a.ModalCard,{isActive:g,onClose:()=>k(!1),headerContent:A("Download edition"),mainContent:i.default.createElement(a.StretchedLayoutContainer,{isDirection:"vertical"},i.default.createElement(a.StretchedLayoutItem,{isFlex:1},i.default.createElement(a.Column,null,i.default.createElement(a.BigSelect,{activeOptionId:void 0,onChange:e=>T(f.generators[e],R),boxStyle:{minHeight:"12rem",textAlign:"center"},options:I.map(e=>({id:e.id,label:i.default.createElement(d.default,{title:A(`download as ${e.id}`),explanation:A(`explanation about ${e.id} download`)}),iconUrl:s.default.takeAway.black.svg}))}))))}),i.default.createElement(u.default,{id:"help-tooltip"}))};g.contextTypes={t:o.default.func},t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n(2)),i=u(n(0)),o=n(6),a=n(16),s=u(n(2829));function u(e){return e&&e.__esModule?e:{default:e}}const l=({editionAsideTabCollapsed:e,editionAsideTabMode:t,production:n={},edition:i={},style:u={},className:l,citationStylesList:c,citationLocalesList:f,setEditionAsideTabCollapsed:d,onCitationStyleChange:p,onCitationLocaleChange:h,setEditionAsideTabMode:m,onEditionChange:g,addItemsToSummaryVisible:v,setAddItemsToSummaryVisible:y,template:b,summaryEdited:_,setSummaryEdited:w},{t:x})=>{const E=(0,a.translateNameSpacer)(x,"Features.EditionView");return r.default.createElement(o.Column,{style:u,className:l,isSize:e?1:"1/4",isWrapper:!0},r.default.createElement(o.StretchedLayoutContainer,{isDirection:"vertical",isAbsolute:!0,style:{paddingLeft:e?void 0:"1rem"}},r.default.createElement(o.StretchedLayoutItem,null,r.default.createElement(o.Column,null,r.default.createElement(o.Tabs,{isBoxed:!0,isFullWidth:!0,style:{overflow:"hidden"}},r.default.createElement(o.TabList,null,!e&&r.default.createElement(o.Tab,{onClick:()=>m("settings"),isActive:"settings"===t},r.default.createElement(o.TabLink,null,E("Settings"))),!e&&r.default.createElement(o.Tab,{onClick:()=>m("summary"),isActive:"summary"===t},r.default.createElement(o.TabLink,null,E("Summary"))),!e&&r.default.createElement(o.Tab,{onClick:()=>m("styles"),isActive:"styles"===t},r.default.createElement(o.TabLink,null,E("Styles"))),r.default.createElement(o.Tab,{className:"is-hidden-mobile",onClick:()=>d(!e),isActive:e},r.default.createElement(o.TabLink,{style:{boxShadow:"none",transform:e?"rotate(180deg)":void 0,transition:"all .5s ease",paddingRight:e?"1rem":void 0,display:e?"inline-block":"flex",justifyContent:e?void 0:"flex-end",textAlign:"left"},"data-for":"tooltip","data-effect":"solid","data-place":"right","data-tip":E(e?"show edition settings pannels":"hide edition settings pannels")},"◀")))))),r.default.createElement(o.StretchedLayoutItem,{isFlex:1,isFlowing:!0,style:{}},r.default.createElement(s.default,{editionAsideTabCollapsed:e,editionAsideTabMode:t,citationStylesList:c,citationLocalesList:f,onCitationStyleChange:p,onCitationLocaleChange:h,addItemsToSummaryVisible:v,setAddItemsToSummaryVisible:y,edition:i,production:n,onEditionChange:g,template:b,summaryEdited:_,setSummaryEdited:w}))))};l.contextTypes={t:i.default.func},t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=g(n(3)),i=n(2),o=g(i),a=g(n(0)),s=n(6),u=g(n(381)),l=n(16),c=n(41),f=g(n(180)),d=g(n(382)),p=g(n(152)),h=g(n(2830)),m=g(n(2832));function g(e){return e&&e.__esModule?e:{default:e}}const v=f.default.definitions.edition;let y=class extends i.Component{constructor(e){super(e),this.componentWillReceiveProps=(e=>{this.props.edition!==e.edition&&this.setState({edition:e.edition})}),this.propagateEditionChange=(e=>{this.props.onEditionChange(e)}),this.handleEditionChange=(e=>{this.setState({edition:e}),this.propagateEditionChange(e)}),this.render=(()=>{const{props:{editionAsideTabCollapsed:e,editionAsideTabMode:t,citationStylesList:n,citationLocalesList:i,summaryEdited:a,onCitationStyleChange:u,onCitationLocaleChange:f,setSummaryEdited:g,template:y},state:{edition:b={}},context:{t:_},handleEditionChange:w}=this,{data:x={}}=b,{style:E={mode:"replace",css:""},additionalHTML:M="",citationLocale:S,citationStyle:O,publicationTitle:k,publicationSubtitle:C,publicationDate:T,publicationAuthors:D=[],plan:A={},bibType:j}=x,{summary:L=[]}=A,I=(0,l.translateNameSpacer)(_,"Features.EditionView"),P=e=>{(0,c.silentEvent)(e),w((0,r.default)({},b,{data:(0,r.default)({},x,{style:(0,r.default)({},E,{mode:e.target.value})})}))},N=e=>{w((0,r.default)({},b,{data:(0,r.default)({},x,{style:(0,r.default)({},E,{css:e})})}))},R=e=>{w((0,r.default)({},b,{data:(0,r.default)({},x,{additionalHTML:e})}))},z=e=>{w((0,r.default)({},b,{metadata:(0,r.default)({},b.metadata,{title:e})}))},F=e=>{w((0,r.default)({},b,{metadata:(0,r.default)({},b.metadata,{description:e})}))},U=e=>{const t=e.target.value;w((0,r.default)({},b,{data:(0,r.default)({},b.data,{bibType:t})}))},Y=e=>{w((0,r.default)({},b,{data:(0,r.default)({},b.data,{publicationTitle:e})}))},H=e=>{w((0,r.default)({},b,{data:(0,r.default)({},b.data,{publicationDate:e})}))},W=e=>{w((0,r.default)({},b,{data:(0,r.default)({},b.data,{publicationAuthors:e})}))},B=e=>{w((0,r.default)({},b,{data:(0,r.default)({},b.data,{publicationSubtitle:e})}))},V=()=>{const e=`${E.css}\n${y&&y.css||""}`;N(e)},q=e=>{const t=e.target.value,r=n.find(e=>e.id===t).title;u(t,r,b)},G=e=>{const t=e.target.value,n=i.find(e=>e.id===t).names;f(t,n,b)},K=()=>{g(!a)};if(e)return null;switch(t){case"settings":return o.default.createElement(s.Column,null,o.default.createElement(s.Field,null,o.default.createElement(s.Control,null,o.default.createElement(p.default,{title:I("Edition title"),explanation:I("Explanation about the edition title")}),o.default.createElement(h.default,{className:"input",type:"text",placeholder:I("Edition title"),value:b.metadata.title,onChange:z}))),o.default.createElement(s.Field,null,o.default.createElement(s.Control,null,o.default.createElement(p.default,{title:I("Edition description"),explanation:I("Explanation about the edition description")}),o.default.createElement(m.default,{className:"textarea",type:"text",placeholder:I("Edition description"),value:b.metadata.description,onChange:F}))),o.default.createElement(s.Level,null,o.default.createElement(s.Column,null,o.default.createElement(s.Field,null,o.default.createElement(s.Control,null,o.default.createElement(p.default,{title:I("Publication title"),explanation:I("Explanation about the publication title")}),o.default.createElement(h.default,{className:"textarea",type:"text",placeholder:I("Publication title"),value:k,onChange:Y}))))),o.default.createElement(s.Level,null,o.default.createElement(s.Column,null,o.default.createElement(s.Field,null,o.default.createElement(s.Control,null,o.default.createElement(p.default,{title:I("Publication subtitle"),explanation:I("Explanation about the publication subtitle")}),o.default.createElement(h.default,{className:"textarea",type:"text",placeholder:I("Publication subtitle"),value:C,onChange:B}))))),o.default.createElement(s.Level,null,o.default.createElement(s.Column,null,o.default.createElement(s.Field,null,o.default.createElement(s.Control,null,o.default.createElement(p.default,{title:I("Publication date"),explanation:I("Explanation about the publication date")}),o.default.createElement(h.default,{className:"textarea",type:"text",placeholder:I("Publication date"),value:T,onChange:H}))))),o.default.createElement(s.Level,null,o.default.createElement(s.Column,null,o.default.createElement(s.Field,null,o.default.createElement(s.Control,null,o.default.createElement(p.default,{title:I("Publication custom authors"),explanation:I("Explanation about the publication custom authors")}),o.default.createElement(d.default,{onChange:W,authors:D}))))),o.default.createElement(s.Level,null,o.default.createElement(s.Column,{style:{maxWidth:"100%"}},o.default.createElement("form",null,o.default.createElement(s.Field,null,o.default.createElement(p.default,{title:I("Citation style"),explanation:I("Explanation about citation style")}),o.default.createElement(s.Control,null,o.default.createElement(s.Select,{onChange:q,value:O.id},n.map(e=>o.default.createElement("option",{key:e.id,value:e.id},e.title)))))))),o.default.createElement(s.Level,null,o.default.createElement(s.Column,null,o.default.createElement("form",null,o.default.createElement(s.Field,null,o.default.createElement(p.default,{title:I("Citation locale"),explanation:I("Explanation about citation locale")}),o.default.createElement(s.Control,null,o.default.createElement(s.Select,{onChange:G,value:S.id},i.map(e=>o.default.createElement("option",{key:e.id,value:e.id},e.names[1])))))))),o.default.createElement(s.Level,null,o.default.createElement(s.Column,{style:{maxWidth:"100%"}},o.default.createElement("form",null,o.default.createElement(s.Field,null,o.default.createElement(p.default,{title:I("Bibliographic metadata type"),explanation:I("Explanation about bibliographic metadata type")}),o.default.createElement(s.Control,null,o.default.createElement(s.Select,{onChange:U,value:j},v.properties.data.properties.bibType.enum.map(e=>o.default.createElement("option",{key:e,value:e},I(e))))))))));case"summary":return o.default.createElement(s.Column,null,o.default.createElement("div",{style:{marginLeft:"1rem"}},o.default.createElement(s.Label,null,I("Current summary")),o.default.createElement("ol",{style:{marginLeft:"2rem"}},L.map((e,t)=>o.default.createElement("li",{key:t},e.data&&e.data.customTitle&&e.data.customTitle.length?`${e.data.customTitle} (${I(e.type)})`:I(e.type))))),o.default.createElement(s.Column,null,o.default.createElement(s.Button,{onClick:K,isColor:a?"primary":"info",isFullWidth:!0},I(a?"Close summary edition":"Edit summary"))));case"styles":default:return o.default.createElement(s.Column,null,o.default.createElement(s.Level,null,o.default.createElement(s.Column,null,o.default.createElement("form",null,o.default.createElement(s.Field,null,o.default.createElement(s.Label,null,I("Styles customization mode")),o.default.createElement(s.Control,null,o.default.createElement(s.Select,{onChange:P,value:E.mode},o.default.createElement("option",{value:"merge"},I("add to template styles")),o.default.createElement("option",{value:"replace"},I("replace styles")))))))),o.default.createElement(s.Level,null,o.default.createElement(s.CodeEditor,{value:E.css,onChange:N})),"replace"===E.mode&&o.default.createElement(s.Level,null,o.default.createElement(s.Button,{onClick:V},I("load template css"))),o.default.createElement(s.Level,null,o.default.createElement(p.default,{title:I("Additional document-level HTML code"),explanation:I("Explanation about additional document-level HTML code")})),o.default.createElement(s.Level,null,o.default.createElement(s.CodeEditor,{value:M,onChange:R})))}}),this.state={edition:e.edition},this.propagateEditionChange=(0,u.default)(this.propagateEditionChange,2e3)}};y.contextTypes={t:a.default.func},t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2831),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=n(2),o=(r=i)&&r.__esModule?r:{default:r},a=n(68);t.default=class extends i.Component{constructor(e){super(e),this.componentWillReceiveProps=(e=>{this.props.value!==e.value&&this.setState({value:e.value}),this.props.delay!==e.delay&&(this.setState({delay:e.delay}),this.onChange=(0,a.debounce)(this.onChange,e.delay))}),this.onChange=(e=>{this.props.onChange(e)}),this.handleChange=(e=>{const t=e.target.value;this.setState({value:t}),this.onChange(t)}),this.render=(()=>{const{state:{value:e},props:{placeholder:t},handleChange:n}=this;return o.default.createElement("input",{className:"input",type:"text",placeholder:t,value:e,onChange:n})});const t=e.delay||500;this.state={value:e.value,delay:t},this.onChange=(0,a.debounce)(this.onChange,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2833),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i=n(2),o=(r=i)&&r.__esModule?r:{default:r},a=n(68);t.default=class extends i.Component{constructor(e){super(e),this.componentWillReceiveProps=(e=>{this.props.value!==e.value&&this.setState({value:e.value}),this.props.delay!==e.delay&&(this.setState({delay:e.delay}),this.onChange=(0,a.debounce)(this.onChange,e.delay))}),this.onChange=(e=>{this.props.onChange(e)}),this.handleChange=(e=>{const t=e.target.value;this.setState({value:t}),this.onChange(t)}),this.render=(()=>{const{state:{value:e},props:{placeholder:t},handleChange:n}=this;return o.default.createElement("textarea",{className:"textarea",type:"text",placeholder:t,value:e,onChange:n})});const t=e.delay||500;this.state={value:e.value,delay:t},this.onChange=(0,a.debounce)(this.onChange,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i,o,a,s,u=y(n(3)),l=n(2),c=y(l),f=y(n(0)),d=n(14),p=n(6),h=n(970),m=n(112),g=y(n(2835)),v=y(n(2837));function y(e){return e&&e.__esModule?e:{default:e}}let b=(i=r=class extends l.Component{constructor(...e){var t;return t=super(...e),this.getChildContext=(()=>({renderingMode:this.props.renderingMode})),this.render=(()=>this.props.children),t}},r.childContextTypes={renderingMode:f.default.string},i),_=(a=o=class extends l.Component{constructor(e){super(e),s.call(this),this.state={assets:{}}}},o.contextTypes={getResourceDataUrl:f.default.func},s=function(){this.componentDidMount=(()=>{this.loadAssets(this.props),setTimeout(()=>this.update(this.props,this.state))}),this.componentWillReceiveProps=(e=>{this.props.production===e.production&&this.props.lang===e.lang&&this.props.edition===e.edition||this.loadAssets(e).then(()=>this.update(this.props,this.state))}),this.shouldComponentUpdate=((e,t)=>{return["production","edition","template","contextualizers","lang"].find(t=>this.props[t]!==e[t])||this.state.assets!==t.assets}),this.loadAssets=(e=>{const{production:t={},edition:n={}}=e;return new Promise((e,r)=>{(0,h.loadAssetsForEdition)({production:t,edition:n,requestAssetData:m.requestAssetData}).then(e=>{this.setState({assets:e})}).then(e).catch(r)})}),this.update=(()=>{}),this.render=(()=>{const{props:e,state:t}=this,{production:n,edition:r={},template:i,contextualizers:o,lang:a,locale:s}=e,{assets:l={}}=t;if(!i||!n)return null;const f=(0,u.default)({},n,{assets:(0,u.default)({},n.assets||{},l)}),p=i.components.Edition,{getResourceDataUrl:h}=this.context,m=r.metadata.type;let v=()=>c.default.createElement(b,{getResourceDataUrl:h,renderingMode:m},c.default.createElement(p,{production:f,edition:r,lang:a,contextualizers:o,previewMode:!0,locale:s}));if("paged"===m)return c.default.createElement(g.default,{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0},Component:v,additionalHTML:r.data.additionalHTML});setTimeout(()=>{const e=this.iframe&&this.iframe.contentDocument;if(v=c.default.createElement(b,{getResourceDataUrl:h,renderingMode:m},c.default.createElement(p,{production:f,edition:r,lang:a,locale:s,contextualizers:o,previewMode:!0,usedDocument:e})),e){let t=e.getElementById("mount");t||((t=e.createElement("div")).id="mount",e.body.appendChild(t)),(0,d.render)(v,t)}});return c.default.createElement("iframe",{name:"preview",id:"preview",style:{width:"100%",height:"100%"},ref:e=>{this.iframe=e}})})},a);t.default=(({production:e,lang:t,edition:n,template:r,contextualizers:i,availableGenerators:o,onClickOnDownload:a,translate:s,summaryEdited:l,setSummaryEdited:f,onEditionChange:d,locale:h})=>{const m=e=>{d((0,u.default)({},n,{data:(0,u.default)({},n.data,{plan:(0,u.default)({},n.data.plan,{summary:e})})}))};return l?c.default.createElement(v.default,{template:r,edition:n,translate:s,setSummaryEdited:f,summaryEdited:l,onSummaryChange:m}):c.default.createElement(p.Column,{isSize:"fullwidth",style:{position:"relative"}},c.default.createElement(_,{production:e,edition:n,lang:t,template:r,contextualizers:i,locale:h}),c.default.createElement("div",{style:{position:"absolute",right:"1rem",bottom:"1rem"}},o.length>0&&c.default.createElement(p.Button,{className:"is-rounded",onClick:a,"data-for":"tooltip","data-tip":s("download this edition")},c.default.createElement(p.Icon,{isSize:"small",isAlign:"left",className:"fa fa-download"})),c.default.createElement(p.Button,{className:"is-rounded",onClick:()=>{window.frames.preview.focus(),window.frames.preview.print()},"data-for":"tooltip","data-tip":s("print this edition")},c.default.createElement(p.Icon,{isSize:"small",isAlign:"left",className:"fa fa-print"}))))})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(2836),o=(r=i)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=u(r),o=n(127),a=n(14),s=u(n(1156));function u(e){return e&&e.__esModule?e:{default:e}}const l=window.location.href.includes("ovide")?`${window.location.href.split("ovide")[0]}ovide/`:`${window.location.href.split("/").slice(0,3).join("/")}/`;t.default=class extends r.Component{constructor(e){super(e),this.update=(()=>{let e=this.renderer.contentDocument.body.children[0].innerHTML;const t=/([\w\W\n]*)<\/style>/gm;let n,r="";for(;null!==(n=t.exec(e));)r+=n[1],e=e.slice(0,n.index)+e.slice(n.index+n[0].length),n.index=-1;const{additionalHTML:i}=this.props,a=`\n \n\n \n \n \n \n PagedJS previewer\n \n${i}\n\x3c!-- toaster lib --\x3e\n\n