!functione(t,n,r){functions(o,u){if(!n[o]){if(!t[o]){vara="function"==typeofrequire&&require;if(!u&&a)returna(o,!0);if(i)returni(o,!0);varf=newError("Cannot find module '"+o+"'");throwf.code="MODULE_NOT_FOUND",f}varl=n[o]={exports:{}};t[o][0].call(l.exports,function(e){varn=t[o][1][e];returns(n?n:e)},l,l.exports,e,t,n,r)}returnn[o].exports}for(vari="function"==typeofrequire&&require,o=0;o<r.length;o++)s(r[o]);returns}({1:[function(require,module,exports){"use strict";function_interopRequireDefault(obj){returnobj&&obj.__esModule?obj:{"default":obj}}function_classCallCheck(instance,Constructor){if(!(instanceinstanceofConstructor))thrownewTypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var_jQuery=require("jQuery"),_jQuery2=_interopRequireDefault(_jQuery),_react=require("react"),_react2=_interopRequireDefault(_react),_reactDom=require("react-dom"),_reactDom2=_interopRequireDefault(_reactDom),_reactRedux=require("react-redux"),_reactRouter=require("react-router"),_createBrowserHistory=require("history/lib/createBrowserHistory"),_createBrowserHistory2=_interopRequireDefault(_createBrowserHistory),_Config=require("lib/Config"),_Config2=_interopRequireDefault(_Config),_Router=require("lib/Router"),_Router2=_interopRequireDefault(_Router),_ReactRouteRegister=require("lib/ReactRouteRegister"),_ReactRouteRegister2=_interopRequireDefault(_ReactRouteRegister),_App=require("containers/App/App"),_App2=_interopRequireDefault(_App),_reactRouterRedux=require("react-router-redux"),BootRoutes=function(){functionBootRoutes(store){_classCallCheck(this,BootRoutes),this.store=store;varbase=_Config2["default"].get("absoluteBaseUrl");_Router2["default"].setAbsoluteBase(base)}returnBootRoutes.prototype.start=function(location){this.matchesLegacyRoute(location)?this.initLegacyRouter():this.initReactRouter()},BootRoutes.prototype.matchesLegacyRoute=function(location){varsections=_Config2["default"].get("sections"),currentPath=_Router2["default"].resolveURLToBase(location).replace(/\/$/,"");return!!Object.keys(sections).find(function(key){varsection=sections[key],route=_Router2["default"].resolveURLToBase(section.url).replace(/\/$/,"");returnsection.reactRouter?!1:currentPath.match(route)})},BootRoutes.prototype.initReactRouter=function(){_ReactRouteRegister2["default"].updateRootRoute({component:_App2["default"]});varhistory=(0,_reactRouterRedux.syncHistoryWithStore)((0,_reactRouter.useRouterHistory)(_createBrowserHistory2["default"])({basename:_Config2["default"].get("baseUrl")}),this.store);_reactDom2["default"].render(_react2["default"].createElement(_reactRedux.Provider,{store:this.store},_react2["default"].createElement(_reactRouter.Router,{history:history,routes:_ReactRouteRegister2["default"].getRootRoute()})),document.getElementsByClassName("cms-content")[0])},BootRoutes.prototype.initLegacyRouter=function(){varsections=_Config2["default"].get("sections"),store=this.store;(0,_Router2["default"])("*",function(ctx,next){ctx.store=store,next()});varlastPath=null;Object.keys(sections).forEach(function(key){varroute=_Router2["default"].resolveURLToBase(sections[key].url);route=route.replace(/\/$/,""),route+="(/*?)?",(0,_Router2["default"])(route,function(ctx,next){if("complete"!==document.readyState||ctx.init)returnvoidnext();lastPath||(lastPath=window.location.pathname);varforceReload=ctx.data&&ctx.data.__forceReload;(ctx.path!==lastPath||forceReload)&&(lastPath=ctx.path.replace(/#.*$/,""),(0,_jQuery2["default"])(".cms-container").entwine("ss").handleStateChange(null,ctx.state))})}),_Router2["default"].start()},BootRoutes}();exports["default"]=BootRoutes},{"containers/App/App":15,"history/lib/createBrowserHistory":51,jQuery:"jQuery","lib/Config":21,"lib/ReactRouteRegister":"lib/ReactRouteRegister","lib/Router":23,react:"react","react-dom":"react-dom","react-redux":"react-redux","react-router":"react-router","react-router-redux":"react-router-redux"}],2:[function(require,module,exports){"use strict";function_interopRequireWildcard(obj){if(obj&&obj.__esMod
},PopoverField}(_SilverStripeComponent2["default"]);PopoverField.propTypes={id:_react2["default"].PropTypes.string,title:_react2["default"].PropTypes.oneOfType([_react2["default"].PropTypes.string,_react2["default"].PropTypes.bool]),data:_react2["default"].PropTypes.oneOfType([_react2["default"].PropTypes.array,_react2["default"].PropTypes.shape({popoverTitle:_react2["default"].PropTypes.string,placement:_react2["default"].PropTypes.oneOf(["top","right","bottom","left"])})])},exports["default"]=PopoverField},{"lib/SilverStripeComponent":"lib/SilverStripeComponent",react:"react","react-bootstrap-4":"react-bootstrap-4"}],12:[function(require,module,exports){"use strict";function_interopRequireDefault(obj){returnobj&&obj.__esModule?obj:{"default":obj}}function_defaults(obj,defaults){for(varkeys=Object.getOwnPropertyNames(defaults),i=0;i<keys.length;i++){varkey=keys[i],value=Object.getOwnPropertyDescriptor(defaults,key);value&&value.configurable&&void0===obj[key]&&Object.defineProperty(obj,key,value)}returnobj}function_classCallCheck(instance,Constructor){if(!(instanceinstanceofConstructor))thrownewTypeError("Cannot call a class as a function")}function_possibleConstructorReturn(self,call){if(!self)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");return!call||"object"!=typeofcall&&"function"!=typeofcall?self:call}function_inherits(subClass,superClass){if("function"!=typeofsuperClass&&null!==superClass)thrownewTypeError("Super expression must either be null or a function, not "+typeofsuperClass);subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),superClass&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):_defaults(subClass,superClass))}Object.defineProperty(exports,"__esModule",{value:!0});var_react=require("react"),_react2=_interopRequireDefault(_react),_i18n=require("i18n"),_i18n2=_interopRequireDefault(_i18n),_SilverStripeComponent=require("lib/SilverStripeComponent"),_SilverStripeComponent2=_interopRequireDefault(_SilverStripeComponent),Preview=function(_SilverStripeComponen){functionPreview(){return_classCallCheck(this,Preview),_possibleConstructorReturn(this,_SilverStripeComponen.apply(this,arguments))}return_inherits(Preview,_SilverStripeComponen),Preview.prototype.render=function(){varbody=null,previewUrl=null,previewType="";this.props.itemLinks&&this.props.itemLinks.preview&&(this.props.itemLinks.preview.Stage?(previewUrl=this.props.itemLinks.preview.Stage.href,previewType=this.props.itemLinks.preview.Stage.type):this.props.itemLinks.preview.Live&&(previewUrl=this.props.itemLinks.preview.Live.href,previewType=this.props.itemLinks.preview.Live.type));vareditUrl=null,editKey="edit",toolbarButtons=[];returnthis.props.itemLinks&&this.props.itemLinks.edit&&(editUrl=this.props.itemLinks.edit.href,toolbarButtons.push(_react2["default"].createElement("a",{key:editKey,href:editUrl,className:"btn btn-secondary-outline font-icon-edit"},_react2["default"].createElement("span",{className:"btn__title"},_i18n2["default"]._t("Preview.EDIT","Edit"))))),body=this.props.itemId?previewUrl?previewType&&0===previewType.indexOf("image/")?_react2["default"].createElement("div",{className:"preview__file-container panel-scrollable"},_react2["default"].createElement("img",{alt:previewUrl,className:"preview__file--fits-space",src:previewUrl})):_react2["default"].createElement("iframe",{className:"preview__iframe",src:previewUrl}):_react2["default"].createElement("div",{className:"preview__overlay"},_react2["default"].createElement("h3",{className:"preview__overlay-text"},"There is no preview available for this item.")):_react2["default"].createElement("div",{className:"preview__overlay"},_react2["default"].createElement("h3",{className:"preview__overlay-text"},"No preview available.")),_react2["default"].createElement("div",{className:"cms-content__right preview"},body,_react2["default"].createElement("a",{href:"",className:"cms-content__back-btn font-icon-left-open-big"}),_r
functionCampaignAdminList(props){_classCallCheck(this,CampaignAdminList);var_this=_possibleConstructorReturn(this,_SilverStripeComponen.call(this,props));return_this.handlePublish=_this.handlePublish.bind(_this),_this.handleItemSelected=_this.handleItemSelected.bind(_this),_this.setBreadcrumbs=_this.setBreadcrumbs.bind(_this),_this}return_inherits(CampaignAdminList,_SilverStripeComponen),CampaignAdminList.prototype.componentDidMount=function(){varfetchURL=this.props.itemListViewEndpoint.url.replace(/:id/,this.props.campaignId);_SilverStripeComponen.prototype.componentDidMount.call(this),this.setBreadcrumbs(),Object.keys(this.props.record).length||this.props.recordActions.fetchRecord(this.props.treeClass,"get",fetchURL).then(this.setBreadcrumbs)},CampaignAdminList.prototype.setBreadcrumbs=function(){if(this.props.record){varbreadcrumbs=[{text:_i18n2["default"]._t("Campaigns.CAMPAIGN","Campaigns"),href:this.props.sectionConfig.url}];breadcrumbs.push({text:this.props.record.Name,href:this.props.sectionConfig.url+"/set/"+this.props.campaignId+"/show"}),this.props.breadcrumbsActions.setBreadcrumbs(breadcrumbs)}},CampaignAdminList.prototype.render=function(){var_this2=this,itemId=this.props.campaign.changeSetItemId,itemLinks=null,campaignId=this.props.campaignId,campaign=this.props.record,itemGroups=this.groupItemsForSet(),accordionBlocks=[];Object.keys(itemGroups).forEach(function(className){vargroup=itemGroups[className],groupCount=group.items.length,listGroupItems=[],title=groupCount+" "+(1===groupCount?group.singular:group.plural),groupid="Set_"+campaignId+"_Group_"+className;group.items.forEach(function(item){itemId||(itemId=item.ID);varselected=itemId===item.ID;selected&&item._links&&(itemLinks=item._links);varitemClassNames=[];"none"!==item.ChangeType&&"published"!==campaign.State||itemClassNames.push("list-group-item--inactive"),selected&&itemClassNames.push("active"),listGroupItems.push(_react2["default"].createElement(_ListGroupItem2["default"],{key:item.ID,className:itemClassNames.join(" "),handleClick:_this2.handleItemSelected,handleClickArg:item.ID},_react2["default"].createElement(_CampaignAdminItem2["default"],{item:item,campaign:_this2.props.record})))}),accordionBlocks.push(_react2["default"].createElement(_AccordionBlock2["default"],{key:groupid,groupid:groupid,title:title},listGroupItems))});varpagesLink=[this.props.config.baseUrl,this.props.config.sections["SilverStripe\\CMS\\Controllers\\CMSPagesController"].url].join("/"),body=accordionBlocks.length?_react2["default"].createElement(_Accordion2["default"],null,accordionBlocks):_react2["default"].createElement("div",{className:"alert alert-warning",role:"alert"},_react2["default"].createElement("strong",null,"This campaign is empty.")," You can add pages by selecting"," ",_react2["default"].createElement("em",null,"Add to campaign")," from within the ",_react2["default"].createElement("em",null,"More Options")," popup on"," ","the ",_react2["default"].createElement("a",{href:pagesLink},"edit page screen"),"."),bodyClass=["container-fluid","campaign-items","panel-scrollable","panel-scrollable--double-toolbar"];return_react2["default"].createElement("div",{className:"cms-content__split cms-content__split--left-sm"},_react2["default"].createElement("div",{className:"cms-content__left cms-campaigns collapse in","aria-expanded":"true"},_react2["default"].createElement(_Toolbar2["default"],{showBackButton:!0,handleBackButtonClick:this.props.handleBackButtonClick},_react2["default"].createElement(_Breadcrumb2["default"],{multiline:!0,crumbs:this.props.breadcrumbs})),_react2["default"].createElement("div",{className:bodyClass.join(" ")},body),_react2["default"].createElement("div",{className:"toolbar--south"},this.renderButtonToolbar())),_react2["default"].createElement(_Preview2["default"],{itemLinks:itemLinks,itemId:itemId}))},CampaignAdminList.prototype.handleItemSelected=function(event,itemId){this.props.campaignActions.selectChangeSetItem(itemId)},CampaignAdminList.prototype.renderButtonToolbar=function(){varitems=this.getItems();if(!items||!item
case_RecordsActionTypes2["default"].DELETE_RECORD_REQUEST:returnstate;case_RecordsActionTypes2["default"].DELETE_RECORD_FAILURE:returnstate;case_RecordsActionTypes2["default"].DELETE_RECORD_SUCCESS:returnrecordType=action.payload.recordType,records=state[recordType],records=Object.keys(records).reduce(function(result,key){returnparseInt(key,10)!==parseInt(action.payload.id,10)?_extends({},result,_defineProperty({},key,records[key])):result},{}),(0,_deepFreezeStrict2["default"])(_extends({},state,_defineProperty({},recordType,records)));default:returnstate}}Object.defineProperty(exports,"__esModule",{value:!0});var_extends=Object.assign||function(target){for(vari=1;i<arguments.length;i++){varsource=arguments[i];for(varkeyinsource)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}returntarget},_deepFreezeStrict=require("deep-freeze-strict"),_deepFreezeStrict2=_interopRequireDefault(_deepFreezeStrict),_RecordsActionTypes=require("./RecordsActionTypes"),_RecordsActionTypes2=_interopRequireDefault(_RecordsActionTypes),initialState={};exports["default"]=recordsReducer},{"./RecordsActionTypes":34,"deep-freeze-strict":"deep-freeze-strict"}],37:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});varACTION_TYPES={SET_SCHEMA:"SET_SCHEMA"};exports["default"]=ACTION_TYPES},{}],38:[function(require,module,exports){"use strict";function_interopRequireDefault(obj){returnobj&&obj.__esModule?obj:{"default":obj}}function_defineProperty(obj,key,value){returnkeyinobj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}functionschemaReducer(){varstate=arguments.length<=0||void0===arguments[0]?initialState:arguments[0],action=arguments.length<=1||void0===arguments[1]?null:arguments[1];switch(action.type){case_SchemaActionTypes2["default"].SET_SCHEMA:varid=action.payload.schema.schema_url;return(0,_deepFreezeStrict2["default"])(_extends({},state,_defineProperty({},id,action.payload)));default:returnstate}}Object.defineProperty(exports,"__esModule",{value:!0});var_extends=Object.assign||function(target){for(vari=1;i<arguments.length;i++){varsource=arguments[i];for(varkeyinsource)Object.prototype.hasOwnProperty.call(source,key)&&(target[key]=source[key])}returntarget};exports["default"]=schemaReducer;var_deepFreezeStrict=require("deep-freeze-strict"),_deepFreezeStrict2=_interopRequireDefault(_deepFreezeStrict),_SchemaActionTypes=require("./SchemaActionTypes"),_SchemaActionTypes2=_interopRequireDefault(_SchemaActionTypes),initialState=(0,_deepFreezeStrict2["default"])({})},{"./SchemaActionTypes":37,"deep-freeze-strict":"deep-freeze-strict"}],39:[function(require,module,exports){functioncleanUpNextTick(){draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue()}functiondrainQueue(){if(!draining){vartimeout=setTimeout(cleanUpNextTick);draining=!0;for(varlen=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex<len;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,len=queue.length}currentQueue=null,draining=!1,clearTimeout(timeout)}}functionItem(fun,array){this.fun=fun,this.array=array}functionnoop(){}varcurrentQueue,process=module.exports={},queue=[],draining=!1,queueIndex=-1;process.nextTick=function(fun){varargs=newArray(arguments.length-1);if(arguments.length>1)for(vari=1;i<arguments.length;i++)args[i-1]=arguments[i];queue.push(newItem(fun,args)),1!==queue.length||draining||setTimeout(drainQueue,0)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.binding=function(name){thrownewError("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(dir){thrownewError("process.chdirisnot
exports.getHashPath=getHashPath,exports.replaceHashPath=replaceHashPath,exports.getWindowPath=getWindowPath,exports.go=go,exports.getUserConfirmation=getUserConfirmation,exports.supportsHistory=supportsHistory,exports.supportsGoWithoutReloadUsingHash=supportsGoWithoutReloadUsingHash},{}],49:[function(require,module,exports){"use strict";exports.__esModule=!0;varcanUseDOM=!("undefined"==typeofwindow||!window.document||!window.document.createElement);exports.canUseDOM=canUseDOM},{}],50:[function(require,module,exports){(function(process){"use strict";function_interopRequireDefault(obj){returnobj&&obj.__esModule?obj:{"default":obj}}functionextractPath(string){varmatch=string.match(/^https?:\/\/[^\/]*/);returnnull==match?string:string.substring(match[0].length)}functionparsePath(path){varpathname=extractPath(path),search="",hash="";"production"!==process.env.NODE_ENV?_warning2["default"](path===pathname,'A path must be pathname + search + hash only, not a fully qualified URL like "%s"',path):void0;varhashIndex=pathname.indexOf("#");-1!==hashIndex&&(hash=pathname.substring(hashIndex),pathname=pathname.substring(0,hashIndex));varsearchIndex=pathname.indexOf("?");return-1!==searchIndex&&(search=pathname.substring(searchIndex),pathname=pathname.substring(0,searchIndex)),""===pathname&&(pathname="/"),{pathname:pathname,search:search,hash:hash}}exports.__esModule=!0,exports.extractPath=extractPath,exports.parsePath=parsePath;var_warning=require("warning"),_warning2=_interopRequireDefault(_warning)}).call(this,require("_process"))},{_process:39,warning:61}],51:[function(require,module,exports){(function(process){"use strict";function_interopRequireDefault(obj){returnobj&&obj.__esModule?obj:{"default":obj}}functioncreateBrowserHistory(){functiongetCurrentLocation(historyState){try{historyState=historyState||window.history.state||{}}catch(e){historyState={}}varpath=_DOMUtils.getWindowPath(),_historyState=historyState,key=_historyState.key,state=void0;key?state=_DOMStateStorage.readState(key):(state=null,key=history.createKey(),isSupported&&window.history.replaceState(_extends({},historyState,{key:key}),null));varlocation=_PathUtils.parsePath(path);returnhistory.createLocation(_extends({},location,{state:state}),void0,key)}functionstartPopStateListener(_ref){functionpopStateListener(event){void0!==event.state&&transitionTo(getCurrentLocation(event.state))}vartransitionTo=_ref.transitionTo;return_DOMUtils.addEventListener(window,"popstate",popStateListener),function(){_DOMUtils.removeEventListener(window,"popstate",popStateListener)}}functionfinishTransition(location){varbasename=location.basename,pathname=location.pathname,search=location.search,hash=location.hash,state=location.state,action=location.action,key=location.key;if(action!==_Actions.POP){_DOMStateStorage.saveState(key,state);varpath=(basename||"")+pathname+search+hash,historyState={key:key};if(action===_Actions.PUSH){if(useRefresh)returnwindow.location.href=path,!1;window.history.pushState(historyState,null,path)}else{if(useRefresh)returnwindow.location.replace(path),!1;window.history.replaceState(historyState,null,path)}}}functionlistenBefore(listener){1===++listenerCount&&(stopPopStateListener=startPopStateListener(history));varunlisten=history.listenBefore(listener);returnfunction(){unlisten(),0===--listenerCount&&stopPopStateListener()}}functionlisten(listener){1===++listenerCount&&(stopPopStateListener=startPopStateListener(history));varunlisten=history.listen(listener);returnfunction(){unlisten(),0===--listenerCount&&stopPopStateListener()}}functionregisterTransitionHook(hook){1===++listenerCount&&(stopPopStateListener=startPopStateListener(history)),history.registerTransitionHook(hook)}functionunregisterTransitionHook(hook){history.unregisterTransitionHook(hook),0===--listenerCount&&stopPopStateListener()}varoptions=arguments.length<=0||void0===arguments[0]?{}:arguments[0];_ExecutionEnvironment.canUseDOM?void0:"production"!==process.env.NODE_ENV?_invariant2["default"](!1,"Browser history needs a DOM"):_invariant2["default"