mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
4 lines
52 KiB
JavaScript
4 lines
52 KiB
JavaScript
!function e(t,r,n){function o(a,s){if(!r[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return o(r?r:e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}function i(){h["default"].add("config",b["default"]),h["default"].add("schemas",E["default"]),h["default"].add("records",_["default"]),h["default"].add("campaign",C["default"]);var e={},t=(0,c.combineReducers)(h["default"].getAll()),r=(0,c.applyMiddleware)(l["default"],(0,p["default"])())(c.createStore);window.store=r(t,e),window.store.dispatch(m.setConfig(window.ss.config))}var a=e("jQuery"),s=o(a),c=e("redux"),u=e("redux-thunk"),l=o(u),f=e("redux-logger"),p=o(f),d=e("reducer-register"),h=o(d),y=e("state/config/actions"),m=n(y),v=e("state/config/reducer"),b=o(v),g=e("state/schema/reducer"),E=o(g),w=e("state/records/reducer"),_=o(w),O=e("state/campaign/reducer"),C=o(O),T=e("sections/campaign-admin/index");o(T);(0,s["default"])("body").entwine({onadd:function(){return i()}})},{jQuery:"jQuery","reducer-register":"reducer-register",redux:"redux","redux-logger":31,"redux-thunk":"redux-thunk","sections/campaign-admin/index":7,"state/campaign/reducer":14,"state/config/actions":16,"state/config/reducer":17,"state/records/reducer":20,"state/schema/reducer":22}],2:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var o=r[n],i=Object.getOwnPropertyDescriptor(t,o);i&&i.configurable&&void 0===e[o]&&Object.defineProperty(e,o,i)}return e}function i(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 s(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):o(e,t))}Object.defineProperty(r,"__esModule",{value:!0});var c=e("react"),u=n(c),l=e("silverstripe-component"),f=n(l);e("bootstrap-collapse");var p=function(e){function t(){return i(this,t),a(this,e.apply(this,arguments))}return s(t,e),t.prototype.render=function(){var e=this.props.groupid+"_Header",t=this.props.groupid+"_Items",r="#"+t,n={id:t,"aria-expanded":!0,className:"list-group list-group-flush collapse in",role:"tabpanel","aria-labelledby":e};return u["default"].createElement("div",{className:"accordion-group"},u["default"].createElement("h6",{className:"accordion-group__title",role:"tab",id:e},u["default"].createElement("a",{"data-toggle":"collapse",href:r,"aria-expanded":"true","aria-controls":t},this.props.title)),u["default"].createElement("div",n,this.props.children))},t}(f["default"]);r["default"]=p},{"bootstrap-collapse":"bootstrap-collapse",react:"react","silverstripe-component":"silverstripe-component"}],3:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var o=r[n],i=Object.getOwnPropertyDescriptor(t,o);i&&i.configurable&&void 0===e[o]&&Object.defineProperty(e,o,i)}return e}function i(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 s(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):o(e,t))}Object.defineProperty(r,"__esModule",{value:!0});var c=e("react"),u=n(c),l=e("silverstripe-component"),f=n(l),p=function(e){function t(){return i(this,t),a(this,e.apply(this,arguments))}return s(t,e),t.prototype.render=function(){return u["default"].createElement("div",{role:"tablist","aria-multiselectable":"true"},this.props.children)},t}(f["default"]);r["default"]=p},{react:"react","silverstripe-component":"silverstripe-component"}],4:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var o=r[n],i=Object.getOwnPropertyDescriptor(t,o);i&&i.configurable&&void 0===e[o]&&Object.defineProperty(e,o,i)}return e}function i(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 s(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):o(e,t))}Object.defineProperty(r,"__esModule",{value:!0});var c=e("react"),u=n(c),l=e("silverstripe-component"),f=n(l),p=function(e){function t(){return i(this,t),a(this,e.apply(this,arguments))}return s(t,e),t.prototype.render=function(){var e="list-group-item "+this.props.className;return u["default"].createElement("a",{className:e},this.props.children)},t}(f["default"]);r["default"]=p},{react:"react","silverstripe-component":"silverstripe-component"}],5:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var o=r[n],i=Object.getOwnPropertyDescriptor(t,o);i&&i.configurable&&void 0===e[o]&&Object.defineProperty(e,o,i)}return e}function i(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 s(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):o(e,t))}Object.defineProperty(r,"__esModule",{value:!0});var c=e("react"),u=n(c),l=e("silverstripe-component"),f=n(l),p=function(e){function t(r){i(this,t);var n=a(this,e.call(this,r));return n.handleClick=n.handleClick.bind(n),n}return s(t,e),t.prototype.render=function(){var e={type:this.props.type,className:this.getButtonClasses(),disabled:this.props.disabled};return"undefined"!=typeof this.props.id&&(e.id=this.props.id),u["default"].createElement("button",e,this.getLoadingIcon(),this.props.label)},t.prototype.getButtonClasses=function(){var e=["btn"];return e.push("btn-"+this.props.style),"undefined"==typeof this.props.label&&e.push("no-text"),"undefined"!=typeof this.props.icon&&e.push("font-icon-"+this.props.icon),this.props.loading===!0&&e.push("btn--loading"),this.props.disabled===!0&&e.push("disabled"),"undefined"!=typeof this.props.extraClass&&e.push(this.props.extraClass),e.join(" ")},t.prototype.getLoadingIcon=function(){return this.props.loading?u["default"].createElement("div",{className:"btn__loading-icon"},u["default"].createElement("svg",{viewBox:"0 0 44 12"},u["default"].createElement("circle",{cx:"6",cy:"6",r:"6"}),u["default"].createElement("circle",{cx:"22",cy:"6",r:"6"}),u["default"].createElement("circle",{cx:"38",cy:"6",r:"6"}))):null},t.prototype.handleClick=function(e){this.props.handleClick(e)},t}(f["default"]);p.propTypes={id:u["default"].PropTypes.string,handleClick:u["default"].PropTypes.func.isRequired,label:u["default"].PropTypes.string,type:u["default"].PropTypes.string,loading:u["default"].PropTypes.bool,icon:u["default"].PropTypes.string,disabled:u["default"].PropTypes.bool,style:u["default"].PropTypes.string,extraClass:u["default"].PropTypes.string},p.defaultProps={type:"button",style:"secondary",disabled:!1},r["default"]=p},{react:"react","silverstripe-component":"silverstripe-component"}],6:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var o=r[n],i=Object.getOwnPropertyDescriptor(t,o);i&&i.configurable&&void 0===e[o]&&Object.defineProperty(e,o,i)}return e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 c(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):i(e,t))}function u(e,t){return{config:e.config.sections[t.sectionConfigKey],campaignId:e.campaign.campaignId,view:e.campaign.view}}function l(e){return{actions:(0,h.bindActionCreators)(v,e)}}Object.defineProperty(r,"__esModule",{value:!0});var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p=e("react"),d=o(p),h=e("redux"),y=e("react-redux"),m=e("state/campaign/actions"),v=n(m),b=e("silverstripe-component"),g=o(b),E=e("components/form-action/index"),w=o(E),_=e("i18n"),O=o(_),C=e("components/north-header/index"),T=o(C),j=e("components/form-builder/index"),R=o(j),x=e("./list"),S=o(x),P=function(e){function t(r){a(this,t);var n=s(this,e.call(this,r));return n.addCampaign=n.addCampaign.bind(n),n.createFn=n.createFn.bind(n),n}return c(t,e),t.prototype.componentDidMount=function(){var e=this;window.ss.router("/"+this.props.config.campaignViewRoute,function(t){e.props.actions.showCampaignView(t.params.id,t.params.view)})},t.prototype.render=function(){var e=null;switch(this.props.view){case"show":e=this.renderItemListView();break;case"edit":e=this.renderDetailEditView();break;default:e=this.renderIndexView()}return e},t.prototype.renderIndexView=function(){var e=this.props.config.forms.editForm.schemaUrl;return d["default"].createElement("div",{className:"cms-middle no-preview"},d["default"].createElement("div",{className:"cms-campaigns collapse in","aria-expanded":"true"},d["default"].createElement(T["default"],null),d["default"].createElement(w["default"],{label:O["default"]._t("Campaigns.ADDCAMPAIGN"),icon:"plus-circled",handleClick:this.addCampaign}),d["default"].createElement(R["default"],{schemaUrl:e,createFn:this.createFn})))},t.prototype.renderItemListView=function(){var e={campaignId:this.props.campaignId,itemListViewEndpoint:this.props.config.itemListViewEndpoint};return d["default"].createElement(S["default"],e)},t.prototype.renderDetailEditView=function(){return d["default"].createElement("p",null,"Edit")},t.prototype.createFn=function(e,t){var r=this.props.config.campaignViewRoute;if("GridField"===t.component){var n=f({},t,{data:f({},t.data,{handleDrillDown:function(e,t){var n=r.replace(/:type\?/,"set").replace(/:id\?/,t.ID).replace(/:view\?/,"show");window.ss.router.show(n)}})});return d["default"].createElement(e,f({key:n.name},n))}return d["default"].createElement(e,f({key:t.name},t))},t.prototype.previewURLForItem=function(e){return e?document.getElementsByTagName("base")[0].href:""},t.prototype.addCampaign=function(){},t}(g["default"]);P.propTypes={config:d["default"].PropTypes.shape({forms:d["default"].PropTypes.shape({editForm:d["default"].PropTypes.shape({schemaUrl:d["default"].PropTypes.string})})}),sectionConfigKey:d["default"].PropTypes.string.isRequired},r["default"]=(0,y.connect)(u,l)(P)},{"./list":9,"components/form-action/index":5,"components/form-builder/index":"components/form-builder/index","components/north-header/index":"components/north-header/index",i18n:"i18n",react:"react","react-redux":"react-redux",redux:"redux","silverstripe-component":"silverstripe-component","state/campaign/actions":13}],7:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var o=e("jQuery"),i=n(o),a=e("react"),s=n(a),c=e("react-dom"),u=n(c),l=e("react-redux"),f=e("./controller"),p=n(f);i["default"].entwine("ss",function(e){e(".cms-content.CampaignAdmin").entwine({onadd:function(){u["default"].render(s["default"].createElement(l.Provider,{store:window.store},s["default"].createElement(p["default"],{sectionConfigKey:"CampaignAdmin"})),this[0])},onremove:function(){u["default"].unmountComponentAtNode(this[0])}})})},{"./controller":6,jQuery:"jQuery",react:"react","react-dom":"react-dom","react-redux":"react-redux"}],8:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var o=r[n],i=Object.getOwnPropertyDescriptor(t,o);i&&i.configurable&&void 0===e[o]&&Object.defineProperty(e,o,i)}return e}function i(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 s(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):o(e,t))}Object.defineProperty(r,"__esModule",{value:!0});var c=e("react"),u=n(c),l=e("silverstripe-component"),f=n(l),p=function(e){function t(){return i(this,t),a(this,e.apply(this,arguments))}return s(t,e),t.prototype.render=function(){var e="",t="",r=this.props.item;switch(r.ChangeType){case"created":t=u["default"].createElement("span",{className:"label label-warning"},"Draft");break;case"modified":t=u["default"].createElement("span",{className:"label label-warning"},"Modified");break;case"deleted":t=u["default"].createElement("span",{className:"label label-error"},"Removed");break;case"none":default:t=u["default"].createElement("span",{className:"label label-success item_visible-hovered"},"Already published")}var n=u["default"].createElement("span",{className:"list-group-item__linked item_visible-hovered"},"[lk] 3 links");return r.Thumbnail&&(e=u["default"].createElement("span",{className:"item__thumbnail"},u["default"].createElement("img",{src:r.Thumbnail}))),u["default"].createElement("div",null,e,u["default"].createElement("h4",{className:"list-group-item-heading"},r.Title),n,t)},t}(f["default"]);r["default"]=p},{react:"react","silverstripe-component":"silverstripe-component"}],9:[function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var o=r[n],i=Object.getOwnPropertyDescriptor(t,o);i&&i.configurable&&void 0===e[o]&&Object.defineProperty(e,o,i)}return e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(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 c(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):i(e,t))}function u(e,t){var r=null;return e.records&&e.records.ChangeSet&&t.campaignId&&(r=e.records.ChangeSet.find(function(e){return e.ID===parseInt(t.campaignId,10)})),{record:r||[]}}function l(e){return{actions:(0,d.bindActionCreators)(m,e)}}Object.defineProperty(r,"__esModule",{value:!0});var f=e("react"),p=o(f),d=e("redux"),h=e("react-redux"),y=e("state/records/actions"),m=n(y),v=e("silverstripe-component"),b=o(v),g=e("components/accordion/index"),E=o(g),w=e("components/accordion/group"),_=o(w),O=e("components/accordion/item"),C=o(O),T=e("components/north-header/index"),j=o(T),R=e("./item"),x=o(R),S=e("./preview"),P=o(S),D=function(e){function t(){return a(this,t),s(this,e.apply(this,arguments))}return c(t,e),t.prototype.componentDidMount=function(){var t=this.props.itemListViewEndpoint.replace(/:id/,this.props.campaignId);e.prototype.componentDidMount.call(this),this.props.actions.fetchRecord("ChangeSet","get",t)},t.prototype.render=function(){var e=1,t=this.props.campaignId,r=this.previewURLForItem(e),n=this.groupItemsForSet(),o=r?"cms-middle with-preview":"cms-middle no-preview",i=[];return Object.keys(n).forEach(function(e){var r=n[e],o=r.items.length,a=[],s=o+" "+(1===o?r.singular:r.plural),c="Set_"+t+"_Group_"+e;r.items.forEach(function(e){var t="";"none"===e.ChangeType&&(t="list-group-item--published"),a.push(p["default"].createElement(C["default"],{key:e.ID,className:t},p["default"].createElement(x["default"],{item:e})))}),i.push(p["default"].createElement(_["default"],{key:c,groupid:c,title:s},a))}),p["default"].createElement("div",{className:o},p["default"].createElement("div",{className:"cms-campaigns collapse in","aria-expanded":"true"},p["default"].createElement(j["default"],null),p["default"].createElement("div",{className:"col-md-12 campaign-items"},p["default"].createElement(E["default"],null,i))),r&&p["default"].createElement(P["default"],{previewUrl:r}))},t.prototype.previewURLForItem=function(e){return e?document.getElementsByTagName("base")[0].href:""},t.prototype.groupItemsForSet=function(){var e={};if(!this.props.record||!this.props.record._embedded)return e;var t=this.props.record._embedded.ChangeSetItems;return t.forEach(function(t){var r=t.BaseClass;e[r]||(e[r]={singular:t.Singular,plural:t.Plural,items:[]}),e[r].items.push(t)}),e},t}(b["default"]);r["default"]=(0,h.connect)(u,l)(D)},{"./item":8,"./preview":10,"components/accordion/group":2,"components/accordion/index":3,"components/accordion/item":4,"components/north-header/index":"components/north-header/index",react:"react","react-redux":"react-redux",redux:"redux","silverstripe-component":"silverstripe-component","state/records/actions":19}],10:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){for(var r=Object.getOwnPropertyNames(t),n=0;n<r.length;n++){var o=r[n],i=Object.getOwnPropertyDescriptor(t,o);i&&i.configurable&&void 0===e[o]&&Object.defineProperty(e,o,i)}return e}function i(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 s(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):o(e,t))}Object.defineProperty(r,"__esModule",{value:!0});var c=e("react"),u=n(c),l=e("silverstripe-component"),f=n(l),p=function(e){function t(){return i(this,t),a(this,e.apply(this,arguments))}return s(t,e),t.prototype.render=function(){return u["default"].createElement("div",{className:"pages-preview"},u["default"].createElement("iframe",{src:this.props.previewUrl}))},t}(f["default"]);r["default"]=p},{react:"react","silverstripe-component":"silverstripe-component"}],11:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){var t=void 0,r=void 0;if(!(e.status>=200&&e.status<300))throw r=new Error(e.statusText),r.response=e,r;return t=e}Object.defineProperty(r,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c=e("isomorphic-fetch"),u=n(c),l=e("es6-promise"),f=n(l),p=e("qs"),d=n(p);f["default"].polyfill();var h=function(){function e(){i(this,e),this.fetch=u["default"]}return e.prototype.createEndpointFetcher=function(e){function t(e,t){switch(e){case"application/x-www-form-url-encoded":return d["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 r(e,t){switch(e){case"application/x-www-form-url-encoded":return d["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 n(e,t){return""===t?e:e.match(/\?/)?e+"&"+t:e+"?"+t}function i(e){return e.text().then(function(t){return r(e.headers.get("Content-Type"),t)})}function a(e,t){return Object.keys(t).reduce(function(r,n){var i=e[n];return!i||i.remove!==!0&&i.querystring!==!0?s(r,o({},n,t[n])):r},{})}function c(e,r,i){var a=arguments.length<=3||void 0===arguments[3]?{setFromData:!1}:arguments[3],c=r,u=Object.keys(i).reduce(function(t,r){var n=e[r],c=a.setFromData===!0&&!(n&&n.remove===!0),u=n&&n.querystring===!0&&n.remove!==!0;return c||u?s(t,o({},r,i[r])):t},{});return c=n(c,t("application/x-www-form-url-encoded",u)),c=Object.keys(e).reduce(function(t,r){var n=e[r].urlReplacement;return n?t.replace(n,i[r]):t},c)}var u=this,l=s({method:"get",payloadFormat:"application/x-www-form-url-encoded",responseFormat:"application/json",payloadSchema:{}},e),f={json:"application/json",urlencoded:"application/x-www-form-url-encoded"};return["payloadFormat","responseFormat"].forEach(function(e){f[l[e]]&&(l[e]=f[l[e]])}),function(e){var r={Accept:l.responseFormat,"Content-Type":l.payloadFormat},n=c(l.payloadSchema,l.url,e,{setFromData:"get"===l.method}),o=t(l.payloadFormat,a(l.payloadSchema,e)),s="get"===l.method?[n,r]:[n,o,r];return u[l.method].apply(u,s).then(i)}},e.prototype.get=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(e,{method:"get",credentials:"same-origin",headers:r,body:t}).then(a)},e.prototype.post=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],n={"Content-Type":"application/x-www-form-urlencoded"};return this.fetch(e,{method:"post",headers:s({},n,r),credentials:"same-origin",body:t}).then(a)},e.prototype.put=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(e,{method:"put",credentials:"same-origin",body:t,headers:r}).then(a)},e.prototype["delete"]=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(e,{method:"delete",credentials:"same-origin",body:t,headers:r}).then(a)},e}(),y=new h;r["default"]=y},{"es6-promise":24,"isomorphic-fetch":25,qs:27}],12:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]={SET_CAMPAIGN_ACTIVE_CHANGESET:"SET_CAMPAIGN_ACTIVE_CHANGESET"}},{}],13:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return{type:a["default"].SET_CAMPAIGN_ACTIVE_CHANGESET,payload:{campaignId:e,view:t}}}Object.defineProperty(r,"__esModule",{value:!0}),r.showCampaignView=o;var i=e("./action-types"),a=n(i)},{"./action-types":12}],14:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(){var e=arguments.length<=0||void 0===arguments[0]?l:arguments[0],t=arguments[1];switch(t.type){case u["default"].SET_CAMPAIGN_ACTIVE_CHANGESET:return(0,s["default"])(i({},e,{campaignId:t.payload.campaignId,view:t.payload.view}));default:return e}}Object.defineProperty(r,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a=e("deep-freeze"),s=n(a),c=e("./action-types"),u=n(c),l={campaignId:null,view:null};r["default"]=o},{"./action-types":12,"deep-freeze":"deep-freeze"}],15:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]={SET_CONFIG:"SET_CONFIG"}},{}],16:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return{type:a["default"].SET_CONFIG,payload:{config:e}}}Object.defineProperty(r,"__esModule",{value:!0}),r.setConfig=o;var i=e("./action-types"),a=n(i)},{"./action-types":15}],17:[function(e,t,r){"use strict";function n(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 u["default"].SET_CONFIG:return(0,s["default"])(i({},e,t.payload.config));default:return e}}Object.defineProperty(r,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a=e("deep-freeze"),s=n(a),c=e("./action-types"),u=n(c);r["default"]=o},{"./action-types":15,"deep-freeze":"deep-freeze"}],18:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["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"}},{}],19:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var r=["id"];return r.reduce(function(e,r){return e.replace(":"+r,t[r])},e)}function i(e,t,r){var n={recordType:e},i={Accept:"text/json"};return function(a){return a({type:u["default"].FETCH_RECORDS_REQUEST,payload:n}),f["default"][t.toLowerCase()](o(r,n),{},i).then(function(e){return e.json()}).then(function(t){a({type:u["default"].FETCH_RECORDS_SUCCESS,payload:{recordType:e,data:t}})})["catch"](function(t){a({type:u["default"].FETCH_RECORDS_FAILURE,payload:{error:t,recordType:e}})})}}function a(e,t,r){var n={recordType:e},i={Accept:"text/json"};return function(a){return a({type:u["default"].FETCH_RECORD_REQUEST,payload:n}),f["default"][t.toLowerCase()](o(r,n),{},i).then(function(e){return e.json()}).then(function(t){a({type:u["default"].FETCH_RECORD_SUCCESS,payload:{recordType:e,data:t}})})["catch"](function(t){a({type:u["default"].FETCH_RECORD_FAILURE,payload:{error:t,recordType:e}})})}}function s(e,t,r,n){var i={recordType:e,id:t};return function(a){return a({type:u["default"].DELETE_RECORD_REQUEST,payload:i}),f["default"][r.toLowerCase()](o(n,i)).then(function(){a({type:u["default"].DELETE_RECORD_SUCCESS,payload:{recordType:e,id:t}})})["catch"](function(r){a({type:u["default"].DELETE_RECORD_FAILURE,payload:{error:r,recordType:e,id:t}})})}}Object.defineProperty(r,"__esModule",{value:!0}),r.fetchRecords=i,r.fetchRecord=a,r.deleteRecord=s;var c=e("./action-types"),u=n(c),l=e("silverstripe-backend.js"),f=n(l)},{"./action-types":18,"silverstripe-backend.js":11}],20:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(){var e=arguments.length<=0||void 0===arguments[0]?f:arguments[0],t=arguments[1],r=void 0,n=void 0,i=void 0,s=void 0;switch(t.type){case l["default"].CREATE_RECORD:return(0,c["default"])(a({},e,{}));case l["default"].UPDATE_RECORD:return(0,c["default"])(a({},e,{}));case l["default"].DELETE_RECORD:return(0,c["default"])(a({},e,{}));case l["default"].FETCH_RECORDS_REQUEST:return e;case l["default"].FETCH_RECORDS_FAILURE:return e;case l["default"].FETCH_RECORDS_SUCCESS:return n=t.payload.recordType,r=t.payload.data._embedded[n+"s"],(0,c["default"])(a({},e,o({},n,r)));case l["default"].FETCH_RECORD_REQUEST:return e;case l["default"].FETCH_RECORD_FAILURE:return e;case l["default"].FETCH_RECORD_SUCCESS:return n=t.payload.recordType,i=t.payload.data,r=e[n]?e[n]:[],s=r.findIndex(function(e){return e.ID===i.ID}),s>-1?r[s]=i:r.push(i),(0,c["default"])(a({},e,o({},n,r)));case l["default"].DELETE_RECORD_REQUEST:return e;case l["default"].DELETE_RECORD_FAILURE:return e;case l["default"].DELETE_RECORD_SUCCESS:return n=t.payload.recordType,r=e[n].filter(function(e){return e.ID!==t.payload.id}),(0,c["default"])(a({},e,o({},n,r)));default:return e}}Object.defineProperty(r,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s=e("deep-freeze"),c=n(s),u=e("./action-types"),l=n(u),f={};r["default"]=i},{"./action-types":18,"deep-freeze":"deep-freeze"}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={SET_SCHEMA:"SET_SCHEMA"};r["default"]=n},{}],22:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(){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 l["default"].SET_SCHEMA:var r=t.payload.schema.schema_url;return(0,c["default"])(a({},e,o({},r,t.payload)));default:return e}}Object.defineProperty(r,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};r["default"]=i;var s=e("deep-freeze"),c=n(s),u=e("./action-types"),l=n(u),f=(0,c["default"])({})},{"./action-types":21,"deep-freeze":"deep-freeze"}],23:[function(e,t,r){function n(){l=!1,s.length?u=s.concat(u):f=-1,u.length&&o()}function o(){if(!l){var e=setTimeout(n);l=!0;for(var t=u.length;t;){for(s=u,u=[];++f<t;)s&&s[f].run();f=-1,t=u.length}s=null,l=!1,clearTimeout(e)}}function i(e,t){this.fun=e,this.array=t}function a(){}var s,c=t.exports={},u=[],l=!1,f=-1;c.nextTick=function(e){var t=new Array(arguments.length-1);
|
|
if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new i(e,t)),1!==u.length||l||setTimeout(o,0)},i.prototype.run=function(){this.fun.apply(null,this.array)},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=a,c.addListener=a,c.once=a,c.off=a,c.removeListener=a,c.removeAllListeners=a,c.emit=a,c.binding=function(e){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(e){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}},{}],24:[function(e,t,r){(function(r,n){(function(){"use strict";function o(e){return"function"==typeof e||"object"==typeof e&&null!==e}function i(e){return"function"==typeof e}function a(e){Q=e}function s(e){X=e}function c(){return function(){r.nextTick(d)}}function u(){return function(){q(d)}}function l(){var e=0,t=new W(d),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function f(){var e=new MessageChannel;return e.port1.onmessage=d,function(){e.port2.postMessage(0)}}function p(){return function(){setTimeout(d,1)}}function d(){for(var e=0;J>e;e+=2){var t=te[e],r=te[e+1];t(r),te[e]=void 0,te[e+1]=void 0}J=0}function h(){try{var t=e,r=t("vertx");return q=r.runOnLoop||r.runOnContext,u()}catch(n){return p()}}function y(e,t){var r=this,n=r._state;if(n===ie&&!e||n===ae&&!t)return this;var o=new this.constructor(v),i=r._result;if(n){var a=arguments[n-1];X(function(){F(n,o,a,i)})}else S(r,o,e,t);return o}function m(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var r=new t(v);return T(r,e),r}function v(){}function b(){return new TypeError("You cannot resolve a promise with itself")}function g(){return new TypeError("A promises callback cannot return that same promise.")}function E(e){try{return e.then}catch(t){return se.error=t,se}}function w(e,t,r,n){try{e.call(t,r,n)}catch(o){return o}}function _(e,t,r){X(function(e){var n=!1,o=w(r,t,function(r){n||(n=!0,t!==r?T(e,r):R(e,r))},function(t){n||(n=!0,x(e,t))},"Settle: "+(e._label||" unknown promise"));!n&&o&&(n=!0,x(e,o))},e)}function O(e,t){t._state===ie?R(e,t._result):t._state===ae?x(e,t._result):S(t,void 0,function(t){T(e,t)},function(t){x(e,t)})}function C(e,t,r){t.constructor===e.constructor&&r===re&&constructor.resolve===ne?O(e,t):r===se?x(e,se.error):void 0===r?R(e,t):i(r)?_(e,t,r):R(e,t)}function T(e,t){e===t?x(e,b()):o(t)?C(e,t,E(t)):R(e,t)}function j(e){e._onerror&&e._onerror(e._result),P(e)}function R(e,t){e._state===oe&&(e._result=t,e._state=ie,0!==e._subscribers.length&&X(P,e))}function x(e,t){e._state===oe&&(e._state=ae,e._result=t,X(j,e))}function S(e,t,r,n){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+ie]=r,o[i+ae]=n,0===i&&e._state&&X(P,e)}function P(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n,o,i=e._result,a=0;a<t.length;a+=3)n=t[a],o=t[a+r],n?F(r,n,o,i):o(i);e._subscribers.length=0}}function D(){this.error=null}function A(e,t){try{return e(t)}catch(r){return ce.error=r,ce}}function F(e,t,r,n){var o,a,s,c,u=i(r);if(u){if(o=A(r,n),o===ce?(c=!0,a=o.error,o=null):s=!0,t===o)return void x(t,g())}else o=n,s=!0;t._state!==oe||(u&&s?T(t,o):c?x(t,a):e===ie?R(t,o):e===ae&&x(t,o))}function I(e,t){try{t(function(t){T(e,t)},function(t){x(e,t)})}catch(r){x(e,r)}}function N(e){return new he(this,e).promise}function U(e){function t(e){T(o,e)}function r(e){x(o,e)}var n=this,o=new n(v);if(!K(e))return x(o,new TypeError("You must pass an array to race.")),o;for(var i=e.length,a=0;o._state===oe&&i>a;a++)S(n.resolve(e[a]),void 0,t,r);return o}function L(e){var t=this,r=new t(v);return x(r,e),r}function M(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function H(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function k(e){this._id=pe++,this._state=void 0,this._result=void 0,this._subscribers=[],v!==e&&("function"!=typeof e&&M(),this instanceof k?I(this,e):H())}function B(e,t){this._instanceConstructor=e,this.promise=new e(v),Array.isArray(t)?(this._input=t,this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?R(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&R(this.promise,this._result))):x(this.promise,this._validationError())}function G(){var e;if("undefined"!=typeof n)e=n;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var r=e.Promise;r&&"[object Promise]"===Object.prototype.toString.call(r.resolve())&&!r.cast||(e.Promise=de)}var V;V=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var q,Q,z,K=V,J=0,X=function(e,t){te[J]=e,te[J+1]=t,J+=2,2===J&&(Q?Q(d):z())},Y="undefined"!=typeof window?window:void 0,$=Y||{},W=$.MutationObserver||$.WebKitMutationObserver,Z="undefined"!=typeof r&&"[object process]"==={}.toString.call(r),ee="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,te=new Array(1e3);z=Z?c():W?l():ee?f():void 0===Y&&"function"==typeof e?h():p();var re=y,ne=m,oe=void 0,ie=1,ae=2,se=new D,ce=new D,ue=N,le=U,fe=L,pe=0,de=k;k.all=ue,k.race=le,k.resolve=ne,k.reject=fe,k._setScheduler=a,k._setAsap=s,k._asap=X,k.prototype={constructor:k,then:re,"catch":function(e){return this.then(null,e)}};var he=B;B.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},B.prototype._enumerate=function(){for(var e=this.length,t=this._input,r=0;this._state===oe&&e>r;r++)this._eachEntry(t[r],r)},B.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===ne){var o=E(e);if(o===re&&e._state!==oe)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(r===de){var i=new r(v);C(i,e,o),this._willSettleAt(i,t)}else this._willSettleAt(new r(function(t){t(e)}),t)}else this._willSettleAt(n(e),t)},B.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===oe&&(this._remaining--,e===ae?x(n,r):this._result[t]=r),0===this._remaining&&R(n,this._result)},B.prototype._willSettleAt=function(e,t){var r=this;S(e,void 0,function(e){r._settledAt(ie,t,e)},function(e){r._settledAt(ae,t,e)})};var ye=G,me={Promise:de,polyfill:ye};"function"==typeof define&&define.amd?define(function(){return me}):"undefined"!=typeof t&&t.exports?t.exports=me:"undefined"!=typeof this&&(this.ES6Promise=me),ye()}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:23}],25:[function(e,t,r){e("whatwg-fetch"),t.exports=self.fetch.bind(self)},{"whatwg-fetch":26}],26:[function(e,t,r){!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 r(e){return"string"!=typeof e&&(e=String(e)),e}function n(e){this.map={},e instanceof n?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 i(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function a(e){var t=new FileReader;return t.readAsArrayBuffer(e),i(t)}function s(e){var t=new FileReader;return t.readAsText(e),i(t)}function c(){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(a)},this.text=function(){var e=o(this);if(e)return e;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 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 u(e){var t=e.toUpperCase();return y.indexOf(t)>-1?t:e}function l(e,t){t=t||{};var r=t.body;if(l.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new n(e.headers)),this.method=e.method,this.mode=e.mode,r||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=e;if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new n(t.headers)),this.method=u(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function f(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}}),t}function p(e){var t=new n,r=e.getAllResponseHeaders().trim().split("\n");return r.forEach(function(e){var r=e.trim().split(":"),n=r.shift().trim(),o=r.join(":").trim();t.append(n,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 n?t.headers:new n(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){n.prototype.append=function(e,n){e=t(e),n=r(n);var o=this.map[e];o||(o=[],this.map[e]=o),o.push(n)},n.prototype["delete"]=function(e){delete this.map[t(e)]},n.prototype.get=function(e){var r=this.map[t(e)];return r?r[0]:null},n.prototype.getAll=function(e){return this.map[t(e)]||[]},n.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},n.prototype.set=function(e,n){this.map[t(e)]=[r(n)]},n.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(n){e.call(t,n,r,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"];l.prototype.clone=function(){return new l(this)},c.call(l.prototype),c.call(d.prototype),d.prototype.clone=function(){return new d(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new n(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(-1===m.indexOf(t))throw new RangeError("Invalid status code");return new d(null,{status:t,headers:{location:e}})},e.Headers=n,e.Request=l,e.Response=d,e.fetch=function(e,t){return new Promise(function(r,n){function o(){return"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0}var i;i=l.prototype.isPrototypeOf(e)&&!t?e:new l(e,t);var a=new XMLHttpRequest;a.onload=function(){var e=1223===a.status?204:a.status;if(100>e||e>599)return void n(new TypeError("Network request failed"));var t={status:e,statusText:a.statusText,headers:p(a),url:o()},i="response"in a?a.response:a.responseText;r(new d(i,t))},a.onerror=function(){n(new TypeError("Network request failed"))},a.open(i.method,i.url,!0),"include"===i.credentials&&(a.withCredentials=!0),"responseType"in a&&h.blob&&(a.responseType="blob"),i.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),a.send("undefined"==typeof i._bodyInit?null:i._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},{}],27:[function(e,t,r){"use strict";var n=e("./stringify"),o=e("./parse");t.exports={stringify:n,parse:o}},{"./parse":28,"./stringify":29}],28:[function(e,t,r){"use strict";var n=e("./utils"),o={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3,strictNullHandling:!1,plainObjects:!1,allowPrototypes:!1,allowDots:!1};o.parseValues=function(e,t){for(var r={},o=e.split(t.delimiter,t.parameterLimit===1/0?void 0:t.parameterLimit),i=0;i<o.length;++i){var a=o[i],s=-1===a.indexOf("]=")?a.indexOf("="):a.indexOf("]=")+1;if(-1===s)r[n.decode(a)]="",t.strictNullHandling&&(r[n.decode(a)]=null);else{var c=n.decode(a.slice(0,s)),u=n.decode(a.slice(s+1));Object.prototype.hasOwnProperty.call(r,c)?r[c]=[].concat(r[c]).concat(u):r[c]=u}}return r},o.parseObject=function(e,t,r){if(!e.length)return t;var n,i=e.shift();if("[]"===i)n=[],n=n.concat(o.parseObject(e,t,r));else{n=r.plainObjects?Object.create(null):{};var a="["===i[0]&&"]"===i[i.length-1]?i.slice(1,i.length-1):i,s=parseInt(a,10);!isNaN(s)&&i!==a&&String(s)===a&&s>=0&&r.parseArrays&&s<=r.arrayLimit?(n=[],n[s]=o.parseObject(e,t,r)):n[a]=o.parseObject(e,t,r)}return n},o.parseKeys=function(e,t,r){if(e){var n=r.allowDots?e.replace(/\.([^\.\[]+)/g,"[$1]"):e,i=/^([^\[\]]*)/,a=/(\[[^\[\]]*\])/g,s=i.exec(n),c=[];if(s[1]){if(!r.plainObjects&&Object.prototype.hasOwnProperty(s[1])&&!r.allowPrototypes)return;c.push(s[1])}for(var u=0;null!==(s=a.exec(n))&&u<r.depth;)u+=1,(r.plainObjects||!Object.prototype.hasOwnProperty(s[1].replace(/\[|\]/g,""))||r.allowPrototypes)&&c.push(s[1]);return s&&c.push("["+n.slice(s.index)+"]"),o.parseObject(c,t,r)}},t.exports=function(e,t){var r=t||{};if(r.delimiter="string"==typeof r.delimiter||n.isRegExp(r.delimiter)?r.delimiter:o.delimiter,r.depth="number"==typeof r.depth?r.depth:o.depth,r.arrayLimit="number"==typeof r.arrayLimit?r.arrayLimit:o.arrayLimit,r.parseArrays=r.parseArrays!==!1,r.allowDots="boolean"==typeof r.allowDots?r.allowDots:o.allowDots,r.plainObjects="boolean"==typeof r.plainObjects?r.plainObjects:o.plainObjects,r.allowPrototypes="boolean"==typeof r.allowPrototypes?r.allowPrototypes:o.allowPrototypes,r.parameterLimit="number"==typeof r.parameterLimit?r.parameterLimit:o.parameterLimit,r.strictNullHandling="boolean"==typeof r.strictNullHandling?r.strictNullHandling:o.strictNullHandling,""===e||null===e||"undefined"==typeof e)return r.plainObjects?Object.create(null):{};for(var i="string"==typeof e?o.parseValues(e,r):e,a=r.plainObjects?Object.create(null):{},s=Object.keys(i),c=0;c<s.length;++c){var u=s[c],l=o.parseKeys(u,i[u],r);a=n.merge(a,l,r)}return n.compact(a)}},{"./utils":30}],29:[function(e,t,r){"use strict";var n=e("./utils"),o={delimiter:"&",arrayPrefixGenerators:{brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},strictNullHandling:!1,skipNulls:!1,encode:!0};o.stringify=function(e,t,r,i,a,s,c,u,l){var f=e;if("function"==typeof c)f=c(t,f);else if(n.isBuffer(f))f=String(f);else if(f instanceof Date)f=f.toISOString();else if(null===f){if(i)return s?n.encode(t):t;f=""}if("string"==typeof f||"number"==typeof f||"boolean"==typeof f)return s?[n.encode(t)+"="+n.encode(f)]:[t+"="+f];var p=[];if("undefined"==typeof f)return p;var d;if(Array.isArray(c))d=c;else{var h=Object.keys(f);d=u?h.sort(u):h}for(var y=0;y<d.length;++y){var m=d[y];a&&null===f[m]||(p=Array.isArray(f)?p.concat(o.stringify(f[m],r(t,m),r,i,a,s,c,u,l)):p.concat(o.stringify(f[m],t+(l?"."+m:"["+m+"]"),r,i,a,s,c,u,l)))}return p},t.exports=function(e,t){var r,n,i=e,a=t||{},s="undefined"==typeof a.delimiter?o.delimiter:a.delimiter,c="boolean"==typeof a.strictNullHandling?a.strictNullHandling:o.strictNullHandling,u="boolean"==typeof a.skipNulls?a.skipNulls:o.skipNulls,l="boolean"==typeof a.encode?a.encode:o.encode,f="function"==typeof a.sort?a.sort:null,p="undefined"==typeof a.allowDots?!1:a.allowDots;"function"==typeof a.filter?(n=a.filter,i=n("",i)):Array.isArray(a.filter)&&(r=n=a.filter);var d=[];if("object"!=typeof i||null===i)return"";var h;h=a.arrayFormat in o.arrayPrefixGenerators?a.arrayFormat:"indices"in a?a.indices?"indices":"repeat":"indices";var y=o.arrayPrefixGenerators[h];r||(r=Object.keys(i)),f&&r.sort(f);for(var m=0;m<r.length;++m){var v=r[m];u&&null===i[v]||(d=d.concat(o.stringify(i[v],v,y,c,u,l,n,f,p)))}return d.join(s)}},{"./utils":30}],30:[function(e,t,r){"use strict";var n=function(){for(var e=new Array(256),t=0;256>t;++t)e[t]="%"+((16>t?"0":"")+t.toString(16)).toUpperCase();return e}();r.arrayToObject=function(e,t){for(var r=t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)"undefined"!=typeof e[n]&&(r[n]=e[n]);return r},r.merge=function(e,t,n){if(!t)return e;if("object"!=typeof t){if(Array.isArray(e))e.push(t);else{if("object"!=typeof e)return[e,t];e[t]=!0}return e}if("object"!=typeof e)return[e].concat(t);var o=e;return Array.isArray(e)&&!Array.isArray(t)&&(o=r.arrayToObject(e,n)),Object.keys(t).reduce(function(e,o){var i=t[o];return Object.prototype.hasOwnProperty.call(e,o)?e[o]=r.merge(e[o],i,n):e[o]=i,e},o)},r.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},r.encode=function(e){if(0===e.length)return e;for(var t="string"==typeof e?e:String(e),r="",o=0;o<t.length;++o){var i=t.charCodeAt(o);45===i||46===i||95===i||126===i||i>=48&&57>=i||i>=65&&90>=i||i>=97&&122>=i?r+=t.charAt(o):128>i?r+=n[i]:2048>i?r+=n[192|i>>6]+n[128|63&i]:55296>i||i>=57344?r+=n[224|i>>12]+n[128|i>>6&63]+n[128|63&i]:(o+=1,i=65536+((1023&i)<<10|1023&t.charCodeAt(o)),r+=n[240|i>>18]+n[128|i>>12&63]+n[128|i>>6&63]+n[128|63&i])}return r},r.compact=function(e,t){if("object"!=typeof e||null===e)return e;var n=t||[],o=n.indexOf(e);if(-1!==o)return n[o];if(n.push(e),Array.isArray(e)){for(var i=[],a=0;a<e.length;++a)"undefined"!=typeof e[a]&&i.push(e[a]);return i}for(var s=Object.keys(e),c=0;c<s.length;++c){var u=s[c];e[u]=r.compact(e[u],n)}return e},r.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},r.isBuffer=function(e){return null===e||"undefined"==typeof e?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},{}],31:[function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function o(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function i(e,t,r,i){switch("undefined"==typeof e?"undefined":o(e)){case"object":return"function"==typeof e[i]?e[i].apply(e,n(r)):e[i];case"function":return e(t);default:return e}}function a(){function e(){j.forEach(function(e,t){var r=e.started,o=e.startedTime,s=e.action,c=e.prevState,l=e.error,p=e.took,d=e.nextState,y=j[t+1];y&&(d=y.prevState,p=y.started-r);var v=w(s),b="function"==typeof f?f(function(){return d},s):f,g=u(o),E=T.title?"color: "+T.title(v)+";":null,_="action "+(m?g:"")+" "+v.type+" "+(h?"(in "+p.toFixed(2)+" ms)":"");try{b?T.title?a.groupCollapsed("%c "+_,E):a.groupCollapsed(_):T.title?a.group("%c "+_,E):a.group(_)}catch(O){a.log(_)}var C=i(n,v,[c],"prevState"),R=i(n,v,[v],"action"),x=i(n,v,[l,c],"error"),S=i(n,v,[d],"nextState");C&&(T.prevState?a[C]("%c prev state","color: "+T.prevState(c)+"; font-weight: bold",c):a[C]("prev state",c)),R&&(T.action?a[R]("%c action","color: "+T.action(v)+"; font-weight: bold",v):a[R]("action",v)),l&&x&&(T.error?a[x]("%c error","color: "+T.error(l,c)+"; font-weight: bold",l):a[x]("error",l)),S&&(T.nextState?a[S]("%c next state","color: "+T.nextState(d)+"; font-weight: bold",d):a[S]("next state",d));try{a.groupEnd()}catch(O){a.log("—— log end ——")}}),j.length=0}var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=t.level,n=void 0===r?"log":r,o=t.logger,a=void 0===o?console:o,s=t.logErrors,c=void 0===s?!0:s,f=t.collapsed,p=t.predicate,d=t.duration,h=void 0===d?!1:d,y=t.timestamp,m=void 0===y?!0:y,v=t.transformer,b=t.stateTransformer,g=void 0===b?function(e){return e}:b,E=t.actionTransformer,w=void 0===E?function(e){return e}:E,_=t.errorTransformer,O=void 0===_?function(e){return e}:_,C=t.colors,T=void 0===C?{title:function(){return"#000000"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}}:C;if("undefined"==typeof a)return function(){return function(e){return function(t){return e(t)}}};v&&console.error("Option 'transformer' is deprecated, use stateTransformer instead");var j=[];return function(t){var r=t.getState;return function(t){return function(n){if("function"==typeof p&&!p(r,n))return t(n);var o={};j.push(o),o.started=l.now(),o.startedTime=new Date,o.prevState=g(r()),o.action=n;var i=void 0;if(c)try{i=t(n)}catch(a){o.error=O(a)}else i=t(n);if(o.took=l.now()-o.started,o.nextState=g(r()),e(),o.error)throw o.error;return i}}}}var s=function(e,t){return new Array(t+1).join(e)},c=function(e,t){return s("0",t-e.toString().length)+e},u=function(e){return"@ "+c(e.getHours(),2)+":"+c(e.getMinutes(),2)+":"+c(e.getSeconds(),2)+"."+c(e.getMilliseconds(),3)},l="undefined"!=typeof performance&&"function"==typeof performance.now?performance:Date;t.exports=a},{}]},{},[1]);
|
|
//# sourceMappingURL=bundle-framework.js.map
|