@clickview/curator 1.0.23 → 1.0.24-rc.0

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.
Files changed (37) hide show
  1. package/dist/curator-app.css.map +1 -1
  2. package/dist/curator-app.js +1 -1
  3. package/dist/curator-app.js.map +1 -1
  4. package/dist/libs/shared/src/apps/upload/utils/FileExtensionsHelper.d.ts +9 -0
  5. package/dist/libs/shared/src/components/image-cropper/ImageCropper.d.ts +10 -0
  6. package/dist/libs/shared/src/context/ImageStorageContext.d.ts +45 -0
  7. package/dist/libs/shared/src/enums/PermissionName.d.ts +23 -0
  8. package/dist/libs/shared/src/enums/PlayerMediaType.d.ts +5 -0
  9. package/dist/libs/shared/src/enums/ResourceFileType.d.ts +9 -0
  10. package/dist/libs/shared/src/enums/UserGroup.d.ts +5 -0
  11. package/dist/libs/shared/src/flight-requests/ImageRequests.d.ts +7 -0
  12. package/dist/libs/shared/src/flight-requests/RatingRequests.d.ts +4 -0
  13. package/dist/libs/shared/src/interfaces/collections/SubtitleCollection.d.ts +3 -0
  14. package/dist/libs/shared/src/interfaces/models/FileUpload.d.ts +20 -0
  15. package/dist/libs/shared/src/interfaces/models/InteractiveMetadata.d.ts +11 -0
  16. package/dist/libs/shared/src/interfaces/models/Language.d.ts +4 -0
  17. package/dist/libs/shared/src/interfaces/models/Pdf.d.ts +4 -0
  18. package/dist/libs/shared/src/interfaces/models/PlayerViewKey.d.ts +3 -0
  19. package/dist/libs/shared/src/interfaces/models/Subtitle.d.ts +7 -0
  20. package/dist/libs/shared/src/interfaces/models/interactive/ActionableItem.d.ts +6 -0
  21. package/dist/libs/shared/src/interfaces/models/interactive/Interaction.d.ts +16 -0
  22. package/dist/libs/shared/src/interfaces/models/interactive/InteractionType.d.ts +7 -0
  23. package/dist/libs/shared/src/interfaces/models/interactive/InteractionTypeId.d.ts +8 -0
  24. package/dist/libs/shared/src/interfaces/models/interactive/Interactive.d.ts +7 -0
  25. package/dist/libs/shared/src/interfaces/models/interactive/Timepoint.d.ts +9 -0
  26. package/dist/libs/shared/src/interfaces/models/interactive/index.d.ts +6 -0
  27. package/dist/libs/shared/src/interfaces/requests/CreateOrUpdateClipRequest.d.ts +6 -0
  28. package/dist/libs/shared/src/interfaces/requests/CreateViewKeyRequest.d.ts +5 -0
  29. package/dist/libs/shared/src/interfaces/requests/UpdateObjectChannel.d.ts +3 -0
  30. package/dist/libs/shared/src/interfaces/requests/UpdateObjectRating.d.ts +3 -0
  31. package/dist/libs/shared/src/interfaces/requests/UpdateResourceRequest.d.ts +3 -0
  32. package/dist/libs/shared/src/interfaces/services/BaseConfigDataService.d.ts +5 -0
  33. package/dist/libs/shared/src/utils/ImageSelectHelper.d.ts +6 -0
  34. package/dist/libs/shared/src/views/image-upload/ImageUploadView.d.ts +9 -0
  35. package/dist/projects/curator/src/apps/subjects/components/levels/select-levels/SelectLevels.d.ts +0 -1
  36. package/dist/projects/curator/src/apps/subjects/components/subjects/select-subjects/SelectSubjects.d.ts +0 -1
  37. package/package.json +47 -47
@@ -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,o=r?Symbol.for("react.portal"):60106,a=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 a: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 o: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=a,t.Lazy=v,t.Memo=y,t.Portal=o,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)===a},t.isLazy=function(e){return O(e)===v},t.isMemo=function(e){return O(e)===y},t.isPortal=function(e){return O(e)===o},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===a||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}}(),o=n(0),a=f(o),c=f(n(16)),s=f(n(187)),u=f(n(188)),l=n(196);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,o=n.highlightFirstSuggestion;if(!(0,s.default)(r,e.suggestions)&&r.length>0&&o)this.highlightFirstSuggestion();else if(i){var a=this.getHighlightedSuggestion();a!=t.highlightedSuggestion&&i({suggestion:a})}}},{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 o=i.valueBeforeUpDown;return null===t?o=null:null===o&&void 0!==n&&(o=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,highlightedSuggestion:null===t?null:r.getSuggestion(e,t),valueBeforeUpDown:o}}))}},{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,o=n.getSectionSuggestions;return i?o(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,o=r.onChange;t!==i&&o(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,o=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,j=S.valueBeforeUpDown,w=b?p:this.props.shouldRenderSuggestions,I=s.value,T=s.onFocus,k=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=w(I);e.setState({isFocused:!0,isCollapsed:!n}),T&&T(t),n&&o({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=w(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?o({value:n,reason:"input-changed"}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var i=t.keyCode;switch(i){case 40:case 38:if(O)w(I)&&(o({value:I,reason:"suggestions-revealed"}),e.revealSuggestions());else if(n.length>0){var a=r.newHighlightedSectionIndex,c=r.newHighlightedItemIndex,s=void 0;s=null===c?null===j?I:j:e.getSuggestionValueByIndex(a,c),e.updateHighlightedSuggestion(a,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===j){if(!f){e.maybeCallOnChange(t,"","escape"),w("")?o({value:"",reason:"escape-pressed"}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,j,"escape");f?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}k&&k(t)}}),N={query:this.getQuery()};return a.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}(o.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 a.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,o=r.onSuggestionSelected,a=r.onSuggestionsFetchRequested;o&&o(t,n),i?a({value:n.suggestionValue,reason:"suggestion-selected"}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,r=n.alwaysRenderSuggestions,i=n.focusInputOnSuggestionClick,o=e.getSuggestionIndices(e.findSuggestionElement(t.target)),a=o.sectionIndex,c=o.suggestionIndex,s=e.getSuggestion(a,c),u=e.props.getSuggestionValue(s);e.maybeCallOnChange(t,u,"click"),e.onSuggestionSelected(t,{suggestion:s,suggestionValue:u,suggestionIndex:c,sectionIndex:a,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,o=n.onBlur,a=e.getHighlightedSuggestion(),c=r(i);e.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!c}),o&&o(e.blurEvent,{highlightedSuggestion:a})},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(186);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==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:o,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(189).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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=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),c=d(a),s=d(n(16)),u=d(n(190)),l=d(n(191)),f=d(n(193)),p=d(n(194));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,o=t.highlightedSectionIndex,a=t.highlightedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var c="ArrowDown"===e.key?"next":"prev",s=n.sectionIterator[c]([o,a]),u=i(s,2),l=u[0],f=u[1];r.onKeyDown(e,{newHighlightedSectionIndex:l,newHighlightedItemIndex:f});break;default:r.onKeyDown(e,{highlightedSectionIndex:o,highlightedItemIndex:a})}},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),o(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,o=n.renderItem,a=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:o,renderItemData:a,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,o=n.renderItemData,a=n.highlightedSectionIndex,s=n.highlightedItemIndex,u=n.itemProps;return c.default.createElement(p.default,{items:e,itemProps:u,renderItem:i,renderItemData:o,highlightedItemIndex:null===a?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,o=t.renderInputComponent,a=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=o(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=a({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}(a.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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}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),o=i[0],a=i[1];return n?null===a||a===t[o]-1?null===(o=function(e){for(null===e?e=0:e++;e<t.length&&0===t[e];)e++;return e===t.length?null:e}(o))?[null,null]:[o,0]:[o,a+1]:0===t||a===t-1?[null,null]:null===a?[null,0]:[null,a+1]}return{next:i,prev:function(e){var i=r(e,2),o=i[0],a=i[1];return n?null===a||0===a?null===(o=function(e){for(null===e?e=t.length-1:e--;e>=0&&0===t[e];)e--;return-1===e?null:e}(o))?[null,null]:[o,t[o]-1]:[o,a-1]:0===t||0===a?[null,null]:null===a?[null,t-1]:[null,a-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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}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 o,a=n(192),c=(o=a)&&o.__esModule?o:{default:o},s=function(e){return e};t.default=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=r(t,2),o=n[0],a=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 o[e]})).filter(s);return"string"==typeof u[0]||"function"==typeof a?{key:e,className:a?a.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 o(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,a=i(e),c=1;c<arguments.length;c++){n=arguments[c],r=o(Object(n));for(var s=0;s<r.length;s++)a[r[s]]=n[r[s]]}return a}},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),o=s(i),a=s(n(16)),c=s(n(29));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,a=n(t);return a?o.default.createElement("div",r(i+"title","sectionTitle"),a):null}}]),t}(i.Component);f.propTypes={section:a.default.any.isRequired,renderSectionTitle:a.default.func.isRequired,theme:a.default.func.isRequired,sectionKeyPrefix:a.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}}(),o=n(0),a=l(o),c=l(n(16)),s=l(n(195)),u=l(n(29));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,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r=p(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),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,o=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 a.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),a.default.createElement(s.default,r({},g,{sectionIndex:u,isHighlighted:y,itemIndex:n,item:t,renderItem:o,renderItemData:c}))})))}}]),t}(o.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}}(),o=n(0),a=u(o),c=u(n(16)),s=u(n(29));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,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r=f(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),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,o=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),a.default.createElement("li",r({role:"option"},c,{ref:this.storeItemReference}),i(n,r({isHighlighted:t},o)))}}]),t}(o.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(198));var i=r.tokenize,o=r.options.Options;function a(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 o(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+=">"+a(p)+"</"+m+">",r.push(b)}else r.push(a(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(19),i=c(n(199)),o=c(n(200)),a=c(n(201));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 a.run(o.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 o=n[i];!o.isLink||t&&o.type!==t||r.push(o.toObject())}return r},t.inherits=r.inherits,t.options=i,t.parser=a,t.scanner=o,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:a,formatHref:a,nl2br:!1,tagName:"a",target:function(e,t){return"url"===t?"_blank":null},validate:!0,ignoreTags:[],attributes:null,className:"linkified"};function o(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 a(e){return e}t.defaults=i,t.Options=o,t.contains=function(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return!0;return!1},o.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 o=void 0,a=this[e];if(!a)return a;switch(void 0===a?"undefined":r(a)){case"function":return a(t,n.type);case"object":return"function"==typeof(o=a.hasOwnProperty(n.type)?a[n.type]:i[e])?o(t,n.type):o}return a},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(124),i=n(30),o=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 a="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<a.length;v++){var b=(0,r.stateify)(a[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(),j=E.pop(),w=O.pop(),I=f(i.DOMAIN),T=f(i.PROTOCOL),k=f(i.MAILTO);A.on("s",I).on(":",T),j.on("s",I).on(":",T),l.push(I),C.on(":",T),I.on(":",T),w.on(":",k);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=o,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 o=p,a=null,c=0,s=null,u=-1;i<n&&(a=o.next(t[i]));)(o=a).accepts()?(u=0,s=o):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(124),i=n(202),o=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),a=n(30);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),j=c(i.URL),w=c(i.URL),I=c(i.URL),T=c(),k=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(a.NL,z).on(a.PROTOCOL,u).on(a.MAILTO,l).on(a.SLASH,f),u.on(a.SLASH,f),f.on(a.SLASH,p),s.on(a.TLD,d).on(a.DOMAIN,d).on(a.LOCALHOST,h).on(a.NUM,d),p.on(a.TLD,b).on(a.DOMAIN,b).on(a.NUM,b).on(a.LOCALHOST,b),d.on(a.DOT,m),P.on(a.DOT,x),m.on(a.TLD,h).on(a.DOMAIN,d).on(a.NUM,d).on(a.LOCALHOST,d),x.on(a.TLD,N).on(a.DOMAIN,P).on(a.NUM,P).on(a.LOCALHOST,P),h.on(a.DOT,m),N.on(a.DOT,x),h.on(a.COLON,y).on(a.SLASH,b),y.on(a.NUM,v),v.on(a.SLASH,b),N.on(a.COLON,R),R.on(a.NUM,D);var H=[a.DOMAIN,a.AT,a.LOCALHOST,a.NUM,a.PLUS,a.POUND,a.PROTOCOL,a.SLASH,a.TLD,a.UNDERSCORE,a.SYM,a.AMPERSAND],q=[a.COLON,a.DOT,a.QUERY,a.PUNCTUATION,a.CLOSEBRACE,a.CLOSEBRACKET,a.CLOSEANGLEBRACKET,a.CLOSEPAREN,a.OPENBRACE,a.OPENBRACKET,a.OPENANGLEBRACKET,a.OPENPAREN];b.on(a.OPENBRACE,S).on(a.OPENBRACKET,E).on(a.OPENANGLEBRACKET,O).on(a.OPENPAREN,C),g.on(a.OPENBRACE,S).on(a.OPENBRACKET,E).on(a.OPENANGLEBRACKET,O).on(a.OPENPAREN,C),S.on(a.CLOSEBRACE,b),E.on(a.CLOSEBRACKET,b),O.on(a.CLOSEANGLEBRACKET,b),C.on(a.CLOSEPAREN,b),A.on(a.CLOSEBRACE,b),j.on(a.CLOSEBRACKET,b),w.on(a.CLOSEANGLEBRACKET,b),I.on(a.CLOSEPAREN,b),T.on(a.CLOSEBRACE,b),k.on(a.CLOSEBRACKET,b),L.on(a.CLOSEANGLEBRACKET,b),_.on(a.CLOSEPAREN,b),S.on(H,A),E.on(H,j),O.on(H,w),C.on(H,I),S.on(q,T),E.on(q,k),O.on(q,L),C.on(q,_),A.on(H,A),j.on(H,j),w.on(H,w),I.on(H,I),A.on(q,A),j.on(q,j),w.on(q,w),I.on(q,I),T.on(H,A),k.on(H,j),L.on(H,w),_.on(H,I),T.on(q,T),k.on(q,k),L.on(q,L),_.on(q,_),b.on(H,b),g.on(H,b),b.on(q,g),g.on(q,g),l.on(a.TLD,M).on(a.DOMAIN,M).on(a.NUM,M).on(a.LOCALHOST,M),M.on(H,M).on(q,U),U.on(H,M).on(q,U);var J=[a.DOMAIN,a.NUM,a.PLUS,a.POUND,a.QUERY,a.UNDERSCORE,a.SYM,a.AMPERSAND,a.TLD];d.on(J,F).on(a.AT,V),h.on(J,F).on(a.AT,V),m.on(J,F),F.on(J,F).on(a.AT,V).on(a.DOT,B),B.on(J,F),V.on(a.TLD,P).on(a.DOMAIN,P).on(a.LOCALHOST,N);t.State=r.TokenState,t.TOKENS=o,t.run=function(e){for(var t=e.length,n=0,r=[],o=[];n<t;){for(var a=s,c=null,u=null,l=0,f=null,p=-1;n<t&&!(c=a.next(e[n]));)o.push(e[n++]);for(;n<t&&(u=c||a.next(e[n]));)c=null,(a=u).accepts()?(p=0,f=a):p>=0&&p++,n++,l++;if(p<0)for(var d=n-l;d<n;d++)o.push(e[d]);else{o.length>0&&(r.push(new i.TEXT(o)),o=[]),n-=p,l-=p;var m=f.emit();r.push(new m(e.slice(n-l,n)))}}return o.length>0&&r.push(new i.TEXT(o)),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(125),i=n(19),o=n(30);function a(e){return e instanceof o.DOMAIN||e instanceof o.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 o.PROTOCOL;)t=!0,i.push(r[c].toString().toLowerCase()),c++;for(;r[c]instanceof o.SLASH;)n=!0,i.push(r[c].toString()),c++;for(;a(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 o.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(17),{block:i}=n(126),{rtrim:o,splitCells:a,escape:c}=n(13);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:o(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:a(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]=a(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:a(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]=a(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(31),i=n(127),o=n(128),a=n(129),{defaults:c}=n(17),{merge:s,unescape:u}=n(13);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 o(e.links,this.options),this.inlineText=new o(e.links,s({},this.options,{renderer:new a})),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,o="";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(o+=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(o,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=o(n(0)),i=o(n(206));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){return(a="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={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[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"!==a(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 o=arguments.length,a=new Array(o),c=0;c<o;c++)a[c]=arguments[c];return h(d(n=f(this,(e=p(t)).call.apply(e,[this].concat(a)))),"onClick",(function(e){var t=n.props,o=t.text,a=t.onCopy,c=t.children,s=t.options,u=r.default.Children.only(c),l=(0,i.default)(o,s);a&&a(o,l),u&&u.props&&"function"==typeof u.props.onClick&&u.props.onClick(e)})),n}var n,o,a;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,(o=[{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,o),a&&l(n,a),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(207),i={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,o,a,c,s,u,l=!1;t||(t={}),n=t.debug||!1;try{if(a=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 o=i[t.format]||i.default;window.clipboardData.setData(o,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"),o=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(o,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(c):s.removeAllRanges()),u&&document.body.removeChild(u),a()}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={};n.r(r),n.d(r,"AppLinkHelper",(function(){return w})),n.d(r,"AppLinkUtility",(function(){return A})),n.d(r,"Application",(function(){return ie})),n.d(r,"AppRouter",(function(){return be})),n.d(r,"Behavior",(function(){return Ie})),n.d(r,"Collection",(function(){return De})),n.d(r,"CollectionView",(function(){return Je})),n.d(r,"ComponentCollection",(function(){return Je})),n.d(r,"Error",(function(){return H})),n.d(r,"ErrorHelper",(function(){return K})),n.d(r,"SilentError",(function(){return q})),n.d(r,"LayoutView",(function(){return Ot})),n.d(r,"NestedModel",(function(){return Vt})),n.d(r,"Service",(function(){return Yt})),n.d(r,"Model",(function(){return _t})),n.d(r,"View",(function(){return mt})),n.d(r,"Component",(function(){return ht})),n.d(r,"EventNames",(function(){return v})),n.d(r,"LayoutService",(function(){return nn})),n.d(r,"Middleware",(function(){return ae})),n.d(r,"LocationUtils",(function(){return g})),n.d(r,"Shell",(function(){return mn}));var i={};n.r(i),n.d(i,"emptyResponse",(function(){return Gr})),n.d(i,"getResponse",(function(){return Wr})),n.d(i,"getFetch",(function(){return Zr})),n.d(i,"fetch",(function(){return Qr})),n.d(i,"dataServiceFetch",(function(){return Xr})),n.d(i,"useGetFetch",(function(){return ei})),n.d(i,"useGetResponse",(function(){return ti})),n.d(i,"useBasicFetch",(function(){return ni})),n.d(i,"createMiddleware",(function(){return li})),n.d(i,"FlightReducer",(function(){return gi})),n.d(i,"Simulator",(function(){return _i})),n.d(i,"Actions",(function(){return jr})),n.d(i,"RequestStatus",(function(){return Or})),n.d(i,"ajaxRequest",(function(){return Tr})),n.d(i,"normalize",(function(){return Nr})),n.d(i,"denormalize",(function(){return Ur}));n(143),n(144),n(145),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(153),n(154),n(155),n(156),n(157),n(158),n(159),n(160),n(161),n(162),n(163),n(164),n(165),n(166),n(167),n(168),n(169),n(170),n(171),n(172),n(173),n(174),n(175),n(176),n(177),n(178);var o={UPLOAD_IMAGE:"upload:image"},a={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"},o),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"},o),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"},o),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"},o),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"},o),ReleaseNotes:{FORM:"form",GENERATOR:"generator"},Customers:{EDIT_CUSTOMER_PRESENTATIONS:"edit:customer:presentations"}},c={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"},s={IMAGES:".".concat(["jpg","tif","png","bmp","gif","jpeg"].join(",."))},u={CURATOR_LAYOUT:"CuratorLayout"},l={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"},f={IMAGE_UPLOAD:"image:upload:data:service",SUBJECT:"subject:data:service",LANGUAGE:"language:data:service"},p={IMAGE_UPLOAD:"ImageUploadDataService",SUBJECT:"SubjectDataService",LANGUAGE:"LanguageDataService"},d=n(0),m=n.n(d),h=n(1),y=n(4),v={SHOW_POPUP:"show:popup",ROUTE:"route",LOCK_NAV:"lock:nav",UNLOCK_NAV:"unlock:nav",NAV_IS_LOCKED:"navigation:islocked",NAV_UNLOCKED_BY_USER:"navigation:unlocked:by:user",ROUTING_START:"routing:start",ROUTING_END:"routing:end",HAS_ACTIVE_ROUTE:"has:active:route",ROUTE_LOOKUP:"route:look:up",URL_CHANGE:"url:change",ERROR:"error",CURRENT_ROUTE:"route:current"},b={SHELL:"global:shell",ALERT:"global:alert",POPUP:"global:popup"},g={GetQuery:function(){return g.DeserializeQueryParams(window.location.search.substring(1))},UpdateQuery:function(e){if(e){var t=g.GetQuery(),n=g.SerializeQueryParams(h.extend(t,e));n&&(n="?".concat(n)),g.UpdateUrl("".concat(g.GetCurrentPath()).concat(n),null,{replace:!0,trigger:!1})}},UpdateUrl:function(e,t,n){var r=w.buildRoute(e,t);y.history.navigate(r,n),y.Radio.channel(b.SHELL).trigger(v.URL_CHANGE,t,n)},SerializeQueryParams:function(e){return e?"string"==typeof e?e:$.param(e,!0):""},DeserializeQueryParams:function(e){return e?h.reduce(e.split("&"),(function(e,t){var n=t.split("="),r=n[0],i=n.length>0?decodeURIComponent(n[1]):"";return e[r]?e[r]instanceof Array?(e[r].push(i),e):(e[r]=[e[r],i],e):(e[r]=i,e)}),{}):{}},StartHistory:function(){y.History.started&&y.history.stop(),y.history.start({pushState:!0})},PageLoad:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?window.open(e,"_blank"):window.location.href=e},Redirect:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=function(){return t?window.location.replace(e):window.location.href=e};A.hasActiveRoute()?y.Radio.channel(b.SHELL).once("routing:end",n):n()},Reload:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];window.location.reload(e)},GetCurrentPath:function(){return window.location.pathname},GetCurrentQueryString:function(){return window.location.search},GetCurrentUrl:function(){return window.location.href},GetCurrentReferrer:function(){return document.referrer},SetPageTitle:function(e){document.title=e}},S=/((\(\?)?:\w+)|(\*\w+)/,E=/[\(\)]/g,O=/\(\/\)/g,C=/\/$/,A={routingStarted:function(){y.Radio.channel(b.SHELL).trigger(v.ROUTING_START)},routingEnded:function(){A.hasActiveRoute()&&y.Radio.channel(b.SHELL).trigger(v.ROUTING_END)},hasActiveRoute:function(){return y.Radio.channel(b.SHELL).request(v.HAS_ACTIVE_ROUTE)}},j=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.usedHelper=!0;var n=e.application,r=e.action;y.Radio.channel(n).trigger(r,e,t)},w={getHref:function(e){if(!e)return"";var t=e.application,n=e.action,r=e.args,i=e.params,o=y.Radio.channel(b.SHELL);return"/".concat(o.request(v.ROUTE_LOOKUP,"".concat(t,":").concat(n),r,i))},buildRoute:function(e,t){if(!t)return e;var n=t.args,r=t.params;if(h.each(n,(function(t){e=e.replace(S,t||"")})),e=(e=(e=e.replace(O,"")).replace(E,"")).replace(C,""),!r)return e;var i=g.SerializeQueryParams(r);return i.length?"".concat(e,"?").concat(i):e},trigger:function(e,t){e&&(A.hasActiveRoute()?y.Radio.channel(b.SHELL).once("routing:end",(function(){j(e,t)})):j(e,t))},getCurrentAppLink:function(){return y.Radio.channel(b.SHELL).request(v.CURRENT_ROUTE)}},I=n(7);function T(e,t,n,r){var i=e;return"string"==typeof e&&(i=y.Radio.channel(e)),r.call(this,i,t,n)}function k(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 L=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.variables={}}var t,n,r;return t=e,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"get",value:function(e){return this.variables[e]}},{key:"setUpVariables",value:function(e){this.variables=e}},{key:"name",get:function(){return"EnvironmentVariables"}},{key:"isDevelopment",get:function(){return this.variables.isDevelopment}}])&&k(t.prototype,n),r&&k(t,r),e}().Instance;function _(e){return(_="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 P(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 x(e,t,n){return t&&P(e.prototype,t),n&&P(e,n),e}function N(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R(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&&B(e,t)}function D(e){var t=V();return function(){var n,r=z(e);if(t){var i=z(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M(this,n)}}function M(e,t){return!t||"object"!==_(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 U(e){var t="function"==typeof Map?new Map:void 0;return(U=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return F(e,arguments,z(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),B(r,e)})(e)}function F(e,t,n){return(F=V()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&B(i,n.prototype),i}).apply(null,arguments)}function V(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function B(e,t){return(B=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var H=function(e){R(n,e);var t=D(n);function n(e){return N(this,n),t.call(this,e)}return n}(U(Error)),q=function(e){R(n,e);var t=D(n);function n(){return N(this,n),t.apply(this,arguments)}return x(n,[{key:"name",get:function(){return"SilentError"}}]),n}(H),J=function(e){R(n,e);var t=D(n);function n(){return N(this,n),t.apply(this,arguments)}return x(n,[{key:"name",get:function(){return"CoreError"}}]),n}(U(Error)),K={throw:function(e){if(y.Radio.channel(b.SHELL).trigger(v.ERROR,e),!(e instanceof q||L.isDevelopment))throw e}};function Y(e){return(Y="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){return function(e){if(Array.isArray(e))return W(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 W(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 W(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 W(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 Z(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 Q(e,t,n){return(Q="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=re(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 X(e,t){return(X=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ee(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=re(e);if(t){var i=re(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return te(this,n)}}function te(e,t){return!t||"object"!==Y(t)&&"function"!=typeof t?ne(e):t}function ne(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function re(e){return(re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ie=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&&X(e,t)}(o,e);var t,n,r,i=ee(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).mergeOptions(e,[].concat(G(t.defaultProps),G(t.props||[]))),h.result(ne(t),"name")||K.throw(new J("BaseApplication must define a name")),h.result(ne(t),"channelName")||K.throw(new J("BaseApplication must define a channelName")),t.listenTo(t.getGlobalRadioChannel("popup"),v.SHOW_POPUP,t.onShowPopup),t.listenTo(t.getGlobalRadioChannel("alert"),"show:alert",t.onShowAlert),t}return t=o,(n=[{key:"getGlobalRadioChannel",value:function(e){var t=this.shell.getGlobalRadioChannels()[e.toUpperCase()];return t||K.throw(new J("Global channel ".concat(t," does not exist"))),y.Radio.channel(t)}},{key:"onLoadLayout",value:function(){if(this.layoutOptions&&this.layoutOptions.name){var e=h.extend({},this.layoutOptions.options||{},{store:this.shell.store});this.layout=this.layoutService.getLayout(h.extend(this.layoutOptions,{options:e})),this.layout||K.throw(new J("Layout: ".concat(this.layoutOptions.name," does not exist or was not registered"))),this.shell.showView(this.layout),this.triggerMethod("layout:loaded")}}},{key:"onShowPopup",value:function(e){this.layout.getRegion("popup")||K.throw(new J("Your application layout must define a popup region")),this.layout.showChildView("popup",e)}},{key:"onShowAlert",value:function(e){var t=e.ctor,n=e.collection,r=this.layout.getRegion("alert");r?r.hasView()||this.layout.showChildView("alert",new t({collection:n})):K.throw(new J("Your application layout must define an alert region"))}},{key:"setDefaultQueryParams",value:function(e){this.defaultQueryParams&&(e=h.extend(this.defaultQueryParams,e)),this.defaultQueryParams=e}},{key:"getAndClearDefaultQueryParams",value:function(){var e=this.defaultQueryParams;return delete this.defaultQueryParams,e||{}}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Q(re(o.prototype),"listenTo",this))}},{key:"defaultProps",get:function(){return["shell","layoutService"]}}])&&Z(t.prototype,n),r&&Z(t,r),o}(I.Application);function oe(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 ae=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,(n=[{key:"use",value:function(e){var t;this.go=(t=this.go,function(n,r){return t(n,(function(){return e(n,r)}))})}},{key:"go",value:function(e,t){t(e)}}])&&oe(t.prototype,n),r&&oe(t,r),e}();function ce(e){return(ce="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 se(e){return function(e){if(Array.isArray(e))return ue(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 ue(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 ue(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 ue(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 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 fe(e,t,n){return(fe="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=he(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 pe(e,t){return(pe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function de(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=he(e);if(t){var i=he(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return me(this,n)}}function me(e,t){return!t||"object"!==ce(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 he(e){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ye=/([A-Z])/g,ve=/(^|:)(\w)/gi,be=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&&pe(e,t)}(o,e);var t,n,r,i=de(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).bindDisposal(),t.processInternalRoutes(),t.processExternalRoutes(),t.processAppLinks(),t}return t=o,(n=[{key:"bindDisposal",value:function(){var e=this;this.listenTo(b.SHELL,v.ROUTE,(function(t){t.application!==e.channelName&&e.destroyApp()}))}},{key:"addRouteLookup",value:function(e,t){var n=this;this.options.shell.addRouteLookup("".concat(this.channelName,":").concat(e),(function(r,i){return w.buildRoute(t,{application:n.channelName,action:e,args:r,params:i})}))}},{key:"processInternalRoutes",value:function(){var e=this;h.each(h.keys(this.appRoutes),(function(t){var n=e.appRoutes[t],r=e.toEventName(n);e.addRouteLookup(r,t),e.listenTo(e.channelName,r,(function(n,r){r&&r.usedHelper||K.throw(new J("Please use Core.AppLinkHelper.trigger({}) to trigger appLinks.")),e.executeRoute(n,{isAppRoute:!0},(function(){var i=h.extend({},e.controller.getAndClearDefaultQueryParams(),n.params);n.params=i,g.UpdateUrl(t,n,r)}))}))}))}},{key:"processExternalRoutes",value:function(){var e=this;this.externalRoutes&&h.each(h.keys(this.externalRoutes),(function(t){var n=e.externalRoutes[t],r=e.toEventName(n);e.addRouteLookup(r,t),e.listenTo(e.channelName,r,(function(e,t){t&&t.usedHelper||K.throw(new J("Please use Core.AppLinkHelper.trigger({}) to trigger appLinks.")),g.PageLoad(w.getHref(e))}))}))}},{key:"processAppLinks",value:function(){var e=this;this.appLinks&&h.each(this.appLinks,(function(t){var n=e.toEventName(t);e.listenTo(e.channelName,n,(function(t,n){n&&n.usedHelper||K.throw(new J("Please use Core.AppLinkHelper.trigger({}) to trigger appLinks.")),e.executeRoute(t,{isAppRoute:!1})}))}))}},{key:"executeRoute",value:function(e,t,n){var r=this;this.validateAppLink(e);var i=this.toMethodName(e.action);A.routingStarted();var o=y.Radio.channel(b.SHELL);if(this.options.shell.isNavLocked())return o.trigger(v.NAV_IS_LOCKED,e),void A.routingEnded();var a=new ae;h.each(this.filters,(function(e){return a.use(e)})),a.go(e,(function(){o.trigger(v.ROUTE,e,t),r.createApp();var a=r.controller;if(h.isFunction(a[i])||(A.routingEnded(),K.throw(new J("".concat(i," does not exist on the ").concat(h.result(a,"name"),".")))),!1===a.triggerMethod("before:action"))return a.triggerMethod("action:cancelled"),void A.routingEnded();a.triggerMethod("load:layout"),a[i].apply(a,[].concat(se(e.args||[]),[e.params||{}])),h.isFunction(n)&&n(),A.routingEnded()}))}},{key:"createApp",value:function(){this.controller||(this.controller=new this.options.appConstructor(this.options.appOptions),this.controller.start())}},{key:"destroyApp",value:function(){this.controller&&(this.controller.destroy(),delete this.controller)}},{key:"_addAppRoute",value:function(e,t,n){var r=this;this.route(t,n,(function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var o={application:r.channelName,action:r.toEventName(n),args:t.slice(0,t.length-1),params:g.DeserializeQueryParams(t[t.length-1])};r.executeRoute(o,{isAppRoute:!0},(function(){g.UpdateQuery(h.extend(r.controller.getAndClearDefaultQueryParams(),o.params))}))}))}},{key:"toEventName",value:function(e){return e.replace(ye,":$1").toLowerCase()}},{key:"toMethodName",value:function(e){var t=e.replace(ve,(function(e,t,n){return n.toUpperCase()}));return t[0].toLowerCase()+t.slice(1,t.length)}},{key:"validateAppLink",value:function(e){e.application&&e.action||(A.routingEnded(),K.throw(new J("Invalid AppLink")))}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],fe(he(o.prototype),"listenTo",this))}}])&&le(t.prototype,n),r&&le(t,r),o}(I.AppRouter);function ge(e){return(ge="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 Se(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 Oe(e,t,n){return(Oe="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=we(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 Ce(e,t){return(Ce=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ae(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 je(this,n)}}function je(e,t){return!t||"object"!==ge(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 Ie=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&&Ce(e,t)}(o,e);var t,n,r,i=Ae(o);function o(){return Se(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Oe(we(o.prototype),"listenTo",this))}}])&&Ee(t.prototype,n),r&&Ee(t,r),o}(I.Behavior);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 ke(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(_e="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=Re(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 Pe(e,t){return(Pe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function xe(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Re(e);if(t){var i=Re(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ne(this,n)}}function Ne(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 Re(e){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var De=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&&Pe(e,t)}(o,e);var t,n,r,i=xe(o);function o(){return ke(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],_e(Re(o.prototype),"listenTo",this))}}])&&Le(t.prototype,n),r&&Le(t,r),o}(y.Collection);function Me(e){return(Me="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 Ue(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 Fe(e,t,n){return(Fe="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=qe(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 Ve(e,t){return(Ve=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Be(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qe(e);if(t){var i=qe(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ze(this,n)}}function ze(e,t){return!t||"object"!==Me(t)&&"function"!=typeof t?He(e):t}function He(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qe(e){return(qe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Je=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&&Ve(e,t)}(o,e);var t,n,r,i=Be(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),t=i.call(this,e),h.result(He(t),"name")||K.throw(new J("Error: View with cid:".concat(t.cid," requires a name."))),t}return t=o,(n=[{key:"serializeModel",value:function(){return this.model?this.model.toJSON():{}}},{key:"serializeCollection",value:function(){return this.collection?this.collection.toJSON():[]}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Fe(qe(o.prototype),"listenTo",this))}}])&&Ue(t.prototype,n),r&&Ue(t,r),o}(I.CollectionView);function $e(e){return($e="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 Ke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ye(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 Ge(e,t){return(Ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function We(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Qe(e);if(t){var i=Qe(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ze(this,n)}}function Ze(e,t){return!t||"object"!==$e(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 Qe(e){return(Qe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Xe=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&&Ge(e,t)}(o,e);var t,n,r,i=We(o);function o(){return Ke(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"name",get:function(){return"DevError"}}])&&Ye(t.prototype,n),r&&Ye(t,r),o}(H);function et(e){return(et="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 tt(e){return function(e){if(Array.isArray(e))return nt(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 nt(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 nt(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 nt(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 rt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function it(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 ot(e,t,n){return t&&it(e.prototype,t),n&&it(e,n),e}function at(e,t,n){return(at="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=pt(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 ct(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&&st(e,t)}function st(e,t){return(st=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ut(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=pt(e);if(t){var i=pt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return lt(this,n)}}function lt(e,t){return!t||"object"!==et(t)&&"function"!=typeof t?ft(e):t}function ft(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pt(e){return(pt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var dt=function(e){ct(n,e);var t=ut(n);function n(e){var r;rt(this,n),r=t.call(this,e);var i=[].concat(tt(r.defaultProps),tt(r.props||[]));return r.mergeOptions(e,i),h.result(ft(r),"name")||K.throw(new J("Error: View with cid:".concat(r.cid," requires a name."))),r}return ot(n,[{key:"_setOptions",value:function(e){this.options=h.extend({},h.result(this,"defaults"),e)}},{key:"_setAttributes",value:function(e){var t,n,r;L.isDevelopment&&h.extend(e,(t={},n="cv-classname",r=this.name,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t)),this.$el.attr(e)}},{key:"serializeModel",value:function(){return this.model?this.model.toJSON():{}}},{key:"serializeCollection",value:function(){return this.collection?this.collection.toJSON():[]}},{key:"resetClassName",value:function(){this.$el.attr("class",h.result(this,"className"))}},{key:"serializeData",value:function(){var e=this,t=at(pt(n.prototype),"serializeData",this).call(this),r=h.result(this,"viewOptions"),i=h.extend({},t,{options:r});return n.ViewDataExtensions.length?h.extend.apply(h,[i].concat(tt(h.map(n.ViewDataExtensions,(function(t){return t instanceof Function?t(e):t}))))):i}},{key:"viewOptions",value:function(){return this.options}},{key:"undelegateAppLinks",value:function(){this.$el&&this.$el.off(".appLinks".concat(this.cid))}},{key:"renderAppLinks",value:function(){var e=this,t=this.appLinks;t&&(t=this.normalizeUIKeys(t),this.undelegateAppLinks(),h.each(h.keys(t),(function(n){var r=n,i=t[n],o=w.getHref(i);"[this]"===r&&(r=null);var a=r?e.$el.find(n):e.$el;(a.is("a")||a.is("button"))&&(o&&"/"!==o&&a.attr("href",o),e.delegate("click.appLinks".concat(e.cid),r,(function(e){e.preventDefault(),w.trigger(i)})))})))}},{key:"hasPartialLoadingRegions",value:function(){return void 0!==this._hasPartialLoadingRegions||(this._hasPartialLoadingRegions=h.some(this.regions,(function(e){return h.has(e,"partialLoading")}))),this._hasPartialLoadingRegions}},{key:"renderPartialLoading",value:function(e){y.Radio.channel(b.SHELL).trigger("render:partial:loading",this,e)}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],at(pt(n.prototype),"listenTo",this))}},{key:"render",value:function(){if(this._isDestroyed)return this;var e=this.processRequriedResources(!0);return e&&(e=this.triggerMethod("before:render",this)),!1!==e&&(e=!0),!1===(e=e&&this.processRequriedResources(!1))?(this._partialLoadingRendered||!this.hasPartialLoadingRegions()||(this._partialLoadingRendered=!0,this._reInitRegions(),this._renderTemplate(),this.renderPartialLoading()),this):((this._isRendered||this._partialLoadingRendered)&&this._reInitRegions(),this.setTitle(),this._renderTemplate(),this.bindUIElements(),this.renderAppLinks(),this._partialLoadingRendered=!1,this._isRendered=!0,this.triggerMethod("render",this),this)}},{key:"processRequriedResources",value:function(e){return!0}},{key:"setTitle",value:function(){}},{key:"defaultProps",get:function(){return["shell","layoutService"]}},{key:"ui",get:function(){return this.uiStorage||(this.uiStorage=this.elements),this.uiStorage},set:function(e){this.uiStorage=e}},{key:"elements",get:function(){return null}}],[{key:"AddViewDataExtension",value:function(e){n.ViewDataExtensions.push(e)}}]),n}(I.View);dt.ViewDataExtensions=[];var mt=function(e){ct(n,e);var t=ut(n);function n(e){var r;return rt(this,n),(r=t.call(this,e)).boundListeners={},r.resourceInstances={},r}return ot(n,[{key:"processRequriedResources",value:function(e){var t=this,n=h.keys(this.requiredResources);if(!n.length)return!0;var r=this,i=!0;return h.each(n,(function(n){var o=t.requiredResources[n];if(o.beforeOnBeforeRender===e){var a=o.dataServiceName;t.resourceInstances[a]||(t.resourceInstances[a]=o.getInstance(t)),t.boundListeners["".concat(a,":").concat(o.eventName)]||(t.listenTo(t.resourceInstances[a].channelName,o.eventName,t.render),t.boundListeners["".concat(a,":").concat(o.eventName)]=!0),r[n]=o.getData(t.resourceInstances[a]),i=i&&!!r[n]}})),i}},{key:"setTitle",value:function(){h.isString(this.title)||!1===this.title||K.throw(new Xe("Must define a title for ".concat(this.name,"."))),y.Radio.channel(b.SHELL).trigger("set:page:title",this.title)}}]),n}(dt),ht=function(e){ct(n,e);var t=ut(n);function n(){return rt(this,n),t.apply(this,arguments)}return n}(dt);function yt(e){return(yt="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 vt(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 bt(e,t){return(bt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gt(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Et(e);if(t){var i=Et(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return St(this,n)}}function St(e,t){return!t||"object"!==yt(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 Et(e){return(Et=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ot=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&&bt(e,t)}(o,e);var t,n,r,i=gt(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,e)}return t=o,r=[{key:"getCacheKey",value:function(e){K.throw(new Xe("Must define getCacheKey for ".concat(this.name,".")))}}],(n=[{key:"unmountRegion",value:function(e){this.trigger("unmount:".concat(e))}}])&&vt(t.prototype,n),r&&vt(t,r),o}(mt);function Ct(e){return(Ct="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 At(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jt(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 wt(e,t,n){return(wt="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=Lt(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 It(e,t){return(It=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Tt(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Lt(e);if(t){var i=Lt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return kt(this,n)}}function kt(e,t){return!t||"object"!==Ct(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 Lt(e){return(Lt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _t=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&&It(e,t)}(o,e);var t,n,r,i=Tt(o);function o(){return At(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"mixin",value:function(e){for(var t in e){if(this.hasOwnProperty(t)){var n=this[t];return void(this[t]=h.extend({},n,e[t]))}this[t]=e[t]}}},{key:"addValidation",value:function(e){this.mixin({validation:e})}},{key:"validate",value:function(e,t){wt(Lt(o.prototype),"validate",this).call(this,e,t)}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],wt(Lt(o.prototype),"listenTo",this))}}])&&jt(t.prototype,n),r&&jt(t,r),o}(y.Model);function Pt(e){return(Pt="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 xt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nt(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 Rt(e,t,n){return(Rt="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=Ft(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 Dt(e,t){return(Dt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mt(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ft(e);if(t){var i=Ft(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ut(this,n)}}function Ut(e,t){return!t||"object"!==Pt(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 Ft(e){return(Ft=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Vt=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&&Dt(e,t)}(o,e);var t,n,r,i=Mt(o);function o(){return xt(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"set",value:function(e,t,n){var r,i;if(null===e)return this;for(r in"object"===Pt(e)?(i=e,n=t):(i={})[e]=t,n||(n={}),i)h.has(this.associations,r)&&(i[r]=this.setAssociation(r,i[r],n));return Rt(Ft(o.prototype),"set",this).call(this,i,n)}},{key:"get",value:function(e){var t=e.indexOf(".");if(-1===t)return Rt(Ft(o.prototype),"get",this).call(this,e);var n=e.substr(0,t),r=this.attributes[n];if(!r||!h.isFunction(r.get))return Rt(Ft(o.prototype),"get",this).call(this,e);var i=e.substr(t+1);return r.get(i)}},{key:"setAssociation",value:function(e,t,n){var r=this.associations[e],i=this.attributes[e];if(!h.isFunction(r))return t;if(n.unset)return i&&delete i.parent,delete this[e],i;if(i)return i instanceof _t&&i.set(t,n),i instanceof De&&i.set(t,n),n.silent||this.trigger("change:".concat(e),this,t,n),i;var o=t instanceof _t?t:new r(t,{parse:!0});return o.parent=this,this[e]=o,o}},{key:"toJSON",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Rt(Ft(o.prototype),"toJSON",this).apply(this,t);return h.each(this.associations,(function(e,t){h.has(r,t)&&h.isFunction(r[t].toJSON)?r[t]=r[t].toJSON():r[t]=(new e).toJSON()})),r}},{key:"toFlatJSON",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.omit(Rt(Ft(o.prototype),"toJSON",this).apply(this,t),h.keys(this.associations))}}])&&Nt(t.prototype,n),r&&Nt(t,r),o}(_t);function Bt(e){return(Bt="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 zt(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 Ht(e,t,n){return(Ht="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=Kt(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 qt(e,t){return(qt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Jt(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Kt(e);if(t){var i=Kt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return $t(this,n)}}function $t(e,t){return!t||"object"!==Bt(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 Kt(e){return(Kt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Yt=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&&qt(e,t)}(o,e);var t,n,r,i=Jt(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).name||K.throw(new J("Your service must be named.")),t}return t=o,(n=[{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Ht(Kt(o.prototype),"listenTo",this))}}])&&zt(t.prototype,n),r&&zt(t,r),o}(I.Object);function Gt(e){return(Gt="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 Wt(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 Zt(e,t,n){return(Zt="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=tn(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 Qt(e,t){return(Qt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xt(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=tn(e);if(t){var i=tn(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return en(this,n)}}function en(e,t){return!t||"object"!==Gt(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 tn(e){return(tn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var nn=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&&Qt(e,t)}(o,e);var t,n,r,i=Xt(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).layouts={},t.requiredRegions=e.requiredRegions,t}return t=o,(n=[{key:"clearLayout",value:function(){this.currentLayout&&(this.currentLayout.destroy(),delete this.currentLayout,delete this.currentLayoutCacheKey)}},{key:"registerLayout",value:function(e,t){return this.checkRequiredRegions(t),this.layouts[e]=t,this}},{key:"getLayout",value:function(e){var t=e.name,n=e.options,r=void 0===n?{}:n;this.layouts[t]||K.throw(new J("".concat(t," was not registered as a template.")));var i=this.layouts[t].getCacheKey(r);return this.currentLayoutCacheKey===i&&this.currentLayout?(this.currentLayout.triggerMethod("layout:requested",r),this.currentLayout):(this.clearLayout(),this.currentLayoutCacheKey=i,this.currentLayout=new this.layouts[t](r),this.listenToOnce(this.currentLayout,"destroy",this.clearLayout),this.currentLayout)}},{key:"checkRequiredRegions",value:function(e){h.each(this.requiredRegions,(function(t){h.has(h.result(e.prototype,"regions"),t)||K.throw(new J("Layout: ".concat(e.prototype.name," must define an ").concat(t," region.")))}))}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Zt(tn(o.prototype),"listenTo",this))}}])&&Wt(t.prototype,n),r&&Wt(t,r),o}(I.Object);function rn(e){return(rn="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 on(e,t,n){return(on="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=un(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 an(e,t){return(an=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function cn(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=un(e);if(t){var i=un(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return sn(this,n)}}function sn(e,t){return!t||"object"!==rn(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 un(e){return(un=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ln(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fn(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 pn(e,t,n){return t&&fn(e.prototype,t),n&&fn(e,n),e}var dn=function(){function e(t,n){ln(this,e),this.application=t,this.options=n||{}}return pn(e,[{key:"Application",get:function(){return this.application}},{key:"Options",get:function(){return this.options}}]),e}(),mn=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&&an(e,t)}(n,e);var t=cn(n);function n(){return ln(this,n),t.apply(this,arguments)}return pn(n,[{key:"initialize",value:function(e){this.mergeOptions(e,["layoutService"]),this.applications=[],this.routeLookup={},this.shellState={navLock:!1,activeRoute:!1,currentAppLink:null},this.errorHandlers=[]}},{key:"bindListeners",value:function(){this.bindRouteLookup(),this.bindNavLockListeners(),this.bindAppLinkListeners(),this.bindErrorHandlers(),this.bindErrorListener()}},{key:"bindNavLockListeners",value:function(){var e=this;this.listenTo(b.SHELL,v.LOCK_NAV,(function(){return e.shellState.navLock=!0})),this.listenTo(b.SHELL,v.UNLOCK_NAV,(function(){return e.shellState.navLock=!1}))}},{key:"bindAppLinkListeners",value:function(){var e=this;this.listenTo(b.SHELL,v.ROUTING_START,(function(){return e.shellState.activeRoute=!0})),this.listenTo(b.SHELL,v.ROUTING_END,(function(){return e.shellState.activeRoute=!1})),this.listenTo(b.SHELL,v.ROUTE,(function(t){return e.shellState.currentAppLink=t}));var t=y.Radio.channel(b.SHELL);t.reply(v.HAS_ACTIVE_ROUTE,h.bind(this.hasActiveRoute,this)),t.reply(v.CURRENT_ROUTE,(function(){return e.shellState.currentAppLink}))}},{key:"bindErrorHandlers",value:function(){window.addEventListener("error",(function(){A.routingEnded()}))}},{key:"bindErrorListener",value:function(){var e=y.Radio.channel(b.SHELL);this.listenTo(e,v.ERROR,this.handleError)}},{key:"bindRouteLookup",value:function(){var e=this;y.Radio.channel(b.SHELL).reply(v.ROUTE_LOOKUP,(function(t,n,r){return e.routeLookup[t]?e.routeLookup[t](n,r):""}),this)}},{key:"addRouteLookup",value:function(e,t){this.routeLookup[e]=t}},{key:"registerApplication",value:function(e,t){return this.applications.push(new dn(e,t)),this}},{key:"getGlobalRadioChannels",value:function(){return b}},{key:"isNavLocked",value:function(){return this.shellState.navLock}},{key:"start",value:function(e){var t=this;e||(e={}),this.runInitializationSteps(this,(function(r,i){t.runStartUpSteps(t,e,(function(r,i,o){on(un(n.prototype),"start",t).call(t,e)}))}))}},{key:"hasActiveRoute",value:function(){return this.shellState.activeRoute}},{key:"onStart",value:function(){var e=this;h.each(this.applications,(function(t){var n={appConstructor:t.Application,shell:e,appOptions:Object.assign({region:"",shell:e,layoutService:e.layoutService},t.Options)};new t.Application.router(n)})),this.bindListeners(),g.StartHistory()}},{key:"addInitializationStep",value:function(e){var t;return this.runInitializationSteps=(t=this.runInitializationSteps,function(n,r){return t(n,(function(){return e(n,r)}))}),this}},{key:"runInitializationSteps",value:function(e,t){t(e)}},{key:"addStartUpStep",value:function(e){var t;return this.runStartUpSteps=(t=this.runStartUpSteps,function(n,r,i){return t(n,r,(function(){return e(n,r,i)}))}),this}},{key:"runStartUpSteps",value:function(e,t,n){n(e,t)}},{key:"registerLayout",value:function(e,t){return this.layoutService.registerLayout(e,t),this}},{key:"registerErrorHandler",value:function(e,t){return e||K.throw(new J("An error must have a name in order to register a handler for it.")),h.any(this.errorHandlers,(function(t){return t.errorType===e}))&&K.throw(new J("An error handler for ".concat(e.prototype.name," has already been defined."))),this.errorHandlers.push({errorType:e,handler:t}),this}},{key:"handleError",value:function(e){var t=h.find(this.errorHandlers,(function(t){return e instanceof t.errorType}));t&&t.handler&&t.handler(e)}},{key:"registerStore",value:function(e){this.store=e}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],on(un(n.prototype),"listenTo",this))}}]),n}(I.Application),hn=function(e){return h.isFunction(e)},yn=function(){return h.identity},vn=n(26),bn=n(5);function gn(e){return(gn="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 Sn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function En(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 On(e,t){return(On=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Cn(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=jn(e);if(t){var i=jn(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return An(this,n)}}function An(e,t){return!t||"object"!==gn(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 jn(e){return(jn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var wn=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&&On(e,t)}(o,e);var t,n,r,i=Cn(o);function o(){return Sn(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"isReactComponent",value:function(e){return d&&d.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"),vn.render(t,r[0],(function(){return n.trigger("show")})),this.listenToOnce(this,"unmount:".concat(e),(function(){return vn.unmountComponentAtNode(r[0])})),this.listenToOnce(this,"before:destroy",(function(){return vn.unmountComponentAtNode(r[0])})))}},{key:"wrapWithStore",value:function(e){return d.createElement(bn.Provider,{store:this.options.store},e)}}])&&En(t.prototype,n),r&&En(t,r),o}(Ot),In="top:nav",Tn="left:nav",kn="content",Ln="popup",_n="alert",Pn=n(130),xn=n.n(Pn),Nn=n(27),Rn=n.n(Nn);function Dn(e){return(Dn="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 Mn(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 Un(e,t,n){return(Un="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=zn(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 Fn(e,t){return(Fn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Vn(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=zn(e);if(t){var i=zn(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Bn(this,n)}}function Bn(e,t){return!t||"object"!==Dn(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 zn(e){return(zn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Hn=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&&Fn(e,t)}(a,e);var t,n,i,o=Vn(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=o.call(this,e)).childComponents={},t}return t=a,i=[{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:"regions",value:function(){return{layout:".layout-region"}}},{key:"getChildComponents",value:function(){return{topNav:{component:this.childComponents[In],className:Rn.a.topNavRegion},leftNav:{component:this.childComponents[Tn],className:"py-3 ".concat(Rn.a.leftNavRegion)},content:{component:this.childComponents[kn],className:"position-relative container py-3"},popup:{component:this.childComponents[Ln]},alert:{component:this.childComponents[_n]}}}},{key:"unsetRegion",value:function(e){delete this.childComponents[e],this.renderLayout()}},{key:"renderTopNav",value:function(){hn(this.options.getTopNavView)&&(this.childComponents[In]=this.options.getTopNavView(r.AppLinkHelper.getCurrentAppLink()))}},{key:"hideLeftNav",value:function(){this.unsetRegion(Tn)}},{key:"closePopup",value:function(){this.unsetRegion(Ln)}},{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());Un(zn(a.prototype),"showChildView",this).call(this,"layout",this.wrapWithStore(d.createElement(Yn,Object.assign({},e))))}},{key:"title",get:function(){return!1}},{key:"name",get:function(){return"CuratorLayoutView"}},{key:"template",get:function(){return xn.a}},{key:"className",get:function(){return"container-fluid ".concat(Rn.a.curatorLayout)}}])&&Mn(t.prototype,n),i&&Mn(t,i),a}(wn),qn=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},Jn=function(e){var t=e.className,n=e.children;return d.createElement("div",{className:t},n)},$n=function(e,t){return"".concat(e).concat(t?" ".concat(t):"")},Kn=function(e){var t=e.topNav,n=e.leftNav,r=e.content,i=e.popup,o=e.alert;return d.createElement(d.Fragment,null,d.createElement("div",{className:"position-relative"},!!t.component&&d.createElement(Jn,{className:$n("top-nav-region",t.className)},t.component),!!n.component&&d.createElement(Jn,{className:$n("left-nav-region",n.className)},n.component),!!r.component&&d.createElement("div",{className:"content-container"},d.createElement(Jn,{className:$n("content-region",r.className)},r.component))),!!i.component&&d.createElement(Jn,{className:$n("popup-region",i.className)},i.component),!!o.component&&d.createElement(Jn,{className:$n("alert-region",o.className)},o.component))},Yn=function(e){var t=e.provider,n=qn(e,["provider"]);return t?d.createElement(t,null,d.createElement(Kn,Object.assign({},n))):d.createElement(Kn,Object.assign({},n))};function Gn(e){return(Gn="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 Wn(e){return function(e){if(Array.isArray(e))return Zn(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 Zn(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 Zn(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 Zn(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 Qn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xn(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 er(e,t){return(er=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function tr(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=rr(e);if(t){var i=rr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return nr(this,n)}}function nr(e,t){return!t||"object"!==Gn(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 rr(e){return(rr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ir=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&&er(e,t)}(a,e);var t,n,i,o=tr(a);function a(){return Qn(this,a),o.apply(this,arguments)}return t=a,(n=[{key:"initialize",value:function(){this.listenTo(b.SHELL,r.EventNames.ROUTING_END,this.updateNav)}},{key:"updateNav",value:function(){var e=this,t=r.AppLinkHelper.getCurrentAppLink().application;if(t!==this.currentApplication){this.currentApplication=t;var n=this.options.navItemMappings[t];if(n){var i=document.querySelector(this.options.navSelector);i&&i.children&&Wn(i.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))}))}}}},{key:"name",get:function(){return"CuratorAppNavService"}}])&&Xn(t.prototype,n),i&&Xn(t,i),a}(r.Service);function or(e){return(or="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 ar(e){return function(e){if(Array.isArray(e))return cr(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 cr(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 cr(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 cr(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 sr(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 ur(e,t){return(ur=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function lr(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=dr(e);if(t){var i=dr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return fr(this,n)}}function fr(e,t){return!t||"object"!==or(t)&&"function"!=typeof t?pr(e):t}function pr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dr(e){return(dr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var mr=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&&ur(e,t)}(o,e);var t,n,r,i=lr(o);function o(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),t=i.call(this,e),h.result(pr(t),"name")||K.throw(new Xe("Must provide a name when extending BaseDataService")),h.result(pr(t),"channelName")||K.throw(new Xe("Must provide a channelName for ".concat(h.result(pr(t),"name"))));var n=[].concat(ar(t.defaultProps),ar(t.props||[]));return t.dataRequestSignatures={},t.mergeOptions(e,n),t}return t=o,(n=[{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,o=this.getEventNames(i),a=o.syncEvent,c=o.errorEvent,s=this.cache.get(i);if(s&&s.openRequest)return this.listenToOnce(this.getChannel(),a,(function(e){h.isFunction(r)&&t.stopListening(t.getChannel(),c,r),h.isFunction(n)&&n(e)})),void this.listenToOnce(this.getChannel(),c,(function(){h.isFunction(n)&&t.stopListening(t.getChannel(),a,n),h.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,o=e.resource,a=e.formatData,c=e.expiryTime,s=e.successHandler,u=e.errorHandler,l=e.bootstrapName,f=this.getEventNames(i),p=f.syncEvent,d=f.requestEvent,m=f.successEvent,y=f.errorEvent,v=this.getChannel(),b=this.currentTimestamp();this.bootstrapData&&this.bootstrapData[l]&&(this.cacheData(i,this.bootstrapData[l],a,{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){h.isFunction(r)&&t.stopListening(t.getChannel(),y,r),h.isFunction(n)&&n(e)})),this.listenToOnce(v,y,(function(){h.isFunction(n)&&t.stopListening(t.getChannel(),p,n),h.isFunction(r)&&r()}))),this.cache.has(i)&&!O||(v.trigger(d),this.listenToResponse({eventPrefix:i,formatData:a,cacheOptions:{timestamp:b},callback:n,errorCallback:r,successHandler:s,errorHandler:u}),this.cacheData(i,null,null,{openRequest:!0,timestamp:b}),this.dataProvider.read(o,{channel:this.getTransportChannel(),successEvent:m,errorEvent:y})),g&&h.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,o=e.callback,a=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:o,errorCallback:a,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,o=e.formatData,a=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:a,formatData:o,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,o=e.invalidationKeys,a=e.successHandler,c=e.errorHandler,s=this.getEventNames(t),u=s.successEvent,l=s.errorEvent,f=this.getTransportChannel();this.listenToResponse({eventPrefix:t,invalidationKeys:o,callback:r,errorCallback:i,cacheOptions:{noCache:!0,clearCacheKey:!0},successHandler:a,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,o=e.errorCallback,a=e.successHandler,c=e.errorHandler,s=e.invalidationKeys,u=e.cacheOptions,l=void 0===u?{}:u,f=this.getEventNames(n),p=f.syncEvent,d=(f.requestEvent,f.successEvent),m=f.errorEvent,y=f.successAlertEvent,v=f.errorAlertEvent,b=this.getChannel(),g=this.getTransportChannel(),S=this.getAlertChannel();h.isFunction(i)&&this.listenToOnce(b,p,i),h.isFunction(o)&&this.listenToOnce(b,m,o),this.stopListening(S,y),this.stopListening(S,v),h.isFunction(a)&&this.listenToOnce(S,y,a),h.isFunction(c)&&this.listenToOnce(S,v,c),!h.isFunction(c)&&!1!==c&&h.isFunction(this.defaultErrorHandler)&&this.listenToOnce(S,v,this.defaultErrorHandler),this.hasRequestSignature(n)||(this.setRequestSignature(n),this.listenTo(g,d,(function(e){t.stopListening(b,m,o);for(var i=arguments.length,a=new Array(i>1?i-1:0),c=1;c<i;c++)a[c-1]=arguments[c];S.trigger.apply(S,[y,e].concat(a));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,m,(function(){var e;t.stopListening(b,p,i);var r=(e=t.dataProvider).parseError.apply(e,arguments);S.trigger(v,r),b.trigger(m,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,o=void 0!==i&&i,a=r.timestamp;a||(a=this.currentTimestamp());var c=this.processPagination(t),s=this.formatData(t,n);return this.cache.set(e,{data:s,timestamp:a,cursors:c,openRequest:o}),s}},{key:"processPagination",value:function(e){if(e){var t=e.pagination;if(t)return t.cursors?t.cursors:h.isUndefined(t.offset)||h.isUndefined(t.pageSize)?t.page?this.convertLegacyPaginationToCursors(t):void 0:this.convertOffsetPaginationToCursors(t)}}},{key:"formatData",value:function(e,t){return h.isFunction(t)?t(e):e}},{key:"chain",value:function(){var e=this,t=[],n=function(e,t){h.isFunction(e)&&e(t)},r=function(r,o){return t.push((function(){var i=r.callback;r.callback=function(e){n(i,e),n(t.shift())},e[o](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 y.Radio.channel("".concat(this.channelName,":transport"))}},{key:"getAlertChannel",value:function(){return y.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,o=r>0&&t>0&&Math.max(t-n,0),a={};if(i&&i<r&&(a.next=i.toString()),h.isNumber(o)&&(a.previous=o.toString()),!h.isEmpty(a))return a}},{key:"convertLegacyPaginationToCursors",value:function(e){var t=e.page,n=e.totalPages,r=h.isNumber(t)&&t>0&&t<n&&t+1,i=h.isNumber(t)&&t>1&&t-1,o={};if(r&&r<=n&&(o.next=r.toString()),i&&(o.previous=i.toString()),!h.isEmpty(o))return o}},{key:"defaultProps",get:function(){return["dataProvider","cache","bootstrapData","defaultErrorHandler","alertService"]}}])&&sr(t.prototype,n),r&&sr(t,r),o}(Yt);function hr(e){return(hr="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 yr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vr(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 br(e,t){return(br=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gr(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Er(e);if(t){var i=Er(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Sr(this,n)}}function Sr(e,t){return!t||"object"!==hr(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 Er(e){return(Er=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Or,Cr,Ar=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&&br(e,t)}(o,e);var t,n,r,i=gr(o);function o(){return yr(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"uploadBase64Image",value:function(e,t,n,r){return this.create({resource:"/api/image/upload?type=".concat(t),eventPrefix:c.UPLOAD_IMAGE,data:e,callback:n,errorCallback:r})}},{key:"name",get:function(){return p.IMAGE_UPLOAD}},{key:"channelName",get:function(){return f.IMAGE_UPLOAD}}])&&vr(t.prototype,n),r&&vr(t,r),o}(mr),jr={API_REQUEST:"API_REQUEST",API_REPONSE:"API_RESPONSE",API_ERROR:"API_ERROR",INVALIDATE:"INVALIDATE",UPDATE:"UPDATE"};function wr(e){return{getResponseHeader:e.getResponseHeader,responseJSON:e.responseJSON,status:e.status}}!function(e){e.None="None",e.Fetching="Fetching",e.Success="Success",e.Error="Error"}(Or||(Or={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE"}(Cr||(Cr={}));var Ir=[Cr.POST,Cr.PUT];function Tr(e){var t=e.resource,n=e.type,r=e.success,i=e.error,o=e.always,a={url:t,method:n};Ir.includes(n)&&e.data&&(a.data=JSON.stringify(e.data)),$.ajax(a).done((function(e,t,n){r&&r(e,wr(n))})).fail((function(e,t,n){i&&i(wr(e))})).always((function(){o&&o()}))}function kr(e){return(kr="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 Lr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.idAttribute,r=void 0===n?"id":n,i=t.namespace,o=void 0===i?"":i;return e[r]||K.throw(new Xe("There was an issue during normalization. Object did not have an id attribute.")),"".concat(o,"__").concat(e[r])}function _r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.idAttribute,i=void 0===r?"id":r,o=[];return e.forEach((function(e){e[i]&&o.push(Lr(e,n)),xr(e,t,n)})),o}function Pr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.idAttribute,i=void 0===r?"id":r,o=Object.assign({},e);if(Object.keys(e).forEach((function(r){var a=e[r];if(a)if(Array.isArray(a)){var c=_r(a,t,n);c.length&&(o[r]=c)}else if("object"===kr(a)){var s=Pr(a,t,n);a[i]?o[r]=Lr(a,n):o[r]=s}})),e[i]){var a=Lr(e,n);return t[a]=o,a}return o}function xr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e)return Array.isArray(e)?_r(e,t,n):"object"===kr(e)?Pr(e,t,n):e}function Nr(e,t){var n={};return{result:xr(e,n,t),entities:n}}var Rr={isEmpty:function(e){return h.isEmpty(e)},values:function(e){return h.values(e)},keys:function(e){return h.keys(e)},deepClone:function(e){return(h.isArray(e)?h.map:h.mapObject)(e,(function(e){return h.isObject(e)||h.isArray(e)?Rr.deepClone(e):e}))},getEnumKeys:function(e){return Object.keys(e).filter((function(e){return!(parseInt(e)>=0)}))},isObject:function(e){return h.isObject(e)},isEqual:function(e,t){return h.isEqual(e,t)},omit:function(e,t){return h.omit(e,t)}};function Dr(e){return(Dr="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 Mr(e,t,n){if(e){if("string"==typeof e)return function(e,t,n){if(n[e])return n[e];n[e]={};var r=Mr(t[e],t,n);return Object.assign(n[e],r),Rr.isEmpty(n[e])&&delete n[e],n[e]}(e,t,n);if(Array.isArray(e))return e.map((function(e){return Mr(e,t,n)}));if("object"===Dr(e)){var r={};return Object.keys(e).forEach((function(i){r[i]=Mr(e[i],t,n)||e[i]})),r}}}function Ur(e,t){return Mr(e,t,{})}function Fr(e,t){return e===t}function Vr(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}function Br(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fr,n=null,r=null;return function(){return Vr(t,n,arguments)||(r=e.apply(null,arguments)),n=arguments,r}}function zr(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}function Hr(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];var o=0,a=r.pop(),c=zr(r),s=e.apply(void 0,[function(){return o++,a.apply(null,arguments)}].concat(n)),u=e((function(){for(var e=[],t=c.length,n=0;n<t;n++)e.push(c[n].apply(null,arguments));return s.apply(null,e)}));return u.resultFunc=a,u.dependencies=c,u.recomputations=function(){return o},u.resetRecomputations=function(){return o=0},u}}var qr=Hr(Br);var Jr={currentTimestamp:function(){return(new Date).valueOf()},isExpired:function(e,t){if(!t)return!1;var n=1e3*t;return e<Jr.currentTimestamp()-n},currentTimeOfDay:function(e){e||(e=new Date);var t=e.getHours();return t>=12&&t<18?"afternoon":t>=18?"evening":"morning"}};function $r(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 Kr=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.status=t.status,this.requestTime=t.requestTime,this.cacheDuration=t.cacheDuration,this.data=t.data,this.statusCode=t.statusCode}var t,n,r;return t=e,(n=[{key:"shouldFetch",get:function(){return this.status===Or.None||this.isExpired}},{key:"isExpired",get:function(){return Jr.isExpired(this.requestTime,this.cacheDuration)}},{key:"isFetching",get:function(){return this.status===Or.Fetching}},{key:"hasError",get:function(){return this.status===Or.Error}},{key:"isComplete",get:function(){return this.status===Or.Success||this.status===Or.Error}}])&&$r(t.prototype,n),r&&$r(t,r),e}();function Yr(e,t,n){if(!e||!t)return Gr();var r=t.response;return!1!==t.request.normalize&&(r=Ur(t.response,n)),new Kr({status:t.status,statusCode:t.statusCode,requestTime:t.timestamp,cacheDuration:t.request.expiryTime,data:r})}function Gr(){return new Kr({status:Or.None})}function Wr(e,t){return Yr(t,e.flightData.resources[t],e.flightData.entities)}function Zr(e,t){return function(){Qr(e,t)}}function Qr(e,t){e({type:jr.API_REQUEST,request:t})}function Xr(e,t,n){var r,i,o,a,c,s,u,l,f,p=Wr(t,null===(r=n)||void 0===r?void 0:r.key);n&&p.shouldFetch?Qr(e,n):p.hasError?(null===(o=(i=n).error)||void 0===o||o.call(i,null),null===(c=(a=n).always)||void 0===c||c.call(a)):(null===(u=(s=n).success)||void 0===u||u.call(s,p.data),null===(f=(l=n).always)||void 0===f||f.call(l))}function ei(e){return Zr(Object(bn.useDispatch)(),e)}function ti(e,t){var n=Object(d.useMemo)((function(){var n;return(null===(n=t)||void 0===n?void 0:n.optimize)?function(e){return Hr(Br,(function(e,t){var n=["response","request"];return Rr.isEqual(Rr.omit(e,n),Rr.omit(t,n))}))((function(t){return t.flightData.resources[e]}),(function(t){var n,r=t.flightData.resources[e];return(null===(n=r)||void 0===n?void 0:n.entityIds)?r.entityIds.reduce((function(e,n){return e[n]=t.flightData.entities[n],e}),{}):{}}),(function(t,n){return Yr(e,t,n)}))}(e):function(e){return qr((function(t){return t.flightData.resources[e]}),(function(e){return e.flightData.entities}),(function(t,n){return Yr(e,t,n)}))}(e)}),[e]);return Object(bn.useSelector)((function(e){return n(e)}))}function ni(e,t){var n=Object(bn.useDispatch)(),r=ti(e&&e.key,t),i=Zr(n,e);return e&&r.shouldFetch&&i(),r}function ri(e){return function(e){if(Array.isArray(e))return ii(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 ii(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 ii(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 ii(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 oi,ai=function(e,t,n){var r=Array.isArray(t)?t:[t],i=[];return r.forEach((function(t){var n,r=new RegExp(t,"i"),o=Object.keys(e.resources).filter((function(e){return r.test(e)}));(n=i).push.apply(n,ri(o))})),n&&(i=i.filter((function(e){return e!==n}))),i.reduce((function(e,t){return e[t]=!0,e}),{})};!function(e){e[e.Ok=200]="Ok",e[e.NoContent=204]="NoContent",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.Conflict=409]="Conflict",e[e.InternalServer=500]="InternalServer"}(oi||(oi={}));var ci=function(e){var t=e;return!!(t.successResponse||t.errorResponse||t.noResponse)},si=function(e,t){var n=e.success,r=e.error,i=e.always,o=t;window.setTimeout((function(){o.noResponse||(o.successResponse?n(o.successResponse(),{status:oi.Ok,getResponseHeader:function(e){return""}}):o.errorResponse&&r(o.errorResponse()),i())}),function(e){var t=e.timeout||300;return t/2+(Math.floor(Math.random()*t/2)+1)}(t))},ui=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 li(e){var t=e.fetchData,n=e.bootstrappedData,r=e.defaultExpiryTime,i=Object.freeze({key:null,url:null,type:Cr.GET,normalize:!0,formatData:function(e){return e},expiryTime:r});return function(e){return function(r){return function(o){if(o.type===jr.API_REQUEST){var a=e.getState(),c=Object.assign({},i,o.request),s=c.success,u=c.error,l=c.always,f=c.formatData,p=ui(c,["success","error","always","formatData"]),d=a.flightData.resources[p.key];if(r(o),!d||d.status!==Or.Fetching){if(p.bootstrapName&&n[o.request.bootstrapName])return h(n[o.request.bootstrapName]),y(),void delete n[o.request.bootstrapName];var m={resource:p.url,type:p.type,data:p.data,success:h,error:function(t){e.dispatch({type:jr.API_ERROR,errorResponse:t.responseJSON,request:o.request,timestamp:Jr.currentTimestamp(),xhr:t}),p.invalidationKeys&&e.dispatch({type:jr.INVALIDATE,keys:p.invalidationKeys,request:p});u&&u(t)},always:y};return void(ci(p)?si(m,p):t(m))}}else r(o);function h(t,n){var r=f(t),i={result:r,entities:{}};(p.normalize&&(i=Nr(r,p.normalizeOptions)),e.dispatch({type:jr.API_REPONSE,result:i.result,entities:i.entities,request:p,timestamp:Jr.currentTimestamp(),xhr:n}),p.updateState)&&(Array.isArray(p.updateState)?p.updateState:[p.updateState]).forEach((function(t){var n,r,i,o;n=t,r=ai(a.flightData,n.keys),i=Object.assign({},Object.keys(a.flightData.resources).filter((function(e){return r[e]})).reduce((function(e,t){var n=a.flightData.resources[t],r=n.response;return n.request.normalize&&(r=Ur(n.response,a.flightData.entities)),e[t]=r,e}),{})),o=n.updateData(i),Object.keys(o).forEach((function(t){var n=a.flightData.resources[t],r=o[t],i={result:r,entities:{}};n.request.normalize&&(i=Nr(r,n.request.normalizeOptions)),e.dispatch({type:jr.UPDATE,result:i.result,entities:i.entities,request:n.request})}))}));if(p.invalidationKeys&&e.dispatch({type:jr.INVALIDATE,keys:p.invalidationKeys,request:p}),s){var o=i.result;p.normalize&&(o=Ur(i.result,Object.assign(Object.assign({},a.flightData.entities),i.entities))),s(o)}}function y(){l&&l()}}}}}function fi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pi(e,t){var n=Object.assign({},e);return Object.keys(t).forEach((function(r){e[r]?n[r]=Object.assign(Object.assign({},e[r]),t[r]):n[r]=t[r]})),n}function di(e,t){var n=e.resources[t.request.key];return{entities:Object.assign({},e.entities),resources:Object.assign(Object.assign({},e.resources),fi({},t.request.key,{request:t.request,status:Or.Fetching,response:n?n.response:null,entityIds:n?n.entityIds:null}))}}function mi(e,t){var n,r=t.entities?Object.keys(t.entities):[];return{entities:pi(e.entities,t.entities),resources:Object.assign(Object.assign({},e.resources),fi({},t.request.key,{request:t.request,status:Or.Success,response:t.result,timestamp:t.timestamp,statusCode:null===(n=t.xhr)||void 0===n?void 0:n.status,entityIds:r}))}}function hi(e,t){var n;return{entities:Object.assign({},e.entities),resources:Object.assign(Object.assign({},e.resources),fi({},t.request.key,{request:t.request,status:Or.Error,errorResponse:t.errorResponse,timestamp:t.timestamp,statusCode:null===(n=t.xhr)||void 0===n?void 0:n.status}))}}function yi(e,t){var n,r=ai(e,t.keys,null===(n=t.request)||void 0===n?void 0:n.key);return{entities:Object.assign({},e.entities),resources:Object.assign(Object.assign({},e.resources),Object.keys(e.resources).filter((function(e){return r[e]})).reduce((function(t,n){var r=e.resources[n];return t[n]=Object.assign({},r,{status:Or.None}),t}),{}))}}function vi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bi,t=arguments.length>1?arguments[1]:void 0,n=t.entities?Object.keys(t.entities):[];return{entities:pi(e.entities,t.entities),resources:Object.assign(Object.assign({},e.resources),fi({},t.request.key,Object.assign(Object.assign({},e.resources[t.request.key]),{request:t.request,response:t.result,entityIds:n})))}}var bi={resources:{},entities:{}};function gi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bi,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case jr.API_REQUEST:return di(e,t);case jr.API_REPONSE:return mi(e,t);case jr.API_ERROR:return hi(e,t);case jr.INVALIDATE:return yi(e,t);case jr.UPDATE:return vi(e,t)}return e}function Si(e){return function(e){if(Array.isArray(e))return Ei(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 Ei(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 Ei(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 Ei(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 Oi=function(e){return h.first(e)},Ci=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e&&e.length?e.slice():[];return t+1>i.length&&(i=[].concat(Si(i),Si(Array(t+1-i.length).fill(r)))),i.splice(t,1,n),i},Ai=function(e,t,n){var r=e.slice();return r.splice(n,0,r.splice(t,1)[0]),r},ji=function(e,t){return h.groupBy(e,t)},wi=function(){return h.intersection.apply(h,arguments)},Ii=function(e,t){var n=e.indexOf(t);return-1===n?e.push(t):e.splice(n,1),e};var Ti="id";function ki(e,t){return localStorage.setItem(e,JSON.stringify(t)),t}function Li(e){var t=localStorage.getItem(e);return t?JSON.parse(t):null}var _i={getAll:function(e,t){var n=Li(e);return n&&n.length?n:!n&&t?(t.forEach((function(t){return _i.create(e,t)})),Li(e)):[]},get:function(e,t){var n=_i.getAll(e);return n.length?n.find((function(e){return e[Ti]===t})):null},create:function(e,t){var n,r,i,o=_i.getAll(e),a=Object.assign(Object.assign({},t),(n={},r=Ti,i=t[Ti]||(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)+1).toString(),r in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,n));return o.push(a),ki(e,o),a},update:function(e,t){var n=_i.getAll(e);if(!n.length)return t;var r=n.findIndex((function(e){return e[Ti]===t[Ti]}));return n[r]=t,ki(e,n),t},delete:function(e,t){var n=_i.getAll(e);n.length&&(Array.isArray(t)||(t=[t]),t.forEach((function(e){var t=n.findIndex((function(t){return t[Ti]===e}));n.splice(t,1)})),ki(e,n))},assoc:function(e,t,n,r,i){var o=Array.isArray(i),a=o?i:[i];"string"==typeof Oi(a)&&(a=_i.getAll(r).filter((function(e){return a.includes(e.id)})));var c=a.map((function(e){return e.id?e:_i.create(r,e)})),s=_i.getAll(e);if(s.length){var u=s.find((function(e){return e.id===t}));if(u)return c.forEach((function(e){if(u[n])if(Array.isArray(u[n])){if(u[n].find((function(t){return t.id===e.id})))return;u[n].push(e)}else u[n]=e;else u[n]=o?[e]:e})),ki(e,s=s.map((function(e){return e.id!==u.id?e:u}))),o?c:Oi(c)}},dissoc:function(e,t,n,r){var i=_i.getAll(e);if(i.length){var o=i.find((function(e){return e.id===t}));if(o){var a=o[n];if(a)return Array.isArray(r)||(r=[r]),Array.isArray(a)||(a=[a]),r.forEach((function(e){var t=a.findIndex((function(t){return t.id===e}));a.splice(t,1)})),o[n]=a,ki(e,i=i.map((function(e){return e.id!==o.id?e:o}))),i}}}},Pi=function(e){var t="/api/master/v2/companies";return e?"".concat(t,"?cursor=").concat(e):t},xi=function(e){return"/api/master/v2/objects/".concat(e)},Ni=function(){return"/api/master/v2/companies"},Ri=function(e){return"/api/master/v2/objects/".concat(e)},Di="companies",Mi="company",Ui="update:company",Fi=function(e){return{key:"".concat(Di).concat(e?":".concat(e):""),url:Pi(e)}},Vi=function(e){return{key:"".concat(Mi,":").concat(e),url:xi(e)}},Bi=function(e,t,n){return{key:Mi,url:Ni(),data:e,type:Cr.POST,success:t,error:n,invalidationKeys:[Di]}},zi=function(e,t,n){return{key:"".concat(Ui,":").concat(e),url:Ri(e),data:t,type:Cr.PUT,always:n}},Hi=n(12),qi=n.n(Hi),Ji=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===$i}(e)}(e)};var $i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Ki(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Gi((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Yi(e,t,n){return e.concat(t).map((function(e){return Ki(e,n)}))}function Gi(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Yi,n.isMergeableObject=n.isMergeableObject||Ji;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]=Ki(e[t],n)})),Object.keys(t).forEach((function(i){n.isMergeableObject(t[i])&&e[i]?r[i]=Gi(e[i],t[i],n):r[i]=Ki(t[i],n)})),r}(e,t,n):Ki(t,n)}Gi.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Gi(e,n,t)}),{})};var Wi=Gi,Zi=n(6),Qi=Zi.a.Symbol,Xi=Object.prototype,eo=Xi.hasOwnProperty,to=Xi.toString,no=Qi?Qi.toStringTag:void 0;var ro=function(e){var t=eo.call(e,no),n=e[no];try{e[no]=void 0;var r=!0}catch(e){}var i=to.call(e);return r&&(t?e[no]=n:delete e[no]),i},io=Object.prototype.toString;var oo=function(e){return io.call(e)},ao=Qi?Qi.toStringTag:void 0;var co=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ao&&ao in Object(e)?ro(e):oo(e)};var so=function(e,t){return function(n){return e(t(n))}},uo=so(Object.getPrototypeOf,Object);var lo=function(e){return null!=e&&"object"==typeof e},fo=Function.prototype,po=Object.prototype,mo=fo.toString,ho=po.hasOwnProperty,yo=mo.call(Object);var vo=function(e){if(!lo(e)||"[object Object]"!=co(e))return!1;var t=uo(e);if(null===t)return!0;var n=ho.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&mo.call(n)==yo};var bo=function(){this.__data__=[],this.size=0};var go=function(e,t){return e===t||e!=e&&t!=t};var So=function(e,t){for(var n=e.length;n--;)if(go(e[n][0],t))return n;return-1},Eo=Array.prototype.splice;var Oo=function(e){var t=this.__data__,n=So(t,e);return!(n<0)&&(n==t.length-1?t.pop():Eo.call(t,n,1),--this.size,!0)};var Co=function(e){var t=this.__data__,n=So(t,e);return n<0?void 0:t[n][1]};var Ao=function(e){return So(this.__data__,e)>-1};var jo=function(e,t){var n=this.__data__,r=So(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function wo(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])}}wo.prototype.clear=bo,wo.prototype.delete=Oo,wo.prototype.get=Co,wo.prototype.has=Ao,wo.prototype.set=jo;var Io=wo;var To=function(){this.__data__=new Io,this.size=0};var ko=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var Lo=function(e){return this.__data__.get(e)};var _o=function(e){return this.__data__.has(e)};var Po=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var xo,No=function(e){if(!Po(e))return!1;var t=co(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Ro=Zi.a["__core-js_shared__"],Do=(xo=/[^.]+$/.exec(Ro&&Ro.keys&&Ro.keys.IE_PROTO||""))?"Symbol(src)_1."+xo:"";var Mo=function(e){return!!Do&&Do in e},Uo=Function.prototype.toString;var Fo=function(e){if(null!=e){try{return Uo.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Vo=/^\[object .+?Constructor\]$/,Bo=Function.prototype,zo=Object.prototype,Ho=Bo.toString,qo=zo.hasOwnProperty,Jo=RegExp("^"+Ho.call(qo).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var $o=function(e){return!(!Po(e)||Mo(e))&&(No(e)?Jo:Vo).test(Fo(e))};var Ko=function(e,t){return null==e?void 0:e[t]};var Yo=function(e,t){var n=Ko(e,t);return $o(n)?n:void 0},Go=Yo(Zi.a,"Map"),Wo=Yo(Object,"create");var Zo=function(){this.__data__=Wo?Wo(null):{},this.size=0};var Qo=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Xo=Object.prototype.hasOwnProperty;var ea=function(e){var t=this.__data__;if(Wo){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Xo.call(t,e)?t[e]:void 0},ta=Object.prototype.hasOwnProperty;var na=function(e){var t=this.__data__;return Wo?void 0!==t[e]:ta.call(t,e)};var ra=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Wo&&void 0===t?"__lodash_hash_undefined__":t,this};function ia(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])}}ia.prototype.clear=Zo,ia.prototype.delete=Qo,ia.prototype.get=ea,ia.prototype.has=na,ia.prototype.set=ra;var oa=ia;var aa=function(){this.size=0,this.__data__={hash:new oa,map:new(Go||Io),string:new oa}};var ca=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var sa=function(e,t){var n=e.__data__;return ca(t)?n["string"==typeof t?"string":"hash"]:n.map};var ua=function(e){var t=sa(this,e).delete(e);return this.size-=t?1:0,t};var la=function(e){return sa(this,e).get(e)};var fa=function(e){return sa(this,e).has(e)};var pa=function(e,t){var n=sa(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function da(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])}}da.prototype.clear=aa,da.prototype.delete=ua,da.prototype.get=la,da.prototype.has=fa,da.prototype.set=pa;var ma=da;var ha=function(e,t){var n=this.__data__;if(n instanceof Io){var r=n.__data__;if(!Go||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ma(r)}return n.set(e,t),this.size=n.size,this};function ya(e){var t=this.__data__=new Io(e);this.size=t.size}ya.prototype.clear=To,ya.prototype.delete=ko,ya.prototype.get=Lo,ya.prototype.has=_o,ya.prototype.set=ha;var va=ya;var ba=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},ga=function(){try{var e=Yo(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Sa=function(e,t,n){"__proto__"==t&&ga?ga(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Ea=Object.prototype.hasOwnProperty;var Oa=function(e,t,n){var r=e[t];Ea.call(e,t)&&go(r,n)&&(void 0!==n||t in e)||Sa(e,t,n)};var Ca=function(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var c=t[o],s=r?r(n[c],e[c],c,n,e):void 0;void 0===s&&(s=e[c]),i?Sa(n,c,s):Oa(n,c,s)}return n};var Aa=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var ja=function(e){return lo(e)&&"[object Arguments]"==co(e)},wa=Object.prototype,Ia=wa.hasOwnProperty,Ta=wa.propertyIsEnumerable,ka=ja(function(){return arguments}())?ja:function(e){return lo(e)&&Ia.call(e,"callee")&&!Ta.call(e,"callee")},La=Array.isArray,_a=n(21),Pa=/^(?:0|[1-9]\d*)$/;var xa=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Pa.test(e))&&e>-1&&e%1==0&&e<t};var Na=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ra={};Ra["[object Float32Array]"]=Ra["[object Float64Array]"]=Ra["[object Int8Array]"]=Ra["[object Int16Array]"]=Ra["[object Int32Array]"]=Ra["[object Uint8Array]"]=Ra["[object Uint8ClampedArray]"]=Ra["[object Uint16Array]"]=Ra["[object Uint32Array]"]=!0,Ra["[object Arguments]"]=Ra["[object Array]"]=Ra["[object ArrayBuffer]"]=Ra["[object Boolean]"]=Ra["[object DataView]"]=Ra["[object Date]"]=Ra["[object Error]"]=Ra["[object Function]"]=Ra["[object Map]"]=Ra["[object Number]"]=Ra["[object Object]"]=Ra["[object RegExp]"]=Ra["[object Set]"]=Ra["[object String]"]=Ra["[object WeakMap]"]=!1;var Da=function(e){return lo(e)&&Na(e.length)&&!!Ra[co(e)]};var Ma=function(e){return function(t){return e(t)}},Ua=n(10),Fa=Ua.a&&Ua.a.isTypedArray,Va=Fa?Ma(Fa):Da,Ba=Object.prototype.hasOwnProperty;var za=function(e,t){var n=La(e),r=!n&&ka(e),i=!n&&!r&&Object(_a.a)(e),o=!n&&!r&&!i&&Va(e),a=n||r||i||o,c=a?Aa(e.length,String):[],s=c.length;for(var u in e)!t&&!Ba.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||xa(u,s))||c.push(u);return c},Ha=Object.prototype;var qa=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ha)},Ja=so(Object.keys,Object),$a=Object.prototype.hasOwnProperty;var Ka=function(e){if(!qa(e))return Ja(e);var t=[];for(var n in Object(e))$a.call(e,n)&&"constructor"!=n&&t.push(n);return t};var Ya=function(e){return null!=e&&Na(e.length)&&!No(e)};var Ga=function(e){return Ya(e)?za(e):Ka(e)};var Wa=function(e,t){return e&&Ca(t,Ga(t),e)};var Za=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},Qa=Object.prototype.hasOwnProperty;var Xa=function(e){if(!Po(e))return Za(e);var t=qa(e),n=[];for(var r in e)("constructor"!=r||!t&&Qa.call(e,r))&&n.push(r);return n};var ec=function(e){return Ya(e)?za(e,!0):Xa(e)};var tc=function(e,t){return e&&Ca(t,ec(t),e)},nc=n(132);var rc=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var ic=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o};var oc=function(){return[]},ac=Object.prototype.propertyIsEnumerable,cc=Object.getOwnPropertySymbols,sc=cc?function(e){return null==e?[]:(e=Object(e),ic(cc(e),(function(t){return ac.call(e,t)})))}:oc;var uc=function(e,t){return Ca(e,sc(e),t)};var lc=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},fc=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)lc(t,sc(e)),e=uo(e);return t}:oc;var pc=function(e,t){return Ca(e,fc(e),t)};var dc=function(e,t,n){var r=t(e);return La(e)?r:lc(r,n(e))};var mc=function(e){return dc(e,Ga,sc)};var hc=function(e){return dc(e,ec,fc)},yc=Yo(Zi.a,"DataView"),vc=Yo(Zi.a,"Promise"),bc=Yo(Zi.a,"Set"),gc=Yo(Zi.a,"WeakMap"),Sc=Fo(yc),Ec=Fo(Go),Oc=Fo(vc),Cc=Fo(bc),Ac=Fo(gc),jc=co;(yc&&"[object DataView]"!=jc(new yc(new ArrayBuffer(1)))||Go&&"[object Map]"!=jc(new Go)||vc&&"[object Promise]"!=jc(vc.resolve())||bc&&"[object Set]"!=jc(new bc)||gc&&"[object WeakMap]"!=jc(new gc))&&(jc=function(e){var t=co(e),n="[object Object]"==t?e.constructor:void 0,r=n?Fo(n):"";if(r)switch(r){case Sc:return"[object DataView]";case Ec:return"[object Map]";case Oc:return"[object Promise]";case Cc:return"[object Set]";case Ac:return"[object WeakMap]"}return t});var wc=jc,Ic=Object.prototype.hasOwnProperty;var Tc=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ic.call(e,"index")&&(n.index=e.index,n.input=e.input),n},kc=Zi.a.Uint8Array;var Lc=function(e){var t=new e.constructor(e.byteLength);return new kc(t).set(new kc(e)),t};var _c=function(e,t){var n=t?Lc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},Pc=/\w*$/;var xc=function(e){var t=new e.constructor(e.source,Pc.exec(e));return t.lastIndex=e.lastIndex,t},Nc=Qi?Qi.prototype:void 0,Rc=Nc?Nc.valueOf:void 0;var Dc=function(e){return Rc?Object(Rc.call(e)):{}};var Mc=function(e,t){var n=t?Lc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var Uc=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return Lc(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return _c(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 Mc(e,n);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return xc(e);case"[object Set]":return new r;case"[object Symbol]":return Dc(e)}},Fc=Object.create,Vc=function(){function e(){}return function(t){if(!Po(t))return{};if(Fc)return Fc(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var Bc=function(e){return"function"!=typeof e.constructor||qa(e)?{}:Vc(uo(e))};var zc=function(e){return lo(e)&&"[object Map]"==wc(e)},Hc=Ua.a&&Ua.a.isMap,qc=Hc?Ma(Hc):zc;var Jc=function(e){return lo(e)&&"[object Set]"==wc(e)},$c=Ua.a&&Ua.a.isSet,Kc=$c?Ma($c):Jc,Yc={};Yc["[object Arguments]"]=Yc["[object Array]"]=Yc["[object ArrayBuffer]"]=Yc["[object DataView]"]=Yc["[object Boolean]"]=Yc["[object Date]"]=Yc["[object Float32Array]"]=Yc["[object Float64Array]"]=Yc["[object Int8Array]"]=Yc["[object Int16Array]"]=Yc["[object Int32Array]"]=Yc["[object Map]"]=Yc["[object Number]"]=Yc["[object Object]"]=Yc["[object RegExp]"]=Yc["[object Set]"]=Yc["[object String]"]=Yc["[object Symbol]"]=Yc["[object Uint8Array]"]=Yc["[object Uint8ClampedArray]"]=Yc["[object Uint16Array]"]=Yc["[object Uint32Array]"]=!0,Yc["[object Error]"]=Yc["[object Function]"]=Yc["[object WeakMap]"]=!1;var Gc=function e(t,n,r,i,o,a){var c,s=1&n,u=2&n,l=4&n;if(r&&(c=o?r(t,i,o,a):r(t)),void 0!==c)return c;if(!Po(t))return t;var f=La(t);if(f){if(c=Tc(t),!s)return rc(t,c)}else{var p=wc(t),d="[object Function]"==p||"[object GeneratorFunction]"==p;if(Object(_a.a)(t))return Object(nc.a)(t,s);if("[object Object]"==p||"[object Arguments]"==p||d&&!o){if(c=u||d?{}:Bc(t),!s)return u?pc(t,tc(c,t)):uc(t,Wa(c,t))}else{if(!Yc[p])return o?t:{};c=Uc(t,p,s)}}a||(a=new va);var m=a.get(t);if(m)return m;a.set(t,c),Kc(t)?t.forEach((function(i){c.add(e(i,n,r,i,t,a))})):qc(t)&&t.forEach((function(i,o){c.set(o,e(i,n,r,o,t,a))}));var h=l?u?hc:mc:u?keysIn:Ga,y=f?void 0:h(t);return ba(y||t,(function(i,o){y&&(i=t[o=i]),Oa(c,o,e(i,n,r,o,t,a))})),c};var Wc=function(e){return Gc(e,4)};var Zc=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 Qc=function(e){return"symbol"==typeof e||lo(e)&&"[object Symbol]"==co(e)};function Xc(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],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Xc.Cache||ma),n}Xc.Cache=ma;var es=Xc;var ts=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ns=/\\(\\)?/g,rs=function(e){var t=es(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(ts,(function(e,n,r,i){t.push(r?i.replace(ns,"$1"):n||e)})),t}));var is=function(e){if("string"==typeof e||Qc(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},os=Qi?Qi.prototype:void 0,as=os?os.toString:void 0;var cs=function e(t){if("string"==typeof t)return t;if(La(t))return Zc(t,e)+"";if(Qc(t))return as?as.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var ss=function(e){return null==e?"":cs(e)};var us=function(e){return La(e)?Zc(e,is):Qc(e)?[e]:rc(rs(ss(e)))};var ls=function(e,t){},fs=n(32),ps=n(33),ds=n.n(ps);var ms=function(e){return Gc(e,5)};function hs(){return(hs=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 ys(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function vs(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function bs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var gs=function(e){return"function"==typeof e},Ss=function(e){return null!==e&&"object"==typeof e},Es=function(e){return String(Math.floor(Number(e)))===e},Os=function(e){return"[object String]"===Object.prototype.toString.call(e)},Cs=function(e){return 0===d.Children.count(e)},As=function(e){return Ss(e)&&gs(e.then)};function js(e,t,n,r){void 0===r&&(r=0);for(var i=us(t);e&&r<i.length;)e=e[i[r++]];return void 0===e?n:e}function ws(e,t,n){for(var r=Wc(e),i=r,o=0,a=us(t);o<a.length-1;o++){var c=a[o],s=js(e,a.slice(0,o+1));if(s&&(Ss(s)||Array.isArray(s)))i=i[c]=Wc(s);else{var u=a[o+1];i=i[c]=Es(u)&&Number(u)>=0?[]:{}}}return(0===o?e:i)[a[o]]===n?e:(void 0===n?delete i[a[o]]:i[a[o]]=n,0===o&&void 0===n&&delete r[a[o]],r)}function Is(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var i=0,o=Object.keys(e);i<o.length;i++){var a=o[i],c=e[a];Ss(c)?n.get(c)||(n.set(c,!0),r[a]=Array.isArray(c)?[]:{},Is(c,t,n,r[a])):r[a]=t}return r}var Ts=Object(d.createContext)(void 0),ks=Ts.Provider,Ls=Ts.Consumer;function _s(){var e=Object(d.useContext)(Ts);return e||ls(!1),e}function Ps(e,t){switch(t.type){case"SET_VALUES":return hs({},e,{values:t.payload});case"SET_TOUCHED":return hs({},e,{touched:t.payload});case"SET_ERRORS":return hs({},e,{errors:t.payload});case"SET_STATUS":return hs({},e,{status:t.payload});case"SET_ISSUBMITTING":return hs({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return hs({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return hs({},e,{values:ws(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return hs({},e,{touched:ws(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return hs({},e,{errors:ws(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return hs({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return hs({},e,{touched:Is(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return hs({},e,{isSubmitting:!1});default:return e}}var xs={},Ns={};function Rs(e){var t=e.validateOnChange,n=void 0===t||t,r=e.validateOnBlur,i=void 0===r||r,o=e.validateOnMount,a=void 0!==o&&o,c=e.isInitialValid,s=e.enableReinitialize,u=void 0!==s&&s,l=e.onSubmit,f=vs(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),p=hs({validateOnChange:n,validateOnBlur:i,validateOnMount:a,onSubmit:l},f),m=Object(d.useRef)(p.initialValues),h=Object(d.useRef)(p.initialErrors||xs),y=Object(d.useRef)(p.initialTouched||Ns),v=Object(d.useRef)(p.initialStatus),b=Object(d.useRef)(!1),g=Object(d.useRef)({});Object(d.useEffect)((function(){0}),[]),Object(d.useEffect)((function(){return b.current=!0,function(){b.current=!1}}),[]);var S=Object(d.useReducer)(Ps,{values:p.initialValues,errors:p.initialErrors||xs,touched:p.initialTouched||Ns,status:p.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),E=S[0],O=S[1],C=Object(d.useCallback)((function(e,t){return new Promise((function(n,r){var i=p.validate(e,t);null==i?n(xs):As(i)?i.then((function(e){n(e||xs)}),(function(e){r(e)})):n(i)}))}),[p.validate]),A=Object(d.useCallback)((function(e,t){var n=p.validationSchema,r=gs(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)||vo(t)?e(t):""!==t?t:void 0})):vo(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(xs)}),(function(n){"ValidationError"===n.name?e(function(e){var t={};if(e.inner){if(0===e.inner.length)return ws(t,e.path,e.message);var n=e.inner,r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if((i=n.next()).done)break;o=i.value}var a=o;js(t,a.path)||(t=ws(t,a.path,a.message))}}return t}(n)):t(n)}))}))}),[p.validationSchema]),j=Object(d.useCallback)((function(e,t){return new Promise((function(n){return n(g.current[e].validate(t))}))}),[]),w=Object(d.useCallback)((function(e){var t=Object.keys(g.current).filter((function(e){return gs(g.current[e].validate)})),n=t.length>0?t.map((function(t){return j(t,js(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=ws(e,t[r],n)),e}),{})}))}),[j]),I=Object(d.useCallback)((function(e){return Promise.all([w(e),p.validationSchema?A(e):{},p.validate?C(e):{}]).then((function(e){var t=e[0],n=e[1],r=e[2];return Wi.all([t,n,r],{arrayMerge:Ms})}))}),[p.validate,p.validationSchema,w,C,A]),T=Fs((function(e){return void 0===e&&(e=E.values),Object(fs.unstable_runWithPriority)(fs.LowPriority,(function(){return I(e).then((function(e){return b.current&&O({type:"SET_ERRORS",payload:e}),e}))}))})),k=Fs((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}),qi()(E.errors,e)||O({type:"SET_ERRORS",payload:e})),e}))}));Object(d.useEffect)((function(){a&&!0===b.current&&T(p.initialValues)}),[p.initialValues,a,T]);var L=Object(d.useCallback)((function(e){var t=e&&e.values?e.values:m.current,n=e&&e.errors?e.errors:h.current?h.current:p.initialErrors||{},r=e&&e.touched?e.touched:y.current?y.current:p.initialTouched||{},i=e&&e.status?e.status:v.current?v.current:p.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}})}),[p.initialErrors,p.initialStatus,p.initialTouched]);Object(d.useEffect)((function(){u&&!0===b.current&&!qi()(m.current,p.initialValues)&&(m.current=p.initialValues,L())}),[u,p.initialValues,L]),Object(d.useEffect)((function(){u&&!0===b.current&&!qi()(h.current,p.initialErrors)&&(h.current=p.initialErrors||xs,O({type:"SET_ERRORS",payload:p.initialErrors||xs}))}),[u,p.initialErrors]),Object(d.useEffect)((function(){u&&!0===b.current&&!qi()(y.current,p.initialTouched)&&(y.current=p.initialTouched||Ns,O({type:"SET_TOUCHED",payload:p.initialTouched||Ns}))}),[u,p.initialTouched]),Object(d.useEffect)((function(){u&&!0===b.current&&!qi()(v.current,p.initialStatus)&&(v.current=p.initialStatus,O({type:"SET_STATUS",payload:p.initialStatus}))}),[u,p.initialStatus,p.initialTouched]);var _=Fs((function(e){if(gs(g.current[e].validate)){var t=js(E.values,e),n=g.current[e].validate(t);return As(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(d.useCallback)((function(e,t){var n=t.validate;g.current[e]={validate:n}}),[]),x=Object(d.useCallback)((function(e){delete g.current[e]}),[]),N=Fs((function(e){return O({type:"SET_TOUCHED",payload:e}),i?T(E.values):Promise.resolve()})),R=Object(d.useCallback)((function(e){O({type:"SET_ERRORS",payload:e})}),[]),D=Fs((function(e){return O({type:"SET_VALUES",payload:e}),n?T(e):Promise.resolve()})),M=Object(d.useCallback)((function(e,t){O({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),U=Fs((function(e,t,r){return void 0===r&&(r=!0),O({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),n&&r?T(ws(E.values,e,t)):Promise.resolve()})),F=Object(d.useCallback)((function(e,t){var n,r=t,i=e;if(!Os(e)){e.persist&&e.persist();var o=e.target,a=o.type,c=o.name,s=o.id,u=o.value,l=o.checked,f=(o.outerHTML,o.options),p=o.multiple;r=t||(c||s),i=/number|range/.test(a)?(n=parseFloat(u),isNaN(n)?"":n):/checkbox/.test(a)?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))}(js(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(d.useCallback)((function(e){if(Os(e))return function(t){return F(t,e)};F(e)}),[F]),B=Fs((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?T(E.values):Promise.resolve()})),z=Object(d.useCallback)((function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,i=n.id,o=(n.outerHTML,t||(r||i));B(o,!0)}),[B]),H=Object(d.useCallback)((function(e){if(Os(e))return function(t){return z(t,e)};z(e)}),[z]),q=Object(d.useCallback)((function(e){gs(e)?O({type:"SET_FORMIK_STATE",payload:e}):O({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),J=Object(d.useCallback)((function(e){O({type:"SET_STATUS",payload:e})}),[]),$=Object(d.useCallback)((function(e){O({type:"SET_ISSUBMITTING",payload:e})}),[]),K={resetForm:L,validateForm:k,validateField:_,setErrors:R,setFieldError:M,setFieldTouched:B,setFieldValue:U,setStatus:J,setSubmitting:$,setTouched:N,setValues:D,setFormikState:q},Y=Fs((function(){return l(E.values,K)})),G=Fs((function(){return O({type:"SUBMIT_ATTEMPT"}),k().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=Fs((function(e){e&&e.preventDefault&&gs(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&gs(e.stopPropagation)&&e.stopPropagation(),G()})),Z=Fs((function(e){if(e&&e.preventDefault&&gs(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&gs(e.stopPropagation)&&e.stopPropagation(),p.onReset){var t=p.onReset(E.values,K);As(t)?t.then(L):L()}else L()})),Q=Object(d.useCallback)((function(e){return{value:js(E.values,e),error:js(E.errors,e),touched:!!js(E.touched,e),initialValue:js(m.current,e),initialTouched:!!js(y.current,e),initialError:js(h.current,e)}}),[E.errors,E.touched,E.values]),X=Object(d.useCallback)((function(e){var t=Ss(e),n=t?e.name:e,r=js(E.values,n),i={name:n,value:r,onChange:V,onBlur:H};if(t){var o=e.type,a=e.value,c=e.as,s=e.multiple;"checkbox"===o?void 0===a?i.checked=!!r:(i.checked=!(!Array.isArray(r)||!~r.indexOf(a)),i.value=a):"radio"===o?(i.checked=r===a,i.value=a):"select"===c&&s&&(i.value=i.value||[],i.multiple=!0)}return i}),[H,V,E.values]),ee=Object(d.useMemo)((function(){return!qi()(m.current,E.values)}),[E.values]),te=Object(d.useMemo)((function(){return void 0!==c?ee?E.errors&&0===Object.keys(E.errors).length:!1!==c&&gs(c)?c(p):c:E.errors&&0===Object.keys(E.errors).length}),[c,ee,E.errors,p]);return hs({},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:k,validateField:_,isValid:te,dirty:ee,unregisterField:x,registerField:P,getFieldProps:X,getFieldMeta:Q,validateOnBlur:i,validateOnChange:n,validateOnMount:a})}function Ds(e){var t=Rs(e),n=e.component,r=e.children,i=e.render;return Object(d.useEffect)((function(){0}),[]),Object(d.createElement)(ks,{value:t},n?Object(d.createElement)(n,t):i?i(t):r?gs(r)?r(t):Cs(r)?null:d.Children.only(r):null)}function Ms(e,t,n){var r=e.slice();return t.forEach((function(t,i){if(void 0===r[i]){var o=!1!==n.clone&&n.isMergeableObject(t);r[i]=o?Wi(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[i]=Wi(e[i],t,n):-1===e.indexOf(t)&&r.push(t)})),r}var Us="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?d.useLayoutEffect:d.useEffect;function Fs(e){var t=Object(d.useRef)(e);return Us((function(){t.current=e})),Object(d.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 Vs(e){var t=e.validate,n=e.name,r=e.render,i=e.children,o=e.as,a=e.component,c=vs(e,["validate","name","render","children","as","component"]),s=_s(),u=(s.validate,s.validationSchema,vs(s,["validate","validationSchema"]));Object(d.useEffect)((function(){0}),[]);var l=u.registerField,f=u.unregisterField;Object(d.useEffect)((function(){return l(n,{validate:t}),function(){f(n)}}),[l,f,n,t]);var p=u.getFieldProps(hs({name:n},c)),m=u.getFieldMeta(n),h={field:p,form:u};if(r)return r(hs({},h,{meta:m}));if(gs(i))return i(hs({},h,{meta:m}));if(a){if("string"==typeof a){var y=c.innerRef,v=vs(c,["innerRef"]);return Object(d.createElement)(a,hs({ref:y},p,v),i)}return Object(d.createElement)(a,hs({field:p,form:u},c),i)}var b=o||"input";if("string"==typeof b){var g=c.innerRef,S=vs(c,["innerRef"]);return Object(d.createElement)(b,hs({ref:g},p,S),i)}return Object(d.createElement)(b,hs({},p,c),i)}var Bs=Object(d.forwardRef)((function(e,t){var n=e.action,r=vs(e,["action"]),i=n||"#",o=_s(),a=o.handleReset,c=o.handleSubmit;return Object(d.createElement)("form",Object.assign({onSubmit:c,ref:t,onReset:a,action:i},r))}));function zs(e){var t=function(t){return Object(d.createElement)(Ls,null,(function(n){return n||ls(!1),Object(d.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+")",ds()(t,e)}Bs.displayName="Form";var Hs=function(e,t,n){var r=qs(e);return r.splice(t,0,n),r},qs=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(hs({},e,{length:t+1}))}return[]},Js=function(e){function t(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var i=n.props,o=i.name,a=i.validateOnChange,c=i.formik,s=c.setFormikState,u=c.validateForm;s((function(n){var i="function"==typeof r?r:e,a="function"==typeof t?t:e;return hs({},n,{values:ws(n.values,o,e(js(n.values,o))),errors:r?ws(n.errors,o,i(js(n.errors,o))):n.errors,touched:t?ws(n.touched,o,a(js(n.touched,o))):n.touched})}),(function(){a&&u()}))},n.push=function(e){return n.updateArrayField((function(t){return[].concat(qs(t),[ms(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=qs(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=qs(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 Hs(n,e,t)}),(function(t){return Hs(t,e,null)}),(function(t){return Hs(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=qs(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(bs(n)),n.pop=n.pop.bind(bs(n)),n}ys(t,e);var n=t.prototype;return n.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?qs(n):[];return t||(t=r[e]),gs(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,o=t.name,a=t.formik,c=(a.validate,a.validationSchema,hs({},e,{form:vs(a,["validate","validationSchema"]),name:o}));return n?Object(d.createElement)(n,c):r?r(c):i?"function"==typeof i?i(c):Cs(i)?null:d.Children.only(i):null},t}(d.Component);Js.defaultProps={validateOnChange:!0};var $s=zs(function(e){function t(){return e.apply(this,arguments)||this}ys(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return js(this.props.formik.errors,this.props.name)!==js(e.formik.errors,this.props.name)||js(this.props.formik.touched,this.props.name)!==js(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,o=e.name,a=vs(e,["component","formik","render","children","name"]),c=js(n.touched,o),s=js(n.errors,o);return c&&s?r?gs(r)?r(s):null:i?gs(i)?i(s):null:t?Object(d.createElement)(t,a,s):s:null},t}(d.Component));(function(e){function t(t){var n;n=e.call(this,t)||this;var r=t.render,i=t.children,o=t.component,a=t.as;t.name;return r&&ls(!1),o&&r&&ls(!1),a&&i&&gs(i)&&ls(!1),o&&i&&gs(i)&&ls(!1),r&&i&&!Cs(i)&&ls(!1),n}ys(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e,t,n){return this.props.shouldUpdate?this.props.shouldUpdate(e,this.props):js(this.context.values,this.props.name)!==js(n.values,this.props.name)||js(this.context.errors,this.props.name)!==js(n.errors,this.props.name)||js(this.context.touched,this.props.name)!==js(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,o=e.component,a=(e.shouldUpdate,vs(e,["validate","name","render","as","children","component","shouldUpdate"])),c=this.context,s=(c.validate,c.validationSchema,vs(c,["validate","validationSchema"])),u={value:"radio"===a.type||"checkbox"===a.type?a.value:js(c.values,t),name:t,onChange:c.handleChange,onBlur:c.handleBlur},l={field:u,meta:{value:js(c.values,t),error:js(c.errors,t),touched:!!js(c.touched,t),initialValue:js(c.initialValues,t),initialTouched:!!js(c.initialTouched,t),initialError:js(c.initialErrors,t)},form:s};if(n)return n(l);if(gs(i))return i(l);if(o){if("string"==typeof o){var f=a.innerRef,p=vs(a,["innerRef"]);return Object(d.createElement)(o,hs({ref:f},u,p),i)}return Object(d.createElement)(o,hs({field:u,form:c},a),i)}var m=r||"input";if("string"==typeof m){var h=a.innerRef,y=vs(a,["innerRef"]);return Object(d.createElement)(m,hs({ref:h},u,y),i)}return Object(d.createElement)(m,hs({},u,a),i)},t}(d.Component)).contextType=Ts;var Ks=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 Ys(e){var t=e.castInitialValues,n=e.castValuesOnSubmit,r=e.initialValues,i=e.onSubmit,o=e.resetOnSubmit,a=Ks(e,["castInitialValues","castValuesOnSubmit","initialValues","onSubmit","resetOnSubmit"]),c=t&&e.validationSchema?e.validationSchema.cast(function e(t){var n=Rr.deepClone(t);return Object.keys(n).forEach((function(t){n.hasOwnProperty(t)&&(Rr.isObject(n[t])?n[t]=e(n[t]):null===n[t]&&delete n[t])})),n}(r)):r,s={allowInitialSubmit:e.allowInitialSubmit};return d.createElement(Ds,Object.assign({enableReinitialize:!0},a,{initialValues:c,onSubmit:function(t,r){var a=r.setSubmitting,c=r.resetForm,s=n&&e.validationSchema?e.validationSchema.cast(t):t;i(s,(function(){o&&c(),a(!1)}))},initialStatus:s}),hn(e.children)?function(t){return e.children(t)}:d.Children.count(e.children)?e.children:null)}Ys.defaultProps={castInitialValues:!0,castValuesOnSubmit:!0};var Gs=n(2),Ws=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown(),Zs=n(3),Qs=function(e,t,n,r){var i="form-control";return js(t,n)&&js(e,n)&&(i+=" is-invalid"),r&&(i+=" ".concat(r)),i};function Xs(e){var t=_s().values[e.fieldName];return"string"!=typeof t?d.createElement(d.Fragment,null):d.createElement("div",{className:"float-right text-muted"},t.length,"/",e.limit)}var eu=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 tu(e){var t=e.label,n=eu(e,["label"]);return d.createElement(Zs.Form.Group,null,d.createElement("div",{className:"custom-control custom-checkbox"},d.createElement(ru,Object.assign({className:"custom-control-input"},n)),d.createElement(Zs.Form.Label,{className:"custom-control-label",htmlFor:n.id},t)))}var nu=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 ru(e){var t=e.children,n=nu(e,["children"]);return d.createElement(Vs,Object.assign({},n),hn(t)?function(e){return t(e)}:d.Children.count(t)?t:null)}function iu(e){var t=e.label,n=e.className,r=e.showCharacterCounter,i=nu(e,["label","className","showCharacterCounter"]),o=_s(),a=o.errors,c=o.touched;return"checkbox"===i.type?d.createElement(tu,Object.assign({},e)):d.createElement(Zs.Form.Group,null,!!t&&d.createElement(Zs.Form.Label,{htmlFor:i.id},t),d.createElement(ru,Object.assign({className:Qs(a,c,i.name,n)},i)),!!r&&!!i.maxLength&&d.createElement(Xs,{fieldName:i.name,limit:i.maxLength}),d.createElement($s,{name:i.name},(function(e){return d.createElement(Zs.Form.Control.Feedback,{type:"invalid"},e)})))}function ou(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return au(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 au(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 au(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 cu(e){var t,n=ou(d.useState(!1),2),r=n[0],i=n[1];return d.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]),d.useEffect((function(){e.isSubmitting&&i(!1)}),[e.isSubmitting]),r}function su(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return uu(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 uu(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 uu(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 lu=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 fu(e){var t=e.showSpinner,n=e.children,r=lu(e,["showSpinner","children"]),i=d.useRef(),o=su(d.useState({}),2),a=o[0],c=o[1];return d.useEffect((function(){var e=a.width,t=a.height;if(!e||!t){var n=i.current,r=n.offsetHeight,o=n.offsetWidth;r&&o&&c({width:o,height:r})}})),d.useEffect((function(){var e=a.width,t=a.height;if(e&&t){var n=i.current;n.style.width="".concat(e+1,"px"),n.style.height="".concat(t+1,"px")}}),[a]),d.createElement(Zs.Button,Object.assign({ref:i,disabled:t},r),t?d.createElement(Zs.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):n)}var pu=n(133),du=n(22),mu="AlertService",hu="LanguageService";function yu(e){return(yu="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 vu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bu(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 gu(e,t){return(gu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Su(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ou(e);if(t){var i=Ou(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Eu(this,n)}}function Eu(e,t){return!t||"object"!==yu(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 Ou(e){return(Ou=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Cu=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&&gu(e,t)}(o,e);var t,n,r,i=Su(o);function o(){return vu(this,o),i.apply(this,arguments)}return t=o,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"setConfig",value:function(e){this.polyglot=new pu({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||K.throw(new Xe("LanguageService config must be set.")),!this.polyglot.has(r)){if(!L.isDevelopment){var i=window.trackJs;return i&&i.console.error("No phrase set for ".concat(r," in language config")),""}K.throw(new Xe("No phrase set for ".concat(r," in language config.")))}if(!n||h.isEmpty(n)){var o=this.cache[r];if(o)return o;var a=this.polyglot.t(r);return this.cache[r]=a,a}var c=h.omit(n,"smartCount"),s={};for(var u in c)s[u]=du.sanitize(c[u]);h.isNumber(n.smartCount)&&(s.smart_count=n.smartCount);var l="".concat(r,":").concat(h.values(Object.assign({},s)).join(":")),f=this.cache[l];if(f)return f;var p=this.polyglot.t(r,s);return this.cache[l]=p,p}},{key:"encloseNamespace",value:function(e){var t=this;return function(n,r){return t.getPhrase(e,n,r)}}},{key:"name",get:function(){return hu}}])&&bu(t.prototype,n),r&&bu(t,r),o}(Yt).Instance,Au=d.createContext(""),ju=d.memo((function(e){var t=e.phrase,n=e.namespace,r=e.options,i=d.useContext(Au),o=n||i,a=Cu.getPhrase(o,t,r);return d.createElement("span",{dangerouslySetInnerHTML:{__html:a}})}),(function(e,t){return e.namespace===t.namespace&&e.phrase===t.phrase&&Rr.isEqual(e.options,t.options)}));function wu(e){var t=_s(),n=cu(t);d.useEffect((function(){function e(e){13===e.keyCode&&n&&t.validateForm().then((function(e){Object.keys(e).length||t.submitForm()}))}return window.addEventListener("keypress",e),function(){return window.removeEventListener("keypress",e)}}),[n]);var r="save";return e.isNew&&(r="create"),e.hasNext&&(r="next"),d.createElement(fu,{variant:e.variant||"primary",showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.submitText?d.createElement(d.Fragment,null,e.submitText):d.createElement(ju,{namespace:"shared.formButtons",phrase:r}))}function Iu(e){var t=_s();return d.createElement(Bs,null,d.createElement(iu,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this company",autoFocus:!0}),d.createElement(wu,{isNew:e.isNew}))}function Tu(e){return d.createElement(Ys,{initialValues:e.company,validationSchema:Ws,onSubmit:e.saveCompany},d.createElement(Iu,{isNew:!(e.company&&e.company.id)}))}function ku(e){var t=Object(bn.useDispatch)(),n=i.useBasicFetch(Vi(e.id));return d.createElement(d.Fragment,null,!!n.data&&d.createElement(Tu,{company:n.data,saveCompany:function(n,r){return i.fetch(t,zi(e.id,n,r))}}))}function Lu(){var e=Object(bn.useDispatch)();return d.createElement(Tu,{saveCompany:function(t,n){i.fetch(e,Bi(t,(function(e){n(),r.AppLinkHelper.trigger({application:l.PEOPLE,action:a.Companies.EDIT_COMPANY,args:[e.id]})}),n))}})}var _u,Pu=n(134);function xu(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Nu(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 Nu(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 Nu(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 Ru(e){return(Ru="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)"}(_u||(_u={}));var Du,Mu={isNumber:function(e){return Mu.isType(e,"number")},isString:function(e){return Mu.isType(e,"string")},isType:function(e,t){return Ru(e)===t}},Uu=n(14),Fu=n.n(Uu);function Vu(e){return function(e){if(Array.isArray(e))return Bu(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 Bu(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 Bu(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 Bu(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}function Hu(e,t){return Rr.isObject(e)&&e.hasOwnProperty(t)&&Mu.isString(e[t])}function qu(e,t,n){return function(r){var o=r.value;if(o.length||n(),!(o.length<e.activationLength)){if(e.local){var a=hn(e.getLocalSuggestions)?e.getLocalSuggestions(o,e.local):(c=o,s=e.local,u=e.valueKey,(l=c.trim().toLowerCase()).length?s.filter((function(e){return!(!Hu(e,u)||!Mu.isString(e[u]))&&e[u].trim().toLowerCase().includes(l)})):[]);t((function(e){return Object.assign(Object.assign({},e),zu({},Du.Local,a))}))}var c,s,u,l;e.getRemoteUrl&&function(e,t,n){var r=hn(e)&&e(t);r&&i.ajaxRequest({resource:r,type:Cr.GET,success:n,error:function(){}})}(e.getRemoteUrl,o,(function(n){return t((function(t){return Object.assign(Object.assign({},t),zu({},Du.Remote,hn(e.formatRemoteSuggestions)?e.formatRemoteSuggestions(n):n))}))}))}}}function Ju(e,t,n,r,i,o){var a=function(t){return e[t]||[]},c=t?a(Du.Recent):[],s=a(Du.Local),u=a(Du.Remote),l=[];c.length&&l.push({title:n,data:c});var f=[].concat(Vu(s),Vu(u));return Number.isInteger(o)&&l.length>o&&f.slice(0,o),hn(i)?l.push.apply(l,Vu(i(f))):l.push({title:r,data:f}),l}function $u(e){return e.data}function Ku(e){if(e.title)return d.createElement("strong",null,e.title)}!function(e){e.Local="local",e.Recent="recent",e.Remote="remote"}(Du||(Du={}));var Yu={container:"position-relative",suggestionsContainerOpen:"bg-white py-1 border rounded ".concat(Fu.a.suggestionsContainerOpen),suggestionsList:"list-unstyled m-0",suggestion:"cursor-pointer py-1 px-2",suggestionHighlighted:Fu.a.suggestionHighlighted,sectionContainer:"border-bottom py-1 ".concat(Fu.a.sectionContainer)};function Gu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(Yu,e)}var Wu,Zu,Qu=n(15),Xu=n(35),el=n.n(Xu),tl=n(36),nl=n.n(tl),rl=n(37),il=n.n(rl),ol=n(38),al=n.n(ol),cl=(n(39),n(40),n(41)),sl=n.n(cl),ul=n(42),ll=n.n(ul),fl=n(43),pl=n.n(fl),dl=n(44),ml=n.n(dl),hl=n(45),yl=n.n(hl),vl=n(46),bl=n.n(vl),gl=n(47),Sl=n.n(gl),El=n(48),Ol=n.n(El),Cl=n(49),Al=n.n(Cl),jl=n(50),wl=n.n(jl),Il=n(51),Tl=n.n(Il),kl=n(52),Ll=n.n(kl),_l=n(53),Pl=n.n(_l),xl=n(54),Nl=n.n(xl),Rl=n(55),Dl=n.n(Rl),Ml=n(56),Ul=n.n(Ml),Fl=n(57),Vl=n.n(Fl),Bl=n(58),zl=n.n(Bl),Hl=n(59),ql=n.n(Hl),Jl=n(60),$l=n.n(Jl),Kl=n(61),Yl=n.n(Kl),Gl=(n(62),n(63)),Wl=n.n(Gl),Zl=n(64),Ql=n.n(Zl),Xl=n(65),ef=n.n(Xl),tf=(n(66),n(67),n(68)),nf=n.n(tf),rf=n(69),of=n.n(rf),af=n(70),cf=n.n(af),sf=n(71),uf=n.n(sf),lf=n(72),ff=n.n(lf),pf=n(73),df=n.n(pf),mf=(n(74),n(75)),hf=n.n(mf),yf=n(76),vf=n.n(yf),bf=n(77),gf=n.n(bf),Sf=n(78),Ef=n.n(Sf),Of=n(79),Cf=n.n(Of),Af=n(80),jf=n.n(Af),wf=n(81),If=n.n(wf),Tf=(n(82),n(83)),kf=n.n(Tf),Lf=n(84),_f=n.n(Lf),Pf=n(85),xf=n.n(Pf),Nf=n(86),Rf=n.n(Nf),Df=n(87),Mf=n.n(Df),Uf=n(88),Ff=n.n(Uf),Vf=n(89),Bf=n.n(Vf),zf=n(90),Hf=n.n(zf),qf=n(91),Jf=n.n(qf),$f=n(92),Kf=n.n($f),Yf=n(93),Gf=n.n(Yf),Wf=n(94),Zf=n.n(Wf),Qf=n(95),Xf=n.n(Qf),ep=n(96),tp=n.n(ep),np=n(97),rp=n.n(np),ip=n(98),op=n.n(ip),ap=(n(99),n(100),n(101),n(102)),cp=n.n(ap),sp=(n(103),n(104),n(105),n(106),n(107)),up=n.n(sp),lp=n(108),fp=n.n(lp),pp=(n(109),n(110),n(111),n(112)),dp=n.n(pp),mp=n(113),hp=n.n(mp),yp=n(114),vp=n.n(yp),bp=n(115),gp=n.n(bp),Sp=n(116),Ep=n.n(Sp),Op=n(117),Cp=n.n(Op),Ap=n(118),jp=n.n(Ap),wp=(n(119),n(120),n(121),n(122)),Ip=n.n(wp),Tp=n(123),kp=n.n(Tp),Lp=[el.a,il.a,al.a,sl.a,ml.a,yl.a,bl.a,Sl.a,pl.a,nl.a,Ol.a,Al.a,wl.a,Tl.a,Ll.a,ll.a,Pl.a,Nl.a,Dl.a,Ul.a,Yl.a,Vl.a,zl.a,ql.a,$l.a,Wl.a,cf.a,Kf.a,Zf.a,Gf.a,op.a,Xf.a,tp.a,rp.a,Ef.a,jf.a,Cf.a,Ql.a,ef.a,vf.a,gf.a,hf.a,nf.a,uf.a,_f.a,xf.a,ff.a,df.a,Rf.a,of.a,kf.a,Mf.a,Ff.a,If.a,Bf.a,Jf.a,Hf.a,up.a,fp.a,cp.a,vp.a,hp.a,dp.a,gp.a,Cp.a,Ep.a,jp.a,kp.a,Ip.a];function _p(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.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"}(Wu||(Wu={}));var Pp;function xp(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)}}h.extend(Qu.config,{autoReplaceSvg:!1,autoAddCss:!1,familyPrefix:"cv",autoA11y:!0,observeMutations:!1,replacementClass:"cv-svg",keepOriginalSource:!1}),(Zu=Qu.library).add.apply(Zu,function(e){if(Array.isArray(e))return _p(e)}(Pp=Lp)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(Pp)||function(e,t){if(e){if("string"==typeof e)return _p(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)?_p(e,t):void 0}}(Pp)||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 Np=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 Qu.icon(e,t.iconOptions||{})}},{key:"faIconLookup",value:function(e,t){var n=t.prefix,r=void 0===n?"cv":n;return Qu.findIconDefinition({prefix:r,iconName:e})}}])&&xp(t.prototype,n),r&&xp(t,r),e}().Instance,Rp=Wu,Dp=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return Math.floor(Math.random()*Math.floor(e))};function Mp(e){var t=e.title,n=e.placement,r=e.trigger,i=e.children;return d.createElement(Zs.OverlayTrigger,{placement:n,overlay:d.createElement(Zs.Tooltip,{id:"".concat(t,"-").concat(Dp())},t),trigger:r},d.createElement("span",null,i))}Mp.defaultProps={trigger:["hover","click","focus"],placement:"top"};var Up;function Fp(e){var t=e.svgName,n=e.className,r=void 0===n?"d-inline-block svg-container":n,i=e.tagName,o=void 0===i?"span":i,a=e.size,c=void 0===a?Up.Standard:a,s=e.onClick,u=e.title,l=e.tooltipPlacement,f=void 0===l?"right":l,p=o,m={dangerouslySetInnerHTML:{__html:Np.getSvg(t)},className:"".concat(r," ").concat(c),onClick:hn(s)?s:null};return u?d.createElement(Mp,{title:u,placement:f},d.createElement(p,Object.assign({},m))):d.createElement(p,Object.assign({},m))}!function(e){e.Standard="std",e.Small="sm",e.Medium="md",e.Large="lg",e.ExtraLarge="xlg",e.XXL="xxlg"}(Up||(Up={}));var Vp=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},Bp=function(e){var t="d-inline-block svg-container";return hn(e)?t+" cursor-pointer":t};function zp(e){var t=e.onClickSearchIcon,n=e.searchIconPlacement,r=e.className,i=Vp(e,["onClickSearchIcon","searchIconPlacement","className"]),o="form-control ".concat(Fu.a.input),a="input-group-text bg-white";"right"===n&&(o+=" border-right-0",a+=" pl-0"),"left"===n&&(o+=" border-left-0",a+=" pr-0"),r&&(o+=" ".concat(r));var c=function(){return d.createElement("div",{className:a},d.createElement(Fp,{svgName:Rp.Search,size:Up.Small,onClick:t,className:Bp(t)}))};return d.createElement("div",{className:"input-group"},"left"===n&&d.createElement("div",{className:"input-group-prepend"},d.createElement(c,null)),d.createElement("input",Object.assign({className:o},i)),"right"===n&&d.createElement("div",{className:"input-group-append"},d.createElement(c,null)))}function Hp(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qp(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 qp(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 qp(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 Jp,$p,Kp,Yp,Gp,Wp,Zp,Qp,Xp,ed,td,nd,rd,id,od,ad,cd,sd,ud,ld,fd,pd,dd,md=hn;function hd(e){var t,n,r,i=(t=e.initialSuggestions,n=e.recentSearches,zu(r={},Du.Recent,n),zu(r,Du.Local,t),zu(r,Du.Remote,[]),r),o=Hp(d.useState(e.initialQuery||""),2),a=o[0],c=o[1],s=Hp(d.useState(i),2),u=s[0],l=s[1],f=function(e){var t=xu(Object(d.useState)(window.matchMedia(e).matches),2),n=t[0],r=t[1];return Object(d.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}(_u.XS),p=function(){l(i)},m=function(t){t.preventDefault(),md(e.onSubmit)&&e.onSubmit(a)};return d.createElement("form",{onSubmit:m},d.createElement(Pu,{suggestions:Ju(u,!a,e.recentSearchHeading||Cu.getPhrase("shared.searchBar","recentSearchHeading"),e.suggestionsHeading,e.getSections,e.suggestionLimit),onSuggestionsFetchRequested:qu(e,l,p),onSuggestionsClearRequested:function(){e.alwaysRenderSuggestions||p()},onSuggestionSelected:function(t,n){var r=n.suggestion;e.clearQueryOnSelect&&c(""),e.onSuggestionSelected(r)},getSuggestionValue:function(t){return e.updateQueryOnSelection?function(e,t){return Hu(t,e)?t[e]:""}(e.valueKey,t):a},renderSuggestion:function(t){return md(e.getSuggestionComponent)?e.getSuggestionComponent(t):function(e,t){return Hu(t,e)?d.createElement(d.Fragment,null,t[e]):d.createElement(d.Fragment,null)}(e.valueKey,t)},alwaysRenderSuggestions:e.alwaysRenderSuggestions,focusInputOnSuggestionClick:!f,inputProps:{placeholder:e.placeholder||Cu.getPhrase("shared.searchBar","placeholder"),value:a,onChange:function(t,n){var r=n.newValue;c(r),md(e.onQueryChange)&&e.onQueryChange(r)},onKeyDown:function(t){8===t.keyCode&&e.onBackspace&&!a&&e.onBackspace()},autoFocus:!!e.autoFocusInput,onClickSearchIcon:!!e.submitOnClickSearchIcon&&m,searchIconPlacement:e.searchIconPlacement},renderInputComponent:zp,theme:Gu(e.theme),multiSection:!0,renderSectionTitle:Ku,getSectionSuggestions:$u}))}function yd(e){return(yd="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 vd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bd(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 gd(e,t){return(gd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Sd(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Od(e);if(t){var i=Od(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ed(this,n)}}function Ed(e,t){return!t||"object"!==yd(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 Od(e){return(Od=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}hd.defaultProps={updateQueryOnSelection:!0,valueKey:"name",activationLength:3,suggestionLimit:5,recentSearches:[],initialSuggestions:[],searchIconPlacement:"right"},function(e){e.Stream="cv_product_stream",e.StreamRaw="cv_product_stream_raw",e.WebPlayerStream="cv_product_webplayer_stream",e.StreamProgress="cv_product_stream_progress",e.Login="cv_product_login",e.LoginSsoRedirect="cv_product_login_sso_redirect",e.LoginFailed="cv_product_login_failed",e.Search="cv_product_search",e.InstantSearch="cv_product_search",e.SearchEmptyResult="cv_product_search_empty_result",e.Filter="cv_product_search_filter",e.SearchLanding="cv_product_search_landing",e.Share="cv_product_share",e.WorkspaceAdd="cv_product_tv_add",e.Rename="cv_product_rename",e.Move="cv_product_move",e.Sort="cv_product_sort",e.Create="cv_product_create",e.Delete="cv_product_delete",e.Associate="cv_product_associate",e.Dissociate="cv_product_dissociate",e.Edit="cv_product_edit",e.Approve="cv_product_approve",e.Reject="cv_product_reject",e.Disable="cv_product_disable",e.Upload="cv_product_upload",e.Download="cv_product_download",e.Navigate="cv_product_navigate",e.Click="cv_product_click",e.Suggest="cv_product_suggest",e.EditAssoc="cv_product_edit_assoc",e.Play="cv_product_play",e.Favourite="cv_product_favourite",e.Follow="cv_product_follow",e.Prefer="cv_product_prefer",e.SetAccess="cv_product_set_access",e.AddToLocalCache="cv_product_add_to_lc",e.ResolveWarning="cv_product_resolve_warning",e.DismissWarning="cv_product_dismiss_warning"}(Jp||(Jp={})),function(e){e.Folder="folder",e.Video="video",e.Rating="rating",e.Series="series",e.Library="library",e.Resource="resource",e.Tag="tag",e.Subtitle="subtitle",e.Chapter="chapter",e.Restriction="restriction",e.Interactive="interactive",e.PDF="pdf",e.CustomerSetting="customer_setting",e.UserSetting="user_setting",e.StaffRequest="staff_request",e.Logo="logo",e.Pagination="pagination",e.Thumbnail="thumbnail",e.Banner="banner",e.Link="link",e.Playlist="playlist",e.Person="person",e.Company="company",e.Classroom="classroom",e.ClassroomGroup="classroom_group",e.Classification="classification",e.ShareLink="share_link",e.Upload="upload",e.SearchResults="search_results",e.Audience="audience",e.User="user",e.Clip="clip",e.UserChannel="user_channel",e.Widget="widget",e.Url="url"}($p||($p={})),function(e){e.TopNav="top_nav",e.LeftNav="left_nav",e.Popup="popup",e.Banner="banner",e.VideoList="video_list",e.VideoListItem="video_list_item",e.VideoListHeader="video_header",e.VideoThumbnail="video_thumbnail",e.VideoItemPreview="video_item_preview",e.VideoDetails="video_details",e.VideoDetailsHeader="video_details_header",e.EditVideoDetails="edit_video_details",e.EditVideoChapters="edit_video_chapters",e.EditVideoResources="edit_video_resources",e.VideoUpload="video_upload",e.VideoRequest="video_request",e.Pagination="pagination",e.SearchBar="search_bar",e.InstantSearch="instant_search",e.SearchFilters="search_filters",e.LibraryHeader="library_header",e.LibraryTiles="library_tiles",e.StaffRequestDetails="staff_request_details",e.SubFolderList="sub_folder_list",e.AwaitingReviewVideoListHeader="awaiting_review_video_list_header",e.AwaitingReviewVideoItem="awaiting_review_video_item",e.PastReleasesHeader="past_releases_header",e.MigrationWarnings="migration_warnings",e.PlaylistListHeader="playlist_list_header",e.PlaylistListItem="playlist_list_item",e.TeacherManager="teacher_manager",e.TeacherManagerListItem="teacher_manager_list_item",e.StudentManager="student_manager",e.StudentManagerListItem="student_manager_list_item",e.ClassroomsList="classrooms_list",e.ClassroomsListItem="classrooms_list_item",e.ClassroomOverview="classroom_overview",e.ClassroomOverviewStudentListItem="classroom_overview_student_list_item",e.ManageClassroomStudents="manage_classroom_students",e.ManageClassroomStudentListItem="manage_classroom_student_list_item",e.ManageClassroomGroups="manage_classroom_groups",e.ManageClassroomGroupListItem="manage_classroom_group_list_item",e.PlayPage="play_page",e.FloatingPlayer="floating_player",e.InteractivePlayer="interactive_player",e.EmbeddedPlayer="embedded_player",e.ContentUpdatesClassificationBanner="content_updates_classification_banner",e.PreferencesSettings="preferences_settings",e.MyUploads="my_uploads",e.SlidingList="sliding_list",e.HeroBannerItem="hero_banner_item",e.SlidingListItem="sliding_list_item",e.ClassificationListItem="classification_list_item",e.ClassificationComingSoon="classification_coming_soon",e.Dashboard="dashboard"}(Kp||(Kp={})),function(e){e.Start="start",e.Complete="complete",e.Save="save",e.Discard="discard"}(Yp||(Yp={})),function(e){e.PageLoad="page_load"}(Gp||(Gp={})),function(e){e.Single="single",e.Bulk="bulk",e.All="all"}(Wp||(Wp={})),function(e){e.ProductionYear="production_year",e.Alphabetical="alphabetical"}(Zp||(Zp={})),function(e){e.Content="content",e.Quality="quality",e.Duration="duration",e.Reset="reset"}(Qp||(Qp={})),function(e){e.Submit="submit",e.ShowAll="show_all",e.Recent="recent",e.SearchIcon="search_icon"}(Xp||(Xp={})),function(e){e.Start="start",e.Finish="finish",e.Terminate="terminate",e.Play="play",e.Pause="pause",e.Playback="playback",e.NextChapter="next_chapter",e.PreviousChapter="previous_chapter",e.FullScreenEnter="full_screen_enter",e.FullScreenExit="full_screen_exit"}(ed||(ed={})),function(e){e.TogglePreview="toggle_preview",e.NavigateHome="navigate_home",e.OpenInStaffView="open_in_staff_view",e.Title="title",e.ToggleHideValidListings="toggle_hide_valid_listings",e.LaunchImmersiveReader="launch_immersive_reader",e.CopyEmbedHtml="copy_embed_html",e.Close="close",e.Open="open",e.Button="button",e.Link="link",e.Tile="tile",e.Thumbnail="thumbnail",e.Cover="cover",e.TallPoster="tall_poster",e.Slide="slide"}(td||(td={})),function(e){e.FeatureUserChannelVideo="feature_user_channel_video",e.RemoveFromUserChannelPlaylist="remove_from_user_channel_playlist",e.ShareClip="share_clip",e.ViewOriginalVideo="view_original_video",e.ShareInteractive="share_interactive",e.DeleteInteractiveVideo="delete_interactive_video",e.CopyInteractiveVideo="copy_interactive_video",e.EditInteractiveVideo="edit_interactive_video",e.PrintAsWorksheet="print_as_worksheet",e.PreviewInteractiveVideo="preview_interactive_video",e.ViewResults="view_results",e.MoveToAnotherFolder="move_to_another_folder",e.CreateInteractiveVideo="create_interactive_video",e.ShareVideo="share_video",e.EditVideo="edit_video",e.DownloadVideo="download_video",e.AddToExchange="add_to_exchange",e.AddToUserChannel="add_to_user_channel",e.CreateClip="create_clip",e.FlagVideo="flag_video",e.AddToLibrary="add_to_library",e.AddToWorkspace="add_to_workspace",e.AddToPlaylist="add_to_playlist",e.RemoveFromPlaylist="remove_from_playlist",e.AddCurriculumLink="add_curriculum_link",e.ViewCurriculumLinks="view_curriculum_links",e.OpenInCurator="open_in_curator",e.ManageVideoAccess="manage_video_access",e.Approve="approve",e.AddToLocalCache="add_to_local_cache",e.OpenInLibraryEditor="open_in_library_editor",e.PlayClip="play_clip",e.EditClip="edit_clip",e.DeleteClip="delete_clip"}(nd||(nd={})),function(e){e.LibraryReview="library_review"}(rd||(rd={})),function(e){e.FileSelect="file_select",e.DragDrop="drag_drop"}(id||(id={})),function(e){e.Edit="edit"}(od||(od={})),function(e){e.Image="image",e.User="user",e.Playlist="playlist"}(ad||(ad={})),function(e){e.On="on",e.Off="off"}(cd||(cd={})),function(e){e.EntityRemoved="cv_entity_removed",e.ValueUpdated="cv_value_updated"}(sd||(sd={})),function(e){e.FileSelect="file_select",e.DragDrop="drag_drop"}(ud||(ud={})),function(e){e.Video="videos",e.Folder="categories",e.Series="series",e.Tags="tags"}(ld||(ld={})),function(e){e[e.V1=1]="V1"}(fd||(fd={})),function(e){e.Staff="staff",e.Learner="learner",e.Unknown="unknown"}(pd||(pd={})),function(e){e.Analytics="AnalyticsService",e.Context="ContextService"}(dd||(dd={}));var Cd,Ad=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&&gd(e,t)}(a,e);var t,n,i,o=Sd(a);function a(){var e;return vd(this,a),(e=o.apply(this,arguments)).contextHistory=[],e}return t=a,i=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"initialize",value:function(){this.listenTo(b.SHELL,r.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}},{key:"name",get:function(){return dd.Context}}])&&bd(t.prototype,n),i&&bd(t,i),a}(r.Service));!function(e){e.Inlet="event:inlet",e.Outlet="event:outlet"}(Cd||(Cd={}));var jd="global:analytics";function wd(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 Id=fd.V1,Td=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||Id}var t,n,i;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||r.ErrorHelper.throw(new Xe("".concat(e," is not a valid key"))),this[e]&&r.ErrorHelper.throw(new Xe("Event already contains an enrichment named ".concat(e)))}}])&&wd(t.prototype,n),i&&wd(t,i),e}(),kd=function(e,t,n,r){y.Radio.channel(jd).trigger(Cd.Inlet,new Td(e,t,n,r))};function Ld(){var e=Ad.getCurrentContext().appLink;return h.isObject(e)||r.ErrorHelper.throw(new Xe("Applink does not exist. Check current context.")),e.application.replace(":","-")}function _d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.location,n=e.entity,i=e.workflowPhase,o=void 0===i?null:i,a=e.descriptor,c=void 0===a?null:a;return t||r.ErrorHelper.throw(new Xe("location must be set.")),n||r.ErrorHelper.throw(new Xe("entity must be set.")),{productArea:Ld(),location:t,entity:n,descriptor:c,workflowPhase:o}}function Pd(){return r.LocationUtils.GetCurrentPath()+r.LocationUtils.GetCurrentQueryString()}var xd={logUserAction:function(e,t){if(function(e){return!(!h.isArray(e)||!h.every(e,(function(e){return h.isObject(e)})))||!!h.isObject(e)}(e)&&h.isObject(t)){var n=xd.buildUserActionEvent(t),r=n.userAction,i=n.action,o=n.eventVersion;kd(r,e,i,o)}},logNavigate:function(e,t){var n=Object.assign({currentLocation:Pd(),appLink:e},t);kd(Jp.Navigate,n)},mergeOptions:function(e,t){return h.extend({},e,t)},buildActionContext:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _d(e)},buildUserActionEvent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.actionType,n=e.eventVersion,r=t,i=_d(e);return{userAction:r,action:i,eventVersion:n}},buildCurrentLocation:function(){return Pd()},buildSearchEvent:function(e,t){return{data:{query:e},action:_d({entity:$p.Video,location:Kp.SearchBar,descriptor:t})}},buildInstantSearchEvent:function(e,t,n){var r;n===ld.Series&&(r=$p.Series),n===ld.Folder&&(r=$p.Folder),n===ld.Tags&&(r=$p.Tag),n===ld.Video&&(r=$p.Video);var i={instant:{},query:e};return t.id&&(i.instant.selectedId=t.id),t.name&&(i.instant.selectedName=t.name),{data:i,action:_d({entity:r,location:Kp.SearchBar})}},mapInteractionType:function(e){switch(e){case ud.DragDrop:return id.DragDrop;case ud.FileSelect:return id.FileSelect;default:return}}};function Nd(e){var t=e.appLink,n=e.className,i=e.children,o=e.tag,a=void 0===o?"a":o;if(!t)return d.createElement("span",{className:n||""},i);var c=r.AppLinkHelper.getHref(t),s=e.onClick;s||(s=function(n){n.preventDefault(),e.analyticsData&&e.analyticsOptions&&xd.logUserAction(Object.assign({href:c},e.analyticsData),e.analyticsOptions),r.AppLinkHelper.trigger(t)});var u={onClick:s,href:c,className:n};return d.createElement(a,Object.assign({},u),i)}function Rd(e){var t=e.backToName,n=e.appLink;return d.createElement(Nd,{appLink:n,className:"d-inline-flex align-items-center"},d.createElement(Fp,{svgName:Rp.ArrowLeft,size:Up.Small}),d.createElement("span",{className:"ml-1"},"Back to ".concat(t)))}function Dd(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Md(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 Md(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 Md(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 Ud=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 Fd(e){var t=e.selected,n=e.onToggle,r=Ud(e,["selected","onToggle"]),i=Dd(d.useState(t),2),o=i[0],a=i[1];d.useEffect((function(){return a(t)}),[t]);return d.createElement(Zs.Form.Check,Object.assign({type:"checkbox",id:"checkbox-".concat(Dp()),checked:o,onChange:function(){a(!o),n(!o)}},r))}var Vd,Bd,zd,Hd,qd=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 Jd(e){var t=e.onFileSelect,n=e.acceptMultiple,r=e.mimeType,i=e.label,o=e.error,a=e.touched,c=qd(e,["onFileSelect","acceptMultiple","mimeType","label","error","touched"]),s="custom-file-input cursor-pointer";o&&a&&(s+=" is-invalid");var u=Object.assign({type:"file",className:s,onChange:function(e){var n=e.currentTarget.files;n&&n.length&&hn(t)&&t(n)},autoComplete:"off",value:"",multiple:!!n},r?{accept:r}:{});return d.createElement("div",{className:"form-group"},d.createElement("div",{className:"custom-file"},d.createElement(Vs,Object.assign({},u,c),e.children),d.createElement(Zs.Form.Label,{className:"custom-file-label",htmlFor:c.id},i)))}!function(e){e.Small="small",e.Medium="medium",e.Large="large"}(Vd||(Vd={})),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"}(Bd||(Bd={})),function(e){e[e.Crop=0]="Crop",e[e.Stretched=1]="Stretched",e[e.Cover=2]="Cover"}(zd||(zd={})),function(e){e[e.None=0]="None",e[e.ImageAPIv1=1]="ImageAPIv1",e[e.FileAPIv1=2]="FileAPIv1",e[e.ImageAPIv2=3]="ImageAPIv2"}(Hd||(Hd={}));var $d,Kd,Yd=function(e,t){var n=h.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=h.reduce(n,(function(e,t){return t?e?"".concat(e,"&").concat(t):t:e}));return r?"".concat(e,"?").concat(r):e},Gd=function(e,t){if(e){var n=e;return e.endsWith("/")||(n+="/"),t?n+=t.startsWith("/")?t.slice(1):t:n}};function Wd(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"}(Kd||(Kd={}));var Zd,Qd=(Wd($d={},Bd.Banners,Kd.Banner),Wd($d,Bd.Thumbnails,Kd.Thumbnail),$d),Xd=function(e){return"/v1/category-map/".concat(e)},em={createUrl:function(e,t){return em._createUrl(e,t)},createBannerUrl:function(e,t,n){return e&&e.url?em._createUrl(e.url,n):em._createCategoryMappedUrl(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,o=Gd(n,"".concat(Xd(Qd[i]))),a=Object.assign({name:em.Rfc3986EncodeURIComponent(r)},t);return em._createUrl(o,a)},_createUrl:function(e,t){if(e){if(Rr.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 r.Model?e.get("url"):"string"==typeof e?e:e.url)){var i=Object.assign({size:Vd.Small,bgColor:"000"},t);return em._createUrl(n,i)}}};function tm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nm=(tm(Zd={},Bd.Thumbnails,{width:1280,height:720}),tm(Zd,Bd.Banners,{width:3600,height:666}),tm(Zd,Bd.Covers,{width:1080,height:1080}),tm(Zd,Bd.Posters,{width:1e3,height:1500}),tm(Zd,Bd.TallPosters,{width:1080,height:1920}),tm(Zd,Bd.HeroBanners,{width:1920,height:640}),Zd),rm={onFileSelect:function(e,t,n){if(t&&t.length){var r=new FileReader;r.addEventListener("load",(function(){return rm.onReaderLoad(r,e,n)})),r.readAsDataURL(t[0])}},onReaderLoad:function(e,t,n){var r=new Image;r.src=e.result;var i=nm[t].width,o=nm[t].height;r.addEventListener("load",(function(){rm.isImageValid(t,r)&&hn(n)?n(r):alert("Image too small: minimum dimensions are ".concat(i," x ").concat(o))}))},isImageValid:function(e,t){var n=nm[e].width,r=nm[e].height;return!(n&&t.width<n)&&!(r&&t.height<r)}},im={isItemActive:function(e,t){return t||(t=r.AppLinkHelper.getCurrentAppLink()),t.application===e.appLink.application&&(Array.isArray(e.activeActions)?e.activeActions.includes(t.action):t.action===e.appLink.action)}},om=function(e){return Object.values(e).every((function(e){return!!e}))},am=(n(135),function(e,t){return!!e&&!!t&&e.toString()===t.toString()}),cm=function(e){return e.split(" ").map((function(e){return(e[0]?e[0].toUpperCase():"")+(e.substr(1)?e.substr(1).toLowerCase():"")})).join(" ")};function sm(e){return function(e){if(Array.isArray(e))return um(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 um(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 um(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 um(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 lm={find:function(e,t){if(e&&e.children&&e.children.length)for(var n=function e(n){if(am(n.id,t))return n;var r=n.children;if(r&&r.length)for(var i=0;i<r.length;i++){var o=e(r[i]);if(o)return o}},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 o=lm.find(e,i);o&&(n=[o].concat(sm(n))),i=o?r(o):null}return n}},fm=function(e){return e&&e.groups?e.groups.map((function(e){return e.name})):[]};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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return dm(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 dm(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 dm(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 mm,hm=d.createContext(void 0),ym=function(e){var t=e.children,n=pm(d.useState(),2),r=n[0],i=n[1],o=pm(d.useState(!1),2),a=o[0],c=o[1],s=pm(d.useState(),2),u=s[0],l=s[1],f={getDataUrl:function(){var e=r;return i(null),e},setDataUrl:i,imageUploaded:a,getImage:function(){var e=u;return l(null),c(!1),e},setImage:function(e){l(e),c(!0)}};return d.createElement(hm.Provider,{value:f},t)};function vm(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bm(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 bm(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 bm(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 gm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Sm=(gm(mm={},Bd.Thumbnails,"Thumbnail"),gm(mm,Bd.Banners,"Banner"),gm(mm,Bd.Avatars,"Avatar"),gm(mm,Bd.Logos,"Logo"),gm(mm,Bd.Covers,"Cover"),gm(mm,Bd.Posters,"Poster"),gm(mm,Bd.TallPosters,"Tall Poster"),gm(mm,Bd.HeroBanners,"Hero Banner"),mm);function Em(e){var t,n=_s(),i=js(null===(t=n)||void 0===t?void 0:t.values,e.fieldName),o=d.useContext(hm),a=o.setDataUrl,c=o.getImage,u=o.imageUploaded,l=vm(d.useState(!1),2),f=l[0],p=l[1],m=vm(d.useState(i),2),h=m[0],y=m[1],v=vm(d.useState(!1),2),b=v[0],g=v[1];function S(t){p(!0),a(t.src),r.AppLinkHelper.trigger({application:e.application,action:e.uploadAction,args:[e.imageType]})}d.useEffect((function(){if(f){var t,r=c();if(r)p(!1),y(r),t=r,hn(e.setSelectedImage)?e.setSelectedImage(t):n&&n.setFieldValue(e.fieldName,{fileId:t.id,fileIdType:Hd.ImageAPIv2})}}),[u]);var E=e.label||Sm[e.imageType]||"Image";return d.createElement("div",{className:"form-group"},d.createElement("div",{className:"form-control h-auto py-2"},d.createElement("label",null,E),d.createElement("em",{className:"ml-1 text-muted"},"(Minimum dimensions are ".concat(nm[e.imageType].width,"px")+" x ".concat(nm[e.imageType].height,"px)")),d.createElement(Jd,{label:"Choose a ".concat(E.toLowerCase()),name:"image",mimeType:s.IMAGES,onFileSelect:function(t){return rm.onFileSelect(e.imageType,t,S)}}),!!h&&!!h.url&&d.createElement(d.Fragment,null,!b&&d.createElement("div",{className:"pb-2 ".concat(e.imageType===Bd.Banners?"w-100":"w-50")},d.createElement("img",{src:em.createUrl(h.url),className:"img img-fluid"})),d.createElement("div",{className:"d-flex justify-content-center"},d.createElement(Fp,{svgName:b?Rp.ChevronDown:Rp.ChevronUp,size:Up.Large,className:"svg-container cursor-pointer",onClick:function(){return g(!b)},title:b?"Show image":"Hide image",tooltipPlacement:"top"})))))}var Om,Cm=n(136),Am=n.n(Cm);function jm(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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(e){e[e.NoRestrictions=0]="NoRestrictions",e[e.RestrictToCanvas=1]="RestrictToCanvas"}(Om||(Om={}));var Im=/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/;function Tm(e){var t=e.dataUrl,n=e.minHeight,r=e.minWidth,i=e.onCrop,o=e.onCancel,a=d.useRef(),c=d.useRef(),s=jm(d.useState(!1),2),u=s[0],l=s[1],f=jm(d.useState(!1),2),p=f[0],m=f[1];return d.useEffect((function(){var e=new Image;e.src=t;var i=a.current.offsetWidth/e.width;return c.current=new Am.a(a.current,{viewMode:Om.RestrictToCanvas,autoCropArea:1,aspectRatio:r/n,minCropBoxWidth:r*i,minCropBoxHeight:n*i,ready:function(){return l(!0)}}),function(){return c.current.destroy()}}),[]),d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-3"},d.createElement("img",{ref:a,src:t,className:"img img-fluid"})),d.createElement("div",{className:"d-flex justify-content-end border-top pt-3"},d.createElement(Zs.Button,{variant:"link",onClick:o},"Cancel"),d.createElement(fu,{onClick:function(){if(u){m(!0);var e=c.current.getCroppedCanvas().toDataURL(function(e){var t=e.match(Im);if(t)return t[1]}(t));hn(i)&&i(e)}},disabled:!u,showSpinner:p},"Crop")))}function km(e,t){return t?{application:e.application,action:e.action,args:e.args,params:Object.assign({},e.params,{cursor:t})}:null}function Lm(e){var t=e.appLink,n=e.cursors,r=e.className;function i(e){xd.logUserAction({page:e},{location:Kp.Pagination,entity:$p.Pagination,actionType:Jp.Navigate})}return d.createElement(Au.Provider,{value:"shared.pagination"},d.createElement("div",{className:r},d.createElement(Nd,{appLink:km(t,n.previous),className:"btn btn-secondary mr-1 ".concat(n.previous?"":"disabled"),onClick:function(){return i("previous")}},d.createElement(ju,{phrase:"previous"})),d.createElement(Nd,{appLink:km(t,n.next),className:"btn btn-secondary ".concat(n.next?"":"disabled"),onClick:function(){return i("next")}},d.createElement(ju,{phrase:"next"}))))}function _m(e){if(!e.collection)return d.createElement(d.Fragment,null);var t=e.collection,n=t.data,r=t.pagination;return d.createElement(d.Fragment,null,!!n&&d.createElement(qm,{objects:n,getObjectAppLink:e.getObjectAppLink,newObjectAppLink:e.newObjectAppLink,objectName:e.objectName}),!!r&&!!r.cursors&&d.createElement(Lm,{cursors:r.cursors,appLink:e.collectionAppLink}))}Lm.defaultProps={className:"py-2"};var Pm=n(23),xm=n.n(Pm);function Nm(e){var t="dropdown-item";return e&&(t+=" ".concat(e)),t}function Rm(e){if(e.action.appLink)return d.createElement(Nd,{appLink:e.action.appLink,onClick:e.action.onClick,className:Nm(e.action.className),analyticsData:e.action.analyticsData,analyticsOptions:e.action.analyticsOptions},e.action.label);return d.createElement("span",{className:"cursor-pointer ".concat(Nm(e.action.className)),onClick:function(t){e.action.analyticsData&&e.action.analyticsOptions&&xd.logUserAction(e.action.analyticsData,e.action.analyticsOptions),hn(e.action.onClick)&&e.action.onClick(t)}},e.action.label)}function Dm(e){if(!e.actions||!e.actions.length)return d.createElement(d.Fragment,null);var t="actions-dropdown-".concat(Dp()),n="px-0 ".concat(xm.a.dropdownToggle);return e.dropdownToggleClassName&&(n+=" ".concat(e.dropdownToggleClassName)),d.createElement(Zs.Dropdown,{className:e.className?e.className:"",alignRight:!0},d.createElement(Zs.Dropdown.Toggle,{as:"button",type:"button",id:t,className:n},d.createElement(Fp,{svgName:Rp.More,size:Up.Small})),d.createElement(Zs.Dropdown.Menu,null,e.actions.map((function(e,t){return d.createElement(Rm,{key:t,action:e})}))))}Dm.defaultProps={dropdownToggleClassName:"btn btn-light"};var Mm=n(18),Um=n.n(Mm);function Fm(e){var t="".concat(e.className," ").concat(Um.a.iconButton);e.children?t+=" ".concat(Um.a.iconWithText):t+=" ".concat(Um.a.iconOnly);var n=d.createElement(Fp,{svgName:e.svgName,className:Um.a.svg});return e.appLink?d.createElement(Nd,{appLink:e.appLink,className:t,onClick:e.onClick,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},n,e.children):d.createElement("button",{className:t,onClick:function(t){e.analyticsData&&e.analyticsOptions&&xd.logUserAction(e.analyticsData,e.analyticsOptions),hn(e.onClick)&&e.onClick(t)}},n,e.children)}function Vm(e){var t="ml-2";e.className&&(t+=" ".concat(e.className));var n=e.showSpinner?d.createElement(Zs.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):e.children;if(e.tooltip)return d.createElement(Mp,{title:e.tooltip},d.createElement(Fm,{appLink:e.appLink,svgName:e.svgName,onClick:e.onClick,className:t,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},n));if(e.svgName)return d.createElement(Fm,{onClick:e.onClick,appLink:e.appLink,svgName:e.svgName,className:t,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},n);if(e.appLink)return d.createElement(Nd,{onClick:e.onClick,appLink:e.appLink,className:t,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},n);return d.createElement("button",{onClick:function(t){e.analyticsData&&e.analyticsOptions&&xd.logUserAction(e.analyticsData,e.analyticsOptions),hn(e.onClick)&&e.onClick(t)},className:t},n)}function Bm(e){var t=[],n=[];e.actions.forEach((function(e){e.button?t.push(e):n.push(e)}));var r="d-flex";return e.className&&(r+=" ".concat(e.className)),d.createElement("div",{className:r},d.createElement(d.Fragment,null,!!t.length&&d.createElement("span",{className:xm.a.buttonList},t.map((function(e,t){return d.createElement(d.Fragment,{key:t},e.label?d.createElement(Vm,{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):d.createElement(Fm,{appLink:e.appLink,onClick:e.onClick,svgName:e.svgName,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions}))}))),e.sortComponent?e.sortComponent:"",!!n.length&&d.createElement(Dm,{actions:n,className:!!t.length&&"ml-2",dropdownToggleClassName:e.actionsDropdownClassName})))}function zm(e){var t=e.object,n=e.actions;return d.createElement("div",{className:"d-flex justify-content-between py-2"},!!t&&d.createElement("h5",null,t.name),!!n&&d.createElement("span",null,d.createElement(Bm,{actions:n})))}function Hm(e){return d.createElement("tr",null,d.createElement("td",null,d.createElement(Nd,{appLink:e.appLink},e.object.name)),d.createElement("td",null))}function qm(e){return d.createElement(Zs.Table,{responsive:!0},d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",null,"Name"),d.createElement("th",null,d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(Nd,{appLink:e.newObjectAppLink},d.createElement(Fp,{svgName:Rp.Plus,size:Up.Small}),d.createElement("span",null,"New ".concat(e.objectName))))))),d.createElement("tbody",null,e.objects.map((function(t){return d.createElement(Hm,{key:t.id,object:t,appLink:e.getObjectAppLink(t)})}))))}function Jm(e){var t=e.objects,n=e.getAppLink,r=e.emptyMessage;return t?t.length?d.createElement("ul",{className:"list-unstyled"},t.map((function(e,t){return d.createElement("li",{key:t,className:"border rounded mb-3"},d.createElement(Nd,{appLink:n(e),className:"d-block p-3"},e.name))}))):d.createElement("div",{className:"py-3"},d.createElement("p",null,r)):d.createElement(d.Fragment,null)}Jm.defaultProps={emptyMessage:"There is nothing here."};function $m(e){var t=_s();return d.createElement(iu,{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},d.createElement(d.Fragment,null,d.createElement("option",{value:""},"Please select a rating"),e.ratings.map((function(e,t){return d.createElement("option",{key:t,value:e.id},function(e){return"".concat(e.name).concat(e.code?" (".concat(e.code,")"):"")}(e))}))))}function Km(e){var t=e.tabs,n=e.isItemActive;return d.createElement(Zs.Nav,{fill:!0,variant:"tabs"},t.map((function(e,t){return d.createElement(Zs.Nav.Item,{key:t},d.createElement(Nd,{appLink:e.appLink,className:(r=n(e),r?"nav-link active":"nav-link")},e.label));var r})))}Km.defaultProps={isItemActive:im.isItemActive};var Ym=n(8),Gm=n.n(Ym);function Wm(e){var t=e.name,n=e.appLink,r=e.onSelect,i=e.isDisabled,o=e.className,a=e.actions,c=Gm.a.text;return o&&(c+=" ".concat(o)),i?d.createElement("a",{className:"".concat(c," text-muted ").concat(Gm.a.disabled)},t):d.createElement(d.Fragment,null,n?d.createElement(Nd,{appLink:n,className:c},t):d.createElement("a",{onClick:r,className:c},t),!!a&&d.createElement(Bm,{className:Gm.a.actions,actions:a}))}function Zm(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Qm(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 Qm(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 Qm(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 Xm(e){var t=e.tree,n=e.selectedIds,r=e.getAppLink,i=e.onSelect,o=e.isDisabled,a=e.actions,c=Array.isArray(n)&&n.some((function(e){return am(t.id,e)})),s=d.useMemo((function(){return Array.isArray(n)&&n.some((function(e){return lm.find(t,e)}))}),[t,n]),u=Zm(d.useState(s),2),l=u[0],f=u[1],p=!!t.children&&!!t.children.length,m={name:t.name,appLink:hn(r)?r(t):null,onSelect:hn(i)?function(){return i(t)}:null,isDisabled:!!hn(o)&&o(t),className:c&&Gm.a.selected||s&&Gm.a.parentOfSelected,actions:!!a&&a.map((function(e){return Object.assign(Object.assign({},e),{appLink:e.getAppLink(t)})}))};return d.createElement("li",{className:"position-relative".concat(l?"":" ".concat(Gm.a.collapsed))},d.createElement("div",{className:"position-relative"},d.createElement("span",{className:Gm.a.node},p&&d.createElement(Fp,{svgName:Rp.ChevronDown,size:Up.Small,className:"svg-container ".concat(Gm.a.chevron),onClick:function(){return f(!l)}}),d.createElement(Wm,Object.assign({},m))),l&&d.createElement(th,Object.assign({},e))))}var eh=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 th(e){var t=e.tree,n=eh(e,["tree"]);return t&&t.children?d.createElement("ul",{className:"m-0 p-0 ".concat(Gm.a.tree)},t.children.map((function(e){return d.createElement(Xm,Object.assign({key:e.id,tree:e},n))}))):d.createElement(d.Fragment,null)}var nh={getChord:function(e,t){return lm.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,o,a=lm.find(t,e);a&&(n=Object.assign((r={},i=e,o=nh.getChord(t,a),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o,r),n))})),n}};function rh(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ih(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 ih(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 ih(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 oh=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 ah(e){var t=e.onSelect,n=e.label,r=e.hideCollapseBtn,i=e.collapse,o=e.noSelectionMessage,a=e.isNodeDisabled,c=e.getSelectedItemAppLink,s=oh(e,["onSelect","label","hideCollapseBtn","collapse","noSelectionMessage","isNodeDisabled","getSelectedItemAppLink"]),u=s.tree,l=s.selectedIds,f=rh(d.useState(nh.getState(l,u)),2),p=f[0],m=f[1];d.useEffect((function(){return m(nh.getState(l,u))}),[l,u]);var h=rh(d.useState(!!i),2),y=h[0],v=h[1];d.useEffect((function(){return v(!!i)}),[i]);var b=!r||!!n;return d.createElement(d.Fragment,null,b&&d.createElement("div",{className:"pb-2"},!!n&&d.createElement("label",{className:"m-0"},n),!r&&d.createElement("a",{className:"float-right cursor-pointer",onClick:function(){return v(!y)}},y?"Expand":"Collapse")),!y&&d.createElement("div",{className:"py-2 border-top"},d.createElement(th,Object.assign({onSelect:function(e){return hn(t)&&t(e)},isDisabled:a},s))),(!Rr.isEmpty(p)||!!o)&&d.createElement("div",{className:"py-2 border-top"},d.createElement("label",null,"Selected:"),d.createElement("ul",{className:"m-0"},Rr.isEmpty(p)?d.createElement("li",null,o):Object.keys(p).map((function(e,t){return d.createElement("li",{key:t},hn(c)?d.createElement(Nd,{appLink:c(e)},p[e]):p[e])})))))}var ch=n(24);var sh=function(e){return e&&!(e.data&&e.data.length)},uh=function(e){return e&&e.data&&e.data.length},lh=function(e){var t="bg-white";return e&&(t+=" ".concat(e)),t};function fh(e){var t=e.video,n=e.getVideoAppLink,r=e.getVideoActions,i=e.className,o=void 0===i?"":i,a=e.itemNumber,c=hn(n)&&n(t);return d.createElement("tr",{className:lh(o)},!!a&&d.createElement("td",null,d.createElement("span",null,a)),d.createElement("td",null,c?d.createElement(Nd,{appLink:c},t.name):t.name),hn(r)&&d.createElement("td",null,d.createElement("span",{className:"d-flex justify-content-end"},d.createElement(Bm,{actions:r(t)}))))}var ph=Object(ch.SortableElement)((function(e){return d.createElement(fh,Object.assign({sortable:!0},e))})),dh=n(11),mh=n.n(dh),hh=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},yh=function(e){var t=e.sortable,n=e.getVideoActions;return d.createElement("thead",null,d.createElement("tr",null,!!t&&d.createElement("th",null,"#"),d.createElement("th",null,"Name"),!!n&&d.createElement("th",null)))},vh=d.forwardRef((function(e,t){var n=e.videos,r=e.sortable,i=hh(e,["videos","sortable"]);return d.createElement("tbody",{ref:t},!sh(n)&&n.data.map((function(e,t){return r?d.createElement(ph,Object.assign({key:e.id,index:t,itemNumber:t+1,video:e,className:mh.a.draggableVideoItem},i)):d.createElement(fh,Object.assign({video:e},i))})))}));var bh=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},gh=Object(ch.SortableContainer)((function(e){var t=e.forwardedRef,n=bh(e,["forwardedRef"]);return d.createElement(vh,Object.assign({sortable:!0,ref:t},n))})),Sh=function(e){return function(t){var n=t.node,r=e.current;if(r){r.classList.add(mh.a.sortingContainer);var i=r.querySelector(".".concat(mh.a.draggedVideoItem));n.childNodes.forEach((function(e,t){return i.childNodes[t].style.width="".concat(e.offsetWidth,"px")}))}}},Eh=function(e,t){return function(n){var r=e.current;r&&r.classList.remove(mh.a.sortingContainer),t(n.oldIndex,n.newIndex)}};function Oh(e){var t=e.onSortEnd,n=e.emptyMessage,r=bh(e,["onSortEnd","emptyMessage"]),i=d.useRef();return sh(e.videos)?d.createElement("div",null,n):d.createElement(Zs.Table,{responsive:!0},d.createElement(yh,Object.assign({sortable:!0},e)),d.createElement(gh,Object.assign({forwardedRef:i,onSortStart:Sh(i),onSortEnd:Eh(i,t),lockAxis:"y",lockToContainerEdges:!0,distance:1,helperClass:mh.a.draggedVideoItem,helperContainer:function(){return i.current}},r)))}function Ch(e){var t=e.alias,n=e.onDelete;return d.createElement("li",{className:"list-group-item d-flex justify-content-between"},t.name,d.createElement(Fp,{svgName:Rp.Delete,onClick:function(){return n(t.id)}}))}function Ah(e){var t=e.aliases,n=e.onDelete;return d.createElement("ul",{className:"list-group mb-3"},t?t.map((function(e){return d.createElement(Ch,{key:e.id,alias:e,onDelete:n})})):d.createElement("span",null,"Currently there are no aliases for this object."))}Oh.defaultProps={emptyMessage:"There are no videos in this list."};var jh=Object(Gs.object)().shape({name:Object(Gs.string)().trim().max(255,"Name is too long").required("Name is required").default("")});function wh(){var e=_s(),t=cu(e);return d.createElement(Bs,null,d.createElement(iu,{label:"Create an alias",name:"name",id:"name",value:e.values.name,placeholder:"Add an alias"}),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(fu,{showSpinner:e.isSubmitting,type:"submit",disabled:!t},"Add")))}function Ih(e){var t=e.onSave;return d.createElement(Ys,{initialValues:{name:""},validationSchema:jh,onSubmit:function(e,n){t(e,n)},resetOnSubmit:!0},d.createElement(wh,null))}function Th(e){var t=e.onSave,n=e.aliases,r=e.onDelete;return d.createElement("div",{className:"w-50"},d.createElement("h1",null,"Aliases"),d.createElement(Ah,{aliases:n,onDelete:r}),d.createElement(Ih,{onSave:t}))}var kh=l.COMPANIES,Lh=function(e){return{application:kh,action:a.Companies.EDIT_COMPANY,args:[e.id]}},_h=function(e){return r.AppLinkHelper.trigger(Lh(e))};function Ph(e){var t=i.useBasicFetch(Fi(e.cursor));return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-3 w-50"},d.createElement(hd,{placeholder:"Search for a company",onSuggestionSelected:_h,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/companies/instant/raw","?q=").concat(e)},activationLength:2})),d.createElement(_m,{collection:t&&t.data,collectionAppLink:{application:kh,action:a.Companies.COMPANIES},newObjectAppLink:{application:kh,action:a.Companies.NEW_COMPANY},getObjectAppLink:Lh,objectName:"Company"}))}function xh(e){return(xh="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 Nh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rh(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 Dh(e,t,n){return t&&Rh(e.prototype,t),n&&Rh(e,n),e}function Mh(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&&Uh(e,t)}function Uh(e,t){return(Uh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fh(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Bh(e);if(t){var i=Bh(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Vh(this,n)}}function Vh(e,t){return!t||"object"!==xh(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 Bh(e){return(Bh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var zh=function(e){Mh(n,e);var t=Fh(n);function n(){return Nh(this,n),t.apply(this,arguments)}return Dh(n,[{key:"channelName",get:function(){return l.COMPANIES}},{key:"appRoutes",get:function(){return{"manage/companies(/)":"companies","manage/companies/new(/)":"newCompany","manage/companies/:id(/)":"editCompany"}}}]),n}(r.AppRouter),Hh=function(e){Mh(n,e);var t=Fh(n);function n(){return Nh(this,n),t.apply(this,arguments)}return Dh(n,[{key:"companies",value:function(e){var t=e.cursor;this.layout.showChildView(kn,d.createElement(Ph,{cursor:t}))}},{key:"newCompany",value:function(){this.layout.showChildView(kn,d.createElement(Lu,null))}},{key:"editCompany",value:function(e){this.layout.showChildView(kn,d.createElement(ku,{id:e}))}},{key:"name",get:function(){return"Companies Application"}},{key:"channelName",get:function(){return l.COMPANIES}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT}}}],[{key:"router",get:function(){return zh}}]),n}(r.Application);function qh(e){return(qh="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 Jh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $h(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 Kh(e,t){return(Kh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Yh(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 Gh(this,n)}}function Gh(e,t){return!t||"object"!==qh(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 Wh(e){return(Wh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Zh=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&&Kh(e,t)}(o,e);var t,n,r,i=Yh(o);function o(){return Jh(this,o),i.apply(this,arguments)}return t=o,(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,d.createElement(t,{alerts:r,removeAlert:function(e){return y.Radio.channel(b.ALERT).trigger("remove:alert",e)}}))}}}])&&$h(t.prototype,n),r&&$h(t,r),o}(ie);function Qh(e){return(Qh="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 Xh(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 ey(e,t){return(ey=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ty(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ry(e);if(t){var i=ry(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ny(this,n)}}function ny(e,t){return!t||"object"!==Qh(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 ry(e){return(ry=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var iy,oy,ay=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&&ey(e,t)}(o,e);var t,n,r,i=ty(o);function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=i.call(this)).constructors={},e.destructors={},e.instances={},e.singletonInstances={},e.referenceCounts={},e}return t=o,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{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():K.throw(new Xe("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 h.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]||K.throw(new Xe("".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||K.throw(new Xe("Classes registered with ".concat(this.name," must have a unique name property."))),this.constructors[t]&&K.throw(new Xe("A class with the name: ".concat(t," has already been registered with ").concat(this.name)))}},{key:"name",get:function(){return"InstanceManager"}}])&&Xh(t.prototype,n),r&&Xh(t,r),o}(Yt).Instance;function cy(e){var t,n;return t=e,n=ay.getInstance(t),d.useEffect((function(){return function(){return ay.releaseInstance(t)}})),n}function sy(e){return(sy="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 uy(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 ly(e,t){return(ly=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function fy(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=dy(e);if(t){var i=dy(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return py(this,n)}}function py(e,t){return!t||"object"!==sy(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 dy(e){return(dy=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"}(iy||(iy={})),function(e){e.Success="Success! 🙌",e.Warning="Whoops...",e.Fail="Oops...",e.Info="FYI"}(oy||(oy={}));var my,hy=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&&ly(e,t)}(o,e);var t,n,r,i=fy(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,e)}return t=o,(n=[{key:"initialize",value:function(){this.alertCollection=new De,this.listenTo(b.ALERT,"remove:alert",this.removeAlert),this.showAlerts()}},{key:"showAlerts",value:function(){var e=y.Radio.channel(b.ALERT),t={collection:this.alertCollection};this.options.alertViewCtor&&(t=h.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=h.extend({},e,{id:this.generateUniqueAlertId()})),this.alertCollection.push(new _t(e)),this.showAlerts()}},{key:"clearAllAlerts",value:function(){this.alertCollection.reset(null)}},{key:"success",value:function(e){var t=this;return"string"==typeof e?h.bind((function(){return t.createAlert(h.extend({},t.options.defaultSuccessAlert,{message:e}))}),this):e.useXHR?h.bind((function(e,n){return t.createAlert(h.extend({},t.options.defaultSuccessAlert,{message:n}))}),this):h.bind((function(){return t.createAlert(h.extend({},t.options.defaultSuccessAlert,e))}),this)}},{key:"error",value:function(e){var t=this;return"string"==typeof e?h.bind((function(){return t.createAlert(h.extend({},t.options.defaultErrorAlert,{message:e}))}),this):e.useXHR?h.bind((function(e){return t.createAlert(h.extend({},t.options.defaultErrorAlert,{message:e.message}))}),this):h.bind((function(){return t.createAlert(h.extend({},t.options.defaultErrorAlertIL_DEFAULT,e))}),this)}},{key:"generateUniqueAlertId",value:function(){return h.uniqueId("alert_")}},{key:"name",get:function(){return mu}},{key:"defaults",get:function(){return{maxAlerts:3}}}])&&uy(t.prototype,n),r&&uy(t,r),o}(Yt),yy=function(){var e=cy(mu);return{success:function(t){e.success(t)()},error:function(t){e.error(t)()},warning:function(t){e.createAlert({type:iy.Warning,heading:oy.Warning,message:t})}}};function vy(){return d.createElement("div",{className:"text-center p-5"},d.createElement(Zs.Spinner,{as:"div",animation:"border",role:"status"}))}function by(e){return d.createElement(Zs.Modal,{show:!0,onHide:e.closePopup,onEntered:e.onEntered,size:e.size},!!e.title&&d.createElement(Zs.Modal.Header,{closeButton:e.closeButton},d.createElement(Zs.Modal.Title,null,e.title)),e.showLoadingSpinner?d.createElement(vy,null):d.createElement(Zs.Modal.Body,null,e.children))}!function(e){e.Subject="subject",e.Curriculum="curriculum"}(my||(my={})),by.defaultProps={closeButton:!0};var gy=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 Sy(e){var t=e.buttons;return d.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,o=e.isSpinnerButton,a=e.showSpinner,c=void 0!==a&&a,s=e.className,u=gy(e,["buttonText","type","isSpinnerButton","showSpinner","className"]),l=Object.assign({key:t,type:i,className:"ml-2".concat(s?" ".concat(s):"")},u);return o?d.createElement(fu,Object.assign({showSpinner:c},l),n):d.createElement(Zs.Button,Object.assign({},l),n)}(e,t)})))}function Ey(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Oy(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 Oy(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 Oy(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 Cy(e){var t=e.title,n=e.onClickConfirm,r=e.confirmButtonText,i=e.cancelButtonText,o=e.closePopup,a=Ey(d.useState(!1),2),c=a[0],s=a[1],u=[{variant:"link",onClick:o,buttonText:i},{variant:"primary",onClick:function(){s(!0),n()},buttonText:r,isSpinnerButton:!0,showSpinner:c}];return d.createElement(by,{title:t,closePopup:o},d.createElement(d.Fragment,null,e.children,d.createElement(Sy,{buttons:u})))}function Ay(e,t){return t?"".concat(e,":").concat(t):e}Cy.defaultProps={confirmButtonText:"Confirm",cancelButtonText:"Cancel"};var jy=function(e){return{key:Ay("presentations",e),url:Yd("/api/subjects/v1/presentations",{type:e})}},wy=function(e,t){return{key:Ay("customers:".concat(e,":presentations"),t),url:Yd("/api/subjects/v1/customers/".concat(e,"/presentations"),{type:t})}},Iy=function(e,t,n,r,i){return{key:"customers:".concat(e,":presentations:").concat(e,":add"),url:"/api/subjects/v1/customers/".concat(e,"/presentations/").concat(t),type:Cr.POST,invalidationKeys:"customers:".concat(e,":presentation"),success:n,error:r,always:i}},Ty=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:Cr.DELETE,invalidationKeys:"customers:".concat(e,":presentations"),success:n,error:r,always:i}},ky=function(e){return{key:"customers:".concat(e),url:"/api/master/v2/objects/".concat(e)}};function Ly(e){return d.createElement("div",null,d.createElement(Zs.Form.Label,null,"Select a presentation to add"),d.createElement(Zs.Form.Control,{as:"select",value:"",onChange:function(t){return e.addPresentation(function(e,t){return Oi(t.filter((function(t){return t.id.toString()===e.toString()})))}(t.target.value,e.availablePresentations))},className:"cursor-pointer"},d.createElement("option",{value:""},"Select a presentation"),e.availablePresentations.map((function(e){return d.createElement("option",{value:e.id,key:e.id},e.name)}))),!!e.currentPresentations.length&&d.createElement(d.Fragment,null,d.createElement("ul",{className:"list-unstyled mt-2"},e.currentPresentations.map((function(t){return d.createElement("li",null,t.name,d.createElement("span",{className:"text-danger cursor-pointer ml-2",onClick:function(){return e.removePresentation(t)}},d.createElement("em",null,"remove")))})))))}function _y(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Py(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 Py(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 Py(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 xy(e){var t=yy(),n=Object(bn.useDispatch)(),r=_y(d.useState(),2),o=r[0],a=r[1],c=i.useBasicFetch(ky(e.customerId)),s=i.useBasicFetch(jy(my.Subject)),u=i.useBasicFetch(jy(my.Curriculum)),l=i.useBasicFetch(wy(e.customerId,my.Subject)),f=i.useBasicFetch(wy(e.customerId,my.Curriculum));function p(r){var o=Iy(e.customerId,r.id,(function(){return t.success("Successfully added customer to presentation.")}),(function(e){var n;return t.error((null===(n=e.responseJSON)||void 0===n?void 0:n.message)||"Failed to add customers presentation.")}));i.fetch(n,o)}return!!(c.data&&s.data&&u.data&&l.data&&f.data)?d.createElement(d.Fragment,null,d.createElement("h1",{className:"h6 mb-3"},c.data.name," - ",c.data.crmId),d.createElement("p",null,d.createElement("strong",null,"Subject Presentations")),d.createElement(Ly,{availablePresentations:s.data,currentPresentations:l.data,addPresentation:p,removePresentation:a}),d.createElement("hr",null),d.createElement("p",null,d.createElement("strong",null,"Curriculum Presentations")),d.createElement(Ly,{availablePresentations:u.data,currentPresentations:f.data,addPresentation:p,removePresentation:a}),!!o&&d.createElement(Cy,{title:"Confirmation needed",onClickConfirm:function(){if(o){var r=Ty(e.customerId,o.id,(function(){return t.success("Successfully removed customer from presentation.")}),(function(e){var n;return t.error((null===(n=e.responseJSON)||void 0===n?void 0:n.message)||"Failed to remove presentation.")}),(function(){return a(null)}));i.fetch(n,r)}},closePopup:function(){return a(null)}},d.createElement("p",null,"Are you sure you want to remove this customer from ",o.name,"?"))):d.createElement(d.Fragment,null)}function Ny(e){return(Ny="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 Ry(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dy(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 My(e,t,n){return t&&Dy(e.prototype,t),n&&Dy(e,n),e}function Uy(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&&Fy(e,t)}function Fy(e,t){return(Fy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Vy(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=zy(e);if(t){var i=zy(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return By(this,n)}}function By(e,t){return!t||"object"!==Ny(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 zy(e){return(zy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Hy=function(e){Uy(n,e);var t=Vy(n);function n(){return Ry(this,n),t.apply(this,arguments)}return My(n,[{key:"channelName",get:function(){return l.CUSTOMERS}},{key:"appRoutes",get:function(){return{"customers/:id/presentations(/)":"editCustomerPresentations"}}}]),n}(r.AppRouter),qy=function(e){Uy(n,e);var t=Vy(n);function n(){return Ry(this,n),t.apply(this,arguments)}return My(n,[{key:"editCustomerPresentations",value:function(e){this.layout.showChildView(kn,d.createElement(xy,{customerId:e}))}},{key:"name",get:function(){return"Customers Application"}},{key:"channelName",get:function(){return l.CUSTOMERS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{alertRegion:_n}}}}],[{key:"router",get:function(){return Hy}}]),n}(Zh),Jy=n(34),$y=n(9),Ky=n.n($y);function Yy(e){var t=e.alert,n=e.svgName,r=e.svgClassName,i=e.closeAlert,o=t.message,a=t.heading,c=t.appLink,s=t.appLinkText,u=t.appLinkClassName,l=void 0===u?"":u,f=Object(du.sanitize)(o);return d.createElement(d.Fragment,null,d.createElement("div",{className:"d-inline-block ".concat(Ky.a.icon)},d.createElement(Fp,{svgName:n,className:"svg-container ".concat(r)})),d.createElement("div",{className:"pl-2 d-inline-block ".concat(Ky.a.alertContent)},d.createElement("p",{className:"p-0 m-0 pb-1 ".concat(Ky.a.heading)},a),d.createElement("p",{className:"p-0 m-0 ".concat(Ky.a.message),dangerouslySetInnerHTML:{__html:f}}),!!c&&d.createElement(Nd,{className:l,appLink:c},s)),d.createElement("div",{className:"close d-inline-block cursor-pointer",role:"button",onClick:i},"×"))}function Gy(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Wy(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 Wy(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 Wy(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 Zy,Qy,Xy=function(e){switch(e.type){case iy.Success:return Rp.CheckCircleOutline;case iy.Fail:case iy.Warning:return Rp.Warning;case iy.Info:default:return Rp.Info}};function ev(e){var t=e.alert,n=e.closeAlert,r=Gy(d.useState(!0),2),i=r[0],o=r[1],a=d.useRef();d.useEffect((function(){i?a.current=window.setTimeout(n,3e3):clearTimeout(a.current)}),[i]);var c="text-".concat(t.type.toLowerCase());return d.createElement("li",{className:"bg-white mt-2 p-2 show clearfix ".concat(Ky.a.alertItem),onMouseEnter:function(){return o(!1)},onMouseLeave:function(){return o(!0)}},d.createElement(Yy,{alert:t,svgName:Xy(t),svgClassName:c,closeAlert:n}))}function tv(e){var t=e.alerts,n=e.removeAlert;return d.createElement("div",{className:Ky.a.alertBox},d.createElement(Jy.TransitionGroup,{component:"ul",className:"".concat(Ky.a.alertList," list-unstyled")},t&&t.map((function(e,t){return d.createElement(Jy.CSSTransition,{key:t,timeout:200,classNames:"alert"},d.createElement(ev,{alert:e,closeAlert:function(){return n(e.id)}}))}))))}!function(e){e.Boolean="System.Boolean",e.String="System.String",e.StaffRequest="ClickView.DomainApi.Models.Options.Enums.StaffRequestOption, ClickView.DomainApi.Models, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null",e.Long="System.Int64"}(Zy||(Zy={})),function(e){e[e.Permanent=0]="Permanent",e[e.Temporary=1]="Temporary"}(Qy||(Qy={}));var nv={namespace:"domain_options"},rv=function(){return"/api/domain/v3/settings/types"},iv=function(e){return"/api/domain/v3/settings/types/".concat(e)},ov=function(){return"/api/domain/v3/settings/types"},av=function(e){return"/api/domain/v3/settings/types/".concat(e)},cv=function(e){return"/api/domain/v3/settings/types/".concat(e)},sv="domain:options",uv="domain:option",lv="update:domain:option",fv="delete:domain:option",pv=function(){return{key:sv,url:rv(),normalizeOptions:nv}},dv=function(e){return{key:"".concat(uv,":").concat(e),url:iv(e),normalizeOptions:nv}},mv=function(e,t,n){return e.type===Zy.String&&(e=vv(e)),{key:uv,url:ov(),data:e,type:Cr.POST,success:t,error:n,invalidationKeys:[sv],normalizeOptions:nv}},hv=function(e,t){return e.type===Zy.String&&(e=vv(e)),{key:"".concat(lv,":").concat(e.id),url:av(e.id),data:e,type:Cr.PUT,always:t,formatData:function(){return e},normalizeOptions:nv}},yv=function(e,t){return{key:"".concat(fv,":").concat(e),url:cv(e),type:Cr.DELETE,invalidationKeys:[sv],normalizeOptions:nv,success:t}};function vv(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 bv(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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}function Sv(e){var t=bv(d.useState(!1),2),n=t[0],o=t[1],c=i.useBasicFetch(dv(e.optionId)),s=Object(bn.useDispatch)(),u=function(){e.closePopup(),r.AppLinkHelper.trigger({application:l.DOMAIN_OPTIONS,action:a.DomainOptions.DOMAIN_OPTIONS})};return d.createElement(by,{title:"Delete Domain Option",closePopup:e.closePopup,showLoadingSpinner:!c.data},c.data&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,c.data.name),"?")),d.createElement(Sy,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){o(!0),i.fetch(s,yv(e.optionId,u))},buttonText:"Yes, delete this domain option",isSpinnerButton:!0,showSpinner:n}]})))}var Ev,Ov=function(e){return{application:l.DOMAIN_OPTIONS,action:a.DomainOptions.EDIT_DOMAIN_OPTION,args:[e.id]}},Cv={application:l.DOMAIN_OPTIONS,action:a.DomainOptions.NEW_DOMAIN_OPTION};function Av(){var e=i.useBasicFetch(pv());if(!e.data)return d.createElement(d.Fragment,null);var t=e.data.map((function(e){return e.displayName&&(e.name=e.displayName),e}));return d.createElement(d.Fragment,null,d.createElement("div",{className:"d-flex justify-content-between mb-2"},d.createElement("h5",{className:"d-inline-block m-0"},"Select a domain option type to edit:"),d.createElement(Nd,{appLink:Cv,className:"d-block"},d.createElement(Fp,{svgName:Rp.Plus,size:Up.Small}),d.createElement("span",null,"New Domain Option"))),d.createElement(Jm,{objects:t,getAppLink:Ov}))}!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"}(Ev||(Ev={}));var jv=Gs.object().shape({id:Gs.string(),name:Gs.string().trim().max(64,"Name is too long").required("Name is required").default(""),displayName:Gs.string().trim().max(255,"Display name is too long").required("Display name is required").default(""),type:Gs.mixed().required("Type is required").default(Zy.Boolean),entityType:Gs.mixed().required("Entity type is required").default(Ev.Customer),kind:Gs.mixed().required("Kind is required").default(Qy.Temporary),defaultValue:Gs.mixed().required("Default value is required").default("false")}).noUnknown();function wv(e){var t=e.type,n=e.defaultValue;if(!t)return d.createElement(d.Fragment,null);var r={label:"Default Value",name:"defaultValue",id:"defaultValue",value:n};return t===Zy.Boolean?d.createElement(iu,Object.assign({as:"select"},r),d.createElement("option",{value:"true"},"True"),d.createElement("option",{value:"false"},"False")):t===Zy.Long||t===Zy.StaffRequest?d.createElement(iu,Object.assign({as:"input",type:"number"},r)):t===Zy.String?d.createElement(iu,Object.assign({as:"input"},r)):void 0}var Iv=[Ev.Customer,Ev.User];function Tv(e){var t=null===e.id||void 0===e.id,n=_s(),r=cu(n);return d.createElement(Bs,null,d.createElement(iu,{label:"Name (snake_case)",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this domain option",autoFocus:!0}),d.createElement(iu,{label:"Display Name",type:"text",name:"displayName",id:"displayName",value:n.values.displayName,placeholder:"Enter a display name for this domain option"}),d.createElement(iu,{as:"select",label:"Kind",name:"kind",id:"kind",value:n.values.kind},Rr.getEnumKeys(Qy).map((function(e){return d.createElement("option",{key:e,value:Qy[e]},e)}))),d.createElement(iu,{as:"select",label:"Entity",name:"entityType",id:"entityType",value:n.values.entityType},Rr.getEnumKeys(Ev).filter((function(e){return Iv.includes(Ev[e])})).map((function(e){return d.createElement("option",{key:e,value:Ev[e]},e)}))),d.createElement(iu,{as:"select",label:"Type",name:"type",id:"type",value:n.values.type},Rr.getEnumKeys(Zy).map((function(e){return d.createElement("option",{key:e,value:Zy[e]},e)}))),d.createElement(wv,{type:n.values.type,defaultValue:n.values.defaultValue}),d.createElement("div",{className:"d-flex justify-content-between"},d.createElement(fu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&d.createElement(Zs.Button,{as:Nd,variant:"danger",appLink:{application:l.DOMAIN_OPTIONS,action:a.DomainOptions.DELETE_DOMAIN_OPTION,args:[e.id]}},"Delete")))}function kv(e){return d.createElement(Ys,{initialValues:e.domainOption,validationSchema:jv,onSubmit:e.saveDomainOption},d.createElement(Tv,{id:e.domainOption&&e.domainOption.id}))}function Lv(){var e=Object(bn.useDispatch)();return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Create New Domain Option"),d.createElement(kv,{saveDomainOption:function(t,n){i.fetch(e,mv(t,(function(e){n(),r.AppLinkHelper.trigger({application:l.DOMAIN_OPTIONS,action:a.DomainOptions.EDIT_DOMAIN_OPTION,args:[e.id]})}),n))}}))}function _v(e){var t=e.optionId,n=i.useBasicFetch(dv(t)),r=Object(bn.useDispatch)();return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Edit Domain Option"),n.data&&d.createElement(kv,{domainOption:n.data,saveDomainOption:function(e,t){return i.fetch(r,hv(e,t))}}))}function Pv(e){return(Pv="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 xv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nv(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 Rv(e,t,n){return t&&Nv(e.prototype,t),n&&Nv(e,n),e}function Dv(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&&Mv(e,t)}function Mv(e,t){return(Mv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Uv(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Vv(e);if(t){var i=Vv(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Fv(this,n)}}function Fv(e,t){return!t||"object"!==Pv(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 Vv(e){return(Vv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Bv=function(e){Dv(n,e);var t=Uv(n);function n(){return xv(this,n),t.apply(this,arguments)}return Rv(n,[{key:"channelName",get:function(){return l.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}(r.AppRouter),zv=function(e){Dv(n,e);var t=Uv(n);function n(){return xv(this,n),t.apply(this,arguments)}return Rv(n,[{key:"domainOptions",value:function(){this.layout.showChildView(kn,d.createElement(Av,null))}},{key:"newDomainOption",value:function(){this.layout.showChildView(kn,d.createElement(Lv,null))}},{key:"editDomainOption",value:function(e){this.layout.showChildView(kn,d.createElement(_v,{optionId:e}))}},{key:"deleteDomainOption",value:function(e){this.layout.showChildView(Ln,d.createElement(Sv,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 y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_n,d.createElement(tv,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Domain Options Application"}},{key:"channelName",get:function(){return l.DOMAIN_OPTIONS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT}}}],[{key:"router",get:function(){return Bv}}]),n}(r.Application),Hv=function(e){return e?"".concat("/api/master/v2/people","?cursor=").concat(e):"/api/master/v2/people"},qv=function(e){return"/api/master/v2/objects/".concat(e)},Jv=function(){return"/api/master/v2/people"},$v=function(e){return"/api/master/v2/objects/".concat(e)},Kv="people",Yv="person",Gv="update:person",Wv=function(e){return{key:"".concat(Kv).concat(e?":".concat(e):""),url:Hv(e)}},Zv=function(e){return{key:"".concat(Yv,":").concat(e),url:qv(e)}},Qv=function(e,t,n){return{key:Yv,url:Jv(),data:e,type:Cr.POST,success:t,error:n,invalidationKeys:[Kv]}},Xv=function(e,t,n){return{key:"".concat(Gv,":").concat(e),url:$v(e),data:t,type:Cr.PUT,always:n}},eb=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown();function tb(e){var t=_s();return d.createElement(Bs,null,d.createElement(iu,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this person",autoFocus:!0}),d.createElement(wu,{isNew:e.isNew}))}function nb(e){return d.createElement(Ys,{initialValues:e.person,validationSchema:eb,onSubmit:e.savePerson},d.createElement(tb,{isNew:!(e.person&&e.person.id)}))}function rb(e){var t=Object(bn.useDispatch)(),n=i.useBasicFetch(Zv(e.id));return d.createElement(d.Fragment,null,!!n.data&&d.createElement(nb,{person:n.data,savePerson:function(n,r){return i.fetch(t,Xv(e.id,n,r))}}))}function ib(){var e=Object(bn.useDispatch)();return d.createElement(nb,{savePerson:function(t,n){i.fetch(e,Qv(t,(function(e){n(),r.AppLinkHelper.trigger({application:l.PEOPLE,action:a.People.EDIT_PERSON,args:[e.id]})}),n))}})}var ob=l.PEOPLE,ab=function(e){return{application:ob,action:a.People.EDIT_PERSON,args:[e.id]}},cb=function(e){return r.AppLinkHelper.trigger(ab(e))};function sb(e){var t=i.useBasicFetch(Wv(e.cursor));return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-3 w-50"},d.createElement(hd,{placeholder:"Search for a person",onSuggestionSelected:cb,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/people/instant/raw","?q=").concat(e)},activationLength:2})),d.createElement(_m,{collection:t&&t.data,collectionAppLink:{application:ob,action:a.People.PEOPLE},newObjectAppLink:{application:ob,action:a.People.NEW_PERSON},getObjectAppLink:ab,objectName:"Person"}))}function ub(e){return(ub="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 lb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fb(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 pb(e,t,n){return t&&fb(e.prototype,t),n&&fb(e,n),e}function db(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&&mb(e,t)}function mb(e,t){return(mb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function hb(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=vb(e);if(t){var i=vb(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return yb(this,n)}}function yb(e,t){return!t||"object"!==ub(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 vb(e){return(vb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var bb=function(e){db(n,e);var t=hb(n);function n(){return lb(this,n),t.apply(this,arguments)}return pb(n,[{key:"channelName",get:function(){return l.PEOPLE}},{key:"appRoutes",get:function(){return{"manage/people(/)":"people","manage/people/new(/)":"newPerson","manage/people/:id(/)":"editPerson"}}}]),n}(r.AppRouter),gb=function(e){db(n,e);var t=hb(n);function n(){return lb(this,n),t.apply(this,arguments)}return pb(n,[{key:"people",value:function(e){var t=e.cursor;this.layout.showChildView(kn,d.createElement(sb,{cursor:t}))}},{key:"newPerson",value:function(){this.layout.showChildView(kn,d.createElement(ib,null))}},{key:"editPerson",value:function(e){this.layout.showChildView(kn,d.createElement(rb,{id:e}))}},{key:"name",get:function(){return"People Application"}},{key:"channelName",get:function(){return l.PEOPLE}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT}}}],[{key:"router",get:function(){return bb}}]),n}(r.Application);function Sb(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Eb(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 Eb(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 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=e.imageType,n=e.closePopup,r=d.useContext(hm),i=r.getDataUrl,o=r.setImage,a=Sb(d.useState(i()),1)[0],c=Sb(d.useState(!1),2),s=c[0],u=c[1],l=cy(p.IMAGE_UPLOAD),f=function(e){o(e),n()},m={dataUrl:a,imageType:t,minWidth:nm[t].width,minHeight:nm[t].height,onCrop:function(e){return l.uploadBase64Image(e,t,f,n)},onCancel:n};return d.createElement(by,{title:"Crop Image",size:"lg",closePopup:n,onEntered:function(){return u(!0)}},s&&d.createElement(Tm,Object.assign({},m)))}var Cb=function(e){var t=e.children;return d.createElement(ym,null,t)};function Ab(e){var t=e.page,n=e.totalPages,r=Mu.isNumber(t)&&t>0&&t<n&&t+1,i=Mu.isNumber(t)&&t>1&&t-1,o={};if(r&&r<=n&&(o.next=r.toString()),i&&(o.previous=i.toString()),!Rr.isEmpty(o))return o}var jb,wb={convertLegacyPaginatedCollection:function(e){if(e)return{data:e.data,pagination:{cursors:Ab(e.pagination),limit:e.pagination.pageSize}}}};!function(e){e.Developer="Curator Devs",e.Content="Content",e.Curator="Curators",e.Support="Support",e.SalesSupport="Sales Support"}(jb||(jb={}));var Ib=function(){return[{value:"protected",access:"r"}]},Tb=function(e){return[jb.Developer,jb.Content].some((function(t){return fm(e).includes(t)}))},kb=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:wb.convertLegacyPaginatedCollection}},Lb=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:wb.convertLegacyPaginatedCollection}},_b=function(e){return{key:"playlist:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=cover,banner")}},Pb=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("&"))}},xb=function(e,t,n,r,i){return{url:"/api/master/v2/objects/".concat(t,"/playlists"),key:"playlist",data:Object.assign(Object.assign({},e),{permissions:Ib()}),type:Cr.POST,invalidationKeys:"playlists",success:n,error:r,always:i}},Nb=function(e,t,n,r,i){return{url:"/api/master/v2/objects/".concat(e),key:"update:playlist:".concat(e),data:t,type:Cr.PUT,success:n,error:r,always:i}},Rb=function(e,t,n,r){return{url:"/api/master/v1/playlists/".concat(e),key:"delete:playlist:".concat(e),type:Cr.DELETE,invalidationKeys:"playlists",success:t,error:n,always:r}},Db=function(e){return{key:"playlist:".concat(e,":videos"),url:"/api/master/v2/objects/".concat(e,"/videos?query={orderBy:orderindex,limit:100}")}},Mb=function(e,t,n,r){return{key:"reorder:playlist",url:"/api/master/v1/objects/".concat(e,"/videos/reorder"),data:t,type:Cr.PUT,invalidationKeys:"playlist:".concat(e,":videos"),success:n,error:r}},Ub=function(e,t,n,r,i){return{key:"remove:playlist:video",url:"/api/master/v1/playlists/".concat(e,"/dissociate/").concat(t),type:Cr.DELETE,invalidationKeys:"playlist:".concat(e,":videos"),success:n,error:r,always:i}};function Fb(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vb(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 Vb(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 Vb(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 Bb(e){var t=Object(bn.useDispatch)(),n=yy(),o=Fb(d.useState(!1),2),c=o[0],s=o[1],u=i.useBasicFetch(_b(e.playlistId));var f=[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){s(!0),i.fetch(t,Rb(e.playlistId,(function(){n.success("Successfully deleted playlist."),r.AppLinkHelper.trigger({application:l.PLAYLISTS,action:a.Playlists.PLAYLISTS})}),(function(){s(!1),n.error("Failed to delete playlist.")}),e.closePopup))},buttonText:"Yes, delete playlist",isSpinnerButton:!0,showSpinner:c}],p=!!u.data;return d.createElement(by,{title:"Delete Playlist",closePopup:e.closePopup,showLoadingSpinner:!p},p&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,u.data.name),"?"),d.createElement("p",null,"Please ensure it is not being used in any widgets.")),d.createElement(Sy,{buttons:f})))}var zb=function(e,t){return{url:"/api/currentUser",key:"currentuser",success:e,error:t}},Hb=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Gs.string().trim().max(65535,"Description is too long").default(""),cover:Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown(),banner:Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown()}).noUnknown(),qb=function(e,t){var n=l.PLAYLISTS,r=a.Playlists,i=[{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 Tb(e)&&i.push.apply(i,[{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]}}]),i};function Jb(e){var t=_s(),n=cu(t);return d.createElement(Bs,null,d.createElement(iu,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this playlist",autoFocus:!0}),d.createElement(iu,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this playlist here"}),d.createElement(Em,{imageType:Bd.Covers,fieldName:"cover",application:l.PLAYLISTS,uploadAction:a.Playlists.UPLOAD_IMAGE}),d.createElement(Em,{imageType:Bd.Banners,fieldName:"banner",application:l.PLAYLISTS,uploadAction:a.Playlists.UPLOAD_IMAGE}),d.createElement("div",{className:"d-flex justify-content-between align-items-center"},d.createElement(fu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.id?"Save":"Create"),!!e.actions&&d.createElement(Bm,{actions:e.actions})))}function $b(e){var t,n=e.playlist&&e.playlist.id;return d.createElement(Ys,{initialValues:e.playlist,validationSchema:Hb,onSubmit:e.savePlaylist},d.createElement(Jb,{id:n,actions:!!n&&(t=n,[{label:"Delete playlist",appLink:{application:l.PLAYLISTS,action:a.Playlists.DELETE_PLAYLIST,args:[t]},className:"text-danger"}])}))}function Kb(e){return d.createElement("div",{className:"py-2"},d.createElement(Km,{tabs:qb(e.currentUser,e.playlistId),isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}));var t}function Yb(e){var t=Object(bn.useDispatch)(),n=yy(),r=i.useBasicFetch(_b(e.playlistId)),o=i.useBasicFetch(zb());return d.createElement(d.Fragment,null,!!o.data&&d.createElement(Kb,{playlistId:e.playlistId,activeAction:a.Playlists.EDIT_PLAYLIST,currentUser:o.data}),!!r.data&&d.createElement($b,{playlist:r.data,savePlaylist:function(r,o){i.fetch(t,Nb(e.playlistId,r,(function(){n.success("Successfully updated playlist.")}),(function(){n.error("Failed to update playlist.")}),o))}}))}var Gb=function(e,t){var n=e.dataServiceName,r=e.eventPrefix,i=e.fetchData,o=e.setData,a=e.onError,c=e.deleteEventPrefix;if(hn(i)){if(hn(o)){var s=a&&hn(a),u=ay.getInstance(n),l=y.Radio.channel(u.channelName),f="".concat(r,":request"),p="".concat(r,":sync"),d="".concat(r,":error"),m="".concat(r,":invalidate"),h=c&&"".concat(c,":sync"),v=function(){return t(!1)},b=function(){return t(!0)},g=function(){return t(!1)},S=function(){return l.off(m,g)};l.once(f,v),l.once(p,b),l.once(m,g),s&&l.once(d,a),h&&l.once(h,S);var E=i(u);return E&&(t(!0),e.setData(E)),function(){ay.releaseInstance(n),l.off(f,v),l.off(p,b),l.off(m,g),s&&l.off(d,a),h&&l.off(h,S)}}K.throw(new Xe("A setData function must be passed to fetch"))}else K.throw(new Xe("A fetchData function must be passed to fetch"))};function Wb(e){return function(e){if(Array.isArray(e))return Xb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Qb(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 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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||Qb(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){if(e){if("string"==typeof e)return Xb(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)?Xb(e,t):void 0}}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}var eg=function(e){return Array(Array.isArray(e)?e.length:0).fill(!1)};function tg(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=d.useState(eg(e)),i=Zb(r,2),o=i[0],a=i[1];d.useEffect((function(){a(eg(e))}),Wb(t)),d.useEffect((function(){if(n){var t=[];return e&&e.forEach((function(e,n){t.push(Gb(e,(function(e){e!==o[n]&&a(Ci(o,n,e))})))})),function(){return t.forEach((function(e){return e()}))}}}),[o,n])}function ng(e){return function(e){if(Array.isArray(e))return og(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||ig(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 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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||ig(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){if(e){if("string"==typeof e)return og(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)?og(e,t):void 0}}function og(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,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=d.useState(!1),i=rg(r,2),o=i[0],a=i[1];d.useEffect((function(){a(!1)}),ng(t)),d.useEffect((function(){if(n)return Gb(e,a)}),[o,n])}var cg,sg,ug,lg,fg,pg=function(e,t,n){return function(r){return e((function(e){var i=hn(n)?n:yn();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)))}))}},dg={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"}(cg||(cg={})),function(e){e.Playlists="playlists",e.Series="series",e.Videos="videos"}(sg||(sg={})),function(e){e.Playlists="playlists",e.Series="series",e.Videos="videos"}(ug||(ug={})),function(e){e.Root="0"}(lg||(lg={})),function(e){e.Root="root"}(fg||(fg={}));var mg,hg=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default(""),backboneAudienceIds:Gs.array().of(Gs.string()).required("A level is required").default([])}).noUnknown();!function(e){e.Subject="Subject",e.Topic="Topic"}(mg||(mg={}));var yg=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default(""),parentIds:Gs.array().of(Gs.string()).default([fg.Root]),backboneClassificationIds:Gs.array().of(Gs.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:Gs.mixed().required("Type is required").default(mg.Subject),emphasize:Gs.boolean().default(!1),comingSoon:Gs.boolean().default(!0),canBePreferred:Gs.boolean().default(!1),cover:Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown(),banner:Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown()}).noUnknown(),vg=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown(),bg=Gs.object().shape({name:Gs.string().max(255,"Name is too long").required("Name is required"),description:Gs.string().max(65535,"Description is too long").required("Description is required")}),gg=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default(""),parentId:Gs.string().default(lg.Root)}).noUnknown(),Sg={singularizeMemberType:function(e){switch(e){case sg.Playlists:return"playlist";case sg.Series:return"series";case sg.Videos:return"video"}},getMemberAppLink:function(e,t){var n=[t];switch(e){case sg.Playlists:return{application:l.PLAYLISTS,action:a.Playlists.EDIT_PLAYLIST,args:n};case sg.Series:return{application:l.SERIES,action:a.Series.EDIT_SERIES,args:n};case sg.Videos:return{application:l.VIDEOS,action:a.Videos.EDIT_VIDEO,args:n}}},getMemberActions:function(e,t,n,r){return[{label:"Remove ".concat(Sg.singularizeMemberType(n)),appLink:{application:l.SUBJECTS,action:t===cg.Subject?a.Subjects.REMOVE_SUBJECT_MEMBER:a.Subjects.REMOVE_CLASSIFICATION_MEMBER,args:[e,r,n]},className:"text-danger"}]}},Eg=function(){var e=l.SUBJECTS,t=a.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]}]},Og=function(e,t){var n=l.SUBJECTS,r=a.Subjects,i=[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:i});return t&&(r.params={presentationId:t}),{label:e.label,appLink:r}}))},Cg=function(e,t){var n=l.SUBJECTS,r=a.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]}}]},Ag=function(e,t){var n=l.SUBJECTS,r=a.Subjects,i=[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:i});return t&&(r.params={presentationId:t}),{label:e.label,appLink:r}}))},jg=function(e,t){var n=l.SUBJECTS,r=a.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]}}]},wg={singularizeMemberType:function(e){switch(e){case ug.Playlists:return"playlist";case ug.Series:return"series";case ug.Videos:return"video"}},getMemberAppLink:function(e,t){var n=[t];switch(e){case ug.Playlists:return{application:l.PLAYLISTS,action:a.Playlists.EDIT_PLAYLIST,args:n};case ug.Series:return{application:l.SERIES,action:a.Series.EDIT_SERIES,args:n};case ug.Videos:return{application:l.VIDEOS,action:a.Videos.EDIT_VIDEO,args:n}}},getMemberActions:function(e,t,n,r){return[{label:"Remove ".concat(wg.singularizeMemberType(n)),appLink:{application:l.SUBJECTS,action:t===cg.Level?a.Subjects.REMOVE_LEVEL_MEMBER:a.Subjects.REMOVE_AUDIENCE_MEMBER,args:[e,r,n]},className:"text-danger"}]}};function Ig(e){return(Ig="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 Tg(e){return function(e){if(Array.isArray(e))return kg(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 kg(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 kg(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 kg(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,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _g(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 Pg(e,t){return(Pg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function xg(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Rg(e);if(t){var i=Rg(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ng(this,n)}}function Ng(e,t){return!t||"object"!==Ig(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 Rg(e){return(Rg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Dg=function(){return"/api/subjects/v1/backbone-classifications/tree"},Mg=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},Ug=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/").concat(t,"?query={limit:100}")},Fg=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},Vg=function(){return"/api/subjects/v1/backbone-classifications"},Bg=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},zg=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},Hg=function(e){return"/api/subjects/v1/objects/".concat(e,"/backbone-classifications")},qg=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/backbone-classifications?addToClassifications=").concat(!!t)},Jg=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/objects?addToClassifications=").concat(!!t)},$g=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},Kg=function(){return"/api/subjects/v1/presentations"},Yg=function(e){return"/api/subjects/v1/presentations/".concat(e)},Gg=function(){return"/api/subjects/v1/presentations"},Wg=function(e){return"/api/subjects/v1/presentations/".concat(e)},Zg=function(e){return"/api/subjects/v1/presentations/".concat(e,"/classifications/tree")},Qg=function(e){return"/api/subjects/v1/classifications/".concat(e,"?query=cover,banner,followers")},Xg=function(e,t){return"/api/subjects/v1/classifications/".concat(e,"/").concat(t,"?query={limit:100}")},eS=function(){return"/api/subjects/v1/classifications"},tS=function(e){return"/api/subjects/v1/classifications/".concat(e)},nS=function(e){return"/api/subjects/v1/classifications/".concat(e)},rS=function(e){return"/api/subjects/v1/objects/".concat(e,"/classifications")},iS=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/classifications?presentationId=").concat(t)},oS=function(e){return"/api/subjects/v1/classifications/".concat(e,"/objects")},aS=function(e,t){return"/api/subjects/v1/classifications/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},cS=function(){return"/api/subjects/v1/backbone-audiences"},sS=function(e){return"/api/subjects/v1/backbone-audiences/".concat(e)},uS=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/").concat(t,"?query={limit:100}")},lS=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},fS=function(){return"/api/subjects/v1/backbone-audiences"},pS=function(e){return"/api/subjects/v1/backbone-audiences/".concat(e)},dS=function(e){return"/api/subjects/v1/objects/".concat(e,"/backbone-audiences")},mS=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/backbone-audiences?addToAudiences=").concat(!!t)},hS=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/objects?addToAudiences=").concat(!!t)},yS=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},vS=function(e){return"/api/subjects/v1/presentations/".concat(e,"/audiences")},bS=function(e){return"/api/subjects/v1/audiences/".concat(e)},gS=function(e,t){return"/api/master/v2/objects/".concat(e,"/").concat(t,"?query={limit:100}")},SS=function(){return"/api/subjects/v1/audiences"},ES=function(e){return"/api/subjects/v1/audiences/".concat(e)},OS=function(e){return"/api/subjects/v1/audiences/".concat(e)},CS=function(e){return"/api/subjects/v1/objects/".concat(e,"/audiences")},AS=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/audiences?presentationId=").concat(t)},jS=function(e){return"/api/subjects/v1/audiences/".concat(e,"/objects")},wS=function(e,t){return"/api/subjects/v1/audiences/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},IS=function(e,t,n){var r="".concat(c.SUBJECT,":").concat(e);return t&&(r+=":".concat(t)),r+=":".concat(c.CLASSIFICATIONS),n&&(r+=":".concat(n)),r},TS=function(e,t,n){var r="".concat(c.LEVEL,":").concat(e);return t&&(r+=":".concat(t)),r+=":".concat(c.AUDIENCES),n&&(r+=":".concat(n)),r},kS=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&&Pg(e,t)}(o,e);var t,n,r,i=xg(o);function o(){return Lg(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"getPresentations",value:function(e,t){return this.get({resource:Kg(),eventPrefix:c.PRESENTATIONS,expiryTime:dg.STANDARD,callback:e,errorCallback:t})}},{key:"getPresentation",value:function(e,t,n){return this.get({resource:Yg(e),eventPrefix:"".concat(c.PRESENTATION,":").concat(e),expiryTime:dg.STANDARD,callback:t,errorCallback:n})}},{key:"createPresentation",value:function(e,t,n){return this.create({resource:Gg(),data:e,callback:t,errorCallback:n,eventPrefix:c.PRESENTATION,invalidationKeys:[c.PRESENTATIONS],expiryTime:dg.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:Wg(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_PRESENTATION,":").concat(e),invalidationKeys:["".concat(c.PRESENTATION,":").concat(e),c.PRESENTATIONS],expiryTime:dg.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:Dg(),formatData:function(e){return{children:e,name:lg.Root,id:null}},eventPrefix:c.SUBJECTS,expiryTime:dg.STANDARD,callback:e,errorCallback:t})}},{key:"getSubject",value:function(e,t,n){return this.get({resource:Mg(e),eventPrefix:"".concat(c.SUBJECT,":").concat(e),expiryTime:dg.STANDARD,callback:t,errorCallback:n})}},{key:"getSubjectMemberIds",value:function(e,t,n,r){return this.get({resource:Ug(e,t),eventPrefix:"".concat(c.SUBJECT,":").concat(e,":").concat(t),expiryTime:dg.STANDARD,callback:n,errorCallback:r})}},{key:"getSubjectClassifications",value:function(e,t,n,r,i){return this.get({resource:Fg(e,t,n),eventPrefix:IS(e,t,n),expiryTime:dg.STANDARD,callback:r,errorCallback:i})}},{key:"createSubject",value:function(e,t,n){return this.create({resource:Vg(),data:e,callback:t,errorCallback:n,eventPrefix:c.SUBJECT,invalidationKeys:[c.SUBJECTS],expiryTime:dg.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:Bg(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_SUBJECT,":").concat(e),invalidationKeys:["".concat(c.SUBJECT,":").concat(e),c.SUBJECTS],expiryTime:dg.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:zg(e),callback:t,errorCallback:n,eventPrefix:c.DELETE_SUBJECT,invalidationKeys:["".concat(c.SUBJECT,":").concat(e),c.SUBJECTS],successHandler:this.alertService.success("Successfully deleted subject."),errorHandler:function(e){var t,n=(null===(t=e)||void 0===t?void 0:t.code)===oi.Conflict?"Cannot delete a subject with child subjects and/or classifications.":"Failed to delete subject.";r.alertService.error(n)()}})}},{key:"getObjectSubjects",value:function(e,t,n,r){return this.get({resource:Hg(e),eventPrefix:"".concat(t,":").concat(e,":").concat(c.SUBJECTS),expiryTime:dg.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectSubjects",value:function(e,t,n,r,i,o){var a=Sg.singularizeMemberType(n),s=["".concat(n,":").concat(e,":").concat(c.SUBJECTS)];return r&&s.push("".concat(n,":").concat(e,":").concat(c.CLASSIFICATIONS)),s.push.apply(s,Tg(t.map((function(e){return"".concat(c.SUBJECTS,":").concat(e,":").concat(n)})))),this.update({resource:qg(e,r),data:t,callback:i,errorCallback:o,eventPrefix:"".concat(c.UPDATE_OBJECT_SUBJECTS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(a," subjects.")),errorHandler:this.alertService.error("Failed to update ".concat(a," subjects."))})}},{key:"addObjectsToSubject",value:function(e,t,n,r,i,o){var a=1===t.length?Sg.singularizeMemberType(n):n,s=["".concat(c.SUBJECT,":").concat(e,":").concat(n)].concat(Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.SUBJECTS)}))),Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.CLASSIFICATIONS)}))));return this.create({resource:Jg(e,r),data:t,callback:i,errorCallback:o,eventPrefix:"".concat(c.ADD_TO_SUBJECT,":").concat(e,":").concat(n),invalidationKeys:s,expiryTime:dg.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(a," to subject.")),errorHandler:this.alertService.error("Failed to add ".concat(a," to subject."))})}},{key:"removeObjectsFromSubject",value:function(e,t,n,r,i){var o=1===t.length?Sg.singularizeMemberType(n):n,a=["".concat(c.SUBJECT,":").concat(e,":").concat(n)].concat(Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.SUBJECTS)}))));return this.delete({resource:$g(e,t),callback:r,errorCallback:i,eventPrefix:"".concat(c.REMOVE_FROM_SUBJECT,":").concat(e,":").concat(n),invalidationKeys:a,expiryTime:dg.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:Zg(e),formatData:function(e){return{children:e,name:fg.Root,id:null}},eventPrefix:"".concat(c.CLASSIFICATIONS,":").concat(e),expiryTime:dg.STANDARD,callback:t,errorCallback:n})}},{key:"getClassification",value:function(e,t,n){return this.get({resource:Qg(e),eventPrefix:"".concat(c.CLASSIFICATION,":").concat(e),expiryTime:dg.STANDARD,callback:t,errorCallback:n})}},{key:"getClassificationMembers",value:function(e,t,n,r){return this.get({resource:Xg(e,t),eventPrefix:"".concat(c.CLASSIFICATION,":").concat(e,":").concat(t),expiryTime:dg.STANDARD,callback:n,errorCallback:r})}},{key:"createClassification",value:function(e,t,n){return this.create({resource:eS(),data:e,callback:t,errorCallback:n,eventPrefix:c.CLASSIFICATION,invalidationKeys:[c.CLASSIFICATIONS],expiryTime:dg.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:tS(e),data:Rr.omit(t,["followers"]),callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_CLASSIFICATION,":").concat(e),invalidationKeys:["".concat(c.CLASSIFICATION,":").concat(e),c.CLASSIFICATIONS],expiryTime:dg.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:nS(e),callback:t,errorCallback:n,eventPrefix:c.DELETE_CLASSIFICATION,invalidationKeys:["".concat(c.CLASSIFICATION,":").concat(e),c.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:rS(e),eventPrefix:"".concat(t,":").concat(e,":").concat(c.CLASSIFICATIONS),expiryTime:dg.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectClassifications",value:function(e,t,n,r,i,o){var a=Sg.singularizeMemberType(r),s=["".concat(r,":").concat(e,":").concat(c.CLASSIFICATIONS)];return s.push.apply(s,Tg(n.map((function(e){return"".concat(c.CLASSIFICATION,":").concat(e,":").concat(r)})))),this.update({resource:iS(e,t),data:n,callback:i,errorCallback:o,eventPrefix:"".concat(c.UPDATE_OBJECT_CLASSIFICATIONS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(a," classifications.")),errorHandler:this.alertService.error("Failed to update ".concat(a," classifications."))})}},{key:"addObjectsToClassification",value:function(e,t,n,r,i,o,a){var s=1===t.length?Sg.singularizeMemberType(n):n,u=["".concat(c.CLASSIFICATION,":").concat(e,":").concat(n)];return r&&u.push(IS(r,i,n)),u.push.apply(u,Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.CLASSIFICATIONS)})))),this.create({resource:oS(e),data:t,callback:o,errorCallback:a,eventPrefix:"".concat(c.ADD_TO_CLASSIFICATION,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:dg.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,a){var s=1===t.length?Sg.singularizeMemberType(n):n,u=["".concat(c.CLASSIFICATION,":").concat(e,":").concat(n)];return r&&u.push(IS(r,i,n)),u.push.apply(u,Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.CLASSIFICATIONS)})))),this.delete({resource:aS(e,t),callback:o,errorCallback:a,eventPrefix:"".concat(c.REMOVE_FROM_CLASSIFICATION,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:dg.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:cS(),eventPrefix:c.LEVELS,expiryTime:dg.STANDARD,callback:e,errorCallback:t})}},{key:"getLevel",value:function(e,t,n){return this.get({resource:sS(e),eventPrefix:"".concat(c.LEVEL,":").concat(e),expiryTime:dg.STANDARD,callback:t,errorCallback:n})}},{key:"getLevelMemberIds",value:function(e,t,n,r){return this.get({resource:uS(e,t),eventPrefix:"".concat(c.LEVEL,":").concat(e,":").concat(t),expiryTime:dg.STANDARD,callback:n,errorCallback:r})}},{key:"getLevelAudiences",value:function(e,t,n,r,i){return this.get({resource:lS(e,t,n),eventPrefix:TS(e,t,n),expiryTime:dg.STANDARD,callback:r,errorCallback:i})}},{key:"createLevel",value:function(e,t,n){return this.create({resource:fS(),data:e,callback:t,errorCallback:n,eventPrefix:c.LEVEL,invalidationKeys:[c.LEVELS],expiryTime:dg.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:pS(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_LEVEL,":").concat(e),invalidationKeys:["".concat(c.LEVEL,":").concat(e),c.LEVELS],expiryTime:dg.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:dS(e),eventPrefix:"".concat(t,":").concat(e,":").concat(c.LEVELS),expiryTime:dg.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectLevels",value:function(e,t,n,r,i,o){var a=Sg.singularizeMemberType(n),s=["".concat(n,":").concat(e,":").concat(c.LEVELS)];return r&&s.push("".concat(n,":").concat(e,":").concat(c.AUDIENCES)),this.update({resource:mS(e,r),data:t,callback:i,errorCallback:o,eventPrefix:"".concat(c.UPDATE_OBJECT_LEVELS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(a," levels.")),errorHandler:this.alertService.error("Failed to update ".concat(a," levels."))})}},{key:"addObjectsToLevel",value:function(e,t,n,r,i,o){var a=1===t.length?wg.singularizeMemberType(n):n,s=["".concat(c.LEVEL,":").concat(e,":").concat(n)].concat(Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.LEVELS)}))),Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.AUDIENCES)}))));return this.create({resource:hS(e,r),data:t,callback:i,errorCallback:o,eventPrefix:"".concat(c.ADD_TO_LEVEL,":").concat(e,":").concat(n),invalidationKeys:s,expiryTime:dg.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(a," to level.")),errorHandler:this.alertService.error("Failed to add ".concat(a," to level."))})}},{key:"removeObjectsFromLevel",value:function(e,t,n,r,i){var o=1===t.length?wg.singularizeMemberType(n):n,a=["".concat(c.LEVEL,":").concat(e,":").concat(n)].concat(Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.LEVELS)}))));return this.delete({resource:yS(e,t),callback:r,errorCallback:i,eventPrefix:"".concat(c.REMOVE_FROM_LEVEL,":").concat(e,":").concat(n),invalidationKeys:a,expiryTime:dg.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:vS(e),callback:t,errorCallback:n,eventPrefix:"".concat(c.AUDIENCES,":").concat(e),expiryTime:dg.STANDARD})}},{key:"getAudience",value:function(e,t,n){return this.get({resource:bS(e),callback:t,errorCallback:n,eventPrefix:"".concat(c.AUDIENCE,":").concat(e),expiryTime:dg.STANDARD})}},{key:"getAudienceMembers",value:function(e,t,n,r){return this.get({resource:gS(e,t),eventPrefix:"".concat(c.AUDIENCE,":").concat(e,":").concat(t),expiryTime:dg.STANDARD,callback:n,errorCallback:r})}},{key:"createAudience",value:function(e,t,n){return this.create({resource:SS(),data:e,callback:t,errorCallback:n,eventPrefix:c.AUDIENCE,invalidationKeys:[c.AUDIENCES],expiryTime:dg.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:ES(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_AUDIENCE,":").concat(e),invalidationKeys:["".concat(c.AUDIENCE,":").concat(e),c.AUDIENCES],expiryTime:dg.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:OS(e),callback:t,errorCallback:n,eventPrefix:c.DELETE_AUDIENCE,invalidationKeys:["".concat(c.AUDIENCE,":").concat(e),c.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:CS(e),eventPrefix:"".concat(t,":").concat(e,":").concat(c.AUDIENCES),expiryTime:dg.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectAudiences",value:function(e,t,n,r,i,o){var a=Sg.singularizeMemberType(r);return this.update({resource:AS(e,t),data:n,callback:i,errorCallback:o,eventPrefix:"".concat(c.UPDATE_OBJECT_AUDIENCES,":").concat(e),invalidationKeys:["".concat(r,":").concat(e,":").concat(c.AUDIENCES)],successHandler:this.alertService.success("Successfully updated ".concat(a," audiences.")),errorHandler:this.alertService.error("Failed to update ".concat(a," audiences."))})}},{key:"addObjectsToAudience",value:function(e,t,n,r,i,o,a){var s=1===t.length?wg.singularizeMemberType(n):n,u=["".concat(c.AUDIENCE,":").concat(e,":").concat(n)];return r&&u.push(TS(r,i,n)),u.push.apply(u,Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.AUDIENCES)})))),this.create({resource:jS(e),data:t,callback:o,errorCallback:a,eventPrefix:"".concat(c.ADD_TO_AUDIENCE,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:dg.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,a){var s=1===t.length?wg.singularizeMemberType(n):n,u=["".concat(c.AUDIENCE,":").concat(e,":").concat(n)];return r&&u.push(TS(r,i,n)),u.push.apply(u,Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.AUDIENCES)})))),this.delete({resource:wS(e,t),callback:o,errorCallback:a,eventPrefix:"".concat(c.REMOVE_FROM_AUDIENCE,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:dg.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(s," from audience.")),errorHandler:this.alertService.error("Failed to remove ".concat(s," from audience."))})}},{key:"name",get:function(){return p.SUBJECT}},{key:"channelName",get:function(){return f.SUBJECT}}])&&_g(t.prototype,n),r&&_g(t,r),o}(mr),LS={dataServiceName:p.SUBJECT,dataChannelName:f.SUBJECT},_S={getSubjectTreeFetchOptions:function(e,t){return Object.assign(Object.assign({},LS),{eventPrefix:c.SUBJECTS,fetchData:function(e){return e.getSubjectTree()},setData:e,onError:t})},getSubjectFetchOptions:function(e,t,n){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.SUBJECT,":").concat(e),fetchData:function(t){return t.getSubject(e)},setData:t,onError:n,deleteEventPrefix:c.DELETE_SUBJECT})},getSubjectMemberIdsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.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({},LS),{eventPrefix:IS(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({},LS),{eventPrefix:"".concat(t,":").concat(e,":").concat(c.SUBJECTS),fetchData:function(n){return n.getObjectSubjects(e,t)},setData:n,onError:r})},getPresentationsFetchOptions:function(e,t){return Object.assign(Object.assign({},LS),{eventPrefix:c.PRESENTATIONS,fetchData:function(e){return e.getPresentations()},setData:e,onError:t})},getPresentationFetchOptions:function(e,t,n){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.PRESENTATION,":").concat(e),fetchData:function(t){return t.getPresentation(e)},setData:t,onError:n})},getClassificationTreeFetchOptions:function(e,t,n){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.CLASSIFICATIONS,":").concat(e),fetchData:function(t){return t.getClassificationTree(e)},setData:t,onError:n})},getClassificationFetchOptions:function(e,t,n){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.CLASSIFICATION,":").concat(e),fetchData:function(t){return t.getClassification(e)},setData:t,onError:n,deleteEventPrefix:c.DELETE_CLASSIFICATION})},getClassificationMembersFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.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({},LS),{eventPrefix:"".concat(t,":").concat(e,":").concat(c.CLASSIFICATIONS),fetchData:function(n){return n.getObjectClassifications(e,t)},setData:n,onError:r})},getLevelsFetchOptions:function(e,t){return Object.assign(Object.assign({},LS),{eventPrefix:c.LEVELS,fetchData:function(e){return e.getLevels()},setData:e,onError:t})},getLevelFetchOptions:function(e,t,n){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.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({},LS),{eventPrefix:"".concat(c.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({},LS),{eventPrefix:TS(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({},LS),{eventPrefix:"".concat(t,":").concat(e,":").concat(c.LEVELS),fetchData:function(n){return n.getObjectLevels(e,t)},setData:n,onError:r})},getAudiencesFetchOptions:function(e,t,n){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.AUDIENCES,":").concat(e),fetchData:function(t){return t.getAudiences(e)},setData:t,onError:n})},getAudienceFetchOptions:function(e,t,n){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.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({},LS),{eventPrefix:"".concat(c.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({},LS),{eventPrefix:"".concat(t,":").concat(e,":").concat(c.AUDIENCES),fetchData:function(n){return n.getObjectAudiences(e,t)},setData:n,onError:r})}},PS=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_LEVEL,args:[e.id]}},xS=function(e,t){var n=e.backboneAudienceIds;return t.filter((function(e){return n.includes(e.id)}))};function NS(e){var t=e.showLevels;return d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",null,"Audiences"),!!t&&d.createElement("th",null,"Mapped Backbone Audience(s)")))}function RS(e){var t,n=e.audience,r=e.levels;return d.createElement("tr",null,d.createElement("td",null,d.createElement(Nd,{appLink:(t=n,{application:l.SUBJECTS,action:a.Subjects.EDIT_AUDIENCE,args:[t.presentationId,t.masterId]})},n.name)),d.createElement("td",null,r.map((function(e){return d.createElement(Nd,{key:e.id,appLink:PS(e),className:"mr-2"},e.name)}))))}function DS(e){var t=e.audiences,n=e.levels;return d.createElement(Zs.Table,{responsive:!0,bordered:!0},d.createElement(NS,{showLevels:!!t.length}),d.createElement("tbody",null,t.length?t.map((function(e){return d.createElement(RS,{key:e.masterId,audience:e,levels:xS(e,n)})})):d.createElement("tr",null,d.createElement("td",null,"This presentation has no audiences."))))}function MS(e){var t=null===e.masterId||void 0===e.masterId,n=_s(),r=cu(n);return d.createElement(Bs,null,d.createElement(iu,{label:"Name",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this audience",autoFocus:!0}),d.createElement(iu,{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 d.createElement("option",{key:e.id,value:e.id},e.name)}))),d.createElement("div",{className:"d-flex justify-content-between"},d.createElement(fu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&d.createElement(Zs.Button,{as:Nd,variant:"danger",appLink:{application:l.SUBJECTS,action:a.Subjects.DELETE_AUDIENCE,args:[e.presentationId,e.masterId]}},"Delete")))}function US(e){return d.createElement(Ys,{initialValues:e.audience,validationSchema:hg,onSubmit:e.saveAudience},d.createElement(MS,{masterId:e.audience&&e.audience.masterId,presentationId:e.presentationId,levels:e.levels}))}function FS(e){var t=e.objectAudiences,n=e.presentationAudiences;return t.filter((function(e){return n.some((function(t){return t.masterId===e.masterId}))}))}function VS(e){var t,n,r,i,o,a=Sg.singularizeMemberType(e.memberType),c=(n=(t=e).presentationAudiences,r=t.objectLevels,i=t.objectAudiences,o=r.map((function(e){return e.id})),n.filter((function(e){return wi(e.backboneAudienceIds,o).length||i.some((function(t){return t.masterId===e.masterId}))})));return d.createElement(d.Fragment,null,d.createElement("div",{className:"border-bottom pb-3 mb-3"},d.createElement("h6",null,"Backbone Audiences"),d.createElement("p",null,"Select which backbone audiences this ".concat(a," is mapped to.")),d.createElement("p",null,"To see how backbone audiences correspond to audiences, scroll down to the audience-backbone audience mappings table."),d.createElement(fE,{initialValues:{backboneAudienceIds:e.objectLevels.map((function(e){return e.id})),addToAudiences:!0},saveLevels:e.saveLevels,levels:e.levels,memberType:e.memberType})),d.createElement("h6",null,"Audiences"),d.createElement("p",null,"Select a presentation to view its audiences and map them to this ".concat(a,".")),d.createElement("div",{className:"w-50 pb-3"},d.createElement(CE,{presentations:e.presentations,currentPresentationId:e.currentPresentation.id,setCurrentPresentation:e.setCurrentPresentation})),d.createElement("p",null,"Audience to backbone audience mappings for this presentation are displayed below."),d.createElement(DS,{levels:e.levels,audiences:e.presentationAudiences}),d.createElement("p",null,"Only the audiences which are mapped to a backbone audience that this"+" ".concat(a," is mapped to are displayed below.")),!!c.length&&d.createElement(zS,{initialValues:{audienceIds:FS(e).map((function(e){return e.masterId}))},saveAudiences:e.saveAudiences,audiences:c}))}function BS(e){var t=_s(),n=cu(t);return d.createElement(Bs,null,d.createElement(iu,{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 d.createElement("option",{key:e.masterId,value:e.masterId},e.name)}))),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(fu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Save Audiences")))}function zS(e){return d.createElement(Ys,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.audienceIds;return e.saveAudiences(r,n)},enableReinitialize:!0},d.createElement(BS,{audiences:e.audiences}))}var HS=function(e){return function(t){if(!e)return t.appLink.action===a.Subjects.EDIT_AUDIENCE;switch(e){case ug.Playlists:return t.appLink.action===a.Subjects.EDIT_AUDIENCE_PLAYLISTS;case ug.Series:return t.appLink.action===a.Subjects.EDIT_AUDIENCE_SERIES;case ug.Videos:return t.appLink.action===a.Subjects.EDIT_AUDIENCE_VIDEOS}}};function qS(e){var t=e.presentation,n=e.audienceId,r=e.memberType;return t?d.createElement(d.Fragment,null,d.createElement("h6",null,"Presentation: ".concat(!!t&&t.name)),d.createElement("div",{className:"py-2"},d.createElement(Km,{tabs:jg(t.id,n),isItemActive:HS(r)}))):d.createElement(d.Fragment,null)}function JS(e){var t=e.item,n=e.getItemAppLink,r=e.actions;return d.createElement("tr",null,d.createElement("td",null,d.createElement(Nd,{appLink:n(t)},t.name)),r&&d.createElement("td",null,d.createElement("span",{className:"d-flex justify-content-end"},d.createElement(Bm,{actions:r}))))}function $S(e){var t=e.items,n=e.memberType,r=e.getItemAppLink,i=e.getActions;if(!t.length)return d.createElement("div",{className:"py-5"},"No ".concat(n," in this audience."));var o="".concat(cm(wg.singularizeMemberType(n))," Name");return d.createElement(Zs.Table,{responsive:!0},d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",null,o),hn(i)&&d.createElement("th",null))),d.createElement("tbody",null,t.map((function(e){return d.createElement(JS,{item:e,key:e.id,getItemAppLink:r,actions:hn(i)&&i(e)})}))))}function KS(e){var t=e.item,n=e.getItemAppLink,r=e.actions,i=e.pinState;return d.createElement("tr",null,d.createElement("td",null,d.createElement(Nd,{appLink:n(t)},t.name)),i.isPinnable&&d.createElement("td",null,d.createElement(Fd,{selected:parseInt(t.id)===parseInt(i.currentPinnedVideo),onToggle:function(e){return i.onChange(e,t.id)},id:t.id})),r&&d.createElement("td",null,d.createElement("span",{className:"d-flex justify-content-end"},d.createElement(Bm,{actions:r}))))}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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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 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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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.items,n=e.memberType,r=e.classification,i=e.getItemAppLink,o=e.getActions,a=e.updatePinnedVideo,c=WS(d.useState(!1),2),s=c[0],u=c[1],l=function(e,t){var n=e.pinnedVideoMasterId||null,r=YS(d.useState(n),2),i=r[0],o=r[1];return{currentPinnedVideo:i,onChange:function(e,t){o(e?t:null)},canSubmit:n!==i,isPinnable:t===sg.Videos}}(r,n);if(!t.length)return d.createElement("div",{className:"py-5"},"No ".concat(n," in this classification."));var f="".concat(cm(Sg.singularizeMemberType(n))," Name");return d.createElement(d.Fragment,null,d.createElement(Zs.Table,{responsive:!0},d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",null,f),l.isPinnable&&d.createElement("th",null,"Pinned"),hn(o)&&d.createElement("th",null))),d.createElement("tbody",null,t.map((function(e){return d.createElement(KS,{item:e,key:e.id,getItemAppLink:i,actions:hn(o)&&o(e),pinState:l})})))),l.isPinnable&&d.createElement(fu,{showSpinner:s,onClick:function(){u(!0),a(l.currentPinnedVideo,(function(){return u(!1)}))},disabled:!l.canSubmit||s},"Save"))}function XS(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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}var tE=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[e]}};function nE(e){var t,n,r,i,o,c,s=_s(),u=cu(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),m=XS(d.useState(p),2),h=m[0],y=m[1];d.useEffect((function(){return y(p)}),[null===(r=e.classification)||void 0===r?void 0:r.id,s.values.parentIds]),d.useEffect((function(){s.values.backboneClassificationIds.length&&!s.touched.backboneClassificationIds&&s.setFieldTouched("backboneClassificationIds",!0)}),[s.values.backboneClassificationIds]);var v=function(e){return s.setFieldValue("parentIds",Ii(s.values.parentIds.map((function(e){return e.toString()})),e.id.toString()))},b=function(e){return s.setFieldValue("backboneClassificationIds",Ii(s.values.backboneClassificationIds.map((function(e){return e.toString()})),e.id.toString()))},g=function(e){return"".concat(Qs(s.errors,s.touched,e)," h-auto py-2")};return d.createElement(Bs,null,d.createElement(iu,{label:"Name",name:"name",id:"name",value:s.values.name,placeholder:"Enter a name for this classification",autoFocus:!0}),d.createElement(iu,{as:"select",label:"Type",name:"type",id:"type",value:s.values.type},Rr.getEnumKeys(mg).map((function(e){return d.createElement("option",{key:e,value:mg[e]},e)}))),d.createElement(iu,{label:"Coming Soon",name:"comingSoon",id:"comingSoon",type:"checkbox",checked:s.values.comingSoon}),d.createElement(iu,{label:"Emphasize",name:"emphasize",id:"emphasize",type:"checkbox",checked:s.values.emphasize}),d.createElement(iu,{label:"Can Be Preferred",name:"canBePreferred",id:"canBePreferred",type:"checkbox",checked:s.values.canBePreferred}),!f&&d.createElement(d.Fragment,null,d.createElement("label",null,"Total Followers:")," ",null===(o=null===(i=e.classification.followers)||void 0===i?void 0:i.data)||void 0===o?void 0:o.length),d.createElement(iu,{name:"parentIds"},(function(){var t,n,r;return d.createElement("div",{className:g("parentIds")},d.createElement(ah,{label:"Parent Classification(s)",tree:e.classificationTree,selectedIds:s.values.parentIds,onSelect:v,collapse:h,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=lm.find(n,r);return!!lm.find(t,e.id)})}))})),d.createElement(iu,{name:"backboneClassificationIds"},(function(){return d.createElement("div",{className:g("backboneClassificationIds")},d.createElement(ah,{label:"Mapped Subject(s)",tree:e.subjectTree,selectedIds:s.values.backboneClassificationIds,onSelect:b,collapse:!f,getSelectedItemAppLink:tE}))})),d.createElement(Em,{imageType:Bd.Covers,fieldName:"cover",application:l.SUBJECTS,uploadAction:a.Subjects.UPLOAD_IMAGE}),d.createElement(Em,{imageType:Bd.Banners,fieldName:"banner",application:l.SUBJECTS,uploadAction:a.Subjects.UPLOAD_IMAGE}),d.createElement("div",{className:"d-flex justify-content-between"},d.createElement(fu,{showSpinner:s.isSubmitting,type:"submit",disabled:!u},f?"Create":"Save"),!f&&d.createElement(Zs.Button,{as:Nd,variant:"danger",appLink:{application:l.SUBJECTS,action:a.Subjects.DELETE_CLASSIFICATION,args:[e.presentationId,null===(c=e.classification)||void 0===c?void 0:c.id]}},"Delete")))}function rE(e){return d.createElement(Ys,{initialValues:e.classification,validationSchema:yg,onSubmit:e.saveClassification},d.createElement(nE,{presentationId:e.presentationId,classificationTree:e.classificationTree,subjectTree:e.subjectTree,classification:e.classification}))}var iE=function(e){return function(t){if(!e)return t.appLink.action===a.Subjects.EDIT_CLASSIFICATION;switch(e){case sg.Playlists:return t.appLink.action===a.Subjects.EDIT_CLASSIFICATION_PLAYLISTS;case sg.Series:return t.appLink.action===a.Subjects.EDIT_CLASSIFICATION_SERIES;case sg.Videos:return t.appLink.action===a.Subjects.EDIT_CLASSIFICATION_VIDEOS}}};function oE(e){var t=e.presentation,n=e.classificationId,r=e.memberType;return t?d.createElement(d.Fragment,null,d.createElement("h6",null,"Presentation: ".concat(!!t&&t.name)),d.createElement("div",{className:"py-2"},d.createElement(Km,{tabs:Cg(t.id,n),isItemActive:iE(r)}))):d.createElement(d.Fragment,null)}function aE(e){var t=_s(),n=cu(t),r=function(e){return t.setFieldValue("classificationIds",Ii(t.values.classificationIds.map((function(e){return e.toString()})),e.id.toString()))},i="".concat(Qs(t.errors,t.touched,"classificationIds")," h-auto py-2");return d.createElement(Bs,null,d.createElement(iu,{name:"classificationIds"},(function(){return d.createElement("div",{className:i},d.createElement(ah,{label:"Mapped Classification(s)",tree:e.classificationTree,selectedIds:t.values.classificationIds,onSelect:r,getSelectedItemAppLink:(n=e.presentationId,function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[n,e]}}),isNodeDisabled:e.isClassificationDisabled}));var n})),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(fu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Save Classifications")))}function cE(e){return d.createElement(Ys,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.classificationIds;return e.saveClassifications(r,n)},enableReinitialize:!0},d.createElement(aE,{presentationId:e.presentationId,classificationTree:e.classificationTree,isClassificationDisabled:e.isClassificationDisabled}))}function sE(e){var t=null===e.id||void 0===e.id,n=_s(),r=cu(n);return d.createElement(Bs,null,d.createElement(iu,{label:"Name",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this level",autoFocus:!0}),d.createElement(fu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"))}function uE(e){return d.createElement(Ys,{initialValues:e.level,validationSchema:vg,onSubmit:e.saveLevel},d.createElement(sE,{id:e.level&&e.level.id}))}function lE(e){var t=Sg.singularizeMemberType(e.memberType),n=_s(),r=cu(n);return d.createElement(Bs,null,d.createElement(iu,{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 d.createElement("option",{key:e.id,value:e.id},e.name)}))),d.createElement(iu,{label:"Automatically add to audiences*",name:"addToAudiences",id:"add-to-audiences",type:"checkbox",checked:n.values.addToAudiences}),d.createElement("p",null,d.createElement("em",null,"*If selected, when adding a ".concat(t," to a backbone audience, all of that backbone audience's")+" mapped audiences across all presentations will also be added to.")),d.createElement("p",null,d.createElement("strong",null,"Note:")," When removing a ".concat(t," from a backbone audience, that backbone audience's mapped audiences "),d.createElement("strong",null,"will not")," be automatically removed from."),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(fu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},"Save Backbone Audience")))}function fE(e){return d.createElement(Ys,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.backboneAudienceIds,i=t.addToAudiences;return e.saveLevels(r,i,n)}},d.createElement(lE,{levels:e.levels,memberType:e.memberType}))}var pE=function(e){return function(t){return t.appLink.action===e}};function dE(e){var t=e.levelId,n=e.activeAction,r=e.presentationId;return d.createElement(d.Fragment,null,d.createElement(Zs.Alert,{variant:"danger"},"Warning: You are editing the backbone audiences."),d.createElement("div",{className:"py-2"},d.createElement(Km,{tabs:Ag(t,r),isItemActive:pE(n)})))}var mE=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 hE(e){return d.createElement(d.Fragment,null,e.audiences.map((function(t){return d.createElement("th",{key:t.masterId},d.createElement("span",{className:"d-inline-block"},d.createElement(Fd,{selected:e.getIsAudienceSelected(t),onToggle:function(n){return e.onToggleAudience(t.masterId,n)}})),d.createElement(Nd,{appLink:e.getAudienceAppLink(t.masterId)},function(e,t){return t?e.name:"Audience: ".concat(e.name)}(t,e.showAudienceSubHeader)))})))}function yE(e){var t=e.memberType,n=e.hasActions,r=e.audiences,i=mE(e,["memberType","hasActions","audiences"]),o="".concat(cm(wg.singularizeMemberType(t))," Name"),a=!!r&&!!r.length,c=a&&r.length>1,s=a?2:1,u=Object.assign({audiences:r,showAudienceSubHeader:c},i);return d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",{rowSpan:s},o),a&&(c?d.createElement("th",{colSpan:r.length,className:"text-center"},"Audiences"):d.createElement(hE,Object.assign({},u))),n&&d.createElement("th",{rowSpan:s})),a&&c&&d.createElement("tr",null,d.createElement(hE,Object.assign({},u))))}function vE(e){var t=e.member,n=t.id,i=t.name,o=t.audiences,a=void 0===o?[]:o,c=e.getMemberAppLink,s=e.onToggleAudience,u=e.actions,l=hn(c)&&c(n);return a.length&&!hn(s)&&r.ErrorHelper.throw(new Xe("onToggleAudience must be passed to LevelMemberItem")),d.createElement("tr",null,d.createElement("td",null,l?d.createElement(Nd,{appLink:c(n)},i):i),!!a.length&&a.map((function(e){return d.createElement("td",{key:e.id},d.createElement(Fd,{selected:e.selected,onToggle:function(t){return s(e.id,t,n)}}))})),u&&d.createElement("td",null,d.createElement("span",{className:"d-flex justify-content-end"},d.createElement(Bm,{actions:u}))))}var bE=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 gE(e,t){return function(n){var r=n[e],i=uh(r);return!!i&&i===t.length}}function SE(e){var t=e.members,n=e.memberType,r=e.getActions,i=e.audiences,o=e.getAudienceAppLink,a=e.onToggleAudience,c=bE(e,["members","memberType","getActions","audiences","getAudienceAppLink","onToggleAudience"]);if(!t.length)return d.createElement("div",{className:"py-5"},"No ".concat(n," in this level."));var s=hn(r),u={memberType:n,audiences:i,getAudienceAppLink:o,getIsAudienceSelected:gE(n,t),onToggleAudience:a,hasActions:s};return d.createElement(Zs.Table,{responsive:!0,bordered:!0},d.createElement(yE,Object.assign({},u)),d.createElement("tbody",null,t.map((function(e,t){return d.createElement(vE,Object.assign({key:t,member:e,actions:s&&r(e.id),onToggleAudience:a},c))}))))}function EE(e){var t=e.values,n=t.name,r=t.description,i=e.id,o=e.isSubmitting,a=!i;return d.createElement(Bs,null,d.createElement(iu,{label:"Name",type:"text",name:"name",id:"name",value:n,placeholder:"Enter a name for this presentation",autoFocus:!0}),d.createElement(iu,{label:"Description",as:"textarea",name:"description",id:"description",value:r,placeholder:"Describe this presentation here"}),d.createElement(fu,{showSpinner:o,type:"submit"},a?"Create":"Save"))}function OE(e){var t=e.presentation,n=(t=void 0===t?{}:t).id,r=void 0===n?null:n,i=t.name,o=void 0===i?"":i,a=t.description,c=void 0===a?"":a,s=e.savePresentation;return d.createElement(Ds,{initialValues:{name:o,description:c},validationSchema:bg,onSubmit:s},(function(e){return d.createElement(EE,Object.assign({id:r},e))}))}function CE(e){var t=e.presentations,n=e.currentPresentationId,r=e.setCurrentPresentation,i=e.label,o=function(e){var n=function(e,t){return Oi(t.filter((function(t){return t.id.toString()===e.toString()})))}(e,t);r(n)};return d.useEffect((function(){t&&!n&&r(Oi(t))}),[t]),d.createElement(d.Fragment,null,!!n&&d.createElement(d.Fragment,null,d.createElement(Zs.Form.Label,null,i),d.createElement(Zs.Form.Control,{as:"select",value:n,onChange:function(e){return o(e.target.value)},className:"cursor-pointer"},t.map((function(e){return d.createElement("option",{value:e.id,key:e.id},e.name)})))))}function AE(e){return d.createElement(d.Fragment,null,d.createElement("h4",null,"".concat(cm(e.memberType))),d.createElement(Zs.Table,{responsive:!0},d.createElement("tbody",null,e.objects&&e.objects.map((function(t){return d.createElement("tr",{key:t.id},d.createElement("td",null,d.createElement(Nd,{appLink:Sg.getMemberAppLink(e.memberType,t.id)},t.name)))})))),d.createElement(DE,{initialValues:{backboneClassificationIds:[],addToClassifications:!0},subjectTree:e.subjectTree,saveSubjects:e.onClickAddToSubject,memberType:e.memberType,saveBtnText:"Add to backbone classification",subjectRequired:!0}))}function jE(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)||function(e,t){if(!e)return;if("string"==typeof e)return wE(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 wE(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 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 IE(e){var t=Sg.singularizeMemberType(e.memberType),n=[].concat(jE(e.objectClassifications),jE(e.objectSubjectClassifications)).map((function(e){return e.id}));return d.createElement(d.Fragment,null,d.createElement("div",{className:"border-bottom pb-3 mb-3"},d.createElement("h6",null,"Backbone Classifications"),d.createElement("p",null,"Select which backbone classifications this ".concat(t," is mapped to.")),d.createElement(DE,{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})),d.createElement("h6",null,"Classifications"),d.createElement("p",null,"Select a presentation to view its classifications and map them to this ".concat(t,".")),d.createElement("div",{className:"w-50 pb-3"},d.createElement(CE,{presentations:e.presentations,currentPresentationId:e.currentPresentation.id,setCurrentPresentation:e.setCurrentPresentation})),e.currentPresentation&&e.classificationTree&&e.classificationTree.children.length?d.createElement(d.Fragment,null,d.createElement("p",null,"Only classifications which are mapped to one of the backbone classifications selected above can be selected."),d.createElement(cE,{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)}})):d.createElement("p",null,"This presentation has no classifications."))}function TE(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return kE(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 kE(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 kE(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}CE.defaultProps={label:"Presentation"};function LE(e){var t=!e.id,n=_s(),r=cu(n),i=!t||!!n.values.parentId,o=TE(d.useState(i),2),c=o[0],s=o[1];d.useEffect((function(){return s(i)}),[e.id,n.values.parentId]);var u=function(e){var t=e.id===n.values.parentId?null:e.id;n.setFieldValue("parentId",t)},f="".concat(Qs(n.errors,n.touched,"parentId")," h-auto py-2");return d.createElement(Bs,null,d.createElement(iu,{label:"Name",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this backbone classification",autoFocus:!0}),d.createElement(iu,{name:"parentId"},(function(){return d.createElement("div",{className:f},d.createElement(ah,{label:"Parent Subject",tree:e.subjectTree,selectedIds:[n.values.parentId],onSelect:u,collapse:c,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=lm.find(t,r);return!!lm.find(n,e.id)})}));var t,r})),d.createElement("div",{className:"d-flex justify-content-between"},d.createElement(fu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&d.createElement(Zs.Button,{as:Nd,variant:"danger",appLink:{application:l.SUBJECTS,action:a.Subjects.DELETE_SUBJECT,args:[e.id]}},"Delete")))}function _E(e){return d.createElement(Ys,{initialValues:e.subject,validationSchema:gg,onSubmit:e.saveSubject},d.createElement(LE,{id:e.subject&&e.subject.id,subjectTree:e.subjectTree}))}var PE=function(e){return function(t){return t.appLink.action===e}};function xE(e){var t=e.subjectId,n=e.activeAction,r=e.presentationId;return d.createElement(d.Fragment,null,d.createElement(Zs.Alert,{variant:"danger"},"Warning: You are editing the backbone classifications."),d.createElement("div",{className:"py-2"},d.createElement(Km,{tabs:Og(t,r),isItemActive:PE(n)})))}var NE=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[e]}};function RE(e){var t=_s(),n=cu(t),r=function(n){var r=e.allowMultiple?Ii(t.values.backboneClassificationIds.map((function(e){return e.toString()})),n.id.toString()):[n.id];t.setFieldValue("backboneClassificationIds",r)},i=Sg.singularizeMemberType(e.memberType),o="".concat(Qs(t.errors,t.touched,"backboneClassificationIds")," h-auto py-2");return d.createElement(Bs,null,d.createElement(iu,{name:"backboneClassificationIds"},(function(){return d.createElement("div",{className:o},d.createElement(ah,{label:"Mapped Backbone Classification".concat(e.allowMultiple?"(s)":""),tree:e.subjectTree,selectedIds:t.values.backboneClassificationIds,onSelect:r,collapse:!!t.initialValues.backboneClassificationIds.length,getSelectedItemAppLink:NE}))})),d.createElement(iu,{label:"Automatically add to classifications*",name:"addToClassifications",id:"add-to-classifications",type:"checkbox",checked:t.values.addToClassifications}),d.createElement("p",null,d.createElement("em",null,"*If selected, when adding a ".concat(i," to a backbone classification,")+" all of that backbone classification's mapped classifications across all presentations will also be added to.")),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(fu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.saveBtnText)))}function DE(e){var t;return d.createElement(Ys,{initialValues:e.initialValues,validationSchema:(t=e.subjectRequired,Gs.object().shape({backboneClassificationIds:t?Gs.array().of(Gs.string()).min(1,"A subject is required").required("A subject is required"):Gs.array().of(Gs.string()),addToClassifications:Gs.boolean().default(!0)}).noUnknown()),onSubmit:function(t,n){var r=t.backboneClassificationIds,i=t.addToClassifications;return e.saveSubjects(r,i,n)}},d.createElement(RE,{subjectTree:e.subjectTree,memberType:e.memberType,allowMultiple:e.allowMultiple,saveBtnText:e.saveBtnText}))}RE.defaultProps={saveBtnText:"Save"};var ME=function(e){return d.createElement("div",{className:"border rounded p-2 mb-3"},d.createElement("h6",{className:"border-bottom pb-1"},e.presentation.name),e.classifications&&e.classifications.length?d.createElement("ul",{className:"list-unstyled mb-0"},e.classifications.map((function(t){return d.createElement("li",{key:t.id,className:"py-1"},d.createElement(Nd,{appLink:(n=e.presentation.id,r=t.id,{application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[n,r]})},t.name));var n,r}))):d.createElement("p",null,d.createElement("em",null,"There are no classifications mapped to this backbone classification in this presentation.")))},UE=function(e){return d.createElement(d.Fragment,null,!!e.presentations&&!!e.classificationDictionary&&e.presentations.map((function(t){return d.createElement(ME,{key:t.id,presentation:t,classifications:e.classificationDictionary[t.id]})})))},FE=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 VE(e){return d.createElement(d.Fragment,null,e.classifications.map((function(t){return d.createElement("th",{key:t.id},d.createElement("span",{className:"d-inline-block"},d.createElement(Fd,{selected:e.getIsClassificationSelected(t),onToggle:function(n){return e.onToggleClassification(t.id,n)}})),d.createElement(Nd,{appLink:e.getClassificationAppLink(t.id)},function(e,t){return t?e.name:"Classification: ".concat(e.name)}(t,e.showClassificationSubHeader)))})))}function BE(e){var t=e.memberType,n=e.hasActions,r=e.classifications,i=FE(e,["memberType","hasActions","classifications"]),o="".concat(cm(Sg.singularizeMemberType(t))," Name"),a=!!r&&!!r.length,c=a&&r.length>1,s=a?2:1,u=Object.assign({classifications:r,showClassificationSubHeader:c},i);return d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",{rowSpan:s},o),a&&(c?d.createElement("th",{colSpan:r.length,className:"text-center"},"Classifications"):d.createElement(VE,Object.assign({},u))),n&&d.createElement("th",{rowSpan:s})),a&&c&&d.createElement("tr",null,d.createElement(VE,Object.assign({},u))))}function zE(e){var t=e.member,n=t.id,i=t.name,o=t.classifications,a=void 0===o?[]:o,c=e.getMemberAppLink,s=e.onToggleClassification,u=e.actions,l=hn(c)&&c(n);return a.length&&!hn(s)&&r.ErrorHelper.throw(new Xe("onToggleClassification must be passed to SubjectMemberItem")),d.createElement("tr",null,d.createElement("td",null,l?d.createElement(Nd,{appLink:c(n)},i):i),!!a.length&&a.map((function(e){return d.createElement("td",{key:e.id},d.createElement(Fd,{selected:e.selected,onToggle:function(t){return s(e.id,t,n)}}))})),u&&d.createElement("td",null,d.createElement("span",{className:"d-flex justify-content-end"},d.createElement(Bm,{actions:u}))))}var HE=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 qE(e,t){return function(n){var r=n[e],i=uh(r);return!!i&&i===t.length}}function JE(e){var t=e.members,n=e.memberType,r=e.getActions,i=e.classifications,o=e.getClassificationAppLink,a=e.onToggleClassification,c=HE(e,["members","memberType","getActions","classifications","getClassificationAppLink","onToggleClassification"]);if(!t.length)return d.createElement("div",{className:"py-5"},"No ".concat(n," in this backbone classification."));var s=hn(r),u={memberType:n,classifications:i,getClassificationAppLink:o,getIsClassificationSelected:qE(n,t),onToggleClassification:a,hasActions:s};return d.createElement(Zs.Table,{responsive:!0,bordered:!0},d.createElement(BE,Object.assign({},u)),d.createElement("tbody",null,t.map((function(e,t){return d.createElement(zE,Object.assign({key:t,member:e,actions:s&&r(e.id),onToggleClassification:a},c))}))))}function $E(e){var t=e.navItems,n=e.currentAppLink;return d.createElement(Zs.Container,null,d.createElement(Zs.Navbar,{className:"justify-content-between align-items-center"},d.createElement(Zs.Nav,null,!!t&&t.map((function(e,t){return d.createElement(Zs.Nav.Item,{key:t},d.createElement(Nd,{appLink:e.appLink,className:"nav-link".concat(im.isItemActive(e,n)?" text-primary":"")},e.label))})))))}function KE(e,t){d.useEffect((function(){e.presentations&&!e.currentPresentation&&pg(t,"currentPresentation")(Oi(e.presentations))}),[e.presentations])}function YE(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return GE(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 GE(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 GE(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 WE(e){var t=i.useBasicFetch(_b(e.playlistId)),n=i.useBasicFetch(zb()),r=YE(d.useState({}),2),o=r[0],c=r[1],s=cy(p.SUBJECT);!function(e,t,n){var r=function(e){return pg(n,e)};tg([_S.getObjectLevelsFetchOptions(e,sg.Playlists,r("playlistLevels"))],[e]),ag(_S.getObjectAudiencesFetchOptions(e,sg.Playlists,r("playlistAudiences")),[e,t.playlistLevels]),tg([_S.getPresentationsFetchOptions(r("presentations")),_S.getLevelsFetchOptions(r("levels"))],[]),ag(!!t.currentPresentation&&_S.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.playlistId,o,c),KE(o,c);var u=!!(o.presentations&&o.levels&&o.presentationAudiences&&o.playlistLevels&&o.playlistAudiences);return d.createElement(d.Fragment,null,!!n.data&&d.createElement(Kb,{playlistId:e.playlistId,activeAction:a.Playlists.EDIT_PLAYLIST_AUDIENCES,currentUser:n.data}),d.createElement(zm,{object:t.data}),!!u&&d.createElement(VS,{objectLevels:o.playlistLevels,objectAudiences:o.playlistAudiences,presentations:o.presentations,currentPresentation:o.currentPresentation,setCurrentPresentation:pg(c,"currentPresentation"),levels:o.levels,presentationAudiences:o.presentationAudiences,memberType:sg.Playlists,saveLevels:function(t,n,r){return s.updateObjectLevels(e.playlistId,t,sg.Playlists,n,r,r)},saveAudiences:function(t,n){return s.updateObjectAudiences(e.playlistId,o.currentPresentation.id,t,sg.Playlists,n,n)}}))}function ZE(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||XE(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 QE(e){return function(e){if(Array.isArray(e))return eO(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||XE(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 XE(e,t){if(e){if("string"==typeof e)return eO(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)?eO(e,t):void 0}}function eO(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 tO(e){var t=i.useBasicFetch(_b(e.playlistId)),n=i.useBasicFetch(zb()),r=ZE(d.useState({}),2),o=r[0],c=r[1],s=cy(p.SUBJECT);!function(e,t,n){var r=function(e){return pg(n,e)};tg([_S.getSubjectTreeFetchOptions(r("subjectTree")),_S.getPresentationsFetchOptions(r("presentations"))],[]),tg([_S.getObjectSubjectsFetchOptions(e,sg.Playlists,r("playlistSubjects"))],[e]),ag(!!t.currentPresentation&&_S.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),d.useEffect((function(){return r("subjectClassifications")([])}),[t.playlistSubjects]);var i=function(e,t){return[].concat(QE(t.subjectClassifications||[]),QE(e))},o=t.playlistSubjects&&t.playlistSubjects.map((function(e){return _S.getSubjectClassificationFetchOptions(e.id,pg(n,"subjectClassifications",i))}));tg(o,[t.playlistSubjects],!!o),ag(_S.getObjectClassificationsFetchOptions(e,sg.Playlists,r("playlistClassifications")),[e,t.playlistSubjects])}(e.playlistId,o,c),KE(o,c);var u=!!(o.playlistSubjects&&o.subjectTree&&o.presentations&&o.classificationTree&&o.playlistClassifications&&o.subjectClassifications);return d.createElement(d.Fragment,null,!!n.data&&d.createElement(Kb,{playlistId:e.playlistId,activeAction:a.Playlists.EDIT_PLAYLIST_SUBJECTS,currentUser:n.data}),d.createElement(zm,{object:t.data}),u&&d.createElement(IE,{objectSubjects:o.playlistSubjects,subjectTree:o.subjectTree,memberType:sg.Playlists,presentations:o.presentations,currentPresentation:o.currentPresentation,setCurrentPresentation:pg(c,"currentPresentation"),objectClassifications:o.playlistClassifications,objectSubjectClassifications:o.subjectClassifications,classificationTree:o.classificationTree,saveSubjects:function(t,n,r){return s.updateObjectSubjects(e.playlistId,t,sg.Playlists,n,r,r)},saveClassifications:function(t,n){return s.updateObjectClassifications(e.playlistId,o.currentPresentation.id,t,sg.Playlists,n,n)}}))}var nO=function(e,t,n){if(t===n)return{reorderedItems:e,reorderRequest:null};var r=Ai(e,t,n),i=n<e.length-1?r[n+1].id:null;return{reorderedItems:r,reorderRequest:{sourceMemberId:r[n].id,destinationMemberId:i}}};function rO(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return iO(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 iO(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 iO(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 oO(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return aO(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 aO(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 aO(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 cO=function(e){return{application:l.VIDEOS,action:a.Videos.EDIT_VIDEO,args:[e.id]}};function sO(e){var t,n,r,o,c,s,u=Object(bn.useDispatch)(),f=yy(),p=i.useBasicFetch(_b(e.playlistId)),m=i.useBasicFetch(Db(e.playlistId)),h=i.useBasicFetch(zb()),y=oO((n=null===(t=m.data)||void 0===t?void 0:t.data,r=rO(Object(d.useState)(),2),o=r[0],c=r[1],Object(d.useEffect)((function(){o&&(n.length!==o.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,o))&&c(null)}),[n]),[o,c]),2),v=y[0],b=y[1],g=v?{data:v,pagination:null}:m.data;return d.createElement(d.Fragment,null,!!h.data&&d.createElement(Kb,{playlistId:e.playlistId,activeAction:a.Playlists.EDIT_PLAYLIST_VIDEOS,currentUser:h.data}),d.createElement(zm,{object:p.data}),!!g&&d.createElement(Oh,{onSortEnd:function(t,n){if(t!==n){var r=nO(m.data.data,t,n),o=r.reorderRequest,a=r.reorderedItems;b(a);i.fetch(u,Mb(e.playlistId,o,null,(function(){f.error("Failed to update playlist order."),b(null)})))}},videos:g,getVideoAppLink:cO,getVideoActions:(s=e.playlistId,function(e){return[{label:"Remove video",appLink:{application:l.PLAYLISTS,action:a.Playlists.REMOVE_VIDEO,args:[s.toString(),e.id.toString()]},className:"text-danger"}]}),emptyMessage:"There are no videos in this playlist."}))}function uO(){var e=Object(bn.useDispatch)(),t=yy(),n=i.useBasicFetch(zb());return d.createElement(d.Fragment,null,!!n.data&&d.createElement($b,{savePlaylist:function(o,c){i.fetch(e,xb(o,n.data.id,(function(e){t.success("Successfully created playlist."),function(e){e&&e.id&&r.AppLinkHelper.trigger({application:l.PLAYLISTS,action:a.Playlists.EDIT_PLAYLIST,args:[e.id]})}(e)}),(function(){t.error("Failed to create playlist.")}),c))}}))}var lO="rating,thumbnail,glance,herobanner",fO=function(e){return{url:"/api/master/v2/objects/".concat(e,"?query=").concat(lO),key:"videos:".concat(e)}},pO=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("&"))}},dO=function(e){return{url:"/ajax/hostedlibraries/rightsline/programs/".concat(e),key:"rightsline:videos:".concat(e),normalizeOptions:{namespace:"rightsline"}}},mO=function(e,t,n,r,i){return{key:"videos:".concat(e),url:"/api/master/v2/objects/".concat(e),data:t,type:Cr.PUT,success:n,error:r,always:i}};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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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(bn.useDispatch)(),n=yy(),r=i.useBasicFetch(_b(e.playlistId)),o=i.useBasicFetch(fO(e.videoId)),a=hO(d.useState(!1),2),c=a[0],s=a[1];var u=!!r.data&&!!o.data;return d.createElement(by,{title:"Remove Video",closePopup:e.closePopup,showLoadingSpinner:!u},!!u&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to remove ",d.createElement("strong",null,o.data.name)," from ",d.createElement("strong",null,r.data.name),"?")),d.createElement(Sy,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){s(!0),i.fetch(t,Ub(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:c}]})))}function bO(e){return r.AppLinkHelper.trigger(function(e){return{application:l.PLAYLISTS,action:a.Playlists.EDIT_PLAYLIST,args:[e.id]}}(e))}function gO(e){var t=e?{application:l.PLAYLISTS,action:a.Playlists.SEARCH_PLAYLISTS,params:{query:e}}:{application:l.PLAYLISTS,action:a.Playlists.PLAYLISTS};r.AppLinkHelper.trigger(t)}function SO(e){return d.createElement("div",{className:"pb-3 w-50"},d.createElement(hd,{initialQuery:e.query,placeholder:"Search for a playlist",onSuggestionSelected:bO,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/playlists/instant/raw","?query=").concat(e)},activationLength:2,onSubmit:gO}))}var EO=l.PLAYLISTS,OO=function(e){return{application:EO,action:a.Playlists.EDIT_PLAYLIST,args:[e.id]}};function CO(e){var t=i.useBasicFetch(kb(e.cursor));return d.createElement(d.Fragment,null,d.createElement(SO,null),d.createElement(_m,{collection:t&&t.data,collectionAppLink:{application:EO,action:a.Playlists.PLAYLISTS},newObjectAppLink:{application:EO,action:a.Playlists.NEW_PLAYLIST},getObjectAppLink:OO,objectName:"Playlist"}))}var AO=l.PLAYLISTS,jO=function(e){return{application:AO,action:a.Playlists.EDIT_PLAYLIST,args:[e.id]}};function wO(e){var t=i.useBasicFetch(Lb(e.query,e.cursor));return d.createElement(d.Fragment,null,d.createElement(SO,{query:e.query}),!!t.data&&(t.data.data.length?d.createElement(_m,{collection:t.data,collectionAppLink:{application:AO,action:a.Playlists.SEARCH_PLAYLISTS,params:{query:e.query}},newObjectAppLink:{application:AO,action:a.Playlists.NEW_PLAYLIST},getObjectAppLink:jO,objectName:"Playlist"}):d.createElement("p",null,"No playlists found, please try a different search query.")))}function IO(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return TO(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 TO(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 TO(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 kO=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 LO(e){var t=e.id,n=e.routeToOnDelete,i=e.closePopup,o=IO(d.useState(),2),a=o[0],c=o[1],s=IO(d.useState(!1),2),u=s[0],l=s[1],f=cy(p.SUBJECT);ag(_S.getAudienceFetchOptions(t,c),[t]);return d.createElement(by,{title:"Delete Audience",closePopup:i,showLoadingSpinner:!a},!!a&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,a.name),"?")),d.createElement(Sy,{buttons:kO((function(){l(!0);f.deleteAudience(t,(function(){i(),n&&r.AppLinkHelper.trigger(n)}),i)}),i,u)})))}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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return PO(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 PO(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 PO(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 xO(e){var t=e.presentationId,n=e.audienceId,r=_O(d.useState(),2),i=r[0],o=r[1],a=_O(d.useState(),2),c=a[0],s=a[1],u=_O(d.useState(),2),l=u[0],f=u[1],m=cy(p.SUBJECT);ag(_S.getAudienceFetchOptions(n,o),[n]),ag(_S.getLevelsFetchOptions(s),[]),ag(_S.getPresentationFetchOptions(t,f),[t]);return d.createElement(d.Fragment,null,d.createElement(qS,{presentation:l,audienceId:n}),!!l&&d.createElement("h6",null,"Presentation: ".concat(l.name)),!!i&&!!c&&d.createElement(US,{audience:i,levels:c,saveAudience:function(e,r){return m.updateAudience(n,Object.assign(Object.assign({},e),{presentationId:t}),r,r)},presentationId:t}))}function NO(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return RO(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 RO(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 RO(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 DO=function(e){return{application:l.SUBJECTS,action:a.Subjects.PRESENTATION_AUDIENCES,args:[e]}};function MO(e){var t=e.presentationId,n=NO(d.useState(),2),i=n[0],o=n[1],c=NO(d.useState(),2),s=c[0],u=c[1],f=cy(p.SUBJECT);ag(_S.getLevelsFetchOptions(o),[]),ag(_S.getPresentationFetchOptions(t,u),[t]);return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-2"},d.createElement(Rd,{appLink:DO(t),backToName:"audiences"})),!!s&&d.createElement("h6",null,"Presentation: ".concat(s.name)),!!i&&d.createElement(US,{levels:i,presentationId:t,saveAudience:function(e,n){return f.createAudience(Object.assign(Object.assign({},e),{presentationId:t}),function(e,t){return function(n){t(),r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_AUDIENCE,args:[e,n.masterId]})}}(t,n),n)}}))}var UO=n(137),FO=n.n(UO);function VO(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return BO(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 BO(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 BO(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 zO(e){var t=e.presentationId,n=e.selectedAudienceId,r=VO(d.useState(),2),i=r[0],o=r[1];ag(_S.getAudiencesFetchOptions(t,o),[]);var c=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_AUDIENCE,args:[t,e.masterId]}},s={application:l.SUBJECTS,action:a.Subjects.NEW_AUDIENCE,args:[t]};return d.createElement("div",{className:"".concat(FO.a.navContainer," h-auto pr-2 border-right")},d.createElement("h5",{className:"border-bottom pb-2"},"Audiences"),d.createElement(Nd,{appLink:s,className:"d-inline-block pb-2"},d.createElement(Fp,{svgName:Rp.Plus,size:Up.Small}),d.createElement("span",null,"New Audience")),d.createElement("div",{className:"border-top pt-1"},d.createElement("ul",{className:"list-unstyled"},i&&i.map((function(e){var t;return d.createElement("li",{className:"position-relative py-1"},d.createElement(Nd,{className:(null===(t=n)||void 0===t?void 0:t.toString())===e.masterId.toString()?"text-primary font-weight-500":"",appLink:c(e)},e.name))})))))}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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qO(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 qO(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 qO(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 JO(e){var t=e.presentationId,n=e.audienceId,r=e.memberType,i=HO(d.useState(),2),o=i[0],a=i[1],c=HO(d.useState(),2),s=(c[0],c[1]),u=HO(d.useState(),2),l=u[0],f=u[1];ag(_S.getPresentationFetchOptions(t,a),[]),ag(_S.getAudienceFetchOptions(n,s),[n]),ag(_S.getAudienceMembersFetchOptions(n,r,f),[n,r]);var p={items:l&&l.data,memberType:r,getItemAppLink:function(e){return wg.getMemberAppLink(r,e.id)},getActions:function(e){return wg.getMemberActions(n,cg.Audience,r,e.id)}},m={presentation:o,audienceId:n},h=om(p);return d.createElement(d.Fragment,null,d.createElement(qS,Object.assign({},m,{memberType:r})),h&&d.createElement($S,Object.assign({},p)))}function $O(e){return{application:l.SUBJECTS,action:a.Subjects.NEW_CLASSIFICATION,args:[e]}}function KO(e){return[{label:"Add child",getAppLink:function(t){return Object.assign(Object.assign({},$O(e)),{args:[e],params:{parentId:t.id}})}},{label:"Delete classification",getAppLink:function(t){return{application:l.SUBJECTS,action:a.Subjects.DELETE_CLASSIFICATION,args:[e,t.id]}},className:"text-danger"}]}var YO=n(138),GO=n.n(YO);function WO(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ZO(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 ZO(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 ZO(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 QO(e){var t=e.presentationId,n=e.selectedClassificationId,r=WO(d.useState(),2),i=r[0],o=r[1],c=WO(d.useState(),2),s=c[0],u=c[1];return function(e,t,n){tg([_S.getClassificationTreeFetchOptions(e,t),_S.getPresentationFetchOptions(e,n)],[e])}(t,o,u),d.createElement("div",{className:"".concat(GO.a.navContainer," h-auto pr-2 border-right")},!!s&&d.createElement("h6",{className:"border-bottom pb-2"},"Classifications (".concat(s.name,")")),d.createElement(Nd,{appLink:$O(t),className:"d-inline-block pb-2"},d.createElement(Fp,{svgName:Rp.Plus,size:Up.Small}),d.createElement("span",null,"New Classification")),!!i&&d.createElement("div",{className:"border-top pt-1"},d.createElement(th,{tree:i,getAppLink:function(e){return function(e,t){return{application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[e,t.id]}}(t,e)},selectedIds:[n],actions:KO(t)})))}function XO(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return eC(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 eC(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 eC(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 tC(e){var t=e.classificationId,n=e.routeToOnDelete,i=e.closePopup,o=XO(d.useState(),2),a=o[0],c=o[1],s=XO(d.useState(!1),2),u=s[0],l=s[1];ag(_S.getClassificationFetchOptions(t,c),[]);var f=cy(p.SUBJECT),m=[{variant:"link",onClick:i,buttonText:"Cancel"},{variant:"danger",onClick:function(){l(!0);f.deleteClassification(t,(function(){i(),n&&r.AppLinkHelper.trigger(n)}),i)},buttonText:"Yes, delete this classification",isSpinnerButton:!0,showSpinner:u}];return d.createElement(by,{title:"Delete Classification",closePopup:i,showLoadingSpinner:!a},!!a&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,a.name),"?")),d.createElement(Sy,{buttons:m})))}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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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=e.presentationId,n=e.classificationId,r=nC(d.useState(),2),i=r[0],o=r[1],a=nC(d.useState(),2),c=a[0],s=a[1],u=nC(d.useState(),2),l=u[0],f=u[1],m=nC(d.useState(),2),h=m[0],y=m[1],v=cy(p.SUBJECT),b=_S.getClassificationFetchOptions(n,o),g=_S.getPresentationFetchOptions(t,s),S=_S.getClassificationTreeFetchOptions(t,f);ag(_S.getSubjectTreeFetchOptions(y),[]),ag(b,[n]),tg([g,S],[t]);return d.createElement("div",null,d.createElement(oE,{presentation:c,classificationId:n}),!!i&&!!l&&!!h&&d.createElement(rE,{classification:i,presentationId:t,subjectTree:h,classificationTree:l,saveClassification:function(e,t){var r,o=Object.assign({pinnedVideoMasterId:(null===(r=i)||void 0===r?void 0:r.pinnedVideoMasterId)||null},e);return v.updateClassification(n,o,t,t)}}))}function oC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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 cC(e){var t=e.presentationId,n=e.classificationId,r=e.memberType,i=oC(d.useState(),2),o=i[0],a=i[1],c=oC(d.useState(),2),s=c[0],u=c[1],l=oC(d.useState(),2),f=l[0],m=l[1];ag(_S.getPresentationFetchOptions(t,a),[]),ag(_S.getClassificationFetchOptions(n,u),[n]),ag(_S.getClassificationMembersFetchOptions(n,r,m),[n,r]);var h=cy(p.SUBJECT),y={items:f&&f.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 Sg.getMemberAppLink(r,e.id)},getActions:function(e){return Sg.getMemberActions(n,cg.Classification,r,e.id)}},v={presentation:o,classificationId:n},b=om(y);return d.createElement(d.Fragment,null,d.createElement(oE,Object.assign({},v,{memberType:r})),b&&d.createElement(QS,Object.assign({},y)))}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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return uC(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 uC(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 uC(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 lC(e){var t=e.presentationId,n=e.parentId,i=sC(d.useState(),2),o=i[0],c=i[1],s=sC(d.useState(),2),u=s[0],f=s[1],m=cy(p.SUBJECT),h=_S.getClassificationTreeFetchOptions(t,c);ag(_S.getSubjectTreeFetchOptions(f),[]),ag(h,[t]);return d.createElement("div",null,d.createElement("h4",{className:"py-2"},"Create New Classification"),!!u&&!!o&&d.createElement(rE,{classification:n?{parentIds:[n]}:{},presentationId:t,subjectTree:u,classificationTree:o,saveClassification:function(e,n){return m.createClassification(Object.assign(Object.assign({},e),{presentationId:t}),function(e,t){return function(n){t(),n&&n.id&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[e,n.id]})}}(t,n),n)}}))}var fC=function(e){return{key:"series:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=thumbnail,tallPoster,banner,rating")}},pC=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("&"))}},dC=function(e,t,n,r){return{url:"/api/master/v2/series",key:"series",data:e,type:Cr.POST,success:t,error:n,always:r}},mC=function(e,t,n,r,i){return{url:"/api/master/v2/objects/".concat(e),key:"update:series:".concat(e),data:t,type:Cr.PUT,success:n,error:r,always:i}};function hC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yC(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 yC(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 yC(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 vC(e){var t=hC(d.useState(),2),n=t[0],r=t[1],o=hC(d.useState(!1),2),a=o[0],c=o[1],s=i.useBasicFetch(function(e,t){switch(e){case sg.Playlists:return _b(t);case sg.Series:return fC(t);case sg.Videos:return fO(t)}}(e.memberType,e.memberId)),u=cy(p.SUBJECT);ag(_S.getClassificationFetchOptions(e.classificationId,r),[e.classificationId]);var l=!!n&&!!s.data,f="Remove ".concat(cm(Sg.singularizeMemberType(e.memberType)));return d.createElement(by,{title:f,closePopup:e.closePopup,showLoadingSpinner:!l},l&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to remove ",d.createElement("strong",null,s.data.name)," from ",d.createElement("strong",null,n.name),"?"),d.createElement("p",null,"This will not remove it from the backbone subject.")),d.createElement(Sy,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){c(!0),u.removeObjectsFromClassification(e.classificationId,[e.memberId],e.memberType,null,null,e.closePopup,e.closePopup),n.pinnedVideoMasterId===e.memberId&&u.updateClassification(e.classificationId,Object.assign(Object.assign({},n),{pinnedVideoMasterId:null}))},buttonText:"Yes, remove this ".concat(Sg.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function bC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return gC(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 gC(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 gC(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 SC(e){var t=e.id,n=bC(d.useState(),2),r=n[0],i=n[1],o=cy(p.SUBJECT);ag(_S.getLevelFetchOptions(t,i),[t]);return d.createElement(d.Fragment,null,d.createElement(dE,{levelId:t,activeAction:a.Subjects.EDIT_LEVEL}),d.createElement("h4",{className:"py-2"},"Edit Level"),!!r&&d.createElement(uE,{level:r,saveLevel:function(e,n){return o.updateLevel(t,e,n,n)}}))}function EC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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(){var e=EC(d.useState(),2),t=e[0],n=e[1];return ag(_S.getLevelsFetchOptions(n),[]),d.useEffect((function(){t&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_LEVEL,args:[Oi(t).id]},{replace:!0})}),[t]),d.createElement(d.Fragment,null)}function AC(){var e=cy(p.SUBJECT);return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Create New Level"),d.createElement(uE,{saveLevel:function(t,n){return e.createLevel(t,function(e){return function(t){e(),t&&t.id&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_LEVEL,args:[t.id]})}}(n),n)}}))}var jC=n(139),wC=n.n(jC);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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return TC(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 TC(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 TC(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 kC(e){var t=e.selectedLevelId,n=IC(d.useState(),2),r=n[0],i=n[1];ag(_S.getLevelsFetchOptions(i),[]);var o=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_LEVEL,args:[e.id]}},c={application:l.SUBJECTS,action:a.Subjects.NEW_LEVEL};return d.createElement("div",{className:"".concat(wC.a.navContainer," h-auto pr-2 border-right")},d.createElement("h5",{className:"border-bottom pb-2"},"Backbone Audiences"),d.createElement(Nd,{appLink:c,className:"d-inline-block pb-2"},d.createElement(Fp,{svgName:Rp.Plus,size:Up.Small}),d.createElement("span",null,"New Backbone Audience")),d.createElement("div",{className:"border-top pt-1"},d.createElement("ul",{className:"list-unstyled"},r&&r.map((function(e){var n;return d.createElement("li",{className:"position-relative py-1"},d.createElement(Nd,{className:(null===(n=t)||void 0===n?void 0:n.toString())===e.id.toString()?"text-primary font-weight-500":"",appLink:o(e)},e.name))})))))}var LC=function(e){return d.createElement("div",{className:"border rounded p-2 mb-3"},d.createElement("h6",{className:"border-bottom pb-1"},e.presentation.name),e.audiences&&e.audiences.length?d.createElement("ul",{className:"list-unstyled mb-0"},e.audiences.map((function(t){return d.createElement("li",{key:t.masterId,className:"py-1"},d.createElement(Nd,{appLink:(n=e.presentation.id,r=t.masterId,{application:l.SUBJECTS,action:a.Subjects.EDIT_AUDIENCE,args:[n,r]})},t.name));var n,r}))):d.createElement("p",null,d.createElement("em",null,"There are no audiences mapped to this level in this presentation.")))},_C=function(e){return d.createElement(d.Fragment,null,!!e.presentations&&!!e.audienceDictionary&&e.presentations.map((function(t){return d.createElement(LC,{key:t.id,presentation:t,audiences:e.audienceDictionary[t.id]})})))};function PC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return xC(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 xC(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 xC(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 NC(e){var t=e.levelId,n=PC(d.useState({}),2),r=n[0];return function(e,t){var n=function(e){return pg(t,e)};ag(_S.getLevelAudiencesFetchOptions(e,n("audiences")),[e]),ag(_S.getPresentationsFetchOptions(n("presentations")),[])}(t,n[1]),d.createElement(d.Fragment,null,d.createElement(dE,{levelId:t,activeAction:a.Subjects.LEVEL_AUDIENCES}),d.createElement(_C,{presentations:r.presentations,audienceDictionary:ji(r.audiences,"presentationId")}))}function RC(e,t){return pg(e,t)}function DC(e){switch(e){case ug.Playlists:return a.Subjects.EDIT_LEVEL_PLAYLISTS;case ug.Series:return a.Subjects.EDIT_LEVEL_SERIES;case ug.Videos:return a.Subjects.EDIT_LEVEL_VIDEOS}}function MC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return UC(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 UC(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 UC(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=MC(d.useState({}),2),n=t[0],o=t[1],c=n.presentations,s=n.audiences,u=n.memberIds,f=n.membersWithAudiences,m=i.useBasicFetch(Array.isArray(u)&&u.length?function(e,t){switch(e){case ug.Playlists:return Pb(t);case ug.Series:return pC(t);case ug.Videos:return pO(t)}}(e.memberType,u):null),h=cy(p.SUBJECT);function y(t){r.AppLinkHelper.trigger({application:l.SUBJECTS,action:e.action,args:[e.levelId],params:{presentationId:t}})}!function(e,t,n){var r=e.presentationId,i=e.levelId,o=e.memberType;ag(_S.getPresentationsFetchOptions(RC(n,"presentations")),[]),ag(_S.getLevelMemberIdsFetchOptions(i,o,RC(n,"memberIds")),[i,o]),ag(!!r&&_S.getLevelAudiencesFetchOptions(i,RC(n,"audiences"),r,o),[i,o,r],!!r)}(e,0,o),function(e,t,n,r){var i=n.audiences;d.useEffect((function(){RC(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])}(m.data,e,n,o),d.useEffect((function(){var t;!e.presentationId&&(null===(t=c)||void 0===t?void 0:t.length)&&y(Oi(c).id)}),[e.presentationId]);var v,b,g=!!e.presentationId&&!!s;return d.createElement(d.Fragment,null,d.createElement(dE,{levelId:e.levelId,presentationId:e.presentationId,activeAction:DC(e.memberType)}),d.createElement(Zs.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."),d.createElement("div",{className:"w-50 py-2"},!!c&&d.createElement(CE,{presentations:c,currentPresentationId:e.presentationId,setCurrentPresentation:function(e){return y(e.id)}})),g&&d.createElement(SE,{members:f||[],memberType:e.memberType,getMemberAppLink:function(t){return wg.getMemberAppLink(e.memberType,t)},getActions:function(t){return wg.getMemberActions(e.levelId,cg.Level,e.memberType,t)},audiences:s,getAudienceAppLink:e.presentationId&&(v=e.memberType,b=e.presentationId,function(e){var t,n=l.SUBJECTS,r=[b,e];switch(v){case ug.Playlists:t=a.Subjects.EDIT_AUDIENCE_PLAYLISTS;break;case ug.Series:t=a.Subjects.EDIT_AUDIENCE_SERIES;break;case ug.Videos:t=a.Subjects.EDIT_AUDIENCE_VIDEOS}return{application:n,action:t,args:r}}),onToggleAudience:function(t,n,r){return function(e,t,n,r,i,o,a){(a?e.addObjectsToAudience.bind(e):e.removeObjectsFromAudience.bind(e))(o,n,t,r,i)}(h,e.memberType,r?[r]:u,e.levelId,e.presentationId,t,n)}}))}function VC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return BC(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 BC(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 BC(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 zC(e){var t=VC(d.useState(),2),n=t[0],r=t[1],o=VC(d.useState(!1),2),a=o[0],c=o[1],s=i.useBasicFetch(function(e,t){switch(e){case ug.Playlists:return _b(t);case ug.Series:return fC(t);case ug.Videos:return fO(t)}}(e.memberType,e.memberId)),u=cy(p.SUBJECT);ag(_S.getLevelFetchOptions(e.levelId,r),[e.levelId]);var l=!!n&&!!s.data,f="Remove ".concat(cm(wg.singularizeMemberType(e.memberType)));return d.createElement(by,{title:f,closePopup:e.closePopup,showLoadingSpinner:!l},l&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to remove ",d.createElement("strong",null,s.data.name)," from ",d.createElement("strong",null,n.name),"?"),d.createElement("p",null,"Please ensure that it is not in any audiences before removing.")),d.createElement(Sy,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){c(!0),u.removeObjectsFromLevel(e.levelId,[e.memberId],e.memberType,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(wg.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function HC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qC(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 qC(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 qC(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 JC(e){var t=e.id,n=HC(d.useState(),2),r=n[0],i=n[1],o=cy(p.SUBJECT);ag(_S.getPresentationFetchOptions(t,i),[t]);var a={presentation:r,savePresentation:function(e,n){var r=n.setSubmitting;return o.updatePresentation(t,e,(function(){return r(!1)}),(function(){return r(!1)}))}},c=om(a);return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Edit Presentation"),!!c&&d.createElement(OE,Object.assign({},a)))}function $C(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return KC(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 KC(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 KC(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 YC=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_PRESENTATION,args:[e.id]}},GC={application:l.SUBJECTS,action:a.Subjects.NEW_PRESENTATION};function WC(){var e=$C(d.useState(),2),t=e[0],n=e[1];return ag(_S.getPresentationsFetchOptions(n),[]),d.createElement("div",null,d.createElement("div",{className:"d-flex justify-content-between mb-2"},d.createElement("h5",{className:"d-inline-block m-0"},"Select a presentation to edit:"),d.createElement(Nd,{appLink:GC,className:"d-block"},d.createElement(Fp,{svgName:Rp.Plus,size:Up.Small}),d.createElement("span",null,"New Presentation"))),d.createElement(Jm,{objects:t,getAppLink:YC}))}function ZC(){var e=cy(p.SUBJECT);return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Create New Presentation"),d.createElement(OE,{savePresentation:function(t,n){var i=n.setSubmitting;e.createPresentation(t,(function(e){return function(e,t){t(!1),e&&e.id&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_PRESENTATION,args:[e.id]})}(e,i)}),(function(){return i(!1)}))}}))}function QC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return XC(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 XC(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 XC(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(e){var t=e.objectType,n=e.getAppLink,r=QC(d.useState(),2),i=r[0],o=r[1];return ag(_S.getPresentationsFetchOptions(o),[]),d.createElement("div",null,d.createElement("h5",null,d.createElement(ju,{namespace:"subjects.selectPresentation",phrase:"heading",options:{objectType:t}})),d.createElement(Jm,{objects:i,getAppLink:n}))}function tA(e,t){return pg(e,t)}function nA(e,t,n,i,o){var c=i.selectedSubject,s=function(){return tA(o,"showConfirmationPopup")(!1)};t.addObjectsToSubject(c.id,e.map((function(e){return e.id})),n.memberType,i.addToClassifications,(function(){s(),r.AppLinkHelper.trigger(function(e,t){var n={application:l.SUBJECTS,args:[e]};switch(t){case sg.Playlists:return Object.assign(Object.assign({},n),{action:a.Subjects.EDIT_SUBJECT_PLAYLISTS});case sg.Series:return Object.assign(Object.assign({},n),{action:a.Subjects.EDIT_SUBJECT_SERIES});case sg.Videos:return Object.assign(Object.assign({},n),{action:a.Subjects.EDIT_SUBJECT_VIDEOS})}}(c.id,n.memberType))}),s)}function rA(e,t,n){if(t&&n){var r=1===t.length?"this ".concat(Sg.singularizeMemberType(e)):"these ".concat(e);return"Add ".concat(r," to ").concat(n.name)}}function iA(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return oA(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 oA(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 oA(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 aA(e,t){return function(n,r,i){i(),tA(t,"selectedSubject")(lm.find(e.subjectTree,Oi(n))),tA(t,"addToClassifications")(r),tA(t,"showConfirmationPopup")(!0)}}function cA(e){var t=iA(d.useState({}),2),n=t[0],r=t[1],o=i.useBasicFetch(function(e,t){switch(e){case sg.Playlists:return Pb(t);case sg.Series:return pC(t);case sg.Videos:return pO(t)}}(e.memberType,e.objectIds)),a=cy(p.SUBJECT);!function(e,t){e.memberType,e.objectIds,ag(_S.getSubjectTreeFetchOptions(tA(t,"subjectTree")),[])}(e,r);var c;return d.createElement(d.Fragment,null,!!o.data&&!!n.subjectTree&&d.createElement(AE,{memberType:e.memberType,objects:o.data,subjectTree:n.subjectTree,onClickAddToSubject:aA(n,r)}),n.showConfirmationPopup&&d.createElement(Cy,{title:rA(e.memberType,o.data,n.selectedSubject),onClickConfirm:function(){return nA(o.data,a,e,n,r)},closePopup:function(){return e=!1,tA(r,"showConfirmationPopup")(e);var e}},d.createElement("p",null,"The following ".concat(e.memberType," will be added to "),d.createElement("strong",null,n.selectedSubject.name),n.addToClassifications?" and its mapped classifications:":":"),d.createElement("ul",null,o.data.map((function(e){return d.createElement("li",{key:e.id},e.name)}))),!n.addToClassifications&&d.createElement("p",null,"".concat(1===o.data.length?"It":"They"," will not be added to its mapped classifications.")),d.createElement("p",null,"".concat((c=e.memberType,cm(Sg.singularizeMemberType(c)))," to classification mappings can be managed from the "),d.createElement("strong",null,"Edit Subject ".concat(cm(e.memberType)," ")),"page.")))}function sA(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return uA(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 uA(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 uA(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 lA(e){var t=e.subjectId,n=e.routeToOnDelete,i=e.closePopup,o=sA(d.useState(),2),a=o[0],c=o[1],s=sA(d.useState(!1),2),u=s[0],l=s[1];ag(_S.getSubjectFetchOptions(t,c),[]);var f=cy(p.SUBJECT),m=[{variant:"link",onClick:i,buttonText:"Cancel"},{variant:"danger",onClick:function(){l(!0);f.deleteSubject(t,(function(){i(),n&&r.AppLinkHelper.trigger(n)}),i)},buttonText:"Yes, delete this backbone classification",isSpinnerButton:!0,showSpinner:u}];return d.createElement(by,{title:"Delete Subject",closePopup:i,showLoadingSpinner:!a},!!a&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,a.name),"?"),d.createElement("p",null,"Subjects that have mapped classifications cannot be deleted.")),d.createElement(Sy,{buttons:m})))}function fA(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||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)||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 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}function dA(e){var t=e.subjectId,n=fA(d.useState(),2),r=n[0],i=n[1],o=fA(d.useState(),2),c=o[0],s=o[1],u=cy(p.SUBJECT),l=_S.getSubjectFetchOptions(t,i);ag(_S.getSubjectTreeFetchOptions(s),[]),ag(l,[t]);return d.createElement(d.Fragment,null,d.createElement(xE,{subjectId:t,activeAction:a.Subjects.EDIT_SUBJECT}),!!r&&!!c&&d.createElement(_E,{subject:r,subjectTree:c,saveSubject:function(e,n){return u.updateSubject(t,e,n,n)}}))}function mA(e,t){return pg(e,t)}function hA(e){switch(e){case sg.Playlists:return a.Subjects.EDIT_SUBJECT_PLAYLISTS;case sg.Series:return a.Subjects.EDIT_SUBJECT_SERIES;case sg.Videos:return a.Subjects.EDIT_SUBJECT_VIDEOS}}function yA(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vA(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 vA(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 vA(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 bA(e){var t=yA(d.useState({}),2),n=t[0],o=t[1],c=n.presentations,s=n.classifications,u=n.memberIds,f=n.membersWithClassifications,m=i.useBasicFetch(Array.isArray(u)&&function(e,t){switch(e){case sg.Playlists:return Pb(t);case sg.Series:return pC(t);case sg.Videos:return pO(t)}}(e.memberType,u)),h=cy(p.SUBJECT);function y(t){r.AppLinkHelper.trigger({application:l.SUBJECTS,action:e.action,args:[e.subjectId],params:{presentationId:t}})}!function(e,t,n){var r=e.subjectId,i=e.memberType,o=e.presentationId;ag(_S.getPresentationsFetchOptions(mA(n,"presentations")),[]),ag(_S.getSubjectMemberIdsFetchOptions(r,i,mA(n,"memberIds")),[r,i]),ag(!!o&&_S.getSubjectClassificationFetchOptions(r,mA(n,"classifications"),o,i),[r,i,o],!!o)}(e,0,o),function(e,t,n,r){var i=n.classifications;d.useEffect((function(){mA(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])}(m.data,e,n,o),d.useEffect((function(){var t;!e.presentationId&&(null===(t=c)||void 0===t?void 0:t.length)&&y(Oi(c).id)}),[e.presentationId]);var v,b,g=!!e.presentationId&&!!s;return d.createElement(d.Fragment,null,d.createElement(xE,{subjectId:e.subjectId,presentationId:e.presentationId,activeAction:hA(e.memberType)}),d.createElement(Zs.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."),d.createElement("div",{className:"w-50 py-2"},!!c&&d.createElement(CE,{presentations:c,currentPresentationId:e.presentationId,setCurrentPresentation:function(e){return y(e.id)}})),g&&d.createElement(JE,{members:f||[],memberType:e.memberType,getMemberAppLink:function(t){return Sg.getMemberAppLink(e.memberType,t)},getActions:function(t){return Sg.getMemberActions(e.subjectId,cg.Subject,e.memberType,t)},classifications:s,getClassificationAppLink:e.presentationId&&(v=e.memberType,b=e.presentationId,function(e){var t,n=l.SUBJECTS,r=[b,e];switch(v){case sg.Playlists:t=a.Subjects.EDIT_CLASSIFICATION_PLAYLISTS;break;case sg.Series:t=a.Subjects.EDIT_CLASSIFICATION_SERIES;break;case sg.Videos:t=a.Subjects.EDIT_CLASSIFICATION_VIDEOS}return{application:n,action:t,args:r}}),onToggleClassification:function(t,n,r){return function(e,t,n,r,i,o,a){(a?e.addObjectsToClassification.bind(e):e.removeObjectsFromClassification.bind(e))(o,n,t,r,i)}(h,e.memberType,r?[r]:u,e.subjectId,e.presentationId,t,n)}}))}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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return SA(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 SA(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 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(e){var t=e.parentId,n=gA(d.useState(),2),i=n[0],o=n[1],c=cy(p.SUBJECT);ag(_S.getSubjectTreeFetchOptions(o),[]);var s={application:l.SUBJECTS,action:a.Subjects.PRESENTATIONS};return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-2 border-bottom"},d.createElement(Rd,{backToName:"Presentations",appLink:s})),d.createElement("h4",{className:"py-2"},"Create New Subject"),!!i&&d.createElement(_E,{subject:{parentId:t},subjectTree:i,saveSubject:function(e,t){return c.createSubject(e,function(e){return function(t){e(),t&&t.id&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[t.id]})}}(t),t)}}))}function OA(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return CA(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 CA(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 CA(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 AA(e){var t=OA(d.useState(),2),n=t[0],r=t[1],o=OA(d.useState(!1),2),a=o[0],c=o[1],s=i.useBasicFetch(function(e,t){switch(e){case sg.Playlists:return _b(t);case sg.Series:return fC(t);case sg.Videos:return fO(t)}}(e.memberType,e.memberId)),u=cy(p.SUBJECT);ag(_S.getSubjectFetchOptions(e.subjectId,r),[e.subjectId]);var l=!!n&&!!s.data,f="Remove ".concat(cm(Sg.singularizeMemberType(e.memberType)));return d.createElement(by,{title:f,closePopup:e.closePopup,showLoadingSpinner:!l},l&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to remove ",d.createElement("strong",null,s.data.name)," from ",d.createElement("strong",null,n.name),"?"),d.createElement("p",null,"Please ensure that it is not in any classifications before removing.")),d.createElement(Sy,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){c(!0),u.removeObjectsFromSubject(e.subjectId,[e.memberId],e.memberType,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(Sg.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function jA(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return wA(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 wA(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 wA(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 IA(e){var t=e.subjectId,n=jA(d.useState({}),2),r=n[0];return function(e,t){var n=function(e){return pg(t,e)};ag(_S.getSubjectClassificationFetchOptions(e,n("classifications")),[e]),ag(_S.getPresentationsFetchOptions(n("presentations")),[])}(t,n[1]),d.createElement(d.Fragment,null,d.createElement(xE,{subjectId:t,activeAction:a.Subjects.SUBJECT_CLASSIFICATIONS}),d.createElement(UE,{presentations:r.presentations,classificationDictionary:ji(r.classifications,"presentationId")}))}var TA=n(140),kA=n.n(TA);function LA(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _A(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 _A(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 _A(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 PA(e){var t=e.selectedSubjectId,n=LA(d.useState(),2),r=n[0],i=n[1];ag(_S.getSubjectTreeFetchOptions(i),[]);var o=d.useCallback((function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[e.id]}}),[]),c={application:l.SUBJECTS,action:a.Subjects.NEW_SUBJECT},s=[{label:"Add child",getAppLink:function(e){return Object.assign(Object.assign({},c),{params:{parentId:e.id}})}},{label:"Delete backbone classification",getAppLink:function(e){return{application:l.SUBJECTS,action:a.Subjects.DELETE_SUBJECT,args:[e.id]}},className:"text-danger"}];return d.createElement("div",{className:"".concat(kA.a.navContainer," h-auto pr-2 border-right")},d.createElement("h5",{className:"border-bottom pb-2"},"Backbone Classifications"),d.createElement(Nd,{appLink:c,className:"d-inline-block pb-2"},d.createElement(Fp,{svgName:Rp.Plus,size:Up.Small}),d.createElement("span",null,"New Backbone Classification")),!!r&&d.createElement("div",{className:"border-top pt-1"},d.createElement(th,{tree:r,getAppLink:o,selectedIds:[t],actions:s})))}function xA(e){var t=e.currentAppLink;return d.createElement($E,{navItems:Eg(),currentAppLink:t})}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,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DA(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 MA(e,t,n){return t&&DA(e.prototype,t),n&&DA(e,n),e}function UA(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)}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 Date.prototype.toString.call(Reflect.construct(Date,[],(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"!==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 zA(e){return(zA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var HA=function(e){UA(n,e);var t=VA(n);function n(){return RA(this,n),t.apply(this,arguments)}return MA(n,[{key:"channelName",get:function(){return l.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}(r.AppRouter),qA=function(e){UA(n,e);var t=VA(n);function n(){return RA(this,n),t.apply(this,arguments)}return MA(n,[{key:"initialize",value:function(){var e=this;Rr.values(p).forEach((function(t){return ay.getInstance(t,e)}))}},{key:"index",value:function(e){var t;this.layout.showChildView(kn,d.createElement(CO,{cursor:null===(t=e)||void 0===t?void 0:t.cursor}))}},{key:"searchPlaylists",value:function(e){var t,n;this.layout.showChildView(kn,d.createElement(wO,{query:null===(t=e)||void 0===t?void 0:t.query,cursor:null===(n=e)||void 0===n?void 0:n.cursor}))}},{key:"newPlaylist",value:function(){this.layout.showChildView(kn,d.createElement(uO,null))}},{key:"editPlaylist",value:function(e){this.layout.showChildView(kn,d.createElement(Yb,{key:e,playlistId:e}))}},{key:"editPlaylistVideos",value:function(e){this.layout.showChildView(kn,d.createElement(sO,{key:e,playlistId:e}))}},{key:"editPlaylistSubjects",value:function(e){this.layout.showChildView(kn,d.createElement(tO,{key:e,playlistId:e}))}},{key:"editPlaylistAudiences",value:function(e){this.layout.showChildView(kn,d.createElement(WE,{key:e,playlistId:e}))}},{key:"deletePlaylist",value:function(e){var t=Object.assign({playlistId:e},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(Bb,Object.assign({},t)))}},{key:"removeVideo",value:function(e,t){var n=Object.assign({playlistId:e,videoId:t},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(vO,Object.assign({},n)))}},{key:"removeFromSubject",value:function(e,t){var n=Object.assign({subjectId:t,memberId:e,memberType:sg.Playlists},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(AA,Object.assign({},n)))}},{key:"uploadImage",value:function(e){var t=Object.assign({imageType:e},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(Ob,Object.assign({},t)))}},{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 y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_n,d.createElement(tv,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Playlists Application"}},{key:"channelName",get:function(){return l.PLAYLISTS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:Cb}}}}],[{key:"router",get:function(){return HA}}]),n}(r.Application),JA=function(e){var t=e.children;return d.createElement(ym,null,t)},$A=function(){return"/api/domain/v2/me/ratings"},KA="ratings",YA=function(){return{url:$A(),key:KA}},GA=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Gs.string().trim().max(350,"Description is too long").default(""),rating:Gs.object().shape({id:Gs.string()}).default({}).noUnknown(),tallPoster:Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown(),banner:Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown()}).noUnknown(),WA=function(e,t){var n=l.SERIES,r=a.Series,i=[{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 Tb(e)&&i.push.apply(i,[{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]}}]),i};function ZA(e){var t=_s(),n=cu(t);return d.createElement(Bs,null,d.createElement(iu,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this series",autoFocus:!0}),d.createElement(iu,{label:"Description",as:"textarea",name:"description",id:"description",maxLength:350,value:t.values.description,placeholder:"Describe this series here",showCharacterCounter:!0}),d.createElement($m,{ratings:e.ratings}),d.createElement(Em,{imageType:Bd.TallPosters,fieldName:"tallPoster",application:l.SERIES,uploadAction:a.Series.UPLOAD_IMAGE}),d.createElement(Em,{imageType:Bd.Banners,fieldName:"banner",application:l.SERIES,uploadAction:a.Playlists.UPLOAD_IMAGE}),d.createElement("div",{className:"d-flex justify-content-between align-items-center"},d.createElement(fu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.id?"Save":"Create"),!!e.actions&&d.createElement(Bm,{actions:e.actions})))}function QA(e){return d.createElement(Ys,{initialValues:e.series,validationSchema:GA,onSubmit:e.saveSeries},d.createElement(ZA,{id:e.series&&e.series.id,ratings:e.ratings}))}function XA(e){return d.createElement("div",{className:"py-2"},d.createElement(Km,{tabs:WA(e.currentUser,e.seriesId),isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}));var t}function ej(e){var t,n=Object(bn.useDispatch)(),r=yy(),o=i.useBasicFetch(fC(e.seriesId)),c=i.useBasicFetch(YA()),s=i.useBasicFetch(zb());return d.createElement(d.Fragment,null,!!s.data&&d.createElement(XA,{seriesId:e.seriesId,activeAction:a.Series.EDIT_SERIES,currentUser:s.data}),!!o.data&&!!c.data&&d.createElement(QA,{series:o.data,saveSeries:function(t,o){i.fetch(n,mC(e.seriesId,t,(function(){r.success("Successfully updated series.")}),(function(){r.error("Failed to update series.")}),o))},ratings:c.data}),d.createElement("div",{className:"py-3 text-right"},"Can't find what you're looking for? Try the old edit series page ",d.createElement(Nd,{className:"info-link",appLink:(t=e.seriesId,{application:l.SERIES,action:a.Series.LEGACY_EDIT_SERIES,args:[t]})},"here"),"."))}function tj(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nj(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 nj(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 nj(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 rj(e){var t=tj(d.useState({}),2),n=t[0],r=t[1],o=i.useBasicFetch(fC(e.seriesId)),c=i.useBasicFetch(zb()),s=cy(p.SUBJECT);!function(e,t,n){var r=function(e){return pg(n,e)};ag(_S.getObjectLevelsFetchOptions(e,sg.Series,r("seriesLevels")),[e]),ag(_S.getObjectAudiencesFetchOptions(e,sg.Series,r("seriesAudiences")),[e,t.seriesLevels]),tg([_S.getPresentationsFetchOptions(r("presentations")),_S.getLevelsFetchOptions(r("levels"))],[]),ag(!!t.currentPresentation&&_S.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.seriesId,n,r),KE(n,r);var u=!!(n.presentations&&n.levels&&n.presentationAudiences&&n.seriesLevels&&n.seriesAudiences);return d.createElement(d.Fragment,null,!!c.data&&d.createElement(XA,{seriesId:e.seriesId,activeAction:a.Series.EDIT_SERIES_AUDIENCES,currentUser:c.data}),d.createElement(zm,{object:o.data}),!!u&&d.createElement(VS,{objectLevels:n.seriesLevels,objectAudiences:n.seriesAudiences,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:pg(r,"currentPresentation"),levels:n.levels,presentationAudiences:n.presentationAudiences,memberType:sg.Series,saveLevels:function(t,n,r){return s.updateObjectLevels(e.seriesId,t,sg.Series,n,r,r)},saveAudiences:function(t,r){return s.updateObjectAudiences(e.seriesId,n.currentPresentation.id,t,sg.Series,r,r)}}))}function ij(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||aj(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 oj(e){return function(e){if(Array.isArray(e))return cj(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||aj(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 aj(e,t){if(e){if("string"==typeof e)return cj(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)?cj(e,t):void 0}}function cj(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 sj(e){var t=ij(d.useState({}),2),n=t[0],r=t[1],o=i.useBasicFetch(fC(e.seriesId)),c=i.useBasicFetch(zb()),s=cy(p.SUBJECT);!function(e,t,n){var r=function(e){return pg(n,e)};tg([_S.getSubjectTreeFetchOptions(r("subjectTree")),_S.getPresentationsFetchOptions(r("presentations"))],[]),ag(_S.getObjectSubjectsFetchOptions(e,sg.Series,r("seriesSubjects")),[e]),ag(!!t.currentPresentation&&_S.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),d.useEffect((function(){return r("subjectClassifications")([])}),[t.seriesSubjects]);var i=function(e,t){return[].concat(oj(t.subjectClassifications||[]),oj(e))},o=t.seriesSubjects&&t.seriesSubjects.map((function(e){return _S.getSubjectClassificationFetchOptions(e.id,pg(n,"subjectClassifications",i))}));tg(o,[t.seriesSubjects],!!o),ag(_S.getObjectClassificationsFetchOptions(e,sg.Series,r("seriesClassifications")),[e,t.seriesSubjects])}(e.seriesId,n,r),KE(n,r);var u=!!(n.seriesSubjects&&n.subjectTree&&n.presentations&&n.classificationTree&&n.seriesClassifications&&n.subjectClassifications);return d.createElement(d.Fragment,null,!!c.data&&d.createElement(XA,{seriesId:e.seriesId,activeAction:a.Series.EDIT_SERIES_SUBJECTS,currentUser:c.data}),d.createElement(zm,{object:o.data}),u&&d.createElement(IE,{objectSubjects:n.seriesSubjects,subjectTree:n.subjectTree,memberType:sg.Series,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:pg(r,"currentPresentation"),objectClassifications:n.seriesClassifications,objectSubjectClassifications:n.subjectClassifications,classificationTree:n.classificationTree,saveSubjects:function(t,n,r){return s.updateObjectSubjects(e.seriesId,t,sg.Series,n,r,r)},saveClassifications:function(t,r){return s.updateObjectClassifications(e.seriesId,n.currentPresentation.id,t,sg.Series,r,r)}}))}function uj(){var e=Object(bn.useDispatch)(),t=yy(),n=i.useBasicFetch(YA());return d.createElement(d.Fragment,null,!!n.data&&d.createElement(QA,{saveSeries:function(n,o){var c=function(){t.error("Failed to create series.")},s=function(e){t.success("Successfully created series."),function(e){r.AppLinkHelper.trigger({application:l.SERIES,action:a.Series.EDIT_SERIES,args:[e.id]})}(e)};i.fetch(e,dC(n,(function(t){var n={permissions:Ib()};i.fetch(e,mC(t.id,n,s,c,o))}),c))},ratings:n.data}))}function lj(e){return(lj="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 fj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pj(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 dj(e,t,n){return t&&pj(e.prototype,t),n&&pj(e,n),e}function mj(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&&hj(e,t)}function hj(e,t){return(hj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yj(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=bj(e);if(t){var i=bj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return vj(this,n)}}function vj(e,t){return!t||"object"!==lj(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 bj(e){return(bj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var gj=function(e){mj(n,e);var t=yj(n);function n(){return fj(this,n),t.apply(this,arguments)}return dj(n,[{key:"channelName",get:function(){return l.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}(r.AppRouter),Sj=function(e){mj(n,e);var t=yj(n);function n(){return fj(this,n),t.apply(this,arguments)}return dj(n,[{key:"initialize",value:function(){var e=this;Rr.values(p).forEach((function(t){return ay.getInstance(t,e)}))}},{key:"newSeries",value:function(){this.layout.showChildView(kn,d.createElement(uj,null))}},{key:"editSeries",value:function(e){this.layout.showChildView(kn,d.createElement(ej,{seriesId:e}))}},{key:"editSeriesVideos",value:function(e){this.legacyEditSeries(e)}},{key:"editSeriesSubjects",value:function(e){this.layout.showChildView(kn,d.createElement(sj,{seriesId:e}))}},{key:"editSeriesAudiences",value:function(e){this.layout.showChildView(kn,d.createElement(rj,{seriesId:e}))}},{key:"legacyEditSeries",value:function(e){r.LocationUtils.Redirect("/manage/legacy/series/".concat(e),!0)}},{key:"uploadImage",value:function(e){var t=Object.assign({imageType:e},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(Ob,Object.assign({},t)))}},{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 y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_n,d.createElement(tv,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Series Application"}},{key:"channelName",get:function(){return l.SERIES}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:JA}}}}],[{key:"router",get:function(){return gj}}]),n}(r.Application);function Ej(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Oj(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 Oj(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 Oj(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 Cj(e){var t=Ej(d.useState(),2),n=t[0],r=t[1],o=Ej(d.useState(!1),2),a=o[0],c=o[1],s=i.useBasicFetch(function(e,t){switch(e){case ug.Playlists:return _b(t);case ug.Series:return fC(t);case ug.Videos:return fO(t)}}(e.memberType,e.memberId)),u=cy(p.SUBJECT);ag(_S.getAudienceFetchOptions(e.audienceId,r),[e.audienceId]);var l=!!n&&!!s.data,f="Remove ".concat(cm(wg.singularizeMemberType(e.memberType)));return d.createElement(by,{title:f,closePopup:e.closePopup,showLoadingSpinner:!l},l&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to remove ",d.createElement("strong",null,s.data.name)," from ",d.createElement("strong",null,n.name),"?"),d.createElement("p",null,"This will not remove it from the backbone level.")),d.createElement(Sy,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){c(!0),u.removeObjectsFromAudience(e.audienceId,[e.memberId],e.memberType,null,null,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(wg.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function Aj(e){return(Aj="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 jj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wj(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 Ij(e,t,n){return t&&wj(e.prototype,t),n&&wj(e,n),e}function Tj(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&&kj(e,t)}function kj(e,t){return(kj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Lj(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Pj(e);if(t){var i=Pj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return _j(this,n)}}function _j(e,t){return!t||"object"!==Aj(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 Pj(e){return(Pj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var xj,Nj=function(e){Tj(n,e);var t=Lj(n);function n(){return jj(this,n),t.apply(this,arguments)}return Ij(n,[{key:"channelName",get:function(){return l.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}(r.AppRouter),Rj=function(e){Tj(n,e);var t=Lj(n);function n(){return jj(this,n),t.apply(this,arguments)}return Ij(n,[{key:"initialize",value:function(){var e=this;this.subjectDataService=ay.getInstance(p.SUBJECT,this),Rr.values(p).forEach((function(t){return ay.getInstance(t,e)}))}},{key:"subjects",value:function(){this.subjectDataService.getSubjectTree((function(e){var t=!!e.children&&e.children[0];t?r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[t.id]},{replace:!0}):r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.NEW_SUBJECT},{replace:!0})}))}},{key:"newSubject",value:function(e){var t={parentId:e.parentId};this.layout.showChildView(kn,d.createElement(EA,Object.assign({key:e.parentId},t))),this.renderSubjectsLeftNav()}},{key:"editSubject",value:function(e){this.layout.showChildView(kn,d.createElement(dA,{key:e,subjectId:e})),this.renderSubjectsLeftNav(e)}},{key:"editSubjectPlaylists",value:function(e,t){var n,r={subjectId:e,memberType:sg.Playlists,action:a.Subjects.EDIT_SUBJECT_PLAYLISTS,presentationId:null===(n=t)||void 0===n?void 0:n.presentationId};this.layout.showChildView(kn,d.createElement(bA,Object.assign({key:"".concat(e,":playlists")},r))),this.renderSubjectsLeftNav(e)}},{key:"editSubjectSeries",value:function(e,t){var n,r={subjectId:e,memberType:sg.Series,action:a.Subjects.EDIT_SUBJECT_SERIES,presentationId:null===(n=t)||void 0===n?void 0:n.presentationId};this.layout.showChildView(kn,d.createElement(bA,Object.assign({key:"".concat(e,":series")},r))),this.renderSubjectsLeftNav(e)}},{key:"editSubjectVideos",value:function(e,t){var n,r={subjectId:e,memberType:sg.Videos,action:a.Subjects.EDIT_SUBJECT_VIDEOS,presentationId:null===(n=t)||void 0===n?void 0:n.presentationId};this.layout.showChildView(kn,d.createElement(bA,Object.assign({key:"".concat(e,":videos")},r))),this.renderSubjectsLeftNav(e)}},{key:"subjectClassifications",value:function(e){this.layout.showChildView(kn,d.createElement(IA,{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(kn,d.createElement(cA,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(Ln,d.createElement(AA,Object.assign({},r)))}},{key:"deleteSubject",value:function(e){var t=e.toString()===this.currentLeftNavId.toString()?{application:l.SUBJECTS,action:a.Subjects.NEW_SUBJECT}:null,n=Object.assign({subjectId:e,routeToOnDelete:t||null},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(lA,Object.assign({},n)))}},{key:"classifications",value:function(){var e={objectType:"classifications",getAppLink:function(e){return{application:l.SUBJECTS,action:a.Subjects.PRESENTATION_CLASSIFICATIONS,args:[e.id]}}};this.layout.showChildView(kn,d.createElement(eA,Object.assign({},e))),this.hideLeftNav()}},{key:"presentationClassifications",value:function(e){this.subjectDataService.getClassificationTree(e,(function(t){var n=!!t.children&&t.children[0];n?r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[e,n.id]},{replace:!0}):r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.NEW_CLASSIFICATION,args:[e]},{replace:!0})}))}},{key:"newClassification",value:function(e,t){var n={presentationId:e,parentId:t.parentId};this.layout.showChildView(kn,d.createElement(lC,Object.assign({key:t.parentId},n))),this.renderClassificationLeftNav(e)}},{key:"editClassification",value:function(e,t){var n={presentationId:e,classificationId:t};this.layout.showChildView(kn,d.createElement(iC,Object.assign({key:t},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationPlaylists",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:sg.Playlists};this.layout.showChildView(kn,d.createElement(cC,Object.assign({key:"".concat(t,":playlists")},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationSeries",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:sg.Series};this.layout.showChildView(kn,d.createElement(cC,Object.assign({key:"".concat(t,":series")},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationVideos",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:sg.Videos};this.layout.showChildView(kn,d.createElement(cC,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(Ln,d.createElement(vC,Object.assign({},r)))}},{key:"deleteClassification",value:function(e,t){var n=t===this.currentLeftNavId?{application:l.SUBJECTS,action:a.Subjects.NEW_CLASSIFICATION,args:[e]}:null,r=Object.assign({classificationId:t,routeToOnDelete:n||null},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(tC,Object.assign({},r)))}},{key:"levels",value:function(){this.layout.showChildView(kn,d.createElement(CC,null)),this.renderLevelsLeftNav()}},{key:"newLevel",value:function(){this.layout.showChildView(kn,d.createElement(AC,null)),this.renderLevelsLeftNav()}},{key:"level",value:function(e){r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_LEVEL,args:[e]},{replace:!0})}},{key:"editLevel",value:function(e){this.layout.showChildView(kn,d.createElement(SC,{key:e,id:e})),this.renderLevelsLeftNav(e)}},{key:"levelAudiences",value:function(e){this.layout.showChildView(kn,d.createElement(NC,{key:e,levelId:e})),this.renderLevelsLeftNav(e)}},{key:"editLevelPlaylists",value:function(e,t){var n,r={levelId:e,memberType:ug.Playlists,action:a.Subjects.EDIT_LEVEL_PLAYLISTS,presentationId:null===(n=t)||void 0===n?void 0:n.presentationId};this.layout.showChildView(kn,d.createElement(FC,Object.assign({key:"".concat(e,":playlists")},r))),this.renderLevelsLeftNav(e)}},{key:"editLevelSeries",value:function(e,t){var n,r={levelId:e,memberType:ug.Series,action:a.Subjects.EDIT_LEVEL_SERIES,presentationId:null===(n=t)||void 0===n?void 0:n.presentationId};this.layout.showChildView(kn,d.createElement(FC,Object.assign({key:"".concat(e,":series")},r))),this.renderLevelsLeftNav(e)}},{key:"editLevelVideos",value:function(e,t){var n,r={levelId:e,memberType:ug.Videos,action:a.Subjects.EDIT_LEVEL_VIDEOS,presentationId:null===(n=t)||void 0===n?void 0:n.presentationId};this.layout.showChildView(kn,d.createElement(FC,Object.assign({key:"".concat(e,":videos")},r))),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(Ln,d.createElement(zC,Object.assign({},r)))}},{key:"audiences",value:function(){var e={objectType:"audiences",getAppLink:function(e){return{application:l.SUBJECTS,action:a.Subjects.PRESENTATION_AUDIENCES,args:[e.id]}}};this.layout.showChildView(kn,d.createElement(eA,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(Ln,d.createElement(Cj,Object.assign({},r)))}},{key:"presentationAudiences",value:function(e){this.subjectDataService.getAudiences(e,(function(t){var n=!!t&&t[0];n?r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_AUDIENCE,args:[e,n.masterId]},{replace:!0}):r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.NEW_AUDIENCE,args:[e]},{replace:!0})}))}},{key:"newAudience",value:function(e){this.layout.showChildView(kn,d.createElement(MO,{presentationId:e})),this.hideLeftNav()}},{key:"editAudience",value:function(e,t){var n={presentationId:e,audienceId:t};this.layout.showChildView(kn,d.createElement(xO,Object.assign({key:t},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudiencePlaylists",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:ug.Playlists};this.layout.showChildView(kn,d.createElement(JO,Object.assign({key:"".concat(t,":playlists")},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudienceSeries",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:ug.Series};this.layout.showChildView(kn,d.createElement(JO,Object.assign({key:"".concat(t,":series")},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudienceVideos",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:ug.Videos};this.layout.showChildView(kn,d.createElement(JO,Object.assign({key:"".concat(t,":videos")},n))),this.renderAudienceLeftNav(e,t)}},{key:"deleteAudience",value:function(e,t){var n={application:l.SUBJECTS,action:a.Subjects.PRESENTATION_AUDIENCES,args:[e]},r=Object.assign({id:t,routeToOnDelete:n},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(LO,Object.assign({},r)))}},{key:"presentations",value:function(){this.layout.showChildView(kn,d.createElement(WC,null)),this.hideLeftNav()}},{key:"newPresentation",value:function(){this.layout.showChildView(kn,d.createElement(ZC,null))}},{key:"editPresentation",value:function(e){this.layout.showChildView(kn,d.createElement(JC,{key:e,id:e})),this.hideLeftNav()}},{key:"uploadImage",value:function(e){var t=Object.assign({imageType:e},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(Ob,Object.assign({},t)))}},{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 y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_n,d.createElement(tv,{alerts:n,removeAlert:r}))}},{key:"renderClassificationLeftNav",value:function(e,t){this.setCurrentLeftNavItem(t);var n={presentationId:e,selectedClassificationId:t};this.layout.showChildView(Tn,d.createElement(QO,Object.assign({},n)))}},{key:"renderSubjectsLeftNav",value:function(e){this.setCurrentLeftNavItem(e),this.layout.showChildView(Tn,d.createElement(PA,{selectedSubjectId:e}))}},{key:"renderAudienceLeftNav",value:function(e,t){this.setCurrentLeftNavItem(t);var n={presentationId:e,selectedAudienceId:t};this.layout.showChildView(Tn,d.createElement(zO,Object.assign({},n)))}},{key:"renderLevelsLeftNav",value:function(e){this.setCurrentLeftNavItem(e),this.layout.showChildView(Tn,d.createElement(kC,{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 d.createElement(xA,{currentAppLink:e})}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Subjects Application"}},{key:"channelName",get:function(){return l.SUBJECTS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:ym,getTopNavView:this.getTopNav}}}}],[{key:"router",get:function(){return Nj}}]),n}(r.Application),Dj=function(e){return{url:"/api/domain/v1/themes/".concat(e),key:"themes:".concat(e)}},Mj=function(e){var t="/api/domain/v1/themes",n="themes";return e&&(t+="?type=".concat(e),n+=":type:".concat(e)),{url:t,key:n}},Uj=function(e,t,n,r){return{url:"/api/domain/v1/themes",key:"theme",data:e,type:Cr.POST,invalidationKeys:"themes",success:t,error:n,always:r}},Fj=function(e,t,n,r,i){return{url:"/api/domain/v1/themes/".concat(e),key:"update:theme:".concat(e),data:t,type:Cr.PUT,success:n,error:r,always:i}},Vj=function(e,t,n,r){return{url:"/api/domain/v1/themes/".concat(e),key:"delete:theme:".concat(e),type:Cr.DELETE,invalidationKeys:"themes",success:t,error:n,always:r}},Bj=function(e){return{application:l.THEMES,action:a.Themes.EDIT_THEME,args:[e.id]}};function zj(){var e=i.useBasicFetch(Mj());return e.data?d.createElement(qm,{objects:e.data,getObjectAppLink:Bj,newObjectAppLink:{application:l.THEMES,action:a.Themes.NEW_THEME},objectName:"Theme"}):d.createElement(d.Fragment,null)}!function(e){e.Glance="glance"}(xj||(xj={}));var Hj=[{key:"topLeft",label:"Top Left"},{key:"topRight",label:"Top Right"},{key:"bottomLeft",label:"Bottom Left"},{key:"bottomRight",label:"Bottom Right"}];function qj(){var e=_s();return d.createElement("div",{className:"form-group"},Hj.map((function(t){var n="data.".concat(t.key);return d.createElement(Em,{label:t.label,imageType:Bd.HeroBanners,fieldName:n,application:l.THEMES,uploadAction:a.Videos.UPLOAD_IMAGE,setSelectedImage:function(t){e.setFieldValue(n,{fileId:t.id,url:t.url,fileIdType:Hd.ImageAPIv2})}})})))}var Jj=Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown(),$j=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default(""),type:Gs.mixed().required("Type is required"),data:Gs.mixed().when("type",{is:xj.Glance,then:Gs.object().shape({topLeft:Jj,topRight:Jj,bottomLeft:Jj,bottomRight:Jj}).noUnknown(),otherwise:Gs.mixed().strip(!0)}).default({})}).noUnknown();function Kj(e){var t=_s(),n=function(e){switch(e){case xj.Glance:return qj;default:return}}(t.values.type);return d.createElement(Bs,null,d.createElement(iu,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this theme",autoFocus:!0}),d.createElement(iu,{as:"select",label:"Type",name:"type",id:"type",value:t.values.type},d.createElement("option",{value:null},"Select a type..."),Rr.getEnumKeys(xj).map((function(e){return d.createElement("option",{key:e,value:xj[e]},e)}))),!!n&&d.createElement(n,null),d.createElement("div",{className:"d-flex justify-content-between align-items-center"},d.createElement(wu,{isNew:e.isNew}),!!e.actions&&d.createElement(Bm,{actions:e.actions})))}function Yj(e){var t;return d.createElement(Ys,{initialValues:e.theme,validationSchema:$j,onSubmit:e.saveTheme},d.createElement(Kj,{isNew:!(null===(t=e.theme)||void 0===t?void 0:t.id),actions:e.actions}))}function Gj(){var e=Object(bn.useDispatch)();return d.createElement(Yj,{saveTheme:function(t,n){i.fetch(e,Uj(t,(function(e){n(),r.AppLinkHelper.trigger({application:l.THEMES,action:a.Themes.EDIT_THEME,args:[e.id]})}),null,n))}})}function Wj(e){var t=Object(bn.useDispatch)(),n=yy(),r=i.useBasicFetch(Dj(e.id));return r.data?d.createElement(Yj,{theme:r.data,saveTheme:function(r,o){i.fetch(t,Fj(e.id,r,(function(){n.success("Successfully updated theme")}),(function(){n.error("Failed to update theme")}),o))},actions:[{label:"Delete theme",className:"btn btn-danger",button:!0,appLink:{application:l.THEMES,action:a.Themes.DELETE_THEME,args:[e.id]}}]}):d.createElement(d.Fragment,null)}function Zj(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Qj(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 Qj(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 Qj(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 Xj(e){var t=Object(bn.useDispatch)(),n=yy(),o=Zj(d.useState(!1),2),c=o[0],s=o[1],u=i.useBasicFetch(Dj(e.id));return d.createElement(by,{title:"Delete Theme",closePopup:e.closePopup,showLoadingSpinner:!u.data},d.createElement(d.Fragment,null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,u.data.name),"?"),d.createElement(Sy,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){s(!0),i.fetch(t,Vj(e.id,(function(){n.success("Successfully deleted theme"),r.AppLinkHelper.trigger({application:l.THEMES,action:a.Themes.THEMES})}),(function(){n.error("Failed to delete theme")})))},buttonText:"Yes, delete this theme",isSpinnerButton:!0,showSpinner:c}]})))}var ew=function(e){var t=e.children;return d.createElement(ym,null,t)};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){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rw(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 iw(e,t,n){return t&&rw(e.prototype,t),n&&rw(e,n),e}function ow(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&&aw(e,t)}function aw(e,t){return(aw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function cw(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=uw(e);if(t){var i=uw(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return sw(this,n)}}function sw(e,t){return!t||"object"!==tw(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 uw(e){return(uw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var lw=function(e){ow(n,e);var t=cw(n);function n(){return nw(this,n),t.apply(this,arguments)}return iw(n,[{key:"channelName",get:function(){return l.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}(r.AppRouter),fw=function(e){ow(n,e);var t=cw(n);function n(){return nw(this,n),t.apply(this,arguments)}return iw(n,[{key:"themes",value:function(){this.layout.showChildView(kn,d.createElement(zj,null))}},{key:"newTheme",value:function(){this.layout.showChildView(kn,d.createElement(Gj,null))}},{key:"editTheme",value:function(e){this.layout.showChildView(kn,d.createElement(Wj,{id:e}))}},{key:"deleteTheme",value:function(e){var t=this;this.layout.showChildView(Ln,d.createElement(Xj,{id:e,closePopup:function(){return t.layout.closePopup()}}))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(Ln,d.createElement(Ob,{imageType:e,closePopup:function(){return t.layout.closePopup()}}))}},{key:"name",get:function(){return"Themes Application"}},{key:"channelName",get:function(){return l.THEMES}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:ew}}}}],[{key:"router",get:function(){return lw}}]),n}(Zh),pw=function(e){var t=e.children;return d.createElement(ym,null,t)},dw=function(e,t){var n=l.VIDEOS,r=a.Videos,i=[{label:"Edit Video Details",appLink:{application:n,action:r.EDIT_VIDEO,args:[t]}}];return Tb(e)?[].concat(i,[{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]}}]):i};function mw(e){var t,n=dw(e.currentUser,e.videoId);return n.length<2?d.createElement(d.Fragment,null):d.createElement("div",{className:"py-2"},d.createElement(Km,{tabs:n,isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}))}var hw,yw=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Gs.string().trim().default(""),status:Gs.mixed().required("Status is required"),productionYear:Gs.number().min(1900),rating:Gs.object().shape({id:Gs.string()}).default({}).noUnknown(),thumbnail:Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown(),heroBanner:Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown(),glance:Gs.object().shape({theme:Gs.string(),format:Gs.mixed(),content:Gs.string()}).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"}(hw||(hw={}));var vw,bw=n(25),gw=n.n(bw);function Sw(e){var t,n,r,i,o,a=_s();return d.createElement("div",{className:"form-group p-2 border"},d.createElement("div",{className:"border-bottom mb-2"},d.createElement("label",null,"Summary")),d.createElement(iu,{as:"select",label:"Theme",name:"glance.theme",id:"type",value:null===(t=a.values.glance)||void 0===t?void 0:t.theme},d.createElement("option",{value:null},"Select a theme..."),e.themes.map((function(e){return d.createElement("option",{key:e.id,value:e.name},e.name)}))),d.createElement(iu,{as:"select",label:"Format",name:"glance.format",id:"type",value:null===(n=a.values.glance)||void 0===n?void 0:n.format},d.createElement("option",{value:null},"Select a format..."),Rr.getEnumKeys(vw).map((function(e){return d.createElement("option",{key:e,value:vw[e]},e)}))),d.createElement(iu,{label:"Content",as:"textarea",name:"glance.content",id:"content",value:null===(r=a.values.glance)||void 0===r?void 0:r.content}),(null===(i=a.values.glance)||void 0===i?void 0:i.format)===vw.Markdown&&d.createElement("div",{className:"form-group"},d.createElement("label",null,"Content Preview"),d.createElement("div",{className:"border rounded py-2",dangerouslySetInnerHTML:{__html:bw(null===(o=a.values.glance)||void 0===o?void 0:o.content)}})))}function Ew(e){switch(e){case hw.Published:return"badge-success";case hw.Archived:return"badge-danger";case hw.Draft:return"badge-warning";case hw.Pending:return"badge-info";case hw.Rejected:return"badge-dark";default:return"badge-secondary"}}function Ow(e){var t=_s(),n=!!e.rightslineId,r=Tb(e.currentUser);return d.createElement(Bs,null,n&&d.createElement(iu,{label:"Rightsline ID",name:"rightslineId",id:"rightslineId",value:e.rightslineId,disabled:!0}),d.createElement(iu,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this video",disabled:n,autoFocus:!0}),d.createElement("div",{className:"form-group"},d.createElement("label",null,"Status"),d.createElement("div",null,d.createElement("span",{className:"badge ".concat(Ew(t.values.status))},hw[t.values.status]))),d.createElement(iu,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this video here",disabled:n,showCharacterCounter:!0}),d.createElement(iu,{label:"Production Year",type:"number",name:"productionYear",id:"productionYear",value:t.values.productionYear,disabled:n}),d.createElement($m,{ratings:e.ratings,disabled:n}),d.createElement(Em,{imageType:Bd.Thumbnails,fieldName:"thumbnail",application:l.VIDEOS,uploadAction:a.Videos.UPLOAD_IMAGE}),d.createElement(Em,{imageType:Bd.HeroBanners,fieldName:"heroBanner",application:l.VIDEOS,uploadAction:a.Videos.UPLOAD_IMAGE}),r&&d.createElement(Sw,{themes:e.themes}),d.createElement(wu,{isNew:!e.id}))}function Cw(e,t){if(e)return t?Object.assign(Object.assign({},e),t):e}function Aw(e){return d.createElement(Ys,{initialValues:Cw(e.video,e.rightslineVideo),validationSchema:yw,onSubmit:e.saveVideo,allowInitialSubmit:!!e.rightslineVideo},d.createElement(Ow,{id:e.video&&e.video.id,ratings:e.ratings,themes:e.themes,currentUser:e.currentUser,rightslineId:e.rightslineId}))}function jw(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ww(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 ww(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 ww(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 Iw(e){var t,n=Object(bn.useDispatch)(),r=jw(d.useState(!1),2),o=r[0],c=r[1],s=i.useBasicFetch(fO(e.videoId)),u=i.useBasicFetch(dO(e.videoId)),f=i.useBasicFetch(YA()),p=i.useBasicFetch(Mj(xj.Glance)),m=i.useBasicFetch(zb());var h,y=!!s.data&&!!f.data&&!!p.data&&!!m.data&&u.isComplete;return d.createElement(d.Fragment,null,!!m.data&&d.createElement(mw,{videoId:e.videoId,activeAction:a.Videos.EDIT_VIDEO,currentUser:m.data}),!!u.data&&d.createElement("div",{className:"pt-3 text-right"},d.createElement(Zs.Button,{variant:"outline-dark",size:"sm",onClick:function(){u.isFetching||(c(!0),i.fetch(n,dO(e.videoId)))}},"Sync from Rightsline")),y&&d.createElement(Aw,{video:s.data,saveVideo:function(t,r){i.fetch(n,mO(e.videoId,t,null,null,r))},ratings:f.data,themes:p.data,currentUser:m.data,rightslineId:null===(t=u.data)||void 0===t?void 0:t.rightslineId,rightslineVideo:o&&u.data}),d.createElement("div",{className:"py-3 text-right"},"Can't find what you're looking for? Try the old edit video page ",d.createElement(Nd,{className:"info-link",appLink:(h=e.videoId,{application:l.VIDEOS,action:a.Videos.LEGACY_EDIT_VIDEO,args:[h]})},"here"),"."))}function Tw(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return kw(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 kw(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 kw(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 Lw(e){var t=Tw(d.useState({}),2),n=t[0],r=t[1],o=i.useBasicFetch(fO(e.videoId)),c=i.useBasicFetch(zb()),s=cy(p.SUBJECT);!function(e,t,n){var r=function(e){return pg(n,e)};ag(_S.getObjectLevelsFetchOptions(e,sg.Videos,r("videoLevels")),[e]),ag(_S.getObjectAudiencesFetchOptions(e,sg.Videos,r("videoAudiences")),[e,t.videoLevels]),tg([_S.getPresentationsFetchOptions(r("presentations")),_S.getLevelsFetchOptions(r("levels"))],[]),ag(!!t.currentPresentation&&_S.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.videoId,n,r),KE(n,r);var u=!!(n.presentations&&n.levels&&n.presentationAudiences&&n.videoLevels&&n.videoAudiences);return d.createElement(d.Fragment,null,!!c.data&&d.createElement(mw,{videoId:e.videoId,activeAction:a.Videos.EDIT_VIDEO_AUDIENCES,currentUser:c.data}),d.createElement(zm,{object:o.data}),!!u&&d.createElement(VS,{objectLevels:n.videoLevels,objectAudiences:n.videoAudiences,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:pg(r,"currentPresentation"),levels:n.levels,presentationAudiences:n.presentationAudiences,memberType:sg.Videos,saveLevels:function(t,n,r){return s.updateObjectLevels(e.videoId,t,sg.Videos,n,r,r)},saveAudiences:function(t,r){return s.updateObjectAudiences(e.videoId,n.currentPresentation.id,t,sg.Videos,r,r)}}))}function _w(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||xw(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 Pw(e){return function(e){if(Array.isArray(e))return Nw(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||xw(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 xw(e,t){if(e){if("string"==typeof e)return Nw(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)?Nw(e,t):void 0}}function Nw(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 Rw(e){var t=_w(d.useState({}),2),n=t[0],r=t[1],o=i.useBasicFetch(fO(e.videoId)),c=i.useBasicFetch(zb()),s=cy(p.SUBJECT);!function(e,t,n){var r=function(e){return pg(n,e)};tg([_S.getSubjectTreeFetchOptions(r("subjectTree")),_S.getPresentationsFetchOptions(r("presentations"))],[]),ag(_S.getObjectSubjectsFetchOptions(e,sg.Videos,r("videoSubjects")),[e]),ag(!!t.currentPresentation&&_S.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),d.useEffect((function(){return r("subjectClassifications")([])}),[t.videoSubjects]);var i=function(e,t){return[].concat(Pw(t.subjectClassifications||[]),Pw(e))},o=t.videoSubjects&&t.videoSubjects.map((function(e){return _S.getSubjectClassificationFetchOptions(e.id,pg(n,"subjectClassifications",i))}));tg(o,[t.videoSubjects],!!o),ag(_S.getObjectClassificationsFetchOptions(e,sg.Videos,r("videoClassifications")),[e,t.videoSubjects])}(e.videoId,n,r),KE(n,r);var u=!!(n.videoSubjects&&n.subjectTree&&n.presentations&&n.classificationTree&&n.videoClassifications&&n.subjectClassifications);return d.createElement(d.Fragment,null,!!c.data&&d.createElement(mw,{videoId:e.videoId,activeAction:a.Videos.EDIT_VIDEO_SUBJECTS,currentUser:c.data}),d.createElement(zm,{object:o.data}),u&&d.createElement(IE,{objectSubjects:n.videoSubjects,subjectTree:n.subjectTree,memberType:sg.Videos,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:pg(r,"currentPresentation"),objectClassifications:n.videoClassifications,objectSubjectClassifications:n.subjectClassifications,classificationTree:n.classificationTree,saveSubjects:function(t,n,r){return s.updateObjectSubjects(e.videoId,t,sg.Videos,n,r,r)},saveClassifications:function(t,r){return s.updateObjectClassifications(e.videoId,n.currentPresentation.id,t,sg.Videos,r,r)}}))}!function(e){e.Markdown="text/markdown"}(vw||(vw={}));var Dw=function(e){return{key:"aliases:".concat(e),url:"/api/master/v2/objects/".concat(e,"/aliases")}},Mw=function(e,t,n,r){return{key:"create:alias",url:"/api/master/v2/objects/".concat(e,"/aliases"),type:Cr.POST,invalidationKeys:"aliases:".concat(e),data:t,success:n,error:r}},Uw=function(e,t,n,r){return{key:"delete:alias",url:"/api/domain/v2/objects/".concat(e,"/aliases/").concat(t),type:Cr.DELETE,invalidationKeys:"aliases:".concat(e),success:n,error:r}};function Fw(e){var t=Object(bn.useDispatch)(),n=yy(),r=i.useBasicFetch(Dw(e.videoId)),o=i.useBasicFetch(zb());return r.data?d.createElement(d.Fragment,null,!!o.data&&d.createElement(mw,{videoId:e.videoId,activeAction:a.Videos.EDIT_VIDEO_ALIASES,currentUser:o.data}),d.createElement(Th,{aliases:r.data.data,onSave:function(r,o){i.fetch(t,Mw(e.videoId,r,(function(){n.success("Successfully created alias"),o()}),(function(){n.error("Something went wrong creating your alias")})))},onDelete:function(r){i.fetch(t,Uw(e.videoId,r,(function(){n.success("Successfully deleted alias")}),(function(){n.error("Something went wrong deleting your alias")})))}})):d.createElement(d.Fragment,null,"Loading...")}function Vw(e){return(Vw="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 Bw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zw(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 Hw(e,t,n){return t&&zw(e.prototype,t),n&&zw(e,n),e}function qw(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&&Jw(e,t)}function Jw(e,t){return(Jw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $w(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 Kw(this,n)}}function Kw(e,t){return!t||"object"!==Vw(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 Gw=function(e){qw(n,e);var t=$w(n);function n(){return Bw(this,n),t.apply(this,arguments)}return Hw(n,[{key:"channelName",get:function(){return l.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}(r.AppRouter),Ww=function(e){qw(n,e);var t=$w(n);function n(){return Bw(this,n),t.apply(this,arguments)}return Hw(n,[{key:"initialize",value:function(){var e=this;Rr.values(p).forEach((function(t){return ay.getInstance(t,e)}))}},{key:"editVideo",value:function(e){this.layout.showChildView(kn,d.createElement(Iw,{videoId:e}))}},{key:"editVideoAudiences",value:function(e){this.layout.showChildView(kn,d.createElement(Lw,{videoId:e}))}},{key:"editVideoSubjects",value:function(e){this.layout.showChildView(kn,d.createElement(Rw,{videoId:e}))}},{key:"editVideoAliases",value:function(e){this.layout.showChildView(kn,d.createElement(Fw,{videoId:e}))}},{key:"legacyEditVideo",value:function(e){r.LocationUtils.Redirect("/tools/programlookup/".concat(e))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(Ln,d.createElement(Ob,{imageType:e,closePopup:function(){return t.layout.closePopup()}}))}},{key:"name",get:function(){return"Videos Application"}},{key:"channelName",get:function(){return l.VIDEOS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:pw,alertRegion:_n}}}}],[{key:"router",get:function(){return Gw}}]),n}(Zh),Zw="UPDATE_VIEW_MODEL",Qw=function(e,t){var n=Object(bn.useDispatch)(),r=Object(bn.useSelector)((function(t){return t.viewModelData[e]}));function i(t,r){n({type:Zw,payload:{viewModelKey:e,dataOrKey:t,keyData:r}})}return void 0!==t&&void 0===r&&i(t),[r,i]},Xw="release:notes:config",eI=[{id:"798",name:"Monorepo"},{id:"109",name:"Online"},{id:"822",name:"Lite"},{id:"534",name:"Library Editor"},{id:"62",name:"Curator"}];function tI(e){var t=_s(),n=cu(t),r="798"===t.values.project;return m.a.useEffect((function(){e.getMilestones(t.values.project),r&&e.getBranchNames(t.values.project)}),[t.values.project]),m.a.useEffect((function(){t.setFieldValue("milestone",Oi(e.milestones))}),[e.milestones]),m.a.useEffect((function(){t.setFieldValue("branchName",Oi(e.branchNames))}),[e.branchNames]),m.a.createElement(Bs,null,m.a.createElement(iu,{as:"select",label:"Project",name:"project",id:"project",value:t.values.project},eI.map((function(e){return m.a.createElement("option",{key:e.id,value:e.id},e.name)}))),m.a.createElement(iu,{as:"select",label:"Milestone",name:"milestone",id:"milestone",value:t.values.milestone,disabled:!e.milestones.length},e.milestones.map((function(e){return m.a.createElement("option",{key:e,value:e},e)}))),r&&m.a.createElement(iu,{as:"select",label:"Branch Name",name:"branchName",id:"branchName",value:t.values.branchName,disabled:!e.branchNames.length},e.branchNames.map((function(e){return m.a.createElement("option",{key:e,value:e},e)}))),m.a.createElement("div",{className:"d-flex justify-content-between"},m.a.createElement(fu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Generate")))}var nI="U_Jxes3Htv-xiaDX5wfn",rI="https://gitlab.cvinternal.net/api/v4",iI=function(e,t){return{key:"milestones:".concat(e),url:Yd("".concat(rI,"/projects/").concat(e,"/milestones"),{private_token:nI}),normalize:!1,formatData:function(e){return e.map((function(e){return e.title}))},success:t}},oI=function(e,t){return{key:"branch:names:".concat(e),url:Yd("".concat(rI,"/projects/").concat(e,"/repository/branches"),{private_token:nI,per_page:50}),normalize:!1,formatData:function(e){return e.map((function(e){return e.name}))},success:t}},aI=function(e,t,n,r){return{key:"merge:requests:".concat(e,":").concat(t,":").concat(n),url:Yd("".concat(rI,"/projects/").concat(e,"/merge_requests"),{private_token:nI,milestone:t,state:"merged",per_page:50,page:n}),success:r}},cI=function(e,t,n){return{key:"file:paths:".concat(t,":").concat(e),url:Yd("".concat(rI,"/projects/").concat(e,"/search"),{scope:"blobs",search:t,private_token:nI}),normalize:!1,formatData:function(e){return e.filter((function(e){return e.filename.includes(t)}))},success:n}},sI=function(e,t,n,r){return{key:"file:".concat(e,":").concat(t,":").concat(n),url:Yd("".concat(rI,"/projects/").concat(e,"/repository/files/").concat(encodeURIComponent(t),"/raw"),{ref:n,private_token:nI}),normalize:!1,formatData:function(e){return JSON.parse(e)},success:r}},uI=Gs.object().shape({project:Gs.string().required("Project is required").default(""),milestone:Gs.string().required("Milestone is required").default(""),branchName:Gs.string().when("project",(function(e,t){return"798"===e?t.required("Branch name is required"):t})).default("")}).noUnknown();function lI(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fI(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 fI(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 fI(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 pI={project:Oi(eI).id};function dI(){var e=lI(m.a.useState([]),2),t=e[0],n=e[1],o=lI(m.a.useState([]),2),c=o[0],s=o[1],u=lI(Qw(Xw),2)[1],f=Object(bn.useDispatch)();return m.a.createElement(m.a.Fragment,null,m.a.createElement("h4",{className:"py-2"},"Generate Release Notes"),m.a.createElement(Ys,{initialValues:pI,onSubmit:function(e){u(e),r.AppLinkHelper.trigger({application:l.RELEASE_NOTES,action:a.ReleaseNotes.GENERATOR})},validationSchema:uI},m.a.createElement(tI,{getMilestones:function(e){n([]),i.fetch(f,iI(e,n))},milestones:t,getBranchNames:function(e){s([]),i.fetch(f,oI(e,s))},branchNames:c})))}var mI=n(141),hI=/#*/;function yI(e){return e=e.replace("-"," "),e="## "+(e=(e=cm(e)).replace(hI,"").trim())}function vI(e){var t=e.toLowerCase();return"## notes"===t||"## dependencies"===t}function bI(e){return e=e.replace("-"," "),e=cm(e)}function gI(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 SI(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 SI(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 o,a=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function SI(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 EI=["# online","# curator","# library editor","# lite","# styles","# tooling","# analytics","# common","# shared","# player"];function OI(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),o=e.slice(n,i);EI.includes(o.toLowerCase().trim())&&(t.name=cm(o.replace("#","").trim()),e=e.slice(i),n=-1)}}for(var a=0;!t.changes&&a<e.length;a++){if(a+1===e.length){t.changes=e,e="";break}if("#"===e[a]&&"#"!==e[a+1]){var c=e.indexOf("\n",a),s=e.slice(a,c);EI.includes(s.toLowerCase().trim())&&(t.changes=e.slice(0,a),e=e.slice(a),a=-1)}}return{section:t,remainingDescription:e}}function CI(e){var t,n={},r=gI(e);try{for(r.s();!(t=r.n()).done;)for(var i=t.value;i;){var o=OI(i),a=o.section;if(i=o.remainingDescription,!a.name)break;n[a.name]||(n[a.name]=[]),n[a.name].push(a.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),o=bI(t.slice(n,i).join(""));r[o]||(r[o]="");for(var a=i;a<t.length;a++){if(t.length===a+1){var c=t.slice(i+1).join("");r[o]+=c,t=[];break}if("#"===t[a]&&"#"===t[a+1]){var s=t.slice(i+1,a).join("");if(!s.length){t=t.slice(a),n=-1;break}r[o]+=s,t=t.slice(a),n=-1;break}}r[o]+="\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 AI=n(142),jI=n.n(AI);function wI(e){return function(e){if(Array.isArray(e))return kI(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||TI(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 II(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||TI(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 TI(e,t){if(e){if("string"==typeof e)return kI(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)?kI(e,t):void 0}}function kI(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 LI(){var e=II(m.a.useState(!0),2),t=e[0],n=e[1],o=II(m.a.useState(1),2),c=o[0],s=o[1],u=II(m.a.useState([]),2),f=u[0],p=u[1],d=II(m.a.useState([]),2),h=d[0],y=d[1],v=II(m.a.useState(!0),2),b=v[0],g=v[1],S=II(m.a.useState(""),2),E=S[0],O=S[1],C=II(m.a.useState("Copy"),2),A=C[0],j=C[1],w=II(Qw(Xw),1)[0],I=w&&"798"===w.project,T=Object(bn.useDispatch)();return m.a.useEffect((function(){if(w){var e=w.project,t=w.milestone;i.fetch(T,aI(e,t,c,(function(e){p([].concat(wI(f),wI(e))),50===e.length?s(c+1):n(!1)})))}}),[c]),m.a.useEffect((function(){if(!(t||I&&b)){var e=f.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=CI(e);return"".concat(n,"\n").concat(r)}(e,h):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 o=n.indexOf("\n",i),a=yI(n.slice(i,o).join(""));t[a]||(vI(a)?r=!0:t[a]="");for(var c=o;c<n.length;c++){if(n.length===c+1){if(r){r=!1,n=[];break}var s=n.slice(o+1).join("");t[a]+=s,n=[];break}if("#"===n[c]){if(r){r=!1,n=n.slice(c),i=-1;break}var u=n.slice(o+1,c).join("");if(!u.length){n=n.slice(c),i=-1;break}t[a]+=u,n=n.slice(c),i=-1;break}}t[a]?t[a]+="\n":delete t[a]}break}})),Object.keys(t).reduce((function(e,n){return t[n]?(e+=n+"\n",e+=t[n]+"\n"):e}),"")}(e);O(n)}}),[t,b]),m.a.useEffect((function(){if(w&&I){var e=[];i.fetch(T,cI(w.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=TI(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 o,a=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;i.fetch(T,sI(w.project,o.path,w.branchName,(function(n){e.push(n),e.length===t.length&&(y(e),g(!1))})))}}catch(e){r.e(e)}finally{r.f()}})))}}),[]),w?m.a.createElement(m.a.Fragment,null,E?m.a.createElement("div",{className:"position-relative border rounded p-3"},m.a.createElement(mI,{onCopy:function(){return j("Copied")},text:E},m.a.createElement("button",{className:"btn btn-white ".concat(jI.a.copyBtn)},A)),m.a.createElement("div",{dangerouslySetInnerHTML:{__html:gw()(E)}})):t?"Fetching merge requests..":"Merging descriptions.."):(r.AppLinkHelper.trigger({application:l.RELEASE_NOTES,action:a.ReleaseNotes.FORM}),m.a.createElement(m.a.Fragment,null))}function _I(e){return(_I="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 PI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xI(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 NI(e,t,n){return t&&xI(e.prototype,t),n&&xI(e,n),e}function RI(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&&DI(e,t)}function DI(e,t){return(DI=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function MI(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=FI(e);if(t){var i=FI(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return UI(this,n)}}function UI(e,t){return!t||"object"!==_I(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 FI(e){return(FI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var VI,BI=function(e){RI(n,e);var t=MI(n);function n(){return PI(this,n),t.apply(this,arguments)}return NI(n,[{key:"channelName",get:function(){return l.RELEASE_NOTES}},{key:"appRoutes",get:function(){return{"developer/release-notes(/)":"index","developer/release-notes/generate(/)":"form","developer/release-notes/generator(/)":"generator"}}}]),n}(r.AppRouter),zI=function(e){RI(n,e);var t=MI(n);function n(){return PI(this,n),t.apply(this,arguments)}return NI(n,[{key:"index",value:function(){r.AppLinkHelper.trigger({application:l.RELEASE_NOTES,action:a.ReleaseNotes.GENERATOR},{replace:!0})}},{key:"form",value:function(){this.layout.showChildView(kn,d.createElement(dI,null))}},{key:"generator",value:function(){this.layout.showChildView(kn,d.createElement(LI,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 y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_n,d.createElement(tv,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Release Notes Application"}},{key:"channelName",get:function(){return l.RELEASE_NOTES}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT}}}],[{key:"router",get:function(){return BI}}]),n}(r.Application);function HI(e){return(HI="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 qI(e){return function(e){if(Array.isArray(e))return JI(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 JI(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 JI(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 JI(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 $I(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 KI(e,t){return(KI=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function YI(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=WI(e);if(t){var i=WI(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return GI(this,n)}}function GI(e,t){return!t||"object"!==HI(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 WI(e){return(WI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Fifo="FifoMemoryCache"}(VI||(VI={}));var ZI,QI=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&&KI(e,t)}(o,e);var t,n,r,i=YI(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this)).size=e.size,t.cache={},t.cachedkeys=[],t}return t=o,(n=[{key:"removeCacheKey",value:function(e){this.cachedkeys=h.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||K.throw(new Xe("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=h.object(this.cachedkeys,this.cachedkeys),i=[];h.each(e,(function(e){var t;r[e]&&i.push(e);var n=new RegExp(e,"i"),o=h.filter(r,(function(e){return n.test(e)}));(t=i).push.apply(t,qI(o))})),i.length&&(i=h.uniq(i),h.each(i,(function(e){delete n.cache[e],h.isFunction(t)&&t(e)})),this.cachedkeys=h.without.apply(h,[this.cachedkeys].concat(qI(i))))}},{key:"name",get:function(){return VI.Fifo}}])&&$I(t.prototype,n),r&&$I(t,r),o}(Yt);!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"}(ZI||(ZI={}));var XI,eT={type:ZI.Unknown,message:"",code:0};!function(e){e.Ajax="AjaxDataProvider",e.Notifications="NotificationsSignalRDataProvider"}(XI||(XI={}));var tT=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 nT(e){return(nT="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 rT(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 iT(e,t){return(iT=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oT(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cT(e);if(t){var i=cT(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return aT(this,n)}}function aT(e,t){return!t||"object"!==nT(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 cT(e){return(cT=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var sT=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&&iT(e,t)}(o,e);var t,n,r,i=oT(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),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=o,(n=[{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=Cr.GET);var i=h.defaults(r,{forceHttps:!1}),o={url:e,method:n,type:n};t&&(o.data=n===Cr.POST||n===Cr.PUT?JSON.stringify(t):t),i.forceHttps&&(o.url=this.makeHttps(o.url)),i.traditional&&(o.traditional=i.traditional);var a=$.ajax(o);return h.keys(this.successMiddleware).length&&a.done(h.values(this.successMiddleware)),h.keys(this.errorMiddleware).length&&a.fail(h.values(this.errorMiddleware)),a}},{key:"create",value:function(e,t,n){var r=n.channel,i=n.successEvent,o=n.errorEvent;this.base(e,t,Cr.POST).done((function(e,t,n){return r.trigger(i,e,t,n)})).fail((function(e,t,n){return r.trigger(o,e,t,n)}))}},{key:"read",value:function(e,t){var n=t.channel,r=t.successEvent,i=t.errorEvent;this.base(e,null,Cr.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,o=n.errorEvent;this.base(e,t,Cr.PUT).done((function(e,t,n){return r.trigger(i,e,t,n)})).fail((function(e,t,n){return r.trigger(o,e,t,n)}))}},{key:"delete",value:function(e,t){var n=t.channel,r=t.successEvent,i=t.errorEvent;this.base(e,null,Cr.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,t,n){var r=e.responseJSON,i=eT;switch(i.code=e.status,i.message=tT(this.dataServiceErrorMessageMappings,this.defaultErrorMessageKey,r),e.status){case 400:i.type=ZI.BadRequest;break;case 401:i.type=ZI.Unauthorized;break;case 403:i.type=ZI.Forbidden;break;case 404:i.type=ZI.NotFound;break;case 500:i.type=ZI.InternalServer}return i}},{key:"name",get:function(){return XI.Ajax}}])&&rT(t.prototype,n),r&&rT(t,r),o}(I.Object);function uT(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lT(e,t){return"string"==typeof t.payload.dataOrKey&&void 0!==t.payload.keyData?Object.assign(Object.assign({},e),uT({},t.payload.viewModelKey,Object.assign(Object.assign({},e[t.payload.viewModelKey]),uT({},t.payload.dataOrKey,t.payload.keyData)))):Object.assign(Object.assign({},e),uT({},t.payload.viewModelKey,t.payload.dataOrKey))}function fT(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Zw:return lT(e,t)}return e}var pT="LanguageDataService",dT="locale",mT="phrases",hT="language:data:service",yT="locale",vT="phrases";function bT(e){return(bT="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 gT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ST(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 ET(e,t){return(ET=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function OT(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=AT(e);if(t){var i=AT(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return CT(this,n)}}function CT(e,t){return!t||"object"!==bT(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 AT(e){return(AT=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jT=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&&ET(e,t)}(o,e);var t,n,r,i=OT(o);function o(){return gT(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"getLanguageConfig",value:function(e){var t={locale:"",phrases:null};this.get({resource:"/api/locale",eventPrefix:dT,expiryTime:dg.STANDARD,bootstrapName:yT,callback:function(n){t.locale=n,t.phrases&&h.isFunction(e)&&e(t)}}),this.get({resource:"/api/phrases",eventPrefix:mT,expiryTime:dg.STANDARD,bootstrapName:vT,callback:function(n){t.phrases=n,t.locale&&h.isFunction(e)&&e(t)}})}},{key:"name",get:function(){return pT}},{key:"channelName",get:function(){return hT}}])&&ST(t.prototype,n),r&&ST(t,r),o}(mr);n.d(t,"Layouts",(function(){return u})),n.d(t,"AppChannels",(function(){return l})),n.d(t,"DataChannels",(function(){return f})),n.d(t,"Actions",(function(){return a})),n.d(t,"DataPrefixes",(function(){return c})),n.d(t,"FileExtensions",(function(){return s})),n.d(t,"DataServices",(function(){return p})),n.d(t,"CuratorLayoutView",(function(){return Hn})),n.d(t,"LayoutComponent",(function(){return Yn})),n.d(t,"CuratorAppNavService",(function(){return ir})),n.d(t,"ImageUploadDataService",(function(){return Ar})),n.d(t,"CompaniesApplication",(function(){return Hh})),n.d(t,"CustomersApplication",(function(){return qy})),n.d(t,"DomainOptionsApplication",(function(){return zv})),n.d(t,"PeopleApplication",(function(){return gb})),n.d(t,"PlaylistsApplication",(function(){return qA})),n.d(t,"SeriesApplication",(function(){return Sj})),n.d(t,"SubjectDataService",(function(){return kS})),n.d(t,"SubjectDataServiceHelper",(function(){return _S})),n.d(t,"SubjectsApplication",(function(){return Rj})),n.d(t,"ThemesApplication",(function(){return fw})),n.d(t,"VideosApplication",(function(){return Ww})),n.d(t,"DomainOptionsApplication",(function(){return zv})),n.d(t,"ReleaseNotesApplication",(function(){return zI})),n.d(t,"Core",(function(){return r})),n.d(t,"InstanceManager",(function(){return ay})),n.d(t,"FifoMemoryCache",(function(){return QI})),n.d(t,"AjaxDataProvider",(function(){return sT})),n.d(t,"AlertList",(function(){return tv})),n.d(t,"AlertType",(function(){return iy})),n.d(t,"BaseAlertService",(function(){return hy})),n.d(t,"LanguageService",(function(){return Cu})),n.d(t,"Flight",(function(){return i})),n.d(t,"CacheDurations",(function(){return dg})),n.d(t,"ViewModelReducer",(function(){return fT})),n.d(t,"LanguageDataService",(function(){return jT}))}])}));
17
+ */var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,a=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 a: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 o: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=a,t.Lazy=v,t.Memo=y,t.Portal=o,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)===a},t.isLazy=function(e){return O(e)===v},t.isMemo=function(e){return O(e)===y},t.isPortal=function(e){return O(e)===o},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===a||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}}(),o=n(0),a=f(o),c=f(n(16)),s=f(n(187)),u=f(n(188)),l=n(196);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,o=n.highlightFirstSuggestion;if(!(0,s.default)(r,e.suggestions)&&r.length>0&&o)this.highlightFirstSuggestion();else if(i){var a=this.getHighlightedSuggestion();a!=t.highlightedSuggestion&&i({suggestion:a})}}},{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 o=i.valueBeforeUpDown;return null===t?o=null:null===o&&void 0!==n&&(o=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,highlightedSuggestion:null===t?null:r.getSuggestion(e,t),valueBeforeUpDown:o}}))}},{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,o=n.getSectionSuggestions;return i?o(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,o=r.onChange;t!==i&&o(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,o=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,j=S.valueBeforeUpDown,w=b?p:this.props.shouldRenderSuggestions,I=s.value,T=s.onFocus,k=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=w(I);e.setState({isFocused:!0,isCollapsed:!n}),T&&T(t),n&&o({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=w(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?o({value:n,reason:"input-changed"}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var i=t.keyCode;switch(i){case 40:case 38:if(O)w(I)&&(o({value:I,reason:"suggestions-revealed"}),e.revealSuggestions());else if(n.length>0){var a=r.newHighlightedSectionIndex,c=r.newHighlightedItemIndex,s=void 0;s=null===c?null===j?I:j:e.getSuggestionValueByIndex(a,c),e.updateHighlightedSuggestion(a,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===j){if(!f){e.maybeCallOnChange(t,"","escape"),w("")?o({value:"",reason:"escape-pressed"}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,j,"escape");f?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}k&&k(t)}}),N={query:this.getQuery()};return a.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}(o.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 a.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,o=r.onSuggestionSelected,a=r.onSuggestionsFetchRequested;o&&o(t,n),i?a({value:n.suggestionValue,reason:"suggestion-selected"}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,r=n.alwaysRenderSuggestions,i=n.focusInputOnSuggestionClick,o=e.getSuggestionIndices(e.findSuggestionElement(t.target)),a=o.sectionIndex,c=o.suggestionIndex,s=e.getSuggestion(a,c),u=e.props.getSuggestionValue(s);e.maybeCallOnChange(t,u,"click"),e.onSuggestionSelected(t,{suggestion:s,suggestionValue:u,suggestionIndex:c,sectionIndex:a,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,o=n.onBlur,a=e.getHighlightedSuggestion(),c=r(i);e.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,highlightedSuggestion:null,valueBeforeUpDown:null,isCollapsed:!c}),o&&o(e.blurEvent,{highlightedSuggestion:a})},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(186);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==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:o,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(189).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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=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),c=d(a),s=d(n(16)),u=d(n(190)),l=d(n(191)),f=d(n(193)),p=d(n(194));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,o=t.highlightedSectionIndex,a=t.highlightedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var c="ArrowDown"===e.key?"next":"prev",s=n.sectionIterator[c]([o,a]),u=i(s,2),l=u[0],f=u[1];r.onKeyDown(e,{newHighlightedSectionIndex:l,newHighlightedItemIndex:f});break;default:r.onKeyDown(e,{highlightedSectionIndex:o,highlightedItemIndex:a})}},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),o(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,o=n.renderItem,a=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:o,renderItemData:a,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,o=n.renderItemData,a=n.highlightedSectionIndex,s=n.highlightedItemIndex,u=n.itemProps;return c.default.createElement(p.default,{items:e,itemProps:u,renderItem:i,renderItemData:o,highlightedItemIndex:null===a?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,o=t.renderInputComponent,a=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=o(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=a({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}(a.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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}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),o=i[0],a=i[1];return n?null===a||a===t[o]-1?null===(o=function(e){for(null===e?e=0:e++;e<t.length&&0===t[e];)e++;return e===t.length?null:e}(o))?[null,null]:[o,0]:[o,a+1]:0===t||a===t-1?[null,null]:null===a?[null,0]:[null,a+1]}return{next:i,prev:function(e){var i=r(e,2),o=i[0],a=i[1];return n?null===a||0===a?null===(o=function(e){for(null===e?e=t.length-1:e--;e>=0&&0===t[e];)e--;return-1===e?null:e}(o))?[null,null]:[o,t[o]-1]:[o,a-1]:0===t||0===a?[null,null]:null===a?[null,t-1]:[null,a-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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(i)throw o}}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 o,a=n(192),c=(o=a)&&o.__esModule?o:{default:o},s=function(e){return e};t.default=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=r(t,2),o=n[0],a=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 o[e]})).filter(s);return"string"==typeof u[0]||"function"==typeof a?{key:e,className:a?a.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 o(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,a=i(e),c=1;c<arguments.length;c++){n=arguments[c],r=o(Object(n));for(var s=0;s<r.length;s++)a[r[s]]=n[r[s]]}return a}},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),o=s(i),a=s(n(16)),c=s(n(29));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,a=n(t);return a?o.default.createElement("div",r(i+"title","sectionTitle"),a):null}}]),t}(i.Component);f.propTypes={section:a.default.any.isRequired,renderSectionTitle:a.default.func.isRequired,theme:a.default.func.isRequired,sectionKeyPrefix:a.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}}(),o=n(0),a=l(o),c=l(n(16)),s=l(n(195)),u=l(n(29));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,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r=p(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),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,o=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 a.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),a.default.createElement(s.default,r({},g,{sectionIndex:u,isHighlighted:y,itemIndex:n,item:t,renderItem:o,renderItemData:c}))})))}}]),t}(o.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}}(),o=n(0),a=u(o),c=u(n(16)),s=u(n(29));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,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r=f(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),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,o=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),a.default.createElement("li",r({role:"option"},c,{ref:this.storeItemReference}),i(n,r({isHighlighted:t},o)))}}]),t}(o.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(198));var i=r.tokenize,o=r.options.Options;function a(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 o(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+=">"+a(p)+"</"+m+">",r.push(b)}else r.push(a(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(19),i=c(n(199)),o=c(n(200)),a=c(n(201));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 a.run(o.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 o=n[i];!o.isLink||t&&o.type!==t||r.push(o.toObject())}return r},t.inherits=r.inherits,t.options=i,t.parser=a,t.scanner=o,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:a,formatHref:a,nl2br:!1,tagName:"a",target:function(e,t){return"url"===t?"_blank":null},validate:!0,ignoreTags:[],attributes:null,className:"linkified"};function o(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 a(e){return e}t.defaults=i,t.Options=o,t.contains=function(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return!0;return!1},o.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 o=void 0,a=this[e];if(!a)return a;switch(void 0===a?"undefined":r(a)){case"function":return a(t,n.type);case"object":return"function"==typeof(o=a.hasOwnProperty(n.type)?a[n.type]:i[e])?o(t,n.type):o}return a},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(124),i=n(30),o=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 a="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<a.length;v++){var b=(0,r.stateify)(a[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(),j=E.pop(),w=O.pop(),I=f(i.DOMAIN),T=f(i.PROTOCOL),k=f(i.MAILTO);A.on("s",I).on(":",T),j.on("s",I).on(":",T),l.push(I),C.on(":",T),I.on(":",T),w.on(":",k);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=o,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 o=p,a=null,c=0,s=null,u=-1;i<n&&(a=o.next(t[i]));)(o=a).accepts()?(u=0,s=o):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(124),i=n(202),o=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),a=n(30);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),j=c(i.URL),w=c(i.URL),I=c(i.URL),T=c(),k=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(a.NL,z).on(a.PROTOCOL,u).on(a.MAILTO,l).on(a.SLASH,f),u.on(a.SLASH,f),f.on(a.SLASH,p),s.on(a.TLD,d).on(a.DOMAIN,d).on(a.LOCALHOST,h).on(a.NUM,d),p.on(a.TLD,b).on(a.DOMAIN,b).on(a.NUM,b).on(a.LOCALHOST,b),d.on(a.DOT,m),P.on(a.DOT,x),m.on(a.TLD,h).on(a.DOMAIN,d).on(a.NUM,d).on(a.LOCALHOST,d),x.on(a.TLD,N).on(a.DOMAIN,P).on(a.NUM,P).on(a.LOCALHOST,P),h.on(a.DOT,m),N.on(a.DOT,x),h.on(a.COLON,y).on(a.SLASH,b),y.on(a.NUM,v),v.on(a.SLASH,b),N.on(a.COLON,R),R.on(a.NUM,D);var H=[a.DOMAIN,a.AT,a.LOCALHOST,a.NUM,a.PLUS,a.POUND,a.PROTOCOL,a.SLASH,a.TLD,a.UNDERSCORE,a.SYM,a.AMPERSAND],q=[a.COLON,a.DOT,a.QUERY,a.PUNCTUATION,a.CLOSEBRACE,a.CLOSEBRACKET,a.CLOSEANGLEBRACKET,a.CLOSEPAREN,a.OPENBRACE,a.OPENBRACKET,a.OPENANGLEBRACKET,a.OPENPAREN];b.on(a.OPENBRACE,S).on(a.OPENBRACKET,E).on(a.OPENANGLEBRACKET,O).on(a.OPENPAREN,C),g.on(a.OPENBRACE,S).on(a.OPENBRACKET,E).on(a.OPENANGLEBRACKET,O).on(a.OPENPAREN,C),S.on(a.CLOSEBRACE,b),E.on(a.CLOSEBRACKET,b),O.on(a.CLOSEANGLEBRACKET,b),C.on(a.CLOSEPAREN,b),A.on(a.CLOSEBRACE,b),j.on(a.CLOSEBRACKET,b),w.on(a.CLOSEANGLEBRACKET,b),I.on(a.CLOSEPAREN,b),T.on(a.CLOSEBRACE,b),k.on(a.CLOSEBRACKET,b),L.on(a.CLOSEANGLEBRACKET,b),_.on(a.CLOSEPAREN,b),S.on(H,A),E.on(H,j),O.on(H,w),C.on(H,I),S.on(q,T),E.on(q,k),O.on(q,L),C.on(q,_),A.on(H,A),j.on(H,j),w.on(H,w),I.on(H,I),A.on(q,A),j.on(q,j),w.on(q,w),I.on(q,I),T.on(H,A),k.on(H,j),L.on(H,w),_.on(H,I),T.on(q,T),k.on(q,k),L.on(q,L),_.on(q,_),b.on(H,b),g.on(H,b),b.on(q,g),g.on(q,g),l.on(a.TLD,M).on(a.DOMAIN,M).on(a.NUM,M).on(a.LOCALHOST,M),M.on(H,M).on(q,U),U.on(H,M).on(q,U);var J=[a.DOMAIN,a.NUM,a.PLUS,a.POUND,a.QUERY,a.UNDERSCORE,a.SYM,a.AMPERSAND,a.TLD];d.on(J,F).on(a.AT,V),h.on(J,F).on(a.AT,V),m.on(J,F),F.on(J,F).on(a.AT,V).on(a.DOT,B),B.on(J,F),V.on(a.TLD,P).on(a.DOMAIN,P).on(a.LOCALHOST,N);t.State=r.TokenState,t.TOKENS=o,t.run=function(e){for(var t=e.length,n=0,r=[],o=[];n<t;){for(var a=s,c=null,u=null,l=0,f=null,p=-1;n<t&&!(c=a.next(e[n]));)o.push(e[n++]);for(;n<t&&(u=c||a.next(e[n]));)c=null,(a=u).accepts()?(p=0,f=a):p>=0&&p++,n++,l++;if(p<0)for(var d=n-l;d<n;d++)o.push(e[d]);else{o.length>0&&(r.push(new i.TEXT(o)),o=[]),n-=p,l-=p;var m=f.emit();r.push(new m(e.slice(n-l,n)))}}return o.length>0&&r.push(new i.TEXT(o)),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(125),i=n(19),o=n(30);function a(e){return e instanceof o.DOMAIN||e instanceof o.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 o.PROTOCOL;)t=!0,i.push(r[c].toString().toLowerCase()),c++;for(;r[c]instanceof o.SLASH;)n=!0,i.push(r[c].toString()),c++;for(;a(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 o.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(17),{block:i}=n(126),{rtrim:o,splitCells:a,escape:c}=n(13);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:o(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:a(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]=a(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:a(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]=a(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(31),i=n(127),o=n(128),a=n(129),{defaults:c}=n(17),{merge:s,unescape:u}=n(13);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 o(e.links,this.options),this.inlineText=new o(e.links,s({},this.options,{renderer:new a})),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,o="";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(o+=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(o,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=o(n(0)),i=o(n(206));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){return(a="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={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[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"!==a(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 o=arguments.length,a=new Array(o),c=0;c<o;c++)a[c]=arguments[c];return h(d(n=f(this,(e=p(t)).call.apply(e,[this].concat(a)))),"onClick",(function(e){var t=n.props,o=t.text,a=t.onCopy,c=t.children,s=t.options,u=r.default.Children.only(c),l=(0,i.default)(o,s);a&&a(o,l),u&&u.props&&"function"==typeof u.props.onClick&&u.props.onClick(e)})),n}var n,o,a;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,(o=[{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,o),a&&l(n,a),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(207),i={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,o,a,c,s,u,l=!1;t||(t={}),n=t.debug||!1;try{if(a=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 o=i[t.format]||i.default;window.clipboardData.setData(o,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"),o=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(o,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(c):s.removeAllRanges()),u&&document.body.removeChild(u),a()}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={};n.r(r),n.d(r,"AppLinkHelper",(function(){return w})),n.d(r,"AppLinkUtility",(function(){return A})),n.d(r,"Application",(function(){return ie})),n.d(r,"AppRouter",(function(){return be})),n.d(r,"Behavior",(function(){return Ie})),n.d(r,"Collection",(function(){return De})),n.d(r,"CollectionView",(function(){return Je})),n.d(r,"ComponentCollection",(function(){return Je})),n.d(r,"Error",(function(){return H})),n.d(r,"ErrorHelper",(function(){return K})),n.d(r,"SilentError",(function(){return q})),n.d(r,"LayoutView",(function(){return Ot})),n.d(r,"NestedModel",(function(){return Vt})),n.d(r,"Service",(function(){return Yt})),n.d(r,"Model",(function(){return _t})),n.d(r,"View",(function(){return mt})),n.d(r,"Component",(function(){return ht})),n.d(r,"EventNames",(function(){return v})),n.d(r,"LayoutService",(function(){return nn})),n.d(r,"Middleware",(function(){return ae})),n.d(r,"LocationUtils",(function(){return g})),n.d(r,"Shell",(function(){return mn}));var i={};n.r(i),n.d(i,"emptyResponse",(function(){return Gr})),n.d(i,"getResponse",(function(){return Wr})),n.d(i,"getFetch",(function(){return Zr})),n.d(i,"fetch",(function(){return Qr})),n.d(i,"dataServiceFetch",(function(){return Xr})),n.d(i,"useGetFetch",(function(){return ei})),n.d(i,"useGetResponse",(function(){return ti})),n.d(i,"useBasicFetch",(function(){return ni})),n.d(i,"createMiddleware",(function(){return li})),n.d(i,"FlightReducer",(function(){return gi})),n.d(i,"Simulator",(function(){return _i})),n.d(i,"Actions",(function(){return jr})),n.d(i,"RequestStatus",(function(){return Or})),n.d(i,"ajaxRequest",(function(){return Tr})),n.d(i,"normalize",(function(){return Nr})),n.d(i,"denormalize",(function(){return Ur}));n(143),n(144),n(145),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(153),n(154),n(155),n(156),n(157),n(158),n(159),n(160),n(161),n(162),n(163),n(164),n(165),n(166),n(167),n(168),n(169),n(170),n(171),n(172),n(173),n(174),n(175),n(176),n(177),n(178);var o={UPLOAD_IMAGE:"upload:image"},a={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"},o),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"},o),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"},o),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"},o),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"},o),ReleaseNotes:{FORM:"form",GENERATOR:"generator"},Customers:{EDIT_CUSTOMER_PRESENTATIONS:"edit:customer:presentations"}},c={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"},s={IMAGES:".".concat(["jpg","tif","png","bmp","gif","jpeg"].join(",."))},u={CURATOR_LAYOUT:"CuratorLayout"},l={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"},f={IMAGE_UPLOAD:"image:upload:data:service",SUBJECT:"subject:data:service",LANGUAGE:"language:data:service"},p={IMAGE_UPLOAD:"ImageUploadDataService",SUBJECT:"SubjectDataService",LANGUAGE:"LanguageDataService"},d=n(0),m=n.n(d),h=n(1),y=n(4),v={SHOW_POPUP:"show:popup",ROUTE:"route",LOCK_NAV:"lock:nav",UNLOCK_NAV:"unlock:nav",NAV_IS_LOCKED:"navigation:islocked",NAV_UNLOCKED_BY_USER:"navigation:unlocked:by:user",ROUTING_START:"routing:start",ROUTING_END:"routing:end",HAS_ACTIVE_ROUTE:"has:active:route",ROUTE_LOOKUP:"route:look:up",URL_CHANGE:"url:change",ERROR:"error",CURRENT_ROUTE:"route:current"},b={SHELL:"global:shell",ALERT:"global:alert",POPUP:"global:popup"},g={GetQuery:function(){return g.DeserializeQueryParams(window.location.search.substring(1))},UpdateQuery:function(e){if(e){var t=g.GetQuery(),n=g.SerializeQueryParams(h.extend(t,e));n&&(n="?".concat(n)),g.UpdateUrl("".concat(g.GetCurrentPath()).concat(n),null,{replace:!0,trigger:!1})}},UpdateUrl:function(e,t,n){var r=w.buildRoute(e,t);y.history.navigate(r,n),y.Radio.channel(b.SHELL).trigger(v.URL_CHANGE,t,n)},SerializeQueryParams:function(e){return e?"string"==typeof e?e:$.param(e,!0):""},DeserializeQueryParams:function(e){return e?h.reduce(e.split("&"),(function(e,t){var n=t.split("="),r=n[0],i=n.length>0?decodeURIComponent(n[1]):"";return e[r]?e[r]instanceof Array?(e[r].push(i),e):(e[r]=[e[r],i],e):(e[r]=i,e)}),{}):{}},StartHistory:function(){y.History.started&&y.history.stop(),y.history.start({pushState:!0})},PageLoad:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?window.open(e,"_blank"):window.location.href=e},Redirect:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=function(){return t?window.location.replace(e):window.location.href=e};A.hasActiveRoute()?y.Radio.channel(b.SHELL).once("routing:end",n):n()},Reload:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];window.location.reload(e)},GetCurrentPath:function(){return window.location.pathname},GetCurrentQueryString:function(){return window.location.search},GetCurrentUrl:function(){return window.location.href},GetCurrentReferrer:function(){return document.referrer},SetPageTitle:function(e){document.title=e}},S=/((\(\?)?:\w+)|(\*\w+)/,E=/[\(\)]/g,O=/\(\/\)/g,C=/\/$/,A={routingStarted:function(){y.Radio.channel(b.SHELL).trigger(v.ROUTING_START)},routingEnded:function(){A.hasActiveRoute()&&y.Radio.channel(b.SHELL).trigger(v.ROUTING_END)},hasActiveRoute:function(){return y.Radio.channel(b.SHELL).request(v.HAS_ACTIVE_ROUTE)}},j=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.usedHelper=!0;var n=e.application,r=e.action;y.Radio.channel(n).trigger(r,e,t)},w={getHref:function(e){if(!e)return"";var t=e.application,n=e.action,r=e.args,i=e.params,o=y.Radio.channel(b.SHELL);return"/".concat(o.request(v.ROUTE_LOOKUP,"".concat(t,":").concat(n),r,i))},buildRoute:function(e,t){if(!t)return e;var n=t.args,r=t.params;if(h.each(n,(function(t){e=e.replace(S,t||"")})),e=(e=(e=e.replace(O,"")).replace(E,"")).replace(C,""),!r)return e;var i=g.SerializeQueryParams(r);return i.length?"".concat(e,"?").concat(i):e},trigger:function(e,t){e&&(A.hasActiveRoute()?y.Radio.channel(b.SHELL).once("routing:end",(function(){j(e,t)})):j(e,t))},getCurrentAppLink:function(){return y.Radio.channel(b.SHELL).request(v.CURRENT_ROUTE)}},I=n(7);function T(e,t,n,r){var i=e;return"string"==typeof e&&(i=y.Radio.channel(e)),r.call(this,i,t,n)}function k(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 L=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.variables={}}var t,n,r;return t=e,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"get",value:function(e){return this.variables[e]}},{key:"setUpVariables",value:function(e){this.variables=e}},{key:"name",get:function(){return"EnvironmentVariables"}},{key:"isDevelopment",get:function(){return this.variables.isDevelopment}}])&&k(t.prototype,n),r&&k(t,r),e}().Instance;function _(e){return(_="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 P(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 x(e,t,n){return t&&P(e.prototype,t),n&&P(e,n),e}function N(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R(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&&B(e,t)}function D(e){var t=V();return function(){var n,r=z(e);if(t){var i=z(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M(this,n)}}function M(e,t){return!t||"object"!==_(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 U(e){var t="function"==typeof Map?new Map:void 0;return(U=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return F(e,arguments,z(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),B(r,e)})(e)}function F(e,t,n){return(F=V()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&B(i,n.prototype),i}).apply(null,arguments)}function V(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function B(e,t){return(B=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var H=function(e){R(n,e);var t=D(n);function n(e){return N(this,n),t.call(this,e)}return n}(U(Error)),q=function(e){R(n,e);var t=D(n);function n(){return N(this,n),t.apply(this,arguments)}return x(n,[{key:"name",get:function(){return"SilentError"}}]),n}(H),J=function(e){R(n,e);var t=D(n);function n(){return N(this,n),t.apply(this,arguments)}return x(n,[{key:"name",get:function(){return"CoreError"}}]),n}(U(Error)),K={throw:function(e){if(y.Radio.channel(b.SHELL).trigger(v.ERROR,e),!(e instanceof q||L.isDevelopment))throw e}};function Y(e){return(Y="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){return function(e){if(Array.isArray(e))return W(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 W(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 W(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 W(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 Z(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 Q(e,t,n){return(Q="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=re(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 X(e,t){return(X=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ee(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=re(e);if(t){var i=re(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return te(this,n)}}function te(e,t){return!t||"object"!==Y(t)&&"function"!=typeof t?ne(e):t}function ne(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function re(e){return(re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ie=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&&X(e,t)}(o,e);var t,n,r,i=ee(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).mergeOptions(e,[].concat(G(t.defaultProps),G(t.props||[]))),h.result(ne(t),"name")||K.throw(new J("BaseApplication must define a name")),h.result(ne(t),"channelName")||K.throw(new J("BaseApplication must define a channelName")),t.listenTo(t.getGlobalRadioChannel("popup"),v.SHOW_POPUP,t.onShowPopup),t.listenTo(t.getGlobalRadioChannel("alert"),"show:alert",t.onShowAlert),t}return t=o,(n=[{key:"getGlobalRadioChannel",value:function(e){var t=this.shell.getGlobalRadioChannels()[e.toUpperCase()];return t||K.throw(new J("Global channel ".concat(t," does not exist"))),y.Radio.channel(t)}},{key:"onLoadLayout",value:function(){if(this.layoutOptions&&this.layoutOptions.name){var e=h.extend({},this.layoutOptions.options||{},{store:this.shell.store});this.layout=this.layoutService.getLayout(h.extend(this.layoutOptions,{options:e})),this.layout||K.throw(new J("Layout: ".concat(this.layoutOptions.name," does not exist or was not registered"))),this.shell.showView(this.layout),this.triggerMethod("layout:loaded")}}},{key:"onShowPopup",value:function(e){this.layout.getRegion("popup")||K.throw(new J("Your application layout must define a popup region")),this.layout.showChildView("popup",e)}},{key:"onShowAlert",value:function(e){var t=e.ctor,n=e.collection,r=this.layout.getRegion("alert");r?r.hasView()||this.layout.showChildView("alert",new t({collection:n})):K.throw(new J("Your application layout must define an alert region"))}},{key:"setDefaultQueryParams",value:function(e){this.defaultQueryParams&&(e=h.extend(this.defaultQueryParams,e)),this.defaultQueryParams=e}},{key:"getAndClearDefaultQueryParams",value:function(){var e=this.defaultQueryParams;return delete this.defaultQueryParams,e||{}}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Q(re(o.prototype),"listenTo",this))}},{key:"defaultProps",get:function(){return["shell","layoutService"]}}])&&Z(t.prototype,n),r&&Z(t,r),o}(I.Application);function oe(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 ae=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,(n=[{key:"use",value:function(e){var t;this.go=(t=this.go,function(n,r){return t(n,(function(){return e(n,r)}))})}},{key:"go",value:function(e,t){t(e)}}])&&oe(t.prototype,n),r&&oe(t,r),e}();function ce(e){return(ce="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 se(e){return function(e){if(Array.isArray(e))return ue(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 ue(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 ue(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 ue(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 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 fe(e,t,n){return(fe="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=he(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 pe(e,t){return(pe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function de(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=he(e);if(t){var i=he(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return me(this,n)}}function me(e,t){return!t||"object"!==ce(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 he(e){return(he=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ye=/([A-Z])/g,ve=/(^|:)(\w)/gi,be=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&&pe(e,t)}(o,e);var t,n,r,i=de(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).bindDisposal(),t.processInternalRoutes(),t.processExternalRoutes(),t.processAppLinks(),t}return t=o,(n=[{key:"bindDisposal",value:function(){var e=this;this.listenTo(b.SHELL,v.ROUTE,(function(t){t.application!==e.channelName&&e.destroyApp()}))}},{key:"addRouteLookup",value:function(e,t){var n=this;this.options.shell.addRouteLookup("".concat(this.channelName,":").concat(e),(function(r,i){return w.buildRoute(t,{application:n.channelName,action:e,args:r,params:i})}))}},{key:"processInternalRoutes",value:function(){var e=this;h.each(h.keys(this.appRoutes),(function(t){var n=e.appRoutes[t],r=e.toEventName(n);e.addRouteLookup(r,t),e.listenTo(e.channelName,r,(function(n,r){r&&r.usedHelper||K.throw(new J("Please use Core.AppLinkHelper.trigger({}) to trigger appLinks.")),e.executeRoute(n,{isAppRoute:!0},(function(){var i=h.extend({},e.controller.getAndClearDefaultQueryParams(),n.params);n.params=i,g.UpdateUrl(t,n,r)}))}))}))}},{key:"processExternalRoutes",value:function(){var e=this;this.externalRoutes&&h.each(h.keys(this.externalRoutes),(function(t){var n=e.externalRoutes[t],r=e.toEventName(n);e.addRouteLookup(r,t),e.listenTo(e.channelName,r,(function(e,t){t&&t.usedHelper||K.throw(new J("Please use Core.AppLinkHelper.trigger({}) to trigger appLinks.")),g.PageLoad(w.getHref(e))}))}))}},{key:"processAppLinks",value:function(){var e=this;this.appLinks&&h.each(this.appLinks,(function(t){var n=e.toEventName(t);e.listenTo(e.channelName,n,(function(t,n){n&&n.usedHelper||K.throw(new J("Please use Core.AppLinkHelper.trigger({}) to trigger appLinks.")),e.executeRoute(t,{isAppRoute:!1})}))}))}},{key:"executeRoute",value:function(e,t,n){var r=this;this.validateAppLink(e);var i=this.toMethodName(e.action);A.routingStarted();var o=y.Radio.channel(b.SHELL);if(this.options.shell.isNavLocked())return o.trigger(v.NAV_IS_LOCKED,e),void A.routingEnded();var a=new ae;h.each(this.filters,(function(e){return a.use(e)})),a.go(e,(function(){o.trigger(v.ROUTE,e,t),r.createApp();var a=r.controller;if(h.isFunction(a[i])||(A.routingEnded(),K.throw(new J("".concat(i," does not exist on the ").concat(h.result(a,"name"),".")))),!1===a.triggerMethod("before:action"))return a.triggerMethod("action:cancelled"),void A.routingEnded();a.triggerMethod("load:layout"),a[i].apply(a,[].concat(se(e.args||[]),[e.params||{}])),h.isFunction(n)&&n(),A.routingEnded()}))}},{key:"createApp",value:function(){this.controller||(this.controller=new this.options.appConstructor(this.options.appOptions),this.controller.start())}},{key:"destroyApp",value:function(){this.controller&&(this.controller.destroy(),delete this.controller)}},{key:"_addAppRoute",value:function(e,t,n){var r=this;this.route(t,n,(function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var o={application:r.channelName,action:r.toEventName(n),args:t.slice(0,t.length-1),params:g.DeserializeQueryParams(t[t.length-1])};r.executeRoute(o,{isAppRoute:!0},(function(){g.UpdateQuery(h.extend(r.controller.getAndClearDefaultQueryParams(),o.params))}))}))}},{key:"toEventName",value:function(e){return e.replace(ye,":$1").toLowerCase()}},{key:"toMethodName",value:function(e){var t=e.replace(ve,(function(e,t,n){return n.toUpperCase()}));return t[0].toLowerCase()+t.slice(1,t.length)}},{key:"validateAppLink",value:function(e){e.application&&e.action||(A.routingEnded(),K.throw(new J("Invalid AppLink")))}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],fe(he(o.prototype),"listenTo",this))}}])&&le(t.prototype,n),r&&le(t,r),o}(I.AppRouter);function ge(e){return(ge="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 Se(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 Oe(e,t,n){return(Oe="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=we(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 Ce(e,t){return(Ce=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ae(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 je(this,n)}}function je(e,t){return!t||"object"!==ge(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 Ie=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&&Ce(e,t)}(o,e);var t,n,r,i=Ae(o);function o(){return Se(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Oe(we(o.prototype),"listenTo",this))}}])&&Ee(t.prototype,n),r&&Ee(t,r),o}(I.Behavior);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 ke(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(_e="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=Re(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 Pe(e,t){return(Pe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function xe(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Re(e);if(t){var i=Re(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ne(this,n)}}function Ne(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 Re(e){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var De=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&&Pe(e,t)}(o,e);var t,n,r,i=xe(o);function o(){return ke(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],_e(Re(o.prototype),"listenTo",this))}}])&&Le(t.prototype,n),r&&Le(t,r),o}(y.Collection);function Me(e){return(Me="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 Ue(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 Fe(e,t,n){return(Fe="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=qe(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 Ve(e,t){return(Ve=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Be(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qe(e);if(t){var i=qe(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ze(this,n)}}function ze(e,t){return!t||"object"!==Me(t)&&"function"!=typeof t?He(e):t}function He(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qe(e){return(qe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Je=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&&Ve(e,t)}(o,e);var t,n,r,i=Be(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),t=i.call(this,e),h.result(He(t),"name")||K.throw(new J("Error: View with cid:".concat(t.cid," requires a name."))),t}return t=o,(n=[{key:"serializeModel",value:function(){return this.model?this.model.toJSON():{}}},{key:"serializeCollection",value:function(){return this.collection?this.collection.toJSON():[]}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Fe(qe(o.prototype),"listenTo",this))}}])&&Ue(t.prototype,n),r&&Ue(t,r),o}(I.CollectionView);function $e(e){return($e="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 Ke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ye(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 Ge(e,t){return(Ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function We(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Qe(e);if(t){var i=Qe(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ze(this,n)}}function Ze(e,t){return!t||"object"!==$e(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 Qe(e){return(Qe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Xe=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&&Ge(e,t)}(o,e);var t,n,r,i=We(o);function o(){return Ke(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"name",get:function(){return"DevError"}}])&&Ye(t.prototype,n),r&&Ye(t,r),o}(H);function et(e){return(et="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 tt(e){return function(e){if(Array.isArray(e))return nt(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 nt(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 nt(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 nt(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 rt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function it(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 ot(e,t,n){return t&&it(e.prototype,t),n&&it(e,n),e}function at(e,t,n){return(at="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=pt(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 ct(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&&st(e,t)}function st(e,t){return(st=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ut(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=pt(e);if(t){var i=pt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return lt(this,n)}}function lt(e,t){return!t||"object"!==et(t)&&"function"!=typeof t?ft(e):t}function ft(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pt(e){return(pt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var dt=function(e){ct(n,e);var t=ut(n);function n(e){var r;rt(this,n),r=t.call(this,e);var i=[].concat(tt(r.defaultProps),tt(r.props||[]));return r.mergeOptions(e,i),h.result(ft(r),"name")||K.throw(new J("Error: View with cid:".concat(r.cid," requires a name."))),r}return ot(n,[{key:"_setOptions",value:function(e){this.options=h.extend({},h.result(this,"defaults"),e)}},{key:"_setAttributes",value:function(e){var t,n,r;L.isDevelopment&&h.extend(e,(t={},n="cv-classname",r=this.name,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t)),this.$el.attr(e)}},{key:"serializeModel",value:function(){return this.model?this.model.toJSON():{}}},{key:"serializeCollection",value:function(){return this.collection?this.collection.toJSON():[]}},{key:"resetClassName",value:function(){this.$el.attr("class",h.result(this,"className"))}},{key:"serializeData",value:function(){var e=this,t=at(pt(n.prototype),"serializeData",this).call(this),r=h.result(this,"viewOptions"),i=h.extend({},t,{options:r});return n.ViewDataExtensions.length?h.extend.apply(h,[i].concat(tt(h.map(n.ViewDataExtensions,(function(t){return t instanceof Function?t(e):t}))))):i}},{key:"viewOptions",value:function(){return this.options}},{key:"undelegateAppLinks",value:function(){this.$el&&this.$el.off(".appLinks".concat(this.cid))}},{key:"renderAppLinks",value:function(){var e=this,t=this.appLinks;t&&(t=this.normalizeUIKeys(t),this.undelegateAppLinks(),h.each(h.keys(t),(function(n){var r=n,i=t[n],o=w.getHref(i);"[this]"===r&&(r=null);var a=r?e.$el.find(n):e.$el;(a.is("a")||a.is("button"))&&(o&&"/"!==o&&a.attr("href",o),e.delegate("click.appLinks".concat(e.cid),r,(function(e){e.preventDefault(),w.trigger(i)})))})))}},{key:"hasPartialLoadingRegions",value:function(){return void 0!==this._hasPartialLoadingRegions||(this._hasPartialLoadingRegions=h.some(this.regions,(function(e){return h.has(e,"partialLoading")}))),this._hasPartialLoadingRegions}},{key:"renderPartialLoading",value:function(e){y.Radio.channel(b.SHELL).trigger("render:partial:loading",this,e)}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],at(pt(n.prototype),"listenTo",this))}},{key:"render",value:function(){if(this._isDestroyed)return this;var e=this.processRequriedResources(!0);return e&&(e=this.triggerMethod("before:render",this)),!1!==e&&(e=!0),!1===(e=e&&this.processRequriedResources(!1))?(this._partialLoadingRendered||!this.hasPartialLoadingRegions()||(this._partialLoadingRendered=!0,this._reInitRegions(),this._renderTemplate(),this.renderPartialLoading()),this):((this._isRendered||this._partialLoadingRendered)&&this._reInitRegions(),this.setTitle(),this._renderTemplate(),this.bindUIElements(),this.renderAppLinks(),this._partialLoadingRendered=!1,this._isRendered=!0,this.triggerMethod("render",this),this)}},{key:"processRequriedResources",value:function(e){return!0}},{key:"setTitle",value:function(){}},{key:"defaultProps",get:function(){return["shell","layoutService"]}},{key:"ui",get:function(){return this.uiStorage||(this.uiStorage=this.elements),this.uiStorage},set:function(e){this.uiStorage=e}},{key:"elements",get:function(){return null}}],[{key:"AddViewDataExtension",value:function(e){n.ViewDataExtensions.push(e)}}]),n}(I.View);dt.ViewDataExtensions=[];var mt=function(e){ct(n,e);var t=ut(n);function n(e){var r;return rt(this,n),(r=t.call(this,e)).boundListeners={},r.resourceInstances={},r}return ot(n,[{key:"processRequriedResources",value:function(e){var t=this,n=h.keys(this.requiredResources);if(!n.length)return!0;var r=this,i=!0;return h.each(n,(function(n){var o=t.requiredResources[n];if(o.beforeOnBeforeRender===e){var a=o.dataServiceName;t.resourceInstances[a]||(t.resourceInstances[a]=o.getInstance(t)),t.boundListeners["".concat(a,":").concat(o.eventName)]||(t.listenTo(t.resourceInstances[a].channelName,o.eventName,t.render),t.boundListeners["".concat(a,":").concat(o.eventName)]=!0),r[n]=o.getData(t.resourceInstances[a]),i=i&&!!r[n]}})),i}},{key:"setTitle",value:function(){h.isString(this.title)||!1===this.title||K.throw(new Xe("Must define a title for ".concat(this.name,"."))),y.Radio.channel(b.SHELL).trigger("set:page:title",this.title)}}]),n}(dt),ht=function(e){ct(n,e);var t=ut(n);function n(){return rt(this,n),t.apply(this,arguments)}return n}(dt);function yt(e){return(yt="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 vt(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 bt(e,t){return(bt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gt(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Et(e);if(t){var i=Et(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return St(this,n)}}function St(e,t){return!t||"object"!==yt(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 Et(e){return(Et=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ot=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&&bt(e,t)}(o,e);var t,n,r,i=gt(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,e)}return t=o,r=[{key:"getCacheKey",value:function(e){K.throw(new Xe("Must define getCacheKey for ".concat(this.name,".")))}}],(n=[{key:"unmountRegion",value:function(e){this.trigger("unmount:".concat(e))}}])&&vt(t.prototype,n),r&&vt(t,r),o}(mt);function Ct(e){return(Ct="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 At(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jt(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 wt(e,t,n){return(wt="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=Lt(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 It(e,t){return(It=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Tt(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Lt(e);if(t){var i=Lt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return kt(this,n)}}function kt(e,t){return!t||"object"!==Ct(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 Lt(e){return(Lt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var _t=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&&It(e,t)}(o,e);var t,n,r,i=Tt(o);function o(){return At(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"mixin",value:function(e){for(var t in e){if(this.hasOwnProperty(t)){var n=this[t];return void(this[t]=h.extend({},n,e[t]))}this[t]=e[t]}}},{key:"addValidation",value:function(e){this.mixin({validation:e})}},{key:"validate",value:function(e,t){wt(Lt(o.prototype),"validate",this).call(this,e,t)}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],wt(Lt(o.prototype),"listenTo",this))}}])&&jt(t.prototype,n),r&&jt(t,r),o}(y.Model);function Pt(e){return(Pt="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 xt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nt(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 Rt(e,t,n){return(Rt="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=Ft(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 Dt(e,t){return(Dt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mt(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ft(e);if(t){var i=Ft(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ut(this,n)}}function Ut(e,t){return!t||"object"!==Pt(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 Ft(e){return(Ft=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Vt=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&&Dt(e,t)}(o,e);var t,n,r,i=Mt(o);function o(){return xt(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"set",value:function(e,t,n){var r,i;if(null===e)return this;for(r in"object"===Pt(e)?(i=e,n=t):(i={})[e]=t,n||(n={}),i)h.has(this.associations,r)&&(i[r]=this.setAssociation(r,i[r],n));return Rt(Ft(o.prototype),"set",this).call(this,i,n)}},{key:"get",value:function(e){var t=e.indexOf(".");if(-1===t)return Rt(Ft(o.prototype),"get",this).call(this,e);var n=e.substr(0,t),r=this.attributes[n];if(!r||!h.isFunction(r.get))return Rt(Ft(o.prototype),"get",this).call(this,e);var i=e.substr(t+1);return r.get(i)}},{key:"setAssociation",value:function(e,t,n){var r=this.associations[e],i=this.attributes[e];if(!h.isFunction(r))return t;if(n.unset)return i&&delete i.parent,delete this[e],i;if(i)return i instanceof _t&&i.set(t,n),i instanceof De&&i.set(t,n),n.silent||this.trigger("change:".concat(e),this,t,n),i;var o=t instanceof _t?t:new r(t,{parse:!0});return o.parent=this,this[e]=o,o}},{key:"toJSON",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Rt(Ft(o.prototype),"toJSON",this).apply(this,t);return h.each(this.associations,(function(e,t){h.has(r,t)&&h.isFunction(r[t].toJSON)?r[t]=r[t].toJSON():r[t]=(new e).toJSON()})),r}},{key:"toFlatJSON",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.omit(Rt(Ft(o.prototype),"toJSON",this).apply(this,t),h.keys(this.associations))}}])&&Nt(t.prototype,n),r&&Nt(t,r),o}(_t);function Bt(e){return(Bt="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 zt(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 Ht(e,t,n){return(Ht="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=Kt(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 qt(e,t){return(qt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Jt(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Kt(e);if(t){var i=Kt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return $t(this,n)}}function $t(e,t){return!t||"object"!==Bt(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 Kt(e){return(Kt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Yt=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&&qt(e,t)}(o,e);var t,n,r,i=Jt(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).name||K.throw(new J("Your service must be named.")),t}return t=o,(n=[{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Ht(Kt(o.prototype),"listenTo",this))}}])&&zt(t.prototype,n),r&&zt(t,r),o}(I.Object);function Gt(e){return(Gt="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 Wt(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 Zt(e,t,n){return(Zt="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=tn(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 Qt(e,t){return(Qt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xt(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=tn(e);if(t){var i=tn(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return en(this,n)}}function en(e,t){return!t||"object"!==Gt(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 tn(e){return(tn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var nn=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&&Qt(e,t)}(o,e);var t,n,r,i=Xt(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).layouts={},t.requiredRegions=e.requiredRegions,t}return t=o,(n=[{key:"clearLayout",value:function(){this.currentLayout&&(this.currentLayout.destroy(),delete this.currentLayout,delete this.currentLayoutCacheKey)}},{key:"registerLayout",value:function(e,t){return this.checkRequiredRegions(t),this.layouts[e]=t,this}},{key:"getLayout",value:function(e){var t=e.name,n=e.options,r=void 0===n?{}:n;this.layouts[t]||K.throw(new J("".concat(t," was not registered as a template.")));var i=this.layouts[t].getCacheKey(r);return this.currentLayoutCacheKey===i&&this.currentLayout?(this.currentLayout.triggerMethod("layout:requested",r),this.currentLayout):(this.clearLayout(),this.currentLayoutCacheKey=i,this.currentLayout=new this.layouts[t](r),this.listenToOnce(this.currentLayout,"destroy",this.clearLayout),this.currentLayout)}},{key:"checkRequiredRegions",value:function(e){h.each(this.requiredRegions,(function(t){h.has(h.result(e.prototype,"regions"),t)||K.throw(new J("Layout: ".concat(e.prototype.name," must define an ").concat(t," region.")))}))}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],Zt(tn(o.prototype),"listenTo",this))}}])&&Wt(t.prototype,n),r&&Wt(t,r),o}(I.Object);function rn(e){return(rn="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 on(e,t,n){return(on="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=un(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 an(e,t){return(an=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function cn(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=un(e);if(t){var i=un(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return sn(this,n)}}function sn(e,t){return!t||"object"!==rn(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 un(e){return(un=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ln(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fn(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 pn(e,t,n){return t&&fn(e.prototype,t),n&&fn(e,n),e}var dn=function(){function e(t,n){ln(this,e),this.application=t,this.options=n||{}}return pn(e,[{key:"Application",get:function(){return this.application}},{key:"Options",get:function(){return this.options}}]),e}(),mn=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&&an(e,t)}(n,e);var t=cn(n);function n(){return ln(this,n),t.apply(this,arguments)}return pn(n,[{key:"initialize",value:function(e){this.mergeOptions(e,["layoutService"]),this.applications=[],this.routeLookup={},this.shellState={navLock:!1,activeRoute:!1,currentAppLink:null},this.errorHandlers=[]}},{key:"bindListeners",value:function(){this.bindRouteLookup(),this.bindNavLockListeners(),this.bindAppLinkListeners(),this.bindErrorHandlers(),this.bindErrorListener()}},{key:"bindNavLockListeners",value:function(){var e=this;this.listenTo(b.SHELL,v.LOCK_NAV,(function(){return e.shellState.navLock=!0})),this.listenTo(b.SHELL,v.UNLOCK_NAV,(function(){return e.shellState.navLock=!1}))}},{key:"bindAppLinkListeners",value:function(){var e=this;this.listenTo(b.SHELL,v.ROUTING_START,(function(){return e.shellState.activeRoute=!0})),this.listenTo(b.SHELL,v.ROUTING_END,(function(){return e.shellState.activeRoute=!1})),this.listenTo(b.SHELL,v.ROUTE,(function(t){return e.shellState.currentAppLink=t}));var t=y.Radio.channel(b.SHELL);t.reply(v.HAS_ACTIVE_ROUTE,h.bind(this.hasActiveRoute,this)),t.reply(v.CURRENT_ROUTE,(function(){return e.shellState.currentAppLink}))}},{key:"bindErrorHandlers",value:function(){window.addEventListener("error",(function(){A.routingEnded()}))}},{key:"bindErrorListener",value:function(){var e=y.Radio.channel(b.SHELL);this.listenTo(e,v.ERROR,this.handleError)}},{key:"bindRouteLookup",value:function(){var e=this;y.Radio.channel(b.SHELL).reply(v.ROUTE_LOOKUP,(function(t,n,r){return e.routeLookup[t]?e.routeLookup[t](n,r):""}),this)}},{key:"addRouteLookup",value:function(e,t){this.routeLookup[e]=t}},{key:"registerApplication",value:function(e,t){return this.applications.push(new dn(e,t)),this}},{key:"getGlobalRadioChannels",value:function(){return b}},{key:"isNavLocked",value:function(){return this.shellState.navLock}},{key:"start",value:function(e){var t=this;e||(e={}),this.runInitializationSteps(this,(function(r,i){t.runStartUpSteps(t,e,(function(r,i,o){on(un(n.prototype),"start",t).call(t,e)}))}))}},{key:"hasActiveRoute",value:function(){return this.shellState.activeRoute}},{key:"onStart",value:function(){var e=this;h.each(this.applications,(function(t){var n={appConstructor:t.Application,shell:e,appOptions:Object.assign({region:"",shell:e,layoutService:e.layoutService},t.Options)};new t.Application.router(n)})),this.bindListeners(),g.StartHistory()}},{key:"addInitializationStep",value:function(e){var t;return this.runInitializationSteps=(t=this.runInitializationSteps,function(n,r){return t(n,(function(){return e(n,r)}))}),this}},{key:"runInitializationSteps",value:function(e,t){t(e)}},{key:"addStartUpStep",value:function(e){var t;return this.runStartUpSteps=(t=this.runStartUpSteps,function(n,r,i){return t(n,r,(function(){return e(n,r,i)}))}),this}},{key:"runStartUpSteps",value:function(e,t,n){n(e,t)}},{key:"registerLayout",value:function(e,t){return this.layoutService.registerLayout(e,t),this}},{key:"registerErrorHandler",value:function(e,t){return e||K.throw(new J("An error must have a name in order to register a handler for it.")),h.any(this.errorHandlers,(function(t){return t.errorType===e}))&&K.throw(new J("An error handler for ".concat(e.prototype.name," has already been defined."))),this.errorHandlers.push({errorType:e,handler:t}),this}},{key:"handleError",value:function(e){var t=h.find(this.errorHandlers,(function(t){return e instanceof t.errorType}));t&&t.handler&&t.handler(e)}},{key:"registerStore",value:function(e){this.store=e}},{key:"listenTo",value:function(){return T.call(this,arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],on(un(n.prototype),"listenTo",this))}}]),n}(I.Application),hn=function(e){return h.isFunction(e)},yn=function(){return h.identity},vn=n(26),bn=n(5);function gn(e){return(gn="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 Sn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function En(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 On(e,t){return(On=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Cn(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=jn(e);if(t){var i=jn(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return An(this,n)}}function An(e,t){return!t||"object"!==gn(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 jn(e){return(jn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var wn=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&&On(e,t)}(o,e);var t,n,r,i=Cn(o);function o(){return Sn(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"isReactComponent",value:function(e){return d&&d.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"),vn.render(t,r[0],(function(){return n.trigger("show")})),this.listenToOnce(this,"unmount:".concat(e),(function(){return vn.unmountComponentAtNode(r[0])})),this.listenToOnce(this,"before:destroy",(function(){return vn.unmountComponentAtNode(r[0])})))}},{key:"wrapWithStore",value:function(e){return d.createElement(bn.Provider,{store:this.options.store},e)}}])&&En(t.prototype,n),r&&En(t,r),o}(Ot),In="top:nav",Tn="left:nav",kn="content",Ln="popup",_n="alert",Pn=n(130),xn=n.n(Pn),Nn=n(27),Rn=n.n(Nn);function Dn(e){return(Dn="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 Mn(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 Un(e,t,n){return(Un="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=zn(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 Fn(e,t){return(Fn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Vn(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=zn(e);if(t){var i=zn(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Bn(this,n)}}function Bn(e,t){return!t||"object"!==Dn(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 zn(e){return(zn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Hn=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&&Fn(e,t)}(a,e);var t,n,i,o=Vn(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=o.call(this,e)).childComponents={},t}return t=a,i=[{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:"regions",value:function(){return{layout:".layout-region"}}},{key:"getChildComponents",value:function(){return{topNav:{component:this.childComponents[In],className:Rn.a.topNavRegion},leftNav:{component:this.childComponents[Tn],className:"py-3 ".concat(Rn.a.leftNavRegion)},content:{component:this.childComponents[kn],className:"position-relative container py-3"},popup:{component:this.childComponents[Ln]},alert:{component:this.childComponents[_n]}}}},{key:"unsetRegion",value:function(e){delete this.childComponents[e],this.renderLayout()}},{key:"renderTopNav",value:function(){hn(this.options.getTopNavView)&&(this.childComponents[In]=this.options.getTopNavView(r.AppLinkHelper.getCurrentAppLink()))}},{key:"hideLeftNav",value:function(){this.unsetRegion(Tn)}},{key:"closePopup",value:function(){this.unsetRegion(Ln)}},{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());Un(zn(a.prototype),"showChildView",this).call(this,"layout",this.wrapWithStore(d.createElement(Yn,Object.assign({},e))))}},{key:"title",get:function(){return!1}},{key:"name",get:function(){return"CuratorLayoutView"}},{key:"template",get:function(){return xn.a}},{key:"className",get:function(){return"container-fluid ".concat(Rn.a.curatorLayout)}}])&&Mn(t.prototype,n),i&&Mn(t,i),a}(wn),qn=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},Jn=function(e){var t=e.className,n=e.children;return d.createElement("div",{className:t},n)},$n=function(e,t){return"".concat(e).concat(t?" ".concat(t):"")},Kn=function(e){var t=e.topNav,n=e.leftNav,r=e.content,i=e.popup,o=e.alert;return d.createElement(d.Fragment,null,d.createElement("div",{className:"position-relative"},!!t.component&&d.createElement(Jn,{className:$n("top-nav-region",t.className)},t.component),!!n.component&&d.createElement(Jn,{className:$n("left-nav-region",n.className)},n.component),!!r.component&&d.createElement("div",{className:"content-container"},d.createElement(Jn,{className:$n("content-region",r.className)},r.component))),!!i.component&&d.createElement(Jn,{className:$n("popup-region",i.className)},i.component),!!o.component&&d.createElement(Jn,{className:$n("alert-region",o.className)},o.component))},Yn=function(e){var t=e.provider,n=qn(e,["provider"]);return t?d.createElement(t,null,d.createElement(Kn,Object.assign({},n))):d.createElement(Kn,Object.assign({},n))};function Gn(e){return(Gn="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 Wn(e){return function(e){if(Array.isArray(e))return Zn(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 Zn(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 Zn(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 Zn(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 Qn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xn(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 er(e,t){return(er=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function tr(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=rr(e);if(t){var i=rr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return nr(this,n)}}function nr(e,t){return!t||"object"!==Gn(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 rr(e){return(rr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ir=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&&er(e,t)}(a,e);var t,n,i,o=tr(a);function a(){return Qn(this,a),o.apply(this,arguments)}return t=a,(n=[{key:"initialize",value:function(){this.listenTo(b.SHELL,r.EventNames.ROUTING_END,this.updateNav)}},{key:"updateNav",value:function(){var e=this,t=r.AppLinkHelper.getCurrentAppLink().application;if(t!==this.currentApplication){this.currentApplication=t;var n=this.options.navItemMappings[t];if(n){var i=document.querySelector(this.options.navSelector);i&&i.children&&Wn(i.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))}))}}}},{key:"name",get:function(){return"CuratorAppNavService"}}])&&Xn(t.prototype,n),i&&Xn(t,i),a}(r.Service);function or(e){return(or="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 ar(e){return function(e){if(Array.isArray(e))return cr(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 cr(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 cr(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 cr(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 sr(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 ur(e,t){return(ur=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function lr(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=dr(e);if(t){var i=dr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return fr(this,n)}}function fr(e,t){return!t||"object"!==or(t)&&"function"!=typeof t?pr(e):t}function pr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dr(e){return(dr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var mr=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&&ur(e,t)}(o,e);var t,n,r,i=lr(o);function o(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),t=i.call(this,e),h.result(pr(t),"name")||K.throw(new Xe("Must provide a name when extending BaseDataService")),h.result(pr(t),"channelName")||K.throw(new Xe("Must provide a channelName for ".concat(h.result(pr(t),"name"))));var n=[].concat(ar(t.defaultProps),ar(t.props||[]));return t.dataRequestSignatures={},t.mergeOptions(e,n),t}return t=o,(n=[{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,o=this.getEventNames(i),a=o.syncEvent,c=o.errorEvent,s=this.cache.get(i);if(s&&s.openRequest)return this.listenToOnce(this.getChannel(),a,(function(e){h.isFunction(r)&&t.stopListening(t.getChannel(),c,r),h.isFunction(n)&&n(e)})),void this.listenToOnce(this.getChannel(),c,(function(){h.isFunction(n)&&t.stopListening(t.getChannel(),a,n),h.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,o=e.resource,a=e.formatData,c=e.expiryTime,s=e.successHandler,u=e.errorHandler,l=e.bootstrapName,f=this.getEventNames(i),p=f.syncEvent,d=f.requestEvent,m=f.successEvent,y=f.errorEvent,v=this.getChannel(),b=this.currentTimestamp();this.bootstrapData&&this.bootstrapData[l]&&(this.cacheData(i,this.bootstrapData[l],a,{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){h.isFunction(r)&&t.stopListening(t.getChannel(),y,r),h.isFunction(n)&&n(e)})),this.listenToOnce(v,y,(function(){h.isFunction(n)&&t.stopListening(t.getChannel(),p,n),h.isFunction(r)&&r()}))),this.cache.has(i)&&!O||(v.trigger(d),this.listenToResponse({eventPrefix:i,formatData:a,cacheOptions:{timestamp:b},callback:n,errorCallback:r,successHandler:s,errorHandler:u}),this.cacheData(i,null,null,{openRequest:!0,timestamp:b}),this.dataProvider.read(o,{channel:this.getTransportChannel(),successEvent:m,errorEvent:y})),g&&h.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,o=e.callback,a=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:o,errorCallback:a,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,o=e.formatData,a=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:a,formatData:o,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,o=e.invalidationKeys,a=e.successHandler,c=e.errorHandler,s=this.getEventNames(t),u=s.successEvent,l=s.errorEvent,f=this.getTransportChannel();this.listenToResponse({eventPrefix:t,invalidationKeys:o,callback:r,errorCallback:i,cacheOptions:{noCache:!0,clearCacheKey:!0},successHandler:a,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,o=e.errorCallback,a=e.successHandler,c=e.errorHandler,s=e.invalidationKeys,u=e.cacheOptions,l=void 0===u?{}:u,f=this.getEventNames(n),p=f.syncEvent,d=(f.requestEvent,f.successEvent),m=f.errorEvent,y=f.successAlertEvent,v=f.errorAlertEvent,b=this.getChannel(),g=this.getTransportChannel(),S=this.getAlertChannel();h.isFunction(i)&&this.listenToOnce(b,p,i),h.isFunction(o)&&this.listenToOnce(b,m,o),this.stopListening(S,y),this.stopListening(S,v),h.isFunction(a)&&this.listenToOnce(S,y,a),h.isFunction(c)&&this.listenToOnce(S,v,c),!h.isFunction(c)&&!1!==c&&h.isFunction(this.defaultErrorHandler)&&this.listenToOnce(S,v,this.defaultErrorHandler),this.hasRequestSignature(n)||(this.setRequestSignature(n),this.listenTo(g,d,(function(e){t.stopListening(b,m,o);for(var i=arguments.length,a=new Array(i>1?i-1:0),c=1;c<i;c++)a[c-1]=arguments[c];S.trigger.apply(S,[y,e].concat(a));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,m,(function(){var e;t.stopListening(b,p,i);var r=(e=t.dataProvider).parseError.apply(e,arguments);S.trigger(v,r),b.trigger(m,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,o=void 0!==i&&i,a=r.timestamp;a||(a=this.currentTimestamp());var c=this.processPagination(t),s=this.formatData(t,n);return this.cache.set(e,{data:s,timestamp:a,cursors:c,openRequest:o}),s}},{key:"processPagination",value:function(e){if(e){var t=e.pagination;if(t)return t.cursors?t.cursors:h.isUndefined(t.offset)||h.isUndefined(t.pageSize)?t.page?this.convertLegacyPaginationToCursors(t):void 0:this.convertOffsetPaginationToCursors(t)}}},{key:"formatData",value:function(e,t){return h.isFunction(t)?t(e):e}},{key:"chain",value:function(){var e=this,t=[],n=function(e,t){h.isFunction(e)&&e(t)},r=function(r,o){return t.push((function(){var i=r.callback;r.callback=function(e){n(i,e),n(t.shift())},e[o](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 y.Radio.channel("".concat(this.channelName,":transport"))}},{key:"getAlertChannel",value:function(){return y.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,o=r>0&&t>0&&Math.max(t-n,0),a={};if(i&&i<r&&(a.next=i.toString()),h.isNumber(o)&&(a.previous=o.toString()),!h.isEmpty(a))return a}},{key:"convertLegacyPaginationToCursors",value:function(e){var t=e.page,n=e.totalPages,r=h.isNumber(t)&&t>0&&t<n&&t+1,i=h.isNumber(t)&&t>1&&t-1,o={};if(r&&r<=n&&(o.next=r.toString()),i&&(o.previous=i.toString()),!h.isEmpty(o))return o}},{key:"defaultProps",get:function(){return["dataProvider","cache","bootstrapData","defaultErrorHandler","alertService"]}}])&&sr(t.prototype,n),r&&sr(t,r),o}(Yt);function hr(e){return(hr="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 yr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vr(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 br(e,t){return(br=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gr(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Er(e);if(t){var i=Er(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Sr(this,n)}}function Sr(e,t){return!t||"object"!==hr(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 Er(e){return(Er=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Or,Cr,Ar=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&&br(e,t)}(o,e);var t,n,r,i=gr(o);function o(){return yr(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"uploadBase64Image",value:function(e,t,n,r){return this.create({resource:"/api/image/upload?type=".concat(t),eventPrefix:c.UPLOAD_IMAGE,data:e,callback:n,errorCallback:r})}},{key:"name",get:function(){return p.IMAGE_UPLOAD}},{key:"channelName",get:function(){return f.IMAGE_UPLOAD}}])&&vr(t.prototype,n),r&&vr(t,r),o}(mr),jr={API_REQUEST:"API_REQUEST",API_REPONSE:"API_RESPONSE",API_ERROR:"API_ERROR",INVALIDATE:"INVALIDATE",UPDATE:"UPDATE"};function wr(e){return{getResponseHeader:e.getResponseHeader,responseJSON:e.responseJSON,status:e.status}}!function(e){e.None="None",e.Fetching="Fetching",e.Success="Success",e.Error="Error"}(Or||(Or={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE"}(Cr||(Cr={}));var Ir=[Cr.POST,Cr.PUT];function Tr(e){var t=e.resource,n=e.type,r=e.success,i=e.error,o=e.always,a={url:t,method:n};Ir.includes(n)&&e.data&&(a.data=JSON.stringify(e.data)),$.ajax(a).done((function(e,t,n){r&&r(e,wr(n))})).fail((function(e,t,n){i&&i(wr(e))})).always((function(){o&&o()}))}function kr(e){return(kr="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 Lr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.idAttribute,r=void 0===n?"id":n,i=t.namespace,o=void 0===i?"":i;return e[r]||K.throw(new Xe("There was an issue during normalization. Object did not have an id attribute.")),"".concat(o,"__").concat(e[r])}function _r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.idAttribute,i=void 0===r?"id":r,o=[];return e.forEach((function(e){e[i]&&o.push(Lr(e,n)),xr(e,t,n)})),o}function Pr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.idAttribute,i=void 0===r?"id":r,o=Object.assign({},e);if(Object.keys(e).forEach((function(r){var a=e[r];if(a)if(Array.isArray(a)){var c=_r(a,t,n);c.length&&(o[r]=c)}else if("object"===kr(a)){var s=Pr(a,t,n);a[i]?o[r]=Lr(a,n):o[r]=s}})),e[i]){var a=Lr(e,n);return t[a]=o,a}return o}function xr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e)return Array.isArray(e)?_r(e,t,n):"object"===kr(e)?Pr(e,t,n):e}function Nr(e,t){var n={};return{result:xr(e,n,t),entities:n}}var Rr={isEmpty:function(e){return h.isEmpty(e)},values:function(e){return h.values(e)},keys:function(e){return h.keys(e)},deepClone:function(e){return(h.isArray(e)?h.map:h.mapObject)(e,(function(e){return h.isObject(e)||h.isArray(e)?Rr.deepClone(e):e}))},getEnumKeys:function(e){return Object.keys(e).filter((function(e){return!(parseInt(e)>=0)}))},isObject:function(e){return h.isObject(e)},isEqual:function(e,t){return h.isEqual(e,t)},omit:function(e,t){return h.omit(e,t)}};function Dr(e){return(Dr="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 Mr(e,t,n){if(e){if("string"==typeof e)return function(e,t,n){if(n[e])return n[e];n[e]={};var r=Mr(t[e],t,n);return Object.assign(n[e],r),Rr.isEmpty(n[e])&&delete n[e],n[e]}(e,t,n);if(Array.isArray(e))return e.map((function(e){return Mr(e,t,n)}));if("object"===Dr(e)){var r={};return Object.keys(e).forEach((function(i){r[i]=Mr(e[i],t,n)||e[i]})),r}}}function Ur(e,t){return Mr(e,t,{})}function Fr(e,t){return e===t}function Vr(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}function Br(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fr,n=null,r=null;return function(){return Vr(t,n,arguments)||(r=e.apply(null,arguments)),n=arguments,r}}function zr(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}function Hr(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];var o=0,a=r.pop(),c=zr(r),s=e.apply(void 0,[function(){return o++,a.apply(null,arguments)}].concat(n)),u=e((function(){for(var e=[],t=c.length,n=0;n<t;n++)e.push(c[n].apply(null,arguments));return s.apply(null,e)}));return u.resultFunc=a,u.dependencies=c,u.recomputations=function(){return o},u.resetRecomputations=function(){return o=0},u}}var qr=Hr(Br);var Jr={currentTimestamp:function(){return(new Date).valueOf()},isExpired:function(e,t){if(!t)return!1;var n=1e3*t;return e<Jr.currentTimestamp()-n},currentTimeOfDay:function(e){e||(e=new Date);var t=e.getHours();return t>=12&&t<18?"afternoon":t>=18?"evening":"morning"}};function $r(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 Kr=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.status=t.status,this.requestTime=t.requestTime,this.cacheDuration=t.cacheDuration,this.data=t.data,this.statusCode=t.statusCode}var t,n,r;return t=e,(n=[{key:"shouldFetch",get:function(){return this.status===Or.None||this.isExpired}},{key:"isExpired",get:function(){return Jr.isExpired(this.requestTime,this.cacheDuration)}},{key:"isFetching",get:function(){return this.status===Or.Fetching}},{key:"hasError",get:function(){return this.status===Or.Error}},{key:"isComplete",get:function(){return this.status===Or.Success||this.status===Or.Error}}])&&$r(t.prototype,n),r&&$r(t,r),e}();function Yr(e,t,n){if(!e||!t)return Gr();var r=t.response;return!1!==t.request.normalize&&(r=Ur(t.response,n)),new Kr({status:t.status,statusCode:t.statusCode,requestTime:t.timestamp,cacheDuration:t.request.expiryTime,data:r})}function Gr(){return new Kr({status:Or.None})}function Wr(e,t){return Yr(t,e.flightData.resources[t],e.flightData.entities)}function Zr(e,t){return function(){Qr(e,t)}}function Qr(e,t){e({type:jr.API_REQUEST,request:t})}function Xr(e,t,n){var r,i,o,a,c,s,u,l,f,p=Wr(t,null===(r=n)||void 0===r?void 0:r.key);n&&p.shouldFetch?Qr(e,n):p.hasError?(null===(o=(i=n).error)||void 0===o||o.call(i,null),null===(c=(a=n).always)||void 0===c||c.call(a)):(null===(u=(s=n).success)||void 0===u||u.call(s,p.data),null===(f=(l=n).always)||void 0===f||f.call(l))}function ei(e){return Zr(Object(bn.useDispatch)(),e)}function ti(e,t){var n=Object(d.useMemo)((function(){var n;return(null===(n=t)||void 0===n?void 0:n.optimize)?function(e){return Hr(Br,(function(e,t){var n=["response","request"];return Rr.isEqual(Rr.omit(e,n),Rr.omit(t,n))}))((function(t){return t.flightData.resources[e]}),(function(t){var n,r=t.flightData.resources[e];return(null===(n=r)||void 0===n?void 0:n.entityIds)?r.entityIds.reduce((function(e,n){return e[n]=t.flightData.entities[n],e}),{}):{}}),(function(t,n){return Yr(e,t,n)}))}(e):function(e){return qr((function(t){return t.flightData.resources[e]}),(function(e){return e.flightData.entities}),(function(t,n){return Yr(e,t,n)}))}(e)}),[e]);return Object(bn.useSelector)((function(e){return n(e)}))}function ni(e,t){var n=Object(bn.useDispatch)(),r=ti(e&&e.key,t),i=Zr(n,e);return e&&r.shouldFetch&&i(),r}function ri(e){return function(e){if(Array.isArray(e))return ii(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 ii(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 ii(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 ii(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 oi,ai=function(e,t,n){var r=Array.isArray(t)?t:[t],i=[];return r.forEach((function(t){var n,r=new RegExp(t,"i"),o=Object.keys(e.resources).filter((function(e){return r.test(e)}));(n=i).push.apply(n,ri(o))})),n&&(i=i.filter((function(e){return e!==n}))),i.reduce((function(e,t){return e[t]=!0,e}),{})};!function(e){e[e.Ok=200]="Ok",e[e.NoContent=204]="NoContent",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.Conflict=409]="Conflict",e[e.InternalServer=500]="InternalServer"}(oi||(oi={}));var ci=function(e){var t=e;return!!(t.successResponse||t.errorResponse||t.noResponse)},si=function(e,t){var n=e.success,r=e.error,i=e.always,o=t;window.setTimeout((function(){o.noResponse||(o.successResponse?n(o.successResponse(),{status:oi.Ok,getResponseHeader:function(e){return""}}):o.errorResponse&&r(o.errorResponse()),i())}),function(e){var t=e.timeout||300;return t/2+(Math.floor(Math.random()*t/2)+1)}(t))},ui=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 li(e){var t=e.fetchData,n=e.bootstrappedData,r=e.defaultExpiryTime,i=Object.freeze({key:null,url:null,type:Cr.GET,normalize:!0,formatData:function(e){return e},expiryTime:r});return function(e){return function(r){return function(o){if(o.type===jr.API_REQUEST){var a=e.getState(),c=Object.assign({},i,o.request),s=c.success,u=c.error,l=c.always,f=c.formatData,p=ui(c,["success","error","always","formatData"]),d=a.flightData.resources[p.key];if(r(o),!d||d.status!==Or.Fetching){if(p.bootstrapName&&n[o.request.bootstrapName])return h(n[o.request.bootstrapName]),y(),void delete n[o.request.bootstrapName];var m={resource:p.url,type:p.type,data:p.data,success:h,error:function(t){e.dispatch({type:jr.API_ERROR,errorResponse:t.responseJSON,request:o.request,timestamp:Jr.currentTimestamp(),xhr:t}),p.invalidationKeys&&e.dispatch({type:jr.INVALIDATE,keys:p.invalidationKeys,request:p});u&&u(t)},always:y};return void(ci(p)?si(m,p):t(m))}}else r(o);function h(t,n){var r=f(t),i={result:r,entities:{}};(p.normalize&&(i=Nr(r,p.normalizeOptions)),e.dispatch({type:jr.API_REPONSE,result:i.result,entities:i.entities,request:p,timestamp:Jr.currentTimestamp(),xhr:n}),p.updateState)&&(Array.isArray(p.updateState)?p.updateState:[p.updateState]).forEach((function(t){var n,r,i,o;n=t,r=ai(a.flightData,n.keys),i=Object.assign({},Object.keys(a.flightData.resources).filter((function(e){return r[e]})).reduce((function(e,t){var n=a.flightData.resources[t],r=n.response;return n.request.normalize&&(r=Ur(n.response,a.flightData.entities)),e[t]=r,e}),{})),o=n.updateData(i),Object.keys(o).forEach((function(t){var n=a.flightData.resources[t],r=o[t],i={result:r,entities:{}};n.request.normalize&&(i=Nr(r,n.request.normalizeOptions)),e.dispatch({type:jr.UPDATE,result:i.result,entities:i.entities,request:n.request})}))}));if(p.invalidationKeys&&e.dispatch({type:jr.INVALIDATE,keys:p.invalidationKeys,request:p}),s){var o=i.result;p.normalize&&(o=Ur(i.result,Object.assign(Object.assign({},a.flightData.entities),i.entities))),s(o)}}function y(){l&&l()}}}}}function fi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pi(e,t){var n=Object.assign({},e);return Object.keys(t).forEach((function(r){e[r]?n[r]=Object.assign(Object.assign({},e[r]),t[r]):n[r]=t[r]})),n}function di(e,t){var n=e.resources[t.request.key];return{entities:Object.assign({},e.entities),resources:Object.assign(Object.assign({},e.resources),fi({},t.request.key,{request:t.request,status:Or.Fetching,response:n?n.response:null,entityIds:n?n.entityIds:null}))}}function mi(e,t){var n,r=t.entities?Object.keys(t.entities):[];return{entities:pi(e.entities,t.entities),resources:Object.assign(Object.assign({},e.resources),fi({},t.request.key,{request:t.request,status:Or.Success,response:t.result,timestamp:t.timestamp,statusCode:null===(n=t.xhr)||void 0===n?void 0:n.status,entityIds:r}))}}function hi(e,t){var n;return{entities:Object.assign({},e.entities),resources:Object.assign(Object.assign({},e.resources),fi({},t.request.key,{request:t.request,status:Or.Error,errorResponse:t.errorResponse,timestamp:t.timestamp,statusCode:null===(n=t.xhr)||void 0===n?void 0:n.status}))}}function yi(e,t){var n,r=ai(e,t.keys,null===(n=t.request)||void 0===n?void 0:n.key);return{entities:Object.assign({},e.entities),resources:Object.assign(Object.assign({},e.resources),Object.keys(e.resources).filter((function(e){return r[e]})).reduce((function(t,n){var r=e.resources[n];return t[n]=Object.assign({},r,{status:Or.None}),t}),{}))}}function vi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bi,t=arguments.length>1?arguments[1]:void 0,n=t.entities?Object.keys(t.entities):[];return{entities:pi(e.entities,t.entities),resources:Object.assign(Object.assign({},e.resources),fi({},t.request.key,Object.assign(Object.assign({},e.resources[t.request.key]),{request:t.request,response:t.result,entityIds:n})))}}var bi={resources:{},entities:{}};function gi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bi,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case jr.API_REQUEST:return di(e,t);case jr.API_REPONSE:return mi(e,t);case jr.API_ERROR:return hi(e,t);case jr.INVALIDATE:return yi(e,t);case jr.UPDATE:return vi(e,t)}return e}function Si(e){return function(e){if(Array.isArray(e))return Ei(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 Ei(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 Ei(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 Ei(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 Oi=function(e){return h.first(e)},Ci=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e&&e.length?e.slice():[];return t+1>i.length&&(i=[].concat(Si(i),Si(Array(t+1-i.length).fill(r)))),i.splice(t,1,n),i},Ai=function(e,t,n){var r=e.slice();return r.splice(n,0,r.splice(t,1)[0]),r},ji=function(e,t){return h.groupBy(e,t)},wi=function(){return h.intersection.apply(h,arguments)},Ii=function(e,t){var n=e.indexOf(t);return-1===n?e.push(t):e.splice(n,1),e};var Ti="id";function ki(e,t){return localStorage.setItem(e,JSON.stringify(t)),t}function Li(e){var t=localStorage.getItem(e);return t?JSON.parse(t):null}var _i={getAll:function(e,t){var n=Li(e);return n&&n.length?n:!n&&t?(t.forEach((function(t){return _i.create(e,t)})),Li(e)):[]},get:function(e,t){var n=_i.getAll(e);return n.length?n.find((function(e){return e[Ti]===t})):null},create:function(e,t){var n,r,i,o=_i.getAll(e),a=Object.assign(Object.assign({},t),(n={},r=Ti,i=t[Ti]||(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER)+1).toString(),r in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,n));return o.push(a),ki(e,o),a},update:function(e,t){var n=_i.getAll(e);if(!n.length)return t;var r=n.findIndex((function(e){return e[Ti]===t[Ti]}));return n[r]=t,ki(e,n),t},delete:function(e,t){var n=_i.getAll(e);n.length&&(Array.isArray(t)||(t=[t]),t.forEach((function(e){var t=n.findIndex((function(t){return t[Ti]===e}));n.splice(t,1)})),ki(e,n))},assoc:function(e,t,n,r,i){var o=Array.isArray(i),a=o?i:[i];"string"==typeof Oi(a)&&(a=_i.getAll(r).filter((function(e){return a.includes(e.id)})));var c=a.map((function(e){return e.id?e:_i.create(r,e)})),s=_i.getAll(e);if(s.length){var u=s.find((function(e){return e.id===t}));if(u)return c.forEach((function(e){if(u[n])if(Array.isArray(u[n])){if(u[n].find((function(t){return t.id===e.id})))return;u[n].push(e)}else u[n]=e;else u[n]=o?[e]:e})),ki(e,s=s.map((function(e){return e.id!==u.id?e:u}))),o?c:Oi(c)}},dissoc:function(e,t,n,r){var i=_i.getAll(e);if(i.length){var o=i.find((function(e){return e.id===t}));if(o){var a=o[n];if(a)return Array.isArray(r)||(r=[r]),Array.isArray(a)||(a=[a]),r.forEach((function(e){var t=a.findIndex((function(t){return t.id===e}));a.splice(t,1)})),o[n]=a,ki(e,i=i.map((function(e){return e.id!==o.id?e:o}))),i}}}},Pi=function(e){var t="/api/master/v2/companies";return e?"".concat(t,"?cursor=").concat(e):t},xi=function(e){return"/api/master/v2/objects/".concat(e)},Ni=function(){return"/api/master/v2/companies"},Ri=function(e){return"/api/master/v2/objects/".concat(e)},Di="companies",Mi="company",Ui="update:company",Fi=function(e){return{key:"".concat(Di).concat(e?":".concat(e):""),url:Pi(e)}},Vi=function(e){return{key:"".concat(Mi,":").concat(e),url:xi(e)}},Bi=function(e,t,n){return{key:Mi,url:Ni(),data:e,type:Cr.POST,success:t,error:n,invalidationKeys:[Di]}},zi=function(e,t,n){return{key:"".concat(Ui,":").concat(e),url:Ri(e),data:t,type:Cr.PUT,always:n}},Hi=n(12),qi=n.n(Hi),Ji=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===$i}(e)}(e)};var $i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Ki(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Gi((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Yi(e,t,n){return e.concat(t).map((function(e){return Ki(e,n)}))}function Gi(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Yi,n.isMergeableObject=n.isMergeableObject||Ji;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]=Ki(e[t],n)})),Object.keys(t).forEach((function(i){n.isMergeableObject(t[i])&&e[i]?r[i]=Gi(e[i],t[i],n):r[i]=Ki(t[i],n)})),r}(e,t,n):Ki(t,n)}Gi.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Gi(e,n,t)}),{})};var Wi=Gi,Zi=n(6),Qi=Zi.a.Symbol,Xi=Object.prototype,eo=Xi.hasOwnProperty,to=Xi.toString,no=Qi?Qi.toStringTag:void 0;var ro=function(e){var t=eo.call(e,no),n=e[no];try{e[no]=void 0;var r=!0}catch(e){}var i=to.call(e);return r&&(t?e[no]=n:delete e[no]),i},io=Object.prototype.toString;var oo=function(e){return io.call(e)},ao=Qi?Qi.toStringTag:void 0;var co=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ao&&ao in Object(e)?ro(e):oo(e)};var so=function(e,t){return function(n){return e(t(n))}},uo=so(Object.getPrototypeOf,Object);var lo=function(e){return null!=e&&"object"==typeof e},fo=Function.prototype,po=Object.prototype,mo=fo.toString,ho=po.hasOwnProperty,yo=mo.call(Object);var vo=function(e){if(!lo(e)||"[object Object]"!=co(e))return!1;var t=uo(e);if(null===t)return!0;var n=ho.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&mo.call(n)==yo};var bo=function(){this.__data__=[],this.size=0};var go=function(e,t){return e===t||e!=e&&t!=t};var So=function(e,t){for(var n=e.length;n--;)if(go(e[n][0],t))return n;return-1},Eo=Array.prototype.splice;var Oo=function(e){var t=this.__data__,n=So(t,e);return!(n<0)&&(n==t.length-1?t.pop():Eo.call(t,n,1),--this.size,!0)};var Co=function(e){var t=this.__data__,n=So(t,e);return n<0?void 0:t[n][1]};var Ao=function(e){return So(this.__data__,e)>-1};var jo=function(e,t){var n=this.__data__,r=So(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function wo(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])}}wo.prototype.clear=bo,wo.prototype.delete=Oo,wo.prototype.get=Co,wo.prototype.has=Ao,wo.prototype.set=jo;var Io=wo;var To=function(){this.__data__=new Io,this.size=0};var ko=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var Lo=function(e){return this.__data__.get(e)};var _o=function(e){return this.__data__.has(e)};var Po=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var xo,No=function(e){if(!Po(e))return!1;var t=co(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Ro=Zi.a["__core-js_shared__"],Do=(xo=/[^.]+$/.exec(Ro&&Ro.keys&&Ro.keys.IE_PROTO||""))?"Symbol(src)_1."+xo:"";var Mo=function(e){return!!Do&&Do in e},Uo=Function.prototype.toString;var Fo=function(e){if(null!=e){try{return Uo.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Vo=/^\[object .+?Constructor\]$/,Bo=Function.prototype,zo=Object.prototype,Ho=Bo.toString,qo=zo.hasOwnProperty,Jo=RegExp("^"+Ho.call(qo).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var $o=function(e){return!(!Po(e)||Mo(e))&&(No(e)?Jo:Vo).test(Fo(e))};var Ko=function(e,t){return null==e?void 0:e[t]};var Yo=function(e,t){var n=Ko(e,t);return $o(n)?n:void 0},Go=Yo(Zi.a,"Map"),Wo=Yo(Object,"create");var Zo=function(){this.__data__=Wo?Wo(null):{},this.size=0};var Qo=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Xo=Object.prototype.hasOwnProperty;var ea=function(e){var t=this.__data__;if(Wo){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Xo.call(t,e)?t[e]:void 0},ta=Object.prototype.hasOwnProperty;var na=function(e){var t=this.__data__;return Wo?void 0!==t[e]:ta.call(t,e)};var ra=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Wo&&void 0===t?"__lodash_hash_undefined__":t,this};function ia(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])}}ia.prototype.clear=Zo,ia.prototype.delete=Qo,ia.prototype.get=ea,ia.prototype.has=na,ia.prototype.set=ra;var oa=ia;var aa=function(){this.size=0,this.__data__={hash:new oa,map:new(Go||Io),string:new oa}};var ca=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var sa=function(e,t){var n=e.__data__;return ca(t)?n["string"==typeof t?"string":"hash"]:n.map};var ua=function(e){var t=sa(this,e).delete(e);return this.size-=t?1:0,t};var la=function(e){return sa(this,e).get(e)};var fa=function(e){return sa(this,e).has(e)};var pa=function(e,t){var n=sa(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function da(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])}}da.prototype.clear=aa,da.prototype.delete=ua,da.prototype.get=la,da.prototype.has=fa,da.prototype.set=pa;var ma=da;var ha=function(e,t){var n=this.__data__;if(n instanceof Io){var r=n.__data__;if(!Go||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ma(r)}return n.set(e,t),this.size=n.size,this};function ya(e){var t=this.__data__=new Io(e);this.size=t.size}ya.prototype.clear=To,ya.prototype.delete=ko,ya.prototype.get=Lo,ya.prototype.has=_o,ya.prototype.set=ha;var va=ya;var ba=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},ga=function(){try{var e=Yo(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Sa=function(e,t,n){"__proto__"==t&&ga?ga(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Ea=Object.prototype.hasOwnProperty;var Oa=function(e,t,n){var r=e[t];Ea.call(e,t)&&go(r,n)&&(void 0!==n||t in e)||Sa(e,t,n)};var Ca=function(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var c=t[o],s=r?r(n[c],e[c],c,n,e):void 0;void 0===s&&(s=e[c]),i?Sa(n,c,s):Oa(n,c,s)}return n};var Aa=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var ja=function(e){return lo(e)&&"[object Arguments]"==co(e)},wa=Object.prototype,Ia=wa.hasOwnProperty,Ta=wa.propertyIsEnumerable,ka=ja(function(){return arguments}())?ja:function(e){return lo(e)&&Ia.call(e,"callee")&&!Ta.call(e,"callee")},La=Array.isArray,_a=n(21),Pa=/^(?:0|[1-9]\d*)$/;var xa=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Pa.test(e))&&e>-1&&e%1==0&&e<t};var Na=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ra={};Ra["[object Float32Array]"]=Ra["[object Float64Array]"]=Ra["[object Int8Array]"]=Ra["[object Int16Array]"]=Ra["[object Int32Array]"]=Ra["[object Uint8Array]"]=Ra["[object Uint8ClampedArray]"]=Ra["[object Uint16Array]"]=Ra["[object Uint32Array]"]=!0,Ra["[object Arguments]"]=Ra["[object Array]"]=Ra["[object ArrayBuffer]"]=Ra["[object Boolean]"]=Ra["[object DataView]"]=Ra["[object Date]"]=Ra["[object Error]"]=Ra["[object Function]"]=Ra["[object Map]"]=Ra["[object Number]"]=Ra["[object Object]"]=Ra["[object RegExp]"]=Ra["[object Set]"]=Ra["[object String]"]=Ra["[object WeakMap]"]=!1;var Da=function(e){return lo(e)&&Na(e.length)&&!!Ra[co(e)]};var Ma=function(e){return function(t){return e(t)}},Ua=n(10),Fa=Ua.a&&Ua.a.isTypedArray,Va=Fa?Ma(Fa):Da,Ba=Object.prototype.hasOwnProperty;var za=function(e,t){var n=La(e),r=!n&&ka(e),i=!n&&!r&&Object(_a.a)(e),o=!n&&!r&&!i&&Va(e),a=n||r||i||o,c=a?Aa(e.length,String):[],s=c.length;for(var u in e)!t&&!Ba.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||xa(u,s))||c.push(u);return c},Ha=Object.prototype;var qa=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ha)},Ja=so(Object.keys,Object),$a=Object.prototype.hasOwnProperty;var Ka=function(e){if(!qa(e))return Ja(e);var t=[];for(var n in Object(e))$a.call(e,n)&&"constructor"!=n&&t.push(n);return t};var Ya=function(e){return null!=e&&Na(e.length)&&!No(e)};var Ga=function(e){return Ya(e)?za(e):Ka(e)};var Wa=function(e,t){return e&&Ca(t,Ga(t),e)};var Za=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},Qa=Object.prototype.hasOwnProperty;var Xa=function(e){if(!Po(e))return Za(e);var t=qa(e),n=[];for(var r in e)("constructor"!=r||!t&&Qa.call(e,r))&&n.push(r);return n};var ec=function(e){return Ya(e)?za(e,!0):Xa(e)};var tc=function(e,t){return e&&Ca(t,ec(t),e)},nc=n(132);var rc=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var ic=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o};var oc=function(){return[]},ac=Object.prototype.propertyIsEnumerable,cc=Object.getOwnPropertySymbols,sc=cc?function(e){return null==e?[]:(e=Object(e),ic(cc(e),(function(t){return ac.call(e,t)})))}:oc;var uc=function(e,t){return Ca(e,sc(e),t)};var lc=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},fc=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)lc(t,sc(e)),e=uo(e);return t}:oc;var pc=function(e,t){return Ca(e,fc(e),t)};var dc=function(e,t,n){var r=t(e);return La(e)?r:lc(r,n(e))};var mc=function(e){return dc(e,Ga,sc)};var hc=function(e){return dc(e,ec,fc)},yc=Yo(Zi.a,"DataView"),vc=Yo(Zi.a,"Promise"),bc=Yo(Zi.a,"Set"),gc=Yo(Zi.a,"WeakMap"),Sc=Fo(yc),Ec=Fo(Go),Oc=Fo(vc),Cc=Fo(bc),Ac=Fo(gc),jc=co;(yc&&"[object DataView]"!=jc(new yc(new ArrayBuffer(1)))||Go&&"[object Map]"!=jc(new Go)||vc&&"[object Promise]"!=jc(vc.resolve())||bc&&"[object Set]"!=jc(new bc)||gc&&"[object WeakMap]"!=jc(new gc))&&(jc=function(e){var t=co(e),n="[object Object]"==t?e.constructor:void 0,r=n?Fo(n):"";if(r)switch(r){case Sc:return"[object DataView]";case Ec:return"[object Map]";case Oc:return"[object Promise]";case Cc:return"[object Set]";case Ac:return"[object WeakMap]"}return t});var wc=jc,Ic=Object.prototype.hasOwnProperty;var Tc=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ic.call(e,"index")&&(n.index=e.index,n.input=e.input),n},kc=Zi.a.Uint8Array;var Lc=function(e){var t=new e.constructor(e.byteLength);return new kc(t).set(new kc(e)),t};var _c=function(e,t){var n=t?Lc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},Pc=/\w*$/;var xc=function(e){var t=new e.constructor(e.source,Pc.exec(e));return t.lastIndex=e.lastIndex,t},Nc=Qi?Qi.prototype:void 0,Rc=Nc?Nc.valueOf:void 0;var Dc=function(e){return Rc?Object(Rc.call(e)):{}};var Mc=function(e,t){var n=t?Lc(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var Uc=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return Lc(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return _c(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 Mc(e,n);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return xc(e);case"[object Set]":return new r;case"[object Symbol]":return Dc(e)}},Fc=Object.create,Vc=function(){function e(){}return function(t){if(!Po(t))return{};if(Fc)return Fc(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var Bc=function(e){return"function"!=typeof e.constructor||qa(e)?{}:Vc(uo(e))};var zc=function(e){return lo(e)&&"[object Map]"==wc(e)},Hc=Ua.a&&Ua.a.isMap,qc=Hc?Ma(Hc):zc;var Jc=function(e){return lo(e)&&"[object Set]"==wc(e)},$c=Ua.a&&Ua.a.isSet,Kc=$c?Ma($c):Jc,Yc={};Yc["[object Arguments]"]=Yc["[object Array]"]=Yc["[object ArrayBuffer]"]=Yc["[object DataView]"]=Yc["[object Boolean]"]=Yc["[object Date]"]=Yc["[object Float32Array]"]=Yc["[object Float64Array]"]=Yc["[object Int8Array]"]=Yc["[object Int16Array]"]=Yc["[object Int32Array]"]=Yc["[object Map]"]=Yc["[object Number]"]=Yc["[object Object]"]=Yc["[object RegExp]"]=Yc["[object Set]"]=Yc["[object String]"]=Yc["[object Symbol]"]=Yc["[object Uint8Array]"]=Yc["[object Uint8ClampedArray]"]=Yc["[object Uint16Array]"]=Yc["[object Uint32Array]"]=!0,Yc["[object Error]"]=Yc["[object Function]"]=Yc["[object WeakMap]"]=!1;var Gc=function e(t,n,r,i,o,a){var c,s=1&n,u=2&n,l=4&n;if(r&&(c=o?r(t,i,o,a):r(t)),void 0!==c)return c;if(!Po(t))return t;var f=La(t);if(f){if(c=Tc(t),!s)return rc(t,c)}else{var p=wc(t),d="[object Function]"==p||"[object GeneratorFunction]"==p;if(Object(_a.a)(t))return Object(nc.a)(t,s);if("[object Object]"==p||"[object Arguments]"==p||d&&!o){if(c=u||d?{}:Bc(t),!s)return u?pc(t,tc(c,t)):uc(t,Wa(c,t))}else{if(!Yc[p])return o?t:{};c=Uc(t,p,s)}}a||(a=new va);var m=a.get(t);if(m)return m;a.set(t,c),Kc(t)?t.forEach((function(i){c.add(e(i,n,r,i,t,a))})):qc(t)&&t.forEach((function(i,o){c.set(o,e(i,n,r,o,t,a))}));var h=l?u?hc:mc:u?keysIn:Ga,y=f?void 0:h(t);return ba(y||t,(function(i,o){y&&(i=t[o=i]),Oa(c,o,e(i,n,r,o,t,a))})),c};var Wc=function(e){return Gc(e,4)};var Zc=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 Qc=function(e){return"symbol"==typeof e||lo(e)&&"[object Symbol]"==co(e)};function Xc(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],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Xc.Cache||ma),n}Xc.Cache=ma;var es=Xc;var ts=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ns=/\\(\\)?/g,rs=function(e){var t=es(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(ts,(function(e,n,r,i){t.push(r?i.replace(ns,"$1"):n||e)})),t}));var is=function(e){if("string"==typeof e||Qc(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},os=Qi?Qi.prototype:void 0,as=os?os.toString:void 0;var cs=function e(t){if("string"==typeof t)return t;if(La(t))return Zc(t,e)+"";if(Qc(t))return as?as.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var ss=function(e){return null==e?"":cs(e)};var us=function(e){return La(e)?Zc(e,is):Qc(e)?[e]:rc(rs(ss(e)))};var ls=function(e,t){},fs=n(32),ps=n(33),ds=n.n(ps);var ms=function(e){return Gc(e,5)};function hs(){return(hs=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 ys(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function vs(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function bs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var gs=function(e){return"function"==typeof e},Ss=function(e){return null!==e&&"object"==typeof e},Es=function(e){return String(Math.floor(Number(e)))===e},Os=function(e){return"[object String]"===Object.prototype.toString.call(e)},Cs=function(e){return 0===d.Children.count(e)},As=function(e){return Ss(e)&&gs(e.then)};function js(e,t,n,r){void 0===r&&(r=0);for(var i=us(t);e&&r<i.length;)e=e[i[r++]];return void 0===e?n:e}function ws(e,t,n){for(var r=Wc(e),i=r,o=0,a=us(t);o<a.length-1;o++){var c=a[o],s=js(e,a.slice(0,o+1));if(s&&(Ss(s)||Array.isArray(s)))i=i[c]=Wc(s);else{var u=a[o+1];i=i[c]=Es(u)&&Number(u)>=0?[]:{}}}return(0===o?e:i)[a[o]]===n?e:(void 0===n?delete i[a[o]]:i[a[o]]=n,0===o&&void 0===n&&delete r[a[o]],r)}function Is(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var i=0,o=Object.keys(e);i<o.length;i++){var a=o[i],c=e[a];Ss(c)?n.get(c)||(n.set(c,!0),r[a]=Array.isArray(c)?[]:{},Is(c,t,n,r[a])):r[a]=t}return r}var Ts=Object(d.createContext)(void 0),ks=Ts.Provider,Ls=Ts.Consumer;function _s(){var e=Object(d.useContext)(Ts);return e||ls(!1),e}function Ps(e,t){switch(t.type){case"SET_VALUES":return hs({},e,{values:t.payload});case"SET_TOUCHED":return hs({},e,{touched:t.payload});case"SET_ERRORS":return hs({},e,{errors:t.payload});case"SET_STATUS":return hs({},e,{status:t.payload});case"SET_ISSUBMITTING":return hs({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return hs({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return hs({},e,{values:ws(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return hs({},e,{touched:ws(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return hs({},e,{errors:ws(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return hs({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return hs({},e,{touched:Is(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":case"SUBMIT_SUCCESS":return hs({},e,{isSubmitting:!1});default:return e}}var xs={},Ns={};function Rs(e){var t=e.validateOnChange,n=void 0===t||t,r=e.validateOnBlur,i=void 0===r||r,o=e.validateOnMount,a=void 0!==o&&o,c=e.isInitialValid,s=e.enableReinitialize,u=void 0!==s&&s,l=e.onSubmit,f=vs(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),p=hs({validateOnChange:n,validateOnBlur:i,validateOnMount:a,onSubmit:l},f),m=Object(d.useRef)(p.initialValues),h=Object(d.useRef)(p.initialErrors||xs),y=Object(d.useRef)(p.initialTouched||Ns),v=Object(d.useRef)(p.initialStatus),b=Object(d.useRef)(!1),g=Object(d.useRef)({});Object(d.useEffect)((function(){0}),[]),Object(d.useEffect)((function(){return b.current=!0,function(){b.current=!1}}),[]);var S=Object(d.useReducer)(Ps,{values:p.initialValues,errors:p.initialErrors||xs,touched:p.initialTouched||Ns,status:p.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),E=S[0],O=S[1],C=Object(d.useCallback)((function(e,t){return new Promise((function(n,r){var i=p.validate(e,t);null==i?n(xs):As(i)?i.then((function(e){n(e||xs)}),(function(e){r(e)})):n(i)}))}),[p.validate]),A=Object(d.useCallback)((function(e,t){var n=p.validationSchema,r=gs(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)||vo(t)?e(t):""!==t?t:void 0})):vo(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(xs)}),(function(n){"ValidationError"===n.name?e(function(e){var t={};if(e.inner){if(0===e.inner.length)return ws(t,e.path,e.message);var n=e.inner,r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if((i=n.next()).done)break;o=i.value}var a=o;js(t,a.path)||(t=ws(t,a.path,a.message))}}return t}(n)):t(n)}))}))}),[p.validationSchema]),j=Object(d.useCallback)((function(e,t){return new Promise((function(n){return n(g.current[e].validate(t))}))}),[]),w=Object(d.useCallback)((function(e){var t=Object.keys(g.current).filter((function(e){return gs(g.current[e].validate)})),n=t.length>0?t.map((function(t){return j(t,js(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=ws(e,t[r],n)),e}),{})}))}),[j]),I=Object(d.useCallback)((function(e){return Promise.all([w(e),p.validationSchema?A(e):{},p.validate?C(e):{}]).then((function(e){var t=e[0],n=e[1],r=e[2];return Wi.all([t,n,r],{arrayMerge:Ms})}))}),[p.validate,p.validationSchema,w,C,A]),T=Fs((function(e){return void 0===e&&(e=E.values),Object(fs.unstable_runWithPriority)(fs.LowPriority,(function(){return I(e).then((function(e){return b.current&&O({type:"SET_ERRORS",payload:e}),e}))}))})),k=Fs((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}),qi()(E.errors,e)||O({type:"SET_ERRORS",payload:e})),e}))}));Object(d.useEffect)((function(){a&&!0===b.current&&T(p.initialValues)}),[p.initialValues,a,T]);var L=Object(d.useCallback)((function(e){var t=e&&e.values?e.values:m.current,n=e&&e.errors?e.errors:h.current?h.current:p.initialErrors||{},r=e&&e.touched?e.touched:y.current?y.current:p.initialTouched||{},i=e&&e.status?e.status:v.current?v.current:p.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}})}),[p.initialErrors,p.initialStatus,p.initialTouched]);Object(d.useEffect)((function(){u&&!0===b.current&&!qi()(m.current,p.initialValues)&&(m.current=p.initialValues,L())}),[u,p.initialValues,L]),Object(d.useEffect)((function(){u&&!0===b.current&&!qi()(h.current,p.initialErrors)&&(h.current=p.initialErrors||xs,O({type:"SET_ERRORS",payload:p.initialErrors||xs}))}),[u,p.initialErrors]),Object(d.useEffect)((function(){u&&!0===b.current&&!qi()(y.current,p.initialTouched)&&(y.current=p.initialTouched||Ns,O({type:"SET_TOUCHED",payload:p.initialTouched||Ns}))}),[u,p.initialTouched]),Object(d.useEffect)((function(){u&&!0===b.current&&!qi()(v.current,p.initialStatus)&&(v.current=p.initialStatus,O({type:"SET_STATUS",payload:p.initialStatus}))}),[u,p.initialStatus,p.initialTouched]);var _=Fs((function(e){if(gs(g.current[e].validate)){var t=js(E.values,e),n=g.current[e].validate(t);return As(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(d.useCallback)((function(e,t){var n=t.validate;g.current[e]={validate:n}}),[]),x=Object(d.useCallback)((function(e){delete g.current[e]}),[]),N=Fs((function(e){return O({type:"SET_TOUCHED",payload:e}),i?T(E.values):Promise.resolve()})),R=Object(d.useCallback)((function(e){O({type:"SET_ERRORS",payload:e})}),[]),D=Fs((function(e){return O({type:"SET_VALUES",payload:e}),n?T(e):Promise.resolve()})),M=Object(d.useCallback)((function(e,t){O({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),U=Fs((function(e,t,r){return void 0===r&&(r=!0),O({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),n&&r?T(ws(E.values,e,t)):Promise.resolve()})),F=Object(d.useCallback)((function(e,t){var n,r=t,i=e;if(!Os(e)){e.persist&&e.persist();var o=e.target,a=o.type,c=o.name,s=o.id,u=o.value,l=o.checked,f=(o.outerHTML,o.options),p=o.multiple;r=t||(c||s),i=/number|range/.test(a)?(n=parseFloat(u),isNaN(n)?"":n):/checkbox/.test(a)?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))}(js(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(d.useCallback)((function(e){if(Os(e))return function(t){return F(t,e)};F(e)}),[F]),B=Fs((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?T(E.values):Promise.resolve()})),z=Object(d.useCallback)((function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,i=n.id,o=(n.outerHTML,t||(r||i));B(o,!0)}),[B]),H=Object(d.useCallback)((function(e){if(Os(e))return function(t){return z(t,e)};z(e)}),[z]),q=Object(d.useCallback)((function(e){gs(e)?O({type:"SET_FORMIK_STATE",payload:e}):O({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),J=Object(d.useCallback)((function(e){O({type:"SET_STATUS",payload:e})}),[]),$=Object(d.useCallback)((function(e){O({type:"SET_ISSUBMITTING",payload:e})}),[]),K={resetForm:L,validateForm:k,validateField:_,setErrors:R,setFieldError:M,setFieldTouched:B,setFieldValue:U,setStatus:J,setSubmitting:$,setTouched:N,setValues:D,setFormikState:q},Y=Fs((function(){return l(E.values,K)})),G=Fs((function(){return O({type:"SUBMIT_ATTEMPT"}),k().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=Fs((function(e){e&&e.preventDefault&&gs(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&gs(e.stopPropagation)&&e.stopPropagation(),G()})),Z=Fs((function(e){if(e&&e.preventDefault&&gs(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&gs(e.stopPropagation)&&e.stopPropagation(),p.onReset){var t=p.onReset(E.values,K);As(t)?t.then(L):L()}else L()})),Q=Object(d.useCallback)((function(e){return{value:js(E.values,e),error:js(E.errors,e),touched:!!js(E.touched,e),initialValue:js(m.current,e),initialTouched:!!js(y.current,e),initialError:js(h.current,e)}}),[E.errors,E.touched,E.values]),X=Object(d.useCallback)((function(e){var t=Ss(e),n=t?e.name:e,r=js(E.values,n),i={name:n,value:r,onChange:V,onBlur:H};if(t){var o=e.type,a=e.value,c=e.as,s=e.multiple;"checkbox"===o?void 0===a?i.checked=!!r:(i.checked=!(!Array.isArray(r)||!~r.indexOf(a)),i.value=a):"radio"===o?(i.checked=r===a,i.value=a):"select"===c&&s&&(i.value=i.value||[],i.multiple=!0)}return i}),[H,V,E.values]),ee=Object(d.useMemo)((function(){return!qi()(m.current,E.values)}),[E.values]),te=Object(d.useMemo)((function(){return void 0!==c?ee?E.errors&&0===Object.keys(E.errors).length:!1!==c&&gs(c)?c(p):c:E.errors&&0===Object.keys(E.errors).length}),[c,ee,E.errors,p]);return hs({},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:k,validateField:_,isValid:te,dirty:ee,unregisterField:x,registerField:P,getFieldProps:X,getFieldMeta:Q,validateOnBlur:i,validateOnChange:n,validateOnMount:a})}function Ds(e){var t=Rs(e),n=e.component,r=e.children,i=e.render;return Object(d.useEffect)((function(){0}),[]),Object(d.createElement)(ks,{value:t},n?Object(d.createElement)(n,t):i?i(t):r?gs(r)?r(t):Cs(r)?null:d.Children.only(r):null)}function Ms(e,t,n){var r=e.slice();return t.forEach((function(t,i){if(void 0===r[i]){var o=!1!==n.clone&&n.isMergeableObject(t);r[i]=o?Wi(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[i]=Wi(e[i],t,n):-1===e.indexOf(t)&&r.push(t)})),r}var Us="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?d.useLayoutEffect:d.useEffect;function Fs(e){var t=Object(d.useRef)(e);return Us((function(){t.current=e})),Object(d.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 Vs(e){var t=e.validate,n=e.name,r=e.render,i=e.children,o=e.as,a=e.component,c=vs(e,["validate","name","render","children","as","component"]),s=_s(),u=(s.validate,s.validationSchema,vs(s,["validate","validationSchema"]));Object(d.useEffect)((function(){0}),[]);var l=u.registerField,f=u.unregisterField;Object(d.useEffect)((function(){return l(n,{validate:t}),function(){f(n)}}),[l,f,n,t]);var p=u.getFieldProps(hs({name:n},c)),m=u.getFieldMeta(n),h={field:p,form:u};if(r)return r(hs({},h,{meta:m}));if(gs(i))return i(hs({},h,{meta:m}));if(a){if("string"==typeof a){var y=c.innerRef,v=vs(c,["innerRef"]);return Object(d.createElement)(a,hs({ref:y},p,v),i)}return Object(d.createElement)(a,hs({field:p,form:u},c),i)}var b=o||"input";if("string"==typeof b){var g=c.innerRef,S=vs(c,["innerRef"]);return Object(d.createElement)(b,hs({ref:g},p,S),i)}return Object(d.createElement)(b,hs({},p,c),i)}var Bs=Object(d.forwardRef)((function(e,t){var n=e.action,r=vs(e,["action"]),i=n||"#",o=_s(),a=o.handleReset,c=o.handleSubmit;return Object(d.createElement)("form",Object.assign({onSubmit:c,ref:t,onReset:a,action:i},r))}));function zs(e){var t=function(t){return Object(d.createElement)(Ls,null,(function(n){return n||ls(!1),Object(d.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+")",ds()(t,e)}Bs.displayName="Form";var Hs=function(e,t,n){var r=qs(e);return r.splice(t,0,n),r},qs=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(hs({},e,{length:t+1}))}return[]},Js=function(e){function t(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var i=n.props,o=i.name,a=i.validateOnChange,c=i.formik,s=c.setFormikState,u=c.validateForm;s((function(n){var i="function"==typeof r?r:e,a="function"==typeof t?t:e;return hs({},n,{values:ws(n.values,o,e(js(n.values,o))),errors:r?ws(n.errors,o,i(js(n.errors,o))):n.errors,touched:t?ws(n.touched,o,a(js(n.touched,o))):n.touched})}),(function(){a&&u()}))},n.push=function(e){return n.updateArrayField((function(t){return[].concat(qs(t),[ms(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=qs(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=qs(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 Hs(n,e,t)}),(function(t){return Hs(t,e,null)}),(function(t){return Hs(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=qs(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(bs(n)),n.pop=n.pop.bind(bs(n)),n}ys(t,e);var n=t.prototype;return n.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?qs(n):[];return t||(t=r[e]),gs(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,o=t.name,a=t.formik,c=(a.validate,a.validationSchema,hs({},e,{form:vs(a,["validate","validationSchema"]),name:o}));return n?Object(d.createElement)(n,c):r?r(c):i?"function"==typeof i?i(c):Cs(i)?null:d.Children.only(i):null},t}(d.Component);Js.defaultProps={validateOnChange:!0};var $s=zs(function(e){function t(){return e.apply(this,arguments)||this}ys(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e){return js(this.props.formik.errors,this.props.name)!==js(e.formik.errors,this.props.name)||js(this.props.formik.touched,this.props.name)!==js(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,o=e.name,a=vs(e,["component","formik","render","children","name"]),c=js(n.touched,o),s=js(n.errors,o);return c&&s?r?gs(r)?r(s):null:i?gs(i)?i(s):null:t?Object(d.createElement)(t,a,s):s:null},t}(d.Component));(function(e){function t(t){var n;n=e.call(this,t)||this;var r=t.render,i=t.children,o=t.component,a=t.as;t.name;return r&&ls(!1),o&&r&&ls(!1),a&&i&&gs(i)&&ls(!1),o&&i&&gs(i)&&ls(!1),r&&i&&!Cs(i)&&ls(!1),n}ys(t,e);var n=t.prototype;return n.shouldComponentUpdate=function(e,t,n){return this.props.shouldUpdate?this.props.shouldUpdate(e,this.props):js(this.context.values,this.props.name)!==js(n.values,this.props.name)||js(this.context.errors,this.props.name)!==js(n.errors,this.props.name)||js(this.context.touched,this.props.name)!==js(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,o=e.component,a=(e.shouldUpdate,vs(e,["validate","name","render","as","children","component","shouldUpdate"])),c=this.context,s=(c.validate,c.validationSchema,vs(c,["validate","validationSchema"])),u={value:"radio"===a.type||"checkbox"===a.type?a.value:js(c.values,t),name:t,onChange:c.handleChange,onBlur:c.handleBlur},l={field:u,meta:{value:js(c.values,t),error:js(c.errors,t),touched:!!js(c.touched,t),initialValue:js(c.initialValues,t),initialTouched:!!js(c.initialTouched,t),initialError:js(c.initialErrors,t)},form:s};if(n)return n(l);if(gs(i))return i(l);if(o){if("string"==typeof o){var f=a.innerRef,p=vs(a,["innerRef"]);return Object(d.createElement)(o,hs({ref:f},u,p),i)}return Object(d.createElement)(o,hs({field:u,form:c},a),i)}var m=r||"input";if("string"==typeof m){var h=a.innerRef,y=vs(a,["innerRef"]);return Object(d.createElement)(m,hs({ref:h},u,y),i)}return Object(d.createElement)(m,hs({},u,a),i)},t}(d.Component)).contextType=Ts;var Ks=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 Ys(e){var t=e.castInitialValues,n=e.castValuesOnSubmit,r=e.initialValues,i=e.onSubmit,o=e.resetOnSubmit,a=Ks(e,["castInitialValues","castValuesOnSubmit","initialValues","onSubmit","resetOnSubmit"]),c=t&&e.validationSchema?e.validationSchema.cast(function e(t){var n=Rr.deepClone(t);return Object.keys(n).forEach((function(t){n.hasOwnProperty(t)&&(Rr.isObject(n[t])?n[t]=e(n[t]):null===n[t]&&delete n[t])})),n}(r)):r,s={allowInitialSubmit:e.allowInitialSubmit};return d.createElement(Ds,Object.assign({enableReinitialize:!0},a,{initialValues:c,onSubmit:function(t,r){var a=r.setSubmitting,c=r.resetForm,s=n&&e.validationSchema?e.validationSchema.cast(t):t;i(s,(function(){o&&c(),a(!1)}))},initialStatus:s}),hn(e.children)?function(t){return e.children(t)}:d.Children.count(e.children)?e.children:null)}Ys.defaultProps={castInitialValues:!0,castValuesOnSubmit:!0};var Gs=n(2),Ws=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown(),Zs=n(3),Qs=function(e,t,n,r){var i="form-control";return js(t,n)&&js(e,n)&&(i+=" is-invalid"),r&&(i+=" ".concat(r)),i};function Xs(e){var t=_s().values[e.fieldName];return"string"!=typeof t?d.createElement(d.Fragment,null):d.createElement("div",{className:"float-right text-muted"},t.length,"/",e.limit)}var eu=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 tu(e){var t=e.label,n=eu(e,["label"]);return d.createElement(Zs.Form.Group,null,d.createElement("div",{className:"custom-control custom-checkbox"},d.createElement(ru,Object.assign({className:"custom-control-input"},n)),d.createElement(Zs.Form.Label,{className:"custom-control-label",htmlFor:n.id},t)))}var nu=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 ru(e){var t=e.children,n=nu(e,["children"]);return d.createElement(Vs,Object.assign({},n),hn(t)?function(e){return t(e)}:d.Children.count(t)?t:null)}function iu(e){var t=e.label,n=e.className,r=e.showCharacterCounter,i=nu(e,["label","className","showCharacterCounter"]),o=_s(),a=o.errors,c=o.touched;return"checkbox"===i.type?d.createElement(tu,Object.assign({},e)):d.createElement(Zs.Form.Group,null,!!t&&d.createElement(Zs.Form.Label,{htmlFor:i.id},t),d.createElement(ru,Object.assign({className:Qs(a,c,i.name,n)},i)),!!r&&!!i.maxLength&&d.createElement(Xs,{fieldName:i.name,limit:i.maxLength}),d.createElement($s,{name:i.name},(function(e){return d.createElement(Zs.Form.Control.Feedback,{type:"invalid"},e)})))}function ou(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return au(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 au(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 au(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 cu(e){var t,n=ou(d.useState(!1),2),r=n[0],i=n[1];return d.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]),d.useEffect((function(){e.isSubmitting&&i(!1)}),[e.isSubmitting]),r}function su(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return uu(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 uu(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 uu(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 lu=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 fu(e){var t=e.showSpinner,n=e.children,r=lu(e,["showSpinner","children"]),i=d.useRef(),o=su(d.useState({}),2),a=o[0],c=o[1];return d.useEffect((function(){var e=a.width,t=a.height;if(!e||!t){var n=i.current,r=n.offsetHeight,o=n.offsetWidth;r&&o&&c({width:o,height:r})}})),d.useEffect((function(){var e=a.width,t=a.height;if(e&&t){var n=i.current;n.style.width="".concat(e+1,"px"),n.style.height="".concat(t+1,"px")}}),[a]),d.createElement(Zs.Button,Object.assign({ref:i,disabled:t},r),t?d.createElement(Zs.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):n)}var pu=n(133),du=n(22),mu="AlertService",hu="LanguageService";function yu(e){return(yu="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 vu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bu(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 gu(e,t){return(gu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Su(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ou(e);if(t){var i=Ou(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Eu(this,n)}}function Eu(e,t){return!t||"object"!==yu(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 Ou(e){return(Ou=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Cu=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&&gu(e,t)}(o,e);var t,n,r,i=Su(o);function o(){return vu(this,o),i.apply(this,arguments)}return t=o,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"setConfig",value:function(e){this.polyglot=new pu({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||K.throw(new Xe("LanguageService config must be set.")),!this.polyglot.has(r)){if(!L.isDevelopment){var i=window.trackJs;return i&&i.console.error("No phrase set for ".concat(r," in language config")),""}K.throw(new Xe("No phrase set for ".concat(r," in language config.")))}if(!n||h.isEmpty(n)){var o=this.cache[r];if(o)return o;var a=this.polyglot.t(r);return this.cache[r]=a,a}var c=h.omit(n,"smartCount"),s={};for(var u in c)s[u]=du.sanitize(c[u]);h.isNumber(n.smartCount)&&(s.smart_count=n.smartCount);var l="".concat(r,":").concat(h.values(Object.assign({},s)).join(":")),f=this.cache[l];if(f)return f;var p=this.polyglot.t(r,s);return this.cache[l]=p,p}},{key:"encloseNamespace",value:function(e){var t=this;return function(n,r){return t.getPhrase(e,n,r)}}},{key:"name",get:function(){return hu}}])&&bu(t.prototype,n),r&&bu(t,r),o}(Yt).Instance,Au=d.createContext(""),ju=d.memo((function(e){var t=e.phrase,n=e.namespace,r=e.options,i=d.useContext(Au),o=n||i,a=Cu.getPhrase(o,t,r);return d.createElement("span",{dangerouslySetInnerHTML:{__html:a}})}),(function(e,t){return e.namespace===t.namespace&&e.phrase===t.phrase&&Rr.isEqual(e.options,t.options)}));function wu(e){var t=_s(),n=cu(t);d.useEffect((function(){function e(e){13===e.keyCode&&n&&t.validateForm().then((function(e){Object.keys(e).length||t.submitForm()}))}return window.addEventListener("keypress",e),function(){return window.removeEventListener("keypress",e)}}),[n]);var r="save";return e.isNew&&(r="create"),e.hasNext&&(r="next"),d.createElement(fu,{variant:e.variant||"primary",showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.submitText?d.createElement(d.Fragment,null,e.submitText):d.createElement(ju,{namespace:"shared.formButtons",phrase:r}))}function Iu(e){var t=_s();return d.createElement(Bs,null,d.createElement(iu,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this company",autoFocus:!0}),d.createElement(wu,{isNew:e.isNew}))}function Tu(e){return d.createElement(Ys,{initialValues:e.company,validationSchema:Ws,onSubmit:e.saveCompany},d.createElement(Iu,{isNew:!(e.company&&e.company.id)}))}function ku(e){var t=Object(bn.useDispatch)(),n=i.useBasicFetch(Vi(e.id));return d.createElement(d.Fragment,null,!!n.data&&d.createElement(Tu,{company:n.data,saveCompany:function(n,r){return i.fetch(t,zi(e.id,n,r))}}))}function Lu(){var e=Object(bn.useDispatch)();return d.createElement(Tu,{saveCompany:function(t,n){i.fetch(e,Bi(t,(function(e){n(),r.AppLinkHelper.trigger({application:l.PEOPLE,action:a.Companies.EDIT_COMPANY,args:[e.id]})}),n))}})}var _u,Pu=n(134);function xu(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Nu(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 Nu(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 Nu(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 Ru(e){return(Ru="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)"}(_u||(_u={}));var Du,Mu={isNumber:function(e){return Mu.isType(e,"number")},isString:function(e){return Mu.isType(e,"string")},isType:function(e,t){return Ru(e)===t}},Uu=n(14),Fu=n.n(Uu);function Vu(e){return function(e){if(Array.isArray(e))return Bu(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 Bu(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 Bu(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 Bu(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}function Hu(e,t){return Rr.isObject(e)&&e.hasOwnProperty(t)&&Mu.isString(e[t])}function qu(e,t,n){return function(r){var o=r.value;if(o.length||n(),!(o.length<e.activationLength)){if(e.local){var a=hn(e.getLocalSuggestions)?e.getLocalSuggestions(o,e.local):(c=o,s=e.local,u=e.valueKey,(l=c.trim().toLowerCase()).length?s.filter((function(e){return!(!Hu(e,u)||!Mu.isString(e[u]))&&e[u].trim().toLowerCase().includes(l)})):[]);t((function(e){return Object.assign(Object.assign({},e),zu({},Du.Local,a))}))}var c,s,u,l;e.getRemoteUrl&&function(e,t,n){var r=hn(e)&&e(t);r&&i.ajaxRequest({resource:r,type:Cr.GET,success:n,error:function(){}})}(e.getRemoteUrl,o,(function(n){return t((function(t){return Object.assign(Object.assign({},t),zu({},Du.Remote,hn(e.formatRemoteSuggestions)?e.formatRemoteSuggestions(n):n))}))}))}}}function Ju(e,t,n,r,i,o){var a=function(t){return e[t]||[]},c=t?a(Du.Recent):[],s=a(Du.Local),u=a(Du.Remote),l=[];c.length&&l.push({title:n,data:c});var f=[].concat(Vu(s),Vu(u));return Number.isInteger(o)&&l.length>o&&f.slice(0,o),hn(i)?l.push.apply(l,Vu(i(f))):l.push({title:r,data:f}),l}function $u(e){return e.data}function Ku(e){if(e.title)return d.createElement("strong",null,e.title)}!function(e){e.Local="local",e.Recent="recent",e.Remote="remote"}(Du||(Du={}));var Yu={container:"position-relative",suggestionsContainerOpen:"bg-white py-1 border rounded ".concat(Fu.a.suggestionsContainerOpen),suggestionsList:"list-unstyled m-0",suggestion:"cursor-pointer py-1 px-2",suggestionHighlighted:Fu.a.suggestionHighlighted,sectionContainer:"border-bottom py-1 ".concat(Fu.a.sectionContainer)};function Gu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(Yu,e)}var Wu,Zu,Qu=n(15),Xu=n(35),el=n.n(Xu),tl=n(36),nl=n.n(tl),rl=n(37),il=n.n(rl),ol=n(38),al=n.n(ol),cl=(n(39),n(40),n(41)),sl=n.n(cl),ul=n(42),ll=n.n(ul),fl=n(43),pl=n.n(fl),dl=n(44),ml=n.n(dl),hl=n(45),yl=n.n(hl),vl=n(46),bl=n.n(vl),gl=n(47),Sl=n.n(gl),El=n(48),Ol=n.n(El),Cl=n(49),Al=n.n(Cl),jl=n(50),wl=n.n(jl),Il=n(51),Tl=n.n(Il),kl=n(52),Ll=n.n(kl),_l=n(53),Pl=n.n(_l),xl=n(54),Nl=n.n(xl),Rl=n(55),Dl=n.n(Rl),Ml=n(56),Ul=n.n(Ml),Fl=n(57),Vl=n.n(Fl),Bl=n(58),zl=n.n(Bl),Hl=n(59),ql=n.n(Hl),Jl=n(60),$l=n.n(Jl),Kl=n(61),Yl=n.n(Kl),Gl=(n(62),n(63)),Wl=n.n(Gl),Zl=n(64),Ql=n.n(Zl),Xl=n(65),ef=n.n(Xl),tf=(n(66),n(67),n(68)),nf=n.n(tf),rf=n(69),of=n.n(rf),af=n(70),cf=n.n(af),sf=n(71),uf=n.n(sf),lf=n(72),ff=n.n(lf),pf=n(73),df=n.n(pf),mf=(n(74),n(75)),hf=n.n(mf),yf=n(76),vf=n.n(yf),bf=n(77),gf=n.n(bf),Sf=n(78),Ef=n.n(Sf),Of=n(79),Cf=n.n(Of),Af=n(80),jf=n.n(Af),wf=n(81),If=n.n(wf),Tf=(n(82),n(83)),kf=n.n(Tf),Lf=n(84),_f=n.n(Lf),Pf=n(85),xf=n.n(Pf),Nf=n(86),Rf=n.n(Nf),Df=n(87),Mf=n.n(Df),Uf=n(88),Ff=n.n(Uf),Vf=n(89),Bf=n.n(Vf),zf=n(90),Hf=n.n(zf),qf=n(91),Jf=n.n(qf),$f=n(92),Kf=n.n($f),Yf=n(93),Gf=n.n(Yf),Wf=n(94),Zf=n.n(Wf),Qf=n(95),Xf=n.n(Qf),ep=n(96),tp=n.n(ep),np=n(97),rp=n.n(np),ip=n(98),op=n.n(ip),ap=(n(99),n(100),n(101),n(102)),cp=n.n(ap),sp=(n(103),n(104),n(105),n(106),n(107)),up=n.n(sp),lp=n(108),fp=n.n(lp),pp=(n(109),n(110),n(111),n(112)),dp=n.n(pp),mp=n(113),hp=n.n(mp),yp=n(114),vp=n.n(yp),bp=n(115),gp=n.n(bp),Sp=n(116),Ep=n.n(Sp),Op=n(117),Cp=n.n(Op),Ap=n(118),jp=n.n(Ap),wp=(n(119),n(120),n(121),n(122)),Ip=n.n(wp),Tp=n(123),kp=n.n(Tp),Lp=[el.a,il.a,al.a,sl.a,ml.a,yl.a,bl.a,Sl.a,pl.a,nl.a,Ol.a,Al.a,wl.a,Tl.a,Ll.a,ll.a,Pl.a,Nl.a,Dl.a,Ul.a,Yl.a,Vl.a,zl.a,ql.a,$l.a,Wl.a,cf.a,Kf.a,Zf.a,Gf.a,op.a,Xf.a,tp.a,rp.a,Ef.a,jf.a,Cf.a,Ql.a,ef.a,vf.a,gf.a,hf.a,nf.a,uf.a,_f.a,xf.a,ff.a,df.a,Rf.a,of.a,kf.a,Mf.a,Ff.a,If.a,Bf.a,Jf.a,Hf.a,up.a,fp.a,cp.a,vp.a,hp.a,dp.a,gp.a,Cp.a,Ep.a,jp.a,kp.a,Ip.a];function _p(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.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"}(Wu||(Wu={}));var Pp;function xp(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)}}h.extend(Qu.config,{autoReplaceSvg:!1,autoAddCss:!1,familyPrefix:"cv",autoA11y:!0,observeMutations:!1,replacementClass:"cv-svg",keepOriginalSource:!1}),(Zu=Qu.library).add.apply(Zu,function(e){if(Array.isArray(e))return _p(e)}(Pp=Lp)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(Pp)||function(e,t){if(e){if("string"==typeof e)return _p(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)?_p(e,t):void 0}}(Pp)||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 Np=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 Qu.icon(e,t.iconOptions||{})}},{key:"faIconLookup",value:function(e,t){var n=t.prefix,r=void 0===n?"cv":n;return Qu.findIconDefinition({prefix:r,iconName:e})}}])&&xp(t.prototype,n),r&&xp(t,r),e}().Instance,Rp=Wu,Dp=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;return Math.floor(Math.random()*Math.floor(e))};function Mp(e){var t=e.title,n=e.placement,r=e.trigger,i=e.children;return d.createElement(Zs.OverlayTrigger,{placement:n,overlay:d.createElement(Zs.Tooltip,{id:"".concat(t,"-").concat(Dp())},t),trigger:r},d.createElement("span",null,i))}Mp.defaultProps={trigger:["hover","click","focus"],placement:"top"};var Up;function Fp(e){var t=e.svgName,n=e.className,r=void 0===n?"d-inline-block svg-container":n,i=e.tagName,o=void 0===i?"span":i,a=e.size,c=void 0===a?Up.Standard:a,s=e.onClick,u=e.title,l=e.tooltipPlacement,f=void 0===l?"right":l,p=o,m={dangerouslySetInnerHTML:{__html:Np.getSvg(t)},className:"".concat(r," ").concat(c),onClick:hn(s)?s:null};return u?d.createElement(Mp,{title:u,placement:f},d.createElement(p,Object.assign({},m))):d.createElement(p,Object.assign({},m))}!function(e){e.Standard="std",e.Small="sm",e.Medium="md",e.Large="lg",e.ExtraLarge="xlg",e.XXL="xxlg"}(Up||(Up={}));var Vp=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},Bp=function(e){var t="d-inline-block svg-container";return hn(e)?t+" cursor-pointer":t};function zp(e){var t=e.onClickSearchIcon,n=e.searchIconPlacement,r=e.className,i=Vp(e,["onClickSearchIcon","searchIconPlacement","className"]),o="form-control ".concat(Fu.a.input),a="input-group-text bg-white";"right"===n&&(o+=" border-right-0",a+=" pl-0"),"left"===n&&(o+=" border-left-0",a+=" pr-0"),r&&(o+=" ".concat(r));var c=function(){return d.createElement("div",{className:a},d.createElement(Fp,{svgName:Rp.Search,size:Up.Small,onClick:t,className:Bp(t)}))};return d.createElement("div",{className:"input-group"},"left"===n&&d.createElement("div",{className:"input-group-prepend"},d.createElement(c,null)),d.createElement("input",Object.assign({className:o},i)),"right"===n&&d.createElement("div",{className:"input-group-append"},d.createElement(c,null)))}function Hp(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qp(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 qp(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 qp(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 Jp,$p,Kp,Yp,Gp,Wp,Zp,Qp,Xp,ed,td,nd,rd,id,od,ad,cd,sd,ud,ld,fd,pd,dd,md=hn;function hd(e){var t,n,r,i=(t=e.initialSuggestions,n=e.recentSearches,zu(r={},Du.Recent,n),zu(r,Du.Local,t),zu(r,Du.Remote,[]),r),o=Hp(d.useState(e.initialQuery||""),2),a=o[0],c=o[1],s=Hp(d.useState(i),2),u=s[0],l=s[1],f=function(e){var t=xu(Object(d.useState)(window.matchMedia(e).matches),2),n=t[0],r=t[1];return Object(d.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}(_u.XS),p=function(){l(i)},m=function(t){t.preventDefault(),md(e.onSubmit)&&e.onSubmit(a)};return d.createElement("form",{onSubmit:m},d.createElement(Pu,{suggestions:Ju(u,!a,e.recentSearchHeading||Cu.getPhrase("shared.searchBar","recentSearchHeading"),e.suggestionsHeading,e.getSections,e.suggestionLimit),onSuggestionsFetchRequested:qu(e,l,p),onSuggestionsClearRequested:function(){e.alwaysRenderSuggestions||p()},onSuggestionSelected:function(t,n){var r=n.suggestion;e.clearQueryOnSelect&&c(""),e.onSuggestionSelected(r)},getSuggestionValue:function(t){return e.updateQueryOnSelection?function(e,t){return Hu(t,e)?t[e]:""}(e.valueKey,t):a},renderSuggestion:function(t){return md(e.getSuggestionComponent)?e.getSuggestionComponent(t):function(e,t){return Hu(t,e)?d.createElement(d.Fragment,null,t[e]):d.createElement(d.Fragment,null)}(e.valueKey,t)},alwaysRenderSuggestions:e.alwaysRenderSuggestions,focusInputOnSuggestionClick:!f,inputProps:{placeholder:e.placeholder||Cu.getPhrase("shared.searchBar","placeholder"),value:a,onChange:function(t,n){var r=n.newValue;c(r),md(e.onQueryChange)&&e.onQueryChange(r)},onKeyDown:function(t){8===t.keyCode&&e.onBackspace&&!a&&e.onBackspace()},autoFocus:!!e.autoFocusInput,onClickSearchIcon:!!e.submitOnClickSearchIcon&&m,searchIconPlacement:e.searchIconPlacement},renderInputComponent:zp,theme:Gu(e.theme),multiSection:!0,renderSectionTitle:Ku,getSectionSuggestions:$u}))}function yd(e){return(yd="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 vd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bd(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 gd(e,t){return(gd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Sd(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Od(e);if(t){var i=Od(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ed(this,n)}}function Ed(e,t){return!t||"object"!==yd(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 Od(e){return(Od=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}hd.defaultProps={updateQueryOnSelection:!0,valueKey:"name",activationLength:3,suggestionLimit:5,recentSearches:[],initialSuggestions:[],searchIconPlacement:"right"},function(e){e.Stream="cv_product_stream",e.StreamRaw="cv_product_stream_raw",e.WebPlayerStream="cv_product_webplayer_stream",e.StreamProgress="cv_product_stream_progress",e.Login="cv_product_login",e.LoginSsoRedirect="cv_product_login_sso_redirect",e.LoginFailed="cv_product_login_failed",e.Search="cv_product_search",e.InstantSearch="cv_product_search",e.SearchEmptyResult="cv_product_search_empty_result",e.Filter="cv_product_search_filter",e.SearchLanding="cv_product_search_landing",e.Share="cv_product_share",e.WorkspaceAdd="cv_product_tv_add",e.Rename="cv_product_rename",e.Move="cv_product_move",e.Sort="cv_product_sort",e.Create="cv_product_create",e.Delete="cv_product_delete",e.Associate="cv_product_associate",e.Dissociate="cv_product_dissociate",e.Edit="cv_product_edit",e.Approve="cv_product_approve",e.Reject="cv_product_reject",e.Disable="cv_product_disable",e.Upload="cv_product_upload",e.Download="cv_product_download",e.Navigate="cv_product_navigate",e.Click="cv_product_click",e.Suggest="cv_product_suggest",e.EditAssoc="cv_product_edit_assoc",e.Play="cv_product_play",e.Favourite="cv_product_favourite",e.Follow="cv_product_follow",e.Prefer="cv_product_prefer",e.SetAccess="cv_product_set_access",e.AddToLocalCache="cv_product_add_to_lc",e.ResolveWarning="cv_product_resolve_warning",e.DismissWarning="cv_product_dismiss_warning"}(Jp||(Jp={})),function(e){e.Folder="folder",e.Video="video",e.Rating="rating",e.Series="series",e.Library="library",e.Resource="resource",e.Tag="tag",e.Subtitle="subtitle",e.Chapter="chapter",e.Restriction="restriction",e.Interactive="interactive",e.PDF="pdf",e.CustomerSetting="customer_setting",e.UserSetting="user_setting",e.StaffRequest="staff_request",e.Logo="logo",e.Pagination="pagination",e.Thumbnail="thumbnail",e.Banner="banner",e.Link="link",e.Playlist="playlist",e.Person="person",e.Company="company",e.Classroom="classroom",e.ClassroomGroup="classroom_group",e.Classification="classification",e.ShareLink="share_link",e.Upload="upload",e.SearchResults="search_results",e.Audience="audience",e.User="user",e.Clip="clip",e.UserChannel="user_channel",e.Widget="widget",e.Url="url"}($p||($p={})),function(e){e.TopNav="top_nav",e.LeftNav="left_nav",e.Popup="popup",e.Banner="banner",e.VideoList="video_list",e.VideoListItem="video_list_item",e.VideoListHeader="video_header",e.VideoThumbnail="video_thumbnail",e.VideoItemPreview="video_item_preview",e.VideoDetails="video_details",e.VideoDetailsHeader="video_details_header",e.EditVideoDetails="edit_video_details",e.EditVideoChapters="edit_video_chapters",e.EditVideoResources="edit_video_resources",e.VideoUpload="video_upload",e.VideoRequest="video_request",e.Pagination="pagination",e.SearchBar="search_bar",e.InstantSearch="instant_search",e.SearchFilters="search_filters",e.LibraryHeader="library_header",e.LibraryTiles="library_tiles",e.StaffRequestDetails="staff_request_details",e.SubFolderList="sub_folder_list",e.AwaitingReviewVideoListHeader="awaiting_review_video_list_header",e.AwaitingReviewVideoItem="awaiting_review_video_item",e.PastReleasesHeader="past_releases_header",e.MigrationWarnings="migration_warnings",e.PlaylistListHeader="playlist_list_header",e.PlaylistListItem="playlist_list_item",e.TeacherManager="teacher_manager",e.TeacherManagerListItem="teacher_manager_list_item",e.StudentManager="student_manager",e.StudentManagerListItem="student_manager_list_item",e.ClassroomsList="classrooms_list",e.ClassroomsListItem="classrooms_list_item",e.ClassroomOverview="classroom_overview",e.ClassroomOverviewStudentListItem="classroom_overview_student_list_item",e.ManageClassroomStudents="manage_classroom_students",e.ManageClassroomStudentListItem="manage_classroom_student_list_item",e.ManageClassroomGroups="manage_classroom_groups",e.ManageClassroomGroupListItem="manage_classroom_group_list_item",e.PlayPage="play_page",e.FloatingPlayer="floating_player",e.InteractivePlayer="interactive_player",e.EmbeddedPlayer="embedded_player",e.ContentUpdatesClassificationBanner="content_updates_classification_banner",e.PreferencesSettings="preferences_settings",e.MyUploads="my_uploads",e.SlidingList="sliding_list",e.HeroBannerItem="hero_banner_item",e.SlidingListItem="sliding_list_item",e.ClassificationListItem="classification_list_item",e.ClassificationComingSoon="classification_coming_soon",e.Dashboard="dashboard"}(Kp||(Kp={})),function(e){e.Start="start",e.Complete="complete",e.Save="save",e.Discard="discard"}(Yp||(Yp={})),function(e){e.PageLoad="page_load"}(Gp||(Gp={})),function(e){e.Single="single",e.Bulk="bulk",e.All="all"}(Wp||(Wp={})),function(e){e.ProductionYear="production_year",e.Alphabetical="alphabetical"}(Zp||(Zp={})),function(e){e.Content="content",e.Quality="quality",e.Duration="duration",e.Reset="reset"}(Qp||(Qp={})),function(e){e.Submit="submit",e.ShowAll="show_all",e.Recent="recent",e.SearchIcon="search_icon"}(Xp||(Xp={})),function(e){e.Start="start",e.Finish="finish",e.Terminate="terminate",e.Play="play",e.Pause="pause",e.Playback="playback",e.NextChapter="next_chapter",e.PreviousChapter="previous_chapter",e.FullScreenEnter="full_screen_enter",e.FullScreenExit="full_screen_exit"}(ed||(ed={})),function(e){e.TogglePreview="toggle_preview",e.NavigateHome="navigate_home",e.OpenInStaffView="open_in_staff_view",e.Title="title",e.ToggleHideValidListings="toggle_hide_valid_listings",e.LaunchImmersiveReader="launch_immersive_reader",e.CopyEmbedHtml="copy_embed_html",e.Close="close",e.Open="open",e.Button="button",e.Link="link",e.Tile="tile",e.Thumbnail="thumbnail",e.Cover="cover",e.TallPoster="tall_poster",e.Slide="slide"}(td||(td={})),function(e){e.FeatureUserChannelVideo="feature_user_channel_video",e.RemoveFromUserChannelPlaylist="remove_from_user_channel_playlist",e.ShareClip="share_clip",e.ViewOriginalVideo="view_original_video",e.ShareInteractive="share_interactive",e.DeleteInteractiveVideo="delete_interactive_video",e.CopyInteractiveVideo="copy_interactive_video",e.EditInteractiveVideo="edit_interactive_video",e.PrintAsWorksheet="print_as_worksheet",e.PreviewInteractiveVideo="preview_interactive_video",e.ViewResults="view_results",e.MoveToAnotherFolder="move_to_another_folder",e.CreateInteractiveVideo="create_interactive_video",e.ShareVideo="share_video",e.EditVideo="edit_video",e.DownloadVideo="download_video",e.AddToExchange="add_to_exchange",e.AddToUserChannel="add_to_user_channel",e.CreateClip="create_clip",e.FlagVideo="flag_video",e.AddToLibrary="add_to_library",e.AddToWorkspace="add_to_workspace",e.AddToPlaylist="add_to_playlist",e.RemoveFromPlaylist="remove_from_playlist",e.AddCurriculumLink="add_curriculum_link",e.ViewCurriculumLinks="view_curriculum_links",e.OpenInCurator="open_in_curator",e.ManageVideoAccess="manage_video_access",e.Approve="approve",e.AddToLocalCache="add_to_local_cache",e.OpenInLibraryEditor="open_in_library_editor",e.PlayClip="play_clip",e.EditClip="edit_clip",e.DeleteClip="delete_clip"}(nd||(nd={})),function(e){e.LibraryReview="library_review"}(rd||(rd={})),function(e){e.FileSelect="file_select",e.DragDrop="drag_drop"}(id||(id={})),function(e){e.Edit="edit"}(od||(od={})),function(e){e.Image="image",e.User="user",e.Playlist="playlist"}(ad||(ad={})),function(e){e.On="on",e.Off="off"}(cd||(cd={})),function(e){e.EntityRemoved="cv_entity_removed",e.ValueUpdated="cv_value_updated"}(sd||(sd={})),function(e){e.FileSelect="file_select",e.DragDrop="drag_drop"}(ud||(ud={})),function(e){e.Video="videos",e.Folder="categories",e.Series="series",e.Tags="tags"}(ld||(ld={})),function(e){e[e.V1=1]="V1"}(fd||(fd={})),function(e){e.Staff="staff",e.Learner="learner",e.Unknown="unknown"}(pd||(pd={})),function(e){e.Analytics="AnalyticsService",e.Context="ContextService"}(dd||(dd={}));var Cd,Ad=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&&gd(e,t)}(a,e);var t,n,i,o=Sd(a);function a(){var e;return vd(this,a),(e=o.apply(this,arguments)).contextHistory=[],e}return t=a,i=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{key:"initialize",value:function(){this.listenTo(b.SHELL,r.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}},{key:"name",get:function(){return dd.Context}}])&&bd(t.prototype,n),i&&bd(t,i),a}(r.Service));!function(e){e.Inlet="event:inlet",e.Outlet="event:outlet"}(Cd||(Cd={}));var jd="global:analytics";function wd(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 Id=fd.V1,Td=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||Id}var t,n,i;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||r.ErrorHelper.throw(new Xe("".concat(e," is not a valid key"))),this[e]&&r.ErrorHelper.throw(new Xe("Event already contains an enrichment named ".concat(e)))}}])&&wd(t.prototype,n),i&&wd(t,i),e}(),kd=function(e,t,n,r){y.Radio.channel(jd).trigger(Cd.Inlet,new Td(e,t,n,r))};function Ld(){var e=Ad.getCurrentContext().appLink;return h.isObject(e)||r.ErrorHelper.throw(new Xe("Applink does not exist. Check current context.")),e.application.replace(":","-")}function _d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.location,n=e.entity,i=e.workflowPhase,o=void 0===i?null:i,a=e.descriptor,c=void 0===a?null:a;return t||r.ErrorHelper.throw(new Xe("location must be set.")),n||r.ErrorHelper.throw(new Xe("entity must be set.")),{productArea:Ld(),location:t,entity:n,descriptor:c,workflowPhase:o}}function Pd(){return r.LocationUtils.GetCurrentPath()+r.LocationUtils.GetCurrentQueryString()}var xd={logUserAction:function(e,t){if(function(e){return!(!h.isArray(e)||!h.every(e,(function(e){return h.isObject(e)})))||!!h.isObject(e)}(e)&&h.isObject(t)){var n=xd.buildUserActionEvent(t),r=n.userAction,i=n.action,o=n.eventVersion;kd(r,e,i,o)}},logNavigate:function(e,t){var n=Object.assign({currentLocation:Pd(),appLink:e},t);kd(Jp.Navigate,n)},mergeOptions:function(e,t){return h.extend({},e,t)},buildActionContext:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _d(e)},buildUserActionEvent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.actionType,n=e.eventVersion,r=t,i=_d(e);return{userAction:r,action:i,eventVersion:n}},buildCurrentLocation:function(){return Pd()},buildSearchEvent:function(e,t){return{data:{query:e},action:_d({entity:$p.Video,location:Kp.SearchBar,descriptor:t})}},buildInstantSearchEvent:function(e,t,n){var r;n===ld.Series&&(r=$p.Series),n===ld.Folder&&(r=$p.Folder),n===ld.Tags&&(r=$p.Tag),n===ld.Video&&(r=$p.Video);var i={instant:{},query:e};return t.id&&(i.instant.selectedId=t.id),t.name&&(i.instant.selectedName=t.name),{data:i,action:_d({entity:r,location:Kp.SearchBar})}},mapInteractionType:function(e){switch(e){case ud.DragDrop:return id.DragDrop;case ud.FileSelect:return id.FileSelect;default:return}}};function Nd(e){var t=e.appLink,n=e.className,i=e.children,o=e.tag,a=void 0===o?"a":o;if(!t)return d.createElement("span",{className:n||""},i);var c=r.AppLinkHelper.getHref(t),s=e.onClick;s||(s=function(n){n.preventDefault(),e.analyticsData&&e.analyticsOptions&&xd.logUserAction(Object.assign({href:c},e.analyticsData),e.analyticsOptions),r.AppLinkHelper.trigger(t)});var u={onClick:s,href:c,className:n};return d.createElement(a,Object.assign({},u),i)}function Rd(e){var t=e.backToName,n=e.appLink;return d.createElement(Nd,{appLink:n,className:"d-inline-flex align-items-center"},d.createElement(Fp,{svgName:Rp.ArrowLeft,size:Up.Small}),d.createElement("span",{className:"ml-1"},"Back to ".concat(t)))}function Dd(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Md(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 Md(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 Md(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 Ud=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 Fd(e){var t=e.selected,n=e.onToggle,r=Ud(e,["selected","onToggle"]),i=Dd(d.useState(t),2),o=i[0],a=i[1];d.useEffect((function(){return a(t)}),[t]);return d.createElement(Zs.Form.Check,Object.assign({type:"checkbox",id:"checkbox-".concat(Dp()),checked:o,onChange:function(){a(!o),n(!o)}},r))}var Vd,Bd,zd,Hd,qd=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 Jd(e){var t=e.onFileSelect,n=e.acceptMultiple,r=e.mimeType,i=e.label,o=e.error,a=e.touched,c=qd(e,["onFileSelect","acceptMultiple","mimeType","label","error","touched"]),s="custom-file-input cursor-pointer";o&&a&&(s+=" is-invalid");var u=Object.assign({type:"file",className:s,onChange:function(e){var n=e.currentTarget.files;n&&n.length&&hn(t)&&t(n)},autoComplete:"off",value:"",multiple:!!n},r?{accept:r}:{});return d.createElement("div",{className:"form-group"},d.createElement("div",{className:"custom-file"},d.createElement(Vs,Object.assign({},u,c),e.children),d.createElement(Zs.Form.Label,{className:"custom-file-label",htmlFor:c.id},i)))}!function(e){e.Small="small",e.Medium="medium",e.Large="large"}(Vd||(Vd={})),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"}(Bd||(Bd={})),function(e){e[e.Crop=0]="Crop",e[e.Stretched=1]="Stretched",e[e.Cover=2]="Cover"}(zd||(zd={})),function(e){e[e.None=0]="None",e[e.ImageAPIv1=1]="ImageAPIv1",e[e.FileAPIv1=2]="FileAPIv1",e[e.ImageAPIv2=3]="ImageAPIv2"}(Hd||(Hd={}));var $d,Kd,Yd=function(e,t){var n=h.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=h.reduce(n,(function(e,t){return t?e?"".concat(e,"&").concat(t):t:e}));return r?"".concat(e,"?").concat(r):e},Gd=function(e,t){if(e){var n=e;return e.endsWith("/")||(n+="/"),t?n+=t.startsWith("/")?t.slice(1):t:n}};function Wd(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"}(Kd||(Kd={}));var Zd,Qd=(Wd($d={},Bd.Banners,Kd.Banner),Wd($d,Bd.Thumbnails,Kd.Thumbnail),$d),Xd=function(e){return"/v1/category-map/".concat(e)},em={createUrl:function(e,t){return em._createUrl(e,t)},createBannerUrl:function(e,t,n){return e&&e.url?em._createUrl(e.url,n):em._createCategoryMappedUrl(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,o=Gd(n,"".concat(Xd(Qd[i]))),a=Object.assign({name:em.Rfc3986EncodeURIComponent(r)},t);return em._createUrl(o,a)},_createUrl:function(e,t){if(e){if(Rr.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 r.Model?e.get("url"):"string"==typeof e?e:e.url)){var i=Object.assign({size:Vd.Small,bgColor:"000"},t);return em._createUrl(n,i)}}};function tm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nm=(tm(Zd={},Bd.Thumbnails,{width:1280,height:720}),tm(Zd,Bd.Banners,{width:3600,height:666}),tm(Zd,Bd.Covers,{width:1080,height:1080}),tm(Zd,Bd.Posters,{width:1e3,height:1500}),tm(Zd,Bd.TallPosters,{width:1080,height:1920}),tm(Zd,Bd.HeroBanners,{width:1920,height:640}),Zd),rm={onFileSelect:function(e,t,n){if(t&&t.length){var r=new FileReader;r.addEventListener("load",(function(){return rm.onReaderLoad(r,e,n)})),r.readAsDataURL(t[0])}},onReaderLoad:function(e,t,n){var r=new Image;r.src=e.result;var i=nm[t].width,o=nm[t].height;r.addEventListener("load",(function(){rm.isImageValid(t,r)&&hn(n)?n(r):alert("Image too small: minimum dimensions are ".concat(i," x ").concat(o))}))},isImageValid:function(e,t){var n=nm[e].width,r=nm[e].height;return!(n&&t.width<n)&&!(r&&t.height<r)}},im={isItemActive:function(e,t){return t||(t=r.AppLinkHelper.getCurrentAppLink()),t.application===e.appLink.application&&(Array.isArray(e.activeActions)?e.activeActions.includes(t.action):t.action===e.appLink.action)}},om=function(e){return Object.values(e).every((function(e){return!!e}))},am=(n(135),function(e,t){return!!e&&!!t&&e.toString()===t.toString()}),cm=function(e){return e.split(" ").map((function(e){return(e[0]?e[0].toUpperCase():"")+(e.substr(1)?e.substr(1).toLowerCase():"")})).join(" ")};function sm(e){return function(e){if(Array.isArray(e))return um(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 um(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 um(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 um(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 lm={find:function(e,t){if(e&&e.children&&e.children.length)for(var n=function e(n){if(am(n.id,t))return n;var r=n.children;if(r&&r.length)for(var i=0;i<r.length;i++){var o=e(r[i]);if(o)return o}},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 o=lm.find(e,i);o&&(n=[o].concat(sm(n))),i=o?r(o):null}return n}},fm=function(e){return e&&e.groups?e.groups.map((function(e){return e.name})):[]};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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return dm(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 dm(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 dm(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 mm,hm=d.createContext(void 0),ym=function(e){var t=e.children,n=pm(d.useState(),2),r=n[0],i=n[1],o=pm(d.useState(!1),2),a=o[0],c=o[1],s=pm(d.useState(),2),u=s[0],l=s[1],f={getDataUrl:function(){var e=r;return i(null),e},setDataUrl:i,imageUploaded:a,getImage:function(){var e=u;return l(null),c(!1),e},setImage:function(e){l(e),c(!0)}};return d.createElement(hm.Provider,{value:f},t)};function vm(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return bm(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 bm(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 bm(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 gm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Sm=(gm(mm={},Bd.Thumbnails,"Thumbnail"),gm(mm,Bd.Banners,"Banner"),gm(mm,Bd.Avatars,"Avatar"),gm(mm,Bd.Logos,"Logo"),gm(mm,Bd.Covers,"Cover"),gm(mm,Bd.Posters,"Poster"),gm(mm,Bd.TallPosters,"Tall Poster"),gm(mm,Bd.HeroBanners,"Hero Banner"),mm);function Em(e){var t,n=_s(),i=js(null===(t=n)||void 0===t?void 0:t.values,e.fieldName),o=d.useContext(hm),a=o.setDataUrl,c=o.getImage,u=o.imageUploaded,l=vm(d.useState(!1),2),f=l[0],p=l[1],m=vm(d.useState(i),2),h=m[0],y=m[1],v=vm(d.useState(!1),2),b=v[0],g=v[1];function S(t){p(!0),a(t.src),r.AppLinkHelper.trigger({application:e.application,action:e.uploadAction,args:[e.imageType]})}d.useEffect((function(){if(f){var t,r=c();if(r)p(!1),y(r),t=r,hn(e.setSelectedImage)?e.setSelectedImage(t):n&&n.setFieldValue(e.fieldName,{fileId:t.id,fileIdType:Hd.ImageAPIv2})}}),[u]);var E=e.label||Sm[e.imageType]||"Image";return d.createElement("div",{className:"form-group"},d.createElement("div",{className:"form-control h-auto py-2"},d.createElement("label",null,E),d.createElement("em",{className:"ml-1 text-muted"},"(Minimum dimensions are ".concat(nm[e.imageType].width,"px")+" x ".concat(nm[e.imageType].height,"px)")),d.createElement(Jd,{label:"Choose a ".concat(E.toLowerCase()),name:"image",mimeType:s.IMAGES,onFileSelect:function(t){return rm.onFileSelect(e.imageType,t,S)}}),!!h&&!!h.url&&d.createElement(d.Fragment,null,!b&&d.createElement("div",{className:"pb-2 ".concat(e.imageType===Bd.Banners?"w-100":"w-50")},d.createElement("img",{src:em.createUrl(h.url),className:"img img-fluid"})),d.createElement("div",{className:"d-flex justify-content-center"},d.createElement(Fp,{svgName:b?Rp.ChevronDown:Rp.ChevronUp,size:Up.Large,className:"svg-container cursor-pointer",onClick:function(){return g(!b)},title:b?"Show image":"Hide image",tooltipPlacement:"top"})))))}var Om,Cm=n(136),Am=n.n(Cm);function jm(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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(e){e[e.NoRestrictions=0]="NoRestrictions",e[e.RestrictToCanvas=1]="RestrictToCanvas"}(Om||(Om={}));var Im=/data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+).*,.*/;function Tm(e){var t=e.dataUrl,n=e.minHeight,r=e.minWidth,i=e.onCrop,o=e.onCancel,a=d.useRef(),c=d.useRef(),s=jm(d.useState(!1),2),u=s[0],l=s[1],f=jm(d.useState(!1),2),p=f[0],m=f[1];return d.useEffect((function(){var e=new Image;e.src=t;var i=a.current.offsetWidth/e.width;return c.current=new Am.a(a.current,{viewMode:Om.RestrictToCanvas,autoCropArea:1,aspectRatio:r/n,minCropBoxWidth:r*i,minCropBoxHeight:n*i,ready:function(){return l(!0)}}),function(){return c.current.destroy()}}),[]),d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-3"},d.createElement("img",{ref:a,src:t,className:"img img-fluid"})),d.createElement("div",{className:"d-flex justify-content-end border-top pt-3"},d.createElement(Zs.Button,{variant:"link",onClick:o},"Cancel"),d.createElement(fu,{onClick:function(){if(u){m(!0);var e=c.current.getCroppedCanvas().toDataURL(function(e){var t=e.match(Im);if(t)return t[1]}(t));hn(i)&&i(e)}},disabled:!u,showSpinner:p},"Crop")))}function km(e,t){return t?{application:e.application,action:e.action,args:e.args,params:Object.assign({},e.params,{cursor:t})}:null}function Lm(e){var t=e.appLink,n=e.cursors,r=e.className;function i(e){xd.logUserAction({page:e},{location:Kp.Pagination,entity:$p.Pagination,actionType:Jp.Navigate})}return d.createElement(Au.Provider,{value:"shared.pagination"},d.createElement("div",{className:r},d.createElement(Nd,{appLink:km(t,n.previous),className:"btn btn-secondary mr-1 ".concat(n.previous?"":"disabled"),onClick:function(){return i("previous")}},d.createElement(ju,{phrase:"previous"})),d.createElement(Nd,{appLink:km(t,n.next),className:"btn btn-secondary ".concat(n.next?"":"disabled"),onClick:function(){return i("next")}},d.createElement(ju,{phrase:"next"}))))}function _m(e){if(!e.collection)return d.createElement(d.Fragment,null);var t=e.collection,n=t.data,r=t.pagination;return d.createElement(d.Fragment,null,!!n&&d.createElement(qm,{objects:n,getObjectAppLink:e.getObjectAppLink,newObjectAppLink:e.newObjectAppLink,objectName:e.objectName}),!!r&&!!r.cursors&&d.createElement(Lm,{cursors:r.cursors,appLink:e.collectionAppLink}))}Lm.defaultProps={className:"py-2"};var Pm=n(23),xm=n.n(Pm);function Nm(e){var t="dropdown-item";return e&&(t+=" ".concat(e)),t}function Rm(e){if(e.action.appLink)return d.createElement(Nd,{appLink:e.action.appLink,onClick:e.action.onClick,className:Nm(e.action.className),analyticsData:e.action.analyticsData,analyticsOptions:e.action.analyticsOptions},e.action.label);return d.createElement("span",{className:"cursor-pointer ".concat(Nm(e.action.className)),onClick:function(t){e.action.analyticsData&&e.action.analyticsOptions&&xd.logUserAction(e.action.analyticsData,e.action.analyticsOptions),hn(e.action.onClick)&&e.action.onClick(t)}},e.action.label)}function Dm(e){if(!e.actions||!e.actions.length)return d.createElement(d.Fragment,null);var t="actions-dropdown-".concat(Dp()),n="px-0 ".concat(xm.a.dropdownToggle);return e.dropdownToggleClassName&&(n+=" ".concat(e.dropdownToggleClassName)),d.createElement(Zs.Dropdown,{className:e.className?e.className:"",alignRight:!0},d.createElement(Zs.Dropdown.Toggle,{as:"button",type:"button",id:t,className:n},d.createElement(Fp,{svgName:Rp.More,size:Up.Small})),d.createElement(Zs.Dropdown.Menu,null,e.actions.map((function(e,t){return d.createElement(Rm,{key:t,action:e})}))))}Dm.defaultProps={dropdownToggleClassName:"btn btn-light"};var Mm=n(18),Um=n.n(Mm);function Fm(e){var t="".concat(e.className," ").concat(Um.a.iconButton);e.children?t+=" ".concat(Um.a.iconWithText):t+=" ".concat(Um.a.iconOnly);var n=d.createElement(Fp,{svgName:e.svgName,className:Um.a.svg});return e.appLink?d.createElement(Nd,{appLink:e.appLink,className:t,onClick:e.onClick,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},n,e.children):d.createElement("button",{className:t,onClick:function(t){e.analyticsData&&e.analyticsOptions&&xd.logUserAction(e.analyticsData,e.analyticsOptions),hn(e.onClick)&&e.onClick(t)}},n,e.children)}function Vm(e){var t="ml-2";e.className&&(t+=" ".concat(e.className));var n=e.showSpinner?d.createElement(Zs.Spinner,{as:"span",animation:"border",role:"status",size:"sm"}):e.children;if(e.tooltip)return d.createElement(Mp,{title:e.tooltip},d.createElement(Fm,{appLink:e.appLink,svgName:e.svgName,onClick:e.onClick,className:t,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},n));if(e.svgName)return d.createElement(Fm,{onClick:e.onClick,appLink:e.appLink,svgName:e.svgName,className:t,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},n);if(e.appLink)return d.createElement(Nd,{onClick:e.onClick,appLink:e.appLink,className:t,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions},n);return d.createElement("button",{onClick:function(t){e.analyticsData&&e.analyticsOptions&&xd.logUserAction(e.analyticsData,e.analyticsOptions),hn(e.onClick)&&e.onClick(t)},className:t},n)}function Bm(e){var t=[],n=[];e.actions.forEach((function(e){e.button?t.push(e):n.push(e)}));var r="d-flex";return e.className&&(r+=" ".concat(e.className)),d.createElement("div",{className:r},d.createElement(d.Fragment,null,!!t.length&&d.createElement("span",{className:xm.a.buttonList},t.map((function(e,t){return d.createElement(d.Fragment,{key:t},e.label?d.createElement(Vm,{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):d.createElement(Fm,{appLink:e.appLink,onClick:e.onClick,svgName:e.svgName,className:e.className,analyticsData:e.analyticsData,analyticsOptions:e.analyticsOptions}))}))),e.sortComponent?e.sortComponent:"",!!n.length&&d.createElement(Dm,{actions:n,className:!!t.length&&"ml-2",dropdownToggleClassName:e.actionsDropdownClassName})))}function zm(e){var t=e.object,n=e.actions;return d.createElement("div",{className:"d-flex justify-content-between py-2"},!!t&&d.createElement("h5",null,t.name),!!n&&d.createElement("span",null,d.createElement(Bm,{actions:n})))}function Hm(e){return d.createElement("tr",null,d.createElement("td",null,d.createElement(Nd,{appLink:e.appLink},e.object.name)),d.createElement("td",null))}function qm(e){return d.createElement(Zs.Table,{responsive:!0},d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",null,"Name"),d.createElement("th",null,d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(Nd,{appLink:e.newObjectAppLink},d.createElement(Fp,{svgName:Rp.Plus,size:Up.Small}),d.createElement("span",null,"New ".concat(e.objectName))))))),d.createElement("tbody",null,e.objects.map((function(t){return d.createElement(Hm,{key:t.id,object:t,appLink:e.getObjectAppLink(t)})}))))}function Jm(e){var t=e.objects,n=e.getAppLink,r=e.emptyMessage;return t?t.length?d.createElement("ul",{className:"list-unstyled"},t.map((function(e,t){return d.createElement("li",{key:t,className:"border rounded mb-3"},d.createElement(Nd,{appLink:n(e),className:"d-block p-3"},e.name))}))):d.createElement("div",{className:"py-3"},d.createElement("p",null,r)):d.createElement(d.Fragment,null)}Jm.defaultProps={emptyMessage:"There is nothing here."};function $m(e){var t=_s();return d.createElement(iu,{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},d.createElement(d.Fragment,null,d.createElement("option",{value:""},"Please select a rating"),e.ratings.map((function(e,t){return d.createElement("option",{key:t,value:e.id},function(e){return"".concat(e.name).concat(e.code?" (".concat(e.code,")"):"")}(e))}))))}function Km(e){var t=e.tabs,n=e.isItemActive;return d.createElement(Zs.Nav,{fill:!0,variant:"tabs"},t.map((function(e,t){return d.createElement(Zs.Nav.Item,{key:t},d.createElement(Nd,{appLink:e.appLink,className:(r=n(e),r?"nav-link active":"nav-link")},e.label));var r})))}Km.defaultProps={isItemActive:im.isItemActive};var Ym=n(8),Gm=n.n(Ym);function Wm(e){var t=e.name,n=e.appLink,r=e.onSelect,i=e.isDisabled,o=e.className,a=e.actions,c=Gm.a.text;return o&&(c+=" ".concat(o)),i?d.createElement("a",{className:"".concat(c," text-muted ").concat(Gm.a.disabled)},t):d.createElement(d.Fragment,null,n?d.createElement(Nd,{appLink:n,className:c},t):d.createElement("a",{onClick:r,className:c},t),!!a&&d.createElement(Bm,{className:Gm.a.actions,actions:a}))}function Zm(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Qm(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 Qm(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 Qm(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 Xm(e){var t=e.tree,n=e.selectedIds,r=e.getAppLink,i=e.onSelect,o=e.isDisabled,a=e.actions,c=Array.isArray(n)&&n.some((function(e){return am(t.id,e)})),s=d.useMemo((function(){return Array.isArray(n)&&n.some((function(e){return lm.find(t,e)}))}),[t,n]),u=Zm(d.useState(s),2),l=u[0],f=u[1],p=!!t.children&&!!t.children.length,m={name:t.name,appLink:hn(r)?r(t):null,onSelect:hn(i)?function(){return i(t)}:null,isDisabled:!!hn(o)&&o(t),className:c&&Gm.a.selected||s&&Gm.a.parentOfSelected,actions:!!a&&a.map((function(e){return Object.assign(Object.assign({},e),{appLink:e.getAppLink(t)})}))};return d.createElement("li",{className:"position-relative".concat(l?"":" ".concat(Gm.a.collapsed))},d.createElement("div",{className:"position-relative"},d.createElement("span",{className:Gm.a.node},p&&d.createElement(Fp,{svgName:Rp.ChevronDown,size:Up.Small,className:"svg-container ".concat(Gm.a.chevron),onClick:function(){return f(!l)}}),d.createElement(Wm,Object.assign({},m))),l&&d.createElement(th,Object.assign({},e))))}var eh=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 th(e){var t=e.tree,n=eh(e,["tree"]);return t&&t.children?d.createElement("ul",{className:"m-0 p-0 ".concat(Gm.a.tree)},t.children.map((function(e){return d.createElement(Xm,Object.assign({key:e.id,tree:e},n))}))):d.createElement(d.Fragment,null)}var nh={getChord:function(e,t){return lm.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,o,a=lm.find(t,e);a&&(n=Object.assign((r={},i=e,o=nh.getChord(t,a),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o,r),n))})),n}};function rh(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ih(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 ih(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 ih(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 oh=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 ah(e){var t=e.onSelect,n=e.label,r=e.hideCollapseBtn,i=e.collapse,o=e.noSelectionMessage,a=e.isNodeDisabled,c=e.getSelectedItemAppLink,s=oh(e,["onSelect","label","hideCollapseBtn","collapse","noSelectionMessage","isNodeDisabled","getSelectedItemAppLink"]),u=s.tree,l=s.selectedIds,f=rh(d.useState(nh.getState(l,u)),2),p=f[0],m=f[1];d.useEffect((function(){return m(nh.getState(l,u))}),[l,u]);var h=rh(d.useState(!!i),2),y=h[0],v=h[1];d.useEffect((function(){return v(!!i)}),[i]);var b=!r||!!n;return d.createElement(d.Fragment,null,b&&d.createElement("div",{className:"pb-2"},!!n&&d.createElement("label",{className:"m-0"},n),!r&&d.createElement("a",{className:"float-right cursor-pointer",onClick:function(){return v(!y)}},y?"Expand":"Collapse")),!y&&d.createElement("div",{className:"py-2 border-top"},d.createElement(th,Object.assign({onSelect:function(e){return hn(t)&&t(e)},isDisabled:a},s))),(!Rr.isEmpty(p)||!!o)&&d.createElement("div",{className:"py-2 border-top"},d.createElement("label",null,"Selected:"),d.createElement("ul",{className:"m-0"},Rr.isEmpty(p)?d.createElement("li",null,o):Object.keys(p).map((function(e,t){return d.createElement("li",{key:t},hn(c)?d.createElement(Nd,{appLink:c(e)},p[e]):p[e])})))))}var ch=n(24);var sh=function(e){return e&&!(e.data&&e.data.length)},uh=function(e){return e&&e.data&&e.data.length},lh=function(e){var t="bg-white";return e&&(t+=" ".concat(e)),t};function fh(e){var t=e.video,n=e.getVideoAppLink,r=e.getVideoActions,i=e.className,o=void 0===i?"":i,a=e.itemNumber,c=hn(n)&&n(t);return d.createElement("tr",{className:lh(o)},!!a&&d.createElement("td",null,d.createElement("span",null,a)),d.createElement("td",null,c?d.createElement(Nd,{appLink:c},t.name):t.name),hn(r)&&d.createElement("td",null,d.createElement("span",{className:"d-flex justify-content-end"},d.createElement(Bm,{actions:r(t)}))))}var ph=Object(ch.SortableElement)((function(e){return d.createElement(fh,Object.assign({sortable:!0},e))})),dh=n(11),mh=n.n(dh),hh=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},yh=function(e){var t=e.sortable,n=e.getVideoActions;return d.createElement("thead",null,d.createElement("tr",null,!!t&&d.createElement("th",null,"#"),d.createElement("th",null,"Name"),!!n&&d.createElement("th",null)))},vh=d.forwardRef((function(e,t){var n=e.videos,r=e.sortable,i=hh(e,["videos","sortable"]);return d.createElement("tbody",{ref:t},!sh(n)&&n.data.map((function(e,t){return r?d.createElement(ph,Object.assign({key:e.id,index:t,itemNumber:t+1,video:e,className:mh.a.draggableVideoItem},i)):d.createElement(fh,Object.assign({video:e},i))})))}));var bh=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},gh=Object(ch.SortableContainer)((function(e){var t=e.forwardedRef,n=bh(e,["forwardedRef"]);return d.createElement(vh,Object.assign({sortable:!0,ref:t},n))})),Sh=function(e){return function(t){var n=t.node,r=e.current;if(r){r.classList.add(mh.a.sortingContainer);var i=r.querySelector(".".concat(mh.a.draggedVideoItem));n.childNodes.forEach((function(e,t){return i.childNodes[t].style.width="".concat(e.offsetWidth,"px")}))}}},Eh=function(e,t){return function(n){var r=e.current;r&&r.classList.remove(mh.a.sortingContainer),t(n.oldIndex,n.newIndex)}};function Oh(e){var t=e.onSortEnd,n=e.emptyMessage,r=bh(e,["onSortEnd","emptyMessage"]),i=d.useRef();return sh(e.videos)?d.createElement("div",null,n):d.createElement(Zs.Table,{responsive:!0},d.createElement(yh,Object.assign({sortable:!0},e)),d.createElement(gh,Object.assign({forwardedRef:i,onSortStart:Sh(i),onSortEnd:Eh(i,t),lockAxis:"y",lockToContainerEdges:!0,distance:1,helperClass:mh.a.draggedVideoItem,helperContainer:function(){return i.current}},r)))}function Ch(e){var t=e.alias,n=e.onDelete;return d.createElement("li",{className:"list-group-item d-flex justify-content-between"},t.name,d.createElement(Fp,{svgName:Rp.Delete,onClick:function(){return n(t.id)}}))}function Ah(e){var t=e.aliases,n=e.onDelete;return d.createElement("ul",{className:"list-group mb-3"},t?t.map((function(e){return d.createElement(Ch,{key:e.id,alias:e,onDelete:n})})):d.createElement("span",null,"Currently there are no aliases for this object."))}Oh.defaultProps={emptyMessage:"There are no videos in this list."};var jh=Object(Gs.object)().shape({name:Object(Gs.string)().trim().max(255,"Name is too long").required("Name is required").default("")});function wh(){var e=_s(),t=cu(e);return d.createElement(Bs,null,d.createElement(iu,{label:"Create an alias",name:"name",id:"name",value:e.values.name,placeholder:"Add an alias"}),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(fu,{showSpinner:e.isSubmitting,type:"submit",disabled:!t},"Add")))}function Ih(e){var t=e.onSave;return d.createElement(Ys,{initialValues:{name:""},validationSchema:jh,onSubmit:function(e,n){t(e,n)},resetOnSubmit:!0},d.createElement(wh,null))}function Th(e){var t=e.onSave,n=e.aliases,r=e.onDelete;return d.createElement("div",{className:"w-50"},d.createElement("h1",null,"Aliases"),d.createElement(Ah,{aliases:n,onDelete:r}),d.createElement(Ih,{onSave:t}))}var kh=l.COMPANIES,Lh=function(e){return{application:kh,action:a.Companies.EDIT_COMPANY,args:[e.id]}},_h=function(e){return r.AppLinkHelper.trigger(Lh(e))};function Ph(e){var t=i.useBasicFetch(Fi(e.cursor));return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-3 w-50"},d.createElement(hd,{placeholder:"Search for a company",onSuggestionSelected:_h,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/companies/instant/raw","?q=").concat(e)},activationLength:2})),d.createElement(_m,{collection:t&&t.data,collectionAppLink:{application:kh,action:a.Companies.COMPANIES},newObjectAppLink:{application:kh,action:a.Companies.NEW_COMPANY},getObjectAppLink:Lh,objectName:"Company"}))}function xh(e){return(xh="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 Nh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rh(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 Dh(e,t,n){return t&&Rh(e.prototype,t),n&&Rh(e,n),e}function Mh(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&&Uh(e,t)}function Uh(e,t){return(Uh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fh(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Bh(e);if(t){var i=Bh(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Vh(this,n)}}function Vh(e,t){return!t||"object"!==xh(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 Bh(e){return(Bh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var zh=function(e){Mh(n,e);var t=Fh(n);function n(){return Nh(this,n),t.apply(this,arguments)}return Dh(n,[{key:"channelName",get:function(){return l.COMPANIES}},{key:"appRoutes",get:function(){return{"manage/companies(/)":"companies","manage/companies/new(/)":"newCompany","manage/companies/:id(/)":"editCompany"}}}]),n}(r.AppRouter),Hh=function(e){Mh(n,e);var t=Fh(n);function n(){return Nh(this,n),t.apply(this,arguments)}return Dh(n,[{key:"companies",value:function(e){var t=e.cursor;this.layout.showChildView(kn,d.createElement(Ph,{cursor:t}))}},{key:"newCompany",value:function(){this.layout.showChildView(kn,d.createElement(Lu,null))}},{key:"editCompany",value:function(e){this.layout.showChildView(kn,d.createElement(ku,{id:e}))}},{key:"name",get:function(){return"Companies Application"}},{key:"channelName",get:function(){return l.COMPANIES}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT}}}],[{key:"router",get:function(){return zh}}]),n}(r.Application);function qh(e){return(qh="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 Jh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $h(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 Kh(e,t){return(Kh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Yh(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 Gh(this,n)}}function Gh(e,t){return!t||"object"!==qh(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 Wh(e){return(Wh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Zh=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&&Kh(e,t)}(o,e);var t,n,r,i=Yh(o);function o(){return Jh(this,o),i.apply(this,arguments)}return t=o,(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,d.createElement(t,{alerts:r,removeAlert:function(e){return y.Radio.channel(b.ALERT).trigger("remove:alert",e)}}))}}}])&&$h(t.prototype,n),r&&$h(t,r),o}(ie);function Qh(e){return(Qh="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 Xh(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 ey(e,t){return(ey=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ty(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ry(e);if(t){var i=ry(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return ny(this,n)}}function ny(e,t){return!t||"object"!==Qh(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 ry(e){return(ry=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var iy,oy,ay=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&&ey(e,t)}(o,e);var t,n,r,i=ty(o);function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=i.call(this)).constructors={},e.destructors={},e.instances={},e.singletonInstances={},e.referenceCounts={},e}return t=o,r=[{key:"Instance",get:function(){return this.instance||(this.instance=new this)}}],(n=[{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():K.throw(new Xe("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 h.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]||K.throw(new Xe("".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||K.throw(new Xe("Classes registered with ".concat(this.name," must have a unique name property."))),this.constructors[t]&&K.throw(new Xe("A class with the name: ".concat(t," has already been registered with ").concat(this.name)))}},{key:"name",get:function(){return"InstanceManager"}}])&&Xh(t.prototype,n),r&&Xh(t,r),o}(Yt).Instance;function cy(e){var t,n;return t=e,n=ay.getInstance(t),d.useEffect((function(){return function(){return ay.releaseInstance(t)}})),n}function sy(e){return(sy="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 uy(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 ly(e,t){return(ly=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function fy(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=dy(e);if(t){var i=dy(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return py(this,n)}}function py(e,t){return!t||"object"!==sy(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 dy(e){return(dy=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"}(iy||(iy={})),function(e){e.Success="Success! 🙌",e.Warning="Whoops...",e.Fail="Oops...",e.Info="FYI"}(oy||(oy={}));var my,hy=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&&ly(e,t)}(o,e);var t,n,r,i=fy(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,e)}return t=o,(n=[{key:"initialize",value:function(){this.alertCollection=new De,this.listenTo(b.ALERT,"remove:alert",this.removeAlert),this.showAlerts()}},{key:"showAlerts",value:function(){var e=y.Radio.channel(b.ALERT),t={collection:this.alertCollection};this.options.alertViewCtor&&(t=h.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=h.extend({},e,{id:this.generateUniqueAlertId()})),this.alertCollection.push(new _t(e)),this.showAlerts()}},{key:"clearAllAlerts",value:function(){this.alertCollection.reset(null)}},{key:"success",value:function(e){var t=this;return"string"==typeof e?h.bind((function(){return t.createAlert(h.extend({},t.options.defaultSuccessAlert,{message:e}))}),this):e.useXHR?h.bind((function(e,n){return t.createAlert(h.extend({},t.options.defaultSuccessAlert,{message:n}))}),this):h.bind((function(){return t.createAlert(h.extend({},t.options.defaultSuccessAlert,e))}),this)}},{key:"error",value:function(e){var t=this;return"string"==typeof e?h.bind((function(){return t.createAlert(h.extend({},t.options.defaultErrorAlert,{message:e}))}),this):e.useXHR?h.bind((function(e){return t.createAlert(h.extend({},t.options.defaultErrorAlert,{message:e.message}))}),this):h.bind((function(){return t.createAlert(h.extend({},t.options.defaultErrorAlertIL_DEFAULT,e))}),this)}},{key:"generateUniqueAlertId",value:function(){return h.uniqueId("alert_")}},{key:"name",get:function(){return mu}},{key:"defaults",get:function(){return{maxAlerts:3}}}])&&uy(t.prototype,n),r&&uy(t,r),o}(Yt),yy=function(){var e=cy(mu);return{success:function(t){e.success(t)()},error:function(t){e.error(t)()},warning:function(t){e.createAlert({type:iy.Warning,heading:oy.Warning,message:t})}}};function vy(){return d.createElement("div",{className:"text-center p-5"},d.createElement(Zs.Spinner,{as:"div",animation:"border",role:"status"}))}function by(e){return d.createElement(Zs.Modal,{show:!0,onHide:e.closePopup,onEntered:e.onEntered,size:e.size},!!e.title&&d.createElement(Zs.Modal.Header,{closeButton:e.closeButton},d.createElement(Zs.Modal.Title,null,e.title)),e.showLoadingSpinner?d.createElement(vy,null):d.createElement(Zs.Modal.Body,null,e.children))}!function(e){e.Subject="subject",e.Curriculum="curriculum"}(my||(my={})),by.defaultProps={closeButton:!0};var gy=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 Sy(e){var t=e.buttons;return d.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,o=e.isSpinnerButton,a=e.showSpinner,c=void 0!==a&&a,s=e.className,u=gy(e,["buttonText","type","isSpinnerButton","showSpinner","className"]),l=Object.assign({key:t,type:i,className:"ml-2".concat(s?" ".concat(s):"")},u);return o?d.createElement(fu,Object.assign({showSpinner:c},l),n):d.createElement(Zs.Button,Object.assign({},l),n)}(e,t)})))}function Ey(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Oy(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 Oy(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 Oy(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 Cy(e){var t=e.title,n=e.onClickConfirm,r=e.confirmButtonText,i=e.cancelButtonText,o=e.closePopup,a=Ey(d.useState(!1),2),c=a[0],s=a[1],u=[{variant:"link",onClick:o,buttonText:i},{variant:"primary",onClick:function(){s(!0),n()},buttonText:r,isSpinnerButton:!0,showSpinner:c}];return d.createElement(by,{title:t,closePopup:o},d.createElement(d.Fragment,null,e.children,d.createElement(Sy,{buttons:u})))}function Ay(e,t){return t?"".concat(e,":").concat(t):e}Cy.defaultProps={confirmButtonText:"Confirm",cancelButtonText:"Cancel"};var jy=function(e){return{key:Ay("presentations",e),url:Yd("/api/subjects/v1/presentations",{type:e})}},wy=function(e,t){return{key:Ay("customers:".concat(e,":presentations"),t),url:Yd("/api/subjects/v1/customers/".concat(e,"/presentations"),{type:t})}},Iy=function(e,t,n,r,i){return{key:"customers:".concat(e,":presentations:").concat(e,":add"),url:"/api/subjects/v1/customers/".concat(e,"/presentations/").concat(t),type:Cr.POST,invalidationKeys:"customers:".concat(e,":presentation"),success:n,error:r,always:i}},Ty=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:Cr.DELETE,invalidationKeys:"customers:".concat(e,":presentations"),success:n,error:r,always:i}},ky=function(e){return{key:"customers:".concat(e),url:"/api/master/v2/objects/".concat(e)}};function Ly(e){return d.createElement("div",null,d.createElement(Zs.Form.Label,null,"Select a presentation to add"),d.createElement(Zs.Form.Control,{as:"select",value:"",onChange:function(t){return e.addPresentation(function(e,t){return Oi(t.filter((function(t){return t.id.toString()===e.toString()})))}(t.target.value,e.availablePresentations))},className:"cursor-pointer"},d.createElement("option",{value:""},"Select a presentation"),e.availablePresentations.map((function(e){return d.createElement("option",{value:e.id,key:e.id},e.name)}))),!!e.currentPresentations.length&&d.createElement(d.Fragment,null,d.createElement("ul",{className:"list-unstyled mt-2"},e.currentPresentations.map((function(t){return d.createElement("li",null,t.name,d.createElement("span",{className:"text-danger cursor-pointer ml-2",onClick:function(){return e.removePresentation(t)}},d.createElement("em",null,"remove")))})))))}function _y(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Py(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 Py(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 Py(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 xy(e){var t=yy(),n=Object(bn.useDispatch)(),r=_y(d.useState(),2),o=r[0],a=r[1],c=i.useBasicFetch(ky(e.customerId)),s=i.useBasicFetch(jy(my.Subject)),u=i.useBasicFetch(jy(my.Curriculum)),l=i.useBasicFetch(wy(e.customerId,my.Subject)),f=i.useBasicFetch(wy(e.customerId,my.Curriculum));function p(r){var o=Iy(e.customerId,r.id,(function(){return t.success("Successfully added customer to presentation.")}),(function(e){var n;return t.error((null===(n=e.responseJSON)||void 0===n?void 0:n.message)||"Failed to add customers presentation.")}));i.fetch(n,o)}return!!(c.data&&s.data&&u.data&&l.data&&f.data)?d.createElement(d.Fragment,null,d.createElement("h1",{className:"h6 mb-3"},c.data.name," - ",c.data.crmId),d.createElement("p",null,d.createElement("strong",null,"Subject Presentations")),d.createElement(Ly,{availablePresentations:s.data,currentPresentations:l.data,addPresentation:p,removePresentation:a}),d.createElement("hr",null),d.createElement("p",null,d.createElement("strong",null,"Curriculum Presentations")),d.createElement(Ly,{availablePresentations:u.data,currentPresentations:f.data,addPresentation:p,removePresentation:a}),!!o&&d.createElement(Cy,{title:"Confirmation needed",onClickConfirm:function(){if(o){var r=Ty(e.customerId,o.id,(function(){return t.success("Successfully removed customer from presentation.")}),(function(e){var n;return t.error((null===(n=e.responseJSON)||void 0===n?void 0:n.message)||"Failed to remove presentation.")}),(function(){return a(null)}));i.fetch(n,r)}},closePopup:function(){return a(null)}},d.createElement("p",null,"Are you sure you want to remove this customer from ",o.name,"?"))):d.createElement(d.Fragment,null)}function Ny(e){return(Ny="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 Ry(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dy(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 My(e,t,n){return t&&Dy(e.prototype,t),n&&Dy(e,n),e}function Uy(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&&Fy(e,t)}function Fy(e,t){return(Fy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Vy(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=zy(e);if(t){var i=zy(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return By(this,n)}}function By(e,t){return!t||"object"!==Ny(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 zy(e){return(zy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Hy=function(e){Uy(n,e);var t=Vy(n);function n(){return Ry(this,n),t.apply(this,arguments)}return My(n,[{key:"channelName",get:function(){return l.CUSTOMERS}},{key:"appRoutes",get:function(){return{"customers/:id/presentations(/)":"editCustomerPresentations"}}}]),n}(r.AppRouter),qy=function(e){Uy(n,e);var t=Vy(n);function n(){return Ry(this,n),t.apply(this,arguments)}return My(n,[{key:"editCustomerPresentations",value:function(e){this.layout.showChildView(kn,d.createElement(xy,{customerId:e}))}},{key:"name",get:function(){return"Customers Application"}},{key:"channelName",get:function(){return l.CUSTOMERS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{alertRegion:_n}}}}],[{key:"router",get:function(){return Hy}}]),n}(Zh),Jy=n(34),$y=n(9),Ky=n.n($y);function Yy(e){var t=e.alert,n=e.svgName,r=e.svgClassName,i=e.closeAlert,o=t.message,a=t.heading,c=t.appLink,s=t.appLinkText,u=t.appLinkClassName,l=void 0===u?"":u,f=Object(du.sanitize)(o);return d.createElement(d.Fragment,null,d.createElement("div",{className:"d-inline-block ".concat(Ky.a.icon)},d.createElement(Fp,{svgName:n,className:"svg-container ".concat(r)})),d.createElement("div",{className:"pl-2 d-inline-block ".concat(Ky.a.alertContent)},d.createElement("p",{className:"p-0 m-0 pb-1 ".concat(Ky.a.heading)},a),d.createElement("p",{className:"p-0 m-0 ".concat(Ky.a.message),dangerouslySetInnerHTML:{__html:f}}),!!c&&d.createElement(Nd,{className:l,appLink:c},s)),d.createElement("div",{className:"close d-inline-block cursor-pointer",role:"button",onClick:i},"×"))}function Gy(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Wy(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 Wy(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 Wy(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 Zy,Qy,Xy=function(e){switch(e.type){case iy.Success:return Rp.CheckCircleOutline;case iy.Fail:case iy.Warning:return Rp.Warning;case iy.Info:default:return Rp.Info}};function ev(e){var t=e.alert,n=e.closeAlert,r=Gy(d.useState(!0),2),i=r[0],o=r[1],a=d.useRef();d.useEffect((function(){i?a.current=window.setTimeout(n,3e3):clearTimeout(a.current)}),[i]);var c="text-".concat(t.type.toLowerCase());return d.createElement("li",{className:"bg-white mt-2 p-2 show clearfix ".concat(Ky.a.alertItem),onMouseEnter:function(){return o(!1)},onMouseLeave:function(){return o(!0)}},d.createElement(Yy,{alert:t,svgName:Xy(t),svgClassName:c,closeAlert:n}))}function tv(e){var t=e.alerts,n=e.removeAlert;return d.createElement("div",{className:Ky.a.alertBox},d.createElement(Jy.TransitionGroup,{component:"ul",className:"".concat(Ky.a.alertList," list-unstyled")},t&&t.map((function(e,t){return d.createElement(Jy.CSSTransition,{key:t,timeout:200,classNames:"alert"},d.createElement(ev,{alert:e,closeAlert:function(){return n(e.id)}}))}))))}!function(e){e.Boolean="System.Boolean",e.String="System.String",e.StaffRequest="ClickView.DomainApi.Models.Options.Enums.StaffRequestOption, ClickView.DomainApi.Models, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null",e.Long="System.Int64"}(Zy||(Zy={})),function(e){e[e.Permanent=0]="Permanent",e[e.Temporary=1]="Temporary"}(Qy||(Qy={}));var nv={namespace:"domain_options"},rv=function(){return"/api/domain/v3/settings/types"},iv=function(e){return"/api/domain/v3/settings/types/".concat(e)},ov=function(){return"/api/domain/v3/settings/types"},av=function(e){return"/api/domain/v3/settings/types/".concat(e)},cv=function(e){return"/api/domain/v3/settings/types/".concat(e)},sv="domain:options",uv="domain:option",lv="update:domain:option",fv="delete:domain:option",pv=function(){return{key:sv,url:rv(),normalizeOptions:nv}},dv=function(e){return{key:"".concat(uv,":").concat(e),url:iv(e),normalizeOptions:nv}},mv=function(e,t,n){return e.type===Zy.String&&(e=vv(e)),{key:uv,url:ov(),data:e,type:Cr.POST,success:t,error:n,invalidationKeys:[sv],normalizeOptions:nv}},hv=function(e,t){return e.type===Zy.String&&(e=vv(e)),{key:"".concat(lv,":").concat(e.id),url:av(e.id),data:e,type:Cr.PUT,always:t,formatData:function(){return e},normalizeOptions:nv}},yv=function(e,t){return{key:"".concat(fv,":").concat(e),url:cv(e),type:Cr.DELETE,invalidationKeys:[sv],normalizeOptions:nv,success:t}};function vv(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 bv(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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}function Sv(e){var t=bv(d.useState(!1),2),n=t[0],o=t[1],c=i.useBasicFetch(dv(e.optionId)),s=Object(bn.useDispatch)(),u=function(){e.closePopup(),r.AppLinkHelper.trigger({application:l.DOMAIN_OPTIONS,action:a.DomainOptions.DOMAIN_OPTIONS})};return d.createElement(by,{title:"Delete Domain Option",closePopup:e.closePopup,showLoadingSpinner:!c.data},c.data&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,c.data.name),"?")),d.createElement(Sy,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){o(!0),i.fetch(s,yv(e.optionId,u))},buttonText:"Yes, delete this domain option",isSpinnerButton:!0,showSpinner:n}]})))}var Ev,Ov=function(e){return{application:l.DOMAIN_OPTIONS,action:a.DomainOptions.EDIT_DOMAIN_OPTION,args:[e.id]}},Cv={application:l.DOMAIN_OPTIONS,action:a.DomainOptions.NEW_DOMAIN_OPTION};function Av(){var e=i.useBasicFetch(pv());if(!e.data)return d.createElement(d.Fragment,null);var t=e.data.map((function(e){return e.displayName&&(e.name=e.displayName),e}));return d.createElement(d.Fragment,null,d.createElement("div",{className:"d-flex justify-content-between mb-2"},d.createElement("h5",{className:"d-inline-block m-0"},"Select a domain option type to edit:"),d.createElement(Nd,{appLink:Cv,className:"d-block"},d.createElement(Fp,{svgName:Rp.Plus,size:Up.Small}),d.createElement("span",null,"New Domain Option"))),d.createElement(Jm,{objects:t,getAppLink:Ov}))}!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"}(Ev||(Ev={}));var jv=Gs.object().shape({id:Gs.string(),name:Gs.string().trim().max(64,"Name is too long").required("Name is required").default(""),displayName:Gs.string().trim().max(255,"Display name is too long").required("Display name is required").default(""),type:Gs.mixed().required("Type is required").default(Zy.Boolean),entityType:Gs.mixed().required("Entity type is required").default(Ev.Customer),kind:Gs.mixed().required("Kind is required").default(Qy.Temporary),defaultValue:Gs.mixed().required("Default value is required").default("false")}).noUnknown();function wv(e){var t=e.type,n=e.defaultValue;if(!t)return d.createElement(d.Fragment,null);var r={label:"Default Value",name:"defaultValue",id:"defaultValue",value:n};return t===Zy.Boolean?d.createElement(iu,Object.assign({as:"select"},r),d.createElement("option",{value:"true"},"True"),d.createElement("option",{value:"false"},"False")):t===Zy.Long||t===Zy.StaffRequest?d.createElement(iu,Object.assign({as:"input",type:"number"},r)):t===Zy.String?d.createElement(iu,Object.assign({as:"input"},r)):void 0}var Iv=[Ev.Customer,Ev.User];function Tv(e){var t=null===e.id||void 0===e.id,n=_s(),r=cu(n);return d.createElement(Bs,null,d.createElement(iu,{label:"Name (snake_case)",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this domain option",autoFocus:!0}),d.createElement(iu,{label:"Display Name",type:"text",name:"displayName",id:"displayName",value:n.values.displayName,placeholder:"Enter a display name for this domain option"}),d.createElement(iu,{as:"select",label:"Kind",name:"kind",id:"kind",value:n.values.kind},Rr.getEnumKeys(Qy).map((function(e){return d.createElement("option",{key:e,value:Qy[e]},e)}))),d.createElement(iu,{as:"select",label:"Entity",name:"entityType",id:"entityType",value:n.values.entityType},Rr.getEnumKeys(Ev).filter((function(e){return Iv.includes(Ev[e])})).map((function(e){return d.createElement("option",{key:e,value:Ev[e]},e)}))),d.createElement(iu,{as:"select",label:"Type",name:"type",id:"type",value:n.values.type},Rr.getEnumKeys(Zy).map((function(e){return d.createElement("option",{key:e,value:Zy[e]},e)}))),d.createElement(wv,{type:n.values.type,defaultValue:n.values.defaultValue}),d.createElement("div",{className:"d-flex justify-content-between"},d.createElement(fu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&d.createElement(Zs.Button,{as:Nd,variant:"danger",appLink:{application:l.DOMAIN_OPTIONS,action:a.DomainOptions.DELETE_DOMAIN_OPTION,args:[e.id]}},"Delete")))}function kv(e){return d.createElement(Ys,{initialValues:e.domainOption,validationSchema:jv,onSubmit:e.saveDomainOption},d.createElement(Tv,{id:e.domainOption&&e.domainOption.id}))}function Lv(){var e=Object(bn.useDispatch)();return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Create New Domain Option"),d.createElement(kv,{saveDomainOption:function(t,n){i.fetch(e,mv(t,(function(e){n(),r.AppLinkHelper.trigger({application:l.DOMAIN_OPTIONS,action:a.DomainOptions.EDIT_DOMAIN_OPTION,args:[e.id]})}),n))}}))}function _v(e){var t=e.optionId,n=i.useBasicFetch(dv(t)),r=Object(bn.useDispatch)();return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Edit Domain Option"),n.data&&d.createElement(kv,{domainOption:n.data,saveDomainOption:function(e,t){return i.fetch(r,hv(e,t))}}))}function Pv(e){return(Pv="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 xv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nv(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 Rv(e,t,n){return t&&Nv(e.prototype,t),n&&Nv(e,n),e}function Dv(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&&Mv(e,t)}function Mv(e,t){return(Mv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Uv(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Vv(e);if(t){var i=Vv(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Fv(this,n)}}function Fv(e,t){return!t||"object"!==Pv(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 Vv(e){return(Vv=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Bv=function(e){Dv(n,e);var t=Uv(n);function n(){return xv(this,n),t.apply(this,arguments)}return Rv(n,[{key:"channelName",get:function(){return l.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}(r.AppRouter),zv=function(e){Dv(n,e);var t=Uv(n);function n(){return xv(this,n),t.apply(this,arguments)}return Rv(n,[{key:"domainOptions",value:function(){this.layout.showChildView(kn,d.createElement(Av,null))}},{key:"newDomainOption",value:function(){this.layout.showChildView(kn,d.createElement(Lv,null))}},{key:"editDomainOption",value:function(e){this.layout.showChildView(kn,d.createElement(_v,{optionId:e}))}},{key:"deleteDomainOption",value:function(e){this.layout.showChildView(Ln,d.createElement(Sv,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 y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_n,d.createElement(tv,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Domain Options Application"}},{key:"channelName",get:function(){return l.DOMAIN_OPTIONS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT}}}],[{key:"router",get:function(){return Bv}}]),n}(r.Application),Hv=function(e){return e?"".concat("/api/master/v2/people","?cursor=").concat(e):"/api/master/v2/people"},qv=function(e){return"/api/master/v2/objects/".concat(e)},Jv=function(){return"/api/master/v2/people"},$v=function(e){return"/api/master/v2/objects/".concat(e)},Kv="people",Yv="person",Gv="update:person",Wv=function(e){return{key:"".concat(Kv).concat(e?":".concat(e):""),url:Hv(e)}},Zv=function(e){return{key:"".concat(Yv,":").concat(e),url:qv(e)}},Qv=function(e,t,n){return{key:Yv,url:Jv(),data:e,type:Cr.POST,success:t,error:n,invalidationKeys:[Kv]}},Xv=function(e,t,n){return{key:"".concat(Gv,":").concat(e),url:$v(e),data:t,type:Cr.PUT,always:n}},eb=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown();function tb(e){var t=_s();return d.createElement(Bs,null,d.createElement(iu,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this person",autoFocus:!0}),d.createElement(wu,{isNew:e.isNew}))}function nb(e){return d.createElement(Ys,{initialValues:e.person,validationSchema:eb,onSubmit:e.savePerson},d.createElement(tb,{isNew:!(e.person&&e.person.id)}))}function rb(e){var t=Object(bn.useDispatch)(),n=i.useBasicFetch(Zv(e.id));return d.createElement(d.Fragment,null,!!n.data&&d.createElement(nb,{person:n.data,savePerson:function(n,r){return i.fetch(t,Xv(e.id,n,r))}}))}function ib(){var e=Object(bn.useDispatch)();return d.createElement(nb,{savePerson:function(t,n){i.fetch(e,Qv(t,(function(e){n(),r.AppLinkHelper.trigger({application:l.PEOPLE,action:a.People.EDIT_PERSON,args:[e.id]})}),n))}})}var ob=l.PEOPLE,ab=function(e){return{application:ob,action:a.People.EDIT_PERSON,args:[e.id]}},cb=function(e){return r.AppLinkHelper.trigger(ab(e))};function sb(e){var t=i.useBasicFetch(Wv(e.cursor));return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-3 w-50"},d.createElement(hd,{placeholder:"Search for a person",onSuggestionSelected:cb,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/people/instant/raw","?q=").concat(e)},activationLength:2})),d.createElement(_m,{collection:t&&t.data,collectionAppLink:{application:ob,action:a.People.PEOPLE},newObjectAppLink:{application:ob,action:a.People.NEW_PERSON},getObjectAppLink:ab,objectName:"Person"}))}function ub(e){return(ub="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 lb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fb(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 pb(e,t,n){return t&&fb(e.prototype,t),n&&fb(e,n),e}function db(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&&mb(e,t)}function mb(e,t){return(mb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function hb(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=vb(e);if(t){var i=vb(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return yb(this,n)}}function yb(e,t){return!t||"object"!==ub(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 vb(e){return(vb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var bb=function(e){db(n,e);var t=hb(n);function n(){return lb(this,n),t.apply(this,arguments)}return pb(n,[{key:"channelName",get:function(){return l.PEOPLE}},{key:"appRoutes",get:function(){return{"manage/people(/)":"people","manage/people/new(/)":"newPerson","manage/people/:id(/)":"editPerson"}}}]),n}(r.AppRouter),gb=function(e){db(n,e);var t=hb(n);function n(){return lb(this,n),t.apply(this,arguments)}return pb(n,[{key:"people",value:function(e){var t=e.cursor;this.layout.showChildView(kn,d.createElement(sb,{cursor:t}))}},{key:"newPerson",value:function(){this.layout.showChildView(kn,d.createElement(ib,null))}},{key:"editPerson",value:function(e){this.layout.showChildView(kn,d.createElement(rb,{id:e}))}},{key:"name",get:function(){return"People Application"}},{key:"channelName",get:function(){return l.PEOPLE}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT}}}],[{key:"router",get:function(){return bb}}]),n}(r.Application);function Sb(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Eb(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 Eb(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 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=e.imageType,n=e.closePopup,r=d.useContext(hm),i=r.getDataUrl,o=r.setImage,a=Sb(d.useState(i()),1)[0],c=Sb(d.useState(!1),2),s=c[0],u=c[1],l=cy(p.IMAGE_UPLOAD),f=function(e){o(e),n()},m={dataUrl:a,imageType:t,minWidth:nm[t].width,minHeight:nm[t].height,onCrop:function(e){return l.uploadBase64Image(e,t,f,n)},onCancel:n};return d.createElement(by,{title:"Crop Image",size:"lg",closePopup:n,onEntered:function(){return u(!0)}},s&&d.createElement(Tm,Object.assign({},m)))}var Cb=function(e){var t=e.children;return d.createElement(ym,null,t)};function Ab(e){var t=e.page,n=e.totalPages,r=Mu.isNumber(t)&&t>0&&t<n&&t+1,i=Mu.isNumber(t)&&t>1&&t-1,o={};if(r&&r<=n&&(o.next=r.toString()),i&&(o.previous=i.toString()),!Rr.isEmpty(o))return o}var jb,wb={convertLegacyPaginatedCollection:function(e){if(e)return{data:e.data,pagination:{cursors:Ab(e.pagination),limit:e.pagination.pageSize}}}};!function(e){e.Developer="Curator Devs",e.Content="Content",e.Curator="Curators",e.Support="Support",e.SalesSupport="Sales Support"}(jb||(jb={}));var Ib=function(){return[{value:"protected",access:"r"}]},Tb=function(e){return[jb.Developer,jb.Content].some((function(t){return fm(e).includes(t)}))},kb=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:wb.convertLegacyPaginatedCollection}},Lb=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:wb.convertLegacyPaginatedCollection}},_b=function(e){return{key:"playlist:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=cover,banner")}},Pb=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("&"))}},xb=function(e,t,n,r,i){return{url:"/api/master/v2/objects/".concat(t,"/playlists"),key:"playlist",data:Object.assign(Object.assign({},e),{permissions:Ib()}),type:Cr.POST,invalidationKeys:"playlists",success:n,error:r,always:i}},Nb=function(e,t,n,r,i){return{url:"/api/master/v2/objects/".concat(e),key:"update:playlist:".concat(e),data:t,type:Cr.PUT,success:n,error:r,always:i}},Rb=function(e,t,n,r){return{url:"/api/master/v1/playlists/".concat(e),key:"delete:playlist:".concat(e),type:Cr.DELETE,invalidationKeys:"playlists",success:t,error:n,always:r}},Db=function(e){return{key:"playlist:".concat(e,":videos"),url:"/api/master/v2/objects/".concat(e,"/videos?query={orderBy:orderindex,limit:100}")}},Mb=function(e,t,n,r){return{key:"reorder:playlist",url:"/api/master/v1/objects/".concat(e,"/videos/reorder"),data:t,type:Cr.PUT,invalidationKeys:"playlist:".concat(e,":videos"),success:n,error:r}},Ub=function(e,t,n,r,i){return{key:"remove:playlist:video",url:"/api/master/v1/playlists/".concat(e,"/dissociate/").concat(t),type:Cr.DELETE,invalidationKeys:"playlist:".concat(e,":videos"),success:n,error:r,always:i}};function Fb(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vb(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 Vb(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 Vb(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 Bb(e){var t=Object(bn.useDispatch)(),n=yy(),o=Fb(d.useState(!1),2),c=o[0],s=o[1],u=i.useBasicFetch(_b(e.playlistId));var f=[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){s(!0),i.fetch(t,Rb(e.playlistId,(function(){n.success("Successfully deleted playlist."),r.AppLinkHelper.trigger({application:l.PLAYLISTS,action:a.Playlists.PLAYLISTS})}),(function(){s(!1),n.error("Failed to delete playlist.")}),e.closePopup))},buttonText:"Yes, delete playlist",isSpinnerButton:!0,showSpinner:c}],p=!!u.data;return d.createElement(by,{title:"Delete Playlist",closePopup:e.closePopup,showLoadingSpinner:!p},p&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,u.data.name),"?"),d.createElement("p",null,"Please ensure it is not being used in any widgets.")),d.createElement(Sy,{buttons:f})))}var zb=function(e,t){return{url:"/api/currentUser",key:"currentuser",success:e,error:t}},Hb=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Gs.string().trim().max(65535,"Description is too long").default(""),cover:Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown(),banner:Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown()}).noUnknown(),qb=function(e,t){var n=l.PLAYLISTS,r=a.Playlists,i=[{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 Tb(e)&&i.push.apply(i,[{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]}}]),i};function Jb(e){var t=_s(),n=cu(t);return d.createElement(Bs,null,d.createElement(iu,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this playlist",autoFocus:!0}),d.createElement(iu,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this playlist here"}),d.createElement(Em,{imageType:Bd.Covers,fieldName:"cover",application:l.PLAYLISTS,uploadAction:a.Playlists.UPLOAD_IMAGE}),d.createElement(Em,{imageType:Bd.Banners,fieldName:"banner",application:l.PLAYLISTS,uploadAction:a.Playlists.UPLOAD_IMAGE}),d.createElement("div",{className:"d-flex justify-content-between align-items-center"},d.createElement(fu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.id?"Save":"Create"),!!e.actions&&d.createElement(Bm,{actions:e.actions})))}function $b(e){var t,n=e.playlist&&e.playlist.id;return d.createElement(Ys,{initialValues:e.playlist,validationSchema:Hb,onSubmit:e.savePlaylist},d.createElement(Jb,{id:n,actions:!!n&&(t=n,[{label:"Delete playlist",appLink:{application:l.PLAYLISTS,action:a.Playlists.DELETE_PLAYLIST,args:[t]},className:"text-danger"}])}))}function Kb(e){return d.createElement("div",{className:"py-2"},d.createElement(Km,{tabs:qb(e.currentUser,e.playlistId),isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}));var t}function Yb(e){var t=Object(bn.useDispatch)(),n=yy(),r=i.useBasicFetch(_b(e.playlistId)),o=i.useBasicFetch(zb());return d.createElement(d.Fragment,null,!!o.data&&d.createElement(Kb,{playlistId:e.playlistId,activeAction:a.Playlists.EDIT_PLAYLIST,currentUser:o.data}),!!r.data&&d.createElement($b,{playlist:r.data,savePlaylist:function(r,o){i.fetch(t,Nb(e.playlistId,r,(function(){n.success("Successfully updated playlist.")}),(function(){n.error("Failed to update playlist.")}),o))}}))}var Gb=function(e,t){var n=e.dataServiceName,r=e.eventPrefix,i=e.fetchData,o=e.setData,a=e.onError,c=e.deleteEventPrefix;if(hn(i)){if(hn(o)){var s=a&&hn(a),u=ay.getInstance(n),l=y.Radio.channel(u.channelName),f="".concat(r,":request"),p="".concat(r,":sync"),d="".concat(r,":error"),m="".concat(r,":invalidate"),h=c&&"".concat(c,":sync"),v=function(){return t(!1)},b=function(){return t(!0)},g=function(){return t(!1)},S=function(){return l.off(m,g)};l.once(f,v),l.once(p,b),l.once(m,g),s&&l.once(d,a),h&&l.once(h,S);var E=i(u);return E&&(t(!0),e.setData(E)),function(){ay.releaseInstance(n),l.off(f,v),l.off(p,b),l.off(m,g),s&&l.off(d,a),h&&l.off(h,S)}}K.throw(new Xe("A setData function must be passed to fetch"))}else K.throw(new Xe("A fetchData function must be passed to fetch"))};function Wb(e){return function(e){if(Array.isArray(e))return Xb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Qb(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 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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||Qb(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){if(e){if("string"==typeof e)return Xb(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)?Xb(e,t):void 0}}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}var eg=function(e){return Array(Array.isArray(e)?e.length:0).fill(!1)};function tg(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=d.useState(eg(e)),i=Zb(r,2),o=i[0],a=i[1];d.useEffect((function(){a(eg(e))}),Wb(t)),d.useEffect((function(){if(n){var t=[];return e&&e.forEach((function(e,n){t.push(Gb(e,(function(e){e!==o[n]&&a(Ci(o,n,e))})))})),function(){return t.forEach((function(e){return e()}))}}}),[o,n])}function ng(e){return function(e){if(Array.isArray(e))return og(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||ig(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 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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||ig(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){if(e){if("string"==typeof e)return og(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)?og(e,t):void 0}}function og(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,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=d.useState(!1),i=rg(r,2),o=i[0],a=i[1];d.useEffect((function(){a(!1)}),ng(t)),d.useEffect((function(){if(n)return Gb(e,a)}),[o,n])}var cg,sg,ug,lg,fg,pg=function(e,t,n){return function(r){return e((function(e){var i=hn(n)?n:yn();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)))}))}},dg={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"}(cg||(cg={})),function(e){e.Playlists="playlists",e.Series="series",e.Videos="videos"}(sg||(sg={})),function(e){e.Playlists="playlists",e.Series="series",e.Videos="videos"}(ug||(ug={})),function(e){e.Root="0"}(lg||(lg={})),function(e){e.Root="root"}(fg||(fg={}));var mg,hg=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default(""),backboneAudienceIds:Gs.array().of(Gs.string()).required("A level is required").default([])}).noUnknown();!function(e){e.Subject="Subject",e.Topic="Topic"}(mg||(mg={}));var yg=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default(""),parentIds:Gs.array().of(Gs.string()).default([fg.Root]),backboneClassificationIds:Gs.array().of(Gs.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:Gs.mixed().required("Type is required").default(mg.Subject),emphasize:Gs.boolean().default(!1),comingSoon:Gs.boolean().default(!0),canBePreferred:Gs.boolean().default(!1),cover:Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown(),banner:Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown()}).noUnknown(),vg=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default("")}).noUnknown(),bg=Gs.object().shape({name:Gs.string().max(255,"Name is too long").required("Name is required"),description:Gs.string().max(65535,"Description is too long").required("Description is required")}),gg=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default(""),parentId:Gs.string().default(lg.Root)}).noUnknown(),Sg={singularizeMemberType:function(e){switch(e){case sg.Playlists:return"playlist";case sg.Series:return"series";case sg.Videos:return"video"}},getMemberAppLink:function(e,t){var n=[t];switch(e){case sg.Playlists:return{application:l.PLAYLISTS,action:a.Playlists.EDIT_PLAYLIST,args:n};case sg.Series:return{application:l.SERIES,action:a.Series.EDIT_SERIES,args:n};case sg.Videos:return{application:l.VIDEOS,action:a.Videos.EDIT_VIDEO,args:n}}},getMemberActions:function(e,t,n,r){return[{label:"Remove ".concat(Sg.singularizeMemberType(n)),appLink:{application:l.SUBJECTS,action:t===cg.Subject?a.Subjects.REMOVE_SUBJECT_MEMBER:a.Subjects.REMOVE_CLASSIFICATION_MEMBER,args:[e,r,n]},className:"text-danger"}]}},Eg=function(){var e=l.SUBJECTS,t=a.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]}]},Og=function(e,t){var n=l.SUBJECTS,r=a.Subjects,i=[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:i});return t&&(r.params={presentationId:t}),{label:e.label,appLink:r}}))},Cg=function(e,t){var n=l.SUBJECTS,r=a.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]}}]},Ag=function(e,t){var n=l.SUBJECTS,r=a.Subjects,i=[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:i});return t&&(r.params={presentationId:t}),{label:e.label,appLink:r}}))},jg=function(e,t){var n=l.SUBJECTS,r=a.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]}}]},wg={singularizeMemberType:function(e){switch(e){case ug.Playlists:return"playlist";case ug.Series:return"series";case ug.Videos:return"video"}},getMemberAppLink:function(e,t){var n=[t];switch(e){case ug.Playlists:return{application:l.PLAYLISTS,action:a.Playlists.EDIT_PLAYLIST,args:n};case ug.Series:return{application:l.SERIES,action:a.Series.EDIT_SERIES,args:n};case ug.Videos:return{application:l.VIDEOS,action:a.Videos.EDIT_VIDEO,args:n}}},getMemberActions:function(e,t,n,r){return[{label:"Remove ".concat(wg.singularizeMemberType(n)),appLink:{application:l.SUBJECTS,action:t===cg.Level?a.Subjects.REMOVE_LEVEL_MEMBER:a.Subjects.REMOVE_AUDIENCE_MEMBER,args:[e,r,n]},className:"text-danger"}]}};function Ig(e){return(Ig="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 Tg(e){return function(e){if(Array.isArray(e))return kg(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 kg(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 kg(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 kg(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,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _g(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 Pg(e,t){return(Pg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function xg(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Rg(e);if(t){var i=Rg(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ng(this,n)}}function Ng(e,t){return!t||"object"!==Ig(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 Rg(e){return(Rg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Dg=function(){return"/api/subjects/v1/backbone-classifications/tree"},Mg=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},Ug=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/").concat(t,"?query={limit:100}")},Fg=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},Vg=function(){return"/api/subjects/v1/backbone-classifications"},Bg=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},zg=function(e){return"/api/subjects/v1/backbone-classifications/".concat(e)},Hg=function(e){return"/api/subjects/v1/objects/".concat(e,"/backbone-classifications")},qg=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/backbone-classifications?addToClassifications=").concat(!!t)},Jg=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/objects?addToClassifications=").concat(!!t)},$g=function(e,t){return"/api/subjects/v1/backbone-classifications/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},Kg=function(){return"/api/subjects/v1/presentations"},Yg=function(e){return"/api/subjects/v1/presentations/".concat(e)},Gg=function(){return"/api/subjects/v1/presentations"},Wg=function(e){return"/api/subjects/v1/presentations/".concat(e)},Zg=function(e){return"/api/subjects/v1/presentations/".concat(e,"/classifications/tree")},Qg=function(e){return"/api/subjects/v1/classifications/".concat(e,"?query=cover,banner,followers")},Xg=function(e,t){return"/api/subjects/v1/classifications/".concat(e,"/").concat(t,"?query={limit:100}")},eS=function(){return"/api/subjects/v1/classifications"},tS=function(e){return"/api/subjects/v1/classifications/".concat(e)},nS=function(e){return"/api/subjects/v1/classifications/".concat(e)},rS=function(e){return"/api/subjects/v1/objects/".concat(e,"/classifications")},iS=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/classifications?presentationId=").concat(t)},oS=function(e){return"/api/subjects/v1/classifications/".concat(e,"/objects")},aS=function(e,t){return"/api/subjects/v1/classifications/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},cS=function(){return"/api/subjects/v1/backbone-audiences"},sS=function(e){return"/api/subjects/v1/backbone-audiences/".concat(e)},uS=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/").concat(t,"?query={limit:100}")},lS=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},fS=function(){return"/api/subjects/v1/backbone-audiences"},pS=function(e){return"/api/subjects/v1/backbone-audiences/".concat(e)},dS=function(e){return"/api/subjects/v1/objects/".concat(e,"/backbone-audiences")},mS=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/backbone-audiences?addToAudiences=").concat(!!t)},hS=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/objects?addToAudiences=").concat(!!t)},yS=function(e,t){return"/api/subjects/v1/backbone-audiences/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},vS=function(e){return"/api/subjects/v1/presentations/".concat(e,"/audiences")},bS=function(e){return"/api/subjects/v1/audiences/".concat(e)},gS=function(e,t){return"/api/master/v2/objects/".concat(e,"/").concat(t,"?query={limit:100}")},SS=function(){return"/api/subjects/v1/audiences"},ES=function(e){return"/api/subjects/v1/audiences/".concat(e)},OS=function(e){return"/api/subjects/v1/audiences/".concat(e)},CS=function(e){return"/api/subjects/v1/objects/".concat(e,"/audiences")},AS=function(e,t){return"/api/subjects/v1/objects/".concat(e,"/audiences?presentationId=").concat(t)},jS=function(e){return"/api/subjects/v1/audiences/".concat(e,"/objects")},wS=function(e,t){return"/api/subjects/v1/audiences/".concat(e,"/objects?").concat(t.map((function(e){return"objectId=".concat(e)})).join("&"))},IS=function(e,t,n){var r="".concat(c.SUBJECT,":").concat(e);return t&&(r+=":".concat(t)),r+=":".concat(c.CLASSIFICATIONS),n&&(r+=":".concat(n)),r},TS=function(e,t,n){var r="".concat(c.LEVEL,":").concat(e);return t&&(r+=":".concat(t)),r+=":".concat(c.AUDIENCES),n&&(r+=":".concat(n)),r},kS=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&&Pg(e,t)}(o,e);var t,n,r,i=xg(o);function o(){return Lg(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"getPresentations",value:function(e,t){return this.get({resource:Kg(),eventPrefix:c.PRESENTATIONS,expiryTime:dg.STANDARD,callback:e,errorCallback:t})}},{key:"getPresentation",value:function(e,t,n){return this.get({resource:Yg(e),eventPrefix:"".concat(c.PRESENTATION,":").concat(e),expiryTime:dg.STANDARD,callback:t,errorCallback:n})}},{key:"createPresentation",value:function(e,t,n){return this.create({resource:Gg(),data:e,callback:t,errorCallback:n,eventPrefix:c.PRESENTATION,invalidationKeys:[c.PRESENTATIONS],expiryTime:dg.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:Wg(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_PRESENTATION,":").concat(e),invalidationKeys:["".concat(c.PRESENTATION,":").concat(e),c.PRESENTATIONS],expiryTime:dg.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:Dg(),formatData:function(e){return{children:e,name:lg.Root,id:null}},eventPrefix:c.SUBJECTS,expiryTime:dg.STANDARD,callback:e,errorCallback:t})}},{key:"getSubject",value:function(e,t,n){return this.get({resource:Mg(e),eventPrefix:"".concat(c.SUBJECT,":").concat(e),expiryTime:dg.STANDARD,callback:t,errorCallback:n})}},{key:"getSubjectMemberIds",value:function(e,t,n,r){return this.get({resource:Ug(e,t),eventPrefix:"".concat(c.SUBJECT,":").concat(e,":").concat(t),expiryTime:dg.STANDARD,callback:n,errorCallback:r})}},{key:"getSubjectClassifications",value:function(e,t,n,r,i){return this.get({resource:Fg(e,t,n),eventPrefix:IS(e,t,n),expiryTime:dg.STANDARD,callback:r,errorCallback:i})}},{key:"createSubject",value:function(e,t,n){return this.create({resource:Vg(),data:e,callback:t,errorCallback:n,eventPrefix:c.SUBJECT,invalidationKeys:[c.SUBJECTS],expiryTime:dg.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:Bg(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_SUBJECT,":").concat(e),invalidationKeys:["".concat(c.SUBJECT,":").concat(e),c.SUBJECTS],expiryTime:dg.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:zg(e),callback:t,errorCallback:n,eventPrefix:c.DELETE_SUBJECT,invalidationKeys:["".concat(c.SUBJECT,":").concat(e),c.SUBJECTS],successHandler:this.alertService.success("Successfully deleted subject."),errorHandler:function(e){var t,n=(null===(t=e)||void 0===t?void 0:t.code)===oi.Conflict?"Cannot delete a subject with child subjects and/or classifications.":"Failed to delete subject.";r.alertService.error(n)()}})}},{key:"getObjectSubjects",value:function(e,t,n,r){return this.get({resource:Hg(e),eventPrefix:"".concat(t,":").concat(e,":").concat(c.SUBJECTS),expiryTime:dg.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectSubjects",value:function(e,t,n,r,i,o){var a=Sg.singularizeMemberType(n),s=["".concat(n,":").concat(e,":").concat(c.SUBJECTS)];return r&&s.push("".concat(n,":").concat(e,":").concat(c.CLASSIFICATIONS)),s.push.apply(s,Tg(t.map((function(e){return"".concat(c.SUBJECTS,":").concat(e,":").concat(n)})))),this.update({resource:qg(e,r),data:t,callback:i,errorCallback:o,eventPrefix:"".concat(c.UPDATE_OBJECT_SUBJECTS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(a," subjects.")),errorHandler:this.alertService.error("Failed to update ".concat(a," subjects."))})}},{key:"addObjectsToSubject",value:function(e,t,n,r,i,o){var a=1===t.length?Sg.singularizeMemberType(n):n,s=["".concat(c.SUBJECT,":").concat(e,":").concat(n)].concat(Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.SUBJECTS)}))),Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.CLASSIFICATIONS)}))));return this.create({resource:Jg(e,r),data:t,callback:i,errorCallback:o,eventPrefix:"".concat(c.ADD_TO_SUBJECT,":").concat(e,":").concat(n),invalidationKeys:s,expiryTime:dg.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(a," to subject.")),errorHandler:this.alertService.error("Failed to add ".concat(a," to subject."))})}},{key:"removeObjectsFromSubject",value:function(e,t,n,r,i){var o=1===t.length?Sg.singularizeMemberType(n):n,a=["".concat(c.SUBJECT,":").concat(e,":").concat(n)].concat(Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.SUBJECTS)}))));return this.delete({resource:$g(e,t),callback:r,errorCallback:i,eventPrefix:"".concat(c.REMOVE_FROM_SUBJECT,":").concat(e,":").concat(n),invalidationKeys:a,expiryTime:dg.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:Zg(e),formatData:function(e){return{children:e,name:fg.Root,id:null}},eventPrefix:"".concat(c.CLASSIFICATIONS,":").concat(e),expiryTime:dg.STANDARD,callback:t,errorCallback:n})}},{key:"getClassification",value:function(e,t,n){return this.get({resource:Qg(e),eventPrefix:"".concat(c.CLASSIFICATION,":").concat(e),expiryTime:dg.STANDARD,callback:t,errorCallback:n})}},{key:"getClassificationMembers",value:function(e,t,n,r){return this.get({resource:Xg(e,t),eventPrefix:"".concat(c.CLASSIFICATION,":").concat(e,":").concat(t),expiryTime:dg.STANDARD,callback:n,errorCallback:r})}},{key:"createClassification",value:function(e,t,n){return this.create({resource:eS(),data:e,callback:t,errorCallback:n,eventPrefix:c.CLASSIFICATION,invalidationKeys:[c.CLASSIFICATIONS],expiryTime:dg.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:tS(e),data:Rr.omit(t,["followers"]),callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_CLASSIFICATION,":").concat(e),invalidationKeys:["".concat(c.CLASSIFICATION,":").concat(e),c.CLASSIFICATIONS],expiryTime:dg.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:nS(e),callback:t,errorCallback:n,eventPrefix:c.DELETE_CLASSIFICATION,invalidationKeys:["".concat(c.CLASSIFICATION,":").concat(e),c.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:rS(e),eventPrefix:"".concat(t,":").concat(e,":").concat(c.CLASSIFICATIONS),expiryTime:dg.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectClassifications",value:function(e,t,n,r,i,o){var a=Sg.singularizeMemberType(r),s=["".concat(r,":").concat(e,":").concat(c.CLASSIFICATIONS)];return s.push.apply(s,Tg(n.map((function(e){return"".concat(c.CLASSIFICATION,":").concat(e,":").concat(r)})))),this.update({resource:iS(e,t),data:n,callback:i,errorCallback:o,eventPrefix:"".concat(c.UPDATE_OBJECT_CLASSIFICATIONS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(a," classifications.")),errorHandler:this.alertService.error("Failed to update ".concat(a," classifications."))})}},{key:"addObjectsToClassification",value:function(e,t,n,r,i,o,a){var s=1===t.length?Sg.singularizeMemberType(n):n,u=["".concat(c.CLASSIFICATION,":").concat(e,":").concat(n)];return r&&u.push(IS(r,i,n)),u.push.apply(u,Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.CLASSIFICATIONS)})))),this.create({resource:oS(e),data:t,callback:o,errorCallback:a,eventPrefix:"".concat(c.ADD_TO_CLASSIFICATION,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:dg.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,a){var s=1===t.length?Sg.singularizeMemberType(n):n,u=["".concat(c.CLASSIFICATION,":").concat(e,":").concat(n)];return r&&u.push(IS(r,i,n)),u.push.apply(u,Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.CLASSIFICATIONS)})))),this.delete({resource:aS(e,t),callback:o,errorCallback:a,eventPrefix:"".concat(c.REMOVE_FROM_CLASSIFICATION,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:dg.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:cS(),eventPrefix:c.LEVELS,expiryTime:dg.STANDARD,callback:e,errorCallback:t})}},{key:"getLevel",value:function(e,t,n){return this.get({resource:sS(e),eventPrefix:"".concat(c.LEVEL,":").concat(e),expiryTime:dg.STANDARD,callback:t,errorCallback:n})}},{key:"getLevelMemberIds",value:function(e,t,n,r){return this.get({resource:uS(e,t),eventPrefix:"".concat(c.LEVEL,":").concat(e,":").concat(t),expiryTime:dg.STANDARD,callback:n,errorCallback:r})}},{key:"getLevelAudiences",value:function(e,t,n,r,i){return this.get({resource:lS(e,t,n),eventPrefix:TS(e,t,n),expiryTime:dg.STANDARD,callback:r,errorCallback:i})}},{key:"createLevel",value:function(e,t,n){return this.create({resource:fS(),data:e,callback:t,errorCallback:n,eventPrefix:c.LEVEL,invalidationKeys:[c.LEVELS],expiryTime:dg.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:pS(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_LEVEL,":").concat(e),invalidationKeys:["".concat(c.LEVEL,":").concat(e),c.LEVELS],expiryTime:dg.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:dS(e),eventPrefix:"".concat(t,":").concat(e,":").concat(c.LEVELS),expiryTime:dg.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectLevels",value:function(e,t,n,r,i,o){var a=Sg.singularizeMemberType(n),s=["".concat(n,":").concat(e,":").concat(c.LEVELS)];return r&&s.push("".concat(n,":").concat(e,":").concat(c.AUDIENCES)),this.update({resource:mS(e,r),data:t,callback:i,errorCallback:o,eventPrefix:"".concat(c.UPDATE_OBJECT_LEVELS,":").concat(e),invalidationKeys:s,successHandler:this.alertService.success("Successfully updated ".concat(a," levels.")),errorHandler:this.alertService.error("Failed to update ".concat(a," levels."))})}},{key:"addObjectsToLevel",value:function(e,t,n,r,i,o){var a=1===t.length?wg.singularizeMemberType(n):n,s=["".concat(c.LEVEL,":").concat(e,":").concat(n)].concat(Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.LEVELS)}))),Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.AUDIENCES)}))));return this.create({resource:hS(e,r),data:t,callback:i,errorCallback:o,eventPrefix:"".concat(c.ADD_TO_LEVEL,":").concat(e,":").concat(n),invalidationKeys:s,expiryTime:dg.STANDARD,successHandler:this.alertService.success("Successfully added ".concat(a," to level.")),errorHandler:this.alertService.error("Failed to add ".concat(a," to level."))})}},{key:"removeObjectsFromLevel",value:function(e,t,n,r,i){var o=1===t.length?wg.singularizeMemberType(n):n,a=["".concat(c.LEVEL,":").concat(e,":").concat(n)].concat(Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.LEVELS)}))));return this.delete({resource:yS(e,t),callback:r,errorCallback:i,eventPrefix:"".concat(c.REMOVE_FROM_LEVEL,":").concat(e,":").concat(n),invalidationKeys:a,expiryTime:dg.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:vS(e),callback:t,errorCallback:n,eventPrefix:"".concat(c.AUDIENCES,":").concat(e),expiryTime:dg.STANDARD})}},{key:"getAudience",value:function(e,t,n){return this.get({resource:bS(e),callback:t,errorCallback:n,eventPrefix:"".concat(c.AUDIENCE,":").concat(e),expiryTime:dg.STANDARD})}},{key:"getAudienceMembers",value:function(e,t,n,r){return this.get({resource:gS(e,t),eventPrefix:"".concat(c.AUDIENCE,":").concat(e,":").concat(t),expiryTime:dg.STANDARD,callback:n,errorCallback:r})}},{key:"createAudience",value:function(e,t,n){return this.create({resource:SS(),data:e,callback:t,errorCallback:n,eventPrefix:c.AUDIENCE,invalidationKeys:[c.AUDIENCES],expiryTime:dg.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:ES(e),data:t,callback:n,errorCallback:r,eventPrefix:"".concat(c.UPDATE_AUDIENCE,":").concat(e),invalidationKeys:["".concat(c.AUDIENCE,":").concat(e),c.AUDIENCES],expiryTime:dg.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:OS(e),callback:t,errorCallback:n,eventPrefix:c.DELETE_AUDIENCE,invalidationKeys:["".concat(c.AUDIENCE,":").concat(e),c.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:CS(e),eventPrefix:"".concat(t,":").concat(e,":").concat(c.AUDIENCES),expiryTime:dg.STANDARD,callback:n,errorCallback:r})}},{key:"updateObjectAudiences",value:function(e,t,n,r,i,o){var a=Sg.singularizeMemberType(r);return this.update({resource:AS(e,t),data:n,callback:i,errorCallback:o,eventPrefix:"".concat(c.UPDATE_OBJECT_AUDIENCES,":").concat(e),invalidationKeys:["".concat(r,":").concat(e,":").concat(c.AUDIENCES)],successHandler:this.alertService.success("Successfully updated ".concat(a," audiences.")),errorHandler:this.alertService.error("Failed to update ".concat(a," audiences."))})}},{key:"addObjectsToAudience",value:function(e,t,n,r,i,o,a){var s=1===t.length?wg.singularizeMemberType(n):n,u=["".concat(c.AUDIENCE,":").concat(e,":").concat(n)];return r&&u.push(TS(r,i,n)),u.push.apply(u,Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.AUDIENCES)})))),this.create({resource:jS(e),data:t,callback:o,errorCallback:a,eventPrefix:"".concat(c.ADD_TO_AUDIENCE,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:dg.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,a){var s=1===t.length?wg.singularizeMemberType(n):n,u=["".concat(c.AUDIENCE,":").concat(e,":").concat(n)];return r&&u.push(TS(r,i,n)),u.push.apply(u,Tg(t.map((function(e){return"".concat(n,":").concat(e,":").concat(c.AUDIENCES)})))),this.delete({resource:wS(e,t),callback:o,errorCallback:a,eventPrefix:"".concat(c.REMOVE_FROM_AUDIENCE,":").concat(e,":").concat(n),invalidationKeys:u,expiryTime:dg.STANDARD,successHandler:this.alertService.success("Successfully removed ".concat(s," from audience.")),errorHandler:this.alertService.error("Failed to remove ".concat(s," from audience."))})}},{key:"name",get:function(){return p.SUBJECT}},{key:"channelName",get:function(){return f.SUBJECT}}])&&_g(t.prototype,n),r&&_g(t,r),o}(mr),LS={dataServiceName:p.SUBJECT,dataChannelName:f.SUBJECT},_S={getSubjectTreeFetchOptions:function(e,t){return Object.assign(Object.assign({},LS),{eventPrefix:c.SUBJECTS,fetchData:function(e){return e.getSubjectTree()},setData:e,onError:t})},getSubjectFetchOptions:function(e,t,n){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.SUBJECT,":").concat(e),fetchData:function(t){return t.getSubject(e)},setData:t,onError:n,deleteEventPrefix:c.DELETE_SUBJECT})},getSubjectMemberIdsFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.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({},LS),{eventPrefix:IS(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({},LS),{eventPrefix:"".concat(t,":").concat(e,":").concat(c.SUBJECTS),fetchData:function(n){return n.getObjectSubjects(e,t)},setData:n,onError:r})},getPresentationsFetchOptions:function(e,t){return Object.assign(Object.assign({},LS),{eventPrefix:c.PRESENTATIONS,fetchData:function(e){return e.getPresentations()},setData:e,onError:t})},getPresentationFetchOptions:function(e,t,n){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.PRESENTATION,":").concat(e),fetchData:function(t){return t.getPresentation(e)},setData:t,onError:n})},getClassificationTreeFetchOptions:function(e,t,n){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.CLASSIFICATIONS,":").concat(e),fetchData:function(t){return t.getClassificationTree(e)},setData:t,onError:n})},getClassificationFetchOptions:function(e,t,n){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.CLASSIFICATION,":").concat(e),fetchData:function(t){return t.getClassification(e)},setData:t,onError:n,deleteEventPrefix:c.DELETE_CLASSIFICATION})},getClassificationMembersFetchOptions:function(e,t,n,r){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.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({},LS),{eventPrefix:"".concat(t,":").concat(e,":").concat(c.CLASSIFICATIONS),fetchData:function(n){return n.getObjectClassifications(e,t)},setData:n,onError:r})},getLevelsFetchOptions:function(e,t){return Object.assign(Object.assign({},LS),{eventPrefix:c.LEVELS,fetchData:function(e){return e.getLevels()},setData:e,onError:t})},getLevelFetchOptions:function(e,t,n){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.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({},LS),{eventPrefix:"".concat(c.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({},LS),{eventPrefix:TS(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({},LS),{eventPrefix:"".concat(t,":").concat(e,":").concat(c.LEVELS),fetchData:function(n){return n.getObjectLevels(e,t)},setData:n,onError:r})},getAudiencesFetchOptions:function(e,t,n){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.AUDIENCES,":").concat(e),fetchData:function(t){return t.getAudiences(e)},setData:t,onError:n})},getAudienceFetchOptions:function(e,t,n){return Object.assign(Object.assign({},LS),{eventPrefix:"".concat(c.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({},LS),{eventPrefix:"".concat(c.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({},LS),{eventPrefix:"".concat(t,":").concat(e,":").concat(c.AUDIENCES),fetchData:function(n){return n.getObjectAudiences(e,t)},setData:n,onError:r})}},PS=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_LEVEL,args:[e.id]}},xS=function(e,t){var n=e.backboneAudienceIds;return t.filter((function(e){return n.includes(e.id)}))};function NS(e){var t=e.showLevels;return d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",null,"Audiences"),!!t&&d.createElement("th",null,"Mapped Backbone Audience(s)")))}function RS(e){var t,n=e.audience,r=e.levels;return d.createElement("tr",null,d.createElement("td",null,d.createElement(Nd,{appLink:(t=n,{application:l.SUBJECTS,action:a.Subjects.EDIT_AUDIENCE,args:[t.presentationId,t.masterId]})},n.name)),d.createElement("td",null,r.map((function(e){return d.createElement(Nd,{key:e.id,appLink:PS(e),className:"mr-2"},e.name)}))))}function DS(e){var t=e.audiences,n=e.levels;return d.createElement(Zs.Table,{responsive:!0,bordered:!0},d.createElement(NS,{showLevels:!!t.length}),d.createElement("tbody",null,t.length?t.map((function(e){return d.createElement(RS,{key:e.masterId,audience:e,levels:xS(e,n)})})):d.createElement("tr",null,d.createElement("td",null,"This presentation has no audiences."))))}function MS(e){var t=null===e.masterId||void 0===e.masterId,n=_s(),r=cu(n);return d.createElement(Bs,null,d.createElement(iu,{label:"Name",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this audience",autoFocus:!0}),d.createElement(iu,{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 d.createElement("option",{key:e.id,value:e.id},e.name)}))),d.createElement("div",{className:"d-flex justify-content-between"},d.createElement(fu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&d.createElement(Zs.Button,{as:Nd,variant:"danger",appLink:{application:l.SUBJECTS,action:a.Subjects.DELETE_AUDIENCE,args:[e.presentationId,e.masterId]}},"Delete")))}function US(e){return d.createElement(Ys,{initialValues:e.audience,validationSchema:hg,onSubmit:e.saveAudience},d.createElement(MS,{masterId:e.audience&&e.audience.masterId,presentationId:e.presentationId,levels:e.levels}))}function FS(e){var t=e.objectAudiences,n=e.presentationAudiences;return t.filter((function(e){return n.some((function(t){return t.masterId===e.masterId}))}))}function VS(e){var t,n,r,i,o,a=Sg.singularizeMemberType(e.memberType),c=(n=(t=e).presentationAudiences,r=t.objectLevels,i=t.objectAudiences,o=r.map((function(e){return e.id})),n.filter((function(e){return wi(e.backboneAudienceIds,o).length||i.some((function(t){return t.masterId===e.masterId}))})));return d.createElement(d.Fragment,null,d.createElement("div",{className:"border-bottom pb-3 mb-3"},d.createElement("h6",null,"Backbone Audiences"),d.createElement("p",null,"Select which backbone audiences this ".concat(a," is mapped to.")),d.createElement("p",null,"To see how backbone audiences correspond to audiences, scroll down to the audience-backbone audience mappings table."),d.createElement(fE,{initialValues:{backboneAudienceIds:e.objectLevels.map((function(e){return e.id}))},saveLevels:e.saveLevels,levels:e.levels,memberType:e.memberType})),d.createElement("h6",null,"Audiences"),d.createElement("p",null,"Select a presentation to view its audiences and map them to this ".concat(a,".")),d.createElement("div",{className:"w-50 pb-3"},d.createElement(CE,{presentations:e.presentations,currentPresentationId:e.currentPresentation.id,setCurrentPresentation:e.setCurrentPresentation})),d.createElement("p",null,"Audience to backbone audience mappings for this presentation are displayed below."),d.createElement(DS,{levels:e.levels,audiences:e.presentationAudiences}),d.createElement("p",null,"Only the audiences which are mapped to a backbone audience that this"+" ".concat(a," is mapped to are displayed below.")),!!c.length&&d.createElement(zS,{initialValues:{audienceIds:FS(e).map((function(e){return e.masterId}))},saveAudiences:e.saveAudiences,audiences:c}))}function BS(e){var t=_s(),n=cu(t);return d.createElement(Bs,null,d.createElement(iu,{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 d.createElement("option",{key:e.masterId,value:e.masterId},e.name)}))),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(fu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Save Audiences")))}function zS(e){return d.createElement(Ys,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.audienceIds;return e.saveAudiences(r,n)},enableReinitialize:!0},d.createElement(BS,{audiences:e.audiences}))}var HS=function(e){return function(t){if(!e)return t.appLink.action===a.Subjects.EDIT_AUDIENCE;switch(e){case ug.Playlists:return t.appLink.action===a.Subjects.EDIT_AUDIENCE_PLAYLISTS;case ug.Series:return t.appLink.action===a.Subjects.EDIT_AUDIENCE_SERIES;case ug.Videos:return t.appLink.action===a.Subjects.EDIT_AUDIENCE_VIDEOS}}};function qS(e){var t=e.presentation,n=e.audienceId,r=e.memberType;return t?d.createElement(d.Fragment,null,d.createElement("h6",null,"Presentation: ".concat(!!t&&t.name)),d.createElement("div",{className:"py-2"},d.createElement(Km,{tabs:jg(t.id,n),isItemActive:HS(r)}))):d.createElement(d.Fragment,null)}function JS(e){var t=e.item,n=e.getItemAppLink,r=e.actions;return d.createElement("tr",null,d.createElement("td",null,d.createElement(Nd,{appLink:n(t)},t.name)),r&&d.createElement("td",null,d.createElement("span",{className:"d-flex justify-content-end"},d.createElement(Bm,{actions:r}))))}function $S(e){var t=e.items,n=e.memberType,r=e.getItemAppLink,i=e.getActions;if(!t.length)return d.createElement("div",{className:"py-5"},"No ".concat(n," in this audience."));var o="".concat(cm(wg.singularizeMemberType(n))," Name");return d.createElement(Zs.Table,{responsive:!0},d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",null,o),hn(i)&&d.createElement("th",null))),d.createElement("tbody",null,t.map((function(e){return d.createElement(JS,{item:e,key:e.id,getItemAppLink:r,actions:hn(i)&&i(e)})}))))}function KS(e){var t=e.item,n=e.getItemAppLink,r=e.actions,i=e.pinState;return d.createElement("tr",null,d.createElement("td",null,d.createElement(Nd,{appLink:n(t)},t.name)),i.isPinnable&&d.createElement("td",null,d.createElement(Fd,{selected:parseInt(t.id)===parseInt(i.currentPinnedVideo),onToggle:function(e){return i.onChange(e,t.id)},id:t.id})),r&&d.createElement("td",null,d.createElement("span",{className:"d-flex justify-content-end"},d.createElement(Bm,{actions:r}))))}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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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 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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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.items,n=e.memberType,r=e.classification,i=e.getItemAppLink,o=e.getActions,a=e.updatePinnedVideo,c=WS(d.useState(!1),2),s=c[0],u=c[1],l=function(e,t){var n=e.pinnedVideoMasterId||null,r=YS(d.useState(n),2),i=r[0],o=r[1];return{currentPinnedVideo:i,onChange:function(e,t){o(e?t:null)},canSubmit:n!==i,isPinnable:t===sg.Videos}}(r,n);if(!t.length)return d.createElement("div",{className:"py-5"},"No ".concat(n," in this classification."));var f="".concat(cm(Sg.singularizeMemberType(n))," Name");return d.createElement(d.Fragment,null,d.createElement(Zs.Table,{responsive:!0},d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",null,f),l.isPinnable&&d.createElement("th",null,"Pinned"),hn(o)&&d.createElement("th",null))),d.createElement("tbody",null,t.map((function(e){return d.createElement(KS,{item:e,key:e.id,getItemAppLink:i,actions:hn(o)&&o(e),pinState:l})})))),l.isPinnable&&d.createElement(fu,{showSpinner:s,onClick:function(){u(!0),a(l.currentPinnedVideo,(function(){return u(!1)}))},disabled:!l.canSubmit||s},"Save"))}function XS(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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}var tE=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[e]}};function nE(e){var t,n,r,i,o,c,s=_s(),u=cu(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),m=XS(d.useState(p),2),h=m[0],y=m[1];d.useEffect((function(){return y(p)}),[null===(r=e.classification)||void 0===r?void 0:r.id,s.values.parentIds]),d.useEffect((function(){s.values.backboneClassificationIds.length&&!s.touched.backboneClassificationIds&&s.setFieldTouched("backboneClassificationIds",!0)}),[s.values.backboneClassificationIds]);var v=function(e){return s.setFieldValue("parentIds",Ii(s.values.parentIds.map((function(e){return e.toString()})),e.id.toString()))},b=function(e){return s.setFieldValue("backboneClassificationIds",Ii(s.values.backboneClassificationIds.map((function(e){return e.toString()})),e.id.toString()))},g=function(e){return"".concat(Qs(s.errors,s.touched,e)," h-auto py-2")};return d.createElement(Bs,null,d.createElement(iu,{label:"Name",name:"name",id:"name",value:s.values.name,placeholder:"Enter a name for this classification",autoFocus:!0}),d.createElement(iu,{as:"select",label:"Type",name:"type",id:"type",value:s.values.type},Rr.getEnumKeys(mg).map((function(e){return d.createElement("option",{key:e,value:mg[e]},e)}))),d.createElement(iu,{label:"Coming Soon",name:"comingSoon",id:"comingSoon",type:"checkbox",checked:s.values.comingSoon}),d.createElement(iu,{label:"Emphasize",name:"emphasize",id:"emphasize",type:"checkbox",checked:s.values.emphasize}),d.createElement(iu,{label:"Can Be Preferred",name:"canBePreferred",id:"canBePreferred",type:"checkbox",checked:s.values.canBePreferred}),!f&&d.createElement(d.Fragment,null,d.createElement("label",null,"Total Followers:")," ",null===(o=null===(i=e.classification.followers)||void 0===i?void 0:i.data)||void 0===o?void 0:o.length),d.createElement(iu,{name:"parentIds"},(function(){var t,n,r;return d.createElement("div",{className:g("parentIds")},d.createElement(ah,{label:"Parent Classification(s)",tree:e.classificationTree,selectedIds:s.values.parentIds,onSelect:v,collapse:h,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=lm.find(n,r);return!!lm.find(t,e.id)})}))})),d.createElement(iu,{name:"backboneClassificationIds"},(function(){return d.createElement("div",{className:g("backboneClassificationIds")},d.createElement(ah,{label:"Mapped Subject(s)",tree:e.subjectTree,selectedIds:s.values.backboneClassificationIds,onSelect:b,collapse:!f,getSelectedItemAppLink:tE}))})),d.createElement(Em,{imageType:Bd.Covers,fieldName:"cover",application:l.SUBJECTS,uploadAction:a.Subjects.UPLOAD_IMAGE}),d.createElement(Em,{imageType:Bd.Banners,fieldName:"banner",application:l.SUBJECTS,uploadAction:a.Subjects.UPLOAD_IMAGE}),d.createElement("div",{className:"d-flex justify-content-between"},d.createElement(fu,{showSpinner:s.isSubmitting,type:"submit",disabled:!u},f?"Create":"Save"),!f&&d.createElement(Zs.Button,{as:Nd,variant:"danger",appLink:{application:l.SUBJECTS,action:a.Subjects.DELETE_CLASSIFICATION,args:[e.presentationId,null===(c=e.classification)||void 0===c?void 0:c.id]}},"Delete")))}function rE(e){return d.createElement(Ys,{initialValues:e.classification,validationSchema:yg,onSubmit:e.saveClassification},d.createElement(nE,{presentationId:e.presentationId,classificationTree:e.classificationTree,subjectTree:e.subjectTree,classification:e.classification}))}var iE=function(e){return function(t){if(!e)return t.appLink.action===a.Subjects.EDIT_CLASSIFICATION;switch(e){case sg.Playlists:return t.appLink.action===a.Subjects.EDIT_CLASSIFICATION_PLAYLISTS;case sg.Series:return t.appLink.action===a.Subjects.EDIT_CLASSIFICATION_SERIES;case sg.Videos:return t.appLink.action===a.Subjects.EDIT_CLASSIFICATION_VIDEOS}}};function oE(e){var t=e.presentation,n=e.classificationId,r=e.memberType;return t?d.createElement(d.Fragment,null,d.createElement("h6",null,"Presentation: ".concat(!!t&&t.name)),d.createElement("div",{className:"py-2"},d.createElement(Km,{tabs:Cg(t.id,n),isItemActive:iE(r)}))):d.createElement(d.Fragment,null)}function aE(e){var t=_s(),n=cu(t),r=function(e){return t.setFieldValue("classificationIds",Ii(t.values.classificationIds.map((function(e){return e.toString()})),e.id.toString()))},i="".concat(Qs(t.errors,t.touched,"classificationIds")," h-auto py-2");return d.createElement(Bs,null,d.createElement(iu,{name:"classificationIds"},(function(){return d.createElement("div",{className:i},d.createElement(ah,{label:"Mapped Classification(s)",tree:e.classificationTree,selectedIds:t.values.classificationIds,onSelect:r,getSelectedItemAppLink:(n=e.presentationId,function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[n,e]}}),isNodeDisabled:e.isClassificationDisabled}));var n})),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(fu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Save Classifications")))}function cE(e){return d.createElement(Ys,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.classificationIds;return e.saveClassifications(r,n)},enableReinitialize:!0},d.createElement(aE,{presentationId:e.presentationId,classificationTree:e.classificationTree,isClassificationDisabled:e.isClassificationDisabled}))}function sE(e){var t=null===e.id||void 0===e.id,n=_s(),r=cu(n);return d.createElement(Bs,null,d.createElement(iu,{label:"Name",type:"text",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this level",autoFocus:!0}),d.createElement(fu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"))}function uE(e){return d.createElement(Ys,{initialValues:e.level,validationSchema:vg,onSubmit:e.saveLevel},d.createElement(sE,{id:e.level&&e.level.id}))}function lE(e){var t=Sg.singularizeMemberType(e.memberType),n=_s(),r=cu(n);return d.createElement(Bs,null,d.createElement(iu,{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 d.createElement("option",{key:e.id,value:e.id},e.name)}))),d.createElement("p",null,d.createElement("strong",null,"Note:")," When removing a ".concat(t," from a backbone audience, that backbone audience's mapped audiences "),d.createElement("strong",null,"will not")," be automatically removed from."),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(fu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},"Save Backbone Audience")))}function fE(e){return d.createElement(Ys,{initialValues:e.initialValues,onSubmit:function(t,n){var r=t.backboneAudienceIds;return e.saveLevels(r,!1,n)}},d.createElement(lE,{levels:e.levels,memberType:e.memberType}))}var pE=function(e){return function(t){return t.appLink.action===e}};function dE(e){var t=e.levelId,n=e.activeAction,r=e.presentationId;return d.createElement(d.Fragment,null,d.createElement(Zs.Alert,{variant:"danger"},"Warning: You are editing the backbone audiences."),d.createElement("div",{className:"py-2"},d.createElement(Km,{tabs:Ag(t,r),isItemActive:pE(n)})))}var mE=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 hE(e){return d.createElement(d.Fragment,null,e.audiences.map((function(t){return d.createElement("th",{key:t.masterId},d.createElement("span",{className:"d-inline-block"},d.createElement(Fd,{selected:e.getIsAudienceSelected(t),onToggle:function(n){return e.onToggleAudience(t.masterId,n)}})),d.createElement(Nd,{appLink:e.getAudienceAppLink(t.masterId)},function(e,t){return t?e.name:"Audience: ".concat(e.name)}(t,e.showAudienceSubHeader)))})))}function yE(e){var t=e.memberType,n=e.hasActions,r=e.audiences,i=mE(e,["memberType","hasActions","audiences"]),o="".concat(cm(wg.singularizeMemberType(t))," Name"),a=!!r&&!!r.length,c=a&&r.length>1,s=a?2:1,u=Object.assign({audiences:r,showAudienceSubHeader:c},i);return d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",{rowSpan:s},o),a&&(c?d.createElement("th",{colSpan:r.length,className:"text-center"},"Audiences"):d.createElement(hE,Object.assign({},u))),n&&d.createElement("th",{rowSpan:s})),a&&c&&d.createElement("tr",null,d.createElement(hE,Object.assign({},u))))}function vE(e){var t=e.member,n=t.id,i=t.name,o=t.audiences,a=void 0===o?[]:o,c=e.getMemberAppLink,s=e.onToggleAudience,u=e.actions,l=hn(c)&&c(n);return a.length&&!hn(s)&&r.ErrorHelper.throw(new Xe("onToggleAudience must be passed to LevelMemberItem")),d.createElement("tr",null,d.createElement("td",null,l?d.createElement(Nd,{appLink:c(n)},i):i),!!a.length&&a.map((function(e){return d.createElement("td",{key:e.id},d.createElement(Fd,{selected:e.selected,onToggle:function(t){return s(e.id,t,n)}}))})),u&&d.createElement("td",null,d.createElement("span",{className:"d-flex justify-content-end"},d.createElement(Bm,{actions:u}))))}var bE=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 gE(e,t){return function(n){var r=n[e],i=uh(r);return!!i&&i===t.length}}function SE(e){var t=e.members,n=e.memberType,r=e.getActions,i=e.audiences,o=e.getAudienceAppLink,a=e.onToggleAudience,c=bE(e,["members","memberType","getActions","audiences","getAudienceAppLink","onToggleAudience"]);if(!t.length)return d.createElement("div",{className:"py-5"},"No ".concat(n," in this level."));var s=hn(r),u={memberType:n,audiences:i,getAudienceAppLink:o,getIsAudienceSelected:gE(n,t),onToggleAudience:a,hasActions:s};return d.createElement(Zs.Table,{responsive:!0,bordered:!0},d.createElement(yE,Object.assign({},u)),d.createElement("tbody",null,t.map((function(e,t){return d.createElement(vE,Object.assign({key:t,member:e,actions:s&&r(e.id),onToggleAudience:a},c))}))))}function EE(e){var t=e.values,n=t.name,r=t.description,i=e.id,o=e.isSubmitting,a=!i;return d.createElement(Bs,null,d.createElement(iu,{label:"Name",type:"text",name:"name",id:"name",value:n,placeholder:"Enter a name for this presentation",autoFocus:!0}),d.createElement(iu,{label:"Description",as:"textarea",name:"description",id:"description",value:r,placeholder:"Describe this presentation here"}),d.createElement(fu,{showSpinner:o,type:"submit"},a?"Create":"Save"))}function OE(e){var t=e.presentation,n=(t=void 0===t?{}:t).id,r=void 0===n?null:n,i=t.name,o=void 0===i?"":i,a=t.description,c=void 0===a?"":a,s=e.savePresentation;return d.createElement(Ds,{initialValues:{name:o,description:c},validationSchema:bg,onSubmit:s},(function(e){return d.createElement(EE,Object.assign({id:r},e))}))}function CE(e){var t=e.presentations,n=e.currentPresentationId,r=e.setCurrentPresentation,i=e.label,o=function(e){var n=function(e,t){return Oi(t.filter((function(t){return t.id.toString()===e.toString()})))}(e,t);r(n)};return d.useEffect((function(){t&&!n&&r(Oi(t))}),[t]),d.createElement(d.Fragment,null,!!n&&d.createElement(d.Fragment,null,d.createElement(Zs.Form.Label,null,i),d.createElement(Zs.Form.Control,{as:"select",value:n,onChange:function(e){return o(e.target.value)},className:"cursor-pointer"},t.map((function(e){return d.createElement("option",{value:e.id,key:e.id},e.name)})))))}function AE(e){return d.createElement(d.Fragment,null,d.createElement("h4",null,"".concat(cm(e.memberType))),d.createElement(Zs.Table,{responsive:!0},d.createElement("tbody",null,e.objects&&e.objects.map((function(t){return d.createElement("tr",{key:t.id},d.createElement("td",null,d.createElement(Nd,{appLink:Sg.getMemberAppLink(e.memberType,t.id)},t.name)))})))),d.createElement(DE,{initialValues:{backboneClassificationIds:[]},subjectTree:e.subjectTree,saveSubjects:e.onClickAddToSubject,memberType:e.memberType,saveBtnText:"Add to backbone classification",subjectRequired:!0}))}function jE(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)||function(e,t){if(!e)return;if("string"==typeof e)return wE(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 wE(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 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 IE(e){var t=Sg.singularizeMemberType(e.memberType),n=[].concat(jE(e.objectClassifications),jE(e.objectSubjectClassifications)).map((function(e){return e.id}));return d.createElement(d.Fragment,null,d.createElement("div",{className:"border-bottom pb-3 mb-3"},d.createElement("h6",null,"Backbone Classifications"),d.createElement("p",null,"Select which backbone classifications this ".concat(t," is mapped to.")),d.createElement(DE,{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})),d.createElement("h6",null,"Classifications"),d.createElement("p",null,"Select a presentation to view its classifications and map them to this ".concat(t,".")),d.createElement("div",{className:"w-50 pb-3"},d.createElement(CE,{presentations:e.presentations,currentPresentationId:e.currentPresentation.id,setCurrentPresentation:e.setCurrentPresentation})),e.currentPresentation&&e.classificationTree&&e.classificationTree.children.length?d.createElement(d.Fragment,null,d.createElement("p",null,"Only classifications which are mapped to one of the backbone classifications selected above can be selected."),d.createElement(cE,{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)}})):d.createElement("p",null,"This presentation has no classifications."))}function TE(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return kE(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 kE(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 kE(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}CE.defaultProps={label:"Presentation"};function LE(e){var t=!e.id,n=_s(),r=cu(n),i=!t||!!n.values.parentId,o=TE(d.useState(i),2),c=o[0],s=o[1];d.useEffect((function(){return s(i)}),[e.id,n.values.parentId]);var u=function(e){var t=e.id===n.values.parentId?null:e.id;n.setFieldValue("parentId",t)},f="".concat(Qs(n.errors,n.touched,"parentId")," h-auto py-2");return d.createElement(Bs,null,d.createElement(iu,{label:"Name",name:"name",id:"name",value:n.values.name,placeholder:"Enter a name for this backbone classification",autoFocus:!0}),d.createElement(iu,{name:"parentId"},(function(){return d.createElement("div",{className:f},d.createElement(ah,{label:"Parent Subject",tree:e.subjectTree,selectedIds:[n.values.parentId],onSelect:u,collapse:c,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=lm.find(t,r);return!!lm.find(n,e.id)})}));var t,r})),d.createElement("div",{className:"d-flex justify-content-between"},d.createElement(fu,{showSpinner:n.isSubmitting,type:"submit",disabled:!r},t?"Create":"Save"),!t&&d.createElement(Zs.Button,{as:Nd,variant:"danger",appLink:{application:l.SUBJECTS,action:a.Subjects.DELETE_SUBJECT,args:[e.id]}},"Delete")))}function _E(e){return d.createElement(Ys,{initialValues:e.subject,validationSchema:gg,onSubmit:e.saveSubject},d.createElement(LE,{id:e.subject&&e.subject.id,subjectTree:e.subjectTree}))}var PE=function(e){return function(t){return t.appLink.action===e}};function xE(e){var t=e.subjectId,n=e.activeAction,r=e.presentationId;return d.createElement(d.Fragment,null,d.createElement(Zs.Alert,{variant:"danger"},"Warning: You are editing the backbone classifications."),d.createElement("div",{className:"py-2"},d.createElement(Km,{tabs:Og(t,r),isItemActive:PE(n)})))}var NE=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[e]}};function RE(e){var t=_s(),n=cu(t),r=function(n){var r=e.allowMultiple?Ii(t.values.backboneClassificationIds.map((function(e){return e.toString()})),n.id.toString()):[n.id];t.setFieldValue("backboneClassificationIds",r)},i="".concat(Qs(t.errors,t.touched,"backboneClassificationIds")," h-auto py-2");return d.createElement(Bs,null,d.createElement(iu,{name:"backboneClassificationIds"},(function(){return d.createElement("div",{className:i},d.createElement(ah,{label:"Mapped Backbone Classification".concat(e.allowMultiple?"(s)":""),tree:e.subjectTree,selectedIds:t.values.backboneClassificationIds,onSelect:r,collapse:!!t.initialValues.backboneClassificationIds.length,getSelectedItemAppLink:NE}))})),d.createElement("div",{className:"d-flex justify-content-end"},d.createElement(fu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.saveBtnText)))}function DE(e){var t;return d.createElement(Ys,{initialValues:e.initialValues,validationSchema:(t=e.subjectRequired,Gs.object().shape({backboneClassificationIds:t?Gs.array().of(Gs.string()).min(1,"A subject is required").required("A subject is required"):Gs.array().of(Gs.string())}).noUnknown()),onSubmit:function(t,n){var r=t.backboneClassificationIds;return e.saveSubjects(r,!1,n)}},d.createElement(RE,{subjectTree:e.subjectTree,memberType:e.memberType,allowMultiple:e.allowMultiple,saveBtnText:e.saveBtnText}))}RE.defaultProps={saveBtnText:"Save"};var ME=function(e){return d.createElement("div",{className:"border rounded p-2 mb-3"},d.createElement("h6",{className:"border-bottom pb-1"},e.presentation.name),e.classifications&&e.classifications.length?d.createElement("ul",{className:"list-unstyled mb-0"},e.classifications.map((function(t){return d.createElement("li",{key:t.id,className:"py-1"},d.createElement(Nd,{appLink:(n=e.presentation.id,r=t.id,{application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[n,r]})},t.name));var n,r}))):d.createElement("p",null,d.createElement("em",null,"There are no classifications mapped to this backbone classification in this presentation.")))},UE=function(e){return d.createElement(d.Fragment,null,!!e.presentations&&!!e.classificationDictionary&&e.presentations.map((function(t){return d.createElement(ME,{key:t.id,presentation:t,classifications:e.classificationDictionary[t.id]})})))},FE=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 VE(e){return d.createElement(d.Fragment,null,e.classifications.map((function(t){return d.createElement("th",{key:t.id},d.createElement("span",{className:"d-inline-block"},d.createElement(Fd,{selected:e.getIsClassificationSelected(t),onToggle:function(n){return e.onToggleClassification(t.id,n)}})),d.createElement(Nd,{appLink:e.getClassificationAppLink(t.id)},function(e,t){return t?e.name:"Classification: ".concat(e.name)}(t,e.showClassificationSubHeader)))})))}function BE(e){var t=e.memberType,n=e.hasActions,r=e.classifications,i=FE(e,["memberType","hasActions","classifications"]),o="".concat(cm(Sg.singularizeMemberType(t))," Name"),a=!!r&&!!r.length,c=a&&r.length>1,s=a?2:1,u=Object.assign({classifications:r,showClassificationSubHeader:c},i);return d.createElement("thead",null,d.createElement("tr",null,d.createElement("th",{rowSpan:s},o),a&&(c?d.createElement("th",{colSpan:r.length,className:"text-center"},"Classifications"):d.createElement(VE,Object.assign({},u))),n&&d.createElement("th",{rowSpan:s})),a&&c&&d.createElement("tr",null,d.createElement(VE,Object.assign({},u))))}function zE(e){var t=e.member,n=t.id,i=t.name,o=t.classifications,a=void 0===o?[]:o,c=e.getMemberAppLink,s=e.onToggleClassification,u=e.actions,l=hn(c)&&c(n);return a.length&&!hn(s)&&r.ErrorHelper.throw(new Xe("onToggleClassification must be passed to SubjectMemberItem")),d.createElement("tr",null,d.createElement("td",null,l?d.createElement(Nd,{appLink:c(n)},i):i),!!a.length&&a.map((function(e){return d.createElement("td",{key:e.id},d.createElement(Fd,{selected:e.selected,onToggle:function(t){return s(e.id,t,n)}}))})),u&&d.createElement("td",null,d.createElement("span",{className:"d-flex justify-content-end"},d.createElement(Bm,{actions:u}))))}var HE=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 qE(e,t){return function(n){var r=n[e],i=uh(r);return!!i&&i===t.length}}function JE(e){var t=e.members,n=e.memberType,r=e.getActions,i=e.classifications,o=e.getClassificationAppLink,a=e.onToggleClassification,c=HE(e,["members","memberType","getActions","classifications","getClassificationAppLink","onToggleClassification"]);if(!t.length)return d.createElement("div",{className:"py-5"},"No ".concat(n," in this backbone classification."));var s=hn(r),u={memberType:n,classifications:i,getClassificationAppLink:o,getIsClassificationSelected:qE(n,t),onToggleClassification:a,hasActions:s};return d.createElement(Zs.Table,{responsive:!0,bordered:!0},d.createElement(BE,Object.assign({},u)),d.createElement("tbody",null,t.map((function(e,t){return d.createElement(zE,Object.assign({key:t,member:e,actions:s&&r(e.id),onToggleClassification:a},c))}))))}function $E(e){var t=e.navItems,n=e.currentAppLink;return d.createElement(Zs.Container,null,d.createElement(Zs.Navbar,{className:"justify-content-between align-items-center"},d.createElement(Zs.Nav,null,!!t&&t.map((function(e,t){return d.createElement(Zs.Nav.Item,{key:t},d.createElement(Nd,{appLink:e.appLink,className:"nav-link".concat(im.isItemActive(e,n)?" text-primary":"")},e.label))})))))}function KE(e,t){d.useEffect((function(){e.presentations&&!e.currentPresentation&&pg(t,"currentPresentation")(Oi(e.presentations))}),[e.presentations])}function YE(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return GE(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 GE(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 GE(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 WE(e){var t=i.useBasicFetch(_b(e.playlistId)),n=i.useBasicFetch(zb()),r=YE(d.useState({}),2),o=r[0],c=r[1],s=cy(p.SUBJECT);!function(e,t,n){var r=function(e){return pg(n,e)};tg([_S.getObjectLevelsFetchOptions(e,sg.Playlists,r("playlistLevels"))],[e]),ag(_S.getObjectAudiencesFetchOptions(e,sg.Playlists,r("playlistAudiences")),[e,t.playlistLevels]),tg([_S.getPresentationsFetchOptions(r("presentations")),_S.getLevelsFetchOptions(r("levels"))],[]),ag(!!t.currentPresentation&&_S.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.playlistId,o,c),KE(o,c);var u=!!(o.presentations&&o.levels&&o.presentationAudiences&&o.playlistLevels&&o.playlistAudiences);return d.createElement(d.Fragment,null,!!n.data&&d.createElement(Kb,{playlistId:e.playlistId,activeAction:a.Playlists.EDIT_PLAYLIST_AUDIENCES,currentUser:n.data}),d.createElement(zm,{object:t.data}),!!u&&d.createElement(VS,{objectLevels:o.playlistLevels,objectAudiences:o.playlistAudiences,presentations:o.presentations,currentPresentation:o.currentPresentation,setCurrentPresentation:pg(c,"currentPresentation"),levels:o.levels,presentationAudiences:o.presentationAudiences,memberType:sg.Playlists,saveLevels:function(t,n,r){return s.updateObjectLevels(e.playlistId,t,sg.Playlists,n,r,r)},saveAudiences:function(t,n){return s.updateObjectAudiences(e.playlistId,o.currentPresentation.id,t,sg.Playlists,n,n)}}))}function ZE(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||XE(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 QE(e){return function(e){if(Array.isArray(e))return eO(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||XE(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 XE(e,t){if(e){if("string"==typeof e)return eO(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)?eO(e,t):void 0}}function eO(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 tO(e){var t=i.useBasicFetch(_b(e.playlistId)),n=i.useBasicFetch(zb()),r=ZE(d.useState({}),2),o=r[0],c=r[1],s=cy(p.SUBJECT);!function(e,t,n){var r=function(e){return pg(n,e)};tg([_S.getSubjectTreeFetchOptions(r("subjectTree")),_S.getPresentationsFetchOptions(r("presentations"))],[]),tg([_S.getObjectSubjectsFetchOptions(e,sg.Playlists,r("playlistSubjects"))],[e]),ag(!!t.currentPresentation&&_S.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),d.useEffect((function(){return r("subjectClassifications")([])}),[t.playlistSubjects]);var i=function(e,t){return[].concat(QE(t.subjectClassifications||[]),QE(e))},o=t.playlistSubjects&&t.playlistSubjects.map((function(e){return _S.getSubjectClassificationFetchOptions(e.id,pg(n,"subjectClassifications",i))}));tg(o,[t.playlistSubjects],!!o),ag(_S.getObjectClassificationsFetchOptions(e,sg.Playlists,r("playlistClassifications")),[e,t.playlistSubjects])}(e.playlistId,o,c),KE(o,c);var u=!!(o.playlistSubjects&&o.subjectTree&&o.presentations&&o.classificationTree&&o.playlistClassifications&&o.subjectClassifications);return d.createElement(d.Fragment,null,!!n.data&&d.createElement(Kb,{playlistId:e.playlistId,activeAction:a.Playlists.EDIT_PLAYLIST_SUBJECTS,currentUser:n.data}),d.createElement(zm,{object:t.data}),u&&d.createElement(IE,{objectSubjects:o.playlistSubjects,subjectTree:o.subjectTree,memberType:sg.Playlists,presentations:o.presentations,currentPresentation:o.currentPresentation,setCurrentPresentation:pg(c,"currentPresentation"),objectClassifications:o.playlistClassifications,objectSubjectClassifications:o.subjectClassifications,classificationTree:o.classificationTree,saveSubjects:function(t,n,r){return s.updateObjectSubjects(e.playlistId,t,sg.Playlists,n,r,r)},saveClassifications:function(t,n){return s.updateObjectClassifications(e.playlistId,o.currentPresentation.id,t,sg.Playlists,n,n)}}))}var nO=function(e,t,n){if(t===n)return{reorderedItems:e,reorderRequest:null};var r=Ai(e,t,n),i=n<e.length-1?r[n+1].id:null;return{reorderedItems:r,reorderRequest:{sourceMemberId:r[n].id,destinationMemberId:i}}};function rO(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return iO(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 iO(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 iO(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 oO(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return aO(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 aO(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 aO(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 cO=function(e){return{application:l.VIDEOS,action:a.Videos.EDIT_VIDEO,args:[e.id]}};function sO(e){var t,n,r,o,c,s,u=Object(bn.useDispatch)(),f=yy(),p=i.useBasicFetch(_b(e.playlistId)),m=i.useBasicFetch(Db(e.playlistId)),h=i.useBasicFetch(zb()),y=oO((n=null===(t=m.data)||void 0===t?void 0:t.data,r=rO(Object(d.useState)(),2),o=r[0],c=r[1],Object(d.useEffect)((function(){o&&(n.length!==o.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,o))&&c(null)}),[n]),[o,c]),2),v=y[0],b=y[1],g=v?{data:v,pagination:null}:m.data;return d.createElement(d.Fragment,null,!!h.data&&d.createElement(Kb,{playlistId:e.playlistId,activeAction:a.Playlists.EDIT_PLAYLIST_VIDEOS,currentUser:h.data}),d.createElement(zm,{object:p.data}),!!g&&d.createElement(Oh,{onSortEnd:function(t,n){if(t!==n){var r=nO(m.data.data,t,n),o=r.reorderRequest,a=r.reorderedItems;b(a);i.fetch(u,Mb(e.playlistId,o,null,(function(){f.error("Failed to update playlist order."),b(null)})))}},videos:g,getVideoAppLink:cO,getVideoActions:(s=e.playlistId,function(e){return[{label:"Remove video",appLink:{application:l.PLAYLISTS,action:a.Playlists.REMOVE_VIDEO,args:[s.toString(),e.id.toString()]},className:"text-danger"}]}),emptyMessage:"There are no videos in this playlist."}))}function uO(){var e=Object(bn.useDispatch)(),t=yy(),n=i.useBasicFetch(zb());return d.createElement(d.Fragment,null,!!n.data&&d.createElement($b,{savePlaylist:function(o,c){i.fetch(e,xb(o,n.data.id,(function(e){t.success("Successfully created playlist."),function(e){e&&e.id&&r.AppLinkHelper.trigger({application:l.PLAYLISTS,action:a.Playlists.EDIT_PLAYLIST,args:[e.id]})}(e)}),(function(){t.error("Failed to create playlist.")}),c))}}))}var lO="rating,thumbnail,glance,herobanner",fO=function(e){return{url:"/api/master/v2/objects/".concat(e,"?query=").concat(lO),key:"videos:".concat(e)}},pO=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("&"))}},dO=function(e){return{url:"/ajax/hostedlibraries/rightsline/programs/".concat(e),key:"rightsline:videos:".concat(e),normalizeOptions:{namespace:"rightsline"}}},mO=function(e,t,n,r,i){return{key:"videos:".concat(e),url:"/api/master/v2/objects/".concat(e),data:t,type:Cr.PUT,success:n,error:r,always:i}};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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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(bn.useDispatch)(),n=yy(),r=i.useBasicFetch(_b(e.playlistId)),o=i.useBasicFetch(fO(e.videoId)),a=hO(d.useState(!1),2),c=a[0],s=a[1];var u=!!r.data&&!!o.data;return d.createElement(by,{title:"Remove Video",closePopup:e.closePopup,showLoadingSpinner:!u},!!u&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to remove ",d.createElement("strong",null,o.data.name)," from ",d.createElement("strong",null,r.data.name),"?")),d.createElement(Sy,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){s(!0),i.fetch(t,Ub(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:c}]})))}function bO(e){return r.AppLinkHelper.trigger(function(e){return{application:l.PLAYLISTS,action:a.Playlists.EDIT_PLAYLIST,args:[e.id]}}(e))}function gO(e){var t=e?{application:l.PLAYLISTS,action:a.Playlists.SEARCH_PLAYLISTS,params:{query:e}}:{application:l.PLAYLISTS,action:a.Playlists.PLAYLISTS};r.AppLinkHelper.trigger(t)}function SO(e){return d.createElement("div",{className:"pb-3 w-50"},d.createElement(hd,{initialQuery:e.query,placeholder:"Search for a playlist",onSuggestionSelected:bO,getRemoteUrl:function(e){return"".concat("/api/domain/v1/search/playlists/instant/raw","?query=").concat(e)},activationLength:2,onSubmit:gO}))}var EO=l.PLAYLISTS,OO=function(e){return{application:EO,action:a.Playlists.EDIT_PLAYLIST,args:[e.id]}};function CO(e){var t=i.useBasicFetch(kb(e.cursor));return d.createElement(d.Fragment,null,d.createElement(SO,null),d.createElement(_m,{collection:t&&t.data,collectionAppLink:{application:EO,action:a.Playlists.PLAYLISTS},newObjectAppLink:{application:EO,action:a.Playlists.NEW_PLAYLIST},getObjectAppLink:OO,objectName:"Playlist"}))}var AO=l.PLAYLISTS,jO=function(e){return{application:AO,action:a.Playlists.EDIT_PLAYLIST,args:[e.id]}};function wO(e){var t=i.useBasicFetch(Lb(e.query,e.cursor));return d.createElement(d.Fragment,null,d.createElement(SO,{query:e.query}),!!t.data&&(t.data.data.length?d.createElement(_m,{collection:t.data,collectionAppLink:{application:AO,action:a.Playlists.SEARCH_PLAYLISTS,params:{query:e.query}},newObjectAppLink:{application:AO,action:a.Playlists.NEW_PLAYLIST},getObjectAppLink:jO,objectName:"Playlist"}):d.createElement("p",null,"No playlists found, please try a different search query.")))}function IO(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return TO(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 TO(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 TO(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 kO=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 LO(e){var t=e.id,n=e.routeToOnDelete,i=e.closePopup,o=IO(d.useState(),2),a=o[0],c=o[1],s=IO(d.useState(!1),2),u=s[0],l=s[1],f=cy(p.SUBJECT);ag(_S.getAudienceFetchOptions(t,c),[t]);return d.createElement(by,{title:"Delete Audience",closePopup:i,showLoadingSpinner:!a},!!a&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,a.name),"?")),d.createElement(Sy,{buttons:kO((function(){l(!0);f.deleteAudience(t,(function(){i(),n&&r.AppLinkHelper.trigger(n)}),i)}),i,u)})))}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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return PO(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 PO(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 PO(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 xO(e){var t=e.presentationId,n=e.audienceId,r=_O(d.useState(),2),i=r[0],o=r[1],a=_O(d.useState(),2),c=a[0],s=a[1],u=_O(d.useState(),2),l=u[0],f=u[1],m=cy(p.SUBJECT);ag(_S.getAudienceFetchOptions(n,o),[n]),ag(_S.getLevelsFetchOptions(s),[]),ag(_S.getPresentationFetchOptions(t,f),[t]);return d.createElement(d.Fragment,null,d.createElement(qS,{presentation:l,audienceId:n}),!!l&&d.createElement("h6",null,"Presentation: ".concat(l.name)),!!i&&!!c&&d.createElement(US,{audience:i,levels:c,saveAudience:function(e,r){return m.updateAudience(n,Object.assign(Object.assign({},e),{presentationId:t}),r,r)},presentationId:t}))}function NO(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return RO(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 RO(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 RO(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 DO=function(e){return{application:l.SUBJECTS,action:a.Subjects.PRESENTATION_AUDIENCES,args:[e]}};function MO(e){var t=e.presentationId,n=NO(d.useState(),2),i=n[0],o=n[1],c=NO(d.useState(),2),s=c[0],u=c[1],f=cy(p.SUBJECT);ag(_S.getLevelsFetchOptions(o),[]),ag(_S.getPresentationFetchOptions(t,u),[t]);return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-2"},d.createElement(Rd,{appLink:DO(t),backToName:"audiences"})),!!s&&d.createElement("h6",null,"Presentation: ".concat(s.name)),!!i&&d.createElement(US,{levels:i,presentationId:t,saveAudience:function(e,n){return f.createAudience(Object.assign(Object.assign({},e),{presentationId:t}),function(e,t){return function(n){t(),r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_AUDIENCE,args:[e,n.masterId]})}}(t,n),n)}}))}var UO=n(137),FO=n.n(UO);function VO(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return BO(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 BO(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 BO(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 zO(e){var t=e.presentationId,n=e.selectedAudienceId,r=VO(d.useState(),2),i=r[0],o=r[1];ag(_S.getAudiencesFetchOptions(t,o),[]);var c=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_AUDIENCE,args:[t,e.masterId]}},s={application:l.SUBJECTS,action:a.Subjects.NEW_AUDIENCE,args:[t]};return d.createElement("div",{className:"".concat(FO.a.navContainer," h-auto pr-2 border-right")},d.createElement("h5",{className:"border-bottom pb-2"},"Audiences"),d.createElement(Nd,{appLink:s,className:"d-inline-block pb-2"},d.createElement(Fp,{svgName:Rp.Plus,size:Up.Small}),d.createElement("span",null,"New Audience")),d.createElement("div",{className:"border-top pt-1"},d.createElement("ul",{className:"list-unstyled"},i&&i.map((function(e){var t;return d.createElement("li",{className:"position-relative py-1"},d.createElement(Nd,{className:(null===(t=n)||void 0===t?void 0:t.toString())===e.masterId.toString()?"text-primary font-weight-500":"",appLink:c(e)},e.name))})))))}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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qO(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 qO(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 qO(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 JO(e){var t=e.presentationId,n=e.audienceId,r=e.memberType,i=HO(d.useState(),2),o=i[0],a=i[1],c=HO(d.useState(),2),s=(c[0],c[1]),u=HO(d.useState(),2),l=u[0],f=u[1];ag(_S.getPresentationFetchOptions(t,a),[]),ag(_S.getAudienceFetchOptions(n,s),[n]),ag(_S.getAudienceMembersFetchOptions(n,r,f),[n,r]);var p={items:l&&l.data,memberType:r,getItemAppLink:function(e){return wg.getMemberAppLink(r,e.id)},getActions:function(e){return wg.getMemberActions(n,cg.Audience,r,e.id)}},m={presentation:o,audienceId:n},h=om(p);return d.createElement(d.Fragment,null,d.createElement(qS,Object.assign({},m,{memberType:r})),h&&d.createElement($S,Object.assign({},p)))}function $O(e){return{application:l.SUBJECTS,action:a.Subjects.NEW_CLASSIFICATION,args:[e]}}function KO(e){return[{label:"Add child",getAppLink:function(t){return Object.assign(Object.assign({},$O(e)),{args:[e],params:{parentId:t.id}})}},{label:"Delete classification",getAppLink:function(t){return{application:l.SUBJECTS,action:a.Subjects.DELETE_CLASSIFICATION,args:[e,t.id]}},className:"text-danger"}]}var YO=n(138),GO=n.n(YO);function WO(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ZO(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 ZO(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 ZO(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 QO(e){var t=e.presentationId,n=e.selectedClassificationId,r=WO(d.useState(),2),i=r[0],o=r[1],c=WO(d.useState(),2),s=c[0],u=c[1];return function(e,t,n){tg([_S.getClassificationTreeFetchOptions(e,t),_S.getPresentationFetchOptions(e,n)],[e])}(t,o,u),d.createElement("div",{className:"".concat(GO.a.navContainer," h-auto pr-2 border-right")},!!s&&d.createElement("h6",{className:"border-bottom pb-2"},"Classifications (".concat(s.name,")")),d.createElement(Nd,{appLink:$O(t),className:"d-inline-block pb-2"},d.createElement(Fp,{svgName:Rp.Plus,size:Up.Small}),d.createElement("span",null,"New Classification")),!!i&&d.createElement("div",{className:"border-top pt-1"},d.createElement(th,{tree:i,getAppLink:function(e){return function(e,t){return{application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[e,t.id]}}(t,e)},selectedIds:[n],actions:KO(t)})))}function XO(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return eC(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 eC(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 eC(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 tC(e){var t=e.classificationId,n=e.routeToOnDelete,i=e.closePopup,o=XO(d.useState(),2),a=o[0],c=o[1],s=XO(d.useState(!1),2),u=s[0],l=s[1];ag(_S.getClassificationFetchOptions(t,c),[]);var f=cy(p.SUBJECT),m=[{variant:"link",onClick:i,buttonText:"Cancel"},{variant:"danger",onClick:function(){l(!0);f.deleteClassification(t,(function(){i(),n&&r.AppLinkHelper.trigger(n)}),i)},buttonText:"Yes, delete this classification",isSpinnerButton:!0,showSpinner:u}];return d.createElement(by,{title:"Delete Classification",closePopup:i,showLoadingSpinner:!a},!!a&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,a.name),"?")),d.createElement(Sy,{buttons:m})))}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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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=e.presentationId,n=e.classificationId,r=nC(d.useState(),2),i=r[0],o=r[1],a=nC(d.useState(),2),c=a[0],s=a[1],u=nC(d.useState(),2),l=u[0],f=u[1],m=nC(d.useState(),2),h=m[0],y=m[1],v=cy(p.SUBJECT),b=_S.getClassificationFetchOptions(n,o),g=_S.getPresentationFetchOptions(t,s),S=_S.getClassificationTreeFetchOptions(t,f);ag(_S.getSubjectTreeFetchOptions(y),[]),ag(b,[n]),tg([g,S],[t]);return d.createElement("div",null,d.createElement(oE,{presentation:c,classificationId:n}),!!i&&!!l&&!!h&&d.createElement(rE,{classification:i,presentationId:t,subjectTree:h,classificationTree:l,saveClassification:function(e,t){var r,o=Object.assign({pinnedVideoMasterId:(null===(r=i)||void 0===r?void 0:r.pinnedVideoMasterId)||null},e);return v.updateClassification(n,o,t,t)}}))}function oC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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 cC(e){var t=e.presentationId,n=e.classificationId,r=e.memberType,i=oC(d.useState(),2),o=i[0],a=i[1],c=oC(d.useState(),2),s=c[0],u=c[1],l=oC(d.useState(),2),f=l[0],m=l[1];ag(_S.getPresentationFetchOptions(t,a),[]),ag(_S.getClassificationFetchOptions(n,u),[n]),ag(_S.getClassificationMembersFetchOptions(n,r,m),[n,r]);var h=cy(p.SUBJECT),y={items:f&&f.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 Sg.getMemberAppLink(r,e.id)},getActions:function(e){return Sg.getMemberActions(n,cg.Classification,r,e.id)}},v={presentation:o,classificationId:n},b=om(y);return d.createElement(d.Fragment,null,d.createElement(oE,Object.assign({},v,{memberType:r})),b&&d.createElement(QS,Object.assign({},y)))}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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return uC(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 uC(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 uC(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 lC(e){var t=e.presentationId,n=e.parentId,i=sC(d.useState(),2),o=i[0],c=i[1],s=sC(d.useState(),2),u=s[0],f=s[1],m=cy(p.SUBJECT),h=_S.getClassificationTreeFetchOptions(t,c);ag(_S.getSubjectTreeFetchOptions(f),[]),ag(h,[t]);return d.createElement("div",null,d.createElement("h4",{className:"py-2"},"Create New Classification"),!!u&&!!o&&d.createElement(rE,{classification:n?{parentIds:[n]}:{},presentationId:t,subjectTree:u,classificationTree:o,saveClassification:function(e,n){return m.createClassification(Object.assign(Object.assign({},e),{presentationId:t}),function(e,t){return function(n){t(),n&&n.id&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[e,n.id]})}}(t,n),n)}}))}var fC=function(e){return{key:"series:".concat(e),url:"/api/master/v2/objects/".concat(e,"?query=thumbnail,tallPoster,banner,rating")}},pC=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("&"))}},dC=function(e,t,n,r){return{url:"/api/master/v2/series",key:"series",data:e,type:Cr.POST,success:t,error:n,always:r}},mC=function(e,t,n,r,i){return{url:"/api/master/v2/objects/".concat(e),key:"update:series:".concat(e),data:t,type:Cr.PUT,success:n,error:r,always:i}};function hC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yC(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 yC(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 yC(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 vC(e){var t=hC(d.useState(),2),n=t[0],r=t[1],o=hC(d.useState(!1),2),a=o[0],c=o[1],s=i.useBasicFetch(function(e,t){switch(e){case sg.Playlists:return _b(t);case sg.Series:return fC(t);case sg.Videos:return fO(t)}}(e.memberType,e.memberId)),u=cy(p.SUBJECT);ag(_S.getClassificationFetchOptions(e.classificationId,r),[e.classificationId]);var l=!!n&&!!s.data,f="Remove ".concat(cm(Sg.singularizeMemberType(e.memberType)));return d.createElement(by,{title:f,closePopup:e.closePopup,showLoadingSpinner:!l},l&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to remove ",d.createElement("strong",null,s.data.name)," from ",d.createElement("strong",null,n.name),"?"),d.createElement("p",null,"This will not remove it from the backbone subject.")),d.createElement(Sy,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){c(!0),u.removeObjectsFromClassification(e.classificationId,[e.memberId],e.memberType,null,null,e.closePopup,e.closePopup),n.pinnedVideoMasterId===e.memberId&&u.updateClassification(e.classificationId,Object.assign(Object.assign({},n),{pinnedVideoMasterId:null}))},buttonText:"Yes, remove this ".concat(Sg.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function bC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return gC(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 gC(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 gC(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 SC(e){var t=e.id,n=bC(d.useState(),2),r=n[0],i=n[1],o=cy(p.SUBJECT);ag(_S.getLevelFetchOptions(t,i),[t]);return d.createElement(d.Fragment,null,d.createElement(dE,{levelId:t,activeAction:a.Subjects.EDIT_LEVEL}),d.createElement("h4",{className:"py-2"},"Edit Level"),!!r&&d.createElement(uE,{level:r,saveLevel:function(e,n){return o.updateLevel(t,e,n,n)}}))}function EC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}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(){var e=EC(d.useState(),2),t=e[0],n=e[1];return ag(_S.getLevelsFetchOptions(n),[]),d.useEffect((function(){t&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_LEVEL,args:[Oi(t).id]},{replace:!0})}),[t]),d.createElement(d.Fragment,null)}function AC(){var e=cy(p.SUBJECT);return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Create New Level"),d.createElement(uE,{saveLevel:function(t,n){return e.createLevel(t,function(e){return function(t){e(),t&&t.id&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_LEVEL,args:[t.id]})}}(n),n)}}))}var jC=n(139),wC=n.n(jC);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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return TC(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 TC(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 TC(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 kC(e){var t=e.selectedLevelId,n=IC(d.useState(),2),r=n[0],i=n[1];ag(_S.getLevelsFetchOptions(i),[]);var o=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_LEVEL,args:[e.id]}},c={application:l.SUBJECTS,action:a.Subjects.NEW_LEVEL};return d.createElement("div",{className:"".concat(wC.a.navContainer," h-auto pr-2 border-right")},d.createElement("h5",{className:"border-bottom pb-2"},"Backbone Audiences"),d.createElement(Nd,{appLink:c,className:"d-inline-block pb-2"},d.createElement(Fp,{svgName:Rp.Plus,size:Up.Small}),d.createElement("span",null,"New Backbone Audience")),d.createElement("div",{className:"border-top pt-1"},d.createElement("ul",{className:"list-unstyled"},r&&r.map((function(e){var n;return d.createElement("li",{className:"position-relative py-1"},d.createElement(Nd,{className:(null===(n=t)||void 0===n?void 0:n.toString())===e.id.toString()?"text-primary font-weight-500":"",appLink:o(e)},e.name))})))))}var LC=function(e){return d.createElement("div",{className:"border rounded p-2 mb-3"},d.createElement("h6",{className:"border-bottom pb-1"},e.presentation.name),e.audiences&&e.audiences.length?d.createElement("ul",{className:"list-unstyled mb-0"},e.audiences.map((function(t){return d.createElement("li",{key:t.masterId,className:"py-1"},d.createElement(Nd,{appLink:(n=e.presentation.id,r=t.masterId,{application:l.SUBJECTS,action:a.Subjects.EDIT_AUDIENCE,args:[n,r]})},t.name));var n,r}))):d.createElement("p",null,d.createElement("em",null,"There are no audiences mapped to this level in this presentation.")))},_C=function(e){return d.createElement(d.Fragment,null,!!e.presentations&&!!e.audienceDictionary&&e.presentations.map((function(t){return d.createElement(LC,{key:t.id,presentation:t,audiences:e.audienceDictionary[t.id]})})))};function PC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return xC(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 xC(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 xC(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 NC(e){var t=e.levelId,n=PC(d.useState({}),2),r=n[0];return function(e,t){var n=function(e){return pg(t,e)};ag(_S.getLevelAudiencesFetchOptions(e,n("audiences")),[e]),ag(_S.getPresentationsFetchOptions(n("presentations")),[])}(t,n[1]),d.createElement(d.Fragment,null,d.createElement(dE,{levelId:t,activeAction:a.Subjects.LEVEL_AUDIENCES}),d.createElement(_C,{presentations:r.presentations,audienceDictionary:ji(r.audiences,"presentationId")}))}function RC(e,t){return pg(e,t)}function DC(e){switch(e){case ug.Playlists:return a.Subjects.EDIT_LEVEL_PLAYLISTS;case ug.Series:return a.Subjects.EDIT_LEVEL_SERIES;case ug.Videos:return a.Subjects.EDIT_LEVEL_VIDEOS}}function MC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return UC(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 UC(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 UC(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=MC(d.useState({}),2),n=t[0],o=t[1],c=n.presentations,s=n.audiences,u=n.memberIds,f=n.membersWithAudiences,m=i.useBasicFetch(Array.isArray(u)&&u.length?function(e,t){switch(e){case ug.Playlists:return Pb(t);case ug.Series:return pC(t);case ug.Videos:return pO(t)}}(e.memberType,u):null),h=cy(p.SUBJECT);function y(t){r.AppLinkHelper.trigger({application:l.SUBJECTS,action:e.action,args:[e.levelId],params:{presentationId:t}})}!function(e,t,n){var r=e.presentationId,i=e.levelId,o=e.memberType;ag(_S.getPresentationsFetchOptions(RC(n,"presentations")),[]),ag(_S.getLevelMemberIdsFetchOptions(i,o,RC(n,"memberIds")),[i,o]),ag(!!r&&_S.getLevelAudiencesFetchOptions(i,RC(n,"audiences"),r,o),[i,o,r],!!r)}(e,0,o),function(e,t,n,r){var i=n.audiences;d.useEffect((function(){RC(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])}(m.data,e,n,o),d.useEffect((function(){var t;!e.presentationId&&(null===(t=c)||void 0===t?void 0:t.length)&&y(Oi(c).id)}),[e.presentationId]);var v,b,g=!!e.presentationId&&!!s;return d.createElement(d.Fragment,null,d.createElement(dE,{levelId:e.levelId,presentationId:e.presentationId,activeAction:DC(e.memberType)}),d.createElement(Zs.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."),d.createElement("div",{className:"w-50 py-2"},!!c&&d.createElement(CE,{presentations:c,currentPresentationId:e.presentationId,setCurrentPresentation:function(e){return y(e.id)}})),g&&d.createElement(SE,{members:f||[],memberType:e.memberType,getMemberAppLink:function(t){return wg.getMemberAppLink(e.memberType,t)},getActions:function(t){return wg.getMemberActions(e.levelId,cg.Level,e.memberType,t)},audiences:s,getAudienceAppLink:e.presentationId&&(v=e.memberType,b=e.presentationId,function(e){var t,n=l.SUBJECTS,r=[b,e];switch(v){case ug.Playlists:t=a.Subjects.EDIT_AUDIENCE_PLAYLISTS;break;case ug.Series:t=a.Subjects.EDIT_AUDIENCE_SERIES;break;case ug.Videos:t=a.Subjects.EDIT_AUDIENCE_VIDEOS}return{application:n,action:t,args:r}}),onToggleAudience:function(t,n,r){return function(e,t,n,r,i,o,a){(a?e.addObjectsToAudience.bind(e):e.removeObjectsFromAudience.bind(e))(o,n,t,r,i)}(h,e.memberType,r?[r]:u,e.levelId,e.presentationId,t,n)}}))}function VC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return BC(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 BC(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 BC(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 zC(e){var t=VC(d.useState(),2),n=t[0],r=t[1],o=VC(d.useState(!1),2),a=o[0],c=o[1],s=i.useBasicFetch(function(e,t){switch(e){case ug.Playlists:return _b(t);case ug.Series:return fC(t);case ug.Videos:return fO(t)}}(e.memberType,e.memberId)),u=cy(p.SUBJECT);ag(_S.getLevelFetchOptions(e.levelId,r),[e.levelId]);var l=!!n&&!!s.data,f="Remove ".concat(cm(wg.singularizeMemberType(e.memberType)));return d.createElement(by,{title:f,closePopup:e.closePopup,showLoadingSpinner:!l},l&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to remove ",d.createElement("strong",null,s.data.name)," from ",d.createElement("strong",null,n.name),"?"),d.createElement("p",null,"Please ensure that it is not in any audiences before removing.")),d.createElement(Sy,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){c(!0),u.removeObjectsFromLevel(e.levelId,[e.memberId],e.memberType,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(wg.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function HC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return qC(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 qC(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 qC(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 JC(e){var t=e.id,n=HC(d.useState(),2),r=n[0],i=n[1],o=cy(p.SUBJECT);ag(_S.getPresentationFetchOptions(t,i),[t]);var a={presentation:r,savePresentation:function(e,n){var r=n.setSubmitting;return o.updatePresentation(t,e,(function(){return r(!1)}),(function(){return r(!1)}))}},c=om(a);return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Edit Presentation"),!!c&&d.createElement(OE,Object.assign({},a)))}function $C(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return KC(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 KC(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 KC(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 YC=function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_PRESENTATION,args:[e.id]}},GC={application:l.SUBJECTS,action:a.Subjects.NEW_PRESENTATION};function WC(){var e=$C(d.useState(),2),t=e[0],n=e[1];return ag(_S.getPresentationsFetchOptions(n),[]),d.createElement("div",null,d.createElement("div",{className:"d-flex justify-content-between mb-2"},d.createElement("h5",{className:"d-inline-block m-0"},"Select a presentation to edit:"),d.createElement(Nd,{appLink:GC,className:"d-block"},d.createElement(Fp,{svgName:Rp.Plus,size:Up.Small}),d.createElement("span",null,"New Presentation"))),d.createElement(Jm,{objects:t,getAppLink:YC}))}function ZC(){var e=cy(p.SUBJECT);return d.createElement(d.Fragment,null,d.createElement("h4",{className:"py-2"},"Create New Presentation"),d.createElement(OE,{savePresentation:function(t,n){var i=n.setSubmitting;e.createPresentation(t,(function(e){return function(e,t){t(!1),e&&e.id&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_PRESENTATION,args:[e.id]})}(e,i)}),(function(){return i(!1)}))}}))}function QC(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return XC(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 XC(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 XC(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(e){var t=e.objectType,n=e.getAppLink,r=QC(d.useState(),2),i=r[0],o=r[1];return ag(_S.getPresentationsFetchOptions(o),[]),d.createElement("div",null,d.createElement("h5",null,d.createElement(ju,{namespace:"subjects.selectPresentation",phrase:"heading",options:{objectType:t}})),d.createElement(Jm,{objects:i,getAppLink:n}))}function tA(e,t){return pg(e,t)}function nA(e,t,n,i,o){var c=i.selectedSubject,s=function(){return tA(o,"showConfirmationPopup")(!1)};t.addObjectsToSubject(c.id,e.map((function(e){return e.id})),n.memberType,i.addToClassifications,(function(){s(),r.AppLinkHelper.trigger(function(e,t){var n={application:l.SUBJECTS,args:[e]};switch(t){case sg.Playlists:return Object.assign(Object.assign({},n),{action:a.Subjects.EDIT_SUBJECT_PLAYLISTS});case sg.Series:return Object.assign(Object.assign({},n),{action:a.Subjects.EDIT_SUBJECT_SERIES});case sg.Videos:return Object.assign(Object.assign({},n),{action:a.Subjects.EDIT_SUBJECT_VIDEOS})}}(c.id,n.memberType))}),s)}function rA(e,t,n){if(t&&n){var r=1===t.length?"this ".concat(Sg.singularizeMemberType(e)):"these ".concat(e);return"Add ".concat(r," to ").concat(n.name)}}function iA(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return oA(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 oA(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 oA(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 aA(e,t){return function(n,r,i){i(),tA(t,"selectedSubject")(lm.find(e.subjectTree,Oi(n))),tA(t,"addToClassifications")(r),tA(t,"showConfirmationPopup")(!0)}}function cA(e){var t=iA(d.useState({}),2),n=t[0],r=t[1],o=i.useBasicFetch(function(e,t){switch(e){case sg.Playlists:return Pb(t);case sg.Series:return pC(t);case sg.Videos:return pO(t)}}(e.memberType,e.objectIds)),a=cy(p.SUBJECT);!function(e,t){e.memberType,e.objectIds,ag(_S.getSubjectTreeFetchOptions(tA(t,"subjectTree")),[])}(e,r);var c;return d.createElement(d.Fragment,null,!!o.data&&!!n.subjectTree&&d.createElement(AE,{memberType:e.memberType,objects:o.data,subjectTree:n.subjectTree,onClickAddToSubject:aA(n,r)}),n.showConfirmationPopup&&d.createElement(Cy,{title:rA(e.memberType,o.data,n.selectedSubject),onClickConfirm:function(){return nA(o.data,a,e,n,r)},closePopup:function(){return e=!1,tA(r,"showConfirmationPopup")(e);var e}},d.createElement("p",null,"The following ".concat(e.memberType," will be added to "),d.createElement("strong",null,n.selectedSubject.name),n.addToClassifications?" and its mapped classifications:":":"),d.createElement("ul",null,o.data.map((function(e){return d.createElement("li",{key:e.id},e.name)}))),!n.addToClassifications&&d.createElement("p",null,"".concat(1===o.data.length?"It":"They"," will not be added to its mapped classifications.")),d.createElement("p",null,"".concat((c=e.memberType,cm(Sg.singularizeMemberType(c)))," to classification mappings can be managed from the "),d.createElement("strong",null,"Edit Subject ".concat(cm(e.memberType)," ")),"page.")))}function sA(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return uA(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 uA(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 uA(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 lA(e){var t=e.subjectId,n=e.routeToOnDelete,i=e.closePopup,o=sA(d.useState(),2),a=o[0],c=o[1],s=sA(d.useState(!1),2),u=s[0],l=s[1];ag(_S.getSubjectFetchOptions(t,c),[]);var f=cy(p.SUBJECT),m=[{variant:"link",onClick:i,buttonText:"Cancel"},{variant:"danger",onClick:function(){l(!0);f.deleteSubject(t,(function(){i(),n&&r.AppLinkHelper.trigger(n)}),i)},buttonText:"Yes, delete this backbone classification",isSpinnerButton:!0,showSpinner:u}];return d.createElement(by,{title:"Delete Subject",closePopup:i,showLoadingSpinner:!a},!!a&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,a.name),"?"),d.createElement("p",null,"Subjects that have mapped classifications cannot be deleted.")),d.createElement(Sy,{buttons:m})))}function fA(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||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)||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 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}function dA(e){var t=e.subjectId,n=fA(d.useState(),2),r=n[0],i=n[1],o=fA(d.useState(),2),c=o[0],s=o[1],u=cy(p.SUBJECT),l=_S.getSubjectFetchOptions(t,i);ag(_S.getSubjectTreeFetchOptions(s),[]),ag(l,[t]);return d.createElement(d.Fragment,null,d.createElement(xE,{subjectId:t,activeAction:a.Subjects.EDIT_SUBJECT}),!!r&&!!c&&d.createElement(_E,{subject:r,subjectTree:c,saveSubject:function(e,n){return u.updateSubject(t,e,n,n)}}))}function mA(e,t){return pg(e,t)}function hA(e){switch(e){case sg.Playlists:return a.Subjects.EDIT_SUBJECT_PLAYLISTS;case sg.Series:return a.Subjects.EDIT_SUBJECT_SERIES;case sg.Videos:return a.Subjects.EDIT_SUBJECT_VIDEOS}}function yA(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return vA(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 vA(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 vA(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 bA(e){var t=yA(d.useState({}),2),n=t[0],o=t[1],c=n.presentations,s=n.classifications,u=n.memberIds,f=n.membersWithClassifications,m=i.useBasicFetch(Array.isArray(u)&&function(e,t){switch(e){case sg.Playlists:return Pb(t);case sg.Series:return pC(t);case sg.Videos:return pO(t)}}(e.memberType,u)),h=cy(p.SUBJECT);function y(t){r.AppLinkHelper.trigger({application:l.SUBJECTS,action:e.action,args:[e.subjectId],params:{presentationId:t}})}!function(e,t,n){var r=e.subjectId,i=e.memberType,o=e.presentationId;ag(_S.getPresentationsFetchOptions(mA(n,"presentations")),[]),ag(_S.getSubjectMemberIdsFetchOptions(r,i,mA(n,"memberIds")),[r,i]),ag(!!o&&_S.getSubjectClassificationFetchOptions(r,mA(n,"classifications"),o,i),[r,i,o],!!o)}(e,0,o),function(e,t,n,r){var i=n.classifications;d.useEffect((function(){mA(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])}(m.data,e,n,o),d.useEffect((function(){var t;!e.presentationId&&(null===(t=c)||void 0===t?void 0:t.length)&&y(Oi(c).id)}),[e.presentationId]);var v,b,g=!!e.presentationId&&!!s;return d.createElement(d.Fragment,null,d.createElement(xE,{subjectId:e.subjectId,presentationId:e.presentationId,activeAction:hA(e.memberType)}),d.createElement(Zs.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."),d.createElement("div",{className:"w-50 py-2"},!!c&&d.createElement(CE,{presentations:c,currentPresentationId:e.presentationId,setCurrentPresentation:function(e){return y(e.id)}})),g&&d.createElement(JE,{members:f||[],memberType:e.memberType,getMemberAppLink:function(t){return Sg.getMemberAppLink(e.memberType,t)},getActions:function(t){return Sg.getMemberActions(e.subjectId,cg.Subject,e.memberType,t)},classifications:s,getClassificationAppLink:e.presentationId&&(v=e.memberType,b=e.presentationId,function(e){var t,n=l.SUBJECTS,r=[b,e];switch(v){case sg.Playlists:t=a.Subjects.EDIT_CLASSIFICATION_PLAYLISTS;break;case sg.Series:t=a.Subjects.EDIT_CLASSIFICATION_SERIES;break;case sg.Videos:t=a.Subjects.EDIT_CLASSIFICATION_VIDEOS}return{application:n,action:t,args:r}}),onToggleClassification:function(t,n,r){return function(e,t,n,r,i,o,a){(a?e.addObjectsToClassification.bind(e):e.removeObjectsFromClassification.bind(e))(o,n,t,r,i)}(h,e.memberType,r?[r]:u,e.subjectId,e.presentationId,t,n)}}))}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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return SA(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 SA(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 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(e){var t=e.parentId,n=gA(d.useState(),2),i=n[0],o=n[1],c=cy(p.SUBJECT);ag(_S.getSubjectTreeFetchOptions(o),[]);var s={application:l.SUBJECTS,action:a.Subjects.PRESENTATIONS};return d.createElement(d.Fragment,null,d.createElement("div",{className:"pb-2 border-bottom"},d.createElement(Rd,{backToName:"Presentations",appLink:s})),d.createElement("h4",{className:"py-2"},"Create New Subject"),!!i&&d.createElement(_E,{subject:{parentId:t},subjectTree:i,saveSubject:function(e,t){return c.createSubject(e,function(e){return function(t){e(),t&&t.id&&r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[t.id]})}}(t),t)}}))}function OA(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return CA(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 CA(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 CA(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 AA(e){var t=OA(d.useState(),2),n=t[0],r=t[1],o=OA(d.useState(!1),2),a=o[0],c=o[1],s=i.useBasicFetch(function(e,t){switch(e){case sg.Playlists:return _b(t);case sg.Series:return fC(t);case sg.Videos:return fO(t)}}(e.memberType,e.memberId)),u=cy(p.SUBJECT);ag(_S.getSubjectFetchOptions(e.subjectId,r),[e.subjectId]);var l=!!n&&!!s.data,f="Remove ".concat(cm(Sg.singularizeMemberType(e.memberType)));return d.createElement(by,{title:f,closePopup:e.closePopup,showLoadingSpinner:!l},l&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to remove ",d.createElement("strong",null,s.data.name)," from ",d.createElement("strong",null,n.name),"?"),d.createElement("p",null,"Please ensure that it is not in any classifications before removing.")),d.createElement(Sy,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){c(!0),u.removeObjectsFromSubject(e.subjectId,[e.memberId],e.memberType,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(Sg.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function jA(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return wA(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 wA(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 wA(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 IA(e){var t=e.subjectId,n=jA(d.useState({}),2),r=n[0];return function(e,t){var n=function(e){return pg(t,e)};ag(_S.getSubjectClassificationFetchOptions(e,n("classifications")),[e]),ag(_S.getPresentationsFetchOptions(n("presentations")),[])}(t,n[1]),d.createElement(d.Fragment,null,d.createElement(xE,{subjectId:t,activeAction:a.Subjects.SUBJECT_CLASSIFICATIONS}),d.createElement(UE,{presentations:r.presentations,classificationDictionary:ji(r.classifications,"presentationId")}))}var TA=n(140),kA=n.n(TA);function LA(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _A(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 _A(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 _A(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 PA(e){var t=e.selectedSubjectId,n=LA(d.useState(),2),r=n[0],i=n[1];ag(_S.getSubjectTreeFetchOptions(i),[]);var o=d.useCallback((function(e){return{application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[e.id]}}),[]),c={application:l.SUBJECTS,action:a.Subjects.NEW_SUBJECT},s=[{label:"Add child",getAppLink:function(e){return Object.assign(Object.assign({},c),{params:{parentId:e.id}})}},{label:"Delete backbone classification",getAppLink:function(e){return{application:l.SUBJECTS,action:a.Subjects.DELETE_SUBJECT,args:[e.id]}},className:"text-danger"}];return d.createElement("div",{className:"".concat(kA.a.navContainer," h-auto pr-2 border-right")},d.createElement("h5",{className:"border-bottom pb-2"},"Backbone Classifications"),d.createElement(Nd,{appLink:c,className:"d-inline-block pb-2"},d.createElement(Fp,{svgName:Rp.Plus,size:Up.Small}),d.createElement("span",null,"New Backbone Classification")),!!r&&d.createElement("div",{className:"border-top pt-1"},d.createElement(th,{tree:r,getAppLink:o,selectedIds:[t],actions:s})))}function xA(e){var t=e.currentAppLink;return d.createElement($E,{navItems:Eg(),currentAppLink:t})}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,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DA(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 MA(e,t,n){return t&&DA(e.prototype,t),n&&DA(e,n),e}function UA(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)}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 Date.prototype.toString.call(Reflect.construct(Date,[],(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"!==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 zA(e){return(zA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var HA=function(e){UA(n,e);var t=VA(n);function n(){return RA(this,n),t.apply(this,arguments)}return MA(n,[{key:"channelName",get:function(){return l.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}(r.AppRouter),qA=function(e){UA(n,e);var t=VA(n);function n(){return RA(this,n),t.apply(this,arguments)}return MA(n,[{key:"initialize",value:function(){var e=this;Rr.values(p).forEach((function(t){return ay.getInstance(t,e)}))}},{key:"index",value:function(e){var t;this.layout.showChildView(kn,d.createElement(CO,{cursor:null===(t=e)||void 0===t?void 0:t.cursor}))}},{key:"searchPlaylists",value:function(e){var t,n;this.layout.showChildView(kn,d.createElement(wO,{query:null===(t=e)||void 0===t?void 0:t.query,cursor:null===(n=e)||void 0===n?void 0:n.cursor}))}},{key:"newPlaylist",value:function(){this.layout.showChildView(kn,d.createElement(uO,null))}},{key:"editPlaylist",value:function(e){this.layout.showChildView(kn,d.createElement(Yb,{key:e,playlistId:e}))}},{key:"editPlaylistVideos",value:function(e){this.layout.showChildView(kn,d.createElement(sO,{key:e,playlistId:e}))}},{key:"editPlaylistSubjects",value:function(e){this.layout.showChildView(kn,d.createElement(tO,{key:e,playlistId:e}))}},{key:"editPlaylistAudiences",value:function(e){this.layout.showChildView(kn,d.createElement(WE,{key:e,playlistId:e}))}},{key:"deletePlaylist",value:function(e){var t=Object.assign({playlistId:e},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(Bb,Object.assign({},t)))}},{key:"removeVideo",value:function(e,t){var n=Object.assign({playlistId:e,videoId:t},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(vO,Object.assign({},n)))}},{key:"removeFromSubject",value:function(e,t){var n=Object.assign({subjectId:t,memberId:e,memberType:sg.Playlists},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(AA,Object.assign({},n)))}},{key:"uploadImage",value:function(e){var t=Object.assign({imageType:e},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(Ob,Object.assign({},t)))}},{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 y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_n,d.createElement(tv,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Playlists Application"}},{key:"channelName",get:function(){return l.PLAYLISTS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:Cb}}}}],[{key:"router",get:function(){return HA}}]),n}(r.Application),JA=function(e){var t=e.children;return d.createElement(ym,null,t)},$A=function(){return"/api/domain/v2/me/ratings"},KA="ratings",YA=function(){return{url:$A(),key:KA}},GA=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Gs.string().trim().max(350,"Description is too long").default(""),rating:Gs.object().shape({id:Gs.string()}).default({}).noUnknown(),tallPoster:Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown(),banner:Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown()}).noUnknown(),WA=function(e,t){var n=l.SERIES,r=a.Series,i=[{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 Tb(e)&&i.push.apply(i,[{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]}}]),i};function ZA(e){var t=_s(),n=cu(t);return d.createElement(Bs,null,d.createElement(iu,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this series",autoFocus:!0}),d.createElement(iu,{label:"Description",as:"textarea",name:"description",id:"description",maxLength:350,value:t.values.description,placeholder:"Describe this series here",showCharacterCounter:!0}),d.createElement($m,{ratings:e.ratings}),d.createElement(Em,{imageType:Bd.TallPosters,fieldName:"tallPoster",application:l.SERIES,uploadAction:a.Series.UPLOAD_IMAGE}),d.createElement(Em,{imageType:Bd.Banners,fieldName:"banner",application:l.SERIES,uploadAction:a.Playlists.UPLOAD_IMAGE}),d.createElement("div",{className:"d-flex justify-content-between align-items-center"},d.createElement(fu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},e.id?"Save":"Create"),!!e.actions&&d.createElement(Bm,{actions:e.actions})))}function QA(e){return d.createElement(Ys,{initialValues:e.series,validationSchema:GA,onSubmit:e.saveSeries},d.createElement(ZA,{id:e.series&&e.series.id,ratings:e.ratings}))}function XA(e){return d.createElement("div",{className:"py-2"},d.createElement(Km,{tabs:WA(e.currentUser,e.seriesId),isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}));var t}function ej(e){var t,n=Object(bn.useDispatch)(),r=yy(),o=i.useBasicFetch(fC(e.seriesId)),c=i.useBasicFetch(YA()),s=i.useBasicFetch(zb());return d.createElement(d.Fragment,null,!!s.data&&d.createElement(XA,{seriesId:e.seriesId,activeAction:a.Series.EDIT_SERIES,currentUser:s.data}),!!o.data&&!!c.data&&d.createElement(QA,{series:o.data,saveSeries:function(t,o){i.fetch(n,mC(e.seriesId,t,(function(){r.success("Successfully updated series.")}),(function(){r.error("Failed to update series.")}),o))},ratings:c.data}),d.createElement("div",{className:"py-3 text-right"},"Can't find what you're looking for? Try the old edit series page ",d.createElement(Nd,{className:"info-link",appLink:(t=e.seriesId,{application:l.SERIES,action:a.Series.LEGACY_EDIT_SERIES,args:[t]})},"here"),"."))}function tj(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nj(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 nj(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 nj(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 rj(e){var t=tj(d.useState({}),2),n=t[0],r=t[1],o=i.useBasicFetch(fC(e.seriesId)),c=i.useBasicFetch(zb()),s=cy(p.SUBJECT);!function(e,t,n){var r=function(e){return pg(n,e)};ag(_S.getObjectLevelsFetchOptions(e,sg.Series,r("seriesLevels")),[e]),ag(_S.getObjectAudiencesFetchOptions(e,sg.Series,r("seriesAudiences")),[e,t.seriesLevels]),tg([_S.getPresentationsFetchOptions(r("presentations")),_S.getLevelsFetchOptions(r("levels"))],[]),ag(!!t.currentPresentation&&_S.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.seriesId,n,r),KE(n,r);var u=!!(n.presentations&&n.levels&&n.presentationAudiences&&n.seriesLevels&&n.seriesAudiences);return d.createElement(d.Fragment,null,!!c.data&&d.createElement(XA,{seriesId:e.seriesId,activeAction:a.Series.EDIT_SERIES_AUDIENCES,currentUser:c.data}),d.createElement(zm,{object:o.data}),!!u&&d.createElement(VS,{objectLevels:n.seriesLevels,objectAudiences:n.seriesAudiences,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:pg(r,"currentPresentation"),levels:n.levels,presentationAudiences:n.presentationAudiences,memberType:sg.Series,saveLevels:function(t,n,r){return s.updateObjectLevels(e.seriesId,t,sg.Series,n,r,r)},saveAudiences:function(t,r){return s.updateObjectAudiences(e.seriesId,n.currentPresentation.id,t,sg.Series,r,r)}}))}function ij(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||aj(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 oj(e){return function(e){if(Array.isArray(e))return cj(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||aj(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 aj(e,t){if(e){if("string"==typeof e)return cj(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)?cj(e,t):void 0}}function cj(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 sj(e){var t=ij(d.useState({}),2),n=t[0],r=t[1],o=i.useBasicFetch(fC(e.seriesId)),c=i.useBasicFetch(zb()),s=cy(p.SUBJECT);!function(e,t,n){var r=function(e){return pg(n,e)};tg([_S.getSubjectTreeFetchOptions(r("subjectTree")),_S.getPresentationsFetchOptions(r("presentations"))],[]),ag(_S.getObjectSubjectsFetchOptions(e,sg.Series,r("seriesSubjects")),[e]),ag(!!t.currentPresentation&&_S.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),d.useEffect((function(){return r("subjectClassifications")([])}),[t.seriesSubjects]);var i=function(e,t){return[].concat(oj(t.subjectClassifications||[]),oj(e))},o=t.seriesSubjects&&t.seriesSubjects.map((function(e){return _S.getSubjectClassificationFetchOptions(e.id,pg(n,"subjectClassifications",i))}));tg(o,[t.seriesSubjects],!!o),ag(_S.getObjectClassificationsFetchOptions(e,sg.Series,r("seriesClassifications")),[e,t.seriesSubjects])}(e.seriesId,n,r),KE(n,r);var u=!!(n.seriesSubjects&&n.subjectTree&&n.presentations&&n.classificationTree&&n.seriesClassifications&&n.subjectClassifications);return d.createElement(d.Fragment,null,!!c.data&&d.createElement(XA,{seriesId:e.seriesId,activeAction:a.Series.EDIT_SERIES_SUBJECTS,currentUser:c.data}),d.createElement(zm,{object:o.data}),u&&d.createElement(IE,{objectSubjects:n.seriesSubjects,subjectTree:n.subjectTree,memberType:sg.Series,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:pg(r,"currentPresentation"),objectClassifications:n.seriesClassifications,objectSubjectClassifications:n.subjectClassifications,classificationTree:n.classificationTree,saveSubjects:function(t,n,r){return s.updateObjectSubjects(e.seriesId,t,sg.Series,n,r,r)},saveClassifications:function(t,r){return s.updateObjectClassifications(e.seriesId,n.currentPresentation.id,t,sg.Series,r,r)}}))}function uj(){var e=Object(bn.useDispatch)(),t=yy(),n=i.useBasicFetch(YA());return d.createElement(d.Fragment,null,!!n.data&&d.createElement(QA,{saveSeries:function(n,o){var c=function(){t.error("Failed to create series.")},s=function(e){t.success("Successfully created series."),function(e){r.AppLinkHelper.trigger({application:l.SERIES,action:a.Series.EDIT_SERIES,args:[e.id]})}(e)};i.fetch(e,dC(n,(function(t){var n={permissions:Ib()};i.fetch(e,mC(t.id,n,s,c,o))}),c))},ratings:n.data}))}function lj(e){return(lj="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 fj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pj(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 dj(e,t,n){return t&&pj(e.prototype,t),n&&pj(e,n),e}function mj(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&&hj(e,t)}function hj(e,t){return(hj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yj(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=bj(e);if(t){var i=bj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return vj(this,n)}}function vj(e,t){return!t||"object"!==lj(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 bj(e){return(bj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var gj=function(e){mj(n,e);var t=yj(n);function n(){return fj(this,n),t.apply(this,arguments)}return dj(n,[{key:"channelName",get:function(){return l.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}(r.AppRouter),Sj=function(e){mj(n,e);var t=yj(n);function n(){return fj(this,n),t.apply(this,arguments)}return dj(n,[{key:"initialize",value:function(){var e=this;Rr.values(p).forEach((function(t){return ay.getInstance(t,e)}))}},{key:"newSeries",value:function(){this.layout.showChildView(kn,d.createElement(uj,null))}},{key:"editSeries",value:function(e){this.layout.showChildView(kn,d.createElement(ej,{seriesId:e}))}},{key:"editSeriesVideos",value:function(e){this.legacyEditSeries(e)}},{key:"editSeriesSubjects",value:function(e){this.layout.showChildView(kn,d.createElement(sj,{seriesId:e}))}},{key:"editSeriesAudiences",value:function(e){this.layout.showChildView(kn,d.createElement(rj,{seriesId:e}))}},{key:"legacyEditSeries",value:function(e){r.LocationUtils.Redirect("/manage/legacy/series/".concat(e),!0)}},{key:"uploadImage",value:function(e){var t=Object.assign({imageType:e},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(Ob,Object.assign({},t)))}},{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 y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_n,d.createElement(tv,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Series Application"}},{key:"channelName",get:function(){return l.SERIES}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:JA}}}}],[{key:"router",get:function(){return gj}}]),n}(r.Application);function Ej(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Oj(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 Oj(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 Oj(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 Cj(e){var t=Ej(d.useState(),2),n=t[0],r=t[1],o=Ej(d.useState(!1),2),a=o[0],c=o[1],s=i.useBasicFetch(function(e,t){switch(e){case ug.Playlists:return _b(t);case ug.Series:return fC(t);case ug.Videos:return fO(t)}}(e.memberType,e.memberId)),u=cy(p.SUBJECT);ag(_S.getAudienceFetchOptions(e.audienceId,r),[e.audienceId]);var l=!!n&&!!s.data,f="Remove ".concat(cm(wg.singularizeMemberType(e.memberType)));return d.createElement(by,{title:f,closePopup:e.closePopup,showLoadingSpinner:!l},l&&d.createElement(d.Fragment,null,d.createElement("div",null,d.createElement("p",null,"Are you sure you want to remove ",d.createElement("strong",null,s.data.name)," from ",d.createElement("strong",null,n.name),"?"),d.createElement("p",null,"This will not remove it from the backbone level.")),d.createElement(Sy,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){c(!0),u.removeObjectsFromAudience(e.audienceId,[e.memberId],e.memberType,null,null,e.closePopup,e.closePopup)},buttonText:"Yes, remove this ".concat(wg.singularizeMemberType(e.memberType)),isSpinnerButton:!0,showSpinner:a}]})))}function Aj(e){return(Aj="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 jj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wj(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 Ij(e,t,n){return t&&wj(e.prototype,t),n&&wj(e,n),e}function Tj(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&&kj(e,t)}function kj(e,t){return(kj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Lj(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Pj(e);if(t){var i=Pj(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return _j(this,n)}}function _j(e,t){return!t||"object"!==Aj(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 Pj(e){return(Pj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var xj,Nj=function(e){Tj(n,e);var t=Lj(n);function n(){return jj(this,n),t.apply(this,arguments)}return Ij(n,[{key:"channelName",get:function(){return l.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}(r.AppRouter),Rj=function(e){Tj(n,e);var t=Lj(n);function n(){return jj(this,n),t.apply(this,arguments)}return Ij(n,[{key:"initialize",value:function(){var e=this;this.subjectDataService=ay.getInstance(p.SUBJECT,this),Rr.values(p).forEach((function(t){return ay.getInstance(t,e)}))}},{key:"subjects",value:function(){this.subjectDataService.getSubjectTree((function(e){var t=!!e.children&&e.children[0];t?r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_SUBJECT,args:[t.id]},{replace:!0}):r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.NEW_SUBJECT},{replace:!0})}))}},{key:"newSubject",value:function(e){var t={parentId:e.parentId};this.layout.showChildView(kn,d.createElement(EA,Object.assign({key:e.parentId},t))),this.renderSubjectsLeftNav()}},{key:"editSubject",value:function(e){this.layout.showChildView(kn,d.createElement(dA,{key:e,subjectId:e})),this.renderSubjectsLeftNav(e)}},{key:"editSubjectPlaylists",value:function(e,t){var n,r={subjectId:e,memberType:sg.Playlists,action:a.Subjects.EDIT_SUBJECT_PLAYLISTS,presentationId:null===(n=t)||void 0===n?void 0:n.presentationId};this.layout.showChildView(kn,d.createElement(bA,Object.assign({key:"".concat(e,":playlists")},r))),this.renderSubjectsLeftNav(e)}},{key:"editSubjectSeries",value:function(e,t){var n,r={subjectId:e,memberType:sg.Series,action:a.Subjects.EDIT_SUBJECT_SERIES,presentationId:null===(n=t)||void 0===n?void 0:n.presentationId};this.layout.showChildView(kn,d.createElement(bA,Object.assign({key:"".concat(e,":series")},r))),this.renderSubjectsLeftNav(e)}},{key:"editSubjectVideos",value:function(e,t){var n,r={subjectId:e,memberType:sg.Videos,action:a.Subjects.EDIT_SUBJECT_VIDEOS,presentationId:null===(n=t)||void 0===n?void 0:n.presentationId};this.layout.showChildView(kn,d.createElement(bA,Object.assign({key:"".concat(e,":videos")},r))),this.renderSubjectsLeftNav(e)}},{key:"subjectClassifications",value:function(e){this.layout.showChildView(kn,d.createElement(IA,{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(kn,d.createElement(cA,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(Ln,d.createElement(AA,Object.assign({},r)))}},{key:"deleteSubject",value:function(e){var t=e.toString()===this.currentLeftNavId.toString()?{application:l.SUBJECTS,action:a.Subjects.NEW_SUBJECT}:null,n=Object.assign({subjectId:e,routeToOnDelete:t||null},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(lA,Object.assign({},n)))}},{key:"classifications",value:function(){var e={objectType:"classifications",getAppLink:function(e){return{application:l.SUBJECTS,action:a.Subjects.PRESENTATION_CLASSIFICATIONS,args:[e.id]}}};this.layout.showChildView(kn,d.createElement(eA,Object.assign({},e))),this.hideLeftNav()}},{key:"presentationClassifications",value:function(e){this.subjectDataService.getClassificationTree(e,(function(t){var n=!!t.children&&t.children[0];n?r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_CLASSIFICATION,args:[e,n.id]},{replace:!0}):r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.NEW_CLASSIFICATION,args:[e]},{replace:!0})}))}},{key:"newClassification",value:function(e,t){var n={presentationId:e,parentId:t.parentId};this.layout.showChildView(kn,d.createElement(lC,Object.assign({key:t.parentId},n))),this.renderClassificationLeftNav(e)}},{key:"editClassification",value:function(e,t){var n={presentationId:e,classificationId:t};this.layout.showChildView(kn,d.createElement(iC,Object.assign({key:t},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationPlaylists",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:sg.Playlists};this.layout.showChildView(kn,d.createElement(cC,Object.assign({key:"".concat(t,":playlists")},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationSeries",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:sg.Series};this.layout.showChildView(kn,d.createElement(cC,Object.assign({key:"".concat(t,":series")},n))),this.renderClassificationLeftNav(e,t)}},{key:"editClassificationVideos",value:function(e,t){var n={presentationId:e,classificationId:t,memberType:sg.Videos};this.layout.showChildView(kn,d.createElement(cC,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(Ln,d.createElement(vC,Object.assign({},r)))}},{key:"deleteClassification",value:function(e,t){var n=t===this.currentLeftNavId?{application:l.SUBJECTS,action:a.Subjects.NEW_CLASSIFICATION,args:[e]}:null,r=Object.assign({classificationId:t,routeToOnDelete:n||null},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(tC,Object.assign({},r)))}},{key:"levels",value:function(){this.layout.showChildView(kn,d.createElement(CC,null)),this.renderLevelsLeftNav()}},{key:"newLevel",value:function(){this.layout.showChildView(kn,d.createElement(AC,null)),this.renderLevelsLeftNav()}},{key:"level",value:function(e){r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_LEVEL,args:[e]},{replace:!0})}},{key:"editLevel",value:function(e){this.layout.showChildView(kn,d.createElement(SC,{key:e,id:e})),this.renderLevelsLeftNav(e)}},{key:"levelAudiences",value:function(e){this.layout.showChildView(kn,d.createElement(NC,{key:e,levelId:e})),this.renderLevelsLeftNav(e)}},{key:"editLevelPlaylists",value:function(e,t){var n,r={levelId:e,memberType:ug.Playlists,action:a.Subjects.EDIT_LEVEL_PLAYLISTS,presentationId:null===(n=t)||void 0===n?void 0:n.presentationId};this.layout.showChildView(kn,d.createElement(FC,Object.assign({key:"".concat(e,":playlists")},r))),this.renderLevelsLeftNav(e)}},{key:"editLevelSeries",value:function(e,t){var n,r={levelId:e,memberType:ug.Series,action:a.Subjects.EDIT_LEVEL_SERIES,presentationId:null===(n=t)||void 0===n?void 0:n.presentationId};this.layout.showChildView(kn,d.createElement(FC,Object.assign({key:"".concat(e,":series")},r))),this.renderLevelsLeftNav(e)}},{key:"editLevelVideos",value:function(e,t){var n,r={levelId:e,memberType:ug.Videos,action:a.Subjects.EDIT_LEVEL_VIDEOS,presentationId:null===(n=t)||void 0===n?void 0:n.presentationId};this.layout.showChildView(kn,d.createElement(FC,Object.assign({key:"".concat(e,":videos")},r))),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(Ln,d.createElement(zC,Object.assign({},r)))}},{key:"audiences",value:function(){var e={objectType:"audiences",getAppLink:function(e){return{application:l.SUBJECTS,action:a.Subjects.PRESENTATION_AUDIENCES,args:[e.id]}}};this.layout.showChildView(kn,d.createElement(eA,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(Ln,d.createElement(Cj,Object.assign({},r)))}},{key:"presentationAudiences",value:function(e){this.subjectDataService.getAudiences(e,(function(t){var n=!!t&&t[0];n?r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.EDIT_AUDIENCE,args:[e,n.masterId]},{replace:!0}):r.AppLinkHelper.trigger({application:l.SUBJECTS,action:a.Subjects.NEW_AUDIENCE,args:[e]},{replace:!0})}))}},{key:"newAudience",value:function(e){this.layout.showChildView(kn,d.createElement(MO,{presentationId:e})),this.hideLeftNav()}},{key:"editAudience",value:function(e,t){var n={presentationId:e,audienceId:t};this.layout.showChildView(kn,d.createElement(xO,Object.assign({key:t},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudiencePlaylists",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:ug.Playlists};this.layout.showChildView(kn,d.createElement(JO,Object.assign({key:"".concat(t,":playlists")},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudienceSeries",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:ug.Series};this.layout.showChildView(kn,d.createElement(JO,Object.assign({key:"".concat(t,":series")},n))),this.renderAudienceLeftNav(e,t)}},{key:"editAudienceVideos",value:function(e,t){var n={presentationId:e,audienceId:t,memberType:ug.Videos};this.layout.showChildView(kn,d.createElement(JO,Object.assign({key:"".concat(t,":videos")},n))),this.renderAudienceLeftNav(e,t)}},{key:"deleteAudience",value:function(e,t){var n={application:l.SUBJECTS,action:a.Subjects.PRESENTATION_AUDIENCES,args:[e]},r=Object.assign({id:t,routeToOnDelete:n},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(LO,Object.assign({},r)))}},{key:"presentations",value:function(){this.layout.showChildView(kn,d.createElement(WC,null)),this.hideLeftNav()}},{key:"newPresentation",value:function(){this.layout.showChildView(kn,d.createElement(ZC,null))}},{key:"editPresentation",value:function(e){this.layout.showChildView(kn,d.createElement(JC,{key:e,id:e})),this.hideLeftNav()}},{key:"uploadImage",value:function(e){var t=Object.assign({imageType:e},this.getPopupProps());this.layout.showChildView(Ln,d.createElement(Ob,Object.assign({},t)))}},{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 y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_n,d.createElement(tv,{alerts:n,removeAlert:r}))}},{key:"renderClassificationLeftNav",value:function(e,t){this.setCurrentLeftNavItem(t);var n={presentationId:e,selectedClassificationId:t};this.layout.showChildView(Tn,d.createElement(QO,Object.assign({},n)))}},{key:"renderSubjectsLeftNav",value:function(e){this.setCurrentLeftNavItem(e),this.layout.showChildView(Tn,d.createElement(PA,{selectedSubjectId:e}))}},{key:"renderAudienceLeftNav",value:function(e,t){this.setCurrentLeftNavItem(t);var n={presentationId:e,selectedAudienceId:t};this.layout.showChildView(Tn,d.createElement(zO,Object.assign({},n)))}},{key:"renderLevelsLeftNav",value:function(e){this.setCurrentLeftNavItem(e),this.layout.showChildView(Tn,d.createElement(kC,{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 d.createElement(xA,{currentAppLink:e})}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Subjects Application"}},{key:"channelName",get:function(){return l.SUBJECTS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:ym,getTopNavView:this.getTopNav}}}}],[{key:"router",get:function(){return Nj}}]),n}(r.Application),Dj=function(e){return{url:"/api/domain/v1/themes/".concat(e),key:"themes:".concat(e)}},Mj=function(e){var t="/api/domain/v1/themes",n="themes";return e&&(t+="?type=".concat(e),n+=":type:".concat(e)),{url:t,key:n}},Uj=function(e,t,n,r){return{url:"/api/domain/v1/themes",key:"theme",data:e,type:Cr.POST,invalidationKeys:"themes",success:t,error:n,always:r}},Fj=function(e,t,n,r,i){return{url:"/api/domain/v1/themes/".concat(e),key:"update:theme:".concat(e),data:t,type:Cr.PUT,success:n,error:r,always:i}},Vj=function(e,t,n,r){return{url:"/api/domain/v1/themes/".concat(e),key:"delete:theme:".concat(e),type:Cr.DELETE,invalidationKeys:"themes",success:t,error:n,always:r}},Bj=function(e){return{application:l.THEMES,action:a.Themes.EDIT_THEME,args:[e.id]}};function zj(){var e=i.useBasicFetch(Mj());return e.data?d.createElement(qm,{objects:e.data,getObjectAppLink:Bj,newObjectAppLink:{application:l.THEMES,action:a.Themes.NEW_THEME},objectName:"Theme"}):d.createElement(d.Fragment,null)}!function(e){e.Glance="glance"}(xj||(xj={}));var Hj=[{key:"topLeft",label:"Top Left"},{key:"topRight",label:"Top Right"},{key:"bottomLeft",label:"Bottom Left"},{key:"bottomRight",label:"Bottom Right"}];function qj(){var e=_s();return d.createElement("div",{className:"form-group"},Hj.map((function(t){var n="data.".concat(t.key);return d.createElement(Em,{label:t.label,imageType:Bd.HeroBanners,fieldName:n,application:l.THEMES,uploadAction:a.Videos.UPLOAD_IMAGE,setSelectedImage:function(t){e.setFieldValue(n,{fileId:t.id,url:t.url,fileIdType:Hd.ImageAPIv2})}})})))}var Jj=Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown(),$j=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default(""),type:Gs.mixed().required("Type is required"),data:Gs.mixed().when("type",{is:xj.Glance,then:Gs.object().shape({topLeft:Jj,topRight:Jj,bottomLeft:Jj,bottomRight:Jj}).noUnknown(),otherwise:Gs.mixed().strip(!0)}).default({})}).noUnknown();function Kj(e){var t=_s(),n=function(e){switch(e){case xj.Glance:return qj;default:return}}(t.values.type);return d.createElement(Bs,null,d.createElement(iu,{label:"Name",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this theme",autoFocus:!0}),d.createElement(iu,{as:"select",label:"Type",name:"type",id:"type",value:t.values.type},d.createElement("option",{value:null},"Select a type..."),Rr.getEnumKeys(xj).map((function(e){return d.createElement("option",{key:e,value:xj[e]},e)}))),!!n&&d.createElement(n,null),d.createElement("div",{className:"d-flex justify-content-between align-items-center"},d.createElement(wu,{isNew:e.isNew}),!!e.actions&&d.createElement(Bm,{actions:e.actions})))}function Yj(e){var t;return d.createElement(Ys,{initialValues:e.theme,validationSchema:$j,onSubmit:e.saveTheme},d.createElement(Kj,{isNew:!(null===(t=e.theme)||void 0===t?void 0:t.id),actions:e.actions}))}function Gj(){var e=Object(bn.useDispatch)();return d.createElement(Yj,{saveTheme:function(t,n){i.fetch(e,Uj(t,(function(e){n(),r.AppLinkHelper.trigger({application:l.THEMES,action:a.Themes.EDIT_THEME,args:[e.id]})}),null,n))}})}function Wj(e){var t=Object(bn.useDispatch)(),n=yy(),r=i.useBasicFetch(Dj(e.id));return r.data?d.createElement(Yj,{theme:r.data,saveTheme:function(r,o){i.fetch(t,Fj(e.id,r,(function(){n.success("Successfully updated theme")}),(function(){n.error("Failed to update theme")}),o))},actions:[{label:"Delete theme",className:"btn btn-danger",button:!0,appLink:{application:l.THEMES,action:a.Themes.DELETE_THEME,args:[e.id]}}]}):d.createElement(d.Fragment,null)}function Zj(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Qj(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 Qj(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 Qj(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 Xj(e){var t=Object(bn.useDispatch)(),n=yy(),o=Zj(d.useState(!1),2),c=o[0],s=o[1],u=i.useBasicFetch(Dj(e.id));return d.createElement(by,{title:"Delete Theme",closePopup:e.closePopup,showLoadingSpinner:!u.data},d.createElement(d.Fragment,null,d.createElement("p",null,"Are you sure you want to delete ",d.createElement("strong",null,u.data.name),"?"),d.createElement(Sy,{buttons:[{variant:"link",onClick:e.closePopup,buttonText:"Cancel"},{variant:"danger",onClick:function(){s(!0),i.fetch(t,Vj(e.id,(function(){n.success("Successfully deleted theme"),r.AppLinkHelper.trigger({application:l.THEMES,action:a.Themes.THEMES})}),(function(){n.error("Failed to delete theme")})))},buttonText:"Yes, delete this theme",isSpinnerButton:!0,showSpinner:c}]})))}var ew=function(e){var t=e.children;return d.createElement(ym,null,t)};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){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rw(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 iw(e,t,n){return t&&rw(e.prototype,t),n&&rw(e,n),e}function ow(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&&aw(e,t)}function aw(e,t){return(aw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function cw(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=uw(e);if(t){var i=uw(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return sw(this,n)}}function sw(e,t){return!t||"object"!==tw(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 uw(e){return(uw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var lw=function(e){ow(n,e);var t=cw(n);function n(){return nw(this,n),t.apply(this,arguments)}return iw(n,[{key:"channelName",get:function(){return l.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}(r.AppRouter),fw=function(e){ow(n,e);var t=cw(n);function n(){return nw(this,n),t.apply(this,arguments)}return iw(n,[{key:"themes",value:function(){this.layout.showChildView(kn,d.createElement(zj,null))}},{key:"newTheme",value:function(){this.layout.showChildView(kn,d.createElement(Gj,null))}},{key:"editTheme",value:function(e){this.layout.showChildView(kn,d.createElement(Wj,{id:e}))}},{key:"deleteTheme",value:function(e){var t=this;this.layout.showChildView(Ln,d.createElement(Xj,{id:e,closePopup:function(){return t.layout.closePopup()}}))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(Ln,d.createElement(Ob,{imageType:e,closePopup:function(){return t.layout.closePopup()}}))}},{key:"name",get:function(){return"Themes Application"}},{key:"channelName",get:function(){return l.THEMES}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:ew}}}}],[{key:"router",get:function(){return lw}}]),n}(Zh),pw=function(e){var t=e.children;return d.createElement(ym,null,t)},dw=function(e,t){var n=l.VIDEOS,r=a.Videos,i=[{label:"Edit Video Details",appLink:{application:n,action:r.EDIT_VIDEO,args:[t]}}];return Tb(e)?[].concat(i,[{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]}}]):i};function mw(e){var t,n=dw(e.currentUser,e.videoId);return n.length<2?d.createElement(d.Fragment,null):d.createElement("div",{className:"py-2"},d.createElement(Km,{tabs:n,isItemActive:(t=e.activeAction,function(e){return e.appLink.action===t})}))}var hw,yw=Gs.object().shape({name:Gs.string().trim().max(255,"Name is too long").required("Name is required").default(""),description:Gs.string().trim().default(""),status:Gs.mixed().required("Status is required"),productionYear:Gs.number().min(1900),rating:Gs.object().shape({id:Gs.string()}).default({}).noUnknown(),thumbnail:Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown(),heroBanner:Gs.object().shape({fileId:Gs.string(),fileIdType:Gs.mixed(),url:Gs.string()}).default({}).noUnknown(),glance:Gs.object().shape({theme:Gs.string(),format:Gs.mixed(),content:Gs.string()}).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"}(hw||(hw={}));var vw,bw=n(25),gw=n.n(bw);function Sw(e){var t,n,r,i,o,a=_s();return d.createElement("div",{className:"form-group p-2 border"},d.createElement("div",{className:"border-bottom mb-2"},d.createElement("label",null,"Summary")),d.createElement(iu,{as:"select",label:"Theme",name:"glance.theme",id:"type",value:null===(t=a.values.glance)||void 0===t?void 0:t.theme},d.createElement("option",{value:null},"Select a theme..."),e.themes.map((function(e){return d.createElement("option",{key:e.id,value:e.name},e.name)}))),d.createElement(iu,{as:"select",label:"Format",name:"glance.format",id:"type",value:null===(n=a.values.glance)||void 0===n?void 0:n.format},d.createElement("option",{value:null},"Select a format..."),Rr.getEnumKeys(vw).map((function(e){return d.createElement("option",{key:e,value:vw[e]},e)}))),d.createElement(iu,{label:"Content",as:"textarea",name:"glance.content",id:"content",value:null===(r=a.values.glance)||void 0===r?void 0:r.content}),(null===(i=a.values.glance)||void 0===i?void 0:i.format)===vw.Markdown&&d.createElement("div",{className:"form-group"},d.createElement("label",null,"Content Preview"),d.createElement("div",{className:"border rounded py-2",dangerouslySetInnerHTML:{__html:bw(null===(o=a.values.glance)||void 0===o?void 0:o.content)}})))}function Ew(e){switch(e){case hw.Published:return"badge-success";case hw.Archived:return"badge-danger";case hw.Draft:return"badge-warning";case hw.Pending:return"badge-info";case hw.Rejected:return"badge-dark";default:return"badge-secondary"}}function Ow(e){var t=_s(),n=!!e.rightslineId,r=Tb(e.currentUser);return d.createElement(Bs,null,n&&d.createElement(iu,{label:"Rightsline ID",name:"rightslineId",id:"rightslineId",value:e.rightslineId,disabled:!0}),d.createElement(iu,{label:"Name",type:"text",name:"name",id:"name",value:t.values.name,placeholder:"Enter a name for this video",disabled:n,autoFocus:!0}),d.createElement("div",{className:"form-group"},d.createElement("label",null,"Status"),d.createElement("div",null,d.createElement("span",{className:"badge ".concat(Ew(t.values.status))},hw[t.values.status]))),d.createElement(iu,{label:"Description",as:"textarea",name:"description",id:"description",value:t.values.description,placeholder:"Describe this video here",disabled:n,showCharacterCounter:!0}),d.createElement(iu,{label:"Production Year",type:"number",name:"productionYear",id:"productionYear",value:t.values.productionYear,disabled:n}),d.createElement($m,{ratings:e.ratings,disabled:n}),d.createElement(Em,{imageType:Bd.Thumbnails,fieldName:"thumbnail",application:l.VIDEOS,uploadAction:a.Videos.UPLOAD_IMAGE}),d.createElement(Em,{imageType:Bd.HeroBanners,fieldName:"heroBanner",application:l.VIDEOS,uploadAction:a.Videos.UPLOAD_IMAGE}),r&&d.createElement(Sw,{themes:e.themes}),d.createElement(wu,{isNew:!e.id}))}function Cw(e,t){if(e)return t?Object.assign(Object.assign({},e),t):e}function Aw(e){return d.createElement(Ys,{initialValues:Cw(e.video,e.rightslineVideo),validationSchema:yw,onSubmit:e.saveVideo,allowInitialSubmit:!!e.rightslineVideo},d.createElement(Ow,{id:e.video&&e.video.id,ratings:e.ratings,themes:e.themes,currentUser:e.currentUser,rightslineId:e.rightslineId}))}function jw(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ww(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 ww(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 ww(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 Iw(e){var t,n=Object(bn.useDispatch)(),r=jw(d.useState(!1),2),o=r[0],c=r[1],s=i.useBasicFetch(fO(e.videoId)),u=i.useBasicFetch(dO(e.videoId)),f=i.useBasicFetch(YA()),p=i.useBasicFetch(Mj(xj.Glance)),m=i.useBasicFetch(zb());var h,y=!!s.data&&!!f.data&&!!p.data&&!!m.data&&u.isComplete;return d.createElement(d.Fragment,null,!!m.data&&d.createElement(mw,{videoId:e.videoId,activeAction:a.Videos.EDIT_VIDEO,currentUser:m.data}),!!u.data&&d.createElement("div",{className:"pt-3 text-right"},d.createElement(Zs.Button,{variant:"outline-dark",size:"sm",onClick:function(){u.isFetching||(c(!0),i.fetch(n,dO(e.videoId)))}},"Sync from Rightsline")),y&&d.createElement(Aw,{video:s.data,saveVideo:function(t,r){i.fetch(n,mO(e.videoId,t,null,null,r))},ratings:f.data,themes:p.data,currentUser:m.data,rightslineId:null===(t=u.data)||void 0===t?void 0:t.rightslineId,rightslineVideo:o&&u.data}),d.createElement("div",{className:"py-3 text-right"},"Can't find what you're looking for? Try the old edit video page ",d.createElement(Nd,{className:"info-link",appLink:(h=e.videoId,{application:l.VIDEOS,action:a.Videos.LEGACY_EDIT_VIDEO,args:[h]})},"here"),"."))}function Tw(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return kw(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 kw(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 kw(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 Lw(e){var t=Tw(d.useState({}),2),n=t[0],r=t[1],o=i.useBasicFetch(fO(e.videoId)),c=i.useBasicFetch(zb()),s=cy(p.SUBJECT);!function(e,t,n){var r=function(e){return pg(n,e)};ag(_S.getObjectLevelsFetchOptions(e,sg.Videos,r("videoLevels")),[e]),ag(_S.getObjectAudiencesFetchOptions(e,sg.Videos,r("videoAudiences")),[e,t.videoLevels]),tg([_S.getPresentationsFetchOptions(r("presentations")),_S.getLevelsFetchOptions(r("levels"))],[]),ag(!!t.currentPresentation&&_S.getAudiencesFetchOptions(t.currentPresentation.id,r("presentationAudiences")),[t.currentPresentation],!!t.currentPresentation)}(e.videoId,n,r),KE(n,r);var u=!!(n.presentations&&n.levels&&n.presentationAudiences&&n.videoLevels&&n.videoAudiences);return d.createElement(d.Fragment,null,!!c.data&&d.createElement(mw,{videoId:e.videoId,activeAction:a.Videos.EDIT_VIDEO_AUDIENCES,currentUser:c.data}),d.createElement(zm,{object:o.data}),!!u&&d.createElement(VS,{objectLevels:n.videoLevels,objectAudiences:n.videoAudiences,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:pg(r,"currentPresentation"),levels:n.levels,presentationAudiences:n.presentationAudiences,memberType:sg.Videos,saveLevels:function(t,n,r){return s.updateObjectLevels(e.videoId,t,sg.Videos,n,r,r)},saveAudiences:function(t,r){return s.updateObjectAudiences(e.videoId,n.currentPresentation.id,t,sg.Videos,r,r)}}))}function _w(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||xw(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 Pw(e){return function(e){if(Array.isArray(e))return Nw(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||xw(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 xw(e,t){if(e){if("string"==typeof e)return Nw(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)?Nw(e,t):void 0}}function Nw(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 Rw(e){var t=_w(d.useState({}),2),n=t[0],r=t[1],o=i.useBasicFetch(fO(e.videoId)),c=i.useBasicFetch(zb()),s=cy(p.SUBJECT);!function(e,t,n){var r=function(e){return pg(n,e)};tg([_S.getSubjectTreeFetchOptions(r("subjectTree")),_S.getPresentationsFetchOptions(r("presentations"))],[]),ag(_S.getObjectSubjectsFetchOptions(e,sg.Videos,r("videoSubjects")),[e]),ag(!!t.currentPresentation&&_S.getClassificationTreeFetchOptions(t.currentPresentation.id,r("classificationTree")),[t.currentPresentation],!!t.currentPresentation),d.useEffect((function(){return r("subjectClassifications")([])}),[t.videoSubjects]);var i=function(e,t){return[].concat(Pw(t.subjectClassifications||[]),Pw(e))},o=t.videoSubjects&&t.videoSubjects.map((function(e){return _S.getSubjectClassificationFetchOptions(e.id,pg(n,"subjectClassifications",i))}));tg(o,[t.videoSubjects],!!o),ag(_S.getObjectClassificationsFetchOptions(e,sg.Videos,r("videoClassifications")),[e,t.videoSubjects])}(e.videoId,n,r),KE(n,r);var u=!!(n.videoSubjects&&n.subjectTree&&n.presentations&&n.classificationTree&&n.videoClassifications&&n.subjectClassifications);return d.createElement(d.Fragment,null,!!c.data&&d.createElement(mw,{videoId:e.videoId,activeAction:a.Videos.EDIT_VIDEO_SUBJECTS,currentUser:c.data}),d.createElement(zm,{object:o.data}),u&&d.createElement(IE,{objectSubjects:n.videoSubjects,subjectTree:n.subjectTree,memberType:sg.Videos,presentations:n.presentations,currentPresentation:n.currentPresentation,setCurrentPresentation:pg(r,"currentPresentation"),objectClassifications:n.videoClassifications,objectSubjectClassifications:n.subjectClassifications,classificationTree:n.classificationTree,saveSubjects:function(t,n,r){return s.updateObjectSubjects(e.videoId,t,sg.Videos,n,r,r)},saveClassifications:function(t,r){return s.updateObjectClassifications(e.videoId,n.currentPresentation.id,t,sg.Videos,r,r)}}))}!function(e){e.Markdown="text/markdown"}(vw||(vw={}));var Dw=function(e){return{key:"aliases:".concat(e),url:"/api/master/v2/objects/".concat(e,"/aliases")}},Mw=function(e,t,n,r){return{key:"create:alias",url:"/api/master/v2/objects/".concat(e,"/aliases"),type:Cr.POST,invalidationKeys:"aliases:".concat(e),data:t,success:n,error:r}},Uw=function(e,t,n,r){return{key:"delete:alias",url:"/api/domain/v2/objects/".concat(e,"/aliases/").concat(t),type:Cr.DELETE,invalidationKeys:"aliases:".concat(e),success:n,error:r}};function Fw(e){var t=Object(bn.useDispatch)(),n=yy(),r=i.useBasicFetch(Dw(e.videoId)),o=i.useBasicFetch(zb());return r.data?d.createElement(d.Fragment,null,!!o.data&&d.createElement(mw,{videoId:e.videoId,activeAction:a.Videos.EDIT_VIDEO_ALIASES,currentUser:o.data}),d.createElement(Th,{aliases:r.data.data,onSave:function(r,o){i.fetch(t,Mw(e.videoId,r,(function(){n.success("Successfully created alias"),o()}),(function(){n.error("Something went wrong creating your alias")})))},onDelete:function(r){i.fetch(t,Uw(e.videoId,r,(function(){n.success("Successfully deleted alias")}),(function(){n.error("Something went wrong deleting your alias")})))}})):d.createElement(d.Fragment,null,"Loading...")}function Vw(e){return(Vw="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 Bw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zw(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 Hw(e,t,n){return t&&zw(e.prototype,t),n&&zw(e,n),e}function qw(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&&Jw(e,t)}function Jw(e,t){return(Jw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $w(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 Date.prototype.toString.call(Reflect.construct(Date,[],(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 Kw(this,n)}}function Kw(e,t){return!t||"object"!==Vw(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 Gw=function(e){qw(n,e);var t=$w(n);function n(){return Bw(this,n),t.apply(this,arguments)}return Hw(n,[{key:"channelName",get:function(){return l.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}(r.AppRouter),Ww=function(e){qw(n,e);var t=$w(n);function n(){return Bw(this,n),t.apply(this,arguments)}return Hw(n,[{key:"initialize",value:function(){var e=this;Rr.values(p).forEach((function(t){return ay.getInstance(t,e)}))}},{key:"editVideo",value:function(e){this.layout.showChildView(kn,d.createElement(Iw,{videoId:e}))}},{key:"editVideoAudiences",value:function(e){this.layout.showChildView(kn,d.createElement(Lw,{videoId:e}))}},{key:"editVideoSubjects",value:function(e){this.layout.showChildView(kn,d.createElement(Rw,{videoId:e}))}},{key:"editVideoAliases",value:function(e){this.layout.showChildView(kn,d.createElement(Fw,{videoId:e}))}},{key:"legacyEditVideo",value:function(e){r.LocationUtils.Redirect("/tools/programlookup/".concat(e))}},{key:"uploadImage",value:function(e){var t=this;this.layout.showChildView(Ln,d.createElement(Ob,{imageType:e,closePopup:function(){return t.layout.closePopup()}}))}},{key:"name",get:function(){return"Videos Application"}},{key:"channelName",get:function(){return l.VIDEOS}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT,options:{provider:pw,alertRegion:_n}}}}],[{key:"router",get:function(){return Gw}}]),n}(Zh),Zw="UPDATE_VIEW_MODEL",Qw=function(e,t){var n=Object(bn.useDispatch)(),r=Object(bn.useSelector)((function(t){return t.viewModelData[e]}));function i(t,r){n({type:Zw,payload:{viewModelKey:e,dataOrKey:t,keyData:r}})}return void 0!==t&&void 0===r&&i(t),[r,i]},Xw="release:notes:config",eI=[{id:"798",name:"Monorepo"},{id:"109",name:"Online"},{id:"822",name:"Lite"},{id:"534",name:"Library Editor"},{id:"62",name:"Curator"}];function tI(e){var t=_s(),n=cu(t),r="798"===t.values.project;return m.a.useEffect((function(){e.getMilestones(t.values.project),r&&e.getBranchNames(t.values.project)}),[t.values.project]),m.a.useEffect((function(){t.setFieldValue("milestone",Oi(e.milestones))}),[e.milestones]),m.a.useEffect((function(){t.setFieldValue("branchName",Oi(e.branchNames))}),[e.branchNames]),m.a.createElement(Bs,null,m.a.createElement(iu,{as:"select",label:"Project",name:"project",id:"project",value:t.values.project},eI.map((function(e){return m.a.createElement("option",{key:e.id,value:e.id},e.name)}))),m.a.createElement(iu,{as:"select",label:"Milestone",name:"milestone",id:"milestone",value:t.values.milestone,disabled:!e.milestones.length},e.milestones.map((function(e){return m.a.createElement("option",{key:e,value:e},e)}))),r&&m.a.createElement(iu,{as:"select",label:"Branch Name",name:"branchName",id:"branchName",value:t.values.branchName,disabled:!e.branchNames.length},e.branchNames.map((function(e){return m.a.createElement("option",{key:e,value:e},e)}))),m.a.createElement("div",{className:"d-flex justify-content-between"},m.a.createElement(fu,{showSpinner:t.isSubmitting,type:"submit",disabled:!n},"Generate")))}var nI="U_Jxes3Htv-xiaDX5wfn",rI="https://gitlab.cvinternal.net/api/v4",iI=function(e,t){return{key:"milestones:".concat(e),url:Yd("".concat(rI,"/projects/").concat(e,"/milestones"),{private_token:nI}),normalize:!1,formatData:function(e){return e.map((function(e){return e.title}))},success:t}},oI=function(e,t){return{key:"branch:names:".concat(e),url:Yd("".concat(rI,"/projects/").concat(e,"/repository/branches"),{private_token:nI,per_page:50}),normalize:!1,formatData:function(e){return e.map((function(e){return e.name}))},success:t}},aI=function(e,t,n,r){return{key:"merge:requests:".concat(e,":").concat(t,":").concat(n),url:Yd("".concat(rI,"/projects/").concat(e,"/merge_requests"),{private_token:nI,milestone:t,state:"merged",per_page:50,page:n}),success:r}},cI=function(e,t,n){return{key:"file:paths:".concat(t,":").concat(e),url:Yd("".concat(rI,"/projects/").concat(e,"/search"),{scope:"blobs",search:t,private_token:nI}),normalize:!1,formatData:function(e){return e.filter((function(e){return e.filename.includes(t)}))},success:n}},sI=function(e,t,n,r){return{key:"file:".concat(e,":").concat(t,":").concat(n),url:Yd("".concat(rI,"/projects/").concat(e,"/repository/files/").concat(encodeURIComponent(t),"/raw"),{ref:n,private_token:nI}),normalize:!1,formatData:function(e){return JSON.parse(e)},success:r}},uI=Gs.object().shape({project:Gs.string().required("Project is required").default(""),milestone:Gs.string().required("Milestone is required").default(""),branchName:Gs.string().when("project",(function(e,t){return"798"===e?t.required("Branch name is required"):t})).default("")}).noUnknown();function lI(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fI(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 fI(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 fI(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 pI={project:Oi(eI).id};function dI(){var e=lI(m.a.useState([]),2),t=e[0],n=e[1],o=lI(m.a.useState([]),2),c=o[0],s=o[1],u=lI(Qw(Xw),2)[1],f=Object(bn.useDispatch)();return m.a.createElement(m.a.Fragment,null,m.a.createElement("h4",{className:"py-2"},"Generate Release Notes"),m.a.createElement(Ys,{initialValues:pI,onSubmit:function(e){u(e),r.AppLinkHelper.trigger({application:l.RELEASE_NOTES,action:a.ReleaseNotes.GENERATOR})},validationSchema:uI},m.a.createElement(tI,{getMilestones:function(e){n([]),i.fetch(f,iI(e,n))},milestones:t,getBranchNames:function(e){s([]),i.fetch(f,oI(e,s))},branchNames:c})))}var mI=n(141),hI=/#*/;function yI(e){return e=e.replace("-"," "),e="## "+(e=(e=cm(e)).replace(hI,"").trim())}function vI(e){var t=e.toLowerCase();return"## notes"===t||"## dependencies"===t}function bI(e){return e=e.replace("-"," "),e=cm(e)}function gI(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 SI(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 SI(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 o,a=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function SI(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 EI=["# online","# curator","# library editor","# lite","# styles","# tooling","# analytics","# common","# shared","# player"];function OI(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),o=e.slice(n,i);EI.includes(o.toLowerCase().trim())&&(t.name=cm(o.replace("#","").trim()),e=e.slice(i),n=-1)}}for(var a=0;!t.changes&&a<e.length;a++){if(a+1===e.length){t.changes=e,e="";break}if("#"===e[a]&&"#"!==e[a+1]){var c=e.indexOf("\n",a),s=e.slice(a,c);EI.includes(s.toLowerCase().trim())&&(t.changes=e.slice(0,a),e=e.slice(a),a=-1)}}return{section:t,remainingDescription:e}}function CI(e){var t,n={},r=gI(e);try{for(r.s();!(t=r.n()).done;)for(var i=t.value;i;){var o=OI(i),a=o.section;if(i=o.remainingDescription,!a.name)break;n[a.name]||(n[a.name]=[]),n[a.name].push(a.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),o=bI(t.slice(n,i).join(""));r[o]||(r[o]="");for(var a=i;a<t.length;a++){if(t.length===a+1){var c=t.slice(i+1).join("");r[o]+=c,t=[];break}if("#"===t[a]&&"#"===t[a+1]){var s=t.slice(i+1,a).join("");if(!s.length){t=t.slice(a),n=-1;break}r[o]+=s,t=t.slice(a),n=-1;break}}r[o]+="\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 AI=n(142),jI=n.n(AI);function wI(e){return function(e){if(Array.isArray(e))return kI(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||TI(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 II(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,o=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw o}}return n}(e,t)||TI(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 TI(e,t){if(e){if("string"==typeof e)return kI(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)?kI(e,t):void 0}}function kI(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 LI(){var e=II(m.a.useState(!0),2),t=e[0],n=e[1],o=II(m.a.useState(1),2),c=o[0],s=o[1],u=II(m.a.useState([]),2),f=u[0],p=u[1],d=II(m.a.useState([]),2),h=d[0],y=d[1],v=II(m.a.useState(!0),2),b=v[0],g=v[1],S=II(m.a.useState(""),2),E=S[0],O=S[1],C=II(m.a.useState("Copy"),2),A=C[0],j=C[1],w=II(Qw(Xw),1)[0],I=w&&"798"===w.project,T=Object(bn.useDispatch)();return m.a.useEffect((function(){if(w){var e=w.project,t=w.milestone;i.fetch(T,aI(e,t,c,(function(e){p([].concat(wI(f),wI(e))),50===e.length?s(c+1):n(!1)})))}}),[c]),m.a.useEffect((function(){if(!(t||I&&b)){var e=f.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=CI(e);return"".concat(n,"\n").concat(r)}(e,h):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 o=n.indexOf("\n",i),a=yI(n.slice(i,o).join(""));t[a]||(vI(a)?r=!0:t[a]="");for(var c=o;c<n.length;c++){if(n.length===c+1){if(r){r=!1,n=[];break}var s=n.slice(o+1).join("");t[a]+=s,n=[];break}if("#"===n[c]){if(r){r=!1,n=n.slice(c),i=-1;break}var u=n.slice(o+1,c).join("");if(!u.length){n=n.slice(c),i=-1;break}t[a]+=u,n=n.slice(c),i=-1;break}}t[a]?t[a]+="\n":delete t[a]}break}})),Object.keys(t).reduce((function(e,n){return t[n]?(e+=n+"\n",e+=t[n]+"\n"):e}),"")}(e);O(n)}}),[t,b]),m.a.useEffect((function(){if(w&&I){var e=[];i.fetch(T,cI(w.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=TI(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 o,a=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;i.fetch(T,sI(w.project,o.path,w.branchName,(function(n){e.push(n),e.length===t.length&&(y(e),g(!1))})))}}catch(e){r.e(e)}finally{r.f()}})))}}),[]),w?m.a.createElement(m.a.Fragment,null,E?m.a.createElement("div",{className:"position-relative border rounded p-3"},m.a.createElement(mI,{onCopy:function(){return j("Copied")},text:E},m.a.createElement("button",{className:"btn btn-white ".concat(jI.a.copyBtn)},A)),m.a.createElement("div",{dangerouslySetInnerHTML:{__html:gw()(E)}})):t?"Fetching merge requests..":"Merging descriptions.."):(r.AppLinkHelper.trigger({application:l.RELEASE_NOTES,action:a.ReleaseNotes.FORM}),m.a.createElement(m.a.Fragment,null))}function _I(e){return(_I="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 PI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xI(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 NI(e,t,n){return t&&xI(e.prototype,t),n&&xI(e,n),e}function RI(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&&DI(e,t)}function DI(e,t){return(DI=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function MI(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=FI(e);if(t){var i=FI(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return UI(this,n)}}function UI(e,t){return!t||"object"!==_I(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 FI(e){return(FI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var VI,BI=function(e){RI(n,e);var t=MI(n);function n(){return PI(this,n),t.apply(this,arguments)}return NI(n,[{key:"channelName",get:function(){return l.RELEASE_NOTES}},{key:"appRoutes",get:function(){return{"developer/release-notes(/)":"index","developer/release-notes/generate(/)":"form","developer/release-notes/generator(/)":"generator"}}}]),n}(r.AppRouter),zI=function(e){RI(n,e);var t=MI(n);function n(){return PI(this,n),t.apply(this,arguments)}return NI(n,[{key:"index",value:function(){r.AppLinkHelper.trigger({application:l.RELEASE_NOTES,action:a.ReleaseNotes.GENERATOR},{replace:!0})}},{key:"form",value:function(){this.layout.showChildView(kn,d.createElement(dI,null))}},{key:"generator",value:function(){this.layout.showChildView(kn,d.createElement(LI,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 y.Radio.channel(b.ALERT).trigger("remove:alert",e)};this.layout.showChildView(_n,d.createElement(tv,{alerts:n,removeAlert:r}))}},{key:"getPopupProps",value:function(){var e=this;return{closePopup:function(){return e.layout.closePopup()}}}},{key:"name",get:function(){return"Release Notes Application"}},{key:"channelName",get:function(){return l.RELEASE_NOTES}},{key:"layoutOptions",get:function(){return{name:u.CURATOR_LAYOUT}}}],[{key:"router",get:function(){return BI}}]),n}(r.Application);function HI(e){return(HI="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 qI(e){return function(e){if(Array.isArray(e))return JI(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 JI(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 JI(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 JI(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 $I(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 KI(e,t){return(KI=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function YI(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=WI(e);if(t){var i=WI(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return GI(this,n)}}function GI(e,t){return!t||"object"!==HI(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 WI(e){return(WI=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}!function(e){e.Fifo="FifoMemoryCache"}(VI||(VI={}));var ZI,QI=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&&KI(e,t)}(o,e);var t,n,r,i=YI(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this)).size=e.size,t.cache={},t.cachedkeys=[],t}return t=o,(n=[{key:"removeCacheKey",value:function(e){this.cachedkeys=h.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||K.throw(new Xe("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=h.object(this.cachedkeys,this.cachedkeys),i=[];h.each(e,(function(e){var t;r[e]&&i.push(e);var n=new RegExp(e,"i"),o=h.filter(r,(function(e){return n.test(e)}));(t=i).push.apply(t,qI(o))})),i.length&&(i=h.uniq(i),h.each(i,(function(e){delete n.cache[e],h.isFunction(t)&&t(e)})),this.cachedkeys=h.without.apply(h,[this.cachedkeys].concat(qI(i))))}},{key:"name",get:function(){return VI.Fifo}}])&&$I(t.prototype,n),r&&$I(t,r),o}(Yt);!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"}(ZI||(ZI={}));var XI,eT={type:ZI.Unknown,message:"",code:0};!function(e){e.Ajax="AjaxDataProvider",e.Notifications="NotificationsSignalRDataProvider"}(XI||(XI={}));var tT=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 nT(e){return(nT="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 rT(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 iT(e,t){return(iT=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function oT(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=cT(e);if(t){var i=cT(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return aT(this,n)}}function aT(e,t){return!t||"object"!==nT(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 cT(e){return(cT=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var sT=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&&iT(e,t)}(o,e);var t,n,r,i=oT(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),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=o,(n=[{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=Cr.GET);var i=h.defaults(r,{forceHttps:!1}),o={url:e,method:n,type:n};t&&(o.data=n===Cr.POST||n===Cr.PUT?JSON.stringify(t):t),i.forceHttps&&(o.url=this.makeHttps(o.url)),i.traditional&&(o.traditional=i.traditional);var a=$.ajax(o);return h.keys(this.successMiddleware).length&&a.done(h.values(this.successMiddleware)),h.keys(this.errorMiddleware).length&&a.fail(h.values(this.errorMiddleware)),a}},{key:"create",value:function(e,t,n){var r=n.channel,i=n.successEvent,o=n.errorEvent;this.base(e,t,Cr.POST).done((function(e,t,n){return r.trigger(i,e,t,n)})).fail((function(e,t,n){return r.trigger(o,e,t,n)}))}},{key:"read",value:function(e,t){var n=t.channel,r=t.successEvent,i=t.errorEvent;this.base(e,null,Cr.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,o=n.errorEvent;this.base(e,t,Cr.PUT).done((function(e,t,n){return r.trigger(i,e,t,n)})).fail((function(e,t,n){return r.trigger(o,e,t,n)}))}},{key:"delete",value:function(e,t){var n=t.channel,r=t.successEvent,i=t.errorEvent;this.base(e,null,Cr.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,t,n){var r=e.responseJSON,i=eT;switch(i.code=e.status,i.message=tT(this.dataServiceErrorMessageMappings,this.defaultErrorMessageKey,r),e.status){case 400:i.type=ZI.BadRequest;break;case 401:i.type=ZI.Unauthorized;break;case 403:i.type=ZI.Forbidden;break;case 404:i.type=ZI.NotFound;break;case 500:i.type=ZI.InternalServer}return i}},{key:"name",get:function(){return XI.Ajax}}])&&rT(t.prototype,n),r&&rT(t,r),o}(I.Object);function uT(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lT(e,t){return"string"==typeof t.payload.dataOrKey&&void 0!==t.payload.keyData?Object.assign(Object.assign({},e),uT({},t.payload.viewModelKey,Object.assign(Object.assign({},e[t.payload.viewModelKey]),uT({},t.payload.dataOrKey,t.payload.keyData)))):Object.assign(Object.assign({},e),uT({},t.payload.viewModelKey,t.payload.dataOrKey))}function fT(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Zw:return lT(e,t)}return e}var pT="LanguageDataService",dT="locale",mT="phrases",hT="language:data:service",yT="locale",vT="phrases";function bT(e){return(bT="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 gT(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ST(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 ET(e,t){return(ET=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function OT(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 Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=AT(e);if(t){var i=AT(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return CT(this,n)}}function CT(e,t){return!t||"object"!==bT(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 AT(e){return(AT=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var jT=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&&ET(e,t)}(o,e);var t,n,r,i=OT(o);function o(){return gT(this,o),i.apply(this,arguments)}return t=o,(n=[{key:"getLanguageConfig",value:function(e){var t={locale:"",phrases:null};this.get({resource:"/api/locale",eventPrefix:dT,expiryTime:dg.STANDARD,bootstrapName:yT,callback:function(n){t.locale=n,t.phrases&&h.isFunction(e)&&e(t)}}),this.get({resource:"/api/phrases",eventPrefix:mT,expiryTime:dg.STANDARD,bootstrapName:vT,callback:function(n){t.phrases=n,t.locale&&h.isFunction(e)&&e(t)}})}},{key:"name",get:function(){return pT}},{key:"channelName",get:function(){return hT}}])&&ST(t.prototype,n),r&&ST(t,r),o}(mr);n.d(t,"Layouts",(function(){return u})),n.d(t,"AppChannels",(function(){return l})),n.d(t,"DataChannels",(function(){return f})),n.d(t,"Actions",(function(){return a})),n.d(t,"DataPrefixes",(function(){return c})),n.d(t,"FileExtensions",(function(){return s})),n.d(t,"DataServices",(function(){return p})),n.d(t,"CuratorLayoutView",(function(){return Hn})),n.d(t,"LayoutComponent",(function(){return Yn})),n.d(t,"CuratorAppNavService",(function(){return ir})),n.d(t,"ImageUploadDataService",(function(){return Ar})),n.d(t,"CompaniesApplication",(function(){return Hh})),n.d(t,"CustomersApplication",(function(){return qy})),n.d(t,"DomainOptionsApplication",(function(){return zv})),n.d(t,"PeopleApplication",(function(){return gb})),n.d(t,"PlaylistsApplication",(function(){return qA})),n.d(t,"SeriesApplication",(function(){return Sj})),n.d(t,"SubjectDataService",(function(){return kS})),n.d(t,"SubjectDataServiceHelper",(function(){return _S})),n.d(t,"SubjectsApplication",(function(){return Rj})),n.d(t,"ThemesApplication",(function(){return fw})),n.d(t,"VideosApplication",(function(){return Ww})),n.d(t,"DomainOptionsApplication",(function(){return zv})),n.d(t,"ReleaseNotesApplication",(function(){return zI})),n.d(t,"Core",(function(){return r})),n.d(t,"InstanceManager",(function(){return ay})),n.d(t,"FifoMemoryCache",(function(){return QI})),n.d(t,"AjaxDataProvider",(function(){return sT})),n.d(t,"AlertList",(function(){return tv})),n.d(t,"AlertType",(function(){return iy})),n.d(t,"BaseAlertService",(function(){return hy})),n.d(t,"LanguageService",(function(){return Cu})),n.d(t,"Flight",(function(){return i})),n.d(t,"CacheDurations",(function(){return dg})),n.d(t,"ViewModelReducer",(function(){return fT})),n.d(t,"LanguageDataService",(function(){return jT}))}])}));