@clickview/curator 1.0.32-rc.0 → 1.0.32-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,4 +14,4 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,m=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,b=r?Symbol.for("react.block"):60121,g=r?Symbol.for("react.fundamental"):60117,S=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function O(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case f:case p:case o:case s:case c:case m:return e;default:switch(e=e&&e.$$typeof){case l:case d:case v:case y:case u:return e;default:return t}}case a:return t}}}function C(e){return O(e)===p}t.AsyncMode=f,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=u,t.Element=i,t.ForwardRef=d,t.Fragment=o,t.Lazy=v,t.Memo=y,t.Portal=a,t.Profiler=s,t.StrictMode=c,t.Suspense=m,t.isAsyncMode=function(e){return C(e)||O(e)===f},t.isConcurrentMode=C,t.isContextConsumer=function(e){return O(e)===l},t.isContextProvider=function(e){return O(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return O(e)===d},t.isFragment=function(e){return O(e)===o},t.isLazy=function(e){return O(e)===v},t.isMemo=function(e){return O(e)===y},t.isPortal=function(e){return O(e)===a},t.isProfiler=function(e){return O(e)===s},t.isStrictMode=function(e){return O(e)===c},t.isSuspense=function(e){return O(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===p||e===s||e===c||e===m||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===y||e.$$typeof===u||e.$$typeof===l||e.$$typeof===d||e.$$typeof===g||e.$$typeof===S||e.$$typeof===E||e.$$typeof===b)},t.typeOf=O},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),o=f(a),c=f(n(39)),s=f(n(228)),u=f(n(229)),l=n(237);function f(e){return e&&e.__esModule?e:{default:e}}var p=function(){return!0},d=function(e){function t(e){var n=e.alwaysRenderSuggestions;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return m.call(r),r.state={isFocused:!1,isCollapsed:!n,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null},r.justPressedUpDown=!1,r.justMouseEntered=!1,r.pressedSuggestion=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown),document.addEventListener("mouseup",this.onDocumentMouseUp),this.input=this.autowhatever.input,this.suggestionsContainer=this.autowhatever.itemsContainer}},{key:"componentWillReceiveProps",value:function(e){(0,s.default)(e.suggestions,this.props.suggestions)?e.highlightFirstSuggestion&&e.suggestions.length>0&&!1===this.justPressedUpDown&&!1===this.justMouseEntered&&this.highlightFirstSuggestion():this.willRenderSuggestions(e)?this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions():this.resetHighlightedSuggestion()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.suggestions,i=n.onSuggestionHighlighted,a=n.highlightFirstSuggestion;if(!(0,s.default)(r,e.suggestions)&&r.length>0&&a)this.highlightFirstSuggestion();else if(i){var o=this.getHighlightedSuggestion();o!=t.highlightedSuggestion&&i({suggestion:o})}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown),document.removeEventListener("mouseup",this.onDocumentMouseUp)}},{key:"updateHighlightedSuggestion",value:function(e,t,n){var r=this;this.setState((function(i){var a=i.valueBeforeUpDown;return null===t?a=null:null===a&&void 0!==n&&(a=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,highlightedSuggestion:null===t?null:r.getSuggestion(e,t),valueBeforeUpDown:a}}))}},{key:"resetHighlightedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState((function(t){var n=t.valueBeforeUpDown;return{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:e?null:n}}))}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,r=n.suggestions,i=n.multiSection,a=n.getSectionSuggestions;return i?a(r[e])[t]:r[t]}},{key:"getHighlightedSuggestion",value:function(){var e=this.state,t=e.highlightedSectionIndex,n=e.highlightedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){return(0,this.props.getSuggestionValue)(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw console.error("Clicked element:",e),new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var r=this.props.inputProps,i=r.value,a=r.onChange;t!==i&&a(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,r=e.shouldRenderSuggestions,i=n.value;return t.length>0&&r(i)}},{key:"getQuery",value:function(){var e=this.props.inputProps.value,t=this.state.valueBeforeUpDown;return(null===t?e:t).trim()}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,i=t.renderInputComponent,a=t.onSuggestionsFetchRequested,c=t.renderSuggestion,s=t.inputProps,f=t.multiSection,d=t.renderSectionTitle,m=t.id,h=t.getSectionSuggestions,y=t.theme,v=t.getSuggestionValue,b=t.alwaysRenderSuggestions,g=t.highlightFirstSuggestion,S=this.state,E=S.isFocused,O=S.isCollapsed,C=S.highlightedSectionIndex,A=S.highlightedSuggestionIndex,w=S.valueBeforeUpDown,j=b?p:this.props.shouldRenderSuggestions,I=s.value,k=s.onFocus,T=s.onKeyDown,L=this.willRenderSuggestions(this.props),_=b||E&&!O&&L,P=_?n:[],x=r({},s,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=j(I);e.setState({isFocused:!0,isCollapsed:!n}),k&&k(t),n&&a({value:I,reason:"input-focused"})}},onBlur:function(t){e.justClickedOnSuggestionsContainer?e.input.focus():(e.blurEvent=t,e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested()))},onChange:function(t){var n=t.target.value,i=j(n);e.maybeCallOnChange(t,n,"type"),e.suggestionsContainer&&(e.suggestionsContainer.scrollTop=0),e.setState(r({},g?{}:{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null},{valueBeforeUpDown:null,isCollapsed:!i})),i?a({value:n,reason:"input-changed"}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var i=t.keyCode;switch(i){case 40:case 38:if(O)j(I)&&(a({value:I,reason:"suggestions-revealed"}),e.revealSuggestions());else if(n.length>0){var o=r.newHighlightedSectionIndex,c=r.newHighlightedItemIndex,s=void 0;s=null===c?null===w?I:w:e.getSuggestionValueByIndex(o,c),e.updateHighlightedSuggestion(o,c,I),e.maybeCallOnChange(t,s,40===i?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout((function(){e.justPressedUpDown=!1}));break;case 13:if(229===t.keyCode)break;var u=e.getHighlightedSuggestion();if(_&&!b&&e.closeSuggestions(),null!=u){var l=v(u);e.maybeCallOnChange(t,l,"enter"),e.onSuggestionSelected(t,{suggestion:u,suggestionValue:l,suggestionIndex:A,sectionIndex:C,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout((function(){e.justSelectedSuggestion=!1}))}break;case 27:_&&t.preventDefault();var f=_&&!b;if(null===w){if(!f){e.maybeCallOnChange(t,"","escape"),j("")?a({value:"",reason:"escape-pressed"}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,w,"escape");f?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}T&&T(t)}}),N={query:this.getQuery()};return o.default.createElement(u.default,{multiSection:f,items:P,renderInputComponent:i,renderItemsContainer:this.renderSuggestionsContainer,renderItem:c,renderItemData:N,renderSectionTitle:d,getSectionItems:h,highlightedSectionIndex:C,highlightedItemIndex:A,inputProps:x,itemProps:this.itemProps,theme:(0,l.mapToAutowhateverTheme)(y),id:m,ref:this.storeAutowhateverRef})}}]),t}(a.Component);d.propTypes={suggestions:c.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){var n=e[t];if("function"!=typeof n)throw new Error("'onSuggestionsFetchRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsFetchRequestedProp")},onSuggestionsClearRequested:function(e,t){var n=e[t];if(!1===e.alwaysRenderSuggestions&&"function"!=typeof n)throw new Error("'onSuggestionsClearRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsClearRequestedProp")},onSuggestionSelected:c.default.func,onSuggestionHighlighted:c.default.func,renderInputComponent:c.default.func,renderSuggestionsContainer:c.default.func,getSuggestionValue:c.default.func.isRequired,renderSuggestion:c.default.func.isRequired,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'.")},shouldRenderSuggestions:c.default.func,alwaysRenderSuggestions:c.default.bool,multiSection:c.default.bool,renderSectionTitle:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'renderSectionTitle' must be implemented. See: https://github.com/moroshko/react-autosuggest#renderSectionTitleProp")},getSectionSuggestions:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'getSectionSuggestions' must be implemented. See: https://github.com/moroshko/react-autosuggest#getSectionSuggestionsProp")},focusInputOnSuggestionClick:c.default.bool,highlightFirstSuggestion:c.default.bool,theme:c.default.object,id:c.default.string},d.defaultProps={renderSuggestionsContainer:function(e){var t=e.containerProps,n=e.children;return o.default.createElement("div",t,n)},shouldRenderSuggestions:function(e){return e.trim().length>0},alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:l.defaultTheme,id:"1"};var m=function(){var e=this;this.onDocumentMouseDown=function(t){e.justClickedOnSuggestionsContainer=!1;for(var n=t.detail&&t.detail.target||t.target;null!==n&&n!==document;){if(null!==n.getAttribute("data-suggestion-index"))return;if(n===e.suggestionsContainer)return void(e.justClickedOnSuggestionsContainer=!0);n=n.parentNode}},this.storeAutowhateverRef=function(t){null!==t&&(e.autowhatever=t)},this.onSuggestionMouseEnter=function(t,n){var r=n.sectionIndex,i=n.itemIndex;e.updateHighlightedSuggestion(r,i),t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!0),e.justMouseEntered=!0,setTimeout((function(){e.justMouseEntered=!1}))},this.highlightFirstSuggestion=function(){e.updateHighlightedSuggestion(e.props.multiSection?0:null,0)},this.onDocumentMouseUp=function(){e.pressedSuggestion&&!e.justSelectedSuggestion&&e.input.focus(),e.pressedSuggestion=null},this.onSuggestionMouseDown=function(t){e.justSelectedSuggestion||(e.justSelectedSuggestion=!0,e.pressedSuggestion=t.target)},this.onSuggestionsClearRequested=function(){var t=e.props.onSuggestionsClearRequested;t&&t()},this.onSuggestionSelected=function(t,n){var r=e.props,i=r.alwaysRenderSuggestions,a=r.onSuggestionSelected,o=r.onSuggestionsFetchRequested;a&&a(t,n),i?o({value:n.suggestionValue,reason:"suggestion-selected"}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,r=n.alwaysRenderSuggestions,i=n.focusInputOnSuggestionClick,a=e.getSuggestionIndices(e.findSuggestionElement(t.target)),o=a.sectionIndex,c=a.suggestionIndex,s=e.getSuggestion(o,c),u=e.props.getSuggestionValue(s);e.maybeCallOnChange(t,u,"click"),e.onSuggestionSelected(t,{suggestion:s,suggestionValue:u,suggestionIndex:c,sectionIndex:o,method:"click"}),r||e.closeSuggestions(),!0===i?e.input.focus():e.onBlur(),setTimeout((function(){e.justSelectedSuggestion=!1}))},this.onBlur=function(){var t=e.props,n=t.inputProps,r=t.shouldRenderSuggestions,i=n.value,a=n.onBlur,o=e.getHighlightedSuggestion(),c=r(i);e.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!c}),a&&a(e.blurEvent,{highlightedSuggestion:o})},this.onSuggestionMouseLeave=function(t){e.resetHighlightedSuggestion(!1),e.justSelectedSuggestion&&t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!1)},this.onSuggestionTouchStart=function(){e.justSelectedSuggestion=!0},this.onSuggestionTouchMove=function(){e.justSelectedSuggestion=!1,e.pressedSuggestion=null,e.input.focus()},this.itemProps=function(t){return{"data-section-index":t.sectionIndex,"data-suggestion-index":t.itemIndex,onMouseEnter:e.onSuggestionMouseEnter,onMouseLeave:e.onSuggestionMouseLeave,onMouseDown:e.onSuggestionMouseDown,onTouchStart:e.onSuggestionTouchStart,onTouchMove:e.onSuggestionTouchMove,onClick:e.onSuggestionClick}},this.renderSuggestionsContainer=function(t){var n=t.containerProps,r=t.children;return(0,e.props.renderSuggestionsContainer)({containerProps:n,children:r,query:e.getQuery()})}};t.default=d},function(e,t,n){"use strict";var r=n(227);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}},function(e,t,n){"use strict";e.exports=n(230).default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),c=d(o),s=d(n(39)),u=d(n(231)),l=d(n(232)),f=d(n(234)),p=d(n(235));function d(e){return e&&e.__esModule?e:{default:e}}var m={},h=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.storeInputReference=function(e){null!==e&&(n.input=e)},n.storeItemsContainerReference=function(e){null!==e&&(n.itemsContainer=e)},n.onHighlightedItemChange=function(e){n.highlightedItem=e},n.getItemId=function(e,t){return null===t?null:"react-autowhatever-"+n.props.id+"-"+(null===e?"":"section-"+e)+"-item-"+t},n.onFocus=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!0}),t.onFocus&&t.onFocus(e)},n.onBlur=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!1}),t.onBlur&&t.onBlur(e)},n.onKeyDown=function(e){var t=n.props,r=t.inputProps,a=t.highlightedSectionIndex,o=t.highlightedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var c="ArrowDown"===e.key?"next":"prev",s=n.sectionIterator[c]([a,o]),u=i(s,2),l=u[0],f=u[1];r.onKeyDown(e,{newHighlightedSectionIndex:l,newHighlightedItemIndex:f});break;default:r.onKeyDown(e,{highlightedSectionIndex:a,highlightedItemIndex:o})}},n.highlightedItem=null,n.state={isInputFocused:!1},n.setSectionsItems(e),n.setSectionIterator(e),n.setTheme(e),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"componentDidMount",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.items!==this.props.items&&this.setSectionsItems(e),e.items===this.props.items&&e.multiSection===this.props.multiSection||this.setSectionIterator(e),e.theme!==this.props.theme&&this.setTheme(e)}},{key:"componentDidUpdate",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"setSectionsItems",value:function(e){e.multiSection&&(this.sectionsItems=e.items.map((function(t){return e.getSectionItems(t)})),this.sectionsLengths=this.sectionsItems.map((function(e){return e.length})),this.allSectionsAreEmpty=this.sectionsLengths.every((function(e){return 0===e})))}},{key:"setSectionIterator",value:function(e){this.sectionIterator=(0,u.default)({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,l.default)(e.theme)}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,r=n.id,i=n.items,a=n.renderItem,o=n.renderItemData,s=n.renderSectionTitle,u=n.highlightedSectionIndex,l=n.highlightedItemIndex,d=n.itemProps;return i.map((function(n,i){var m="react-autowhatever-"+r+"-",h=m+"section-"+i+"-",y=0===i;return c.default.createElement("div",t(h+"container","sectionContainer",y&&"sectionContainerFirst"),c.default.createElement(f.default,{section:n,renderSectionTitle:s,theme:t,sectionKeyPrefix:h}),c.default.createElement(p.default,{items:e.sectionsItems[i],itemProps:d,renderItem:a,renderItemData:o,sectionIndex:i,highlightedItemIndex:u===i?l:null,onHighlightedItemChange:e.onHighlightedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:m,ref:e.storeItemsListReference}))}))}},{key:"renderItems",value:function(){var e=this.props.items;if(0===e.length)return null;var t=this.theme,n=this.props,r=n.id,i=n.renderItem,a=n.renderItemData,o=n.highlightedSectionIndex,s=n.highlightedItemIndex,u=n.itemProps;return c.default.createElement(p.default,{items:e,itemProps:u,renderItem:i,renderItemData:a,highlightedItemIndex:null===o?s:null,onHighlightedItemChange:this.onHighlightedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-"+r+"-"})}},{key:"ensureHighlightedItemIsVisible",value:function(){var e=this.highlightedItem;if(e){var t=this.itemsContainer,n=e.offsetParent===t?e.offsetTop:e.offsetTop-t.offsetTop,r=t.scrollTop;n<r?r=n:n+e.offsetHeight>r+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,i=t.multiSection,a=t.renderInputComponent,o=t.renderItemsContainer,s=t.highlightedSectionIndex,u=t.highlightedItemIndex,l=this.state.isInputFocused,f=i?this.renderSections():this.renderItems(),p=null!==f,d=this.getItemId(s,u),m="react-autowhatever-"+n,h=r({role:"combobox","aria-haspopup":"listbox","aria-owns":m,"aria-expanded":p},e("react-autowhatever-"+n+"-container","container",p&&"containerOpen"),this.props.containerProps),y=a(r({type:"text",value:"",autoComplete:"off","aria-autocomplete":"list","aria-controls":m,"aria-activedescendant":d},e("react-autowhatever-"+n+"-input","input",p&&"inputOpen",l&&"inputFocused"),this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),v=o({containerProps:r({id:m,role:"listbox"},e("react-autowhatever-"+n+"-items-container","itemsContainer",p&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:f});return c.default.createElement("div",h,y,v)}}]),t}(o.Component);h.propTypes={id:s.default.string,multiSection:s.default.bool,renderInputComponent:s.default.func,renderItemsContainer:s.default.func,items:s.default.array.isRequired,renderItem:s.default.func,renderItemData:s.default.object,renderSectionTitle:s.default.func,getSectionItems:s.default.func,containerProps:s.default.object,inputProps:s.default.object,itemProps:s.default.oneOfType([s.default.object,s.default.func]),highlightedSectionIndex:s.default.number,highlightedItemIndex:s.default.number,theme:s.default.oneOfType([s.default.object,s.default.array])},h.defaultProps={id:"1",multiSection:!1,renderInputComponent:function(e){return c.default.createElement("input",e)},renderItemsContainer:function(e){var t=e.containerProps,n=e.children;return c.default.createElement("div",t,n)},renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:m,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},containerProps:m,inputProps:m,itemProps:m,highlightedSectionIndex:null,highlightedItemIndex:null,theme:{container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",inputOpen:"react-autowhatever__input--open",inputFocused:"react-autowhatever__input--focused",itemsContainer:"react-autowhatever__items-container",itemsContainerOpen:"react-autowhatever__items-container--open",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemFirst:"react-autowhatever__item--first",itemHighlighted:"react-autowhatever__item--highlighted",sectionContainer:"react-autowhatever__section-container",sectionContainerFirst:"react-autowhatever__section-container--first",sectionTitle:"react-autowhatever__section-title"}},t.default=h},function(e,t,n){"use strict";var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.exports=function(e){var t=e.data,n=e.multiSection;function i(e){var i=r(e,2),a=i[0],o=i[1];return n?null===o||o===t[a]-1?null===(a=function(e){for(null===e?e=0:e++;e<t.length&&0===t[e];)e++;return e===t.length?null:e}(a))?[null,null]:[a,0]:[a,o+1]:0===t||o===t-1?[null,null]:null===o?[null,0]:[null,o+1]}return{next:i,prev:function(e){var i=r(e,2),a=i[0],o=i[1];return n?null===o||0===o?null===(a=function(e){for(null===e?e=t.length-1:e--;e>=0&&0===t[e];)e--;return-1===e?null:e}(a))?[null,null]:[a,t[a]-1]:[a,o-1]:0===t||0===o?[null,null]:null===o?[null,t-1]:[null,o-1]},isLast:function(e){return null===i(e)[1]}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var a,o=n(233),c=(a=o)&&a.__esModule?a:{default:a},s=function(e){return e};t.default=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=r(t,2),a=n[0],o=n[1];return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var u=n.map((function(e){return a[e]})).filter(s);return"string"==typeof u[0]||"function"==typeof o?{key:e,className:o?o.apply(void 0,i(u)):u.join(" ")}:{key:e,style:c.default.apply(void 0,[{}].concat(i(u)))}}},e.exports=t.default},function(e,t,n){"use strict";var r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function a(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter((function(t){return r.call(e,t)}))}e.exports=Object.assign||function(e,t){for(var n,r,o=i(e),c=1;c<arguments.length;c++){n=arguments[c],r=a(Object(n));for(var s=0;s<r.length;s++)o[r[s]]=n[r[s]]}return o}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=s(i),o=s(n(39)),c=s(n(58));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var f=function(e){function t(){return u(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"shouldComponentUpdate",value:function(e){return(0,c.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,r=e.theme,i=e.sectionKeyPrefix,o=n(t);return o?a.default.createElement("div",r(i+"title","sectionTitle"),o):null}}]),t}(i.Component);f.propTypes={section:o.default.any.isRequired,renderSectionTitle:o.default.func.isRequired,theme:o.default.func.isRequired,sectionKeyPrefix:o.default.string.isRequired},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),o=l(a),c=l(n(39)),s=l(n(236)),u=l(n(58));function l(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=function(e){function t(){var e,n,r;f(this,t);for(var i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r=p(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.storeHighlightedItemReference=function(e){r.props.onHighlightedItemChange(null===e?null:e.item)},p(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"shouldComponentUpdate",value:function(e){return(0,u.default)(e,this.props,["itemProps"])}},{key:"render",value:function(){var e=this,t=this.props,n=t.items,i=t.itemProps,a=t.renderItem,c=t.renderItemData,u=t.sectionIndex,l=t.highlightedItemIndex,f=t.getItemId,p=t.theme,d=t.keyPrefix,m=null===u?d:d+"section-"+u+"-",h="function"==typeof i;return o.default.createElement("ul",r({role:"listbox"},p(m+"items-list","itemsList")),n.map((function(t,n){var d=0===n,y=n===l,v=m+"item-"+n,b=h?i({sectionIndex:u,itemIndex:n}):i,g=r({id:f(u,n),"aria-selected":y},p(v,"item",d&&"itemFirst",y&&"itemHighlighted"),b);return y&&(g.ref=e.storeHighlightedItemReference),o.default.createElement(s.default,r({},g,{sectionIndex:u,isHighlighted:y,itemIndex:n,item:t,renderItem:a,renderItemData:c}))})))}}]),t}(a.Component);d.propTypes={items:c.default.array.isRequired,itemProps:c.default.oneOfType([c.default.object,c.default.func]),renderItem:c.default.func.isRequired,renderItemData:c.default.object.isRequired,sectionIndex:c.default.number,highlightedItemIndex:c.default.number,onHighlightedItemChange:c.default.func.isRequired,getItemId:c.default.func.isRequired,theme:c.default.func.isRequired,keyPrefix:c.default.string.isRequired},d.defaultProps={sectionIndex:null},t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),o=u(a),c=u(n(39)),s=u(n(58));function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var p=function(e){function t(){var e,n,r;l(this,t);for(var i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r=f(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.storeItemReference=function(e){null!==e&&(r.item=e)},r.onMouseEnter=function(e){var t=r.props,n=t.sectionIndex,i=t.itemIndex;r.props.onMouseEnter(e,{sectionIndex:n,itemIndex:i})},r.onMouseLeave=function(e){var t=r.props,n=t.sectionIndex,i=t.itemIndex;r.props.onMouseLeave(e,{sectionIndex:n,itemIndex:i})},r.onMouseDown=function(e){var t=r.props,n=t.sectionIndex,i=t.itemIndex;r.props.onMouseDown(e,{sectionIndex:n,itemIndex:i})},r.onClick=function(e){var t=r.props,n=t.sectionIndex,i=t.itemIndex;r.props.onClick(e,{sectionIndex:n,itemIndex:i})},f(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"shouldComponentUpdate",value:function(e){return(0,s.default)(e,this.props,["renderItemData"])}},{key:"render",value:function(){var e=this.props,t=e.isHighlighted,n=e.item,i=e.renderItem,a=e.renderItemData,c=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["isHighlighted","item","renderItem","renderItemData"]);return delete c.sectionIndex,delete c.itemIndex,"function"==typeof c.onMouseEnter&&(c.onMouseEnter=this.onMouseEnter),"function"==typeof c.onMouseLeave&&(c.onMouseLeave=this.onMouseLeave),"function"==typeof c.onMouseDown&&(c.onMouseDown=this.onMouseDown),"function"==typeof c.onClick&&(c.onClick=this.onClick),o.default.createElement("li",r({role:"option"},c,{ref:this.storeItemReference}),i(n,r({isHighlighted:t},a)))}}]),t}(a.Component);p.propTypes={sectionIndex:c.default.number,isHighlighted:c.default.bool.isRequired,itemIndex:c.default.number.isRequired,item:c.default.any.isRequired,renderItem:c.default.func.isRequired,renderItemData:c.default.object.isRequired,onMouseEnter:c.default.func,onMouseLeave:c.default.func,onMouseDown:c.default.func,onClick:c.default.func},t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultTheme={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",inputOpen:"react-autosuggest__input--open",inputFocused:"react-autosuggest__input--focused",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsContainerOpen:"react-autosuggest__suggestions-container--open",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFirst:"react-autosuggest__suggestion--first",suggestionHighlighted:"react-autosuggest__suggestion--highlighted",sectionContainer:"react-autosuggest__section-container",sectionContainerFirst:"react-autosuggest__section-container--first",sectionTitle:"react-autosuggest__section-title"},t.mapToAutowhateverTheme=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestionsContainerOpen":t.itemsContainerOpen=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFirst":t.itemFirst=e[n];break;case"suggestionHighlighted":t.itemHighlighted=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t}},function(e,t,n){"use strict";t.__esModule=!0;var r=function(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}(n(239));var i=r.tokenize,a=r.options.Options;function o(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function c(e){return e.replace(/"/g,"&quot;")}function s(e){if(!e)return"";var t=[];for(var n in e){var r=e[n]+"";t.push(n+'="'+c(r)+'"')}return t.join(" ")}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=new a(t);for(var n=i(e),r=[],u=0;u<n.length;u++){var l=n[u];if("nl"===l.type&&t.nl2br)r.push("<br>\n");else if(l.isLink&&t.check(l)){var f=t.resolve(l),p=f.formatted,d=f.formattedHref,m=f.tagName,h=f.className,y=f.target,v=f.attributes,b="<"+m+' href="'+c(d)+'"';h&&(b+=' class="'+c(h)+'"'),y&&(b+=' target="'+c(y)+'"'),v&&(b+=" "+s(v)),b+=">"+o(p)+"</"+m+">",r.push(b)}else r.push(o(l.toString()))}return r.join("")}if(!String.prototype.linkify)try{Object.defineProperty(String.prototype,"linkify",{set:function(){},get:function(){return function(e){return u(this,e)}}})}catch(e){String.prototype.linkify||(String.prototype.linkify=function(e){return u(this,e)})}t.default=u},function(e,t,n){"use strict";t.__esModule=!0,t.tokenize=t.test=t.scanner=t.parser=t.options=t.inherits=t.find=void 0;var r=n(43),i=c(n(240)),a=c(n(241)),o=c(n(242));function c(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}Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var s=function(e){return o.run(a.run(e))};t.find=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=s(e),r=[],i=0;i<n.length;i++){var a=n[i];!a.isLink||t&&a.type!==t||r.push(a.toObject())}return r},t.inherits=r.inherits,t.options=i,t.parser=o,t.scanner=a,t.test=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=s(e);return 1===n.length&&n[0].isLink&&(!t||n[0].type===t)},t.tokenize=s},function(e,t,n){"use strict";t.__esModule=!0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i={defaultProtocol:"http",events:null,format:o,formatHref:o,nl2br:!1,tagName:"a",target:function(e,t){return"url"===t?"_blank":null},validate:!0,ignoreTags:[],attributes:null,className:"linkified"};function a(e){e=e||{},this.defaultProtocol=e.hasOwnProperty("defaultProtocol")?e.defaultProtocol:i.defaultProtocol,this.events=e.hasOwnProperty("events")?e.events:i.events,this.format=e.hasOwnProperty("format")?e.format:i.format,this.formatHref=e.hasOwnProperty("formatHref")?e.formatHref:i.formatHref,this.nl2br=e.hasOwnProperty("nl2br")?e.nl2br:i.nl2br,this.tagName=e.hasOwnProperty("tagName")?e.tagName:i.tagName,this.target=e.hasOwnProperty("target")?e.target:i.target,this.validate=e.hasOwnProperty("validate")?e.validate:i.validate,this.ignoreTags=[],this.attributes=e.attributes||e.linkAttributes||i.attributes,this.className=e.hasOwnProperty("className")?e.className:e.linkClass||i.className;for(var t=e.hasOwnProperty("ignoreTags")?e.ignoreTags:i.ignoreTags,n=0;n<t.length;n++)this.ignoreTags.push(t[n].toUpperCase())}function o(e){return e}t.defaults=i,t.Options=a,t.contains=function(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return!0;return!1},a.prototype={resolve:function(e){var t=e.toHref(this.defaultProtocol);return{formatted:this.get("format",e.toString(),e),formattedHref:this.get("formatHref",t,e),tagName:this.get("tagName",t,e),className:this.get("className",t,e),target:this.get("target",t,e),events:this.getObject("events",t,e),attributes:this.getObject("attributes",t,e)}},check:function(e){return this.get("validate",e.toString(),e)},get:function(e,t,n){var a=void 0,o=this[e];if(!o)return o;switch(void 0===o?"undefined":r(o)){case"function":return o(t,n.type);case"object":return"function"==typeof(a=o.hasOwnProperty(n.type)?o[n.type]:i[e])?a(t,n.type):a}return o},getObject:function(e,t,n){var r=this[e];return"function"==typeof r?r(t,n.type):r}}},function(e,t,n){"use strict";t.__esModule=!0,t.start=t.run=t.TOKENS=t.State=void 0;var r=n(195),i=n(59),a=function(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}(i);var o="aaa|aarp|abarth|abb|abbott|abbvie|abc|able|abogado|abudhabi|ac|academy|accenture|accountant|accountants|aco|active|actor|ad|adac|ads|adult|ae|aeg|aero|aetna|af|afamilycompany|afl|africa|ag|agakhan|agency|ai|aig|aigo|airbus|airforce|airtel|akdn|al|alfaromeo|alibaba|alipay|allfinanz|allstate|ally|alsace|alstom|am|americanexpress|americanfamily|amex|amfam|amica|amsterdam|analytics|android|anquan|anz|ao|aol|apartments|app|apple|aq|aquarelle|ar|arab|aramco|archi|army|arpa|art|arte|as|asda|asia|associates|at|athleta|attorney|au|auction|audi|audible|audio|auspost|author|auto|autos|avianca|aw|aws|ax|axa|az|azure|ba|baby|baidu|banamex|bananarepublic|band|bank|bar|barcelona|barclaycard|barclays|barefoot|bargains|baseball|basketball|bauhaus|bayern|bb|bbc|bbt|bbva|bcg|bcn|bd|be|beats|beauty|beer|bentley|berlin|best|bestbuy|bet|bf|bg|bh|bharti|bi|bible|bid|bike|bing|bingo|bio|biz|bj|black|blackfriday|blanco|blockbuster|blog|bloomberg|blue|bm|bms|bmw|bn|bnl|bnpparibas|bo|boats|boehringer|bofa|bom|bond|boo|book|booking|boots|bosch|bostik|boston|bot|boutique|box|br|bradesco|bridgestone|broadway|broker|brother|brussels|bs|bt|budapest|bugatti|build|builders|business|buy|buzz|bv|bw|by|bz|bzh|ca|cab|cafe|cal|call|calvinklein|cam|camera|camp|cancerresearch|canon|capetown|capital|capitalone|car|caravan|cards|care|career|careers|cars|cartier|casa|case|caseih|cash|casino|cat|catering|catholic|cba|cbn|cbre|cbs|cc|cd|ceb|center|ceo|cern|cf|cfa|cfd|cg|ch|chanel|channel|chase|chat|cheap|chintai|chloe|christmas|chrome|chrysler|church|ci|cipriani|circle|cisco|citadel|citi|citic|city|cityeats|ck|cl|claims|cleaning|click|clinic|clinique|clothing|cloud|club|clubmed|cm|cn|co|coach|codes|coffee|college|cologne|com|comcast|commbank|community|company|compare|computer|comsec|condos|construction|consulting|contact|contractors|cooking|cookingchannel|cool|coop|corsica|country|coupon|coupons|courses|cr|credit|creditcard|creditunion|cricket|crown|crs|cruise|cruises|csc|cu|cuisinella|cv|cw|cx|cy|cymru|cyou|cz|dabur|dad|dance|data|date|dating|datsun|day|dclk|dds|de|deal|dealer|deals|degree|delivery|dell|deloitte|delta|democrat|dental|dentist|desi|design|dev|dhl|diamonds|diet|digital|direct|directory|discount|discover|dish|diy|dj|dk|dm|dnp|do|docs|doctor|dodge|dog|doha|domains|dot|download|drive|dtv|dubai|duck|dunlop|duns|dupont|durban|dvag|dvr|dz|earth|eat|ec|eco|edeka|edu|education|ee|eg|email|emerck|energy|engineer|engineering|enterprises|epost|epson|equipment|er|ericsson|erni|es|esq|estate|esurance|et|etisalat|eu|eurovision|eus|events|everbank|exchange|expert|exposed|express|extraspace|fage|fail|fairwinds|faith|family|fan|fans|farm|farmers|fashion|fast|fedex|feedback|ferrari|ferrero|fi|fiat|fidelity|fido|film|final|finance|financial|fire|firestone|firmdale|fish|fishing|fit|fitness|fj|fk|flickr|flights|flir|florist|flowers|fly|fm|fo|foo|food|foodnetwork|football|ford|forex|forsale|forum|foundation|fox|fr|free|fresenius|frl|frogans|frontdoor|frontier|ftr|fujitsu|fujixerox|fun|fund|furniture|futbol|fyi|ga|gal|gallery|gallo|gallup|game|games|gap|garden|gb|gbiz|gd|gdn|ge|gea|gent|genting|george|gf|gg|ggee|gh|gi|gift|gifts|gives|giving|gl|glade|glass|gle|global|globo|gm|gmail|gmbh|gmo|gmx|gn|godaddy|gold|goldpoint|golf|goo|goodhands|goodyear|goog|google|gop|got|gov|gp|gq|gr|grainger|graphics|gratis|green|gripe|grocery|group|gs|gt|gu|guardian|gucci|guge|guide|guitars|guru|gw|gy|hair|hamburg|hangout|haus|hbo|hdfc|hdfcbank|health|healthcare|help|helsinki|here|hermes|hgtv|hiphop|hisamitsu|hitachi|hiv|hk|hkt|hm|hn|hockey|holdings|holiday|homedepot|homegoods|homes|homesense|honda|honeywell|horse|hospital|host|hosting|hot|hoteles|hotels|hotmail|house|how|hr|hsbc|ht|htc|hu|hughes|hyatt|hyundai|ibm|icbc|ice|icu|id|ie|ieee|ifm|ikano|il|im|imamat|imdb|immo|immobilien|in|industries|infiniti|info|ing|ink|institute|insurance|insure|int|intel|international|intuit|investments|io|ipiranga|iq|ir|irish|is|iselect|ismaili|ist|istanbul|it|itau|itv|iveco|iwc|jaguar|java|jcb|jcp|je|jeep|jetzt|jewelry|jio|jlc|jll|jm|jmp|jnj|jo|jobs|joburg|jot|joy|jp|jpmorgan|jprs|juegos|juniper|kaufen|kddi|ke|kerryhotels|kerrylogistics|kerryproperties|kfh|kg|kh|ki|kia|kim|kinder|kindle|kitchen|kiwi|km|kn|koeln|komatsu|kosher|kp|kpmg|kpn|kr|krd|kred|kuokgroup|kw|ky|kyoto|kz|la|lacaixa|ladbrokes|lamborghini|lamer|lancaster|lancia|lancome|land|landrover|lanxess|lasalle|lat|latino|latrobe|law|lawyer|lb|lc|lds|lease|leclerc|lefrak|legal|lego|lexus|lgbt|li|liaison|lidl|life|lifeinsurance|lifestyle|lighting|like|lilly|limited|limo|lincoln|linde|link|lipsy|live|living|lixil|lk|loan|loans|locker|locus|loft|lol|london|lotte|lotto|love|lpl|lplfinancial|lr|ls|lt|ltd|ltda|lu|lundbeck|lupin|luxe|luxury|lv|ly|ma|macys|madrid|maif|maison|makeup|man|management|mango|map|market|marketing|markets|marriott|marshalls|maserati|mattel|mba|mc|mckinsey|md|me|med|media|meet|melbourne|meme|memorial|men|menu|meo|merckmsd|metlife|mg|mh|miami|microsoft|mil|mini|mint|mit|mitsubishi|mk|ml|mlb|mls|mm|mma|mn|mo|mobi|mobile|mobily|moda|moe|moi|mom|monash|money|monster|mopar|mormon|mortgage|moscow|moto|motorcycles|mov|movie|movistar|mp|mq|mr|ms|msd|mt|mtn|mtr|mu|museum|mutual|mv|mw|mx|my|mz|na|nab|nadex|nagoya|name|nationwide|natura|navy|nba|nc|ne|nec|net|netbank|netflix|network|neustar|new|newholland|news|next|nextdirect|nexus|nf|nfl|ng|ngo|nhk|ni|nico|nike|nikon|ninja|nissan|nissay|nl|no|nokia|northwesternmutual|norton|now|nowruz|nowtv|np|nr|nra|nrw|ntt|nu|nyc|nz|obi|observer|off|office|okinawa|olayan|olayangroup|oldnavy|ollo|om|omega|one|ong|onl|online|onyourside|ooo|open|oracle|orange|org|organic|origins|osaka|otsuka|ott|ovh|pa|page|panasonic|panerai|paris|pars|partners|parts|party|passagens|pay|pccw|pe|pet|pf|pfizer|pg|ph|pharmacy|phd|philips|phone|photo|photography|photos|physio|piaget|pics|pictet|pictures|pid|pin|ping|pink|pioneer|pizza|pk|pl|place|play|playstation|plumbing|plus|pm|pn|pnc|pohl|poker|politie|porn|post|pr|pramerica|praxi|press|prime|pro|prod|productions|prof|progressive|promo|properties|property|protection|pru|prudential|ps|pt|pub|pw|pwc|py|qa|qpon|quebec|quest|qvc|racing|radio|raid|re|read|realestate|realtor|realty|recipes|red|redstone|redumbrella|rehab|reise|reisen|reit|reliance|ren|rent|rentals|repair|report|republican|rest|restaurant|review|reviews|rexroth|rich|richardli|ricoh|rightathome|ril|rio|rip|rmit|ro|rocher|rocks|rodeo|rogers|room|rs|rsvp|ru|rugby|ruhr|run|rw|rwe|ryukyu|sa|saarland|safe|safety|sakura|sale|salon|samsclub|samsung|sandvik|sandvikcoromant|sanofi|sap|sapo|sarl|sas|save|saxo|sb|sbi|sbs|sc|sca|scb|schaeffler|schmidt|scholarships|school|schule|schwarz|science|scjohnson|scor|scot|sd|se|search|seat|secure|security|seek|select|sener|services|ses|seven|sew|sex|sexy|sfr|sg|sh|shangrila|sharp|shaw|shell|shia|shiksha|shoes|shop|shopping|shouji|show|showtime|shriram|si|silk|sina|singles|site|sj|sk|ski|skin|sky|skype|sl|sling|sm|smart|smile|sn|sncf|so|soccer|social|softbank|software|sohu|solar|solutions|song|sony|soy|space|spiegel|spot|spreadbetting|sr|srl|srt|st|stada|staples|star|starhub|statebank|statefarm|statoil|stc|stcgroup|stockholm|storage|store|stream|studio|study|style|su|sucks|supplies|supply|support|surf|surgery|suzuki|sv|swatch|swiftcover|swiss|sx|sy|sydney|symantec|systems|sz|tab|taipei|talk|taobao|target|tatamotors|tatar|tattoo|tax|taxi|tc|tci|td|tdk|team|tech|technology|tel|telecity|telefonica|temasek|tennis|teva|tf|tg|th|thd|theater|theatre|tiaa|tickets|tienda|tiffany|tips|tires|tirol|tj|tjmaxx|tjx|tk|tkmaxx|tl|tm|tmall|tn|to|today|tokyo|tools|top|toray|toshiba|total|tours|town|toyota|toys|tr|trade|trading|training|travel|travelchannel|travelers|travelersinsurance|trust|trv|tt|tube|tui|tunes|tushu|tv|tvs|tw|tz|ua|ubank|ubs|uconnect|ug|uk|unicom|university|uno|uol|ups|us|uy|uz|va|vacations|vana|vanguard|vc|ve|vegas|ventures|verisign|versicherung|vet|vg|vi|viajes|video|vig|viking|villas|vin|vip|virgin|visa|vision|vista|vistaprint|viva|vivo|vlaanderen|vn|vodka|volkswagen|volvo|vote|voting|voto|voyage|vu|vuelos|wales|walmart|walter|wang|wanggou|warman|watch|watches|weather|weatherchannel|webcam|weber|website|wed|wedding|weibo|weir|wf|whoswho|wien|wiki|williamhill|win|windows|wine|winners|wme|wolterskluwer|woodside|work|works|world|wow|ws|wtc|wtf|xbox|xerox|xfinity|xihuan|xin|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--30rr7y|xn--3bst00m|xn--3ds443g|xn--3e0b707e|xn--3hcrj9c|xn--3oq18vl8pn36a|xn--3pxu8k|xn--42c2d9a|xn--45br5cyl|xn--45brj9c|xn--45q11c|xn--4gbrim|xn--54b7fta0cc|xn--55qw42g|xn--55qx5d|xn--5su34j936bgsg|xn--5tzm5g|xn--6frz82g|xn--6qq986b3xl|xn--80adxhks|xn--80ao21a|xn--80aqecdr1a|xn--80asehdb|xn--80aswg|xn--8y0a063a|xn--90a3ac|xn--90ae|xn--90ais|xn--9dbq2a|xn--9et52u|xn--9krt00a|xn--b4w605ferd|xn--bck1b9a5dre4c|xn--c1avg|xn--c2br7g|xn--cck2b3b|xn--cg4bki|xn--clchc0ea0b2g2a9gcd|xn--czr694b|xn--czrs0t|xn--czru2d|xn--d1acj3b|xn--d1alf|xn--e1a4c|xn--eckvdtc9d|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fhbei|xn--fiq228c5hs|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--fjq720a|xn--flw351e|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--fzys8d69uvgm|xn--g2xx48c|xn--gckr3f0f|xn--gecrj9c|xn--gk3at1e|xn--h2breg3eve|xn--h2brj9c|xn--h2brj9c8c|xn--hxt814e|xn--i1b6b1a6a2e|xn--imr513n|xn--io0a7i|xn--j1aef|xn--j1amh|xn--j6w193g|xn--jlq61u9w7b|xn--jvr189m|xn--kcrx77d1x4a|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--kput3i|xn--l1acc|xn--lgbbat1ad8j|xn--mgb9awbf|xn--mgba3a3ejt|xn--mgba3a4f16a|xn--mgba7c0bbn0a|xn--mgbaakc7dvf|xn--mgbaam7a8h|xn--mgbab2bd|xn--mgbai9azgqp6j|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a|xn--mgbbh1a71e|xn--mgbc0a9azcg|xn--mgbca7dzdo|xn--mgberp4a5d4ar|xn--mgbgu82a|xn--mgbi4ecexp|xn--mgbpl2fh|xn--mgbt3dhd|xn--mgbtx2b|xn--mgbx4cd0ab|xn--mix891f|xn--mk1bu44c|xn--mxtq1m|xn--ngbc5azd|xn--ngbe9e0a|xn--ngbrx|xn--node|xn--nqv7f|xn--nqv7fs00ema|xn--nyqy26a|xn--o3cw4h|xn--ogbpf8fl|xn--p1acf|xn--p1ai|xn--pbt977c|xn--pgbs0dh|xn--pssy2u|xn--q9jyb4c|xn--qcka1pmc|xn--qxam|xn--rhqv96g|xn--rovu88b|xn--rvc1e0am3e|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--tckwe|xn--tiq49xqyj|xn--unup4y|xn--vermgensberater-ctb|xn--vermgensberatung-pwb|xn--vhquv|xn--vuq861b|xn--w4r85el8fhu5dnra|xn--w4rs40l|xn--wgbh1c|xn--wgbl6a|xn--xhq521b|xn--xkc2al3hye2a|xn--xkc2dl3a5ee0h|xn--y9a3aq|xn--yfro4i67o|xn--ygbi2ammx|xn--zfr164b|xperia|xxx|xyz|yachts|yahoo|yamaxun|yandex|ye|yodobashi|yoga|yokohama|you|youtube|yt|yun|za|zappos|zara|zero|zip|zippo|zm|zone|zuerich|zw".split("|"),c="0123456789".split(""),s="0123456789abcdefghijklmnopqrstuvwxyz".split(""),u=[" ","\f","\r","\t","\v"," "," ","᠎"],l=[],f=function(e){return new r.CharacterState(e)},p=f(),d=f(i.NUM),m=f(i.DOMAIN),h=f(),y=f(i.WS);p.on("@",f(i.AT)).on(".",f(i.DOT)).on("+",f(i.PLUS)).on("#",f(i.POUND)).on("?",f(i.QUERY)).on("/",f(i.SLASH)).on("_",f(i.UNDERSCORE)).on(":",f(i.COLON)).on("{",f(i.OPENBRACE)).on("[",f(i.OPENBRACKET)).on("<",f(i.OPENANGLEBRACKET)).on("(",f(i.OPENPAREN)).on("}",f(i.CLOSEBRACE)).on("]",f(i.CLOSEBRACKET)).on(">",f(i.CLOSEANGLEBRACKET)).on(")",f(i.CLOSEPAREN)).on("&",f(i.AMPERSAND)).on([",",";","!",'"',"'"],f(i.PUNCTUATION)),p.on("\n",f(i.NL)).on(u,y),y.on(u,y);for(var v=0;v<o.length;v++){var b=(0,r.stateify)(o[v],p,i.TLD,i.DOMAIN);l.push.apply(l,b)}var g=(0,r.stateify)("file",p,i.DOMAIN,i.DOMAIN),S=(0,r.stateify)("ftp",p,i.DOMAIN,i.DOMAIN),E=(0,r.stateify)("http",p,i.DOMAIN,i.DOMAIN),O=(0,r.stateify)("mailto",p,i.DOMAIN,i.DOMAIN);l.push.apply(l,g),l.push.apply(l,S),l.push.apply(l,E),l.push.apply(l,O);var C=g.pop(),A=S.pop(),w=E.pop(),j=O.pop(),I=f(i.DOMAIN),k=f(i.PROTOCOL),T=f(i.MAILTO);A.on("s",I).on(":",k),w.on("s",I).on(":",k),l.push(I),C.on(":",k),I.on(":",k),j.on(":",T);var L=(0,r.stateify)("localhost",p,i.LOCALHOST,i.DOMAIN);l.push.apply(l,L),p.on(c,d),d.on("-",h).on(c,d).on(s,m),m.on("-",h).on(s,m);for(var _=0;_<l.length;_++)l[_].on("-",h).on(s,m);h.on("-",h).on(c,m).on(s,m),p.defaultTransition=f(i.SYM);var P=p;t.State=r.CharacterState,t.TOKENS=a,t.run=function(e){for(var t=e.replace(/[A-Z]/g,(function(e){return e.toLowerCase()})),n=e.length,r=[],i=0;i<n;){for(var a=p,o=null,c=0,s=null,u=-1;i<n&&(o=a.next(t[i]));)(a=o).accepts()?(u=0,s=a):u>=0&&u++,c++,i++;if(!(u<0)){i-=u,c-=u;var l=s.emit();r.push(new l(e.substr(i-c,c)))}}return r},t.start=P},function(e,t,n){"use strict";t.__esModule=!0,t.start=t.run=t.TOKENS=t.State=void 0;var r=n(195),i=n(243),a=function(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}(i),o=n(59);var c=function(e){return new r.TokenState(e)},s=c(),u=c(),l=c(),f=c(),p=c(),d=c(),m=c(),h=c(i.URL),y=c(),v=c(i.URL),b=c(i.URL),g=c(),S=c(),E=c(),O=c(),C=c(),A=c(i.URL),w=c(i.URL),j=c(i.URL),I=c(i.URL),k=c(),T=c(),L=c(),_=c(),P=c(),x=c(),N=c(i.EMAIL),R=c(),D=c(i.EMAIL),M=c(i.MAILTOEMAIL),U=c(),F=c(),V=c(),B=c(),z=c(i.NL);s.on(o.NL,z).on(o.PROTOCOL,u).on(o.MAILTO,l).on(o.SLASH,f),u.on(o.SLASH,f),f.on(o.SLASH,p),s.on(o.TLD,d).on(o.DOMAIN,d).on(o.LOCALHOST,h).on(o.NUM,d),p.on(o.TLD,b).on(o.DOMAIN,b).on(o.NUM,b).on(o.LOCALHOST,b),d.on(o.DOT,m),P.on(o.DOT,x),m.on(o.TLD,h).on(o.DOMAIN,d).on(o.NUM,d).on(o.LOCALHOST,d),x.on(o.TLD,N).on(o.DOMAIN,P).on(o.NUM,P).on(o.LOCALHOST,P),h.on(o.DOT,m),N.on(o.DOT,x),h.on(o.COLON,y).on(o.SLASH,b),y.on(o.NUM,v),v.on(o.SLASH,b),N.on(o.COLON,R),R.on(o.NUM,D);var H=[o.DOMAIN,o.AT,o.LOCALHOST,o.NUM,o.PLUS,o.POUND,o.PROTOCOL,o.SLASH,o.TLD,o.UNDERSCORE,o.SYM,o.AMPERSAND],q=[o.COLON,o.DOT,o.QUERY,o.PUNCTUATION,o.CLOSEBRACE,o.CLOSEBRACKET,o.CLOSEANGLEBRACKET,o.CLOSEPAREN,o.OPENBRACE,o.OPENBRACKET,o.OPENANGLEBRACKET,o.OPENPAREN];b.on(o.OPENBRACE,S).on(o.OPENBRACKET,E).on(o.OPENANGLEBRACKET,O).on(o.OPENPAREN,C),g.on(o.OPENBRACE,S).on(o.OPENBRACKET,E).on(o.OPENANGLEBRACKET,O).on(o.OPENPAREN,C),S.on(o.CLOSEBRACE,b),E.on(o.CLOSEBRACKET,b),O.on(o.CLOSEANGLEBRACKET,b),C.on(o.CLOSEPAREN,b),A.on(o.CLOSEBRACE,b),w.on(o.CLOSEBRACKET,b),j.on(o.CLOSEANGLEBRACKET,b),I.on(o.CLOSEPAREN,b),k.on(o.CLOSEBRACE,b),T.on(o.CLOSEBRACKET,b),L.on(o.CLOSEANGLEBRACKET,b),_.on(o.CLOSEPAREN,b),S.on(H,A),E.on(H,w),O.on(H,j),C.on(H,I),S.on(q,k),E.on(q,T),O.on(q,L),C.on(q,_),A.on(H,A),w.on(H,w),j.on(H,j),I.on(H,I),A.on(q,A),w.on(q,w),j.on(q,j),I.on(q,I),k.on(H,A),T.on(H,w),L.on(H,j),_.on(H,I),k.on(q,k),T.on(q,T),L.on(q,L),_.on(q,_),b.on(H,b),g.on(H,b),b.on(q,g),g.on(q,g),l.on(o.TLD,M).on(o.DOMAIN,M).on(o.NUM,M).on(o.LOCALHOST,M),M.on(H,M).on(q,U),U.on(H,M).on(q,U);var J=[o.DOMAIN,o.NUM,o.PLUS,o.POUND,o.QUERY,o.UNDERSCORE,o.SYM,o.AMPERSAND,o.TLD];d.on(J,F).on(o.AT,V),h.on(J,F).on(o.AT,V),m.on(J,F),F.on(J,F).on(o.AT,V).on(o.DOT,B),B.on(J,F),V.on(o.TLD,P).on(o.DOMAIN,P).on(o.LOCALHOST,N);t.State=r.TokenState,t.TOKENS=a,t.run=function(e){for(var t=e.length,n=0,r=[],a=[];n<t;){for(var o=s,c=null,u=null,l=0,f=null,p=-1;n<t&&!(c=o.next(e[n]));)a.push(e[n++]);for(;n<t&&(u=c||o.next(e[n]));)c=null,(o=u).accepts()?(p=0,f=o):p>=0&&p++,n++,l++;if(p<0)for(var d=n-l;d<n;d++)a.push(e[d]);else{a.length>0&&(r.push(new i.TEXT(a)),a=[]),n-=p,l-=p;var m=f.emit();r.push(new m(e.slice(n-l,n)))}}return a.length>0&&r.push(new i.TEXT(a)),r},t.start=s},function(e,t,n){"use strict";t.__esModule=!0,t.URL=t.TEXT=t.NL=t.EMAIL=t.MAILTOEMAIL=t.Base=void 0;var r=n(196),i=n(43),a=n(59);function o(e){return e instanceof a.DOMAIN||e instanceof a.TLD}var c=(0,r.createTokenClass)();c.prototype={type:"token",isLink:!1,toString:function(){for(var e=[],t=0;t<this.v.length;t++)e.push(this.v[t].toString());return e.join("")},toHref:function(){return this.toString()},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http";return{type:this.type,value:this.toString(),href:this.toHref(e)}}};var s=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"email",isLink:!0}),u=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"email",isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),l=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"text"}),f=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"nl"}),p=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"url",isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http",t=!1,n=!1,r=this.v,i=[],c=0;r[c]instanceof a.PROTOCOL;)t=!0,i.push(r[c].toString().toLowerCase()),c++;for(;r[c]instanceof a.SLASH;)n=!0,i.push(r[c].toString()),c++;for(;o(r[c]);)i.push(r[c].toString().toLowerCase()),c++;for(;c<r.length;c++)i.push(r[c].toString());return i=i.join(""),t||n||(i=e+"://"+i),i},hasProtocol:function(){return this.v[0]instanceof a.PROTOCOL}});t.Base=c,t.MAILTOEMAIL=s,t.EMAIL=u,t.NL=f,t.TEXT=l,t.URL=p},function(e,t,n){const{defaults:r}=n(40),{block:i}=n(199),{rtrim:a,splitCells:o,escape:c}=n(34);e.exports=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.rules=i.normal,this.options.pedantic?this.rules=i.pedantic:this.options.gfm&&(this.rules=i.gfm)}static get rules(){return i}static lex(t,n){return new e(n).lex(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.token(e,!0)}token(e,t){let n,r,s,u,l,f,p,d,m,h,y,v,b,g,S,E;for(e=e.replace(/^ +$/gm,"");e;)if((s=this.rules.newline.exec(e))&&(e=e.substring(s[0].length),s[0].length>1&&this.tokens.push({type:"space"})),s=this.rules.code.exec(e)){const t=this.tokens[this.tokens.length-1];e=e.substring(s[0].length),t&&"paragraph"===t.type?t.text+="\n"+s[0].trimRight():(s=s[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",codeBlockStyle:"indented",text:this.options.pedantic?s:a(s,"\n")}))}else if(s=this.rules.fences.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"code",lang:s[2]?s[2].trim():s[2],text:s[3]||""});else if(s=this.rules.heading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:s[1].length,text:s[2]});else if((s=this.rules.nptable.exec(e))&&(f={type:"table",header:o(s[1].replace(/^ *| *\| *$/g,"")),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3]?s[3].replace(/\n$/,"").split("\n"):[]},f.header.length===f.align.length)){for(e=e.substring(s[0].length),y=0;y<f.align.length;y++)/^ *-+: *$/.test(f.align[y])?f.align[y]="right":/^ *:-+: *$/.test(f.align[y])?f.align[y]="center":/^ *:-+ *$/.test(f.align[y])?f.align[y]="left":f.align[y]=null;for(y=0;y<f.cells.length;y++)f.cells[y]=o(f.cells[y],f.header.length);this.tokens.push(f)}else if(s=this.rules.hr.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"hr"});else if(s=this.rules.blockquote.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"blockquote_start"}),s=s[0].replace(/^ *> ?/gm,""),this.token(s,t),this.tokens.push({type:"blockquote_end"});else if(s=this.rules.list.exec(e)){for(e=e.substring(s[0].length),u=s[2],g=u.length>1,p={type:"list_start",ordered:g,start:g?+u:"",loose:!1},this.tokens.push(p),s=s[0].match(this.rules.item),d=[],n=!1,b=s.length,y=0;y<b;y++)f=s[y],h=f.length,f=f.replace(/^ *([*+-]|\d+\.) */,""),~f.indexOf("\n ")&&(h-=f.length,f=this.options.pedantic?f.replace(/^ {1,4}/gm,""):f.replace(new RegExp("^ {1,"+h+"}","gm"),"")),y!==b-1&&(l=i.bullet.exec(s[y+1])[0],(u.length>1?1===l.length:l.length>1||this.options.smartLists&&l!==u)&&(e=s.slice(y+1).join("\n")+e,y=b-1)),r=n||/\n\n(?!\s*$)/.test(f),y!==b-1&&(n="\n"===f.charAt(f.length-1),r||(r=n)),r&&(p.loose=!0),S=/^\[[ xX]\] /.test(f),E=void 0,S&&(E=" "!==f[1],f=f.replace(/^\[[ xX]\] +/,"")),m={type:"list_item_start",task:S,checked:E,loose:r},d.push(m),this.tokens.push(m),this.token(f,!1),this.tokens.push({type:"list_item_end"});if(p.loose)for(b=d.length,y=0;y<b;y++)d[y].loose=!0;this.tokens.push({type:"list_end"})}else if(s=this.rules.html.exec(e))e=e.substring(s[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===s[1]||"script"===s[1]||"style"===s[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):c(s[0]):s[0]});else if(t&&(s=this.rules.def.exec(e)))e=e.substring(s[0].length),s[3]&&(s[3]=s[3].substring(1,s[3].length-1)),v=s[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[v]||(this.tokens.links[v]={href:s[2],title:s[3]});else if((s=this.rules.table.exec(e))&&(f={type:"table",header:o(s[1].replace(/^ *| *\| *$/g,"")),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3]?s[3].replace(/\n$/,"").split("\n"):[]},f.header.length===f.align.length)){for(e=e.substring(s[0].length),y=0;y<f.align.length;y++)/^ *-+: *$/.test(f.align[y])?f.align[y]="right":/^ *:-+: *$/.test(f.align[y])?f.align[y]="center":/^ *:-+ *$/.test(f.align[y])?f.align[y]="left":f.align[y]=null;for(y=0;y<f.cells.length;y++)f.cells[y]=o(f.cells[y].replace(/^ *\| *| *\| *$/g,""),f.header.length);this.tokens.push(f)}else if(s=this.rules.lheading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:"="===s[2].charAt(0)?1:2,text:s[1]});else if(t&&(s=this.rules.paragraph.exec(e)))e=e.substring(s[0].length),this.tokens.push({type:"paragraph",text:"\n"===s[1].charAt(s[1].length-1)?s[1].slice(0,-1):s[1]});else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"text",text:s[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens}}},function(e,t,n){const r=n(60),i=n(200),a=n(201),o=n(202),{defaults:c}=n(40),{merge:s,unescape:u}=n(34);e.exports=class e{constructor(e){this.tokens=[],this.token=null,this.options=e||c,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options,this.slugger=new i}static parse(t,n){return new e(n).parse(t)}parse(e){this.inline=new a(e.links,this.options),this.inlineText=new a(e.links,s({},this.options,{renderer:new o})),this.tokens=e.reverse();let t="";for(;this.next();)t+=this.tok();return t}next(){return this.token=this.tokens.pop(),this.token}peek(){return this.tokens[this.tokens.length-1]||0}parseText(){let e=this.token.text;for(;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}tok(){let e="";switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,u(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":{let t,n,r,i,a="";for(r="",t=0;t<this.token.header.length;t++)r+=this.renderer.tablecell(this.inline.output(this.token.header[t]),{header:!0,align:this.token.align[t]});for(a+=this.renderer.tablerow(r),t=0;t<this.token.cells.length;t++){for(n=this.token.cells[t],r="",i=0;i<n.length;i++)r+=this.renderer.tablecell(this.inline.output(n[i]),{header:!1,align:this.token.align[i]});e+=this.renderer.tablerow(r)}return this.renderer.table(a,e)}case"blockquote_start":for(e="";"blockquote_end"!==this.next().type;)e+=this.tok();return this.renderer.blockquote(e);case"list_start":{e="";const t=this.token.ordered,n=this.token.start;for(;"list_end"!==this.next().type;)e+=this.tok();return this.renderer.list(e,t,n)}case"list_item_start":{e="";const t=this.token.loose,n=this.token.checked,r=this.token.task;if(this.token.task)if(t)if("text"===this.peek().type){const e=this.peek();e.text=this.renderer.checkbox(n)+" "+e.text}else this.tokens.push({type:"text",text:this.renderer.checkbox(n)});else e+=this.renderer.checkbox(n);for(;"list_item_end"!==this.next().type;)e+=t||"text"!==this.token.type?this.tok():this.parseText();return this.renderer.listitem(e,r,n)}case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText());default:{const e='Token with "'+this.token.type+'" type was not found.';if(!this.options.silent)throw new Error(e);console.log(e)}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var r=a(n(0)),i=a(n(247));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?d(e):t}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=function(e){function t(){var e,n;u(this,t);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return h(d(n=f(this,(e=p(t)).call.apply(e,[this].concat(o)))),"onClick",(function(e){var t=n.props,a=t.text,o=t.onCopy,c=t.children,s=t.options,u=r.default.Children.only(c),l=(0,i.default)(a,s);o&&o(a,l),u&&u.props&&"function"==typeof u.props.onClick&&u.props.onClick(e)})),n}var n,a,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(t,e),n=t,(a=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),n=s(e,["text","onCopy","options","children"]),i=r.default.Children.only(t);return r.default.cloneElement(i,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(n,!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n,{onClick:this.onClick}))}}])&&l(n.prototype,a),o&&l(n,o),t}(r.default.PureComponent);t.CopyToClipboard=y,h(y,"defaultProps",{onCopy:void 0,options:void 0})},function(e,t,n){"use strict";var r=n(248),i={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,a,o,c,s,u,l=!1;t||(t={}),n=t.debug||!1;try{if(o=r(),c=document.createRange(),s=document.getSelection(),(u=document.createElement("span")).textContent=e,u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=i[t.format]||i.default;window.clipboardData.setData(a,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(u),c.selectNodeContents(u),s.addRange(c),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),a=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(a,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(c):s.removeAllRanges()),u&&document.body.removeChild(u),o()}return l}},function(e,t){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}}},function(e,t,n){"use strict";n.r(t);var r={UPLOAD_IMAGE:"upload:image"},i={Subjects:Object.assign({SUBJECTS:"subjects",NEW_SUBJECT:"new:subject",EDIT_SUBJECT:"edit:subject",EDIT_SUBJECT_PLAYLISTS:"edit:subject:playlists",EDIT_SUBJECT_SERIES:"edit:subject:series",EDIT_SUBJECT_VIDEOS:"edit:subject:videos",SUBJECT_CLASSIFICATIONS:"subject:classifications",DELETE_SUBJECT:"delete:subject",ADD_SUBJECT_MEMBERS:"add:subject:members",REMOVE_SUBJECT_MEMBER:"remove:subject:member",CLASSIFICATIONS:"classifications",PRESENTATION_CLASSIFICATIONS:"presentation:classifications",NEW_CLASSIFICATION:"new:classification",EDIT_CLASSIFICATION:"edit:classification",EDIT_CLASSIFICATION_PLAYLISTS:"edit:classification:playlists",EDIT_CLASSIFICATION_SERIES:"edit:classification:series",EDIT_CLASSIFICATION_VIDEOS:"edit:classification:videos",DELETE_CLASSIFICATION:"delete:classification",REMOVE_CLASSIFICATION_MEMBER:"remove:classification:member",LEVELS:"levels",NEW_LEVEL:"new:level",EDIT_LEVEL:"edit:level",LEVEL_AUDIENCES:"level:audiences",EDIT_LEVEL_PLAYLISTS:"edit:level:playlists",EDIT_LEVEL_SERIES:"edit:level:series",EDIT_LEVEL_VIDEOS:"edit:level:videos",REMOVE_LEVEL_MEMBER:"remove:level:member",AUDIENCES:"audiences",PRESENTATION_AUDIENCES:"presentation:audiences",NEW_AUDIENCE:"new:audience",EDIT_AUDIENCE:"edit:audience",EDIT_AUDIENCE_PLAYLISTS:"edit:audience:playlists",EDIT_AUDIENCE_SERIES:"edit:audience:series",EDIT_AUDIENCE_VIDEOS:"edit:audience:videos",DELETE_AUDIENCE:"delete:audience",REMOVE_AUDIENCE_MEMBER:"remove:audience:member",PRESENTATIONS:"presentations",NEW_PRESENTATION:"new:presentation",EDIT_PRESENTATION:"edit:presentation"},r),Playlists:Object.assign({PLAYLISTS:"index",SEARCH_PLAYLISTS:"search:playlists",NEW_PLAYLIST:"new:playlist",EDIT_PLAYLIST:"edit:playlist",EDIT_PLAYLIST_VIDEOS:"edit:playlist:videos",EDIT_PLAYLIST_SUBJECTS:"edit:playlist:subjects",EDIT_PLAYLIST_AUDIENCES:"edit:playlist:audiences",DELETE_PLAYLIST:"delete:playlist",REMOVE_VIDEO:"remove:video",REMOVE_FROM_SUBJECT:"remove:from:subject"},r),Series:Object.assign({EDIT_SERIES:"edit:series",EDIT_SERIES_VIDEOS:"edit:series:videos",EDIT_SERIES_SUBJECTS:"edit:series:subjects",EDIT_SERIES_AUDIENCES:"edit:series:audiences",LEGACY_EDIT_SERIES:"legacy:edit:series"},r),Videos:Object.assign({EDIT_VIDEO:"edit:video",EDIT_VIDEO_AUDIENCES:"edit:video:audiences",EDIT_VIDEO_SUBJECTS:"edit:video:subjects",EDIT_VIDEO_ALIASES:"edit:video:aliases",LEGACY_EDIT_VIDEO:"legacy:edit:video"},r),DomainOptions:{DOMAIN_OPTIONS:"domain:options",NEW_DOMAIN_OPTION:"new:domain:option",EDIT_DOMAIN_OPTION:"edit:domain:option",DELETE_DOMAIN_OPTION:"delete:domain:option"},People:{PEOPLE:"people",NEW_PERSON:"new:person",EDIT_PERSON:"edit:person"},Companies:{COMPANIES:"companies",NEW_COMPANY:"new:company",EDIT_COMPANY:"edit:company"},Themes:Object.assign({THEMES:"themes",NEW_THEME:"new:theme",EDIT_THEME:"edit:theme",DELETE_THEME:"delete:theme"},r),ReleaseNotes:{FORM:"form",GENERATOR:"generator"},Customers:{MANAGE_CUSTOMER:"manage:customer",MANAGE_CUSTOMER_TOPICS:"manage:customer:topics"}},a={SUBJECT:"subject",SUBJECTS:"subjects",UPDATE_SUBJECT:"update:subject",DELETE_SUBJECT:"delete:subject",UPDATE_OBJECT_SUBJECTS:"update:object:subjects",ADD_TO_SUBJECT:"add:to:subject",REMOVE_FROM_SUBJECT:"remove:from:subject",CLASSIFICATION:"classification",CLASSIFICATIONS:"classifications",UPDATE_CLASSIFICATION:"update:classification",DELETE_CLASSIFICATION:"delete:classification",UPDATE_OBJECT_CLASSIFICATIONS:"update:object:classifications",ADD_TO_CLASSIFICATION:"add:to:classification",REMOVE_FROM_CLASSIFICATION:"remove:from:classification",PRESENTATION:"presentation",PRESENTATIONS:"presentations",UPDATE_PRESENTATION:"update:presentation",LEVEL:"level",LEVELS:"levels",UPDATE_LEVEL:"update:level",ADD_TO_LEVEL:"add:to:level",REMOVE_FROM_LEVEL:"remove:from:level",UPDATE_OBJECT_LEVELS:"update:object:levels",AUDIENCE:"audience",AUDIENCES:"audiences",UPDATE_AUDIENCE:"update:audience",DELETE_AUDIENCE:"delete:audience",UPDATE_OBJECT_AUDIENCES:"update:object:audiences",ADD_TO_AUDIENCE:"add:to:audience",REMOVE_FROM_AUDIENCE:"remove:from:audience",PLAYLIST:"playlist",PLAYLISTS:"playlists",UPDATE_PLAYLIST:"update:playlist",DELETE_PLAYLIST:"delete:playlist",PLAYLIST_VIDEOS:"playlist:videos",REORDER_PLAYLIST_VIDEOS:"reorder:playlist:videos",REMOVE_PLAYLIST_VIDEO:"remove:playlist:video",VIDEO:"video",SERIES:"series",SERIES_BY_ID:"series:by:id",UPDATE_SERIES:"update:series",CURRENT_USER:"current:user",UPLOAD_IMAGE:"upload:image",LOCALE:"locale",PHRASES:"PHRASES"},o={CURATOR_LAYOUT:"CuratorLayout"},c={COMPANIES:"companies:application",CUSTOMERS:"customers:application",DOMAIN_OPTIONS:"domain:options:application",PEOPLE:"people:application",PLAYLISTS:"playlists:application",SERIES:"series:application",SUBJECTS:"subjects:application",THEMES:"themes:application",VIDEOS:"videos:application",RELEASE_NOTES:"release:notes:application"},s={IMAGE_UPLOAD:"image:upload:data:service",SUBJECT:"subject:data:service",LANGUAGE:"language:data:service"},u={SUBJECT:"SubjectDataService",LANGUAGE:"LanguageDataService"},l=n(0),f=n.n(l),p=n(27),d=n(1),m=function(e){return d.isFunction(e)},h=function(){return d.identity},y=n(54),v=n(7);function b(e){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=A(e);if(t){var i=A(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return C(this,n)}}function C(e,t){return!t||"object"!==b(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&E(e,t)}(a,e);var t,n,r,i=O(a);function a(){return g(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"isReactComponent",value:function(e){return l&&l.isValidElement(e)}},{key:"showChildView",value:function(e,t){this.isReactComponent(t)&&this.showChildReactComponent(e,t)}},{key:"showChildReactComponent",value:function(e,t){var n=this;this.isAttached()?this.renderChildReactComponent(e,t):this.listenToOnce(this,"attach",(function(){return n.renderChildReactComponent(e,t)}))}},{key:"renderChildReactComponent",value:function(e,t){var n=this.getRegion(e),r=this.$el.find(n.el);r&&r.length&&(n.trigger("before:show"),y.render(t,r[0],(function(){return n.trigger("show")})),this.listenToOnce(this,"unmount:".concat(e),(function(){return y.unmountComponentAtNode(r[0])})),this.listenToOnce(this,"before:destroy",(function(){return y.unmountComponentAtNode(r[0])})))}},{key:"wrapWithStore",value:function(e){return l.createElement(v.Provider,{store:this.options.store},e)}}])&&S(t.prototype,n),r&&S(t,r),a}(n(46).a),j="top:nav",I="left:nav",k="content",T="popup",L="alert",_=n(206),P=n.n(_),x=n(55),N=n.n(x);function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function M(e,t,n){return(M="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=B(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function U(e,t){return(U=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=B(e);if(t){var i=B(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return V(this,n)}}function V(e,t){return!t||"object"!==R(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function B(e){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&U(e,t)}(a,e);var t,n,r,i=F(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).childComponents={},t}return t=a,r=[{key:"getCacheKey",value:function(e){var t="".concat(this.name),n=[];return Object.keys(e).forEach((function(t){n.push("".concat(t,":").concat(e[t]))})),n.length&&(n.sort(),t+=":".concat(n.join(":"))),t}}],(n=[{key:"title",get:function(){return!1}},{key:"name",get:function(){return"CuratorLayoutView"}},{key:"template",get:function(){return P.a}},{key:"className",get:function(){return"container-fluid ".concat(N.a.curatorLayout)}},{key:"regions",value:function(){return{layout:".layout-region"}}},{key:"getChildComponents",value:function(){return{topNav:{component:this.childComponents[j],className:N.a.topNavRegion},leftNav:{component:this.childComponents[I],className:"py-3 ".concat(N.a.leftNavRegion)},content:{component:this.childComponents[k],className:"position-relative container py-3"},popup:{component:this.childComponents[T]},alert:{component:this.childComponents[L]}}}},{key:"unsetRegion",value:function(e){delete this.childComponents[e],this.renderLayout()}},{key:"renderTopNav",value:function(){m(this.options.getTopNavView)&&(this.childComponents[j]=this.options.getTopNavView(p.AppLinkHelper.getCurrentAppLink()))}},{key:"hideLeftNav",value:function(){this.unsetRegion(I)}},{key:"closePopup",value:function(){this.unsetRegion(T)}},{key:"showChildView",value:function(e,t){this.childComponents[e]=t,this.renderTopNav(),this.renderLayout()}},{key:"renderLayout",value:function(){var e=Object.assign({provider:this.options.provider},this.getChildComponents());M(B(a.prototype),"showChildView",this).call(this,"layout",this.wrapWithStore(l.createElement(Y,Object.assign({},e))))}}])&&D(t.prototype,n),r&&D(t,r),a}(w),H=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},q=function(e){var t=e.className,n=e.children;return l.createElement("div",{className:t},n)},J=function(e,t){return"".concat(e).concat(t?" ".concat(t):"")},K=function(e){var t=e.topNav,n=e.leftNav,r=e.content,i=e.popup,a=e.alert;return l.createElement(l.Fragment,null,l.createElement("div",{className:"position-relative"},!!t.component&&l.createElement(q,{className:J("top-nav-region",t.className)},t.component),!!n.component&&l.createElement(q,{className:J("left-nav-region",n.className)},n.component),!!r.component&&l.createElement("div",{className:"content-container"},l.createElement(q,{className:J("content-region",r.className)},r.component))),!!i.component&&l.createElement(q,{className:J("popup-region",i.className)},i.component),!!a.component&&l.createElement(q,{className:J("alert-region",a.className)},a.component))},Y=function(e){var t=e.provider,n=H(e,["provider"]);return t?l.createElement(t,null,l.createElement(K,Object.assign({},n))):l.createElement(K,Object.assign({},n))},G=n(9);function W(e){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Z(e){return function(e){if(Array.isArray(e))return Q(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function X(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function te(e,t){return(te=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ie(e);if(t){var i=ie(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return re(this,n)}}function re(e,t){return!t||"object"!==W(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ie(e){return(ie=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&te(e,t)}(a,e);var t,n,r,i=ne(a);function a(){return X(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"initialize",value:function(){this.listenTo(G.a.SHELL,p.EventNames.ROUTING_END,this.updateNav)}},{key:"name",get:function(){return"CuratorAppNavService"}},{key:"updateNav",value:function(){var e=this,t=p.AppLinkHelper.getCurrentAppLink().application;if(t!==this.currentApplication){this.currentApplication=t;var n=this.options.navItemMappings[t];if(n){var r=document.querySelector(this.options.navSelector);r&&r.children&&Z(r.children).forEach((function(t){var r=t.querySelector("a");r&&(r.classList.remove(e.options.currentItemClassName),r.text===n&&r.classList.add(e.options.currentItemClassName))}))}}}}])&&ee(t.prototype,n),r&&ee(t,r),a}(p.Service),oe=n(70),ce=n(8),se=function(e){var t="/api/master/v2/companies";return e?"".concat(t,"?cursor=").concat(e):t},ue=function(e){return"/api/master/v2/objects/".concat(e)},le=function(){return"/api/master/v2/companies"},fe=function(e){return"/api/master/v2/objects/".concat(e)},pe="companies",de="company",me="update:company",he=function(e){return{key:"".concat(pe).concat(e?":".concat(e):""),url:se(e)}},ye=function(e){return{key:"".concat(de,":").concat(e),url:ue(e)}},ve=function(e,t,n){return{key:de,url:le(),data:e,type:ce.a.POST,success:t,error:n,invalidationKeys:[pe]}},be=function(e,t,n){return{key:"".concat(me,":").concat(e),url:fe(e),data:t,type:ce.a.PUT,always:n}},ge=n(33),Se=n.n(ge),Ee=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===Oe}(e)}(e)};var Oe="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Ce(e,t){return!1!==t.clone&&t.isMergeableObject(e)?we((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Ae(e,t,n){return e.concat(t).map((function(e){return Ce(e,n)}))}function we(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Ae,n.isMergeableObject=n.isMergeableObject||Ee;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach((function(t){r[t]=Ce(e[t],n)})),Object.keys(t).forEach((function(i){n.isMergeableObject(t[i])&&e[i]?r[i]=we(e[i],t[i],n):r[i]=Ce(t[i],n)})),r}(e,t,n):Ce(t,n)}we.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return we(e,n,t)}),{})};var je=we,Ie=n(15),ke=Ie.a.Symbol,Te=Object.prototype,Le=Te.hasOwnProperty,_e=Te.toString,Pe=ke?ke.toStringTag:void 0;var xe=function(e){var t=Le.call(e,Pe),n=e[Pe];try{e[Pe]=void 0;var r=!0}catch(e){}var i=_e.call(e);return r&&(t?e[Pe]=n:delete e[Pe]),i},Ne=Object.prototype.toString;var Re=function(e){return Ne.call(e)},De=ke?ke.toStringTag:void 0;var Me=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":De&&De in Object(e)?xe(e):Re(e)};var Ue=function(e,t){return function(n){return e(t(n))}},Fe=Ue(Object.getPrototypeOf,Object);var Ve=function(e){return null!=e&&"object"==typeof e},Be=Function.prototype,ze=Object.prototype,He=Be.toString,qe=ze.hasOwnProperty,Je=He.call(Object);var $e=function(e){if(!Ve(e)||"[object Object]"!=Me(e))return!1;var t=Fe(e);if(null===t)return!0;var n=qe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&He.call(n)==Je};var Ke=function(){this.__data__=[],this.size=0};var Ye=function(e,t){return e===t||e!=e&&t!=t};var Ge=function(e,t){for(var n=e.length;n--;)if(Ye(e[n][0],t))return n;return-1},We=Array.prototype.splice;var Ze=function(e){var t=this.__data__,n=Ge(t,e);return!(n<0)&&(n==t.length-1?t.pop():We.call(t,n,1),--this.size,!0)};var Qe=function(e){var t=this.__data__,n=Ge(t,e);return n<0?void 0:t[n][1]};var Xe=function(e){return Ge(this.__data__,e)>-1};var et=function(e,t){var n=this.__data__,r=Ge(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function tt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}tt.prototype.clear=Ke,tt.prototype.delete=Ze,tt.prototype.get=Qe,tt.prototype.has=Xe,tt.prototype.set=et;var nt=tt;var rt=function(){this.__data__=new nt,this.size=0};var it=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var at=function(e){return this.__data__.get(e)};var ot=function(e){return this.__data__.has(e)};var ct=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var st,ut=function(e){if(!ct(e))return!1;var t=Me(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},lt=Ie.a["__core-js_shared__"],ft=(st=/[^.]+$/.exec(lt&&lt.keys&&lt.keys.IE_PROTO||""))?"Symbol(src)_1."+st:"";var pt=function(e){return!!ft&&ft in e},dt=Function.prototype.toString;var mt=function(e){if(null!=e){try{return dt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ht=/^\[object .+?Constructor\]$/,yt=Function.prototype,vt=Object.prototype,bt=yt.toString,gt=vt.hasOwnProperty,St=RegExp("^"+bt.call(gt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Et=function(e){return!(!ct(e)||pt(e))&&(ut(e)?St:ht).test(mt(e))};var Ot=function(e,t){return null==e?void 0:e[t]};var Ct=function(e,t){var n=Ot(e,t);return Et(n)?n:void 0},At=Ct(Ie.a,"Map"),wt=Ct(Object,"create");var jt=function(){this.__data__=wt?wt(null):{},this.size=0};var It=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},kt=Object.prototype.hasOwnProperty;var Tt=function(e){var t=this.__data__;if(wt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return kt.call(t,e)?t[e]:void 0},Lt=Object.prototype.hasOwnProperty;var _t=function(e){var t=this.__data__;return wt?void 0!==t[e]:Lt.call(t,e)};var Pt=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=wt&&void 0===t?"__lodash_hash_undefined__":t,this};function xt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}xt.prototype.clear=jt,xt.prototype.delete=It,xt.prototype.get=Tt,xt.prototype.has=_t,xt.prototype.set=Pt;var Nt=xt;var Rt=function(){this.size=0,this.__data__={hash:new Nt,map:new(At||nt),string:new Nt}};var Dt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Mt=function(e,t){var n=e.__data__;return Dt(t)?n["string"==typeof t?"string":"hash"]:n.map};var Ut=function(e){var t=Mt(this,e).delete(e);return this.size-=t?1:0,t};var Ft=function(e){return Mt(this,e).get(e)};var Vt=function(e){return Mt(this,e).has(e)};var Bt=function(e,t){var n=Mt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function zt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}zt.prototype.clear=Rt,zt.prototype.delete=Ut,zt.prototype.get=Ft,zt.prototype.has=Vt,zt.prototype.set=Bt;var Ht=zt;var qt=function(e,t){var n=this.__data__;if(n instanceof nt){var r=n.__data__;if(!At||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ht(r)}return n.set(e,t),this.size=n.size,this};function Jt(e){var t=this.__data__=new nt(e);this.size=t.size}Jt.prototype.clear=rt,Jt.prototype.delete=it,Jt.prototype.get=at,Jt.prototype.has=ot,Jt.prototype.set=qt;var $t=Jt;var Kt=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},Yt=function(){try{var e=Ct(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Gt=function(e,t,n){"__proto__"==t&&Yt?Yt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Wt=Object.prototype.hasOwnProperty;var Zt=function(e,t,n){var r=e[t];Wt.call(e,t)&&Ye(r,n)&&(void 0!==n||t in e)||Gt(e,t,n)};var Qt=function(e,t,n,r){var i=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var c=t[a],s=r?r(n[c],e[c],c,n,e):void 0;void 0===s&&(s=e[c]),i?Gt(n,c,s):Zt(n,c,s)}return n};var Xt=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var en=function(e){return Ve(e)&&"[object Arguments]"==Me(e)},tn=Object.prototype,nn=tn.hasOwnProperty,rn=tn.propertyIsEnumerable,an=en(function(){return arguments}())?en:function(e){return Ve(e)&&nn.call(e,"callee")&&!rn.call(e,"callee")},on=Array.isArray,cn=n(49),sn=/^(?:0|[1-9]\d*)$/;var un=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&sn.test(e))&&e>-1&&e%1==0&&e<t};var ln=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},fn={};fn["[object Float32Array]"]=fn["[object Float64Array]"]=fn["[object Int8Array]"]=fn["[object Int16Array]"]=fn["[object Int32Array]"]=fn["[object Uint8Array]"]=fn["[object Uint8ClampedArray]"]=fn["[object Uint16Array]"]=fn["[object Uint32Array]"]=!0,fn["[object Arguments]"]=fn["[object Array]"]=fn["[object ArrayBuffer]"]=fn["[object Boolean]"]=fn["[object DataView]"]=fn["[object Date]"]=fn["[object Error]"]=fn["[object Function]"]=fn["[object Map]"]=fn["[object Number]"]=fn["[object Object]"]=fn["[object RegExp]"]=fn["[object Set]"]=fn["[object String]"]=fn["[object WeakMap]"]=!1;var pn=function(e){return Ve(e)&&ln(e.length)&&!!fn[Me(e)]};var dn=function(e){return function(t){return e(t)}},mn=n(29),hn=mn.a&&mn.a.isTypedArray,yn=hn?dn(hn):pn,vn=Object.prototype.hasOwnProperty;var bn=function(e,t){var n=on(e),r=!n&&an(e),i=!n&&!r&&Object(cn.a)(e),a=!n&&!r&&!i&&yn(e),o=n||r||i||a,c=o?Xt(e.length,String):[],s=c.length;for(var u in e)!t&&!vn.call(e,u)||o&&("length"==u||i&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||un(u,s))||c.push(u);return c},gn=Object.prototype;var Sn=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||gn)},En=Ue(Object.keys,Object),On=Object.prototype.hasOwnProperty;var Cn=function(e){if(!Sn(e))return En(e);var t=[];for(var n in Object(e))On.call(e,n)&&"constructor"!=n&&t.push(n);return t};var An=function(e){return null!=e&&ln(e.length)&&!ut(e)};var wn=function(e){return An(e)?bn(e):Cn(e)};var jn=function(e,t){return e&&Qt(t,wn(t),e)};var In=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},kn=Object.prototype.hasOwnProperty;var Tn=function(e){if(!ct(e))return In(e);var t=Sn(e),n=[];for(var r in e)("constructor"!=r||!t&&kn.call(e,r))&&n.push(r);return n};var Ln=function(e){return An(e)?bn(e,!0):Tn(e)};var _n=function(e,t){return e&&Qt(t,Ln(t),e)},Pn=n(208);var xn=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var Nn=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a};var Rn=function(){return[]},Dn=Object.prototype.propertyIsEnumerable,Mn=Object.getOwnPropertySymbols,Un=Mn?function(e){return null==e?[]:(e=Object(e),Nn(Mn(e),(function(t){return Dn.call(e,t)})))}:Rn;var Fn=function(e,t){return Qt(e,Un(e),t)};var Vn=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},Bn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Vn(t,Un(e)),e=Fe(e);return t}:Rn;var zn=function(e,t){return Qt(e,Bn(e),t)};var Hn=function(e,t,n){var r=t(e);return on(e)?r:Vn(r,n(e))};var qn=function(e){return Hn(e,wn,Un)};var Jn=function(e){return Hn(e,Ln,Bn)},$n=Ct(Ie.a,"DataView"),Kn=Ct(Ie.a,"Promise"),Yn=Ct(Ie.a,"Set"),Gn=Ct(Ie.a,"WeakMap"),Wn=mt($n),Zn=mt(At),Qn=mt(Kn),Xn=mt(Yn),er=mt(Gn),tr=Me;($n&&"[object DataView]"!=tr(new $n(new ArrayBuffer(1)))||At&&"[object Map]"!=tr(new At)||Kn&&"[object Promise]"!=tr(Kn.resolve())||Yn&&"[object Set]"!=tr(new Yn)||Gn&&"[object WeakMap]"!=tr(new Gn))&&(tr=function(e){var t=Me(e),n="[object Object]"==t?e.constructor:void 0,r=n?mt(n):"";if(r)switch(r){case Wn:return"[object DataView]";case Zn:return"[object Map]";case Qn:return"[object Promise]";case Xn:return"[object Set]";case er:return"[object WeakMap]"}return t});var nr=tr,rr=Object.prototype.hasOwnProperty;var ir=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&rr.call(e,"index")&&(n.index=e.index,n.input=e.input),n},ar=Ie.a.Uint8Array;var or=function(e){var t=new e.constructor(e.byteLength);return new ar(t).set(new ar(e)),t};var cr=function(e,t){var n=t?or(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},sr=/\w*$/;var ur=function(e){var t=new e.constructor(e.source,sr.exec(e));return t.lastIndex=e.lastIndex,t},lr=ke?ke.prototype:void 0,fr=lr?lr.valueOf:void 0;var pr=function(e){return fr?Object(fr.call(e)):{}};var dr=function(e,t){var n=t?or(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var mr=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return or(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return cr(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return dr(e,n);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return ur(e);case"[object Set]":return new r;case"[object Symbol]":return pr(e)}},hr=Object.create,yr=function(){function e(){}return function(t){if(!ct(t))return{};if(hr)return hr(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var vr=function(e){return"function"!=typeof e.constructor||Sn(e)?{}:yr(Fe(e))};var br=function(e){return Ve(e)&&"[object Map]"==nr(e)},gr=mn.a&&mn.a.isMap,Sr=gr?dn(gr):br;var Er=function(e){return Ve(e)&&"[object Set]"==nr(e)},Or=mn.a&&mn.a.isSet,Cr=Or?dn(Or):Er,Ar={};Ar["[object Arguments]"]=Ar["[object Array]"]=Ar["[object ArrayBuffer]"]=Ar["[object DataView]"]=Ar["[object Boolean]"]=Ar["[object Date]"]=Ar["[object Float32Array]"]=Ar["[object Float64Array]"]=Ar["[object Int8Array]"]=Ar["[object Int16Array]"]=Ar["[object Int32Array]"]=Ar["[object Map]"]=Ar["[object Number]"]=Ar["[object Object]"]=Ar["[object RegExp]"]=Ar["[object Set]"]=Ar["[object String]"]=Ar["[object Symbol]"]=Ar["[object Uint8Array]"]=Ar["[object Uint8ClampedArray]"]=Ar["[object Uint16Array]"]=Ar["[object Uint32Array]"]=!0,Ar["[object Error]"]=Ar["[object Function]"]=Ar["[object WeakMap]"]=!1;var wr=function e(t,n,r,i,a,o){var c,s=1&n,u=2&n,l=4&n;if(r&&(c=a?r(t,i,a,o):r(t)),void 0!==c)return c;if(!ct(t))return t;var f=on(t);if(f){if(c=ir(t),!s)return xn(t,c)}else{var p=nr(t),d="[object Function]"==p||"[object GeneratorFunction]"==p;if(Object(cn.a)(t))return Object(Pn.a)(t,s);if("[object Object]"==p||"[object Arguments]"==p||d&&!a){if(c=u||d?{}:vr(t),!s)return u?zn(t,_n(c,t)):Fn(t,jn(c,t))}else{if(!Ar[p])return a?t:{};c=mr(t,p,s)}}o||(o=new $t);var m=o.get(t);if(m)return m;o.set(t,c),Cr(t)?t.forEach((function(i){c.add(e(i,n,r,i,t,o))})):Sr(t)&&t.forEach((function(i,a){c.set(a,e(i,n,r,a,t,o))}));var h=f?void 0:(l?u?Jn:qn:u?Ln:wn)(t);return Kt(h||t,(function(i,a){h&&(i=t[a=i]),Zt(c,a,e(i,n,r,a,t,o))})),c};var jr=function(e){return wr(e,4)};var Ir=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i};var kr=function(e){return"symbol"==typeof e||Ve(e)&&"[object Symbol]"==Me(e)};function Tr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Tr.Cache||Ht),n}Tr.Cache=Ht;var Lr=Tr;var _r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pr=/\\(\\)?/g,xr=function(e){var t=Lr(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(_r,(function(e,n,r,i){t.push(r?i.replace(Pr,"$1"):n||e)})),t}));var Nr=function(e){if("string"==typeof e||kr(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Rr=ke?ke.prototype:void 0,Dr=Rr?Rr.toString:void 0;var Mr=function e(t){if("string"==typeof t)return t;if(on(t))return Ir(t,e)+"";if(kr(t))return Dr?Dr.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var Ur=function(e){return null==e?"":Mr(e)};var Fr=function(e){return on(e)?Ir(e,Nr):kr(e)?[e]:xn(xr(Ur(e)))};var Vr=function(e,t){},Br=n(61),zr=n(62),Hr=n.n(zr);var qr=function(e){return wr(e,5)};function Jr(){return(Jr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function $r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Kr(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function Yr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Gr=function(e){return"function"==typeof e},Wr=function(e){return null!==e&&"object"==typeof e},Zr=function(e){return String(Math.floor(Number(e)))===e},Qr=function(e){return"[object String]"===Object.prototype.toString.call(e)},Xr=function(e){return 0===l.Children.count(e)},ei=function(e){return Wr(e)&&Gr(e.then)};function ti(e,t,n,r){void 0===r&&(r=0);for(var i=Fr(t);e&&r<i.length;)e=e[i[r++]];return void 0===e?n:e}function ni(e,t,n){for(var r=jr(e),i=r,a=0,o=Fr(t);a<o.length-1;a++){var c=o[a],s=ti(e,o.slice(0,a+1));if(s&&(Wr(s)||Array.isArray(s)))i=i[c]=jr(s);else{var u=o[a+1];i=i[c]=Zr(u)&&Number(u)>=0?[]:{}}}return(0===a?e:i)[o[a]]===n?e:(void 0===n?delete i[o[a]]:i[o[a]]=n,0===a&&void 0===n&&delete r[o[a]],r)}function ri(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var i=0,a=Object.keys(e);i<a.length;i++){var o=a[i],c=e[o];Wr(c)?n.get(c)||(n.set(c,!0),r[o]=Array.isArray(c)?[]:{},ri(c,t,n,r[o])):r[o]=t}return r}var ii=Object(l.createContext)(void 0),ai=ii.Provider,oi=ii.Consumer;function ci(){var e=Object(l.useContext)(ii);return e||Vr(!1),e}function si(e,t){switch(t.type){case"SET_VALUES":return Jr({},e,{values:t.payload});case"SET_TOUCHED":return Jr({},e,{touched:t.payload});case"SET_ERRORS":return Jr({},e,{errors:t.payload});case"SET_STATUS":return Jr({},e,{status:t.payload});case"SET_ISSUBMITTING":return Jr({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return Jr({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return Jr({},e,{values:ni(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return Jr({},e,{touched:ni(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return Jr({},e,{errors:ni(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return Jr({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return Jr({},e,{touched:ri(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return Jr({},e,{isSubmitting:!1});default:return e}}var ui={},li={};function fi(e){var t=e.validateOnChange,n=void 0===t||t,r=e.validateOnBlur,i=void 0===r||r,a=e.validateOnMount,o=void 0!==a&&a,c=e.isInitialValid,s=e.enableReinitialize,u=void 0!==s&&s,f=e.onSubmit,p=Kr(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),d=Jr({validateOnChange:n,validateOnBlur:i,validateOnMount:o,onSubmit:f},p),m=Object(l.useRef)(d.initialValues),h=Object(l.useRef)(d.initialErrors||ui),y=Object(l.useRef)(d.initialTouched||li),v=Object(l.useRef)(d.initialStatus),b=Object(l.useRef)(!1),g=Object(l.useRef)({});Object(l.useEffect)((function(){0}),[]),Object(l.useEffect)((function(){return b.current=!0,function(){b.current=!1}}),[]);var S=Object(l.useReducer)(si,{values:d.initialValues,errors:d.initialErrors||ui,touched:d.initialTouched||li,status:d.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),E=S[0],O=S[1],C=Object(l.useCallback)((function(e,t){return new Promise((function(n,r){var i=d.validate(e,t);null==i?n(ui):ei(i)?i.then((function(e){n(e||ui)}),(function(e){r(e)})):n(i)}))}),[d.validate]),A=Object(l.useCallback)((function(e,t){var n=d.validationSchema,r=Gr(n)?n(t):n,i=t&&r.validateAt?r.validateAt(t,e):function(e,t,n,r){void 0===n&&(n=!1);void 0===r&&(r={});var i=function e(t){var n={};for(var r in t)if(t.hasOwnProperty(r)){var i=String(r);!0===Array.isArray(t[i])?n[i]=t[i].map((function(t){return!0===Array.isArray(t)||$e(t)?e(t):""!==t?t:void 0})):$e(t[i])?n[i]=e(t[i]):n[i]=""!==t[i]?t[i]:void 0}return n}(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}(e,r);return new Promise((function(e,t){i.then((function(){e(ui)}),(function(n){"ValidationError"===n.name?e(function(e){var t={};if(e.inner){if(0===e.inner.length)return ni(t,e.path,e.message);var n=e.inner,r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var o=a;ti(t,o.path)||(t=ni(t,o.path,o.message))}}return t}(n)):t(n)}))}))}),[d.validationSchema]),w=Object(l.useCallback)((function(e,t){return new Promise((function(n){return n(g.current[e].validate(t))}))}),[]),j=Object(l.useCallback)((function(e){var t=Object.keys(g.current).filter((function(e){return Gr(g.current[e].validate)})),n=t.length>0?t.map((function(t){return w(t,ti(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then((function(e){return e.reduce((function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=ni(e,t[r],n)),e}),{})}))}),[w]),I=Object(l.useCallback)((function(e){return Promise.all([j(e),d.validationSchema?A(e):{},d.validate?C(e):{}]).then((function(e){var t=e[0],n=e[1],r=e[2];return je.all([t,n,r],{arrayMerge:di})}))}),[d.validate,d.validationSchema,j,C,A]),k=hi((function(e){return void 0===e&&(e=E.values),Object(Br.unstable_runWithPriority)(Br.LowPriority,(function(){return I(e).then((function(e){return b.current&&O({type:"SET_ERRORS",payload:e}),e}))}))})),T=hi((function(e){return void 0===e&&(e=E.values),O({type:"SET_ISVALIDATING",payload:!0}),I(e).then((function(e){return b.current&&(O({type:"SET_ISVALIDATING",payload:!1}),Se()(E.errors,e)||O({type:"SET_ERRORS",payload:e})),e}))}));Object(l.useEffect)((function(){o&&!0===b.current&&k(d.initialValues)}),[d.initialValues,o,k]);var L=Object(l.useCallback)((function(e){var t=e&&e.values?e.values:m.current,n=e&&e.errors?e.errors:h.current?h.current:d.initialErrors||{},r=e&&e.touched?e.touched:y.current?y.current:d.initialTouched||{},i=e&&e.status?e.status:v.current?v.current:d.initialStatus;m.current=t,h.current=n,y.current=r,v.current=i,O({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:i,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})}),[d.initialErrors,d.initialStatus,d.initialTouched]);Object(l.useEffect)((function(){u&&!0===b.current&&!Se()(m.current,d.initialValues)&&(m.current=d.initialValues,L())}),[u,d.initialValues,L]),Object(l.useEffect)((function(){u&&!0===b.current&&!Se()(h.current,d.initialErrors)&&(h.current=d.initialErrors||ui,O({type:"SET_ERRORS",payload:d.initialErrors||ui}))}),[u,d.initialErrors]),Object(l.useEffect)((function(){u&&!0===b.current&&!Se()(y.current,d.initialTouched)&&(y.current=d.initialTouched||li,O({type:"SET_TOUCHED",payload:d.initialTouched||li}))}),[u,d.initialTouched]),Object(l.useEffect)((function(){u&&!0===b.current&&!Se()(v.current,d.initialStatus)&&(v.current=d.initialStatus,O({type:"SET_STATUS",payload:d.initialStatus}))}),[u,d.initialStatus,d.initialTouched]);var _=hi((function(e){if(Gr(g.current[e].validate)){var t=ti(E.values,e),n=g.current[e].validate(t);return ei(n)?(O({type:"SET_ISVALIDATING",payload:!0}),n.then((function(e){return e})).then((function(t){O({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),O({type:"SET_ISVALIDATING",payload:!1})}))):(O({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return Promise.resolve()})),P=Object(l.useCallback)((function(e,t){var n=t.validate;g.current[e]={validate:n}}),[]),x=Object(l.useCallback)((function(e){delete g.current[e]}),[]),N=hi((function(e){return O({type:"SET_TOUCHED",payload:e}),i?k(E.values):Promise.resolve()})),R=Object(l.useCallback)((function(e){O({type:"SET_ERRORS",payload:e})}),[]),D=hi((function(e){return O({type:"SET_VALUES",payload:e}),n?k(e):Promise.resolve()})),M=Object(l.useCallback)((function(e,t){O({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),U=hi((function(e,t,r){return void 0===r&&(r=!0),O({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),n&&r?k(ni(E.values,e,t)):Promise.resolve()})),F=Object(l.useCallback)((function(e,t){var n,r=t,i=e;if(!Qr(e)){e.persist&&e.persist();var a=e.target,o=a.type,c=a.name,s=a.id,u=a.value,l=a.checked,f=(a.outerHTML,a.options),p=a.multiple;r=t||(c||s),i=/number|range/.test(o)?(n=parseFloat(u),isNaN(n)?"":n):/checkbox/.test(o)?function(e,t,n){if("true"==n||"false"==n)return!!t;if(t&&n)return Array.isArray(e)?e.concat(n):[n];if(!Array.isArray(e))return!e;var r=e.indexOf(n);if(r<0)return e;return e.slice(0,r).concat(e.slice(r+1))}(ti(E.values,r),l,u):p?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(f):u}r&&U(r,i)}),[U,E.values]),V=Object(l.useCallback)((function(e){if(Qr(e))return function(t){return F(t,e)};F(e)}),[F]),B=hi((function(e,t,n){return void 0===t&&(t=!0),void 0===n&&(n=!0),O({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),i&&n?k(E.values):Promise.resolve()})),z=Object(l.useCallback)((function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,i=n.id,a=(n.outerHTML,t||(r||i));B(a,!0)}),[B]),H=Object(l.useCallback)((function(e){if(Qr(e))return function(t){return z(t,e)};z(e)}),[z]),q=Object(l.useCallback)((function(e){Gr(e)?O({type:"SET_FORMIK_STATE",payload:e}):O({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),J=Object(l.useCallback)((function(e){O({type:"SET_STATUS",payload:e})}),[]),$=Object(l.useCallback)((function(e){O({type:"SET_ISSUBMITTING",payload:e})}),[]),K={resetForm:L,validateForm:T,validateField:_,setErrors:R,setFieldError:M,setFieldTouched:B,setFieldValue:U,setStatus:J,setSubmitting:$,setTouched:N,setValues:D,setFormikState:q},Y=hi((function(){return f(E.values,K)})),G=hi((function(){return O({type:"SUBMIT_ATTEMPT"}),T().then((function(e){if(0===Object.keys(e).length){var t=Y();if(void 0===t)return;return Promise.resolve(t).then((function(){b.current&&O({type:"SUBMIT_SUCCESS"})})).catch((function(e){if(b.current)throw O({type:"SUBMIT_FAILURE"}),e}))}b.current&&O({type:"SUBMIT_FAILURE"})}))})),W=hi((function(e){e&&e.preventDefault&&Gr(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Gr(e.stopPropagation)&&e.stopPropagation(),G()})),Z=hi((function(e){if(e&&e.preventDefault&&Gr(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Gr(e.stopPropagation)&&e.stopPropagation(),d.onReset){var t=d.onReset(E.values,K);ei(t)?t.then(L):L()}else L()})),Q=Object(l.useCallback)((function(e){return{value:ti(E.values,e),error:ti(E.errors,e),touched:!!ti(E.touched,e),initialValue:ti(m.current,e),initialTouched:!!ti(y.current,e),initialError:ti(h.current,e)}}),[E.errors,E.touched,E.values]),X=Object(l.useCallback)((function(e){var t=Wr(e),n=t?e.name:e,r=ti(E.values,n),i={name:n,value:r,onChange:V,onBlur:H};if(t){var a=e.type,o=e.value,c=e.as,s=e.multiple;"checkbox"===a?void 0===o?i.checked=!!r:(i.checked=!(!Array.isArray(r)||!~r.indexOf(o)),i.value=o):"radio"===a?(i.checked=r===o,i.value=o):"select"===c&&s&&(i.value=i.value||[],i.multiple=!0)}return i}),[H,V,E.values]),ee=Object(l.useMemo)((function(){return!Se()(m.current,E.values)}),[E.values]),te=Object(l.useMemo)((function(){return void 0!==c?ee?E.errors&&0===Object.keys(E.errors).length:!1!==c&&Gr(c)?c(d):c:E.errors&&0===Object.keys(E.errors).length}),[c,ee,E.errors,d]);return Jr({},E,{initialValues:m.current,initialErrors:h.current,initialTouched:y.current,initialStatus:v.current,handleBlur:H,handleChange:V,handleReset:Z,handleSubmit:W,resetForm:L,setErrors:R,setFormikState:q,setFieldTouched:B,setFieldValue:U,setFieldError:M,setStatus:J,setSubmitting:$,setTouched:N,setValues:D,submitForm:G,validateForm:T,validateField:_,isValid:te,dirty:ee,unregisterField:x,registerField:P,getFieldProps:X,getFieldMeta:Q,validateOnBlur:i,validateOnChange:n,validateOnMount:o})}function pi(e){var t=fi(e),n=e.component,r=e.children,i=e.render;return Object(l.useEffect)((function(){0}),[]),Object(l.createElement)(ai,{value:t},n?Object(l.createElement)(n,t):i?i(t):r?Gr(r)?r(t):Xr(r)?null:l.Children.only(r):null)}function di(e,t,n){var r=e.slice();return t.forEach((function(t,i){if(void 0===r[i]){var a=!1!==n.clone&&n.isMergeableObject(t);r[i]=a?je(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[i]=je(e[i],t,n):-1===e.indexOf(t)&&r.push(t)})),r}var mi="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?l.useLayoutEffect:l.useEffect;function hi(e){var t=Object(l.useRef)(e);return mi((function(){t.current=e})),Object(l.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current.apply(void 0,n)}),[])}function yi(e){var t=e.validate,n=e.name,r=e.render,i=e.children,a=e.as,o=e.component,c=Kr(e,["validate","name","render","children","as","component"]),s=ci(),u=(s.validate,s.validationSchema,Kr(s,["validate","validationSchema"]));Object(l.useEffect)((function(){0}),[]);var f=u.registerField,p=u.unregisterField;Object(l.useEffect)((function(){return f(n,{validate:t}),function(){p(n)}}),[f,p,n,t]);var d=u.getFieldProps(Jr({name:n},c)),m=u.getFieldMeta(n),h={field:d,form:u};if(r)return r(Jr({},h,{meta:m}));if(Gr(i))return i(Jr({},h,{meta:m}));if(o){if("string"==typeof o){var y=c.innerRef,v=Kr(c,["innerRef"]);return Object(l.createElement)(o,Jr({ref:y},d,v),i)}return Object(l.createElement)(o,Jr({field:d,form:u},c),i)}var b=a||"input";if("string"==typeof b){var g=c.innerRef,S=Kr(c,["innerRef"]);return Object(l.createElement)(b,Jr({ref:g},d,S),i)}return Object(l.createElement)(b,Jr({},d,c),i)}var vi=Object(l.forwardRef)((function(e,t){var n=e.action,r=Kr(e,["action"]),i=n||"#",a=ci(),o=a.handleReset,c=a.handleSubmit;return Object(l.createElement)("form",Object.assign({onSubmit:c,ref:t,onReset:o,action:i},r))}));function bi(e){var t=function(t){return Object(l.createElement)(oi,null,(function(n){return n||Vr(!1),Object(l.createElement)(e,Object.assign({},t,{formik:n}))}))},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return t.WrappedComponent=e,t.displayName="FormikConnect("+n+")",Hr()(t,e)}vi.displayName="Form";var gi=function(e,t,n){var r=Si(e);return r.splice(t,0,n),r},Si=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map((function(e){return parseInt(e)})).reduce((function(e,t){return t>e?t:e}),0);return Array.from(Jr({},e,{length:t+1}))}return[]},Ei=function(e){function t(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var i=n.props,a=i.name,o=i.validateOnChange,c=i.formik,s=c.setFormikState,u=c.validateForm;s((function(n){var i="function"==typeof r?r:e,o="function"==typeof t?t:e;return Jr({},n,{values:ni(n.values,a,e(ti(n.values,a))),errors:r?ni(n.errors,a,i(ti(n.errors,a))):n.errors,touched:t?ni(n.touched,a,o(ti(n.touched,a))):n.touched})}),(function(){o&&u()}))},n.push=function(e){return n.updateArrayField((function(t){return[].concat(Si(t),[qr(e)])}),!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Si(e),i=r[t];return r[t]=r[n],r[n]=i,r}(n,e,t)}),!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Si(e),i=r[t];return r.splice(t,1),r.splice(n,0,i),r}(n,e,t)}),!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField((function(n){return gi(n,e,t)}),(function(t){return gi(t,e,null)}),(function(t){return gi(t,e,null)}))},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Si(e);return r[t]=n,r}(n,e,t)}),!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField((function(n){var r=n?[e].concat(n):[e];return t<0&&(t=r.length),r}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n})),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(Yr(n)),n.pop=n.pop.bind(Yr(n)),n}$r(t,e);var n=t.prototype;return n.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?Si(n):[];return t||(t=r[e]),Gr(r.splice)&&r.splice(e,1),r}),!0,!0),t},n.pop=function(){var e;return this.updateArrayField((function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n}),!0,!0),e},n.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,i=t.children,a=t.name,o=t.formik,c=(o.validate,o.validationSchema,Jr({},e,{form:Kr(o,["validate","validationSchema"]),name:a}));return n?Object(l.createElement)(n,c):r?r(c):i?"function"==typeof i?i(c):Xr(i)?null:l.Children.only(i):null},t}(l.Component);Ei.defaultProps={validateOnChange:!0};var Oi=bi(function(e){function t(){return e.apply(this,arguments)||this}$r(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return ti(this.props.formik.errors,this.props.name)!==ti(e.formik.errors,this.props.name)||ti(this.props.formik.touched,this.props.name)!==ti(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},n.render=function(){var e=this.props,t=e.component,n=e.formik,r=e.render,i=e.children,a=e.name,o=Kr(e,["component","formik","render","children","name"]),c=ti(n.touched,a),s=ti(n.errors,a);return c&&s?r?Gr(r)?r(s):null:i?Gr(i)?i(s):null:t?Object(l.createElement)(t,o,s):s:null},t}(l.Component));(function(e){function t(t){var n;n=e.call(this,t)||this;var r=t.render,i=t.children,a=t.component,o=t.as;t.name;return r&&Vr(!1),a&&r&&Vr(!1),o&&i&&Gr(i)&&Vr(!1),a&&i&&Gr(i)&&Vr(!1),r&&i&&!Xr(i)&&Vr(!1),n}$r(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e,t,n){return this.props.shouldUpdate?this.props.shouldUpdate(e,this.props):ti(this.context.values,this.props.name)!==ti(n.values,this.props.name)||ti(this.context.errors,this.props.name)!==ti(n.errors,this.props.name)||ti(this.context.touched,this.props.name)!==ti(n.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length||this.context.isSubmitting!==n.isSubmitting},n.componentDidMount=function(){this.context.registerField(this.props.name,{validate:this.props.validate})},n.componentDidUpdate=function(e){this.props.name!==e.name&&(this.context.unregisterField(e.name),this.context.registerField(this.props.name,{validate:this.props.validate})),this.props.validate!==e.validate&&this.context.registerField(this.props.name,{validate:this.props.validate})},n.componentWillUnmount=function(){this.context.unregisterField(this.props.name)},n.render=function(){var e=this.props,t=(e.validate,e.name),n=e.render,r=e.as,i=e.children,a=e.component,o=(e.shouldUpdate,Kr(e,["validate","name","render","as","children","component","shouldUpdate"])),c=this.context,s=(c.validate,c.validationSchema,Kr(c,["validate","validationSchema"])),u={value:"radio"===o.type||"checkbox"===o.type?o.value:ti(c.values,t),name:t,onChange:c.handleChange,onBlur:c.handleBlur},f={field:u,meta:{value:ti(c.values,t),error:ti(c.errors,t),touched:!!ti(c.touched,t),initialValue:ti(c.initialValues,t),initialTouched:!!ti(c.initialTouched,t),initialError:ti(c.initialErrors,t)},form:s};if(n)return n(f);if(Gr(i))return i(f);if(a){if("string"==typeof a){var p=o.innerRef,d=Kr(o,["innerRef"]);return Object(l.createElement)(a,Jr({ref:p},u,d),i)}return Object(l.createElement)(a,Jr({field:u,form:c},o),i)}var m=r||"input";if("string"==typeof m){var h=o.innerRef,y=Kr(o,["innerRef"]);return Object(l.createElement)(m,Jr({ref:h},u,y),i)}return Object(l.createElement)(m,Jr({},u,o),i)},t}(l.Component)).contextType=ii;var Ci=n(6),Ai=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function wi(e){var t=e.castInitialValues,n=e.castValuesOnSubmit,r=e.initialValues,i=e.onSubmit,a=Ai(e,["castInitialValues","castValuesOnSubmit","initialValues","onSubmit"]),o=t&&e.validationSchema?e.validationSchema.cast(function e(t){var n=Ci.a.deepClone(t);return Object.keys(n).forEach((function(t){n.hasOwnProperty(t)&&(Ci.a.isObject(n[t])?n[t]=e(n[t]):null===n[t]&&delete n[t])})),n}(r)):r,c={allowInitialSubmit:e.allowInitialSubmit};return l.createElement(pi,Object.assign({enableReinitialize:!0},a,{initialValues:o,onSubmit:function(t,r){var a=r.setSubmitting,o=r.resetForm,c=n&&e.validationSchema?e.validationSchema.cast(t):t;i(c,(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.reset&&o(),a(!1)}))},initialStatus:c}),m(e.children)?function(t){return e.children(t)}:l.Children.count(e.children)?e.children:null)}wi.defaultProps={castInitialValues:!0,castValuesOnSubmit:!0};var ji=n(2),Ii=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown(),ki=n(3),Ti=function(e,t,n,r,i){var a="form-control";return"sm"===r&&(a+=" form-control-sm"),"lg"===r&&(a+=" form-control-lg"),ti(t,n)&&ti(e,n)&&(a+=" is-invalid"),i&&(a+=" ".concat(i)),a},Li=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function _i(e){var t=e.label,n=e.checkboxLabelClassName,r=Li(e,["label","checkboxLabelClassName"]);return l.createElement(ki.Form.Group,null,l.createElement("div",{className:"custom-control custom-checkbox"},l.createElement(Vc,Object.assign({className:"custom-control-input"},r)),l.createElement(ki.Form.Label,{className:"custom-control-label cursor-pointer ".concat(n),htmlFor:r.id},t)))}var Pi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return Math.floor(Math.random()*Math.floor(e))};function xi(e){var t=e.title,n=e.placement,r=e.trigger,i=e.spanHack,a=e.children;return i?l.createElement(ki.OverlayTrigger,{placement:n,overlay:l.createElement(ki.Tooltip,{id:"".concat(t,"-").concat(Pi())},t),trigger:r},l.createElement("span",{className:"d-flex justify-content-center align-items-center"},a)):l.createElement(ki.OverlayTrigger,{placement:n,overlay:l.createElement(ki.Tooltip,{id:"".concat(t,"-").concat(Pi())},t),trigger:r},a)}xi.defaultProps={trigger:["hover","click","focus"],placement:"top"};var Ni,Ri,Di=n(37),Mi=n(84),Ui=n.n(Mi),Fi=n(85),Vi=n.n(Fi),Bi=n(86),zi=n.n(Bi),Hi=n(87),qi=n.n(Hi),Ji=(n(88),n(89),n(90)),$i=n.n(Ji),Ki=n(91),Yi=n.n(Ki),Gi=n(92),Wi=n.n(Gi),Zi=n(93),Qi=n.n(Zi),Xi=n(94),ea=n.n(Xi),ta=n(95),na=n.n(ta),ra=n(96),ia=n.n(ra),aa=n(97),oa=n.n(aa),ca=n(98),sa=n.n(ca),ua=n(99),la=n.n(ua),fa=n(100),pa=n.n(fa),da=n(101),ma=n.n(da),ha=n(102),ya=n.n(ha),va=n(103),ba=n.n(va),ga=n(104),Sa=n.n(ga),Ea=n(105),Oa=n.n(Ea),Ca=n(106),Aa=n.n(Ca),wa=n(107),ja=n.n(wa),Ia=n(108),ka=n.n(Ia),Ta=n(109),La=n.n(Ta),_a=n(110),Pa=n.n(_a),xa=n(111),Na=n.n(xa),Ra=n(112),Da=n.n(Ra),Ma=n(113),Ua=n.n(Ma),Fa=n(114),Va=n.n(Fa),Ba=n(115),za=n.n(Ba),Ha=n(116),qa=n.n(Ha),Ja=n(117),$a=n.n(Ja),Ka=(n(118),n(119),n(120)),Ya=n.n(Ka),Ga=n(121),Wa=n.n(Ga),Za=n(122),Qa=n.n(Za),Xa=n(123),eo=n.n(Xa),to=n(124),no=n.n(to),ro=n(125),io=n.n(ro),ao=(n(126),n(127)),oo=n.n(ao),co=n(128),so=n.n(co),uo=n(129),lo=n.n(uo),fo=n(130),po=n.n(fo),mo=n(131),ho=n.n(mo),yo=n(132),vo=n.n(yo),bo=n(133),go=n.n(bo),So=(n(134),n(135)),Eo=n.n(So),Oo=n(136),Co=n.n(Oo),Ao=n(137),wo=n.n(Ao),jo=n(138),Io=n.n(jo),ko=n(139),To=n.n(ko),Lo=n(140),_o=n.n(Lo),Po=n(141),xo=n.n(Po),No=n(142),Ro=n.n(No),Do=n(143),Mo=n.n(Do),Uo=n(144),Fo=n.n(Uo),Vo=n(145),Bo=n.n(Vo),zo=n(146),Ho=n.n(zo),qo=n(147),Jo=n.n(qo),$o=n(148),Ko=n.n($o),Yo=n(149),Go=n.n(Yo),Wo=n(150),Zo=n.n(Wo),Qo=n(151),Xo=n.n(Qo),ec=n(152),tc=n.n(ec),nc=n(153),rc=n.n(nc),ic=n(154),ac=n.n(ic),oc=(n(155),n(156),n(157),n(158)),cc=n.n(oc),sc=(n(159),n(160),n(161),n(162),n(163)),uc=n.n(sc),lc=n(164),fc=n.n(lc),pc=(n(165),n(166),n(167),n(168)),dc=n.n(pc),mc=n(169),hc=n.n(mc),yc=n(170),vc=n.n(yc),bc=n(171),gc=n.n(bc),Sc=n(172),Ec=n.n(Sc),Oc=n(173),Cc=n.n(Oc),Ac=n(174),wc=n.n(Ac),jc=(n(175),n(176),n(177),n(178)),Ic=n.n(jc),kc=n(179),Tc=n.n(kc),Lc=[Ui.a,zi.a,qi.a,$i.a,Qi.a,ea.a,na.a,ia.a,Wi.a,Vi.a,oa.a,sa.a,la.a,pa.a,ma.a,Yi.a,ya.a,ba.a,Sa.a,Oa.a,Aa.a,ja.a,ka.a,Ua.a,Va.a,La.a,Pa.a,Na.a,Da.a,za.a,Qa.a,Ho.a,Ko.a,Jo.a,tc.a,Go.a,Zo.a,Xo.a,po.a,vo.a,ho.a,qa.a,$a.a,so.a,lo.a,oo.a,Ya.a,eo.a,Co.a,wo.a,no.a,io.a,Io.a,Wa.a,Eo.a,To.a,_o.a,go.a,xo.a,Mo.a,Ro.a,rc.a,ac.a,Fo.a,Bo.a,uc.a,fc.a,cc.a,vc.a,hc.a,dc.a,gc.a,Cc.a,Ec.a,wc.a,Tc.a,Ic.a];function _c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e){e.AddToPlaylists="add-to-playlist",e.Caret="caret",e.Delete="delete",e.Edit="edit",e.NoEdit="no-edit",e.Close="close",e.Folder="folder",e.Resources="resources",e.More="more",e.Bell="bell",e.Plus="plus",e.Search="search",e.Share="share",e.Share2="share2",e.Upload="upload",e.Preview="preview",e.CircleCheck="circle-check",e.Down="down",e.Right="right",e.UpDown="up-down",e.ChevronUp="chevron-up",e.ChevronDown="chevron-down",e.ChevronLeft="chevron-left",e.ChevronRight="chevron-right",e.VisibleOff="visible-off",e.VisibleOn="visible-on",e.PublisherArchive="publisher-archive",e.Play="play",e.PlayCircle="play-circle",e.ArrowLeft="arrow-left",e.ArrowRight="arrow-right",e.CheckCircleOutline="check-circle-o",e.CheckCircle="check-circle",e.Check="check",e.Lock="lock",e.Link="link",e.Info="info",e.Question="question",e.Star="star",e.StarOutline="star-o",e.Archive="archive",e.Warning="warning",e.WarningOutline="warning-o",e.NewWindow="new-window",e.File="file",e.FilePDF="file-pdf",e.FileExcel="file-excel",e.FilePowerpoint="file-ppt",e.FileWord="file-word",e.FileImg="file-img",e.FileZip="file-zip",e.Enter="enter",e.Calendar="calendar",e.CloseCaption="close-caption",e.CloseCaptionBadge="close-caption-badge",e.Playlist="playlist",e.Handle="handle",e.Subject="subject",e.Series="series",e.EditClickView="edit-clickview",e.Heart="heart",e.HeartOutline="heart-outline",e.WhiteWave="white-wave",e.Cog="cog",e.Video="video",e.Compass="compass",e.History="history",e.Tag="tag",e.Email="email",e.YearLevel="year-level",e.Subjects="subjects",e.Download="download",e.Print="print",e.CreateInteractive="create-interactive",e.Twitter="twitter",e.Facebook="facebook",e.Classrooms="classrooms",e.Group="group"}(Ni||(Ni={}));var Pc;function xc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}d.extend(Di.config,{autoReplaceSvg:!1,autoAddCss:!1,familyPrefix:"cv",autoA11y:!0,observeMutations:!1,replacementClass:"cv-svg",keepOriginalSource:!1}),(Ri=Di.library).add.apply(Ri,function(e){if(Array.isArray(e))return _c(e)}(Pc=Lc)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(Pc)||function(e,t){if(e){if("string"==typeof e)return _c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_c(e,t):void 0}}(Pc)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());var Nc,Rc=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"getSvg",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.faIconLookup(e,t),r=this.getIcon(n,t);if(r&&(!r||r.html.length))return r.html.pop()}},{key:"getIcon",value:function(e,t){return Di.icon(e,t.iconOptions||{})}},{key:"faIconLookup",value:function(e,t){var n=t.prefix,r=void 0===n?"cv":n;return Di.findIconDefinition({prefix:r,iconName:e})}}])&&xc(t.prototype,n),r&&xc(t,r),e}().Instance,Dc=Ni;function Mc(e){var t=e.svgName,n=e.className,r=void 0===n?"d-inline-block svg-container":n,i=e.tagName,a=void 0===i?"span":i,o=e.size,c=void 0===o?Nc.Standard:o,s=e.onClick,u=e.title,f=e.tooltipPlacement,p=void 0===f?"right":f,d=a,h={dangerouslySetInnerHTML:{__html:Rc.getSvg(t)},className:"".concat(r," ").concat(c),onClick:m(s)?s:null};return u?l.createElement(xi,{title:u,placement:p},l.createElement(d,Object.assign({},h))):l.createElement(d,Object.assign({},h))}function Uc(e){var t=ci().values[e.fieldName];return"string"!=typeof t?l.createElement(l.Fragment,null):l.createElement("div",{className:"float-right text-muted"},t.length,"/",e.limit)}!function(e){e.Standard="std",e.Small="sm",e.Medium="md",e.Large="lg",e.ExtraLarge="xlg",e.XXL="xxlg"}(Nc||(Nc={}));var Fc=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Vc(e){var t=e.children,n=Fc(e,["children"]);return l.createElement(yi,Object.assign({},Ci.a.omit(n,["formSize"])),m(t)?function(e){return t(e)}:l.Children.count(t)?t:null)}function Bc(e){var t=e.label,n=e.className,r=e.showCharacterCounter,i=e.showRequiredStar,a=e.infoTooltip,o=e.formSize,c=Fc(e,["label","className","showCharacterCounter","showRequiredStar","infoTooltip","formSize"]),s=ci(),u=s.errors,f=s.touched;return"checkbox"===c.type?l.createElement(_i,Object.assign({},Ci.a.omit(e,["formSize"]))):l.createElement(ki.Form.Group,null,!!t&&l.createElement(ki.Form.Label,{htmlFor:c.id},t,i&&l.createElement("span",{className:"text-danger"},"*"),a&&l.createElement(xi,{title:a},l.createElement("span",null,l.createElement(Mc,{svgName:Dc.Info})))),l.createElement(Vc,Object.assign({className:Ti(u,f,c.name,o,n)},c)),!!r&&!!c.maxLength&&l.createElement(Uc,{fieldName:c.name,limit:c.maxLength}),l.createElement(Oi,{name:c.name},(function(e){return l.createElement(ki.Form.Control.Feedback,{type:"invalid"},e)})))}function zc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Hc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hc(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qc(e){var t,n=zc(l.useState(!1),2),r=n[0],i=n[1];return l.useEffect((function(){var t;e.isValid&&(e.dirty||(null===(t=e.initialStatus)||void 0===t?void 0:t.allowInitialSubmit))?i(!0):i(!1)}),[e.isValid,null===(t=e.initialStatus)||void 0===t?void 0:t.allowInitialSubmit,e.dirty,e.values]),l.useEffect((function(){e.isSubmitting&&i(!1)}),[e.isSubmitting]),r}var Jc=n(209),$c=n(50),Kc=n(22),Yc=n(4),Gc="AlertService",Wc="LanguageService",Zc=n(11),Qc=n(36);function Xc(e){return(Xc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function es(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ts(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ns(e,t){return(ns=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function rs(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=as(e);if(t){var i=as(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return is(this,n)}}function is(e,t){return!t||"object"!==Xc(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function as(e){return(as=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var os=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ns(e,t)}(a,e);var t,n,r,i=rs(a);function a(){return es(this,a),i.apply(this,arguments)}return t=a,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"name",get:function(){return Wc}},{key:"setConfig",value:function(e){this.polyglot=new Jc({locale:e.locale,phrases:e.phrases.rootElement||e.phrases}),this.cache={}}},{key:"getPhrase",value:function(e,t,n){var r="".concat(e,".").concat(t);if(this.polyglot||Yc.c.throw(new Zc.a("LanguageService config must be set.")),!this.polyglot.has(r)){if(!Qc.a.isDevelopment){var i=window.trackJs;return i&&i.console.error("No phrase set for ".concat(r," in language config")),""}Yc.c.throw(new Zc.a("No phrase set for ".concat(r," in language config.")))}if(!n||d.isEmpty(n)){var a=this.cache[r];if(a)return a;var o=this.polyglot.t(r);return this.cache[r]=o,o}var c=d.omit(n,"smartCount"),s={};for(var u in c){var l=c[u];"number"==typeof l&&(l=l.toString()),s[u]=$c.sanitize(l)}d.isNumber(n.smartCount)&&(s.smart_count=n.smartCount);var f="".concat(r,":").concat(d.values(Object.assign({},s)).join(":")),p=this.cache[f];if(p)return p;var m=this.polyglot.t(r,s);return this.cache[f]=m,m}},{key:"encloseNamespace",value:function(e){var t=this;return function(n,r){return t.getPhrase(e,n,r)}}}])&&ts(t.prototype,n),r&&ts(t,r),a}(Kc.a).Instance,cs=l.createContext(""),ss=l.memo((function(e){var t=e.phrase,n=e.namespace,r=e.options,i=l.useContext(cs),a=n||i,o=os.getPhrase(a,t,r);return l.createElement("span",{dangerouslySetInnerHTML:{__html:o}})}),(function(e,t){return e.namespace===t.namespace&&e.phrase===t.phrase&&Ci.a.isEqual(e.options,t.options)}));function us(e){var t=ci(),n=qc(t);return l.createElement(ki.Button,{variant:e.variant||"primary",type:"submit",disabled:!n,size:e.size},t.isSubmitting?l.createElement(ki.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):e.submitText?l.createElement(l.Fragment,null,e.submitText):l.createElement(ss,{namespace:"shared.formButtons",phrase:e.isNew?"create":"save"}))}function ls(e){var t=ci();return l.createElement(vi,null,l.createElement(Bc,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this company",autoFocus:!0}),l.createElement(us,{isNew:e.isNew}))}function fs(e){return l.createElement(wi,{initialValues:e.company,validationSchema:Ii,onSubmit:e.saveCompany},l.createElement(ls,{isNew:!(e.company&&e.company.id)}))}function ps(e){var t=Object(v.useDispatch)(),n=oe.useBasicFetch(ye(e.id));return l.createElement(l.Fragment,null,!!n.data&&l.createElement(fs,{company:n.data,saveCompany:function(n,r){return oe.fetch(t,be(e.id,n,r))}}))}function ds(){var e=Object(v.useDispatch)();return l.createElement(fs,{saveCompany:function(t,n){oe.fetch(e,ve(t,(function(e){n(),p.AppLinkHelper.trigger({application:c.PEOPLE,action:i.Companies.EDIT_COMPANY,args:[e.id]})}),n))}})}var ms,hs=n(210);function ys(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vs(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bs(e){return(bs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e){e.XS="(max-width: 575px)",e.SM="(min-width: 576px) and (max-width: 767px)",e.MD="(min-width: 768px) and (max-width: 991px)",e.LG="(min-width: 992px)",e.XL="(min-width: 1200px)",e.XXL="(min-width: 1440px)",e.SMDown="(max-width: 576px)",e.MDDown="(max-width: 768px)",e.LGDown="(max-width: 992px)",e.XLDown="(max-width: 1200px)"}(ms||(ms={}));var gs={isNumber:function(e){return gs.isType(e,"number")},isString:function(e){return gs.isType(e,"string")},isType:function(e,t){return bs(e)===t}},Ss=n(21),Es=n.n(Ss);function Os(e){return function(e){if(Array.isArray(e))return Cs(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Cs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cs(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function As(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ws,js=[{empty:!0}];function Is(e,t){return Ci.a.isObject(e)&&e.hasOwnProperty(t)&&gs.isString(e[t])}function ks(e,t,n){return function(r){var i=r.value;if(i.length||n(),!(i.length<e.activationLength)){if(e.local){var a=m(e.getLocalSuggestions)?e.getLocalSuggestions(i,e.local):(c=i,s=e.local,u=e.valueKey,(l=c.trim().toLowerCase()).length?s.filter((function(e){return!(!Is(e,u)||!gs.isString(e[u]))&&e[u].trim().toLowerCase().includes(l)})):[]),o=!a.length&&e.getEmptyStateComponent;t((function(e){var t;return Object.assign(Object.assign({},e),(As(t={},ws.Local,a),As(t,ws.Empty,o?js:[]),t))}))}var c,s,u,l;e.getRemoteUrl&&function(e,t,n,r){var i=m(e)&&e(t);i&&oe.ajaxRequest({resource:i,type:ce.a.GET,success:n,error:function(){},headers:r})}(e.getRemoteUrl,i,(function(n){var r=m(e.formatRemoteSuggestions)?e.formatRemoteSuggestions(n):n,i=!r.length&&e.getEmptyStateComponent;t((function(e){var t;return Object.assign(Object.assign({},e),(As(t={},ws.Remote,r),As(t,ws.Empty,i?js:[]),t))}))}),e.requestHeaders)}}}function Ts(e,t,n,r,i,a,o){var c=function(t){return e[t]||[]},s=t?c(ws.Recent):[],u=c(ws.Local),l=c(ws.Remote),f=c(ws.Empty);if(f.length&&n)return[{data:f}];var p=[];s.length&&p.push({title:r,data:s});var d=[].concat(Os(u),Os(l));return d.length?(Number.isInteger(o)&&d.length>o&&(d=d.slice(0,o)),m(a)?p.push.apply(p,Os(a(d))):p.push({title:i,data:d}),p):p}function Ls(e){return e.data}function _s(e){if(e.title)return l.createElement("div",{className:"pb-1"},l.createElement("strong",null,e.title))}function Ps(e){return{container:"position-relative",suggestionsContainerOpen:"bg-white py-1 border rounded ".concat(Es.a.suggestionsContainerOpen),suggestionsList:"list-unstyled m-0",suggestion:"".concat(e?"":"cursor-pointer"," py-1 px-2"),suggestionHighlighted:e?"":Es.a.suggestionHighlighted,sectionContainer:"border-bottom py-1 ".concat(Es.a.sectionContainer)}}function xs(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=Ps(t),r=Object.assign(n,e);return r}!function(e){e.Local="local",e.Recent="recent",e.Remote="remote",e.Empty="empty"}(ws||(ws={}));var Ns=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Rs(e,t,n,r,i){var a="form-control";return n||(a+=" ".concat(Es.a.inputWithoutHighlight)),"left"===e&&(a+=" ".concat(Es.a.inputWithLeftIcon)),("right"===e&&!t||"left"===e&&t)&&(a+=" ".concat(Es.a.inputWithRightIcon)),"right"===e&&t&&(a+=" ".concat(Es.a.inputWithTwoRightIcons)),"lg"===i&&(a+=" form-control-lg"),"sm"===i&&(a+=" form-control-sm"),r&&(a+="".concat(r)),a}function Ds(e){var t="d-inline-block svg-container";return m(e)?t+" cursor-pointer":t}function Ms(e){var t=e.onClickSearchIcon,n=e.searchIconPlacement,r=e.showClearInputIcon,i=e.onClickClearInput,a=e.highlightOnFocus,o=e.className,c=e.formSize,s=Ns(e,["onClickSearchIcon","searchIconPlacement","showClearInputIcon","onClickClearInput","highlightOnFocus","className","formSize"]),u=function(){return l.createElement("div",{className:"d-inline-block"},l.createElement(Mc,{svgName:Dc.Search,size:Nc.Standard,onClick:t,className:Ds(t)}))};return l.createElement("div",{className:"position-relative ".concat(Es.a.inputContainer)},"left"===n&&l.createElement("div",{className:"".concat(Es.a.iconContainer," ").concat(Es.a.leftIconContainer)},l.createElement(u,null)),l.createElement("input",Object.assign({className:Rs(n,r,a,o,c)},s)),("right"===n||!!r)&&l.createElement("div",{className:"".concat(Es.a.iconContainer," ").concat(Es.a.rightIconContainer)},!!r&&l.createElement((function(){return l.createElement("div",{className:"d-inline-block text-muted ".concat(Es.a.clearButton)},l.createElement(Mc,{svgName:Dc.Close,size:Nc.Standard,onClick:i,className:Ds(i)}))}),null),"right"===n&&l.createElement(u,null)))}function Us(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Fs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fs(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Vs=m;function Bs(e){return e.renderAsForm?l.createElement("form",{onSubmit:e.onSubmit},e.children):l.createElement(l.Fragment,null,e.children)}function zs(e){var t,n,r,i=(t=e.initialSuggestions,n=e.recentSearches,As(r={},ws.Recent,n),As(r,ws.Local,t),As(r,ws.Remote,[]),As(r,ws.Empty,[]),r),a=Us(l.useState(e.initialQuery||""),2),o=a[0],c=a[1],s=Us(l.useState(i),2),u=s[0],f=s[1],p=function(e){var t=ys(Object(l.useState)(window.matchMedia(e).matches),2),n=t[0],r=t[1];return Object(l.useEffect)((function(){var t=window.matchMedia(e);t.matches!==n&&r(t.matches);var i=function(){return r(t.matches)};return t.addListener(i),function(){return t.removeListener(i)}}),[e]),n}(ms.XS);l.useEffect((function(){var t=e.initialQuery||"";o!==t&&c(t)}),[e.initialQuery]);var d=function(){f(i)},h=function(t){t.preventDefault(),Vs(e.onSubmit)&&e.onSubmit(o)};return l.createElement(Bs,{onSubmit:h,renderAsForm:!!e.renderAsForm},l.createElement(hs,Object.assign({suggestions:Ts(u,!o,!!e.getEmptyStateComponent,e.recentSearchHeading||os.getPhrase("shared.searchBar","recentSearchHeading"),e.suggestionsHeading,e.getSections,e.suggestionLimit),onSuggestionsFetchRequested:ks(e,f,d),onSuggestionsClearRequested:function(){e.alwaysRenderSuggestions||d()},onSuggestionSelected:function(t,n){var r=n.suggestion;r.empty||(e.clearQueryOnSelect&&c(""),e.onSuggestionSelected(r))},getSuggestionValue:function(t){return e.updateQueryOnSelection?function(e,t){return Is(t,e)?t[e]:""}(e.valueKey,t):o},renderSuggestion:function(t){return t&&t.empty?o.length>=e.activationLength&&m(e.getEmptyStateComponent)?e.getEmptyStateComponent(o):l.createElement(l.Fragment,null):Vs(e.getSuggestionComponent)?e.getSuggestionComponent(t):function(e,t){return Is(t,e)?l.createElement(l.Fragment,null,t[e]):l.createElement(l.Fragment,null)}(e.valueKey,t)},alwaysRenderSuggestions:e.alwaysRenderSuggestions,focusInputOnSuggestionClick:!p,inputProps:{placeholder:e.placeholder||os.getPhrase("shared.searchBar","placeholder"),value:o,onChange:function(t,n){var r=n.newValue;c(r),Vs(e.onQueryChange)&&e.onQueryChange(r)},onKeyDown:function(t){8===t.keyCode&&e.onBackspace&&!o&&e.onBackspace()},autoFocus:!!e.autoFocusInput,highlightOnFocus:e.highlightInputOnFocus,onClickSearchIcon:!!e.submitOnClickSearchIcon&&h,searchIconPlacement:e.searchIconPlacement,showClearInputIcon:!!e.showClearInputIcon&&!!o.length,onClickClearInput:function(){c(""),Vs(e.onClickClearInput)&&e.onClickClearInput()},formSize:e.size},renderInputComponent:Ms,theme:xs(e.theme,!!u.empty.find((function(e){return e.empty}))),multiSection:!0,renderSectionTitle:_s,getSectionSuggestions:Ls},e.alwaysRenderSuggestionsOnInputFocus?{shouldRenderSuggestions:function(){return!0}}:{})))}zs.defaultProps={updateQueryOnSelection:!0,valueKey:"name",activationLength:3,suggestionLimit:5,recentSearches:[],initialSuggestions:[],searchIconPlacement:"right",renderAsForm:!0};var Hs,qs=n(13);function Js(e){return(Js="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ks(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ys(e,t){return(Ys=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Gs(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Zs(e);if(t){var i=Zs(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ws(this,n)}}function Ws(e,t){return!t||"object"!==Js(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Zs(e){return(Zs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Analytics="AnalyticsService",e.Context="ContextService"}(Hs||(Hs={}));var Qs,Xs=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ys(e,t)}(a,e);var t,n,r,i=Gs(a);function a(){var e;return $s(this,a),(e=i.apply(this,arguments)).contextHistory=[],e}return t=a,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"name",get:function(){return Hs.Context}},{key:"initialize",value:function(){this.listenTo(G.a.SHELL,p.EventNames.ROUTE,this.setContext)}},{key:"setContext",value:function(e){this.contextHistory.length>=5&&this.contextHistory.unshift(),this.contextHistory.push({pageLoad:!this.contextHistory.length,appLink:e})}},{key:"getCurrentContext",value:function(){if(this.contextHistory.length)return this.contextHistory[this.contextHistory.length-1]}},{key:"fromPageLoad",value:function(){return 1===this.contextHistory.length}}])&&Ks(t.prototype,n),r&&Ks(t,r),a}(p.Service)),eu=n(5);!function(e){e.Inlet="event:inlet",e.Outlet="event:outlet"}(Qs||(Qs={}));var tu="global:analytics";function nu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var ru=qs.EventVersion.V1,iu=function(){function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=t,this.data=n,this.actionContext=r,this.eventVersion=i||ru}var t,n,r;return t=e,(n=[{key:"isType",value:function(e){return e===this.type}},{key:"enrich",value:function(e,t){this.validateKey(e),this[e]=t}},{key:"get",value:function(e){if(e&&this[e])return this[e]}},{key:"validateKey",value:function(e){"type"!==e&&"data"!==e||p.ErrorHelper.throw(new Zc.a("".concat(e," is not a valid key"))),this[e]&&p.ErrorHelper.throw(new Zc.a("Event already contains an enrichment named ".concat(e)))}}])&&nu(t.prototype,n),r&&nu(t,r),e}(),au=function(e,t,n,r){eu.Radio.channel(tu).trigger(Qs.Inlet,new iu(e,t,n,r))};function ou(){var e=Xs.getCurrentContext().appLink;return d.isObject(e)||p.ErrorHelper.throw(new Zc.a("Applink does not exist. Check current context.")),e.application.replace(":","-")}function cu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.location,n=e.entity,r=e.workflowPhase,i=void 0===r?null:r,a=e.descriptor,o=void 0===a?null:a;return t||p.ErrorHelper.throw(new Zc.a("location must be set.")),n||p.ErrorHelper.throw(new Zc.a("entity must be set.")),{productArea:ou(),location:t,entity:n,descriptor:o,workflowPhase:i}}function su(){return p.LocationUtils.GetCurrentPath()+p.LocationUtils.GetCurrentQueryString()}var uu={logUserAction:function(e,t){if(function(e){return!(!d.isArray(e)||!d.every(e,(function(e){return d.isObject(e)})))||!!d.isObject(e)}(e)&&d.isObject(t)){var n=uu.buildUserActionEvent(t),r=n.userAction,i=n.action,a=n.eventVersion;au(r,e,i,a)}},logNavigate:function(e,t){var n=Object.assign({currentLocation:su(),appLink:e},t);au(qs.UserAction.Navigate,n)},mergeOptions:function(e,t){return d.extend({},e,t)},buildActionContext:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return cu(e)},buildUserActionEvent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.actionType,n=e.eventVersion,r=t,i=cu(e);return{userAction:r,action:i,eventVersion:n}},buildCurrentLocation:function(){return su()},buildSearchEvent:function(e,t){return{data:{query:e},action:cu({entity:qs.EntityType.Video,location:qs.LocationContext.SearchBar,descriptor:t})}},buildInstantSearchEvent:function(e,t,n){var r;n===qs.SearchQueryType.Series&&(r=qs.EntityType.Series),n===qs.SearchQueryType.Folder&&(r=qs.EntityType.Folder),n===qs.SearchQueryType.Tags&&(r=qs.EntityType.Tag),n===qs.SearchQueryType.Video&&(r=qs.EntityType.Video),n===qs.SearchQueryType.Subjects&&(r=qs.EntityType.Classification);var i={instant:{},query:e};return t.id&&(i.instant.selectedId=t.id),t.name&&(i.instant.selectedName=t.name),{data:i,action:cu({entity:r,location:qs.LocationContext.SearchBar})}},mapInteractionType:function(e){switch(e){case qs.InteractionType.DragDrop:return qs.InteractionTypeDescriptor.DragDrop;case qs.InteractionType.FileSelect:return qs.InteractionTypeDescriptor.FileSelect;default:return}}};function lu(e){var t=e.appLink,n=e.appLinkOptions,r=e.className,i=e.style,a=e.children,o=e.tag,c=void 0===o?"a":o;if(!t)return l.createElement("span",{className:r||""},a);var s=p.AppLinkHelper.getHref(t),u={onClick:function(r){var i;r.preventDefault(),null===(i=e.onClick)||void 0===i||i.call(e,r),e.analyticsData&&e.analyticsOptions&&uu.logUserAction(Object.assign({href:s},e.analyticsData),e.analyticsOptions),p.AppLinkHelper.trigger(t,n)},href:s,className:r,style:i};return e.title&&(u.title=e.title),l.createElement(c,Object.assign({},u),a)}function fu(e){var t=e.backToName,n=e.appLink;return l.createElement(lu,{appLink:n,className:"d-inline-flex align-items-center"},l.createElement(Mc,{svgName:Dc.ArrowLeft,size:Nc.Small}),l.createElement("span",{className:"ml-1"},"Back to ".concat(t)))}function pu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return du(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return du(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function du(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}lu.defaultProps={appLinkOptions:{}};var mu,hu,yu,vu,bu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function gu(e){var t=e.selected,n=e.onToggle,r=bu(e,["selected","onToggle"]),i=pu(l.useState(t),2),a=i[0],o=i[1];l.useEffect((function(){return o(t)}),[t]);return l.createElement(ki.Form.Check,Object.assign({type:"checkbox",id:"checkbox-".concat(Pi()),checked:a,onChange:function(){o(!a),n(!a)}},r))}!function(e){e.Small="small",e.Medium="medium",e.Large="large"}(mu||(mu={})),function(e){e[e.Thumbnails=0]="Thumbnails",e[e.Banners=1]="Banners",e[e.Avatars=2]="Avatars",e[e.Logos=3]="Logos",e[e.Covers=4]="Covers",e[e.Posters=5]="Posters",e[e.TallPosters=6]="TallPosters",e[e.HeroBanners=7]="HeroBanners",e[e.None=99999]="None"}(hu||(hu={})),function(e){e[e.Crop=0]="Crop",e[e.Stretched=1]="Stretched",e[e.Cover=2]="Cover"}(yu||(yu={})),function(e){e[e.None=0]="None",e[e.ImageAPIv1=1]="ImageAPIv1",e[e.FileAPIv1=2]="FileAPIv1",e[e.ImageAPIv2=3]="ImageAPIv2"}(vu||(vu={}));var Su,Eu,Ou=function(e,t){var n=d.map(t,(function(e,t){return t&&Array.isArray(e)?e.map((function(e){return"".concat(t,"=").concat(encodeURIComponent(e))})).join("&"):t&&void 0!==e?"".concat(t,"=").concat(encodeURIComponent(e)):""})),r=d.reduce(n,(function(e,t){return t?e?"".concat(e,"&").concat(t):t:e}));return r?"".concat(e,"?").concat(r):e},Cu=function(e,t){if(e){var n=e;return e.endsWith("/")||(n+="/"),t?n+=t.startsWith("/")?t.slice(1):t:n}};function Au(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.Banner="banner",e.Thumbnail="thumbnail"}(Eu||(Eu={}));var wu,ju=(Au(Su={},hu.Banners,Eu.Banner),Au(Su,hu.Thumbnails,Eu.Thumbnail),Su),Iu=function(e){return"/v1/category-map/".concat(e)},ku={createUrl:function(e,t){return ku._createUrl(e,t)},createBannerUrl:function(e,t,n){return e&&e.url?ku._createUrl(e.url,n):ku._createCategoryMappedUrl(t,n)},createResourceImage:function(e,t,n){return ku._createUrl(e,Object.assign({url:t},n))},Rfc3986EncodeURIComponent:function(e){return encodeURIComponent(e).replace(/[!'()*]/g,escape)},_createCategoryMappedUrl:function(e,t){var n=e.fallbackBaseUrl,r=e.fallbackCategoryName,i=e.type,a=Cu(n,"".concat(Iu(ju[i]))),o=Object.assign({name:ku.Rfc3986EncodeURIComponent(r)},t);return ku._createUrl(a,o)},_createUrl:function(e,t){if(e){if(Ci.a.isEmpty(t))return e;var n=$.param(t),r=-1===e.indexOf("?")?"?":"&",i=e;return i.endsWith("/")&&(i=i.slice(0,-1)),i+"".concat(r).concat(n)}},legacyCreateThumbnailUrl:function(e,t){if(!e)return"";var n;if(e&&(n=e instanceof p.Model?e.get("url"):"string"==typeof e?e:e.url)){var r=Object.assign({size:mu.Small,bgColor:"000"},t);return ku._createUrl(n,r)}}};function Tu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Lu=(Tu(wu={},hu.Thumbnails,{width:1280,height:720}),Tu(wu,hu.Banners,{width:3600,height:666}),Tu(wu,hu.Covers,{width:1080,height:1080}),Tu(wu,hu.Posters,{width:1e3,height:1500}),Tu(wu,hu.TallPosters,{width:1080,height:1920}),Tu(wu,hu.HeroBanners,{width:1920,height:640}),Tu(wu,hu.None,{width:1,height:1}),Tu(wu,hu.Avatars,{width:256,height:256}),wu);function _u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xu,Nu=l.createContext(void 0),Ru=function(e){var t=e.children,n=_u(l.useState(),2),r=n[0],i=n[1],a=_u(l.useState(!1),2),o=a[0],c=a[1],s=_u(l.useState(),2),u=s[0],f=s[1],p={getDataUrl:function(){var e=r;return i(null),e},setDataUrl:i,imageUploaded:o,getImage:function(){var e=u;return f(null),c(!1),e},setImage:function(e){f(e),c(!0)}};return l.createElement(Nu.Provider,{value:p},t)},Du={onFileSelect:function(e,t,n){if(t&&t.length){var r=new FileReader;r.addEventListener("load",(function(){return Du.onReaderLoad(r,e,n)})),r.readAsDataURL(t[0])}},onReaderLoad:function(e,t,n){var r=new Image;r.src=e.result;var i=Lu[t].width,a=Lu[t].height;r.addEventListener("load",(function(){Du.isImageValid(t,r)&&m(n)?n(r):alert("Image too small: minimum dimensions are ".concat(i," x ").concat(a))}))},isImageValid:function(e,t){var n=Lu[e].width,r=Lu[e].height;return!(n&&t.width<n)&&!(r&&t.height<r)},mapImageTypeToString:function(e){switch(e){case hu.Avatars:return"avatars";case hu.Thumbnails:return"thumbnails";case hu.Logos:return"logos";case hu.Covers:return"covers";case hu.Posters:return"posters";case hu.TallPosters:return"tallposters";case hu.HeroBanners:return"herobanners";case hu.None:default:return""}}},Mu=["pdf"],Uu=["doc","docx","dotx","dot","rtf","docm","odt"],Fu=["csv","txt"],Vu=["xls","xlt","xlsx"],Bu=["jpg","tif","png","bmp","gif","jpeg"],zu=["zip","rar"],Hu=["ppt","pot","pps","pptx"],qu=["srt"],Ju={IMAGES:".".concat(Bu.join(",.")),RESOURCES:".".concat([].concat(Uu,Vu,Hu,Mu,Fu,Bu,zu).join(",.")),SUBTITLES:".".concat(qu.join(",."))},$u=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Ku(e){var t=e.onFileSelect,n=e.acceptMultiple,r=e.mimeType,i=e.label,a=e.error,o=e.touched,c=$u(e,["onFileSelect","acceptMultiple","mimeType","label","error","touched"]),s="custom-file-input cursor-pointer";a&&o&&(s+=" is-invalid");var u=Object.assign({type:"file",className:s,onChange:function(e){var n=e.currentTarget.files;n&&n.length&&m(t)&&t(n)},autoComplete:"off",value:"",multiple:!!n},r?{accept:r}:{});return l.createElement("div",{className:"form-group"},l.createElement("div",{className:"custom-file"},l.createElement(yi,Object.assign({},u,c),e.children),l.createElement(ki.Form.Label,{className:"custom-file-label",htmlFor:c.id},i)))}function Yu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Gu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Wu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Zu=(Wu(xu={},hu.Thumbnails,"Thumbnail"),Wu(xu,hu.Banners,"Banner"),Wu(xu,hu.Avatars,"Avatar"),Wu(xu,hu.Logos,"Logo"),Wu(xu,hu.Covers,"Cover"),Wu(xu,hu.Posters,"Poster"),Wu(xu,hu.TallPosters,"Tall Poster"),Wu(xu,hu.HeroBanners,"Hero Banner"),Wu(xu,hu.None,"Image"),xu);function Qu(e){var t=ci(),n=ti(null==t?void 0:t.values,e.fieldName),r=l.useContext(Nu),i=r.setDataUrl,a=r.getImage,o=r.imageUploaded,c=Yu(l.useState(!1),2),s=c[0],u=c[1],f=Yu(l.useState(n),2),d=f[0],h=f[1],y=Yu(l.useState(!1),2),v=y[0],b=y[1];function g(t){u(!0),i(t.src),p.AppLinkHelper.trigger({application:e.application,action:e.uploadAction,args:[e.imageType]})}l.useEffect((function(){if(s){var n,r=a();if(r)u(!1),h(r),n=r,m(e.setSelectedImage)?e.setSelectedImage(n):t&&t.setFieldValue(e.fieldName,{fileId:n.id,fileIdType:vu.ImageAPIv2})}}),[o]);var S=e.label||Zu[e.imageType]||"Image";return l.createElement("div",{className:"form-group"},l.createElement("div",{className:"form-control h-auto py-2"},l.createElement("label",null,S),l.createElement("em",{className:"ml-1 text-muted"},"(Minimum dimensions are ".concat(Lu[e.imageType].width,"px")+" x ".concat(Lu[e.imageType].height,"px)")),l.createElement(Ku,{label:"Choose a ".concat(S.toLowerCase()),name:"image",mimeType:Ju.IMAGES,onFileSelect:function(t){return Du.onFileSelect(e.imageType,t,g)}}),!!d&&!!d.url&&l.createElement(l.Fragment,null,!v&&l.createElement("div",{className:"pb-2 ".concat(e.imageType===hu.Banners?"w-100":"w-50")},l.createElement("img",{src:ku.createUrl(d.url),className:"img img-fluid"})),l.createElement("div",{className:"d-flex justify-content-center"},l.createElement(Mc,{svgName:v?Dc.ChevronDown:Dc.ChevronUp,size:Nc.Large,className:"svg-container cursor-pointer",onClick:function(){return b(!v)},title:v?"Show image":"Hide image",tooltipPlacement:"top"})))))}function Xu(e,t){return t?{application:e.application,action:e.action,args:e.args,params:Object.assign({},e.params,{cursor:t})}:null}function el(e){var t=e.appLink,n=e.cursors,r=e.className,i=e.buttonVariant;function a(e){uu.logUserAction({page:e},{location:qs.LocationContext.Pagination,entity:qs.EntityType.Pagination,actionType:qs.UserAction.Navigate})}return l.createElement(cs.Provider,{value:"shared.pagination"},l.createElement("div",{className:r},l.createElement(lu,{appLink:Xu(t,n.previous),className:"btn btn-".concat(i," mr-1 ").concat(n.previous?"":"disabled"),onClick:function(){return a("previous")}},l.createElement(ss,{phrase:"previous"})),l.createElement(lu,{appLink:Xu(t,n.next),className:"btn btn-".concat(i," ").concat(n.next?"":"disabled"),onClick:function(){return a("next")}},l.createElement(ss,{phrase:"next"}))))}function tl(e){if(!e.collection)return l.createElement(l.Fragment,null);var t=e.collection,n=t.data,r=t.pagination;return l.createElement(l.Fragment,null,!!n&&l.createElement(ml,{objects:n,getObjectAppLink:e.getObjectAppLink,newObjectAppLink:e.newObjectAppLink,objectName:e.objectName}),!!r&&!!r.cursors&&l.createElement(el,{cursors:r.cursors,appLink:e.collectionAppLink}))}el.defaultProps={className:"py-2",buttonVariant:"secondary"};var nl=n(42),rl=n.n(nl);function il(e){var t="".concat(e.className," ").concat(rl.a.iconButton);e.children?t+=" ".concat(rl.a.iconWithText):t+=" ".concat(rl.a.iconOnly);var n=l.createElement(Mc,{svgName:e.svgName,className:"svg-container ".concat(rl.a.svg),size:e.svgSize});return e.appLink?l.createElement(lu,{appLink:e.appLink,className:t,onClick:e.onClick,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},n,e.children):l.createElement("button",{className:t,onClick:function(t){e.analyticsData&&e.analyticsOptions&&uu.logUserAction(e.analyticsData,e.analyticsOptions),m(e.onClick)&&e.onClick(t)}},n,e.children)}var al=n(211),ol=n.n(al);function cl(e){var t="dropdown-item";return e&&(t+=" ".concat(e)),t}function sl(e){if(e.action.appLink)return l.createElement(lu,{appLink:e.action.appLink,onClick:e.action.onClick,className:cl(e.action.className),analyticsData:e.action.analyticsData,analyticsOptions:e.action.analyticsOptions},e.action.label);function t(){e.action.analyticsData&&e.action.analyticsOptions&&uu.logUserAction(e.action.analyticsData,e.action.analyticsOptions),m(e.action.onClick)&&e.action.onClick()}return l.createElement("span",{className:"cursor-pointer ".concat(cl(e.action.className)),onClick:t,role:"button",tabIndex:0,onKeyDown:function(e){return"Enter"===e.key&&t()}},e.action.label)}function ul(e){if(!e.actions||!e.actions.length)return l.createElement(l.Fragment,null);var t="dropdown";e.className&&(t+=" ".concat(e.className));var n="actions-dropdown-".concat(Pi()),r="dropdown-toggle px-0 ".concat(ol.a.dropdownToggle);return e.dropdownToggleClassName&&(r+=" ".concat(e.dropdownToggleClassName)),l.createElement("div",{className:t},l.createElement("button",{className:r,type:"button",id:n,"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},l.createElement(Mc,{svgName:Dc.More,size:Nc.Small})),l.createElement("div",{className:"dropdown-menu dropdown-menu-right","aria-labelledby":n},e.actions.map((function(e,t){return e.tooltip?l.createElement(xi,{title:e.tooltip,spanHack:!0},l.createElement(sl,{key:t,action:e})):l.createElement(sl,{key:t,action:e})}))))}function ll(e){var t=e.showSpinner?l.createElement(ki.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):e.children;if(e.tooltip)return l.createElement(xi,{title:e.tooltip},l.createElement("span",null,l.createElement(il,{appLink:e.appLink,svgName:e.svgName,svgSize:e.svgSize,onClick:e.onClick,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},t)));if(e.svgName)return l.createElement(il,{onClick:e.onClick,appLink:e.appLink,svgName:e.svgName,svgSize:e.svgSize,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},t);if(e.appLink)return l.createElement(lu,{onClick:e.onClick,appLink:e.appLink,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},t);return l.createElement("button",{onClick:function(t){e.analyticsData&&e.analyticsOptions&&uu.logUserAction(e.analyticsData,e.analyticsOptions),m(e.onClick)&&e.onClick(t)},className:e.className},t)}function fl(e){var t=l.useMemo((function(){return e.actions.sort((function(e,t){return e.order-t.order}))}),[e.actions]),n=[],r=[];t.forEach((function(e){e.button?n.push(e):r.push(e)}));var i="d-flex";return e.className&&(i+=" ".concat(e.className)),n.length||r.length?l.createElement("div",{className:i},l.createElement(l.Fragment,null,l.createElement("span",{className:"d-flex align-items-center"},n.length?n.map((function(e,t){return l.createElement(l.Fragment,{key:t},function(){if(e.label)return l.createElement(ll,{appLink:e.appLink,onClick:e.onClick,svgName:e.svgName,className:e.className,tooltip:e.tooltip,showSpinner:e.showSpinner,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},e.label);var t=l.createElement(il,{appLink:e.appLink,onClick:e.onClick,svgName:e.svgName,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions});return e.tooltip?l.createElement(xi,{title:e.tooltip,spanHack:!0},t):t}())})):l.createElement(l.Fragment,null),e.sortComponent&&e.sortComponent,r.length?l.createElement(ul,{actions:r,dropdownToggleClassName:e.actionsDropdownClassName}):l.createElement(l.Fragment,null)))):l.createElement(l.Fragment,null)}function pl(e){var t=e.object,n=e.actions;return l.createElement("div",{className:"d-flex justify-content-between py-2"},!!t&&l.createElement("h5",null,t.name),!!n&&l.createElement("span",null,l.createElement(fl,{actions:n})))}function dl(e){return l.createElement("tr",null,l.createElement("td",null,l.createElement(lu,{appLink:e.appLink},e.object.name)),l.createElement("td",null))}function ml(e){return l.createElement(ki.Table,{responsive:!0},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",null,"Name"),l.createElement("th",null,l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(lu,{appLink:e.newObjectAppLink},l.createElement(Mc,{svgName:Dc.Plus,size:Nc.Small}),l.createElement("span",null,"New ".concat(e.objectName))))))),l.createElement("tbody",null,e.objects.map((function(t){return l.createElement(dl,{key:t.id,object:t,appLink:e.getObjectAppLink(t)})}))))}function hl(e){var t=e.objects,n=e.getAppLink,r=e.emptyMessage;return t?t.length?l.createElement("ul",{className:"list-unstyled"},t.map((function(e,t){return l.createElement("li",{key:t,className:"border rounded mb-3"},l.createElement(lu,{appLink:n(e),className:"d-block p-3"},e.name))}))):l.createElement("div",{className:"py-3"},l.createElement("p",null,r)):l.createElement(l.Fragment,null)}ul.defaultProps={dropdownToggleClassName:"btn btn-light"},hl.defaultProps={emptyMessage:"There is nothing here."};function yl(e){var t=ci();return l.createElement(Bc,{as:"select",label:"Rating",name:"rating",id:"rating",value:t.values.rating&&t.values.rating.id,onChange:function(e){return t.setFieldValue("rating",e.target.value?{id:e.target.value}:{})},disabled:e.disabled},l.createElement(l.Fragment,null,l.createElement("option",{value:""},"Please select a rating"),e.ratings.map((function(e,t){return l.createElement("option",{key:t,value:e.id},function(e){return"".concat(e.name).concat(e.code?" (".concat(e.code,")"):"")}(e))}))))}var vl={isItemActive:function(e,t){return t||(t=p.AppLinkHelper.getCurrentAppLink()),t.application===e.appLink.application&&(Array.isArray(e.activeActions)?e.activeActions.includes(t.action):t.action===e.appLink.action)}},bl=function(e){return Object.values(e).every((function(e){return!!e}))},gl=(n(212),function(e,t){return!!e&&!!t&&e.toString()===t.toString()}),Sl=function(e){return e.split(" ").map((function(e){return(e[0]?e[0].toUpperCase():"")+(e.substr(1)?e.substr(1).toLowerCase():"")})).join(" ")};function El(e){return function(e){if(Array.isArray(e))return Ol(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ol(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ol(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ol(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Cl={find:function(e,t){if(e&&e.children&&e.children.length)for(var n=function e(n){if(gl(n.id,t))return n;var r=n.children;if(r&&r.length)for(var i=0;i<r.length;i++){var a=e(r[i]);if(a)return a}},r=0;r<e.children.length;r++){var i=n(e.children[r]);if(i)return i}},getPath:function(e,t){for(var n=[t],r=function(e){return e.hasOwnProperty("parentIds")&&Array.isArray(e.parentIds)&&e.parentIds.length?e.parentIds[0]:e.hasOwnProperty("parentId")?e.parentId:null},i=r(t);i;){var a=Cl.find(e,i);a&&(n=[a].concat(El(n))),i=a?r(a):null}return n}},Al=function(e){return e&&e.groups?e.groups.map((function(e){return e.name})):[]};function wl(e){var t=e.tabs,n=e.isItemActive;return l.createElement(ki.Nav,{fill:!0,variant:"tabs"},t.map((function(e,t){return l.createElement(ki.Nav.Item,{key:t},l.createElement(lu,{appLink:e.appLink,className:(r=n(e),r?"nav-link active":"nav-link")},e.label));var r})))}wl.defaultProps={isItemActive:vl.isItemActive};var jl=n(24),Il=n.n(jl);function kl(e){var t=e.name,n=e.appLink,r=e.onSelect,i=e.isDisabled,a=e.className,o=e.actions,c=Il.a.text;return a&&(c+=" ".concat(a)),i?l.createElement("a",{className:"".concat(c," text-muted ").concat(Il.a.disabled)},t):l.createElement(l.Fragment,null,n?l.createElement(lu,{appLink:n,className:c},t):l.createElement("a",{onClick:r,className:c},t),!!o&&l.createElement(fl,{className:Il.a.actions,actions:o}))}function Tl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ll(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ll(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ll(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _l(e){var t=e.tree,n=e.selectedIds,r=e.getAppLink,i=e.onSelect,a=e.isDisabled,o=e.actions,c=Array.isArray(n)&&n.some((function(e){return gl(t.id,e)})),s=l.useMemo((function(){return Array.isArray(n)&&n.some((function(e){return Cl.find(t,e)}))}),[t,n]),u=Tl(l.useState(s),2),f=u[0],p=u[1],d=!!t.children&&!!t.children.length,h={name:t.name,appLink:m(r)?r(t):null,onSelect:m(i)?function(){return i(t)}:null,isDisabled:!!m(a)&&a(t),className:c&&Il.a.selected||s&&Il.a.parentOfSelected,actions:!!o&&o.map((function(e){return Object.assign(Object.assign({},e),{appLink:e.getAppLink(t)})}))};return l.createElement("li",{className:"position-relative".concat(f?"":" ".concat(Il.a.collapsed))},l.createElement("div",{className:"position-relative"},l.createElement("span",{className:Il.a.node},d&&l.createElement(Mc,{svgName:Dc.ChevronDown,size:Nc.Small,className:"svg-container ".concat(Il.a.chevron),onClick:function(){return p(!f)}}),l.createElement(kl,Object.assign({},h))),f&&l.createElement(xl,Object.assign({},e))))}var Pl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function xl(e){var t=e.tree,n=Pl(e,["tree"]);return t&&t.children?l.createElement("ul",{className:"m-0 p-0 ".concat(Il.a.tree)},t.children.map((function(e){return l.createElement(_l,Object.assign({key:e.id,tree:e},n))}))):l.createElement(l.Fragment,null)}var Nl={getChord:function(e,t){return Cl.getPath(e,t).map((function(e){return e.name})).join(" -> ")},getState:function(e,t){var n={};return Array.isArray(e)&&e.forEach((function(e){var r,i,a,o=Cl.find(t,e);o&&(n=Object.assign((r={},i=e,a=Nl.getChord(t,o),i in r?Object.defineProperty(r,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[i]=a,r),n))})),n}};function Rl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Dl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dl(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ml=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Ul(e){var t=e.onSelect,n=e.label,r=e.hideCollapseBtn,i=e.collapse,a=e.noSelectionMessage,o=e.isNodeDisabled,c=e.getSelectedItemAppLink,s=Ml(e,["onSelect","label","hideCollapseBtn","collapse","noSelectionMessage","isNodeDisabled","getSelectedItemAppLink"]),u=s.tree,f=s.selectedIds,p=Rl(l.useState(Nl.getState(f,u)),2),d=p[0],h=p[1];l.useEffect((function(){return h(Nl.getState(f,u))}),[f,u]);var y=Rl(l.useState(!!i),2),v=y[0],b=y[1];l.useEffect((function(){return b(!!i)}),[i]);var g=!r||!!n;return l.createElement(l.Fragment,null,g&&l.createElement("div",{className:"pb-2"},!!n&&l.createElement("label",{className:"m-0"},n),!r&&l.createElement("a",{className:"float-right cursor-pointer",onClick:function(){return b(!v)}},v?"Expand":"Collapse")),!v&&l.createElement("div",{className:"py-2 border-top"},l.createElement(xl,Object.assign({onSelect:function(e){return m(t)&&t(e)},isDisabled:o},s))),(!Ci.a.isEmpty(d)||!!a)&&l.createElement("div",{className:"py-2 border-top"},l.createElement("label",null,"Selected:"),l.createElement("ul",{className:"m-0"},Ci.a.isEmpty(d)?l.createElement("li",null,a):Object.keys(d).map((function(e,t){return l.createElement("li",{key:t},m(c)?l.createElement(lu,{appLink:c(e)},d[e]):d[e])})))))}var Fl=n(51);var Vl=function(e){return e&&!(e.data&&e.data.length)},Bl=function(e){return e&&e.data&&e.data.length},zl=function(e){var t="bg-white";return e&&(t+=" ".concat(e)),t};function Hl(e){var t=e.video,n=e.getVideoAppLink,r=e.getVideoActions,i=e.className,a=void 0===i?"":i,o=e.itemNumber,c=m(n)&&n(t);return l.createElement("tr",{className:zl(a)},!!o&&l.createElement("td",null,l.createElement("span",null,o)),l.createElement("td",null,c?l.createElement(lu,{appLink:c},t.name):t.name),m(r)&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(fl,{actions:r(t)}))))}var ql=Object(Fl.SortableElement)((function(e){return l.createElement(Hl,Object.assign({sortable:!0},e))})),Jl=n(32),$l=n.n(Jl),Kl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},Yl=function(e){var t=e.sortable,n=e.getVideoActions;return l.createElement("thead",null,l.createElement("tr",null,!!t&&l.createElement("th",null,"#"),l.createElement("th",null,"Name"),!!n&&l.createElement("th",null)))},Gl=l.forwardRef((function(e,t){var n=e.videos,r=e.sortable,i=Kl(e,["videos","sortable"]);return l.createElement("tbody",{ref:t},!Vl(n)&&n.data.map((function(e,t){return r?l.createElement(ql,Object.assign({key:e.id,index:t,itemNumber:t+1,video:e,className:$l.a.draggableVideoItem},i)):l.createElement(Hl,Object.assign({video:e},i))})))}));var Wl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},Zl=Object(Fl.SortableContainer)((function(e){var t=e.forwardedRef,n=Wl(e,["forwardedRef"]);return l.createElement(Gl,Object.assign({sortable:!0,ref:t},n))})),Ql=function(e){return function(t){var n=t.node,r=e.current;if(r){r.classList.add($l.a.sortingContainer);var i=r.querySelector(".".concat($l.a.draggedVideoItem));n.childNodes.forEach((function(e,t){return i.childNodes[t].style.width="".concat(e.offsetWidth,"px")}))}}},Xl=function(e,t){return function(n){var r=e.current;r&&r.classList.remove($l.a.sortingContainer),t(n.oldIndex,n.newIndex)}};function ef(e){var t=e.onSortEnd,n=e.emptyMessage,r=Wl(e,["onSortEnd","emptyMessage"]),i=l.useRef();return Vl(e.videos)?l.createElement("div",null,n):l.createElement(ki.Table,{responsive:!0},l.createElement(Yl,Object.assign({sortable:!0},e)),l.createElement(Zl,Object.assign({forwardedRef:i,onSortStart:Ql(i),onSortEnd:Xl(i,t),lockAxis:"y",lockToContainerEdges:!0,distance:1,helperClass:$l.a.draggedVideoItem,helperContainer:function(){return i.current}},r)))}function tf(e){var t=e.alias,n=e.onDelete;return l.createElement("li",{className:"list-group-item d-flex justify-content-between"},t.name,l.createElement(Mc,{svgName:Dc.Delete,onClick:function(){return n(t.id)}}))}function nf(e){var t=e.aliases,n=e.onDelete;return l.createElement("ul",{className:"list-group mb-3"},t?t.map((function(e){return l.createElement(tf,{key:e.id,alias:e,onDelete:n})})):l.createElement("span",null,"Currently there are no aliases for this object."))}function rf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return af(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return af(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function af(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}ef.defaultProps={emptyMessage:"There are no videos in this list."};var of=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function cf(e){var t=e.showSpinner,n=e.children,r=of(e,["showSpinner","children"]),i=l.useRef(),a=rf(l.useState({}),2),o=a[0],c=a[1];return l.useEffect((function(){var e=o.width,t=o.height;if(!e||!t){var n=i.current,r=n.offsetHeight,a=n.offsetWidth;r&&a&&c({width:a,height:r})}})),l.useEffect((function(){var e=o.width,t=o.height;if(e&&t){var n=i.current;n.style.width="".concat(e+1,"px"),n.style.height="".concat(t+1,"px")}}),[o]),l.createElement(ki.Button,Object.assign({ref:i,disabled:t},r),t?l.createElement(ki.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):n)}var sf=Object(ji.object)().shape({name:Object(ji.string)().trim().max(255,"Name is too long").required("Name is required").default("")});function uf(){var e=ci(),t=qc(e);return l.createElement(vi,null,l.createElement(Bc,{label:"Create an alias",name:"name",id:"name",value:e.values.name,placeholder:"Add an alias"}),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(cf,{showSpinner:e.isSubmitting,type:"submit",disabled:!t},"Add")))}function lf(e){var t=e.onSave;return l.createElement(wi,{initialValues:{name:""},validationSchema:sf,onSubmit:function(e,n){t(e,(function(){return n({reset:!0})}))}},l.createElement(uf,null))}function ff(e){var t=e.onSave,n=e.aliases,r=e.onDelete;return l.createElement("div",{className:"w-50"},l.createElement("h1",null,"Aliases"),l.createElement(nf,{aliases:n,onDelete:r}),l.createElement(lf,{onSave:t}))}var pf=c.COMPANIES,df=function(e){return{application:pf,action:i.Companies.EDIT_COMPANY,args:[e.id]}},mf=function(e){return p.AppLinkHelper.trigger(df(e))};function hf(e){var t=oe.useBasicFetch(he(e.cursor));return l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-3 w-50"},l.createElement(zs,{placeholder:"Search for a company",onSuggestionSelected:mf,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/companies/instant/raw","?q=").concat(e)},activationLength:2})),l.createElement(tl,{collection:t&&t.data,collectionAppLink:{application:pf,action:i.Companies.COMPANIES},newObjectAppLink:{application:pf,action:i.Companies.NEW_COMPANY},getObjectAppLink:df,objectName:"Company"}))}function yf(e){return(yf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gf(e,t,n){return t&&bf(e.prototype,t),n&&bf(e,n),e}function Sf(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ef(e,t)}function Ef(e,t){return(Ef=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Of(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Af(e);if(t){var i=Af(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Cf(this,n)}}function Cf(e,t){return!t||"object"!==yf(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Af(e){return(Af=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var wf=function(e){Sf(n,e);var t=Of(n);function n(){return vf(this,n),t.apply(this,arguments)}return gf(n,[{key:"channelName",get:function(){return c.COMPANIES}},{key:"appRoutes",get:function(){return{"manage/companies(/)":"companies","manage/companies/new(/)":"newCompany","manage/companies/:id(/)":"editCompany"}}}]),n}(p.AppRouter),jf=function(e){Sf(n,e);var t=Of(n);function n(){return vf(this,n),t.apply(this,arguments)}return gf(n,[{key:"name",get:function(){return"Companies Application"}},{key:"channelName",get:function(){return c.COMPANIES}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT}}},{key:"companies",value:function(e){var t=e.cursor;this.layout.showChildView(k,l.createElement(hf,{cursor:t}))}},{key:"newCompany",value:function(){this.layout.showChildView(k,l.createElement(ds,null))}},{key:"editCompany",value:function(e){this.layout.showChildView(k,l.createElement(ps,{id:e}))}}],[{key:"router",get:function(){return wf}}]),n}(p.Application);function If(e){return(If="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function kf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Lf(e,t){return(Lf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=xf(e);if(t){var i=xf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Pf(this,n)}}function Pf(e,t){return!t||"object"!==If(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xf(e){return(xf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Nf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Lf(e,t)}(a,e);var t,n,r,i=_f(a);function a(){return kf(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"onShowAlert",value:function(e){if(this.layoutOptions.options.alertRegion){var t=e.ctor,n=e.collection,r=n?n.toJSON():[];this.layout.showChildView(this.layoutOptions.options.alertRegion,l.createElement(t,{alerts:r,removeAlert:function(e){return eu.Radio.channel(G.a.ALERT).trigger("remove:alert",e)}}))}}}])&&Tf(t.prototype,n),r&&Tf(t,r),a}(n(44).a);function Rf(e){return(Rf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Df(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Mf(e,t){return(Mf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Uf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Vf(e);if(t){var i=Vf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ff(this,n)}}function Ff(e,t){return!t||"object"!==Rf(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Vf(e){return(Vf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Bf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Mf(e,t)}(a,e);var t,n,r,i=Uf(a);function a(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(e=i.call(this)).constructors={},e.destructors={},e.instances={},e.singletonInstances={},e.referenceCounts={},e}return t=a,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"name",get:function(){return"InstanceManager"}},{key:"registerDataService",value:function(e,t){var n=this;this.validateConstructor(e);var r=e.prototype.name;return this.referenceCounts[r]=0,this.constructors[r]=function(){return new e({dataProvider:n.getInstance(t.dataProvider),cache:n.getInstance(t.cache),bootstrapData:t.bootstrapData,defaultErrorHandler:t.defaultErrorHandler,alertService:t.alertService})},this.destructors[r]=function(){n.instances[r]?n.instances[r].destroy():Yc.c.throw(new Zc.a("Trying to destroy a ".concat(r," instance that has already been destroyed"))),n.releaseInstance(t.dataProvider),n.releaseInstance(t.cache)},this}},{key:"registerInstance",value:function(e,t){var n=this;this.validateConstructor(e);var r=e.prototype.name;return this.referenceCounts[r]=0,this.constructors[r]=function(){return new e(t)},this.destructors[r]=function(){return d.isFunction(n.instances[r].destroy)&&n.instances[r].destroy()},this}},{key:"registerSingleton",value:function(e){var t=e.name;return this.singletonInstances[t]=e,this}},{key:"getInstance",value:function(e,t){var n=this;return this.singletonInstances[e]?this.singletonInstances[e]:(this.constructors[e]||Yc.c.throw(new Zc.a("".concat(e," was not registered with ").concat(this.name))),this.referenceCounts[e]++,t&&this.listenTo(t,"destroy",(function(){return n.releaseInstance(e)})),this.instances[e]||(this.instances[e]=this.constructors[e]()),this.instances[e])}},{key:"releaseInstance",value:function(e){var t=this;if(this.instances[e])return window.setTimeout((function(){t.referenceCounts[e]--,t.referenceCounts[e]<1&&(t.destructors[e](),delete t.instances[e])}),0),this}},{key:"validateConstructor",value:function(e){var t=e.prototype.name;t||Yc.c.throw(new Zc.a("Classes registered with ".concat(this.name," must have a unique name property."))),this.constructors[t]&&Yc.c.throw(new Zc.a("A class with the name: ".concat(t," has already been registered with ").concat(this.name)))}}])&&Df(t.prototype,n),r&&Df(t,r),a}(Kc.a).Instance;function zf(e){var t,n;return t=e,n=Bf.getInstance(t),l.useEffect((function(){return function(){return Bf.releaseInstance(t)}})),n}var Hf,qf,Jf=n(35),$f=n(30);function Kf(e){return(Kf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Gf(e,t){return(Gf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Wf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Qf(e);if(t){var i=Qf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Zf(this,n)}}function Zf(e,t){return!t||"object"!==Kf(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Qf(e){return(Qf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Success="success",e.Warning="warning",e.Fail="danger",e.Info="info"}(Hf||(Hf={})),function(e){e.Success="Success! 🙌",e.Warning="Whoops...",e.Fail="Oops...",e.Info="FYI"}(qf||(qf={}));var Xf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gf(e,t)}(a,e);var t,n,r,i=Wf(a);function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,e)}return t=a,(n=[{key:"initialize",value:function(){this.alertCollection=new Jf.a,this.listenTo(G.a.ALERT,"remove:alert",this.removeAlert),this.showAlerts()}},{key:"name",get:function(){return Gc}},{key:"defaults",get:function(){return{maxAlerts:3}}},{key:"showAlerts",value:function(){var e=eu.Radio.channel(G.a.ALERT),t={collection:this.alertCollection};this.options.alertViewCtor&&(t=d.extend({},t,{ctor:this.options.alertViewCtor})),e.trigger("show:alert",t)}},{key:"removeAlert",value:function(e){this.alertCollection.remove(e),this.showAlerts()}},{key:"createAlert",value:function(e){this.alertCollection.length===this.options.maxAlerts&&this.alertCollection.shift(),e.id||(e=d.extend({},e,{id:this.generateUniqueAlertId()})),this.alertCollection.push(new $f.a(e)),this.showAlerts()}},{key:"clearAllAlerts",value:function(){this.alertCollection.reset(null)}},{key:"success",value:function(e){var t=this;return"string"==typeof e?d.bind((function(){return t.createAlert(d.extend({},t.options.defaultSuccessAlert,{message:e}))}),this):e.useXHR?d.bind((function(e,n){return t.createAlert(d.extend({},t.options.defaultSuccessAlert,{message:n}))}),this):d.bind((function(){return t.createAlert(d.extend({},t.options.defaultSuccessAlert,e))}),this)}},{key:"error",value:function(e){var t=this;return"string"==typeof e?d.bind((function(){return t.createAlert(d.extend({},t.options.defaultErrorAlert,{message:e}))}),this):e.useXHR?d.bind((function(e){return t.createAlert(d.extend({},t.options.defaultErrorAlert,{message:e.message}))}),this):d.bind((function(){return t.createAlert(d.extend({},t.options.defaultErrorAlertIL_DEFAULT,e))}),this)}},{key:"generateUniqueAlertId",value:function(){return d.uniqueId("alert_")}}])&&Yf(t.prototype,n),r&&Yf(t,r),a}(Kc.a);function ep(){var e=zf(Gc);return{success:function(t){e.success(t)()},error:function(t){e.error(t)()},warning:function(t){e.createAlert({type:Hf.Warning,heading:qf.Warning,message:t})}}}function tp(){return l.createElement("div",{className:"text-center p-5"},l.createElement(ki.Spinner,{as:"div",animation:"border",role:"status"}))}function np(e){var t,n=(null===(t=e.headerButtons)||void 0===t?void 0:t.length)?e.headerButtons.map((function(e,t){return l.createElement(ll,Object.assign({key:t},e))})):l.createElement(l.Fragment,null);return l.createElement(ki.Modal,{show:!0,onHide:e.closePopup,onEntered:e.onEntered,size:e.size,dialogClassName:e.dialogClassName,centered:e.centered},!!e.title&&l.createElement(ki.Modal.Header,{className:"d-flex align-items-center",closeButton:e.closeButton},l.createElement(ki.Modal.Title,{className:"flex-grow-1 text-truncate"},e.title),n),e.showLoadingSpinner?l.createElement(tp,null):l.createElement(ki.Modal.Body,{className:e.bodyClassName},e.children))}np.defaultProps={closeButton:!0,bodyClassName:"",dialogClassName:""};var rp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function ip(e){var t=e.buttons;return l.createElement("div",{className:"d-flex justify-content-end border-top pt-3 px-3 mx-n3"},t.map((function(e,t){return function(e,t){var n=e.buttonText,r=e.type,i=void 0===r?"button":r,a=e.isSpinnerButton,o=e.showSpinner,c=void 0!==o&&o,s=e.className,u=rp(e,["buttonText","type","isSpinnerButton","showSpinner","className"]),f=Object.assign({key:t,type:i,className:"ml-2".concat(s?" ".concat(s):"")},u);return a?l.createElement(cf,Object.assign({showSpinner:c},f),n):l.createElement(ki.Button,Object.assign({},f),n)}(e,t)})))}function ap(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return op(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return op(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function op(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var cp=os.encloseNamespace("shared.confirmationPopup");function sp(e){var t=ap(l.useState(!1),2),n=t[0],r=t[1],i=[{variant:e.cancelButtonVariant,onClick:e.closePopup,buttonText:e.cancelButtonText||cp("cancel")},{variant:e.confirmButtonVariant,onClick:function(){r(!0),e.onClickConfirm()},buttonText:e.confirmButtonText||cp("confirm"),isSpinnerButton:!0,showSpinner:n}];return l.createElement(np,{title:e.title,closePopup:e.closePopup},l.createElement(l.Fragment,null,e.children,l.createElement(ip,{buttons:i})))}sp.defaultProps={confirmButtonVariant:"primary",cancelButtonVariant:"link"};var up,lp,fp="locale",pp="phrases",dp="currentuser",mp=function(e,t){return{url:"/api/currentuser",key:"currentuser",normalizeOptions:{namespace:"currentuser"},bootstrapName:dp,formatData:function(e){return e.id?e:null},success:e,error:t,expiryTime:1/0}},hp=n(10),yp=function(e,t,n,r){return{key:"settings:".concat(e,":").concat(t),url:"/api/domain/v3/settings/".concat(e,"?type=").concat(t),normalize:!1,formatData:function(e){return hp.a.first(e)},success:n,error:r}},vp=function(e,t,n,r){return{key:"update:settings:".concat(e,":bulk"),url:"/api/domain/v3/settings/".concat(e,"/bulk"),data:t,type:ce.a.PUT,invalidationKeys:t.map((function(t){return"settings:".concat(e,":").concat(t.name)})),success:n,error:r}};function bp(e){var t=l.useRef(null);return l.useEffect((function(){t.current&&(e.checked?t.current.indeterminate&&(t.current.indeterminate=!1):!e.indeterminate||t.current.indeterminate?!e.indeterminate&&t.current.indeterminate&&(t.current.indeterminate=!1):t.current.indeterminate=!0)}),[t.current,e.indeterminate,e.checked]),l.createElement("div",{className:"custom-control custom-checkbox ".concat(e.className)},l.createElement("input",{ref:t,type:"checkbox",className:"custom-control-input",id:e.id,name:e.name,checked:e.checked,onChange:e.onChange,disabled:e.disabled}),l.createElement("label",{className:"custom-control-label cursor-pointer",htmlFor:e.id},e.label))}function gp(e,t){return t?"".concat(e,":").concat(t):e}!function(e){e.MustCompleteOnboarding="must_complete_onboarding",e.StudentWorkspaceSharing="student_ws_sharing",e.StudentToStudentMessaging="student_to_student_messaging",e.HideResourcesForStudents="hide_resources_for_students",e.LibraryReview="library_review",e.SchoolMessaging="school_messaging",e.LegacyTvNaming="legacy_tv_naming",e.LegacyAlbertCustomer="legacy_albert_customer",e.HideHostedLibraries="hide_hosted_libraries",e.StaffRequest="staff_request",e.MaxCustomLibraries="max_custom_libraries",e.CustomLibrariesBetaAccess="custom_libraries_beta_access",e.AutoCaptioning="auto_captioning",e.Topics="subjects",e.NewDashboards="new_dashboards",e.HasCompletedOnboarding="has_completed_onboarding",e.BulkOnboardingPreferencesState="bulk_onboarding_preferences_state"}(up||(up={})),bp.defaultProps={checked:!1,label:"",className:""},function(e){e[e.Permanent=0]="Permanent",e[e.Temporary=1]="Temporary"}(lp||(lp={}));var Sp,Ep=function(e){return{key:gp("presentations",e),url:Ou("/api/subjects/v1/presentations",{type:e})}},Op=function(e,t){return{key:gp("customers:".concat(e,":presentations"),t),url:Ou("/api/subjects/v1/customers/".concat(e,"/presentations"),{type:t})}},Cp=function(e,t,n,r,i){return{key:"customers:".concat(e,":presentations:").concat(t,":add"),url:"/api/subjects/v1/customers/".concat(e,"/presentations/").concat(t),type:ce.a.POST,invalidationKeys:"customers:".concat(e,":presentation"),success:n,error:r,always:i}},Ap=function(e,t,n,r,i){return{key:"customers:".concat(e,":presentations:").concat(t,":remove"),url:"/api/subjects/v1/customers/".concat(e,"/presentations/").concat(t),type:ce.a.DELETE,invalidationKeys:"customers:".concat(e,":presentations"),success:n,error:r,always:i}};!function(e){e.Developer="Curator Devs",e.Content="Content",e.Curator="Curators",e.Support="Support",e.SalesSupport="Sales Support"}(Sp||(Sp={}));var wp,jp,Ip=function(){return[{value:"protected",access:"r"}]},kp=function(e){return Al(e).includes(Sp.Developer)},Tp=function(e){return[Sp.Developer,Sp.Content].some((function(t){return Al(e).includes(t)}))},Lp=function(e,t,n,r,i){var a="settings:entity:".concat(e),o="/api/cache?keys=".concat(a);return{url:"/ajax/online/".concat(t,"?endpoint=").concat(encodeURIComponent(o)),key:"settings:cache:".concat(e),type:ce.a.DELETE,success:n,error:r,always:i}},_p=function(e){return{key:"customers:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=country")}};function Pp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return xp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Np(e){var t,n=Pp(l.useState(),2),r=n[0],i=n[1],a=e.availablePresentations.filter((function(t){return!e.currentPresentations.find((function(e){return e.id===t.id}))}));return l.createElement("div",null,!!e.canAdd&&!!a.length&&l.createElement(l.Fragment,null,l.createElement(ki.Form.Label,null,"Select a presentation to add"),l.createElement(ki.Form.Control,{as:"select",value:null!==(t=null==r?void 0:r.id)&&void 0!==t?t:"",onChange:function(t){var n=function(e,t){return hp.a.first(t.filter((function(t){return t.id.toString()===e.toString()})))}(t.target.value,a);n&&(i(n),e.onSelectPresentation(n))},className:"cursor-pointer"},l.createElement("option",{value:""},"Select a presentation"),a.map((function(e){return l.createElement("option",{value:e.id,key:e.id},e.name)})))),!!e.currentPresentations.length&&l.createElement(l.Fragment,null,l.createElement("ul",{className:"list-unstyled mt-2"},e.currentPresentations.map((function(t){return l.createElement("li",null,t.name,!!e.canRemove&&l.createElement("span",{className:"text-danger cursor-pointer ml-2",onClick:function(){return e.removePresentation(t)}},l.createElement("em",null,"remove")))})))))}function Rp(e,t){return kp(t)?e:e.filter((function(e){return e.status===wp.Published}))}function Dp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Mp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Up(e){var t,n,r=ep(),a=Object(v.useDispatch)(),o=Dp(l.useState(!!e.newCustomer),2),s=o[0],u=o[1],f=Dp(l.useState(),2),d=f[0],m=f[1],h=Dp(l.useState(),2),y=h[0],b=h[1],g=Dp(l.useState(),2),S=g[0],E=g[1],O=Dp(l.useState(!1),2),C=O[0],A=O[1],w=oe.useBasicFetch(_p(e.customerId)),j=oe.useBasicFetch(mp()),I=oe.useBasicFetch(yp(e.customerId,up.Topics)),k=(n=e.customerId,{availableTopicPresentations:oe.useBasicFetch(Ep(jp.Subject)),availableCurriculumPresentations:oe.useBasicFetch(Ep(jp.Curriculum)),customerTopicPresentations:oe.useBasicFetch(Op(n,jp.Subject)),customerCurriculumPresentations:oe.useBasicFetch(Op(n,jp.Curriculum))}),T=k.availableTopicPresentations,L=k.availableCurriculumPresentations,_=k.customerTopicPresentations,P=k.customerCurriculumPresentations;function x(){if(e.newCustomer)return alert("Successfully set up Topics for this customer."),void p.LocationUtils.PageLoad(p.AppLinkHelper.getHref({application:c.CUSTOMERS,action:i.Customers.MANAGE_CUSTOMER_TOPICS,args:[e.customerId]}));A(!1),r.success("Successfully saved customer presentations.")}if(l.useEffect((function(){var e;(null===(e=I.data)||void 0===e?void 0:e.value)&&u(!0)}),[null===(t=I.data)||void 0===t?void 0:t.value]),l.useEffect((function(){s||(m(null),b(null))}),[s]),!!!(j.data&&I.data&&w.data&&T.data&&L.data&&_.data&&P.data))return l.createElement(l.Fragment,null);var N=kp(j.data),R=!_.data.length&&!P.data.length||N,D=N?d||y:s&&d&&y;return l.createElement(l.Fragment,null,l.createElement("h1",{className:"h6 mb-3"},w.data.name," - ",w.data.crmId),l.createElement("div",{className:"alert alert-danger",role:"alert"},"After enabling Topics, please ensure that ",l.createElement("strong",null,"Dashboard")," is enabled for this customer and that they have the correct library for the ",l.createElement("strong",null,"Topics Presentation")," you choose."),l.createElement(bp,{id:"enableTopics",checked:s,onChange:function(){return u(!s)},label:"Enable Topics",disabled:I.data.value}),s&&l.createElement(l.Fragment,null,l.createElement("p",{className:"mt-3"},l.createElement("strong",null,"Topic Presentations")),l.createElement(Np,{availablePresentations:Rp(T.data,j.data),currentPresentations:_.data,onSelectPresentation:function(e){return m(e)},removePresentation:function(e){return E(e)},canAdd:R,canRemove:N}),l.createElement("p",{className:"mt-3"},l.createElement("strong",null,"Curriculum Presentations")),l.createElement(Np,{availablePresentations:Rp(L.data,j.data),currentPresentations:P.data,onSelectPresentation:function(e){return b(e)},removePresentation:function(e){return E(e)},canAdd:R,canRemove:N})),R&&l.createElement("div",{className:"d-flex justify-content-end align-items-center pt-3"},!I.data.value&&l.createElement(lu,{className:"info-link mr-3",appLink:{application:c.CUSTOMERS,action:i.Customers.MANAGE_CUSTOMER,args:[e.customerId]}},"Skip for now"),l.createElement("button",{className:"btn btn-primary",onClick:function(){return A(!0)},disabled:!D},"Save")),C&&l.createElement(sp,{title:"Confirmation needed",onClickConfirm:function(){var t=function(){var e=[];return d&&e.push(d),y&&e.push(y),e}();if(t.length){var n=function(){var t=I.data.value?[]:[up.Topics,up.NewDashboards];return e.newCustomer&&t.push(up.MustCompleteOnboarding),t}(),r=0,i=0,o=t.length+(n.length?1:0),c=t.map((function(t){return Cp(e.customerId,t.id,s,u)}));n.length&&c.push(vp(e.customerId,n.map((function(e){return{name:e,value:!0,kind:lp.Temporary}})),s,u)),c.forEach((function(e){return oe.fetch(a,e)}))}function s(){i++,u()}function u(){var t;if(++r===o){if(i<r||!(null===(t=w.data.country)||void 0===t?void 0:t.code))return A(!1),void alert("Something went wrong while setting up Topics for this customer. Please contact to the Product Team so that they look into the issue.");if(n.length){var c=Lp(e.customerId,w.data.country.code,x,(function(){A(!1),alert("Successfully set up Topics but failed to clear Online cache. Please contact to the Product Team so that they look into the issue.")}));oe.fetch(a,c)}else x()}}},closePopup:function(){return A(!1)}},I.data.value?l.createElement("p",null,"Are you sure you want to add this customer to:"):l.createElement("p",null,"Are you sure you want enable Topics for this customer and add it to the following presentations:"),l.createElement("ul",null,!!d&&l.createElement("li",null,l.createElement("strong",null,"Topic Presentation:")," ",d.name),!!y&&l.createElement("li",null,l.createElement("strong",null,"Curriculum Presentation:")," ",y.name)),!N&&l.createElement("p",{className:"text-danger"},l.createElement("strong",null,"You will not be able to come back and change this."))),!!S&&l.createElement(sp,{title:"Confirmation needed",onClickConfirm:function(){if(S){var t=Ap(e.customerId,S.id,(function(){return r.success("Successfully removed customer from presentation.")}),(function(e){var t;return r.error((null===(t=e.responseJSON)||void 0===t?void 0:t.message)||"Failed to remove presentation.")}),(function(){return E(null)}));oe.fetch(a,t)}},closePopup:function(){return E(null)}},l.createElement("p",null,"Are you sure you want to remove this customer from ",l.createElement("strong",null,S.name),"?")))}function Fp(e){return(Fp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function zp(e,t,n){return t&&Bp(e.prototype,t),n&&Bp(e,n),e}function Hp(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qp(e,t)}function qp(e,t){return(qp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Jp(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Kp(e);if(t){var i=Kp(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return $p(this,n)}}function $p(e,t){return!t||"object"!==Fp(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Kp(e){return(Kp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Draft="Draft",e.Published="Published"}(wp||(wp={})),function(e){e.Subject="subject",e.Curriculum="curriculum"}(jp||(jp={}));var Yp=function(e){Hp(n,e);var t=Jp(n);function n(){return Vp(this,n),t.apply(this,arguments)}return zp(n,[{key:"channelName",get:function(){return c.CUSTOMERS}},{key:"appRoutes",get:function(){return{"customers/:id/topics(/)":"manageCustomerTopics"}}},{key:"externalRoutes",get:function(){return{"customers/:id(/)":"manageCustomer"}}}]),n}(p.AppRouter),Gp=function(e){Hp(n,e);var t=Jp(n);function n(){return Vp(this,n),t.apply(this,arguments)}return zp(n,[{key:"name",get:function(){return"Customers Application"}},{key:"channelName",get:function(){return c.CUSTOMERS}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT,options:{alertRegion:L}}}},{key:"manageCustomerTopics",value:function(e,t){this.layout.showChildView(k,l.createElement(Up,{customerId:e,newCustomer:t.newCustomer}))}}],[{key:"router",get:function(){return Yp}}]),n}(Nf),Wp=n(63),Zp=n(25),Qp=n.n(Zp);function Xp(e){var t=e.alert,n=e.svgName,r=e.svgClassName,i=e.closeAlert,a=t.message,o=t.heading,c=t.appLink,s=t.appLinkText,u=t.appLinkClassName,f=void 0===u?"":u,p=Object($c.sanitize)(a);return l.createElement(l.Fragment,null,l.createElement("div",{className:"d-inline-block ".concat(Qp.a.icon)},l.createElement(Mc,{svgName:n,className:"svg-container ".concat(r)})),l.createElement("div",{className:"pl-2 d-inline-block ".concat(Qp.a.alertContent)},l.createElement("p",{className:"p-0 m-0 pb-1 ".concat(Qp.a.heading)},o),l.createElement("p",{className:"p-0 m-0 text-break clamp-4 ".concat(Qp.a.message),dangerouslySetInnerHTML:{__html:p}}),!!c&&l.createElement(lu,{className:f,appLink:c},s)),l.createElement("div",{className:"close d-inline-block cursor-pointer",role:"button",onClick:i},"×"))}function ed(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return td(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return td(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function td(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var nd=function(e){switch(e.type){case Hf.Success:return Dc.CheckCircleOutline;case Hf.Fail:case Hf.Warning:return Dc.Warning;case Hf.Info:default:return Dc.Info}};function rd(e){var t=e.alert,n=e.closeAlert,r=ed(l.useState(!0),2),i=r[0],a=r[1],o=l.useRef();l.useEffect((function(){i?o.current=window.setTimeout(n,3e3):clearTimeout(o.current)}),[i]);var c="text-".concat(t.type.toLowerCase());return l.createElement("li",{className:"bg-white mt-2 p-2 show clearfix ".concat(Qp.a.alertItem),onMouseEnter:function(){return a(!1)},onMouseLeave:function(){return a(!0)}},l.createElement(Xp,{alert:t,svgName:nd(t),svgClassName:c,closeAlert:n}))}function id(e){var t=e.alerts,n=e.removeAlert;return l.createElement("div",{className:Qp.a.alertBox},l.createElement(Wp.TransitionGroup,{component:"ul",className:"".concat(Qp.a.alertList," list-unstyled")},t&&t.map((function(e,t){return l.createElement(Wp.CSSTransition,{key:t,timeout:200,classNames:"alert"},l.createElement(rd,{alert:e,closeAlert:function(){return n(e.id)}}))}))))}var ad=n(20),od={namespace:"domain_options"},cd=function(){return"/api/domain/v3/settings/types"},sd=function(e){return"/api/domain/v3/settings/types/".concat(e)},ud=function(){return"/api/domain/v3/settings/types"},ld=function(e){return"/api/domain/v3/settings/types/".concat(e)},fd=function(e){return"/api/domain/v3/settings/types/".concat(e)},pd="domain:options",dd="domain:option",md="update:domain:option",hd="delete:domain:option",yd=function(){return{key:pd,url:cd(),normalizeOptions:od}},vd=function(e){return{key:"".concat(dd,":").concat(e),url:sd(e),normalizeOptions:od}},bd=function(e,t,n){return e.type===ad.DomainOptionType.String&&(e=Ed(e)),{key:dd,url:ud(),data:e,type:ce.a.POST,success:t,error:n,invalidationKeys:[pd],normalizeOptions:od}},gd=function(e,t){return e.type===ad.DomainOptionType.String&&(e=Ed(e)),{key:"".concat(md,":").concat(e.id),url:ld(e.id),data:e,type:ce.a.PUT,always:t,formatData:function(){return e},normalizeOptions:od}},Sd=function(e,t){return{key:"".concat(hd,":").concat(e),url:fd(e),type:ce.a.DELETE,invalidationKeys:[pd],normalizeOptions:od,success:t}};function Ed(e){var t=e.defaultValue;if('"'===t)return Object.assign(Object.assign({},e),{defaultValue:'"'.concat(t,'"')});var n=t.charAt(0),r=t.charAt(t.length-1);return'"'!==n&&(t='"'.concat(t)),'"'!==r&&(t="".concat(t,'"')),Object.assign(Object.assign({},e),{defaultValue:t})}function Od(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Cd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ad(e){var t=Od(l.useState(!1),2),n=t[0],r=t[1],a=oe.useBasicFetch(vd(e.optionId)),o=Object(v.useDispatch)(),s=function(){e.closePopup(),p.AppLinkHelper.trigger({application:c.DOMAIN_OPTIONS,action:i.DomainOptions.DOMAIN_OPTIONS})};return l.createElement(np,{title:"Delete Domain Option",closePopup:e.closePopup,showLoadingSpinner:!a.data},a.data&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,a.data.name),"?")),l.createElement(ip,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){r(!0),oe.fetch(o,Sd(e.optionId,s))},buttonText:"Yes, delete this domain option",isSpinnerButton:!0,showSpinner:n}]})))}var wd,jd=function(e){return{application:c.DOMAIN_OPTIONS,action:i.DomainOptions.EDIT_DOMAIN_OPTION,args:[e.id]}},Id={application:c.DOMAIN_OPTIONS,action:i.DomainOptions.NEW_DOMAIN_OPTION};function kd(){var e=oe.useBasicFetch(yd());if(!e.data)return l.createElement(l.Fragment,null);var t=e.data.map((function(e){return e.displayName&&(e.name=e.displayName),e}));return l.createElement(l.Fragment,null,l.createElement("div",{className:"d-flex justify-content-between mb-2"},l.createElement("h5",{className:"d-inline-block m-0"},"Select a domain option type to edit:"),l.createElement(lu,{appLink:Id,className:"d-block"},l.createElement(Mc,{svgName:Dc.Plus,size:Nc.Small}),l.createElement("span",null,"New Domain Option"))),l.createElement(hl,{objects:t,getAppLink:jd}))}!function(e){e[e.Audience=1]="Audience",e[e.Category=2]="Category",e[e.Channel=3]="Channel",e[e.Chapter=4]="Chapter",e[e.Comment=5]="Comment",e[e.OwnerComment=6]="OwnerComment",e[e.Image=7]="Image",e[e.Thumbnail=8]="Thumbnail",e[e.Avatar=9]="Avatar",e[e.Banner=10]="Banner",e[e.Video=11]="Video",e[e.Trailer=12]="Trailer",e[e.Rating=13]="Rating",e[e.Topic=14]="Topic",e[e.Series=15]="Series",e[e.Season=16]="Season",e[e.HostedMediaObjectCollection=17]="HostedMediaObjectCollection",e[e.ExchangeCollection=18]="ExchangeCollection",e[e.CustomMediaObjectCollection=19]="CustomMediaObjectCollection",e[e.Playlist=20]="Playlist",e[e.ClickViewTvCollection=21]="ClickViewTvCollection",e[e.ClickViewProductionsCollection=22]="ClickViewProductionsCollection",e[e.User=23]="User",e[e.SystemUser=24]="SystemUser",e[e.Customer=25]="Customer",e[e.Country=26]="Country",e[e.Organisation=28]="Organisation",e[e.SystemOrganisation=29]="SystemOrganisation",e[e.Group=30]="Group",e[e.SystemGroup=31]="SystemGroup",e[e.FlagReason=32]="FlagReason",e[e.Library=33]="Library",e[e.Interactive=34]="Interactive",e[e.WorkspaceCollection=35]="WorkspaceCollection",e[e.Conversation=36]="Conversation",e[e.Message=37]="Message",e[e.Notification=38]="Notification",e[e.Clip=39]="Clip",e[e.Link=40]="Link",e[e.UserChannel=41]="UserChannel",e[e.Resource=42]="Resource",e[e.VideoStream=43]="VideoStream",e[e.AudioStream=44]="AudioStream",e[e.Tag=45]="Tag",e[e.Subtitle=46]="Subtitle",e[e.LicencedContentCollection=47]="LicencedContentCollection",e[e.PublicCollection=48]="PublicCollection",e[e.CategoryTree=49]="CategoryTree",e[e.Logo=50]="Logo",e[e.Permission=51]="Permission",e[e.Subject=52]="Subject",e[e.Field=53]="Field",e[e.Company=54]="Company",e[e.Person=55]="Person",e[e.Cover=56]="Cover",e[e.Poster=57]="Poster",e[e.SubjectAudience=58]="SubjectAudience",e[e.Classroom=67]="Classroom",e[e.ClassroomGroup=68]="ClassroomGroup"}(wd||(wd={}));var Td=ji.object().shape({id:ji.string(),name:ji.string().trim().max(64,"Name is too long").required("Name is required").default(""),displayName:ji.string().trim().max(255,"Display name is too long").required("Display name is required").default(""),type:ji.mixed().required("Type is required").default(ad.DomainOptionType.Boolean),entityType:ji.mixed().required("Entity type is required").default(wd.Customer),kind:ji.mixed().required("Kind is required").default(ad.DomainOptionKind.Temporary),defaultValue:ji.mixed().required("Default value is required").default("false")}).noUnknown();function Ld(e){var t=e.type,n=e.defaultValue;if(!t)return l.createElement(l.Fragment,null);var r={label:"Default Value",name:"defaultValue",id:"defaultValue",value:n};return t===ad.DomainOptionType.Boolean?l.createElement(Bc,Object.assign({as:"select"},r),l.createElement("option",{value:"true"},"True"),l.createElement("option",{value:"false"},"False")):t===ad.DomainOptionType.Long||t===ad.DomainOptionType.StaffRequest?l.createElement(Bc,Object.assign({as:"input",type:"number"},r)):t===ad.DomainOptionType.String?l.createElement(Bc,Object.assign({as:"input"},r)):void 0}var _d=[wd.Customer,wd.User];function Pd(e){var t=null===e.id||void 0===e.id,n=ci(),r=qc(n);return l.createElement(vi,null,l.createElement(Bc,{label:"Name (snake_case)",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this domain option",autoFocus:!0}),l.createElement(Bc,{label:"Display Name",type:"text",name:"displayName",id:"displayName",value:n.values.displayName,placeholder:"Enter a display name for this domain option"}),l.createElement(Bc,{as:"select",label:"Kind",name:"kind",id:"kind",value:n.values.kind},Ci.a.getEnumKeys(ad.DomainOptionKind).map((function(e){return l.createElement("option",{key:e,value:ad.DomainOptionKind[e]},e)}))),l.createElement(Bc,{as:"select",label:"Entity",name:"entityType",id:"entityType",value:n.values.entityType},Ci.a.getEnumKeys(wd).filter((function(e){return _d.includes(wd[e])})).map((function(e){return l.createElement("option",{key:e,value:wd[e]},e)}))),l.createElement(Bc,{as:"select",label:"Type",name:"type",id:"type",value:n.values.type},Ci.a.getEnumKeys(ad.DomainOptionType).map((function(e){return l.createElement("option",{key:e,value:ad.DomainOptionType[e]},e)}))),l.createElement(Ld,{type:n.values.type,defaultValue:n.values.defaultValue}),l.createElement("div",{className:"d-flex justify-content-between"},l.createElement(cf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&l.createElement(ki.Button,{as:lu,variant:"danger",appLink:{application:c.DOMAIN_OPTIONS,action:i.DomainOptions.DELETE_DOMAIN_OPTION,args:[e.id]}},"Delete")))}function xd(e){return l.createElement(wi,{initialValues:e.domainOption,validationSchema:Td,onSubmit:e.saveDomainOption},l.createElement(Pd,{id:e.domainOption&&e.domainOption.id}))}function Nd(){var e=Object(v.useDispatch)();return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Create New Domain Option"),l.createElement(xd,{saveDomainOption:function(t,n){oe.fetch(e,bd(t,(function(e){n(),p.AppLinkHelper.trigger({application:c.DOMAIN_OPTIONS,action:i.DomainOptions.EDIT_DOMAIN_OPTION,args:[e.id]})}),n))}}))}function Rd(e){var t=e.optionId,n=oe.useBasicFetch(vd(t)),r=Object(v.useDispatch)();return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Edit Domain Option"),n.data&&l.createElement(xd,{domainOption:n.data,saveDomainOption:function(e,t){return oe.fetch(r,gd(e,t))}}))}function Dd(e){return(Dd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Md(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ud(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Fd(e,t,n){return t&&Ud(e.prototype,t),n&&Ud(e,n),e}function Vd(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Bd(e,t)}function Bd(e,t){return(Bd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function zd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qd(e);if(t){var i=qd(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Hd(this,n)}}function Hd(e,t){return!t||"object"!==Dd(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qd(e){return(qd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Jd=function(e){Vd(n,e);var t=zd(n);function n(){return Md(this,n),t.apply(this,arguments)}return Fd(n,[{key:"channelName",get:function(){return c.DOMAIN_OPTIONS}},{key:"appRoutes",get:function(){return{"developer/options(/)":"domainOptions","developer/options/new(/)":"newDomainOption","developer/options/:id(/)":"editDomainOption"}}},{key:"appLinks",get:function(){return["deleteDomainOption"]}}]),n}(p.AppRouter),$d=function(e){Vd(n,e);var t=zd(n);function n(){return Md(this,n),t.apply(this,arguments)}return Fd(n,[{key:"name",get:function(){return"Domain Options Application"}},{key:"channelName",get:function(){return c.DOMAIN_OPTIONS}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT}}},{key:"domainOptions",value:function(){this.layout.showChildView(k,l.createElement(kd,null))}},{key:"newDomainOption",value:function(){this.layout.showChildView(k,l.createElement(Nd,null))}},{key:"editDomainOption",value:function(e){this.layout.showChildView(k,l.createElement(Rd,{optionId:e}))}},{key:"deleteDomainOption",value:function(e){this.layout.showChildView(T,l.createElement(Ad,Object.assign({optionId:e},this.getPopupProps())))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return eu.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(L,l.createElement(id,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return Jd}}]),n}(p.Application),Kd=function(e){return e?"".concat("/api/master/v2/people","?cursor=").concat(e):"/api/master/v2/people"},Yd=function(e){return"/api/master/v2/objects/".concat(e)},Gd=function(){return"/api/master/v2/people"},Wd=function(e){return"/api/master/v2/objects/".concat(e)},Zd="people",Qd="person",Xd="update:person",em=function(e){return{key:"".concat(Zd).concat(e?":".concat(e):""),url:Kd(e)}},tm=function(e){return{key:"".concat(Qd,":").concat(e),url:Yd(e)}},nm=function(e,t,n){return{key:Qd,url:Gd(),data:e,type:ce.a.POST,success:t,error:n,invalidationKeys:[Zd]}},rm=function(e,t,n){return{key:"".concat(Xd,":").concat(e),url:Wd(e),data:t,type:ce.a.PUT,always:n}},im=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown();function am(e){var t=ci();return l.createElement(vi,null,l.createElement(Bc,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this person",autoFocus:!0}),l.createElement(us,{isNew:e.isNew}))}function om(e){return l.createElement(wi,{initialValues:e.person,validationSchema:im,onSubmit:e.savePerson},l.createElement(am,{isNew:!(e.person&&e.person.id)}))}function cm(e){var t=Object(v.useDispatch)(),n=oe.useBasicFetch(tm(e.id));return l.createElement(l.Fragment,null,!!n.data&&l.createElement(om,{person:n.data,savePerson:function(n,r){return oe.fetch(t,rm(e.id,n,r))}}))}function sm(){var e=Object(v.useDispatch)();return l.createElement(om,{savePerson:function(t,n){oe.fetch(e,nm(t,(function(e){n(),p.AppLinkHelper.trigger({application:c.PEOPLE,action:i.People.EDIT_PERSON,args:[e.id]})}),n))}})}var um=c.PEOPLE,lm=function(e){return{application:um,action:i.People.EDIT_PERSON,args:[e.id]}},fm=function(e){return p.AppLinkHelper.trigger(lm(e))};function pm(e){var t=oe.useBasicFetch(em(e.cursor));return l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-3 w-50"},l.createElement(zs,{placeholder:"Search for a person",onSuggestionSelected:fm,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/people/instant/raw","?q=").concat(e)},activationLength:2})),l.createElement(tl,{collection:t&&t.data,collectionAppLink:{application:um,action:i.People.PEOPLE},newObjectAppLink:{application:um,action:i.People.NEW_PERSON},getObjectAppLink:lm,objectName:"Person"}))}function dm(e){return(dm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ym(e,t,n){return t&&hm(e.prototype,t),n&&hm(e,n),e}function vm(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&bm(e,t)}function bm(e,t){return(bm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Em(e);if(t){var i=Em(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Sm(this,n)}}function Sm(e,t){return!t||"object"!==dm(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Em(e){return(Em=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Om,Cm=function(e){vm(n,e);var t=gm(n);function n(){return mm(this,n),t.apply(this,arguments)}return ym(n,[{key:"channelName",get:function(){return c.PEOPLE}},{key:"appRoutes",get:function(){return{"manage/people(/)":"people","manage/people/new(/)":"newPerson","manage/people/:id(/)":"editPerson"}}}]),n}(p.AppRouter),Am=function(e){vm(n,e);var t=gm(n);function n(){return mm(this,n),t.apply(this,arguments)}return ym(n,[{key:"name",get:function(){return"People Application"}},{key:"channelName",get:function(){return c.PEOPLE}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT}}},{key:"people",value:function(e){var t=e.cursor;this.layout.showChildView(k,l.createElement(pm,{cursor:t}))}},{key:"newPerson",value:function(){this.layout.showChildView(k,l.createElement(sm,null))}},{key:"editPerson",value:function(e){this.layout.showChildView(k,l.createElement(cm,{id:e}))}}],[{key:"router",get:function(){return Cm}}]),n}(p.Application),wm=function(e,t,n,r,i){return{url:"/api/image/upload?type=".concat(t),key:"upload:image",data:e,type:ce.a.POST,success:n,error:r,always:i}},jm=n(213),Im=n.n(jm);function km(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Tm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Tm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e){e[e.NoRestrictions=0]="NoRestrictions",e[e.RestrictToCanvas=1]="RestrictToCanvas"}(Om||(Om={}));var Lm=/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/;function _m(e){var t=e.dataUrl,n=e.minHeight,r=e.minWidth,i=e.onCrop,a=e.onCancel,o=l.useRef(),c=l.useRef(),s=km(l.useState(!1),2),u=s[0],f=s[1],p=km(l.useState(!1),2),d=p[0],h=p[1];return l.useEffect((function(){var e=new Image;e.src=t;var i=o.current.offsetWidth/e.width;return c.current=new Im.a(o.current,{viewMode:Om.RestrictToCanvas,autoCropArea:1,aspectRatio:r/n,minCropBoxWidth:r*i,minCropBoxHeight:n*i,ready:function(){return f(!0)}}),function(){return c.current.destroy()}}),[]),l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-3"},l.createElement("img",{ref:o,src:t,className:"img img-fluid"})),l.createElement("div",{className:"d-flex justify-content-end border-top pt-3"},l.createElement(ki.Button,{variant:"link",onClick:a},"Cancel"),l.createElement(cf,{onClick:function(){if(u){h(!0);var e=c.current.getCroppedCanvas().toDataURL(function(e){var t=e.match(Lm);if(t)return t[1]}(t));m(i)&&i(e)}},disabled:!u,showSpinner:d},"Crop")))}function Pm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return xm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Nm(e){var t=Object(v.useDispatch)(),n=l.useContext(Nu),r=n.getDataUrl,i=n.setImage,a=Pm(l.useState(r()),1)[0],o=Pm(l.useState(!1),2),c=o[0],s=o[1];return l.createElement(np,{title:"Crop Image",size:e.popupSize,closePopup:e.closePopup,onEntered:function(){return s(!0)}},c&&l.createElement(_m,{dataUrl:a,minWidth:Lu[e.imageType].width,minHeight:Lu[e.imageType].height,onCrop:function(n){oe.fetch(t,wm(n,e.imageType,(function(e){return i(e)}),null,e.closePopup))},onCancel:e.closePopup}))}var Rm=function(e){var t=e.children;return l.createElement(Ru,null,t)};function Dm(e){var t=e.page,n=e.totalPages,r=gs.isNumber(t)&&t>0&&t<n&&t+1,i=gs.isNumber(t)&&t>1&&t-1,a={};if(r&&r<=n&&(a.next=r.toString()),i&&(a.previous=i.toString()),!Ci.a.isEmpty(a))return a}var Mm={convertLegacyPaginatedCollection:function(e){if(e)return{data:e.data,pagination:{cursors:Dm(e.pagination),limit:e.pagination.pageSize}}}},Um=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"1";return{key:"playlists:".concat(e),url:"/ajax/playlists/curators?page=".concat(e),formatData:Mm.convertLegacyPaginatedCollection}},Fm=function(e,t){var n="/api/domain/v1/search/playlists?query=".concat(e);return t&&(n+="&filter={page:".concat(t,"}")),{key:"playlists:search:".concat(e).concat(t?":".concat(t):""),url:n,formatData:Mm.convertLegacyPaginatedCollection}},Vm=function(e){return{key:"playlist:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=cover,banner")}},Bm=function(e){var t=e.slice().sort();return{key:"playlists:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},zm=function(e,t,n,r,i){return{url:"/api/master/v2/objects/".concat(t,"/playlists"),key:"playlist",data:Object.assign(Object.assign({},e),{permissions:Ip()}),type:ce.a.POST,invalidationKeys:"playlists",success:n,error:r,always:i}},Hm=function(e,t,n,r,i){return{url:"/api/master/v2/objects/".concat(e),key:"update:playlist:".concat(e),data:t,type:ce.a.PUT,success:n,error:r,always:i}},qm=function(e,t,n,r){return{url:"/api/master/v1/playlists/".concat(e),key:"delete:playlist:".concat(e),type:ce.a.DELETE,invalidationKeys:"playlists",success:t,error:n,always:r}},Jm=function(e){return{key:"playlist:".concat(e,":videos"),url:"/api/master/v2/objects/".concat(e,"/videos?query={orderBy:orderindex,limit:100}")}},$m=function(e,t,n,r){return{key:"reorder:playlist",url:"/api/master/v1/objects/".concat(e,"/videos/reorder"),data:t,type:ce.a.PUT,invalidationKeys:"playlist:".concat(e,":videos"),success:n,error:r}},Km=function(e,t,n,r,i){return{key:"remove:playlist:video",url:"/api/master/v1/playlists/".concat(e,"/dissociate/").concat(t),type:ce.a.DELETE,invalidationKeys:"playlist:".concat(e,":videos"),success:n,error:r,always:i}};function Ym(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Gm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Wm(e){var t=Object(v.useDispatch)(),n=ep(),r=Ym(l.useState(!1),2),a=r[0],o=r[1],s=oe.useBasicFetch(Vm(e.playlistId));var u=[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){o(!0),oe.fetch(t,qm(e.playlistId,(function(){n.success("Successfully deleted playlist."),p.AppLinkHelper.trigger({application:c.PLAYLISTS,action:i.Playlists.PLAYLISTS})}),(function(){o(!1),n.error("Failed to delete playlist.")}),e.closePopup))},buttonText:"Yes, delete playlist",isSpinnerButton:!0,showSpinner:a}],f=!!s.data;return l.createElement(np,{title:"Delete Playlist",closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,s.data.name),"?"),l.createElement("p",null,"Please ensure it is not being used in any widgets.")),l.createElement(ip,{buttons:u})))}var Zm=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:ji.string().trim().max(65535,"Description is too long").default(""),cover:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown(),banner:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown()}).noUnknown(),Qm=function(e,t){var n=c.PLAYLISTS,r=i.Playlists,a=[{label:"Edit Playlist Details",appLink:{application:n,action:r.EDIT_PLAYLIST,args:[t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_PLAYLIST_VIDEOS,args:[t]}}];return Tp(e)&&a.push.apply(a,[{label:"Backbone Classifications",appLink:{application:n,action:r.EDIT_PLAYLIST_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_PLAYLIST_AUDIENCES,args:[t]}}]),a};function Xm(e){var t=ci(),n=qc(t);return l.createElement(vi,null,l.createElement(Bc,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this playlist",autoFocus:!0}),l.createElement(Bc,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this playlist here"}),l.createElement(Qu,{imageType:hu.Covers,fieldName:"cover",application:c.PLAYLISTS,uploadAction:i.Playlists.UPLOAD_IMAGE}),l.createElement(Qu,{imageType:hu.Banners,fieldName:"banner",application:c.PLAYLISTS,uploadAction:i.Playlists.UPLOAD_IMAGE}),l.createElement("div",{className:"d-flex justify-content-between align-items-center"},l.createElement(cf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.id?"Save":"Create"),!!e.actions&&l.createElement(fl,{actions:e.actions})))}function eh(e){var t,n=e.playlist&&e.playlist.id;return l.createElement(wi,{initialValues:e.playlist,validationSchema:Zm,onSubmit:e.savePlaylist},l.createElement(Xm,{id:n,actions:!!n&&(t=n,[{label:"Delete playlist",appLink:{application:c.PLAYLISTS,action:i.Playlists.DELETE_PLAYLIST,args:[t]},className:"text-danger"}])}))}function th(e){return l.createElement("div",{className:"py-2"},l.createElement(wl,{tabs:Qm(e.currentUser,e.playlistId),isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}));var t}function nh(e){var t=Object(v.useDispatch)(),n=ep(),r=oe.useBasicFetch(Vm(e.playlistId)),a=oe.useBasicFetch(mp());return l.createElement(l.Fragment,null,!!a.data&&l.createElement(th,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST,currentUser:a.data}),!!r.data&&l.createElement(eh,{playlist:r.data,savePlaylist:function(r,i){oe.fetch(t,Hm(e.playlistId,r,(function(){n.success("Successfully updated playlist.")}),(function(){n.error("Failed to update playlist.")}),i))}}))}var rh=function(e,t){var n=e.dataServiceName,r=e.eventPrefix,i=e.fetchData,a=e.setData,o=e.onError,c=e.deleteEventPrefix;if(m(i)){if(m(a)){var s=o&&m(o),u=Bf.getInstance(n),l=eu.Radio.channel(u.channelName),f="".concat(r,":request"),d="".concat(r,":sync"),h="".concat(r,":error"),y="".concat(r,":invalidate"),v=c&&"".concat(c,":sync"),b=function(){return t(!1)},g=function(){return t(!0)},S=function(){return t(!1)},E=function(){return l.off(y,S)};l.once(f,b),l.once(d,g),l.once(y,S),s&&l.once(h,o),v&&l.once(v,E);var O=i(u);return O&&(t(!0),e.setData(O)),function(){Bf.releaseInstance(n),l.off(f,b),l.off(d,g),l.off(y,S),s&&l.off(h,o),v&&l.off(v,E)}}p.ErrorHelper.throw(new Zc.a("A setData function must be passed to fetch"))}else p.ErrorHelper.throw(new Zc.a("A fetchData function must be passed to fetch"))};function ih(e){return function(e){if(Array.isArray(e))return ch(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||oh(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ah(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||oh(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oh(e,t){if(e){if("string"==typeof e)return ch(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ch(e,t):void 0}}function ch(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var sh=function(e){return Array(Array.isArray(e)?e.length:0).fill(!1)};function uh(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=l.useState(sh(e)),i=ah(r,2),a=i[0],o=i[1];l.useEffect((function(){o(sh(e))}),ih(t)),l.useEffect((function(){if(n){var t=[];return e&&e.forEach((function(e,n){t.push(rh(e,(function(e){e!==a[n]&&o(hp.a.cloneAndReplaceAtIdx(a,n,e))})))})),function(){return t.forEach((function(e){return e()}))}}}),[a,n])}function lh(e){return function(e){if(Array.isArray(e))return dh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||ph(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||ph(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ph(e,t){if(e){if("string"==typeof e)return dh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dh(e,t):void 0}}function dh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mh(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=l.useState(!1),i=fh(r,2),a=i[0],o=i[1];l.useEffect((function(){o(!1)}),lh(t)),l.useEffect((function(){if(n)return rh(e,o)}),[a,n])}var hh=function(e,t,n){return function(r){return e((function(e){var i=m(n)?n:h();return Object.assign(Object.assign({},e),function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,i(r,e)))}))}};function yh(e){return(yh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vh(e){return function(e){if(Array.isArray(e))return bh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return bh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bh(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Sh(e,t){return(Sh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Eh(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ah(e);if(t){var i=Ah(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Oh(this,n)}}function Oh(e,t){return!t||"object"!==yh(t)&&"function"!=typeof t?Ch(e):t}function Ch(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ah(e){return(Ah=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var wh,jh,Ih,kh,Th,Lh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Sh(e,t)}(a,e);var t,n,r,i=Eh(a);function a(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),t=i.call(this,e),d.result(Ch(t),"name")||Yc.c.throw(new Zc.a("Must provide a name when extending BaseDataService")),d.result(Ch(t),"channelName")||Yc.c.throw(new Zc.a("Must provide a channelName for ".concat(d.result(Ch(t),"name"))));var n=[].concat(vh(t.defaultProps),vh(t.props||[]));return t.dataRequestSignatures={},t.mergeOptions(e,n),t}return t=a,(n=[{key:"defaultProps",get:function(){return["dataProvider","cache","bootstrapData","defaultErrorHandler","alertService"]}},{key:"getCursors",value:function(e){var t=this.cache.get(e);return t?t.cursors:{}}},{key:"clearCacheAndGet",value:function(e){var t=this,n=e.callback,r=e.errorCallback,i=e.eventPrefix,a=this.getEventNames(i),o=a.syncEvent,c=a.errorEvent,s=this.cache.get(i);if(s&&s.openRequest)return this.listenToOnce(this.getChannel(),o,(function(e){d.isFunction(r)&&t.stopListening(t.getChannel(),c,r),d.isFunction(n)&&n(e)})),void this.listenToOnce(this.getChannel(),c,(function(){d.isFunction(n)&&t.stopListening(t.getChannel(),o,n),d.isFunction(r)&&r()}));this.cache.remove(e.eventPrefix),this.get(e)}},{key:"get",value:function(e){var t=this,n=e.callback,r=e.errorCallback,i=e.eventPrefix,a=e.resource,o=e.formatData,c=e.expiryTime,s=e.successHandler,u=e.errorHandler,l=e.bootstrapName,f=this.getEventNames(i),p=f.syncEvent,m=f.requestEvent,h=f.successEvent,y=f.errorEvent,v=this.getChannel(),b=this.currentTimestamp();this.bootstrapData&&this.bootstrapData[l]&&(this.cacheData(i,this.bootstrapData[l],o,{openRequest:!1,timestamp:b}),delete this.bootstrapData[l]);var g,S=this.cache.get(i);S&&(g=S.data);var E=S&&S.openRequest,O=this.isExpired(i,c);if(E&&(this.listenToOnce(v,p,(function(e){d.isFunction(r)&&t.stopListening(t.getChannel(),y,r),d.isFunction(n)&&n(e)})),this.listenToOnce(v,y,(function(){d.isFunction(n)&&t.stopListening(t.getChannel(),p,n),d.isFunction(r)&&r()}))),this.cache.has(i)&&!O||(v.trigger(m),this.listenToResponse({eventPrefix:i,formatData:o,cacheOptions:{timestamp:b},callback:n,errorCallback:r,successHandler:s,errorHandler:u}),this.cacheData(i,null,null,{openRequest:!0,timestamp:b}),this.dataProvider.read(a,{channel:this.getTransportChannel(),successEvent:h,errorEvent:y})),g&&d.isFunction(n)&&!O&&n(g),g)return g}},{key:"create",value:function(e){var t=e.eventPrefix,n=e.resource,r=e.data,i=e.formatData,a=e.callback,o=e.errorCallback,c=e.invalidationKeys,s=e.successHandler,u=e.errorHandler,l=this.getEventNames(e.eventPrefix),f=l.requestEvent,p=l.successEvent,d=l.errorEvent,m=this.getChannel(),h=this.getTransportChannel();m.trigger(f),this.listenToResponse({eventPrefix:t,formatData:i,invalidationKeys:c,callback:a,errorCallback:o,successHandler:s,errorHandler:u}),this.dataProvider.create(n,r,{channel:h,successEvent:p,errorEvent:d})}},{key:"update",value:function(e){var t=e.data,n=e.callback,r=e.errorCallback,i=e.resource,a=e.formatData,o=e.eventPrefix,c=e.invalidationKeys,s=e.errorHandler,u=e.successHandler,l=this.getEventNames(e.eventPrefix),f=l.requestEvent,p=l.successEvent,d=l.errorEvent,m=this.getChannel(),h=this.getTransportChannel();m.trigger(f),this.listenToResponse({eventPrefix:o,formatData:a,invalidationKeys:c,callback:n,errorCallback:r,successHandler:u,errorHandler:s}),this.dataProvider.update(i,t,{channel:h,successEvent:p,errorEvent:d})}},{key:"delete",value:function(e){var t=e.eventPrefix,n=e.resource,r=e.callback,i=e.errorCallback,a=e.invalidationKeys,o=e.successHandler,c=e.errorHandler,s=this.getEventNames(t),u=s.successEvent,l=s.errorEvent,f=this.getTransportChannel();this.listenToResponse({eventPrefix:t,invalidationKeys:a,callback:r,errorCallback:i,cacheOptions:{noCache:!0,clearCacheKey:!0},successHandler:o,errorHandler:c}),this.dataProvider.delete(n,{channel:f,successEvent:u,errorEvent:l})}},{key:"listenToResponse",value:function(e){var t=this,n=e.eventPrefix,r=e.formatData,i=e.callback,a=e.errorCallback,o=e.successHandler,c=e.errorHandler,s=e.invalidationKeys,u=e.cacheOptions,l=void 0===u?{}:u,f=this.getEventNames(n),p=f.syncEvent,m=f.successEvent,h=f.errorEvent,y=f.successAlertEvent,v=f.errorAlertEvent,b=this.getChannel(),g=this.getTransportChannel(),S=this.getAlertChannel();d.isFunction(i)&&this.listenToOnce(b,p,i),d.isFunction(a)&&this.listenToOnce(b,h,a),this.stopListening(S,y),this.stopListening(S,v),d.isFunction(o)&&this.listenToOnce(S,y,o),d.isFunction(c)&&this.listenToOnce(S,v,c),!d.isFunction(c)&&!1!==c&&d.isFunction(this.defaultErrorHandler)&&this.listenToOnce(S,v,this.defaultErrorHandler),this.hasRequestSignature(n)||(this.setRequestSignature(n),this.listenTo(g,m,(function(e){t.stopListening(b,h,a);for(var i=arguments.length,o=new Array(i>1?i-1:0),c=1;c<i;c++)o[c-1]=arguments[c];S.trigger.apply(S,[y,e].concat(o));var u=l.noCache?t.formatData(e,r):t.cacheData(n,e,r);l.clearCacheKey&&t.cache.remove(n),b.trigger(p,u),s&&s.length&&t.cache.invalidate(s,(function(e){return b.trigger("".concat(e,":invalidate"))}))})),this.listenTo(g,h,(function(){var e;t.stopListening(b,p,i);var r=(e=t.dataProvider).parseError.apply(e,arguments);S.trigger(v,r),b.trigger(h,r),l.noCache||t.cacheData(n,null,null)})))}},{key:"cacheData",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.openRequest,a=void 0!==i&&i,o=r.timestamp;o||(o=this.currentTimestamp());var c=this.processPagination(t),s=this.formatData(t,n);return this.cache.set(e,{data:s,timestamp:o,cursors:c,openRequest:a}),s}},{key:"processPagination",value:function(e){if(e){var t=e.pagination;if(t)return t.cursors?t.cursors:d.isUndefined(t.offset)||d.isUndefined(t.pageSize)?t.page?this.convertLegacyPaginationToCursors(t):void 0:this.convertOffsetPaginationToCursors(t)}}},{key:"formatData",value:function(e,t){return d.isFunction(t)?t(e):e}},{key:"chain",value:function(){var e=this,t=[],n=function(e,t){d.isFunction(e)&&e(t)},r=function(r,a){return t.push((function(){var i=r.callback;r.callback=function(e){n(i,e),n(t.shift())},e[a](r)})),i},i={func:function(e){return t.push((function(){e(t.shift()||function(){})})),i},get:function(e){return r(e,"get")},create:function(e){return r(e,"create")},update:function(e){return r(e,"update")},delete:function(e){return r(e,"delete")},run:function(){n(t.shift())}};return i}},{key:"invalidateCache",value:function(e){e&&e.length&&this.cache.invalidate(e)}},{key:"currentTimestamp",value:function(){return(new Date).valueOf()}},{key:"isExpired",value:function(e,t){if(!t)return!1;var n=this.cache.get(e);if(!n||!n.timestamp)return!0;var r=1e3*t;return n.timestamp<this.currentTimestamp()-r}},{key:"getEventNames",value:function(e){return{syncEvent:"".concat(e,":sync"),requestEvent:"".concat(e,":request"),successEvent:"".concat(e,":success"),errorEvent:"".concat(e,":error"),successAlertEvent:"".concat(e,":success:alert"),errorAlertEvent:"".concat(e,":error:alert")}}},{key:"getTransportChannel",value:function(){return eu.Radio.channel("".concat(this.channelName,":transport"))}},{key:"getAlertChannel",value:function(){return eu.Radio.channel("".concat(this.channelName,":alert"))}},{key:"setRequestSignature",value:function(e){this.dataRequestSignatures[e]=e}},{key:"hasRequestSignature",value:function(e){return!!this.dataRequestSignatures[e]}},{key:"convertOffsetPaginationToCursors",value:function(e){var t=e.offset,n=e.pageSize,r=e.totalItems,i=r>0&&t<r&&t+n,a=r>0&&t>0&&Math.max(t-n,0),o={};if(i&&i<r&&(o.next=i.toString()),d.isNumber(a)&&(o.previous=a.toString()),!d.isEmpty(o))return o}},{key:"convertLegacyPaginationToCursors",value:function(e){var t=e.page,n=e.totalPages,r=d.isNumber(t)&&t>0&&t<n&&t+1,i=d.isNumber(t)&&t>1&&t-1,a={};if(r&&r<=n&&(a.next=r.toString()),i&&(a.previous=i.toString()),!d.isEmpty(a))return a}}])&&gh(t.prototype,n),r&&gh(t,r),a}(Kc.a),_h=n(47),Ph={SHORT:120,STANDARD:600};!function(e){e[e.Subject=0]="Subject",e[e.Classification=1]="Classification",e[e.Level=2]="Level",e[e.Audience=3]="Audience"}(wh||(wh={})),function(e){e.Playlists="playlists",e.Series="series",e.Videos="videos"}(jh||(jh={})),function(e){e.Playlists="playlists",e.Series="series",e.Videos="videos"}(Ih||(Ih={})),function(e){e.Root="0"}(kh||(kh={})),function(e){e.Root="root"}(Th||(Th={}));var xh,Nh,Rh=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default(""),backboneAudienceIds:ji.array().of(ji.string()).required("A level is required").default([])}).noUnknown();!function(e){e.Subject="Subject",e.Topic="Topic"}(xh||(xh={})),function(e){e.Draft="Draft",e.ComingSoon="ComingSoon",e.Published="Published"}(Nh||(Nh={}));var Dh=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default(""),parentIds:ji.array().of(ji.string()).default([Th.Root]),backboneClassificationIds:ji.array().of(ji.string()).min(1,"A classification must be mapped to at least one subject").required("A classification must be mapped to at least one subject").default([]),type:ji.mixed().required("Type is required").default(xh.Subject),status:ji.mixed().required("Status is required").default(Nh.Draft),emphasize:ji.boolean().default(!1),canBePreferred:ji.boolean().default(!1),cover:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown(),banner:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown(),tallPoster:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown()}).noUnknown(),Mh=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown(),Uh=ji.object().shape({name:ji.string().max(255,"Name is too long").required("Name is required"),description:ji.string().max(65535,"Description is too long").required("Description is required"),status:ji.mixed().required("Status is required").default(wp.Draft)}),Fh=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default(""),parentId:ji.string().default(kh.Root)}).noUnknown(),Vh={singularizeMemberType:function(e){switch(e){case jh.Playlists:return"playlist";case jh.Series:return"series";case jh.Videos:return"video"}},getMemberAppLink:function(e,t){var n=[t];switch(e){case jh.Playlists:return{application:c.PLAYLISTS,action:i.Playlists.EDIT_PLAYLIST,args:n};case jh.Series:return{application:c.SERIES,action:i.Series.EDIT_SERIES,args:n};case jh.Videos:return{application:c.VIDEOS,action:i.Videos.EDIT_VIDEO,args:n}}},getMemberActions:function(e,t,n,r){return[{label:"Remove ".concat(Vh.singularizeMemberType(n)),appLink:{application:c.SUBJECTS,action:t===wh.Subject?i.Subjects.REMOVE_SUBJECT_MEMBER:i.Subjects.REMOVE_CLASSIFICATION_MEMBER,args:[e,r,n]},className:"text-danger"}]}},Bh=function(){var e=c.SUBJECTS,t=i.Subjects;return[{label:"Classifications",appLink:{application:e,action:t.CLASSIFICATIONS},activeActions:[t.CLASSIFICATIONS,t.PRESENTATION_CLASSIFICATIONS,t.NEW_CLASSIFICATION,t.EDIT_CLASSIFICATION,t.EDIT_CLASSIFICATION_PLAYLISTS,t.EDIT_CLASSIFICATION_SERIES,t.EDIT_CLASSIFICATION_VIDEOS,t.DELETE_CLASSIFICATION,t.REMOVE_CLASSIFICATION_MEMBER]},{label:"Backbone Classifications",appLink:{application:e,action:t.SUBJECTS},activeActions:[t.SUBJECTS,t.NEW_SUBJECT,t.EDIT_SUBJECT,t.EDIT_SUBJECT_PLAYLISTS,t.EDIT_SUBJECT_SERIES,t.EDIT_SUBJECT_VIDEOS,t.SUBJECT_CLASSIFICATIONS,t.DELETE_SUBJECT,t.ADD_SUBJECT_MEMBERS,t.REMOVE_SUBJECT_MEMBER]},{label:"Audiences",appLink:{application:e,action:t.AUDIENCES},activeActions:[t.AUDIENCES,t.PRESENTATION_AUDIENCES,t.NEW_AUDIENCE,t.EDIT_AUDIENCE,t.EDIT_AUDIENCE_PLAYLISTS,t.EDIT_AUDIENCE_SERIES,t.EDIT_AUDIENCE_VIDEOS,t.REMOVE_AUDIENCE_MEMBER]},{label:"Backbone Audiences",appLink:{application:e,action:t.LEVELS},activeActions:[t.LEVELS,t.NEW_LEVEL,t.EDIT_LEVEL,t.LEVEL_AUDIENCES,t.EDIT_LEVEL_PLAYLISTS,t.EDIT_LEVEL_SERIES,t.EDIT_LEVEL_VIDEOS]},{label:"Presentations",appLink:{application:e,action:t.PRESENTATIONS},activeActions:[t.PRESENTATIONS,t.NEW_PRESENTATION,t.EDIT_PRESENTATION]}]},zh=function(e,t){var n=c.SUBJECTS,r=i.Subjects,a=[e];return[{label:"Edit Backbone Classification Details",appLink:{action:r.EDIT_SUBJECT}},{label:"Classifications",appLink:{action:r.SUBJECT_CLASSIFICATIONS}},{label:"Playlists",appLink:{action:r.EDIT_SUBJECT_PLAYLISTS}},{label:"Series",appLink:{action:r.EDIT_SUBJECT_SERIES}},{label:"Videos",appLink:{action:r.EDIT_SUBJECT_VIDEOS}}].map((function(e){var r=Object.assign(Object.assign({},e.appLink),{application:n,args:a});return t&&(r.params={presentationId:t}),{label:e.label,appLink:r}}))},Hh=function(e,t){var n=c.SUBJECTS,r=i.Subjects;return[{label:"Edit Classification Details",appLink:{application:n,action:r.EDIT_CLASSIFICATION,args:[e,t]}},{label:"Playlists",appLink:{application:n,action:r.EDIT_CLASSIFICATION_PLAYLISTS,args:[e,t]}},{label:"Series",appLink:{application:n,action:r.EDIT_CLASSIFICATION_SERIES,args:[e,t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_CLASSIFICATION_VIDEOS,args:[e,t]}}]},qh=function(e,t){var n=c.SUBJECTS,r=i.Subjects,a=[e];return[{label:"Edit Level Details",appLink:{action:r.EDIT_LEVEL}},{label:"Audiences",appLink:{action:r.LEVEL_AUDIENCES}},{label:"Playlists",appLink:{action:r.EDIT_LEVEL_PLAYLISTS}},{label:"Series",appLink:{action:r.EDIT_LEVEL_SERIES}},{label:"Videos",appLink:{action:r.EDIT_LEVEL_VIDEOS}}].map((function(e){var r=Object.assign(Object.assign({},e.appLink),{application:n,args:a});return t&&(r.params={presentationId:t}),{label:e.label,appLink:r}}))},Jh=function(e,t){var n=c.SUBJECTS,r=i.Subjects;return[{label:"Edit Audience Details",appLink:{application:n,action:r.EDIT_AUDIENCE,args:[e,t]}},{label:"Playlists",appLink:{application:n,action:r.EDIT_AUDIENCE_PLAYLISTS,args:[e,t]}},{label:"Series",appLink:{application:n,action:r.EDIT_AUDIENCE_SERIES,args:[e,t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_AUDIENCE_VIDEOS,args:[e,t]}}]},$h={singularizeMemberType:function(e){switch(e){case Ih.Playlists:return"playlist";case Ih.Series:return"series";case Ih.Videos:return"video"}},getMemberAppLink:function(e,t){var n=[t];switch(e){case Ih.Playlists:return{application:c.PLAYLISTS,action:i.Playlists.EDIT_PLAYLIST,args:n};case Ih.Series:return{application:c.SERIES,action:i.Series.EDIT_SERIES,args:n};case Ih.Videos:return{application:c.VIDEOS,action:i.Videos.EDIT_VIDEO,args:n}}},getMemberActions:function(e,t,n,r){return[{label:"Remove ".concat($h.singularizeMemberType(n)),appLink:{application:c.SUBJECTS,action:t===wh.Level?i.Subjects.REMOVE_LEVEL_MEMBER:i.Subjects.REMOVE_AUDIENCE_MEMBER,args:[e,r,n]},className:"text-danger"}]}};function Kh(e){return(Kh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yh(e){return function(e){if(Array.isArray(e))return Gh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Gh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gh(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Wh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Qh(e,t){return(Qh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xh(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ty(e);if(t){var i=ty(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ey(this,n)}}function ey(e,t){return!t||"object"!==Kh(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ty(e){return(ty=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ny=function(){return"/api/subjects/v1/backbone-classifications/tree"},ry=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},iy=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/").concat(t,"?query={limit:100}")},ay=function(e,t,n){var r="/api/subjects/v1/backbone-classifications/".concat(e,"/classifications"),i=[];return t&&i.push("presentationId=".concat(t)),n&&i.push("query=".concat(n,"{limit:100}")),i.length?"".concat(r,"?").concat(i.join("&")):r},oy=function(){return"/api/subjects/v1/backbone-classifications"},cy=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},sy=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},uy=function(e){return"/api/subjects/v1/objects/".concat(e,"/backbone-classifications")},ly=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/backbone-classifications?addToClassifications=").concat(!!t)},fy=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/objects?addToClassifications=").concat(!!t)},py=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},dy=function(){return"/api/subjects/v1/presentations"},my=function(e){return"/api/subjects/v1/presentations/".concat(e)},hy=function(){return"/api/subjects/v1/presentations"},yy=function(e){return"/api/subjects/v1/presentations/".concat(e)},vy=function(e){return"/api/subjects/v1/presentations/".concat(e,"/classifications/tree")},by=function(e){return"/api/subjects/v1/classifications/".concat(e,"?query=cover,banner,followers[count()]{limit:0}")},gy=function(e,t){return"/api/subjects/v1/classifications/".concat(e,"/").concat(t,"?query={limit:100}")},Sy=function(){return"/api/subjects/v1/classifications"},Ey=function(e){return"/api/subjects/v1/classifications/".concat(e)},Oy=function(e){return"/api/subjects/v1/classifications/".concat(e)},Cy=function(e){return"/api/subjects/v1/objects/".concat(e,"/classifications")},Ay=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/classifications?presentationId=").concat(t)},wy=function(e){return"/api/subjects/v1/classifications/".concat(e,"/objects")},jy=function(e,t){return"/api/subjects/v1/classifications/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},Iy=function(){return"/api/subjects/v1/backbone-audiences"},ky=function(e){return"/api/subjects/v1/backbone-audiences/".concat(e)},Ty=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/").concat(t,"?query={limit:100}")},Ly=function(e,t,n){var r="/api/subjects/v1/backbone-audiences/".concat(e,"/audiences"),i=[];return t&&i.push("presentationId=".concat(t)),n&&i.push("query=".concat(n,"{limit:100}")),i.length?"".concat(r,"?").concat(i.join("&")):r},_y=function(){return"/api/subjects/v1/backbone-audiences"},Py=function(e){return"/api/subjects/v1/backbone-audiences/".concat(e)},xy=function(e){return"/api/subjects/v1/objects/".concat(e,"/backbone-audiences")},Ny=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/backbone-audiences?addToAudiences=").concat(!!t)},Ry=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/objects?addToAudiences=").concat(!!t)},Dy=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},My=function(e){return"/api/subjects/v1/presentations/".concat(e,"/audiences")},Uy=function(e){return"/api/subjects/v1/audiences/".concat(e)},Fy=function(e,t){return"/api/master/v2/objects/".concat(e,"/").concat(t,"?query={limit:100}")},Vy=function(){return"/api/subjects/v1/audiences"},By=function(e){return"/api/subjects/v1/audiences/".concat(e)},zy=function(e){return"/api/subjects/v1/audiences/".concat(e)},Hy=function(e){return"/api/subjects/v1/objects/".concat(e,"/audiences")},qy=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/audiences?presentationId=").concat(t)},Jy=function(e){return"/api/subjects/v1/audiences/".concat(e,"/objects")},$y=function(e,t){return"/api/subjects/v1/audiences/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},Ky=function(e,t,n){var r="".concat(a.SUBJECT,":").concat(e);return t&&(r+=":".concat(t)),r+=":".concat(a.CLASSIFICATIONS),n&&(r+=":".concat(n)),r},Yy=function(e,t,n){var r="".concat(a.LEVEL,":").concat(e);return t&&(r+=":".concat(t)),r+=":".concat(a.AUDIENCES),n&&(r+=":".concat(n)),r},Gy=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qh(e,t)}(o,e);var t,n,r,i=Xh(o);function o(){return Wh(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"name",get:function(){return u.SUBJECT}},{key:"channelName",get:function(){return s.SUBJECT}},{key:"getPresentations",value:function(e,t){return this.get({resource:dy(),eventPrefix:a.PRESENTATIONS,expiryTime:Ph.STANDARD,callback:e,errorCallback:t})}},{key:"getPresentation",value:function(e,t,n){return this.get({resource:my(e),eventPrefix:"".concat(a.PRESENTATION,":").concat(e),expiryTime:Ph.STANDARD,callback:t,errorCallback:n})}},{key:"createPresentation",value:function(e,t,n){return this.create({resource:hy(),data:e,callback:t,errorCallback:n,eventPrefix:a.PRESENTATION,invalidationKeys:[a.PRESENTATIONS],expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully created presentation."),errorHandler:this.alertService.error("Failed to create presentation.")})}},{key:"updatePresentation",value:function(e,t,n,r){return this.update({resource:yy(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(a.UPDATE_PRESENTATION,":").concat(e),invalidationKeys:["".concat(a.PRESENTATION,":").concat(e),a.PRESENTATIONS],expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully updated presentation."),errorHandler:this.alertService.error("Failed to update presentation.")})}},{key:"getSubjectTree",value:function(e,t){return this.get({resource:ny(),formatData:function(e){return{children:e,name:kh.Root,id:null}},eventPrefix:a.SUBJECTS,expiryTime:Ph.STANDARD,callback:e,errorCallback:t})}},{key:"getSubject",value:function(e,t,n){return this.get({resource:ry(e),eventPrefix:"".concat(a.SUBJECT,":").concat(e),expiryTime:Ph.STANDARD,callback:t,errorCallback:n})}},{key:"getSubjectMemberIds",value:function(e,t,n,r){return this.get({resource:iy(e,t),eventPrefix:"".concat(a.SUBJECT,":").concat(e,":").concat(t),expiryTime:Ph.STANDARD,callback:n,errorCallback:r})}},{key:"getSubjectClassifications",value:function(e,t,n,r,i){return this.get({resource:ay(e,t,n),eventPrefix:Ky(e,t,n),expiryTime:Ph.STANDARD,callback:r,errorCallback:i})}},{key:"createSubject",value:function(e,t,n){return this.create({resource:oy(),data:e,callback:t,errorCallback:n,eventPrefix:a.SUBJECT,invalidationKeys:[a.SUBJECTS],expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully created subject."),errorHandler:this.alertService.error("Failed to create subject.")})}},{key:"updateSubject",value:function(e,t,n,r){return this.update({resource:cy(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(a.UPDATE_SUBJECT,":").concat(e),invalidationKeys:["".concat(a.SUBJECT,":").concat(e),a.SUBJECTS],expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully updated subject."),errorHandler:this.alertService.error("Failed to save subject.")})}},{key:"deleteSubject",value:function(e,t,n){var r=this;return this.delete({resource:sy(e),callback:t,errorCallback:n,eventPrefix:a.DELETE_SUBJECT,invalidationKeys:["".concat(a.SUBJECT,":").concat(e),a.SUBJECTS],successHandler:this.alertService.success("Successfully deleted subject."),errorHandler:function(e){var t=(null==e?void 0:e.code)===_h.a.Conflict?"Cannot delete a subject with child subjects and/or classifications.":"Failed to delete subject.";r.alertService.error(t)()}})}},{key:"getObjectSubjects",value:function(e,t,n,r){return this.get({resource:uy(e),eventPrefix:"".concat(t,":").concat(e,":").concat(a.SUBJECTS),expiryTime:Ph.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectSubjects",value:function(e,t,n,r,i,o){var c=Vh.singularizeMemberType(n),s=["".concat(n,":").concat(e,":").concat(a.SUBJECTS)];return r&&s.push("".concat(n,":").concat(e,":").concat(a.CLASSIFICATIONS)),s.push.apply(s,Yh(t.map((function(e){return"".concat(a.SUBJECTS,":").concat(e,":").concat(n)})))),this.update({resource:ly(e,r),data:t,callback:i,errorCallback:o,eventPrefix:"".concat(a.UPDATE_OBJECT_SUBJECTS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(c," subjects.")),errorHandler:this.alertService.error("Failed to update ".concat(c," subjects."))})}},{key:"addObjectsToSubject",value:function(e,t,n,r,i,o){var c=1===t.length?Vh.singularizeMemberType(n):n,s=["".concat(a.SUBJECT,":").concat(e,":").concat(n)].concat(Yh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.SUBJECTS)}))),Yh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.CLASSIFICATIONS)}))));return this.create({resource:fy(e,r),data:t,callback:i,errorCallback:o,eventPrefix:"".concat(a.ADD_TO_SUBJECT,":").concat(e,":").concat(n),invalidationKeys:s,expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(c," to subject.")),errorHandler:this.alertService.error("Failed to add ".concat(c," to subject."))})}},{key:"removeObjectsFromSubject",value:function(e,t,n,r,i){var o=1===t.length?Vh.singularizeMemberType(n):n,c=["".concat(a.SUBJECT,":").concat(e,":").concat(n)].concat(Yh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.SUBJECTS)}))));return this.delete({resource:py(e,t),callback:r,errorCallback:i,eventPrefix:"".concat(a.REMOVE_FROM_SUBJECT,":").concat(e,":").concat(n),invalidationKeys:c,expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(o," from subject.")),errorHandler:this.alertService.error("Failed to remove ".concat(o," from subject."))})}},{key:"getClassificationTree",value:function(e,t,n){return this.get({resource:vy(e),formatData:function(e){return{children:e,name:Th.Root,id:null}},eventPrefix:"".concat(a.CLASSIFICATIONS,":").concat(e),expiryTime:Ph.STANDARD,callback:t,errorCallback:n})}},{key:"getClassification",value:function(e,t,n){return this.get({resource:by(e),eventPrefix:"".concat(a.CLASSIFICATION,":").concat(e),expiryTime:Ph.STANDARD,callback:t,errorCallback:n})}},{key:"getClassificationMembers",value:function(e,t,n,r){return this.get({resource:gy(e,t),eventPrefix:"".concat(a.CLASSIFICATION,":").concat(e,":").concat(t),expiryTime:Ph.STANDARD,callback:n,errorCallback:r})}},{key:"createClassification",value:function(e,t,n){return this.create({resource:Sy(),data:e,callback:t,errorCallback:n,eventPrefix:a.CLASSIFICATION,invalidationKeys:[a.CLASSIFICATIONS],expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully created classification."),errorHandler:this.alertService.error("Failed to create classification.")})}},{key:"updateClassification",value:function(e,t,n,r){return this.update({resource:Ey(e),data:Ci.a.omit(t,["followers"]),callback:n,errorCallback:r,eventPrefix:"".concat(a.UPDATE_CLASSIFICATION,":").concat(e),invalidationKeys:["".concat(a.CLASSIFICATION,":").concat(e),a.CLASSIFICATIONS],expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully updated classification."),errorHandler:this.alertService.error("Failed to save classification.")})}},{key:"deleteClassification",value:function(e,t,n){return this.delete({resource:Oy(e),callback:t,errorCallback:n,eventPrefix:a.DELETE_CLASSIFICATION,invalidationKeys:["".concat(a.CLASSIFICATION,":").concat(e),a.CLASSIFICATIONS],successHandler:this.alertService.success("Successfully deleted classification"),errorHandler:this.alertService.error("Failed to delete classification")})}},{key:"getObjectClassifications",value:function(e,t,n,r){return this.get({resource:Cy(e),eventPrefix:"".concat(t,":").concat(e,":").concat(a.CLASSIFICATIONS),expiryTime:Ph.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectClassifications",value:function(e,t,n,r,i,o){var c=Vh.singularizeMemberType(r),s=["".concat(r,":").concat(e,":").concat(a.CLASSIFICATIONS)];return s.push.apply(s,Yh(n.map((function(e){return"".concat(a.CLASSIFICATION,":").concat(e,":").concat(r)})))),this.update({resource:Ay(e,t),data:n,callback:i,errorCallback:o,eventPrefix:"".concat(a.UPDATE_OBJECT_CLASSIFICATIONS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(c," classifications.")),errorHandler:this.alertService.error("Failed to update ".concat(c," classifications."))})}},{key:"addObjectsToClassification",value:function(e,t,n,r,i,o,c){var s=1===t.length?Vh.singularizeMemberType(n):n,u=["".concat(a.CLASSIFICATION,":").concat(e,":").concat(n)];return r&&u.push(Ky(r,i,n)),u.push.apply(u,Yh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.CLASSIFICATIONS)})))),this.create({resource:wy(e),data:t,callback:o,errorCallback:c,eventPrefix:"".concat(a.ADD_TO_CLASSIFICATION,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(s," to classification.")),errorHandler:this.alertService.error("Failed to add ".concat(s," to classification."))})}},{key:"removeObjectsFromClassification",value:function(e,t,n,r,i,o,c){var s=1===t.length?Vh.singularizeMemberType(n):n,u=["".concat(a.CLASSIFICATION,":").concat(e,":").concat(n)];return r&&u.push(Ky(r,i,n)),u.push.apply(u,Yh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.CLASSIFICATIONS)})))),this.delete({resource:jy(e,t),callback:o,errorCallback:c,eventPrefix:"".concat(a.REMOVE_FROM_CLASSIFICATION,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(s," from classification.")),errorHandler:this.alertService.error("Failed to remove ".concat(s," from classification."))})}},{key:"getLevels",value:function(e,t){return this.get({resource:Iy(),eventPrefix:a.LEVELS,expiryTime:Ph.STANDARD,callback:e,errorCallback:t})}},{key:"getLevel",value:function(e,t,n){return this.get({resource:ky(e),eventPrefix:"".concat(a.LEVEL,":").concat(e),expiryTime:Ph.STANDARD,callback:t,errorCallback:n})}},{key:"getLevelMemberIds",value:function(e,t,n,r){return this.get({resource:Ty(e,t),eventPrefix:"".concat(a.LEVEL,":").concat(e,":").concat(t),expiryTime:Ph.STANDARD,callback:n,errorCallback:r})}},{key:"getLevelAudiences",value:function(e,t,n,r,i){return this.get({resource:Ly(e,t,n),eventPrefix:Yy(e,t,n),expiryTime:Ph.STANDARD,callback:r,errorCallback:i})}},{key:"createLevel",value:function(e,t,n){return this.create({resource:_y(),data:e,callback:t,errorCallback:n,eventPrefix:a.LEVEL,invalidationKeys:[a.LEVELS],expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully created level."),errorHandler:this.alertService.error("Failed to create level.")})}},{key:"updateLevel",value:function(e,t,n,r){return this.update({resource:Py(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(a.UPDATE_LEVEL,":").concat(e),invalidationKeys:["".concat(a.LEVEL,":").concat(e),a.LEVELS],expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully updated level."),errorHandler:this.alertService.error("Failed to save level.")})}},{key:"getObjectLevels",value:function(e,t,n,r){return this.get({resource:xy(e),eventPrefix:"".concat(t,":").concat(e,":").concat(a.LEVELS),expiryTime:Ph.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectLevels",value:function(e,t,n,r,i,o){var c=Vh.singularizeMemberType(n),s=["".concat(n,":").concat(e,":").concat(a.LEVELS)];return r&&s.push("".concat(n,":").concat(e,":").concat(a.AUDIENCES)),this.update({resource:Ny(e,r),data:t,callback:i,errorCallback:o,eventPrefix:"".concat(a.UPDATE_OBJECT_LEVELS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(c," levels.")),errorHandler:this.alertService.error("Failed to update ".concat(c," levels."))})}},{key:"addObjectsToLevel",value:function(e,t,n,r,i,o){var c=1===t.length?$h.singularizeMemberType(n):n,s=["".concat(a.LEVEL,":").concat(e,":").concat(n)].concat(Yh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.LEVELS)}))),Yh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.AUDIENCES)}))));return this.create({resource:Ry(e,r),data:t,callback:i,errorCallback:o,eventPrefix:"".concat(a.ADD_TO_LEVEL,":").concat(e,":").concat(n),invalidationKeys:s,expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(c," to level.")),errorHandler:this.alertService.error("Failed to add ".concat(c," to level."))})}},{key:"removeObjectsFromLevel",value:function(e,t,n,r,i){var o=1===t.length?$h.singularizeMemberType(n):n,c=["".concat(a.LEVEL,":").concat(e,":").concat(n)].concat(Yh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.LEVELS)}))));return this.delete({resource:Dy(e,t),callback:r,errorCallback:i,eventPrefix:"".concat(a.REMOVE_FROM_LEVEL,":").concat(e,":").concat(n),invalidationKeys:c,expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(o," from level.")),errorHandler:this.alertService.error("Failed to remove ".concat(o," from level."))})}},{key:"getAudiences",value:function(e,t,n){return this.get({resource:My(e),callback:t,errorCallback:n,eventPrefix:"".concat(a.AUDIENCES,":").concat(e),expiryTime:Ph.STANDARD})}},{key:"getAudience",value:function(e,t,n){return this.get({resource:Uy(e),callback:t,errorCallback:n,eventPrefix:"".concat(a.AUDIENCE,":").concat(e),expiryTime:Ph.STANDARD})}},{key:"getAudienceMembers",value:function(e,t,n,r){return this.get({resource:Fy(e,t),eventPrefix:"".concat(a.AUDIENCE,":").concat(e,":").concat(t),expiryTime:Ph.STANDARD,callback:n,errorCallback:r})}},{key:"createAudience",value:function(e,t,n){return this.create({resource:Vy(),data:e,callback:t,errorCallback:n,eventPrefix:a.AUDIENCE,invalidationKeys:[a.AUDIENCES],expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully created audience."),errorHandler:this.alertService.error("Failed to create audience.")})}},{key:"updateAudience",value:function(e,t,n,r){return this.update({resource:By(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(a.UPDATE_AUDIENCE,":").concat(e),invalidationKeys:["".concat(a.AUDIENCE,":").concat(e),a.AUDIENCES],expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully updated audience."),errorHandler:this.alertService.error("Failed to update audience.")})}},{key:"deleteAudience",value:function(e,t,n){return this.delete({resource:zy(e),callback:t,errorCallback:n,eventPrefix:a.DELETE_AUDIENCE,invalidationKeys:["".concat(a.AUDIENCE,":").concat(e),a.AUDIENCES],successHandler:this.alertService.success("Successfully deleted audience"),errorHandler:this.alertService.error("Failed to delete audience")})}},{key:"getObjectAudiences",value:function(e,t,n,r){return this.get({resource:Hy(e),eventPrefix:"".concat(t,":").concat(e,":").concat(a.AUDIENCES),expiryTime:Ph.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectAudiences",value:function(e,t,n,r,i,o){var c=Vh.singularizeMemberType(r);return this.update({resource:qy(e,t),data:n,callback:i,errorCallback:o,eventPrefix:"".concat(a.UPDATE_OBJECT_AUDIENCES,":").concat(e),invalidationKeys:["".concat(r,":").concat(e,":").concat(a.AUDIENCES)],successHandler:this.alertService.success("Successfully updated ".concat(c," audiences.")),errorHandler:this.alertService.error("Failed to update ".concat(c," audiences."))})}},{key:"addObjectsToAudience",value:function(e,t,n,r,i,o,c){var s=1===t.length?$h.singularizeMemberType(n):n,u=["".concat(a.AUDIENCE,":").concat(e,":").concat(n)];return r&&u.push(Yy(r,i,n)),u.push.apply(u,Yh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.AUDIENCES)})))),this.create({resource:Jy(e),data:t,callback:o,errorCallback:c,eventPrefix:"".concat(a.ADD_TO_AUDIENCE,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(s," to audience.")),errorHandler:this.alertService.error("Failed to add ".concat(s," to audience."))})}},{key:"removeObjectsFromAudience",value:function(e,t,n,r,i,o,c){var s=1===t.length?$h.singularizeMemberType(n):n,u=["".concat(a.AUDIENCE,":").concat(e,":").concat(n)];return r&&u.push(Yy(r,i,n)),u.push.apply(u,Yh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.AUDIENCES)})))),this.delete({resource:$y(e,t),callback:o,errorCallback:c,eventPrefix:"".concat(a.REMOVE_FROM_AUDIENCE,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:Ph.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(s," from audience.")),errorHandler:this.alertService.error("Failed to remove ".concat(s," from audience."))})}}])&&Zh(t.prototype,n),r&&Zh(t,r),o}(Lh),Wy={dataServiceName:u.SUBJECT,dataChannelName:s.SUBJECT},Zy={getSubjectTreeFetchOptions:function(e,t){return Object.assign(Object.assign({},Wy),{eventPrefix:a.SUBJECTS,fetchData:function(e){return e.getSubjectTree()},setData:e,onError:t})},getSubjectFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Wy),{eventPrefix:"".concat(a.SUBJECT,":").concat(e),fetchData:function(t){return t.getSubject(e)},setData:t,onError:n,deleteEventPrefix:a.DELETE_SUBJECT})},getSubjectMemberIdsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Wy),{eventPrefix:"".concat(a.SUBJECT,":").concat(e,":").concat(t),fetchData:function(n){return n.getSubjectMemberIds(e,t)},setData:n,onError:r})},getSubjectClassificationFetchOptions:function(e,t,n,r,i){return Object.assign(Object.assign({},Wy),{eventPrefix:Ky(e,n,r),fetchData:function(t){return t.getSubjectClassifications(e,n,r)},setData:t,onError:i})},getObjectSubjectsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Wy),{eventPrefix:"".concat(t,":").concat(e,":").concat(a.SUBJECTS),fetchData:function(n){return n.getObjectSubjects(e,t)},setData:n,onError:r})},getPresentationsFetchOptions:function(e,t){return Object.assign(Object.assign({},Wy),{eventPrefix:a.PRESENTATIONS,fetchData:function(e){return e.getPresentations()},setData:e,onError:t})},getPresentationFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Wy),{eventPrefix:"".concat(a.PRESENTATION,":").concat(e),fetchData:function(t){return t.getPresentation(e)},setData:t,onError:n})},getClassificationTreeFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Wy),{eventPrefix:"".concat(a.CLASSIFICATIONS,":").concat(e),fetchData:function(t){return t.getClassificationTree(e)},setData:t,onError:n})},getClassificationFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Wy),{eventPrefix:"".concat(a.CLASSIFICATION,":").concat(e),fetchData:function(t){return t.getClassification(e)},setData:t,onError:n,deleteEventPrefix:a.DELETE_CLASSIFICATION})},getClassificationMembersFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Wy),{eventPrefix:"".concat(a.CLASSIFICATION,":").concat(e,":").concat(t),fetchData:function(n){return n.getClassificationMembers(e,t)},setData:n,onError:r})},getObjectClassificationsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Wy),{eventPrefix:"".concat(t,":").concat(e,":").concat(a.CLASSIFICATIONS),fetchData:function(n){return n.getObjectClassifications(e,t)},setData:n,onError:r})},getLevelsFetchOptions:function(e,t){return Object.assign(Object.assign({},Wy),{eventPrefix:a.LEVELS,fetchData:function(e){return e.getLevels()},setData:e,onError:t})},getLevelFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Wy),{eventPrefix:"".concat(a.LEVEL,":").concat(e),fetchData:function(t){return t.getLevel(e)},setData:t,onError:n})},getLevelMemberIdsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Wy),{eventPrefix:"".concat(a.LEVEL,":").concat(e,":").concat(t),fetchData:function(n){return n.getLevelMemberIds(e,t)},setData:n,onError:r})},getLevelAudiencesFetchOptions:function(e,t,n,r,i){return Object.assign(Object.assign({},Wy),{eventPrefix:Yy(e,n,r),fetchData:function(t){return t.getLevelAudiences(e,n,r)},setData:t,onError:i})},getObjectLevelsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Wy),{eventPrefix:"".concat(t,":").concat(e,":").concat(a.LEVELS),fetchData:function(n){return n.getObjectLevels(e,t)},setData:n,onError:r})},getAudiencesFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Wy),{eventPrefix:"".concat(a.AUDIENCES,":").concat(e),fetchData:function(t){return t.getAudiences(e)},setData:t,onError:n})},getAudienceFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Wy),{eventPrefix:"".concat(a.AUDIENCE,":").concat(e),fetchData:function(t){return t.getAudience(e)},setData:t,onError:n})},getAudienceMembersFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Wy),{eventPrefix:"".concat(a.AUDIENCE,":").concat(e,":").concat(t),fetchData:function(n){return n.getAudienceMembers(e,t)},setData:n,onError:r})},getObjectAudiencesFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Wy),{eventPrefix:"".concat(t,":").concat(e,":").concat(a.AUDIENCES),fetchData:function(n){return n.getObjectAudiences(e,t)},setData:n,onError:r})}},Qy=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[e.id]}},Xy=function(e,t){var n=e.backboneAudienceIds;return t.filter((function(e){return n.includes(e.id)}))};function ev(e){var t=e.showLevels;return l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",null,"Audiences"),!!t&&l.createElement("th",null,"Mapped Backbone Audience(s)")))}function tv(e){var t,n=e.audience,r=e.levels;return l.createElement("tr",null,l.createElement("td",null,l.createElement(lu,{appLink:(t=n,{application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[t.presentationId,t.masterId]})},n.name)),l.createElement("td",null,r.map((function(e){return l.createElement(lu,{key:e.id,appLink:Qy(e),className:"mr-2"},e.name)}))))}function nv(e){var t=e.audiences,n=e.levels;return l.createElement(ki.Table,{responsive:!0,bordered:!0},l.createElement(ev,{showLevels:!!t.length}),l.createElement("tbody",null,t.length?t.map((function(e){return l.createElement(tv,{key:e.masterId,audience:e,levels:Xy(e,n)})})):l.createElement("tr",null,l.createElement("td",null,"This presentation has no audiences."))))}function rv(e){var t=null===e.masterId||void 0===e.masterId,n=ci(),r=qc(n);return l.createElement(vi,null,l.createElement(Bc,{label:"Name",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this audience",autoFocus:!0}),l.createElement(Bc,{label:"Mapped Level(s)",as:"select",name:"backboneAudienceIds",id:"level-ids",multiple:!0,size:e.levels.length,value:n.values.backboneAudienceIds},e.levels.map((function(e){return l.createElement("option",{key:e.id,value:e.id},e.name)}))),l.createElement("div",{className:"d-flex justify-content-between"},l.createElement(cf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&l.createElement(ki.Button,{as:lu,variant:"danger",appLink:{application:c.SUBJECTS,action:i.Subjects.DELETE_AUDIENCE,args:[e.presentationId,e.masterId]}},"Delete")))}function iv(e){return l.createElement(wi,{initialValues:e.audience,validationSchema:Rh,onSubmit:e.saveAudience},l.createElement(rv,{masterId:e.audience&&e.audience.masterId,presentationId:e.presentationId,levels:e.levels}))}function av(e){var t=e.objectAudiences,n=e.presentationAudiences;return t.filter((function(e){return n.some((function(t){return t.masterId===e.masterId}))}))}function ov(e){var t,n,r,i,a,o=Vh.singularizeMemberType(e.memberType),c=(n=(t=e).presentationAudiences,r=t.objectLevels,i=t.objectAudiences,a=r.map((function(e){return e.id})),n.filter((function(e){return hp.a.intersection(e.backboneAudienceIds,a).length||i.some((function(t){return t.masterId===e.masterId}))})));return l.createElement(l.Fragment,null,l.createElement("div",{className:"border-bottom pb-3 mb-3"},l.createElement("h6",null,"Backbone Audiences"),l.createElement("p",null,"Select which backbone audiences this ".concat(o," is mapped to.")),l.createElement("p",null,"To see how backbone audiences correspond to audiences, scroll down to the audience-backbone audience mappings table."),l.createElement(_v,{initialValues:{backboneAudienceIds:e.objectLevels.map((function(e){return e.id}))},saveLevels:e.saveLevels,levels:e.levels,memberType:e.memberType})),l.createElement("h6",null,"Audiences"),l.createElement("p",null,"Select a presentation to view its audiences and map them to this ".concat(o,".")),l.createElement("div",{className:"w-50 pb-3"},l.createElement(Hv,{presentations:e.presentations,currentPresentationId:e.currentPresentation.id,setCurrentPresentation:e.setCurrentPresentation})),l.createElement("p",null,"Audience to backbone audience mappings for this presentation are displayed below."),l.createElement(nv,{levels:e.levels,audiences:e.presentationAudiences}),l.createElement("p",null,"Only the audiences which are mapped to a backbone audience that this"+" ".concat(o," is mapped to are displayed below.")),!!c.length&&l.createElement(sv,{initialValues:{audienceIds:av(e).map((function(e){return e.masterId}))},saveAudiences:e.saveAudiences,audiences:c}))}function cv(e){var t=ci(),n=qc(t);return l.createElement(vi,null,l.createElement(Bc,{label:"Audience(s)",as:"select",name:"audienceIds",id:"audience-ids",multiple:!0,size:e.audiences.length,value:t.values.audienceIds},e.audiences.map((function(e){return l.createElement("option",{key:e.masterId,value:e.masterId},e.name)}))),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(cf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Save Audiences")))}function sv(e){return l.createElement(wi,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.audienceIds;return e.saveAudiences(r,n)},enableReinitialize:!0},l.createElement(cv,{audiences:e.audiences}))}var uv=function(e){return function(t){if(!e)return t.appLink.action===i.Subjects.EDIT_AUDIENCE;switch(e){case Ih.Playlists:return t.appLink.action===i.Subjects.EDIT_AUDIENCE_PLAYLISTS;case Ih.Series:return t.appLink.action===i.Subjects.EDIT_AUDIENCE_SERIES;case Ih.Videos:return t.appLink.action===i.Subjects.EDIT_AUDIENCE_VIDEOS}}};function lv(e){var t=e.presentation,n=e.audienceId,r=e.memberType;return t?l.createElement(l.Fragment,null,l.createElement("h6",null,"Presentation: ".concat(!!t&&t.name)),l.createElement("div",{className:"py-2"},l.createElement(wl,{tabs:Jh(t.id,n),isItemActive:uv(r)}))):l.createElement(l.Fragment,null)}function fv(e){var t=e.item,n=e.getItemAppLink,r=e.actions;return l.createElement("tr",null,l.createElement("td",null,l.createElement(lu,{appLink:n(t)},t.name)),r&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(fl,{actions:r}))))}function pv(e){var t=e.items,n=e.memberType,r=e.getItemAppLink,i=e.getActions;if(!t.length)return l.createElement("div",{className:"py-5"},"No ".concat(n," in this audience."));var a="".concat(Sl($h.singularizeMemberType(n))," Name");return l.createElement(ki.Table,{responsive:!0},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",null,a),m(i)&&l.createElement("th",null))),l.createElement("tbody",null,t.map((function(e){return l.createElement(fv,{item:e,key:e.id,getItemAppLink:r,actions:m(i)&&i(e)})}))))}function dv(e){var t=e.item,n=e.getItemAppLink,r=e.actions,i=e.pinState;return l.createElement("tr",null,l.createElement("td",null,l.createElement(lu,{appLink:n(t)},t.name)),i.isPinnable&&l.createElement("td",null,l.createElement(gu,{selected:parseInt(t.id)===parseInt(i.currentPinnedVideo),onToggle:function(e){return i.onChange(e,t.id)},id:t.id})),r&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(fl,{actions:r}))))}function mv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return hv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bv(e){var t=e.items,n=e.memberType,r=e.classification,i=e.getItemAppLink,a=e.getActions,o=e.updatePinnedVideo,c=yv(l.useState(!1),2),s=c[0],u=c[1],f=function(e,t){var n=e.pinnedVideoMasterId||null,r=mv(l.useState(n),2),i=r[0],a=r[1];return{currentPinnedVideo:i,onChange:function(e,t){a(e?t:null)},canSubmit:n!==i,isPinnable:t===jh.Videos}}(r,n);if(!t.length)return l.createElement("div",{className:"py-5"},"No ".concat(n," in this classification."));var p="".concat(Sl(Vh.singularizeMemberType(n))," Name");return l.createElement(l.Fragment,null,l.createElement(ki.Table,{responsive:!0},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",null,p),f.isPinnable&&l.createElement("th",null,"Pinned"),m(a)&&l.createElement("th",null))),l.createElement("tbody",null,t.map((function(e){return l.createElement(dv,{item:e,key:e.id,getItemAppLink:i,actions:m(a)&&a(e),pinState:f})})))),f.isPinnable&&l.createElement(cf,{showSpinner:s,onClick:function(){u(!0),o(f.currentPinnedVideo,(function(){return u(!1)}))},disabled:!f.canSubmit||s},"Save"))}function gv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Sv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ev=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[e]}};function Ov(e){var t,n,r,a,o,s=ci(),u=qc(s),f=null===(null===(t=e.classification)||void 0===t?void 0:t.id)||void 0===(null===(n=e.classification)||void 0===n?void 0:n.id),p=!f||!(!s.values.parentIds||!s.values.parentIds.length),d=gv(l.useState(p),2),m=d[0],h=d[1];l.useEffect((function(){return h(p)}),[null===(r=e.classification)||void 0===r?void 0:r.id,s.values.parentIds]),l.useEffect((function(){s.values.backboneClassificationIds.length&&!s.touched.backboneClassificationIds&&s.setFieldTouched("backboneClassificationIds",!0)}),[s.values.backboneClassificationIds]);var y=function(e){return s.setFieldValue("parentIds",hp.a.addOrRemove(s.values.parentIds.map((function(e){return e.toString()})),e.id.toString()))},v=function(e){return s.setFieldValue("backboneClassificationIds",hp.a.addOrRemove(s.values.backboneClassificationIds.map((function(e){return e.toString()})),e.id.toString()))},b=function(e){return"".concat(Ti(s.errors,s.touched,e)," h-auto py-2")};return l.createElement(vi,null,l.createElement(Bc,{label:"Name",name:"name",id:"name",value:s.values.name,placeholder:"Enter a name for this classification",autoFocus:!0}),l.createElement(Bc,{as:"select",label:"Type",name:"type",id:"type",value:s.values.type},Ci.a.getEnumKeys(xh).map((function(e){return l.createElement("option",{key:e,value:xh[e]},e)}))),l.createElement(Bc,{as:"select",label:"Status",name:"status",id:"status",value:s.values.status,disabled:f},Ci.a.getEnumKeys(Nh).map((function(e){return l.createElement("option",{key:e,value:Nh[e]},e)}))),l.createElement(Bc,{label:"Emphasize",name:"emphasize",id:"emphasize",type:"checkbox",checked:s.values.emphasize}),l.createElement(Bc,{label:"Can Be Preferred",name:"canBePreferred",id:"canBePreferred",type:"checkbox",checked:s.values.canBePreferred}),!f&&l.createElement(l.Fragment,null,l.createElement("label",null,"Total Followers:")," ",null===(a=e.classification.followers)||void 0===a?void 0:a.count),l.createElement(Bc,{name:"parentIds"},(function(){var t,n,r;return l.createElement("div",{className:b("parentIds")},l.createElement(Ul,{label:"Parent Classification(s)",tree:e.classificationTree,selectedIds:s.values.parentIds,onSelect:y,collapse:m,noSelectionMessage:"No parent selected, this will be a root classification.",isNodeDisabled:(n=e.classificationTree,r=null===(t=e.classification)||void 0===t?void 0:t.id,function(e){if(e.id===r)return!0;var t=Cl.find(n,r);return!!Cl.find(t,e.id)})}))})),l.createElement(Bc,{name:"backboneClassificationIds"},(function(){return l.createElement("div",{className:b("backboneClassificationIds")},l.createElement(Ul,{label:"Mapped Subject(s)",tree:e.subjectTree,selectedIds:s.values.backboneClassificationIds,onSelect:v,collapse:!f,getSelectedItemAppLink:Ev}))})),l.createElement(Qu,{imageType:hu.Covers,fieldName:"cover",application:c.SUBJECTS,uploadAction:i.Subjects.UPLOAD_IMAGE}),l.createElement(Qu,{imageType:hu.Banners,fieldName:"banner",application:c.SUBJECTS,uploadAction:i.Subjects.UPLOAD_IMAGE}),l.createElement(Qu,{imageType:hu.TallPosters,fieldName:"tallPoster",application:c.SUBJECTS,uploadAction:i.Subjects.UPLOAD_IMAGE}),l.createElement("div",{className:"d-flex justify-content-between"},l.createElement(cf,{showSpinner:s.isSubmitting,type:"submit",disabled:!u},f?"Create":"Save"),!f&&l.createElement(ki.Button,{as:lu,variant:"danger",appLink:{application:c.SUBJECTS,action:i.Subjects.DELETE_CLASSIFICATION,args:[e.presentationId,null===(o=e.classification)||void 0===o?void 0:o.id]}},"Delete")))}function Cv(e){return l.createElement(wi,{initialValues:e.classification,validationSchema:Dh,onSubmit:e.saveClassification},l.createElement(Ov,{presentationId:e.presentationId,classificationTree:e.classificationTree,subjectTree:e.subjectTree,classification:e.classification}))}var Av=function(e){return function(t){if(!e)return t.appLink.action===i.Subjects.EDIT_CLASSIFICATION;switch(e){case jh.Playlists:return t.appLink.action===i.Subjects.EDIT_CLASSIFICATION_PLAYLISTS;case jh.Series:return t.appLink.action===i.Subjects.EDIT_CLASSIFICATION_SERIES;case jh.Videos:return t.appLink.action===i.Subjects.EDIT_CLASSIFICATION_VIDEOS}}};function wv(e){var t=e.presentation,n=e.classificationId,r=e.memberType;return t?l.createElement(l.Fragment,null,l.createElement("h6",null,"Presentation: ".concat(!!t&&t.name)),l.createElement("div",{className:"py-2"},l.createElement(wl,{tabs:Hh(t.id,n),isItemActive:Av(r)}))):l.createElement(l.Fragment,null)}function jv(e){var t=ci(),n=qc(t),r=function(e){return t.setFieldValue("classificationIds",hp.a.addOrRemove(t.values.classificationIds.map((function(e){return e.toString()})),e.id.toString()))},a="".concat(Ti(t.errors,t.touched,"classificationIds")," h-auto py-2");return l.createElement(vi,null,l.createElement(Bc,{name:"classificationIds"},(function(){return l.createElement("div",{className:a},l.createElement(Ul,{label:"Mapped Classification(s)",tree:e.classificationTree,selectedIds:t.values.classificationIds,onSelect:r,getSelectedItemAppLink:(n=e.presentationId,function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[n,e]}}),isNodeDisabled:e.isClassificationDisabled}));var n})),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(cf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Save Classifications")))}function Iv(e){return l.createElement(wi,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.classificationIds;return e.saveClassifications(r,n)},enableReinitialize:!0},l.createElement(jv,{presentationId:e.presentationId,classificationTree:e.classificationTree,isClassificationDisabled:e.isClassificationDisabled}))}function kv(e){var t=null===e.id||void 0===e.id,n=ci(),r=qc(n);return l.createElement(vi,null,l.createElement(Bc,{label:"Name",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this level",autoFocus:!0}),l.createElement(cf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"))}function Tv(e){return l.createElement(wi,{initialValues:e.level,validationSchema:Mh,onSubmit:e.saveLevel},l.createElement(kv,{id:e.level&&e.level.id}))}function Lv(e){var t=Vh.singularizeMemberType(e.memberType),n=ci(),r=qc(n);return l.createElement(vi,null,l.createElement(Bc,{label:"Backbone Audience(s)",as:"select",name:"backboneAudienceIds",id:"level-ids",multiple:!0,size:e.levels.length,value:n.values.backboneAudienceIds},e.levels.map((function(e){return l.createElement("option",{key:e.id,value:e.id},e.name)}))),l.createElement("p",null,l.createElement("strong",null,"Note:")," When removing a ".concat(t," from a backbone audience, that backbone audience's mapped audiences "),l.createElement("strong",null,"will not")," be automatically removed from."),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(cf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},"Save Backbone Audience")))}function _v(e){return l.createElement(wi,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.backboneAudienceIds;return e.saveLevels(r,!1,n)}},l.createElement(Lv,{levels:e.levels,memberType:e.memberType}))}var Pv=function(e){return function(t){return t.appLink.action===e}};function xv(e){var t=e.levelId,n=e.activeAction,r=e.presentationId;return l.createElement(l.Fragment,null,l.createElement(ki.Alert,{variant:"danger"},"Warning: You are editing the backbone audiences."),l.createElement("div",{className:"py-2"},l.createElement(wl,{tabs:qh(t,r),isItemActive:Pv(n)})))}var Nv=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Rv(e){return l.createElement(l.Fragment,null,e.audiences.map((function(t){return l.createElement("th",{key:t.masterId},l.createElement("span",{className:"d-inline-block"},l.createElement(gu,{selected:e.getIsAudienceSelected(t),onToggle:function(n){return e.onToggleAudience(t.masterId,n)}})),l.createElement(lu,{appLink:e.getAudienceAppLink(t.masterId)},function(e,t){return t?e.name:"Audience: ".concat(e.name)}(t,e.showAudienceSubHeader)))})))}function Dv(e){var t=e.memberType,n=e.hasActions,r=e.audiences,i=Nv(e,["memberType","hasActions","audiences"]),a="".concat(Sl($h.singularizeMemberType(t))," Name"),o=!!r&&!!r.length,c=o&&r.length>1,s=o?2:1,u=Object.assign({audiences:r,showAudienceSubHeader:c},i);return l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{rowSpan:s},a),o&&(c?l.createElement("th",{colSpan:r.length,className:"text-center"},"Audiences"):l.createElement(Rv,Object.assign({},u))),n&&l.createElement("th",{rowSpan:s})),o&&c&&l.createElement("tr",null,l.createElement(Rv,Object.assign({},u))))}function Mv(e){var t=e.member,n=t.id,r=t.name,i=t.audiences,a=void 0===i?[]:i,o=e.getMemberAppLink,c=e.onToggleAudience,s=e.actions,u=m(o)&&o(n);return a.length&&!m(c)&&p.ErrorHelper.throw(new Zc.a("onToggleAudience must be passed to LevelMemberItem")),l.createElement("tr",null,l.createElement("td",null,u?l.createElement(lu,{appLink:o(n)},r):r),!!a.length&&a.map((function(e){return l.createElement("td",{key:e.id},l.createElement(gu,{selected:e.selected,onToggle:function(t){return c(e.id,t,n)}}))})),s&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(fl,{actions:s}))))}var Uv=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Fv(e,t){return function(n){var r=n[e],i=Bl(r);return!!i&&i===t.length}}function Vv(e){var t=e.members,n=e.memberType,r=e.getActions,i=e.audiences,a=e.getAudienceAppLink,o=e.onToggleAudience,c=Uv(e,["members","memberType","getActions","audiences","getAudienceAppLink","onToggleAudience"]);if(!t.length)return l.createElement("div",{className:"py-5"},"No ".concat(n," in this level."));var s=m(r),u={memberType:n,audiences:i,getAudienceAppLink:a,getIsAudienceSelected:Fv(n,t),onToggleAudience:o,hasActions:s};return l.createElement(ki.Table,{responsive:!0,bordered:!0},l.createElement(Dv,Object.assign({},u)),l.createElement("tbody",null,t.map((function(e,t){return l.createElement(Mv,Object.assign({key:t,member:e,actions:s&&r(e.id),onToggleAudience:o},c))}))))}function Bv(e){var t=ci();return l.createElement(vi,null,l.createElement(Bc,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this presentation",autoFocus:!0}),l.createElement(Bc,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this presentation here"}),l.createElement(Bc,{as:"select",label:"Status",name:"status",id:"status",value:t.values.status,disabled:e.isNew},Ci.a.getEnumKeys(wp).map((function(e){return l.createElement("option",{key:e,value:wp[e]},e)}))),l.createElement("div",{className:"btn-container d-flex justify-content-end"},l.createElement(us,{isNew:e.isNew})))}function zv(e){var t;return l.createElement(wi,{initialValues:e.presentation,validationSchema:Uh,onSubmit:e.savePresentation},l.createElement(Bv,{isNew:!(null===(t=e.presentation)||void 0===t?void 0:t.id)}))}function Hv(e){var t=e.presentations,n=e.currentPresentationId,r=e.setCurrentPresentation,i=e.label,a=function(e){var n=function(e,t){return hp.a.first(t.filter((function(t){return t.id.toString()===e.toString()})))}(e,t);r(n)};return l.useEffect((function(){t&&!n&&r(hp.a.first(t))}),[t]),l.createElement(l.Fragment,null,!!n&&l.createElement(l.Fragment,null,l.createElement(ki.Form.Label,null,i),l.createElement(ki.Form.Control,{as:"select",value:n,onChange:function(e){return a(e.target.value)},className:"cursor-pointer"},t.map((function(e){return l.createElement("option",{value:e.id,key:e.id},e.name)})))))}function qv(e){return l.createElement(l.Fragment,null,l.createElement("h4",null,"".concat(Sl(e.memberType))),l.createElement(ki.Table,{responsive:!0},l.createElement("tbody",null,e.objects&&e.objects.map((function(t){return l.createElement("tr",{key:t.id},l.createElement("td",null,l.createElement(lu,{appLink:Vh.getMemberAppLink(e.memberType,t.id)},t.name)))})))),l.createElement(nb,{initialValues:{backboneClassificationIds:[]},subjectTree:e.subjectTree,saveSubjects:e.onClickAddToSubject,memberType:e.memberType,saveBtnText:"Add to backbone classification",subjectRequired:!0}))}function Jv(e){return function(e){if(Array.isArray(e))return $v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return $v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $v(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Kv(e){var t=Vh.singularizeMemberType(e.memberType),n=[].concat(Jv(e.objectClassifications),Jv(e.objectSubjectClassifications)).map((function(e){return e.id}));return l.createElement(l.Fragment,null,l.createElement("div",{className:"border-bottom pb-3 mb-3"},l.createElement("h6",null,"Backbone Classifications"),l.createElement("p",null,"Select which backbone classifications this ".concat(t," is mapped to.")),l.createElement(nb,{initialValues:{backboneClassificationIds:e.objectSubjects.map((function(e){return e.id}))},subjectTree:e.subjectTree,saveSubjects:e.saveSubjects,memberType:e.memberType,saveBtnText:"Save Backbone Classifications",allowMultiple:!0})),l.createElement("h6",null,"Classifications"),l.createElement("p",null,"Select a presentation to view its classifications and map them to this ".concat(t,".")),l.createElement("div",{className:"w-50 pb-3"},l.createElement(Hv,{presentations:e.presentations,currentPresentationId:e.currentPresentation.id,setCurrentPresentation:e.setCurrentPresentation})),e.currentPresentation&&e.classificationTree&&e.classificationTree.children.length?l.createElement(l.Fragment,null,l.createElement("p",null,"Only classifications which are mapped to one of the backbone classifications selected above can be selected."),l.createElement(Iv,{initialValues:{classificationIds:e.objectClassifications.map((function(e){return e.id}))},presentationId:e.currentPresentation.id,classificationTree:e.classificationTree,saveClassifications:e.saveClassifications,isClassificationDisabled:function(e){return!n.includes(e.id)}})):l.createElement("p",null,"This presentation has no classifications."))}function Yv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Gv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Hv.defaultProps={label:"Presentation"};function Wv(e){var t=!e.id,n=ci(),r=qc(n),a=!t||!!n.values.parentId,o=Yv(l.useState(a),2),s=o[0],u=o[1];l.useEffect((function(){return u(a)}),[e.id,n.values.parentId]);var f=function(e){var t=e.id===n.values.parentId?null:e.id;n.setFieldValue("parentId",t)},p="".concat(Ti(n.errors,n.touched,"parentId")," h-auto py-2");return l.createElement(vi,null,l.createElement(Bc,{label:"Name",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this backbone classification",autoFocus:!0}),l.createElement(Bc,{name:"parentId"},(function(){return l.createElement("div",{className:p},l.createElement(Ul,{label:"Parent Backbone Classification",tree:e.subjectTree,selectedIds:[n.values.parentId],onSelect:f,collapse:s,noSelectionMessage:"No parent selected, this will be a root backbone classification.",isNodeDisabled:(t=e.subjectTree,r=e.id,function(e){if(e.id===r)return!0;var n=Cl.find(t,r);return!!Cl.find(n,e.id)})}));var t,r})),l.createElement("div",{className:"d-flex justify-content-between"},l.createElement(cf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&l.createElement(ki.Button,{as:lu,variant:"danger",appLink:{application:c.SUBJECTS,action:i.Subjects.DELETE_SUBJECT,args:[e.id]}},"Delete")))}function Zv(e){return l.createElement(wi,{initialValues:e.subject,validationSchema:Fh,onSubmit:e.saveSubject},l.createElement(Wv,{id:e.subject&&e.subject.id,subjectTree:e.subjectTree}))}var Qv=function(e){return function(t){return t.appLink.action===e}};function Xv(e){var t=e.subjectId,n=e.activeAction,r=e.presentationId;return l.createElement(l.Fragment,null,l.createElement(ki.Alert,{variant:"danger"},"Warning: You are editing the backbone classifications."),l.createElement("div",{className:"py-2"},l.createElement(wl,{tabs:zh(t,r),isItemActive:Qv(n)})))}var eb=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[e]}};function tb(e){var t=ci(),n=qc(t),r=function(n){var r=e.allowMultiple?hp.a.addOrRemove(t.values.backboneClassificationIds.map((function(e){return e.toString()})),n.id.toString()):[n.id];t.setFieldValue("backboneClassificationIds",r)},i="".concat(Ti(t.errors,t.touched,"backboneClassificationIds")," h-auto py-2");return l.createElement(vi,null,l.createElement(Bc,{name:"backboneClassificationIds"},(function(){return l.createElement("div",{className:i},l.createElement(Ul,{label:"Mapped Backbone Classification".concat(e.allowMultiple?"(s)":""),tree:e.subjectTree,selectedIds:t.values.backboneClassificationIds,onSelect:r,collapse:!!t.initialValues.backboneClassificationIds.length,getSelectedItemAppLink:eb}))})),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(cf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.saveBtnText)))}function nb(e){var t;return l.createElement(wi,{initialValues:e.initialValues,validationSchema:(t=e.subjectRequired,ji.object().shape({backboneClassificationIds:t?ji.array().of(ji.string()).min(1,"A subject is required").required("A subject is required"):ji.array().of(ji.string())}).noUnknown()),onSubmit:function(t,n){var r=t.backboneClassificationIds;return e.saveSubjects(r,!1,n)}},l.createElement(tb,{subjectTree:e.subjectTree,memberType:e.memberType,allowMultiple:e.allowMultiple,saveBtnText:e.saveBtnText}))}tb.defaultProps={saveBtnText:"Save"};var rb=function(e){return l.createElement("div",{className:"border rounded p-2 mb-3"},l.createElement("h6",{className:"border-bottom pb-1"},e.presentation.name),e.classifications&&e.classifications.length?l.createElement("ul",{className:"list-unstyled mb-0"},e.classifications.map((function(t){return l.createElement("li",{key:t.id,className:"py-1"},l.createElement(lu,{appLink:(n=e.presentation.id,r=t.id,{application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[n,r]})},t.name));var n,r}))):l.createElement("p",null,l.createElement("em",null,"There are no classifications mapped to this backbone classification in this presentation.")))},ib=function(e){return l.createElement(l.Fragment,null,!!e.presentations&&!!e.classificationDictionary&&e.presentations.map((function(t){return l.createElement(rb,{key:t.id,presentation:t,classifications:e.classificationDictionary[t.id]})})))},ab=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function ob(e){return l.createElement(l.Fragment,null,e.classifications.map((function(t){return l.createElement("th",{key:t.id},l.createElement("span",{className:"d-inline-block"},l.createElement(gu,{selected:e.getIsClassificationSelected(t),onToggle:function(n){return e.onToggleClassification(t.id,n)}})),l.createElement(lu,{appLink:e.getClassificationAppLink(t.id)},function(e,t){return t?e.name:"Classification: ".concat(e.name)}(t,e.showClassificationSubHeader)))})))}function cb(e){var t=e.memberType,n=e.hasActions,r=e.classifications,i=ab(e,["memberType","hasActions","classifications"]),a="".concat(Sl(Vh.singularizeMemberType(t))," Name"),o=!!r&&!!r.length,c=o&&r.length>1,s=o?2:1,u=Object.assign({classifications:r,showClassificationSubHeader:c},i);return l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{rowSpan:s},a),o&&(c?l.createElement("th",{colSpan:r.length,className:"text-center"},"Classifications"):l.createElement(ob,Object.assign({},u))),n&&l.createElement("th",{rowSpan:s})),o&&c&&l.createElement("tr",null,l.createElement(ob,Object.assign({},u))))}function sb(e){var t=e.member,n=t.id,r=t.name,i=t.classifications,a=void 0===i?[]:i,o=e.getMemberAppLink,c=e.onToggleClassification,s=e.actions,u=m(o)&&o(n);return a.length&&!m(c)&&p.ErrorHelper.throw(new Zc.a("onToggleClassification must be passed to SubjectMemberItem")),l.createElement("tr",null,l.createElement("td",null,u?l.createElement(lu,{appLink:o(n)},r):r),!!a.length&&a.map((function(e){return l.createElement("td",{key:e.id},l.createElement(gu,{selected:e.selected,onToggle:function(t){return c(e.id,t,n)}}))})),s&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(fl,{actions:s}))))}var ub=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function lb(e,t){return function(n){var r=n[e],i=Bl(r);return!!i&&i===t.length}}function fb(e){var t=e.members,n=e.memberType,r=e.getActions,i=e.classifications,a=e.getClassificationAppLink,o=e.onToggleClassification,c=ub(e,["members","memberType","getActions","classifications","getClassificationAppLink","onToggleClassification"]);if(!t.length)return l.createElement("div",{className:"py-5"},"No ".concat(n," in this backbone classification."));var s=m(r),u={memberType:n,classifications:i,getClassificationAppLink:a,getIsClassificationSelected:lb(n,t),onToggleClassification:o,hasActions:s};return l.createElement(ki.Table,{responsive:!0,bordered:!0},l.createElement(cb,Object.assign({},u)),l.createElement("tbody",null,t.map((function(e,t){return l.createElement(sb,Object.assign({key:t,member:e,actions:s&&r(e.id),onToggleClassification:o},c))}))))}function pb(e){var t=e.navItems,n=e.currentAppLink;return l.createElement(ki.Container,null,l.createElement(ki.Navbar,{className:"justify-content-between align-items-center"},l.createElement(ki.Nav,null,!!t&&t.map((function(e,t){return l.createElement(ki.Nav.Item,{key:t},l.createElement(lu,{appLink:e.appLink,className:"nav-link".concat(vl.isItemActive(e,n)?" text-primary":"")},e.label))})))))}function db(e,t){l.useEffect((function(){e.presentations&&!e.currentPresentation&&hh(t,"currentPresentation")(hp.a.first(e.presentations))}),[e.presentations])}function mb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return hb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function hb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yb(e){var t=oe.useBasicFetch(Vm(e.playlistId)),n=oe.useBasicFetch(mp()),r=mb(l.useState({}),2),a=r[0],o=r[1],c=zf(u.SUBJECT);!function(e,t,n){var r=function(e){return hh(n,e)};uh([Zy.getObjectLevelsFetchOptions(e,jh.Playlists,r("playlistLevels"))],[e]),mh(Zy.getObjectAudiencesFetchOptions(e,jh.Playlists,r("playlistAudiences")),[e,t.playlistLevels]),uh([Zy.getPresentationsFetchOptions(r("presentations")),Zy.getLevelsFetchOptions(r("levels"))],[]),mh(!!t.currentPresentation&&Zy.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.playlistId,a,o),db(a,o);var s=!!(a.presentations&&a.levels&&a.presentationAudiences&&a.playlistLevels&&a.playlistAudiences);return l.createElement(l.Fragment,null,!!n.data&&l.createElement(th,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST_AUDIENCES,currentUser:n.data}),l.createElement(pl,{object:t.data}),!!s&&l.createElement(ov,{objectLevels:a.playlistLevels,objectAudiences:a.playlistAudiences,presentations:a.presentations,currentPresentation:a.currentPresentation,setCurrentPresentation:hh(o,"currentPresentation"),levels:a.levels,presentationAudiences:a.presentationAudiences,memberType:jh.Playlists,saveLevels:function(t,n,r){return c.updateObjectLevels(e.playlistId,t,jh.Playlists,n,r,r)},saveAudiences:function(t,n){return c.updateObjectAudiences(e.playlistId,a.currentPresentation.id,t,jh.Playlists,n,n)}}))}function vb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||gb(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bb(e){return function(e){if(Array.isArray(e))return Sb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||gb(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gb(e,t){if(e){if("string"==typeof e)return Sb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sb(e,t):void 0}}function Sb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Eb(e){var t=oe.useBasicFetch(Vm(e.playlistId)),n=oe.useBasicFetch(mp()),r=vb(l.useState({}),2),a=r[0],o=r[1],c=zf(u.SUBJECT);!function(e,t,n){var r=function(e){return hh(n,e)};uh([Zy.getSubjectTreeFetchOptions(r("subjectTree")),Zy.getPresentationsFetchOptions(r("presentations"))],[]),uh([Zy.getObjectSubjectsFetchOptions(e,jh.Playlists,r("playlistSubjects"))],[e]),mh(!!t.currentPresentation&&Zy.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),l.useEffect((function(){return r("subjectClassifications")([])}),[t.playlistSubjects]);var i=function(e,t){return[].concat(bb(t.subjectClassifications||[]),bb(e))},a=t.playlistSubjects&&t.playlistSubjects.map((function(e){return Zy.getSubjectClassificationFetchOptions(e.id,hh(n,"subjectClassifications",i))}));uh(a,[t.playlistSubjects],!!a),mh(Zy.getObjectClassificationsFetchOptions(e,jh.Playlists,r("playlistClassifications")),[e,t.playlistSubjects])}(e.playlistId,a,o),db(a,o);var s=!!(a.playlistSubjects&&a.subjectTree&&a.presentations&&a.classificationTree&&a.playlistClassifications&&a.subjectClassifications);return l.createElement(l.Fragment,null,!!n.data&&l.createElement(th,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST_SUBJECTS,currentUser:n.data}),l.createElement(pl,{object:t.data}),s&&l.createElement(Kv,{objectSubjects:a.playlistSubjects,subjectTree:a.subjectTree,memberType:jh.Playlists,presentations:a.presentations,currentPresentation:a.currentPresentation,setCurrentPresentation:hh(o,"currentPresentation"),objectClassifications:a.playlistClassifications,objectSubjectClassifications:a.subjectClassifications,classificationTree:a.classificationTree,saveSubjects:function(t,n,r){return c.updateObjectSubjects(e.playlistId,t,jh.Playlists,n,r,r)},saveClassifications:function(t,n){return c.updateObjectClassifications(e.playlistId,a.currentPresentation.id,t,jh.Playlists,n,n)}}))}var Ob=function(e,t,n){if(t===n)return{reorderedItems:e,reorderRequest:null};var r=hp.a.moveItem(e,t,n),i=n<e.length-1?r[n+1].id:null;return{reorderedItems:r,reorderRequest:{sourceMemberId:r[n].id,destinationMemberId:i}}};function Cb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ab(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ab(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ab(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return jb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ib=function(e){return{application:c.VIDEOS,action:i.Videos.EDIT_VIDEO,args:[e.id]}};function kb(e){var t,n,r,a,o,s,u=Object(v.useDispatch)(),f=ep(),p=oe.useBasicFetch(Vm(e.playlistId)),d=oe.useBasicFetch(Jm(e.playlistId)),m=oe.useBasicFetch(mp()),h=wb((n=null===(t=d.data)||void 0===t?void 0:t.data,r=Cb(Object(l.useState)(),2),a=r[0],o=r[1],Object(l.useEffect)((function(){a&&(n.length!==a.length||function(e,t){var n=!0;if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r].id!==t[r].id){n=!1;break}return n}(n,a))&&o(null)}),[n]),[a,o]),2),y=h[0],b=h[1],g=y?{data:y,pagination:null}:d.data;return l.createElement(l.Fragment,null,!!m.data&&l.createElement(th,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST_VIDEOS,currentUser:m.data}),l.createElement(pl,{object:p.data}),!!g&&l.createElement(ef,{onSortEnd:function(t,n){if(t!==n){var r=Ob(d.data.data,t,n),i=r.reorderRequest,a=r.reorderedItems;b(a);oe.fetch(u,$m(e.playlistId,i,null,(function(){f.error("Failed to update playlist order."),b(null)})))}},videos:g,getVideoAppLink:Ib,getVideoActions:(s=e.playlistId,function(e){return[{label:"Remove video",appLink:{application:c.PLAYLISTS,action:i.Playlists.REMOVE_VIDEO,args:[s.toString(),e.id.toString()]},className:"text-danger"}]}),emptyMessage:"There are no videos in this playlist."}))}function Tb(){var e=Object(v.useDispatch)(),t=ep(),n=oe.useBasicFetch(mp());return l.createElement(l.Fragment,null,!!n.data&&l.createElement(eh,{savePlaylist:function(r,a){oe.fetch(e,zm(r,n.data.id,(function(e){t.success("Successfully created playlist."),function(e){e&&e.id&&p.AppLinkHelper.trigger({application:c.PLAYLISTS,action:i.Playlists.EDIT_PLAYLIST,args:[e.id]})}(e)}),(function(){t.error("Failed to create playlist.")}),a))}}))}var Lb="rating,thumbnail,glance,herobanner,tags",_b=function(e){return{url:"/api/master/v2/objects/".concat(e,"?query=").concat(Lb),key:"videos:".concat(e)}},Pb=function(e){var t=e.slice().sort();return{key:"videos:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},xb=function(e){return{url:"/ajax/hostedlibraries/rightsline/programs/".concat(e),key:"rightsline:videos:".concat(e),normalizeOptions:{namespace:"rightsline"}}},Nb=function(e,t,n,r,i){return{key:"videos:".concat(e),url:"/api/master/v2/objects/".concat(e),data:t,type:ce.a.PUT,success:n,error:r,always:i}};function Rb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Db(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Db(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Db(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Mb(e){var t=Object(v.useDispatch)(),n=ep(),r=oe.useBasicFetch(Vm(e.playlistId)),i=oe.useBasicFetch(_b(e.videoId)),a=Rb(l.useState(!1),2),o=a[0],c=a[1];var s=!!r.data&&!!i.data;return l.createElement(np,{title:"Remove Video",closePopup:e.closePopup,showLoadingSpinner:!s},!!s&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,i.data.name)," from ",l.createElement("strong",null,r.data.name),"?")),l.createElement(ip,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){c(!0),oe.fetch(t,Km(e.playlistId,e.videoId,(function(){n.success("Successfully removed video from playlist")}),(function(){n.error("Failed to remove video from playlist")}),e.closePopup))},buttonText:"Yes, remove video",isSpinnerButton:!0,showSpinner:o}]})))}function Ub(e){return p.AppLinkHelper.trigger(function(e){return{application:c.PLAYLISTS,action:i.Playlists.EDIT_PLAYLIST,args:[e.id]}}(e))}function Fb(e){var t=e?{application:c.PLAYLISTS,action:i.Playlists.SEARCH_PLAYLISTS,params:{query:e}}:{application:c.PLAYLISTS,action:i.Playlists.PLAYLISTS};p.AppLinkHelper.trigger(t)}function Vb(e){return l.createElement("div",{className:"pb-3 w-50"},l.createElement(zs,{initialQuery:e.query,placeholder:"Search for a playlist",onSuggestionSelected:Ub,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/playlists/instant/raw","?query=").concat(e)},activationLength:2,onSubmit:Fb}))}var Bb=c.PLAYLISTS,zb=function(e){return{application:Bb,action:i.Playlists.EDIT_PLAYLIST,args:[e.id]}};function Hb(e){var t=oe.useBasicFetch(Um(e.cursor));return l.createElement(l.Fragment,null,l.createElement(Vb,null),l.createElement(tl,{collection:t&&t.data,collectionAppLink:{application:Bb,action:i.Playlists.PLAYLISTS},newObjectAppLink:{application:Bb,action:i.Playlists.NEW_PLAYLIST},getObjectAppLink:zb,objectName:"Playlist"}))}var qb=c.PLAYLISTS,Jb=function(e){return{application:qb,action:i.Playlists.EDIT_PLAYLIST,args:[e.id]}};function $b(e){var t=oe.useBasicFetch(Fm(e.query,e.cursor));return l.createElement(l.Fragment,null,l.createElement(Vb,{query:e.query}),!!t.data&&(t.data.data.length?l.createElement(tl,{collection:t.data,collectionAppLink:{application:qb,action:i.Playlists.SEARCH_PLAYLISTS,params:{query:e.query}},newObjectAppLink:{application:qb,action:i.Playlists.NEW_PLAYLIST},getObjectAppLink:Jb,objectName:"Playlist"}):l.createElement("p",null,"No playlists found, please try a different search query.")))}function Kb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Gb=function(e,t,n){return[{variant:"link",onClick:t,buttonText:"Cancel"},{variant:"danger",onClick:e,buttonText:"Yes, delete this audience",isSpinnerButton:!0,showSpinner:n}]};function Wb(e){var t=e.id,n=e.routeToOnDelete,r=e.closePopup,i=Kb(l.useState(),2),a=i[0],o=i[1],c=Kb(l.useState(!1),2),s=c[0],f=c[1],d=zf(u.SUBJECT);mh(Zy.getAudienceFetchOptions(t,o),[t]);return l.createElement(np,{title:"Delete Audience",closePopup:r,showLoadingSpinner:!a},!!a&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,a.name),"?")),l.createElement(ip,{buttons:Gb((function(){f(!0);d.deleteAudience(t,(function(){r(),n&&p.AppLinkHelper.trigger(n)}),r)}),r,s)})))}function Zb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Qb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Xb(e){var t=e.presentationId,n=e.audienceId,r=Zb(l.useState(),2),i=r[0],a=r[1],o=Zb(l.useState(),2),c=o[0],s=o[1],f=Zb(l.useState(),2),p=f[0],d=f[1],m=zf(u.SUBJECT);mh(Zy.getAudienceFetchOptions(n,a),[n]),mh(Zy.getLevelsFetchOptions(s),[]),mh(Zy.getPresentationFetchOptions(t,d),[t]);return l.createElement(l.Fragment,null,l.createElement(lv,{presentation:p,audienceId:n}),!!p&&l.createElement("h6",null,"Presentation: ".concat(p.name)),!!i&&!!c&&l.createElement(iv,{audience:i,levels:c,saveAudience:function(e,r){return m.updateAudience(n,Object.assign(Object.assign({},e),{presentationId:t}),r,r)},presentationId:t}))}function eg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return tg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ng=function(e){return{application:c.SUBJECTS,action:i.Subjects.PRESENTATION_AUDIENCES,args:[e]}};function rg(e){var t=e.presentationId,n=eg(l.useState(),2),r=n[0],a=n[1],o=eg(l.useState(),2),s=o[0],f=o[1],d=zf(u.SUBJECT);mh(Zy.getLevelsFetchOptions(a),[]),mh(Zy.getPresentationFetchOptions(t,f),[t]);return l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-2"},l.createElement(fu,{appLink:ng(t),backToName:"audiences"})),!!s&&l.createElement("h6",null,"Presentation: ".concat(s.name)),!!r&&l.createElement(iv,{levels:r,presentationId:t,saveAudience:function(e,n){return d.createAudience(Object.assign(Object.assign({},e),{presentationId:t}),function(e,t){return function(n){t(),p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[e,n.masterId]})}}(t,n),n)}}))}var ig=n(214),ag=n.n(ig);function og(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return cg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sg(e){var t=e.presentationId,n=e.selectedAudienceId,r=og(l.useState(),2),a=r[0],o=r[1];mh(Zy.getAudiencesFetchOptions(t,o),[]);var s=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[t,e.masterId]}},u={application:c.SUBJECTS,action:i.Subjects.NEW_AUDIENCE,args:[t]};return l.createElement("div",{className:"".concat(ag.a.navContainer," h-auto pr-2 border-right")},l.createElement("h5",{className:"border-bottom pb-2"},"Audiences"),l.createElement(lu,{appLink:u,className:"d-inline-block pb-2"},l.createElement(Mc,{svgName:Dc.Plus,size:Nc.Small}),l.createElement("span",null,"New Audience")),l.createElement("div",{className:"border-top pt-1"},l.createElement("ul",{className:"list-unstyled"},a&&a.map((function(e){return l.createElement("li",{className:"position-relative py-1"},l.createElement(lu,{className:(null==n?void 0:n.toString())===e.masterId.toString()?"text-primary font-weight-500":"",appLink:s(e)},e.name))})))))}function ug(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return lg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fg(e){var t=e.presentationId,n=e.audienceId,r=e.memberType,i=ug(l.useState(),2),a=i[0],o=i[1],c=ug(l.useState(),2)[1],s=ug(l.useState(),2),u=s[0],f=s[1];mh(Zy.getPresentationFetchOptions(t,o),[]),mh(Zy.getAudienceFetchOptions(n,c),[n]),mh(Zy.getAudienceMembersFetchOptions(n,r,f),[n,r]);var p={items:u&&u.data,memberType:r,getItemAppLink:function(e){return $h.getMemberAppLink(r,e.id)},getActions:function(e){return $h.getMemberActions(n,wh.Audience,r,e.id)}},d={presentation:a,audienceId:n},m=bl(p);return l.createElement(l.Fragment,null,l.createElement(lv,Object.assign({},d,{memberType:r})),m&&l.createElement(pv,Object.assign({},p)))}function pg(e){return{application:c.SUBJECTS,action:i.Subjects.NEW_CLASSIFICATION,args:[e]}}function dg(e){return[{label:"Add child",getAppLink:function(t){return Object.assign(Object.assign({},pg(e)),{args:[e],params:{parentId:t.id}})}},{label:"Delete classification",getAppLink:function(t){return{application:c.SUBJECTS,action:i.Subjects.DELETE_CLASSIFICATION,args:[e,t.id]}},className:"text-danger"}]}var mg=n(215),hg=n.n(mg);function yg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bg(e){var t=e.presentationId,n=e.selectedClassificationId,r=yg(l.useState(),2),a=r[0],o=r[1],s=yg(l.useState(),2),u=s[0],f=s[1];return function(e,t,n){uh([Zy.getClassificationTreeFetchOptions(e,t),Zy.getPresentationFetchOptions(e,n)],[e])}(t,o,f),l.createElement("div",{className:"".concat(hg.a.navContainer," h-auto pr-2 border-right")},!!u&&l.createElement("h6",{className:"border-bottom pb-2"},"Classifications (".concat(u.name,")")),l.createElement(lu,{appLink:pg(t),className:"d-inline-block pb-2"},l.createElement(Mc,{svgName:Dc.Plus,size:Nc.Small}),l.createElement("span",null,"New Classification")),!!a&&l.createElement("div",{className:"border-top pt-1"},l.createElement(xl,{tree:a,getAppLink:function(e){return function(e,t){return{application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[e,t.id]}}(t,e)},selectedIds:[n],actions:dg(t)})))}function gg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Sg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Eg(e){var t=e.classificationId,n=e.routeToOnDelete,r=e.closePopup,i=gg(l.useState(),2),a=i[0],o=i[1],c=gg(l.useState(!1),2),s=c[0],f=c[1];mh(Zy.getClassificationFetchOptions(t,o),[]);var d=zf(u.SUBJECT),m=[{variant:"link",onClick:r,buttonText:"Cancel"},{variant:"danger",onClick:function(){f(!0);d.deleteClassification(t,(function(){r(),n&&p.AppLinkHelper.trigger(n)}),r)},buttonText:"Yes, delete this classification",isSpinnerButton:!0,showSpinner:s}];return l.createElement(np,{title:"Delete Classification",closePopup:r,showLoadingSpinner:!a},!!a&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,a.name),"?")),l.createElement(ip,{buttons:m})))}function Og(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Cg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ag(e){var t=e.presentationId,n=e.classificationId,r=Og(l.useState(),2),i=r[0],a=r[1],o=Og(l.useState(),2),c=o[0],s=o[1],f=Og(l.useState(),2),p=f[0],d=f[1],m=Og(l.useState(),2),h=m[0],y=m[1],v=zf(u.SUBJECT),b=Zy.getClassificationFetchOptions(n,a),g=Zy.getPresentationFetchOptions(t,s),S=Zy.getClassificationTreeFetchOptions(t,d);mh(Zy.getSubjectTreeFetchOptions(y),[]),mh(b,[n]),uh([g,S],[t]);return l.createElement("div",null,l.createElement(wv,{presentation:c,classificationId:n}),!!i&&!!p&&!!h&&l.createElement(Cv,{classification:i,presentationId:t,subjectTree:h,classificationTree:p,saveClassification:function(e,t){var r=Object.assign({pinnedVideoMasterId:(null==i?void 0:i.pinnedVideoMasterId)||null},e);return v.updateClassification(n,r,t,t)}}))}function wg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return jg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ig(e){var t=e.presentationId,n=e.classificationId,r=e.memberType,i=wg(l.useState(),2),a=i[0],o=i[1],c=wg(l.useState(),2),s=c[0],f=c[1],p=wg(l.useState(),2),d=p[0],m=p[1];mh(Zy.getPresentationFetchOptions(t,o),[]),mh(Zy.getClassificationFetchOptions(n,f),[n]),mh(Zy.getClassificationMembersFetchOptions(n,r,m),[n,r]);var h=zf(u.SUBJECT),y={items:d&&d.data,memberType:r,classification:s,updatePinnedVideo:function(e,t){var r=Object.assign(Object.assign({},s),{pinnedVideoMasterId:e});h.updateClassification(n,r,t)},getItemAppLink:function(e){return Vh.getMemberAppLink(r,e.id)},getActions:function(e){return Vh.getMemberActions(n,wh.Classification,r,e.id)}},v={presentation:a,classificationId:n},b=bl(y);return l.createElement(l.Fragment,null,l.createElement(wv,Object.assign({},v,{memberType:r})),b&&l.createElement(bv,Object.assign({},y)))}function kg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Tg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Tg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Lg(e){var t=e.presentationId,n=e.parentId,r=kg(l.useState(),2),a=r[0],o=r[1],s=kg(l.useState(),2),f=s[0],d=s[1],m=zf(u.SUBJECT),h=Zy.getClassificationTreeFetchOptions(t,o);mh(Zy.getSubjectTreeFetchOptions(d),[]),mh(h,[t]);return l.createElement("div",null,l.createElement("h4",{className:"py-2"},"Create New Classification"),!!f&&!!a&&l.createElement(Cv,{classification:n?{parentIds:[n]}:{},presentationId:t,subjectTree:f,classificationTree:a,saveClassification:function(e,n){return m.createClassification(Object.assign(Object.assign({},e),{presentationId:t}),function(e,t){return function(n){t(),n&&n.id&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[e,n.id]})}}(t,n),n)}}))}var _g=function(e){return{key:"series:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=thumbnail,tallPoster,banner,rating")}},Pg=function(e){var t=e.slice().sort();return{key:"series:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},xg=function(e,t,n,r){return{url:"/api/master/v2/series",key:"series",data:e,type:ce.a.POST,success:t,error:n,always:r}},Ng=function(e,t,n,r,i){return{url:"/api/master/v2/objects/".concat(e),key:"update:series:".concat(e),data:t,type:ce.a.PUT,success:n,error:r,always:i}};function Rg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Dg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Mg(e){var t=Rg(l.useState(),2),n=t[0],r=t[1],i=Rg(l.useState(!1),2),a=i[0],o=i[1],c=oe.useBasicFetch(function(e,t){switch(e){case jh.Playlists:return Vm(t);case jh.Series:return _g(t);case jh.Videos:return _b(t)}}(e.memberType,e.memberId)),s=zf(u.SUBJECT);mh(Zy.getClassificationFetchOptions(e.classificationId,r),[e.classificationId]);var f=!!n&&!!c.data,p="Remove ".concat(Sl(Vh.singularizeMemberType(e.memberType)));return l.createElement(np,{title:p,closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,c.data.name)," from ",l.createElement("strong",null,n.name),"?"),l.createElement("p",null,"This will not remove it from the backbone subject.")),l.createElement(ip,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){o(!0),s.removeObjectsFromClassification(e.classificationId,[e.memberId],e.memberType,null,null,e.closePopup,e.closePopup),n.pinnedVideoMasterId===e.memberId&&s.updateClassification(e.classificationId,Object.assign(Object.assign({},n),{pinnedVideoMasterId:null}))},buttonText:"Yes, remove this ".concat(Vh.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function Ug(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Fg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vg(e){var t=e.id,n=Ug(l.useState(),2),r=n[0],a=n[1],o=zf(u.SUBJECT);mh(Zy.getLevelFetchOptions(t,a),[t]);return l.createElement(l.Fragment,null,l.createElement(xv,{levelId:t,activeAction:i.Subjects.EDIT_LEVEL}),l.createElement("h4",{className:"py-2"},"Edit Level"),!!r&&l.createElement(Tv,{level:r,saveLevel:function(e,n){return o.updateLevel(t,e,n,n)}}))}function Bg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return zg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Hg(){var e=Bg(l.useState(),2),t=e[0],n=e[1];return mh(Zy.getLevelsFetchOptions(n),[]),l.useEffect((function(){t&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[hp.a.first(t).id]},{replace:!0})}),[t]),l.createElement(l.Fragment,null)}function qg(){var e=zf(u.SUBJECT);return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Create New Level"),l.createElement(Tv,{saveLevel:function(t,n){return e.createLevel(t,function(e){return function(t){e(),t&&t.id&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[t.id]})}}(n),n)}}))}var Jg=n(216),$g=n.n(Jg);function Kg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Gg(e){var t=e.selectedLevelId,n=Kg(l.useState(),2),r=n[0],a=n[1];mh(Zy.getLevelsFetchOptions(a),[]);var o=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[e.id]}},s={application:c.SUBJECTS,action:i.Subjects.NEW_LEVEL};return l.createElement("div",{className:"".concat($g.a.navContainer," h-auto pr-2 border-right")},l.createElement("h5",{className:"border-bottom pb-2"},"Backbone Audiences"),l.createElement(lu,{appLink:s,className:"d-inline-block pb-2"},l.createElement(Mc,{svgName:Dc.Plus,size:Nc.Small}),l.createElement("span",null,"New Backbone Audience")),l.createElement("div",{className:"border-top pt-1"},l.createElement("ul",{className:"list-unstyled"},r&&r.map((function(e){return l.createElement("li",{className:"position-relative py-1"},l.createElement(lu,{className:(null==t?void 0:t.toString())===e.id.toString()?"text-primary font-weight-500":"",appLink:o(e)},e.name))})))))}var Wg=function(e){return l.createElement("div",{className:"border rounded p-2 mb-3"},l.createElement("h6",{className:"border-bottom pb-1"},e.presentation.name),e.audiences&&e.audiences.length?l.createElement("ul",{className:"list-unstyled mb-0"},e.audiences.map((function(t){return l.createElement("li",{key:t.masterId,className:"py-1"},l.createElement(lu,{appLink:(n=e.presentation.id,r=t.masterId,{application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[n,r]})},t.name));var n,r}))):l.createElement("p",null,l.createElement("em",null,"There are no audiences mapped to this level in this presentation.")))},Zg=function(e){return l.createElement(l.Fragment,null,!!e.presentations&&!!e.audienceDictionary&&e.presentations.map((function(t){return l.createElement(Wg,{key:t.id,presentation:t,audiences:e.audienceDictionary[t.id]})})))};function Qg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eS(e){var t=e.levelId,n=Qg(l.useState({}),2),r=n[0];return function(e,t){var n=function(e){return hh(t,e)};mh(Zy.getLevelAudiencesFetchOptions(e,n("audiences")),[e]),mh(Zy.getPresentationsFetchOptions(n("presentations")),[])}(t,n[1]),l.createElement(l.Fragment,null,l.createElement(xv,{levelId:t,activeAction:i.Subjects.LEVEL_AUDIENCES}),l.createElement(Zg,{presentations:r.presentations,audienceDictionary:hp.a.groupBy(r.audiences,"presentationId")}))}function tS(e,t){return hh(e,t)}function nS(e){switch(e){case Ih.Playlists:return i.Subjects.EDIT_LEVEL_PLAYLISTS;case Ih.Series:return i.Subjects.EDIT_LEVEL_SERIES;case Ih.Videos:return i.Subjects.EDIT_LEVEL_VIDEOS}}function rS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return iS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function iS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function aS(e){var t=rS(l.useState({}),2),n=t[0],r=t[1],a=n.presentations,o=n.audiences,s=n.memberIds,f=n.membersWithAudiences,d=oe.useBasicFetch(Array.isArray(s)&&s.length?function(e,t){switch(e){case Ih.Playlists:return Bm(t);case Ih.Series:return Pg(t);case Ih.Videos:return Pb(t)}}(e.memberType,s):null),m=zf(u.SUBJECT);function h(t){p.AppLinkHelper.trigger({application:c.SUBJECTS,action:e.action,args:[e.levelId],params:{presentationId:t}})}!function(e,t,n){var r=e.presentationId,i=e.levelId,a=e.memberType;mh(Zy.getPresentationsFetchOptions(tS(n,"presentations")),[]),mh(Zy.getLevelMemberIdsFetchOptions(i,a,tS(n,"memberIds")),[i,a]),mh(!!r&&Zy.getLevelAudiencesFetchOptions(i,tS(n,"audiences"),r,a),[i,a,r],!!r)}(e,0,r),function(e,t,n,r){var i=n.audiences;l.useEffect((function(){tS(r,"membersWithAudiences")(function(e,t,n){if(!t||!n)return;return t.map((function(t){return{id:t.id,name:t.name,audiences:n.map((function(n){return{id:n.masterId,selected:(r=t,i=n,!!i[e]&&!!i[e].data.filter((function(e){return e.id===r.id})).length)};var r,i}))}}))}(t.memberType,e,i))}),[e,i])}(d.data,e,n,r),l.useEffect((function(){!e.presentationId&&(null==a?void 0:a.length)&&h(hp.a.first(a).id)}),[e.presentationId]);var y,v,b=!!e.presentationId&&!!o;return l.createElement(l.Fragment,null,l.createElement(xv,{levelId:e.levelId,presentationId:e.presentationId,activeAction:nS(e.memberType)}),l.createElement(ki.Alert,{variant:"info",className:"m-0"},"Select which ".concat(e.memberType," are shown for each audience in this level.")+" Change the selected presentation to view different audiences."),l.createElement("div",{className:"w-50 py-2"},!!a&&l.createElement(Hv,{presentations:a,currentPresentationId:e.presentationId,setCurrentPresentation:function(e){return h(e.id)}})),b&&l.createElement(Vv,{members:f||[],memberType:e.memberType,getMemberAppLink:function(t){return $h.getMemberAppLink(e.memberType,t)},getActions:function(t){return $h.getMemberActions(e.levelId,wh.Level,e.memberType,t)},audiences:o,getAudienceAppLink:e.presentationId&&(y=e.memberType,v=e.presentationId,function(e){var t,n=c.SUBJECTS,r=[v,e];switch(y){case Ih.Playlists:t=i.Subjects.EDIT_AUDIENCE_PLAYLISTS;break;case Ih.Series:t=i.Subjects.EDIT_AUDIENCE_SERIES;break;case Ih.Videos:t=i.Subjects.EDIT_AUDIENCE_VIDEOS}return{application:n,action:t,args:r}}),onToggleAudience:function(t,n,r){return function(e,t,n,r,i,a,o){(o?e.addObjectsToAudience.bind(e):e.removeObjectsFromAudience.bind(e))(a,n,t,r,i)}(m,e.memberType,r?[r]:s,e.levelId,e.presentationId,t,n)}}))}function oS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return cS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sS(e){var t=oS(l.useState(),2),n=t[0],r=t[1],i=oS(l.useState(!1),2),a=i[0],o=i[1],c=oe.useBasicFetch(function(e,t){switch(e){case Ih.Playlists:return Vm(t);case Ih.Series:return _g(t);case Ih.Videos:return _b(t)}}(e.memberType,e.memberId)),s=zf(u.SUBJECT);mh(Zy.getLevelFetchOptions(e.levelId,r),[e.levelId]);var f=!!n&&!!c.data,p="Remove ".concat(Sl($h.singularizeMemberType(e.memberType)));return l.createElement(np,{title:p,closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,c.data.name)," from ",l.createElement("strong",null,n.name),"?"),l.createElement("p",null,"Please ensure that it is not in any audiences before removing.")),l.createElement(ip,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){o(!0),s.removeObjectsFromLevel(e.levelId,[e.memberId],e.memberType,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat($h.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function uS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return lS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fS(e){var t=e.id,n=uS(l.useState(),2),r=n[0],i=n[1],a=zf(u.SUBJECT);mh(Zy.getPresentationFetchOptions(t,i),[t]);var o={presentation:r,savePresentation:function(e,n){a.updatePresentation(t,e,n,n)}},c=bl(o);return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Edit Presentation"),!!c&&l.createElement(zv,Object.assign({},o)))}function pS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return dS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var mS=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_PRESENTATION,args:[e.id]}},hS={application:c.SUBJECTS,action:i.Subjects.NEW_PRESENTATION};function yS(){var e=pS(l.useState(),2),t=e[0],n=e[1];return mh(Zy.getPresentationsFetchOptions(n),[]),l.createElement("div",null,l.createElement("div",{className:"d-flex justify-content-between mb-2"},l.createElement("h5",{className:"d-inline-block m-0"},"Select a presentation to edit:"),l.createElement(lu,{appLink:hS,className:"d-block"},l.createElement(Mc,{svgName:Dc.Plus,size:Nc.Small}),l.createElement("span",null,"New Presentation"))),l.createElement(hl,{objects:t,getAppLink:mS}))}function vS(){var e=zf(u.SUBJECT);return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Create New Presentation"),l.createElement(zv,{savePresentation:function(t,n){e.createPresentation(t,(function(e){n(),e&&e.id&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_PRESENTATION,args:[e.id]})}),n)}}))}function bS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return gS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function SS(e){var t=e.objectType,n=e.getAppLink,r=bS(l.useState(),2),i=r[0],a=r[1];return mh(Zy.getPresentationsFetchOptions(a),[]),l.createElement("div",null,l.createElement("h5",null,l.createElement(ss,{namespace:"subjects.selectPresentation",phrase:"heading",options:{objectType:t}})),l.createElement(hl,{objects:i,getAppLink:n}))}function ES(e,t){return hh(e,t)}function OS(e,t,n,r,a){var o=r.selectedSubject,s=function(){return ES(a,"showConfirmationPopup")(!1)};t.addObjectsToSubject(o.id,e.map((function(e){return e.id})),n.memberType,r.addToClassifications,(function(){s(),p.AppLinkHelper.trigger(function(e,t){var n={application:c.SUBJECTS,args:[e]};switch(t){case jh.Playlists:return Object.assign(Object.assign({},n),{action:i.Subjects.EDIT_SUBJECT_PLAYLISTS});case jh.Series:return Object.assign(Object.assign({},n),{action:i.Subjects.EDIT_SUBJECT_SERIES});case jh.Videos:return Object.assign(Object.assign({},n),{action:i.Subjects.EDIT_SUBJECT_VIDEOS})}}(o.id,n.memberType))}),s)}function CS(e,t,n){if(t&&n){var r=1===t.length?"this ".concat(Vh.singularizeMemberType(e)):"these ".concat(e);return"Add ".concat(r," to ").concat(n.name)}}function AS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return wS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jS(e,t){return function(n,r,i){i(),ES(t,"selectedSubject")(Cl.find(e.subjectTree,hp.a.first(n))),ES(t,"addToClassifications")(r),ES(t,"showConfirmationPopup")(!0)}}function IS(e){var t=AS(l.useState({}),2),n=t[0],r=t[1],i=oe.useBasicFetch(function(e,t){switch(e){case jh.Playlists:return Bm(t);case jh.Series:return Pg(t);case jh.Videos:return Pb(t)}}(e.memberType,e.objectIds)),a=zf(u.SUBJECT);!function(e,t){mh(Zy.getSubjectTreeFetchOptions(ES(t,"subjectTree")),[])}(0,r);var o;return l.createElement(l.Fragment,null,!!i.data&&!!n.subjectTree&&l.createElement(qv,{memberType:e.memberType,objects:i.data,subjectTree:n.subjectTree,onClickAddToSubject:jS(n,r)}),n.showConfirmationPopup&&l.createElement(sp,{title:CS(e.memberType,i.data,n.selectedSubject),onClickConfirm:function(){return OS(i.data,a,e,n,r)},closePopup:function(){return e=!1,ES(r,"showConfirmationPopup")(e);var e}},l.createElement("p",null,"The following ".concat(e.memberType," will be added to "),l.createElement("strong",null,n.selectedSubject.name),n.addToClassifications?" and its mapped classifications:":":"),l.createElement("ul",null,i.data.map((function(e){return l.createElement("li",{key:e.id},e.name)}))),!n.addToClassifications&&l.createElement("p",null,"".concat(1===i.data.length?"It":"They"," will not be added to its mapped classifications.")),l.createElement("p",null,"".concat((o=e.memberType,Sl(Vh.singularizeMemberType(o)))," to classification mappings can be managed from the "),l.createElement("strong",null,"Edit Subject ".concat(Sl(e.memberType)," ")),"page.")))}function kS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return TS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return TS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function TS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function LS(e){var t=e.subjectId,n=e.routeToOnDelete,r=e.closePopup,i=kS(l.useState(),2),a=i[0],o=i[1],c=kS(l.useState(!1),2),s=c[0],f=c[1];mh(Zy.getSubjectFetchOptions(t,o),[]);var d=zf(u.SUBJECT),m=[{variant:"link",onClick:r,buttonText:"Cancel"},{variant:"danger",onClick:function(){f(!0);d.deleteSubject(t,(function(){r(),n&&p.AppLinkHelper.trigger(n)}),r)},buttonText:"Yes, delete this backbone classification",isSpinnerButton:!0,showSpinner:s}];return l.createElement(np,{title:"Delete Subject",closePopup:r,showLoadingSpinner:!a},!!a&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,a.name),"?"),l.createElement("p",null,"Subjects that have mapped classifications cannot be deleted.")),l.createElement(ip,{buttons:m})))}function _S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return PS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function PS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xS(e){var t=e.subjectId,n=_S(l.useState(),2),r=n[0],a=n[1],o=_S(l.useState(),2),c=o[0],s=o[1],f=zf(u.SUBJECT),p=Zy.getSubjectFetchOptions(t,a);mh(Zy.getSubjectTreeFetchOptions(s),[]),mh(p,[t]);return l.createElement(l.Fragment,null,l.createElement(Xv,{subjectId:t,activeAction:i.Subjects.EDIT_SUBJECT}),!!r&&!!c&&l.createElement(Zv,{subject:r,subjectTree:c,saveSubject:function(e,n){return f.updateSubject(t,e,n,n)}}))}function NS(e,t){return hh(e,t)}function RS(e){switch(e){case jh.Playlists:return i.Subjects.EDIT_SUBJECT_PLAYLISTS;case jh.Series:return i.Subjects.EDIT_SUBJECT_SERIES;case jh.Videos:return i.Subjects.EDIT_SUBJECT_VIDEOS}}function DS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return MS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return MS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function MS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function US(e){var t=DS(l.useState({}),2),n=t[0],r=t[1],a=n.presentations,o=n.classifications,s=n.memberIds,f=n.membersWithClassifications,d=oe.useBasicFetch(Array.isArray(s)&&function(e,t){switch(e){case jh.Playlists:return Bm(t);case jh.Series:return Pg(t);case jh.Videos:return Pb(t)}}(e.memberType,s)),m=zf(u.SUBJECT);function h(t){p.AppLinkHelper.trigger({application:c.SUBJECTS,action:e.action,args:[e.subjectId],params:{presentationId:t}})}!function(e,t,n){var r=e.subjectId,i=e.memberType,a=e.presentationId;mh(Zy.getPresentationsFetchOptions(NS(n,"presentations")),[]),mh(Zy.getSubjectMemberIdsFetchOptions(r,i,NS(n,"memberIds")),[r,i]),mh(!!a&&Zy.getSubjectClassificationFetchOptions(r,NS(n,"classifications"),a,i),[r,i,a],!!a)}(e,0,r),function(e,t,n,r){var i=n.classifications;l.useEffect((function(){NS(r,"membersWithClassifications")(function(e,t,n){if(!t||!n)return;return t.map((function(t){return{id:t.id,name:t.name,classifications:n.map((function(n){return{id:n.id,selected:(r=t,i=n,!!i[e]&&!!i[e].data.filter((function(e){return e.id===r.id})).length)};var r,i}))}}))}(t.memberType,e,i))}),[e,i])}(d.data,e,n,r),l.useEffect((function(){!e.presentationId&&(null==a?void 0:a.length)&&h(hp.a.first(a).id)}),[e.presentationId]);var y,v,b=!!e.presentationId&&!!o;return l.createElement(l.Fragment,null,l.createElement(Xv,{subjectId:e.subjectId,presentationId:e.presentationId,activeAction:RS(e.memberType)}),l.createElement(ki.Alert,{variant:"info",className:"m-0"},"Select which ".concat(e.memberType," are shown for each classification in this backbone classification.")+" Change the selected presentation to view different classifications."),l.createElement("div",{className:"w-50 py-2"},!!a&&l.createElement(Hv,{presentations:a,currentPresentationId:e.presentationId,setCurrentPresentation:function(e){return h(e.id)}})),b&&l.createElement(fb,{members:f||[],memberType:e.memberType,getMemberAppLink:function(t){return Vh.getMemberAppLink(e.memberType,t)},getActions:function(t){return Vh.getMemberActions(e.subjectId,wh.Subject,e.memberType,t)},classifications:o,getClassificationAppLink:e.presentationId&&(y=e.memberType,v=e.presentationId,function(e){var t,n=c.SUBJECTS,r=[v,e];switch(y){case jh.Playlists:t=i.Subjects.EDIT_CLASSIFICATION_PLAYLISTS;break;case jh.Series:t=i.Subjects.EDIT_CLASSIFICATION_SERIES;break;case jh.Videos:t=i.Subjects.EDIT_CLASSIFICATION_VIDEOS}return{application:n,action:t,args:r}}),onToggleClassification:function(t,n,r){return function(e,t,n,r,i,a,o){(o?e.addObjectsToClassification.bind(e):e.removeObjectsFromClassification.bind(e))(a,n,t,r,i)}(m,e.memberType,r?[r]:s,e.subjectId,e.presentationId,t,n)}}))}function FS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return VS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function VS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function BS(e){var t=e.parentId,n=FS(l.useState(),2),r=n[0],a=n[1],o=zf(u.SUBJECT);mh(Zy.getSubjectTreeFetchOptions(a),[]);var s={application:c.SUBJECTS,action:i.Subjects.PRESENTATIONS};return l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-2 border-bottom"},l.createElement(fu,{backToName:"Presentations",appLink:s})),l.createElement("h4",{className:"py-2"},"Create New Subject"),!!r&&l.createElement(Zv,{subject:{parentId:t},subjectTree:r,saveSubject:function(e,t){return o.createSubject(e,function(e){return function(t){e(),t&&t.id&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[t.id]})}}(t),t)}}))}function zS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return HS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function HS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qS(e){var t=zS(l.useState(),2),n=t[0],r=t[1],i=zS(l.useState(!1),2),a=i[0],o=i[1],c=oe.useBasicFetch(function(e,t){switch(e){case jh.Playlists:return Vm(t);case jh.Series:return _g(t);case jh.Videos:return _b(t)}}(e.memberType,e.memberId)),s=zf(u.SUBJECT);mh(Zy.getSubjectFetchOptions(e.subjectId,r),[e.subjectId]);var f=!!n&&!!c.data,p="Remove ".concat(Sl(Vh.singularizeMemberType(e.memberType)));return l.createElement(np,{title:p,closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,c.data.name)," from ",l.createElement("strong",null,n.name),"?"),l.createElement("p",null,"Please ensure that it is not in any classifications before removing.")),l.createElement(ip,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){o(!0),s.removeObjectsFromSubject(e.subjectId,[e.memberId],e.memberType,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(Vh.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function JS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return $S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $S(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function KS(e){var t=e.subjectId,n=JS(l.useState({}),2),r=n[0];return function(e,t){var n=function(e){return hh(t,e)};mh(Zy.getSubjectClassificationFetchOptions(e,n("classifications")),[e]),mh(Zy.getPresentationsFetchOptions(n("presentations")),[])}(t,n[1]),l.createElement(l.Fragment,null,l.createElement(Xv,{subjectId:t,activeAction:i.Subjects.SUBJECT_CLASSIFICATIONS}),l.createElement(ib,{presentations:r.presentations,classificationDictionary:hp.a.groupBy(r.classifications,"presentationId")}))}var YS=n(217),GS=n.n(YS);function WS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ZS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ZS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ZS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function QS(e){var t=e.selectedSubjectId,n=WS(l.useState(),2),r=n[0],a=n[1];mh(Zy.getSubjectTreeFetchOptions(a),[]);var o=l.useCallback((function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[e.id]}}),[]),s={application:c.SUBJECTS,action:i.Subjects.NEW_SUBJECT},u=[{label:"Add child",getAppLink:function(e){return Object.assign(Object.assign({},s),{params:{parentId:e.id}})}},{label:"Delete backbone classification",getAppLink:function(e){return{application:c.SUBJECTS,action:i.Subjects.DELETE_SUBJECT,args:[e.id]}},className:"text-danger"}];return l.createElement("div",{className:"".concat(GS.a.navContainer," h-auto pr-2 border-right")},l.createElement("h5",{className:"border-bottom pb-2"},"Backbone Classifications"),l.createElement(lu,{appLink:s,className:"d-inline-block pb-2"},l.createElement(Mc,{svgName:Dc.Plus,size:Nc.Small}),l.createElement("span",null,"New Backbone Classification")),!!r&&l.createElement("div",{className:"border-top pt-1"},l.createElement(xl,{tree:r,getAppLink:o,selectedIds:[t],actions:u})))}function XS(e){var t=e.currentAppLink;return l.createElement(pb,{navItems:Bh(),currentAppLink:t})}function eE(e){return(eE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function rE(e,t,n){return t&&nE(e.prototype,t),n&&nE(e,n),e}function iE(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&aE(e,t)}function aE(e,t){return(aE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=sE(e);if(t){var i=sE(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return cE(this,n)}}function cE(e,t){return!t||"object"!==eE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function sE(e){return(sE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var uE=function(e){iE(n,e);var t=oE(n);function n(){return tE(this,n),t.apply(this,arguments)}return rE(n,[{key:"channelName",get:function(){return c.PLAYLISTS}},{key:"appRoutes",get:function(){return{"manage/playlists(/)":"index","manage/playlists/new(/)":"newPlaylist","manage/playlists/search(/)":"searchPlaylists","manage/playlists/:id(/)":"editPlaylist","manage/playlists/:id/videos(/)":"editPlaylistVideos","manage/playlists/:id/classifications(/)":"editPlaylistSubjects","manage/playlists/:id/audiences(/)":"editPlaylistAudiences"}}},{key:"appLinks",get:function(){return["deletePlaylist","removeVideo","uploadImage","removeFromSubject"]}}]),n}(p.AppRouter),lE=function(e){iE(n,e);var t=oE(n);function n(){return tE(this,n),t.apply(this,arguments)}return rE(n,[{key:"initialize",value:function(){var e=this;Ci.a.values(u).forEach((function(t){return Bf.getInstance(t,e)}))}},{key:"name",get:function(){return"Playlists Application"}},{key:"channelName",get:function(){return c.PLAYLISTS}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT,options:{provider:Rm}}}},{key:"index",value:function(e){this.layout.showChildView(k,l.createElement(Hb,{cursor:null==e?void 0:e.cursor}))}},{key:"searchPlaylists",value:function(e){this.layout.showChildView(k,l.createElement($b,{query:null==e?void 0:e.query,cursor:null==e?void 0:e.cursor}))}},{key:"newPlaylist",value:function(){this.layout.showChildView(k,l.createElement(Tb,null))}},{key:"editPlaylist",value:function(e){this.layout.showChildView(k,l.createElement(nh,{key:e,playlistId:e}))}},{key:"editPlaylistVideos",value:function(e){this.layout.showChildView(k,l.createElement(kb,{key:e,playlistId:e}))}},{key:"editPlaylistSubjects",value:function(e){this.layout.showChildView(k,l.createElement(Eb,{key:e,playlistId:e}))}},{key:"editPlaylistAudiences",value:function(e){this.layout.showChildView(k,l.createElement(yb,{key:e,playlistId:e}))}},{key:"deletePlaylist",value:function(e){var t=Object.assign({playlistId:e},this.getPopupProps());this.layout.showChildView(T,l.createElement(Wm,Object.assign({},t)))}},{key:"removeVideo",value:function(e,t){var n=Object.assign({playlistId:e,videoId:t},this.getPopupProps());this.layout.showChildView(T,l.createElement(Mb,Object.assign({},n)))}},{key:"removeFromSubject",value:function(e,t){var n=Object.assign({subjectId:t,memberId:e,memberType:jh.Playlists},this.getPopupProps());this.layout.showChildView(T,l.createElement(qS,Object.assign({},n)))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(T,l.createElement(Nm,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return eu.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(L,l.createElement(id,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return uE}}]),n}(p.Application),fE=function(e){var t=e.children;return l.createElement(Ru,null,t)},pE=function(){return{url:"/api/domain/v2/me/ratings",key:"ratings"}},dE=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:ji.string().trim().max(350,"Description is too long").default(""),rating:ji.object().shape({id:ji.string()}).default({}).noUnknown(),tallPoster:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown(),banner:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown()}).noUnknown(),mE=function(e,t){var n=c.SERIES,r=i.Series,a=[{label:"Edit Series Details",appLink:{application:n,action:r.EDIT_SERIES,args:[t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_SERIES_VIDEOS,args:[t]}}];return Tp(e)&&a.push.apply(a,[{label:"Backbone Classifications",appLink:{application:n,action:r.EDIT_SERIES_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_SERIES_AUDIENCES,args:[t]}}]),a};function hE(e){var t=ci(),n=qc(t);return l.createElement(vi,null,l.createElement(Bc,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this series",autoFocus:!0}),l.createElement(Bc,{label:"Description",as:"textarea",name:"description",id:"description",maxLength:350,value:t.values.description,placeholder:"Describe this series here",showCharacterCounter:!0}),l.createElement(yl,{ratings:e.ratings}),l.createElement(Qu,{imageType:hu.TallPosters,fieldName:"tallPoster",application:c.SERIES,uploadAction:i.Series.UPLOAD_IMAGE}),l.createElement(Qu,{imageType:hu.Banners,fieldName:"banner",application:c.SERIES,uploadAction:i.Playlists.UPLOAD_IMAGE}),l.createElement("div",{className:"d-flex justify-content-between align-items-center"},l.createElement(cf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.id?"Save":"Create"),!!e.actions&&l.createElement(fl,{actions:e.actions})))}function yE(e){return l.createElement(wi,{initialValues:e.series,validationSchema:dE,onSubmit:e.saveSeries},l.createElement(hE,{id:e.series&&e.series.id,ratings:e.ratings}))}function vE(e){return l.createElement("div",{className:"py-2"},l.createElement(wl,{tabs:mE(e.currentUser,e.seriesId),isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}));var t}function bE(e){var t,n=Object(v.useDispatch)(),r=ep(),a=oe.useBasicFetch(_g(e.seriesId)),o=oe.useBasicFetch(pE()),s=oe.useBasicFetch(mp());return l.createElement(l.Fragment,null,!!s.data&&l.createElement(vE,{seriesId:e.seriesId,activeAction:i.Series.EDIT_SERIES,currentUser:s.data}),!!a.data&&!!o.data&&l.createElement(yE,{series:a.data,saveSeries:function(t,i){oe.fetch(n,Ng(e.seriesId,t,(function(){r.success("Successfully updated series.")}),(function(){r.error("Failed to update series.")}),i))},ratings:o.data}),l.createElement("div",{className:"py-3 text-right"},"Can't find what you're looking for? Try the old edit series page ",l.createElement(lu,{className:"info-link",appLink:(t=e.seriesId,{application:c.SERIES,action:i.Series.LEGACY_EDIT_SERIES,args:[t]})},"here"),"."))}function gE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return SE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return SE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function SE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function EE(e){var t=gE(l.useState({}),2),n=t[0],r=t[1],a=oe.useBasicFetch(_g(e.seriesId)),o=oe.useBasicFetch(mp()),c=zf(u.SUBJECT);!function(e,t,n){var r=function(e){return hh(n,e)};mh(Zy.getObjectLevelsFetchOptions(e,jh.Series,r("seriesLevels")),[e]),mh(Zy.getObjectAudiencesFetchOptions(e,jh.Series,r("seriesAudiences")),[e,t.seriesLevels]),uh([Zy.getPresentationsFetchOptions(r("presentations")),Zy.getLevelsFetchOptions(r("levels"))],[]),mh(!!t.currentPresentation&&Zy.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.seriesId,n,r),db(n,r);var s=!!(n.presentations&&n.levels&&n.presentationAudiences&&n.seriesLevels&&n.seriesAudiences);return l.createElement(l.Fragment,null,!!o.data&&l.createElement(vE,{seriesId:e.seriesId,activeAction:i.Series.EDIT_SERIES_AUDIENCES,currentUser:o.data}),l.createElement(pl,{object:a.data}),!!s&&l.createElement(ov,{objectLevels:n.seriesLevels,objectAudiences:n.seriesAudiences,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:hh(r,"currentPresentation"),levels:n.levels,presentationAudiences:n.presentationAudiences,memberType:jh.Series,saveLevels:function(t,n,r){return c.updateObjectLevels(e.seriesId,t,jh.Series,n,r,r)},saveAudiences:function(t,r){return c.updateObjectAudiences(e.seriesId,n.currentPresentation.id,t,jh.Series,r,r)}}))}function OE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||AE(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function CE(e){return function(e){if(Array.isArray(e))return wE(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||AE(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function AE(e,t){if(e){if("string"==typeof e)return wE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wE(e,t):void 0}}function wE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jE(e){var t=OE(l.useState({}),2),n=t[0],r=t[1],a=oe.useBasicFetch(_g(e.seriesId)),o=oe.useBasicFetch(mp()),c=zf(u.SUBJECT);!function(e,t,n){var r=function(e){return hh(n,e)};uh([Zy.getSubjectTreeFetchOptions(r("subjectTree")),Zy.getPresentationsFetchOptions(r("presentations"))],[]),mh(Zy.getObjectSubjectsFetchOptions(e,jh.Series,r("seriesSubjects")),[e]),mh(!!t.currentPresentation&&Zy.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),l.useEffect((function(){return r("subjectClassifications")([])}),[t.seriesSubjects]);var i=function(e,t){return[].concat(CE(t.subjectClassifications||[]),CE(e))},a=t.seriesSubjects&&t.seriesSubjects.map((function(e){return Zy.getSubjectClassificationFetchOptions(e.id,hh(n,"subjectClassifications",i))}));uh(a,[t.seriesSubjects],!!a),mh(Zy.getObjectClassificationsFetchOptions(e,jh.Series,r("seriesClassifications")),[e,t.seriesSubjects])}(e.seriesId,n,r),db(n,r);var s=!!(n.seriesSubjects&&n.subjectTree&&n.presentations&&n.classificationTree&&n.seriesClassifications&&n.subjectClassifications);return l.createElement(l.Fragment,null,!!o.data&&l.createElement(vE,{seriesId:e.seriesId,activeAction:i.Series.EDIT_SERIES_SUBJECTS,currentUser:o.data}),l.createElement(pl,{object:a.data}),s&&l.createElement(Kv,{objectSubjects:n.seriesSubjects,subjectTree:n.subjectTree,memberType:jh.Series,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:hh(r,"currentPresentation"),objectClassifications:n.seriesClassifications,objectSubjectClassifications:n.subjectClassifications,classificationTree:n.classificationTree,saveSubjects:function(t,n,r){return c.updateObjectSubjects(e.seriesId,t,jh.Series,n,r,r)},saveClassifications:function(t,r){return c.updateObjectClassifications(e.seriesId,n.currentPresentation.id,t,jh.Series,r,r)}}))}function IE(){var e=Object(v.useDispatch)(),t=ep(),n=oe.useBasicFetch(pE());return l.createElement(l.Fragment,null,!!n.data&&l.createElement(yE,{saveSeries:function(n,r){var a=function(){t.error("Failed to create series.")},o=function(e){t.success("Successfully created series."),function(e){p.AppLinkHelper.trigger({application:c.SERIES,action:i.Series.EDIT_SERIES,args:[e.id]})}(e)};oe.fetch(e,xg(n,(function(t){var n={permissions:Ip()};oe.fetch(e,Ng(t.id,n,o,a,r))}),a))},ratings:n.data}))}function kE(e){return(kE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function TE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _E(e,t,n){return t&&LE(e.prototype,t),n&&LE(e,n),e}function PE(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xE(e,t)}function xE(e,t){return(xE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function NE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=DE(e);if(t){var i=DE(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return RE(this,n)}}function RE(e,t){return!t||"object"!==kE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function DE(e){return(DE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ME=function(e){PE(n,e);var t=NE(n);function n(){return TE(this,n),t.apply(this,arguments)}return _E(n,[{key:"channelName",get:function(){return c.SERIES}},{key:"appRoutes",get:function(){return{"manage/series/new(/)":"newSeries","manage/series/:id(/)":"editSeries","manage/series/:id/videos(/)":"editSeriesVideos","manage/series/:id/classifications(/)":"editSeriesSubjects","manage/series/:id/audiences(/)":"editSeriesAudiences","manage/legacy/series/:id(/)":"legacyEditSeries"}}},{key:"appLinks",get:function(){return["uploadImage"]}}]),n}(p.AppRouter),UE=function(e){PE(n,e);var t=NE(n);function n(){return TE(this,n),t.apply(this,arguments)}return _E(n,[{key:"initialize",value:function(){var e=this;Ci.a.values(u).forEach((function(t){return Bf.getInstance(t,e)}))}},{key:"name",get:function(){return"Series Application"}},{key:"channelName",get:function(){return c.SERIES}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT,options:{provider:fE}}}},{key:"newSeries",value:function(){this.layout.showChildView(k,l.createElement(IE,null))}},{key:"editSeries",value:function(e){this.layout.showChildView(k,l.createElement(bE,{seriesId:e}))}},{key:"editSeriesVideos",value:function(e){this.legacyEditSeries(e)}},{key:"editSeriesSubjects",value:function(e){this.layout.showChildView(k,l.createElement(jE,{seriesId:e}))}},{key:"editSeriesAudiences",value:function(e){this.layout.showChildView(k,l.createElement(EE,{seriesId:e}))}},{key:"legacyEditSeries",value:function(e){p.LocationUtils.Redirect("/manage/legacy/series/".concat(e),!0)}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(T,l.createElement(Nm,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return eu.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(L,l.createElement(id,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return ME}}]),n}(p.Application);function FE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return VE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function VE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function BE(e){var t=FE(l.useState(),2),n=t[0],r=t[1],i=FE(l.useState(!1),2),a=i[0],o=i[1],c=oe.useBasicFetch(function(e,t){switch(e){case Ih.Playlists:return Vm(t);case Ih.Series:return _g(t);case Ih.Videos:return _b(t)}}(e.memberType,e.memberId)),s=zf(u.SUBJECT);mh(Zy.getAudienceFetchOptions(e.audienceId,r),[e.audienceId]);var f=!!n&&!!c.data,p="Remove ".concat(Sl($h.singularizeMemberType(e.memberType)));return l.createElement(np,{title:p,closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,c.data.name)," from ",l.createElement("strong",null,n.name),"?"),l.createElement("p",null,"This will not remove it from the backbone level.")),l.createElement(ip,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){o(!0),s.removeObjectsFromAudience(e.audienceId,[e.memberId],e.memberType,null,null,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat($h.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function zE(e){return(zE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function HE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function JE(e,t,n){return t&&qE(e.prototype,t),n&&qE(e,n),e}function $E(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&KE(e,t)}function KE(e,t){return(KE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function YE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=WE(e);if(t){var i=WE(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return GE(this,n)}}function GE(e,t){return!t||"object"!==zE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function WE(e){return(WE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ZE,QE=function(e){$E(n,e);var t=YE(n);function n(){return HE(this,n),t.apply(this,arguments)}return JE(n,[{key:"channelName",get:function(){return c.SUBJECTS}},{key:"appRoutes",get:function(){return{"manage/subjects(/)":"subjects","manage/subjects/add-objects(/)":"addSubjectMembers","manage/subjects/new(/)":"newSubject","manage/subjects/:id/edit(/)":"editSubject","manage/subjects/:id/edit/playlists(/)":"editSubjectPlaylists","manage/subjects/:id/edit/series(/)":"editSubjectSeries","manage/subjects/:id/edit/videos(/)":"editSubjectVideos","manage/subjects/:id/classifications(/)":"subjectClassifications","manage/subjects/classifications(/)":"classifications","manage/subjects/presentations/:id/classifications(/)":"presentationClassifications","manage/subjects/presentations/:id/classifications/new(/)":"newClassification","manage/subjects/presentations/:id/classifications/:id/edit(/)":"editClassification","manage/subjects/presentations/:id/classifications/:id/edit/playlists(/)":"editClassificationPlaylists","manage/subjects/presentations/:id/classifications/:id/edit/series(/)":"editClassificationSeries","manage/subjects/presentations/:id/classifications/:id/edit/videos(/)":"editClassificationVideos","manage/subjects/levels(/)":"levels","manage/subjects/levels/new(/)":"newLevel","manage/subjects/levels/:id(/)":"level","manage/subjects/levels/:id/edit(/)":"editLevel","manage/subjects/levels/:id/edit/playlists(/)":"editLevelPlaylists","manage/subjects/levels/:id/edit/series(/)":"editLevelSeries","manage/subjects/levels/:id/edit/videos(/)":"editLevelVideos","manage/subjects/levels/:id/audiences(/)":"levelAudiences","manage/subjects/audiences(/)":"audiences","manage/subjects/presentations/:id/audiences(/)":"presentationAudiences","manage/subjects/presentations/:id/audiences/new(/)":"newAudience","manage/subjects/presentations/:id/audiences/:id/edit(/)":"editAudience","manage/subjects/presentations/:id/audiences/:id/edit/playlists(/)":"editAudiencePlaylists","manage/subjects/presentations/:id/audiences/:id/edit/series(/)":"editAudienceSeries","manage/subjects/presentations/:id/audiences/:id/edit/videos(/)":"editAudienceVideos","manage/subjects/presentations(/)":"presentations","manage/subjects/presentations/new":"newPresentation","manage/subjects/presentations/:id(/)":"editPresentation"}}},{key:"appLinks",get:function(){return["deleteClassification","removeClassificationMember","deleteSubject","removeSubjectMember","deleteAudience","removeLevelMember","removeAudienceMember","uploadImage"]}}]),n}(p.AppRouter),XE=function(e){$E(n,e);var t=YE(n);function n(){return HE(this,n),t.apply(this,arguments)}return JE(n,[{key:"initialize",value:function(){var e=this;this.subjectDataService=Bf.getInstance(u.SUBJECT,this),Ci.a.values(u).forEach((function(t){return Bf.getInstance(t,e)}))}},{key:"name",get:function(){return"Subjects Application"}},{key:"channelName",get:function(){return c.SUBJECTS}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT,options:{provider:Ru,getTopNavView:this.getTopNav}}}},{key:"subjects",value:function(){this.subjectDataService.getSubjectTree((function(e){var t=!!e.children&&e.children[0];t?p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[t.id]},{replace:!0}):p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.NEW_SUBJECT},{replace:!0})}))}},{key:"newSubject",value:function(e){var t={parentId:e.parentId};this.layout.showChildView(k,l.createElement(BS,Object.assign({key:e.parentId},t))),this.renderSubjectsLeftNav()}},{key:"editSubject",value:function(e){this.layout.showChildView(k,l.createElement(xS,{key:e,subjectId:e})),this.renderSubjectsLeftNav(e)}},{key:"editSubjectPlaylists",value:function(e,t){var n={subjectId:e,memberType:jh.Playlists,action:i.Subjects.EDIT_SUBJECT_PLAYLISTS,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(k,l.createElement(US,Object.assign({key:"".concat(e,":playlists")},n))),this.renderSubjectsLeftNav(e)}},{key:"editSubjectSeries",value:function(e,t){var n={subjectId:e,memberType:jh.Series,action:i.Subjects.EDIT_SUBJECT_SERIES,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(k,l.createElement(US,Object.assign({key:"".concat(e,":series")},n))),this.renderSubjectsLeftNav(e)}},{key:"editSubjectVideos",value:function(e,t){var n={subjectId:e,memberType:jh.Videos,action:i.Subjects.EDIT_SUBJECT_VIDEOS,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(k,l.createElement(US,Object.assign({key:"".concat(e,":videos")},n))),this.renderSubjectsLeftNav(e)}},{key:"subjectClassifications",value:function(e){this.layout.showChildView(k,l.createElement(KS,{key:e,subjectId:e})),this.renderSubjectsLeftNav(e)}},{key:"addSubjectMembers",value:function(e){var t=e.memberType,n=e.objectIds;if(t&&n){var r={memberType:t,objectIds:Array.isArray(n)?n:[n]};this.layout.showChildView(k,l.createElement(IS,Object.assign({},r))),this.hideLeftNav()}}},{key:"removeSubjectMember",value:function(e,t,n){var r=Object.assign({subjectId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(T,l.createElement(qS,Object.assign({},r)))}},{key:"deleteSubject",value:function(e){var t=e.toString()===this.currentLeftNavId.toString()?{application:c.SUBJECTS,action:i.Subjects.NEW_SUBJECT}:null,n=Object.assign({subjectId:e,routeToOnDelete:t||null},this.getPopupProps());this.layout.showChildView(T,l.createElement(LS,Object.assign({},n)))}},{key:"classifications",value:function(){var e={objectType:"classifications",getAppLink:function(e){return{application:c.SUBJECTS,action:i.Subjects.PRESENTATION_CLASSIFICATIONS,args:[e.id]}}};this.layout.showChildView(k,l.createElement(SS,Object.assign({},e))),this.hideLeftNav()}},{key:"presentationClassifications",value:function(e){this.subjectDataService.getClassificationTree(e,(function(t){var n=!!t.children&&t.children[0];n?p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[e,n.id]},{replace:!0}):p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.NEW_CLASSIFICATION,args:[e]},{replace:!0})}))}},{key:"newClassification",value:function(e,t){var n={presentationId:e,parentId:t.parentId};this.layout.showChildView(k,l.createElement(Lg,Object.assign({key:t.parentId},n))),this.renderClassificationLeftNav(e)}},{key:"editClassification",value:function(e,t){var n={presentationId:e,classificationId:t};this.layout.showChildView(k,l.createElement(Ag,Object.assign({key:t},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationPlaylists",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:jh.Playlists};this.layout.showChildView(k,l.createElement(Ig,Object.assign({key:"".concat(t,":playlists")},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationSeries",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:jh.Series};this.layout.showChildView(k,l.createElement(Ig,Object.assign({key:"".concat(t,":series")},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationVideos",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:jh.Videos};this.layout.showChildView(k,l.createElement(Ig,Object.assign({key:"".concat(t,":videos")},n))),this.renderClassificationLeftNav(e,t)}},{key:"removeClassificationMember",value:function(e,t,n){var r=Object.assign({classificationId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(T,l.createElement(Mg,Object.assign({},r)))}},{key:"deleteClassification",value:function(e,t){var n=t===this.currentLeftNavId?{application:c.SUBJECTS,action:i.Subjects.NEW_CLASSIFICATION,args:[e]}:null,r=Object.assign({classificationId:t,routeToOnDelete:n||null},this.getPopupProps());this.layout.showChildView(T,l.createElement(Eg,Object.assign({},r)))}},{key:"levels",value:function(){this.layout.showChildView(k,l.createElement(Hg,null)),this.renderLevelsLeftNav()}},{key:"newLevel",value:function(){this.layout.showChildView(k,l.createElement(qg,null)),this.renderLevelsLeftNav()}},{key:"level",value:function(e){p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[e]},{replace:!0})}},{key:"editLevel",value:function(e){this.layout.showChildView(k,l.createElement(Vg,{key:e,id:e})),this.renderLevelsLeftNav(e)}},{key:"levelAudiences",value:function(e){this.layout.showChildView(k,l.createElement(eS,{key:e,levelId:e})),this.renderLevelsLeftNav(e)}},{key:"editLevelPlaylists",value:function(e,t){var n={levelId:e,memberType:Ih.Playlists,action:i.Subjects.EDIT_LEVEL_PLAYLISTS,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(k,l.createElement(aS,Object.assign({key:"".concat(e,":playlists")},n))),this.renderLevelsLeftNav(e)}},{key:"editLevelSeries",value:function(e,t){var n={levelId:e,memberType:Ih.Series,action:i.Subjects.EDIT_LEVEL_SERIES,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(k,l.createElement(aS,Object.assign({key:"".concat(e,":series")},n))),this.renderLevelsLeftNav(e)}},{key:"editLevelVideos",value:function(e,t){var n={levelId:e,memberType:Ih.Videos,action:i.Subjects.EDIT_LEVEL_VIDEOS,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(k,l.createElement(aS,Object.assign({key:"".concat(e,":videos")},n))),this.renderLevelsLeftNav(e)}},{key:"removeLevelMember",value:function(e,t,n){var r=Object.assign({levelId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(T,l.createElement(sS,Object.assign({},r)))}},{key:"audiences",value:function(){var e={objectType:"audiences",getAppLink:function(e){return{application:c.SUBJECTS,action:i.Subjects.PRESENTATION_AUDIENCES,args:[e.id]}}};this.layout.showChildView(k,l.createElement(SS,Object.assign({},e))),this.hideLeftNav()}},{key:"removeAudienceMember",value:function(e,t,n){var r=Object.assign({audienceId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(T,l.createElement(BE,Object.assign({},r)))}},{key:"presentationAudiences",value:function(e){this.subjectDataService.getAudiences(e,(function(t){var n=!!t&&t[0];n?p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[e,n.masterId]},{replace:!0}):p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.NEW_AUDIENCE,args:[e]},{replace:!0})}))}},{key:"newAudience",value:function(e){this.layout.showChildView(k,l.createElement(rg,{presentationId:e})),this.hideLeftNav()}},{key:"editAudience",value:function(e,t){var n={presentationId:e,audienceId:t};this.layout.showChildView(k,l.createElement(Xb,Object.assign({key:t},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudiencePlaylists",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:Ih.Playlists};this.layout.showChildView(k,l.createElement(fg,Object.assign({key:"".concat(t,":playlists")},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudienceSeries",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:Ih.Series};this.layout.showChildView(k,l.createElement(fg,Object.assign({key:"".concat(t,":series")},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudienceVideos",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:Ih.Videos};this.layout.showChildView(k,l.createElement(fg,Object.assign({key:"".concat(t,":videos")},n))),this.renderAudienceLeftNav(e,t)}},{key:"deleteAudience",value:function(e,t){var n={application:c.SUBJECTS,action:i.Subjects.PRESENTATION_AUDIENCES,args:[e]},r=Object.assign({id:t,routeToOnDelete:n},this.getPopupProps());this.layout.showChildView(T,l.createElement(Wb,Object.assign({},r)))}},{key:"presentations",value:function(){this.layout.showChildView(k,l.createElement(yS,null)),this.hideLeftNav()}},{key:"newPresentation",value:function(){this.layout.showChildView(k,l.createElement(vS,null))}},{key:"editPresentation",value:function(e){this.layout.showChildView(k,l.createElement(fS,{key:e,id:e})),this.hideLeftNav()}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(T,l.createElement(Nm,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return eu.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(L,l.createElement(id,{alerts:n,removeAlert:r}))}},{key:"renderClassificationLeftNav",value:function(e,t){this.setCurrentLeftNavItem(t);var n={presentationId:e,selectedClassificationId:t};this.layout.showChildView(I,l.createElement(bg,Object.assign({},n)))}},{key:"renderSubjectsLeftNav",value:function(e){this.setCurrentLeftNavItem(e),this.layout.showChildView(I,l.createElement(QS,{selectedSubjectId:e}))}},{key:"renderAudienceLeftNav",value:function(e,t){this.setCurrentLeftNavItem(t);var n={presentationId:e,selectedAudienceId:t};this.layout.showChildView(I,l.createElement(sg,Object.assign({},n)))}},{key:"renderLevelsLeftNav",value:function(e){this.setCurrentLeftNavItem(e),this.layout.showChildView(I,l.createElement(Gg,{selectedLevelId:e}))}},{key:"setCurrentLeftNavItem",value:function(e){this.currentLeftNavId=e||null}},{key:"hideLeftNav",value:function(){this.setCurrentLeftNavItem(),this.layout.hideLeftNav()}},{key:"getTopNav",value:function(e){return l.createElement(XS,{currentAppLink:e})}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return QE}}]),n}(p.Application),eO=function(e){return{url:"/api/domain/v1/themes/".concat(e),key:"themes:".concat(e)}},tO=function(e){var t="/api/domain/v1/themes",n="themes";return e&&(t+="?type=".concat(e),n+=":type:".concat(e)),{url:t,key:n}},nO=function(e,t,n,r){return{url:"/api/domain/v1/themes",key:"theme",data:e,type:ce.a.POST,invalidationKeys:"themes",success:t,error:n,always:r}},rO=function(e,t,n,r,i){return{url:"/api/domain/v1/themes/".concat(e),key:"update:theme:".concat(e),data:t,type:ce.a.PUT,success:n,error:r,always:i}},iO=function(e,t,n,r){return{url:"/api/domain/v1/themes/".concat(e),key:"delete:theme:".concat(e),type:ce.a.DELETE,invalidationKeys:"themes",success:t,error:n,always:r}},aO=function(e){return{application:c.THEMES,action:i.Themes.EDIT_THEME,args:[e.id]}};function oO(){var e=oe.useBasicFetch(tO());return e.data?l.createElement(ml,{objects:e.data,getObjectAppLink:aO,newObjectAppLink:{application:c.THEMES,action:i.Themes.NEW_THEME},objectName:"Theme"}):l.createElement(l.Fragment,null)}!function(e){e.Glance="glance"}(ZE||(ZE={}));var cO=[{key:"topLeft",label:"Top Left"},{key:"topRight",label:"Top Right"},{key:"bottomLeft",label:"Bottom Left"},{key:"bottomRight",label:"Bottom Right"}];function sO(){var e=ci();return l.createElement("div",{className:"form-group"},cO.map((function(t){var n="data.".concat(t.key);return l.createElement(Qu,{label:t.label,imageType:hu.HeroBanners,fieldName:n,application:c.THEMES,uploadAction:i.Videos.UPLOAD_IMAGE,setSelectedImage:function(t){e.setFieldValue(n,{fileId:t.id,url:t.url,fileIdType:vu.ImageAPIv2})}})})))}var uO=ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown(),lO=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default(""),type:ji.mixed().required("Type is required"),data:ji.mixed().when("type",{is:ZE.Glance,then:ji.object().shape({topLeft:uO,topRight:uO,bottomLeft:uO,bottomRight:uO}).noUnknown(),otherwise:ji.mixed().strip(!0)}).default({})}).noUnknown();function fO(e){var t=ci(),n=function(e){switch(e){case ZE.Glance:return sO;default:return}}(t.values.type);return l.createElement(vi,null,l.createElement(Bc,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this theme",autoFocus:!0}),l.createElement(Bc,{as:"select",label:"Type",name:"type",id:"type",value:t.values.type},l.createElement("option",{value:null},"Select a type..."),Ci.a.getEnumKeys(ZE).map((function(e){return l.createElement("option",{key:e,value:ZE[e]},e)}))),!!n&&l.createElement(n,null),l.createElement("div",{className:"d-flex justify-content-between align-items-center"},l.createElement(us,{isNew:e.isNew}),!!e.actions&&l.createElement(fl,{actions:e.actions})))}function pO(e){var t;return l.createElement(wi,{initialValues:e.theme,validationSchema:lO,onSubmit:e.saveTheme},l.createElement(fO,{isNew:!(null===(t=e.theme)||void 0===t?void 0:t.id),actions:e.actions}))}function dO(){var e=Object(v.useDispatch)();return l.createElement(pO,{saveTheme:function(t,n){oe.fetch(e,nO(t,(function(e){n(),p.AppLinkHelper.trigger({application:c.THEMES,action:i.Themes.EDIT_THEME,args:[e.id]})}),null,n))}})}function mO(e){var t=Object(v.useDispatch)(),n=ep(),r=oe.useBasicFetch(eO(e.id));return r.data?l.createElement(pO,{theme:r.data,saveTheme:function(r,i){oe.fetch(t,rO(e.id,r,(function(){n.success("Successfully updated theme")}),(function(){n.error("Failed to update theme")}),i))},actions:[{label:"Delete theme",className:"btn btn-danger",button:!0,appLink:{application:c.THEMES,action:i.Themes.DELETE_THEME,args:[e.id]}}]}):l.createElement(l.Fragment,null)}function hO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vO(e){var t=Object(v.useDispatch)(),n=ep(),r=hO(l.useState(!1),2),a=r[0],o=r[1],s=oe.useBasicFetch(eO(e.id));return l.createElement(np,{title:"Delete Theme",closePopup:e.closePopup,showLoadingSpinner:!s.data},l.createElement(l.Fragment,null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,s.data.name),"?"),l.createElement(ip,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){o(!0),oe.fetch(t,iO(e.id,(function(){n.success("Successfully deleted theme"),p.AppLinkHelper.trigger({application:c.THEMES,action:i.Themes.THEMES})}),(function(){n.error("Failed to delete theme")})))},buttonText:"Yes, delete this theme",isSpinnerButton:!0,showSpinner:a}]})))}var bO=function(e){var t=e.children;return l.createElement(Ru,null,t)};function gO(e){return(gO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function SO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function OO(e,t,n){return t&&EO(e.prototype,t),n&&EO(e,n),e}function CO(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&AO(e,t)}function AO(e,t){return(AO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function wO(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=IO(e);if(t){var i=IO(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return jO(this,n)}}function jO(e,t){return!t||"object"!==gO(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function IO(e){return(IO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var kO=function(e){CO(n,e);var t=wO(n);function n(){return SO(this,n),t.apply(this,arguments)}return OO(n,[{key:"channelName",get:function(){return c.THEMES}},{key:"appRoutes",get:function(){return{"manage/themes(/)":"themes","manage/themes/new(/)":"newTheme","manage/themes/:id(/)":"editTheme"}}},{key:"appLinks",get:function(){return["deleteTheme","uploadImage"]}}]),n}(p.AppRouter),TO=function(e){CO(n,e);var t=wO(n);function n(){return SO(this,n),t.apply(this,arguments)}return OO(n,[{key:"name",get:function(){return"Themes Application"}},{key:"channelName",get:function(){return c.THEMES}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT,options:{provider:bO}}}},{key:"themes",value:function(){this.layout.showChildView(k,l.createElement(oO,null))}},{key:"newTheme",value:function(){this.layout.showChildView(k,l.createElement(dO,null))}},{key:"editTheme",value:function(e){this.layout.showChildView(k,l.createElement(mO,{id:e}))}},{key:"deleteTheme",value:function(e){var t=this;this.layout.showChildView(T,l.createElement(vO,{id:e,closePopup:function(){return t.layout.closePopup()}}))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(T,l.createElement(Nm,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}}],[{key:"router",get:function(){return kO}}]),n}(Nf),LO=function(e){var t=e.children;return l.createElement(Ru,null,t)},_O=function(e,t){var n=c.VIDEOS,r=i.Videos,a=[{label:"Edit Video Details",appLink:{application:n,action:r.EDIT_VIDEO,args:[t]}}];return Tp(e)?[].concat(a,[{label:"Backbone Classifications",appLink:{application:n,action:r.EDIT_VIDEO_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_VIDEO_AUDIENCES,args:[t]}},{label:"Aliases",appLink:{application:n,action:r.EDIT_VIDEO_ALIASES,args:[t]}}]):a};function PO(e){var t,n=_O(e.currentUser,e.videoId);return n.length<2?l.createElement(l.Fragment,null):l.createElement("div",{className:"py-2"},l.createElement(wl,{tabs:n,isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}))}var xO,NO,RO=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:ji.string().trim().default(""),status:ji.mixed().required("Status is required"),productionYear:ji.number().min(1900),rating:ji.object().shape({id:ji.string()}).default({}).noUnknown(),thumbnail:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown(),heroBanner:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown(),glance:ji.object().shape({theme:ji.string(),format:ji.mixed(),content:ji.string(),type:ji.mixed()}).default({}).noUnknown()}).noUnknown();!function(e){e[e.Draft=0]="Draft",e[e.Published=1]="Published",e[e.Archived=2]="Archived",e[e.Pending=3]="Pending",e[e.Rejected=4]="Rejected",e[e.Processing=5]="Processing"}(xO||(xO={})),function(e){e.Markdown="text/markdown"}(NO||(NO={}));var DO=n(52),MO=n.n(DO),UO=n(31);function FO(e){return f.a.createElement("div",Object.assign({},e,{role:"button",tabIndex:0,className:"".concat(e.className?e.className:""," cursor-pointer"),onKeyDown:e.onKeyDown?e.onKeyDown:function(t){return"Enter"===t.key&&e.onClick(t)},onClick:e.onClick,style:e.style?e.style:{}}),e.children)}var VO=n(53),BO=n.n(VO);function zO(e){var t=e.tag,n=e.appLink,r=e.onClick,i=e.disabled,a=e.tagClass,o="badge-pill py-1 px-2 my-1 mr-1 clamp-1 text-nowrap ".concat(void 0===a?"tag":a);return!n&&!r||i||(o+=" cursor-pointer"),i&&(o+=" "+BO.a.disabled),n?f.a.createElement(lu,{onClick:r,appLink:n,className:o,title:t.name},t.name):f.a.createElement("span",{onClick:r,className:o,title:t.name},t.name)}function HO(e){var t=e.tags,n=e.getAppLink;return t&&t.data?f.a.createElement("div",{className:BO.a.tagList},t.data.map((function(e){var t=m(n)?n(e):null;return f.a.createElement(zO,{key:e.id,tag:e,appLink:t})}))):f.a.createElement(f.a.Fragment,null)}var qO=n(26),JO=n.n(qO);function $O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return KO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return KO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function KO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var YO;function GO(e){var t,n,r,i=$O(l.useState(""),2),a=i[0],o=i[1];if(l.useEffect((function(){if(e.hasGlanceData){var t=DO(e.video.glance.content).split('a href="cv-tag://').join('a class="badge-pill tag mr-1 my-1 px-2 py-1" href="cv-tag://');o(t)}}),[null===(t=e.video.glance)||void 0===t?void 0:t.content]),!e.hasGlanceData&&e.hasDetails)return e.onClickShowDescription&&e.onClickShowDescription(),l.createElement(l.Fragment,null);return l.createElement("div",{className:"rounded border px-5 py-3 mb-3 position-relative d-flex justify-content-center ".concat(JO.a.container," ").concat((r=null===(n=e.theme)||void 0===n?void 0:n.name.toLowerCase(),r===YO.Maths?JO.a.bgBlue:r===YO.English?JO.a.bgPink:r===YO.History?JO.a.bgYellow:JO.a.bgGreen))},l.createElement("div",{className:"".concat(JO.a.content)},l.createElement("h2",{className:"h4"},l.createElement(ss,{namespace:"shared.videoAtAGlance",phrase:"videoAtAGlance"})),e.hasDetails&&e.onClickShowDescription&&l.createElement(FO,{onClick:e.onClickShowDescription,className:"".concat(JO.a.detailsBtn," position-absolute cursor-pointer mr-4 font-weight-500 text-info")},l.createElement(ss,{namespace:"shared.videoAtAGlance",phrase:"readFullDescription"})),l.createElement("div",{className:"position-relative",onClick:function(t){t.preventDefault();var n=t.target.getAttribute("href");if(n)if(n.includes("cv-timestamp://")){var r=n.split("cv-timestamp://")[1];e.setStartTime&&e.setStartTime(UO.a.convertDurationToSeconds(r))}else if(n.includes("cv-tag://")&&e.getTagAppLink){var i=n.split("cv-tag://")[1];p.AppLinkHelper.trigger(e.getTagAppLink(i))}else;},dangerouslySetInnerHTML:{__html:a}}),function(){var t,n,r;return(null===(n=null===(t=e.video.tags)||void 0===t?void 0:t.data)||void 0===n?void 0:n.length)?l.createElement("div",{className:"py-1"},l.createElement(HO,{tags:null===(r=e.video)||void 0===r?void 0:r.tags,getAppLink:function(t){return e.getTagAppLink?e.getTagAppLink(t.name):null}})):l.createElement(l.Fragment,null)}(),l.createElement("div",{className:"mt-2"},e.hasCurriculumLinks&&e.onClickShowCurriculumLinks&&l.createElement(FO,{onClick:e.onClickShowCurriculumLinks,className:"cursor-pointer d-inline-block font-weight-500 text-info"},l.createElement(ss,{namespace:"shared.videoAtAGlance",phrase:"seeCurriculumLinks"})))),function(){var t;return Ci.a.keys(null===(t=e.theme)||void 0===t?void 0:t.data).filter((function(t){var n;return!Ci.a.isEmpty(null===(n=e.theme)||void 0===n?void 0:n.data[t])})).map((function(t){var n,r,i,a;return l.createElement("div",{key:null===(r=null===(n=e.theme)||void 0===n?void 0:n.data[t])||void 0===r?void 0:r.fileId,className:"".concat(JO.a[t]," ").concat(JO.a.background),style:{backgroundImage:"url('".concat(ku.createUrl(null===(a=null===(i=e.theme)||void 0===i?void 0:i.data[t])||void 0===a?void 0:a.url,{format:"png"}),"')")}})}))}())}function WO(e){var t,n,r,i,a,o=ci(),c=e.themes.find((function(e){var t;return e.name===(null===(t=o.values.glance)||void 0===t?void 0:t.theme)})),s=(null===(t=o.values.glance)||void 0===t?void 0:t.format)===NO.Markdown&&(null===(n=o.values.glance)||void 0===n?void 0:n.content)&&c;return l.createElement("div",{className:"form-group p-2 border"},l.createElement("div",{className:"border-bottom mb-2"},l.createElement("label",null,"Video at a Glance")),l.createElement(Bc,{as:"select",label:"Theme",name:"glance.theme",id:"glance.theme",value:null===(r=o.values.glance)||void 0===r?void 0:r.theme},l.createElement("option",{value:null},"Select a theme..."),e.themes.map((function(e){return l.createElement("option",{key:e.id,value:e.name},e.name)}))),l.createElement(Bc,{as:"select",label:"Format",name:"glance.format",id:"glance.format",value:null===(i=o.values.glance)||void 0===i?void 0:i.format},l.createElement("option",{value:null},"Select a format..."),Ci.a.getEnumKeys(NO).map((function(e){return l.createElement("option",{key:e,value:NO[e]},e)}))),l.createElement(Bc,{label:"Content",as:"textarea",name:"glance.content",id:"glance.content",value:null===(a=o.values.glance)||void 0===a?void 0:a.content}),s&&l.createElement("div",{className:"form-group"},l.createElement("label",null,"Preview"),l.createElement(GO,{theme:c,video:{glance:o.values.glance,tags:e.tags},hasGlanceData:!0})))}function ZO(e){switch(e){case xO.Published:return"badge-success";case xO.Archived:return"badge-danger";case xO.Draft:return"badge-warning";case xO.Pending:return"badge-info";case xO.Rejected:return"badge-dark";default:return"badge-secondary"}}function QO(e){var t=ci(),n=!!e.rightslineId,r=Tp(e.currentUser);return l.createElement(vi,null,n&&l.createElement(Bc,{label:"Rightsline ID",name:"rightslineId",id:"rightslineId",value:e.rightslineId,disabled:!0}),l.createElement(Bc,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this video",disabled:n,autoFocus:!0}),l.createElement("div",{className:"form-group"},l.createElement("label",null,"Status"),l.createElement("div",null,l.createElement("span",{className:"badge ".concat(ZO(t.values.status))},xO[t.values.status]))),l.createElement(Bc,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this video here",disabled:n,showCharacterCounter:!0}),l.createElement(Bc,{label:"Production Year",type:"number",name:"productionYear",id:"productionYear",value:t.values.productionYear,disabled:n}),l.createElement(yl,{ratings:e.ratings,disabled:n}),l.createElement(Qu,{imageType:hu.Thumbnails,fieldName:"thumbnail",application:c.VIDEOS,uploadAction:i.Videos.UPLOAD_IMAGE}),l.createElement(Qu,{imageType:hu.HeroBanners,fieldName:"heroBanner",application:c.VIDEOS,uploadAction:i.Videos.UPLOAD_IMAGE}),r&&l.createElement(WO,{themes:e.themes,tags:e.tags}),l.createElement(us,{isNew:!e.id}))}function XO(e,t){if(e)return t?Object.assign(Object.assign({},e),t):e}function eC(e){var t;return l.createElement(wi,{initialValues:XO(e.video,e.rightslineVideo),validationSchema:RO,onSubmit:e.saveVideo,allowInitialSubmit:!!e.rightslineVideo},l.createElement(QO,{id:e.video&&e.video.id,ratings:e.ratings,themes:e.themes,tags:null===(t=e.video)||void 0===t?void 0:t.tags,currentUser:e.currentUser,rightslineId:e.rightslineId}))}function tC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nC(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rC(e){var t,n=Object(v.useDispatch)(),r=tC(l.useState(!1),2),a=r[0],o=r[1],s=oe.useBasicFetch(_b(e.videoId)),u=oe.useBasicFetch(xb(e.videoId)),f=oe.useBasicFetch(pE()),p=oe.useBasicFetch(tO(ZE.Glance)),d=oe.useBasicFetch(mp());var m,h=!!s.data&&!!f.data&&!!p.data&&!!d.data&&u.isComplete;return l.createElement(l.Fragment,null,!!d.data&&l.createElement(PO,{videoId:e.videoId,activeAction:i.Videos.EDIT_VIDEO,currentUser:d.data}),!!u.data&&l.createElement("div",{className:"pt-3 text-right"},l.createElement(ki.Button,{variant:"outline-dark",size:"sm",onClick:function(){u.isFetching||(o(!0),oe.fetch(n,xb(e.videoId)))}},"Sync from Rightsline")),h&&l.createElement(eC,{video:s.data,saveVideo:function(t,r){oe.fetch(n,Nb(e.videoId,t,null,null,r))},ratings:f.data,themes:p.data,currentUser:d.data,rightslineId:null===(t=u.data)||void 0===t?void 0:t.rightslineId,rightslineVideo:a&&u.data}),l.createElement("div",{className:"py-3 text-right"},"Can't find what you're looking for? Try the old edit video page ",l.createElement(lu,{className:"info-link",appLink:(m=e.videoId,{application:c.VIDEOS,action:i.Videos.LEGACY_EDIT_VIDEO,args:[m]})},"here"),"."))}function iC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return aC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aC(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function aC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oC(e){var t=iC(l.useState({}),2),n=t[0],r=t[1],a=oe.useBasicFetch(_b(e.videoId)),o=oe.useBasicFetch(mp()),c=zf(u.SUBJECT);!function(e,t,n){var r=function(e){return hh(n,e)};mh(Zy.getObjectLevelsFetchOptions(e,jh.Videos,r("videoLevels")),[e]),mh(Zy.getObjectAudiencesFetchOptions(e,jh.Videos,r("videoAudiences")),[e,t.videoLevels]),uh([Zy.getPresentationsFetchOptions(r("presentations")),Zy.getLevelsFetchOptions(r("levels"))],[]),mh(!!t.currentPresentation&&Zy.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.videoId,n,r),db(n,r);var s=!!(n.presentations&&n.levels&&n.presentationAudiences&&n.videoLevels&&n.videoAudiences);return l.createElement(l.Fragment,null,!!o.data&&l.createElement(PO,{videoId:e.videoId,activeAction:i.Videos.EDIT_VIDEO_AUDIENCES,currentUser:o.data}),l.createElement(pl,{object:a.data}),!!s&&l.createElement(ov,{objectLevels:n.videoLevels,objectAudiences:n.videoAudiences,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:hh(r,"currentPresentation"),levels:n.levels,presentationAudiences:n.presentationAudiences,memberType:jh.Videos,saveLevels:function(t,n,r){return c.updateObjectLevels(e.videoId,t,jh.Videos,n,r,r)},saveAudiences:function(t,r){return c.updateObjectAudiences(e.videoId,n.currentPresentation.id,t,jh.Videos,r,r)}}))}function cC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||uC(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sC(e){return function(e){if(Array.isArray(e))return lC(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||uC(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uC(e,t){if(e){if("string"==typeof e)return lC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lC(e,t):void 0}}function lC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fC(e){var t=cC(l.useState({}),2),n=t[0],r=t[1],a=oe.useBasicFetch(_b(e.videoId)),o=oe.useBasicFetch(mp()),c=zf(u.SUBJECT);!function(e,t,n){var r=function(e){return hh(n,e)};uh([Zy.getSubjectTreeFetchOptions(r("subjectTree")),Zy.getPresentationsFetchOptions(r("presentations"))],[]),mh(Zy.getObjectSubjectsFetchOptions(e,jh.Videos,r("videoSubjects")),[e]),mh(!!t.currentPresentation&&Zy.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),l.useEffect((function(){return r("subjectClassifications")([])}),[t.videoSubjects]);var i=function(e,t){return[].concat(sC(t.subjectClassifications||[]),sC(e))},a=t.videoSubjects&&t.videoSubjects.map((function(e){return Zy.getSubjectClassificationFetchOptions(e.id,hh(n,"subjectClassifications",i))}));uh(a,[t.videoSubjects],!!a),mh(Zy.getObjectClassificationsFetchOptions(e,jh.Videos,r("videoClassifications")),[e,t.videoSubjects])}(e.videoId,n,r),db(n,r);var s=!!(n.videoSubjects&&n.subjectTree&&n.presentations&&n.classificationTree&&n.videoClassifications&&n.subjectClassifications);return l.createElement(l.Fragment,null,!!o.data&&l.createElement(PO,{videoId:e.videoId,activeAction:i.Videos.EDIT_VIDEO_SUBJECTS,currentUser:o.data}),l.createElement(pl,{object:a.data}),s&&l.createElement(Kv,{objectSubjects:n.videoSubjects,subjectTree:n.subjectTree,memberType:jh.Videos,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:hh(r,"currentPresentation"),objectClassifications:n.videoClassifications,objectSubjectClassifications:n.subjectClassifications,classificationTree:n.classificationTree,saveSubjects:function(t,n,r){return c.updateObjectSubjects(e.videoId,t,jh.Videos,n,r,r)},saveClassifications:function(t,r){return c.updateObjectClassifications(e.videoId,n.currentPresentation.id,t,jh.Videos,r,r)}}))}!function(e){e.Maths="maths",e.English="english",e.History="history"}(YO||(YO={}));var pC=function(e){return{key:"aliases:".concat(e),url:"/api/master/v2/objects/".concat(e,"/aliases")}},dC=function(e,t,n,r){return{key:"create:alias",url:"/api/master/v2/objects/".concat(e,"/aliases"),type:ce.a.POST,invalidationKeys:"aliases:".concat(e),data:t,success:n,error:r}},mC=function(e,t,n,r){return{key:"delete:alias",url:"/api/domain/v2/objects/".concat(e,"/aliases/").concat(t),type:ce.a.DELETE,invalidationKeys:"aliases:".concat(e),success:n,error:r}};function hC(e){var t=Object(v.useDispatch)(),n=ep(),r=oe.useBasicFetch(pC(e.videoId)),a=oe.useBasicFetch(mp());return r.data?l.createElement(l.Fragment,null,!!a.data&&l.createElement(PO,{videoId:e.videoId,activeAction:i.Videos.EDIT_VIDEO_ALIASES,currentUser:a.data}),l.createElement(ff,{aliases:r.data.data,onSave:function(r,i){oe.fetch(t,dC(e.videoId,r,(function(){n.success("Successfully created alias"),i()}),(function(){n.error("Something went wrong creating your alias")})))},onDelete:function(r){oe.fetch(t,mC(e.videoId,r,(function(){n.success("Successfully deleted alias")}),(function(){n.error("Something went wrong deleting your alias")})))}})):l.createElement(l.Fragment,null,"Loading...")}function yC(e){return(yC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gC(e,t,n){return t&&bC(e.prototype,t),n&&bC(e,n),e}function SC(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&EC(e,t)}function EC(e,t){return(EC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function OC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=AC(e);if(t){var i=AC(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return CC(this,n)}}function CC(e,t){return!t||"object"!==yC(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function AC(e){return(AC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var wC,jC,IC=function(e){SC(n,e);var t=OC(n);function n(){return vC(this,n),t.apply(this,arguments)}return gC(n,[{key:"channelName",get:function(){return c.VIDEOS}},{key:"appRoutes",get:function(){return{"manage/videos/:id(/)":"editVideo","manage/videos/:id/audiences(/)":"editVideoAudiences","manage/videos/:id/classifications(/)":"editVideoSubjects","manage/videos/:id/aliases(/)":"editVideoAliases","tools/programlookup/:id":"legacyEditVideo"}}},{key:"appLinks",get:function(){return["uploadImage"]}}]),n}(p.AppRouter),kC=function(e){SC(n,e);var t=OC(n);function n(){return vC(this,n),t.apply(this,arguments)}return gC(n,[{key:"initialize",value:function(){var e=this;Ci.a.values(u).forEach((function(t){return Bf.getInstance(t,e)}))}},{key:"name",get:function(){return"Videos Application"}},{key:"channelName",get:function(){return c.VIDEOS}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT,options:{provider:LO,alertRegion:L}}}},{key:"editVideo",value:function(e){this.layout.showChildView(k,l.createElement(rC,{videoId:e}))}},{key:"editVideoAudiences",value:function(e){this.layout.showChildView(k,l.createElement(oC,{videoId:e}))}},{key:"editVideoSubjects",value:function(e){this.layout.showChildView(k,l.createElement(fC,{videoId:e}))}},{key:"editVideoAliases",value:function(e){this.layout.showChildView(k,l.createElement(hC,{videoId:e}))}},{key:"legacyEditVideo",value:function(e){p.LocationUtils.Redirect("/tools/programlookup/".concat(e))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(T,l.createElement(Nm,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}}],[{key:"router",get:function(){return IC}}]),n}(Nf);function TC(e){return(TC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function LC(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_C(e,t)}function _C(e,t){return(_C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function PC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=NC(e);if(t){var i=NC(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return xC(this,n)}}function xC(e,t){return!t||"object"!==TC(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function NC(e){return(NC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function RC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function MC(e,t,n){return t&&DC(e.prototype,t),n&&DC(e,n),e}!function(e){e.UPDATE="UPDATE_VIEW_MODEL"}(wC||(wC={})),function(e){e.LocalStorage="localStorage",e.SessionStorage="sessionStorage"}(jC||(jC={}));var UC=function(){function e(t){RC(this,e),this.cachePrefix="_cv:",this.expireTime=3600,this.hasSupport=this.hasBrowserSupport(),this.type=t.type,this.hasSupport&&(this.storage=window[this.type])}return MC(e,[{key:"get",value:function(e){if(this.hasSupport){var t=this.storage.getItem(e);try{return JSON.parse(t)}catch(e){return t}}}},{key:"set",value:function(e,t){if(this.hasSupport)try{return this.storage.removeItem(e),"string"!=typeof t?(this.storage.setItem(e,JSON.stringify(t)),!0):(this.storage.setItem(e,t),!0)}catch(e){return!1}}},{key:"remove",value:function(e){if(this.hasSupport)return this.storage.removeItem(e)}},{key:"length",value:function(){if(this.hasSupport)return this.storage.length}},{key:"clear",value:function(){if(this.hasSupport)return this.storage.clear()}},{key:"cacheSet",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.expireTime;this.cacheClean();var r={time:this.getCurrentTime()+1e3*n,data:null!=t&&t};return this.set("".concat(this.cachePrefix).concat(e),r)}},{key:"cacheGet",value:function(e){var t="".concat(this.cachePrefix).concat(e),n=this.get(t);return n?this.isExpired(n)?(this.remove(t),null):n.data:null}},{key:"cacheExists",value:function(e){var t="".concat(this.cachePrefix).concat(e),n=this.get(t);return!!n&&(!this.isExpired(n)||(this.remove(t),!1))}},{key:"cacheRemove",value:function(e){return this.remove("".concat(this.cachePrefix).concat(e))}},{key:"cacheFlush",value:function(){this.cacheClean()}},{key:"cacheClean",value:function(){if(this.hasSupport)for(var e=0;e<this.storage.length;e++){var t=this.storage.key(e);if(0===t.indexOf(this.cachePrefix)){var n=this.get(t);n&&n.time&&this.isExpired(n)&&this.remove(t)}}}},{key:"isExpired",value:function(e){return e.time<this.getCurrentTime()}},{key:"getCurrentTime",value:function(){return(new Date).getTime()}},{key:"hasBrowserSupport",value:function(){try{return this.type in window&&null!==window[this.type]}catch(e){return!1}}}]),e}(),FC=function(e){LC(n,e);var t=PC(n);function n(){return RC(this,n),t.apply(this,arguments)}return MC(n,null,[{key:"Instance",get:function(){return this.instance||(this.instance=new this({type:jC.LocalStorage}))}}]),n}(UC),VC=function(e){LC(n,e);var t=PC(n);function n(){return RC(this,n),t.apply(this,arguments)}return MC(n,null,[{key:"Instance",get:function(){return this.instance||(this.instance=new this({type:jC.SessionStorage}))}}]),n}(UC),BC=FC.Instance,zC=VC.Instance;var HC=function(e,t,n){var r,i=(r=null==n?void 0:n.storage)?r===jC.SessionStorage?zC:BC:null,a=Object(v.useDispatch)(),o=Object(v.useSelector)((function(t){return t.viewModelData[e]})),c=void 0!==t&&void 0===o;if(c)u(t);else if(i&&void 0===o){var s=i.get(e);u("undefined"===s?null:s)}function u(t,n){i&&function(t,n){if(!i)return;var r=i.get(e);if("string"==typeof t&&void 0!==n)return void i.set(e,Object.assign(Object.assign({},r),{dataOrKey:n}));i.set(e,t)}(t,n),a({type:wC.UPDATE,payload:{viewModelKey:e,dataOrKey:t,keyData:n}})}return c?[t,u]:[null!=o?o:void 0,u]},qC="release:notes:config",JC=[{id:"798",name:"Monorepo"},{id:"109",name:"Online"},{id:"822",name:"Lite"},{id:"534",name:"Library Editor"},{id:"62",name:"Curator"}];function $C(e){var t=ci(),n=qc(t),r="798"===t.values.project;return f.a.useEffect((function(){e.getMilestones(t.values.project),r&&e.getBranchNames(t.values.project)}),[t.values.project]),f.a.useEffect((function(){t.setFieldValue("milestone",hp.a.first(e.milestones))}),[e.milestones]),f.a.useEffect((function(){t.setFieldValue("branchName",hp.a.first(e.branchNames))}),[e.branchNames]),f.a.createElement(vi,null,f.a.createElement(Bc,{as:"select",label:"Project",name:"project",id:"project",value:t.values.project},JC.map((function(e){return f.a.createElement("option",{key:e.id,value:e.id},e.name)}))),f.a.createElement(Bc,{as:"select",label:"Milestone",name:"milestone",id:"milestone",value:t.values.milestone,disabled:!e.milestones.length},e.milestones.map((function(e){return f.a.createElement("option",{key:e,value:e},e)}))),r&&f.a.createElement(Bc,{as:"select",label:"Branch Name",name:"branchName",id:"branchName",value:t.values.branchName,disabled:!e.branchNames.length},e.branchNames.map((function(e){return f.a.createElement("option",{key:e,value:e},e)}))),f.a.createElement("div",{className:"d-flex justify-content-between"},f.a.createElement(cf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Generate")))}var KC="U_Jxes3Htv-xiaDX5wfn",YC="https://gitlab.cvinternal.net/api/v4",GC=function(e,t){return{key:"milestones:".concat(e),url:Ou("".concat(YC,"/projects/").concat(e,"/milestones"),{private_token:KC}),normalize:!1,formatData:function(e){return e.map((function(e){return e.title}))},success:t}},WC=function(e,t){return{key:"branch:names:".concat(e),url:Ou("".concat(YC,"/projects/").concat(e,"/repository/branches"),{private_token:KC,per_page:50}),normalize:!1,formatData:function(e){return e.map((function(e){return e.name}))},success:t}},ZC=function(e,t,n,r){return{key:"merge:requests:".concat(e,":").concat(t,":").concat(n),url:Ou("".concat(YC,"/projects/").concat(e,"/merge_requests"),{private_token:KC,milestone:t,state:"merged",per_page:50,page:n}),success:r}},QC=function(e,t,n){return{key:"file:paths:".concat(t,":").concat(e),url:Ou("".concat(YC,"/projects/").concat(e,"/search"),{scope:"blobs",search:t,private_token:KC}),normalize:!1,formatData:function(e){return e.filter((function(e){return e.filename.includes(t)}))},success:n}},XC=function(e,t,n,r){return{key:"file:".concat(e,":").concat(t,":").concat(n),url:Ou("".concat(YC,"/projects/").concat(e,"/repository/files/").concat(encodeURIComponent(t),"/raw"),{ref:n,private_token:KC}),normalize:!1,formatData:function(e){return JSON.parse(e)},success:r}},eA=ji.object().shape({project:ji.string().required("Project is required").default(""),milestone:ji.string().required("Milestone is required").default(""),branchName:ji.string().when("project",(function(e,t){return"798"===e?t.required("Branch name is required"):t})).default("")}).noUnknown();function tA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nA(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rA={project:hp.a.first(JC).id};function iA(){var e=tA(f.a.useState([]),2),t=e[0],n=e[1],r=tA(f.a.useState([]),2),a=r[0],o=r[1],s=tA(HC(qC),2)[1],u=Object(v.useDispatch)();return f.a.createElement(f.a.Fragment,null,f.a.createElement("h4",{className:"py-2"},"Generate Release Notes"),f.a.createElement(wi,{initialValues:rA,onSubmit:function(e){s(e),p.AppLinkHelper.trigger({application:c.RELEASE_NOTES,action:i.ReleaseNotes.GENERATOR})},validationSchema:eA},f.a.createElement($C,{getMilestones:function(e){n([]),oe.fetch(u,GC(e,n))},milestones:t,getBranchNames:function(e){o([]),oe.fetch(u,WC(e,o))},branchNames:a})))}var aA=n(218),oA=/#*/;function cA(e){return e=e.replace("-"," "),e="## "+(e=(e=Sl(e)).replace(oA,"").trim())}function sA(e){var t=e.toLowerCase();return"## notes"===t||"## dependencies"===t}function uA(e){return e=e.replace("-"," "),e=Sl(e)}function lA(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return fA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fA(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){c=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(c)throw a}}}}function fA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var pA=["# online","# curator","# library editor","# lite","# styles","# tooling","# analytics","# common","# shared","# player"];function dA(e){for(var t={name:"",changes:""},n=0;t.name||n<e.length;n++){var r=e[n];if(!r)break;if("#"===r){var i=e.indexOf("\n",n),a=e.slice(n,i);pA.includes(a.toLowerCase().trim())&&(t.name=Sl(a.replace("#","").trim()),e=e.slice(i),n=-1)}}for(var o=0;!t.changes&&o<e.length;o++){if(o+1===e.length){t.changes=e,e="";break}if("#"===e[o]&&"#"!==e[o+1]){var c=e.indexOf("\n",o),s=e.slice(o,c);pA.includes(s.toLowerCase().trim())&&(t.changes=e.slice(0,o),e=e.slice(o),o=-1)}}return{section:t,remainingDescription:e}}function mA(e){var t,n={},r=lA(e);try{for(r.s();!(t=r.n()).done;)for(var i=t.value;i;){var a=dA(i),o=a.section;if(i=a.remainingDescription,!o.name)break;n[o.name]||(n[o.name]=[]),n[o.name].push(o.changes)}}catch(e){r.e(e)}finally{r.f()}var c={};return Object.keys(n).forEach((function(e){var t,r;c[e]=(t=n[e],r={},t.forEach((function(e){for(var t=e.split("");t&&t.length;){for(var n=0;n<t.length&&t.length!==n+1;n++)if("#"===t[n]&&"#"===t[n+1]){var i=t.indexOf("\n",n),a=uA(t.slice(n,i).join(""));r[a]||(r[a]="");for(var o=i;o<t.length;o++){if(t.length===o+1){var c=t.slice(i+1).join("");r[a]+=c,t=[];break}if("#"===t[o]&&"#"===t[o+1]){var s=t.slice(i+1,o).join("");if(!s.length){t=t.slice(o),n=-1;break}r[a]+=s,t=t.slice(o),n=-1;break}}r[a]+="\n"}break}})),Object.keys(r).reduce((function(e,t){return e+=t+"\n",e+=r[t]+"\n"}),""))})),Object.keys(c).reduce((function(e,t){return e+="\n",e+="\n# ".concat(t),e+="\n".concat(c[t])}),"")}var hA=n(219),yA=n.n(hA);function vA(e){return function(e){if(Array.isArray(e))return SA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||gA(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||gA(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gA(e,t){if(e){if("string"==typeof e)return SA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?SA(e,t):void 0}}function SA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function EA(){var e=bA(f.a.useState(!0),2),t=e[0],n=e[1],r=bA(f.a.useState(1),2),a=r[0],o=r[1],s=bA(f.a.useState([]),2),u=s[0],l=s[1],d=bA(f.a.useState([]),2),m=d[0],h=d[1],y=bA(f.a.useState(!0),2),b=y[0],g=y[1],S=bA(f.a.useState(""),2),E=S[0],O=S[1],C=bA(f.a.useState("Copy"),2),A=C[0],w=C[1],j=bA(HC(qC),1)[0],I=j&&"798"===j.project,k=Object(v.useDispatch)();return f.a.useEffect((function(){if(j){var e=j.project,t=j.milestone;oe.fetch(k,ZC(e,t,a,(function(e){l([].concat(vA(u),vA(e))),50===e.length?o(a+1):n(!1)})))}}),[a]),f.a.useEffect((function(){if(!(t||I&&b)){var e=u.map((function(e){return e.description.replace("\r\n","\n").replace("\r","")})),n=I?function(e,t){var n=function(e){var t="# Final Package Versions\n\n| Package | Version |\n| ------------------------- | ------------------------ |\n| @clickview/analytics | <analytics-version> |\n| @clickview/styles | <styles-version> |\n| @clickview/tooling | <tooling-version> |\n| @clickview/curator | <curator-version> |\n| @clickview/library-editor | <library-editor-version> |\n| @clickview/lite | <lite-version> |\n| @clickview/online | <online-version> |\n| @clickview/player | <player-version> |\n";return e.forEach((function(e){var n=e.name,r=e.version;r&&(t=t.replace("<".concat(n.replace("@clickview/",""),"-version>"),r))})),t}(t),r=mA(e);return"".concat(n,"\n").concat(r)}(e,m):function(e){var t={};return e.forEach((function(e){for(var n=e.split("");;){var r=!1;if(!n||!n.length)break;for(var i=0;i<n.length&&n.length!==i+1;i++)if("#"===n[i]){var a=n.indexOf("\n",i),o=cA(n.slice(i,a).join(""));t[o]||(sA(o)?r=!0:t[o]="");for(var c=a;c<n.length;c++){if(n.length===c+1){if(r){r=!1,n=[];break}var s=n.slice(a+1).join("");t[o]+=s,n=[];break}if("#"===n[c]){if(r){r=!1,n=n.slice(c),i=-1;break}var u=n.slice(a+1,c).join("");if(!u.length){n=n.slice(c),i=-1;break}t[o]+=u,n=n.slice(c),i=-1;break}}t[o]?t[o]+="\n":delete t[o]}break}})),Object.keys(t).reduce((function(e,n){return t[n]?(e+=n+"\n",e+=t[n]+"\n"):e}),"")}(e);O(n)}}),[t,b]),f.a.useEffect((function(){if(j&&I){var e=[];oe.fetch(k,QC(j.project,"package.json",(function(t){var n,r=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=gA(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){c=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(c)throw a}}}}(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;oe.fetch(k,XC(j.project,i.path,j.branchName,(function(n){e.push(n),e.length===t.length&&(h(e),g(!1))})))}}catch(e){r.e(e)}finally{r.f()}})))}}),[]),j?f.a.createElement(f.a.Fragment,null,E?f.a.createElement("div",{className:"position-relative border rounded p-3"},f.a.createElement(aA,{onCopy:function(){return w("Copied")},text:E},f.a.createElement("button",{className:"btn btn-outline-dark ".concat(yA.a.copyBtn)},A)),f.a.createElement("div",{dangerouslySetInnerHTML:{__html:MO()(E)}})):t?"Fetching merge requests..":"Merging descriptions.."):(p.AppLinkHelper.trigger({application:c.RELEASE_NOTES,action:i.ReleaseNotes.FORM}),f.a.createElement(f.a.Fragment,null))}function OA(e){return(OA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function CA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function wA(e,t,n){return t&&AA(e.prototype,t),n&&AA(e,n),e}function jA(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&IA(e,t)}function IA(e,t){return(IA=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function kA(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=LA(e);if(t){var i=LA(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return TA(this,n)}}function TA(e,t){return!t||"object"!==OA(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function LA(e){return(LA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _A,PA=function(e){jA(n,e);var t=kA(n);function n(){return CA(this,n),t.apply(this,arguments)}return wA(n,[{key:"channelName",get:function(){return c.RELEASE_NOTES}},{key:"appRoutes",get:function(){return{"developer/release-notes(/)":"index","developer/release-notes/generate(/)":"form","developer/release-notes/generator(/)":"generator"}}}]),n}(p.AppRouter),xA=function(e){jA(n,e);var t=kA(n);function n(){return CA(this,n),t.apply(this,arguments)}return wA(n,[{key:"name",get:function(){return"Release Notes Application"}},{key:"channelName",get:function(){return c.RELEASE_NOTES}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT}}},{key:"index",value:function(){p.AppLinkHelper.trigger({application:c.RELEASE_NOTES,action:i.ReleaseNotes.GENERATOR},{replace:!0})}},{key:"form",value:function(){this.layout.showChildView(k,l.createElement(iA,null))}},{key:"generator",value:function(){this.layout.showChildView(k,l.createElement(EA,null))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return eu.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(L,l.createElement(id,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return PA}}]),n}(p.Application);function NA(e){return(NA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function RA(e){return function(e){if(Array.isArray(e))return DA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return DA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DA(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function DA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function MA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function UA(e,t){return(UA=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function FA(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=BA(e);if(t){var i=BA(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return VA(this,n)}}function VA(e,t){return!t||"object"!==NA(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function BA(e){return(BA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Fifo="FifoMemoryCache"}(_A||(_A={}));var zA,HA=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&UA(e,t)}(a,e);var t,n,r,i=FA(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this)).size=e.size,t.cache={},t.cachedkeys=[],t}return t=a,(n=[{key:"name",get:function(){return _A.Fifo}},{key:"removeCacheKey",value:function(e){this.cachedkeys=d.without(this.cachedkeys,e)}},{key:"has",value:function(e){return!!this.cache[e]}},{key:"get",value:function(e){return this.cache[e]}},{key:"set",value:function(e,t){e&&t||Yc.c.throw(new Zc.a("Must provide a cache key and a value to cache in FifoMemoryCache.")),this.has(e)&&this.removeCacheKey(e),this.cachedkeys.push(e),this.cache[e]=t,this.cachedkeys.length>this.size&&delete this.cache[this.cachedkeys.shift()]}},{key:"getOrSet",value:function(e,t){if(this.has(e))return this.get(e);var n=t();return this.set(e,n),n}},{key:"remove",value:function(e){return!!this.has(e)&&(delete this.cache[e],this.removeCacheKey(e),!0)}},{key:"invalidate",value:function(e,t){var n=this,r=d.object(this.cachedkeys,this.cachedkeys),i=[];d.each(e,(function(e){var t;r[e]&&i.push(e);var n=new RegExp(e,"i"),a=d.filter(r,(function(e){return n.test(e)}));(t=i).push.apply(t,RA(a))})),i.length&&(i=d.uniq(i),d.each(i,(function(e){delete n.cache[e],d.isFunction(t)&&t(e)})),this.cachedkeys=d.without.apply(d,[this.cachedkeys].concat(RA(i))))}}])&&MA(t.prototype,n),r&&MA(t,r),a}(Kc.a),qA=n(17);!function(e){e[e.Unknown=0]="Unknown",e[e.BadRequest=1]="BadRequest",e[e.Unauthorized=2]="Unauthorized",e[e.Forbidden=3]="Forbidden",e[e.NotFound=4]="NotFound",e[e.InternalServer=5]="InternalServer"}(zA||(zA={}));var JA,$A={type:zA.Unknown,message:"",code:0};!function(e){e.Ajax="AjaxDataProvider",e.Notifications="NotificationsSignalRDataProvider"}(JA||(JA={}));var KA=function(e,t,n){if(!n||!n.errorCode)return e[t];var r="".concat(n.errorCode);return n.errorSubCode&&(r+=".".concat(n.errorSubCode)),e[r]||e[t]};function YA(e){return(YA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function GA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function WA(e,t){return(WA=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ZA(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=XA(e);if(t){var i=XA(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return QA(this,n)}}function QA(e,t){return!t||"object"!==YA(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function XA(e){return(XA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ew=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&WA(e,t)}(a,e);var t,n,r,i=ZA(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),t=i.call(this,e),$.ajaxSetup({cache:!1,contentType:"application/json; charset=utf-8"}),t.successMiddleware={},t.errorMiddleware={},t.dataServiceErrorMessageMappings=e.dataServiceErrorMessageMappings,t.defaultErrorMessageKey=e.defaultErrorMessageKey,t}return t=a,(n=[{key:"name",get:function(){return JA.Ajax}},{key:"parseUrl",value:function(e){var t=document.createElement("a");return t.href=e,""===t.host&&(t.href=t.href),t}},{key:"makeHttps",value:function(e){var t=this.parseUrl(e);return"http:"===t.protocol&&(t.protocol="https:"),t.href}},{key:"base",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n||(n=ce.a.GET);var i=d.defaults(r,{forceHttps:!1}),a={url:e,method:n,type:n};t&&(a.data=n===ce.a.POST||n===ce.a.PUT?JSON.stringify(t):t),i.forceHttps&&(a.url=this.makeHttps(a.url)),i.traditional&&(a.traditional=i.traditional);var o=$.ajax(a);return d.keys(this.successMiddleware).length&&o.done(d.values(this.successMiddleware)),d.keys(this.errorMiddleware).length&&o.fail(d.values(this.errorMiddleware)),o}},{key:"create",value:function(e,t,n){var r=n.channel,i=n.successEvent,a=n.errorEvent;this.base(e,t,ce.a.POST).done((function(e,t,n){return r.trigger(i,e,t,n)})).fail((function(e,t,n){return r.trigger(a,e,t,n)}))}},{key:"read",value:function(e,t){var n=t.channel,r=t.successEvent,i=t.errorEvent;this.base(e,null,ce.a.GET).done((function(e,t,i){n.trigger(r,e,t,i)})).fail((function(e,t,r){n.trigger(i,e,t,r)}))}},{key:"update",value:function(e,t,n){var r=n.channel,i=n.successEvent,a=n.errorEvent;this.base(e,t,ce.a.PUT).done((function(e,t,n){return r.trigger(i,e,t,n)})).fail((function(e,t,n){return r.trigger(a,e,t,n)}))}},{key:"delete",value:function(e,t){var n=t.channel,r=t.successEvent,i=t.errorEvent;this.base(e,null,ce.a.DELETE).done((function(e,t,i){return n.trigger(r,e,t,i)})).fail((function(e,t,r){return n.trigger(i,e,t,r)}))}},{key:"useMiddleware",value:function(e,t){this.successMiddleware[e]||(this.successMiddleware[e]=t)}},{key:"useErrorMiddleware",value:function(e,t){this.errorMiddleware[e]||(this.errorMiddleware[e]=t)}},{key:"parseError",value:function(e){var t=e.responseJSON,n=$A;switch(n.code=e.status,n.message=KA(this.dataServiceErrorMessageMappings,this.defaultErrorMessageKey,t),e.status){case 400:n.type=zA.BadRequest;break;case 401:n.type=zA.Unauthorized;break;case 403:n.type=zA.Forbidden;break;case 404:n.type=zA.NotFound;break;case 500:n.type=zA.InternalServer}return n}}])&&GA(t.prototype,n),r&&GA(t,r),a}(qA.Object);function tw(e){return(tw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nw(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rw(e,t){return"string"==typeof t.payload.dataOrKey&&void 0!==t.payload.keyData?Object.assign(Object.assign({},e),nw({},t.payload.viewModelKey,Object.assign(Object.assign({},e[t.payload.viewModelKey]),nw({},t.payload.dataOrKey,t.payload.keyData)))):("object"===tw(t.payload.dataOrKey)&&Array.isArray(t.payload.dataOrKey),Object.assign(Object.assign({},e),nw({},t.payload.viewModelKey,t.payload.dataOrKey)))}function iw(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case wC.UPDATE:return rw(e,t)}return e}var aw="LanguageDataService",ow="locale",cw="phrases",sw="language:data:service";function uw(e){return(uw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function lw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function pw(e,t){return(pw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function dw(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=hw(e);if(t){var i=hw(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return mw(this,n)}}function mw(e,t){return!t||"object"!==uw(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function hw(e){return(hw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var yw=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&pw(e,t)}(a,e);var t,n,r,i=dw(a);function a(){return lw(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"name",get:function(){return aw}},{key:"channelName",get:function(){return sw}},{key:"getLanguageConfig",value:function(e){var t={locale:"",phrases:null};this.get({resource:"/api/locale",eventPrefix:ow,expiryTime:Ph.STANDARD,bootstrapName:fp,callback:function(n){t.locale=n,t.phrases&&d.isFunction(e)&&e(t)}}),this.get({resource:"/api/phrases",eventPrefix:cw,expiryTime:Ph.STANDARD,bootstrapName:pp,callback:function(n){t.phrases=n,t.locale&&d.isFunction(e)&&e(t)}})}}])&&fw(t.prototype,n),r&&fw(t,r),a}(Lh);n.d(t,"Layouts",(function(){return o})),n.d(t,"AppChannels",(function(){return c})),n.d(t,"DataChannels",(function(){return s})),n.d(t,"Actions",(function(){return i})),n.d(t,"DataPrefixes",(function(){return a})),n.d(t,"DataServices",(function(){return u})),n.d(t,"CuratorLayoutView",(function(){return z})),n.d(t,"LayoutComponent",(function(){return Y})),n.d(t,"CuratorAppNavService",(function(){return ae})),n.d(t,"CompaniesApplication",(function(){return jf})),n.d(t,"CustomersApplication",(function(){return Gp})),n.d(t,"DomainOptionsApplication",(function(){return $d})),n.d(t,"PeopleApplication",(function(){return Am})),n.d(t,"PlaylistsApplication",(function(){return lE})),n.d(t,"SeriesApplication",(function(){return UE})),n.d(t,"SubjectDataService",(function(){return Gy})),n.d(t,"SubjectDataServiceHelper",(function(){return Zy})),n.d(t,"SubjectsApplication",(function(){return XE})),n.d(t,"ThemesApplication",(function(){return TO})),n.d(t,"VideosApplication",(function(){return kC})),n.d(t,"DomainOptionsApplication",(function(){return $d})),n.d(t,"ReleaseNotesApplication",(function(){return xA})),n.d(t,"Core",(function(){return p})),n.d(t,"InstanceManager",(function(){return Bf})),n.d(t,"FifoMemoryCache",(function(){return HA})),n.d(t,"AjaxDataProvider",(function(){return ew})),n.d(t,"AlertList",(function(){return id})),n.d(t,"AlertType",(function(){return Hf})),n.d(t,"BaseAlertService",(function(){return Xf})),n.d(t,"LanguageService",(function(){return os})),n.d(t,"Flight",(function(){return oe})),n.d(t,"CacheDurations",(function(){return Ph})),n.d(t,"ViewModelReducer",(function(){return iw})),n.d(t,"LanguageDataService",(function(){return yw}))}])}));
17
+ */var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,m=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,b=r?Symbol.for("react.block"):60121,g=r?Symbol.for("react.fundamental"):60117,S=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function O(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case f:case p:case o:case s:case c:case m:return e;default:switch(e=e&&e.$$typeof){case l:case d:case v:case y:case u:return e;default:return t}}case a:return t}}}function C(e){return O(e)===p}t.AsyncMode=f,t.ConcurrentMode=p,t.ContextConsumer=l,t.ContextProvider=u,t.Element=i,t.ForwardRef=d,t.Fragment=o,t.Lazy=v,t.Memo=y,t.Portal=a,t.Profiler=s,t.StrictMode=c,t.Suspense=m,t.isAsyncMode=function(e){return C(e)||O(e)===f},t.isConcurrentMode=C,t.isContextConsumer=function(e){return O(e)===l},t.isContextProvider=function(e){return O(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return O(e)===d},t.isFragment=function(e){return O(e)===o},t.isLazy=function(e){return O(e)===v},t.isMemo=function(e){return O(e)===y},t.isPortal=function(e){return O(e)===a},t.isProfiler=function(e){return O(e)===s},t.isStrictMode=function(e){return O(e)===c},t.isSuspense=function(e){return O(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===p||e===s||e===c||e===m||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===y||e.$$typeof===u||e.$$typeof===l||e.$$typeof===d||e.$$typeof===g||e.$$typeof===S||e.$$typeof===E||e.$$typeof===b)},t.typeOf=O},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),o=f(a),c=f(n(39)),s=f(n(228)),u=f(n(229)),l=n(237);function f(e){return e&&e.__esModule?e:{default:e}}var p=function(){return!0},d=function(e){function t(e){var n=e.alwaysRenderSuggestions;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return m.call(r),r.state={isFocused:!1,isCollapsed:!n,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null},r.justPressedUpDown=!1,r.justMouseEntered=!1,r.pressedSuggestion=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown),document.addEventListener("mouseup",this.onDocumentMouseUp),this.input=this.autowhatever.input,this.suggestionsContainer=this.autowhatever.itemsContainer}},{key:"componentWillReceiveProps",value:function(e){(0,s.default)(e.suggestions,this.props.suggestions)?e.highlightFirstSuggestion&&e.suggestions.length>0&&!1===this.justPressedUpDown&&!1===this.justMouseEntered&&this.highlightFirstSuggestion():this.willRenderSuggestions(e)?this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions():this.resetHighlightedSuggestion()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=n.suggestions,i=n.onSuggestionHighlighted,a=n.highlightFirstSuggestion;if(!(0,s.default)(r,e.suggestions)&&r.length>0&&a)this.highlightFirstSuggestion();else if(i){var o=this.getHighlightedSuggestion();o!=t.highlightedSuggestion&&i({suggestion:o})}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown),document.removeEventListener("mouseup",this.onDocumentMouseUp)}},{key:"updateHighlightedSuggestion",value:function(e,t,n){var r=this;this.setState((function(i){var a=i.valueBeforeUpDown;return null===t?a=null:null===a&&void 0!==n&&(a=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,highlightedSuggestion:null===t?null:r.getSuggestion(e,t),valueBeforeUpDown:a}}))}},{key:"resetHighlightedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState((function(t){var n=t.valueBeforeUpDown;return{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:e?null:n}}))}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,r=n.suggestions,i=n.multiSection,a=n.getSectionSuggestions;return i?a(r[e])[t]:r[t]}},{key:"getHighlightedSuggestion",value:function(){var e=this.state,t=e.highlightedSectionIndex,n=e.highlightedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){return(0,this.props.getSuggestionValue)(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw console.error("Clicked element:",e),new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var r=this.props.inputProps,i=r.value,a=r.onChange;t!==i&&a(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,r=e.shouldRenderSuggestions,i=n.value;return t.length>0&&r(i)}},{key:"getQuery",value:function(){var e=this.props.inputProps.value,t=this.state.valueBeforeUpDown;return(null===t?e:t).trim()}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,i=t.renderInputComponent,a=t.onSuggestionsFetchRequested,c=t.renderSuggestion,s=t.inputProps,f=t.multiSection,d=t.renderSectionTitle,m=t.id,h=t.getSectionSuggestions,y=t.theme,v=t.getSuggestionValue,b=t.alwaysRenderSuggestions,g=t.highlightFirstSuggestion,S=this.state,E=S.isFocused,O=S.isCollapsed,C=S.highlightedSectionIndex,A=S.highlightedSuggestionIndex,w=S.valueBeforeUpDown,j=b?p:this.props.shouldRenderSuggestions,I=s.value,k=s.onFocus,T=s.onKeyDown,L=this.willRenderSuggestions(this.props),_=b||E&&!O&&L,P=_?n:[],x=r({},s,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=j(I);e.setState({isFocused:!0,isCollapsed:!n}),k&&k(t),n&&a({value:I,reason:"input-focused"})}},onBlur:function(t){e.justClickedOnSuggestionsContainer?e.input.focus():(e.blurEvent=t,e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested()))},onChange:function(t){var n=t.target.value,i=j(n);e.maybeCallOnChange(t,n,"type"),e.suggestionsContainer&&(e.suggestionsContainer.scrollTop=0),e.setState(r({},g?{}:{highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null},{valueBeforeUpDown:null,isCollapsed:!i})),i?a({value:n,reason:"input-changed"}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var i=t.keyCode;switch(i){case 40:case 38:if(O)j(I)&&(a({value:I,reason:"suggestions-revealed"}),e.revealSuggestions());else if(n.length>0){var o=r.newHighlightedSectionIndex,c=r.newHighlightedItemIndex,s=void 0;s=null===c?null===w?I:w:e.getSuggestionValueByIndex(o,c),e.updateHighlightedSuggestion(o,c,I),e.maybeCallOnChange(t,s,40===i?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout((function(){e.justPressedUpDown=!1}));break;case 13:if(229===t.keyCode)break;var u=e.getHighlightedSuggestion();if(_&&!b&&e.closeSuggestions(),null!=u){var l=v(u);e.maybeCallOnChange(t,l,"enter"),e.onSuggestionSelected(t,{suggestion:u,suggestionValue:l,suggestionIndex:A,sectionIndex:C,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout((function(){e.justSelectedSuggestion=!1}))}break;case 27:_&&t.preventDefault();var f=_&&!b;if(null===w){if(!f){e.maybeCallOnChange(t,"","escape"),j("")?a({value:"",reason:"escape-pressed"}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,w,"escape");f?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}T&&T(t)}}),N={query:this.getQuery()};return o.default.createElement(u.default,{multiSection:f,items:P,renderInputComponent:i,renderItemsContainer:this.renderSuggestionsContainer,renderItem:c,renderItemData:N,renderSectionTitle:d,getSectionItems:h,highlightedSectionIndex:C,highlightedItemIndex:A,inputProps:x,itemProps:this.itemProps,theme:(0,l.mapToAutowhateverTheme)(y),id:m,ref:this.storeAutowhateverRef})}}]),t}(a.Component);d.propTypes={suggestions:c.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){var n=e[t];if("function"!=typeof n)throw new Error("'onSuggestionsFetchRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsFetchRequestedProp")},onSuggestionsClearRequested:function(e,t){var n=e[t];if(!1===e.alwaysRenderSuggestions&&"function"!=typeof n)throw new Error("'onSuggestionsClearRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsClearRequestedProp")},onSuggestionSelected:c.default.func,onSuggestionHighlighted:c.default.func,renderInputComponent:c.default.func,renderSuggestionsContainer:c.default.func,getSuggestionValue:c.default.func.isRequired,renderSuggestion:c.default.func.isRequired,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'.")},shouldRenderSuggestions:c.default.func,alwaysRenderSuggestions:c.default.bool,multiSection:c.default.bool,renderSectionTitle:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'renderSectionTitle' must be implemented. See: https://github.com/moroshko/react-autosuggest#renderSectionTitleProp")},getSectionSuggestions:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'getSectionSuggestions' must be implemented. See: https://github.com/moroshko/react-autosuggest#getSectionSuggestionsProp")},focusInputOnSuggestionClick:c.default.bool,highlightFirstSuggestion:c.default.bool,theme:c.default.object,id:c.default.string},d.defaultProps={renderSuggestionsContainer:function(e){var t=e.containerProps,n=e.children;return o.default.createElement("div",t,n)},shouldRenderSuggestions:function(e){return e.trim().length>0},alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:l.defaultTheme,id:"1"};var m=function(){var e=this;this.onDocumentMouseDown=function(t){e.justClickedOnSuggestionsContainer=!1;for(var n=t.detail&&t.detail.target||t.target;null!==n&&n!==document;){if(null!==n.getAttribute("data-suggestion-index"))return;if(n===e.suggestionsContainer)return void(e.justClickedOnSuggestionsContainer=!0);n=n.parentNode}},this.storeAutowhateverRef=function(t){null!==t&&(e.autowhatever=t)},this.onSuggestionMouseEnter=function(t,n){var r=n.sectionIndex,i=n.itemIndex;e.updateHighlightedSuggestion(r,i),t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!0),e.justMouseEntered=!0,setTimeout((function(){e.justMouseEntered=!1}))},this.highlightFirstSuggestion=function(){e.updateHighlightedSuggestion(e.props.multiSection?0:null,0)},this.onDocumentMouseUp=function(){e.pressedSuggestion&&!e.justSelectedSuggestion&&e.input.focus(),e.pressedSuggestion=null},this.onSuggestionMouseDown=function(t){e.justSelectedSuggestion||(e.justSelectedSuggestion=!0,e.pressedSuggestion=t.target)},this.onSuggestionsClearRequested=function(){var t=e.props.onSuggestionsClearRequested;t&&t()},this.onSuggestionSelected=function(t,n){var r=e.props,i=r.alwaysRenderSuggestions,a=r.onSuggestionSelected,o=r.onSuggestionsFetchRequested;a&&a(t,n),i?o({value:n.suggestionValue,reason:"suggestion-selected"}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,r=n.alwaysRenderSuggestions,i=n.focusInputOnSuggestionClick,a=e.getSuggestionIndices(e.findSuggestionElement(t.target)),o=a.sectionIndex,c=a.suggestionIndex,s=e.getSuggestion(o,c),u=e.props.getSuggestionValue(s);e.maybeCallOnChange(t,u,"click"),e.onSuggestionSelected(t,{suggestion:s,suggestionValue:u,suggestionIndex:c,sectionIndex:o,method:"click"}),r||e.closeSuggestions(),!0===i?e.input.focus():e.onBlur(),setTimeout((function(){e.justSelectedSuggestion=!1}))},this.onBlur=function(){var t=e.props,n=t.inputProps,r=t.shouldRenderSuggestions,i=n.value,a=n.onBlur,o=e.getHighlightedSuggestion(),c=r(i);e.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!c}),a&&a(e.blurEvent,{highlightedSuggestion:o})},this.onSuggestionMouseLeave=function(t){e.resetHighlightedSuggestion(!1),e.justSelectedSuggestion&&t.target===e.pressedSuggestion&&(e.justSelectedSuggestion=!1)},this.onSuggestionTouchStart=function(){e.justSelectedSuggestion=!0},this.onSuggestionTouchMove=function(){e.justSelectedSuggestion=!1,e.pressedSuggestion=null,e.input.focus()},this.itemProps=function(t){return{"data-section-index":t.sectionIndex,"data-suggestion-index":t.itemIndex,onMouseEnter:e.onSuggestionMouseEnter,onMouseLeave:e.onSuggestionMouseLeave,onMouseDown:e.onSuggestionMouseDown,onTouchStart:e.onSuggestionTouchStart,onTouchMove:e.onSuggestionTouchMove,onClick:e.onSuggestionClick}},this.renderSuggestionsContainer=function(t){var n=t.containerProps,r=t.children;return(0,e.props.renderSuggestionsContainer)({containerProps:n,children:r,query:e.getQuery()})}};t.default=d},function(e,t,n){"use strict";var r=n(227);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}},function(e,t,n){"use strict";e.exports=n(230).default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0),c=d(o),s=d(n(39)),u=d(n(231)),l=d(n(232)),f=d(n(234)),p=d(n(235));function d(e){return e&&e.__esModule?e:{default:e}}var m={},h=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.storeInputReference=function(e){null!==e&&(n.input=e)},n.storeItemsContainerReference=function(e){null!==e&&(n.itemsContainer=e)},n.onHighlightedItemChange=function(e){n.highlightedItem=e},n.getItemId=function(e,t){return null===t?null:"react-autowhatever-"+n.props.id+"-"+(null===e?"":"section-"+e)+"-item-"+t},n.onFocus=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!0}),t.onFocus&&t.onFocus(e)},n.onBlur=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!1}),t.onBlur&&t.onBlur(e)},n.onKeyDown=function(e){var t=n.props,r=t.inputProps,a=t.highlightedSectionIndex,o=t.highlightedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var c="ArrowDown"===e.key?"next":"prev",s=n.sectionIterator[c]([a,o]),u=i(s,2),l=u[0],f=u[1];r.onKeyDown(e,{newHighlightedSectionIndex:l,newHighlightedItemIndex:f});break;default:r.onKeyDown(e,{highlightedSectionIndex:a,highlightedItemIndex:o})}},n.highlightedItem=null,n.state={isInputFocused:!1},n.setSectionsItems(e),n.setSectionIterator(e),n.setTheme(e),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"componentDidMount",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.items!==this.props.items&&this.setSectionsItems(e),e.items===this.props.items&&e.multiSection===this.props.multiSection||this.setSectionIterator(e),e.theme!==this.props.theme&&this.setTheme(e)}},{key:"componentDidUpdate",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"setSectionsItems",value:function(e){e.multiSection&&(this.sectionsItems=e.items.map((function(t){return e.getSectionItems(t)})),this.sectionsLengths=this.sectionsItems.map((function(e){return e.length})),this.allSectionsAreEmpty=this.sectionsLengths.every((function(e){return 0===e})))}},{key:"setSectionIterator",value:function(e){this.sectionIterator=(0,u.default)({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,l.default)(e.theme)}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,r=n.id,i=n.items,a=n.renderItem,o=n.renderItemData,s=n.renderSectionTitle,u=n.highlightedSectionIndex,l=n.highlightedItemIndex,d=n.itemProps;return i.map((function(n,i){var m="react-autowhatever-"+r+"-",h=m+"section-"+i+"-",y=0===i;return c.default.createElement("div",t(h+"container","sectionContainer",y&&"sectionContainerFirst"),c.default.createElement(f.default,{section:n,renderSectionTitle:s,theme:t,sectionKeyPrefix:h}),c.default.createElement(p.default,{items:e.sectionsItems[i],itemProps:d,renderItem:a,renderItemData:o,sectionIndex:i,highlightedItemIndex:u===i?l:null,onHighlightedItemChange:e.onHighlightedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:m,ref:e.storeItemsListReference}))}))}},{key:"renderItems",value:function(){var e=this.props.items;if(0===e.length)return null;var t=this.theme,n=this.props,r=n.id,i=n.renderItem,a=n.renderItemData,o=n.highlightedSectionIndex,s=n.highlightedItemIndex,u=n.itemProps;return c.default.createElement(p.default,{items:e,itemProps:u,renderItem:i,renderItemData:a,highlightedItemIndex:null===o?s:null,onHighlightedItemChange:this.onHighlightedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-"+r+"-"})}},{key:"ensureHighlightedItemIsVisible",value:function(){var e=this.highlightedItem;if(e){var t=this.itemsContainer,n=e.offsetParent===t?e.offsetTop:e.offsetTop-t.offsetTop,r=t.scrollTop;n<r?r=n:n+e.offsetHeight>r+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,i=t.multiSection,a=t.renderInputComponent,o=t.renderItemsContainer,s=t.highlightedSectionIndex,u=t.highlightedItemIndex,l=this.state.isInputFocused,f=i?this.renderSections():this.renderItems(),p=null!==f,d=this.getItemId(s,u),m="react-autowhatever-"+n,h=r({role:"combobox","aria-haspopup":"listbox","aria-owns":m,"aria-expanded":p},e("react-autowhatever-"+n+"-container","container",p&&"containerOpen"),this.props.containerProps),y=a(r({type:"text",value:"",autoComplete:"off","aria-autocomplete":"list","aria-controls":m,"aria-activedescendant":d},e("react-autowhatever-"+n+"-input","input",p&&"inputOpen",l&&"inputFocused"),this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),v=o({containerProps:r({id:m,role:"listbox"},e("react-autowhatever-"+n+"-items-container","itemsContainer",p&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:f});return c.default.createElement("div",h,y,v)}}]),t}(o.Component);h.propTypes={id:s.default.string,multiSection:s.default.bool,renderInputComponent:s.default.func,renderItemsContainer:s.default.func,items:s.default.array.isRequired,renderItem:s.default.func,renderItemData:s.default.object,renderSectionTitle:s.default.func,getSectionItems:s.default.func,containerProps:s.default.object,inputProps:s.default.object,itemProps:s.default.oneOfType([s.default.object,s.default.func]),highlightedSectionIndex:s.default.number,highlightedItemIndex:s.default.number,theme:s.default.oneOfType([s.default.object,s.default.array])},h.defaultProps={id:"1",multiSection:!1,renderInputComponent:function(e){return c.default.createElement("input",e)},renderItemsContainer:function(e){var t=e.containerProps,n=e.children;return c.default.createElement("div",t,n)},renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:m,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},containerProps:m,inputProps:m,itemProps:m,highlightedSectionIndex:null,highlightedItemIndex:null,theme:{container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",inputOpen:"react-autowhatever__input--open",inputFocused:"react-autowhatever__input--focused",itemsContainer:"react-autowhatever__items-container",itemsContainerOpen:"react-autowhatever__items-container--open",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemFirst:"react-autowhatever__item--first",itemHighlighted:"react-autowhatever__item--highlighted",sectionContainer:"react-autowhatever__section-container",sectionContainerFirst:"react-autowhatever__section-container--first",sectionTitle:"react-autowhatever__section-title"}},t.default=h},function(e,t,n){"use strict";var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};e.exports=function(e){var t=e.data,n=e.multiSection;function i(e){var i=r(e,2),a=i[0],o=i[1];return n?null===o||o===t[a]-1?null===(a=function(e){for(null===e?e=0:e++;e<t.length&&0===t[e];)e++;return e===t.length?null:e}(a))?[null,null]:[a,0]:[a,o+1]:0===t||o===t-1?[null,null]:null===o?[null,0]:[null,o+1]}return{next:i,prev:function(e){var i=r(e,2),a=i[0],o=i[1];return n?null===o||0===o?null===(a=function(e){for(null===e?e=t.length-1:e--;e>=0&&0===t[e];)e--;return-1===e?null:e}(a))?[null,null]:[a,t[a]-1]:[a,o-1]:0===t||0===o?[null,null]:null===o?[null,t-1]:[null,o-1]},isLast:function(e){return null===i(e)[1]}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var a,o=n(233),c=(a=o)&&a.__esModule?a:{default:a},s=function(e){return e};t.default=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=r(t,2),a=n[0],o=n[1];return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var u=n.map((function(e){return a[e]})).filter(s);return"string"==typeof u[0]||"function"==typeof o?{key:e,className:o?o.apply(void 0,i(u)):u.join(" ")}:{key:e,style:c.default.apply(void 0,[{}].concat(i(u)))}}},e.exports=t.default},function(e,t,n){"use strict";var r=Object.prototype.propertyIsEnumerable;function i(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function a(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter((function(t){return r.call(e,t)}))}e.exports=Object.assign||function(e,t){for(var n,r,o=i(e),c=1;c<arguments.length;c++){n=arguments[c],r=a(Object(n));for(var s=0;s<r.length;s++)o[r[s]]=n[r[s]]}return o}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(0),a=s(i),o=s(n(39)),c=s(n(58));function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var f=function(e){function t(){return u(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"shouldComponentUpdate",value:function(e){return(0,c.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,r=e.theme,i=e.sectionKeyPrefix,o=n(t);return o?a.default.createElement("div",r(i+"title","sectionTitle"),o):null}}]),t}(i.Component);f.propTypes={section:o.default.any.isRequired,renderSectionTitle:o.default.func.isRequired,theme:o.default.func.isRequired,sectionKeyPrefix:o.default.string.isRequired},t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),o=l(a),c=l(n(39)),s=l(n(236)),u=l(n(58));function l(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=function(e){function t(){var e,n,r;f(this,t);for(var i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r=p(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.storeHighlightedItemReference=function(e){r.props.onHighlightedItemChange(null===e?null:e.item)},p(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"shouldComponentUpdate",value:function(e){return(0,u.default)(e,this.props,["itemProps"])}},{key:"render",value:function(){var e=this,t=this.props,n=t.items,i=t.itemProps,a=t.renderItem,c=t.renderItemData,u=t.sectionIndex,l=t.highlightedItemIndex,f=t.getItemId,p=t.theme,d=t.keyPrefix,m=null===u?d:d+"section-"+u+"-",h="function"==typeof i;return o.default.createElement("ul",r({role:"listbox"},p(m+"items-list","itemsList")),n.map((function(t,n){var d=0===n,y=n===l,v=m+"item-"+n,b=h?i({sectionIndex:u,itemIndex:n}):i,g=r({id:f(u,n),"aria-selected":y},p(v,"item",d&&"itemFirst",y&&"itemHighlighted"),b);return y&&(g.ref=e.storeHighlightedItemReference),o.default.createElement(s.default,r({},g,{sectionIndex:u,isHighlighted:y,itemIndex:n,item:t,renderItem:a,renderItemData:c}))})))}}]),t}(a.Component);d.propTypes={items:c.default.array.isRequired,itemProps:c.default.oneOfType([c.default.object,c.default.func]),renderItem:c.default.func.isRequired,renderItemData:c.default.object.isRequired,sectionIndex:c.default.number,highlightedItemIndex:c.default.number,onHighlightedItemChange:c.default.func.isRequired,getItemId:c.default.func.isRequired,theme:c.default.func.isRequired,keyPrefix:c.default.string.isRequired},d.defaultProps={sectionIndex:null},t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),o=u(a),c=u(n(39)),s=u(n(58));function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var p=function(e){function t(){var e,n,r;l(this,t);for(var i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r=f(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.storeItemReference=function(e){null!==e&&(r.item=e)},r.onMouseEnter=function(e){var t=r.props,n=t.sectionIndex,i=t.itemIndex;r.props.onMouseEnter(e,{sectionIndex:n,itemIndex:i})},r.onMouseLeave=function(e){var t=r.props,n=t.sectionIndex,i=t.itemIndex;r.props.onMouseLeave(e,{sectionIndex:n,itemIndex:i})},r.onMouseDown=function(e){var t=r.props,n=t.sectionIndex,i=t.itemIndex;r.props.onMouseDown(e,{sectionIndex:n,itemIndex:i})},r.onClick=function(e){var t=r.props,n=t.sectionIndex,i=t.itemIndex;r.props.onClick(e,{sectionIndex:n,itemIndex:i})},f(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"shouldComponentUpdate",value:function(e){return(0,s.default)(e,this.props,["renderItemData"])}},{key:"render",value:function(){var e=this.props,t=e.isHighlighted,n=e.item,i=e.renderItem,a=e.renderItemData,c=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["isHighlighted","item","renderItem","renderItemData"]);return delete c.sectionIndex,delete c.itemIndex,"function"==typeof c.onMouseEnter&&(c.onMouseEnter=this.onMouseEnter),"function"==typeof c.onMouseLeave&&(c.onMouseLeave=this.onMouseLeave),"function"==typeof c.onMouseDown&&(c.onMouseDown=this.onMouseDown),"function"==typeof c.onClick&&(c.onClick=this.onClick),o.default.createElement("li",r({role:"option"},c,{ref:this.storeItemReference}),i(n,r({isHighlighted:t},a)))}}]),t}(a.Component);p.propTypes={sectionIndex:c.default.number,isHighlighted:c.default.bool.isRequired,itemIndex:c.default.number.isRequired,item:c.default.any.isRequired,renderItem:c.default.func.isRequired,renderItemData:c.default.object.isRequired,onMouseEnter:c.default.func,onMouseLeave:c.default.func,onMouseDown:c.default.func,onClick:c.default.func},t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultTheme={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",inputOpen:"react-autosuggest__input--open",inputFocused:"react-autosuggest__input--focused",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsContainerOpen:"react-autosuggest__suggestions-container--open",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFirst:"react-autosuggest__suggestion--first",suggestionHighlighted:"react-autosuggest__suggestion--highlighted",sectionContainer:"react-autosuggest__section-container",sectionContainerFirst:"react-autosuggest__section-container--first",sectionTitle:"react-autosuggest__section-title"},t.mapToAutowhateverTheme=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestionsContainerOpen":t.itemsContainerOpen=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFirst":t.itemFirst=e[n];break;case"suggestionHighlighted":t.itemHighlighted=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t}},function(e,t,n){"use strict";t.__esModule=!0;var r=function(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}(n(239));var i=r.tokenize,a=r.options.Options;function o(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function c(e){return e.replace(/"/g,"&quot;")}function s(e){if(!e)return"";var t=[];for(var n in e){var r=e[n]+"";t.push(n+'="'+c(r)+'"')}return t.join(" ")}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=new a(t);for(var n=i(e),r=[],u=0;u<n.length;u++){var l=n[u];if("nl"===l.type&&t.nl2br)r.push("<br>\n");else if(l.isLink&&t.check(l)){var f=t.resolve(l),p=f.formatted,d=f.formattedHref,m=f.tagName,h=f.className,y=f.target,v=f.attributes,b="<"+m+' href="'+c(d)+'"';h&&(b+=' class="'+c(h)+'"'),y&&(b+=' target="'+c(y)+'"'),v&&(b+=" "+s(v)),b+=">"+o(p)+"</"+m+">",r.push(b)}else r.push(o(l.toString()))}return r.join("")}if(!String.prototype.linkify)try{Object.defineProperty(String.prototype,"linkify",{set:function(){},get:function(){return function(e){return u(this,e)}}})}catch(e){String.prototype.linkify||(String.prototype.linkify=function(e){return u(this,e)})}t.default=u},function(e,t,n){"use strict";t.__esModule=!0,t.tokenize=t.test=t.scanner=t.parser=t.options=t.inherits=t.find=void 0;var r=n(43),i=c(n(240)),a=c(n(241)),o=c(n(242));function c(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}Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var s=function(e){return o.run(a.run(e))};t.find=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=s(e),r=[],i=0;i<n.length;i++){var a=n[i];!a.isLink||t&&a.type!==t||r.push(a.toObject())}return r},t.inherits=r.inherits,t.options=i,t.parser=o,t.scanner=a,t.test=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=s(e);return 1===n.length&&n[0].isLink&&(!t||n[0].type===t)},t.tokenize=s},function(e,t,n){"use strict";t.__esModule=!0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i={defaultProtocol:"http",events:null,format:o,formatHref:o,nl2br:!1,tagName:"a",target:function(e,t){return"url"===t?"_blank":null},validate:!0,ignoreTags:[],attributes:null,className:"linkified"};function a(e){e=e||{},this.defaultProtocol=e.hasOwnProperty("defaultProtocol")?e.defaultProtocol:i.defaultProtocol,this.events=e.hasOwnProperty("events")?e.events:i.events,this.format=e.hasOwnProperty("format")?e.format:i.format,this.formatHref=e.hasOwnProperty("formatHref")?e.formatHref:i.formatHref,this.nl2br=e.hasOwnProperty("nl2br")?e.nl2br:i.nl2br,this.tagName=e.hasOwnProperty("tagName")?e.tagName:i.tagName,this.target=e.hasOwnProperty("target")?e.target:i.target,this.validate=e.hasOwnProperty("validate")?e.validate:i.validate,this.ignoreTags=[],this.attributes=e.attributes||e.linkAttributes||i.attributes,this.className=e.hasOwnProperty("className")?e.className:e.linkClass||i.className;for(var t=e.hasOwnProperty("ignoreTags")?e.ignoreTags:i.ignoreTags,n=0;n<t.length;n++)this.ignoreTags.push(t[n].toUpperCase())}function o(e){return e}t.defaults=i,t.Options=a,t.contains=function(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return!0;return!1},a.prototype={resolve:function(e){var t=e.toHref(this.defaultProtocol);return{formatted:this.get("format",e.toString(),e),formattedHref:this.get("formatHref",t,e),tagName:this.get("tagName",t,e),className:this.get("className",t,e),target:this.get("target",t,e),events:this.getObject("events",t,e),attributes:this.getObject("attributes",t,e)}},check:function(e){return this.get("validate",e.toString(),e)},get:function(e,t,n){var a=void 0,o=this[e];if(!o)return o;switch(void 0===o?"undefined":r(o)){case"function":return o(t,n.type);case"object":return"function"==typeof(a=o.hasOwnProperty(n.type)?o[n.type]:i[e])?a(t,n.type):a}return o},getObject:function(e,t,n){var r=this[e];return"function"==typeof r?r(t,n.type):r}}},function(e,t,n){"use strict";t.__esModule=!0,t.start=t.run=t.TOKENS=t.State=void 0;var r=n(195),i=n(59),a=function(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}(i);var o="aaa|aarp|abarth|abb|abbott|abbvie|abc|able|abogado|abudhabi|ac|academy|accenture|accountant|accountants|aco|active|actor|ad|adac|ads|adult|ae|aeg|aero|aetna|af|afamilycompany|afl|africa|ag|agakhan|agency|ai|aig|aigo|airbus|airforce|airtel|akdn|al|alfaromeo|alibaba|alipay|allfinanz|allstate|ally|alsace|alstom|am|americanexpress|americanfamily|amex|amfam|amica|amsterdam|analytics|android|anquan|anz|ao|aol|apartments|app|apple|aq|aquarelle|ar|arab|aramco|archi|army|arpa|art|arte|as|asda|asia|associates|at|athleta|attorney|au|auction|audi|audible|audio|auspost|author|auto|autos|avianca|aw|aws|ax|axa|az|azure|ba|baby|baidu|banamex|bananarepublic|band|bank|bar|barcelona|barclaycard|barclays|barefoot|bargains|baseball|basketball|bauhaus|bayern|bb|bbc|bbt|bbva|bcg|bcn|bd|be|beats|beauty|beer|bentley|berlin|best|bestbuy|bet|bf|bg|bh|bharti|bi|bible|bid|bike|bing|bingo|bio|biz|bj|black|blackfriday|blanco|blockbuster|blog|bloomberg|blue|bm|bms|bmw|bn|bnl|bnpparibas|bo|boats|boehringer|bofa|bom|bond|boo|book|booking|boots|bosch|bostik|boston|bot|boutique|box|br|bradesco|bridgestone|broadway|broker|brother|brussels|bs|bt|budapest|bugatti|build|builders|business|buy|buzz|bv|bw|by|bz|bzh|ca|cab|cafe|cal|call|calvinklein|cam|camera|camp|cancerresearch|canon|capetown|capital|capitalone|car|caravan|cards|care|career|careers|cars|cartier|casa|case|caseih|cash|casino|cat|catering|catholic|cba|cbn|cbre|cbs|cc|cd|ceb|center|ceo|cern|cf|cfa|cfd|cg|ch|chanel|channel|chase|chat|cheap|chintai|chloe|christmas|chrome|chrysler|church|ci|cipriani|circle|cisco|citadel|citi|citic|city|cityeats|ck|cl|claims|cleaning|click|clinic|clinique|clothing|cloud|club|clubmed|cm|cn|co|coach|codes|coffee|college|cologne|com|comcast|commbank|community|company|compare|computer|comsec|condos|construction|consulting|contact|contractors|cooking|cookingchannel|cool|coop|corsica|country|coupon|coupons|courses|cr|credit|creditcard|creditunion|cricket|crown|crs|cruise|cruises|csc|cu|cuisinella|cv|cw|cx|cy|cymru|cyou|cz|dabur|dad|dance|data|date|dating|datsun|day|dclk|dds|de|deal|dealer|deals|degree|delivery|dell|deloitte|delta|democrat|dental|dentist|desi|design|dev|dhl|diamonds|diet|digital|direct|directory|discount|discover|dish|diy|dj|dk|dm|dnp|do|docs|doctor|dodge|dog|doha|domains|dot|download|drive|dtv|dubai|duck|dunlop|duns|dupont|durban|dvag|dvr|dz|earth|eat|ec|eco|edeka|edu|education|ee|eg|email|emerck|energy|engineer|engineering|enterprises|epost|epson|equipment|er|ericsson|erni|es|esq|estate|esurance|et|etisalat|eu|eurovision|eus|events|everbank|exchange|expert|exposed|express|extraspace|fage|fail|fairwinds|faith|family|fan|fans|farm|farmers|fashion|fast|fedex|feedback|ferrari|ferrero|fi|fiat|fidelity|fido|film|final|finance|financial|fire|firestone|firmdale|fish|fishing|fit|fitness|fj|fk|flickr|flights|flir|florist|flowers|fly|fm|fo|foo|food|foodnetwork|football|ford|forex|forsale|forum|foundation|fox|fr|free|fresenius|frl|frogans|frontdoor|frontier|ftr|fujitsu|fujixerox|fun|fund|furniture|futbol|fyi|ga|gal|gallery|gallo|gallup|game|games|gap|garden|gb|gbiz|gd|gdn|ge|gea|gent|genting|george|gf|gg|ggee|gh|gi|gift|gifts|gives|giving|gl|glade|glass|gle|global|globo|gm|gmail|gmbh|gmo|gmx|gn|godaddy|gold|goldpoint|golf|goo|goodhands|goodyear|goog|google|gop|got|gov|gp|gq|gr|grainger|graphics|gratis|green|gripe|grocery|group|gs|gt|gu|guardian|gucci|guge|guide|guitars|guru|gw|gy|hair|hamburg|hangout|haus|hbo|hdfc|hdfcbank|health|healthcare|help|helsinki|here|hermes|hgtv|hiphop|hisamitsu|hitachi|hiv|hk|hkt|hm|hn|hockey|holdings|holiday|homedepot|homegoods|homes|homesense|honda|honeywell|horse|hospital|host|hosting|hot|hoteles|hotels|hotmail|house|how|hr|hsbc|ht|htc|hu|hughes|hyatt|hyundai|ibm|icbc|ice|icu|id|ie|ieee|ifm|ikano|il|im|imamat|imdb|immo|immobilien|in|industries|infiniti|info|ing|ink|institute|insurance|insure|int|intel|international|intuit|investments|io|ipiranga|iq|ir|irish|is|iselect|ismaili|ist|istanbul|it|itau|itv|iveco|iwc|jaguar|java|jcb|jcp|je|jeep|jetzt|jewelry|jio|jlc|jll|jm|jmp|jnj|jo|jobs|joburg|jot|joy|jp|jpmorgan|jprs|juegos|juniper|kaufen|kddi|ke|kerryhotels|kerrylogistics|kerryproperties|kfh|kg|kh|ki|kia|kim|kinder|kindle|kitchen|kiwi|km|kn|koeln|komatsu|kosher|kp|kpmg|kpn|kr|krd|kred|kuokgroup|kw|ky|kyoto|kz|la|lacaixa|ladbrokes|lamborghini|lamer|lancaster|lancia|lancome|land|landrover|lanxess|lasalle|lat|latino|latrobe|law|lawyer|lb|lc|lds|lease|leclerc|lefrak|legal|lego|lexus|lgbt|li|liaison|lidl|life|lifeinsurance|lifestyle|lighting|like|lilly|limited|limo|lincoln|linde|link|lipsy|live|living|lixil|lk|loan|loans|locker|locus|loft|lol|london|lotte|lotto|love|lpl|lplfinancial|lr|ls|lt|ltd|ltda|lu|lundbeck|lupin|luxe|luxury|lv|ly|ma|macys|madrid|maif|maison|makeup|man|management|mango|map|market|marketing|markets|marriott|marshalls|maserati|mattel|mba|mc|mckinsey|md|me|med|media|meet|melbourne|meme|memorial|men|menu|meo|merckmsd|metlife|mg|mh|miami|microsoft|mil|mini|mint|mit|mitsubishi|mk|ml|mlb|mls|mm|mma|mn|mo|mobi|mobile|mobily|moda|moe|moi|mom|monash|money|monster|mopar|mormon|mortgage|moscow|moto|motorcycles|mov|movie|movistar|mp|mq|mr|ms|msd|mt|mtn|mtr|mu|museum|mutual|mv|mw|mx|my|mz|na|nab|nadex|nagoya|name|nationwide|natura|navy|nba|nc|ne|nec|net|netbank|netflix|network|neustar|new|newholland|news|next|nextdirect|nexus|nf|nfl|ng|ngo|nhk|ni|nico|nike|nikon|ninja|nissan|nissay|nl|no|nokia|northwesternmutual|norton|now|nowruz|nowtv|np|nr|nra|nrw|ntt|nu|nyc|nz|obi|observer|off|office|okinawa|olayan|olayangroup|oldnavy|ollo|om|omega|one|ong|onl|online|onyourside|ooo|open|oracle|orange|org|organic|origins|osaka|otsuka|ott|ovh|pa|page|panasonic|panerai|paris|pars|partners|parts|party|passagens|pay|pccw|pe|pet|pf|pfizer|pg|ph|pharmacy|phd|philips|phone|photo|photography|photos|physio|piaget|pics|pictet|pictures|pid|pin|ping|pink|pioneer|pizza|pk|pl|place|play|playstation|plumbing|plus|pm|pn|pnc|pohl|poker|politie|porn|post|pr|pramerica|praxi|press|prime|pro|prod|productions|prof|progressive|promo|properties|property|protection|pru|prudential|ps|pt|pub|pw|pwc|py|qa|qpon|quebec|quest|qvc|racing|radio|raid|re|read|realestate|realtor|realty|recipes|red|redstone|redumbrella|rehab|reise|reisen|reit|reliance|ren|rent|rentals|repair|report|republican|rest|restaurant|review|reviews|rexroth|rich|richardli|ricoh|rightathome|ril|rio|rip|rmit|ro|rocher|rocks|rodeo|rogers|room|rs|rsvp|ru|rugby|ruhr|run|rw|rwe|ryukyu|sa|saarland|safe|safety|sakura|sale|salon|samsclub|samsung|sandvik|sandvikcoromant|sanofi|sap|sapo|sarl|sas|save|saxo|sb|sbi|sbs|sc|sca|scb|schaeffler|schmidt|scholarships|school|schule|schwarz|science|scjohnson|scor|scot|sd|se|search|seat|secure|security|seek|select|sener|services|ses|seven|sew|sex|sexy|sfr|sg|sh|shangrila|sharp|shaw|shell|shia|shiksha|shoes|shop|shopping|shouji|show|showtime|shriram|si|silk|sina|singles|site|sj|sk|ski|skin|sky|skype|sl|sling|sm|smart|smile|sn|sncf|so|soccer|social|softbank|software|sohu|solar|solutions|song|sony|soy|space|spiegel|spot|spreadbetting|sr|srl|srt|st|stada|staples|star|starhub|statebank|statefarm|statoil|stc|stcgroup|stockholm|storage|store|stream|studio|study|style|su|sucks|supplies|supply|support|surf|surgery|suzuki|sv|swatch|swiftcover|swiss|sx|sy|sydney|symantec|systems|sz|tab|taipei|talk|taobao|target|tatamotors|tatar|tattoo|tax|taxi|tc|tci|td|tdk|team|tech|technology|tel|telecity|telefonica|temasek|tennis|teva|tf|tg|th|thd|theater|theatre|tiaa|tickets|tienda|tiffany|tips|tires|tirol|tj|tjmaxx|tjx|tk|tkmaxx|tl|tm|tmall|tn|to|today|tokyo|tools|top|toray|toshiba|total|tours|town|toyota|toys|tr|trade|trading|training|travel|travelchannel|travelers|travelersinsurance|trust|trv|tt|tube|tui|tunes|tushu|tv|tvs|tw|tz|ua|ubank|ubs|uconnect|ug|uk|unicom|university|uno|uol|ups|us|uy|uz|va|vacations|vana|vanguard|vc|ve|vegas|ventures|verisign|versicherung|vet|vg|vi|viajes|video|vig|viking|villas|vin|vip|virgin|visa|vision|vista|vistaprint|viva|vivo|vlaanderen|vn|vodka|volkswagen|volvo|vote|voting|voto|voyage|vu|vuelos|wales|walmart|walter|wang|wanggou|warman|watch|watches|weather|weatherchannel|webcam|weber|website|wed|wedding|weibo|weir|wf|whoswho|wien|wiki|williamhill|win|windows|wine|winners|wme|wolterskluwer|woodside|work|works|world|wow|ws|wtc|wtf|xbox|xerox|xfinity|xihuan|xin|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--30rr7y|xn--3bst00m|xn--3ds443g|xn--3e0b707e|xn--3hcrj9c|xn--3oq18vl8pn36a|xn--3pxu8k|xn--42c2d9a|xn--45br5cyl|xn--45brj9c|xn--45q11c|xn--4gbrim|xn--54b7fta0cc|xn--55qw42g|xn--55qx5d|xn--5su34j936bgsg|xn--5tzm5g|xn--6frz82g|xn--6qq986b3xl|xn--80adxhks|xn--80ao21a|xn--80aqecdr1a|xn--80asehdb|xn--80aswg|xn--8y0a063a|xn--90a3ac|xn--90ae|xn--90ais|xn--9dbq2a|xn--9et52u|xn--9krt00a|xn--b4w605ferd|xn--bck1b9a5dre4c|xn--c1avg|xn--c2br7g|xn--cck2b3b|xn--cg4bki|xn--clchc0ea0b2g2a9gcd|xn--czr694b|xn--czrs0t|xn--czru2d|xn--d1acj3b|xn--d1alf|xn--e1a4c|xn--eckvdtc9d|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fhbei|xn--fiq228c5hs|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--fjq720a|xn--flw351e|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--fzys8d69uvgm|xn--g2xx48c|xn--gckr3f0f|xn--gecrj9c|xn--gk3at1e|xn--h2breg3eve|xn--h2brj9c|xn--h2brj9c8c|xn--hxt814e|xn--i1b6b1a6a2e|xn--imr513n|xn--io0a7i|xn--j1aef|xn--j1amh|xn--j6w193g|xn--jlq61u9w7b|xn--jvr189m|xn--kcrx77d1x4a|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--kput3i|xn--l1acc|xn--lgbbat1ad8j|xn--mgb9awbf|xn--mgba3a3ejt|xn--mgba3a4f16a|xn--mgba7c0bbn0a|xn--mgbaakc7dvf|xn--mgbaam7a8h|xn--mgbab2bd|xn--mgbai9azgqp6j|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a|xn--mgbbh1a71e|xn--mgbc0a9azcg|xn--mgbca7dzdo|xn--mgberp4a5d4ar|xn--mgbgu82a|xn--mgbi4ecexp|xn--mgbpl2fh|xn--mgbt3dhd|xn--mgbtx2b|xn--mgbx4cd0ab|xn--mix891f|xn--mk1bu44c|xn--mxtq1m|xn--ngbc5azd|xn--ngbe9e0a|xn--ngbrx|xn--node|xn--nqv7f|xn--nqv7fs00ema|xn--nyqy26a|xn--o3cw4h|xn--ogbpf8fl|xn--p1acf|xn--p1ai|xn--pbt977c|xn--pgbs0dh|xn--pssy2u|xn--q9jyb4c|xn--qcka1pmc|xn--qxam|xn--rhqv96g|xn--rovu88b|xn--rvc1e0am3e|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--tckwe|xn--tiq49xqyj|xn--unup4y|xn--vermgensberater-ctb|xn--vermgensberatung-pwb|xn--vhquv|xn--vuq861b|xn--w4r85el8fhu5dnra|xn--w4rs40l|xn--wgbh1c|xn--wgbl6a|xn--xhq521b|xn--xkc2al3hye2a|xn--xkc2dl3a5ee0h|xn--y9a3aq|xn--yfro4i67o|xn--ygbi2ammx|xn--zfr164b|xperia|xxx|xyz|yachts|yahoo|yamaxun|yandex|ye|yodobashi|yoga|yokohama|you|youtube|yt|yun|za|zappos|zara|zero|zip|zippo|zm|zone|zuerich|zw".split("|"),c="0123456789".split(""),s="0123456789abcdefghijklmnopqrstuvwxyz".split(""),u=[" ","\f","\r","\t","\v"," "," ","᠎"],l=[],f=function(e){return new r.CharacterState(e)},p=f(),d=f(i.NUM),m=f(i.DOMAIN),h=f(),y=f(i.WS);p.on("@",f(i.AT)).on(".",f(i.DOT)).on("+",f(i.PLUS)).on("#",f(i.POUND)).on("?",f(i.QUERY)).on("/",f(i.SLASH)).on("_",f(i.UNDERSCORE)).on(":",f(i.COLON)).on("{",f(i.OPENBRACE)).on("[",f(i.OPENBRACKET)).on("<",f(i.OPENANGLEBRACKET)).on("(",f(i.OPENPAREN)).on("}",f(i.CLOSEBRACE)).on("]",f(i.CLOSEBRACKET)).on(">",f(i.CLOSEANGLEBRACKET)).on(")",f(i.CLOSEPAREN)).on("&",f(i.AMPERSAND)).on([",",";","!",'"',"'"],f(i.PUNCTUATION)),p.on("\n",f(i.NL)).on(u,y),y.on(u,y);for(var v=0;v<o.length;v++){var b=(0,r.stateify)(o[v],p,i.TLD,i.DOMAIN);l.push.apply(l,b)}var g=(0,r.stateify)("file",p,i.DOMAIN,i.DOMAIN),S=(0,r.stateify)("ftp",p,i.DOMAIN,i.DOMAIN),E=(0,r.stateify)("http",p,i.DOMAIN,i.DOMAIN),O=(0,r.stateify)("mailto",p,i.DOMAIN,i.DOMAIN);l.push.apply(l,g),l.push.apply(l,S),l.push.apply(l,E),l.push.apply(l,O);var C=g.pop(),A=S.pop(),w=E.pop(),j=O.pop(),I=f(i.DOMAIN),k=f(i.PROTOCOL),T=f(i.MAILTO);A.on("s",I).on(":",k),w.on("s",I).on(":",k),l.push(I),C.on(":",k),I.on(":",k),j.on(":",T);var L=(0,r.stateify)("localhost",p,i.LOCALHOST,i.DOMAIN);l.push.apply(l,L),p.on(c,d),d.on("-",h).on(c,d).on(s,m),m.on("-",h).on(s,m);for(var _=0;_<l.length;_++)l[_].on("-",h).on(s,m);h.on("-",h).on(c,m).on(s,m),p.defaultTransition=f(i.SYM);var P=p;t.State=r.CharacterState,t.TOKENS=a,t.run=function(e){for(var t=e.replace(/[A-Z]/g,(function(e){return e.toLowerCase()})),n=e.length,r=[],i=0;i<n;){for(var a=p,o=null,c=0,s=null,u=-1;i<n&&(o=a.next(t[i]));)(a=o).accepts()?(u=0,s=a):u>=0&&u++,c++,i++;if(!(u<0)){i-=u,c-=u;var l=s.emit();r.push(new l(e.substr(i-c,c)))}}return r},t.start=P},function(e,t,n){"use strict";t.__esModule=!0,t.start=t.run=t.TOKENS=t.State=void 0;var r=n(195),i=n(243),a=function(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}(i),o=n(59);var c=function(e){return new r.TokenState(e)},s=c(),u=c(),l=c(),f=c(),p=c(),d=c(),m=c(),h=c(i.URL),y=c(),v=c(i.URL),b=c(i.URL),g=c(),S=c(),E=c(),O=c(),C=c(),A=c(i.URL),w=c(i.URL),j=c(i.URL),I=c(i.URL),k=c(),T=c(),L=c(),_=c(),P=c(),x=c(),N=c(i.EMAIL),R=c(),D=c(i.EMAIL),M=c(i.MAILTOEMAIL),U=c(),F=c(),V=c(),B=c(),z=c(i.NL);s.on(o.NL,z).on(o.PROTOCOL,u).on(o.MAILTO,l).on(o.SLASH,f),u.on(o.SLASH,f),f.on(o.SLASH,p),s.on(o.TLD,d).on(o.DOMAIN,d).on(o.LOCALHOST,h).on(o.NUM,d),p.on(o.TLD,b).on(o.DOMAIN,b).on(o.NUM,b).on(o.LOCALHOST,b),d.on(o.DOT,m),P.on(o.DOT,x),m.on(o.TLD,h).on(o.DOMAIN,d).on(o.NUM,d).on(o.LOCALHOST,d),x.on(o.TLD,N).on(o.DOMAIN,P).on(o.NUM,P).on(o.LOCALHOST,P),h.on(o.DOT,m),N.on(o.DOT,x),h.on(o.COLON,y).on(o.SLASH,b),y.on(o.NUM,v),v.on(o.SLASH,b),N.on(o.COLON,R),R.on(o.NUM,D);var H=[o.DOMAIN,o.AT,o.LOCALHOST,o.NUM,o.PLUS,o.POUND,o.PROTOCOL,o.SLASH,o.TLD,o.UNDERSCORE,o.SYM,o.AMPERSAND],q=[o.COLON,o.DOT,o.QUERY,o.PUNCTUATION,o.CLOSEBRACE,o.CLOSEBRACKET,o.CLOSEANGLEBRACKET,o.CLOSEPAREN,o.OPENBRACE,o.OPENBRACKET,o.OPENANGLEBRACKET,o.OPENPAREN];b.on(o.OPENBRACE,S).on(o.OPENBRACKET,E).on(o.OPENANGLEBRACKET,O).on(o.OPENPAREN,C),g.on(o.OPENBRACE,S).on(o.OPENBRACKET,E).on(o.OPENANGLEBRACKET,O).on(o.OPENPAREN,C),S.on(o.CLOSEBRACE,b),E.on(o.CLOSEBRACKET,b),O.on(o.CLOSEANGLEBRACKET,b),C.on(o.CLOSEPAREN,b),A.on(o.CLOSEBRACE,b),w.on(o.CLOSEBRACKET,b),j.on(o.CLOSEANGLEBRACKET,b),I.on(o.CLOSEPAREN,b),k.on(o.CLOSEBRACE,b),T.on(o.CLOSEBRACKET,b),L.on(o.CLOSEANGLEBRACKET,b),_.on(o.CLOSEPAREN,b),S.on(H,A),E.on(H,w),O.on(H,j),C.on(H,I),S.on(q,k),E.on(q,T),O.on(q,L),C.on(q,_),A.on(H,A),w.on(H,w),j.on(H,j),I.on(H,I),A.on(q,A),w.on(q,w),j.on(q,j),I.on(q,I),k.on(H,A),T.on(H,w),L.on(H,j),_.on(H,I),k.on(q,k),T.on(q,T),L.on(q,L),_.on(q,_),b.on(H,b),g.on(H,b),b.on(q,g),g.on(q,g),l.on(o.TLD,M).on(o.DOMAIN,M).on(o.NUM,M).on(o.LOCALHOST,M),M.on(H,M).on(q,U),U.on(H,M).on(q,U);var J=[o.DOMAIN,o.NUM,o.PLUS,o.POUND,o.QUERY,o.UNDERSCORE,o.SYM,o.AMPERSAND,o.TLD];d.on(J,F).on(o.AT,V),h.on(J,F).on(o.AT,V),m.on(J,F),F.on(J,F).on(o.AT,V).on(o.DOT,B),B.on(J,F),V.on(o.TLD,P).on(o.DOMAIN,P).on(o.LOCALHOST,N);t.State=r.TokenState,t.TOKENS=a,t.run=function(e){for(var t=e.length,n=0,r=[],a=[];n<t;){for(var o=s,c=null,u=null,l=0,f=null,p=-1;n<t&&!(c=o.next(e[n]));)a.push(e[n++]);for(;n<t&&(u=c||o.next(e[n]));)c=null,(o=u).accepts()?(p=0,f=o):p>=0&&p++,n++,l++;if(p<0)for(var d=n-l;d<n;d++)a.push(e[d]);else{a.length>0&&(r.push(new i.TEXT(a)),a=[]),n-=p,l-=p;var m=f.emit();r.push(new m(e.slice(n-l,n)))}}return a.length>0&&r.push(new i.TEXT(a)),r},t.start=s},function(e,t,n){"use strict";t.__esModule=!0,t.URL=t.TEXT=t.NL=t.EMAIL=t.MAILTOEMAIL=t.Base=void 0;var r=n(196),i=n(43),a=n(59);function o(e){return e instanceof a.DOMAIN||e instanceof a.TLD}var c=(0,r.createTokenClass)();c.prototype={type:"token",isLink:!1,toString:function(){for(var e=[],t=0;t<this.v.length;t++)e.push(this.v[t].toString());return e.join("")},toHref:function(){return this.toString()},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http";return{type:this.type,value:this.toString(),href:this.toHref(e)}}};var s=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"email",isLink:!0}),u=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"email",isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),l=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"text"}),f=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"nl"}),p=(0,i.inherits)(c,(0,r.createTokenClass)(),{type:"url",isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http",t=!1,n=!1,r=this.v,i=[],c=0;r[c]instanceof a.PROTOCOL;)t=!0,i.push(r[c].toString().toLowerCase()),c++;for(;r[c]instanceof a.SLASH;)n=!0,i.push(r[c].toString()),c++;for(;o(r[c]);)i.push(r[c].toString().toLowerCase()),c++;for(;c<r.length;c++)i.push(r[c].toString());return i=i.join(""),t||n||(i=e+"://"+i),i},hasProtocol:function(){return this.v[0]instanceof a.PROTOCOL}});t.Base=c,t.MAILTOEMAIL=s,t.EMAIL=u,t.NL=f,t.TEXT=l,t.URL=p},function(e,t,n){const{defaults:r}=n(40),{block:i}=n(199),{rtrim:a,splitCells:o,escape:c}=n(34);e.exports=class e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.rules=i.normal,this.options.pedantic?this.rules=i.pedantic:this.options.gfm&&(this.rules=i.gfm)}static get rules(){return i}static lex(t,n){return new e(n).lex(t)}lex(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.token(e,!0)}token(e,t){let n,r,s,u,l,f,p,d,m,h,y,v,b,g,S,E;for(e=e.replace(/^ +$/gm,"");e;)if((s=this.rules.newline.exec(e))&&(e=e.substring(s[0].length),s[0].length>1&&this.tokens.push({type:"space"})),s=this.rules.code.exec(e)){const t=this.tokens[this.tokens.length-1];e=e.substring(s[0].length),t&&"paragraph"===t.type?t.text+="\n"+s[0].trimRight():(s=s[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",codeBlockStyle:"indented",text:this.options.pedantic?s:a(s,"\n")}))}else if(s=this.rules.fences.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"code",lang:s[2]?s[2].trim():s[2],text:s[3]||""});else if(s=this.rules.heading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:s[1].length,text:s[2]});else if((s=this.rules.nptable.exec(e))&&(f={type:"table",header:o(s[1].replace(/^ *| *\| *$/g,"")),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3]?s[3].replace(/\n$/,"").split("\n"):[]},f.header.length===f.align.length)){for(e=e.substring(s[0].length),y=0;y<f.align.length;y++)/^ *-+: *$/.test(f.align[y])?f.align[y]="right":/^ *:-+: *$/.test(f.align[y])?f.align[y]="center":/^ *:-+ *$/.test(f.align[y])?f.align[y]="left":f.align[y]=null;for(y=0;y<f.cells.length;y++)f.cells[y]=o(f.cells[y],f.header.length);this.tokens.push(f)}else if(s=this.rules.hr.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"hr"});else if(s=this.rules.blockquote.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"blockquote_start"}),s=s[0].replace(/^ *> ?/gm,""),this.token(s,t),this.tokens.push({type:"blockquote_end"});else if(s=this.rules.list.exec(e)){for(e=e.substring(s[0].length),u=s[2],g=u.length>1,p={type:"list_start",ordered:g,start:g?+u:"",loose:!1},this.tokens.push(p),s=s[0].match(this.rules.item),d=[],n=!1,b=s.length,y=0;y<b;y++)f=s[y],h=f.length,f=f.replace(/^ *([*+-]|\d+\.) */,""),~f.indexOf("\n ")&&(h-=f.length,f=this.options.pedantic?f.replace(/^ {1,4}/gm,""):f.replace(new RegExp("^ {1,"+h+"}","gm"),"")),y!==b-1&&(l=i.bullet.exec(s[y+1])[0],(u.length>1?1===l.length:l.length>1||this.options.smartLists&&l!==u)&&(e=s.slice(y+1).join("\n")+e,y=b-1)),r=n||/\n\n(?!\s*$)/.test(f),y!==b-1&&(n="\n"===f.charAt(f.length-1),r||(r=n)),r&&(p.loose=!0),S=/^\[[ xX]\] /.test(f),E=void 0,S&&(E=" "!==f[1],f=f.replace(/^\[[ xX]\] +/,"")),m={type:"list_item_start",task:S,checked:E,loose:r},d.push(m),this.tokens.push(m),this.token(f,!1),this.tokens.push({type:"list_item_end"});if(p.loose)for(b=d.length,y=0;y<b;y++)d[y].loose=!0;this.tokens.push({type:"list_end"})}else if(s=this.rules.html.exec(e))e=e.substring(s[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===s[1]||"script"===s[1]||"style"===s[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):c(s[0]):s[0]});else if(t&&(s=this.rules.def.exec(e)))e=e.substring(s[0].length),s[3]&&(s[3]=s[3].substring(1,s[3].length-1)),v=s[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[v]||(this.tokens.links[v]={href:s[2],title:s[3]});else if((s=this.rules.table.exec(e))&&(f={type:"table",header:o(s[1].replace(/^ *| *\| *$/g,"")),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3]?s[3].replace(/\n$/,"").split("\n"):[]},f.header.length===f.align.length)){for(e=e.substring(s[0].length),y=0;y<f.align.length;y++)/^ *-+: *$/.test(f.align[y])?f.align[y]="right":/^ *:-+: *$/.test(f.align[y])?f.align[y]="center":/^ *:-+ *$/.test(f.align[y])?f.align[y]="left":f.align[y]=null;for(y=0;y<f.cells.length;y++)f.cells[y]=o(f.cells[y].replace(/^ *\| *| *\| *$/g,""),f.header.length);this.tokens.push(f)}else if(s=this.rules.lheading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:"="===s[2].charAt(0)?1:2,text:s[1]});else if(t&&(s=this.rules.paragraph.exec(e)))e=e.substring(s[0].length),this.tokens.push({type:"paragraph",text:"\n"===s[1].charAt(s[1].length-1)?s[1].slice(0,-1):s[1]});else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"text",text:s[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens}}},function(e,t,n){const r=n(60),i=n(200),a=n(201),o=n(202),{defaults:c}=n(40),{merge:s,unescape:u}=n(34);e.exports=class e{constructor(e){this.tokens=[],this.token=null,this.options=e||c,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options,this.slugger=new i}static parse(t,n){return new e(n).parse(t)}parse(e){this.inline=new a(e.links,this.options),this.inlineText=new a(e.links,s({},this.options,{renderer:new o})),this.tokens=e.reverse();let t="";for(;this.next();)t+=this.tok();return t}next(){return this.token=this.tokens.pop(),this.token}peek(){return this.tokens[this.tokens.length-1]||0}parseText(){let e=this.token.text;for(;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)}tok(){let e="";switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,u(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":{let t,n,r,i,a="";for(r="",t=0;t<this.token.header.length;t++)r+=this.renderer.tablecell(this.inline.output(this.token.header[t]),{header:!0,align:this.token.align[t]});for(a+=this.renderer.tablerow(r),t=0;t<this.token.cells.length;t++){for(n=this.token.cells[t],r="",i=0;i<n.length;i++)r+=this.renderer.tablecell(this.inline.output(n[i]),{header:!1,align:this.token.align[i]});e+=this.renderer.tablerow(r)}return this.renderer.table(a,e)}case"blockquote_start":for(e="";"blockquote_end"!==this.next().type;)e+=this.tok();return this.renderer.blockquote(e);case"list_start":{e="";const t=this.token.ordered,n=this.token.start;for(;"list_end"!==this.next().type;)e+=this.tok();return this.renderer.list(e,t,n)}case"list_item_start":{e="";const t=this.token.loose,n=this.token.checked,r=this.token.task;if(this.token.task)if(t)if("text"===this.peek().type){const e=this.peek();e.text=this.renderer.checkbox(n)+" "+e.text}else this.tokens.push({type:"text",text:this.renderer.checkbox(n)});else e+=this.renderer.checkbox(n);for(;"list_item_end"!==this.next().type;)e+=t||"text"!==this.token.type?this.tok():this.parseText();return this.renderer.listitem(e,r,n)}case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText());default:{const e='Token with "'+this.token.type+'" type was not found.';if(!this.options.silent)throw new Error(e);console.log(e)}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var r=a(n(0)),i=a(n(247));function a(e){return e&&e.__esModule?e:{default:e}}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?d(e):t}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=function(e){function t(){var e,n;u(this,t);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return h(d(n=f(this,(e=p(t)).call.apply(e,[this].concat(o)))),"onClick",(function(e){var t=n.props,a=t.text,o=t.onCopy,c=t.children,s=t.options,u=r.default.Children.only(c),l=(0,i.default)(a,s);o&&o(a,l),u&&u.props&&"function"==typeof u.props.onClick&&u.props.onClick(e)})),n}var n,a,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(t,e),n=t,(a=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),n=s(e,["text","onCopy","options","children"]),i=r.default.Children.only(t);return r.default.cloneElement(i,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(n,!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n,{onClick:this.onClick}))}}])&&l(n.prototype,a),o&&l(n,o),t}(r.default.PureComponent);t.CopyToClipboard=y,h(y,"defaultProps",{onCopy:void 0,options:void 0})},function(e,t,n){"use strict";var r=n(248),i={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,a,o,c,s,u,l=!1;t||(t={}),n=t.debug||!1;try{if(o=r(),c=document.createRange(),s=document.getSelection(),(u=document.createElement("span")).textContent=e,u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=i[t.format]||i.default;window.clipboardData.setData(a,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(u),c.selectNodeContents(u),s.addRange(c),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),a=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(a,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(c):s.removeAllRanges()),u&&document.body.removeChild(u),o()}return l}},function(e,t){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}}},function(e,t,n){"use strict";n.r(t);var r={UPLOAD_IMAGE:"upload:image"},i={Subjects:Object.assign({SUBJECTS:"subjects",NEW_SUBJECT:"new:subject",EDIT_SUBJECT:"edit:subject",EDIT_SUBJECT_PLAYLISTS:"edit:subject:playlists",EDIT_SUBJECT_SERIES:"edit:subject:series",EDIT_SUBJECT_VIDEOS:"edit:subject:videos",SUBJECT_CLASSIFICATIONS:"subject:classifications",DELETE_SUBJECT:"delete:subject",ADD_SUBJECT_MEMBERS:"add:subject:members",REMOVE_SUBJECT_MEMBER:"remove:subject:member",CLASSIFICATIONS:"classifications",PRESENTATION_CLASSIFICATIONS:"presentation:classifications",NEW_CLASSIFICATION:"new:classification",EDIT_CLASSIFICATION:"edit:classification",EDIT_CLASSIFICATION_PLAYLISTS:"edit:classification:playlists",EDIT_CLASSIFICATION_SERIES:"edit:classification:series",EDIT_CLASSIFICATION_VIDEOS:"edit:classification:videos",DELETE_CLASSIFICATION:"delete:classification",REMOVE_CLASSIFICATION_MEMBER:"remove:classification:member",LEVELS:"levels",NEW_LEVEL:"new:level",EDIT_LEVEL:"edit:level",LEVEL_AUDIENCES:"level:audiences",EDIT_LEVEL_PLAYLISTS:"edit:level:playlists",EDIT_LEVEL_SERIES:"edit:level:series",EDIT_LEVEL_VIDEOS:"edit:level:videos",REMOVE_LEVEL_MEMBER:"remove:level:member",AUDIENCES:"audiences",PRESENTATION_AUDIENCES:"presentation:audiences",NEW_AUDIENCE:"new:audience",EDIT_AUDIENCE:"edit:audience",EDIT_AUDIENCE_PLAYLISTS:"edit:audience:playlists",EDIT_AUDIENCE_SERIES:"edit:audience:series",EDIT_AUDIENCE_VIDEOS:"edit:audience:videos",DELETE_AUDIENCE:"delete:audience",REMOVE_AUDIENCE_MEMBER:"remove:audience:member",PRESENTATIONS:"presentations",NEW_PRESENTATION:"new:presentation",EDIT_PRESENTATION:"edit:presentation"},r),Playlists:Object.assign({PLAYLISTS:"index",SEARCH_PLAYLISTS:"search:playlists",NEW_PLAYLIST:"new:playlist",EDIT_PLAYLIST:"edit:playlist",EDIT_PLAYLIST_VIDEOS:"edit:playlist:videos",EDIT_PLAYLIST_SUBJECTS:"edit:playlist:subjects",EDIT_PLAYLIST_AUDIENCES:"edit:playlist:audiences",DELETE_PLAYLIST:"delete:playlist",REMOVE_VIDEO:"remove:video",REMOVE_FROM_SUBJECT:"remove:from:subject"},r),Series:Object.assign({EDIT_SERIES:"edit:series",EDIT_SERIES_VIDEOS:"edit:series:videos",EDIT_SERIES_SUBJECTS:"edit:series:subjects",EDIT_SERIES_AUDIENCES:"edit:series:audiences",LEGACY_EDIT_SERIES:"legacy:edit:series"},r),Videos:Object.assign({EDIT_VIDEO:"edit:video",EDIT_VIDEO_AUDIENCES:"edit:video:audiences",EDIT_VIDEO_SUBJECTS:"edit:video:subjects",EDIT_VIDEO_ALIASES:"edit:video:aliases",LEGACY_EDIT_VIDEO:"legacy:edit:video"},r),DomainOptions:{DOMAIN_OPTIONS:"domain:options",NEW_DOMAIN_OPTION:"new:domain:option",EDIT_DOMAIN_OPTION:"edit:domain:option",DELETE_DOMAIN_OPTION:"delete:domain:option"},People:{PEOPLE:"people",NEW_PERSON:"new:person",EDIT_PERSON:"edit:person"},Companies:{COMPANIES:"companies",NEW_COMPANY:"new:company",EDIT_COMPANY:"edit:company"},Themes:Object.assign({THEMES:"themes",NEW_THEME:"new:theme",EDIT_THEME:"edit:theme",DELETE_THEME:"delete:theme"},r),ReleaseNotes:{FORM:"form",GENERATOR:"generator"},Customers:{MANAGE_CUSTOMER:"manage:customer",MANAGE_CUSTOMER_TOPICS:"manage:customer:topics"}},a={SUBJECT:"subject",SUBJECTS:"subjects",UPDATE_SUBJECT:"update:subject",DELETE_SUBJECT:"delete:subject",UPDATE_OBJECT_SUBJECTS:"update:object:subjects",ADD_TO_SUBJECT:"add:to:subject",REMOVE_FROM_SUBJECT:"remove:from:subject",CLASSIFICATION:"classification",CLASSIFICATIONS:"classifications",UPDATE_CLASSIFICATION:"update:classification",DELETE_CLASSIFICATION:"delete:classification",UPDATE_OBJECT_CLASSIFICATIONS:"update:object:classifications",ADD_TO_CLASSIFICATION:"add:to:classification",REMOVE_FROM_CLASSIFICATION:"remove:from:classification",PRESENTATION:"presentation",PRESENTATIONS:"presentations",UPDATE_PRESENTATION:"update:presentation",LEVEL:"level",LEVELS:"levels",UPDATE_LEVEL:"update:level",ADD_TO_LEVEL:"add:to:level",REMOVE_FROM_LEVEL:"remove:from:level",UPDATE_OBJECT_LEVELS:"update:object:levels",AUDIENCE:"audience",AUDIENCES:"audiences",UPDATE_AUDIENCE:"update:audience",DELETE_AUDIENCE:"delete:audience",UPDATE_OBJECT_AUDIENCES:"update:object:audiences",ADD_TO_AUDIENCE:"add:to:audience",REMOVE_FROM_AUDIENCE:"remove:from:audience",PLAYLIST:"playlist",PLAYLISTS:"playlists",UPDATE_PLAYLIST:"update:playlist",DELETE_PLAYLIST:"delete:playlist",PLAYLIST_VIDEOS:"playlist:videos",REORDER_PLAYLIST_VIDEOS:"reorder:playlist:videos",REMOVE_PLAYLIST_VIDEO:"remove:playlist:video",VIDEO:"video",SERIES:"series",SERIES_BY_ID:"series:by:id",UPDATE_SERIES:"update:series",CURRENT_USER:"current:user",UPLOAD_IMAGE:"upload:image",LOCALE:"locale",PHRASES:"PHRASES"},o={CURATOR_LAYOUT:"CuratorLayout"},c={COMPANIES:"companies:application",CUSTOMERS:"customers:application",DOMAIN_OPTIONS:"domain:options:application",PEOPLE:"people:application",PLAYLISTS:"playlists:application",SERIES:"series:application",SUBJECTS:"subjects:application",THEMES:"themes:application",VIDEOS:"videos:application",RELEASE_NOTES:"release:notes:application"},s={IMAGE_UPLOAD:"image:upload:data:service",SUBJECT:"subject:data:service",LANGUAGE:"language:data:service"},u={SUBJECT:"SubjectDataService",LANGUAGE:"LanguageDataService"},l=n(0),f=n.n(l),p=n(27),d=n(1),m=function(e){return d.isFunction(e)},h=function(){return d.identity},y=n(54),v=n(7);function b(e){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=A(e);if(t){var i=A(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return C(this,n)}}function C(e,t){return!t||"object"!==b(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&E(e,t)}(a,e);var t,n,r,i=O(a);function a(){return g(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"isReactComponent",value:function(e){return l&&l.isValidElement(e)}},{key:"showChildView",value:function(e,t){this.isReactComponent(t)&&this.showChildReactComponent(e,t)}},{key:"showChildReactComponent",value:function(e,t){var n=this;this.isAttached()?this.renderChildReactComponent(e,t):this.listenToOnce(this,"attach",(function(){return n.renderChildReactComponent(e,t)}))}},{key:"renderChildReactComponent",value:function(e,t){var n=this.getRegion(e),r=this.$el.find(n.el);r&&r.length&&(n.trigger("before:show"),y.render(t,r[0],(function(){return n.trigger("show")})),this.listenToOnce(this,"unmount:".concat(e),(function(){return y.unmountComponentAtNode(r[0])})),this.listenToOnce(this,"before:destroy",(function(){return y.unmountComponentAtNode(r[0])})))}},{key:"wrapWithStore",value:function(e){return l.createElement(v.Provider,{store:this.options.store},e)}}])&&S(t.prototype,n),r&&S(t,r),a}(n(46).a),j="top:nav",I="left:nav",k="content",T="popup",L="alert",_=n(206),P=n.n(_),x=n(55),N=n.n(x);function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function M(e,t,n){return(M="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=B(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function U(e,t){return(U=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=B(e);if(t){var i=B(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return V(this,n)}}function V(e,t){return!t||"object"!==R(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function B(e){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&U(e,t)}(a,e);var t,n,r,i=F(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).childComponents={},t}return t=a,r=[{key:"getCacheKey",value:function(e){var t="".concat(this.name),n=[];return Object.keys(e).forEach((function(t){n.push("".concat(t,":").concat(e[t]))})),n.length&&(n.sort(),t+=":".concat(n.join(":"))),t}}],(n=[{key:"title",get:function(){return!1}},{key:"name",get:function(){return"CuratorLayoutView"}},{key:"template",get:function(){return P.a}},{key:"className",get:function(){return"container-fluid ".concat(N.a.curatorLayout)}},{key:"regions",value:function(){return{layout:".layout-region"}}},{key:"getChildComponents",value:function(){return{topNav:{component:this.childComponents[j],className:N.a.topNavRegion},leftNav:{component:this.childComponents[I],className:"py-3 ".concat(N.a.leftNavRegion)},content:{component:this.childComponents[k],className:"position-relative container py-3"},popup:{component:this.childComponents[T]},alert:{component:this.childComponents[L]}}}},{key:"unsetRegion",value:function(e){delete this.childComponents[e],this.renderLayout()}},{key:"renderTopNav",value:function(){m(this.options.getTopNavView)&&(this.childComponents[j]=this.options.getTopNavView(p.AppLinkHelper.getCurrentAppLink()))}},{key:"hideLeftNav",value:function(){this.unsetRegion(I)}},{key:"closePopup",value:function(){this.unsetRegion(T)}},{key:"showChildView",value:function(e,t){this.childComponents[e]=t,this.renderTopNav(),this.renderLayout()}},{key:"renderLayout",value:function(){var e=Object.assign({provider:this.options.provider},this.getChildComponents());M(B(a.prototype),"showChildView",this).call(this,"layout",this.wrapWithStore(l.createElement(Y,Object.assign({},e))))}}])&&D(t.prototype,n),r&&D(t,r),a}(w),H=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},q=function(e){var t=e.className,n=e.children;return l.createElement("div",{className:t},n)},J=function(e,t){return"".concat(e).concat(t?" ".concat(t):"")},K=function(e){var t=e.topNav,n=e.leftNav,r=e.content,i=e.popup,a=e.alert;return l.createElement(l.Fragment,null,l.createElement("div",{className:"position-relative"},!!t.component&&l.createElement(q,{className:J("top-nav-region",t.className)},t.component),!!n.component&&l.createElement(q,{className:J("left-nav-region",n.className)},n.component),!!r.component&&l.createElement("div",{className:"content-container"},l.createElement(q,{className:J("content-region",r.className)},r.component))),!!i.component&&l.createElement(q,{className:J("popup-region",i.className)},i.component),!!a.component&&l.createElement(q,{className:J("alert-region",a.className)},a.component))},Y=function(e){var t=e.provider,n=H(e,["provider"]);return t?l.createElement(t,null,l.createElement(K,Object.assign({},n))):l.createElement(K,Object.assign({},n))},G=n(9);function W(e){return(W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Z(e){return function(e){if(Array.isArray(e))return Q(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Q(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function X(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function te(e,t){return(te=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ie(e);if(t){var i=ie(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return re(this,n)}}function re(e,t){return!t||"object"!==W(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ie(e){return(ie=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&te(e,t)}(a,e);var t,n,r,i=ne(a);function a(){return X(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"initialize",value:function(){this.listenTo(G.a.SHELL,p.EventNames.ROUTING_END,this.updateNav)}},{key:"name",get:function(){return"CuratorAppNavService"}},{key:"updateNav",value:function(){var e=this,t=p.AppLinkHelper.getCurrentAppLink().application;if(t!==this.currentApplication){this.currentApplication=t;var n=this.options.navItemMappings[t];if(n){var r=document.querySelector(this.options.navSelector);r&&r.children&&Z(r.children).forEach((function(t){var r=t.querySelector("a");r&&(r.classList.remove(e.options.currentItemClassName),r.text===n&&r.classList.add(e.options.currentItemClassName))}))}}}}])&&ee(t.prototype,n),r&&ee(t,r),a}(p.Service),oe=n(70),ce=n(8),se=function(e){var t="/api/master/v2/companies";return e?"".concat(t,"?cursor=").concat(e):t},ue=function(e){return"/api/master/v2/objects/".concat(e)},le=function(){return"/api/master/v2/companies"},fe=function(e){return"/api/master/v2/objects/".concat(e)},pe="companies",de="company",me="update:company",he=function(e){return{key:"".concat(pe).concat(e?":".concat(e):""),url:se(e)}},ye=function(e){return{key:"".concat(de,":").concat(e),url:ue(e)}},ve=function(e,t,n){return{key:de,url:le(),data:e,type:ce.a.POST,success:t,error:n,invalidationKeys:[pe]}},be=function(e,t,n){return{key:"".concat(me,":").concat(e),url:fe(e),data:t,type:ce.a.PUT,always:n}},ge=n(33),Se=n.n(ge),Ee=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===Oe}(e)}(e)};var Oe="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Ce(e,t){return!1!==t.clone&&t.isMergeableObject(e)?we((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Ae(e,t,n){return e.concat(t).map((function(e){return Ce(e,n)}))}function we(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Ae,n.isMergeableObject=n.isMergeableObject||Ee;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach((function(t){r[t]=Ce(e[t],n)})),Object.keys(t).forEach((function(i){n.isMergeableObject(t[i])&&e[i]?r[i]=we(e[i],t[i],n):r[i]=Ce(t[i],n)})),r}(e,t,n):Ce(t,n)}we.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return we(e,n,t)}),{})};var je=we,Ie=n(15),ke=Ie.a.Symbol,Te=Object.prototype,Le=Te.hasOwnProperty,_e=Te.toString,Pe=ke?ke.toStringTag:void 0;var xe=function(e){var t=Le.call(e,Pe),n=e[Pe];try{e[Pe]=void 0;var r=!0}catch(e){}var i=_e.call(e);return r&&(t?e[Pe]=n:delete e[Pe]),i},Ne=Object.prototype.toString;var Re=function(e){return Ne.call(e)},De=ke?ke.toStringTag:void 0;var Me=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":De&&De in Object(e)?xe(e):Re(e)};var Ue=function(e,t){return function(n){return e(t(n))}},Fe=Ue(Object.getPrototypeOf,Object);var Ve=function(e){return null!=e&&"object"==typeof e},Be=Function.prototype,ze=Object.prototype,He=Be.toString,qe=ze.hasOwnProperty,Je=He.call(Object);var $e=function(e){if(!Ve(e)||"[object Object]"!=Me(e))return!1;var t=Fe(e);if(null===t)return!0;var n=qe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&He.call(n)==Je};var Ke=function(){this.__data__=[],this.size=0};var Ye=function(e,t){return e===t||e!=e&&t!=t};var Ge=function(e,t){for(var n=e.length;n--;)if(Ye(e[n][0],t))return n;return-1},We=Array.prototype.splice;var Ze=function(e){var t=this.__data__,n=Ge(t,e);return!(n<0)&&(n==t.length-1?t.pop():We.call(t,n,1),--this.size,!0)};var Qe=function(e){var t=this.__data__,n=Ge(t,e);return n<0?void 0:t[n][1]};var Xe=function(e){return Ge(this.__data__,e)>-1};var et=function(e,t){var n=this.__data__,r=Ge(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function tt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}tt.prototype.clear=Ke,tt.prototype.delete=Ze,tt.prototype.get=Qe,tt.prototype.has=Xe,tt.prototype.set=et;var nt=tt;var rt=function(){this.__data__=new nt,this.size=0};var it=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var at=function(e){return this.__data__.get(e)};var ot=function(e){return this.__data__.has(e)};var ct=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var st,ut=function(e){if(!ct(e))return!1;var t=Me(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},lt=Ie.a["__core-js_shared__"],ft=(st=/[^.]+$/.exec(lt&&lt.keys&&lt.keys.IE_PROTO||""))?"Symbol(src)_1."+st:"";var pt=function(e){return!!ft&&ft in e},dt=Function.prototype.toString;var mt=function(e){if(null!=e){try{return dt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ht=/^\[object .+?Constructor\]$/,yt=Function.prototype,vt=Object.prototype,bt=yt.toString,gt=vt.hasOwnProperty,St=RegExp("^"+bt.call(gt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Et=function(e){return!(!ct(e)||pt(e))&&(ut(e)?St:ht).test(mt(e))};var Ot=function(e,t){return null==e?void 0:e[t]};var Ct=function(e,t){var n=Ot(e,t);return Et(n)?n:void 0},At=Ct(Ie.a,"Map"),wt=Ct(Object,"create");var jt=function(){this.__data__=wt?wt(null):{},this.size=0};var It=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},kt=Object.prototype.hasOwnProperty;var Tt=function(e){var t=this.__data__;if(wt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return kt.call(t,e)?t[e]:void 0},Lt=Object.prototype.hasOwnProperty;var _t=function(e){var t=this.__data__;return wt?void 0!==t[e]:Lt.call(t,e)};var Pt=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=wt&&void 0===t?"__lodash_hash_undefined__":t,this};function xt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}xt.prototype.clear=jt,xt.prototype.delete=It,xt.prototype.get=Tt,xt.prototype.has=_t,xt.prototype.set=Pt;var Nt=xt;var Rt=function(){this.size=0,this.__data__={hash:new Nt,map:new(At||nt),string:new Nt}};var Dt=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var Mt=function(e,t){var n=e.__data__;return Dt(t)?n["string"==typeof t?"string":"hash"]:n.map};var Ut=function(e){var t=Mt(this,e).delete(e);return this.size-=t?1:0,t};var Ft=function(e){return Mt(this,e).get(e)};var Vt=function(e){return Mt(this,e).has(e)};var Bt=function(e,t){var n=Mt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function zt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}zt.prototype.clear=Rt,zt.prototype.delete=Ut,zt.prototype.get=Ft,zt.prototype.has=Vt,zt.prototype.set=Bt;var Ht=zt;var qt=function(e,t){var n=this.__data__;if(n instanceof nt){var r=n.__data__;if(!At||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ht(r)}return n.set(e,t),this.size=n.size,this};function Jt(e){var t=this.__data__=new nt(e);this.size=t.size}Jt.prototype.clear=rt,Jt.prototype.delete=it,Jt.prototype.get=at,Jt.prototype.has=ot,Jt.prototype.set=qt;var $t=Jt;var Kt=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},Yt=function(){try{var e=Ct(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Gt=function(e,t,n){"__proto__"==t&&Yt?Yt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Wt=Object.prototype.hasOwnProperty;var Zt=function(e,t,n){var r=e[t];Wt.call(e,t)&&Ye(r,n)&&(void 0!==n||t in e)||Gt(e,t,n)};var Qt=function(e,t,n,r){var i=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var c=t[a],s=r?r(n[c],e[c],c,n,e):void 0;void 0===s&&(s=e[c]),i?Gt(n,c,s):Zt(n,c,s)}return n};var Xt=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var en=function(e){return Ve(e)&&"[object Arguments]"==Me(e)},tn=Object.prototype,nn=tn.hasOwnProperty,rn=tn.propertyIsEnumerable,an=en(function(){return arguments}())?en:function(e){return Ve(e)&&nn.call(e,"callee")&&!rn.call(e,"callee")},on=Array.isArray,cn=n(49),sn=/^(?:0|[1-9]\d*)$/;var un=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&sn.test(e))&&e>-1&&e%1==0&&e<t};var ln=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},fn={};fn["[object Float32Array]"]=fn["[object Float64Array]"]=fn["[object Int8Array]"]=fn["[object Int16Array]"]=fn["[object Int32Array]"]=fn["[object Uint8Array]"]=fn["[object Uint8ClampedArray]"]=fn["[object Uint16Array]"]=fn["[object Uint32Array]"]=!0,fn["[object Arguments]"]=fn["[object Array]"]=fn["[object ArrayBuffer]"]=fn["[object Boolean]"]=fn["[object DataView]"]=fn["[object Date]"]=fn["[object Error]"]=fn["[object Function]"]=fn["[object Map]"]=fn["[object Number]"]=fn["[object Object]"]=fn["[object RegExp]"]=fn["[object Set]"]=fn["[object String]"]=fn["[object WeakMap]"]=!1;var pn=function(e){return Ve(e)&&ln(e.length)&&!!fn[Me(e)]};var dn=function(e){return function(t){return e(t)}},mn=n(29),hn=mn.a&&mn.a.isTypedArray,yn=hn?dn(hn):pn,vn=Object.prototype.hasOwnProperty;var bn=function(e,t){var n=on(e),r=!n&&an(e),i=!n&&!r&&Object(cn.a)(e),a=!n&&!r&&!i&&yn(e),o=n||r||i||a,c=o?Xt(e.length,String):[],s=c.length;for(var u in e)!t&&!vn.call(e,u)||o&&("length"==u||i&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||un(u,s))||c.push(u);return c},gn=Object.prototype;var Sn=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||gn)},En=Ue(Object.keys,Object),On=Object.prototype.hasOwnProperty;var Cn=function(e){if(!Sn(e))return En(e);var t=[];for(var n in Object(e))On.call(e,n)&&"constructor"!=n&&t.push(n);return t};var An=function(e){return null!=e&&ln(e.length)&&!ut(e)};var wn=function(e){return An(e)?bn(e):Cn(e)};var jn=function(e,t){return e&&Qt(t,wn(t),e)};var In=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},kn=Object.prototype.hasOwnProperty;var Tn=function(e){if(!ct(e))return In(e);var t=Sn(e),n=[];for(var r in e)("constructor"!=r||!t&&kn.call(e,r))&&n.push(r);return n};var Ln=function(e){return An(e)?bn(e,!0):Tn(e)};var _n=function(e,t){return e&&Qt(t,Ln(t),e)},Pn=n(208);var xn=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var Nn=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a};var Rn=function(){return[]},Dn=Object.prototype.propertyIsEnumerable,Mn=Object.getOwnPropertySymbols,Un=Mn?function(e){return null==e?[]:(e=Object(e),Nn(Mn(e),(function(t){return Dn.call(e,t)})))}:Rn;var Fn=function(e,t){return Qt(e,Un(e),t)};var Vn=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},Bn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Vn(t,Un(e)),e=Fe(e);return t}:Rn;var zn=function(e,t){return Qt(e,Bn(e),t)};var Hn=function(e,t,n){var r=t(e);return on(e)?r:Vn(r,n(e))};var qn=function(e){return Hn(e,wn,Un)};var Jn=function(e){return Hn(e,Ln,Bn)},$n=Ct(Ie.a,"DataView"),Kn=Ct(Ie.a,"Promise"),Yn=Ct(Ie.a,"Set"),Gn=Ct(Ie.a,"WeakMap"),Wn=mt($n),Zn=mt(At),Qn=mt(Kn),Xn=mt(Yn),er=mt(Gn),tr=Me;($n&&"[object DataView]"!=tr(new $n(new ArrayBuffer(1)))||At&&"[object Map]"!=tr(new At)||Kn&&"[object Promise]"!=tr(Kn.resolve())||Yn&&"[object Set]"!=tr(new Yn)||Gn&&"[object WeakMap]"!=tr(new Gn))&&(tr=function(e){var t=Me(e),n="[object Object]"==t?e.constructor:void 0,r=n?mt(n):"";if(r)switch(r){case Wn:return"[object DataView]";case Zn:return"[object Map]";case Qn:return"[object Promise]";case Xn:return"[object Set]";case er:return"[object WeakMap]"}return t});var nr=tr,rr=Object.prototype.hasOwnProperty;var ir=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&rr.call(e,"index")&&(n.index=e.index,n.input=e.input),n},ar=Ie.a.Uint8Array;var or=function(e){var t=new e.constructor(e.byteLength);return new ar(t).set(new ar(e)),t};var cr=function(e,t){var n=t?or(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},sr=/\w*$/;var ur=function(e){var t=new e.constructor(e.source,sr.exec(e));return t.lastIndex=e.lastIndex,t},lr=ke?ke.prototype:void 0,fr=lr?lr.valueOf:void 0;var pr=function(e){return fr?Object(fr.call(e)):{}};var dr=function(e,t){var n=t?or(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var mr=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return or(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return cr(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return dr(e,n);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return ur(e);case"[object Set]":return new r;case"[object Symbol]":return pr(e)}},hr=Object.create,yr=function(){function e(){}return function(t){if(!ct(t))return{};if(hr)return hr(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var vr=function(e){return"function"!=typeof e.constructor||Sn(e)?{}:yr(Fe(e))};var br=function(e){return Ve(e)&&"[object Map]"==nr(e)},gr=mn.a&&mn.a.isMap,Sr=gr?dn(gr):br;var Er=function(e){return Ve(e)&&"[object Set]"==nr(e)},Or=mn.a&&mn.a.isSet,Cr=Or?dn(Or):Er,Ar={};Ar["[object Arguments]"]=Ar["[object Array]"]=Ar["[object ArrayBuffer]"]=Ar["[object DataView]"]=Ar["[object Boolean]"]=Ar["[object Date]"]=Ar["[object Float32Array]"]=Ar["[object Float64Array]"]=Ar["[object Int8Array]"]=Ar["[object Int16Array]"]=Ar["[object Int32Array]"]=Ar["[object Map]"]=Ar["[object Number]"]=Ar["[object Object]"]=Ar["[object RegExp]"]=Ar["[object Set]"]=Ar["[object String]"]=Ar["[object Symbol]"]=Ar["[object Uint8Array]"]=Ar["[object Uint8ClampedArray]"]=Ar["[object Uint16Array]"]=Ar["[object Uint32Array]"]=!0,Ar["[object Error]"]=Ar["[object Function]"]=Ar["[object WeakMap]"]=!1;var wr=function e(t,n,r,i,a,o){var c,s=1&n,u=2&n,l=4&n;if(r&&(c=a?r(t,i,a,o):r(t)),void 0!==c)return c;if(!ct(t))return t;var f=on(t);if(f){if(c=ir(t),!s)return xn(t,c)}else{var p=nr(t),d="[object Function]"==p||"[object GeneratorFunction]"==p;if(Object(cn.a)(t))return Object(Pn.a)(t,s);if("[object Object]"==p||"[object Arguments]"==p||d&&!a){if(c=u||d?{}:vr(t),!s)return u?zn(t,_n(c,t)):Fn(t,jn(c,t))}else{if(!Ar[p])return a?t:{};c=mr(t,p,s)}}o||(o=new $t);var m=o.get(t);if(m)return m;o.set(t,c),Cr(t)?t.forEach((function(i){c.add(e(i,n,r,i,t,o))})):Sr(t)&&t.forEach((function(i,a){c.set(a,e(i,n,r,a,t,o))}));var h=f?void 0:(l?u?Jn:qn:u?Ln:wn)(t);return Kt(h||t,(function(i,a){h&&(i=t[a=i]),Zt(c,a,e(i,n,r,a,t,o))})),c};var jr=function(e){return wr(e,4)};var Ir=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i};var kr=function(e){return"symbol"==typeof e||Ve(e)&&"[object Symbol]"==Me(e)};function Tr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Tr.Cache||Ht),n}Tr.Cache=Ht;var Lr=Tr;var _r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pr=/\\(\\)?/g,xr=function(e){var t=Lr(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(_r,(function(e,n,r,i){t.push(r?i.replace(Pr,"$1"):n||e)})),t}));var Nr=function(e){if("string"==typeof e||kr(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Rr=ke?ke.prototype:void 0,Dr=Rr?Rr.toString:void 0;var Mr=function e(t){if("string"==typeof t)return t;if(on(t))return Ir(t,e)+"";if(kr(t))return Dr?Dr.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var Ur=function(e){return null==e?"":Mr(e)};var Fr=function(e){return on(e)?Ir(e,Nr):kr(e)?[e]:xn(xr(Ur(e)))};var Vr=function(e,t){},Br=n(61),zr=n(62),Hr=n.n(zr);var qr=function(e){return wr(e,5)};function Jr(){return(Jr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function $r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Kr(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function Yr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Gr=function(e){return"function"==typeof e},Wr=function(e){return null!==e&&"object"==typeof e},Zr=function(e){return String(Math.floor(Number(e)))===e},Qr=function(e){return"[object String]"===Object.prototype.toString.call(e)},Xr=function(e){return 0===l.Children.count(e)},ei=function(e){return Wr(e)&&Gr(e.then)};function ti(e,t,n,r){void 0===r&&(r=0);for(var i=Fr(t);e&&r<i.length;)e=e[i[r++]];return void 0===e?n:e}function ni(e,t,n){for(var r=jr(e),i=r,a=0,o=Fr(t);a<o.length-1;a++){var c=o[a],s=ti(e,o.slice(0,a+1));if(s&&(Wr(s)||Array.isArray(s)))i=i[c]=jr(s);else{var u=o[a+1];i=i[c]=Zr(u)&&Number(u)>=0?[]:{}}}return(0===a?e:i)[o[a]]===n?e:(void 0===n?delete i[o[a]]:i[o[a]]=n,0===a&&void 0===n&&delete r[o[a]],r)}function ri(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var i=0,a=Object.keys(e);i<a.length;i++){var o=a[i],c=e[o];Wr(c)?n.get(c)||(n.set(c,!0),r[o]=Array.isArray(c)?[]:{},ri(c,t,n,r[o])):r[o]=t}return r}var ii=Object(l.createContext)(void 0),ai=ii.Provider,oi=ii.Consumer;function ci(){var e=Object(l.useContext)(ii);return e||Vr(!1),e}function si(e,t){switch(t.type){case"SET_VALUES":return Jr({},e,{values:t.payload});case"SET_TOUCHED":return Jr({},e,{touched:t.payload});case"SET_ERRORS":return Jr({},e,{errors:t.payload});case"SET_STATUS":return Jr({},e,{status:t.payload});case"SET_ISSUBMITTING":return Jr({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return Jr({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return Jr({},e,{values:ni(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return Jr({},e,{touched:ni(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return Jr({},e,{errors:ni(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return Jr({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return Jr({},e,{touched:ri(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return Jr({},e,{isSubmitting:!1});default:return e}}var ui={},li={};function fi(e){var t=e.validateOnChange,n=void 0===t||t,r=e.validateOnBlur,i=void 0===r||r,a=e.validateOnMount,o=void 0!==a&&a,c=e.isInitialValid,s=e.enableReinitialize,u=void 0!==s&&s,f=e.onSubmit,p=Kr(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),d=Jr({validateOnChange:n,validateOnBlur:i,validateOnMount:o,onSubmit:f},p),m=Object(l.useRef)(d.initialValues),h=Object(l.useRef)(d.initialErrors||ui),y=Object(l.useRef)(d.initialTouched||li),v=Object(l.useRef)(d.initialStatus),b=Object(l.useRef)(!1),g=Object(l.useRef)({});Object(l.useEffect)((function(){0}),[]),Object(l.useEffect)((function(){return b.current=!0,function(){b.current=!1}}),[]);var S=Object(l.useReducer)(si,{values:d.initialValues,errors:d.initialErrors||ui,touched:d.initialTouched||li,status:d.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),E=S[0],O=S[1],C=Object(l.useCallback)((function(e,t){return new Promise((function(n,r){var i=d.validate(e,t);null==i?n(ui):ei(i)?i.then((function(e){n(e||ui)}),(function(e){r(e)})):n(i)}))}),[d.validate]),A=Object(l.useCallback)((function(e,t){var n=d.validationSchema,r=Gr(n)?n(t):n,i=t&&r.validateAt?r.validateAt(t,e):function(e,t,n,r){void 0===n&&(n=!1);void 0===r&&(r={});var i=function e(t){var n={};for(var r in t)if(t.hasOwnProperty(r)){var i=String(r);!0===Array.isArray(t[i])?n[i]=t[i].map((function(t){return!0===Array.isArray(t)||$e(t)?e(t):""!==t?t:void 0})):$e(t[i])?n[i]=e(t[i]):n[i]=""!==t[i]?t[i]:void 0}return n}(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}(e,r);return new Promise((function(e,t){i.then((function(){e(ui)}),(function(n){"ValidationError"===n.name?e(function(e){var t={};if(e.inner){if(0===e.inner.length)return ni(t,e.path,e.message);var n=e.inner,r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if((i=n.next()).done)break;a=i.value}var o=a;ti(t,o.path)||(t=ni(t,o.path,o.message))}}return t}(n)):t(n)}))}))}),[d.validationSchema]),w=Object(l.useCallback)((function(e,t){return new Promise((function(n){return n(g.current[e].validate(t))}))}),[]),j=Object(l.useCallback)((function(e){var t=Object.keys(g.current).filter((function(e){return Gr(g.current[e].validate)})),n=t.length>0?t.map((function(t){return w(t,ti(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then((function(e){return e.reduce((function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=ni(e,t[r],n)),e}),{})}))}),[w]),I=Object(l.useCallback)((function(e){return Promise.all([j(e),d.validationSchema?A(e):{},d.validate?C(e):{}]).then((function(e){var t=e[0],n=e[1],r=e[2];return je.all([t,n,r],{arrayMerge:di})}))}),[d.validate,d.validationSchema,j,C,A]),k=hi((function(e){return void 0===e&&(e=E.values),Object(Br.unstable_runWithPriority)(Br.LowPriority,(function(){return I(e).then((function(e){return b.current&&O({type:"SET_ERRORS",payload:e}),e}))}))})),T=hi((function(e){return void 0===e&&(e=E.values),O({type:"SET_ISVALIDATING",payload:!0}),I(e).then((function(e){return b.current&&(O({type:"SET_ISVALIDATING",payload:!1}),Se()(E.errors,e)||O({type:"SET_ERRORS",payload:e})),e}))}));Object(l.useEffect)((function(){o&&!0===b.current&&k(d.initialValues)}),[d.initialValues,o,k]);var L=Object(l.useCallback)((function(e){var t=e&&e.values?e.values:m.current,n=e&&e.errors?e.errors:h.current?h.current:d.initialErrors||{},r=e&&e.touched?e.touched:y.current?y.current:d.initialTouched||{},i=e&&e.status?e.status:v.current?v.current:d.initialStatus;m.current=t,h.current=n,y.current=r,v.current=i,O({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:i,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})}),[d.initialErrors,d.initialStatus,d.initialTouched]);Object(l.useEffect)((function(){u&&!0===b.current&&!Se()(m.current,d.initialValues)&&(m.current=d.initialValues,L())}),[u,d.initialValues,L]),Object(l.useEffect)((function(){u&&!0===b.current&&!Se()(h.current,d.initialErrors)&&(h.current=d.initialErrors||ui,O({type:"SET_ERRORS",payload:d.initialErrors||ui}))}),[u,d.initialErrors]),Object(l.useEffect)((function(){u&&!0===b.current&&!Se()(y.current,d.initialTouched)&&(y.current=d.initialTouched||li,O({type:"SET_TOUCHED",payload:d.initialTouched||li}))}),[u,d.initialTouched]),Object(l.useEffect)((function(){u&&!0===b.current&&!Se()(v.current,d.initialStatus)&&(v.current=d.initialStatus,O({type:"SET_STATUS",payload:d.initialStatus}))}),[u,d.initialStatus,d.initialTouched]);var _=hi((function(e){if(Gr(g.current[e].validate)){var t=ti(E.values,e),n=g.current[e].validate(t);return ei(n)?(O({type:"SET_ISVALIDATING",payload:!0}),n.then((function(e){return e})).then((function(t){O({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),O({type:"SET_ISVALIDATING",payload:!1})}))):(O({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return Promise.resolve()})),P=Object(l.useCallback)((function(e,t){var n=t.validate;g.current[e]={validate:n}}),[]),x=Object(l.useCallback)((function(e){delete g.current[e]}),[]),N=hi((function(e){return O({type:"SET_TOUCHED",payload:e}),i?k(E.values):Promise.resolve()})),R=Object(l.useCallback)((function(e){O({type:"SET_ERRORS",payload:e})}),[]),D=hi((function(e){return O({type:"SET_VALUES",payload:e}),n?k(e):Promise.resolve()})),M=Object(l.useCallback)((function(e,t){O({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),U=hi((function(e,t,r){return void 0===r&&(r=!0),O({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),n&&r?k(ni(E.values,e,t)):Promise.resolve()})),F=Object(l.useCallback)((function(e,t){var n,r=t,i=e;if(!Qr(e)){e.persist&&e.persist();var a=e.target,o=a.type,c=a.name,s=a.id,u=a.value,l=a.checked,f=(a.outerHTML,a.options),p=a.multiple;r=t||(c||s),i=/number|range/.test(o)?(n=parseFloat(u),isNaN(n)?"":n):/checkbox/.test(o)?function(e,t,n){if("true"==n||"false"==n)return!!t;if(t&&n)return Array.isArray(e)?e.concat(n):[n];if(!Array.isArray(e))return!e;var r=e.indexOf(n);if(r<0)return e;return e.slice(0,r).concat(e.slice(r+1))}(ti(E.values,r),l,u):p?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(f):u}r&&U(r,i)}),[U,E.values]),V=Object(l.useCallback)((function(e){if(Qr(e))return function(t){return F(t,e)};F(e)}),[F]),B=hi((function(e,t,n){return void 0===t&&(t=!0),void 0===n&&(n=!0),O({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),i&&n?k(E.values):Promise.resolve()})),z=Object(l.useCallback)((function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,i=n.id,a=(n.outerHTML,t||(r||i));B(a,!0)}),[B]),H=Object(l.useCallback)((function(e){if(Qr(e))return function(t){return z(t,e)};z(e)}),[z]),q=Object(l.useCallback)((function(e){Gr(e)?O({type:"SET_FORMIK_STATE",payload:e}):O({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),J=Object(l.useCallback)((function(e){O({type:"SET_STATUS",payload:e})}),[]),$=Object(l.useCallback)((function(e){O({type:"SET_ISSUBMITTING",payload:e})}),[]),K={resetForm:L,validateForm:T,validateField:_,setErrors:R,setFieldError:M,setFieldTouched:B,setFieldValue:U,setStatus:J,setSubmitting:$,setTouched:N,setValues:D,setFormikState:q},Y=hi((function(){return f(E.values,K)})),G=hi((function(){return O({type:"SUBMIT_ATTEMPT"}),T().then((function(e){if(0===Object.keys(e).length){var t=Y();if(void 0===t)return;return Promise.resolve(t).then((function(){b.current&&O({type:"SUBMIT_SUCCESS"})})).catch((function(e){if(b.current)throw O({type:"SUBMIT_FAILURE"}),e}))}b.current&&O({type:"SUBMIT_FAILURE"})}))})),W=hi((function(e){e&&e.preventDefault&&Gr(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Gr(e.stopPropagation)&&e.stopPropagation(),G()})),Z=hi((function(e){if(e&&e.preventDefault&&Gr(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&Gr(e.stopPropagation)&&e.stopPropagation(),d.onReset){var t=d.onReset(E.values,K);ei(t)?t.then(L):L()}else L()})),Q=Object(l.useCallback)((function(e){return{value:ti(E.values,e),error:ti(E.errors,e),touched:!!ti(E.touched,e),initialValue:ti(m.current,e),initialTouched:!!ti(y.current,e),initialError:ti(h.current,e)}}),[E.errors,E.touched,E.values]),X=Object(l.useCallback)((function(e){var t=Wr(e),n=t?e.name:e,r=ti(E.values,n),i={name:n,value:r,onChange:V,onBlur:H};if(t){var a=e.type,o=e.value,c=e.as,s=e.multiple;"checkbox"===a?void 0===o?i.checked=!!r:(i.checked=!(!Array.isArray(r)||!~r.indexOf(o)),i.value=o):"radio"===a?(i.checked=r===o,i.value=o):"select"===c&&s&&(i.value=i.value||[],i.multiple=!0)}return i}),[H,V,E.values]),ee=Object(l.useMemo)((function(){return!Se()(m.current,E.values)}),[E.values]),te=Object(l.useMemo)((function(){return void 0!==c?ee?E.errors&&0===Object.keys(E.errors).length:!1!==c&&Gr(c)?c(d):c:E.errors&&0===Object.keys(E.errors).length}),[c,ee,E.errors,d]);return Jr({},E,{initialValues:m.current,initialErrors:h.current,initialTouched:y.current,initialStatus:v.current,handleBlur:H,handleChange:V,handleReset:Z,handleSubmit:W,resetForm:L,setErrors:R,setFormikState:q,setFieldTouched:B,setFieldValue:U,setFieldError:M,setStatus:J,setSubmitting:$,setTouched:N,setValues:D,submitForm:G,validateForm:T,validateField:_,isValid:te,dirty:ee,unregisterField:x,registerField:P,getFieldProps:X,getFieldMeta:Q,validateOnBlur:i,validateOnChange:n,validateOnMount:o})}function pi(e){var t=fi(e),n=e.component,r=e.children,i=e.render;return Object(l.useEffect)((function(){0}),[]),Object(l.createElement)(ai,{value:t},n?Object(l.createElement)(n,t):i?i(t):r?Gr(r)?r(t):Xr(r)?null:l.Children.only(r):null)}function di(e,t,n){var r=e.slice();return t.forEach((function(t,i){if(void 0===r[i]){var a=!1!==n.clone&&n.isMergeableObject(t);r[i]=a?je(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[i]=je(e[i],t,n):-1===e.indexOf(t)&&r.push(t)})),r}var mi="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?l.useLayoutEffect:l.useEffect;function hi(e){var t=Object(l.useRef)(e);return mi((function(){t.current=e})),Object(l.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.current.apply(void 0,n)}),[])}function yi(e){var t=e.validate,n=e.name,r=e.render,i=e.children,a=e.as,o=e.component,c=Kr(e,["validate","name","render","children","as","component"]),s=ci(),u=(s.validate,s.validationSchema,Kr(s,["validate","validationSchema"]));Object(l.useEffect)((function(){0}),[]);var f=u.registerField,p=u.unregisterField;Object(l.useEffect)((function(){return f(n,{validate:t}),function(){p(n)}}),[f,p,n,t]);var d=u.getFieldProps(Jr({name:n},c)),m=u.getFieldMeta(n),h={field:d,form:u};if(r)return r(Jr({},h,{meta:m}));if(Gr(i))return i(Jr({},h,{meta:m}));if(o){if("string"==typeof o){var y=c.innerRef,v=Kr(c,["innerRef"]);return Object(l.createElement)(o,Jr({ref:y},d,v),i)}return Object(l.createElement)(o,Jr({field:d,form:u},c),i)}var b=a||"input";if("string"==typeof b){var g=c.innerRef,S=Kr(c,["innerRef"]);return Object(l.createElement)(b,Jr({ref:g},d,S),i)}return Object(l.createElement)(b,Jr({},d,c),i)}var vi=Object(l.forwardRef)((function(e,t){var n=e.action,r=Kr(e,["action"]),i=n||"#",a=ci(),o=a.handleReset,c=a.handleSubmit;return Object(l.createElement)("form",Object.assign({onSubmit:c,ref:t,onReset:o,action:i},r))}));function bi(e){var t=function(t){return Object(l.createElement)(oi,null,(function(n){return n||Vr(!1),Object(l.createElement)(e,Object.assign({},t,{formik:n}))}))},n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return t.WrappedComponent=e,t.displayName="FormikConnect("+n+")",Hr()(t,e)}vi.displayName="Form";var gi=function(e,t,n){var r=Si(e);return r.splice(t,0,n),r},Si=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map((function(e){return parseInt(e)})).reduce((function(e,t){return t>e?t:e}),0);return Array.from(Jr({},e,{length:t+1}))}return[]},Ei=function(e){function t(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var i=n.props,a=i.name,o=i.validateOnChange,c=i.formik,s=c.setFormikState,u=c.validateForm;s((function(n){var i="function"==typeof r?r:e,o="function"==typeof t?t:e;return Jr({},n,{values:ni(n.values,a,e(ti(n.values,a))),errors:r?ni(n.errors,a,i(ti(n.errors,a))):n.errors,touched:t?ni(n.touched,a,o(ti(n.touched,a))):n.touched})}),(function(){o&&u()}))},n.push=function(e){return n.updateArrayField((function(t){return[].concat(Si(t),[qr(e)])}),!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Si(e),i=r[t];return r[t]=r[n],r[n]=i,r}(n,e,t)}),!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Si(e),i=r[t];return r.splice(t,1),r.splice(n,0,i),r}(n,e,t)}),!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField((function(n){return gi(n,e,t)}),(function(t){return gi(t,e,null)}),(function(t){return gi(t,e,null)}))},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=Si(e);return r[t]=n,r}(n,e,t)}),!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField((function(n){var r=n?[e].concat(n):[e];return t<0&&(t=r.length),r}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n})),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(Yr(n)),n.pop=n.pop.bind(Yr(n)),n}$r(t,e);var n=t.prototype;return n.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?Si(n):[];return t||(t=r[e]),Gr(r.splice)&&r.splice(e,1),r}),!0,!0),t},n.pop=function(){var e;return this.updateArrayField((function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n}),!0,!0),e},n.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,i=t.children,a=t.name,o=t.formik,c=(o.validate,o.validationSchema,Jr({},e,{form:Kr(o,["validate","validationSchema"]),name:a}));return n?Object(l.createElement)(n,c):r?r(c):i?"function"==typeof i?i(c):Xr(i)?null:l.Children.only(i):null},t}(l.Component);Ei.defaultProps={validateOnChange:!0};var Oi=bi(function(e){function t(){return e.apply(this,arguments)||this}$r(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return ti(this.props.formik.errors,this.props.name)!==ti(e.formik.errors,this.props.name)||ti(this.props.formik.touched,this.props.name)!==ti(e.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length},n.render=function(){var e=this.props,t=e.component,n=e.formik,r=e.render,i=e.children,a=e.name,o=Kr(e,["component","formik","render","children","name"]),c=ti(n.touched,a),s=ti(n.errors,a);return c&&s?r?Gr(r)?r(s):null:i?Gr(i)?i(s):null:t?Object(l.createElement)(t,o,s):s:null},t}(l.Component));(function(e){function t(t){var n;n=e.call(this,t)||this;var r=t.render,i=t.children,a=t.component,o=t.as;t.name;return r&&Vr(!1),a&&r&&Vr(!1),o&&i&&Gr(i)&&Vr(!1),a&&i&&Gr(i)&&Vr(!1),r&&i&&!Xr(i)&&Vr(!1),n}$r(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e,t,n){return this.props.shouldUpdate?this.props.shouldUpdate(e,this.props):ti(this.context.values,this.props.name)!==ti(n.values,this.props.name)||ti(this.context.errors,this.props.name)!==ti(n.errors,this.props.name)||ti(this.context.touched,this.props.name)!==ti(n.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(e).length||this.context.isSubmitting!==n.isSubmitting},n.componentDidMount=function(){this.context.registerField(this.props.name,{validate:this.props.validate})},n.componentDidUpdate=function(e){this.props.name!==e.name&&(this.context.unregisterField(e.name),this.context.registerField(this.props.name,{validate:this.props.validate})),this.props.validate!==e.validate&&this.context.registerField(this.props.name,{validate:this.props.validate})},n.componentWillUnmount=function(){this.context.unregisterField(this.props.name)},n.render=function(){var e=this.props,t=(e.validate,e.name),n=e.render,r=e.as,i=e.children,a=e.component,o=(e.shouldUpdate,Kr(e,["validate","name","render","as","children","component","shouldUpdate"])),c=this.context,s=(c.validate,c.validationSchema,Kr(c,["validate","validationSchema"])),u={value:"radio"===o.type||"checkbox"===o.type?o.value:ti(c.values,t),name:t,onChange:c.handleChange,onBlur:c.handleBlur},f={field:u,meta:{value:ti(c.values,t),error:ti(c.errors,t),touched:!!ti(c.touched,t),initialValue:ti(c.initialValues,t),initialTouched:!!ti(c.initialTouched,t),initialError:ti(c.initialErrors,t)},form:s};if(n)return n(f);if(Gr(i))return i(f);if(a){if("string"==typeof a){var p=o.innerRef,d=Kr(o,["innerRef"]);return Object(l.createElement)(a,Jr({ref:p},u,d),i)}return Object(l.createElement)(a,Jr({field:u,form:c},o),i)}var m=r||"input";if("string"==typeof m){var h=o.innerRef,y=Kr(o,["innerRef"]);return Object(l.createElement)(m,Jr({ref:h},u,y),i)}return Object(l.createElement)(m,Jr({},u,o),i)},t}(l.Component)).contextType=ii;var Ci=n(6),Ai=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function wi(e){var t=e.castInitialValues,n=e.castValuesOnSubmit,r=e.initialValues,i=e.onSubmit,a=Ai(e,["castInitialValues","castValuesOnSubmit","initialValues","onSubmit"]),o=t&&e.validationSchema?e.validationSchema.cast(function e(t){var n=Ci.a.deepClone(t);return Object.keys(n).forEach((function(t){n.hasOwnProperty(t)&&(Ci.a.isObject(n[t])?n[t]=e(n[t]):null===n[t]&&delete n[t])})),n}(r)):r,c={allowInitialSubmit:e.allowInitialSubmit};return l.createElement(pi,Object.assign({enableReinitialize:!0},a,{initialValues:o,onSubmit:function(t,r){var a=r.setSubmitting,o=r.resetForm,c=n&&e.validationSchema?e.validationSchema.cast(t):t;i(c,(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.reset&&o(),a(!1)}))},initialStatus:c}),m(e.children)?function(t){return e.children(t)}:l.Children.count(e.children)?e.children:null)}wi.defaultProps={castInitialValues:!0,castValuesOnSubmit:!0};var ji=n(2),Ii=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown(),ki=n(3),Ti=function(e,t,n,r,i){var a="form-control";return"sm"===r&&(a+=" form-control-sm"),"lg"===r&&(a+=" form-control-lg"),ti(t,n)&&ti(e,n)&&(a+=" is-invalid"),i&&(a+=" ".concat(i)),a},Li=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function _i(e){var t=e.label,n=e.checkboxLabelClassName,r=Li(e,["label","checkboxLabelClassName"]);return l.createElement(ki.Form.Group,null,l.createElement("div",{className:"custom-control custom-checkbox"},l.createElement(Vc,Object.assign({className:"custom-control-input"},r)),l.createElement(ki.Form.Label,{className:"custom-control-label cursor-pointer ".concat(n),htmlFor:r.id},t)))}var Pi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return Math.floor(Math.random()*Math.floor(e))};function xi(e){var t=e.title,n=e.placement,r=e.trigger,i=e.spanHack,a=e.children;return i?l.createElement(ki.OverlayTrigger,{placement:n,overlay:l.createElement(ki.Tooltip,{id:"".concat(t,"-").concat(Pi())},t),trigger:r},l.createElement("span",{className:"d-flex justify-content-center align-items-center"},a)):l.createElement(ki.OverlayTrigger,{placement:n,overlay:l.createElement(ki.Tooltip,{id:"".concat(t,"-").concat(Pi())},t),trigger:r},a)}xi.defaultProps={trigger:["hover","click","focus"],placement:"top"};var Ni,Ri,Di=n(37),Mi=n(84),Ui=n.n(Mi),Fi=n(85),Vi=n.n(Fi),Bi=n(86),zi=n.n(Bi),Hi=n(87),qi=n.n(Hi),Ji=(n(88),n(89),n(90)),$i=n.n(Ji),Ki=n(91),Yi=n.n(Ki),Gi=n(92),Wi=n.n(Gi),Zi=n(93),Qi=n.n(Zi),Xi=n(94),ea=n.n(Xi),ta=n(95),na=n.n(ta),ra=n(96),ia=n.n(ra),aa=n(97),oa=n.n(aa),ca=n(98),sa=n.n(ca),ua=n(99),la=n.n(ua),fa=n(100),pa=n.n(fa),da=n(101),ma=n.n(da),ha=n(102),ya=n.n(ha),va=n(103),ba=n.n(va),ga=n(104),Sa=n.n(ga),Ea=n(105),Oa=n.n(Ea),Ca=n(106),Aa=n.n(Ca),wa=n(107),ja=n.n(wa),Ia=n(108),ka=n.n(Ia),Ta=n(109),La=n.n(Ta),_a=n(110),Pa=n.n(_a),xa=n(111),Na=n.n(xa),Ra=n(112),Da=n.n(Ra),Ma=n(113),Ua=n.n(Ma),Fa=n(114),Va=n.n(Fa),Ba=n(115),za=n.n(Ba),Ha=n(116),qa=n.n(Ha),Ja=n(117),$a=n.n(Ja),Ka=(n(118),n(119),n(120)),Ya=n.n(Ka),Ga=n(121),Wa=n.n(Ga),Za=n(122),Qa=n.n(Za),Xa=n(123),eo=n.n(Xa),to=n(124),no=n.n(to),ro=n(125),io=n.n(ro),ao=(n(126),n(127)),oo=n.n(ao),co=n(128),so=n.n(co),uo=n(129),lo=n.n(uo),fo=n(130),po=n.n(fo),mo=n(131),ho=n.n(mo),yo=n(132),vo=n.n(yo),bo=n(133),go=n.n(bo),So=(n(134),n(135)),Eo=n.n(So),Oo=n(136),Co=n.n(Oo),Ao=n(137),wo=n.n(Ao),jo=n(138),Io=n.n(jo),ko=n(139),To=n.n(ko),Lo=n(140),_o=n.n(Lo),Po=n(141),xo=n.n(Po),No=n(142),Ro=n.n(No),Do=n(143),Mo=n.n(Do),Uo=n(144),Fo=n.n(Uo),Vo=n(145),Bo=n.n(Vo),zo=n(146),Ho=n.n(zo),qo=n(147),Jo=n.n(qo),$o=n(148),Ko=n.n($o),Yo=n(149),Go=n.n(Yo),Wo=n(150),Zo=n.n(Wo),Qo=n(151),Xo=n.n(Qo),ec=n(152),tc=n.n(ec),nc=n(153),rc=n.n(nc),ic=n(154),ac=n.n(ic),oc=(n(155),n(156),n(157),n(158)),cc=n.n(oc),sc=(n(159),n(160),n(161),n(162),n(163)),uc=n.n(sc),lc=n(164),fc=n.n(lc),pc=(n(165),n(166),n(167),n(168)),dc=n.n(pc),mc=n(169),hc=n.n(mc),yc=n(170),vc=n.n(yc),bc=n(171),gc=n.n(bc),Sc=n(172),Ec=n.n(Sc),Oc=n(173),Cc=n.n(Oc),Ac=n(174),wc=n.n(Ac),jc=(n(175),n(176),n(177),n(178)),Ic=n.n(jc),kc=n(179),Tc=n.n(kc),Lc=[Ui.a,zi.a,qi.a,$i.a,Qi.a,ea.a,na.a,ia.a,Wi.a,Vi.a,oa.a,sa.a,la.a,pa.a,ma.a,Yi.a,ya.a,ba.a,Sa.a,Oa.a,Aa.a,ja.a,ka.a,Ua.a,Va.a,La.a,Pa.a,Na.a,Da.a,za.a,Qa.a,Ho.a,Ko.a,Jo.a,tc.a,Go.a,Zo.a,Xo.a,po.a,vo.a,ho.a,qa.a,$a.a,so.a,lo.a,oo.a,Ya.a,eo.a,Co.a,wo.a,no.a,io.a,Io.a,Wa.a,Eo.a,To.a,_o.a,go.a,xo.a,Mo.a,Ro.a,rc.a,ac.a,Fo.a,Bo.a,uc.a,fc.a,cc.a,vc.a,hc.a,dc.a,gc.a,Cc.a,Ec.a,wc.a,Tc.a,Ic.a];function _c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e){e.AddToPlaylists="add-to-playlist",e.Caret="caret",e.Delete="delete",e.Edit="edit",e.NoEdit="no-edit",e.Close="close",e.Folder="folder",e.Resources="resources",e.More="more",e.Bell="bell",e.Plus="plus",e.Search="search",e.Share="share",e.Share2="share2",e.Upload="upload",e.Preview="preview",e.CircleCheck="circle-check",e.Down="down",e.Right="right",e.UpDown="up-down",e.ChevronUp="chevron-up",e.ChevronDown="chevron-down",e.ChevronLeft="chevron-left",e.ChevronRight="chevron-right",e.VisibleOff="visible-off",e.VisibleOn="visible-on",e.PublisherArchive="publisher-archive",e.Play="play",e.PlayCircle="play-circle",e.ArrowLeft="arrow-left",e.ArrowRight="arrow-right",e.CheckCircleOutline="check-circle-o",e.CheckCircle="check-circle",e.Check="check",e.Lock="lock",e.Link="link",e.Info="info",e.Question="question",e.Star="star",e.StarOutline="star-o",e.Archive="archive",e.Warning="warning",e.WarningOutline="warning-o",e.NewWindow="new-window",e.File="file",e.FilePDF="file-pdf",e.FileExcel="file-excel",e.FilePowerpoint="file-ppt",e.FileWord="file-word",e.FileImg="file-img",e.FileZip="file-zip",e.Enter="enter",e.Calendar="calendar",e.CloseCaption="close-caption",e.CloseCaptionBadge="close-caption-badge",e.Playlist="playlist",e.Handle="handle",e.Subject="subject",e.Series="series",e.EditClickView="edit-clickview",e.Heart="heart",e.HeartOutline="heart-outline",e.WhiteWave="white-wave",e.Cog="cog",e.Video="video",e.Compass="compass",e.History="history",e.Tag="tag",e.Email="email",e.YearLevel="year-level",e.Subjects="subjects",e.Download="download",e.Print="print",e.CreateInteractive="create-interactive",e.Twitter="twitter",e.Facebook="facebook",e.Classrooms="classrooms",e.Group="group"}(Ni||(Ni={}));var Pc;function xc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}d.extend(Di.config,{autoReplaceSvg:!1,autoAddCss:!1,familyPrefix:"cv",autoA11y:!0,observeMutations:!1,replacementClass:"cv-svg",keepOriginalSource:!1}),(Ri=Di.library).add.apply(Ri,function(e){if(Array.isArray(e))return _c(e)}(Pc=Lc)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(Pc)||function(e,t){if(e){if("string"==typeof e)return _c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_c(e,t):void 0}}(Pc)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());var Nc,Rc=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"getSvg",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.faIconLookup(e,t),r=this.getIcon(n,t);if(r&&(!r||r.html.length))return r.html.pop()}},{key:"getIcon",value:function(e,t){return Di.icon(e,t.iconOptions||{})}},{key:"faIconLookup",value:function(e,t){var n=t.prefix,r=void 0===n?"cv":n;return Di.findIconDefinition({prefix:r,iconName:e})}}])&&xc(t.prototype,n),r&&xc(t,r),e}().Instance,Dc=Ni;function Mc(e){var t=e.svgName,n=e.className,r=void 0===n?"d-inline-block svg-container":n,i=e.tagName,a=void 0===i?"span":i,o=e.size,c=void 0===o?Nc.Standard:o,s=e.onClick,u=e.title,f=e.tooltipPlacement,p=void 0===f?"right":f,d=a,h={dangerouslySetInnerHTML:{__html:Rc.getSvg(t)},className:"".concat(r," ").concat(c),onClick:m(s)?s:null};return u?l.createElement(xi,{title:u,placement:p},l.createElement(d,Object.assign({},h))):l.createElement(d,Object.assign({},h))}function Uc(e){var t=ci().values[e.fieldName];return"string"!=typeof t?l.createElement(l.Fragment,null):l.createElement("div",{className:"float-right text-muted"},t.length,"/",e.limit)}!function(e){e.Standard="std",e.Small="sm",e.Medium="md",e.Large="lg",e.ExtraLarge="xlg",e.XXL="xxlg"}(Nc||(Nc={}));var Fc=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Vc(e){var t=e.children,n=Fc(e,["children"]);return l.createElement(yi,Object.assign({},Ci.a.omit(n,["formSize"])),m(t)?function(e){return t(e)}:l.Children.count(t)?t:null)}function Bc(e){var t=e.label,n=e.className,r=e.showCharacterCounter,i=e.showRequiredStar,a=e.infoTooltip,o=e.formSize,c=Fc(e,["label","className","showCharacterCounter","showRequiredStar","infoTooltip","formSize"]),s=ci(),u=s.errors,f=s.touched;return"checkbox"===c.type?l.createElement(_i,Object.assign({},Ci.a.omit(e,["formSize"]))):l.createElement(ki.Form.Group,null,!!t&&l.createElement(ki.Form.Label,{htmlFor:c.id},t,i&&l.createElement("span",{className:"text-danger"},"*"),a&&l.createElement(xi,{title:a},l.createElement("span",null,l.createElement(Mc,{svgName:Dc.Info})))),l.createElement(Vc,Object.assign({className:Ti(u,f,c.name,o,n)},c)),!!r&&!!c.maxLength&&l.createElement(Uc,{fieldName:c.name,limit:c.maxLength}),l.createElement(Oi,{name:c.name},(function(e){return l.createElement(ki.Form.Control.Feedback,{type:"invalid"},e)})))}function zc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Hc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hc(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qc(e){var t,n=zc(l.useState(!1),2),r=n[0],i=n[1];return l.useEffect((function(){var t;e.isValid&&(e.dirty||(null===(t=e.initialStatus)||void 0===t?void 0:t.allowInitialSubmit))?i(!0):i(!1)}),[e.isValid,null===(t=e.initialStatus)||void 0===t?void 0:t.allowInitialSubmit,e.dirty,e.values]),l.useEffect((function(){e.isSubmitting&&i(!1)}),[e.isSubmitting]),r}var Jc=n(209),$c=n(50),Kc=n(22),Yc=n(4),Gc="AlertService",Wc="LanguageService",Zc=n(11),Qc=n(36);function Xc(e){return(Xc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function es(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ts(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ns(e,t){return(ns=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function rs(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=as(e);if(t){var i=as(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return is(this,n)}}function is(e,t){return!t||"object"!==Xc(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function as(e){return(as=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function os(e){return $c.sanitize(e).replace("&amp;","&")}var cs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ns(e,t)}(a,e);var t,n,r,i=rs(a);function a(){return es(this,a),i.apply(this,arguments)}return t=a,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"name",get:function(){return Wc}},{key:"setConfig",value:function(e){this.polyglot=new Jc({locale:e.locale,phrases:e.phrases.rootElement||e.phrases}),this.cache={}}},{key:"getPhrase",value:function(e,t,n){var r="".concat(e,".").concat(t);if(this.polyglot||Yc.c.throw(new Zc.a("LanguageService config must be set.")),!this.polyglot.has(r)){if(!Qc.a.isDevelopment){var i=window.trackJs;return i&&i.console.error("No phrase set for ".concat(r," in language config")),""}Yc.c.throw(new Zc.a("No phrase set for ".concat(r," in language config.")))}if(!n||d.isEmpty(n)){var a=this.cache[r];if(a)return a;var o=this.polyglot.t(r);return this.cache[r]=o,o}var c=d.omit(n,"smartCount"),s={};for(var u in c){var l=c[u];"number"==typeof l&&(l=l.toString()),s[u]=os(l)}d.isNumber(n.smartCount)&&(s.smart_count=n.smartCount);var f="".concat(r,":").concat(d.values(Object.assign({},s)).join(":")),p=this.cache[f];if(p)return p;var m=this.polyglot.t(r,s);return this.cache[f]=m,m}},{key:"encloseNamespace",value:function(e){var t=this;return function(n,r){return t.getPhrase(e,n,r)}}}])&&ts(t.prototype,n),r&&ts(t,r),a}(Kc.a).Instance,ss=l.createContext(""),us=l.memo((function(e){var t=e.phrase,n=e.namespace,r=e.options,i=l.useContext(ss),a=n||i,o=cs.getPhrase(a,t,r);return l.createElement("span",{dangerouslySetInnerHTML:{__html:o}})}),(function(e,t){return e.namespace===t.namespace&&e.phrase===t.phrase&&Ci.a.isEqual(e.options,t.options)}));function ls(e){var t=ci(),n=qc(t);return l.createElement(ki.Button,{variant:e.variant||"primary",type:"submit",disabled:!n,size:e.size},t.isSubmitting?l.createElement(ki.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):e.submitText?l.createElement(l.Fragment,null,e.submitText):l.createElement(us,{namespace:"shared.formButtons",phrase:e.isNew?"create":"save"}))}function fs(e){var t=ci();return l.createElement(vi,null,l.createElement(Bc,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this company",autoFocus:!0}),l.createElement(ls,{isNew:e.isNew}))}function ps(e){return l.createElement(wi,{initialValues:e.company,validationSchema:Ii,onSubmit:e.saveCompany},l.createElement(fs,{isNew:!(e.company&&e.company.id)}))}function ds(e){var t=Object(v.useDispatch)(),n=oe.useBasicFetch(ye(e.id));return l.createElement(l.Fragment,null,!!n.data&&l.createElement(ps,{company:n.data,saveCompany:function(n,r){return oe.fetch(t,be(e.id,n,r))}}))}function ms(){var e=Object(v.useDispatch)();return l.createElement(ps,{saveCompany:function(t,n){oe.fetch(e,ve(t,(function(e){n(),p.AppLinkHelper.trigger({application:c.PEOPLE,action:i.Companies.EDIT_COMPANY,args:[e.id]})}),n))}})}var hs,ys=n(210);function vs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bs(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gs(e){return(gs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e){e.XS="(max-width: 575px)",e.SM="(min-width: 576px) and (max-width: 767px)",e.MD="(min-width: 768px) and (max-width: 991px)",e.LG="(min-width: 992px)",e.XL="(min-width: 1200px)",e.XXL="(min-width: 1440px)",e.SMDown="(max-width: 576px)",e.MDDown="(max-width: 768px)",e.LGDown="(max-width: 992px)",e.XLDown="(max-width: 1200px)"}(hs||(hs={}));var Ss={isNumber:function(e){return Ss.isType(e,"number")},isString:function(e){return Ss.isType(e,"string")},isType:function(e,t){return gs(e)===t}},Es=n(21),Os=n.n(Es);function Cs(e){return function(e){if(Array.isArray(e))return As(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return As(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return As(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function As(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ws(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var js,Is=[{empty:!0}];function ks(e,t){return Ci.a.isObject(e)&&e.hasOwnProperty(t)&&Ss.isString(e[t])}function Ts(e,t,n){return function(r){var i=r.value;if(i.length||n(),!(i.length<e.activationLength)){if(e.local){var a=m(e.getLocalSuggestions)?e.getLocalSuggestions(i,e.local):(c=i,s=e.local,u=e.valueKey,(l=c.trim().toLowerCase()).length?s.filter((function(e){return!(!ks(e,u)||!Ss.isString(e[u]))&&e[u].trim().toLowerCase().includes(l)})):[]),o=!a.length&&e.getEmptyStateComponent;t((function(e){var t;return Object.assign(Object.assign({},e),(ws(t={},js.Local,a),ws(t,js.Empty,o?Is:[]),t))}))}var c,s,u,l;e.getRemoteUrl&&function(e,t,n,r){var i=m(e)&&e(t);i&&oe.ajaxRequest({resource:i,type:ce.a.GET,success:n,error:function(){},headers:r})}(e.getRemoteUrl,i,(function(n){var r=m(e.formatRemoteSuggestions)?e.formatRemoteSuggestions(n):n,i=!r.length&&e.getEmptyStateComponent;t((function(e){var t;return Object.assign(Object.assign({},e),(ws(t={},js.Remote,r),ws(t,js.Empty,i?Is:[]),t))}))}),e.requestHeaders)}}}function Ls(e,t,n,r,i,a,o){var c=function(t){return e[t]||[]},s=t?c(js.Recent):[],u=c(js.Local),l=c(js.Remote),f=c(js.Empty);if(f.length&&n)return[{data:f}];var p=[];s.length&&p.push({title:r,data:s});var d=[].concat(Cs(u),Cs(l));return d.length?(Number.isInteger(o)&&d.length>o&&(d=d.slice(0,o)),m(a)?p.push.apply(p,Cs(a(d))):p.push({title:i,data:d}),p):p}function _s(e){return e.data}function Ps(e){if(e.title)return l.createElement("div",{className:"pb-1"},l.createElement("strong",null,e.title))}function xs(e){return{container:"position-relative",suggestionsContainerOpen:"bg-white py-1 border rounded ".concat(Os.a.suggestionsContainerOpen),suggestionsList:"list-unstyled m-0",suggestion:"".concat(e?"":"cursor-pointer"," py-1 px-2"),suggestionHighlighted:e?"":Os.a.suggestionHighlighted,sectionContainer:"border-bottom py-1 ".concat(Os.a.sectionContainer)}}function Ns(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=xs(t),r=Object.assign(n,e);return r}!function(e){e.Local="local",e.Recent="recent",e.Remote="remote",e.Empty="empty"}(js||(js={}));var Rs=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Ds(e,t,n,r,i){var a="form-control";return n||(a+=" ".concat(Os.a.inputWithoutHighlight)),"left"===e&&(a+=" ".concat(Os.a.inputWithLeftIcon)),("right"===e&&!t||"left"===e&&t)&&(a+=" ".concat(Os.a.inputWithRightIcon)),"right"===e&&t&&(a+=" ".concat(Os.a.inputWithTwoRightIcons)),"lg"===i&&(a+=" form-control-lg"),"sm"===i&&(a+=" form-control-sm"),r&&(a+="".concat(r)),a}function Ms(e){var t="d-inline-block svg-container";return m(e)?t+" cursor-pointer":t}function Us(e){var t=e.onClickSearchIcon,n=e.searchIconPlacement,r=e.showClearInputIcon,i=e.onClickClearInput,a=e.highlightOnFocus,o=e.className,c=e.formSize,s=Rs(e,["onClickSearchIcon","searchIconPlacement","showClearInputIcon","onClickClearInput","highlightOnFocus","className","formSize"]),u=function(){return l.createElement("div",{className:"d-inline-block"},l.createElement(Mc,{svgName:Dc.Search,size:Nc.Standard,onClick:t,className:Ms(t)}))};return l.createElement("div",{className:"position-relative ".concat(Os.a.inputContainer)},"left"===n&&l.createElement("div",{className:"".concat(Os.a.iconContainer," ").concat(Os.a.leftIconContainer)},l.createElement(u,null)),l.createElement("input",Object.assign({className:Ds(n,r,a,o,c)},s)),("right"===n||!!r)&&l.createElement("div",{className:"".concat(Os.a.iconContainer," ").concat(Os.a.rightIconContainer)},!!r&&l.createElement((function(){return l.createElement("div",{className:"d-inline-block text-muted ".concat(Os.a.clearButton)},l.createElement(Mc,{svgName:Dc.Close,size:Nc.Standard,onClick:i,className:Ms(i)}))}),null),"right"===n&&l.createElement(u,null)))}function Fs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vs(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Bs=m;function zs(e){return e.renderAsForm?l.createElement("form",{onSubmit:e.onSubmit},e.children):l.createElement(l.Fragment,null,e.children)}function Hs(e){var t,n,r,i=(t=e.initialSuggestions,n=e.recentSearches,ws(r={},js.Recent,n),ws(r,js.Local,t),ws(r,js.Remote,[]),ws(r,js.Empty,[]),r),a=Fs(l.useState(e.initialQuery||""),2),o=a[0],c=a[1],s=Fs(l.useState(i),2),u=s[0],f=s[1],p=function(e){var t=vs(Object(l.useState)(window.matchMedia(e).matches),2),n=t[0],r=t[1];return Object(l.useEffect)((function(){var t=window.matchMedia(e);t.matches!==n&&r(t.matches);var i=function(){return r(t.matches)};return t.addListener(i),function(){return t.removeListener(i)}}),[e]),n}(hs.XS);l.useEffect((function(){var t=e.initialQuery||"";o!==t&&c(t)}),[e.initialQuery]);var d=function(){f(i)},h=function(t){t.preventDefault(),Bs(e.onSubmit)&&e.onSubmit(o)};return l.createElement(zs,{onSubmit:h,renderAsForm:!!e.renderAsForm},l.createElement(ys,Object.assign({suggestions:Ls(u,!o,!!e.getEmptyStateComponent,e.recentSearchHeading||cs.getPhrase("shared.searchBar","recentSearchHeading"),e.suggestionsHeading,e.getSections,e.suggestionLimit),onSuggestionsFetchRequested:Ts(e,f,d),onSuggestionsClearRequested:function(){e.alwaysRenderSuggestions||d()},onSuggestionSelected:function(t,n){var r=n.suggestion;r.empty||(e.clearQueryOnSelect&&c(""),e.onSuggestionSelected(r))},getSuggestionValue:function(t){return e.updateQueryOnSelection?function(e,t){return ks(t,e)?t[e]:""}(e.valueKey,t):o},renderSuggestion:function(t){return t&&t.empty?o.length>=e.activationLength&&m(e.getEmptyStateComponent)?e.getEmptyStateComponent(o):l.createElement(l.Fragment,null):Bs(e.getSuggestionComponent)?e.getSuggestionComponent(t):function(e,t){return ks(t,e)?l.createElement(l.Fragment,null,t[e]):l.createElement(l.Fragment,null)}(e.valueKey,t)},alwaysRenderSuggestions:e.alwaysRenderSuggestions,focusInputOnSuggestionClick:!p,inputProps:{placeholder:e.placeholder||cs.getPhrase("shared.searchBar","placeholder"),value:o,onChange:function(t,n){var r=n.newValue;c(r),Bs(e.onQueryChange)&&e.onQueryChange(r)},onKeyDown:function(t){8===t.keyCode&&e.onBackspace&&!o&&e.onBackspace()},autoFocus:!!e.autoFocusInput,highlightOnFocus:e.highlightInputOnFocus,onClickSearchIcon:!!e.submitOnClickSearchIcon&&h,searchIconPlacement:e.searchIconPlacement,showClearInputIcon:!!e.showClearInputIcon&&!!o.length,onClickClearInput:function(){c(""),Bs(e.onClickClearInput)&&e.onClickClearInput()},formSize:e.size},renderInputComponent:Us,theme:Ns(e.theme,!!u.empty.find((function(e){return e.empty}))),multiSection:!0,renderSectionTitle:Ps,getSectionSuggestions:_s},e.alwaysRenderSuggestionsOnInputFocus?{shouldRenderSuggestions:function(){return!0}}:{})))}Hs.defaultProps={updateQueryOnSelection:!0,valueKey:"name",activationLength:3,suggestionLimit:5,recentSearches:[],initialSuggestions:[],searchIconPlacement:"right",renderAsForm:!0};var qs,Js=n(13);function $s(e){return($s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ks(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ys(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Gs(e,t){return(Gs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ws(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Qs(e);if(t){var i=Qs(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Zs(this,n)}}function Zs(e,t){return!t||"object"!==$s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Qs(e){return(Qs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Analytics="AnalyticsService",e.Context="ContextService"}(qs||(qs={}));var Xs,eu=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Gs(e,t)}(a,e);var t,n,r,i=Ws(a);function a(){var e;return Ks(this,a),(e=i.apply(this,arguments)).contextHistory=[],e}return t=a,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"name",get:function(){return qs.Context}},{key:"initialize",value:function(){this.listenTo(G.a.SHELL,p.EventNames.ROUTE,this.setContext)}},{key:"setContext",value:function(e){this.contextHistory.length>=5&&this.contextHistory.unshift(),this.contextHistory.push({pageLoad:!this.contextHistory.length,appLink:e})}},{key:"getCurrentContext",value:function(){if(this.contextHistory.length)return this.contextHistory[this.contextHistory.length-1]}},{key:"fromPageLoad",value:function(){return 1===this.contextHistory.length}}])&&Ys(t.prototype,n),r&&Ys(t,r),a}(p.Service)),tu=n(5);!function(e){e.Inlet="event:inlet",e.Outlet="event:outlet"}(Xs||(Xs={}));var nu="global:analytics";function ru(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var iu=Js.EventVersion.V1,au=function(){function e(t,n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=t,this.data=n,this.actionContext=r,this.eventVersion=i||iu}var t,n,r;return t=e,(n=[{key:"isType",value:function(e){return e===this.type}},{key:"enrich",value:function(e,t){this.validateKey(e),this[e]=t}},{key:"get",value:function(e){if(e&&this[e])return this[e]}},{key:"validateKey",value:function(e){"type"!==e&&"data"!==e||p.ErrorHelper.throw(new Zc.a("".concat(e," is not a valid key"))),this[e]&&p.ErrorHelper.throw(new Zc.a("Event already contains an enrichment named ".concat(e)))}}])&&ru(t.prototype,n),r&&ru(t,r),e}(),ou=function(e,t,n,r){tu.Radio.channel(nu).trigger(Xs.Inlet,new au(e,t,n,r))};function cu(){var e=eu.getCurrentContext().appLink;return d.isObject(e)||p.ErrorHelper.throw(new Zc.a("Applink does not exist. Check current context.")),e.application.replace(":","-")}function su(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.location,n=e.entity,r=e.workflowPhase,i=void 0===r?null:r,a=e.descriptor,o=void 0===a?null:a;return t||p.ErrorHelper.throw(new Zc.a("location must be set.")),n||p.ErrorHelper.throw(new Zc.a("entity must be set.")),{productArea:cu(),location:t,entity:n,descriptor:o,workflowPhase:i}}function uu(){return p.LocationUtils.GetCurrentPath()+p.LocationUtils.GetCurrentQueryString()}var lu={logUserAction:function(e,t){if(function(e){return!(!d.isArray(e)||!d.every(e,(function(e){return d.isObject(e)})))||!!d.isObject(e)}(e)&&d.isObject(t)){var n=lu.buildUserActionEvent(t),r=n.userAction,i=n.action,a=n.eventVersion;ou(r,e,i,a)}},logNavigate:function(e,t){var n=Object.assign({currentLocation:uu(),appLink:e},t);ou(Js.UserAction.Navigate,n)},mergeOptions:function(e,t){return d.extend({},e,t)},buildActionContext:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return su(e)},buildUserActionEvent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.actionType,n=e.eventVersion,r=t,i=su(e);return{userAction:r,action:i,eventVersion:n}},buildCurrentLocation:function(){return uu()},buildSearchEvent:function(e,t){return{data:{query:e},action:su({entity:Js.EntityType.Video,location:Js.LocationContext.SearchBar,descriptor:t})}},buildInstantSearchEvent:function(e,t,n){var r;n===Js.SearchQueryType.Series&&(r=Js.EntityType.Series),n===Js.SearchQueryType.Folder&&(r=Js.EntityType.Folder),n===Js.SearchQueryType.Tags&&(r=Js.EntityType.Tag),n===Js.SearchQueryType.Video&&(r=Js.EntityType.Video),n===Js.SearchQueryType.Subjects&&(r=Js.EntityType.Classification);var i={instant:{},query:e};return t.id&&(i.instant.selectedId=t.id),t.name&&(i.instant.selectedName=t.name),{data:i,action:su({entity:r,location:Js.LocationContext.SearchBar})}},mapInteractionType:function(e){switch(e){case Js.InteractionType.DragDrop:return Js.InteractionTypeDescriptor.DragDrop;case Js.InteractionType.FileSelect:return Js.InteractionTypeDescriptor.FileSelect;default:return}}};function fu(e){var t=e.appLink,n=e.appLinkOptions,r=e.className,i=e.style,a=e.children,o=e.tag,c=void 0===o?"a":o;if(!t)return l.createElement("span",{className:r||""},a);var s=p.AppLinkHelper.getHref(t),u={onClick:function(r){var i;r.preventDefault(),null===(i=e.onClick)||void 0===i||i.call(e,r),e.analyticsData&&e.analyticsOptions&&lu.logUserAction(Object.assign({href:s},e.analyticsData),e.analyticsOptions),p.AppLinkHelper.trigger(t,n)},href:s,className:r,style:i};return e.title&&(u.title=e.title),l.createElement(c,Object.assign({},u),a)}function pu(e){var t=e.backToName,n=e.appLink;return l.createElement(fu,{appLink:n,className:"d-inline-flex align-items-center"},l.createElement(Mc,{svgName:Dc.ArrowLeft,size:Nc.Small}),l.createElement("span",{className:"ml-1"},"Back to ".concat(t)))}function du(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return mu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}fu.defaultProps={appLinkOptions:{}};var hu,yu,vu,bu,gu=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Su(e){var t=e.selected,n=e.onToggle,r=gu(e,["selected","onToggle"]),i=du(l.useState(t),2),a=i[0],o=i[1];l.useEffect((function(){return o(t)}),[t]);return l.createElement(ki.Form.Check,Object.assign({type:"checkbox",id:"checkbox-".concat(Pi()),checked:a,onChange:function(){o(!a),n(!a)}},r))}!function(e){e.Small="small",e.Medium="medium",e.Large="large"}(hu||(hu={})),function(e){e[e.Thumbnails=0]="Thumbnails",e[e.Banners=1]="Banners",e[e.Avatars=2]="Avatars",e[e.Logos=3]="Logos",e[e.Covers=4]="Covers",e[e.Posters=5]="Posters",e[e.TallPosters=6]="TallPosters",e[e.HeroBanners=7]="HeroBanners",e[e.None=99999]="None"}(yu||(yu={})),function(e){e[e.Crop=0]="Crop",e[e.Stretched=1]="Stretched",e[e.Cover=2]="Cover"}(vu||(vu={})),function(e){e[e.None=0]="None",e[e.ImageAPIv1=1]="ImageAPIv1",e[e.FileAPIv1=2]="FileAPIv1",e[e.ImageAPIv2=3]="ImageAPIv2"}(bu||(bu={}));var Eu,Ou,Cu=function(e,t){var n=d.map(t,(function(e,t){return t&&Array.isArray(e)?e.map((function(e){return"".concat(t,"=").concat(encodeURIComponent(e))})).join("&"):t&&void 0!==e?"".concat(t,"=").concat(encodeURIComponent(e)):""})),r=d.reduce(n,(function(e,t){return t?e?"".concat(e,"&").concat(t):t:e}));return r?"".concat(e,"?").concat(r):e},Au=function(e,t){if(e){var n=e;return e.endsWith("/")||(n+="/"),t?n+=t.startsWith("/")?t.slice(1):t:n}};function wu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.Banner="banner",e.Thumbnail="thumbnail"}(Ou||(Ou={}));var ju,Iu=(wu(Eu={},yu.Banners,Ou.Banner),wu(Eu,yu.Thumbnails,Ou.Thumbnail),Eu),ku=function(e){return"/v1/category-map/".concat(e)},Tu={createUrl:function(e,t){return Tu._createUrl(e,t)},createBannerUrl:function(e,t,n){return e&&e.url?Tu._createUrl(e.url,n):Tu._createCategoryMappedUrl(t,n)},createResourceImage:function(e,t,n){return Tu._createUrl(e,Object.assign({url:t},n))},Rfc3986EncodeURIComponent:function(e){return encodeURIComponent(e).replace(/[!'()*]/g,escape)},_createCategoryMappedUrl:function(e,t){var n=e.fallbackBaseUrl,r=e.fallbackCategoryName,i=e.type,a=Au(n,"".concat(ku(Iu[i]))),o=Object.assign({name:Tu.Rfc3986EncodeURIComponent(r)},t);return Tu._createUrl(a,o)},_createUrl:function(e,t){if(e){if(Ci.a.isEmpty(t))return e;var n=$.param(t),r=-1===e.indexOf("?")?"?":"&",i=e;return i.endsWith("/")&&(i=i.slice(0,-1)),i+"".concat(r).concat(n)}},legacyCreateThumbnailUrl:function(e,t){if(!e)return"";var n;if(e&&(n=e instanceof p.Model?e.get("url"):"string"==typeof e?e:e.url)){var r=Object.assign({size:hu.Small,bgColor:"000"},t);return Tu._createUrl(n,r)}}};function Lu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _u=(Lu(ju={},yu.Thumbnails,{width:1280,height:720}),Lu(ju,yu.Banners,{width:3600,height:666}),Lu(ju,yu.Covers,{width:1080,height:1080}),Lu(ju,yu.Posters,{width:1e3,height:1500}),Lu(ju,yu.TallPosters,{width:1080,height:1920}),Lu(ju,yu.HeroBanners,{width:1920,height:640}),Lu(ju,yu.None,{width:1,height:1}),Lu(ju,yu.Avatars,{width:256,height:256}),ju);function Pu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return xu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Nu,Ru=l.createContext(void 0),Du=function(e){var t=e.children,n=Pu(l.useState(),2),r=n[0],i=n[1],a=Pu(l.useState(!1),2),o=a[0],c=a[1],s=Pu(l.useState(),2),u=s[0],f=s[1],p={getDataUrl:function(){var e=r;return i(null),e},setDataUrl:i,imageUploaded:o,getImage:function(){var e=u;return f(null),c(!1),e},setImage:function(e){f(e),c(!0)}};return l.createElement(Ru.Provider,{value:p},t)},Mu={onFileSelect:function(e,t,n){if(t&&t.length){var r=new FileReader;r.addEventListener("load",(function(){return Mu.onReaderLoad(r,e,n)})),r.readAsDataURL(t[0])}},onReaderLoad:function(e,t,n){var r=new Image;r.src=e.result;var i=_u[t].width,a=_u[t].height;r.addEventListener("load",(function(){Mu.isImageValid(t,r)&&m(n)?n(r):alert("Image too small: minimum dimensions are ".concat(i," x ").concat(a))}))},isImageValid:function(e,t){var n=_u[e].width,r=_u[e].height;return!(n&&t.width<n)&&!(r&&t.height<r)},mapImageTypeToString:function(e){switch(e){case yu.Avatars:return"avatars";case yu.Thumbnails:return"thumbnails";case yu.Logos:return"logos";case yu.Covers:return"covers";case yu.Posters:return"posters";case yu.TallPosters:return"tallposters";case yu.HeroBanners:return"herobanners";case yu.None:default:return""}}},Uu=["pdf"],Fu=["doc","docx","dotx","dot","rtf","docm","odt"],Vu=["csv","txt"],Bu=["xls","xlt","xlsx"],zu=["jpg","tif","png","bmp","gif","jpeg"],Hu=["zip","rar"],qu=["ppt","pot","pps","pptx"],Ju=["srt"],$u={IMAGES:".".concat(zu.join(",.")),RESOURCES:".".concat([].concat(Fu,Bu,qu,Uu,Vu,zu,Hu).join(",.")),SUBTITLES:".".concat(Ju.join(",."))},Ku=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Yu(e){var t=e.onFileSelect,n=e.acceptMultiple,r=e.mimeType,i=e.label,a=e.error,o=e.touched,c=Ku(e,["onFileSelect","acceptMultiple","mimeType","label","error","touched"]),s="custom-file-input cursor-pointer";a&&o&&(s+=" is-invalid");var u=Object.assign({type:"file",className:s,onChange:function(e){var n=e.currentTarget.files;n&&n.length&&m(t)&&t(n)},autoComplete:"off",value:"",multiple:!!n},r?{accept:r}:{});return l.createElement("div",{className:"form-group"},l.createElement("div",{className:"custom-file"},l.createElement(yi,Object.assign({},u,c),e.children),l.createElement(ki.Form.Label,{className:"custom-file-label",htmlFor:c.id},i)))}function Gu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Wu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wu(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qu=(Zu(Nu={},yu.Thumbnails,"Thumbnail"),Zu(Nu,yu.Banners,"Banner"),Zu(Nu,yu.Avatars,"Avatar"),Zu(Nu,yu.Logos,"Logo"),Zu(Nu,yu.Covers,"Cover"),Zu(Nu,yu.Posters,"Poster"),Zu(Nu,yu.TallPosters,"Tall Poster"),Zu(Nu,yu.HeroBanners,"Hero Banner"),Zu(Nu,yu.None,"Image"),Nu);function Xu(e){var t=ci(),n=ti(null==t?void 0:t.values,e.fieldName),r=l.useContext(Ru),i=r.setDataUrl,a=r.getImage,o=r.imageUploaded,c=Gu(l.useState(!1),2),s=c[0],u=c[1],f=Gu(l.useState(n),2),d=f[0],h=f[1],y=Gu(l.useState(!1),2),v=y[0],b=y[1];function g(t){u(!0),i(t.src),p.AppLinkHelper.trigger({application:e.application,action:e.uploadAction,args:[e.imageType]})}l.useEffect((function(){if(s){var n,r=a();if(r)u(!1),h(r),n=r,m(e.setSelectedImage)?e.setSelectedImage(n):t&&t.setFieldValue(e.fieldName,{fileId:n.id,fileIdType:bu.ImageAPIv2})}}),[o]);var S=e.label||Qu[e.imageType]||"Image";return l.createElement("div",{className:"form-group"},l.createElement("div",{className:"form-control h-auto py-2"},l.createElement("label",null,S),l.createElement("em",{className:"ml-1 text-muted"},"(Minimum dimensions are ".concat(_u[e.imageType].width,"px")+" x ".concat(_u[e.imageType].height,"px)")),l.createElement(Yu,{label:"Choose a ".concat(S.toLowerCase()),name:"image",mimeType:$u.IMAGES,onFileSelect:function(t){return Mu.onFileSelect(e.imageType,t,g)}}),!!d&&!!d.url&&l.createElement(l.Fragment,null,!v&&l.createElement("div",{className:"pb-2 ".concat(e.imageType===yu.Banners?"w-100":"w-50")},l.createElement("img",{src:Tu.createUrl(d.url),className:"img img-fluid"})),l.createElement("div",{className:"d-flex justify-content-center"},l.createElement(Mc,{svgName:v?Dc.ChevronDown:Dc.ChevronUp,size:Nc.Large,className:"svg-container cursor-pointer",onClick:function(){return b(!v)},title:v?"Show image":"Hide image",tooltipPlacement:"top"})))))}function el(e,t){return t?{application:e.application,action:e.action,args:e.args,params:Object.assign({},e.params,{cursor:t})}:null}function tl(e){var t=e.appLink,n=e.cursors,r=e.className,i=e.buttonVariant;function a(e){lu.logUserAction({page:e},{location:Js.LocationContext.Pagination,entity:Js.EntityType.Pagination,actionType:Js.UserAction.Navigate})}return l.createElement(ss.Provider,{value:"shared.pagination"},l.createElement("div",{className:r},l.createElement(fu,{appLink:el(t,n.previous),className:"btn btn-".concat(i," mr-1 ").concat(n.previous?"":"disabled"),onClick:function(){return a("previous")}},l.createElement(us,{phrase:"previous"})),l.createElement(fu,{appLink:el(t,n.next),className:"btn btn-".concat(i," ").concat(n.next?"":"disabled"),onClick:function(){return a("next")}},l.createElement(us,{phrase:"next"}))))}function nl(e){if(!e.collection)return l.createElement(l.Fragment,null);var t=e.collection,n=t.data,r=t.pagination;return l.createElement(l.Fragment,null,!!n&&l.createElement(hl,{objects:n,getObjectAppLink:e.getObjectAppLink,newObjectAppLink:e.newObjectAppLink,objectName:e.objectName}),!!r&&!!r.cursors&&l.createElement(tl,{cursors:r.cursors,appLink:e.collectionAppLink}))}tl.defaultProps={className:"py-2",buttonVariant:"secondary"};var rl=n(42),il=n.n(rl);function al(e){var t="".concat(e.className," ").concat(il.a.iconButton);e.children?t+=" ".concat(il.a.iconWithText):t+=" ".concat(il.a.iconOnly);var n=l.createElement(Mc,{svgName:e.svgName,className:"svg-container ".concat(il.a.svg),size:e.svgSize});return e.appLink?l.createElement(fu,{appLink:e.appLink,className:t,onClick:e.onClick,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},n,e.children):l.createElement("button",{className:t,onClick:function(t){e.analyticsData&&e.analyticsOptions&&lu.logUserAction(e.analyticsData,e.analyticsOptions),m(e.onClick)&&e.onClick(t)}},n,e.children)}var ol=n(211),cl=n.n(ol);function sl(e){var t="dropdown-item";return e&&(t+=" ".concat(e)),t}function ul(e){if(e.action.appLink)return l.createElement(fu,{appLink:e.action.appLink,onClick:e.action.onClick,className:sl(e.action.className),analyticsData:e.action.analyticsData,analyticsOptions:e.action.analyticsOptions},e.action.label);function t(){e.action.analyticsData&&e.action.analyticsOptions&&lu.logUserAction(e.action.analyticsData,e.action.analyticsOptions),m(e.action.onClick)&&e.action.onClick()}return l.createElement("span",{className:"cursor-pointer ".concat(sl(e.action.className)),onClick:t,role:"button",tabIndex:0,onKeyDown:function(e){return"Enter"===e.key&&t()}},e.action.label)}function ll(e){if(!e.actions||!e.actions.length)return l.createElement(l.Fragment,null);var t="dropdown";e.className&&(t+=" ".concat(e.className));var n="actions-dropdown-".concat(Pi()),r="dropdown-toggle px-0 ".concat(cl.a.dropdownToggle);return e.dropdownToggleClassName&&(r+=" ".concat(e.dropdownToggleClassName)),l.createElement("div",{className:t},l.createElement("button",{className:r,type:"button",id:n,"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},l.createElement(Mc,{svgName:Dc.More,size:Nc.Small})),l.createElement("div",{className:"dropdown-menu dropdown-menu-right","aria-labelledby":n},e.actions.map((function(e,t){return e.tooltip?l.createElement(xi,{title:e.tooltip,spanHack:!0},l.createElement(ul,{key:t,action:e})):l.createElement(ul,{key:t,action:e})}))))}function fl(e){var t=e.showSpinner?l.createElement(ki.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):e.children;if(e.tooltip)return l.createElement(xi,{title:e.tooltip},l.createElement("span",null,l.createElement(al,{appLink:e.appLink,svgName:e.svgName,svgSize:e.svgSize,onClick:e.onClick,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},t)));if(e.svgName)return l.createElement(al,{onClick:e.onClick,appLink:e.appLink,svgName:e.svgName,svgSize:e.svgSize,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},t);if(e.appLink)return l.createElement(fu,{onClick:e.onClick,appLink:e.appLink,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},t);return l.createElement("button",{onClick:function(t){e.analyticsData&&e.analyticsOptions&&lu.logUserAction(e.analyticsData,e.analyticsOptions),m(e.onClick)&&e.onClick(t)},className:e.className},t)}function pl(e){var t=l.useMemo((function(){return e.actions.sort((function(e,t){return e.order-t.order}))}),[e.actions]),n=[],r=[];t.forEach((function(e){e.button?n.push(e):r.push(e)}));var i="d-flex";return e.className&&(i+=" ".concat(e.className)),n.length||r.length?l.createElement("div",{className:i},l.createElement(l.Fragment,null,l.createElement("span",{className:"d-flex align-items-center"},n.length?n.map((function(e,t){return l.createElement(l.Fragment,{key:t},function(){if(e.label)return l.createElement(fl,{appLink:e.appLink,onClick:e.onClick,svgName:e.svgName,className:e.className,tooltip:e.tooltip,showSpinner:e.showSpinner,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},e.label);var t=l.createElement(al,{appLink:e.appLink,onClick:e.onClick,svgName:e.svgName,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions});return e.tooltip?l.createElement(xi,{title:e.tooltip,spanHack:!0},t):t}())})):l.createElement(l.Fragment,null),e.sortComponent&&e.sortComponent,r.length?l.createElement(ll,{actions:r,dropdownToggleClassName:e.actionsDropdownClassName}):l.createElement(l.Fragment,null)))):l.createElement(l.Fragment,null)}function dl(e){var t=e.object,n=e.actions;return l.createElement("div",{className:"d-flex justify-content-between py-2"},!!t&&l.createElement("h5",null,t.name),!!n&&l.createElement("span",null,l.createElement(pl,{actions:n})))}function ml(e){return l.createElement("tr",null,l.createElement("td",null,l.createElement(fu,{appLink:e.appLink},e.object.name)),l.createElement("td",null))}function hl(e){return l.createElement(ki.Table,{responsive:!0},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",null,"Name"),l.createElement("th",null,l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(fu,{appLink:e.newObjectAppLink},l.createElement(Mc,{svgName:Dc.Plus,size:Nc.Small}),l.createElement("span",null,"New ".concat(e.objectName))))))),l.createElement("tbody",null,e.objects.map((function(t){return l.createElement(ml,{key:t.id,object:t,appLink:e.getObjectAppLink(t)})}))))}function yl(e){var t=e.objects,n=e.getAppLink,r=e.emptyMessage;return t?t.length?l.createElement("ul",{className:"list-unstyled"},t.map((function(e,t){return l.createElement("li",{key:t,className:"border rounded mb-3"},l.createElement(fu,{appLink:n(e),className:"d-block p-3"},e.name))}))):l.createElement("div",{className:"py-3"},l.createElement("p",null,r)):l.createElement(l.Fragment,null)}ll.defaultProps={dropdownToggleClassName:"btn btn-light"},yl.defaultProps={emptyMessage:"There is nothing here."};function vl(e){var t=ci();return l.createElement(Bc,{as:"select",label:"Rating",name:"rating",id:"rating",value:t.values.rating&&t.values.rating.id,onChange:function(e){return t.setFieldValue("rating",e.target.value?{id:e.target.value}:{})},disabled:e.disabled},l.createElement(l.Fragment,null,l.createElement("option",{value:""},"Please select a rating"),e.ratings.map((function(e,t){return l.createElement("option",{key:t,value:e.id},function(e){return"".concat(e.name).concat(e.code?" (".concat(e.code,")"):"")}(e))}))))}var bl={isItemActive:function(e,t){return t||(t=p.AppLinkHelper.getCurrentAppLink()),t.application===e.appLink.application&&(Array.isArray(e.activeActions)?e.activeActions.includes(t.action):t.action===e.appLink.action)}},gl=function(e){return Object.values(e).every((function(e){return!!e}))},Sl=(n(212),function(e,t){return!!e&&!!t&&e.toString()===t.toString()}),El=function(e){return e.split(" ").map((function(e){return(e[0]?e[0].toUpperCase():"")+(e.substr(1)?e.substr(1).toLowerCase():"")})).join(" ")};function Ol(e){return function(e){if(Array.isArray(e))return Cl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Cl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cl(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Al={find:function(e,t){if(e&&e.children&&e.children.length)for(var n=function e(n){if(Sl(n.id,t))return n;var r=n.children;if(r&&r.length)for(var i=0;i<r.length;i++){var a=e(r[i]);if(a)return a}},r=0;r<e.children.length;r++){var i=n(e.children[r]);if(i)return i}},getPath:function(e,t){for(var n=[t],r=function(e){return e.hasOwnProperty("parentIds")&&Array.isArray(e.parentIds)&&e.parentIds.length?e.parentIds[0]:e.hasOwnProperty("parentId")?e.parentId:null},i=r(t);i;){var a=Al.find(e,i);a&&(n=[a].concat(Ol(n))),i=a?r(a):null}return n}},wl=function(e){return e&&e.groups?e.groups.map((function(e){return e.name})):[]};function jl(e){var t=e.tabs,n=e.isItemActive;return l.createElement(ki.Nav,{fill:!0,variant:"tabs"},t.map((function(e,t){return l.createElement(ki.Nav.Item,{key:t},l.createElement(fu,{appLink:e.appLink,className:(r=n(e),r?"nav-link active":"nav-link")},e.label));var r})))}jl.defaultProps={isItemActive:bl.isItemActive};var Il=n(24),kl=n.n(Il);function Tl(e){var t=e.name,n=e.appLink,r=e.onSelect,i=e.isDisabled,a=e.className,o=e.actions,c=kl.a.text;return a&&(c+=" ".concat(a)),i?l.createElement("a",{className:"".concat(c," text-muted ").concat(kl.a.disabled)},t):l.createElement(l.Fragment,null,n?l.createElement(fu,{appLink:n,className:c},t):l.createElement("a",{onClick:r,className:c},t),!!o&&l.createElement(pl,{className:kl.a.actions,actions:o}))}function Ll(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Pl(e){var t=e.tree,n=e.selectedIds,r=e.getAppLink,i=e.onSelect,a=e.isDisabled,o=e.actions,c=Array.isArray(n)&&n.some((function(e){return Sl(t.id,e)})),s=l.useMemo((function(){return Array.isArray(n)&&n.some((function(e){return Al.find(t,e)}))}),[t,n]),u=Ll(l.useState(s),2),f=u[0],p=u[1],d=!!t.children&&!!t.children.length,h={name:t.name,appLink:m(r)?r(t):null,onSelect:m(i)?function(){return i(t)}:null,isDisabled:!!m(a)&&a(t),className:c&&kl.a.selected||s&&kl.a.parentOfSelected,actions:!!o&&o.map((function(e){return Object.assign(Object.assign({},e),{appLink:e.getAppLink(t)})}))};return l.createElement("li",{className:"position-relative".concat(f?"":" ".concat(kl.a.collapsed))},l.createElement("div",{className:"position-relative"},l.createElement("span",{className:kl.a.node},d&&l.createElement(Mc,{svgName:Dc.ChevronDown,size:Nc.Small,className:"svg-container ".concat(kl.a.chevron),onClick:function(){return p(!f)}}),l.createElement(Tl,Object.assign({},h))),f&&l.createElement(Nl,Object.assign({},e))))}var xl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Nl(e){var t=e.tree,n=xl(e,["tree"]);return t&&t.children?l.createElement("ul",{className:"m-0 p-0 ".concat(kl.a.tree)},t.children.map((function(e){return l.createElement(Pl,Object.assign({key:e.id,tree:e},n))}))):l.createElement(l.Fragment,null)}var Rl={getChord:function(e,t){return Al.getPath(e,t).map((function(e){return e.name})).join(" -> ")},getState:function(e,t){var n={};return Array.isArray(e)&&e.forEach((function(e){var r,i,a,o=Al.find(t,e);o&&(n=Object.assign((r={},i=e,a=Rl.getChord(t,o),i in r?Object.defineProperty(r,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[i]=a,r),n))})),n}};function Dl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ml(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ml(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ml(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ul=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Fl(e){var t=e.onSelect,n=e.label,r=e.hideCollapseBtn,i=e.collapse,a=e.noSelectionMessage,o=e.isNodeDisabled,c=e.getSelectedItemAppLink,s=Ul(e,["onSelect","label","hideCollapseBtn","collapse","noSelectionMessage","isNodeDisabled","getSelectedItemAppLink"]),u=s.tree,f=s.selectedIds,p=Dl(l.useState(Rl.getState(f,u)),2),d=p[0],h=p[1];l.useEffect((function(){return h(Rl.getState(f,u))}),[f,u]);var y=Dl(l.useState(!!i),2),v=y[0],b=y[1];l.useEffect((function(){return b(!!i)}),[i]);var g=!r||!!n;return l.createElement(l.Fragment,null,g&&l.createElement("div",{className:"pb-2"},!!n&&l.createElement("label",{className:"m-0"},n),!r&&l.createElement("a",{className:"float-right cursor-pointer",onClick:function(){return b(!v)}},v?"Expand":"Collapse")),!v&&l.createElement("div",{className:"py-2 border-top"},l.createElement(Nl,Object.assign({onSelect:function(e){return m(t)&&t(e)},isDisabled:o},s))),(!Ci.a.isEmpty(d)||!!a)&&l.createElement("div",{className:"py-2 border-top"},l.createElement("label",null,"Selected:"),l.createElement("ul",{className:"m-0"},Ci.a.isEmpty(d)?l.createElement("li",null,a):Object.keys(d).map((function(e,t){return l.createElement("li",{key:t},m(c)?l.createElement(fu,{appLink:c(e)},d[e]):d[e])})))))}var Vl=n(51);var Bl=function(e){return e&&!(e.data&&e.data.length)},zl=function(e){return e&&e.data&&e.data.length},Hl=function(e){var t="bg-white";return e&&(t+=" ".concat(e)),t};function ql(e){var t=e.video,n=e.getVideoAppLink,r=e.getVideoActions,i=e.className,a=void 0===i?"":i,o=e.itemNumber,c=m(n)&&n(t);return l.createElement("tr",{className:Hl(a)},!!o&&l.createElement("td",null,l.createElement("span",null,o)),l.createElement("td",null,c?l.createElement(fu,{appLink:c},t.name):t.name),m(r)&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(pl,{actions:r(t)}))))}var Jl=Object(Vl.SortableElement)((function(e){return l.createElement(ql,Object.assign({sortable:!0},e))})),$l=n(32),Kl=n.n($l),Yl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},Gl=function(e){var t=e.sortable,n=e.getVideoActions;return l.createElement("thead",null,l.createElement("tr",null,!!t&&l.createElement("th",null,"#"),l.createElement("th",null,"Name"),!!n&&l.createElement("th",null)))},Wl=l.forwardRef((function(e,t){var n=e.videos,r=e.sortable,i=Yl(e,["videos","sortable"]);return l.createElement("tbody",{ref:t},!Bl(n)&&n.data.map((function(e,t){return r?l.createElement(Jl,Object.assign({key:e.id,index:t,itemNumber:t+1,video:e,className:Kl.a.draggableVideoItem},i)):l.createElement(ql,Object.assign({video:e},i))})))}));var Zl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},Ql=Object(Vl.SortableContainer)((function(e){var t=e.forwardedRef,n=Zl(e,["forwardedRef"]);return l.createElement(Wl,Object.assign({sortable:!0,ref:t},n))})),Xl=function(e){return function(t){var n=t.node,r=e.current;if(r){r.classList.add(Kl.a.sortingContainer);var i=r.querySelector(".".concat(Kl.a.draggedVideoItem));n.childNodes.forEach((function(e,t){return i.childNodes[t].style.width="".concat(e.offsetWidth,"px")}))}}},ef=function(e,t){return function(n){var r=e.current;r&&r.classList.remove(Kl.a.sortingContainer),t(n.oldIndex,n.newIndex)}};function tf(e){var t=e.onSortEnd,n=e.emptyMessage,r=Zl(e,["onSortEnd","emptyMessage"]),i=l.useRef();return Bl(e.videos)?l.createElement("div",null,n):l.createElement(ki.Table,{responsive:!0},l.createElement(Gl,Object.assign({sortable:!0},e)),l.createElement(Ql,Object.assign({forwardedRef:i,onSortStart:Xl(i),onSortEnd:ef(i,t),lockAxis:"y",lockToContainerEdges:!0,distance:1,helperClass:Kl.a.draggedVideoItem,helperContainer:function(){return i.current}},r)))}function nf(e){var t=e.alias,n=e.onDelete;return l.createElement("li",{className:"list-group-item d-flex justify-content-between"},t.name,l.createElement(Mc,{svgName:Dc.Delete,onClick:function(){return n(t.id)}}))}function rf(e){var t=e.aliases,n=e.onDelete;return l.createElement("ul",{className:"list-group mb-3"},t?t.map((function(e){return l.createElement(nf,{key:e.id,alias:e,onDelete:n})})):l.createElement("span",null,"Currently there are no aliases for this object."))}function af(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return of(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return of(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function of(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}tf.defaultProps={emptyMessage:"There are no videos in this list."};var cf=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function sf(e){var t=e.showSpinner,n=e.children,r=cf(e,["showSpinner","children"]),i=l.useRef(),a=af(l.useState({}),2),o=a[0],c=a[1];return l.useEffect((function(){var e=o.width,t=o.height;if(!e||!t){var n=i.current,r=n.offsetHeight,a=n.offsetWidth;r&&a&&c({width:a,height:r})}})),l.useEffect((function(){var e=o.width,t=o.height;if(e&&t){var n=i.current;n.style.width="".concat(e+1,"px"),n.style.height="".concat(t+1,"px")}}),[o]),l.createElement(ki.Button,Object.assign({ref:i,disabled:t},r),t?l.createElement(ki.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):n)}var uf=Object(ji.object)().shape({name:Object(ji.string)().trim().max(255,"Name is too long").required("Name is required").default("")});function lf(){var e=ci(),t=qc(e);return l.createElement(vi,null,l.createElement(Bc,{label:"Create an alias",name:"name",id:"name",value:e.values.name,placeholder:"Add an alias"}),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(sf,{showSpinner:e.isSubmitting,type:"submit",disabled:!t},"Add")))}function ff(e){var t=e.onSave;return l.createElement(wi,{initialValues:{name:""},validationSchema:uf,onSubmit:function(e,n){t(e,(function(){return n({reset:!0})}))}},l.createElement(lf,null))}function pf(e){var t=e.onSave,n=e.aliases,r=e.onDelete;return l.createElement("div",{className:"w-50"},l.createElement("h1",null,"Aliases"),l.createElement(rf,{aliases:n,onDelete:r}),l.createElement(ff,{onSave:t}))}var df=c.COMPANIES,mf=function(e){return{application:df,action:i.Companies.EDIT_COMPANY,args:[e.id]}},hf=function(e){return p.AppLinkHelper.trigger(mf(e))};function yf(e){var t=oe.useBasicFetch(he(e.cursor));return l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-3 w-50"},l.createElement(Hs,{placeholder:"Search for a company",onSuggestionSelected:hf,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/companies/instant/raw","?q=").concat(e)},activationLength:2})),l.createElement(nl,{collection:t&&t.data,collectionAppLink:{application:df,action:i.Companies.COMPANIES},newObjectAppLink:{application:df,action:i.Companies.NEW_COMPANY},getObjectAppLink:mf,objectName:"Company"}))}function vf(e){return(vf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Sf(e,t,n){return t&&gf(e.prototype,t),n&&gf(e,n),e}function Ef(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Of(e,t)}function Of(e,t){return(Of=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Cf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=wf(e);if(t){var i=wf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Af(this,n)}}function Af(e,t){return!t||"object"!==vf(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function wf(e){return(wf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jf=function(e){Ef(n,e);var t=Cf(n);function n(){return bf(this,n),t.apply(this,arguments)}return Sf(n,[{key:"channelName",get:function(){return c.COMPANIES}},{key:"appRoutes",get:function(){return{"manage/companies(/)":"companies","manage/companies/new(/)":"newCompany","manage/companies/:id(/)":"editCompany"}}}]),n}(p.AppRouter),If=function(e){Ef(n,e);var t=Cf(n);function n(){return bf(this,n),t.apply(this,arguments)}return Sf(n,[{key:"name",get:function(){return"Companies Application"}},{key:"channelName",get:function(){return c.COMPANIES}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT}}},{key:"companies",value:function(e){var t=e.cursor;this.layout.showChildView(k,l.createElement(yf,{cursor:t}))}},{key:"newCompany",value:function(){this.layout.showChildView(k,l.createElement(ms,null))}},{key:"editCompany",value:function(e){this.layout.showChildView(k,l.createElement(ds,{id:e}))}}],[{key:"router",get:function(){return jf}}]),n}(p.Application);function kf(e){return(kf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _f(e,t){return(_f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Nf(e);if(t){var i=Nf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return xf(this,n)}}function xf(e,t){return!t||"object"!==kf(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Nf(e){return(Nf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Rf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_f(e,t)}(a,e);var t,n,r,i=Pf(a);function a(){return Tf(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"onShowAlert",value:function(e){if(this.layoutOptions.options.alertRegion){var t=e.ctor,n=e.collection,r=n?n.toJSON():[];this.layout.showChildView(this.layoutOptions.options.alertRegion,l.createElement(t,{alerts:r,removeAlert:function(e){return tu.Radio.channel(G.a.ALERT).trigger("remove:alert",e)}}))}}}])&&Lf(t.prototype,n),r&&Lf(t,r),a}(n(44).a);function Df(e){return(Df="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Mf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Uf(e,t){return(Uf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ff(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Bf(e);if(t){var i=Bf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Vf(this,n)}}function Vf(e,t){return!t||"object"!==Df(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Bf(e){return(Bf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var zf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Uf(e,t)}(a,e);var t,n,r,i=Ff(a);function a(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(e=i.call(this)).constructors={},e.destructors={},e.instances={},e.singletonInstances={},e.referenceCounts={},e}return t=a,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"name",get:function(){return"InstanceManager"}},{key:"registerDataService",value:function(e,t){var n=this;this.validateConstructor(e);var r=e.prototype.name;return this.referenceCounts[r]=0,this.constructors[r]=function(){return new e({dataProvider:n.getInstance(t.dataProvider),cache:n.getInstance(t.cache),bootstrapData:t.bootstrapData,defaultErrorHandler:t.defaultErrorHandler,alertService:t.alertService})},this.destructors[r]=function(){n.instances[r]?n.instances[r].destroy():Yc.c.throw(new Zc.a("Trying to destroy a ".concat(r," instance that has already been destroyed"))),n.releaseInstance(t.dataProvider),n.releaseInstance(t.cache)},this}},{key:"registerInstance",value:function(e,t){var n=this;this.validateConstructor(e);var r=e.prototype.name;return this.referenceCounts[r]=0,this.constructors[r]=function(){return new e(t)},this.destructors[r]=function(){return d.isFunction(n.instances[r].destroy)&&n.instances[r].destroy()},this}},{key:"registerSingleton",value:function(e){var t=e.name;return this.singletonInstances[t]=e,this}},{key:"getInstance",value:function(e,t){var n=this;return this.singletonInstances[e]?this.singletonInstances[e]:(this.constructors[e]||Yc.c.throw(new Zc.a("".concat(e," was not registered with ").concat(this.name))),this.referenceCounts[e]++,t&&this.listenTo(t,"destroy",(function(){return n.releaseInstance(e)})),this.instances[e]||(this.instances[e]=this.constructors[e]()),this.instances[e])}},{key:"releaseInstance",value:function(e){var t=this;if(this.instances[e])return window.setTimeout((function(){t.referenceCounts[e]--,t.referenceCounts[e]<1&&(t.destructors[e](),delete t.instances[e])}),0),this}},{key:"validateConstructor",value:function(e){var t=e.prototype.name;t||Yc.c.throw(new Zc.a("Classes registered with ".concat(this.name," must have a unique name property."))),this.constructors[t]&&Yc.c.throw(new Zc.a("A class with the name: ".concat(t," has already been registered with ").concat(this.name)))}}])&&Mf(t.prototype,n),r&&Mf(t,r),a}(Kc.a).Instance;function Hf(e){var t,n;return t=e,n=zf.getInstance(t),l.useEffect((function(){return function(){return zf.releaseInstance(t)}})),n}var qf,Jf,$f=n(35),Kf=n(30);function Yf(e){return(Yf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Wf(e,t){return(Wf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Xf(e);if(t){var i=Xf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Qf(this,n)}}function Qf(e,t){return!t||"object"!==Yf(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Xf(e){return(Xf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Success="success",e.Warning="warning",e.Fail="danger",e.Info="info"}(qf||(qf={})),function(e){e.Success="Success! 🙌",e.Warning="Whoops...",e.Fail="Oops...",e.Info="FYI"}(Jf||(Jf={}));var ep=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Wf(e,t)}(a,e);var t,n,r,i=Zf(a);function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i.call(this,e)}return t=a,(n=[{key:"initialize",value:function(){this.alertCollection=new $f.a,this.listenTo(G.a.ALERT,"remove:alert",this.removeAlert),this.showAlerts()}},{key:"name",get:function(){return Gc}},{key:"defaults",get:function(){return{maxAlerts:3}}},{key:"showAlerts",value:function(){var e=tu.Radio.channel(G.a.ALERT),t={collection:this.alertCollection};this.options.alertViewCtor&&(t=d.extend({},t,{ctor:this.options.alertViewCtor})),e.trigger("show:alert",t)}},{key:"removeAlert",value:function(e){this.alertCollection.remove(e),this.showAlerts()}},{key:"createAlert",value:function(e){this.alertCollection.length===this.options.maxAlerts&&this.alertCollection.shift(),e.id||(e=d.extend({},e,{id:this.generateUniqueAlertId()})),this.alertCollection.push(new Kf.a(e)),this.showAlerts()}},{key:"clearAllAlerts",value:function(){this.alertCollection.reset(null)}},{key:"success",value:function(e){var t=this;return"string"==typeof e?d.bind((function(){return t.createAlert(d.extend({},t.options.defaultSuccessAlert,{message:e}))}),this):e.useXHR?d.bind((function(e,n){return t.createAlert(d.extend({},t.options.defaultSuccessAlert,{message:n}))}),this):d.bind((function(){return t.createAlert(d.extend({},t.options.defaultSuccessAlert,e))}),this)}},{key:"error",value:function(e){var t=this;return"string"==typeof e?d.bind((function(){return t.createAlert(d.extend({},t.options.defaultErrorAlert,{message:e}))}),this):e.useXHR?d.bind((function(e){return t.createAlert(d.extend({},t.options.defaultErrorAlert,{message:e.message}))}),this):d.bind((function(){return t.createAlert(d.extend({},t.options.defaultErrorAlertIL_DEFAULT,e))}),this)}},{key:"generateUniqueAlertId",value:function(){return d.uniqueId("alert_")}}])&&Gf(t.prototype,n),r&&Gf(t,r),a}(Kc.a);function tp(){var e=Hf(Gc);return{success:function(t){e.success(t)()},error:function(t){e.error(t)()},warning:function(t){e.createAlert({type:qf.Warning,heading:Jf.Warning,message:t})}}}function np(){return l.createElement("div",{className:"text-center p-5"},l.createElement(ki.Spinner,{as:"div",animation:"border",role:"status"}))}function rp(e){var t,n=(null===(t=e.headerButtons)||void 0===t?void 0:t.length)?e.headerButtons.map((function(e,t){return l.createElement(fl,Object.assign({key:t},e))})):l.createElement(l.Fragment,null);return l.createElement(ki.Modal,{show:!0,onHide:e.closePopup,onEntered:e.onEntered,size:e.size,dialogClassName:e.dialogClassName,centered:e.centered},!!e.title&&l.createElement(ki.Modal.Header,{className:"d-flex align-items-center",closeButton:e.closeButton},l.createElement(ki.Modal.Title,{className:"flex-grow-1 text-truncate"},e.title),n),e.showLoadingSpinner?l.createElement(np,null):l.createElement(ki.Modal.Body,{className:e.bodyClassName},e.children))}rp.defaultProps={closeButton:!0,bodyClassName:"",dialogClassName:""};var ip=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function ap(e){var t=e.buttons;return l.createElement("div",{className:"d-flex justify-content-end border-top pt-3 px-3 mx-n3"},t.map((function(e,t){return function(e,t){var n=e.buttonText,r=e.type,i=void 0===r?"button":r,a=e.isSpinnerButton,o=e.showSpinner,c=void 0!==o&&o,s=e.className,u=ip(e,["buttonText","type","isSpinnerButton","showSpinner","className"]),f=Object.assign({key:t,type:i,className:"ml-2".concat(s?" ".concat(s):"")},u);return a?l.createElement(sf,Object.assign({showSpinner:c},f),n):l.createElement(ki.Button,Object.assign({},f),n)}(e,t)})))}function op(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return cp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cp(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var sp=cs.encloseNamespace("shared.confirmationPopup");function up(e){var t=op(l.useState(!1),2),n=t[0],r=t[1],i=[{variant:e.cancelButtonVariant,onClick:e.closePopup,buttonText:e.cancelButtonText||sp("cancel")},{variant:e.confirmButtonVariant,onClick:function(){r(!0),e.onClickConfirm()},buttonText:e.confirmButtonText||sp("confirm"),isSpinnerButton:!0,showSpinner:n}];return l.createElement(rp,{title:e.title,closePopup:e.closePopup},l.createElement(l.Fragment,null,e.children,l.createElement(ap,{buttons:i})))}up.defaultProps={confirmButtonVariant:"primary",cancelButtonVariant:"link"};var lp,fp,pp="locale",dp="phrases",mp="currentuser",hp=function(e,t){return{url:"/api/currentuser",key:"currentuser",normalizeOptions:{namespace:"currentuser"},bootstrapName:mp,formatData:function(e){return e.id?e:null},success:e,error:t,expiryTime:1/0}},yp=n(10),vp=function(e,t,n,r){return{key:"settings:".concat(e,":").concat(t),url:"/api/domain/v3/settings/".concat(e,"?type=").concat(t),normalize:!1,formatData:function(e){return yp.a.first(e)},success:n,error:r}},bp=function(e,t,n,r){return{key:"update:settings:".concat(e,":bulk"),url:"/api/domain/v3/settings/".concat(e,"/bulk"),data:t,type:ce.a.PUT,invalidationKeys:t.map((function(t){return"settings:".concat(e,":").concat(t.name)})),success:n,error:r}};function gp(e){var t=l.useRef(null);return l.useEffect((function(){t.current&&(e.checked?t.current.indeterminate&&(t.current.indeterminate=!1):!e.indeterminate||t.current.indeterminate?!e.indeterminate&&t.current.indeterminate&&(t.current.indeterminate=!1):t.current.indeterminate=!0)}),[t.current,e.indeterminate,e.checked]),l.createElement("div",{className:"custom-control custom-checkbox ".concat(e.className)},l.createElement("input",{ref:t,type:"checkbox",className:"custom-control-input",id:e.id,name:e.name,checked:e.checked,onChange:e.onChange,disabled:e.disabled}),l.createElement("label",{className:"custom-control-label cursor-pointer",htmlFor:e.id},e.label))}function Sp(e,t){return t?"".concat(e,":").concat(t):e}!function(e){e.MustCompleteOnboarding="must_complete_onboarding",e.StudentWorkspaceSharing="student_ws_sharing",e.StudentToStudentMessaging="student_to_student_messaging",e.HideResourcesForStudents="hide_resources_for_students",e.LibraryReview="library_review",e.SchoolMessaging="school_messaging",e.LegacyTvNaming="legacy_tv_naming",e.LegacyAlbertCustomer="legacy_albert_customer",e.HideHostedLibraries="hide_hosted_libraries",e.StaffRequest="staff_request",e.MaxCustomLibraries="max_custom_libraries",e.CustomLibrariesBetaAccess="custom_libraries_beta_access",e.AutoCaptioning="auto_captioning",e.Topics="subjects",e.NewDashboards="new_dashboards",e.HasCompletedOnboarding="has_completed_onboarding",e.BulkOnboardingPreferencesState="bulk_onboarding_preferences_state"}(lp||(lp={})),gp.defaultProps={checked:!1,label:"",className:""},function(e){e[e.Permanent=0]="Permanent",e[e.Temporary=1]="Temporary"}(fp||(fp={}));var Ep,Op=function(e){return{key:Sp("presentations",e),url:Cu("/api/subjects/v1/presentations",{type:e})}},Cp=function(e,t){return{key:Sp("customers:".concat(e,":presentations"),t),url:Cu("/api/subjects/v1/customers/".concat(e,"/presentations"),{type:t})}},Ap=function(e,t,n,r,i){return{key:"customers:".concat(e,":presentations:").concat(t,":add"),url:"/api/subjects/v1/customers/".concat(e,"/presentations/").concat(t),type:ce.a.POST,invalidationKeys:"customers:".concat(e,":presentation"),success:n,error:r,always:i}},wp=function(e,t,n,r,i){return{key:"customers:".concat(e,":presentations:").concat(t,":remove"),url:"/api/subjects/v1/customers/".concat(e,"/presentations/").concat(t),type:ce.a.DELETE,invalidationKeys:"customers:".concat(e,":presentations"),success:n,error:r,always:i}};!function(e){e.Developer="Curator Devs",e.Content="Content",e.Curator="Curators",e.Support="Support",e.SalesSupport="Sales Support"}(Ep||(Ep={}));var jp,Ip,kp=function(){return[{value:"protected",access:"r"}]},Tp=function(e){return wl(e).includes(Ep.Developer)},Lp=function(e){return[Ep.Developer,Ep.Content].some((function(t){return wl(e).includes(t)}))},_p=function(e,t,n,r,i){var a="settings:entity:".concat(e),o="/api/cache?keys=".concat(a);return{url:"/ajax/online/".concat(t,"?endpoint=").concat(encodeURIComponent(o)),key:"settings:cache:".concat(e),type:ce.a.DELETE,success:n,error:r,always:i}},Pp=function(e){return{key:"customers:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=country")}};function xp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Np(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Np(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Np(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Rp(e){var t,n=xp(l.useState(),2),r=n[0],i=n[1],a=e.availablePresentations.filter((function(t){return!e.currentPresentations.find((function(e){return e.id===t.id}))}));return l.createElement("div",null,!!e.canAdd&&!!a.length&&l.createElement(l.Fragment,null,l.createElement(ki.Form.Label,null,"Select a presentation to add"),l.createElement(ki.Form.Control,{as:"select",value:null!==(t=null==r?void 0:r.id)&&void 0!==t?t:"",onChange:function(t){var n=function(e,t){return yp.a.first(t.filter((function(t){return t.id.toString()===e.toString()})))}(t.target.value,a);n&&(i(n),e.onSelectPresentation(n))},className:"cursor-pointer"},l.createElement("option",{value:""},"Select a presentation"),a.map((function(e){return l.createElement("option",{value:e.id,key:e.id},e.name)})))),!!e.currentPresentations.length&&l.createElement(l.Fragment,null,l.createElement("ul",{className:"list-unstyled mt-2"},e.currentPresentations.map((function(t){return l.createElement("li",null,t.name,!!e.canRemove&&l.createElement("span",{className:"text-danger cursor-pointer ml-2",onClick:function(){return e.removePresentation(t)}},l.createElement("em",null,"remove")))})))))}function Dp(e,t){return Tp(t)?e:e.filter((function(e){return e.status===jp.Published}))}function Mp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Up(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Up(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Up(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Fp(e){var t,n,r=tp(),a=Object(v.useDispatch)(),o=Mp(l.useState(!!e.newCustomer),2),s=o[0],u=o[1],f=Mp(l.useState(),2),d=f[0],m=f[1],h=Mp(l.useState(),2),y=h[0],b=h[1],g=Mp(l.useState(),2),S=g[0],E=g[1],O=Mp(l.useState(!1),2),C=O[0],A=O[1],w=oe.useBasicFetch(Pp(e.customerId)),j=oe.useBasicFetch(hp()),I=oe.useBasicFetch(vp(e.customerId,lp.Topics)),k=(n=e.customerId,{availableTopicPresentations:oe.useBasicFetch(Op(Ip.Subject)),availableCurriculumPresentations:oe.useBasicFetch(Op(Ip.Curriculum)),customerTopicPresentations:oe.useBasicFetch(Cp(n,Ip.Subject)),customerCurriculumPresentations:oe.useBasicFetch(Cp(n,Ip.Curriculum))}),T=k.availableTopicPresentations,L=k.availableCurriculumPresentations,_=k.customerTopicPresentations,P=k.customerCurriculumPresentations;function x(){if(e.newCustomer)return alert("Successfully set up Topics for this customer."),void p.LocationUtils.PageLoad(p.AppLinkHelper.getHref({application:c.CUSTOMERS,action:i.Customers.MANAGE_CUSTOMER_TOPICS,args:[e.customerId]}));A(!1),r.success("Successfully saved customer presentations.")}if(l.useEffect((function(){var e;(null===(e=I.data)||void 0===e?void 0:e.value)&&u(!0)}),[null===(t=I.data)||void 0===t?void 0:t.value]),l.useEffect((function(){s||(m(null),b(null))}),[s]),!!!(j.data&&I.data&&w.data&&T.data&&L.data&&_.data&&P.data))return l.createElement(l.Fragment,null);var N=Tp(j.data),R=!_.data.length&&!P.data.length||N,D=N?d||y:s&&d&&y;return l.createElement(l.Fragment,null,l.createElement("h1",{className:"h6 mb-3"},w.data.name," - ",w.data.crmId),l.createElement("div",{className:"alert alert-danger",role:"alert"},"After enabling Topics, please ensure that ",l.createElement("strong",null,"Dashboard")," is enabled for this customer and that they have the correct library for the ",l.createElement("strong",null,"Topics Presentation")," you choose."),l.createElement(gp,{id:"enableTopics",checked:s,onChange:function(){return u(!s)},label:"Enable Topics",disabled:I.data.value}),s&&l.createElement(l.Fragment,null,l.createElement("p",{className:"mt-3"},l.createElement("strong",null,"Topic Presentations")),l.createElement(Rp,{availablePresentations:Dp(T.data,j.data),currentPresentations:_.data,onSelectPresentation:function(e){return m(e)},removePresentation:function(e){return E(e)},canAdd:R,canRemove:N}),l.createElement("p",{className:"mt-3"},l.createElement("strong",null,"Curriculum Presentations")),l.createElement(Rp,{availablePresentations:Dp(L.data,j.data),currentPresentations:P.data,onSelectPresentation:function(e){return b(e)},removePresentation:function(e){return E(e)},canAdd:R,canRemove:N})),R&&l.createElement("div",{className:"d-flex justify-content-end align-items-center pt-3"},!I.data.value&&l.createElement(fu,{className:"info-link mr-3",appLink:{application:c.CUSTOMERS,action:i.Customers.MANAGE_CUSTOMER,args:[e.customerId]}},"Skip for now"),l.createElement("button",{className:"btn btn-primary",onClick:function(){return A(!0)},disabled:!D},"Save")),C&&l.createElement(up,{title:"Confirmation needed",onClickConfirm:function(){var t=function(){var e=[];return d&&e.push(d),y&&e.push(y),e}();if(t.length){var n=function(){var t=I.data.value?[]:[lp.Topics,lp.NewDashboards];return e.newCustomer&&t.push(lp.MustCompleteOnboarding),t}(),r=0,i=0,o=t.length+(n.length?1:0),c=t.map((function(t){return Ap(e.customerId,t.id,s,u)}));n.length&&c.push(bp(e.customerId,n.map((function(e){return{name:e,value:!0,kind:fp.Temporary}})),s,u)),c.forEach((function(e){return oe.fetch(a,e)}))}function s(){i++,u()}function u(){var t;if(++r===o){if(i<r||!(null===(t=w.data.country)||void 0===t?void 0:t.code))return A(!1),void alert("Something went wrong while setting up Topics for this customer. Please contact to the Product Team so that they look into the issue.");if(n.length){var c=_p(e.customerId,w.data.country.code,x,(function(){A(!1),alert("Successfully set up Topics but failed to clear Online cache. Please contact to the Product Team so that they look into the issue.")}));oe.fetch(a,c)}else x()}}},closePopup:function(){return A(!1)}},I.data.value?l.createElement("p",null,"Are you sure you want to add this customer to:"):l.createElement("p",null,"Are you sure you want enable Topics for this customer and add it to the following presentations:"),l.createElement("ul",null,!!d&&l.createElement("li",null,l.createElement("strong",null,"Topic Presentation:")," ",d.name),!!y&&l.createElement("li",null,l.createElement("strong",null,"Curriculum Presentation:")," ",y.name)),!N&&l.createElement("p",{className:"text-danger"},l.createElement("strong",null,"You will not be able to come back and change this."))),!!S&&l.createElement(up,{title:"Confirmation needed",onClickConfirm:function(){if(S){var t=wp(e.customerId,S.id,(function(){return r.success("Successfully removed customer from presentation.")}),(function(e){var t;return r.error((null===(t=e.responseJSON)||void 0===t?void 0:t.message)||"Failed to remove presentation.")}),(function(){return E(null)}));oe.fetch(a,t)}},closePopup:function(){return E(null)}},l.createElement("p",null,"Are you sure you want to remove this customer from ",l.createElement("strong",null,S.name),"?")))}function Vp(e){return(Vp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Bp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Hp(e,t,n){return t&&zp(e.prototype,t),n&&zp(e,n),e}function qp(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Jp(e,t)}function Jp(e,t){return(Jp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Yp(e);if(t){var i=Yp(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Kp(this,n)}}function Kp(e,t){return!t||"object"!==Vp(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Yp(e){return(Yp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Draft="Draft",e.Published="Published"}(jp||(jp={})),function(e){e.Subject="subject",e.Curriculum="curriculum"}(Ip||(Ip={}));var Gp=function(e){qp(n,e);var t=$p(n);function n(){return Bp(this,n),t.apply(this,arguments)}return Hp(n,[{key:"channelName",get:function(){return c.CUSTOMERS}},{key:"appRoutes",get:function(){return{"customers/:id/topics(/)":"manageCustomerTopics"}}},{key:"externalRoutes",get:function(){return{"customers/:id(/)":"manageCustomer"}}}]),n}(p.AppRouter),Wp=function(e){qp(n,e);var t=$p(n);function n(){return Bp(this,n),t.apply(this,arguments)}return Hp(n,[{key:"name",get:function(){return"Customers Application"}},{key:"channelName",get:function(){return c.CUSTOMERS}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT,options:{alertRegion:L}}}},{key:"manageCustomerTopics",value:function(e,t){this.layout.showChildView(k,l.createElement(Fp,{customerId:e,newCustomer:t.newCustomer}))}}],[{key:"router",get:function(){return Gp}}]),n}(Rf),Zp=n(63),Qp=n(25),Xp=n.n(Qp);function ed(e){var t=e.alert,n=e.svgName,r=e.svgClassName,i=e.closeAlert,a=t.message,o=t.heading,c=t.appLink,s=t.appLinkText,u=t.appLinkClassName,f=void 0===u?"":u,p=Object($c.sanitize)(a);return l.createElement(l.Fragment,null,l.createElement("div",{className:"d-inline-block ".concat(Xp.a.icon)},l.createElement(Mc,{svgName:n,className:"svg-container ".concat(r)})),l.createElement("div",{className:"pl-2 d-inline-block ".concat(Xp.a.alertContent)},l.createElement("p",{className:"p-0 m-0 pb-1 ".concat(Xp.a.heading)},o),l.createElement("p",{className:"p-0 m-0 text-break clamp-4 ".concat(Xp.a.message),dangerouslySetInnerHTML:{__html:p}}),!!c&&l.createElement(fu,{className:f,appLink:c},s)),l.createElement("div",{className:"close d-inline-block cursor-pointer",role:"button",onClick:i},"×"))}function td(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nd(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rd=function(e){switch(e.type){case qf.Success:return Dc.CheckCircleOutline;case qf.Fail:case qf.Warning:return Dc.Warning;case qf.Info:default:return Dc.Info}};function id(e){var t=e.alert,n=e.closeAlert,r=td(l.useState(!0),2),i=r[0],a=r[1],o=l.useRef();l.useEffect((function(){i?o.current=window.setTimeout(n,3e3):clearTimeout(o.current)}),[i]);var c="text-".concat(t.type.toLowerCase());return l.createElement("li",{className:"bg-white mt-2 p-2 show clearfix ".concat(Xp.a.alertItem),onMouseEnter:function(){return a(!1)},onMouseLeave:function(){return a(!0)}},l.createElement(ed,{alert:t,svgName:rd(t),svgClassName:c,closeAlert:n}))}function ad(e){var t=e.alerts,n=e.removeAlert;return l.createElement("div",{className:Xp.a.alertBox},l.createElement(Zp.TransitionGroup,{component:"ul",className:"".concat(Xp.a.alertList," list-unstyled")},t&&t.map((function(e,t){return l.createElement(Zp.CSSTransition,{key:t,timeout:200,classNames:"alert"},l.createElement(id,{alert:e,closeAlert:function(){return n(e.id)}}))}))))}var od=n(20),cd={namespace:"domain_options"},sd=function(){return"/api/domain/v3/settings/types"},ud=function(e){return"/api/domain/v3/settings/types/".concat(e)},ld=function(){return"/api/domain/v3/settings/types"},fd=function(e){return"/api/domain/v3/settings/types/".concat(e)},pd=function(e){return"/api/domain/v3/settings/types/".concat(e)},dd="domain:options",md="domain:option",hd="update:domain:option",yd="delete:domain:option",vd=function(){return{key:dd,url:sd(),normalizeOptions:cd}},bd=function(e){return{key:"".concat(md,":").concat(e),url:ud(e),normalizeOptions:cd}},gd=function(e,t,n){return e.type===od.DomainOptionType.String&&(e=Od(e)),{key:md,url:ld(),data:e,type:ce.a.POST,success:t,error:n,invalidationKeys:[dd],normalizeOptions:cd}},Sd=function(e,t){return e.type===od.DomainOptionType.String&&(e=Od(e)),{key:"".concat(hd,":").concat(e.id),url:fd(e.id),data:e,type:ce.a.PUT,always:t,formatData:function(){return e},normalizeOptions:cd}},Ed=function(e,t){return{key:"".concat(yd,":").concat(e),url:pd(e),type:ce.a.DELETE,invalidationKeys:[dd],normalizeOptions:cd,success:t}};function Od(e){var t=e.defaultValue;if('"'===t)return Object.assign(Object.assign({},e),{defaultValue:'"'.concat(t,'"')});var n=t.charAt(0),r=t.charAt(t.length-1);return'"'!==n&&(t='"'.concat(t)),'"'!==r&&(t="".concat(t,'"')),Object.assign(Object.assign({},e),{defaultValue:t})}function Cd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ad(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ad(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ad(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wd(e){var t=Cd(l.useState(!1),2),n=t[0],r=t[1],a=oe.useBasicFetch(bd(e.optionId)),o=Object(v.useDispatch)(),s=function(){e.closePopup(),p.AppLinkHelper.trigger({application:c.DOMAIN_OPTIONS,action:i.DomainOptions.DOMAIN_OPTIONS})};return l.createElement(rp,{title:"Delete Domain Option",closePopup:e.closePopup,showLoadingSpinner:!a.data},a.data&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,a.data.name),"?")),l.createElement(ap,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){r(!0),oe.fetch(o,Ed(e.optionId,s))},buttonText:"Yes, delete this domain option",isSpinnerButton:!0,showSpinner:n}]})))}var jd,Id=function(e){return{application:c.DOMAIN_OPTIONS,action:i.DomainOptions.EDIT_DOMAIN_OPTION,args:[e.id]}},kd={application:c.DOMAIN_OPTIONS,action:i.DomainOptions.NEW_DOMAIN_OPTION};function Td(){var e=oe.useBasicFetch(vd());if(!e.data)return l.createElement(l.Fragment,null);var t=e.data.map((function(e){return e.displayName&&(e.name=e.displayName),e}));return l.createElement(l.Fragment,null,l.createElement("div",{className:"d-flex justify-content-between mb-2"},l.createElement("h5",{className:"d-inline-block m-0"},"Select a domain option type to edit:"),l.createElement(fu,{appLink:kd,className:"d-block"},l.createElement(Mc,{svgName:Dc.Plus,size:Nc.Small}),l.createElement("span",null,"New Domain Option"))),l.createElement(yl,{objects:t,getAppLink:Id}))}!function(e){e[e.Audience=1]="Audience",e[e.Category=2]="Category",e[e.Channel=3]="Channel",e[e.Chapter=4]="Chapter",e[e.Comment=5]="Comment",e[e.OwnerComment=6]="OwnerComment",e[e.Image=7]="Image",e[e.Thumbnail=8]="Thumbnail",e[e.Avatar=9]="Avatar",e[e.Banner=10]="Banner",e[e.Video=11]="Video",e[e.Trailer=12]="Trailer",e[e.Rating=13]="Rating",e[e.Topic=14]="Topic",e[e.Series=15]="Series",e[e.Season=16]="Season",e[e.HostedMediaObjectCollection=17]="HostedMediaObjectCollection",e[e.ExchangeCollection=18]="ExchangeCollection",e[e.CustomMediaObjectCollection=19]="CustomMediaObjectCollection",e[e.Playlist=20]="Playlist",e[e.ClickViewTvCollection=21]="ClickViewTvCollection",e[e.ClickViewProductionsCollection=22]="ClickViewProductionsCollection",e[e.User=23]="User",e[e.SystemUser=24]="SystemUser",e[e.Customer=25]="Customer",e[e.Country=26]="Country",e[e.Organisation=28]="Organisation",e[e.SystemOrganisation=29]="SystemOrganisation",e[e.Group=30]="Group",e[e.SystemGroup=31]="SystemGroup",e[e.FlagReason=32]="FlagReason",e[e.Library=33]="Library",e[e.Interactive=34]="Interactive",e[e.WorkspaceCollection=35]="WorkspaceCollection",e[e.Conversation=36]="Conversation",e[e.Message=37]="Message",e[e.Notification=38]="Notification",e[e.Clip=39]="Clip",e[e.Link=40]="Link",e[e.UserChannel=41]="UserChannel",e[e.Resource=42]="Resource",e[e.VideoStream=43]="VideoStream",e[e.AudioStream=44]="AudioStream",e[e.Tag=45]="Tag",e[e.Subtitle=46]="Subtitle",e[e.LicencedContentCollection=47]="LicencedContentCollection",e[e.PublicCollection=48]="PublicCollection",e[e.CategoryTree=49]="CategoryTree",e[e.Logo=50]="Logo",e[e.Permission=51]="Permission",e[e.Subject=52]="Subject",e[e.Field=53]="Field",e[e.Company=54]="Company",e[e.Person=55]="Person",e[e.Cover=56]="Cover",e[e.Poster=57]="Poster",e[e.SubjectAudience=58]="SubjectAudience",e[e.Classroom=67]="Classroom",e[e.ClassroomGroup=68]="ClassroomGroup"}(jd||(jd={}));var Ld=ji.object().shape({id:ji.string(),name:ji.string().trim().max(64,"Name is too long").required("Name is required").default(""),displayName:ji.string().trim().max(255,"Display name is too long").required("Display name is required").default(""),type:ji.mixed().required("Type is required").default(od.DomainOptionType.Boolean),entityType:ji.mixed().required("Entity type is required").default(jd.Customer),kind:ji.mixed().required("Kind is required").default(od.DomainOptionKind.Temporary),defaultValue:ji.mixed().required("Default value is required").default("false")}).noUnknown();function _d(e){var t=e.type,n=e.defaultValue;if(!t)return l.createElement(l.Fragment,null);var r={label:"Default Value",name:"defaultValue",id:"defaultValue",value:n};return t===od.DomainOptionType.Boolean?l.createElement(Bc,Object.assign({as:"select"},r),l.createElement("option",{value:"true"},"True"),l.createElement("option",{value:"false"},"False")):t===od.DomainOptionType.Long||t===od.DomainOptionType.StaffRequest?l.createElement(Bc,Object.assign({as:"input",type:"number"},r)):t===od.DomainOptionType.String?l.createElement(Bc,Object.assign({as:"input"},r)):void 0}var Pd=[jd.Customer,jd.User];function xd(e){var t=null===e.id||void 0===e.id,n=ci(),r=qc(n);return l.createElement(vi,null,l.createElement(Bc,{label:"Name (snake_case)",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this domain option",autoFocus:!0}),l.createElement(Bc,{label:"Display Name",type:"text",name:"displayName",id:"displayName",value:n.values.displayName,placeholder:"Enter a display name for this domain option"}),l.createElement(Bc,{as:"select",label:"Kind",name:"kind",id:"kind",value:n.values.kind},Ci.a.getEnumKeys(od.DomainOptionKind).map((function(e){return l.createElement("option",{key:e,value:od.DomainOptionKind[e]},e)}))),l.createElement(Bc,{as:"select",label:"Entity",name:"entityType",id:"entityType",value:n.values.entityType},Ci.a.getEnumKeys(jd).filter((function(e){return Pd.includes(jd[e])})).map((function(e){return l.createElement("option",{key:e,value:jd[e]},e)}))),l.createElement(Bc,{as:"select",label:"Type",name:"type",id:"type",value:n.values.type},Ci.a.getEnumKeys(od.DomainOptionType).map((function(e){return l.createElement("option",{key:e,value:od.DomainOptionType[e]},e)}))),l.createElement(_d,{type:n.values.type,defaultValue:n.values.defaultValue}),l.createElement("div",{className:"d-flex justify-content-between"},l.createElement(sf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&l.createElement(ki.Button,{as:fu,variant:"danger",appLink:{application:c.DOMAIN_OPTIONS,action:i.DomainOptions.DELETE_DOMAIN_OPTION,args:[e.id]}},"Delete")))}function Nd(e){return l.createElement(wi,{initialValues:e.domainOption,validationSchema:Ld,onSubmit:e.saveDomainOption},l.createElement(xd,{id:e.domainOption&&e.domainOption.id}))}function Rd(){var e=Object(v.useDispatch)();return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Create New Domain Option"),l.createElement(Nd,{saveDomainOption:function(t,n){oe.fetch(e,gd(t,(function(e){n(),p.AppLinkHelper.trigger({application:c.DOMAIN_OPTIONS,action:i.DomainOptions.EDIT_DOMAIN_OPTION,args:[e.id]})}),n))}}))}function Dd(e){var t=e.optionId,n=oe.useBasicFetch(bd(t)),r=Object(v.useDispatch)();return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Edit Domain Option"),n.data&&l.createElement(Nd,{domainOption:n.data,saveDomainOption:function(e,t){return oe.fetch(r,Sd(e,t))}}))}function Md(e){return(Md="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ud(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Vd(e,t,n){return t&&Fd(e.prototype,t),n&&Fd(e,n),e}function Bd(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zd(e,t)}function zd(e,t){return(zd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Jd(e);if(t){var i=Jd(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return qd(this,n)}}function qd(e,t){return!t||"object"!==Md(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Jd(e){return(Jd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $d=function(e){Bd(n,e);var t=Hd(n);function n(){return Ud(this,n),t.apply(this,arguments)}return Vd(n,[{key:"channelName",get:function(){return c.DOMAIN_OPTIONS}},{key:"appRoutes",get:function(){return{"developer/options(/)":"domainOptions","developer/options/new(/)":"newDomainOption","developer/options/:id(/)":"editDomainOption"}}},{key:"appLinks",get:function(){return["deleteDomainOption"]}}]),n}(p.AppRouter),Kd=function(e){Bd(n,e);var t=Hd(n);function n(){return Ud(this,n),t.apply(this,arguments)}return Vd(n,[{key:"name",get:function(){return"Domain Options Application"}},{key:"channelName",get:function(){return c.DOMAIN_OPTIONS}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT}}},{key:"domainOptions",value:function(){this.layout.showChildView(k,l.createElement(Td,null))}},{key:"newDomainOption",value:function(){this.layout.showChildView(k,l.createElement(Rd,null))}},{key:"editDomainOption",value:function(e){this.layout.showChildView(k,l.createElement(Dd,{optionId:e}))}},{key:"deleteDomainOption",value:function(e){this.layout.showChildView(T,l.createElement(wd,Object.assign({optionId:e},this.getPopupProps())))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return tu.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(L,l.createElement(ad,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return $d}}]),n}(p.Application),Yd=function(e){return e?"".concat("/api/master/v2/people","?cursor=").concat(e):"/api/master/v2/people"},Gd=function(e){return"/api/master/v2/objects/".concat(e)},Wd=function(){return"/api/master/v2/people"},Zd=function(e){return"/api/master/v2/objects/".concat(e)},Qd="people",Xd="person",em="update:person",tm=function(e){return{key:"".concat(Qd).concat(e?":".concat(e):""),url:Yd(e)}},nm=function(e){return{key:"".concat(Xd,":").concat(e),url:Gd(e)}},rm=function(e,t,n){return{key:Xd,url:Wd(),data:e,type:ce.a.POST,success:t,error:n,invalidationKeys:[Qd]}},im=function(e,t,n){return{key:"".concat(em,":").concat(e),url:Zd(e),data:t,type:ce.a.PUT,always:n}},am=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown();function om(e){var t=ci();return l.createElement(vi,null,l.createElement(Bc,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this person",autoFocus:!0}),l.createElement(ls,{isNew:e.isNew}))}function cm(e){return l.createElement(wi,{initialValues:e.person,validationSchema:am,onSubmit:e.savePerson},l.createElement(om,{isNew:!(e.person&&e.person.id)}))}function sm(e){var t=Object(v.useDispatch)(),n=oe.useBasicFetch(nm(e.id));return l.createElement(l.Fragment,null,!!n.data&&l.createElement(cm,{person:n.data,savePerson:function(n,r){return oe.fetch(t,im(e.id,n,r))}}))}function um(){var e=Object(v.useDispatch)();return l.createElement(cm,{savePerson:function(t,n){oe.fetch(e,rm(t,(function(e){n(),p.AppLinkHelper.trigger({application:c.PEOPLE,action:i.People.EDIT_PERSON,args:[e.id]})}),n))}})}var lm=c.PEOPLE,fm=function(e){return{application:lm,action:i.People.EDIT_PERSON,args:[e.id]}},pm=function(e){return p.AppLinkHelper.trigger(fm(e))};function dm(e){var t=oe.useBasicFetch(tm(e.cursor));return l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-3 w-50"},l.createElement(Hs,{placeholder:"Search for a person",onSuggestionSelected:pm,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/people/instant/raw","?q=").concat(e)},activationLength:2})),l.createElement(nl,{collection:t&&t.data,collectionAppLink:{application:lm,action:i.People.PEOPLE},newObjectAppLink:{application:lm,action:i.People.NEW_PERSON},getObjectAppLink:fm,objectName:"Person"}))}function mm(e){return(mm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ym(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function vm(e,t,n){return t&&ym(e.prototype,t),n&&ym(e,n),e}function bm(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gm(e,t)}function gm(e,t){return(gm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Sm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Om(e);if(t){var i=Om(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Em(this,n)}}function Em(e,t){return!t||"object"!==mm(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Om(e){return(Om=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Cm,Am=function(e){bm(n,e);var t=Sm(n);function n(){return hm(this,n),t.apply(this,arguments)}return vm(n,[{key:"channelName",get:function(){return c.PEOPLE}},{key:"appRoutes",get:function(){return{"manage/people(/)":"people","manage/people/new(/)":"newPerson","manage/people/:id(/)":"editPerson"}}}]),n}(p.AppRouter),wm=function(e){bm(n,e);var t=Sm(n);function n(){return hm(this,n),t.apply(this,arguments)}return vm(n,[{key:"name",get:function(){return"People Application"}},{key:"channelName",get:function(){return c.PEOPLE}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT}}},{key:"people",value:function(e){var t=e.cursor;this.layout.showChildView(k,l.createElement(dm,{cursor:t}))}},{key:"newPerson",value:function(){this.layout.showChildView(k,l.createElement(um,null))}},{key:"editPerson",value:function(e){this.layout.showChildView(k,l.createElement(sm,{id:e}))}}],[{key:"router",get:function(){return Am}}]),n}(p.Application),jm=function(e,t,n,r,i){return{url:"/api/image/upload?type=".concat(t),key:"upload:image",data:e,type:ce.a.POST,success:n,error:r,always:i}},Im=n(213),km=n.n(Im);function Tm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Lm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e){e[e.NoRestrictions=0]="NoRestrictions",e[e.RestrictToCanvas=1]="RestrictToCanvas"}(Cm||(Cm={}));var _m=/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/;function Pm(e){var t=e.dataUrl,n=e.minHeight,r=e.minWidth,i=e.onCrop,a=e.onCancel,o=l.useRef(),c=l.useRef(),s=Tm(l.useState(!1),2),u=s[0],f=s[1],p=Tm(l.useState(!1),2),d=p[0],h=p[1];return l.useEffect((function(){var e=new Image;e.src=t;var i=o.current.offsetWidth/e.width;return c.current=new km.a(o.current,{viewMode:Cm.RestrictToCanvas,autoCropArea:1,aspectRatio:r/n,minCropBoxWidth:r*i,minCropBoxHeight:n*i,ready:function(){return f(!0)}}),function(){return c.current.destroy()}}),[]),l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-3"},l.createElement("img",{ref:o,src:t,className:"img img-fluid"})),l.createElement("div",{className:"d-flex justify-content-end border-top pt-3"},l.createElement(ki.Button,{variant:"link",onClick:a},"Cancel"),l.createElement(sf,{onClick:function(){if(u){h(!0);var e=c.current.getCroppedCanvas().toDataURL(function(e){var t=e.match(_m);if(t)return t[1]}(t));m(i)&&i(e)}},disabled:!u,showSpinner:d},"Crop")))}function xm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Nm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Rm(e){var t=Object(v.useDispatch)(),n=l.useContext(Ru),r=n.getDataUrl,i=n.setImage,a=xm(l.useState(r()),1)[0],o=xm(l.useState(!1),2),c=o[0],s=o[1];return l.createElement(rp,{title:"Crop Image",size:e.popupSize,closePopup:e.closePopup,onEntered:function(){return s(!0)}},c&&l.createElement(Pm,{dataUrl:a,minWidth:_u[e.imageType].width,minHeight:_u[e.imageType].height,onCrop:function(n){oe.fetch(t,jm(n,e.imageType,(function(e){return i(e)}),null,e.closePopup))},onCancel:e.closePopup}))}var Dm=function(e){var t=e.children;return l.createElement(Du,null,t)};function Mm(e){var t=e.page,n=e.totalPages,r=Ss.isNumber(t)&&t>0&&t<n&&t+1,i=Ss.isNumber(t)&&t>1&&t-1,a={};if(r&&r<=n&&(a.next=r.toString()),i&&(a.previous=i.toString()),!Ci.a.isEmpty(a))return a}var Um={convertLegacyPaginatedCollection:function(e){if(e)return{data:e.data,pagination:{cursors:Mm(e.pagination),limit:e.pagination.pageSize}}}},Fm=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"1";return{key:"playlists:".concat(e),url:"/ajax/playlists/curators?page=".concat(e),formatData:Um.convertLegacyPaginatedCollection}},Vm=function(e,t){var n="/api/domain/v1/search/playlists?query=".concat(e);return t&&(n+="&filter={page:".concat(t,"}")),{key:"playlists:search:".concat(e).concat(t?":".concat(t):""),url:n,formatData:Um.convertLegacyPaginatedCollection}},Bm=function(e){return{key:"playlist:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=cover,banner")}},zm=function(e){var t=e.slice().sort();return{key:"playlists:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},Hm=function(e,t,n,r,i){return{url:"/api/master/v2/objects/".concat(t,"/playlists"),key:"playlist",data:Object.assign(Object.assign({},e),{permissions:kp()}),type:ce.a.POST,invalidationKeys:"playlists",success:n,error:r,always:i}},qm=function(e,t,n,r,i){return{url:"/api/master/v2/objects/".concat(e),key:"update:playlist:".concat(e),data:t,type:ce.a.PUT,success:n,error:r,always:i}},Jm=function(e,t,n,r){return{url:"/api/master/v1/playlists/".concat(e),key:"delete:playlist:".concat(e),type:ce.a.DELETE,invalidationKeys:"playlists",success:t,error:n,always:r}},$m=function(e){return{key:"playlist:".concat(e,":videos"),url:"/api/master/v2/objects/".concat(e,"/videos?query={orderBy:orderindex,limit:100}")}},Km=function(e,t,n,r){return{key:"reorder:playlist",url:"/api/master/v1/objects/".concat(e,"/videos/reorder"),data:t,type:ce.a.PUT,invalidationKeys:"playlist:".concat(e,":videos"),success:n,error:r}},Ym=function(e,t,n,r,i){return{key:"remove:playlist:video",url:"/api/master/v1/playlists/".concat(e,"/dissociate/").concat(t),type:ce.a.DELETE,invalidationKeys:"playlist:".concat(e,":videos"),success:n,error:r,always:i}};function Gm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Wm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wm(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zm(e){var t=Object(v.useDispatch)(),n=tp(),r=Gm(l.useState(!1),2),a=r[0],o=r[1],s=oe.useBasicFetch(Bm(e.playlistId));var u=[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){o(!0),oe.fetch(t,Jm(e.playlistId,(function(){n.success("Successfully deleted playlist."),p.AppLinkHelper.trigger({application:c.PLAYLISTS,action:i.Playlists.PLAYLISTS})}),(function(){o(!1),n.error("Failed to delete playlist.")}),e.closePopup))},buttonText:"Yes, delete playlist",isSpinnerButton:!0,showSpinner:a}],f=!!s.data;return l.createElement(rp,{title:"Delete Playlist",closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,s.data.name),"?"),l.createElement("p",null,"Please ensure it is not being used in any widgets.")),l.createElement(ap,{buttons:u})))}var Qm=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:ji.string().trim().max(65535,"Description is too long").default(""),cover:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown(),banner:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown()}).noUnknown(),Xm=function(e,t){var n=c.PLAYLISTS,r=i.Playlists,a=[{label:"Edit Playlist Details",appLink:{application:n,action:r.EDIT_PLAYLIST,args:[t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_PLAYLIST_VIDEOS,args:[t]}}];return Lp(e)&&a.push.apply(a,[{label:"Backbone Classifications",appLink:{application:n,action:r.EDIT_PLAYLIST_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_PLAYLIST_AUDIENCES,args:[t]}}]),a};function eh(e){var t=ci(),n=qc(t);return l.createElement(vi,null,l.createElement(Bc,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this playlist",autoFocus:!0}),l.createElement(Bc,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this playlist here"}),l.createElement(Xu,{imageType:yu.Covers,fieldName:"cover",application:c.PLAYLISTS,uploadAction:i.Playlists.UPLOAD_IMAGE}),l.createElement(Xu,{imageType:yu.Banners,fieldName:"banner",application:c.PLAYLISTS,uploadAction:i.Playlists.UPLOAD_IMAGE}),l.createElement("div",{className:"d-flex justify-content-between align-items-center"},l.createElement(sf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.id?"Save":"Create"),!!e.actions&&l.createElement(pl,{actions:e.actions})))}function th(e){var t,n=e.playlist&&e.playlist.id;return l.createElement(wi,{initialValues:e.playlist,validationSchema:Qm,onSubmit:e.savePlaylist},l.createElement(eh,{id:n,actions:!!n&&(t=n,[{label:"Delete playlist",appLink:{application:c.PLAYLISTS,action:i.Playlists.DELETE_PLAYLIST,args:[t]},className:"text-danger"}])}))}function nh(e){return l.createElement("div",{className:"py-2"},l.createElement(jl,{tabs:Xm(e.currentUser,e.playlistId),isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}));var t}function rh(e){var t=Object(v.useDispatch)(),n=tp(),r=oe.useBasicFetch(Bm(e.playlistId)),a=oe.useBasicFetch(hp());return l.createElement(l.Fragment,null,!!a.data&&l.createElement(nh,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST,currentUser:a.data}),!!r.data&&l.createElement(th,{playlist:r.data,savePlaylist:function(r,i){oe.fetch(t,qm(e.playlistId,r,(function(){n.success("Successfully updated playlist.")}),(function(){n.error("Failed to update playlist.")}),i))}}))}var ih=function(e,t){var n=e.dataServiceName,r=e.eventPrefix,i=e.fetchData,a=e.setData,o=e.onError,c=e.deleteEventPrefix;if(m(i)){if(m(a)){var s=o&&m(o),u=zf.getInstance(n),l=tu.Radio.channel(u.channelName),f="".concat(r,":request"),d="".concat(r,":sync"),h="".concat(r,":error"),y="".concat(r,":invalidate"),v=c&&"".concat(c,":sync"),b=function(){return t(!1)},g=function(){return t(!0)},S=function(){return t(!1)},E=function(){return l.off(y,S)};l.once(f,b),l.once(d,g),l.once(y,S),s&&l.once(h,o),v&&l.once(v,E);var O=i(u);return O&&(t(!0),e.setData(O)),function(){zf.releaseInstance(n),l.off(f,b),l.off(d,g),l.off(y,S),s&&l.off(h,o),v&&l.off(v,E)}}p.ErrorHelper.throw(new Zc.a("A setData function must be passed to fetch"))}else p.ErrorHelper.throw(new Zc.a("A fetchData function must be passed to fetch"))};function ah(e){return function(e){if(Array.isArray(e))return sh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||ch(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||ch(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ch(e,t){if(e){if("string"==typeof e)return sh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sh(e,t):void 0}}function sh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var uh=function(e){return Array(Array.isArray(e)?e.length:0).fill(!1)};function lh(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=l.useState(uh(e)),i=oh(r,2),a=i[0],o=i[1];l.useEffect((function(){o(uh(e))}),ah(t)),l.useEffect((function(){if(n){var t=[];return e&&e.forEach((function(e,n){t.push(ih(e,(function(e){e!==a[n]&&o(yp.a.cloneAndReplaceAtIdx(a,n,e))})))})),function(){return t.forEach((function(e){return e()}))}}}),[a,n])}function fh(e){return function(e){if(Array.isArray(e))return mh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||dh(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ph(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||dh(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dh(e,t){if(e){if("string"==typeof e)return mh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mh(e,t):void 0}}function mh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hh(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=l.useState(!1),i=ph(r,2),a=i[0],o=i[1];l.useEffect((function(){o(!1)}),fh(t)),l.useEffect((function(){if(n)return ih(e,o)}),[a,n])}var yh=function(e,t,n){return function(r){return e((function(e){var i=m(n)?n:h();return Object.assign(Object.assign({},e),function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,i(r,e)))}))}};function vh(e){return(vh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bh(e){return function(e){if(Array.isArray(e))return gh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return gh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gh(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Sh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Eh(e,t){return(Eh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Oh(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=wh(e);if(t){var i=wh(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ch(this,n)}}function Ch(e,t){return!t||"object"!==vh(t)&&"function"!=typeof t?Ah(e):t}function Ah(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wh(e){return(wh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jh,Ih,kh,Th,Lh,_h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Eh(e,t)}(a,e);var t,n,r,i=Oh(a);function a(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),t=i.call(this,e),d.result(Ah(t),"name")||Yc.c.throw(new Zc.a("Must provide a name when extending BaseDataService")),d.result(Ah(t),"channelName")||Yc.c.throw(new Zc.a("Must provide a channelName for ".concat(d.result(Ah(t),"name"))));var n=[].concat(bh(t.defaultProps),bh(t.props||[]));return t.dataRequestSignatures={},t.mergeOptions(e,n),t}return t=a,(n=[{key:"defaultProps",get:function(){return["dataProvider","cache","bootstrapData","defaultErrorHandler","alertService"]}},{key:"getCursors",value:function(e){var t=this.cache.get(e);return t?t.cursors:{}}},{key:"clearCacheAndGet",value:function(e){var t=this,n=e.callback,r=e.errorCallback,i=e.eventPrefix,a=this.getEventNames(i),o=a.syncEvent,c=a.errorEvent,s=this.cache.get(i);if(s&&s.openRequest)return this.listenToOnce(this.getChannel(),o,(function(e){d.isFunction(r)&&t.stopListening(t.getChannel(),c,r),d.isFunction(n)&&n(e)})),void this.listenToOnce(this.getChannel(),c,(function(){d.isFunction(n)&&t.stopListening(t.getChannel(),o,n),d.isFunction(r)&&r()}));this.cache.remove(e.eventPrefix),this.get(e)}},{key:"get",value:function(e){var t=this,n=e.callback,r=e.errorCallback,i=e.eventPrefix,a=e.resource,o=e.formatData,c=e.expiryTime,s=e.successHandler,u=e.errorHandler,l=e.bootstrapName,f=this.getEventNames(i),p=f.syncEvent,m=f.requestEvent,h=f.successEvent,y=f.errorEvent,v=this.getChannel(),b=this.currentTimestamp();this.bootstrapData&&this.bootstrapData[l]&&(this.cacheData(i,this.bootstrapData[l],o,{openRequest:!1,timestamp:b}),delete this.bootstrapData[l]);var g,S=this.cache.get(i);S&&(g=S.data);var E=S&&S.openRequest,O=this.isExpired(i,c);if(E&&(this.listenToOnce(v,p,(function(e){d.isFunction(r)&&t.stopListening(t.getChannel(),y,r),d.isFunction(n)&&n(e)})),this.listenToOnce(v,y,(function(){d.isFunction(n)&&t.stopListening(t.getChannel(),p,n),d.isFunction(r)&&r()}))),this.cache.has(i)&&!O||(v.trigger(m),this.listenToResponse({eventPrefix:i,formatData:o,cacheOptions:{timestamp:b},callback:n,errorCallback:r,successHandler:s,errorHandler:u}),this.cacheData(i,null,null,{openRequest:!0,timestamp:b}),this.dataProvider.read(a,{channel:this.getTransportChannel(),successEvent:h,errorEvent:y})),g&&d.isFunction(n)&&!O&&n(g),g)return g}},{key:"create",value:function(e){var t=e.eventPrefix,n=e.resource,r=e.data,i=e.formatData,a=e.callback,o=e.errorCallback,c=e.invalidationKeys,s=e.successHandler,u=e.errorHandler,l=this.getEventNames(e.eventPrefix),f=l.requestEvent,p=l.successEvent,d=l.errorEvent,m=this.getChannel(),h=this.getTransportChannel();m.trigger(f),this.listenToResponse({eventPrefix:t,formatData:i,invalidationKeys:c,callback:a,errorCallback:o,successHandler:s,errorHandler:u}),this.dataProvider.create(n,r,{channel:h,successEvent:p,errorEvent:d})}},{key:"update",value:function(e){var t=e.data,n=e.callback,r=e.errorCallback,i=e.resource,a=e.formatData,o=e.eventPrefix,c=e.invalidationKeys,s=e.errorHandler,u=e.successHandler,l=this.getEventNames(e.eventPrefix),f=l.requestEvent,p=l.successEvent,d=l.errorEvent,m=this.getChannel(),h=this.getTransportChannel();m.trigger(f),this.listenToResponse({eventPrefix:o,formatData:a,invalidationKeys:c,callback:n,errorCallback:r,successHandler:u,errorHandler:s}),this.dataProvider.update(i,t,{channel:h,successEvent:p,errorEvent:d})}},{key:"delete",value:function(e){var t=e.eventPrefix,n=e.resource,r=e.callback,i=e.errorCallback,a=e.invalidationKeys,o=e.successHandler,c=e.errorHandler,s=this.getEventNames(t),u=s.successEvent,l=s.errorEvent,f=this.getTransportChannel();this.listenToResponse({eventPrefix:t,invalidationKeys:a,callback:r,errorCallback:i,cacheOptions:{noCache:!0,clearCacheKey:!0},successHandler:o,errorHandler:c}),this.dataProvider.delete(n,{channel:f,successEvent:u,errorEvent:l})}},{key:"listenToResponse",value:function(e){var t=this,n=e.eventPrefix,r=e.formatData,i=e.callback,a=e.errorCallback,o=e.successHandler,c=e.errorHandler,s=e.invalidationKeys,u=e.cacheOptions,l=void 0===u?{}:u,f=this.getEventNames(n),p=f.syncEvent,m=f.successEvent,h=f.errorEvent,y=f.successAlertEvent,v=f.errorAlertEvent,b=this.getChannel(),g=this.getTransportChannel(),S=this.getAlertChannel();d.isFunction(i)&&this.listenToOnce(b,p,i),d.isFunction(a)&&this.listenToOnce(b,h,a),this.stopListening(S,y),this.stopListening(S,v),d.isFunction(o)&&this.listenToOnce(S,y,o),d.isFunction(c)&&this.listenToOnce(S,v,c),!d.isFunction(c)&&!1!==c&&d.isFunction(this.defaultErrorHandler)&&this.listenToOnce(S,v,this.defaultErrorHandler),this.hasRequestSignature(n)||(this.setRequestSignature(n),this.listenTo(g,m,(function(e){t.stopListening(b,h,a);for(var i=arguments.length,o=new Array(i>1?i-1:0),c=1;c<i;c++)o[c-1]=arguments[c];S.trigger.apply(S,[y,e].concat(o));var u=l.noCache?t.formatData(e,r):t.cacheData(n,e,r);l.clearCacheKey&&t.cache.remove(n),b.trigger(p,u),s&&s.length&&t.cache.invalidate(s,(function(e){return b.trigger("".concat(e,":invalidate"))}))})),this.listenTo(g,h,(function(){var e;t.stopListening(b,p,i);var r=(e=t.dataProvider).parseError.apply(e,arguments);S.trigger(v,r),b.trigger(h,r),l.noCache||t.cacheData(n,null,null)})))}},{key:"cacheData",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.openRequest,a=void 0!==i&&i,o=r.timestamp;o||(o=this.currentTimestamp());var c=this.processPagination(t),s=this.formatData(t,n);return this.cache.set(e,{data:s,timestamp:o,cursors:c,openRequest:a}),s}},{key:"processPagination",value:function(e){if(e){var t=e.pagination;if(t)return t.cursors?t.cursors:d.isUndefined(t.offset)||d.isUndefined(t.pageSize)?t.page?this.convertLegacyPaginationToCursors(t):void 0:this.convertOffsetPaginationToCursors(t)}}},{key:"formatData",value:function(e,t){return d.isFunction(t)?t(e):e}},{key:"chain",value:function(){var e=this,t=[],n=function(e,t){d.isFunction(e)&&e(t)},r=function(r,a){return t.push((function(){var i=r.callback;r.callback=function(e){n(i,e),n(t.shift())},e[a](r)})),i},i={func:function(e){return t.push((function(){e(t.shift()||function(){})})),i},get:function(e){return r(e,"get")},create:function(e){return r(e,"create")},update:function(e){return r(e,"update")},delete:function(e){return r(e,"delete")},run:function(){n(t.shift())}};return i}},{key:"invalidateCache",value:function(e){e&&e.length&&this.cache.invalidate(e)}},{key:"currentTimestamp",value:function(){return(new Date).valueOf()}},{key:"isExpired",value:function(e,t){if(!t)return!1;var n=this.cache.get(e);if(!n||!n.timestamp)return!0;var r=1e3*t;return n.timestamp<this.currentTimestamp()-r}},{key:"getEventNames",value:function(e){return{syncEvent:"".concat(e,":sync"),requestEvent:"".concat(e,":request"),successEvent:"".concat(e,":success"),errorEvent:"".concat(e,":error"),successAlertEvent:"".concat(e,":success:alert"),errorAlertEvent:"".concat(e,":error:alert")}}},{key:"getTransportChannel",value:function(){return tu.Radio.channel("".concat(this.channelName,":transport"))}},{key:"getAlertChannel",value:function(){return tu.Radio.channel("".concat(this.channelName,":alert"))}},{key:"setRequestSignature",value:function(e){this.dataRequestSignatures[e]=e}},{key:"hasRequestSignature",value:function(e){return!!this.dataRequestSignatures[e]}},{key:"convertOffsetPaginationToCursors",value:function(e){var t=e.offset,n=e.pageSize,r=e.totalItems,i=r>0&&t<r&&t+n,a=r>0&&t>0&&Math.max(t-n,0),o={};if(i&&i<r&&(o.next=i.toString()),d.isNumber(a)&&(o.previous=a.toString()),!d.isEmpty(o))return o}},{key:"convertLegacyPaginationToCursors",value:function(e){var t=e.page,n=e.totalPages,r=d.isNumber(t)&&t>0&&t<n&&t+1,i=d.isNumber(t)&&t>1&&t-1,a={};if(r&&r<=n&&(a.next=r.toString()),i&&(a.previous=i.toString()),!d.isEmpty(a))return a}}])&&Sh(t.prototype,n),r&&Sh(t,r),a}(Kc.a),Ph=n(47),xh={SHORT:120,STANDARD:600};!function(e){e[e.Subject=0]="Subject",e[e.Classification=1]="Classification",e[e.Level=2]="Level",e[e.Audience=3]="Audience"}(jh||(jh={})),function(e){e.Playlists="playlists",e.Series="series",e.Videos="videos"}(Ih||(Ih={})),function(e){e.Playlists="playlists",e.Series="series",e.Videos="videos"}(kh||(kh={})),function(e){e.Root="0"}(Th||(Th={})),function(e){e.Root="root"}(Lh||(Lh={}));var Nh,Rh,Dh=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default(""),backboneAudienceIds:ji.array().of(ji.string()).required("A level is required").default([])}).noUnknown();!function(e){e.Subject="Subject",e.Topic="Topic"}(Nh||(Nh={})),function(e){e.Draft="Draft",e.ComingSoon="ComingSoon",e.Published="Published"}(Rh||(Rh={}));var Mh=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default(""),parentIds:ji.array().of(ji.string()).default([Lh.Root]),backboneClassificationIds:ji.array().of(ji.string()).min(1,"A classification must be mapped to at least one subject").required("A classification must be mapped to at least one subject").default([]),type:ji.mixed().required("Type is required").default(Nh.Subject),status:ji.mixed().required("Status is required").default(Rh.Draft),emphasize:ji.boolean().default(!1),canBePreferred:ji.boolean().default(!1),cover:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown(),banner:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown(),tallPoster:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown()}).noUnknown(),Uh=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown(),Fh=ji.object().shape({name:ji.string().max(255,"Name is too long").required("Name is required"),description:ji.string().max(65535,"Description is too long").required("Description is required"),status:ji.mixed().required("Status is required").default(jp.Draft)}),Vh=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default(""),parentId:ji.string().default(Th.Root)}).noUnknown(),Bh={singularizeMemberType:function(e){switch(e){case Ih.Playlists:return"playlist";case Ih.Series:return"series";case Ih.Videos:return"video"}},getMemberAppLink:function(e,t){var n=[t];switch(e){case Ih.Playlists:return{application:c.PLAYLISTS,action:i.Playlists.EDIT_PLAYLIST,args:n};case Ih.Series:return{application:c.SERIES,action:i.Series.EDIT_SERIES,args:n};case Ih.Videos:return{application:c.VIDEOS,action:i.Videos.EDIT_VIDEO,args:n}}},getMemberActions:function(e,t,n,r){return[{label:"Remove ".concat(Bh.singularizeMemberType(n)),appLink:{application:c.SUBJECTS,action:t===jh.Subject?i.Subjects.REMOVE_SUBJECT_MEMBER:i.Subjects.REMOVE_CLASSIFICATION_MEMBER,args:[e,r,n]},className:"text-danger"}]}},zh=function(){var e=c.SUBJECTS,t=i.Subjects;return[{label:"Classifications",appLink:{application:e,action:t.CLASSIFICATIONS},activeActions:[t.CLASSIFICATIONS,t.PRESENTATION_CLASSIFICATIONS,t.NEW_CLASSIFICATION,t.EDIT_CLASSIFICATION,t.EDIT_CLASSIFICATION_PLAYLISTS,t.EDIT_CLASSIFICATION_SERIES,t.EDIT_CLASSIFICATION_VIDEOS,t.DELETE_CLASSIFICATION,t.REMOVE_CLASSIFICATION_MEMBER]},{label:"Backbone Classifications",appLink:{application:e,action:t.SUBJECTS},activeActions:[t.SUBJECTS,t.NEW_SUBJECT,t.EDIT_SUBJECT,t.EDIT_SUBJECT_PLAYLISTS,t.EDIT_SUBJECT_SERIES,t.EDIT_SUBJECT_VIDEOS,t.SUBJECT_CLASSIFICATIONS,t.DELETE_SUBJECT,t.ADD_SUBJECT_MEMBERS,t.REMOVE_SUBJECT_MEMBER]},{label:"Audiences",appLink:{application:e,action:t.AUDIENCES},activeActions:[t.AUDIENCES,t.PRESENTATION_AUDIENCES,t.NEW_AUDIENCE,t.EDIT_AUDIENCE,t.EDIT_AUDIENCE_PLAYLISTS,t.EDIT_AUDIENCE_SERIES,t.EDIT_AUDIENCE_VIDEOS,t.REMOVE_AUDIENCE_MEMBER]},{label:"Backbone Audiences",appLink:{application:e,action:t.LEVELS},activeActions:[t.LEVELS,t.NEW_LEVEL,t.EDIT_LEVEL,t.LEVEL_AUDIENCES,t.EDIT_LEVEL_PLAYLISTS,t.EDIT_LEVEL_SERIES,t.EDIT_LEVEL_VIDEOS]},{label:"Presentations",appLink:{application:e,action:t.PRESENTATIONS},activeActions:[t.PRESENTATIONS,t.NEW_PRESENTATION,t.EDIT_PRESENTATION]}]},Hh=function(e,t){var n=c.SUBJECTS,r=i.Subjects,a=[e];return[{label:"Edit Backbone Classification Details",appLink:{action:r.EDIT_SUBJECT}},{label:"Classifications",appLink:{action:r.SUBJECT_CLASSIFICATIONS}},{label:"Playlists",appLink:{action:r.EDIT_SUBJECT_PLAYLISTS}},{label:"Series",appLink:{action:r.EDIT_SUBJECT_SERIES}},{label:"Videos",appLink:{action:r.EDIT_SUBJECT_VIDEOS}}].map((function(e){var r=Object.assign(Object.assign({},e.appLink),{application:n,args:a});return t&&(r.params={presentationId:t}),{label:e.label,appLink:r}}))},qh=function(e,t){var n=c.SUBJECTS,r=i.Subjects;return[{label:"Edit Classification Details",appLink:{application:n,action:r.EDIT_CLASSIFICATION,args:[e,t]}},{label:"Playlists",appLink:{application:n,action:r.EDIT_CLASSIFICATION_PLAYLISTS,args:[e,t]}},{label:"Series",appLink:{application:n,action:r.EDIT_CLASSIFICATION_SERIES,args:[e,t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_CLASSIFICATION_VIDEOS,args:[e,t]}}]},Jh=function(e,t){var n=c.SUBJECTS,r=i.Subjects,a=[e];return[{label:"Edit Level Details",appLink:{action:r.EDIT_LEVEL}},{label:"Audiences",appLink:{action:r.LEVEL_AUDIENCES}},{label:"Playlists",appLink:{action:r.EDIT_LEVEL_PLAYLISTS}},{label:"Series",appLink:{action:r.EDIT_LEVEL_SERIES}},{label:"Videos",appLink:{action:r.EDIT_LEVEL_VIDEOS}}].map((function(e){var r=Object.assign(Object.assign({},e.appLink),{application:n,args:a});return t&&(r.params={presentationId:t}),{label:e.label,appLink:r}}))},$h=function(e,t){var n=c.SUBJECTS,r=i.Subjects;return[{label:"Edit Audience Details",appLink:{application:n,action:r.EDIT_AUDIENCE,args:[e,t]}},{label:"Playlists",appLink:{application:n,action:r.EDIT_AUDIENCE_PLAYLISTS,args:[e,t]}},{label:"Series",appLink:{application:n,action:r.EDIT_AUDIENCE_SERIES,args:[e,t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_AUDIENCE_VIDEOS,args:[e,t]}}]},Kh={singularizeMemberType:function(e){switch(e){case kh.Playlists:return"playlist";case kh.Series:return"series";case kh.Videos:return"video"}},getMemberAppLink:function(e,t){var n=[t];switch(e){case kh.Playlists:return{application:c.PLAYLISTS,action:i.Playlists.EDIT_PLAYLIST,args:n};case kh.Series:return{application:c.SERIES,action:i.Series.EDIT_SERIES,args:n};case kh.Videos:return{application:c.VIDEOS,action:i.Videos.EDIT_VIDEO,args:n}}},getMemberActions:function(e,t,n,r){return[{label:"Remove ".concat(Kh.singularizeMemberType(n)),appLink:{application:c.SUBJECTS,action:t===jh.Level?i.Subjects.REMOVE_LEVEL_MEMBER:i.Subjects.REMOVE_AUDIENCE_MEMBER,args:[e,r,n]},className:"text-danger"}]}};function Yh(e){return(Yh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gh(e){return function(e){if(Array.isArray(e))return Wh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Wh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wh(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Xh(e,t){return(Xh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ey(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ny(e);if(t){var i=ny(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ty(this,n)}}function ty(e,t){return!t||"object"!==Yh(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ny(e){return(ny=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ry=function(){return"/api/subjects/v1/backbone-classifications/tree"},iy=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},ay=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/").concat(t,"?query={limit:100}")},oy=function(e,t,n){var r="/api/subjects/v1/backbone-classifications/".concat(e,"/classifications"),i=[];return t&&i.push("presentationId=".concat(t)),n&&i.push("query=".concat(n,"{limit:100}")),i.length?"".concat(r,"?").concat(i.join("&")):r},cy=function(){return"/api/subjects/v1/backbone-classifications"},sy=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},uy=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},ly=function(e){return"/api/subjects/v1/objects/".concat(e,"/backbone-classifications")},fy=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/backbone-classifications?addToClassifications=").concat(!!t)},py=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/objects?addToClassifications=").concat(!!t)},dy=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},my=function(){return"/api/subjects/v1/presentations"},hy=function(e){return"/api/subjects/v1/presentations/".concat(e)},yy=function(){return"/api/subjects/v1/presentations"},vy=function(e){return"/api/subjects/v1/presentations/".concat(e)},by=function(e){return"/api/subjects/v1/presentations/".concat(e,"/classifications/tree")},gy=function(e){return"/api/subjects/v1/classifications/".concat(e,"?query=cover,banner,followers[count()]{limit:0}")},Sy=function(e,t){return"/api/subjects/v1/classifications/".concat(e,"/").concat(t,"?query={limit:100}")},Ey=function(){return"/api/subjects/v1/classifications"},Oy=function(e){return"/api/subjects/v1/classifications/".concat(e)},Cy=function(e){return"/api/subjects/v1/classifications/".concat(e)},Ay=function(e){return"/api/subjects/v1/objects/".concat(e,"/classifications")},wy=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/classifications?presentationId=").concat(t)},jy=function(e){return"/api/subjects/v1/classifications/".concat(e,"/objects")},Iy=function(e,t){return"/api/subjects/v1/classifications/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},ky=function(){return"/api/subjects/v1/backbone-audiences"},Ty=function(e){return"/api/subjects/v1/backbone-audiences/".concat(e)},Ly=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/").concat(t,"?query={limit:100}")},_y=function(e,t,n){var r="/api/subjects/v1/backbone-audiences/".concat(e,"/audiences"),i=[];return t&&i.push("presentationId=".concat(t)),n&&i.push("query=".concat(n,"{limit:100}")),i.length?"".concat(r,"?").concat(i.join("&")):r},Py=function(){return"/api/subjects/v1/backbone-audiences"},xy=function(e){return"/api/subjects/v1/backbone-audiences/".concat(e)},Ny=function(e){return"/api/subjects/v1/objects/".concat(e,"/backbone-audiences")},Ry=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/backbone-audiences?addToAudiences=").concat(!!t)},Dy=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/objects?addToAudiences=").concat(!!t)},My=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},Uy=function(e){return"/api/subjects/v1/presentations/".concat(e,"/audiences")},Fy=function(e){return"/api/subjects/v1/audiences/".concat(e)},Vy=function(e,t){return"/api/master/v2/objects/".concat(e,"/").concat(t,"?query={limit:100}")},By=function(){return"/api/subjects/v1/audiences"},zy=function(e){return"/api/subjects/v1/audiences/".concat(e)},Hy=function(e){return"/api/subjects/v1/audiences/".concat(e)},qy=function(e){return"/api/subjects/v1/objects/".concat(e,"/audiences")},Jy=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/audiences?presentationId=").concat(t)},$y=function(e){return"/api/subjects/v1/audiences/".concat(e,"/objects")},Ky=function(e,t){return"/api/subjects/v1/audiences/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},Yy=function(e,t,n){var r="".concat(a.SUBJECT,":").concat(e);return t&&(r+=":".concat(t)),r+=":".concat(a.CLASSIFICATIONS),n&&(r+=":".concat(n)),r},Gy=function(e,t,n){var r="".concat(a.LEVEL,":").concat(e);return t&&(r+=":".concat(t)),r+=":".concat(a.AUDIENCES),n&&(r+=":".concat(n)),r},Wy=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Xh(e,t)}(o,e);var t,n,r,i=ey(o);function o(){return Zh(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"name",get:function(){return u.SUBJECT}},{key:"channelName",get:function(){return s.SUBJECT}},{key:"getPresentations",value:function(e,t){return this.get({resource:my(),eventPrefix:a.PRESENTATIONS,expiryTime:xh.STANDARD,callback:e,errorCallback:t})}},{key:"getPresentation",value:function(e,t,n){return this.get({resource:hy(e),eventPrefix:"".concat(a.PRESENTATION,":").concat(e),expiryTime:xh.STANDARD,callback:t,errorCallback:n})}},{key:"createPresentation",value:function(e,t,n){return this.create({resource:yy(),data:e,callback:t,errorCallback:n,eventPrefix:a.PRESENTATION,invalidationKeys:[a.PRESENTATIONS],expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully created presentation."),errorHandler:this.alertService.error("Failed to create presentation.")})}},{key:"updatePresentation",value:function(e,t,n,r){return this.update({resource:vy(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(a.UPDATE_PRESENTATION,":").concat(e),invalidationKeys:["".concat(a.PRESENTATION,":").concat(e),a.PRESENTATIONS],expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully updated presentation."),errorHandler:this.alertService.error("Failed to update presentation.")})}},{key:"getSubjectTree",value:function(e,t){return this.get({resource:ry(),formatData:function(e){return{children:e,name:Th.Root,id:null}},eventPrefix:a.SUBJECTS,expiryTime:xh.STANDARD,callback:e,errorCallback:t})}},{key:"getSubject",value:function(e,t,n){return this.get({resource:iy(e),eventPrefix:"".concat(a.SUBJECT,":").concat(e),expiryTime:xh.STANDARD,callback:t,errorCallback:n})}},{key:"getSubjectMemberIds",value:function(e,t,n,r){return this.get({resource:ay(e,t),eventPrefix:"".concat(a.SUBJECT,":").concat(e,":").concat(t),expiryTime:xh.STANDARD,callback:n,errorCallback:r})}},{key:"getSubjectClassifications",value:function(e,t,n,r,i){return this.get({resource:oy(e,t,n),eventPrefix:Yy(e,t,n),expiryTime:xh.STANDARD,callback:r,errorCallback:i})}},{key:"createSubject",value:function(e,t,n){return this.create({resource:cy(),data:e,callback:t,errorCallback:n,eventPrefix:a.SUBJECT,invalidationKeys:[a.SUBJECTS],expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully created subject."),errorHandler:this.alertService.error("Failed to create subject.")})}},{key:"updateSubject",value:function(e,t,n,r){return this.update({resource:sy(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(a.UPDATE_SUBJECT,":").concat(e),invalidationKeys:["".concat(a.SUBJECT,":").concat(e),a.SUBJECTS],expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully updated subject."),errorHandler:this.alertService.error("Failed to save subject.")})}},{key:"deleteSubject",value:function(e,t,n){var r=this;return this.delete({resource:uy(e),callback:t,errorCallback:n,eventPrefix:a.DELETE_SUBJECT,invalidationKeys:["".concat(a.SUBJECT,":").concat(e),a.SUBJECTS],successHandler:this.alertService.success("Successfully deleted subject."),errorHandler:function(e){var t=(null==e?void 0:e.code)===Ph.a.Conflict?"Cannot delete a subject with child subjects and/or classifications.":"Failed to delete subject.";r.alertService.error(t)()}})}},{key:"getObjectSubjects",value:function(e,t,n,r){return this.get({resource:ly(e),eventPrefix:"".concat(t,":").concat(e,":").concat(a.SUBJECTS),expiryTime:xh.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectSubjects",value:function(e,t,n,r,i,o){var c=Bh.singularizeMemberType(n),s=["".concat(n,":").concat(e,":").concat(a.SUBJECTS)];return r&&s.push("".concat(n,":").concat(e,":").concat(a.CLASSIFICATIONS)),s.push.apply(s,Gh(t.map((function(e){return"".concat(a.SUBJECTS,":").concat(e,":").concat(n)})))),this.update({resource:fy(e,r),data:t,callback:i,errorCallback:o,eventPrefix:"".concat(a.UPDATE_OBJECT_SUBJECTS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(c," subjects.")),errorHandler:this.alertService.error("Failed to update ".concat(c," subjects."))})}},{key:"addObjectsToSubject",value:function(e,t,n,r,i,o){var c=1===t.length?Bh.singularizeMemberType(n):n,s=["".concat(a.SUBJECT,":").concat(e,":").concat(n)].concat(Gh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.SUBJECTS)}))),Gh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.CLASSIFICATIONS)}))));return this.create({resource:py(e,r),data:t,callback:i,errorCallback:o,eventPrefix:"".concat(a.ADD_TO_SUBJECT,":").concat(e,":").concat(n),invalidationKeys:s,expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(c," to subject.")),errorHandler:this.alertService.error("Failed to add ".concat(c," to subject."))})}},{key:"removeObjectsFromSubject",value:function(e,t,n,r,i){var o=1===t.length?Bh.singularizeMemberType(n):n,c=["".concat(a.SUBJECT,":").concat(e,":").concat(n)].concat(Gh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.SUBJECTS)}))));return this.delete({resource:dy(e,t),callback:r,errorCallback:i,eventPrefix:"".concat(a.REMOVE_FROM_SUBJECT,":").concat(e,":").concat(n),invalidationKeys:c,expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(o," from subject.")),errorHandler:this.alertService.error("Failed to remove ".concat(o," from subject."))})}},{key:"getClassificationTree",value:function(e,t,n){return this.get({resource:by(e),formatData:function(e){return{children:e,name:Lh.Root,id:null}},eventPrefix:"".concat(a.CLASSIFICATIONS,":").concat(e),expiryTime:xh.STANDARD,callback:t,errorCallback:n})}},{key:"getClassification",value:function(e,t,n){return this.get({resource:gy(e),eventPrefix:"".concat(a.CLASSIFICATION,":").concat(e),expiryTime:xh.STANDARD,callback:t,errorCallback:n})}},{key:"getClassificationMembers",value:function(e,t,n,r){return this.get({resource:Sy(e,t),eventPrefix:"".concat(a.CLASSIFICATION,":").concat(e,":").concat(t),expiryTime:xh.STANDARD,callback:n,errorCallback:r})}},{key:"createClassification",value:function(e,t,n){return this.create({resource:Ey(),data:e,callback:t,errorCallback:n,eventPrefix:a.CLASSIFICATION,invalidationKeys:[a.CLASSIFICATIONS],expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully created classification."),errorHandler:this.alertService.error("Failed to create classification.")})}},{key:"updateClassification",value:function(e,t,n,r){return this.update({resource:Oy(e),data:Ci.a.omit(t,["followers"]),callback:n,errorCallback:r,eventPrefix:"".concat(a.UPDATE_CLASSIFICATION,":").concat(e),invalidationKeys:["".concat(a.CLASSIFICATION,":").concat(e),a.CLASSIFICATIONS],expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully updated classification."),errorHandler:this.alertService.error("Failed to save classification.")})}},{key:"deleteClassification",value:function(e,t,n){return this.delete({resource:Cy(e),callback:t,errorCallback:n,eventPrefix:a.DELETE_CLASSIFICATION,invalidationKeys:["".concat(a.CLASSIFICATION,":").concat(e),a.CLASSIFICATIONS],successHandler:this.alertService.success("Successfully deleted classification"),errorHandler:this.alertService.error("Failed to delete classification")})}},{key:"getObjectClassifications",value:function(e,t,n,r){return this.get({resource:Ay(e),eventPrefix:"".concat(t,":").concat(e,":").concat(a.CLASSIFICATIONS),expiryTime:xh.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectClassifications",value:function(e,t,n,r,i,o){var c=Bh.singularizeMemberType(r),s=["".concat(r,":").concat(e,":").concat(a.CLASSIFICATIONS)];return s.push.apply(s,Gh(n.map((function(e){return"".concat(a.CLASSIFICATION,":").concat(e,":").concat(r)})))),this.update({resource:wy(e,t),data:n,callback:i,errorCallback:o,eventPrefix:"".concat(a.UPDATE_OBJECT_CLASSIFICATIONS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(c," classifications.")),errorHandler:this.alertService.error("Failed to update ".concat(c," classifications."))})}},{key:"addObjectsToClassification",value:function(e,t,n,r,i,o,c){var s=1===t.length?Bh.singularizeMemberType(n):n,u=["".concat(a.CLASSIFICATION,":").concat(e,":").concat(n)];return r&&u.push(Yy(r,i,n)),u.push.apply(u,Gh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.CLASSIFICATIONS)})))),this.create({resource:jy(e),data:t,callback:o,errorCallback:c,eventPrefix:"".concat(a.ADD_TO_CLASSIFICATION,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(s," to classification.")),errorHandler:this.alertService.error("Failed to add ".concat(s," to classification."))})}},{key:"removeObjectsFromClassification",value:function(e,t,n,r,i,o,c){var s=1===t.length?Bh.singularizeMemberType(n):n,u=["".concat(a.CLASSIFICATION,":").concat(e,":").concat(n)];return r&&u.push(Yy(r,i,n)),u.push.apply(u,Gh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.CLASSIFICATIONS)})))),this.delete({resource:Iy(e,t),callback:o,errorCallback:c,eventPrefix:"".concat(a.REMOVE_FROM_CLASSIFICATION,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(s," from classification.")),errorHandler:this.alertService.error("Failed to remove ".concat(s," from classification."))})}},{key:"getLevels",value:function(e,t){return this.get({resource:ky(),eventPrefix:a.LEVELS,expiryTime:xh.STANDARD,callback:e,errorCallback:t})}},{key:"getLevel",value:function(e,t,n){return this.get({resource:Ty(e),eventPrefix:"".concat(a.LEVEL,":").concat(e),expiryTime:xh.STANDARD,callback:t,errorCallback:n})}},{key:"getLevelMemberIds",value:function(e,t,n,r){return this.get({resource:Ly(e,t),eventPrefix:"".concat(a.LEVEL,":").concat(e,":").concat(t),expiryTime:xh.STANDARD,callback:n,errorCallback:r})}},{key:"getLevelAudiences",value:function(e,t,n,r,i){return this.get({resource:_y(e,t,n),eventPrefix:Gy(e,t,n),expiryTime:xh.STANDARD,callback:r,errorCallback:i})}},{key:"createLevel",value:function(e,t,n){return this.create({resource:Py(),data:e,callback:t,errorCallback:n,eventPrefix:a.LEVEL,invalidationKeys:[a.LEVELS],expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully created level."),errorHandler:this.alertService.error("Failed to create level.")})}},{key:"updateLevel",value:function(e,t,n,r){return this.update({resource:xy(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(a.UPDATE_LEVEL,":").concat(e),invalidationKeys:["".concat(a.LEVEL,":").concat(e),a.LEVELS],expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully updated level."),errorHandler:this.alertService.error("Failed to save level.")})}},{key:"getObjectLevels",value:function(e,t,n,r){return this.get({resource:Ny(e),eventPrefix:"".concat(t,":").concat(e,":").concat(a.LEVELS),expiryTime:xh.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectLevels",value:function(e,t,n,r,i,o){var c=Bh.singularizeMemberType(n),s=["".concat(n,":").concat(e,":").concat(a.LEVELS)];return r&&s.push("".concat(n,":").concat(e,":").concat(a.AUDIENCES)),this.update({resource:Ry(e,r),data:t,callback:i,errorCallback:o,eventPrefix:"".concat(a.UPDATE_OBJECT_LEVELS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(c," levels.")),errorHandler:this.alertService.error("Failed to update ".concat(c," levels."))})}},{key:"addObjectsToLevel",value:function(e,t,n,r,i,o){var c=1===t.length?Kh.singularizeMemberType(n):n,s=["".concat(a.LEVEL,":").concat(e,":").concat(n)].concat(Gh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.LEVELS)}))),Gh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.AUDIENCES)}))));return this.create({resource:Dy(e,r),data:t,callback:i,errorCallback:o,eventPrefix:"".concat(a.ADD_TO_LEVEL,":").concat(e,":").concat(n),invalidationKeys:s,expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(c," to level.")),errorHandler:this.alertService.error("Failed to add ".concat(c," to level."))})}},{key:"removeObjectsFromLevel",value:function(e,t,n,r,i){var o=1===t.length?Kh.singularizeMemberType(n):n,c=["".concat(a.LEVEL,":").concat(e,":").concat(n)].concat(Gh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.LEVELS)}))));return this.delete({resource:My(e,t),callback:r,errorCallback:i,eventPrefix:"".concat(a.REMOVE_FROM_LEVEL,":").concat(e,":").concat(n),invalidationKeys:c,expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(o," from level.")),errorHandler:this.alertService.error("Failed to remove ".concat(o," from level."))})}},{key:"getAudiences",value:function(e,t,n){return this.get({resource:Uy(e),callback:t,errorCallback:n,eventPrefix:"".concat(a.AUDIENCES,":").concat(e),expiryTime:xh.STANDARD})}},{key:"getAudience",value:function(e,t,n){return this.get({resource:Fy(e),callback:t,errorCallback:n,eventPrefix:"".concat(a.AUDIENCE,":").concat(e),expiryTime:xh.STANDARD})}},{key:"getAudienceMembers",value:function(e,t,n,r){return this.get({resource:Vy(e,t),eventPrefix:"".concat(a.AUDIENCE,":").concat(e,":").concat(t),expiryTime:xh.STANDARD,callback:n,errorCallback:r})}},{key:"createAudience",value:function(e,t,n){return this.create({resource:By(),data:e,callback:t,errorCallback:n,eventPrefix:a.AUDIENCE,invalidationKeys:[a.AUDIENCES],expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully created audience."),errorHandler:this.alertService.error("Failed to create audience.")})}},{key:"updateAudience",value:function(e,t,n,r){return this.update({resource:zy(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(a.UPDATE_AUDIENCE,":").concat(e),invalidationKeys:["".concat(a.AUDIENCE,":").concat(e),a.AUDIENCES],expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully updated audience."),errorHandler:this.alertService.error("Failed to update audience.")})}},{key:"deleteAudience",value:function(e,t,n){return this.delete({resource:Hy(e),callback:t,errorCallback:n,eventPrefix:a.DELETE_AUDIENCE,invalidationKeys:["".concat(a.AUDIENCE,":").concat(e),a.AUDIENCES],successHandler:this.alertService.success("Successfully deleted audience"),errorHandler:this.alertService.error("Failed to delete audience")})}},{key:"getObjectAudiences",value:function(e,t,n,r){return this.get({resource:qy(e),eventPrefix:"".concat(t,":").concat(e,":").concat(a.AUDIENCES),expiryTime:xh.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectAudiences",value:function(e,t,n,r,i,o){var c=Bh.singularizeMemberType(r);return this.update({resource:Jy(e,t),data:n,callback:i,errorCallback:o,eventPrefix:"".concat(a.UPDATE_OBJECT_AUDIENCES,":").concat(e),invalidationKeys:["".concat(r,":").concat(e,":").concat(a.AUDIENCES)],successHandler:this.alertService.success("Successfully updated ".concat(c," audiences.")),errorHandler:this.alertService.error("Failed to update ".concat(c," audiences."))})}},{key:"addObjectsToAudience",value:function(e,t,n,r,i,o,c){var s=1===t.length?Kh.singularizeMemberType(n):n,u=["".concat(a.AUDIENCE,":").concat(e,":").concat(n)];return r&&u.push(Gy(r,i,n)),u.push.apply(u,Gh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.AUDIENCES)})))),this.create({resource:$y(e),data:t,callback:o,errorCallback:c,eventPrefix:"".concat(a.ADD_TO_AUDIENCE,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(s," to audience.")),errorHandler:this.alertService.error("Failed to add ".concat(s," to audience."))})}},{key:"removeObjectsFromAudience",value:function(e,t,n,r,i,o,c){var s=1===t.length?Kh.singularizeMemberType(n):n,u=["".concat(a.AUDIENCE,":").concat(e,":").concat(n)];return r&&u.push(Gy(r,i,n)),u.push.apply(u,Gh(t.map((function(e){return"".concat(n,":").concat(e,":").concat(a.AUDIENCES)})))),this.delete({resource:Ky(e,t),callback:o,errorCallback:c,eventPrefix:"".concat(a.REMOVE_FROM_AUDIENCE,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:xh.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(s," from audience.")),errorHandler:this.alertService.error("Failed to remove ".concat(s," from audience."))})}}])&&Qh(t.prototype,n),r&&Qh(t,r),o}(_h),Zy={dataServiceName:u.SUBJECT,dataChannelName:s.SUBJECT},Qy={getSubjectTreeFetchOptions:function(e,t){return Object.assign(Object.assign({},Zy),{eventPrefix:a.SUBJECTS,fetchData:function(e){return e.getSubjectTree()},setData:e,onError:t})},getSubjectFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Zy),{eventPrefix:"".concat(a.SUBJECT,":").concat(e),fetchData:function(t){return t.getSubject(e)},setData:t,onError:n,deleteEventPrefix:a.DELETE_SUBJECT})},getSubjectMemberIdsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Zy),{eventPrefix:"".concat(a.SUBJECT,":").concat(e,":").concat(t),fetchData:function(n){return n.getSubjectMemberIds(e,t)},setData:n,onError:r})},getSubjectClassificationFetchOptions:function(e,t,n,r,i){return Object.assign(Object.assign({},Zy),{eventPrefix:Yy(e,n,r),fetchData:function(t){return t.getSubjectClassifications(e,n,r)},setData:t,onError:i})},getObjectSubjectsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Zy),{eventPrefix:"".concat(t,":").concat(e,":").concat(a.SUBJECTS),fetchData:function(n){return n.getObjectSubjects(e,t)},setData:n,onError:r})},getPresentationsFetchOptions:function(e,t){return Object.assign(Object.assign({},Zy),{eventPrefix:a.PRESENTATIONS,fetchData:function(e){return e.getPresentations()},setData:e,onError:t})},getPresentationFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Zy),{eventPrefix:"".concat(a.PRESENTATION,":").concat(e),fetchData:function(t){return t.getPresentation(e)},setData:t,onError:n})},getClassificationTreeFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Zy),{eventPrefix:"".concat(a.CLASSIFICATIONS,":").concat(e),fetchData:function(t){return t.getClassificationTree(e)},setData:t,onError:n})},getClassificationFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Zy),{eventPrefix:"".concat(a.CLASSIFICATION,":").concat(e),fetchData:function(t){return t.getClassification(e)},setData:t,onError:n,deleteEventPrefix:a.DELETE_CLASSIFICATION})},getClassificationMembersFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Zy),{eventPrefix:"".concat(a.CLASSIFICATION,":").concat(e,":").concat(t),fetchData:function(n){return n.getClassificationMembers(e,t)},setData:n,onError:r})},getObjectClassificationsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Zy),{eventPrefix:"".concat(t,":").concat(e,":").concat(a.CLASSIFICATIONS),fetchData:function(n){return n.getObjectClassifications(e,t)},setData:n,onError:r})},getLevelsFetchOptions:function(e,t){return Object.assign(Object.assign({},Zy),{eventPrefix:a.LEVELS,fetchData:function(e){return e.getLevels()},setData:e,onError:t})},getLevelFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Zy),{eventPrefix:"".concat(a.LEVEL,":").concat(e),fetchData:function(t){return t.getLevel(e)},setData:t,onError:n})},getLevelMemberIdsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Zy),{eventPrefix:"".concat(a.LEVEL,":").concat(e,":").concat(t),fetchData:function(n){return n.getLevelMemberIds(e,t)},setData:n,onError:r})},getLevelAudiencesFetchOptions:function(e,t,n,r,i){return Object.assign(Object.assign({},Zy),{eventPrefix:Gy(e,n,r),fetchData:function(t){return t.getLevelAudiences(e,n,r)},setData:t,onError:i})},getObjectLevelsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Zy),{eventPrefix:"".concat(t,":").concat(e,":").concat(a.LEVELS),fetchData:function(n){return n.getObjectLevels(e,t)},setData:n,onError:r})},getAudiencesFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Zy),{eventPrefix:"".concat(a.AUDIENCES,":").concat(e),fetchData:function(t){return t.getAudiences(e)},setData:t,onError:n})},getAudienceFetchOptions:function(e,t,n){return Object.assign(Object.assign({},Zy),{eventPrefix:"".concat(a.AUDIENCE,":").concat(e),fetchData:function(t){return t.getAudience(e)},setData:t,onError:n})},getAudienceMembersFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Zy),{eventPrefix:"".concat(a.AUDIENCE,":").concat(e,":").concat(t),fetchData:function(n){return n.getAudienceMembers(e,t)},setData:n,onError:r})},getObjectAudiencesFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},Zy),{eventPrefix:"".concat(t,":").concat(e,":").concat(a.AUDIENCES),fetchData:function(n){return n.getObjectAudiences(e,t)},setData:n,onError:r})}},Xy=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[e.id]}},ev=function(e,t){var n=e.backboneAudienceIds;return t.filter((function(e){return n.includes(e.id)}))};function tv(e){var t=e.showLevels;return l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",null,"Audiences"),!!t&&l.createElement("th",null,"Mapped Backbone Audience(s)")))}function nv(e){var t,n=e.audience,r=e.levels;return l.createElement("tr",null,l.createElement("td",null,l.createElement(fu,{appLink:(t=n,{application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[t.presentationId,t.masterId]})},n.name)),l.createElement("td",null,r.map((function(e){return l.createElement(fu,{key:e.id,appLink:Xy(e),className:"mr-2"},e.name)}))))}function rv(e){var t=e.audiences,n=e.levels;return l.createElement(ki.Table,{responsive:!0,bordered:!0},l.createElement(tv,{showLevels:!!t.length}),l.createElement("tbody",null,t.length?t.map((function(e){return l.createElement(nv,{key:e.masterId,audience:e,levels:ev(e,n)})})):l.createElement("tr",null,l.createElement("td",null,"This presentation has no audiences."))))}function iv(e){var t=null===e.masterId||void 0===e.masterId,n=ci(),r=qc(n);return l.createElement(vi,null,l.createElement(Bc,{label:"Name",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this audience",autoFocus:!0}),l.createElement(Bc,{label:"Mapped Level(s)",as:"select",name:"backboneAudienceIds",id:"level-ids",multiple:!0,size:e.levels.length,value:n.values.backboneAudienceIds},e.levels.map((function(e){return l.createElement("option",{key:e.id,value:e.id},e.name)}))),l.createElement("div",{className:"d-flex justify-content-between"},l.createElement(sf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&l.createElement(ki.Button,{as:fu,variant:"danger",appLink:{application:c.SUBJECTS,action:i.Subjects.DELETE_AUDIENCE,args:[e.presentationId,e.masterId]}},"Delete")))}function av(e){return l.createElement(wi,{initialValues:e.audience,validationSchema:Dh,onSubmit:e.saveAudience},l.createElement(iv,{masterId:e.audience&&e.audience.masterId,presentationId:e.presentationId,levels:e.levels}))}function ov(e){var t=e.objectAudiences,n=e.presentationAudiences;return t.filter((function(e){return n.some((function(t){return t.masterId===e.masterId}))}))}function cv(e){var t,n,r,i,a,o=Bh.singularizeMemberType(e.memberType),c=(n=(t=e).presentationAudiences,r=t.objectLevels,i=t.objectAudiences,a=r.map((function(e){return e.id})),n.filter((function(e){return yp.a.intersection(e.backboneAudienceIds,a).length||i.some((function(t){return t.masterId===e.masterId}))})));return l.createElement(l.Fragment,null,l.createElement("div",{className:"border-bottom pb-3 mb-3"},l.createElement("h6",null,"Backbone Audiences"),l.createElement("p",null,"Select which backbone audiences this ".concat(o," is mapped to.")),l.createElement("p",null,"To see how backbone audiences correspond to audiences, scroll down to the audience-backbone audience mappings table."),l.createElement(Pv,{initialValues:{backboneAudienceIds:e.objectLevels.map((function(e){return e.id}))},saveLevels:e.saveLevels,levels:e.levels,memberType:e.memberType})),l.createElement("h6",null,"Audiences"),l.createElement("p",null,"Select a presentation to view its audiences and map them to this ".concat(o,".")),l.createElement("div",{className:"w-50 pb-3"},l.createElement(qv,{presentations:e.presentations,currentPresentationId:e.currentPresentation.id,setCurrentPresentation:e.setCurrentPresentation})),l.createElement("p",null,"Audience to backbone audience mappings for this presentation are displayed below."),l.createElement(rv,{levels:e.levels,audiences:e.presentationAudiences}),l.createElement("p",null,"Only the audiences which are mapped to a backbone audience that this"+" ".concat(o," is mapped to are displayed below.")),!!c.length&&l.createElement(uv,{initialValues:{audienceIds:ov(e).map((function(e){return e.masterId}))},saveAudiences:e.saveAudiences,audiences:c}))}function sv(e){var t=ci(),n=qc(t);return l.createElement(vi,null,l.createElement(Bc,{label:"Audience(s)",as:"select",name:"audienceIds",id:"audience-ids",multiple:!0,size:e.audiences.length,value:t.values.audienceIds},e.audiences.map((function(e){return l.createElement("option",{key:e.masterId,value:e.masterId},e.name)}))),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(sf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Save Audiences")))}function uv(e){return l.createElement(wi,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.audienceIds;return e.saveAudiences(r,n)},enableReinitialize:!0},l.createElement(sv,{audiences:e.audiences}))}var lv=function(e){return function(t){if(!e)return t.appLink.action===i.Subjects.EDIT_AUDIENCE;switch(e){case kh.Playlists:return t.appLink.action===i.Subjects.EDIT_AUDIENCE_PLAYLISTS;case kh.Series:return t.appLink.action===i.Subjects.EDIT_AUDIENCE_SERIES;case kh.Videos:return t.appLink.action===i.Subjects.EDIT_AUDIENCE_VIDEOS}}};function fv(e){var t=e.presentation,n=e.audienceId,r=e.memberType;return t?l.createElement(l.Fragment,null,l.createElement("h6",null,"Presentation: ".concat(!!t&&t.name)),l.createElement("div",{className:"py-2"},l.createElement(jl,{tabs:$h(t.id,n),isItemActive:lv(r)}))):l.createElement(l.Fragment,null)}function pv(e){var t=e.item,n=e.getItemAppLink,r=e.actions;return l.createElement("tr",null,l.createElement("td",null,l.createElement(fu,{appLink:n(t)},t.name)),r&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(pl,{actions:r}))))}function dv(e){var t=e.items,n=e.memberType,r=e.getItemAppLink,i=e.getActions;if(!t.length)return l.createElement("div",{className:"py-5"},"No ".concat(n," in this audience."));var a="".concat(El(Kh.singularizeMemberType(n))," Name");return l.createElement(ki.Table,{responsive:!0},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",null,a),m(i)&&l.createElement("th",null))),l.createElement("tbody",null,t.map((function(e){return l.createElement(pv,{item:e,key:e.id,getItemAppLink:r,actions:m(i)&&i(e)})}))))}function mv(e){var t=e.item,n=e.getItemAppLink,r=e.actions,i=e.pinState;return l.createElement("tr",null,l.createElement("td",null,l.createElement(fu,{appLink:n(t)},t.name)),i.isPinnable&&l.createElement("td",null,l.createElement(Su,{selected:parseInt(t.id)===parseInt(i.currentPinnedVideo),onToggle:function(e){return i.onChange(e,t.id)},id:t.id})),r&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(pl,{actions:r}))))}function hv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gv(e){var t=e.items,n=e.memberType,r=e.classification,i=e.getItemAppLink,a=e.getActions,o=e.updatePinnedVideo,c=vv(l.useState(!1),2),s=c[0],u=c[1],f=function(e,t){var n=e.pinnedVideoMasterId||null,r=hv(l.useState(n),2),i=r[0],a=r[1];return{currentPinnedVideo:i,onChange:function(e,t){a(e?t:null)},canSubmit:n!==i,isPinnable:t===Ih.Videos}}(r,n);if(!t.length)return l.createElement("div",{className:"py-5"},"No ".concat(n," in this classification."));var p="".concat(El(Bh.singularizeMemberType(n))," Name");return l.createElement(l.Fragment,null,l.createElement(ki.Table,{responsive:!0},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",null,p),f.isPinnable&&l.createElement("th",null,"Pinned"),m(a)&&l.createElement("th",null))),l.createElement("tbody",null,t.map((function(e){return l.createElement(mv,{item:e,key:e.id,getItemAppLink:i,actions:m(a)&&a(e),pinState:f})})))),f.isPinnable&&l.createElement(sf,{showSpinner:s,onClick:function(){u(!0),o(f.currentPinnedVideo,(function(){return u(!1)}))},disabled:!f.canSubmit||s},"Save"))}function Sv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ev(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ev(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ev(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ov=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[e]}};function Cv(e){var t,n,r,a,o,s=ci(),u=qc(s),f=null===(null===(t=e.classification)||void 0===t?void 0:t.id)||void 0===(null===(n=e.classification)||void 0===n?void 0:n.id),p=!f||!(!s.values.parentIds||!s.values.parentIds.length),d=Sv(l.useState(p),2),m=d[0],h=d[1];l.useEffect((function(){return h(p)}),[null===(r=e.classification)||void 0===r?void 0:r.id,s.values.parentIds]),l.useEffect((function(){s.values.backboneClassificationIds.length&&!s.touched.backboneClassificationIds&&s.setFieldTouched("backboneClassificationIds",!0)}),[s.values.backboneClassificationIds]);var y=function(e){return s.setFieldValue("parentIds",yp.a.addOrRemove(s.values.parentIds.map((function(e){return e.toString()})),e.id.toString()))},v=function(e){return s.setFieldValue("backboneClassificationIds",yp.a.addOrRemove(s.values.backboneClassificationIds.map((function(e){return e.toString()})),e.id.toString()))},b=function(e){return"".concat(Ti(s.errors,s.touched,e)," h-auto py-2")};return l.createElement(vi,null,l.createElement(Bc,{label:"Name",name:"name",id:"name",value:s.values.name,placeholder:"Enter a name for this classification",autoFocus:!0}),l.createElement(Bc,{as:"select",label:"Type",name:"type",id:"type",value:s.values.type},Ci.a.getEnumKeys(Nh).map((function(e){return l.createElement("option",{key:e,value:Nh[e]},e)}))),l.createElement(Bc,{as:"select",label:"Status",name:"status",id:"status",value:s.values.status,disabled:f},Ci.a.getEnumKeys(Rh).map((function(e){return l.createElement("option",{key:e,value:Rh[e]},e)}))),l.createElement(Bc,{label:"Emphasize",name:"emphasize",id:"emphasize",type:"checkbox",checked:s.values.emphasize}),l.createElement(Bc,{label:"Can Be Preferred",name:"canBePreferred",id:"canBePreferred",type:"checkbox",checked:s.values.canBePreferred}),!f&&l.createElement(l.Fragment,null,l.createElement("label",null,"Total Followers:")," ",null===(a=e.classification.followers)||void 0===a?void 0:a.count),l.createElement(Bc,{name:"parentIds"},(function(){var t,n,r;return l.createElement("div",{className:b("parentIds")},l.createElement(Fl,{label:"Parent Classification(s)",tree:e.classificationTree,selectedIds:s.values.parentIds,onSelect:y,collapse:m,noSelectionMessage:"No parent selected, this will be a root classification.",isNodeDisabled:(n=e.classificationTree,r=null===(t=e.classification)||void 0===t?void 0:t.id,function(e){if(e.id===r)return!0;var t=Al.find(n,r);return!!Al.find(t,e.id)})}))})),l.createElement(Bc,{name:"backboneClassificationIds"},(function(){return l.createElement("div",{className:b("backboneClassificationIds")},l.createElement(Fl,{label:"Mapped Subject(s)",tree:e.subjectTree,selectedIds:s.values.backboneClassificationIds,onSelect:v,collapse:!f,getSelectedItemAppLink:Ov}))})),l.createElement(Xu,{imageType:yu.Covers,fieldName:"cover",application:c.SUBJECTS,uploadAction:i.Subjects.UPLOAD_IMAGE}),l.createElement(Xu,{imageType:yu.Banners,fieldName:"banner",application:c.SUBJECTS,uploadAction:i.Subjects.UPLOAD_IMAGE}),l.createElement(Xu,{imageType:yu.TallPosters,fieldName:"tallPoster",application:c.SUBJECTS,uploadAction:i.Subjects.UPLOAD_IMAGE}),l.createElement("div",{className:"d-flex justify-content-between"},l.createElement(sf,{showSpinner:s.isSubmitting,type:"submit",disabled:!u},f?"Create":"Save"),!f&&l.createElement(ki.Button,{as:fu,variant:"danger",appLink:{application:c.SUBJECTS,action:i.Subjects.DELETE_CLASSIFICATION,args:[e.presentationId,null===(o=e.classification)||void 0===o?void 0:o.id]}},"Delete")))}function Av(e){return l.createElement(wi,{initialValues:e.classification,validationSchema:Mh,onSubmit:e.saveClassification},l.createElement(Cv,{presentationId:e.presentationId,classificationTree:e.classificationTree,subjectTree:e.subjectTree,classification:e.classification}))}var wv=function(e){return function(t){if(!e)return t.appLink.action===i.Subjects.EDIT_CLASSIFICATION;switch(e){case Ih.Playlists:return t.appLink.action===i.Subjects.EDIT_CLASSIFICATION_PLAYLISTS;case Ih.Series:return t.appLink.action===i.Subjects.EDIT_CLASSIFICATION_SERIES;case Ih.Videos:return t.appLink.action===i.Subjects.EDIT_CLASSIFICATION_VIDEOS}}};function jv(e){var t=e.presentation,n=e.classificationId,r=e.memberType;return t?l.createElement(l.Fragment,null,l.createElement("h6",null,"Presentation: ".concat(!!t&&t.name)),l.createElement("div",{className:"py-2"},l.createElement(jl,{tabs:qh(t.id,n),isItemActive:wv(r)}))):l.createElement(l.Fragment,null)}function Iv(e){var t=ci(),n=qc(t),r=function(e){return t.setFieldValue("classificationIds",yp.a.addOrRemove(t.values.classificationIds.map((function(e){return e.toString()})),e.id.toString()))},a="".concat(Ti(t.errors,t.touched,"classificationIds")," h-auto py-2");return l.createElement(vi,null,l.createElement(Bc,{name:"classificationIds"},(function(){return l.createElement("div",{className:a},l.createElement(Fl,{label:"Mapped Classification(s)",tree:e.classificationTree,selectedIds:t.values.classificationIds,onSelect:r,getSelectedItemAppLink:(n=e.presentationId,function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[n,e]}}),isNodeDisabled:e.isClassificationDisabled}));var n})),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(sf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Save Classifications")))}function kv(e){return l.createElement(wi,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.classificationIds;return e.saveClassifications(r,n)},enableReinitialize:!0},l.createElement(Iv,{presentationId:e.presentationId,classificationTree:e.classificationTree,isClassificationDisabled:e.isClassificationDisabled}))}function Tv(e){var t=null===e.id||void 0===e.id,n=ci(),r=qc(n);return l.createElement(vi,null,l.createElement(Bc,{label:"Name",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this level",autoFocus:!0}),l.createElement(sf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"))}function Lv(e){return l.createElement(wi,{initialValues:e.level,validationSchema:Uh,onSubmit:e.saveLevel},l.createElement(Tv,{id:e.level&&e.level.id}))}function _v(e){var t=Bh.singularizeMemberType(e.memberType),n=ci(),r=qc(n);return l.createElement(vi,null,l.createElement(Bc,{label:"Backbone Audience(s)",as:"select",name:"backboneAudienceIds",id:"level-ids",multiple:!0,size:e.levels.length,value:n.values.backboneAudienceIds},e.levels.map((function(e){return l.createElement("option",{key:e.id,value:e.id},e.name)}))),l.createElement("p",null,l.createElement("strong",null,"Note:")," When removing a ".concat(t," from a backbone audience, that backbone audience's mapped audiences "),l.createElement("strong",null,"will not")," be automatically removed from."),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(sf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},"Save Backbone Audience")))}function Pv(e){return l.createElement(wi,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.backboneAudienceIds;return e.saveLevels(r,!1,n)}},l.createElement(_v,{levels:e.levels,memberType:e.memberType}))}var xv=function(e){return function(t){return t.appLink.action===e}};function Nv(e){var t=e.levelId,n=e.activeAction,r=e.presentationId;return l.createElement(l.Fragment,null,l.createElement(ki.Alert,{variant:"danger"},"Warning: You are editing the backbone audiences."),l.createElement("div",{className:"py-2"},l.createElement(jl,{tabs:Jh(t,r),isItemActive:xv(n)})))}var Rv=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Dv(e){return l.createElement(l.Fragment,null,e.audiences.map((function(t){return l.createElement("th",{key:t.masterId},l.createElement("span",{className:"d-inline-block"},l.createElement(Su,{selected:e.getIsAudienceSelected(t),onToggle:function(n){return e.onToggleAudience(t.masterId,n)}})),l.createElement(fu,{appLink:e.getAudienceAppLink(t.masterId)},function(e,t){return t?e.name:"Audience: ".concat(e.name)}(t,e.showAudienceSubHeader)))})))}function Mv(e){var t=e.memberType,n=e.hasActions,r=e.audiences,i=Rv(e,["memberType","hasActions","audiences"]),a="".concat(El(Kh.singularizeMemberType(t))," Name"),o=!!r&&!!r.length,c=o&&r.length>1,s=o?2:1,u=Object.assign({audiences:r,showAudienceSubHeader:c},i);return l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{rowSpan:s},a),o&&(c?l.createElement("th",{colSpan:r.length,className:"text-center"},"Audiences"):l.createElement(Dv,Object.assign({},u))),n&&l.createElement("th",{rowSpan:s})),o&&c&&l.createElement("tr",null,l.createElement(Dv,Object.assign({},u))))}function Uv(e){var t=e.member,n=t.id,r=t.name,i=t.audiences,a=void 0===i?[]:i,o=e.getMemberAppLink,c=e.onToggleAudience,s=e.actions,u=m(o)&&o(n);return a.length&&!m(c)&&p.ErrorHelper.throw(new Zc.a("onToggleAudience must be passed to LevelMemberItem")),l.createElement("tr",null,l.createElement("td",null,u?l.createElement(fu,{appLink:o(n)},r):r),!!a.length&&a.map((function(e){return l.createElement("td",{key:e.id},l.createElement(Su,{selected:e.selected,onToggle:function(t){return c(e.id,t,n)}}))})),s&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(pl,{actions:s}))))}var Fv=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function Vv(e,t){return function(n){var r=n[e],i=zl(r);return!!i&&i===t.length}}function Bv(e){var t=e.members,n=e.memberType,r=e.getActions,i=e.audiences,a=e.getAudienceAppLink,o=e.onToggleAudience,c=Fv(e,["members","memberType","getActions","audiences","getAudienceAppLink","onToggleAudience"]);if(!t.length)return l.createElement("div",{className:"py-5"},"No ".concat(n," in this level."));var s=m(r),u={memberType:n,audiences:i,getAudienceAppLink:a,getIsAudienceSelected:Vv(n,t),onToggleAudience:o,hasActions:s};return l.createElement(ki.Table,{responsive:!0,bordered:!0},l.createElement(Mv,Object.assign({},u)),l.createElement("tbody",null,t.map((function(e,t){return l.createElement(Uv,Object.assign({key:t,member:e,actions:s&&r(e.id),onToggleAudience:o},c))}))))}function zv(e){var t=ci();return l.createElement(vi,null,l.createElement(Bc,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this presentation",autoFocus:!0}),l.createElement(Bc,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this presentation here"}),l.createElement(Bc,{as:"select",label:"Status",name:"status",id:"status",value:t.values.status,disabled:e.isNew},Ci.a.getEnumKeys(jp).map((function(e){return l.createElement("option",{key:e,value:jp[e]},e)}))),l.createElement("div",{className:"btn-container d-flex justify-content-end"},l.createElement(ls,{isNew:e.isNew})))}function Hv(e){var t;return l.createElement(wi,{initialValues:e.presentation,validationSchema:Fh,onSubmit:e.savePresentation},l.createElement(zv,{isNew:!(null===(t=e.presentation)||void 0===t?void 0:t.id)}))}function qv(e){var t=e.presentations,n=e.currentPresentationId,r=e.setCurrentPresentation,i=e.label,a=function(e){var n=function(e,t){return yp.a.first(t.filter((function(t){return t.id.toString()===e.toString()})))}(e,t);r(n)};return l.useEffect((function(){t&&!n&&r(yp.a.first(t))}),[t]),l.createElement(l.Fragment,null,!!n&&l.createElement(l.Fragment,null,l.createElement(ki.Form.Label,null,i),l.createElement(ki.Form.Control,{as:"select",value:n,onChange:function(e){return a(e.target.value)},className:"cursor-pointer"},t.map((function(e){return l.createElement("option",{value:e.id,key:e.id},e.name)})))))}function Jv(e){return l.createElement(l.Fragment,null,l.createElement("h4",null,"".concat(El(e.memberType))),l.createElement(ki.Table,{responsive:!0},l.createElement("tbody",null,e.objects&&e.objects.map((function(t){return l.createElement("tr",{key:t.id},l.createElement("td",null,l.createElement(fu,{appLink:Bh.getMemberAppLink(e.memberType,t.id)},t.name)))})))),l.createElement(rb,{initialValues:{backboneClassificationIds:[]},subjectTree:e.subjectTree,saveSubjects:e.onClickAddToSubject,memberType:e.memberType,saveBtnText:"Add to backbone classification",subjectRequired:!0}))}function $v(e){return function(e){if(Array.isArray(e))return Kv(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Kv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kv(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Yv(e){var t=Bh.singularizeMemberType(e.memberType),n=[].concat($v(e.objectClassifications),$v(e.objectSubjectClassifications)).map((function(e){return e.id}));return l.createElement(l.Fragment,null,l.createElement("div",{className:"border-bottom pb-3 mb-3"},l.createElement("h6",null,"Backbone Classifications"),l.createElement("p",null,"Select which backbone classifications this ".concat(t," is mapped to.")),l.createElement(rb,{initialValues:{backboneClassificationIds:e.objectSubjects.map((function(e){return e.id}))},subjectTree:e.subjectTree,saveSubjects:e.saveSubjects,memberType:e.memberType,saveBtnText:"Save Backbone Classifications",allowMultiple:!0})),l.createElement("h6",null,"Classifications"),l.createElement("p",null,"Select a presentation to view its classifications and map them to this ".concat(t,".")),l.createElement("div",{className:"w-50 pb-3"},l.createElement(qv,{presentations:e.presentations,currentPresentationId:e.currentPresentation.id,setCurrentPresentation:e.setCurrentPresentation})),e.currentPresentation&&e.classificationTree&&e.classificationTree.children.length?l.createElement(l.Fragment,null,l.createElement("p",null,"Only classifications which are mapped to one of the backbone classifications selected above can be selected."),l.createElement(kv,{initialValues:{classificationIds:e.objectClassifications.map((function(e){return e.id}))},presentationId:e.currentPresentation.id,classificationTree:e.classificationTree,saveClassifications:e.saveClassifications,isClassificationDisabled:function(e){return!n.includes(e.id)}})):l.createElement("p",null,"This presentation has no classifications."))}function Gv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Wv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wv(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}qv.defaultProps={label:"Presentation"};function Zv(e){var t=!e.id,n=ci(),r=qc(n),a=!t||!!n.values.parentId,o=Gv(l.useState(a),2),s=o[0],u=o[1];l.useEffect((function(){return u(a)}),[e.id,n.values.parentId]);var f=function(e){var t=e.id===n.values.parentId?null:e.id;n.setFieldValue("parentId",t)},p="".concat(Ti(n.errors,n.touched,"parentId")," h-auto py-2");return l.createElement(vi,null,l.createElement(Bc,{label:"Name",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this backbone classification",autoFocus:!0}),l.createElement(Bc,{name:"parentId"},(function(){return l.createElement("div",{className:p},l.createElement(Fl,{label:"Parent Backbone Classification",tree:e.subjectTree,selectedIds:[n.values.parentId],onSelect:f,collapse:s,noSelectionMessage:"No parent selected, this will be a root backbone classification.",isNodeDisabled:(t=e.subjectTree,r=e.id,function(e){if(e.id===r)return!0;var n=Al.find(t,r);return!!Al.find(n,e.id)})}));var t,r})),l.createElement("div",{className:"d-flex justify-content-between"},l.createElement(sf,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&l.createElement(ki.Button,{as:fu,variant:"danger",appLink:{application:c.SUBJECTS,action:i.Subjects.DELETE_SUBJECT,args:[e.id]}},"Delete")))}function Qv(e){return l.createElement(wi,{initialValues:e.subject,validationSchema:Vh,onSubmit:e.saveSubject},l.createElement(Zv,{id:e.subject&&e.subject.id,subjectTree:e.subjectTree}))}var Xv=function(e){return function(t){return t.appLink.action===e}};function eb(e){var t=e.subjectId,n=e.activeAction,r=e.presentationId;return l.createElement(l.Fragment,null,l.createElement(ki.Alert,{variant:"danger"},"Warning: You are editing the backbone classifications."),l.createElement("div",{className:"py-2"},l.createElement(jl,{tabs:Hh(t,r),isItemActive:Xv(n)})))}var tb=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[e]}};function nb(e){var t=ci(),n=qc(t),r=function(n){var r=e.allowMultiple?yp.a.addOrRemove(t.values.backboneClassificationIds.map((function(e){return e.toString()})),n.id.toString()):[n.id];t.setFieldValue("backboneClassificationIds",r)},i="".concat(Ti(t.errors,t.touched,"backboneClassificationIds")," h-auto py-2");return l.createElement(vi,null,l.createElement(Bc,{name:"backboneClassificationIds"},(function(){return l.createElement("div",{className:i},l.createElement(Fl,{label:"Mapped Backbone Classification".concat(e.allowMultiple?"(s)":""),tree:e.subjectTree,selectedIds:t.values.backboneClassificationIds,onSelect:r,collapse:!!t.initialValues.backboneClassificationIds.length,getSelectedItemAppLink:tb}))})),l.createElement("div",{className:"d-flex justify-content-end"},l.createElement(sf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.saveBtnText)))}function rb(e){var t;return l.createElement(wi,{initialValues:e.initialValues,validationSchema:(t=e.subjectRequired,ji.object().shape({backboneClassificationIds:t?ji.array().of(ji.string()).min(1,"A subject is required").required("A subject is required"):ji.array().of(ji.string())}).noUnknown()),onSubmit:function(t,n){var r=t.backboneClassificationIds;return e.saveSubjects(r,!1,n)}},l.createElement(nb,{subjectTree:e.subjectTree,memberType:e.memberType,allowMultiple:e.allowMultiple,saveBtnText:e.saveBtnText}))}nb.defaultProps={saveBtnText:"Save"};var ib=function(e){return l.createElement("div",{className:"border rounded p-2 mb-3"},l.createElement("h6",{className:"border-bottom pb-1"},e.presentation.name),e.classifications&&e.classifications.length?l.createElement("ul",{className:"list-unstyled mb-0"},e.classifications.map((function(t){return l.createElement("li",{key:t.id,className:"py-1"},l.createElement(fu,{appLink:(n=e.presentation.id,r=t.id,{application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[n,r]})},t.name));var n,r}))):l.createElement("p",null,l.createElement("em",null,"There are no classifications mapped to this backbone classification in this presentation.")))},ab=function(e){return l.createElement(l.Fragment,null,!!e.presentations&&!!e.classificationDictionary&&e.presentations.map((function(t){return l.createElement(ib,{key:t.id,presentation:t,classifications:e.classificationDictionary[t.id]})})))},ob=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function cb(e){return l.createElement(l.Fragment,null,e.classifications.map((function(t){return l.createElement("th",{key:t.id},l.createElement("span",{className:"d-inline-block"},l.createElement(Su,{selected:e.getIsClassificationSelected(t),onToggle:function(n){return e.onToggleClassification(t.id,n)}})),l.createElement(fu,{appLink:e.getClassificationAppLink(t.id)},function(e,t){return t?e.name:"Classification: ".concat(e.name)}(t,e.showClassificationSubHeader)))})))}function sb(e){var t=e.memberType,n=e.hasActions,r=e.classifications,i=ob(e,["memberType","hasActions","classifications"]),a="".concat(El(Bh.singularizeMemberType(t))," Name"),o=!!r&&!!r.length,c=o&&r.length>1,s=o?2:1,u=Object.assign({classifications:r,showClassificationSubHeader:c},i);return l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{rowSpan:s},a),o&&(c?l.createElement("th",{colSpan:r.length,className:"text-center"},"Classifications"):l.createElement(cb,Object.assign({},u))),n&&l.createElement("th",{rowSpan:s})),o&&c&&l.createElement("tr",null,l.createElement(cb,Object.assign({},u))))}function ub(e){var t=e.member,n=t.id,r=t.name,i=t.classifications,a=void 0===i?[]:i,o=e.getMemberAppLink,c=e.onToggleClassification,s=e.actions,u=m(o)&&o(n);return a.length&&!m(c)&&p.ErrorHelper.throw(new Zc.a("onToggleClassification must be passed to SubjectMemberItem")),l.createElement("tr",null,l.createElement("td",null,u?l.createElement(fu,{appLink:o(n)},r):r),!!a.length&&a.map((function(e){return l.createElement("td",{key:e.id},l.createElement(Su,{selected:e.selected,onToggle:function(t){return c(e.id,t,n)}}))})),s&&l.createElement("td",null,l.createElement("span",{className:"d-flex justify-content-end"},l.createElement(pl,{actions:s}))))}var lb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function fb(e,t){return function(n){var r=n[e],i=zl(r);return!!i&&i===t.length}}function pb(e){var t=e.members,n=e.memberType,r=e.getActions,i=e.classifications,a=e.getClassificationAppLink,o=e.onToggleClassification,c=lb(e,["members","memberType","getActions","classifications","getClassificationAppLink","onToggleClassification"]);if(!t.length)return l.createElement("div",{className:"py-5"},"No ".concat(n," in this backbone classification."));var s=m(r),u={memberType:n,classifications:i,getClassificationAppLink:a,getIsClassificationSelected:fb(n,t),onToggleClassification:o,hasActions:s};return l.createElement(ki.Table,{responsive:!0,bordered:!0},l.createElement(sb,Object.assign({},u)),l.createElement("tbody",null,t.map((function(e,t){return l.createElement(ub,Object.assign({key:t,member:e,actions:s&&r(e.id),onToggleClassification:o},c))}))))}function db(e){var t=e.navItems,n=e.currentAppLink;return l.createElement(ki.Container,null,l.createElement(ki.Navbar,{className:"justify-content-between align-items-center"},l.createElement(ki.Nav,null,!!t&&t.map((function(e,t){return l.createElement(ki.Nav.Item,{key:t},l.createElement(fu,{appLink:e.appLink,className:"nav-link".concat(bl.isItemActive(e,n)?" text-primary":"")},e.label))})))))}function mb(e,t){l.useEffect((function(){e.presentations&&!e.currentPresentation&&yh(t,"currentPresentation")(yp.a.first(e.presentations))}),[e.presentations])}function hb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vb(e){var t=oe.useBasicFetch(Bm(e.playlistId)),n=oe.useBasicFetch(hp()),r=hb(l.useState({}),2),a=r[0],o=r[1],c=Hf(u.SUBJECT);!function(e,t,n){var r=function(e){return yh(n,e)};lh([Qy.getObjectLevelsFetchOptions(e,Ih.Playlists,r("playlistLevels"))],[e]),hh(Qy.getObjectAudiencesFetchOptions(e,Ih.Playlists,r("playlistAudiences")),[e,t.playlistLevels]),lh([Qy.getPresentationsFetchOptions(r("presentations")),Qy.getLevelsFetchOptions(r("levels"))],[]),hh(!!t.currentPresentation&&Qy.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.playlistId,a,o),mb(a,o);var s=!!(a.presentations&&a.levels&&a.presentationAudiences&&a.playlistLevels&&a.playlistAudiences);return l.createElement(l.Fragment,null,!!n.data&&l.createElement(nh,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST_AUDIENCES,currentUser:n.data}),l.createElement(dl,{object:t.data}),!!s&&l.createElement(cv,{objectLevels:a.playlistLevels,objectAudiences:a.playlistAudiences,presentations:a.presentations,currentPresentation:a.currentPresentation,setCurrentPresentation:yh(o,"currentPresentation"),levels:a.levels,presentationAudiences:a.presentationAudiences,memberType:Ih.Playlists,saveLevels:function(t,n,r){return c.updateObjectLevels(e.playlistId,t,Ih.Playlists,n,r,r)},saveAudiences:function(t,n){return c.updateObjectAudiences(e.playlistId,a.currentPresentation.id,t,Ih.Playlists,n,n)}}))}function bb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||Sb(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gb(e){return function(e){if(Array.isArray(e))return Eb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Sb(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sb(e,t){if(e){if("string"==typeof e)return Eb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Eb(e,t):void 0}}function Eb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ob(e){var t=oe.useBasicFetch(Bm(e.playlistId)),n=oe.useBasicFetch(hp()),r=bb(l.useState({}),2),a=r[0],o=r[1],c=Hf(u.SUBJECT);!function(e,t,n){var r=function(e){return yh(n,e)};lh([Qy.getSubjectTreeFetchOptions(r("subjectTree")),Qy.getPresentationsFetchOptions(r("presentations"))],[]),lh([Qy.getObjectSubjectsFetchOptions(e,Ih.Playlists,r("playlistSubjects"))],[e]),hh(!!t.currentPresentation&&Qy.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),l.useEffect((function(){return r("subjectClassifications")([])}),[t.playlistSubjects]);var i=function(e,t){return[].concat(gb(t.subjectClassifications||[]),gb(e))},a=t.playlistSubjects&&t.playlistSubjects.map((function(e){return Qy.getSubjectClassificationFetchOptions(e.id,yh(n,"subjectClassifications",i))}));lh(a,[t.playlistSubjects],!!a),hh(Qy.getObjectClassificationsFetchOptions(e,Ih.Playlists,r("playlistClassifications")),[e,t.playlistSubjects])}(e.playlistId,a,o),mb(a,o);var s=!!(a.playlistSubjects&&a.subjectTree&&a.presentations&&a.classificationTree&&a.playlistClassifications&&a.subjectClassifications);return l.createElement(l.Fragment,null,!!n.data&&l.createElement(nh,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST_SUBJECTS,currentUser:n.data}),l.createElement(dl,{object:t.data}),s&&l.createElement(Yv,{objectSubjects:a.playlistSubjects,subjectTree:a.subjectTree,memberType:Ih.Playlists,presentations:a.presentations,currentPresentation:a.currentPresentation,setCurrentPresentation:yh(o,"currentPresentation"),objectClassifications:a.playlistClassifications,objectSubjectClassifications:a.subjectClassifications,classificationTree:a.classificationTree,saveSubjects:function(t,n,r){return c.updateObjectSubjects(e.playlistId,t,Ih.Playlists,n,r,r)},saveClassifications:function(t,n){return c.updateObjectClassifications(e.playlistId,a.currentPresentation.id,t,Ih.Playlists,n,n)}}))}var Cb=function(e,t,n){if(t===n)return{reorderedItems:e,reorderRequest:null};var r=yp.a.moveItem(e,t,n),i=n<e.length-1?r[n+1].id:null;return{reorderedItems:r,reorderRequest:{sourceMemberId:r[n].id,destinationMemberId:i}}};function Ab(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return wb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ib(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ib(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ib(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var kb=function(e){return{application:c.VIDEOS,action:i.Videos.EDIT_VIDEO,args:[e.id]}};function Tb(e){var t,n,r,a,o,s,u=Object(v.useDispatch)(),f=tp(),p=oe.useBasicFetch(Bm(e.playlistId)),d=oe.useBasicFetch($m(e.playlistId)),m=oe.useBasicFetch(hp()),h=jb((n=null===(t=d.data)||void 0===t?void 0:t.data,r=Ab(Object(l.useState)(),2),a=r[0],o=r[1],Object(l.useEffect)((function(){a&&(n.length!==a.length||function(e,t){var n=!0;if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r].id!==t[r].id){n=!1;break}return n}(n,a))&&o(null)}),[n]),[a,o]),2),y=h[0],b=h[1],g=y?{data:y,pagination:null}:d.data;return l.createElement(l.Fragment,null,!!m.data&&l.createElement(nh,{playlistId:e.playlistId,activeAction:i.Playlists.EDIT_PLAYLIST_VIDEOS,currentUser:m.data}),l.createElement(dl,{object:p.data}),!!g&&l.createElement(tf,{onSortEnd:function(t,n){if(t!==n){var r=Cb(d.data.data,t,n),i=r.reorderRequest,a=r.reorderedItems;b(a);oe.fetch(u,Km(e.playlistId,i,null,(function(){f.error("Failed to update playlist order."),b(null)})))}},videos:g,getVideoAppLink:kb,getVideoActions:(s=e.playlistId,function(e){return[{label:"Remove video",appLink:{application:c.PLAYLISTS,action:i.Playlists.REMOVE_VIDEO,args:[s.toString(),e.id.toString()]},className:"text-danger"}]}),emptyMessage:"There are no videos in this playlist."}))}function Lb(){var e=Object(v.useDispatch)(),t=tp(),n=oe.useBasicFetch(hp());return l.createElement(l.Fragment,null,!!n.data&&l.createElement(th,{savePlaylist:function(r,a){oe.fetch(e,Hm(r,n.data.id,(function(e){t.success("Successfully created playlist."),function(e){e&&e.id&&p.AppLinkHelper.trigger({application:c.PLAYLISTS,action:i.Playlists.EDIT_PLAYLIST,args:[e.id]})}(e)}),(function(){t.error("Failed to create playlist.")}),a))}}))}var _b="rating,thumbnail,glance,herobanner,tags",Pb=function(e){return{url:"/api/master/v2/objects/".concat(e,"?query=").concat(_b),key:"videos:".concat(e)}},xb=function(e){var t=e.slice().sort();return{key:"videos:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},Nb=function(e){return{url:"/ajax/hostedlibraries/rightsline/programs/".concat(e),key:"rightsline:videos:".concat(e),normalizeOptions:{namespace:"rightsline"}}},Rb=function(e,t,n,r,i){return{key:"videos:".concat(e),url:"/api/master/v2/objects/".concat(e),data:t,type:ce.a.PUT,success:n,error:r,always:i}};function Db(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Mb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ub(e){var t=Object(v.useDispatch)(),n=tp(),r=oe.useBasicFetch(Bm(e.playlistId)),i=oe.useBasicFetch(Pb(e.videoId)),a=Db(l.useState(!1),2),o=a[0],c=a[1];var s=!!r.data&&!!i.data;return l.createElement(rp,{title:"Remove Video",closePopup:e.closePopup,showLoadingSpinner:!s},!!s&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,i.data.name)," from ",l.createElement("strong",null,r.data.name),"?")),l.createElement(ap,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){c(!0),oe.fetch(t,Ym(e.playlistId,e.videoId,(function(){n.success("Successfully removed video from playlist")}),(function(){n.error("Failed to remove video from playlist")}),e.closePopup))},buttonText:"Yes, remove video",isSpinnerButton:!0,showSpinner:o}]})))}function Fb(e){return p.AppLinkHelper.trigger(function(e){return{application:c.PLAYLISTS,action:i.Playlists.EDIT_PLAYLIST,args:[e.id]}}(e))}function Vb(e){var t=e?{application:c.PLAYLISTS,action:i.Playlists.SEARCH_PLAYLISTS,params:{query:e}}:{application:c.PLAYLISTS,action:i.Playlists.PLAYLISTS};p.AppLinkHelper.trigger(t)}function Bb(e){return l.createElement("div",{className:"pb-3 w-50"},l.createElement(Hs,{initialQuery:e.query,placeholder:"Search for a playlist",onSuggestionSelected:Fb,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/playlists/instant/raw","?query=").concat(e)},activationLength:2,onSubmit:Vb}))}var zb=c.PLAYLISTS,Hb=function(e){return{application:zb,action:i.Playlists.EDIT_PLAYLIST,args:[e.id]}};function qb(e){var t=oe.useBasicFetch(Fm(e.cursor));return l.createElement(l.Fragment,null,l.createElement(Bb,null),l.createElement(nl,{collection:t&&t.data,collectionAppLink:{application:zb,action:i.Playlists.PLAYLISTS},newObjectAppLink:{application:zb,action:i.Playlists.NEW_PLAYLIST},getObjectAppLink:Hb,objectName:"Playlist"}))}var Jb=c.PLAYLISTS,$b=function(e){return{application:Jb,action:i.Playlists.EDIT_PLAYLIST,args:[e.id]}};function Kb(e){var t=oe.useBasicFetch(Vm(e.query,e.cursor));return l.createElement(l.Fragment,null,l.createElement(Bb,{query:e.query}),!!t.data&&(t.data.data.length?l.createElement(nl,{collection:t.data,collectionAppLink:{application:Jb,action:i.Playlists.SEARCH_PLAYLISTS,params:{query:e.query}},newObjectAppLink:{application:Jb,action:i.Playlists.NEW_PLAYLIST},getObjectAppLink:$b,objectName:"Playlist"}):l.createElement("p",null,"No playlists found, please try a different search query.")))}function Yb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Gb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Wb=function(e,t,n){return[{variant:"link",onClick:t,buttonText:"Cancel"},{variant:"danger",onClick:e,buttonText:"Yes, delete this audience",isSpinnerButton:!0,showSpinner:n}]};function Zb(e){var t=e.id,n=e.routeToOnDelete,r=e.closePopup,i=Yb(l.useState(),2),a=i[0],o=i[1],c=Yb(l.useState(!1),2),s=c[0],f=c[1],d=Hf(u.SUBJECT);hh(Qy.getAudienceFetchOptions(t,o),[t]);return l.createElement(rp,{title:"Delete Audience",closePopup:r,showLoadingSpinner:!a},!!a&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,a.name),"?")),l.createElement(ap,{buttons:Wb((function(){f(!0);d.deleteAudience(t,(function(){r(),n&&p.AppLinkHelper.trigger(n)}),r)}),r,s)})))}function Qb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xb(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eg(e){var t=e.presentationId,n=e.audienceId,r=Qb(l.useState(),2),i=r[0],a=r[1],o=Qb(l.useState(),2),c=o[0],s=o[1],f=Qb(l.useState(),2),p=f[0],d=f[1],m=Hf(u.SUBJECT);hh(Qy.getAudienceFetchOptions(n,a),[n]),hh(Qy.getLevelsFetchOptions(s),[]),hh(Qy.getPresentationFetchOptions(t,d),[t]);return l.createElement(l.Fragment,null,l.createElement(fv,{presentation:p,audienceId:n}),!!p&&l.createElement("h6",null,"Presentation: ".concat(p.name)),!!i&&!!c&&l.createElement(av,{audience:i,levels:c,saveAudience:function(e,r){return m.updateAudience(n,Object.assign(Object.assign({},e),{presentationId:t}),r,r)},presentationId:t}))}function tg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ng(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ng(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ng(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rg=function(e){return{application:c.SUBJECTS,action:i.Subjects.PRESENTATION_AUDIENCES,args:[e]}};function ig(e){var t=e.presentationId,n=tg(l.useState(),2),r=n[0],a=n[1],o=tg(l.useState(),2),s=o[0],f=o[1],d=Hf(u.SUBJECT);hh(Qy.getLevelsFetchOptions(a),[]),hh(Qy.getPresentationFetchOptions(t,f),[t]);return l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-2"},l.createElement(pu,{appLink:rg(t),backToName:"audiences"})),!!s&&l.createElement("h6",null,"Presentation: ".concat(s.name)),!!r&&l.createElement(av,{levels:r,presentationId:t,saveAudience:function(e,n){return d.createAudience(Object.assign(Object.assign({},e),{presentationId:t}),function(e,t){return function(n){t(),p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[e,n.masterId]})}}(t,n),n)}}))}var ag=n(214),og=n.n(ag);function cg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ug(e){var t=e.presentationId,n=e.selectedAudienceId,r=cg(l.useState(),2),a=r[0],o=r[1];hh(Qy.getAudiencesFetchOptions(t,o),[]);var s=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[t,e.masterId]}},u={application:c.SUBJECTS,action:i.Subjects.NEW_AUDIENCE,args:[t]};return l.createElement("div",{className:"".concat(og.a.navContainer," h-auto pr-2 border-right")},l.createElement("h5",{className:"border-bottom pb-2"},"Audiences"),l.createElement(fu,{appLink:u,className:"d-inline-block pb-2"},l.createElement(Mc,{svgName:Dc.Plus,size:Nc.Small}),l.createElement("span",null,"New Audience")),l.createElement("div",{className:"border-top pt-1"},l.createElement("ul",{className:"list-unstyled"},a&&a.map((function(e){return l.createElement("li",{className:"position-relative py-1"},l.createElement(fu,{className:(null==n?void 0:n.toString())===e.masterId.toString()?"text-primary font-weight-500":"",appLink:s(e)},e.name))})))))}function lg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pg(e){var t=e.presentationId,n=e.audienceId,r=e.memberType,i=lg(l.useState(),2),a=i[0],o=i[1],c=lg(l.useState(),2)[1],s=lg(l.useState(),2),u=s[0],f=s[1];hh(Qy.getPresentationFetchOptions(t,o),[]),hh(Qy.getAudienceFetchOptions(n,c),[n]),hh(Qy.getAudienceMembersFetchOptions(n,r,f),[n,r]);var p={items:u&&u.data,memberType:r,getItemAppLink:function(e){return Kh.getMemberAppLink(r,e.id)},getActions:function(e){return Kh.getMemberActions(n,jh.Audience,r,e.id)}},d={presentation:a,audienceId:n},m=gl(p);return l.createElement(l.Fragment,null,l.createElement(fv,Object.assign({},d,{memberType:r})),m&&l.createElement(dv,Object.assign({},p)))}function dg(e){return{application:c.SUBJECTS,action:i.Subjects.NEW_CLASSIFICATION,args:[e]}}function mg(e){return[{label:"Add child",getAppLink:function(t){return Object.assign(Object.assign({},dg(e)),{args:[e],params:{parentId:t.id}})}},{label:"Delete classification",getAppLink:function(t){return{application:c.SUBJECTS,action:i.Subjects.DELETE_CLASSIFICATION,args:[e,t.id]}},className:"text-danger"}]}var hg=n(215),yg=n.n(hg);function vg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function gg(e){var t=e.presentationId,n=e.selectedClassificationId,r=vg(l.useState(),2),a=r[0],o=r[1],s=vg(l.useState(),2),u=s[0],f=s[1];return function(e,t,n){lh([Qy.getClassificationTreeFetchOptions(e,t),Qy.getPresentationFetchOptions(e,n)],[e])}(t,o,f),l.createElement("div",{className:"".concat(yg.a.navContainer," h-auto pr-2 border-right")},!!u&&l.createElement("h6",{className:"border-bottom pb-2"},"Classifications (".concat(u.name,")")),l.createElement(fu,{appLink:dg(t),className:"d-inline-block pb-2"},l.createElement(Mc,{svgName:Dc.Plus,size:Nc.Small}),l.createElement("span",null,"New Classification")),!!a&&l.createElement("div",{className:"border-top pt-1"},l.createElement(Nl,{tree:a,getAppLink:function(e){return function(e,t){return{application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[e,t.id]}}(t,e)},selectedIds:[n],actions:mg(t)})))}function Sg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Eg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Eg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Eg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Og(e){var t=e.classificationId,n=e.routeToOnDelete,r=e.closePopup,i=Sg(l.useState(),2),a=i[0],o=i[1],c=Sg(l.useState(!1),2),s=c[0],f=c[1];hh(Qy.getClassificationFetchOptions(t,o),[]);var d=Hf(u.SUBJECT),m=[{variant:"link",onClick:r,buttonText:"Cancel"},{variant:"danger",onClick:function(){f(!0);d.deleteClassification(t,(function(){r(),n&&p.AppLinkHelper.trigger(n)}),r)},buttonText:"Yes, delete this classification",isSpinnerButton:!0,showSpinner:s}];return l.createElement(rp,{title:"Delete Classification",closePopup:r,showLoadingSpinner:!a},!!a&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,a.name),"?")),l.createElement(ap,{buttons:m})))}function Cg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ag(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ag(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ag(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wg(e){var t=e.presentationId,n=e.classificationId,r=Cg(l.useState(),2),i=r[0],a=r[1],o=Cg(l.useState(),2),c=o[0],s=o[1],f=Cg(l.useState(),2),p=f[0],d=f[1],m=Cg(l.useState(),2),h=m[0],y=m[1],v=Hf(u.SUBJECT),b=Qy.getClassificationFetchOptions(n,a),g=Qy.getPresentationFetchOptions(t,s),S=Qy.getClassificationTreeFetchOptions(t,d);hh(Qy.getSubjectTreeFetchOptions(y),[]),hh(b,[n]),lh([g,S],[t]);return l.createElement("div",null,l.createElement(jv,{presentation:c,classificationId:n}),!!i&&!!p&&!!h&&l.createElement(Av,{classification:i,presentationId:t,subjectTree:h,classificationTree:p,saveClassification:function(e,t){var r=Object.assign({pinnedVideoMasterId:(null==i?void 0:i.pinnedVideoMasterId)||null},e);return v.updateClassification(n,r,t,t)}}))}function jg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ig(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ig(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ig(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function kg(e){var t=e.presentationId,n=e.classificationId,r=e.memberType,i=jg(l.useState(),2),a=i[0],o=i[1],c=jg(l.useState(),2),s=c[0],f=c[1],p=jg(l.useState(),2),d=p[0],m=p[1];hh(Qy.getPresentationFetchOptions(t,o),[]),hh(Qy.getClassificationFetchOptions(n,f),[n]),hh(Qy.getClassificationMembersFetchOptions(n,r,m),[n,r]);var h=Hf(u.SUBJECT),y={items:d&&d.data,memberType:r,classification:s,updatePinnedVideo:function(e,t){var r=Object.assign(Object.assign({},s),{pinnedVideoMasterId:e});h.updateClassification(n,r,t)},getItemAppLink:function(e){return Bh.getMemberAppLink(r,e.id)},getActions:function(e){return Bh.getMemberActions(n,jh.Classification,r,e.id)}},v={presentation:a,classificationId:n},b=gl(y);return l.createElement(l.Fragment,null,l.createElement(jv,Object.assign({},v,{memberType:r})),b&&l.createElement(gv,Object.assign({},y)))}function Tg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Lg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Lg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _g(e){var t=e.presentationId,n=e.parentId,r=Tg(l.useState(),2),a=r[0],o=r[1],s=Tg(l.useState(),2),f=s[0],d=s[1],m=Hf(u.SUBJECT),h=Qy.getClassificationTreeFetchOptions(t,o);hh(Qy.getSubjectTreeFetchOptions(d),[]),hh(h,[t]);return l.createElement("div",null,l.createElement("h4",{className:"py-2"},"Create New Classification"),!!f&&!!a&&l.createElement(Av,{classification:n?{parentIds:[n]}:{},presentationId:t,subjectTree:f,classificationTree:a,saveClassification:function(e,n){return m.createClassification(Object.assign(Object.assign({},e),{presentationId:t}),function(e,t){return function(n){t(),n&&n.id&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[e,n.id]})}}(t,n),n)}}))}var Pg=function(e){return{key:"series:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=thumbnail,tallPoster,banner,rating")}},xg=function(e){var t=e.slice().sort();return{key:"series:".concat(t.join(",")),url:"/api/master/v2/objects?".concat(t.map((function(e){return"id=".concat(e)})).join("&"))}},Ng=function(e,t,n,r){return{url:"/api/master/v2/series",key:"series",data:e,type:ce.a.POST,success:t,error:n,always:r}},Rg=function(e,t,n,r,i){return{url:"/api/master/v2/objects/".concat(e),key:"update:series:".concat(e),data:t,type:ce.a.PUT,success:n,error:r,always:i}};function Dg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Mg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ug(e){var t=Dg(l.useState(),2),n=t[0],r=t[1],i=Dg(l.useState(!1),2),a=i[0],o=i[1],c=oe.useBasicFetch(function(e,t){switch(e){case Ih.Playlists:return Bm(t);case Ih.Series:return Pg(t);case Ih.Videos:return Pb(t)}}(e.memberType,e.memberId)),s=Hf(u.SUBJECT);hh(Qy.getClassificationFetchOptions(e.classificationId,r),[e.classificationId]);var f=!!n&&!!c.data,p="Remove ".concat(El(Bh.singularizeMemberType(e.memberType)));return l.createElement(rp,{title:p,closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,c.data.name)," from ",l.createElement("strong",null,n.name),"?"),l.createElement("p",null,"This will not remove it from the backbone subject.")),l.createElement(ap,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){o(!0),s.removeObjectsFromClassification(e.classificationId,[e.memberId],e.memberType,null,null,e.closePopup,e.closePopup),n.pinnedVideoMasterId===e.memberId&&s.updateClassification(e.classificationId,Object.assign(Object.assign({},n),{pinnedVideoMasterId:null}))},buttonText:"Yes, remove this ".concat(Bh.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function Fg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Bg(e){var t=e.id,n=Fg(l.useState(),2),r=n[0],a=n[1],o=Hf(u.SUBJECT);hh(Qy.getLevelFetchOptions(t,a),[t]);return l.createElement(l.Fragment,null,l.createElement(Nv,{levelId:t,activeAction:i.Subjects.EDIT_LEVEL}),l.createElement("h4",{className:"py-2"},"Edit Level"),!!r&&l.createElement(Lv,{level:r,saveLevel:function(e,n){return o.updateLevel(t,e,n,n)}}))}function zg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Hg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qg(){var e=zg(l.useState(),2),t=e[0],n=e[1];return hh(Qy.getLevelsFetchOptions(n),[]),l.useEffect((function(){t&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[yp.a.first(t).id]},{replace:!0})}),[t]),l.createElement(l.Fragment,null)}function Jg(){var e=Hf(u.SUBJECT);return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Create New Level"),l.createElement(Lv,{saveLevel:function(t,n){return e.createLevel(t,function(e){return function(t){e(),t&&t.id&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[t.id]})}}(n),n)}}))}var $g=n(216),Kg=n.n($g);function Yg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Gg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gg(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Wg(e){var t=e.selectedLevelId,n=Yg(l.useState(),2),r=n[0],a=n[1];hh(Qy.getLevelsFetchOptions(a),[]);var o=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[e.id]}},s={application:c.SUBJECTS,action:i.Subjects.NEW_LEVEL};return l.createElement("div",{className:"".concat(Kg.a.navContainer," h-auto pr-2 border-right")},l.createElement("h5",{className:"border-bottom pb-2"},"Backbone Audiences"),l.createElement(fu,{appLink:s,className:"d-inline-block pb-2"},l.createElement(Mc,{svgName:Dc.Plus,size:Nc.Small}),l.createElement("span",null,"New Backbone Audience")),l.createElement("div",{className:"border-top pt-1"},l.createElement("ul",{className:"list-unstyled"},r&&r.map((function(e){return l.createElement("li",{className:"position-relative py-1"},l.createElement(fu,{className:(null==t?void 0:t.toString())===e.id.toString()?"text-primary font-weight-500":"",appLink:o(e)},e.name))})))))}var Zg=function(e){return l.createElement("div",{className:"border rounded p-2 mb-3"},l.createElement("h6",{className:"border-bottom pb-1"},e.presentation.name),e.audiences&&e.audiences.length?l.createElement("ul",{className:"list-unstyled mb-0"},e.audiences.map((function(t){return l.createElement("li",{key:t.masterId,className:"py-1"},l.createElement(fu,{appLink:(n=e.presentation.id,r=t.masterId,{application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[n,r]})},t.name));var n,r}))):l.createElement("p",null,l.createElement("em",null,"There are no audiences mapped to this level in this presentation.")))},Qg=function(e){return l.createElement(l.Fragment,null,!!e.presentations&&!!e.audienceDictionary&&e.presentations.map((function(t){return l.createElement(Zg,{key:t.id,presentation:t,audiences:e.audienceDictionary[t.id]})})))};function Xg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return eS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tS(e){var t=e.levelId,n=Xg(l.useState({}),2),r=n[0];return function(e,t){var n=function(e){return yh(t,e)};hh(Qy.getLevelAudiencesFetchOptions(e,n("audiences")),[e]),hh(Qy.getPresentationsFetchOptions(n("presentations")),[])}(t,n[1]),l.createElement(l.Fragment,null,l.createElement(Nv,{levelId:t,activeAction:i.Subjects.LEVEL_AUDIENCES}),l.createElement(Qg,{presentations:r.presentations,audienceDictionary:yp.a.groupBy(r.audiences,"presentationId")}))}function nS(e,t){return yh(e,t)}function rS(e){switch(e){case kh.Playlists:return i.Subjects.EDIT_LEVEL_PLAYLISTS;case kh.Series:return i.Subjects.EDIT_LEVEL_SERIES;case kh.Videos:return i.Subjects.EDIT_LEVEL_VIDEOS}}function iS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return aS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function aS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oS(e){var t=iS(l.useState({}),2),n=t[0],r=t[1],a=n.presentations,o=n.audiences,s=n.memberIds,f=n.membersWithAudiences,d=oe.useBasicFetch(Array.isArray(s)&&s.length?function(e,t){switch(e){case kh.Playlists:return zm(t);case kh.Series:return xg(t);case kh.Videos:return xb(t)}}(e.memberType,s):null),m=Hf(u.SUBJECT);function h(t){p.AppLinkHelper.trigger({application:c.SUBJECTS,action:e.action,args:[e.levelId],params:{presentationId:t}})}!function(e,t,n){var r=e.presentationId,i=e.levelId,a=e.memberType;hh(Qy.getPresentationsFetchOptions(nS(n,"presentations")),[]),hh(Qy.getLevelMemberIdsFetchOptions(i,a,nS(n,"memberIds")),[i,a]),hh(!!r&&Qy.getLevelAudiencesFetchOptions(i,nS(n,"audiences"),r,a),[i,a,r],!!r)}(e,0,r),function(e,t,n,r){var i=n.audiences;l.useEffect((function(){nS(r,"membersWithAudiences")(function(e,t,n){if(!t||!n)return;return t.map((function(t){return{id:t.id,name:t.name,audiences:n.map((function(n){return{id:n.masterId,selected:(r=t,i=n,!!i[e]&&!!i[e].data.filter((function(e){return e.id===r.id})).length)};var r,i}))}}))}(t.memberType,e,i))}),[e,i])}(d.data,e,n,r),l.useEffect((function(){!e.presentationId&&(null==a?void 0:a.length)&&h(yp.a.first(a).id)}),[e.presentationId]);var y,v,b=!!e.presentationId&&!!o;return l.createElement(l.Fragment,null,l.createElement(Nv,{levelId:e.levelId,presentationId:e.presentationId,activeAction:rS(e.memberType)}),l.createElement(ki.Alert,{variant:"info",className:"m-0"},"Select which ".concat(e.memberType," are shown for each audience in this level.")+" Change the selected presentation to view different audiences."),l.createElement("div",{className:"w-50 py-2"},!!a&&l.createElement(qv,{presentations:a,currentPresentationId:e.presentationId,setCurrentPresentation:function(e){return h(e.id)}})),b&&l.createElement(Bv,{members:f||[],memberType:e.memberType,getMemberAppLink:function(t){return Kh.getMemberAppLink(e.memberType,t)},getActions:function(t){return Kh.getMemberActions(e.levelId,jh.Level,e.memberType,t)},audiences:o,getAudienceAppLink:e.presentationId&&(y=e.memberType,v=e.presentationId,function(e){var t,n=c.SUBJECTS,r=[v,e];switch(y){case kh.Playlists:t=i.Subjects.EDIT_AUDIENCE_PLAYLISTS;break;case kh.Series:t=i.Subjects.EDIT_AUDIENCE_SERIES;break;case kh.Videos:t=i.Subjects.EDIT_AUDIENCE_VIDEOS}return{application:n,action:t,args:r}}),onToggleAudience:function(t,n,r){return function(e,t,n,r,i,a,o){(o?e.addObjectsToAudience.bind(e):e.removeObjectsFromAudience.bind(e))(a,n,t,r,i)}(m,e.memberType,r?[r]:s,e.levelId,e.presentationId,t,n)}}))}function cS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return sS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uS(e){var t=cS(l.useState(),2),n=t[0],r=t[1],i=cS(l.useState(!1),2),a=i[0],o=i[1],c=oe.useBasicFetch(function(e,t){switch(e){case kh.Playlists:return Bm(t);case kh.Series:return Pg(t);case kh.Videos:return Pb(t)}}(e.memberType,e.memberId)),s=Hf(u.SUBJECT);hh(Qy.getLevelFetchOptions(e.levelId,r),[e.levelId]);var f=!!n&&!!c.data,p="Remove ".concat(El(Kh.singularizeMemberType(e.memberType)));return l.createElement(rp,{title:p,closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,c.data.name)," from ",l.createElement("strong",null,n.name),"?"),l.createElement("p",null,"Please ensure that it is not in any audiences before removing.")),l.createElement(ap,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){o(!0),s.removeObjectsFromLevel(e.levelId,[e.memberId],e.memberType,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(Kh.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function lS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pS(e){var t=e.id,n=lS(l.useState(),2),r=n[0],i=n[1],a=Hf(u.SUBJECT);hh(Qy.getPresentationFetchOptions(t,i),[t]);var o={presentation:r,savePresentation:function(e,n){a.updatePresentation(t,e,n,n)}},c=gl(o);return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Edit Presentation"),!!c&&l.createElement(Hv,Object.assign({},o)))}function dS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return mS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var hS=function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_PRESENTATION,args:[e.id]}},yS={application:c.SUBJECTS,action:i.Subjects.NEW_PRESENTATION};function vS(){var e=dS(l.useState(),2),t=e[0],n=e[1];return hh(Qy.getPresentationsFetchOptions(n),[]),l.createElement("div",null,l.createElement("div",{className:"d-flex justify-content-between mb-2"},l.createElement("h5",{className:"d-inline-block m-0"},"Select a presentation to edit:"),l.createElement(fu,{appLink:yS,className:"d-block"},l.createElement(Mc,{svgName:Dc.Plus,size:Nc.Small}),l.createElement("span",null,"New Presentation"))),l.createElement(yl,{objects:t,getAppLink:hS}))}function bS(){var e=Hf(u.SUBJECT);return l.createElement(l.Fragment,null,l.createElement("h4",{className:"py-2"},"Create New Presentation"),l.createElement(Hv,{savePresentation:function(t,n){e.createPresentation(t,(function(e){n(),e&&e.id&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_PRESENTATION,args:[e.id]})}),n)}}))}function gS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return SS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return SS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function SS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ES(e){var t=e.objectType,n=e.getAppLink,r=gS(l.useState(),2),i=r[0],a=r[1];return hh(Qy.getPresentationsFetchOptions(a),[]),l.createElement("div",null,l.createElement("h5",null,l.createElement(us,{namespace:"subjects.selectPresentation",phrase:"heading",options:{objectType:t}})),l.createElement(yl,{objects:i,getAppLink:n}))}function OS(e,t){return yh(e,t)}function CS(e,t,n,r,a){var o=r.selectedSubject,s=function(){return OS(a,"showConfirmationPopup")(!1)};t.addObjectsToSubject(o.id,e.map((function(e){return e.id})),n.memberType,r.addToClassifications,(function(){s(),p.AppLinkHelper.trigger(function(e,t){var n={application:c.SUBJECTS,args:[e]};switch(t){case Ih.Playlists:return Object.assign(Object.assign({},n),{action:i.Subjects.EDIT_SUBJECT_PLAYLISTS});case Ih.Series:return Object.assign(Object.assign({},n),{action:i.Subjects.EDIT_SUBJECT_SERIES});case Ih.Videos:return Object.assign(Object.assign({},n),{action:i.Subjects.EDIT_SUBJECT_VIDEOS})}}(o.id,n.memberType))}),s)}function AS(e,t,n){if(t&&n){var r=1===t.length?"this ".concat(Bh.singularizeMemberType(e)):"these ".concat(e);return"Add ".concat(r," to ").concat(n.name)}}function wS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return jS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function IS(e,t){return function(n,r,i){i(),OS(t,"selectedSubject")(Al.find(e.subjectTree,yp.a.first(n))),OS(t,"addToClassifications")(r),OS(t,"showConfirmationPopup")(!0)}}function kS(e){var t=wS(l.useState({}),2),n=t[0],r=t[1],i=oe.useBasicFetch(function(e,t){switch(e){case Ih.Playlists:return zm(t);case Ih.Series:return xg(t);case Ih.Videos:return xb(t)}}(e.memberType,e.objectIds)),a=Hf(u.SUBJECT);!function(e,t){hh(Qy.getSubjectTreeFetchOptions(OS(t,"subjectTree")),[])}(0,r);var o;return l.createElement(l.Fragment,null,!!i.data&&!!n.subjectTree&&l.createElement(Jv,{memberType:e.memberType,objects:i.data,subjectTree:n.subjectTree,onClickAddToSubject:IS(n,r)}),n.showConfirmationPopup&&l.createElement(up,{title:AS(e.memberType,i.data,n.selectedSubject),onClickConfirm:function(){return CS(i.data,a,e,n,r)},closePopup:function(){return e=!1,OS(r,"showConfirmationPopup")(e);var e}},l.createElement("p",null,"The following ".concat(e.memberType," will be added to "),l.createElement("strong",null,n.selectedSubject.name),n.addToClassifications?" and its mapped classifications:":":"),l.createElement("ul",null,i.data.map((function(e){return l.createElement("li",{key:e.id},e.name)}))),!n.addToClassifications&&l.createElement("p",null,"".concat(1===i.data.length?"It":"They"," will not be added to its mapped classifications.")),l.createElement("p",null,"".concat((o=e.memberType,El(Bh.singularizeMemberType(o)))," to classification mappings can be managed from the "),l.createElement("strong",null,"Edit Subject ".concat(El(e.memberType)," ")),"page.")))}function TS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return LS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return LS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function LS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _S(e){var t=e.subjectId,n=e.routeToOnDelete,r=e.closePopup,i=TS(l.useState(),2),a=i[0],o=i[1],c=TS(l.useState(!1),2),s=c[0],f=c[1];hh(Qy.getSubjectFetchOptions(t,o),[]);var d=Hf(u.SUBJECT),m=[{variant:"link",onClick:r,buttonText:"Cancel"},{variant:"danger",onClick:function(){f(!0);d.deleteSubject(t,(function(){r(),n&&p.AppLinkHelper.trigger(n)}),r)},buttonText:"Yes, delete this backbone classification",isSpinnerButton:!0,showSpinner:s}];return l.createElement(rp,{title:"Delete Subject",closePopup:r,showLoadingSpinner:!a},!!a&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,a.name),"?"),l.createElement("p",null,"Subjects that have mapped classifications cannot be deleted.")),l.createElement(ap,{buttons:m})))}function PS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return xS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NS(e){var t=e.subjectId,n=PS(l.useState(),2),r=n[0],a=n[1],o=PS(l.useState(),2),c=o[0],s=o[1],f=Hf(u.SUBJECT),p=Qy.getSubjectFetchOptions(t,a);hh(Qy.getSubjectTreeFetchOptions(s),[]),hh(p,[t]);return l.createElement(l.Fragment,null,l.createElement(eb,{subjectId:t,activeAction:i.Subjects.EDIT_SUBJECT}),!!r&&!!c&&l.createElement(Qv,{subject:r,subjectTree:c,saveSubject:function(e,n){return f.updateSubject(t,e,n,n)}}))}function RS(e,t){return yh(e,t)}function DS(e){switch(e){case Ih.Playlists:return i.Subjects.EDIT_SUBJECT_PLAYLISTS;case Ih.Series:return i.Subjects.EDIT_SUBJECT_SERIES;case Ih.Videos:return i.Subjects.EDIT_SUBJECT_VIDEOS}}function MS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return US(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return US(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function US(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function FS(e){var t=MS(l.useState({}),2),n=t[0],r=t[1],a=n.presentations,o=n.classifications,s=n.memberIds,f=n.membersWithClassifications,d=oe.useBasicFetch(Array.isArray(s)&&function(e,t){switch(e){case Ih.Playlists:return zm(t);case Ih.Series:return xg(t);case Ih.Videos:return xb(t)}}(e.memberType,s)),m=Hf(u.SUBJECT);function h(t){p.AppLinkHelper.trigger({application:c.SUBJECTS,action:e.action,args:[e.subjectId],params:{presentationId:t}})}!function(e,t,n){var r=e.subjectId,i=e.memberType,a=e.presentationId;hh(Qy.getPresentationsFetchOptions(RS(n,"presentations")),[]),hh(Qy.getSubjectMemberIdsFetchOptions(r,i,RS(n,"memberIds")),[r,i]),hh(!!a&&Qy.getSubjectClassificationFetchOptions(r,RS(n,"classifications"),a,i),[r,i,a],!!a)}(e,0,r),function(e,t,n,r){var i=n.classifications;l.useEffect((function(){RS(r,"membersWithClassifications")(function(e,t,n){if(!t||!n)return;return t.map((function(t){return{id:t.id,name:t.name,classifications:n.map((function(n){return{id:n.id,selected:(r=t,i=n,!!i[e]&&!!i[e].data.filter((function(e){return e.id===r.id})).length)};var r,i}))}}))}(t.memberType,e,i))}),[e,i])}(d.data,e,n,r),l.useEffect((function(){!e.presentationId&&(null==a?void 0:a.length)&&h(yp.a.first(a).id)}),[e.presentationId]);var y,v,b=!!e.presentationId&&!!o;return l.createElement(l.Fragment,null,l.createElement(eb,{subjectId:e.subjectId,presentationId:e.presentationId,activeAction:DS(e.memberType)}),l.createElement(ki.Alert,{variant:"info",className:"m-0"},"Select which ".concat(e.memberType," are shown for each classification in this backbone classification.")+" Change the selected presentation to view different classifications."),l.createElement("div",{className:"w-50 py-2"},!!a&&l.createElement(qv,{presentations:a,currentPresentationId:e.presentationId,setCurrentPresentation:function(e){return h(e.id)}})),b&&l.createElement(pb,{members:f||[],memberType:e.memberType,getMemberAppLink:function(t){return Bh.getMemberAppLink(e.memberType,t)},getActions:function(t){return Bh.getMemberActions(e.subjectId,jh.Subject,e.memberType,t)},classifications:o,getClassificationAppLink:e.presentationId&&(y=e.memberType,v=e.presentationId,function(e){var t,n=c.SUBJECTS,r=[v,e];switch(y){case Ih.Playlists:t=i.Subjects.EDIT_CLASSIFICATION_PLAYLISTS;break;case Ih.Series:t=i.Subjects.EDIT_CLASSIFICATION_SERIES;break;case Ih.Videos:t=i.Subjects.EDIT_CLASSIFICATION_VIDEOS}return{application:n,action:t,args:r}}),onToggleClassification:function(t,n,r){return function(e,t,n,r,i,a,o){(o?e.addObjectsToClassification.bind(e):e.removeObjectsFromClassification.bind(e))(a,n,t,r,i)}(m,e.memberType,r?[r]:s,e.subjectId,e.presentationId,t,n)}}))}function VS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return BS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return BS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function BS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zS(e){var t=e.parentId,n=VS(l.useState(),2),r=n[0],a=n[1],o=Hf(u.SUBJECT);hh(Qy.getSubjectTreeFetchOptions(a),[]);var s={application:c.SUBJECTS,action:i.Subjects.PRESENTATIONS};return l.createElement(l.Fragment,null,l.createElement("div",{className:"pb-2 border-bottom"},l.createElement(pu,{backToName:"Presentations",appLink:s})),l.createElement("h4",{className:"py-2"},"Create New Subject"),!!r&&l.createElement(Qv,{subject:{parentId:t},subjectTree:r,saveSubject:function(e,t){return o.createSubject(e,function(e){return function(t){e(),t&&t.id&&p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[t.id]})}}(t),t)}}))}function HS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function JS(e){var t=HS(l.useState(),2),n=t[0],r=t[1],i=HS(l.useState(!1),2),a=i[0],o=i[1],c=oe.useBasicFetch(function(e,t){switch(e){case Ih.Playlists:return Bm(t);case Ih.Series:return Pg(t);case Ih.Videos:return Pb(t)}}(e.memberType,e.memberId)),s=Hf(u.SUBJECT);hh(Qy.getSubjectFetchOptions(e.subjectId,r),[e.subjectId]);var f=!!n&&!!c.data,p="Remove ".concat(El(Bh.singularizeMemberType(e.memberType)));return l.createElement(rp,{title:p,closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,c.data.name)," from ",l.createElement("strong",null,n.name),"?"),l.createElement("p",null,"Please ensure that it is not in any classifications before removing.")),l.createElement(ap,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){o(!0),s.removeObjectsFromSubject(e.subjectId,[e.memberId],e.memberType,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(Bh.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function $S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return KS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return KS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function KS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function YS(e){var t=e.subjectId,n=$S(l.useState({}),2),r=n[0];return function(e,t){var n=function(e){return yh(t,e)};hh(Qy.getSubjectClassificationFetchOptions(e,n("classifications")),[e]),hh(Qy.getPresentationsFetchOptions(n("presentations")),[])}(t,n[1]),l.createElement(l.Fragment,null,l.createElement(eb,{subjectId:t,activeAction:i.Subjects.SUBJECT_CLASSIFICATIONS}),l.createElement(ab,{presentations:r.presentations,classificationDictionary:yp.a.groupBy(r.classifications,"presentationId")}))}var GS=n(217),WS=n.n(GS);function ZS(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return QS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return QS(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function QS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function XS(e){var t=e.selectedSubjectId,n=ZS(l.useState(),2),r=n[0],a=n[1];hh(Qy.getSubjectTreeFetchOptions(a),[]);var o=l.useCallback((function(e){return{application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[e.id]}}),[]),s={application:c.SUBJECTS,action:i.Subjects.NEW_SUBJECT},u=[{label:"Add child",getAppLink:function(e){return Object.assign(Object.assign({},s),{params:{parentId:e.id}})}},{label:"Delete backbone classification",getAppLink:function(e){return{application:c.SUBJECTS,action:i.Subjects.DELETE_SUBJECT,args:[e.id]}},className:"text-danger"}];return l.createElement("div",{className:"".concat(WS.a.navContainer," h-auto pr-2 border-right")},l.createElement("h5",{className:"border-bottom pb-2"},"Backbone Classifications"),l.createElement(fu,{appLink:s,className:"d-inline-block pb-2"},l.createElement(Mc,{svgName:Dc.Plus,size:Nc.Small}),l.createElement("span",null,"New Backbone Classification")),!!r&&l.createElement("div",{className:"border-top pt-1"},l.createElement(Nl,{tree:r,getAppLink:o,selectedIds:[t],actions:u})))}function eE(e){var t=e.currentAppLink;return l.createElement(db,{navItems:zh(),currentAppLink:t})}function tE(e){return(tE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function iE(e,t,n){return t&&rE(e.prototype,t),n&&rE(e,n),e}function aE(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oE(e,t)}function oE(e,t){return(oE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function cE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=uE(e);if(t){var i=uE(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return sE(this,n)}}function sE(e,t){return!t||"object"!==tE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function uE(e){return(uE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var lE=function(e){aE(n,e);var t=cE(n);function n(){return nE(this,n),t.apply(this,arguments)}return iE(n,[{key:"channelName",get:function(){return c.PLAYLISTS}},{key:"appRoutes",get:function(){return{"manage/playlists(/)":"index","manage/playlists/new(/)":"newPlaylist","manage/playlists/search(/)":"searchPlaylists","manage/playlists/:id(/)":"editPlaylist","manage/playlists/:id/videos(/)":"editPlaylistVideos","manage/playlists/:id/classifications(/)":"editPlaylistSubjects","manage/playlists/:id/audiences(/)":"editPlaylistAudiences"}}},{key:"appLinks",get:function(){return["deletePlaylist","removeVideo","uploadImage","removeFromSubject"]}}]),n}(p.AppRouter),fE=function(e){aE(n,e);var t=cE(n);function n(){return nE(this,n),t.apply(this,arguments)}return iE(n,[{key:"initialize",value:function(){var e=this;Ci.a.values(u).forEach((function(t){return zf.getInstance(t,e)}))}},{key:"name",get:function(){return"Playlists Application"}},{key:"channelName",get:function(){return c.PLAYLISTS}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT,options:{provider:Dm}}}},{key:"index",value:function(e){this.layout.showChildView(k,l.createElement(qb,{cursor:null==e?void 0:e.cursor}))}},{key:"searchPlaylists",value:function(e){this.layout.showChildView(k,l.createElement(Kb,{query:null==e?void 0:e.query,cursor:null==e?void 0:e.cursor}))}},{key:"newPlaylist",value:function(){this.layout.showChildView(k,l.createElement(Lb,null))}},{key:"editPlaylist",value:function(e){this.layout.showChildView(k,l.createElement(rh,{key:e,playlistId:e}))}},{key:"editPlaylistVideos",value:function(e){this.layout.showChildView(k,l.createElement(Tb,{key:e,playlistId:e}))}},{key:"editPlaylistSubjects",value:function(e){this.layout.showChildView(k,l.createElement(Ob,{key:e,playlistId:e}))}},{key:"editPlaylistAudiences",value:function(e){this.layout.showChildView(k,l.createElement(vb,{key:e,playlistId:e}))}},{key:"deletePlaylist",value:function(e){var t=Object.assign({playlistId:e},this.getPopupProps());this.layout.showChildView(T,l.createElement(Zm,Object.assign({},t)))}},{key:"removeVideo",value:function(e,t){var n=Object.assign({playlistId:e,videoId:t},this.getPopupProps());this.layout.showChildView(T,l.createElement(Ub,Object.assign({},n)))}},{key:"removeFromSubject",value:function(e,t){var n=Object.assign({subjectId:t,memberId:e,memberType:Ih.Playlists},this.getPopupProps());this.layout.showChildView(T,l.createElement(JS,Object.assign({},n)))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(T,l.createElement(Rm,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return tu.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(L,l.createElement(ad,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return lE}}]),n}(p.Application),pE=function(e){var t=e.children;return l.createElement(Du,null,t)},dE=function(){return{url:"/api/domain/v2/me/ratings",key:"ratings"}},mE=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:ji.string().trim().max(350,"Description is too long").default(""),rating:ji.object().shape({id:ji.string()}).default({}).noUnknown(),tallPoster:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown(),banner:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown()}).noUnknown(),hE=function(e,t){var n=c.SERIES,r=i.Series,a=[{label:"Edit Series Details",appLink:{application:n,action:r.EDIT_SERIES,args:[t]}},{label:"Videos",appLink:{application:n,action:r.EDIT_SERIES_VIDEOS,args:[t]}}];return Lp(e)&&a.push.apply(a,[{label:"Backbone Classifications",appLink:{application:n,action:r.EDIT_SERIES_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_SERIES_AUDIENCES,args:[t]}}]),a};function yE(e){var t=ci(),n=qc(t);return l.createElement(vi,null,l.createElement(Bc,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this series",autoFocus:!0}),l.createElement(Bc,{label:"Description",as:"textarea",name:"description",id:"description",maxLength:350,value:t.values.description,placeholder:"Describe this series here",showCharacterCounter:!0}),l.createElement(vl,{ratings:e.ratings}),l.createElement(Xu,{imageType:yu.TallPosters,fieldName:"tallPoster",application:c.SERIES,uploadAction:i.Series.UPLOAD_IMAGE}),l.createElement(Xu,{imageType:yu.Banners,fieldName:"banner",application:c.SERIES,uploadAction:i.Playlists.UPLOAD_IMAGE}),l.createElement("div",{className:"d-flex justify-content-between align-items-center"},l.createElement(sf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.id?"Save":"Create"),!!e.actions&&l.createElement(pl,{actions:e.actions})))}function vE(e){return l.createElement(wi,{initialValues:e.series,validationSchema:mE,onSubmit:e.saveSeries},l.createElement(yE,{id:e.series&&e.series.id,ratings:e.ratings}))}function bE(e){return l.createElement("div",{className:"py-2"},l.createElement(jl,{tabs:hE(e.currentUser,e.seriesId),isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}));var t}function gE(e){var t,n=Object(v.useDispatch)(),r=tp(),a=oe.useBasicFetch(Pg(e.seriesId)),o=oe.useBasicFetch(dE()),s=oe.useBasicFetch(hp());return l.createElement(l.Fragment,null,!!s.data&&l.createElement(bE,{seriesId:e.seriesId,activeAction:i.Series.EDIT_SERIES,currentUser:s.data}),!!a.data&&!!o.data&&l.createElement(vE,{series:a.data,saveSeries:function(t,i){oe.fetch(n,Rg(e.seriesId,t,(function(){r.success("Successfully updated series.")}),(function(){r.error("Failed to update series.")}),i))},ratings:o.data}),l.createElement("div",{className:"py-3 text-right"},"Can't find what you're looking for? Try the old edit series page ",l.createElement(fu,{className:"info-link",appLink:(t=e.seriesId,{application:c.SERIES,action:i.Series.LEGACY_EDIT_SERIES,args:[t]})},"here"),"."))}function SE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return EE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return EE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function EE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function OE(e){var t=SE(l.useState({}),2),n=t[0],r=t[1],a=oe.useBasicFetch(Pg(e.seriesId)),o=oe.useBasicFetch(hp()),c=Hf(u.SUBJECT);!function(e,t,n){var r=function(e){return yh(n,e)};hh(Qy.getObjectLevelsFetchOptions(e,Ih.Series,r("seriesLevels")),[e]),hh(Qy.getObjectAudiencesFetchOptions(e,Ih.Series,r("seriesAudiences")),[e,t.seriesLevels]),lh([Qy.getPresentationsFetchOptions(r("presentations")),Qy.getLevelsFetchOptions(r("levels"))],[]),hh(!!t.currentPresentation&&Qy.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.seriesId,n,r),mb(n,r);var s=!!(n.presentations&&n.levels&&n.presentationAudiences&&n.seriesLevels&&n.seriesAudiences);return l.createElement(l.Fragment,null,!!o.data&&l.createElement(bE,{seriesId:e.seriesId,activeAction:i.Series.EDIT_SERIES_AUDIENCES,currentUser:o.data}),l.createElement(dl,{object:a.data}),!!s&&l.createElement(cv,{objectLevels:n.seriesLevels,objectAudiences:n.seriesAudiences,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:yh(r,"currentPresentation"),levels:n.levels,presentationAudiences:n.presentationAudiences,memberType:Ih.Series,saveLevels:function(t,n,r){return c.updateObjectLevels(e.seriesId,t,Ih.Series,n,r,r)},saveAudiences:function(t,r){return c.updateObjectAudiences(e.seriesId,n.currentPresentation.id,t,Ih.Series,r,r)}}))}function CE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||wE(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function AE(e){return function(e){if(Array.isArray(e))return jE(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||wE(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wE(e,t){if(e){if("string"==typeof e)return jE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jE(e,t):void 0}}function jE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function IE(e){var t=CE(l.useState({}),2),n=t[0],r=t[1],a=oe.useBasicFetch(Pg(e.seriesId)),o=oe.useBasicFetch(hp()),c=Hf(u.SUBJECT);!function(e,t,n){var r=function(e){return yh(n,e)};lh([Qy.getSubjectTreeFetchOptions(r("subjectTree")),Qy.getPresentationsFetchOptions(r("presentations"))],[]),hh(Qy.getObjectSubjectsFetchOptions(e,Ih.Series,r("seriesSubjects")),[e]),hh(!!t.currentPresentation&&Qy.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),l.useEffect((function(){return r("subjectClassifications")([])}),[t.seriesSubjects]);var i=function(e,t){return[].concat(AE(t.subjectClassifications||[]),AE(e))},a=t.seriesSubjects&&t.seriesSubjects.map((function(e){return Qy.getSubjectClassificationFetchOptions(e.id,yh(n,"subjectClassifications",i))}));lh(a,[t.seriesSubjects],!!a),hh(Qy.getObjectClassificationsFetchOptions(e,Ih.Series,r("seriesClassifications")),[e,t.seriesSubjects])}(e.seriesId,n,r),mb(n,r);var s=!!(n.seriesSubjects&&n.subjectTree&&n.presentations&&n.classificationTree&&n.seriesClassifications&&n.subjectClassifications);return l.createElement(l.Fragment,null,!!o.data&&l.createElement(bE,{seriesId:e.seriesId,activeAction:i.Series.EDIT_SERIES_SUBJECTS,currentUser:o.data}),l.createElement(dl,{object:a.data}),s&&l.createElement(Yv,{objectSubjects:n.seriesSubjects,subjectTree:n.subjectTree,memberType:Ih.Series,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:yh(r,"currentPresentation"),objectClassifications:n.seriesClassifications,objectSubjectClassifications:n.subjectClassifications,classificationTree:n.classificationTree,saveSubjects:function(t,n,r){return c.updateObjectSubjects(e.seriesId,t,Ih.Series,n,r,r)},saveClassifications:function(t,r){return c.updateObjectClassifications(e.seriesId,n.currentPresentation.id,t,Ih.Series,r,r)}}))}function kE(){var e=Object(v.useDispatch)(),t=tp(),n=oe.useBasicFetch(dE());return l.createElement(l.Fragment,null,!!n.data&&l.createElement(vE,{saveSeries:function(n,r){var a=function(){t.error("Failed to create series.")},o=function(e){t.success("Successfully created series."),function(e){p.AppLinkHelper.trigger({application:c.SERIES,action:i.Series.EDIT_SERIES,args:[e.id]})}(e)};oe.fetch(e,Ng(n,(function(t){var n={permissions:kp()};oe.fetch(e,Rg(t.id,n,o,a,r))}),a))},ratings:n.data}))}function TE(e){return(TE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function LE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function PE(e,t,n){return t&&_E(e.prototype,t),n&&_E(e,n),e}function xE(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&NE(e,t)}function NE(e,t){return(NE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function RE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ME(e);if(t){var i=ME(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return DE(this,n)}}function DE(e,t){return!t||"object"!==TE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ME(e){return(ME=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var UE=function(e){xE(n,e);var t=RE(n);function n(){return LE(this,n),t.apply(this,arguments)}return PE(n,[{key:"channelName",get:function(){return c.SERIES}},{key:"appRoutes",get:function(){return{"manage/series/new(/)":"newSeries","manage/series/:id(/)":"editSeries","manage/series/:id/videos(/)":"editSeriesVideos","manage/series/:id/classifications(/)":"editSeriesSubjects","manage/series/:id/audiences(/)":"editSeriesAudiences","manage/legacy/series/:id(/)":"legacyEditSeries"}}},{key:"appLinks",get:function(){return["uploadImage"]}}]),n}(p.AppRouter),FE=function(e){xE(n,e);var t=RE(n);function n(){return LE(this,n),t.apply(this,arguments)}return PE(n,[{key:"initialize",value:function(){var e=this;Ci.a.values(u).forEach((function(t){return zf.getInstance(t,e)}))}},{key:"name",get:function(){return"Series Application"}},{key:"channelName",get:function(){return c.SERIES}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT,options:{provider:pE}}}},{key:"newSeries",value:function(){this.layout.showChildView(k,l.createElement(kE,null))}},{key:"editSeries",value:function(e){this.layout.showChildView(k,l.createElement(gE,{seriesId:e}))}},{key:"editSeriesVideos",value:function(e){this.legacyEditSeries(e)}},{key:"editSeriesSubjects",value:function(e){this.layout.showChildView(k,l.createElement(IE,{seriesId:e}))}},{key:"editSeriesAudiences",value:function(e){this.layout.showChildView(k,l.createElement(OE,{seriesId:e}))}},{key:"legacyEditSeries",value:function(e){p.LocationUtils.Redirect("/manage/legacy/series/".concat(e),!0)}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(T,l.createElement(Rm,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return tu.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(L,l.createElement(ad,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return UE}}]),n}(p.Application);function VE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return BE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return BE(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function BE(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zE(e){var t=VE(l.useState(),2),n=t[0],r=t[1],i=VE(l.useState(!1),2),a=i[0],o=i[1],c=oe.useBasicFetch(function(e,t){switch(e){case kh.Playlists:return Bm(t);case kh.Series:return Pg(t);case kh.Videos:return Pb(t)}}(e.memberType,e.memberId)),s=Hf(u.SUBJECT);hh(Qy.getAudienceFetchOptions(e.audienceId,r),[e.audienceId]);var f=!!n&&!!c.data,p="Remove ".concat(El(Kh.singularizeMemberType(e.memberType)));return l.createElement(rp,{title:p,closePopup:e.closePopup,showLoadingSpinner:!f},f&&l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("p",null,"Are you sure you want to remove ",l.createElement("strong",null,c.data.name)," from ",l.createElement("strong",null,n.name),"?"),l.createElement("p",null,"This will not remove it from the backbone level.")),l.createElement(ap,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){o(!0),s.removeObjectsFromAudience(e.audienceId,[e.memberId],e.memberType,null,null,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(Kh.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function HE(e){return(HE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $E(e,t,n){return t&&JE(e.prototype,t),n&&JE(e,n),e}function KE(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&YE(e,t)}function YE(e,t){return(YE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function GE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ZE(e);if(t){var i=ZE(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return WE(this,n)}}function WE(e,t){return!t||"object"!==HE(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ZE(e){return(ZE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var QE,XE=function(e){KE(n,e);var t=GE(n);function n(){return qE(this,n),t.apply(this,arguments)}return $E(n,[{key:"channelName",get:function(){return c.SUBJECTS}},{key:"appRoutes",get:function(){return{"manage/subjects(/)":"subjects","manage/subjects/add-objects(/)":"addSubjectMembers","manage/subjects/new(/)":"newSubject","manage/subjects/:id/edit(/)":"editSubject","manage/subjects/:id/edit/playlists(/)":"editSubjectPlaylists","manage/subjects/:id/edit/series(/)":"editSubjectSeries","manage/subjects/:id/edit/videos(/)":"editSubjectVideos","manage/subjects/:id/classifications(/)":"subjectClassifications","manage/subjects/classifications(/)":"classifications","manage/subjects/presentations/:id/classifications(/)":"presentationClassifications","manage/subjects/presentations/:id/classifications/new(/)":"newClassification","manage/subjects/presentations/:id/classifications/:id/edit(/)":"editClassification","manage/subjects/presentations/:id/classifications/:id/edit/playlists(/)":"editClassificationPlaylists","manage/subjects/presentations/:id/classifications/:id/edit/series(/)":"editClassificationSeries","manage/subjects/presentations/:id/classifications/:id/edit/videos(/)":"editClassificationVideos","manage/subjects/levels(/)":"levels","manage/subjects/levels/new(/)":"newLevel","manage/subjects/levels/:id(/)":"level","manage/subjects/levels/:id/edit(/)":"editLevel","manage/subjects/levels/:id/edit/playlists(/)":"editLevelPlaylists","manage/subjects/levels/:id/edit/series(/)":"editLevelSeries","manage/subjects/levels/:id/edit/videos(/)":"editLevelVideos","manage/subjects/levels/:id/audiences(/)":"levelAudiences","manage/subjects/audiences(/)":"audiences","manage/subjects/presentations/:id/audiences(/)":"presentationAudiences","manage/subjects/presentations/:id/audiences/new(/)":"newAudience","manage/subjects/presentations/:id/audiences/:id/edit(/)":"editAudience","manage/subjects/presentations/:id/audiences/:id/edit/playlists(/)":"editAudiencePlaylists","manage/subjects/presentations/:id/audiences/:id/edit/series(/)":"editAudienceSeries","manage/subjects/presentations/:id/audiences/:id/edit/videos(/)":"editAudienceVideos","manage/subjects/presentations(/)":"presentations","manage/subjects/presentations/new":"newPresentation","manage/subjects/presentations/:id(/)":"editPresentation"}}},{key:"appLinks",get:function(){return["deleteClassification","removeClassificationMember","deleteSubject","removeSubjectMember","deleteAudience","removeLevelMember","removeAudienceMember","uploadImage"]}}]),n}(p.AppRouter),eO=function(e){KE(n,e);var t=GE(n);function n(){return qE(this,n),t.apply(this,arguments)}return $E(n,[{key:"initialize",value:function(){var e=this;this.subjectDataService=zf.getInstance(u.SUBJECT,this),Ci.a.values(u).forEach((function(t){return zf.getInstance(t,e)}))}},{key:"name",get:function(){return"Subjects Application"}},{key:"channelName",get:function(){return c.SUBJECTS}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT,options:{provider:Du,getTopNavView:this.getTopNav}}}},{key:"subjects",value:function(){this.subjectDataService.getSubjectTree((function(e){var t=!!e.children&&e.children[0];t?p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_SUBJECT,args:[t.id]},{replace:!0}):p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.NEW_SUBJECT},{replace:!0})}))}},{key:"newSubject",value:function(e){var t={parentId:e.parentId};this.layout.showChildView(k,l.createElement(zS,Object.assign({key:e.parentId},t))),this.renderSubjectsLeftNav()}},{key:"editSubject",value:function(e){this.layout.showChildView(k,l.createElement(NS,{key:e,subjectId:e})),this.renderSubjectsLeftNav(e)}},{key:"editSubjectPlaylists",value:function(e,t){var n={subjectId:e,memberType:Ih.Playlists,action:i.Subjects.EDIT_SUBJECT_PLAYLISTS,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(k,l.createElement(FS,Object.assign({key:"".concat(e,":playlists")},n))),this.renderSubjectsLeftNav(e)}},{key:"editSubjectSeries",value:function(e,t){var n={subjectId:e,memberType:Ih.Series,action:i.Subjects.EDIT_SUBJECT_SERIES,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(k,l.createElement(FS,Object.assign({key:"".concat(e,":series")},n))),this.renderSubjectsLeftNav(e)}},{key:"editSubjectVideos",value:function(e,t){var n={subjectId:e,memberType:Ih.Videos,action:i.Subjects.EDIT_SUBJECT_VIDEOS,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(k,l.createElement(FS,Object.assign({key:"".concat(e,":videos")},n))),this.renderSubjectsLeftNav(e)}},{key:"subjectClassifications",value:function(e){this.layout.showChildView(k,l.createElement(YS,{key:e,subjectId:e})),this.renderSubjectsLeftNav(e)}},{key:"addSubjectMembers",value:function(e){var t=e.memberType,n=e.objectIds;if(t&&n){var r={memberType:t,objectIds:Array.isArray(n)?n:[n]};this.layout.showChildView(k,l.createElement(kS,Object.assign({},r))),this.hideLeftNav()}}},{key:"removeSubjectMember",value:function(e,t,n){var r=Object.assign({subjectId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(T,l.createElement(JS,Object.assign({},r)))}},{key:"deleteSubject",value:function(e){var t=e.toString()===this.currentLeftNavId.toString()?{application:c.SUBJECTS,action:i.Subjects.NEW_SUBJECT}:null,n=Object.assign({subjectId:e,routeToOnDelete:t||null},this.getPopupProps());this.layout.showChildView(T,l.createElement(_S,Object.assign({},n)))}},{key:"classifications",value:function(){var e={objectType:"classifications",getAppLink:function(e){return{application:c.SUBJECTS,action:i.Subjects.PRESENTATION_CLASSIFICATIONS,args:[e.id]}}};this.layout.showChildView(k,l.createElement(ES,Object.assign({},e))),this.hideLeftNav()}},{key:"presentationClassifications",value:function(e){this.subjectDataService.getClassificationTree(e,(function(t){var n=!!t.children&&t.children[0];n?p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_CLASSIFICATION,args:[e,n.id]},{replace:!0}):p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.NEW_CLASSIFICATION,args:[e]},{replace:!0})}))}},{key:"newClassification",value:function(e,t){var n={presentationId:e,parentId:t.parentId};this.layout.showChildView(k,l.createElement(_g,Object.assign({key:t.parentId},n))),this.renderClassificationLeftNav(e)}},{key:"editClassification",value:function(e,t){var n={presentationId:e,classificationId:t};this.layout.showChildView(k,l.createElement(wg,Object.assign({key:t},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationPlaylists",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:Ih.Playlists};this.layout.showChildView(k,l.createElement(kg,Object.assign({key:"".concat(t,":playlists")},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationSeries",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:Ih.Series};this.layout.showChildView(k,l.createElement(kg,Object.assign({key:"".concat(t,":series")},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationVideos",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:Ih.Videos};this.layout.showChildView(k,l.createElement(kg,Object.assign({key:"".concat(t,":videos")},n))),this.renderClassificationLeftNav(e,t)}},{key:"removeClassificationMember",value:function(e,t,n){var r=Object.assign({classificationId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(T,l.createElement(Ug,Object.assign({},r)))}},{key:"deleteClassification",value:function(e,t){var n=t===this.currentLeftNavId?{application:c.SUBJECTS,action:i.Subjects.NEW_CLASSIFICATION,args:[e]}:null,r=Object.assign({classificationId:t,routeToOnDelete:n||null},this.getPopupProps());this.layout.showChildView(T,l.createElement(Og,Object.assign({},r)))}},{key:"levels",value:function(){this.layout.showChildView(k,l.createElement(qg,null)),this.renderLevelsLeftNav()}},{key:"newLevel",value:function(){this.layout.showChildView(k,l.createElement(Jg,null)),this.renderLevelsLeftNav()}},{key:"level",value:function(e){p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_LEVEL,args:[e]},{replace:!0})}},{key:"editLevel",value:function(e){this.layout.showChildView(k,l.createElement(Bg,{key:e,id:e})),this.renderLevelsLeftNav(e)}},{key:"levelAudiences",value:function(e){this.layout.showChildView(k,l.createElement(tS,{key:e,levelId:e})),this.renderLevelsLeftNav(e)}},{key:"editLevelPlaylists",value:function(e,t){var n={levelId:e,memberType:kh.Playlists,action:i.Subjects.EDIT_LEVEL_PLAYLISTS,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(k,l.createElement(oS,Object.assign({key:"".concat(e,":playlists")},n))),this.renderLevelsLeftNav(e)}},{key:"editLevelSeries",value:function(e,t){var n={levelId:e,memberType:kh.Series,action:i.Subjects.EDIT_LEVEL_SERIES,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(k,l.createElement(oS,Object.assign({key:"".concat(e,":series")},n))),this.renderLevelsLeftNav(e)}},{key:"editLevelVideos",value:function(e,t){var n={levelId:e,memberType:kh.Videos,action:i.Subjects.EDIT_LEVEL_VIDEOS,presentationId:null==t?void 0:t.presentationId};this.layout.showChildView(k,l.createElement(oS,Object.assign({key:"".concat(e,":videos")},n))),this.renderLevelsLeftNav(e)}},{key:"removeLevelMember",value:function(e,t,n){var r=Object.assign({levelId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(T,l.createElement(uS,Object.assign({},r)))}},{key:"audiences",value:function(){var e={objectType:"audiences",getAppLink:function(e){return{application:c.SUBJECTS,action:i.Subjects.PRESENTATION_AUDIENCES,args:[e.id]}}};this.layout.showChildView(k,l.createElement(ES,Object.assign({},e))),this.hideLeftNav()}},{key:"removeAudienceMember",value:function(e,t,n){var r=Object.assign({audienceId:e,memberId:t,memberType:n},this.getPopupProps());this.layout.showChildView(T,l.createElement(zE,Object.assign({},r)))}},{key:"presentationAudiences",value:function(e){this.subjectDataService.getAudiences(e,(function(t){var n=!!t&&t[0];n?p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.EDIT_AUDIENCE,args:[e,n.masterId]},{replace:!0}):p.AppLinkHelper.trigger({application:c.SUBJECTS,action:i.Subjects.NEW_AUDIENCE,args:[e]},{replace:!0})}))}},{key:"newAudience",value:function(e){this.layout.showChildView(k,l.createElement(ig,{presentationId:e})),this.hideLeftNav()}},{key:"editAudience",value:function(e,t){var n={presentationId:e,audienceId:t};this.layout.showChildView(k,l.createElement(eg,Object.assign({key:t},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudiencePlaylists",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:kh.Playlists};this.layout.showChildView(k,l.createElement(pg,Object.assign({key:"".concat(t,":playlists")},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudienceSeries",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:kh.Series};this.layout.showChildView(k,l.createElement(pg,Object.assign({key:"".concat(t,":series")},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudienceVideos",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:kh.Videos};this.layout.showChildView(k,l.createElement(pg,Object.assign({key:"".concat(t,":videos")},n))),this.renderAudienceLeftNav(e,t)}},{key:"deleteAudience",value:function(e,t){var n={application:c.SUBJECTS,action:i.Subjects.PRESENTATION_AUDIENCES,args:[e]},r=Object.assign({id:t,routeToOnDelete:n},this.getPopupProps());this.layout.showChildView(T,l.createElement(Zb,Object.assign({},r)))}},{key:"presentations",value:function(){this.layout.showChildView(k,l.createElement(vS,null)),this.hideLeftNav()}},{key:"newPresentation",value:function(){this.layout.showChildView(k,l.createElement(bS,null))}},{key:"editPresentation",value:function(e){this.layout.showChildView(k,l.createElement(pS,{key:e,id:e})),this.hideLeftNav()}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(T,l.createElement(Rm,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return tu.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(L,l.createElement(ad,{alerts:n,removeAlert:r}))}},{key:"renderClassificationLeftNav",value:function(e,t){this.setCurrentLeftNavItem(t);var n={presentationId:e,selectedClassificationId:t};this.layout.showChildView(I,l.createElement(gg,Object.assign({},n)))}},{key:"renderSubjectsLeftNav",value:function(e){this.setCurrentLeftNavItem(e),this.layout.showChildView(I,l.createElement(XS,{selectedSubjectId:e}))}},{key:"renderAudienceLeftNav",value:function(e,t){this.setCurrentLeftNavItem(t);var n={presentationId:e,selectedAudienceId:t};this.layout.showChildView(I,l.createElement(ug,Object.assign({},n)))}},{key:"renderLevelsLeftNav",value:function(e){this.setCurrentLeftNavItem(e),this.layout.showChildView(I,l.createElement(Wg,{selectedLevelId:e}))}},{key:"setCurrentLeftNavItem",value:function(e){this.currentLeftNavId=e||null}},{key:"hideLeftNav",value:function(){this.setCurrentLeftNavItem(),this.layout.hideLeftNav()}},{key:"getTopNav",value:function(e){return l.createElement(eE,{currentAppLink:e})}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return XE}}]),n}(p.Application),tO=function(e){return{url:"/api/domain/v1/themes/".concat(e),key:"themes:".concat(e)}},nO=function(e){var t="/api/domain/v1/themes",n="themes";return e&&(t+="?type=".concat(e),n+=":type:".concat(e)),{url:t,key:n}},rO=function(e,t,n,r){return{url:"/api/domain/v1/themes",key:"theme",data:e,type:ce.a.POST,invalidationKeys:"themes",success:t,error:n,always:r}},iO=function(e,t,n,r,i){return{url:"/api/domain/v1/themes/".concat(e),key:"update:theme:".concat(e),data:t,type:ce.a.PUT,success:n,error:r,always:i}},aO=function(e,t,n,r){return{url:"/api/domain/v1/themes/".concat(e),key:"delete:theme:".concat(e),type:ce.a.DELETE,invalidationKeys:"themes",success:t,error:n,always:r}},oO=function(e){return{application:c.THEMES,action:i.Themes.EDIT_THEME,args:[e.id]}};function cO(){var e=oe.useBasicFetch(nO());return e.data?l.createElement(hl,{objects:e.data,getObjectAppLink:oO,newObjectAppLink:{application:c.THEMES,action:i.Themes.NEW_THEME},objectName:"Theme"}):l.createElement(l.Fragment,null)}!function(e){e.Glance="glance"}(QE||(QE={}));var sO=[{key:"topLeft",label:"Top Left"},{key:"topRight",label:"Top Right"},{key:"bottomLeft",label:"Bottom Left"},{key:"bottomRight",label:"Bottom Right"}];function uO(){var e=ci();return l.createElement("div",{className:"form-group"},sO.map((function(t){var n="data.".concat(t.key);return l.createElement(Xu,{label:t.label,imageType:yu.HeroBanners,fieldName:n,application:c.THEMES,uploadAction:i.Videos.UPLOAD_IMAGE,setSelectedImage:function(t){e.setFieldValue(n,{fileId:t.id,url:t.url,fileIdType:bu.ImageAPIv2})}})})))}var lO=ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown(),fO=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default(""),type:ji.mixed().required("Type is required"),data:ji.mixed().when("type",{is:QE.Glance,then:ji.object().shape({topLeft:lO,topRight:lO,bottomLeft:lO,bottomRight:lO}).noUnknown(),otherwise:ji.mixed().strip(!0)}).default({})}).noUnknown();function pO(e){var t=ci(),n=function(e){switch(e){case QE.Glance:return uO;default:return}}(t.values.type);return l.createElement(vi,null,l.createElement(Bc,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this theme",autoFocus:!0}),l.createElement(Bc,{as:"select",label:"Type",name:"type",id:"type",value:t.values.type},l.createElement("option",{value:null},"Select a type..."),Ci.a.getEnumKeys(QE).map((function(e){return l.createElement("option",{key:e,value:QE[e]},e)}))),!!n&&l.createElement(n,null),l.createElement("div",{className:"d-flex justify-content-between align-items-center"},l.createElement(ls,{isNew:e.isNew}),!!e.actions&&l.createElement(pl,{actions:e.actions})))}function dO(e){var t;return l.createElement(wi,{initialValues:e.theme,validationSchema:fO,onSubmit:e.saveTheme},l.createElement(pO,{isNew:!(null===(t=e.theme)||void 0===t?void 0:t.id),actions:e.actions}))}function mO(){var e=Object(v.useDispatch)();return l.createElement(dO,{saveTheme:function(t,n){oe.fetch(e,rO(t,(function(e){n(),p.AppLinkHelper.trigger({application:c.THEMES,action:i.Themes.EDIT_THEME,args:[e.id]})}),null,n))}})}function hO(e){var t=Object(v.useDispatch)(),n=tp(),r=oe.useBasicFetch(tO(e.id));return r.data?l.createElement(dO,{theme:r.data,saveTheme:function(r,i){oe.fetch(t,iO(e.id,r,(function(){n.success("Successfully updated theme")}),(function(){n.error("Failed to update theme")}),i))},actions:[{label:"Delete theme",className:"btn btn-danger",button:!0,appLink:{application:c.THEMES,action:i.Themes.DELETE_THEME,args:[e.id]}}]}):l.createElement(l.Fragment,null)}function yO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bO(e){var t=Object(v.useDispatch)(),n=tp(),r=yO(l.useState(!1),2),a=r[0],o=r[1],s=oe.useBasicFetch(tO(e.id));return l.createElement(rp,{title:"Delete Theme",closePopup:e.closePopup,showLoadingSpinner:!s.data},l.createElement(l.Fragment,null,l.createElement("p",null,"Are you sure you want to delete ",l.createElement("strong",null,s.data.name),"?"),l.createElement(ap,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){o(!0),oe.fetch(t,aO(e.id,(function(){n.success("Successfully deleted theme"),p.AppLinkHelper.trigger({application:c.THEMES,action:i.Themes.THEMES})}),(function(){n.error("Failed to delete theme")})))},buttonText:"Yes, delete this theme",isSpinnerButton:!0,showSpinner:a}]})))}var gO=function(e){var t=e.children;return l.createElement(Du,null,t)};function SO(e){return(SO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function EO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function CO(e,t,n){return t&&OO(e.prototype,t),n&&OO(e,n),e}function AO(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wO(e,t)}function wO(e,t){return(wO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function jO(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=kO(e);if(t){var i=kO(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return IO(this,n)}}function IO(e,t){return!t||"object"!==SO(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function kO(e){return(kO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var TO=function(e){AO(n,e);var t=jO(n);function n(){return EO(this,n),t.apply(this,arguments)}return CO(n,[{key:"channelName",get:function(){return c.THEMES}},{key:"appRoutes",get:function(){return{"manage/themes(/)":"themes","manage/themes/new(/)":"newTheme","manage/themes/:id(/)":"editTheme"}}},{key:"appLinks",get:function(){return["deleteTheme","uploadImage"]}}]),n}(p.AppRouter),LO=function(e){AO(n,e);var t=jO(n);function n(){return EO(this,n),t.apply(this,arguments)}return CO(n,[{key:"name",get:function(){return"Themes Application"}},{key:"channelName",get:function(){return c.THEMES}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT,options:{provider:gO}}}},{key:"themes",value:function(){this.layout.showChildView(k,l.createElement(cO,null))}},{key:"newTheme",value:function(){this.layout.showChildView(k,l.createElement(mO,null))}},{key:"editTheme",value:function(e){this.layout.showChildView(k,l.createElement(hO,{id:e}))}},{key:"deleteTheme",value:function(e){var t=this;this.layout.showChildView(T,l.createElement(bO,{id:e,closePopup:function(){return t.layout.closePopup()}}))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(T,l.createElement(Rm,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}}],[{key:"router",get:function(){return TO}}]),n}(Rf),_O=function(e){var t=e.children;return l.createElement(Du,null,t)},PO=function(e,t){var n=c.VIDEOS,r=i.Videos,a=[{label:"Edit Video Details",appLink:{application:n,action:r.EDIT_VIDEO,args:[t]}}];return Lp(e)?[].concat(a,[{label:"Backbone Classifications",appLink:{application:n,action:r.EDIT_VIDEO_SUBJECTS,args:[t]}},{label:"Audiences",appLink:{application:n,action:r.EDIT_VIDEO_AUDIENCES,args:[t]}},{label:"Aliases",appLink:{application:n,action:r.EDIT_VIDEO_ALIASES,args:[t]}}]):a};function xO(e){var t,n=PO(e.currentUser,e.videoId);return n.length<2?l.createElement(l.Fragment,null):l.createElement("div",{className:"py-2"},l.createElement(jl,{tabs:n,isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}))}var NO,RO,DO=ji.object().shape({name:ji.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:ji.string().trim().default(""),status:ji.mixed().required("Status is required"),productionYear:ji.number().min(1900),rating:ji.object().shape({id:ji.string()}).default({}).noUnknown(),thumbnail:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown(),heroBanner:ji.object().shape({fileId:ji.string(),fileIdType:ji.mixed(),url:ji.string()}).default({}).noUnknown(),glance:ji.object().shape({theme:ji.string(),format:ji.mixed(),content:ji.string(),type:ji.mixed()}).default({}).noUnknown()}).noUnknown();!function(e){e[e.Draft=0]="Draft",e[e.Published=1]="Published",e[e.Archived=2]="Archived",e[e.Pending=3]="Pending",e[e.Rejected=4]="Rejected",e[e.Processing=5]="Processing"}(NO||(NO={})),function(e){e.Markdown="text/markdown"}(RO||(RO={}));var MO=n(52),UO=n.n(MO),FO=n(31);function VO(e){return f.a.createElement("div",Object.assign({},e,{role:"button",tabIndex:0,className:"".concat(e.className?e.className:""," cursor-pointer"),onKeyDown:e.onKeyDown?e.onKeyDown:function(t){return"Enter"===t.key&&e.onClick(t)},onClick:e.onClick,style:e.style?e.style:{}}),e.children)}var BO=n(53),zO=n.n(BO);function HO(e){var t=e.tag,n=e.appLink,r=e.onClick,i=e.disabled,a=e.tagClass,o="badge-pill py-1 px-2 my-1 mr-1 clamp-1 text-nowrap ".concat(void 0===a?"tag":a);return!n&&!r||i||(o+=" cursor-pointer"),i&&(o+=" "+zO.a.disabled),n?f.a.createElement(fu,{onClick:r,appLink:n,className:o,title:t.name},t.name):f.a.createElement("span",{onClick:r,className:o,title:t.name},t.name)}function qO(e){var t=e.tags,n=e.getAppLink;return t&&t.data?f.a.createElement("div",{className:zO.a.tagList},t.data.map((function(e){var t=m(n)?n(e):null;return f.a.createElement(HO,{key:e.id,tag:e,appLink:t})}))):f.a.createElement(f.a.Fragment,null)}var JO=n(26),$O=n.n(JO);function KO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return YO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return YO(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function YO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var GO;function WO(e){var t,n,r,i=KO(l.useState(""),2),a=i[0],o=i[1];if(l.useEffect((function(){if(e.hasGlanceData){var t=MO(e.video.glance.content).split('a href="cv-tag://').join('a class="badge-pill tag mr-1 my-1 px-2 py-1" href="cv-tag://');o(t)}}),[null===(t=e.video.glance)||void 0===t?void 0:t.content]),!e.hasGlanceData&&e.hasDetails)return e.onClickShowDescription&&e.onClickShowDescription(),l.createElement(l.Fragment,null);return l.createElement("div",{className:"rounded border px-5 py-3 mb-3 position-relative d-flex justify-content-center ".concat($O.a.container," ").concat((r=null===(n=e.theme)||void 0===n?void 0:n.name.toLowerCase(),r===GO.Maths?$O.a.bgBlue:r===GO.English?$O.a.bgPink:r===GO.History?$O.a.bgYellow:$O.a.bgGreen))},l.createElement("div",{className:"".concat($O.a.content)},l.createElement("h2",{className:"h4"},l.createElement(us,{namespace:"shared.videoAtAGlance",phrase:"videoAtAGlance"})),e.hasDetails&&e.onClickShowDescription&&l.createElement(VO,{onClick:e.onClickShowDescription,className:"".concat($O.a.detailsBtn," position-absolute cursor-pointer mr-4 font-weight-500 text-info")},l.createElement(us,{namespace:"shared.videoAtAGlance",phrase:"readFullDescription"})),l.createElement("div",{className:"position-relative",onClick:function(t){t.preventDefault();var n=t.target.getAttribute("href");if(n)if(n.includes("cv-timestamp://")){var r=n.split("cv-timestamp://")[1];e.setStartTime&&e.setStartTime(FO.a.convertDurationToSeconds(r))}else if(n.includes("cv-tag://")&&e.getTagAppLink){var i=n.split("cv-tag://")[1];p.AppLinkHelper.trigger(e.getTagAppLink(i))}else;},dangerouslySetInnerHTML:{__html:a}}),function(){var t,n,r;return(null===(n=null===(t=e.video.tags)||void 0===t?void 0:t.data)||void 0===n?void 0:n.length)?l.createElement("div",{className:"py-1"},l.createElement(qO,{tags:null===(r=e.video)||void 0===r?void 0:r.tags,getAppLink:function(t){return e.getTagAppLink?e.getTagAppLink(t.name):null}})):l.createElement(l.Fragment,null)}(),l.createElement("div",{className:"mt-2"},e.hasCurriculumLinks&&e.onClickShowCurriculumLinks&&l.createElement(VO,{onClick:e.onClickShowCurriculumLinks,className:"cursor-pointer d-inline-block font-weight-500 text-info"},l.createElement(us,{namespace:"shared.videoAtAGlance",phrase:"seeCurriculumLinks"})))),function(){var t;return Ci.a.keys(null===(t=e.theme)||void 0===t?void 0:t.data).filter((function(t){var n;return!Ci.a.isEmpty(null===(n=e.theme)||void 0===n?void 0:n.data[t])})).map((function(t){var n,r,i,a;return l.createElement("div",{key:null===(r=null===(n=e.theme)||void 0===n?void 0:n.data[t])||void 0===r?void 0:r.fileId,className:"".concat($O.a[t]," ").concat($O.a.background),style:{backgroundImage:"url('".concat(Tu.createUrl(null===(a=null===(i=e.theme)||void 0===i?void 0:i.data[t])||void 0===a?void 0:a.url,{format:"png"}),"')")}})}))}())}function ZO(e){var t,n,r,i,a,o=ci(),c=e.themes.find((function(e){var t;return e.name===(null===(t=o.values.glance)||void 0===t?void 0:t.theme)})),s=(null===(t=o.values.glance)||void 0===t?void 0:t.format)===RO.Markdown&&(null===(n=o.values.glance)||void 0===n?void 0:n.content)&&c;return l.createElement("div",{className:"form-group p-2 border"},l.createElement("div",{className:"border-bottom mb-2"},l.createElement("label",null,"Video at a Glance")),l.createElement(Bc,{as:"select",label:"Theme",name:"glance.theme",id:"glance.theme",value:null===(r=o.values.glance)||void 0===r?void 0:r.theme},l.createElement("option",{value:null},"Select a theme..."),e.themes.map((function(e){return l.createElement("option",{key:e.id,value:e.name},e.name)}))),l.createElement(Bc,{as:"select",label:"Format",name:"glance.format",id:"glance.format",value:null===(i=o.values.glance)||void 0===i?void 0:i.format},l.createElement("option",{value:null},"Select a format..."),Ci.a.getEnumKeys(RO).map((function(e){return l.createElement("option",{key:e,value:RO[e]},e)}))),l.createElement(Bc,{label:"Content",as:"textarea",name:"glance.content",id:"glance.content",value:null===(a=o.values.glance)||void 0===a?void 0:a.content}),s&&l.createElement("div",{className:"form-group"},l.createElement("label",null,"Preview"),l.createElement(WO,{theme:c,video:{glance:o.values.glance,tags:e.tags},hasGlanceData:!0})))}function QO(e){switch(e){case NO.Published:return"badge-success";case NO.Archived:return"badge-danger";case NO.Draft:return"badge-warning";case NO.Pending:return"badge-info";case NO.Rejected:return"badge-dark";default:return"badge-secondary"}}function XO(e){var t=ci(),n=!!e.rightslineId,r=Lp(e.currentUser);return l.createElement(vi,null,n&&l.createElement(Bc,{label:"Rightsline ID",name:"rightslineId",id:"rightslineId",value:e.rightslineId,disabled:!0}),l.createElement(Bc,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this video",disabled:n,autoFocus:!0}),l.createElement("div",{className:"form-group"},l.createElement("label",null,"Status"),l.createElement("div",null,l.createElement("span",{className:"badge ".concat(QO(t.values.status))},NO[t.values.status]))),l.createElement(Bc,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this video here",disabled:n,showCharacterCounter:!0}),l.createElement(Bc,{label:"Production Year",type:"number",name:"productionYear",id:"productionYear",value:t.values.productionYear,disabled:n}),l.createElement(vl,{ratings:e.ratings,disabled:n}),l.createElement(Xu,{imageType:yu.Thumbnails,fieldName:"thumbnail",application:c.VIDEOS,uploadAction:i.Videos.UPLOAD_IMAGE}),l.createElement(Xu,{imageType:yu.HeroBanners,fieldName:"heroBanner",application:c.VIDEOS,uploadAction:i.Videos.UPLOAD_IMAGE}),r&&l.createElement(ZO,{themes:e.themes,tags:e.tags}),l.createElement(ls,{isNew:!e.id}))}function eC(e,t){if(e)return t?Object.assign(Object.assign({},e),t):e}function tC(e){var t;return l.createElement(wi,{initialValues:eC(e.video,e.rightslineVideo),validationSchema:DO,onSubmit:e.saveVideo,allowInitialSubmit:!!e.rightslineVideo},l.createElement(XO,{id:e.video&&e.video.id,ratings:e.ratings,themes:e.themes,tags:null===(t=e.video)||void 0===t?void 0:t.tags,currentUser:e.currentUser,rightslineId:e.rightslineId}))}function nC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return rC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rC(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function iC(e){var t,n=Object(v.useDispatch)(),r=nC(l.useState(!1),2),a=r[0],o=r[1],s=oe.useBasicFetch(Pb(e.videoId)),u=oe.useBasicFetch(Nb(e.videoId)),f=oe.useBasicFetch(dE()),p=oe.useBasicFetch(nO(QE.Glance)),d=oe.useBasicFetch(hp());var m,h=!!s.data&&!!f.data&&!!p.data&&!!d.data&&u.isComplete;return l.createElement(l.Fragment,null,!!d.data&&l.createElement(xO,{videoId:e.videoId,activeAction:i.Videos.EDIT_VIDEO,currentUser:d.data}),!!u.data&&l.createElement("div",{className:"pt-3 text-right"},l.createElement(ki.Button,{variant:"outline-dark",size:"sm",onClick:function(){u.isFetching||(o(!0),oe.fetch(n,Nb(e.videoId)))}},"Sync from Rightsline")),h&&l.createElement(tC,{video:s.data,saveVideo:function(t,r){oe.fetch(n,Rb(e.videoId,t,null,null,r))},ratings:f.data,themes:p.data,currentUser:d.data,rightslineId:null===(t=u.data)||void 0===t?void 0:t.rightslineId,rightslineVideo:a&&u.data}),l.createElement("div",{className:"py-3 text-right"},"Can't find what you're looking for? Try the old edit video page ",l.createElement(fu,{className:"info-link",appLink:(m=e.videoId,{application:c.VIDEOS,action:i.Videos.LEGACY_EDIT_VIDEO,args:[m]})},"here"),"."))}function aC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return oC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oC(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cC(e){var t=aC(l.useState({}),2),n=t[0],r=t[1],a=oe.useBasicFetch(Pb(e.videoId)),o=oe.useBasicFetch(hp()),c=Hf(u.SUBJECT);!function(e,t,n){var r=function(e){return yh(n,e)};hh(Qy.getObjectLevelsFetchOptions(e,Ih.Videos,r("videoLevels")),[e]),hh(Qy.getObjectAudiencesFetchOptions(e,Ih.Videos,r("videoAudiences")),[e,t.videoLevels]),lh([Qy.getPresentationsFetchOptions(r("presentations")),Qy.getLevelsFetchOptions(r("levels"))],[]),hh(!!t.currentPresentation&&Qy.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.videoId,n,r),mb(n,r);var s=!!(n.presentations&&n.levels&&n.presentationAudiences&&n.videoLevels&&n.videoAudiences);return l.createElement(l.Fragment,null,!!o.data&&l.createElement(xO,{videoId:e.videoId,activeAction:i.Videos.EDIT_VIDEO_AUDIENCES,currentUser:o.data}),l.createElement(dl,{object:a.data}),!!s&&l.createElement(cv,{objectLevels:n.videoLevels,objectAudiences:n.videoAudiences,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:yh(r,"currentPresentation"),levels:n.levels,presentationAudiences:n.presentationAudiences,memberType:Ih.Videos,saveLevels:function(t,n,r){return c.updateObjectLevels(e.videoId,t,Ih.Videos,n,r,r)},saveAudiences:function(t,r){return c.updateObjectAudiences(e.videoId,n.currentPresentation.id,t,Ih.Videos,r,r)}}))}function sC(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||lC(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uC(e){return function(e){if(Array.isArray(e))return fC(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||lC(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lC(e,t){if(e){if("string"==typeof e)return fC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fC(e,t):void 0}}function fC(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pC(e){var t=sC(l.useState({}),2),n=t[0],r=t[1],a=oe.useBasicFetch(Pb(e.videoId)),o=oe.useBasicFetch(hp()),c=Hf(u.SUBJECT);!function(e,t,n){var r=function(e){return yh(n,e)};lh([Qy.getSubjectTreeFetchOptions(r("subjectTree")),Qy.getPresentationsFetchOptions(r("presentations"))],[]),hh(Qy.getObjectSubjectsFetchOptions(e,Ih.Videos,r("videoSubjects")),[e]),hh(!!t.currentPresentation&&Qy.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),l.useEffect((function(){return r("subjectClassifications")([])}),[t.videoSubjects]);var i=function(e,t){return[].concat(uC(t.subjectClassifications||[]),uC(e))},a=t.videoSubjects&&t.videoSubjects.map((function(e){return Qy.getSubjectClassificationFetchOptions(e.id,yh(n,"subjectClassifications",i))}));lh(a,[t.videoSubjects],!!a),hh(Qy.getObjectClassificationsFetchOptions(e,Ih.Videos,r("videoClassifications")),[e,t.videoSubjects])}(e.videoId,n,r),mb(n,r);var s=!!(n.videoSubjects&&n.subjectTree&&n.presentations&&n.classificationTree&&n.videoClassifications&&n.subjectClassifications);return l.createElement(l.Fragment,null,!!o.data&&l.createElement(xO,{videoId:e.videoId,activeAction:i.Videos.EDIT_VIDEO_SUBJECTS,currentUser:o.data}),l.createElement(dl,{object:a.data}),s&&l.createElement(Yv,{objectSubjects:n.videoSubjects,subjectTree:n.subjectTree,memberType:Ih.Videos,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:yh(r,"currentPresentation"),objectClassifications:n.videoClassifications,objectSubjectClassifications:n.subjectClassifications,classificationTree:n.classificationTree,saveSubjects:function(t,n,r){return c.updateObjectSubjects(e.videoId,t,Ih.Videos,n,r,r)},saveClassifications:function(t,r){return c.updateObjectClassifications(e.videoId,n.currentPresentation.id,t,Ih.Videos,r,r)}}))}!function(e){e.Maths="maths",e.English="english",e.History="history"}(GO||(GO={}));var dC=function(e){return{key:"aliases:".concat(e),url:"/api/master/v2/objects/".concat(e,"/aliases")}},mC=function(e,t,n,r){return{key:"create:alias",url:"/api/master/v2/objects/".concat(e,"/aliases"),type:ce.a.POST,invalidationKeys:"aliases:".concat(e),data:t,success:n,error:r}},hC=function(e,t,n,r){return{key:"delete:alias",url:"/api/domain/v2/objects/".concat(e,"/aliases/").concat(t),type:ce.a.DELETE,invalidationKeys:"aliases:".concat(e),success:n,error:r}};function yC(e){var t=Object(v.useDispatch)(),n=tp(),r=oe.useBasicFetch(dC(e.videoId)),a=oe.useBasicFetch(hp());return r.data?l.createElement(l.Fragment,null,!!a.data&&l.createElement(xO,{videoId:e.videoId,activeAction:i.Videos.EDIT_VIDEO_ALIASES,currentUser:a.data}),l.createElement(pf,{aliases:r.data.data,onSave:function(r,i){oe.fetch(t,mC(e.videoId,r,(function(){n.success("Successfully created alias"),i()}),(function(){n.error("Something went wrong creating your alias")})))},onDelete:function(r){oe.fetch(t,hC(e.videoId,r,(function(){n.success("Successfully deleted alias")}),(function(){n.error("Something went wrong deleting your alias")})))}})):l.createElement(l.Fragment,null,"Loading...")}function vC(e){return(vC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function SC(e,t,n){return t&&gC(e.prototype,t),n&&gC(e,n),e}function EC(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&OC(e,t)}function OC(e,t){return(OC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function CC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=wC(e);if(t){var i=wC(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return AC(this,n)}}function AC(e,t){return!t||"object"!==vC(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function wC(e){return(wC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jC,IC,kC=function(e){EC(n,e);var t=CC(n);function n(){return bC(this,n),t.apply(this,arguments)}return SC(n,[{key:"channelName",get:function(){return c.VIDEOS}},{key:"appRoutes",get:function(){return{"manage/videos/:id(/)":"editVideo","manage/videos/:id/audiences(/)":"editVideoAudiences","manage/videos/:id/classifications(/)":"editVideoSubjects","manage/videos/:id/aliases(/)":"editVideoAliases","tools/programlookup/:id":"legacyEditVideo"}}},{key:"appLinks",get:function(){return["uploadImage"]}}]),n}(p.AppRouter),TC=function(e){EC(n,e);var t=CC(n);function n(){return bC(this,n),t.apply(this,arguments)}return SC(n,[{key:"initialize",value:function(){var e=this;Ci.a.values(u).forEach((function(t){return zf.getInstance(t,e)}))}},{key:"name",get:function(){return"Videos Application"}},{key:"channelName",get:function(){return c.VIDEOS}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT,options:{provider:_O,alertRegion:L}}}},{key:"editVideo",value:function(e){this.layout.showChildView(k,l.createElement(iC,{videoId:e}))}},{key:"editVideoAudiences",value:function(e){this.layout.showChildView(k,l.createElement(cC,{videoId:e}))}},{key:"editVideoSubjects",value:function(e){this.layout.showChildView(k,l.createElement(pC,{videoId:e}))}},{key:"editVideoAliases",value:function(e){this.layout.showChildView(k,l.createElement(yC,{videoId:e}))}},{key:"legacyEditVideo",value:function(e){p.LocationUtils.Redirect("/tools/programlookup/".concat(e))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(T,l.createElement(Rm,{imageType:e,popupSize:"lg",closePopup:function(){return t.layout.closePopup()}}))}}],[{key:"router",get:function(){return kC}}]),n}(Rf);function LC(e){return(LC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _C(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&PC(e,t)}function PC(e,t){return(PC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function xC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=RC(e);if(t){var i=RC(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return NC(this,n)}}function NC(e,t){return!t||"object"!==LC(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function RC(e){return(RC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function DC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function UC(e,t,n){return t&&MC(e.prototype,t),n&&MC(e,n),e}!function(e){e.UPDATE="UPDATE_VIEW_MODEL"}(jC||(jC={})),function(e){e.LocalStorage="localStorage",e.SessionStorage="sessionStorage"}(IC||(IC={}));var FC=function(){function e(t){DC(this,e),this.cachePrefix="_cv:",this.expireTime=3600,this.hasSupport=this.hasBrowserSupport(),this.type=t.type,this.hasSupport&&(this.storage=window[this.type])}return UC(e,[{key:"get",value:function(e){if(this.hasSupport){var t=this.storage.getItem(e);try{return JSON.parse(t)}catch(e){return t}}}},{key:"set",value:function(e,t){if(this.hasSupport)try{return this.storage.removeItem(e),"string"!=typeof t?(this.storage.setItem(e,JSON.stringify(t)),!0):(this.storage.setItem(e,t),!0)}catch(e){return!1}}},{key:"remove",value:function(e){if(this.hasSupport)return this.storage.removeItem(e)}},{key:"length",value:function(){if(this.hasSupport)return this.storage.length}},{key:"clear",value:function(){if(this.hasSupport)return this.storage.clear()}},{key:"cacheSet",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.expireTime;this.cacheClean();var r={time:this.getCurrentTime()+1e3*n,data:null!=t&&t};return this.set("".concat(this.cachePrefix).concat(e),r)}},{key:"cacheGet",value:function(e){var t="".concat(this.cachePrefix).concat(e),n=this.get(t);return n?this.isExpired(n)?(this.remove(t),null):n.data:null}},{key:"cacheExists",value:function(e){var t="".concat(this.cachePrefix).concat(e),n=this.get(t);return!!n&&(!this.isExpired(n)||(this.remove(t),!1))}},{key:"cacheRemove",value:function(e){return this.remove("".concat(this.cachePrefix).concat(e))}},{key:"cacheFlush",value:function(){this.cacheClean()}},{key:"cacheClean",value:function(){if(this.hasSupport)for(var e=0;e<this.storage.length;e++){var t=this.storage.key(e);if(0===t.indexOf(this.cachePrefix)){var n=this.get(t);n&&n.time&&this.isExpired(n)&&this.remove(t)}}}},{key:"isExpired",value:function(e){return e.time<this.getCurrentTime()}},{key:"getCurrentTime",value:function(){return(new Date).getTime()}},{key:"hasBrowserSupport",value:function(){try{return this.type in window&&null!==window[this.type]}catch(e){return!1}}}]),e}(),VC=function(e){_C(n,e);var t=xC(n);function n(){return DC(this,n),t.apply(this,arguments)}return UC(n,null,[{key:"Instance",get:function(){return this.instance||(this.instance=new this({type:IC.LocalStorage}))}}]),n}(FC),BC=function(e){_C(n,e);var t=xC(n);function n(){return DC(this,n),t.apply(this,arguments)}return UC(n,null,[{key:"Instance",get:function(){return this.instance||(this.instance=new this({type:IC.SessionStorage}))}}]),n}(FC),zC=VC.Instance,HC=BC.Instance;var qC=function(e,t,n){var r,i=(r=null==n?void 0:n.storage)?r===IC.SessionStorage?HC:zC:null,a=Object(v.useDispatch)(),o=Object(v.useSelector)((function(t){return t.viewModelData[e]})),c=void 0!==t&&void 0===o;if(c)u(t);else if(i&&void 0===o){var s=i.get(e);u("undefined"===s?null:s)}function u(t,n){i&&function(t,n){if(!i)return;var r=i.get(e);if("string"==typeof t&&void 0!==n)return void i.set(e,Object.assign(Object.assign({},r),{dataOrKey:n}));i.set(e,t)}(t,n),a({type:jC.UPDATE,payload:{viewModelKey:e,dataOrKey:t,keyData:n}})}return c?[t,u]:[null!=o?o:void 0,u]},JC="release:notes:config",$C=[{id:"798",name:"Monorepo"},{id:"109",name:"Online"},{id:"822",name:"Lite"},{id:"534",name:"Library Editor"},{id:"62",name:"Curator"}];function KC(e){var t=ci(),n=qc(t),r="798"===t.values.project;return f.a.useEffect((function(){e.getMilestones(t.values.project),r&&e.getBranchNames(t.values.project)}),[t.values.project]),f.a.useEffect((function(){t.setFieldValue("milestone",yp.a.first(e.milestones))}),[e.milestones]),f.a.useEffect((function(){t.setFieldValue("branchName",yp.a.first(e.branchNames))}),[e.branchNames]),f.a.createElement(vi,null,f.a.createElement(Bc,{as:"select",label:"Project",name:"project",id:"project",value:t.values.project},$C.map((function(e){return f.a.createElement("option",{key:e.id,value:e.id},e.name)}))),f.a.createElement(Bc,{as:"select",label:"Milestone",name:"milestone",id:"milestone",value:t.values.milestone,disabled:!e.milestones.length},e.milestones.map((function(e){return f.a.createElement("option",{key:e,value:e},e)}))),r&&f.a.createElement(Bc,{as:"select",label:"Branch Name",name:"branchName",id:"branchName",value:t.values.branchName,disabled:!e.branchNames.length},e.branchNames.map((function(e){return f.a.createElement("option",{key:e,value:e},e)}))),f.a.createElement("div",{className:"d-flex justify-content-between"},f.a.createElement(sf,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Generate")))}var YC="U_Jxes3Htv-xiaDX5wfn",GC="https://gitlab.cvinternal.net/api/v4",WC=function(e,t){return{key:"milestones:".concat(e),url:Cu("".concat(GC,"/projects/").concat(e,"/milestones"),{private_token:YC}),normalize:!1,formatData:function(e){return e.map((function(e){return e.title}))},success:t}},ZC=function(e,t){return{key:"branch:names:".concat(e),url:Cu("".concat(GC,"/projects/").concat(e,"/repository/branches"),{private_token:YC,per_page:50}),normalize:!1,formatData:function(e){return e.map((function(e){return e.name}))},success:t}},QC=function(e,t,n,r){return{key:"merge:requests:".concat(e,":").concat(t,":").concat(n),url:Cu("".concat(GC,"/projects/").concat(e,"/merge_requests"),{private_token:YC,milestone:t,state:"merged",per_page:50,page:n}),success:r}},XC=function(e,t,n){return{key:"file:paths:".concat(t,":").concat(e),url:Cu("".concat(GC,"/projects/").concat(e,"/search"),{scope:"blobs",search:t,private_token:YC}),normalize:!1,formatData:function(e){return e.filter((function(e){return e.filename.includes(t)}))},success:n}},eA=function(e,t,n,r){return{key:"file:".concat(e,":").concat(t,":").concat(n),url:Cu("".concat(GC,"/projects/").concat(e,"/repository/files/").concat(encodeURIComponent(t),"/raw"),{ref:n,private_token:YC}),normalize:!1,formatData:function(e){return JSON.parse(e)},success:r}},tA=ji.object().shape({project:ji.string().required("Project is required").default(""),milestone:ji.string().required("Milestone is required").default(""),branchName:ji.string().when("project",(function(e,t){return"798"===e?t.required("Branch name is required"):t})).default("")}).noUnknown();function nA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return rA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rA(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var iA={project:yp.a.first($C).id};function aA(){var e=nA(f.a.useState([]),2),t=e[0],n=e[1],r=nA(f.a.useState([]),2),a=r[0],o=r[1],s=nA(qC(JC),2)[1],u=Object(v.useDispatch)();return f.a.createElement(f.a.Fragment,null,f.a.createElement("h4",{className:"py-2"},"Generate Release Notes"),f.a.createElement(wi,{initialValues:iA,onSubmit:function(e){s(e),p.AppLinkHelper.trigger({application:c.RELEASE_NOTES,action:i.ReleaseNotes.GENERATOR})},validationSchema:tA},f.a.createElement(KC,{getMilestones:function(e){n([]),oe.fetch(u,WC(e,n))},milestones:t,getBranchNames:function(e){o([]),oe.fetch(u,ZC(e,o))},branchNames:a})))}var oA=n(218),cA=/#*/;function sA(e){return e=e.replace("-"," "),e="## "+(e=(e=El(e)).replace(cA,"").trim())}function uA(e){var t=e.toLowerCase();return"## notes"===t||"## dependencies"===t}function lA(e){return e=e.replace("-"," "),e=El(e)}function fA(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return pA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pA(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){c=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(c)throw a}}}}function pA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var dA=["# online","# curator","# library editor","# lite","# styles","# tooling","# analytics","# common","# shared","# player"];function mA(e){for(var t={name:"",changes:""},n=0;t.name||n<e.length;n++){var r=e[n];if(!r)break;if("#"===r){var i=e.indexOf("\n",n),a=e.slice(n,i);dA.includes(a.toLowerCase().trim())&&(t.name=El(a.replace("#","").trim()),e=e.slice(i),n=-1)}}for(var o=0;!t.changes&&o<e.length;o++){if(o+1===e.length){t.changes=e,e="";break}if("#"===e[o]&&"#"!==e[o+1]){var c=e.indexOf("\n",o),s=e.slice(o,c);dA.includes(s.toLowerCase().trim())&&(t.changes=e.slice(0,o),e=e.slice(o),o=-1)}}return{section:t,remainingDescription:e}}function hA(e){var t,n={},r=fA(e);try{for(r.s();!(t=r.n()).done;)for(var i=t.value;i;){var a=mA(i),o=a.section;if(i=a.remainingDescription,!o.name)break;n[o.name]||(n[o.name]=[]),n[o.name].push(o.changes)}}catch(e){r.e(e)}finally{r.f()}var c={};return Object.keys(n).forEach((function(e){var t,r;c[e]=(t=n[e],r={},t.forEach((function(e){for(var t=e.split("");t&&t.length;){for(var n=0;n<t.length&&t.length!==n+1;n++)if("#"===t[n]&&"#"===t[n+1]){var i=t.indexOf("\n",n),a=lA(t.slice(n,i).join(""));r[a]||(r[a]="");for(var o=i;o<t.length;o++){if(t.length===o+1){var c=t.slice(i+1).join("");r[a]+=c,t=[];break}if("#"===t[o]&&"#"===t[o+1]){var s=t.slice(i+1,o).join("");if(!s.length){t=t.slice(o),n=-1;break}r[a]+=s,t=t.slice(o),n=-1;break}}r[a]+="\n"}break}})),Object.keys(r).reduce((function(e,t){return e+=t+"\n",e+=r[t]+"\n"}),""))})),Object.keys(c).reduce((function(e,t){return e+="\n",e+="\n# ".concat(t),e+="\n".concat(c[t])}),"")}var yA=n(219),vA=n.n(yA);function bA(e){return function(e){if(Array.isArray(e))return EA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||SA(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,c=e[Symbol.iterator]();!(r=(o=c.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||SA(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function SA(e,t){if(e){if("string"==typeof e)return EA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?EA(e,t):void 0}}function EA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function OA(){var e=gA(f.a.useState(!0),2),t=e[0],n=e[1],r=gA(f.a.useState(1),2),a=r[0],o=r[1],s=gA(f.a.useState([]),2),u=s[0],l=s[1],d=gA(f.a.useState([]),2),m=d[0],h=d[1],y=gA(f.a.useState(!0),2),b=y[0],g=y[1],S=gA(f.a.useState(""),2),E=S[0],O=S[1],C=gA(f.a.useState("Copy"),2),A=C[0],w=C[1],j=gA(qC(JC),1)[0],I=j&&"798"===j.project,k=Object(v.useDispatch)();return f.a.useEffect((function(){if(j){var e=j.project,t=j.milestone;oe.fetch(k,QC(e,t,a,(function(e){l([].concat(bA(u),bA(e))),50===e.length?o(a+1):n(!1)})))}}),[a]),f.a.useEffect((function(){if(!(t||I&&b)){var e=u.map((function(e){return e.description.replace("\r\n","\n").replace("\r","")})),n=I?function(e,t){var n=function(e){var t="# Final Package Versions\n\n| Package | Version |\n| ------------------------- | ------------------------ |\n| @clickview/analytics | <analytics-version> |\n| @clickview/styles | <styles-version> |\n| @clickview/tooling | <tooling-version> |\n| @clickview/curator | <curator-version> |\n| @clickview/library-editor | <library-editor-version> |\n| @clickview/lite | <lite-version> |\n| @clickview/online | <online-version> |\n| @clickview/player | <player-version> |\n";return e.forEach((function(e){var n=e.name,r=e.version;r&&(t=t.replace("<".concat(n.replace("@clickview/",""),"-version>"),r))})),t}(t),r=hA(e);return"".concat(n,"\n").concat(r)}(e,m):function(e){var t={};return e.forEach((function(e){for(var n=e.split("");;){var r=!1;if(!n||!n.length)break;for(var i=0;i<n.length&&n.length!==i+1;i++)if("#"===n[i]){var a=n.indexOf("\n",i),o=sA(n.slice(i,a).join(""));t[o]||(uA(o)?r=!0:t[o]="");for(var c=a;c<n.length;c++){if(n.length===c+1){if(r){r=!1,n=[];break}var s=n.slice(a+1).join("");t[o]+=s,n=[];break}if("#"===n[c]){if(r){r=!1,n=n.slice(c),i=-1;break}var u=n.slice(a+1,c).join("");if(!u.length){n=n.slice(c),i=-1;break}t[o]+=u,n=n.slice(c),i=-1;break}}t[o]?t[o]+="\n":delete t[o]}break}})),Object.keys(t).reduce((function(e,n){return t[n]?(e+=n+"\n",e+=t[n]+"\n"):e}),"")}(e);O(n)}}),[t,b]),f.a.useEffect((function(){if(j&&I){var e=[];oe.fetch(k,XC(j.project,"package.json",(function(t){var n,r=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=SA(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){c=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(c)throw a}}}}(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;oe.fetch(k,eA(j.project,i.path,j.branchName,(function(n){e.push(n),e.length===t.length&&(h(e),g(!1))})))}}catch(e){r.e(e)}finally{r.f()}})))}}),[]),j?f.a.createElement(f.a.Fragment,null,E?f.a.createElement("div",{className:"position-relative border rounded p-3"},f.a.createElement(oA,{onCopy:function(){return w("Copied")},text:E},f.a.createElement("button",{className:"btn btn-outline-dark ".concat(vA.a.copyBtn)},A)),f.a.createElement("div",{dangerouslySetInnerHTML:{__html:UO()(E)}})):t?"Fetching merge requests..":"Merging descriptions.."):(p.AppLinkHelper.trigger({application:c.RELEASE_NOTES,action:i.ReleaseNotes.FORM}),f.a.createElement(f.a.Fragment,null))}function CA(e){return(CA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function AA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function jA(e,t,n){return t&&wA(e.prototype,t),n&&wA(e,n),e}function IA(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&kA(e,t)}function kA(e,t){return(kA=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function TA(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=_A(e);if(t){var i=_A(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return LA(this,n)}}function LA(e,t){return!t||"object"!==CA(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _A(e){return(_A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var PA,xA=function(e){IA(n,e);var t=TA(n);function n(){return AA(this,n),t.apply(this,arguments)}return jA(n,[{key:"channelName",get:function(){return c.RELEASE_NOTES}},{key:"appRoutes",get:function(){return{"developer/release-notes(/)":"index","developer/release-notes/generate(/)":"form","developer/release-notes/generator(/)":"generator"}}}]),n}(p.AppRouter),NA=function(e){IA(n,e);var t=TA(n);function n(){return AA(this,n),t.apply(this,arguments)}return jA(n,[{key:"name",get:function(){return"Release Notes Application"}},{key:"channelName",get:function(){return c.RELEASE_NOTES}},{key:"layoutOptions",get:function(){return{name:o.CURATOR_LAYOUT}}},{key:"index",value:function(){p.AppLinkHelper.trigger({application:c.RELEASE_NOTES,action:i.ReleaseNotes.GENERATOR},{replace:!0})}},{key:"form",value:function(){this.layout.showChildView(k,l.createElement(aA,null))}},{key:"generator",value:function(){this.layout.showChildView(k,l.createElement(OA,null))}},{key:"onShowAlert",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collection,n=t?t.toJSON():[],r=function(e){return tu.Radio.channel(G.a.ALERT).trigger("remove:alert",e)};this.layout.showChildView(L,l.createElement(ad,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}}],[{key:"router",get:function(){return xA}}]),n}(p.Application);function RA(e){return(RA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function DA(e){return function(e){if(Array.isArray(e))return MA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return MA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return MA(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function MA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function UA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function FA(e,t){return(FA=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function VA(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=zA(e);if(t){var i=zA(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return BA(this,n)}}function BA(e,t){return!t||"object"!==RA(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function zA(e){return(zA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Fifo="FifoMemoryCache"}(PA||(PA={}));var HA,qA=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&FA(e,t)}(a,e);var t,n,r,i=VA(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this)).size=e.size,t.cache={},t.cachedkeys=[],t}return t=a,(n=[{key:"name",get:function(){return PA.Fifo}},{key:"removeCacheKey",value:function(e){this.cachedkeys=d.without(this.cachedkeys,e)}},{key:"has",value:function(e){return!!this.cache[e]}},{key:"get",value:function(e){return this.cache[e]}},{key:"set",value:function(e,t){e&&t||Yc.c.throw(new Zc.a("Must provide a cache key and a value to cache in FifoMemoryCache.")),this.has(e)&&this.removeCacheKey(e),this.cachedkeys.push(e),this.cache[e]=t,this.cachedkeys.length>this.size&&delete this.cache[this.cachedkeys.shift()]}},{key:"getOrSet",value:function(e,t){if(this.has(e))return this.get(e);var n=t();return this.set(e,n),n}},{key:"remove",value:function(e){return!!this.has(e)&&(delete this.cache[e],this.removeCacheKey(e),!0)}},{key:"invalidate",value:function(e,t){var n=this,r=d.object(this.cachedkeys,this.cachedkeys),i=[];d.each(e,(function(e){var t;r[e]&&i.push(e);var n=new RegExp(e,"i"),a=d.filter(r,(function(e){return n.test(e)}));(t=i).push.apply(t,DA(a))})),i.length&&(i=d.uniq(i),d.each(i,(function(e){delete n.cache[e],d.isFunction(t)&&t(e)})),this.cachedkeys=d.without.apply(d,[this.cachedkeys].concat(DA(i))))}}])&&UA(t.prototype,n),r&&UA(t,r),a}(Kc.a),JA=n(17);!function(e){e[e.Unknown=0]="Unknown",e[e.BadRequest=1]="BadRequest",e[e.Unauthorized=2]="Unauthorized",e[e.Forbidden=3]="Forbidden",e[e.NotFound=4]="NotFound",e[e.InternalServer=5]="InternalServer"}(HA||(HA={}));var $A,KA={type:HA.Unknown,message:"",code:0};!function(e){e.Ajax="AjaxDataProvider",e.Notifications="NotificationsSignalRDataProvider"}($A||($A={}));var YA=function(e,t,n){if(!n||!n.errorCode)return e[t];var r="".concat(n.errorCode);return n.errorSubCode&&(r+=".".concat(n.errorSubCode)),e[r]||e[t]};function GA(e){return(GA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function WA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ZA(e,t){return(ZA=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function QA(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ew(e);if(t){var i=ew(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return XA(this,n)}}function XA(e,t){return!t||"object"!==GA(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ew(e){return(ew=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var tw=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ZA(e,t)}(a,e);var t,n,r,i=QA(a);function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),t=i.call(this,e),$.ajaxSetup({cache:!1,contentType:"application/json; charset=utf-8"}),t.successMiddleware={},t.errorMiddleware={},t.dataServiceErrorMessageMappings=e.dataServiceErrorMessageMappings,t.defaultErrorMessageKey=e.defaultErrorMessageKey,t}return t=a,(n=[{key:"name",get:function(){return $A.Ajax}},{key:"parseUrl",value:function(e){var t=document.createElement("a");return t.href=e,""===t.host&&(t.href=t.href),t}},{key:"makeHttps",value:function(e){var t=this.parseUrl(e);return"http:"===t.protocol&&(t.protocol="https:"),t.href}},{key:"base",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};n||(n=ce.a.GET);var i=d.defaults(r,{forceHttps:!1}),a={url:e,method:n,type:n};t&&(a.data=n===ce.a.POST||n===ce.a.PUT?JSON.stringify(t):t),i.forceHttps&&(a.url=this.makeHttps(a.url)),i.traditional&&(a.traditional=i.traditional);var o=$.ajax(a);return d.keys(this.successMiddleware).length&&o.done(d.values(this.successMiddleware)),d.keys(this.errorMiddleware).length&&o.fail(d.values(this.errorMiddleware)),o}},{key:"create",value:function(e,t,n){var r=n.channel,i=n.successEvent,a=n.errorEvent;this.base(e,t,ce.a.POST).done((function(e,t,n){return r.trigger(i,e,t,n)})).fail((function(e,t,n){return r.trigger(a,e,t,n)}))}},{key:"read",value:function(e,t){var n=t.channel,r=t.successEvent,i=t.errorEvent;this.base(e,null,ce.a.GET).done((function(e,t,i){n.trigger(r,e,t,i)})).fail((function(e,t,r){n.trigger(i,e,t,r)}))}},{key:"update",value:function(e,t,n){var r=n.channel,i=n.successEvent,a=n.errorEvent;this.base(e,t,ce.a.PUT).done((function(e,t,n){return r.trigger(i,e,t,n)})).fail((function(e,t,n){return r.trigger(a,e,t,n)}))}},{key:"delete",value:function(e,t){var n=t.channel,r=t.successEvent,i=t.errorEvent;this.base(e,null,ce.a.DELETE).done((function(e,t,i){return n.trigger(r,e,t,i)})).fail((function(e,t,r){return n.trigger(i,e,t,r)}))}},{key:"useMiddleware",value:function(e,t){this.successMiddleware[e]||(this.successMiddleware[e]=t)}},{key:"useErrorMiddleware",value:function(e,t){this.errorMiddleware[e]||(this.errorMiddleware[e]=t)}},{key:"parseError",value:function(e){var t=e.responseJSON,n=KA;switch(n.code=e.status,n.message=YA(this.dataServiceErrorMessageMappings,this.defaultErrorMessageKey,t),e.status){case 400:n.type=HA.BadRequest;break;case 401:n.type=HA.Unauthorized;break;case 403:n.type=HA.Forbidden;break;case 404:n.type=HA.NotFound;break;case 500:n.type=HA.InternalServer}return n}}])&&WA(t.prototype,n),r&&WA(t,r),a}(JA.Object);function nw(e){return(nw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function rw(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iw(e,t){return"string"==typeof t.payload.dataOrKey&&void 0!==t.payload.keyData?Object.assign(Object.assign({},e),rw({},t.payload.viewModelKey,Object.assign(Object.assign({},e[t.payload.viewModelKey]),rw({},t.payload.dataOrKey,t.payload.keyData)))):("object"===nw(t.payload.dataOrKey)&&Array.isArray(t.payload.dataOrKey),Object.assign(Object.assign({},e),rw({},t.payload.viewModelKey,t.payload.dataOrKey)))}function aw(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case jC.UPDATE:return iw(e,t)}return e}var ow="LanguageDataService",cw="locale",sw="phrases",uw="language:data:service";function lw(e){return(lw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function dw(e,t){return(dw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mw(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=yw(e);if(t){var i=yw(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return hw(this,n)}}function hw(e,t){return!t||"object"!==lw(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function yw(e){return(yw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var vw=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&dw(e,t)}(a,e);var t,n,r,i=mw(a);function a(){return fw(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"name",get:function(){return ow}},{key:"channelName",get:function(){return uw}},{key:"getLanguageConfig",value:function(e){var t={locale:"",phrases:null};this.get({resource:"/api/locale",eventPrefix:cw,expiryTime:xh.STANDARD,bootstrapName:pp,callback:function(n){t.locale=n,t.phrases&&d.isFunction(e)&&e(t)}}),this.get({resource:"/api/phrases",eventPrefix:sw,expiryTime:xh.STANDARD,bootstrapName:dp,callback:function(n){t.phrases=n,t.locale&&d.isFunction(e)&&e(t)}})}}])&&pw(t.prototype,n),r&&pw(t,r),a}(_h);n.d(t,"Layouts",(function(){return o})),n.d(t,"AppChannels",(function(){return c})),n.d(t,"DataChannels",(function(){return s})),n.d(t,"Actions",(function(){return i})),n.d(t,"DataPrefixes",(function(){return a})),n.d(t,"DataServices",(function(){return u})),n.d(t,"CuratorLayoutView",(function(){return z})),n.d(t,"LayoutComponent",(function(){return Y})),n.d(t,"CuratorAppNavService",(function(){return ae})),n.d(t,"CompaniesApplication",(function(){return If})),n.d(t,"CustomersApplication",(function(){return Wp})),n.d(t,"DomainOptionsApplication",(function(){return Kd})),n.d(t,"PeopleApplication",(function(){return wm})),n.d(t,"PlaylistsApplication",(function(){return fE})),n.d(t,"SeriesApplication",(function(){return FE})),n.d(t,"SubjectDataService",(function(){return Wy})),n.d(t,"SubjectDataServiceHelper",(function(){return Qy})),n.d(t,"SubjectsApplication",(function(){return eO})),n.d(t,"ThemesApplication",(function(){return LO})),n.d(t,"VideosApplication",(function(){return TC})),n.d(t,"DomainOptionsApplication",(function(){return Kd})),n.d(t,"ReleaseNotesApplication",(function(){return NA})),n.d(t,"Core",(function(){return p})),n.d(t,"InstanceManager",(function(){return zf})),n.d(t,"FifoMemoryCache",(function(){return qA})),n.d(t,"AjaxDataProvider",(function(){return tw})),n.d(t,"AlertList",(function(){return ad})),n.d(t,"AlertType",(function(){return qf})),n.d(t,"BaseAlertService",(function(){return ep})),n.d(t,"LanguageService",(function(){return cs})),n.d(t,"Flight",(function(){return oe})),n.d(t,"CacheDurations",(function(){return xh})),n.d(t,"ViewModelReducer",(function(){return aw})),n.d(t,"LanguageDataService",(function(){return vw}))}])}));