FIX stringify api call body to work for IE10 (#6032)

* FIX stringify api call body to work for IE10

* Pull out functions defined in createEndpointFetcher
This commit is contained in:
Chris Joe 2016-09-21 14:45:30 +12:00 committed by Damian Mooyman
parent 183b3915d3
commit 51ef369630
8 changed files with 368 additions and 200 deletions

View File

@ -1,6 +1,6 @@
!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}function a(){h["default"].add("config",g["default"]),h["default"].add("form",w["default"]),h["default"].add("schemas",T["default"]),h["default"].add("records",P["default"]),h["default"].add("campaign",j["default"]),h["default"].add("breadcrumbs",k["default"]),h["default"].add("routing",te.routerReducer),m["default"].register("TextField",I["default"]),m["default"].register("HiddenField",N["default"]),m["default"].register("GridField",U["default"]),m["default"].register("SingleSelectField",M["default"]),m["default"].register("PopoverField",G["default"]),m["default"].register("HeaderField",Q["default"]),m["default"].register("LiteralField",K["default"]),m["default"].register("HtmlReadonlyField",W["default"]),m["default"].register("CompositeField",$["default"]),m["default"].register("Tabs",z["default"]),m["default"].register("TabItem",ee["default"]),m["default"].register("FormAction",B["default"]);var e={},t=(0,s.combineReducers)(h["default"].getAll()),n=[c["default"]],r=p["default"].get("environment"),o=p["default"].get("debugging"),a=s.applyMiddleware.apply(void 0,n),i=window.devToolsExtension;"dev"===r&&o&&"function"==typeof i&&(a=(0,s.compose)(s.applyMiddleware.apply(void 0,n),i()));var l=a(s.createStore),f=l(t,e);f.dispatch(v.setConfig(p["default"].getAll())),window.ss=window.ss||{},window.ss.store=f;var d=new u["default"](f);d.start(window.location.pathname)}var i=n(2),u=o(i),s=n(30),l=n(31),c=o(l),f=n(24),p=o(f),d=n(32),h=o(d),y=n(33),m=o(y),b=n(34),v=r(b),_=n(36),g=o(_),E=n(38),w=o(E),O=n(40),T=o(O),C=n(42),P=o(C),S=n(44),j=o(S),R=n(46),k=o(R),A=n(48),I=o(A),x=n(50),M=o(x),D=n(52),N=o(D),L=n(53),U=o(L),F=n(54),B=o(F),H=n(55),G=o(H),q=n(57),Q=o(q),V=n(58),K=o(V),Y=n(59),W=o(Y),J=n(60),$=o(J),X=n(61),z=o(X),Z=n(62),ee=o(Z),te=n(29),ne=n(63),re=o(ne);window.onload=a},function(e,t){e.exports=jQuery},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(1),u=r(i),s=n(3),l=r(s),c=n(4),f=r(c),p=n(5),d=n(6),h=n(7),y=r(h),m=n(24),b=r(m),v=n(25),_=r(v),g=n(26),E=r(g),w=n(27),O=r(w),T=n(29),C=function(){function e(t){o(this,e),this.store=t;var n=b["default"].get("absoluteBaseUrl");_["default"].setAbsoluteBase(n)}return a(e,[{key:"start",value:function t(e){this.matchesLegacyRoute(e)?this.initLegacyRouter():this.initReactRouter()}},{key:"matchesLegacyRoute",value:function n(e){var t=b["default"].get("sections"),n=_["default"].resolveURLToBase(e).replace(/\/$/,"");return!!Object.keys(t).find(function(e){var r=t[e],o=_["default"].resolveURLToBase(r.url).replace(/\/$/,"");return!r.reactRouter&&n.match(o)})}},{key:"initReactRouter",value:function r(){E["default"].updateRootRoute({component:O["default"]});var e=(0,T.syncHistoryWithStore)((0,d.useRouterHistory)(y["default"])({basename:b["default"].get("baseUrl")}),this.store);f["default"].render(l["default"].createElement(p.Provider,{store:this.store},l["default"].createElement(d.Router,{history:e,routes:E["default"].getRootRoute()})),document.getElementsByClassName("cms-content")[0])}},{key:"initLegacyRouter",value:function i(){var e=b["default"].get("sections"),t=this.store;(0,_["default"])("*",function(e,n){e.store=t,n()});var n=null;Object.keys(e).forEach(function(t){var r=_["default"].resolveURLToBase(e[t].url);r=r.replace(/\/$/,""),r+="(/*?)?",(0,_["default"])(r,function(e,t){if("complete"!==document.readyState||e.init)return void t();n||(n=window.location.pathname);var r=e.data&&e.data.__forceReload;(e.path!==n||r)&&(n=e.path.replace(/#.*$/,""),(0,u["default"])(".cms-container").entwine("ss").handleStateChange(null,e.state))})}),_["default"].start()}}]),e}();t["default"]=C},function(e,t){e.exports=React},function(e,t){e.exports=ReactDom},function(e,t){e.exports=ReactRedux},function(e,t){e.exports=ReactRouter},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){function e(e){try{e=e||window.history.state||{}}catch(t){e={}}var n=f.getWindowPath(),r=e,o=r.key,i=void 0;o?i=p.readState(o):(i=null,o=_.createKey(),b&&window.history.replaceState(a({},e,{key:o}),null));var u=l.parsePath(n);return _.createLocation(a({},u,{state:i}),void 0,o)}function t(t){function n(t){void 0!==t.state&&r(e(t.state))}var r=t.transitionTo;return f.addEventListener(window,"popstate",n),function(){f.removeEventListener(window,"popstate",n)}}function n(e){var t=e.basename,n=e.pathname,r=e.search,o=e.hash,a=e.state,i=e.action,u=e.key;if(i!==s.POP){p.saveState(u,a);var l=(t||"")+n+r+o,c={key:u};if(i===s.PUSH){if(v)return window.location.href=l,!1;window.history.pushState(c,null,l)}else{if(v)return window.location.replace(l),!1;window.history.replaceState(c,null,l)}}}function r(e){1===++g&&(E=t(_));var n=_.listenBefore(e);return function(){n(),0===--g&&E()}}function o(e){1===++g&&(E=t(_));var n=_.listen(e);return function(){n(),0===--g&&E()}}function i(e){1===++g&&(E=t(_)),_.registerTransitionHook(e)}function d(e){_.unregisterTransitionHook(e),0===--g&&E()}var y=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];c.canUseDOM?void 0:u["default"](!1);var m=y.forceRefresh,b=f.supportsHistory(),v=!b||m,_=h["default"](a({},y,{getCurrentLocation:e,finishTransition:n,saveState:p.saveState})),g=0,E=void 0;return a({},_,{listenBefore:r,listen:o,registerTransitionHook:i,unregisterTransitionHook:d})}t.__esModule=!0;var a=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=n(8),u=r(i),s=n(9),l=n(10),c=n(12),f=n(13),p=n(14),d=n(15),h=r(d);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";var r=function(e,t,n,r,o,a,i,u){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,a,i,u],c=0;s=new Error(t.replace(/%s/g,function(){return l[c++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}};e.exports=r},function(e,t){"use strict";t.__esModule=!0;var n="PUSH";t.PUSH=n;var r="REPLACE";t.REPLACE=r;var o="POP";t.POP=o,t["default"]={PUSH:n,REPLACE:r,POP:o}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=e.match(/^https?:\/\/[^\/]*/);return null==t?e:e.substring(t[0].length)}function a(e){var t=o(e),n="",r="",a=t.indexOf("#");a!==-1&&(r=t.substring(a),t=t.substring(0,a));var i=t.indexOf("?");return i!==-1&&(n=t.substring(i),t=t.substring(0,i)),""===t&&(t="/"),{pathname:t,search:n,hash:r}}t.__esModule=!0,t.extractPath=o,t.parsePath=a;var i=n(11),u=r(i)},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t){"use strict";t.__esModule=!0;var n=!("undefined"==typeof window||!window.document||!window.document.createElement);t.canUseDOM=n},function(e,t){"use strict";function n(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function r(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function o(){return window.location.href.split("#")[1]||""}function a(e){window.location.replace(window.location.pathname+window.location.search+"#"+e)}function i(){return window.location.pathname+window.location.search+window.location.hash}function u(e){e&&window.history.go(e)}function s(e,t){t(window.confirm(e))}function l(){var e=navigator.userAgent;return(e.indexOf("Android 2.")===-1&&e.indexOf("Android 4.0")===-1||e.indexOf("Mobile Safari")===-1||e.indexOf("Chrome")!==-1||e.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)}function c(){var e=navigator.userAgent;return e.indexOf("Firefox")===-1}t.__esModule=!0,t.addEventListener=n,t.removeEventListener=r,t.getHashPath=o,t.replaceHashPath=a,t.getWindowPath=i,t.go=u,t.getUserConfirmation=s,t.supportsHistory=l,t.supportsGoWithoutReloadUsingHash=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return l+e}function a(e,t){try{null==t?window.sessionStorage.removeItem(o(e)):window.sessionStorage.setItem(o(e),JSON.stringify(t))}catch(n){if(n.name===f)return;if(c.indexOf(n.name)>=0&&0===window.sessionStorage.length)return;throw n}}function i(e){var t=void 0;try{t=window.sessionStorage.getItem(o(e))}catch(n){if(n.name===f)return null}if(t)try{return JSON.parse(t)}catch(n){}return null}t.__esModule=!0,t.saveState=a,t.readState=i;var u=n(11),s=r(u),l="@@History/",c=["QuotaExceededError","QUOTA_EXCEEDED_ERR"],f="SecurityError"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){function t(e){return s.canUseDOM?void 0:u["default"](!1),n.listen(e)}var n=f["default"](a({getUserConfirmation:l.getUserConfirmation},e,{go:l.go}));return a({},n,{listen:t})}t.__esModule=!0;var a=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=n(8),u=r(i),s=n(12),l=n(13),c=n(16),f=r(c);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return Math.random().toString(36).substr(2,e)}function a(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.key===t.key&&f["default"](e.state,t.state)}function i(){function e(e){return U.push(e),function(){U=U.filter(function(t){return t!==e})}}function t(){return G&&G.action===h.POP?F.indexOf(G.key):H?F.indexOf(H.key):-1}function n(e){var n=t();H=e,H.action===h.PUSH?F=[].concat(F.slice(0,n+1),[H.key]):H.action===h.REPLACE&&(F[n]=H.key),B.forEach(function(e){e(H)})}function r(e){if(B.push(e),H)e(H);else{var t=I();F=[t.key],n(t)}return function(){B=B.filter(function(t){return t!==e})}}function i(e,t){d.loopAsync(U.length,function(t,n,r){v["default"](U[t],e,function(e){null!=e?r(e):n()})},function(e){N&&"string"==typeof e?N(e,function(e){t(e!==!1)}):t(e!==!1)})}function s(e){H&&a(H,e)||(G=e,i(e,function(t){if(G===e)if(t){if(e.action===h.PUSH){var r=w(H),o=w(e);o===r&&f["default"](H.state,e.state)&&(e.action=h.REPLACE)}x(e)!==!1&&n(e)}else if(H&&e.action===h.POP){var a=F.indexOf(H.key),i=F.indexOf(e.key);a!==-1&&i!==-1&&D(a-i)}}))}function l(e){s(T(e,h.PUSH,_()))}function c(e){s(T(e,h.REPLACE,_()))}function y(){D(-1)}function b(){D(1)}function _(){return o(L)}function w(e){if(null==e||"string"==typeof e)return e;var t=e.pathname,n=e.search,r=e.hash,o=t;return n&&(o+=n),r&&(o+=r),o}function O(e){return w(e)}function T(e,t){var n=arguments.length<=2||void 0===arguments[2]?_():arguments[2];return"object"==typeof t&&("string"==typeof e&&(e=p.parsePath(e)),e=u({},e,{state:t}),t=n,n=arguments[3]||_()),m["default"](e,t,n)}function C(e){H?(P(H,e),n(H)):P(I(),e)}function P(e,t){e.state=u({},e.state,t),M(e.key,e.state)}function S(e){U.indexOf(e)===-1&&U.push(e)}function j(e){U=U.filter(function(t){return t!==e})}function R(e,t){"string"==typeof t&&(t=p.parsePath(t)),l(u({state:e},t))}function k(e,t){"string"==typeof t&&(t=p.parsePath(t)),c(u({state:e},t))}var A=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],I=A.getCurrentLocation,x=A.finishTransition,M=A.saveState,D=A.go,N=A.getUserConfirmation,L=A.keyLength;"number"!=typeof L&&(L=E);var U=[],F=[],B=[],H=void 0,G=void 0;return{listenBefore:e,listen:r,transitionTo:s,push:l,replace:c,go:D,goBack:y,goForward:b,createKey:_,createPath:w,createHref:O,createLocation:T,setState:g["default"](C,"setState is deprecated; use location.key to save state instead"),registerTransitionHook:g["default"](S,"registerTransitionHook is deprecated; use listenBefore instead"),unregisterTransitionHook:g["default"](j,"unregisterTransitionHook is deprecated; use the callback returned from listenBefore instead"),pushState:g["default"](R,"pushState is deprecated; use push instead"),replaceState:g["default"](k,"replaceState is deprecated; use replace instead")}}t.__esModule=!0;var u=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},s=n(11),l=r(s),c=n(17),f=r(c),p=n(10),d=n(20),h=n(9),y=n(21),m=r(y),b=n(22),v=r(b),_=n(23),g=r(_),E=6;t["default"]=i,e.exports=t["default"]},function(e,t,n){function r(e){return null===e||void 0===e}function o(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length)&&("function"==typeof e.copy&&"function"==typeof e.slice&&!(e.length>0&&"number"!=typeof e[0]))}function a(e,t,n){var a,c;if(r(e)||r(t))return!1;if(e.prototype!==t.prototype)return!1;if(s(e))return!!s(t)&&(e=i.call(e),t=i.call(t),l(e,t,n));if(o(e)){if(!o(t))return!1;if(e.length!==t.length)return!1;for(a=0;a<e.length;a++)if(e[a]!==t[a])return!1;return!0}try{var f=u(e),p=u(t)}catch(d){return!1}if(f.length!=p.length)return!1;for(f.sort(),p.sort(),a=f.length-1;a>=0;a--)if(f[a]!=p[a])return!1;for(a=f.length-1;a>=0;a--)if(c=f[a],!l(e[c],t[c],n))return!1;return typeof e==typeof t}var i=Array.prototype.slice,u=n(18),s=n(19),l=e.exports=function(e,t,n){return n||(n={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:a(e,t,n))}},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}t=e.exports="function"==typeof Object.keys?Object.keys:n,t.shim=n},function(e,t){function n(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var o="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();t=e.exports=o?n:r,t.supported=n,t.unsupported=r},function(e,t){"use strict";function n(e,t,n){function o(){return u=!0,s?void(c=[].concat(r.call(arguments))):void n.apply(this,arguments)}function a(){if(!u&&(l=!0,!s)){for(s=!0;!u&&i<e&&l;)l=!1,t.call(this,i++,a,o);return s=!1,u?void n.apply(this,c):void(i>=e&&l&&(u=!0,n()))}}var i=0,u=!1,s=!1,l=!1,c=void 0;a()}t.__esModule=!0;var r=Array.prototype.slice;t.loopAsync=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){var e=arguments.length<=0||void 0===arguments[0]?"/":arguments[0],t=arguments.length<=1||void 0===arguments[1]?s.POP:arguments[1],n=arguments.length<=2||void 0===arguments[2]?null:arguments[2],r=arguments.length<=3||void 0===arguments[3]?null:arguments[3];"string"==typeof e&&(e=l.parsePath(e)),"object"==typeof t&&(e=a({},e,{state:t}),t=n||s.POP,n=r);var o=e.pathname||"/",i=e.search||"",u=e.hash||"",c=e.state||null;return{pathname:o,search:i,hash:u,state:c,action:t,key:n}}t.__esModule=!0;var a=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=n(11),u=r(i),s=n(9),l=n(10);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){var r=e(t,n);e.length<2&&n(r)}t.__esModule=!0;var a=n(11),i=r(a);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return function(){return e.apply(this,arguments)}}t.__esModule=!0;var a=n(11),i=r(a);t["default"]=o,e.exports=t["default"]},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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}}(),o=function(){function e(){n(this,e)}return r(e,null,[{key:"get",value:function t(e){return window.ss.config[e]}},{key:"getAll",value:function o(){return window.ss.config}},{key:"getSection",value:function a(e){return window.ss.config.sections[e]}}]),e}();t["default"]=o},function(e,t){e.exports=Router},function(e,t){e.exports=ReactRouteRegister},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var u=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}}(),s=n(3),l=r(s),c=n(28),f=r(c),p=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function n(){return l["default"].createElement("div",{className:"app"},this.props.children)}}]),t}(f["default"]);t["default"]=p},function(e,t){e.exports=SilverStripeComponent},function(e,t){e.exports=ReactRouterRedux},function(e,t){e.exports=Redux},function(e,t){e.exports=ReduxThunk},function(e,t){e.exports=ReducerRegister},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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}}(),o=function(){function e(){n(this,e),this.components={}}return r(e,[{key:"getComponentByName",value:function t(e){return this.components[e]}},{key:"getComponentByDataType",value:function o(e){switch(e){case"Text":case"DateTime":return this.components.TextField;case"Hidden":return this.components.HiddenField;case"SingleSelect":return this.components.SingleSelectField;case"Custom":return this.components.GridField;case"Structural":return this.components.CompositeField;default:return null}}},{key:"register",value:function a(e,t){this.components[e]=t}}]),e}();window.ss=window.ss||{},window.ss.injector=window.ss.injector||new o,t["default"]=window.ss.injector},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return{type:i["default"].SET_CONFIG,payload:{config:e}}}Object.defineProperty(t,"__esModule",{value:!0}),t.setConfig=o;var a=n(35),i=r(a)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={SET_CONFIG:"SET_CONFIG"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=arguments[1];switch(t.type){case l["default"].SET_CONFIG:return(0,u["default"])(a({},e,t.payload.config));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var a=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=n(37),u=r(i),s=n(35),l=r(s);t["default"]=o},function(e,t){e.exports=DeepFreezeStrict},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(){var e=arguments.length<=0||void 0===arguments[0]?c:arguments[0],t=arguments[1],n=function r(t,n){return i({},e,o({},t,i({},e[t],n)))};switch(t.type){case l.ACTION_TYPES.SUBMIT_FORM_REQUEST:return(0,s["default"])(n(t.payload.formId,{error:!1,submitting:!0}));case l.ACTION_TYPES.REMOVE_FORM:return(0,s["default"])(Object.keys(e).reduce(function(n,r){return r===t.payload.formId?n:i({},n,o({},r,e[r]))},{}));case l.ACTION_TYPES.ADD_FORM:return(0,s["default"])(i({},e,o({},t.payload.formState.id,{fields:t.payload.formState.fields,error:!1,submitting:!1})));case l.ACTION_TYPES.UPDATE_FIELD:return(0,s["default"])(n(t.payload.formId,{fields:e[t.payload.formId].fields.map(function(e){return e.id===t.payload.updates.id?i({},e,t.payload.updates):e})}));case l.ACTION_TYPES.SUBMIT_FORM_SUCCESS:return(0,s["default"])(n(t.payload.response.id,{fields:t.payload.response.state.fields,error:!1,messages:t.payload.response.state.messages,submitting:!1}));case l.ACTION_TYPES.SUBMIT_FORM_FAILURE:return(0,s["default"])(n(t.payload.formId,{error:!0,messages:t.payload.error,submitting:!1}));case l.ACTION_TYPES.SET_SUBMIT_ACTION:return(0,s["default"])(n(t.payload.formId,{submitAction:t.payload.submitAction}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var i=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},u=n(37),s=r(u),l=n(39),c=(0,s["default"])({});t["default"]=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=t.ACTION_TYPES={ADD_FORM:"ADD_FORM",REMOVE_FORM:"REMOVE_FORM",SUBMIT_FORM_FAILURE:"SUBMIT_FORM_FAILURE",SUBMIT_FORM_REQUEST:"SUBMIT_FORM_REQUEST",SUBMIT_FORM_SUCCESS:"SUBMIT_FORM_SUCCESS",UPDATE_FIELD:"UPDATE_FIELD",SET_SUBMIT_ACTION:"SET_SUBMIT_ACTION"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(){var e=arguments.length<=0||void 0===arguments[0]?f:arguments[0],t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];switch(t.type){case c["default"].SET_SCHEMA:var n=t.payload.schema.schema_url;return(0,s["default"])(i({},e,o({},n,t.payload)));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var i=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};t["default"]=a;var u=n(37),s=r(u),l=n(41),c=r(l),f=(0,s["default"])({})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={SET_SCHEMA:"SET_SCHEMA"};t["default"]=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(){var e=arguments.length<=0||void 0===arguments[0]?f:arguments[0],t=arguments[1],n=null,r=null,a=null;switch(t.type){case c["default"].CREATE_RECORD:return(0,s["default"])(i({},e,{}));case c["default"].UPDATE_RECORD:return(0,s["default"])(i({},e,{}));case c["default"].DELETE_RECORD:return(0,s["default"])(i({},e,{}));case c["default"].FETCH_RECORDS_REQUEST:return e;case c["default"].FETCH_RECORDS_FAILURE:return e;case c["default"].FETCH_RECORDS_SUCCESS:if(r=t.payload.recordType,!r)throw new Error("Undefined record type");return n=t.payload.data._embedded[r]||{},n=n.reduce(function(e,t){return i({},e,o({},t.ID,t))},{}),(0,s["default"])(i({},e,o({},r,n)));case c["default"].FETCH_RECORD_REQUEST:return e;case c["default"].FETCH_RECORD_FAILURE:return e;case c["default"].FETCH_RECORD_SUCCESS:if(r=t.payload.recordType,a=t.payload.data,!r)throw new Error("Undefined record type");return(0,s["default"])(i({},e,o({},r,i({},e[r],o({},a.ID,a)))));case c["default"].DELETE_RECORD_REQUEST:return e;case c["default"].DELETE_RECORD_FAILURE:return e;case c["default"].DELETE_RECORD_SUCCESS:return r=t.payload.recordType,n=e[r],n=Object.keys(n).reduce(function(e,r){return parseInt(r,10)!==parseInt(t.payload.id,10)?i({},e,o({},r,n[r])):e},{}),(0,s["default"])(i({},e,o({},r,n)));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var i=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},u=n(37),s=r(u),l=n(43),c=r(l),f={};t["default"]=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={CREATE_RECORD:"CREATE_RECORD",UPDATE_RECORD:"UPDATE_RECORD",DELETE_RECORD:"DELETE_RECORD",FETCH_RECORDS_REQUEST:"FETCH_RECORDS_REQUEST",FETCH_RECORDS_FAILURE:"FETCH_RECORDS_FAILURE",FETCH_RECORDS_SUCCESS:"FETCH_RECORDS_SUCCESS",FETCH_RECORD_REQUEST:"FETCH_RECORD_REQUEST",FETCH_RECORD_FAILURE:"FETCH_RECORD_FAILURE",FETCH_RECORD_SUCCESS:"FETCH_RECORD_SUCCESS",DELETE_RECORD_REQUEST:"DELETE_RECORD_REQUEST",DELETE_RECORD_FAILURE:"DELETE_RECORD_FAILURE",DELETE_RECORD_SUCCESS:"DELETE_RECORD_SUCCESS"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){var e=arguments.length<=0||void 0===arguments[0]?c:arguments[0],t=arguments[1];switch(t.type){case l["default"].SET_CAMPAIGN_SELECTED_CHANGESETITEM:return(0,u["default"])(a({},e,{changeSetItemId:t.payload.changeSetItemId}));case l["default"].SET_CAMPAIGN_ACTIVE_CHANGESET:return(0,u["default"])(a({},e,{campaignId:t.payload.campaignId,view:t.payload.view,changeSetItemId:null}));case l["default"].PUBLISH_CAMPAIGN_REQUEST:return(0,u["default"])(a({},e,{isPublishing:!0}));case l["default"].PUBLISH_CAMPAIGN_SUCCESS:case l["default"].PUBLISH_CAMPAIGN_FAILURE:return(0,u["default"])(a({},e,{isPublishing:!1}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var a=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=n(37),u=r(i),s=n(45),l=r(s),c=(0,u["default"])({campaignId:null,changeSetItemId:null,isPublishing:!1,view:null});t["default"]=o},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={SET_CAMPAIGN_ACTIVE_CHANGESET:"SET_CAMPAIGN_ACTIVE_CHANGESET",SET_CAMPAIGN_SELECTED_CHANGESETITEM:"SET_CAMPAIGN_SELECTED_CHANGESETITEM",PUBLISH_CAMPAIGN_REQUEST:"PUBLISH_CAMPAIGN_REQUEST",PUBLISH_CAMPAIGN_SUCCESS:"PUBLISH_CAMPAIGN_SUCCESS",PUBLISH_CAMPAIGN_FAILURE:"PUBLISH_CAMPAIGN_FAILURE"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){var e=arguments.length<=0||void 0===arguments[0]?c:arguments[0],t=arguments[1];switch(t.type){case l["default"].SET_BREADCRUMBS:return(0,u["default"])(a([],t.payload.breadcrumbs));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var a=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=n(37),u=r(i),s=n(47),l=r(s),c=(0,u["default"])([]);t["default"]=o},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={SET_BREADCRUMBS:"SET_BREADCRUMBS"}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var u=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}}(),s=n(3),l=r(s),c=n(28),f=r(c),p=n(49),d=r(p),h=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleChange=n.handleChange.bind(n),n}return i(t,e),u(t,[{key:"render",value:function n(){var e=null;return e=this.props.readOnly?l["default"].createElement("div",null,l["default"].createElement("i",null,this.props.value)):l["default"].createElement("input",this.getInputProps())}},{key:"getInputProps",value:function r(){return{className:["form-control",this.props.extraClass].join(" "),id:this.props.id,name:this.props.name,onChange:this.handleChange,type:"text",value:this.props.value}}},{key:"handleChange",value:function s(e){"function"==typeof this.props.onChange&&this.props.onChange(e,{id:this.props.id,value:e.target.value})}}]),t}(f["default"]);h.propTypes={extraClass:l["default"].PropTypes.string,id:l["default"].PropTypes.string,name:l["default"].PropTypes.string.isRequired,onChange:l["default"].PropTypes.func,value:l["default"].PropTypes.string,readOnly:l["default"].PropTypes.bool},h.defaultProps={value:null},t["default"]=(0,d["default"])(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function i(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)}function u(e){var t=function(t){function n(){return o(this,n),a(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return i(n,t),c(n,[{key:"castStringToElement",value:function r(e,t,n){if(e&&"undefined"!=typeof e.html){var r={__html:e.html};return p["default"].createElement(t,l({},n,{dangerouslySetInnerHTML:r}))}var o=null;if(o=e&&"undefined"!=typeof e.text?e.text:e,o&&"object"===("undefined"==typeof o?"undefined":s(o)))throw new Error("Unsupported string value "+JSON.stringify(o));return p["default"].createElement(t,n,o)}},{key:"getDescription",value:function u(){return this.castStringToElement(this.props.description,"div",{className:"form__field-description"})}},{key:"getTitle",value:function f(){var e=null!==this.props.leftTitle?this.props.leftTitle:this.props.title;return e?this.castStringToElement(e,"label",{className:"form__field-label",htmlFor:this.props.id}):null}},{key:"render",value:function d(){var t=["form-group field",this.props.extraClass];return this.props.readOnly&&t.push("readonly"),p["default"].createElement("div",{className:t.join(" "),id:this.props.holder_id},this.getTitle(),p["default"].createElement("div",{className:"form__field-holder"},p["default"].createElement(e,this.props)),this.getDescription())}}]),n}(h["default"]);return t.propTypes={leftTitle:p["default"].PropTypes.oneOfType([p["default"].PropTypes.string,p["default"].PropTypes.bool]),title:p["default"].PropTypes.oneOfType([p["default"].PropTypes.string,p["default"].PropTypes.bool]),
extraClass:p["default"].PropTypes.string,holder_id:p["default"].PropTypes.string,id:p["default"].PropTypes.string,description:p["default"].PropTypes.oneOfType([p["default"].PropTypes.string,p["default"].PropTypes.object])},t}Object.defineProperty(t,"__esModule",{value:!0});var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},l=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},c=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}}(),f=n(3),p=r(f),d=n(28),h=r(d);t["default"]=u},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var u=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}}(),s=n(3),l=r(s),c=n(28),f=r(c),p=n(49),d=r(p),h=n(51),y=r(h),m=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleChange=n.handleChange.bind(n),n}return i(t,e),u(t,[{key:"render",value:function n(){var e=null;return e=this.props.readOnly?this.getReadonlyField():this.getSelectField()}},{key:"getReadonlyField",value:function r(){var e=this,t=this.props.source&&this.props.source.find(function(t){return t.value===e.props.value});return t="string"==typeof t?t:this.props.value,l["default"].createElement("div",null,l["default"].createElement("i",null,t))}},{key:"getSelectField",value:function s(){var e=this,t=this.props.source||[];return this.props.data.hasEmptyDefault&&!t.find(function(e){return!e.value})&&t.unshift({value:"",title:this.props.data.emptyString,disabled:!1}),l["default"].createElement("select",this.getInputProps(),t.map(function(t,n){var r=e.props.name+"-"+(t.value||"empty"+n);return l["default"].createElement("option",{key:r,value:t.value,disabled:t.disabled},t.title)}))}},{key:"getInputProps",value:function c(){return{className:["form-control",this.props.extraClass].join(" "),id:this.props.id,name:this.props.name,onChange:this.handleChange,value:this.props.value}}},{key:"handleChange",value:function f(e){"function"==typeof this.props.onChange&&this.props.onChange(e,{id:this.props.id,value:e.target.value})}}]),t}(f["default"]);m.propTypes={id:l["default"].PropTypes.string,name:l["default"].PropTypes.string.isRequired,onChange:l["default"].PropTypes.func,value:l["default"].PropTypes.oneOfType([l["default"].PropTypes.string,l["default"].PropTypes.number]),readOnly:l["default"].PropTypes.bool,source:l["default"].PropTypes.arrayOf(l["default"].PropTypes.shape({value:l["default"].PropTypes.oneOfType([l["default"].PropTypes.string,l["default"].PropTypes.number]),title:l["default"].PropTypes.any,disabled:l["default"].PropTypes.bool})),data:l["default"].PropTypes.oneOfType([l["default"].PropTypes.array,l["default"].PropTypes.shape({hasEmptyDefault:l["default"].PropTypes.bool,emptyString:l["default"].PropTypes.string})])},m.defaultProps={source:[],data:{emptyString:y["default"]._t("Boolean.ANY","Any")}},t["default"]=(0,d["default"])(m)},function(e,t){e.exports=i18n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var u=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}}(),s=n(3),l=r(s),c=n(28),f=r(c),p=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleChange=n.handleChange.bind(n),n}return i(t,e),u(t,[{key:"render",value:function n(){return l["default"].createElement("div",{className:"field hidden"},l["default"].createElement("input",this.getInputProps()))}},{key:"getInputProps",value:function r(){return{className:["hidden",this.props.extraClass].join(" "),id:this.props.id,name:this.props.name,onChange:this.props.onChange,type:"hidden",value:this.props.value}}},{key:"handleChange",value:function s(){"undefined"!=typeof this.props.onChange&&this.props.onChange()}}]),t}(f["default"]);p.propTypes={extraClass:l["default"].PropTypes.string,name:l["default"].PropTypes.string.isRequired,onChange:l["default"].PropTypes.func,value:l["default"].PropTypes.any},p.defaultProps={value:null},t["default"]=p},function(e,t){e.exports=GridField},function(e,t){e.exports=FormAction},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var u=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}}(),s=n(3),l=r(s),c=n(56),f=n(28),p=r(f),d=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleShow=n.handleShow.bind(n),n.handleHide=n.handleHide.bind(n),n.state={showing:!1},n}return i(t,e),u(t,[{key:"handleShow",value:function n(){this.setState({showing:!0})}},{key:"handleHide",value:function r(){this.setState({showing:!1})}},{key:"render",value:function s(){var e=this.getPlacement(),t=l["default"].createElement(c.Popover,{id:this.props.id+"_Popover",className:"fade in popover-"+e,title:this.props.data.popoverTitle},this.props.children),n=["btn","btn-secondary"];return this.state.showing&&n.push("btn--no-focus"),this.props.title||n.push("font-icon-dot-3 btn--no-text btn--icon-xl"),l["default"].createElement(c.OverlayTrigger,{rootClose:!0,trigger:"click",container:this,placement:e,overlay:t,onEnter:this.handleShow,onExited:this.handleHide},l["default"].createElement("button",{id:this.props.id,type:"button",className:n.join(" ")},this.props.title))}},{key:"getPlacement",value:function f(){var e=this.props.data.placement;return e||"bottom"}}]),t}(p["default"]);d.propTypes={id:l["default"].PropTypes.string,title:l["default"].PropTypes.oneOfType([l["default"].PropTypes.string,l["default"].PropTypes.bool]),data:l["default"].PropTypes.oneOfType([l["default"].PropTypes.array,l["default"].PropTypes.shape({popoverTitle:l["default"].PropTypes.string,placement:l["default"].PropTypes.oneOf(["top","right","bottom","left"])})])},t["default"]=d},function(e,t){e.exports=ReactBootstrap},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var u=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}}(),s=n(3),l=r(s),c=n(28),f=r(c),p=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function n(){var e="h"+this.props.data.headingLevel;return l["default"].createElement("div",{className:"field"},l["default"].createElement(e,this.getInputProps(),this.props.data.title))}},{key:"getInputProps",value:function r(){return{className:[this.props.extraClass].join(" "),id:this.props.id}}}]),t}(f["default"]);p.propTypes={extraClass:l["default"].PropTypes.string,id:l["default"].PropTypes.string,data:l["default"].PropTypes.oneOfType([l["default"].PropTypes.array,l["default"].PropTypes.shape({headingLevel:l["default"].PropTypes.number.isRequired,title:l["default"].PropTypes.string})]).isRequired},t["default"]=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var u=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}}(),s=n(3),l=r(s),c=n(28),f=r(c),p=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"getContent",value:function n(){return{__html:this.props.data.content}}},{key:"render",value:function r(){return l["default"].createElement("div",{id:this.props.id,className:this.props.extraClass,dangerouslySetInnerHTML:this.getContent()})}}]),t}(f["default"]);p.propTypes={id:l["default"].PropTypes.string,extraClass:l["default"].PropTypes.string,data:l["default"].PropTypes.oneOfType([l["default"].PropTypes.array,l["default"].PropTypes.shape({content:l["default"].PropTypes.string.isRequired})]).isRequired},t["default"]=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var u=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}}(),s=n(3),l=r(s),c=n(28),f=r(c),p=n(49),d=r(p),h=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.getContent=n.getContent.bind(n),n}return i(t,e),u(t,[{key:"getContent",value:function n(){return{__html:this.props.value}}},{key:"render",value:function r(){return l["default"].createElement("div",null,l["default"].createElement("i",{dangerouslySetInnerHTML:this.getContent()}))}}]),t}(f["default"]);h.propTypes={value:l["default"].PropTypes.string},t["default"]=(0,d["default"])(h)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var u=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}}(),s=n(3),l=r(s),c=n(28),f=r(c),p=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"getLegend",value:function n(){return"fieldset"===this.props.data.tag&&this.props.data.legend&&l["default"].createElement("legend",null,this.props.data.legend)}},{key:"render",value:function r(){var e=this.getLegend(),t=this.props.data.tag;return l["default"].createElement(t,{className:this.props.extraClass},e,this.props.children)}}]),t}(f["default"]);p.propTypes={tag:l["default"].PropTypes.string,legend:l["default"].PropTypes.string,extraClass:l["default"].PropTypes.string},p.defaultProps={tag:"div"},t["default"]=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var u=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}}(),s=n(3),l=r(s),c=n(28),f=r(c),p=n(56),d=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"getContainerProps",value:function n(){var e=this.props,t=e.activeKey,n=e.onSelect,r=e.className,o=e.extraClass,a=r+" "+o;return{activeKey:t,className:a,defaultActiveKey:this.getDefaultActiveKey(),onSelect:n}}},{key:"getDefaultActiveKey",value:function r(){var e=this,t=null;if("string"==typeof this.props.defaultActiveKey){var n=l["default"].Children.toArray(this.props.children).find(function(t){return t.props.name===e.props.defaultActiveKey});n&&(t=n.props.name)}return"string"!=typeof t&&l["default"].Children.forEach(this.props.children,function(e){"string"!=typeof t&&(t=e.props.name)}),t}},{key:"renderTab",value:function s(e){return null===e.props.title?null:l["default"].createElement(p.NavItem,{eventKey:e.props.name,disabled:e.props.disabled,className:e.props.tabClassName},e.props.title)}},{key:"renderNav",value:function c(){var e=l["default"].Children.map(this.props.children,this.renderTab);return e.length<=1?null:l["default"].createElement(p.Nav,{bsStyle:this.props.bsStyle,role:"tablist"},e)}},{key:"render",value:function f(){var e=this.getContainerProps(),t=this.renderNav();return l["default"].createElement(p.Tab.Container,e,l["default"].createElement("div",{className:"wrapper"},t,l["default"].createElement(p.Tab.Content,{animation:this.props.animation},this.props.children)))}}]),t}(f["default"]);d.propTypes={id:l["default"].PropTypes.string.isRequired,defaultActiveKey:l["default"].PropTypes.string,extraClass:l["default"].PropTypes.string},d.defaultProps={bsStyle:"tabs",className:"",extraClass:""},t["default"]=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var u=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}}(),s=n(3),l=r(s),c=n(28),f=r(c),p=n(56),d=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"getTabProps",value:function n(){var e=this.props,t=e.name,n=e.className,r=e.extraClass,o=e.disabled,a=e.bsClass,i=e.onEnter,u=e.onEntering,s=e.onEntered,l=e.onExit,c=e.onExiting,f=e.onExited,p=e.animation,d=e.id,h=e.unmountOnExit;return{eventKey:t,className:n+" "+r,disabled:o,bsClass:a,onEnter:i,onEntering:u,onEntered:s,onExit:l,onExiting:c,onExited:f,animation:p,id:d,unmountOnExit:h,"aria-labelledby":this.props["aria-labelledby"]}}},{key:"render",value:function r(){var e=this.getTabProps();return l["default"].createElement(p.Tab.Pane,e,this.props.children)}}]),t}(f["default"]);d.propTypes={name:l["default"].PropTypes.string.isRequired,extraClass:l["default"].PropTypes.string},d.defaultProps={className:"",extraClass:""},t["default"]=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var o=n(6),a=n(24),i=r(a),u=n(26),s=r(u),l=n(64),c=r(l);document.addEventListener("DOMContentLoaded",function(){var e=i["default"].getSection("SilverStripe\\Admin\\CampaignAdmin");s["default"].add({path:e.url,component:(0,o.withRouter)(c["default"]),childRoutes:[{path:":type/:id/:view",component:c["default"]},{path:"set/:id/:view",component:c["default"]}]})})},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function u(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)}function s(e){return{config:e.config,campaignId:e.campaign.campaignId,view:e.campaign.view,breadcrumbs:e.breadcrumbs,sectionConfig:e.config.sections["SilverStripe\\Admin\\CampaignAdmin"],securityId:e.config.SecurityID}}function l(e){return{breadcrumbsActions:(0,y.bindActionCreators)(g,e)}}Object.defineProperty(t,"__esModule",{value:!0});var c=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},f=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}}(),p=n(3),d=o(p),h=n(5),y=n(30),m=n(6),b=n(65),v=o(b),_=n(66),g=r(_),E=n(67),w=o(E),O=n(28),T=o(O),C=n(54),P=o(C),S=n(51),j=o(S),R=n(68),k=o(R),A=n(69),I=o(A),x=n(70),M=o(x),D=function(e){function t(e){a(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.publishApi=v["default"].createEndpointFetcher({url:n.props.sectionConfig.publishEndpoint.url,method:n.props.sectionConfig.publishEndpoint.method,defaultData:{SecurityID:n.props.securityId},payloadSchema:{id:{urlReplacement:":id",remove:!0}}}),n.handleBackButtonClick=n.handleBackButtonClick.bind(n),n}return u(t,e),f(t,[{key:"componentWillMount",value:function n(){0===this.props.breadcrumbs.length&&this.setBreadcrumbs(this.props.params.view,this.props.params.id)}},{key:"componentWillReceiveProps",value:function r(e){var t=this.props.params.id!==e.params.id||this.props.params.view!==e.params.view;t&&this.setBreadcrumbs(e.params.view,e.params.id)}},{key:"setBreadcrumbs",value:function o(e,t){var n=[{text:j["default"]._t("Campaigns.CAMPAIGN","Campaigns"),href:this.props.sectionConfig.url}];switch(e){case"show":break;case"edit":n.push({text:j["default"]._t("Campaigns.EDIT_CAMPAIGN","Editing Campaign"),href:this.getActionRoute(t,e)});break;case"create":n.push({text:j["default"]._t("Campaigns.ADD_CAMPAIGN","Add Campaign"),href:this.getActionRoute(t,e)})}this.props.breadcrumbsActions.setBreadcrumbs(n)}},{key:"handleBackButtonClick",value:function s(e){if(this.props.breadcrumbs.length>1){var t=this.props.breadcrumbs[this.props.breadcrumbs.length-2];if(t&&t.href)return e.preventDefault(),void this.props.router.push(t.href)}}},{key:"render",value:function l(){var e=null;switch(this.props.params.view){case"show":e=this.renderItemListView();break;case"edit":e=this.renderDetailEditView();break;case"create":e=this.renderCreateView();break;default:e=this.renderIndexView()}return e}},{key:"renderIndexView",value:function p(){var e=this.props.sectionConfig.form.EditForm.schemaUrl,t={title:j["default"]._t("Campaigns.ADDCAMPAIGN"),icon:"plus",handleClick:this.addCampaign.bind(this)},n={createFn:this.campaignListCreateFn.bind(this),schemaUrl:e};return d["default"].createElement("div",{className:"cms-content__inner no-preview"},d["default"].createElement("div",{className:"cms-content__left cms-campaigns collapse in","aria-expanded":"true"},d["default"].createElement(k["default"],null,d["default"].createElement(w["default"],{multiline:!0,crumbs:this.props.breadcrumbs})),d["default"].createElement("div",{className:"panel--padded panel--scrollable panel--single-toolbar"},d["default"].createElement("div",{className:"toolbar--content"},d["default"].createElement("div",{className:"btn-toolbar"},d["default"].createElement(P["default"],t))),d["default"].createElement("div",{className:"campaign-admin"},d["default"].createElement(I["default"],n)))))}},{key:"renderItemListView",value:function h(){var e={sectionConfig:this.props.sectionConfig,campaignId:this.props.params.id,itemListViewEndpoint:this.props.sectionConfig.itemListViewEndpoint,publishApi:this.publishApi,handleBackButtonClick:this.handleBackButtonClick.bind(this)};return d["default"].createElement(M["default"],e)}},{key:"renderDetailEditView",value:function y(){var e=this.props.sectionConfig.form.DetailEditForm.schemaUrl,t={createFn:this.campaignEditCreateFn.bind(this),schemaUrl:e+"/"+this.props.params.id};return d["default"].createElement("div",{className:"cms-content__inner"},d["default"].createElement(k["default"],{showBackButton:!0,handleBackButtonClick:this.handleBackButtonClick},d["default"].createElement(w["default"],{multiline:!0,crumbs:this.props.breadcrumbs})),d["default"].createElement("div",{className:"panel panel--padded panel--scrollable panel--single-toolbar"},d["default"].createElement("div",{className:"form--inline"},d["default"].createElement(I["default"],t))))}},{key:"renderCreateView",value:function m(){var e=this.props.sectionConfig.form.DetailEditForm.schemaUrl,t={createFn:this.campaignAddCreateFn.bind(this),schemaUrl:e+"/"+this.props.params.id};return d["default"].createElement("div",{className:"cms-content__inner"},d["default"].createElement(k["default"],{showBackButton:!0,handleBackButtonClick:this.handleBackButtonClick},d["default"].createElement(w["default"],{multiline:!0,crumbs:this.props.breadcrumbs})),d["default"].createElement("div",{className:"panel panel--padded panel--scrollable panel--single-toolbar"},d["default"].createElement(I["default"],t)))}},{key:"campaignEditCreateFn",value:function b(e,t){var n=this,r=this.props.sectionConfig.url;if("action_cancel"===t.name){var o=c({},t,{handleClick:function a(e){e.preventDefault(),n.props.router.push(r)}});return d["default"].createElement(e,c({key:t.id},o))}return d["default"].createElement(e,c({key:t.id},t))}},{key:"campaignAddCreateFn",value:function _(e,t){var n=this,r=this.props.sectionConfig.url;if("action_cancel"===t.name){var o=c({},t,{handleClick:function a(e){e.preventDefault(),n.props.router.push(r)}});return d["default"].createElement(e,c({key:t.name},o))}return d["default"].createElement(e,c({key:t.name},t))}},{key:"campaignListCreateFn",value:function g(e,t){var n=this,r=this.props.sectionConfig.url,o="set";if("GridField"===t.component){var a=c({},t,{data:c({},t.data,{handleDrillDown:function i(e,t){n.props.router.push(r+"/"+o+"/"+t.ID+"/show")},handleEditRecord:function u(e,t){n.props.router.push(r+"/"+o+"/"+t+"/edit")}})});return d["default"].createElement(e,c({key:a.name},a))}return d["default"].createElement(e,c({key:t.name},t))}},{key:"addCampaign",value:function E(){var e=this.getActionRoute(0,"create");this.props.router.push(e)}},{key:"getActionRoute",value:function O(e,t){return this.props.sectionConfig.url+"/set/"+e+"/"+t}}]),t}(T["default"]);D.propTypes={breadcrumbsActions:d["default"].PropTypes.object.isRequired,campaignId:d["default"].PropTypes.string,sectionConfig:d["default"].PropTypes.object.isRequired,securityId:d["default"].PropTypes.string.isRequired,view:d["default"].PropTypes.string},t["default"]=(0,m.withRouter)((0,h.connect)(s,l)(D))},function(e,t){e.exports=Backend},function(e,t){e.exports=BreadcrumbsActions},function(e,t){e.exports=Breadcrumb},function(e,t){e.exports=Toolbar},function(e,t){e.exports=FormBuilder},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function u(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)}function s(e,t){var n=null,r=t.sectionConfig.treeClass;return e.records&&e.records[r]&&t.campaignId&&(n=e.records[r][parseInt(t.campaignId,10)]),{config:e.config,record:n||{},campaign:e.campaign,treeClass:r,breadcrumbs:e.breadcrumbs}}function l(e){return{breadcrumbsActions:(0,y.bindActionCreators)(v,e),recordActions:(0,y.bindActionCreators)(g,e),campaignActions:(0,y.bindActionCreators)(w,e)}}Object.defineProperty(t,"__esModule",{value:!0});var c=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},f=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}}(),p=function Q(e,t,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:Q(o,t,n)}if("value"in r)return r.value;var a=r.get;if(void 0!==a)return a.call(n)},d=n(3),h=o(d),y=n(30),m=n(5),b=n(66),v=r(b),_=n(71),g=r(_),E=n(84),w=r(E),O=n(28),T=o(O),C=n(85),P=o(C),S=n(86),j=o(S),R=n(88),k=o(R),A=n(68),I=o(A),x=n(54),M=o(x),D=n(89),N=o(D),L=n(67),U=o(L),F=n(90),B=o(F),H=n(51),G=o(H),q=function(e){function t(e){a(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handlePublish=n.handlePublish.bind(n),n.handleItemSelected=n.handleItemSelected.bind(n),n.setBreadcrumbs=n.setBreadcrumbs.bind(n),n}return u(t,e),f(t,[{key:"componentDidMount",value:function n(){var e=this.props.itemListViewEndpoint.url.replace(/:id/,this.props.campaignId);p(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentDidMount",this).call(this),this.setBreadcrumbs(),Object.keys(this.props.record).length||this.props.recordActions.fetchRecord(this.props.treeClass,"get",e).then(this.setBreadcrumbs)}},{key:"setBreadcrumbs",value:function r(){if(this.props.record){var e=[{text:G["default"]._t("Campaigns.CAMPAIGN","Campaigns"),href:this.props.sectionConfig.url}];e.push({text:this.props.record.Name,href:this.props.sectionConfig.url+"/set/"+this.props.campaignId+"/show"}),this.props.breadcrumbsActions.setBreadcrumbs(e)}}},{key:"render",value:function o(){var e=this,t=this.props.campaign.changeSetItemId,n=null,r=this.props.campaignId,o=this.props.record,a=this.groupItemsForSet(),i=[];Object.keys(a).forEach(function(u){var s=a[u],l=s.items.length,c=[],f=l+" "+(1===l?s.singular:s.plural),p="Set_"+r+"_Group_"+u;s.items.forEach(function(r){t||(t=r.ID);var a=t===r.ID;a&&r._links&&(n=r._links);var i=[];"none"!==r.ChangeType&&"published"!==o.State||i.push("list-group-item--inactive"),a&&i.push("active"),c.push(h["default"].createElement(k["default"],{key:r.ID,className:i.join(" "),handleClick:e.handleItemSelected,handleClickArg:r.ID},h["default"].createElement(N["default"],{item:r,campaign:e.props.record})))}),i.push(h["default"].createElement(j["default"],{key:p,groupid:p,title:f},c))});var u=[this.props.config.baseUrl,this.props.config.sections["SilverStripe\\CMS\\Controllers\\CMSPagesController"].url].join("/"),s=i.length?h["default"].createElement(P["default"],null,i):h["default"].createElement("div",{
className:"alert alert-warning",role:"alert"},h["default"].createElement("strong",null,"This campaign is empty.")," You can add pages by selecting"," ",h["default"].createElement("em",null,"Add to campaign")," from within the ",h["default"].createElement("em",null,"More Options")," popup on"," ","the ",h["default"].createElement("a",{href:u},"edit page screen"),"."),l=["panel","panel--padded","panel--scrollable","panel--double-toolbar","campaign-items"];return h["default"].createElement("div",{className:"cms-content__split cms-content__split--left-sm"},h["default"].createElement("div",{className:"cms-content__left cms-campaigns collapse in","aria-expanded":"true"},h["default"].createElement(I["default"],{showBackButton:!0,handleBackButtonClick:this.props.handleBackButtonClick},h["default"].createElement(U["default"],{multiline:!0,crumbs:this.props.breadcrumbs})),h["default"].createElement("div",{className:l.join(" ")},s),h["default"].createElement("div",{className:"toolbar--south"},this.renderButtonToolbar())),h["default"].createElement(B["default"],{itemLinks:n,itemId:t}))}},{key:"handleItemSelected",value:function s(e,t){this.props.campaignActions.selectChangeSetItem(t)}},{key:"renderButtonToolbar",value:function l(){var e=this.getItems();if(!e||!e.length)return h["default"].createElement("div",{className:"btn-toolbar"});var t={};return"open"===this.props.record.State?t=c(t,{title:G["default"]._t("Campaigns.PUBLISHCAMPAIGN"),bootstrapButtonStyle:"primary",loading:this.props.campaign.isPublishing,handleClick:this.handlePublish,icon:"rocket"}):"published"===this.props.record.State&&(t=c(t,{title:G["default"]._t("Campaigns.REVERTCAMPAIGN"),bootstrapButtonStyle:"default",icon:"back-in-time",disabled:!0})),h["default"].createElement("div",{className:"btn-toolbar"},h["default"].createElement(M["default"],t))}},{key:"getItems",value:function d(){return this.props.record&&this.props.record._embedded?this.props.record._embedded.items:null}},{key:"groupItemsForSet",value:function y(){var e={},t=this.getItems();return t?(t.forEach(function(t){var n=t.BaseClass;e[n]||(e[n]={singular:t.Singular,plural:t.Plural,items:[]}),e[n].items.push(t)}),e):e}},{key:"handlePublish",value:function m(e){e.preventDefault(),this.props.campaignActions.publishCampaign(this.props.publishApi,this.props.treeClass,this.props.campaignId)}}]),t}(T["default"]);q.propTypes={campaign:h["default"].PropTypes.shape({isPublishing:h["default"].PropTypes.bool.isRequired,changeSetItemId:h["default"].PropTypes.number}),breadcrumbsActions:h["default"].PropTypes.object.isRequired,campaignActions:h["default"].PropTypes.object.isRequired,publishApi:h["default"].PropTypes.func.isRequired,record:h["default"].PropTypes.object.isRequired,recordActions:h["default"].PropTypes.object.isRequired,sectionConfig:h["default"].PropTypes.object.isRequired,handleBackButtonClick:h["default"].PropTypes.func},t["default"]=(0,m.connect)(s,l)(q)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n=["id"];return n.reduce(function(e,n){return e.replace(":"+n,t[n])},e)}function a(e,t,n){var r={recordType:e},a={Accept:"text/json"},i=t.toLowerCase();return function(t){t({type:l["default"].FETCH_RECORDS_REQUEST,payload:r});var u="get"===i?[o(n,r),a]:[o(n,r),{},a];return f["default"][i].apply(f["default"],u).then(function(e){return e.json()}).then(function(n){t({type:l["default"].FETCH_RECORDS_SUCCESS,payload:{recordType:e,data:n}})})["catch"](function(n){t({type:l["default"].FETCH_RECORDS_FAILURE,payload:{error:n,recordType:e}})})}}function i(e,t,n){var r={recordType:e},a={Accept:"text/json"},i=t.toLowerCase();return function(t){t({type:l["default"].FETCH_RECORD_REQUEST,payload:r});var u="get"===i?[o(n,r),a]:[o(n,r),{},a];return f["default"][i].apply(f["default"],u).then(function(e){return e.json()}).then(function(n){t({type:l["default"].FETCH_RECORD_SUCCESS,payload:{recordType:e,data:n}})})["catch"](function(n){t({type:l["default"].FETCH_RECORD_FAILURE,payload:{error:n,recordType:e}})})}}function u(e,t,n,r){var a=arguments.length<=4||void 0===arguments[4]?{}:arguments[4],i={recordType:e,id:t},u=n.toLowerCase(),s="get"===u?[o(r,i),a]:[o(r,i),{},a];return function(n){return n({type:l["default"].DELETE_RECORD_REQUEST,payload:i}),f["default"][u].apply(f["default"],s).then(function(){n({type:l["default"].DELETE_RECORD_SUCCESS,payload:{recordType:e,id:t}})})["catch"](function(r){n({type:l["default"].DELETE_RECORD_FAILURE,payload:{error:r,recordType:e,id:t}})})}}Object.defineProperty(t,"__esModule",{value:!0}),t.fetchRecords=a,t.fetchRecord=i,t.deleteRecord=u;var s=n(43),l=r(s),c=n(72),f=r(c)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){var t=null,n=null;if(!(e.status>=200&&e.status<300))throw n=new Error(e.statusText),n.response=e,n;return t=e}Object.defineProperty(t,"__esModule",{value:!0});var u=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},s=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}}(),l=n(73),c=r(l),f=n(75),p=r(f),d=n(78),h=r(d),y=n(82),m=r(y);p["default"].polyfill();var b=function(){function e(){a(this,e),this.fetch=c["default"]}return s(e,[{key:"createEndpointFetcher",value:function t(e){function t(e,t){switch(e){case"application/x-www-form-urlencoded":return h["default"].stringify(t);case"application/json":case"application/x-json":case"application/x-javascript":case"text/javascript":case"text/x-javascript":case"text/x-json":return JSON.stringify(t);default:throw new Error("Can't encode format: "+e)}}function n(e,t){switch(e){case"application/x-www-form-urlencoded":return h["default"].parse(t);case"application/json":case"application/x-json":case"application/x-javascript":case"text/javascript":case"text/x-javascript":case"text/x-json":return JSON.parse(t);default:throw new Error("Can't decode format: "+e)}}function r(e,t){return""===t?e:e.match(/\?/)?e+"&"+t:e+"?"+t}function a(e){return e.text().then(function(t){return n(e.headers.get("Content-Type"),t)})}function i(e,t){return Object.keys(t).reduce(function(n,r){var a=e[r];return!a||a.remove!==!0&&a.querystring!==!0?u(n,o({},r,t[r])):n},{})}function s(e,n,a){var i=arguments.length<=3||void 0===arguments[3]?{setFromData:!1}:arguments[3],s=n,l=Object.keys(a).reduce(function(t,n){var r=e[n],s=i.setFromData===!0&&!(r&&r.remove===!0),l=r&&r.querystring===!0&&r.remove!==!0;return s||l?u(t,o({},n,a[n])):t},{});return s=r(s,t("application/x-www-form-urlencoded",l)),s=Object.keys(e).reduce(function(t,n){var r=e[n].urlReplacement;return r?t.replace(r,a[n]):t},s)}var l=this,c=u({method:"get",payloadFormat:"application/x-www-form-urlencoded",responseFormat:"application/json",payloadSchema:{},defaultData:{}},e),f={json:"application/json",urlencoded:"application/x-www-form-urlencoded"};return["payloadFormat","responseFormat"].forEach(function(e){f[c[e]]&&(c[e]=f[c[e]])}),function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=u({},n,{Accept:c.responseFormat,"Content-Type":c.payloadFormat}),o=m["default"].recursive({},c.defaultData,e),f=s(c.payloadSchema,c.url,o,{setFromData:"get"===c.method.toLowerCase()}),p=t(c.payloadFormat,i(c.payloadSchema,o)),d="get"===c.method.toLowerCase()?[f,r]:[f,p,r];return l[c.method.toLowerCase()].apply(l,d).then(a)}}},{key:"get",value:function n(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return this.fetch(e,{method:"get",credentials:"same-origin",headers:t}).then(i)}},{key:"post",value:function r(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r={"Content-Type":"application/x-www-form-urlencoded"};return this.fetch(e,{method:"post",headers:u({},r,n),credentials:"same-origin",body:t}).then(i)}},{key:"put",value:function l(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(e,{method:"put",credentials:"same-origin",body:t,headers:n}).then(i)}},{key:"delete",value:function f(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(e,{method:"delete",credentials:"same-origin",body:t,headers:n}).then(i)}}]),e}(),v=new b;t["default"]=v},function(e,t,n){n(74),e.exports=self.fetch.bind(self)},function(e,t){!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){this.map={},e instanceof r?e.forEach(function(e,t){this.append(t,e)},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function o(e){return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function a(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function i(e){var t=new FileReader;return t.readAsArrayBuffer(e),a(t)}function u(e){var t=new FileReader;return t.readAsText(e),a(t)}function s(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,"string"==typeof e)this._bodyText=e;else if(h.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(h.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(e){if(!h.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e))throw new Error("unsupported BodyInit type")}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type&&this.headers.set("content-type",this._bodyBlob.type))},h.blob?(this.blob=function(){var e=o(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(i)},this.text=function(){var e=o(this);if(e)return e;if(this._bodyBlob)return u(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var e=o(this);return e?e:Promise.resolve(this._bodyText)},h.formData&&(this.formData=function(){return this.text().then(f)}),this.json=function(){return this.text().then(JSON.parse)},this}function l(e){var t=e.toUpperCase();return y.indexOf(t)>-1?t:e}function c(e,t){t=t||{};var n=t.body;if(c.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new r(e.headers)),this.method=e.method,this.mode=e.mode,n||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=e;if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new r(t.headers)),this.method=l(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function f(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function p(e){var t=new r,n=e.getAllResponseHeaders().trim().split("\n");return n.forEach(function(e){var n=e.trim().split(":"),r=n.shift().trim(),o=n.join(":").trim();t.append(r,o)}),t}function d(e,t){t||(t={}),this.type="default",this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof r?t.headers:new r(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){r.prototype.append=function(e,r){e=t(e),r=n(r);var o=this.map[e];o||(o=[],this.map[e]=o),o.push(r)},r.prototype["delete"]=function(e){delete this.map[t(e)]},r.prototype.get=function(e){var n=this.map[t(e)];return n?n[0]:null},r.prototype.getAll=function(e){return this.map[t(e)]||[]},r.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},r.prototype.set=function(e,r){this.map[t(e)]=[n(r)]},r.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach(function(n){this.map[n].forEach(function(r){e.call(t,r,n,this)},this)},this)};var h={blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e},y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];c.prototype.clone=function(){return new c(this)},s.call(c.prototype),s.call(d.prototype),d.prototype.clone=function(){return new d(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new r(this.headers),url:this.url})},d.error=function(){var e=new d(null,{status:0,statusText:""});return e.type="error",e};var m=[301,302,303,307,308];d.redirect=function(e,t){if(m.indexOf(t)===-1)throw new RangeError("Invalid status code");return new d(null,{status:t,headers:{location:e}})},e.Headers=r,e.Request=c,e.Response=d,e.fetch=function(e,t){return new Promise(function(n,r){function o(){return"responseURL"in i?i.responseURL:/^X-Request-URL:/m.test(i.getAllResponseHeaders())?i.getResponseHeader("X-Request-URL"):void 0}var a;a=c.prototype.isPrototypeOf(e)&&!t?e:new c(e,t);var i=new XMLHttpRequest;i.onload=function(){var e=1223===i.status?204:i.status;if(e<100||e>599)return void r(new TypeError("Network request failed"));var t={status:e,statusText:i.statusText,headers:p(i),url:o()},a="response"in i?i.response:i.responseText;n(new d(a,t))},i.onerror=function(){r(new TypeError("Network request failed"))},i.open(a.method,a.url,!0),"include"===a.credentials&&(i.withCredentials=!0),"responseType"in i&&h.blob&&(i.responseType="blob"),a.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send("undefined"==typeof a._bodyInit?null:a._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(e,t,n){var r;(function(t,o){/*!
className:"alert alert-warning",role:"alert"},h["default"].createElement("strong",null,"This campaign is empty.")," You can add pages by selecting"," ",h["default"].createElement("em",null,"Add to campaign")," from within the ",h["default"].createElement("em",null,"More Options")," popup on"," ","the ",h["default"].createElement("a",{href:u},"edit page screen"),"."),l=["panel","panel--padded","panel--scrollable","panel--double-toolbar","campaign-items"];return h["default"].createElement("div",{className:"cms-content__split cms-content__split--left-sm"},h["default"].createElement("div",{className:"cms-content__left cms-campaigns collapse in","aria-expanded":"true"},h["default"].createElement(I["default"],{showBackButton:!0,handleBackButtonClick:this.props.handleBackButtonClick},h["default"].createElement(U["default"],{multiline:!0,crumbs:this.props.breadcrumbs})),h["default"].createElement("div",{className:l.join(" ")},s),h["default"].createElement("div",{className:"toolbar--south"},this.renderButtonToolbar())),h["default"].createElement(B["default"],{itemLinks:n,itemId:t}))}},{key:"handleItemSelected",value:function s(e,t){this.props.campaignActions.selectChangeSetItem(t)}},{key:"renderButtonToolbar",value:function l(){var e=this.getItems();if(!e||!e.length)return h["default"].createElement("div",{className:"btn-toolbar"});var t={};return"open"===this.props.record.State?t=c(t,{title:G["default"]._t("Campaigns.PUBLISHCAMPAIGN"),bootstrapButtonStyle:"primary",loading:this.props.campaign.isPublishing,handleClick:this.handlePublish,icon:"rocket"}):"published"===this.props.record.State&&(t=c(t,{title:G["default"]._t("Campaigns.REVERTCAMPAIGN"),bootstrapButtonStyle:"default",icon:"back-in-time",disabled:!0})),h["default"].createElement("div",{className:"btn-toolbar"},h["default"].createElement(M["default"],t))}},{key:"getItems",value:function d(){return this.props.record&&this.props.record._embedded?this.props.record._embedded.items:null}},{key:"groupItemsForSet",value:function y(){var e={},t=this.getItems();return t?(t.forEach(function(t){var n=t.BaseClass;e[n]||(e[n]={singular:t.Singular,plural:t.Plural,items:[]}),e[n].items.push(t)}),e):e}},{key:"handlePublish",value:function m(e){e.preventDefault(),this.props.campaignActions.publishCampaign(this.props.publishApi,this.props.treeClass,this.props.campaignId)}}]),t}(T["default"]);q.propTypes={campaign:h["default"].PropTypes.shape({isPublishing:h["default"].PropTypes.bool.isRequired,changeSetItemId:h["default"].PropTypes.number}),breadcrumbsActions:h["default"].PropTypes.object.isRequired,campaignActions:h["default"].PropTypes.object.isRequired,publishApi:h["default"].PropTypes.func.isRequired,record:h["default"].PropTypes.object.isRequired,recordActions:h["default"].PropTypes.object.isRequired,sectionConfig:h["default"].PropTypes.object.isRequired,handleBackButtonClick:h["default"].PropTypes.func},t["default"]=(0,m.connect)(s,l)(q)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n=["id"];return n.reduce(function(e,n){return e.replace(":"+n,t[n])},e)}function a(e,t,n){var r={recordType:e},a={Accept:"text/json"},i=t.toLowerCase();return function(t){t({type:l["default"].FETCH_RECORDS_REQUEST,payload:r});var u="get"===i?[o(n,r),a]:[o(n,r),{},a];return f["default"][i].apply(f["default"],u).then(function(e){return e.json()}).then(function(n){t({type:l["default"].FETCH_RECORDS_SUCCESS,payload:{recordType:e,data:n}})})["catch"](function(n){throw t({type:l["default"].FETCH_RECORDS_FAILURE,payload:{error:n,recordType:e}}),n})}}function i(e,t,n){var r={recordType:e},a={Accept:"text/json"},i=t.toLowerCase();return function(t){t({type:l["default"].FETCH_RECORD_REQUEST,payload:r});var u="get"===i?[o(n,r),a]:[o(n,r),{},a];return f["default"][i].apply(f["default"],u).then(function(e){return e.json()}).then(function(n){t({type:l["default"].FETCH_RECORD_SUCCESS,payload:{recordType:e,data:n}})})["catch"](function(n){throw t({type:l["default"].FETCH_RECORD_FAILURE,payload:{error:n,recordType:e}}),n})}}function u(e,t,n,r){var a=arguments.length<=4||void 0===arguments[4]?{}:arguments[4],i={recordType:e,id:t},u=n.toLowerCase(),s="get"===u?[o(r,i),a]:[o(r,i),{},a];return function(n){return n({type:l["default"].DELETE_RECORD_REQUEST,payload:i}),f["default"][u].apply(f["default"],s).then(function(){n({type:l["default"].DELETE_RECORD_SUCCESS,payload:{recordType:e,id:t}})})["catch"](function(r){throw n({type:l["default"].DELETE_RECORD_FAILURE,payload:{error:r,recordType:e,id:t}}),r})}}Object.defineProperty(t,"__esModule",{value:!0}),t.fetchRecords=a,t.fetchRecord=i,t.deleteRecord=u;var s=n(43),l=r(s),c=n(72),f=r(c)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){var t=null,n=null;if(!(e.status>=200&&e.status<300))throw n=new Error(e.statusText),n.response=e,n;return t=e}function u(e){var t=null;if(e instanceof FormData||"string"==typeof e)t=e;else{if(!e||"object"!==("undefined"==typeof e?"undefined":m(e)))throw new Error("Invalid body type");t=JSON.stringify(e)}return t}function s(e,t){switch(e){case"application/x-www-form-urlencoded":return w["default"].stringify(t);case"application/json":case"application/x-json":case"application/x-javascript":case"text/javascript":case"text/x-javascript":case"text/x-json":return JSON.stringify(t);default:throw new Error("Can't encode format: "+e)}}function l(e,t){switch(e){case"application/x-www-form-urlencoded":return w["default"].parse(t);case"application/json":case"application/x-json":case"application/x-javascript":case"text/javascript":case"text/x-javascript":case"text/x-json":return JSON.parse(t);default:throw new Error("Can't decode format: "+e)}}function c(e,t){return""===t?e:e.match(/\?/)?e+"&"+t:e+"?"+t}function f(e){return e.text().then(function(t){return l(e.headers.get("Content-Type"),t)})}function p(e,t){return Object.keys(t).reduce(function(n,r){var o=e[r];return!o||o.remove!==!0&&o.querystring!==!0?y(n,a({},r,t[r])):n},{})}function d(e,t,n){var r=arguments.length<=3||void 0===arguments[3]?{setFromData:!1}:arguments[3],o=t,i=Object.keys(n).reduce(function(t,o){var i=e[o],u=r.setFromData===!0&&!(i&&i.remove===!0),s=i&&i.querystring===!0&&i.remove!==!0;return u||s?y(t,a({},o,n[o])):t},{}),u=s("application/x-www-form-urlencoded",i);return o=c(o,u),o=Object.keys(e).reduce(function(t,r){var o=e[r].urlReplacement;return o?t.replace(o,n[r]):t},o)}Object.defineProperty(t,"__esModule",{value:!0});var h=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}}(),y=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},m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},b=n(73),v=r(b),_=n(75),g=r(_),E=n(78),w=r(E),O=n(82),T=r(O);g["default"].polyfill();var C=function(){function e(){o(this,e),this.fetch=v["default"]}return h(e,[{key:"createEndpointFetcher",value:function t(e){var t=this,n=y({method:"get",payloadFormat:"application/x-www-form-urlencoded",responseFormat:"application/json",payloadSchema:{},defaultData:{}},e),r={json:"application/json",urlencoded:"application/x-www-form-urlencoded"};return["payloadFormat","responseFormat"].forEach(function(e){r[n[e]]&&(n[e]=r[n[e]])}),function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=y({},r,{Accept:n.responseFormat,"Content-Type":n.payloadFormat}),a=T["default"].recursive({},n.defaultData,e),i=d(n.payloadSchema,n.url,a,{setFromData:"get"===n.method.toLowerCase()}),u=s(n.payloadFormat,p(n.payloadSchema,a)),l="get"===n.method.toLowerCase()?[i,o]:[i,u,o];return t[n.method.toLowerCase()].apply(t,l).then(f)}}},{key:"get",value:function n(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return this.fetch(e,{method:"get",credentials:"same-origin",headers:t}).then(i)}},{key:"post",value:function r(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r={"Content-Type":"application/x-www-form-urlencoded"};return this.fetch(e,{method:"post",credentials:"same-origin",body:u(t),headers:y({},r,n)}).then(i)}},{key:"put",value:function a(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(e,{method:"put",credentials:"same-origin",body:u(t),headers:n}).then(i)}},{key:"delete",value:function l(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(e,{method:"delete",credentials:"same-origin",body:u(t),headers:n}).then(i)}}]),e}(),P=new C;t["default"]=P},function(e,t,n){n(74),e.exports=self.fetch.bind(self)},function(e,t){!function(e){"use strict";function t(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n(e){return"string"!=typeof e&&(e=String(e)),e}function r(e){this.map={},e instanceof r?e.forEach(function(e,t){this.append(t,e)},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function o(e){return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function a(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function i(e){var t=new FileReader;return t.readAsArrayBuffer(e),a(t)}function u(e){var t=new FileReader;return t.readAsText(e),a(t)}function s(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,"string"==typeof e)this._bodyText=e;else if(h.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(h.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(e){if(!h.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e))throw new Error("unsupported BodyInit type")}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type&&this.headers.set("content-type",this._bodyBlob.type))},h.blob?(this.blob=function(){var e=o(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(i)},this.text=function(){var e=o(this);if(e)return e;if(this._bodyBlob)return u(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var e=o(this);return e?e:Promise.resolve(this._bodyText)},h.formData&&(this.formData=function(){return this.text().then(f)}),this.json=function(){return this.text().then(JSON.parse)},this}function l(e){var t=e.toUpperCase();return y.indexOf(t)>-1?t:e}function c(e,t){t=t||{};var n=t.body;if(c.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new r(e.headers)),this.method=e.method,this.mode=e.mode,n||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=e;if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new r(t.headers)),this.method=l(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function f(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function p(e){var t=new r,n=e.getAllResponseHeaders().trim().split("\n");return n.forEach(function(e){var n=e.trim().split(":"),r=n.shift().trim(),o=n.join(":").trim();t.append(r,o)}),t}function d(e,t){t||(t={}),this.type="default",this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof r?t.headers:new r(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){r.prototype.append=function(e,r){e=t(e),r=n(r);var o=this.map[e];o||(o=[],this.map[e]=o),o.push(r)},r.prototype["delete"]=function(e){delete this.map[t(e)]},r.prototype.get=function(e){var n=this.map[t(e)];return n?n[0]:null},r.prototype.getAll=function(e){return this.map[t(e)]||[]},r.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},r.prototype.set=function(e,r){this.map[t(e)]=[n(r)]},r.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach(function(n){this.map[n].forEach(function(r){e.call(t,r,n,this)},this)},this)};var h={blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e},y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];c.prototype.clone=function(){return new c(this)},s.call(c.prototype),s.call(d.prototype),d.prototype.clone=function(){return new d(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new r(this.headers),url:this.url})},d.error=function(){var e=new d(null,{status:0,statusText:""});return e.type="error",e};var m=[301,302,303,307,308];d.redirect=function(e,t){if(m.indexOf(t)===-1)throw new RangeError("Invalid status code");return new d(null,{status:t,headers:{location:e}})},e.Headers=r,e.Request=c,e.Response=d,e.fetch=function(e,t){return new Promise(function(n,r){function o(){return"responseURL"in i?i.responseURL:/^X-Request-URL:/m.test(i.getAllResponseHeaders())?i.getResponseHeader("X-Request-URL"):void 0}var a;a=c.prototype.isPrototypeOf(e)&&!t?e:new c(e,t);var i=new XMLHttpRequest;i.onload=function(){var e=1223===i.status?204:i.status;if(e<100||e>599)return void r(new TypeError("Network request failed"));var t={status:e,statusText:i.statusText,headers:p(i),url:o()},a="response"in i?i.response:i.responseText;n(new d(a,t))},i.onerror=function(){r(new TypeError("Network request failed"))},i.open(a.method,a.url,!0),"include"===a.credentials&&(i.withCredentials=!0),"responseType"in i&&h.blob&&(i.responseType="blob"),a.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send("undefined"==typeof a._bodyInit?null:a._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(e,t,n){var r;(function(t,o){/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license

View File

@ -1,5 +1,5 @@
!function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";n(121),n(123),n(153),n(155),n(288),n(298),n(313),n(315),n(363),n(369),n(372),n(374),n(628),n(636),n(639),n(642),n(645),n(646),n(942),n(943),n(944),n(94),n(945),n(946),n(947),n(948),n(949),n(950),n(951),n(952),n(953),n(954),n(955),n(118),n(94),n(93),n(956),n(957),n(958),n(959),n(960),n(113),n(961),n(962),n(93),n(963),n(964),n(965),n(966),n(968),n(969),n(971),n(973),n(975),n(979),n(981),n(989),n(990),n(991),n(992),n(993),n(994),n(995),n(996),n(998),n(1e3),n(1002),n(1003),n(1005),n(1007),n(1008)},function(t,e){t.exports=jQuery},,function(t,e){t.exports=React},function(t,e){t.exports=ReactDom},function(t,e){t.exports=ReactRedux},function(t,e){t.exports=ReactRouter},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(){function t(t){try{t=t||window.history.state||{}}catch(e){t={}}var n=d.getWindowPath(),i=t,r=i.key,a=void 0;r?a=f.readState(r):(a=null,r=b.createKey(),v&&window.history.replaceState(o({},t,{key:r}),null));var s=u.parsePath(n);return b.createLocation(o({},s,{state:a}),void 0,r)}function e(e){function n(e){void 0!==e.state&&i(t(e.state))}var i=e.transitionTo;return d.addEventListener(window,"popstate",n),function(){d.removeEventListener(window,"popstate",n)}}function n(t){var e=t.basename,n=t.pathname,i=t.search,r=t.hash,o=t.state,a=t.action,s=t.key;if(a!==l.POP){f.saveState(s,o);var u=(e||"")+n+i+r,c={key:s};if(a===l.PUSH){if(y)return window.location.href=u,!1;window.history.pushState(c,null,u)}else{if(y)return window.location.replace(u),!1;window.history.replaceState(c,null,u)}}}function i(t){1===++_&&(x=e(b));var n=b.listenBefore(t);return function(){n(),0===--_&&x()}}function r(t){1===++_&&(x=e(b));var n=b.listen(t);return function(){n(),0===--_&&x()}}function a(t){1===++_&&(x=e(b)),b.registerTransitionHook(t)}function h(t){b.unregisterTransitionHook(t),0===--_&&x()}var m=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];c.canUseDOM?void 0:s["default"](!1);var g=m.forceRefresh,v=d.supportsHistory(),y=!v||g,b=p["default"](o({},m,{getCurrentLocation:t,finishTransition:n,saveState:f.saveState})),_=0,x=void 0;return o({},b,{listenBefore:i,listen:r,registerTransitionHook:a,unregisterTransitionHook:h})}e.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},a=n(8),s=i(a),l=n(9),u=n(10),c=n(12),d=n(13),f=n(14),h=n(15),p=i(h);e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";var i=function(t,e,n,i,r,o,a,s){if(!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,i,r,o,a,s],c=0;l=new Error(e.replace(/%s/g,function(){return u[c++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}};t.exports=i},function(t,e){"use strict";e.__esModule=!0;var n="PUSH";e.PUSH=n;var i="REPLACE";e.REPLACE=i;var r="POP";e.POP=r,e["default"]={PUSH:n,REPLACE:i,POP:r}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t){var e=t.match(/^https?:\/\/[^\/]*/);return null==e?t:t.substring(e[0].length)}function o(t){var e=r(t),n="",i="",o=e.indexOf("#");o!==-1&&(i=e.substring(o),e=e.substring(0,o));var a=e.indexOf("?");return a!==-1&&(n=e.substring(a),e=e.substring(0,a)),""===e&&(e="/"),{pathname:e,search:n,hash:i}}e.__esModule=!0,e.extractPath=r,e.parsePath=o;var a=n(11),s=i(a)},function(t,e,n){"use strict";var i=function(){};t.exports=i},function(t,e){"use strict";e.__esModule=!0;var n=!("undefined"==typeof window||!window.document||!window.document.createElement);e.canUseDOM=n},function(t,e){"use strict";function n(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function i(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)}function r(){return window.location.href.split("#")[1]||""}function o(t){window.location.replace(window.location.pathname+window.location.search+"#"+t)}function a(){return window.location.pathname+window.location.search+window.location.hash}function s(t){t&&window.history.go(t)}function l(t,e){e(window.confirm(t))}function u(){var t=navigator.userAgent;return(t.indexOf("Android 2.")===-1&&t.indexOf("Android 4.0")===-1||t.indexOf("Mobile Safari")===-1||t.indexOf("Chrome")!==-1||t.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)}function c(){var t=navigator.userAgent;return t.indexOf("Firefox")===-1}e.__esModule=!0,e.addEventListener=n,e.removeEventListener=i,e.getHashPath=r,e.replaceHashPath=o,e.getWindowPath=a,e.go=s,e.getUserConfirmation=l,e.supportsHistory=u,e.supportsGoWithoutReloadUsingHash=c},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t){return u+t}function o(t,e){try{null==e?window.sessionStorage.removeItem(r(t)):window.sessionStorage.setItem(r(t),JSON.stringify(e))}catch(n){if(n.name===d)return;if(c.indexOf(n.name)>=0&&0===window.sessionStorage.length)return;throw n}}function a(t){var e=void 0;try{e=window.sessionStorage.getItem(r(t))}catch(n){if(n.name===d)return null}if(e)try{return JSON.parse(e)}catch(n){}return null}e.__esModule=!0,e.saveState=o,e.readState=a;var s=n(11),l=i(s),u="@@History/",c=["QuotaExceededError","QUOTA_EXCEEDED_ERR"],d="SecurityError"},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t){function e(t){return l.canUseDOM?void 0:s["default"](!1),n.listen(t)}var n=d["default"](o({getUserConfirmation:u.getUserConfirmation},t,{go:u.go}));return o({},n,{listen:e})}e.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},a=n(8),s=i(a),l=n(12),u=n(13),c=n(16),d=i(c);e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t){return Math.random().toString(36).substr(2,t)}function o(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.key===e.key&&d["default"](t.state,e.state)}function a(){function t(t){return L.push(t),function(){L=L.filter(function(e){return e!==t})}}function e(){return B&&B.action===p.POP?H.indexOf(B.key):U?H.indexOf(U.key):-1}function n(t){var n=e();U=t,U.action===p.PUSH?H=[].concat(H.slice(0,n+1),[U.key]):U.action===p.REPLACE&&(H[n]=U.key),Q.forEach(function(t){t(U)})}function i(t){if(Q.push(t),U)t(U);else{var e=D();H=[e.key],n(e)}return function(){Q=Q.filter(function(e){return e!==t})}}function a(t,e){h.loopAsync(L.length,function(e,n,i){y["default"](L[e],t,function(t){null!=t?i(t):n()})},function(t){R&&"string"==typeof t?R(t,function(t){e(t!==!1)}):e(t!==!1)})}function l(t){U&&o(U,t)||(B=t,a(t,function(e){if(B===t)if(e){if(t.action===p.PUSH){var i=w(U),r=w(t);r===i&&d["default"](U.state,t.state)&&(t.action=p.REPLACE)}M(t)!==!1&&n(t)}else if(U&&t.action===p.POP){var o=H.indexOf(U.key),a=H.indexOf(t.key);o!==-1&&a!==-1&&I(o-a)}}))}function u(t){l(k(t,p.PUSH,b()))}function c(t){l(k(t,p.REPLACE,b()))}function m(){I(-1)}function v(){I(1)}function b(){return r(F)}function w(t){if(null==t||"string"==typeof t)return t;var e=t.pathname,n=t.search,i=t.hash,r=e;return n&&(r+=n),i&&(r+=i),r}function C(t){return w(t)}function k(t,e){var n=arguments.length<=2||void 0===arguments[2]?b():arguments[2];return"object"==typeof e&&("string"==typeof t&&(t=f.parsePath(t)),t=s({},t,{state:e}),e=n,n=arguments[3]||b()),g["default"](t,e,n)}function T(t){U?(j(U,t),n(U)):j(D(),t)}function j(t,e){t.state=s({},t.state,e),A(t.key,t.state)}function E(t){L.indexOf(t)===-1&&L.push(t)}function S(t){L=L.filter(function(e){return e!==t})}function P(t,e){"string"==typeof e&&(e=f.parsePath(e)),u(s({state:t},e))}function O(t,e){"string"==typeof e&&(e=f.parsePath(e)),c(s({state:t},e))}var N=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],D=N.getCurrentLocation,M=N.finishTransition,A=N.saveState,I=N.go,R=N.getUserConfirmation,F=N.keyLength;"number"!=typeof F&&(F=x);var L=[],H=[],Q=[],U=void 0,B=void 0;return{listenBefore:t,listen:i,transitionTo:l,push:u,replace:c,go:I,goBack:m,goForward:v,createKey:b,createPath:w,createHref:C,createLocation:k,setState:_["default"](T,"setState is deprecated; use location.key to save state instead"),registerTransitionHook:_["default"](E,"registerTransitionHook is deprecated; use listenBefore instead"),unregisterTransitionHook:_["default"](S,"unregisterTransitionHook is deprecated; use the callback returned from listenBefore instead"),pushState:_["default"](P,"pushState is deprecated; use push instead"),replaceState:_["default"](O,"replaceState is deprecated; use replace instead")}}e.__esModule=!0;var s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},l=n(11),u=i(l),c=n(17),d=i(c),f=n(10),h=n(20),p=n(9),m=n(21),g=i(m),v=n(22),y=i(v),b=n(23),_=i(b),x=6;e["default"]=a,t.exports=e["default"]},function(t,e,n){function i(t){return null===t||void 0===t}function r(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function o(t,e,n){var o,c;if(i(t)||i(e))return!1;if(t.prototype!==e.prototype)return!1;if(l(t))return!!l(e)&&(t=a.call(t),e=a.call(e),u(t,e,n));if(r(t)){if(!r(e))return!1;if(t.length!==e.length)return!1;for(o=0;o<t.length;o++)if(t[o]!==e[o])return!1;return!0}try{var d=s(t),f=s(e)}catch(h){return!1}if(d.length!=f.length)return!1;for(d.sort(),f.sort(),o=d.length-1;o>=0;o--)if(d[o]!=f[o])return!1;for(o=d.length-1;o>=0;o--)if(c=d[o],!u(t[c],e[c],n))return!1;return typeof t==typeof e}var a=Array.prototype.slice,s=n(18),l=n(19),u=t.exports=function(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?t===e:t==e:o(t,e,n))}},function(t,e){function n(t){var e=[];for(var n in t)e.push(n);return e}e=t.exports="function"==typeof Object.keys?Object.keys:n,e.shim=n},function(t,e){function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function i(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var r="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();e=t.exports=r?n:i,e.supported=n,e.unsupported=i},function(t,e){"use strict";function n(t,e,n){function r(){return s=!0,l?void(c=[].concat(i.call(arguments))):void n.apply(this,arguments)}function o(){if(!s&&(u=!0,!l)){for(l=!0;!s&&a<t&&u;)u=!1,e.call(this,a++,o,r);return l=!1,s?void n.apply(this,c):void(a>=t&&u&&(s=!0,n()))}}var a=0,s=!1,l=!1,u=!1,c=void 0;o()}e.__esModule=!0;var i=Array.prototype.slice;e.loopAsync=n},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(){var t=arguments.length<=0||void 0===arguments[0]?"/":arguments[0],e=arguments.length<=1||void 0===arguments[1]?l.POP:arguments[1],n=arguments.length<=2||void 0===arguments[2]?null:arguments[2],i=arguments.length<=3||void 0===arguments[3]?null:arguments[3];"string"==typeof t&&(t=u.parsePath(t)),"object"==typeof e&&(t=o({},t,{state:e}),e=n||l.POP,n=i);var r=t.pathname||"/",a=t.search||"",s=t.hash||"",c=t.state||null;return{pathname:r,search:a,hash:s,state:c,action:e,key:n}}e.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},a=n(11),s=i(a),l=n(9),u=n(10);e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e,n){var i=t(e,n);t.length<2&&n(i)}e.__esModule=!0;var o=n(11),a=i(o);e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){return function(){return t.apply(this,arguments)}}e.__esModule=!0;var o=n(11),a=i(o);e["default"]=r,t.exports=e["default"]},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=function(){function t(){n(this,t)}return i(t,null,[{key:"get",value:function e(t){return window.ss.config[t]}},{key:"getAll",value:function r(){return window.ss.config}},{key:"getSection",value:function o(t){return window.ss.config.sections[t]}}]),t}();e["default"]=r},,,,function(t,e){t.exports=SilverStripeComponent},,function(t,e){t.exports=Redux},,,function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=function(){function t(){n(this,t),this.components={}}return i(t,[{key:"getComponentByName",value:function e(t){return this.components[t]}},{key:"getComponentByDataType",value:function r(t){switch(t){case"Text":case"DateTime":return this.components.TextField;case"Hidden":return this.components.HiddenField;case"SingleSelect":return this.components.SingleSelectField;case"Custom":return this.components.GridField;case"Structural":return this.components.CompositeField;default:return null}}},{key:"register",value:function o(t,e){this.components[t]=e}}]),t}();window.ss=window.ss||{},window.ss.injector=window.ss.injector||new r,e["default"]=window.ss.injector},,,,,,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=e.ACTION_TYPES={ADD_FORM:"ADD_FORM",REMOVE_FORM:"REMOVE_FORM",SUBMIT_FORM_FAILURE:"SUBMIT_FORM_FAILURE",SUBMIT_FORM_REQUEST:"SUBMIT_FORM_REQUEST",SUBMIT_FORM_SUCCESS:"SUBMIT_FORM_SUCCESS",UPDATE_FIELD:"UPDATE_FIELD",SET_SUBMIT_ACTION:"SET_SUBMIT_ACTION"}},,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={SET_SCHEMA:"SET_SCHEMA"};e["default"]=n},,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={CREATE_RECORD:"CREATE_RECORD",UPDATE_RECORD:"UPDATE_RECORD",DELETE_RECORD:"DELETE_RECORD",FETCH_RECORDS_REQUEST:"FETCH_RECORDS_REQUEST",FETCH_RECORDS_FAILURE:"FETCH_RECORDS_FAILURE",FETCH_RECORDS_SUCCESS:"FETCH_RECORDS_SUCCESS",FETCH_RECORD_REQUEST:"FETCH_RECORD_REQUEST",FETCH_RECORD_FAILURE:"FETCH_RECORD_FAILURE",FETCH_RECORD_SUCCESS:"FETCH_RECORD_SUCCESS",DELETE_RECORD_REQUEST:"DELETE_RECORD_REQUEST",DELETE_RECORD_FAILURE:"DELETE_RECORD_FAILURE",DELETE_RECORD_SUCCESS:"DELETE_RECORD_SUCCESS"}},,,,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={SET_BREADCRUMBS:"SET_BREADCRUMBS"}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=n(3),u=i(l),c=n(28),d=i(c),f=n(49),h=i(f),p=function(t){function e(t){r(this,e);var n=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleChange=n.handleChange.bind(n),n}return a(e,t),s(e,[{key:"render",value:function n(){var t=null;return t=this.props.readOnly?u["default"].createElement("div",null,u["default"].createElement("i",null,this.props.value)):u["default"].createElement("input",this.getInputProps())}},{key:"getInputProps",value:function i(){return{className:["form-control",this.props.extraClass].join(" "),id:this.props.id,name:this.props.name,onChange:this.handleChange,type:"text",value:this.props.value}}},{key:"handleChange",value:function l(t){"function"==typeof this.props.onChange&&this.props.onChange(t,{id:this.props.id,value:t.target.value})}}]),e}(d["default"]);p.propTypes={extraClass:u["default"].PropTypes.string,id:u["default"].PropTypes.string,name:u["default"].PropTypes.string.isRequired,onChange:u["default"].PropTypes.func,value:u["default"].PropTypes.string,readOnly:u["default"].PropTypes.bool},p.defaultProps={value:null},e["default"]=(0,h["default"])(p)},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t){var e=function(e){function n(){return r(this,n),o(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return a(n,e),c(n,[{key:"castStringToElement",value:function i(t,e,n){if(t&&"undefined"!=typeof t.html){var i={__html:t.html};return f["default"].createElement(e,u({},n,{dangerouslySetInnerHTML:i}))}var r=null;if(r=t&&"undefined"!=typeof t.text?t.text:t,r&&"object"===("undefined"==typeof r?"undefined":l(r)))throw new Error("Unsupported string value "+JSON.stringify(r));return f["default"].createElement(e,n,r)}},{key:"getDescription",value:function s(){return this.castStringToElement(this.props.description,"div",{className:"form__field-description"})}},{key:"getTitle",value:function d(){var t=null!==this.props.leftTitle?this.props.leftTitle:this.props.title;return t?this.castStringToElement(t,"label",{className:"form__field-label",htmlFor:this.props.id}):null}},{key:"render",value:function h(){var e=["form-group field",this.props.extraClass];return this.props.readOnly&&e.push("readonly"),f["default"].createElement("div",{className:e.join(" "),id:this.props.holder_id},this.getTitle(),f["default"].createElement("div",{className:"form__field-holder"},f["default"].createElement(t,this.props)),this.getDescription())}}]),n}(p["default"]);return e.propTypes={leftTitle:f["default"].PropTypes.oneOfType([f["default"].PropTypes.string,f["default"].PropTypes.bool]),title:f["default"].PropTypes.oneOfType([f["default"].PropTypes.string,f["default"].PropTypes.bool]),extraClass:f["default"].PropTypes.string,holder_id:f["default"].PropTypes.string,id:f["default"].PropTypes.string,description:f["default"].PropTypes.oneOfType([f["default"].PropTypes.string,f["default"].PropTypes.object])},e}Object.defineProperty(e,"__esModule",{value:!0});var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),d=n(3),f=i(d),h=n(28),p=i(h);e["default"]=s},,function(t,e){t.exports=i18n},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=n(3),u=i(l),c=n(28),d=i(c),f=function(t){function e(t){r(this,e);var n=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleChange=n.handleChange.bind(n),n}return a(e,t),s(e,[{key:"render",value:function n(){return u["default"].createElement("div",{className:"field hidden"},u["default"].createElement("input",this.getInputProps()))}},{key:"getInputProps",value:function i(){return{className:["hidden",this.props.extraClass].join(" "),id:this.props.id,name:this.props.name,onChange:this.props.onChange,type:"hidden",value:this.props.value}}},{key:"handleChange",value:function l(){"undefined"!=typeof this.props.onChange&&this.props.onChange()}}]),e}(d["default"]);f.propTypes={extraClass:u["default"].PropTypes.string,name:u["default"].PropTypes.string.isRequired,onChange:u["default"].PropTypes.func,value:u["default"].PropTypes.any},f.defaultProps={value:null},e["default"]=f},,,,function(t,e){t.exports=ReactBootstrap},,,,,,,,,function(t,e){t.exports=Backend},,,,function(t,e){t.exports=FormBuilder},,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){var n=["id"];return n.reduce(function(t,n){return t.replace(":"+n,e[n])},t)}function o(t,e,n){var i={recordType:t},o={Accept:"text/json"},a=e.toLowerCase();return function(e){e({type:u["default"].FETCH_RECORDS_REQUEST,payload:i});var s="get"===a?[r(n,i),o]:[r(n,i),{},o];return d["default"][a].apply(d["default"],s).then(function(t){return t.json()}).then(function(n){e({type:u["default"].FETCH_RECORDS_SUCCESS,payload:{recordType:t,data:n}})})["catch"](function(n){e({type:u["default"].FETCH_RECORDS_FAILURE,payload:{error:n,recordType:t}})})}}function a(t,e,n){var i={recordType:t},o={Accept:"text/json"},a=e.toLowerCase();return function(e){e({type:u["default"].FETCH_RECORD_REQUEST,payload:i});var s="get"===a?[r(n,i),o]:[r(n,i),{},o];return d["default"][a].apply(d["default"],s).then(function(t){return t.json()}).then(function(n){e({type:u["default"].FETCH_RECORD_SUCCESS,payload:{recordType:t,data:n}})})["catch"](function(n){e({type:u["default"].FETCH_RECORD_FAILURE,payload:{error:n,recordType:t}})})}}function s(t,e,n,i){var o=arguments.length<=4||void 0===arguments[4]?{}:arguments[4],a={recordType:t,id:e},s=n.toLowerCase(),l="get"===s?[r(i,a),o]:[r(i,a),{},o];return function(n){return n({type:u["default"].DELETE_RECORD_REQUEST,payload:a}),d["default"][s].apply(d["default"],l).then(function(){n({type:u["default"].DELETE_RECORD_SUCCESS,payload:{recordType:t,id:e}})})["catch"](function(i){n({type:u["default"].DELETE_RECORD_FAILURE,payload:{error:i,recordType:t,id:e}})})}}Object.defineProperty(e,"__esModule",{value:!0}),e.fetchRecords=o,e.fetchRecord=a,e.deleteRecord=s;var l=n(43),u=i(l),c=n(72),d=i(c)},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t){var e=null,n=null;if(!(t.status>=200&&t.status<300))throw n=new Error(t.statusText),n.response=t,n;return e=t}Object.defineProperty(e,"__esModule",{value:!0});var s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},l=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),u=n(73),c=i(u),d=n(75),f=i(d),h=n(78),p=i(h),m=n(82),g=i(m);f["default"].polyfill();var v=function(){function t(){o(this,t),this.fetch=c["default"]}return l(t,[{key:"createEndpointFetcher",value:function e(t){function e(t,e){switch(t){case"application/x-www-form-urlencoded":return p["default"].stringify(e);case"application/json":case"application/x-json":case"application/x-javascript":case"text/javascript":case"text/x-javascript":case"text/x-json":return JSON.stringify(e);default:throw new Error("Can't encode format: "+t)}}function n(t,e){switch(t){case"application/x-www-form-urlencoded":return p["default"].parse(e);case"application/json":case"application/x-json":case"application/x-javascript":case"text/javascript":case"text/x-javascript":case"text/x-json":return JSON.parse(e);default:throw new Error("Can't decode format: "+t)}}function i(t,e){return""===e?t:t.match(/\?/)?t+"&"+e:t+"?"+e}function o(t){return t.text().then(function(e){return n(t.headers.get("Content-Type"),e)})}function a(t,e){return Object.keys(e).reduce(function(n,i){var o=t[i];return!o||o.remove!==!0&&o.querystring!==!0?s(n,r({},i,e[i])):n},{})}function l(t,n,o){var a=arguments.length<=3||void 0===arguments[3]?{setFromData:!1}:arguments[3],l=n,u=Object.keys(o).reduce(function(e,n){var i=t[n],l=a.setFromData===!0&&!(i&&i.remove===!0),u=i&&i.querystring===!0&&i.remove!==!0;return l||u?s(e,r({},n,o[n])):e},{});return l=i(l,e("application/x-www-form-urlencoded",u)),l=Object.keys(t).reduce(function(e,n){var i=t[n].urlReplacement;return i?e.replace(i,o[n]):e},l)}var u=this,c=s({method:"get",payloadFormat:"application/x-www-form-urlencoded",responseFormat:"application/json",payloadSchema:{},defaultData:{}},t),d={json:"application/json",urlencoded:"application/x-www-form-urlencoded"};return["payloadFormat","responseFormat"].forEach(function(t){d[c[t]]&&(c[t]=d[c[t]])}),function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=s({},n,{Accept:c.responseFormat,"Content-Type":c.payloadFormat}),r=g["default"].recursive({},c.defaultData,t),d=l(c.payloadSchema,c.url,r,{setFromData:"get"===c.method.toLowerCase()}),f=e(c.payloadFormat,a(c.payloadSchema,r)),h="get"===c.method.toLowerCase()?[d,i]:[d,f,i];return u[c.method.toLowerCase()].apply(u,h).then(o)}}},{key:"get",value:function n(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return this.fetch(t,{method:"get",credentials:"same-origin",headers:e}).then(a)}},{key:"post",value:function i(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],i={"Content-Type":"application/x-www-form-urlencoded"};return this.fetch(t,{method:"post",headers:s({},i,n),credentials:"same-origin",body:e}).then(a)}},{key:"put",value:function u(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(t,{method:"put",credentials:"same-origin",body:e,headers:n}).then(a)}},{key:"delete",value:function d(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(t,{method:"delete",credentials:"same-origin",body:e,headers:n}).then(a)}}]),t}(),y=new v;e["default"]=y},function(t,e,n){n(74),t.exports=self.fetch.bind(self)},function(t,e){!function(t){"use strict";function e(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function n(t){return"string"!=typeof t&&(t=String(t)),t}function i(t){this.map={},t instanceof i?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function r(t){return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function o(t){return new Promise(function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}})}function a(t){var e=new FileReader;return e.readAsArrayBuffer(t),o(e)}function s(t){var e=new FileReader;return e.readAsText(t),o(e)}function l(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,"string"==typeof t)this._bodyText=t;else if(p.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(p.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(t){if(!p.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t))throw new Error("unsupported BodyInit type")}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type&&this.headers.set("content-type",this._bodyBlob.type))},p.blob?(this.blob=function(){var t=r(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(a)},this.text=function(){var t=r(this);if(t)return t;if(this._bodyBlob)return s(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var t=r(this);return t?t:Promise.resolve(this._bodyText)},p.formData&&(this.formData=function(){return this.text().then(d)}),this.json=function(){return this.text().then(JSON.parse)},this}function u(t){var e=t.toUpperCase();return m.indexOf(e)>-1?e:t}function c(t,e){e=e||{};var n=e.body;if(c.prototype.isPrototypeOf(t)){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new i(t.headers)),this.method=t.method,this.mode=t.mode,n||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=t;if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new i(e.headers)),this.method=u(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function d(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),i=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(r))}}),e}function f(t){var e=new i,n=t.getAllResponseHeaders().trim().split("\n");return n.forEach(function(t){var n=t.trim().split(":"),i=n.shift().trim(),r=n.join(":").trim();e.append(i,r)}),e}function h(t,e){e||(e={}),this.type="default",this.status=e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText,this.headers=e.headers instanceof i?e.headers:new i(e.headers),
this.url=e.url||"",this._initBody(t)}if(!t.fetch){i.prototype.append=function(t,i){t=e(t),i=n(i);var r=this.map[t];r||(r=[],this.map[t]=r),r.push(i)},i.prototype["delete"]=function(t){delete this.map[e(t)]},i.prototype.get=function(t){var n=this.map[e(t)];return n?n[0]:null},i.prototype.getAll=function(t){return this.map[e(t)]||[]},i.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},i.prototype.set=function(t,i){this.map[e(t)]=[n(i)]},i.prototype.forEach=function(t,e){Object.getOwnPropertyNames(this.map).forEach(function(n){this.map[n].forEach(function(i){t.call(e,i,n,this)},this)},this)};var p={blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t},m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];c.prototype.clone=function(){return new c(this)},l.call(c.prototype),l.call(h.prototype),h.prototype.clone=function(){return new h(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},h.error=function(){var t=new h(null,{status:0,statusText:""});return t.type="error",t};var g=[301,302,303,307,308];h.redirect=function(t,e){if(g.indexOf(e)===-1)throw new RangeError("Invalid status code");return new h(null,{status:e,headers:{location:t}})},t.Headers=i,t.Request=c,t.Response=h,t.fetch=function(t,e){return new Promise(function(n,i){function r(){return"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0}var o;o=c.prototype.isPrototypeOf(t)&&!e?t:new c(t,e);var a=new XMLHttpRequest;a.onload=function(){var t=1223===a.status?204:a.status;if(t<100||t>599)return void i(new TypeError("Network request failed"));var e={status:t,statusText:a.statusText,headers:f(a),url:r()},o="response"in a?a.response:a.responseText;n(new h(o,e))},a.onerror=function(){i(new TypeError("Network request failed"))},a.open(o.method,o.url,!0),"include"===o.credentials&&(a.withCredentials=!0),"responseType"in a&&p.blob&&(a.responseType="blob"),o.headers.forEach(function(t,e){a.setRequestHeader(e,t)}),a.send("undefined"==typeof o._bodyInit?null:o._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(t,e,n){var i;(function(e,r){/*!
!function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";n(121),n(123),n(153),n(155),n(288),n(298),n(313),n(315),n(363),n(369),n(372),n(374),n(628),n(636),n(639),n(642),n(645),n(646),n(942),n(943),n(944),n(94),n(945),n(946),n(947),n(948),n(949),n(950),n(951),n(952),n(953),n(954),n(955),n(118),n(94),n(93),n(956),n(957),n(958),n(959),n(960),n(113),n(961),n(962),n(93),n(963),n(964),n(965),n(966),n(968),n(969),n(971),n(973),n(975),n(979),n(981),n(989),n(990),n(991),n(992),n(993),n(994),n(995),n(996),n(998),n(1e3),n(1002),n(1003),n(1005),n(1007),n(1008)},function(t,e){t.exports=jQuery},,function(t,e){t.exports=React},function(t,e){t.exports=ReactDom},function(t,e){t.exports=ReactRedux},function(t,e){t.exports=ReactRouter},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(){function t(t){try{t=t||window.history.state||{}}catch(e){t={}}var n=d.getWindowPath(),i=t,r=i.key,a=void 0;r?a=f.readState(r):(a=null,r=b.createKey(),v&&window.history.replaceState(o({},t,{key:r}),null));var s=u.parsePath(n);return b.createLocation(o({},s,{state:a}),void 0,r)}function e(e){function n(e){void 0!==e.state&&i(t(e.state))}var i=e.transitionTo;return d.addEventListener(window,"popstate",n),function(){d.removeEventListener(window,"popstate",n)}}function n(t){var e=t.basename,n=t.pathname,i=t.search,r=t.hash,o=t.state,a=t.action,s=t.key;if(a!==l.POP){f.saveState(s,o);var u=(e||"")+n+i+r,c={key:s};if(a===l.PUSH){if(y)return window.location.href=u,!1;window.history.pushState(c,null,u)}else{if(y)return window.location.replace(u),!1;window.history.replaceState(c,null,u)}}}function i(t){1===++_&&(x=e(b));var n=b.listenBefore(t);return function(){n(),0===--_&&x()}}function r(t){1===++_&&(x=e(b));var n=b.listen(t);return function(){n(),0===--_&&x()}}function a(t){1===++_&&(x=e(b)),b.registerTransitionHook(t)}function h(t){b.unregisterTransitionHook(t),0===--_&&x()}var m=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];c.canUseDOM?void 0:s["default"](!1);var g=m.forceRefresh,v=d.supportsHistory(),y=!v||g,b=p["default"](o({},m,{getCurrentLocation:t,finishTransition:n,saveState:f.saveState})),_=0,x=void 0;return o({},b,{listenBefore:i,listen:r,registerTransitionHook:a,unregisterTransitionHook:h})}e.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},a=n(8),s=i(a),l=n(9),u=n(10),c=n(12),d=n(13),f=n(14),h=n(15),p=i(h);e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";var i=function(t,e,n,i,r,o,a,s){if(!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,i,r,o,a,s],c=0;l=new Error(e.replace(/%s/g,function(){return u[c++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}};t.exports=i},function(t,e){"use strict";e.__esModule=!0;var n="PUSH";e.PUSH=n;var i="REPLACE";e.REPLACE=i;var r="POP";e.POP=r,e["default"]={PUSH:n,REPLACE:i,POP:r}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t){var e=t.match(/^https?:\/\/[^\/]*/);return null==e?t:t.substring(e[0].length)}function o(t){var e=r(t),n="",i="",o=e.indexOf("#");o!==-1&&(i=e.substring(o),e=e.substring(0,o));var a=e.indexOf("?");return a!==-1&&(n=e.substring(a),e=e.substring(0,a)),""===e&&(e="/"),{pathname:e,search:n,hash:i}}e.__esModule=!0,e.extractPath=r,e.parsePath=o;var a=n(11),s=i(a)},function(t,e,n){"use strict";var i=function(){};t.exports=i},function(t,e){"use strict";e.__esModule=!0;var n=!("undefined"==typeof window||!window.document||!window.document.createElement);e.canUseDOM=n},function(t,e){"use strict";function n(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function i(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)}function r(){return window.location.href.split("#")[1]||""}function o(t){window.location.replace(window.location.pathname+window.location.search+"#"+t)}function a(){return window.location.pathname+window.location.search+window.location.hash}function s(t){t&&window.history.go(t)}function l(t,e){e(window.confirm(t))}function u(){var t=navigator.userAgent;return(t.indexOf("Android 2.")===-1&&t.indexOf("Android 4.0")===-1||t.indexOf("Mobile Safari")===-1||t.indexOf("Chrome")!==-1||t.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)}function c(){var t=navigator.userAgent;return t.indexOf("Firefox")===-1}e.__esModule=!0,e.addEventListener=n,e.removeEventListener=i,e.getHashPath=r,e.replaceHashPath=o,e.getWindowPath=a,e.go=s,e.getUserConfirmation=l,e.supportsHistory=u,e.supportsGoWithoutReloadUsingHash=c},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t){return u+t}function o(t,e){try{null==e?window.sessionStorage.removeItem(r(t)):window.sessionStorage.setItem(r(t),JSON.stringify(e))}catch(n){if(n.name===d)return;if(c.indexOf(n.name)>=0&&0===window.sessionStorage.length)return;throw n}}function a(t){var e=void 0;try{e=window.sessionStorage.getItem(r(t))}catch(n){if(n.name===d)return null}if(e)try{return JSON.parse(e)}catch(n){}return null}e.__esModule=!0,e.saveState=o,e.readState=a;var s=n(11),l=i(s),u="@@History/",c=["QuotaExceededError","QUOTA_EXCEEDED_ERR"],d="SecurityError"},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t){function e(t){return l.canUseDOM?void 0:s["default"](!1),n.listen(t)}var n=d["default"](o({getUserConfirmation:u.getUserConfirmation},t,{go:u.go}));return o({},n,{listen:e})}e.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},a=n(8),s=i(a),l=n(12),u=n(13),c=n(16),d=i(c);e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t){return Math.random().toString(36).substr(2,t)}function o(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.key===e.key&&d["default"](t.state,e.state)}function a(){function t(t){return L.push(t),function(){L=L.filter(function(e){return e!==t})}}function e(){return B&&B.action===p.POP?H.indexOf(B.key):U?H.indexOf(U.key):-1}function n(t){var n=e();U=t,U.action===p.PUSH?H=[].concat(H.slice(0,n+1),[U.key]):U.action===p.REPLACE&&(H[n]=U.key),Q.forEach(function(t){t(U)})}function i(t){if(Q.push(t),U)t(U);else{var e=D();H=[e.key],n(e)}return function(){Q=Q.filter(function(e){return e!==t})}}function a(t,e){h.loopAsync(L.length,function(e,n,i){y["default"](L[e],t,function(t){null!=t?i(t):n()})},function(t){R&&"string"==typeof t?R(t,function(t){e(t!==!1)}):e(t!==!1)})}function l(t){U&&o(U,t)||(B=t,a(t,function(e){if(B===t)if(e){if(t.action===p.PUSH){var i=w(U),r=w(t);r===i&&d["default"](U.state,t.state)&&(t.action=p.REPLACE)}M(t)!==!1&&n(t)}else if(U&&t.action===p.POP){var o=H.indexOf(U.key),a=H.indexOf(t.key);o!==-1&&a!==-1&&I(o-a)}}))}function u(t){l(k(t,p.PUSH,b()))}function c(t){l(k(t,p.REPLACE,b()))}function m(){I(-1)}function v(){I(1)}function b(){return r(F)}function w(t){if(null==t||"string"==typeof t)return t;var e=t.pathname,n=t.search,i=t.hash,r=e;return n&&(r+=n),i&&(r+=i),r}function C(t){return w(t)}function k(t,e){var n=arguments.length<=2||void 0===arguments[2]?b():arguments[2];return"object"==typeof e&&("string"==typeof t&&(t=f.parsePath(t)),t=s({},t,{state:e}),e=n,n=arguments[3]||b()),g["default"](t,e,n)}function T(t){U?(j(U,t),n(U)):j(D(),t)}function j(t,e){t.state=s({},t.state,e),A(t.key,t.state)}function E(t){L.indexOf(t)===-1&&L.push(t)}function S(t){L=L.filter(function(e){return e!==t})}function P(t,e){"string"==typeof e&&(e=f.parsePath(e)),u(s({state:t},e))}function O(t,e){"string"==typeof e&&(e=f.parsePath(e)),c(s({state:t},e))}var N=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],D=N.getCurrentLocation,M=N.finishTransition,A=N.saveState,I=N.go,R=N.getUserConfirmation,F=N.keyLength;"number"!=typeof F&&(F=x);var L=[],H=[],Q=[],U=void 0,B=void 0;return{listenBefore:t,listen:i,transitionTo:l,push:u,replace:c,go:I,goBack:m,goForward:v,createKey:b,createPath:w,createHref:C,createLocation:k,setState:_["default"](T,"setState is deprecated; use location.key to save state instead"),registerTransitionHook:_["default"](E,"registerTransitionHook is deprecated; use listenBefore instead"),unregisterTransitionHook:_["default"](S,"unregisterTransitionHook is deprecated; use the callback returned from listenBefore instead"),pushState:_["default"](P,"pushState is deprecated; use push instead"),replaceState:_["default"](O,"replaceState is deprecated; use replace instead")}}e.__esModule=!0;var s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},l=n(11),u=i(l),c=n(17),d=i(c),f=n(10),h=n(20),p=n(9),m=n(21),g=i(m),v=n(22),y=i(v),b=n(23),_=i(b),x=6;e["default"]=a,t.exports=e["default"]},function(t,e,n){function i(t){return null===t||void 0===t}function r(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function o(t,e,n){var o,c;if(i(t)||i(e))return!1;if(t.prototype!==e.prototype)return!1;if(l(t))return!!l(e)&&(t=a.call(t),e=a.call(e),u(t,e,n));if(r(t)){if(!r(e))return!1;if(t.length!==e.length)return!1;for(o=0;o<t.length;o++)if(t[o]!==e[o])return!1;return!0}try{var d=s(t),f=s(e)}catch(h){return!1}if(d.length!=f.length)return!1;for(d.sort(),f.sort(),o=d.length-1;o>=0;o--)if(d[o]!=f[o])return!1;for(o=d.length-1;o>=0;o--)if(c=d[o],!u(t[c],e[c],n))return!1;return typeof t==typeof e}var a=Array.prototype.slice,s=n(18),l=n(19),u=t.exports=function(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?t===e:t==e:o(t,e,n))}},function(t,e){function n(t){var e=[];for(var n in t)e.push(n);return e}e=t.exports="function"==typeof Object.keys?Object.keys:n,e.shim=n},function(t,e){function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function i(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}var r="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();e=t.exports=r?n:i,e.supported=n,e.unsupported=i},function(t,e){"use strict";function n(t,e,n){function r(){return s=!0,l?void(c=[].concat(i.call(arguments))):void n.apply(this,arguments)}function o(){if(!s&&(u=!0,!l)){for(l=!0;!s&&a<t&&u;)u=!1,e.call(this,a++,o,r);return l=!1,s?void n.apply(this,c):void(a>=t&&u&&(s=!0,n()))}}var a=0,s=!1,l=!1,u=!1,c=void 0;o()}e.__esModule=!0;var i=Array.prototype.slice;e.loopAsync=n},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(){var t=arguments.length<=0||void 0===arguments[0]?"/":arguments[0],e=arguments.length<=1||void 0===arguments[1]?l.POP:arguments[1],n=arguments.length<=2||void 0===arguments[2]?null:arguments[2],i=arguments.length<=3||void 0===arguments[3]?null:arguments[3];"string"==typeof t&&(t=u.parsePath(t)),"object"==typeof e&&(t=o({},t,{state:e}),e=n||l.POP,n=i);var r=t.pathname||"/",a=t.search||"",s=t.hash||"",c=t.state||null;return{pathname:r,search:a,hash:s,state:c,action:e,key:n}}e.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},a=n(11),s=i(a),l=n(9),u=n(10);e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e,n){var i=t(e,n);t.length<2&&n(i)}e.__esModule=!0;var o=n(11),a=i(o);e["default"]=r,t.exports=e["default"]},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){return function(){return t.apply(this,arguments)}}e.__esModule=!0;var o=n(11),a=i(o);e["default"]=r,t.exports=e["default"]},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=function(){function t(){n(this,t)}return i(t,null,[{key:"get",value:function e(t){return window.ss.config[t]}},{key:"getAll",value:function r(){return window.ss.config}},{key:"getSection",value:function o(t){return window.ss.config.sections[t]}}]),t}();e["default"]=r},,,,function(t,e){t.exports=SilverStripeComponent},,function(t,e){t.exports=Redux},,,function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=function(){function t(){n(this,t),this.components={}}return i(t,[{key:"getComponentByName",value:function e(t){return this.components[t]}},{key:"getComponentByDataType",value:function r(t){switch(t){case"Text":case"DateTime":return this.components.TextField;case"Hidden":return this.components.HiddenField;case"SingleSelect":return this.components.SingleSelectField;case"Custom":return this.components.GridField;case"Structural":return this.components.CompositeField;default:return null}}},{key:"register",value:function o(t,e){this.components[t]=e}}]),t}();window.ss=window.ss||{},window.ss.injector=window.ss.injector||new r,e["default"]=window.ss.injector},,,,,,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=e.ACTION_TYPES={ADD_FORM:"ADD_FORM",REMOVE_FORM:"REMOVE_FORM",SUBMIT_FORM_FAILURE:"SUBMIT_FORM_FAILURE",SUBMIT_FORM_REQUEST:"SUBMIT_FORM_REQUEST",SUBMIT_FORM_SUCCESS:"SUBMIT_FORM_SUCCESS",UPDATE_FIELD:"UPDATE_FIELD",SET_SUBMIT_ACTION:"SET_SUBMIT_ACTION"}},,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={SET_SCHEMA:"SET_SCHEMA"};e["default"]=n},,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={CREATE_RECORD:"CREATE_RECORD",UPDATE_RECORD:"UPDATE_RECORD",DELETE_RECORD:"DELETE_RECORD",FETCH_RECORDS_REQUEST:"FETCH_RECORDS_REQUEST",FETCH_RECORDS_FAILURE:"FETCH_RECORDS_FAILURE",FETCH_RECORDS_SUCCESS:"FETCH_RECORDS_SUCCESS",FETCH_RECORD_REQUEST:"FETCH_RECORD_REQUEST",FETCH_RECORD_FAILURE:"FETCH_RECORD_FAILURE",FETCH_RECORD_SUCCESS:"FETCH_RECORD_SUCCESS",DELETE_RECORD_REQUEST:"DELETE_RECORD_REQUEST",DELETE_RECORD_FAILURE:"DELETE_RECORD_FAILURE",DELETE_RECORD_SUCCESS:"DELETE_RECORD_SUCCESS"}},,,,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={SET_BREADCRUMBS:"SET_BREADCRUMBS"}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=n(3),u=i(l),c=n(28),d=i(c),f=n(49),h=i(f),p=function(t){function e(t){r(this,e);var n=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleChange=n.handleChange.bind(n),n}return a(e,t),s(e,[{key:"render",value:function n(){var t=null;return t=this.props.readOnly?u["default"].createElement("div",null,u["default"].createElement("i",null,this.props.value)):u["default"].createElement("input",this.getInputProps())}},{key:"getInputProps",value:function i(){return{className:["form-control",this.props.extraClass].join(" "),id:this.props.id,name:this.props.name,onChange:this.handleChange,type:"text",value:this.props.value}}},{key:"handleChange",value:function l(t){"function"==typeof this.props.onChange&&this.props.onChange(t,{id:this.props.id,value:t.target.value})}}]),e}(d["default"]);p.propTypes={extraClass:u["default"].PropTypes.string,id:u["default"].PropTypes.string,name:u["default"].PropTypes.string.isRequired,onChange:u["default"].PropTypes.func,value:u["default"].PropTypes.string,readOnly:u["default"].PropTypes.bool},p.defaultProps={value:null},e["default"]=(0,h["default"])(p)},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t){var e=function(e){function n(){return r(this,n),o(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return a(n,e),c(n,[{key:"castStringToElement",value:function i(t,e,n){if(t&&"undefined"!=typeof t.html){var i={__html:t.html};return f["default"].createElement(e,u({},n,{dangerouslySetInnerHTML:i}))}var r=null;if(r=t&&"undefined"!=typeof t.text?t.text:t,r&&"object"===("undefined"==typeof r?"undefined":l(r)))throw new Error("Unsupported string value "+JSON.stringify(r));return f["default"].createElement(e,n,r)}},{key:"getDescription",value:function s(){return this.castStringToElement(this.props.description,"div",{className:"form__field-description"})}},{key:"getTitle",value:function d(){var t=null!==this.props.leftTitle?this.props.leftTitle:this.props.title;return t?this.castStringToElement(t,"label",{className:"form__field-label",htmlFor:this.props.id}):null}},{key:"render",value:function h(){var e=["form-group field",this.props.extraClass];return this.props.readOnly&&e.push("readonly"),f["default"].createElement("div",{className:e.join(" "),id:this.props.holder_id},this.getTitle(),f["default"].createElement("div",{className:"form__field-holder"},f["default"].createElement(t,this.props)),this.getDescription())}}]),n}(p["default"]);return e.propTypes={leftTitle:f["default"].PropTypes.oneOfType([f["default"].PropTypes.string,f["default"].PropTypes.bool]),title:f["default"].PropTypes.oneOfType([f["default"].PropTypes.string,f["default"].PropTypes.bool]),extraClass:f["default"].PropTypes.string,holder_id:f["default"].PropTypes.string,id:f["default"].PropTypes.string,description:f["default"].PropTypes.oneOfType([f["default"].PropTypes.string,f["default"].PropTypes.object])},e}Object.defineProperty(e,"__esModule",{value:!0});var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),d=n(3),f=i(d),h=n(28),p=i(h);e["default"]=s},,function(t,e){t.exports=i18n},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=n(3),u=i(l),c=n(28),d=i(c),f=function(t){function e(t){r(this,e);var n=o(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleChange=n.handleChange.bind(n),n}return a(e,t),s(e,[{key:"render",value:function n(){return u["default"].createElement("div",{className:"field hidden"},u["default"].createElement("input",this.getInputProps()))}},{key:"getInputProps",value:function i(){return{className:["hidden",this.props.extraClass].join(" "),id:this.props.id,name:this.props.name,onChange:this.props.onChange,type:"hidden",value:this.props.value}}},{key:"handleChange",value:function l(){"undefined"!=typeof this.props.onChange&&this.props.onChange()}}]),e}(d["default"]);f.propTypes={extraClass:u["default"].PropTypes.string,name:u["default"].PropTypes.string.isRequired,onChange:u["default"].PropTypes.func,value:u["default"].PropTypes.any},f.defaultProps={value:null},e["default"]=f},,,,function(t,e){t.exports=ReactBootstrap},,,,,,,,,function(t,e){t.exports=Backend},,,,function(t,e){t.exports=FormBuilder},,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){var n=["id"];return n.reduce(function(t,n){return t.replace(":"+n,e[n])},t)}function o(t,e,n){var i={recordType:t},o={Accept:"text/json"},a=e.toLowerCase();return function(e){e({type:u["default"].FETCH_RECORDS_REQUEST,payload:i});var s="get"===a?[r(n,i),o]:[r(n,i),{},o];return d["default"][a].apply(d["default"],s).then(function(t){return t.json()}).then(function(n){e({type:u["default"].FETCH_RECORDS_SUCCESS,payload:{recordType:t,data:n}})})["catch"](function(n){throw e({type:u["default"].FETCH_RECORDS_FAILURE,payload:{error:n,recordType:t}}),n})}}function a(t,e,n){var i={recordType:t},o={Accept:"text/json"},a=e.toLowerCase();return function(e){e({type:u["default"].FETCH_RECORD_REQUEST,payload:i});var s="get"===a?[r(n,i),o]:[r(n,i),{},o];return d["default"][a].apply(d["default"],s).then(function(t){return t.json()}).then(function(n){e({type:u["default"].FETCH_RECORD_SUCCESS,payload:{recordType:t,data:n}})})["catch"](function(n){throw e({type:u["default"].FETCH_RECORD_FAILURE,payload:{error:n,recordType:t}}),n})}}function s(t,e,n,i){var o=arguments.length<=4||void 0===arguments[4]?{}:arguments[4],a={recordType:t,id:e},s=n.toLowerCase(),l="get"===s?[r(i,a),o]:[r(i,a),{},o];return function(n){return n({type:u["default"].DELETE_RECORD_REQUEST,payload:a}),d["default"][s].apply(d["default"],l).then(function(){n({type:u["default"].DELETE_RECORD_SUCCESS,payload:{recordType:t,id:e}})})["catch"](function(i){throw n({type:u["default"].DELETE_RECORD_FAILURE,payload:{error:i,recordType:t,id:e}}),i})}}Object.defineProperty(e,"__esModule",{value:!0}),e.fetchRecords=o,e.fetchRecord=a,e.deleteRecord=s;var l=n(43),u=i(l),c=n(72),d=i(c)},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(t){var e=null,n=null;if(!(t.status>=200&&t.status<300))throw n=new Error(t.statusText),n.response=t,n;return e=t}function s(t){var e=null;if(t instanceof FormData||"string"==typeof t)e=t;else{if(!t||"object"!==("undefined"==typeof t?"undefined":g(t)))throw new Error("Invalid body type");e=JSON.stringify(t)}return e}function l(t,e){switch(t){case"application/x-www-form-urlencoded":return w["default"].stringify(e);case"application/json":case"application/x-json":case"application/x-javascript":case"text/javascript":case"text/x-javascript":case"text/x-json":return JSON.stringify(e);default:throw new Error("Can't encode format: "+t)}}function u(t,e){switch(t){case"application/x-www-form-urlencoded":return w["default"].parse(e);case"application/json":case"application/x-json":case"application/x-javascript":case"text/javascript":case"text/x-javascript":case"text/x-json":return JSON.parse(e);default:throw new Error("Can't decode format: "+t)}}function c(t,e){return""===e?t:t.match(/\?/)?t+"&"+e:t+"?"+e}function d(t){return t.text().then(function(e){return u(t.headers.get("Content-Type"),e)})}function f(t,e){return Object.keys(e).reduce(function(n,i){var r=t[i];return!r||r.remove!==!0&&r.querystring!==!0?m(n,o({},i,e[i])):n},{})}function h(t,e,n){var i=arguments.length<=3||void 0===arguments[3]?{setFromData:!1}:arguments[3],r=e,a=Object.keys(n).reduce(function(e,r){var a=t[r],s=i.setFromData===!0&&!(a&&a.remove===!0),l=a&&a.querystring===!0&&a.remove!==!0;return s||l?m(e,o({},r,n[r])):e},{}),s=l("application/x-www-form-urlencoded",a);return r=c(r,s),r=Object.keys(t).reduce(function(e,i){var r=t[i].urlReplacement;return r?e.replace(r,n[i]):e},r)}Object.defineProperty(e,"__esModule",{value:!0});var p=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),m=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},v=n(73),y=i(v),b=n(75),_=i(b),x=n(78),w=i(x),C=n(82),k=i(C);_["default"].polyfill();var T=function(){function t(){r(this,t),this.fetch=y["default"]}return p(t,[{key:"createEndpointFetcher",value:function e(t){var e=this,n=m({method:"get",payloadFormat:"application/x-www-form-urlencoded",responseFormat:"application/json",payloadSchema:{},defaultData:{}},t),i={json:"application/json",urlencoded:"application/x-www-form-urlencoded"};return["payloadFormat","responseFormat"].forEach(function(t){i[n[t]]&&(n[t]=i[n[t]])}),function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=m({},i,{Accept:n.responseFormat,"Content-Type":n.payloadFormat}),o=k["default"].recursive({},n.defaultData,t),a=h(n.payloadSchema,n.url,o,{setFromData:"get"===n.method.toLowerCase()}),s=l(n.payloadFormat,f(n.payloadSchema,o)),u="get"===n.method.toLowerCase()?[a,r]:[a,s,r];return e[n.method.toLowerCase()].apply(e,u).then(d)}}},{key:"get",value:function n(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return this.fetch(t,{method:"get",credentials:"same-origin",headers:e}).then(a)}},{key:"post",value:function i(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],i={"Content-Type":"application/x-www-form-urlencoded"};return this.fetch(t,{method:"post",credentials:"same-origin",body:s(e),headers:m({},i,n)}).then(a)}},{key:"put",value:function o(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(t,{method:"put",credentials:"same-origin",body:s(e),headers:n}).then(a)}},{key:"delete",value:function u(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(t,{method:"delete",credentials:"same-origin",body:s(e),headers:n}).then(a)}}]),t}(),j=new T;e["default"]=j},function(t,e,n){n(74),t.exports=self.fetch.bind(self)},function(t,e){!function(t){"use strict";function e(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function n(t){return"string"!=typeof t&&(t=String(t)),t}function i(t){this.map={},t instanceof i?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function r(t){return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function o(t){return new Promise(function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}})}function a(t){var e=new FileReader;return e.readAsArrayBuffer(t),o(e)}function s(t){var e=new FileReader;return e.readAsText(t),o(e)}function l(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,"string"==typeof t)this._bodyText=t;else if(p.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(p.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(t){if(!p.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t))throw new Error("unsupported BodyInit type")}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type&&this.headers.set("content-type",this._bodyBlob.type))},p.blob?(this.blob=function(){var t=r(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(a)},this.text=function(){var t=r(this);if(t)return t;if(this._bodyBlob)return s(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var t=r(this);return t?t:Promise.resolve(this._bodyText)},p.formData&&(this.formData=function(){return this.text().then(d)}),this.json=function(){return this.text().then(JSON.parse)},this}function u(t){var e=t.toUpperCase();return m.indexOf(e)>-1?e:t}function c(t,e){e=e||{};var n=e.body;if(c.prototype.isPrototypeOf(t)){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new i(t.headers)),this.method=t.method,this.mode=t.mode,n||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=t;if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new i(e.headers)),this.method=u(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function d(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var n=t.split("="),i=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");
e.append(decodeURIComponent(i),decodeURIComponent(r))}}),e}function f(t){var e=new i,n=t.getAllResponseHeaders().trim().split("\n");return n.forEach(function(t){var n=t.trim().split(":"),i=n.shift().trim(),r=n.join(":").trim();e.append(i,r)}),e}function h(t,e){e||(e={}),this.type="default",this.status=e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText,this.headers=e.headers instanceof i?e.headers:new i(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){i.prototype.append=function(t,i){t=e(t),i=n(i);var r=this.map[t];r||(r=[],this.map[t]=r),r.push(i)},i.prototype["delete"]=function(t){delete this.map[e(t)]},i.prototype.get=function(t){var n=this.map[e(t)];return n?n[0]:null},i.prototype.getAll=function(t){return this.map[e(t)]||[]},i.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},i.prototype.set=function(t,i){this.map[e(t)]=[n(i)]},i.prototype.forEach=function(t,e){Object.getOwnPropertyNames(this.map).forEach(function(n){this.map[n].forEach(function(i){t.call(e,i,n,this)},this)},this)};var p={blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t},m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];c.prototype.clone=function(){return new c(this)},l.call(c.prototype),l.call(h.prototype),h.prototype.clone=function(){return new h(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},h.error=function(){var t=new h(null,{status:0,statusText:""});return t.type="error",t};var g=[301,302,303,307,308];h.redirect=function(t,e){if(g.indexOf(e)===-1)throw new RangeError("Invalid status code");return new h(null,{status:e,headers:{location:t}})},t.Headers=i,t.Request=c,t.Response=h,t.fetch=function(t,e){return new Promise(function(n,i){function r(){return"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0}var o;o=c.prototype.isPrototypeOf(t)&&!e?t:new c(t,e);var a=new XMLHttpRequest;a.onload=function(){var t=1223===a.status?204:a.status;if(t<100||t>599)return void i(new TypeError("Network request failed"));var e={status:t,statusText:a.statusText,headers:f(a),url:r()},o="response"in a?a.response:a.responseText;n(new h(o,e))},a.onerror=function(){i(new TypeError("Network request failed"))},a.open(o.method,o.url,!0),"include"===o.credentials&&(a.withCredentials=!0),"responseType"in a&&p.blob&&(a.responseType="blob"),o.headers.forEach(function(t,e){a.setRequestHeader(e,t)}),a.send("undefined"==typeof o._bodyInit?null:o._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(t,e,n){var i;(function(e,r){/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license

2
admin/client/dist/js/main.js vendored Normal file
View File

@ -0,0 +1,2 @@
!function(r){function n(t){if(o[t])return o[t].exports;var e=o[t]={exports:{},id:t,loaded:!1};return r[t].call(e.exports,e,e.exports,n),e.loaded=!0,e.exports}var o={};return n.m=r,n.c=o,n.p="",n(0)}([function(r,n,o){!function t(){throw new Error('Cannot find module "—watch"')}(),function e(){throw new Error('Cannot find module "—profile"')}()}]);
//# sourceMappingURL=main.js.map

53
admin/client/dist/main.css vendored Normal file
View File

@ -0,0 +1,53 @@
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
(function webpackMissingModule() { throw new Error("Cannot find module \"watch\""); }());
(function webpackMissingModule() { throw new Error("Cannot find module \"profile\""); }());
/***/ }
/******/ ]);
/*# sourceMappingURL=main.css.map*/

View File

@ -22,6 +22,183 @@ function checkStatus(response) {
return ret;
}
/**
* Encodes the body data given to a valid value for posting
*
* References:
* https://github.com/github/fetch - API for fetch
* https://github.com/facebook/react-native/issues/2538 - IE10 bug
*
* @param data
* @returns {FormData|string}
*/
function encodeBody(data) {
let encodedData = null;
if (data instanceof FormData || typeof data === 'string') {
encodedData = data;
} else if (data && typeof data === 'object') {
encodedData = JSON.stringify(data);
} else {
throw new Error('Invalid body type');
}
return encodedData;
}
/**
* Encode a payload based on the given contentType
*
* @param {string} contentType
* @param {Object} data
* @return {string}
*/
function encode(contentType, data) {
switch (contentType) {
case 'application/x-www-form-urlencoded':
return qs.stringify(data);
case 'application/json':
case 'application/x-json':
case 'application/x-javascript':
case 'text/javascript':
case 'text/x-javascript':
case 'text/x-json':
return JSON.stringify(data);
default:
throw new Error(`Can\'t encode format: ${contentType}`);
}
}
/**
* Decode a payload based on the given contentType
*
* @param {string} contentType
* @param {string} text
* @return {Object}
*/
function decode(contentType, text) {
switch (contentType) {
case 'application/x-www-form-urlencoded':
return qs.parse(text);
case 'application/json':
case 'application/x-json':
case 'application/x-javascript':
case 'text/javascript':
case 'text/x-javascript':
case 'text/x-json':
return JSON.parse(text);
default:
throw new Error(`Can\'t decode format: ${contentType}`);
}
}
/**
* Add a querystring to a url
*
* @param {string} url
* @param {string} querystring
* @return {string}
*/
function addQuerystring(url, querystring) {
if (querystring === '') {
return url;
}
if (url.match(/\?/)) {
return `${url}&${querystring}`;
}
return `${url}?${querystring}`;
}
/**
* Parse the response based on the content type returned
*
* @param {Promise} response
* @return {Promise}
*/
function parseResponse(response) {
return response.text().then(
body => decode(response.headers.get('Content-Type'), body)
);
}
/**
* Apply the payload schema rules to the passed-in payload,
* returning the transformed payload.
*
* @param {Object} payloadSchema
* @param {Object} data
* @return {Object}
*/
function applySchemaToData(payloadSchema, data) {
return Object.keys(data).reduce((prev, key) => {
const schema = payloadSchema[key];
// Remove key if schema requires it.
// Usually set because the specific payload key
// is used to populate a url placeholder instead.
if (schema && (schema.remove === true || schema.querystring === true)) {
return prev;
}
// TODO Support for nested keys
return Object.assign(prev, { [key]: data[key] });
}, {});
}
/**
* Applies URL templating and query parameter transformation based on the payloadSchema.
*
* @param {Object} payloadSchema
* @param {string} url
* @param {Object} data
* @param {Object} opts
* @return {string} New URL
*/
function applySchemaToUrl(payloadSchema, url, data, opts = { setFromData: false }) {
let newUrl = url;
// Set query parameters
const queryData = Object.keys(data).reduce((prev, key) => {
const schema = payloadSchema[key];
const includeThroughSetFromData = (
opts.setFromData === true
&& !(schema && schema.remove === true)
);
const includeThroughSpec = (
schema
&& schema.querystring === true
&& schema.remove !== true
);
if (includeThroughSetFromData || includeThroughSpec) {
return Object.assign(prev, { [key]: data[key] });
}
return prev;
}, {});
const encodedQuery = encode('application/x-www-form-urlencoded', queryData);
newUrl = addQuerystring(
newUrl,
encodedQuery
);
// Template placeholders
newUrl = Object.keys(payloadSchema).reduce((prev, key) => {
const replacement = payloadSchema[key].urlReplacement;
if (replacement) {
return prev.replace(replacement, data[key]);
}
return prev;
}, newUrl);
return newUrl;
}
class Backend {
constructor() {
@ -103,160 +280,6 @@ class Backend {
* and returns a promise.
*/
createEndpointFetcher(endpointSpec) {
/**
* Encode a payload based on the given contentType
*
* @param {string} contentType
* @param {Object} data
* @return {string}
*/
function encode(contentType, data) {
switch (contentType) {
case 'application/x-www-form-urlencoded':
return qs.stringify(data);
case 'application/json':
case 'application/x-json':
case 'application/x-javascript':
case 'text/javascript':
case 'text/x-javascript':
case 'text/x-json':
return JSON.stringify(data);
default:
throw new Error(`Can\'t encode format: ${contentType}`);
}
}
/**
* Decode a payload based on the given contentType
*
* @param {string} contentType
* @param {string} text
* @return {Object}
*/
function decode(contentType, text) {
switch (contentType) {
case 'application/x-www-form-urlencoded':
return qs.parse(text);
case 'application/json':
case 'application/x-json':
case 'application/x-javascript':
case 'text/javascript':
case 'text/x-javascript':
case 'text/x-json':
return JSON.parse(text);
default:
throw new Error(`Can\'t decode format: ${contentType}`);
}
}
/**
* Add a querystring to a url
*
* @param {string} url
* @param {string} querystring
* @return {string}
*/
function addQuerystring(url, querystring) {
if (querystring === '') {
return url;
}
if (url.match(/\?/)) {
return `${url}&${querystring}`;
}
return `${url}?${querystring}`;
}
/**
* Parse the response based on the content type returned
*
* @param {Promise} response
* @return {Promise}
*/
function parseResponse(response) {
return response.text().then(
body => decode(response.headers.get('Content-Type'), body)
);
}
/**
* Apply the payload schema rules to the passed-in payload,
* returning the transformed payload.
*
* @param {Object} payloadSchema
* @param {Object} data
* @return {Object}
*/
function applySchemaToData(payloadSchema, data) {
return Object.keys(data).reduce((prev, key) => {
const schema = payloadSchema[key];
// Remove key if schema requires it.
// Usually set because the specific payload key
// is used to populate a url placeholder instead.
if (schema && (schema.remove === true || schema.querystring === true)) {
return prev;
}
// TODO Support for nested keys
return Object.assign(prev, { [key]: data[key] });
}, {});
}
/**
* Applies URL templating and query parameter transformation based on the payloadSchema.
*
* @param {Object} payloadSchema
* @param {string} url
* @param {Object} data
* @param {Object} opts
* @return {string} New URL
*/
function applySchemaToUrl(payloadSchema, url, data, opts = { setFromData: false }) {
let newUrl = url;
// Set query parameters
const queryData = Object.keys(data).reduce((prev, key) => {
const schema = payloadSchema[key];
const includeThroughSetFromData = (
opts.setFromData === true
&& !(schema && schema.remove === true)
);
const includeThroughSpec = (
schema
&& schema.querystring === true
&& schema.remove !== true
);
if (includeThroughSetFromData || includeThroughSpec) {
return Object.assign(prev, { [key]: data[key] });
}
return prev;
}, {});
newUrl = addQuerystring(
newUrl,
encode('application/x-www-form-urlencoded', queryData)
);
// Template placeholders
newUrl = Object.keys(payloadSchema).reduce((prev, key) => {
const replacement = payloadSchema[key].urlReplacement;
if (replacement) {
return prev.replace(replacement, data[key]);
}
return prev;
}, newUrl);
return newUrl;
}
// Parameter defaults
const refinedSpec = Object.assign({
method: 'get',
@ -344,9 +367,9 @@ class Backend {
const defaultHeaders = { 'Content-Type': 'application/x-www-form-urlencoded' };
return this.fetch(url, {
method: 'post',
headers: Object.assign({}, defaultHeaders, headers),
credentials: 'same-origin',
body: data,
body: encodeBody(data),
headers: Object.assign({}, defaultHeaders, headers),
})
.then(checkStatus);
}
@ -360,7 +383,12 @@ class Backend {
* @return object - Promise
*/
put(url, data = {}, headers = {}) {
return this.fetch(url, { method: 'put', credentials: 'same-origin', body: data, headers })
return this.fetch(url, {
method: 'put',
credentials: 'same-origin',
body: encodeBody(data),
headers,
})
.then(checkStatus);
}
@ -373,7 +401,12 @@ class Backend {
* @return object - Promise
*/
delete(url, data = {}, headers = {}) {
return this.fetch(url, { method: 'delete', credentials: 'same-origin', body: data, headers })
return this.fetch(url, {
method: 'delete',
credentials: 'same-origin',
body: encodeBody(data),
headers,
})
.then(checkStatus);
}

View File

@ -64,7 +64,7 @@ describe('Backend', () => {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: postData,
body: JSON.stringify(postData),
}
);
});
@ -87,7 +87,7 @@ describe('Backend', () => {
method: 'put',
credentials: 'same-origin',
headers: {},
body: putData,
body: JSON.stringify(putData),
}
);
});
@ -110,7 +110,7 @@ describe('Backend', () => {
method: 'delete',
credentials: 'same-origin',
headers: {},
body: deleteData,
body: JSON.stringify(deleteData),
}
);
});
@ -129,28 +129,35 @@ describe('Backend', () => {
});
}
it('should add querystring to the URL for GET requests', () => {
it('should add querystring to the URL for GET requests', (done) => {
const mock = getBackendMock({
text: () => Promise.resolve('{"status":"ok","message":"happy"}'),
headers: new Headers({
'Content-Type': 'application/json',
}),
});
const endpoint = mock.createEndpointFetcher({
url: 'http://example.org',
method: 'get',
responseFormat: 'json',
});
endpoint({ id: 1, values: { a: 'aye', b: 'bee' } });
expect(mock.get.mock.calls[0][0]).toEqual('http://example.org?id=1&values%5Ba%5D=aye&values%5Bb%5D=bee');
expect(mock.get.mock.calls[0][1]).toEqual({
const promise = endpoint({ id: 1, values: { a: 'aye', b: 'bee' } });
return promise.then(() => {
expect(mock.get.mock.calls[0][0])
.toEqual('http://example.org?id=1&values%5Ba%5D=aye&values%5Bb%5D=bee');
expect(mock.get.mock.calls[0][1])
.toEqual({
Accept: 'application/json',
'Content-Type': 'application/x-www-form-urlencoded',
});
done();
});
});
it('should pass a JSON payload', () => {
it('should pass a JSON payload', (done) => {
const mock = getBackendMock({
text: () => Promise.resolve('{"status":"ok","message":"happy"}'),
headers: new Headers({
@ -165,19 +172,20 @@ describe('Backend', () => {
});
const promise = endpoint({ id: 1, values: { a: 'aye', b: 'bee' } });
return promise.then((result) => {
expect(mock.post.mock.calls[0][0]).toEqual('http://example.org');
expect(mock.post.mock.calls[0][1]).toEqual('{"id":1,"values":{"a":"aye","b":"bee"}}');
expect(mock.post.mock.calls[0][2]).toEqual({
Accept: 'application/json',
'Content-Type': 'application/json',
});
return promise.then((result) => {
expect(result).toEqual({ status: 'ok', message: 'happy' });
done();
});
});
it('should replace url template parameters', () => {
it('should replace url template parameters', (done) => {
const mock = getBackendMock({
text: () => Promise.resolve('{"status":"ok"}'),
headers: new Headers({
@ -192,16 +200,20 @@ describe('Backend', () => {
two: { urlReplacement: ':two' },
},
});
endpoint({
const promise = endpoint({
one: 1,
two: 2,
three: 3,
});
return promise.then(() => {
expect(mock.post.mock.calls[0][0]).toEqual('http://example.com/1/2/?foo=bar');
expect(mock.post.mock.calls[0][1]).toEqual('two=2&three=3');
done();
});
});
it('should add query parameters from spec for non-GET data', () => {
it('should add query parameters from spec for non-GET data', (done) => {
const mock = getBackendMock({
text: () => Promise.resolve('{"status":"ok"}'),
headers: new Headers({
@ -218,16 +230,20 @@ describe('Backend', () => {
three: { querystring: true },
},
});
endpoint({
const promise = endpoint({
one: 1,
two: 2,
three: 3,
});
return promise.then(() => {
expect(mock.post.mock.calls[0][0]).toEqual('http://example.com/1/2/?foo=bar&three=3');
expect(mock.post.mock.calls[0][1]).toEqual('{"two":2}');
done();
});
});
it('should add query parameters from payload for GET data', () => {
it('should add query parameters from payload for GET data', (done) => {
const mock = getBackendMock({
text: () => Promise.resolve('{"status":"ok"}'),
headers: new Headers({
@ -243,19 +259,23 @@ describe('Backend', () => {
three: { querystring: true },
},
});
endpoint({
const promise = endpoint({
one: 1,
two: 2,
three: 3,
});
return promise.then(() => {
expect(mock.get.mock.calls[0][0]).toEqual('http://example.com/1/2/?foo=bar&two=2&three=3');
expect(mock.get.mock.calls[0][1]).toEqual({
Accept: 'application/json',
'Content-Type': 'application/x-www-form-urlencoded',
});
done();
});
});
it('should merge defaultData into data argument', () => {
it('should merge defaultData into data argument', (done) => {
const mock = getBackendMock({
text: () => Promise.resolve('{"status":"ok"}'),
headers: new Headers({
@ -268,11 +288,13 @@ describe('Backend', () => {
payloadFormat: 'json',
defaultData: { one: 1, two: 2, four: { fourOne: true } },
});
endpoint({
const promise = endpoint({
two: 'updated',
three: 3,
four: { fourTwo: true },
});
return promise.then(() => {
expect(mock.post.mock.calls[0][0]).toEqual('http://example.com/');
expect(mock.post.mock.calls[0][1]).toEqual(JSON.stringify({
one: 1,
@ -280,6 +302,8 @@ describe('Backend', () => {
four: { fourOne: true, fourTwo: true },
three: 3,
}));
done();
});
});
});
});

View File

@ -52,6 +52,7 @@ export function fetchRecords(recordType, method, url) {
type: ACTION_TYPES.FETCH_RECORDS_FAILURE,
payload: { error: err, recordType },
});
throw err;
});
};
}
@ -92,6 +93,7 @@ export function fetchRecord(recordType, method, url) {
type: ACTION_TYPES.FETCH_RECORD_FAILURE,
payload: { error: err, recordType },
});
throw err;
});
};
}
@ -129,6 +131,7 @@ export function deleteRecord(recordType, id, method, url, headers = {}) {
type: ACTION_TYPES.DELETE_RECORD_FAILURE,
payload: { error: err, recordType, id },
});
throw err;
});
};
}

53
main.css Normal file
View File

@ -0,0 +1,53 @@
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
(function webpackMissingModule() { throw new Error("Cannot find module \"watch\""); }());
(function webpackMissingModule() { throw new Error("Cannot find module \"profile\""); }());
/***/ }
/******/ ]);
/*# sourceMappingURL=main.css.map*/