From 5422e28635cec8f285eb422fa85f57f4418c09b8 Mon Sep 17 00:00:00 2001 From: Luke Edwards Date: Mon, 1 Oct 2018 15:56:08 +1300 Subject: [PATCH] BUG Folder sort incorrect --- client/dist/js/bundle.js | 2 +- .../src/containers/AssetAdmin/AssetAdmin.js | 20 +++++++--------- code/GraphQL/FolderTypeCreator.php | 13 ----------- tests/php/GraphQL/FolderTypeCreatorTest.php | 23 ------------------- 4 files changed, 9 insertions(+), 49 deletions(-) diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index 489a635da..261c97d04 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1 +1 @@ -!function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var o={};t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./client/src/bundles/bundle.js")}({"./client/src/boot/applyTransform.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(2),s=n(r),l=o("./client/src/transforms/AssetAdmin/insertAssetModal.js"),i=n(l),a=o("./client/src/transforms/FormAction/ownerAwareUnpublish.js"),d=n(a),u=o("./client/src/transforms/TreeDropdownField/moveTreeDropdownField.js"),c=n(u),p=function(){s.default.transform("insert-media-modal",function(e){e.form.alterSchema("AssetAdmin.EditForm.fileInsertForm",i.default)}),s.default.transform("move-form-disabled",function(e){e.component("TreeDropdownField.AssetAdmin.MoveForm",c.default)}),s.default.transform("owner-unpublishing",function(e){e.component("FormAction.AssetAdmin.EditForm.action_unpublish",d.default)})};t.default=p},"./client/src/boot/index.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var r=o(20),s=n(r),l=o(34),i=n(l),a=o("./client/src/containers/AssetAdmin/AssetAdminRouter.js"),d=n(a),u=o("./client/src/boot/applyTransform.js"),c=n(u),p=o("./client/src/boot/registerReducers.js"),f=n(p),h=o("./client/src/boot/registerComponents.js"),m=n(h),_=o("./client/src/boot/registerQueries.js"),g=n(_);document.addEventListener("DOMContentLoaded",function(){(0,m.default)(),(0,c.default)();var e=s.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdmin");i.default.add({path:e.url,component:d.default,indexRoute:{component:d.default},childRoutes:[{path:"show/:folderId/:viewAction/:fileId",component:d.default},{path:"show/:folderId/:viewAction",component:d.default},{path:"show/:folderId",component:d.default}]}),(0,g.default)(),(0,f.default)()})},"./client/src/boot/registerComponents.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(2),s=n(r),l=o("./client/src/components/UploadField/UploadField.js"),i=n(l),a=o("./client/src/components/UploadField/UploadFieldItem.js"),d=n(a),u=o("./client/src/components/AssetDropzone/AssetDropzone.js"),c=n(u),p=o(10),f=n(p),h=o("./client/src/components/PreviewImageField/PreviewImageField.js"),m=n(h),_=o("./client/src/components/ProportionConstraintField/ProportionConstraintField.js"),g=n(_),y=o("./client/src/containers/HistoryList/HistoryList.js"),v=n(y),b=o("./client/src/components/GalleryToolbar/GalleryToolbar.js"),E=n(b),j=o("./client/src/components/GalleryItem/GalleryItem.js"),S=function(){s.default.component.registerMany({UploadField:i.default,UploadFieldItem:d.default,PreviewImageField:m.default,HistoryList:v.default,ProportionConstraintField:g.default,AssetDropzone:c.default,InsertMediaModal:f.default,GalleryToolbar:E.default,GalleryItemFile:j.File,GalleryItemFolder:j.Folder})};t.default=S},"./client/src/boot/registerQueries.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(2),r=function(e){return e&&e.__esModule?e:{default:e}}(n),s=o("./client/src/lib/fileFragments.js"),l=function(){r.default.query.registerFragment("FileInterfaceFields",s.fileInterface),r.default.query.registerFragment("FileFields",s.file),r.default.query.registerFragment("FolderFields",s.folder)};t.default=l},"./client/src/boot/registerReducers.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(2),s=n(r),l=o(4),i=o("./client/src/state/gallery/GalleryReducer.js"),a=n(i),d=o("./client/src/state/queuedFiles/QueuedFilesReducer.js"),u=n(d),c=o("./client/src/state/uploadField/UploadFieldReducer.js"),p=n(c),f=o("./client/src/state/previewField/PreviewFieldReducer.js"),h=n(f),m=o("./client/src/state/imageLoad/ImageLoadReducer.js"),_=n(m),g=function(){s.default.reducer.register("assetAdmin",(0,l.combineReducers)({gallery:a.default,queuedFiles:u.default,uploadField:p.default,previewField:h.default,imageLoad:_.default}))};t.default=g},"./client/src/bundles/bundle.js":function(e,t,o){"use strict";o("./node_modules/expose-loader/index.js?InsertMediaModal!./client/src/containers/InsertMediaModal/InsertMediaModal.js-exposed"),o("./node_modules/expose-loader/index.js?InsertEmbedModal!./client/src/components/InsertEmbedModal/InsertEmbedModal.js-exposed"),o("./client/src/boot/index.js"),o("./client/src/entwine/UploadField/UploadFieldEntwine.js")},"./client/src/components/AssetDropzone/AssetDropzone.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i=Object.assign||function(e){for(var t=1;t2});return t<2?p.default.createElement(m.Button,{className:o,key:e.value,onClick:this.handleChangeValue,value:e.value},e.label):p.default.createElement(m.DropdownItem,{type:"button",className:o,key:e.value,onClick:this.handleChangeValue,value:e.value},e.label)}},{key:"render",value:function(){var e=this;if(!this.props.items.length)return null;var t=this.props.actions.filter(function(t){return!t.canApply||t.canApply(e.props.items)});if(t=t.map(this.renderChild),!t.length)return null;var o=this.props,n=o.ActionMenu,r=o.showCount,s=this.props.items.length;return p.default.createElement("div",{className:"bulk-actions fieldholder-small"},r&&p.default.createElement("div",{className:"bulk-actions-counter"},s),t.slice(0,2),t.length>2&&n?p.default.createElement(n,{id:"BulkActions",className:"bulk-actions__more-actions-menu"},t.slice(2)):t.slice(2))}}]),t}(c.Component);y.propTypes={items:c.PropTypes.array,actions:c.PropTypes.arrayOf(c.PropTypes.shape({value:c.PropTypes.string.isRequired,label:c.PropTypes.string.isRequired,className:c.PropTypes.string,destructive:c.PropTypes.bool,callback:c.PropTypes.func,canApply:c.PropTypes.func,confirm:c.PropTypes.func})),ActionMenu:c.PropTypes.oneOfType([c.PropTypes.node,c.PropTypes.func]),showCount:c.PropTypes.bool},y.defaultProps={items:[],actions:[],ActionMenu:null,total:null,showCount:!0,totalReachedMessage:u.default._t("")};var v=(0,f.connect)(i)(y);t.Component=y,t.default=(0,h.inject)(["ActionMenu"],function(e){return{ActionMenu:e}},function(){return"BulkActions"})(v)},"./client/src/components/GalleryItem/GalleryItem.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function s(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function l(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 a(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 d(e){return e.item.thumbnail&&"image"===e.item.category&&e.item.exists&&!e.item.queuedId&&e.sectionConfig.imageRetry.minRetry&&e.sectionConfig.imageRetry.maxRetry}function u(e,t){if(d(t)){var o=e.assetAdmin.imageLoad,n=o.files.find(function(e){return t.item.thumbnail===e.url});return{loadState:n&&n.status||L.default.NONE}}return{loadState:L.default.DISABLED}}function c(e){return{actions:{imageLoad:(0,D.bindActionCreators)(R,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.File=t.Folder=t.Component=void 0;var p=Object.assign||function(e){for(var t=1;t0}},{key:"missing",value:function(){return!this.exists()&&this.saved()}},{key:"uploading",value:function(){return this.props.item.queuedId&&!this.saved()}},{key:"exists",value:function(){return this.props.item.exists}},{key:"isImage",value:function(){return"image"===this.props.item.category}},{key:"canBatchSelect",value:function(){return this.props.selectable&&this.props.item.canEdit}},{key:"hasError",value:function(){var e=!1;return this.props.item.message&&(e="error"===this.props.item.message.type),e}},{key:"handleActivate",value:function(e){e.stopPropagation(),"function"==typeof this.props.onActivate&&this.saved()&&this.props.onActivate(e,this.props.item)}},{key:"handleSelect",value:function(e){e.stopPropagation(),e.preventDefault(),"function"==typeof this.props.onSelect&&this.props.onSelect(e,this.props.item)}},{key:"handleKeyDown",value:function(e){E.default.SPACE_KEY_CODE===e.keyCode&&(e.preventDefault(),this.canBatchSelect()&&this.handleSelect(e)),E.default.RETURN_KEY_CODE===e.keyCode&&this.handleActivate(e)}},{key:"handleCancelUpload",value:function(e){e.stopPropagation(),e.preventDefault(),this.hasError()?this.props.onRemoveErroredUpload(this.props.item):this.props.onCancelUpload&&this.props.onCancelUpload(this.props.item)}},{key:"render",value:function(){var e=this,t=null,o=null,n=null,r=this.props.item,s=r.id,l=r.queuedId,i=s?"item-"+s:"queued-"+l;if(this.props.selectable&&(this.canBatchSelect()&&(t=this.handleSelect),o="font-icon-tick"),this.uploading())t=this.handleCancelUpload,o="font-icon-cancel";else if(this.exists()){var a=m.default._t("AssetAdmin.DETAILS","Details");n=g.default.createElement("div",{className:"gallery-item--overlay font-icon-edit"},a)}var d=this.props.badge,u={className:"gallery-item__checkbox",type:"checkbox",title:m.default._t("AssetAdmin.SELECT","Select"),tabIndex:-1,onMouseDown:U,id:i},c=["gallery-item__checkbox-label",o];this.canBatchSelect()||(u.disabled=!0,c.push("gallery-item__checkbox-label--disabled"));var f={className:c.join(" "),onClick:t};return g.default.createElement("div",{className:this.getItemClassNames(),"data-id":this.props.item.id,tabIndex:0,role:"button",onKeyDown:this.handleKeyDown,onClick:this.handleActivate},!!d&&g.default.createElement(F.default,{className:"gallery-item__badge",status:d.status,message:d.message}),g.default.createElement("div",{ref:function(t){e.thumbnail=t},className:this.getThumbnailClassNames(),style:this.getThumbnailStyles()},n,this.getStatusFlags()),this.getProgressBar(),this.getErrorMessage(),this.props.children,g.default.createElement("div",{className:"gallery-item__title",ref:function(t){e.title=t}},g.default.createElement("label",p({},f,{htmlFor:i}),g.default.createElement("input",u)),this.props.item.title))}}]),t}(_.Component);G.propTypes={sectionConfig:x.default,item:S.default,loadState:_.PropTypes.oneOf(Object.values(L.default)),highlighted:_.PropTypes.bool,selected:_.PropTypes.bool,isDropping:_.PropTypes.bool,isDragging:_.PropTypes.bool,message:_.PropTypes.shape({value:_.PropTypes.string,type:_.PropTypes.string}),selectable:_.PropTypes.bool,onActivate:_.PropTypes.func,onSelect:_.PropTypes.func,onCancelUpload:_.PropTypes.func,onRemoveErroredUpload:_.PropTypes.func,badge:_.PropTypes.shape({status:_.PropTypes.string,message:_.PropTypes.string}),updateStatusFlags:_.PropTypes.func,updateProgressBar:_.PropTypes.func,updateErrorMessage:_.PropTypes.func},G.defaultProps={item:{},sectionConfig:{imageRetry:{}},updateStatusFlags:function(e){return e},updateProgressBar:function(e){return e},updateErrorMessage:function(e){return e}};var B=(0,A.connect)(u,c)(G),q=(0,k.createSelectable)((0,P.default)("GalleryItem")(B)),H=(0,k.createSelectable)((0,T.default)("GalleryItem")(q));t.Component=G,t.Folder=H,t.File=q,t.default=B},"./client/src/components/GalleryItem/GalleryItemDragLayer.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i=Object.assign||function(e){for(var t=1;t1?u.default.createElement("div",{key:"1",className:"gallery-item__drag-shadow"}):null,t>2?u.default.createElement("div",{key:"2",className:"gallery-item__drag-shadow gallery-item__drag-shadow--second"}):null];return u.default.createElement("div",{className:"gallery-item__drag-layer"},u.default.createElement("div",{className:"gallery-item__drag-layer-item",style:this.getOffset()},u.default.createElement("div",{className:"gallery-item__drag-layer-preview"},o,u.default.createElement(f.default,i({},e.props,{isDragging:!0}))),t>1?u.default.createElement(m.default,{className:"gallery-item__drag-layer-count",status:"info",message:""+t}):null))}}]),t}(d.Component);_.propTypes={item:d.PropTypes.object,offset:d.PropTypes.shape({x:d.PropTypes.number.isRequired,y:d.PropTypes.number.isRequired}),isDragging:d.PropTypes.bool.isRequired};var g=function(e){return{item:e.getItem(),offset:e.getInitialClientOffset(),dragged:e.getDifferenceFromInitialOffset(),isDragging:e.isDragging()}};t.default=(0,c.DragLayer)(g)(_)},"./client/src/components/GalleryItem/draggable.js":function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(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):e.__proto__=t)}function l(e){var t={canDrag:function(e){return e.canDrag},beginDrag:function(e){var t=e.item.id;"function"==typeof e.onDrag&&e.onDrag(!0,t);var o=e.selectedFiles.concat([]);return o.includes(t)||o.push(t),{selected:o,props:e}},endDrag:function(e){var t=e.item.id;"function"==typeof e.onDrag&&e.onDrag(!1,t)}},o=function(e,t){return{connectDragPreview:e.dragPreview(),connectDragSource:e.dragSource(),isDragging:t.isDragging()}},l=(0,u.DragSource)(e,t,o);return function(e){var t=function(t){function o(){return n(this,o),r(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return s(o,t),i(o,[{key:"componentDidMount",value:function(){this.props.connectDragPreview((0,c.getEmptyImage)(),{captureDraggingState:!0})}},{key:"render",value:function(){var t=this.props.connectDragSource,o=d.default.createElement(e,this.props);return t("string"==typeof o.type?o:d.default.createElement("div",{className:"gallery-item__draggable"},o))}}]),o}(a.Component);return t.propTypes={connectDragSource:a.PropTypes.func.isRequired,connectDragPreview:a.PropTypes.func.isRequired,item:a.PropTypes.shape({id:a.PropTypes.number.isRequired}).isRequired,onDrag:a.PropTypes.func,selectedFiles:a.PropTypes.arrayOf(a.PropTypes.number)},l(t)}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var o=0;o0&&r<100?f.default.createElement("div",{className:"preview-image-field__progress"},f.default.createElement("div",{className:"preview-image-field__progress-bar",style:{width:r+"%"}})):null,i=this.props.upload.message,a=null;return i?a=f.default.createElement("div",{className:"preview-image-field__message preview-image-field__message--"+i.type},i.value):100===r&&(a=f.default.createElement("div",{className:"preview-image-field__message preview-image-field__message--success"},c.default._t("AssetAdmin.REPlACE_FILE_SUCCESS","Upload successful, the file will be replaced when you Save."))),f.default.createElement("div",{className:"editor__thumbnail-container"},s||n,l,a)}},{key:"renderToolbar",value:function(){var e=this.canEdit();return this.props.data.url||e?f.default.createElement("div",{className:"preview-image-field__toolbar fill-height"},this.props.data.url?f.default.createElement("a",{href:this.props.data.url,target:"_blank",className:this.getButtonClasses("link")},"Open"):null,e?f.default.createElement("button",{id:"preview-replace-button",onClick:this.preventDefault,className:this.getButtonClasses("replace"),type:"button"},"Replace"):null,this.props.upload.progress||this.props.upload.message?f.default.createElement("button",{onClick:this.handleCancelUpload,className:this.getButtonClasses("remove"),type:"button"},"Remove"):null):null}},{key:"render",value:function(){var e=this.getDropzoneProps();if(this.canEdit())return f.default.createElement(m.default,e,this.renderImage(),this.renderToolbar());var t=["preview-image-field__container",this.props.className,this.props.extraClass];return f.default.createElement("div",{className:t.join(" ")},this.renderImage(),this.renderToolbar())}}]),t}(p.Component);O.propTypes={id:p.PropTypes.string.isRequired,name:p.PropTypes.string,className:p.PropTypes.string,extraClass:p.PropTypes.string,readOnly:p.PropTypes.bool,disabled:p.PropTypes.bool,onAutofill:p.PropTypes.func,formid:p.PropTypes.string,nameValue:p.PropTypes.string,data:p.PropTypes.shape({id:p.PropTypes.number,parentid:p.PropTypes.number,version:p.PropTypes.number,url:p.PropTypes.string,mock:p.PropTypes.bool,exists:p.PropTypes.bool,preview:p.PropTypes.string,category:p.PropTypes.string,nameField:p.PropTypes.string,uploadFileEndpoint:p.PropTypes.shape({url:p.PropTypes.string.isRequired,method:p.PropTypes.string.isRequired,payloadFormat:p.PropTypes.string}),initialValues:p.PropTypes.object}).isRequired,upload:p.PropTypes.shape({url:p.PropTypes.string,progress:p.PropTypes.number,xhr:p.PropTypes.object,category:p.PropTypes.string,message:p.PropTypes.shape({type:p.PropTypes.string.isRequired,value:p.PropTypes.string.isRequired})}),actions:p.PropTypes.object,securityID:p.PropTypes.string,confirm:p.PropTypes.func},O.defaultProps={extraClass:"",className:"",data:{},upload:{},confirm:function(e){return window.confirm(e)}},t.Component=O,t.default=(0,y.connect)(i,a)(O)},"./client/src/components/ProportionConstraintField/ProportionConstraintField.js":function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var l=function(){function e(e,t){for(var o=0;o0}function a(e,t){var o=e.form.formSchemas[t.searchFormSchemaUrl];if(!o||!o.name)return{formData:{}};var n=(0,w.default)((0,I.default)(e),o.name);return{formData:n&&n.values||{}}}function d(e){return{actions:{schema:(0,y.bindActionCreators)(S,e),reduxForm:(0,y.bindActionCreators)({reset:C.reset,initialize:C.initialize},e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.hasFilters=t.Component=void 0;var u=function(){function e(e,t){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:this.props;if("function"==typeof t.onChange){var o=t.files.filter(function(e){return e.id}).map(function(e){return e.id}),n={Files:o};t.onChange(e,{id:t.id,value:n})}}},{key:"handleUploadButton",value:function(e){e.preventDefault()}},{key:"handleAddShow",value:function(e){e.preventDefault(),this.setState({selecting:!0,selectingItem:null})}},{key:"handleHide",value:function(){this.setState({selecting:!1,selectingItem:null})}},{key:"handleAddInsert",value:function(e,t,o){return this.props.actions.uploadField.addFile(this.props.id,o),this.handleHide(),Promise.resolve({})}},{key:"handleInsertMany",value:function(e,t){var o=this;if(this.state.selectingItem)return void this.handleReplace(e,null,t[0]);t.forEach(function(t){o.handleAddInsert(e,null,t)})}},{key:"handleReplace",value:function(e,t,o){var n=this.state.selectingItem,r=this.props,s=r.id,l=r.actions.uploadField,i=l.addFile,a=l.removeFile;if(!n)throw new Error("Tried to replace a file when none was selected.");return a(s,n),i(s,o),this.handleHide(),Promise.resolve({})}},{key:"canEdit",value:function(){return!this.props.disabled&&!this.props.readOnly&&(this.props.data.canUpload||this.props.data.canAttach)}},{key:"canUpload",value:function(){return this.canEdit()&&this.props.data.canUpload}},{key:"canAttach",value:function(){return this.canEdit()&&this.props.data.canAttach}},{key:"renderDropzone",value:function(){var e=this.props.AssetDropzone;if(!this.props.data.createFileEndpoint)return null;var t={height:E.default.SMALL_THUMBNAIL_HEIGHT,width:E.default.SMALL_THUMBNAIL_WIDTH},o=this.getMaxFiles(),n={url:this.props.data.createFileEndpoint.url,method:this.props.data.createFileEndpoint.method,paramName:"Upload",maxFiles:o,thumbnailWidth:E.default.SMALL_THUMBNAIL_WIDTH,thumbnailHeight:E.default.SMALL_THUMBNAIL_HEIGHT},r=["uploadfield__dropzone"];if(0===o&&r.push("uploadfield__dropzone--hidden"),!this.canEdit())return this.props.files.length?null:_.default.createElement("p",null,h.default._t("AssetAdmin.EMPTY","No files"));var s=this.props.securityId,l=[];return this.canUpload()&&l.push(_.default.createElement("button",{key:"uploadbutton",type:"button",onClick:this.handleUploadButton,className:"uploadfield__upload-button"},h.default._t("AssetAdmin.BROWSE","Browse"))),this.canAttach()&&(l.length&&l.push(_.default.createElement("span",{key:"uploadjoin",className:"uploadfield__join"},h.default._t("AssetAdmin.OR","or"))),l.push(_.default.createElement("button",{key:"attachbutton",type:"button",onClick:this.handleAddShow,className:"uploadfield__add-button"},h.default._t("AssetAdmin.ADD_FILES","Add from files")))),_.default.createElement(e,{name:this.props.name,canUpload:this.canUpload(),uploadButton:!1,uploadSelector:".uploadfield__upload-button, .uploadfield__backdrop",folderId:this.props.data.parentid,onAddedFile:this.handleAddedFile,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:t,options:n,securityID:s,className:r.join(" ")},_.default.createElement("div",{className:"uploadfield__backdrop"}),_.default.createElement("span",{className:"uploadfield__droptext"},l))}},{key:"renderModal",value:function(){var e=this.props.InsertMediaModal,t=this.state,o=t.selecting,n=t.selectingItem,r=this.getMaxFiles(),s=this.getFolderId();return _.default.createElement(e,{title:!1,isOpen:o,onInsert:n?this.handleReplace:this.handleAddInsert,onClosed:this.handleHide,onInsertMany:this.handleInsertMany,maxFiles:n?1:r,type:"select",bodyClassName:"modal__dialog",className:"insert-media-react__dialog-wrapper",fileAttributes:n?{ID:n.id}:null,folderId:s})}},{key:"renderChild",value:function(e,t){var o=this.props.UploadFieldItem,n={key:e.id?"file-"+e.id:"queued-"+e.queuedId,item:e,name:this.props.name,onRemove:this.handleItemRemove,canEdit:this.canEdit(),onView:this.handleReplaceShow},r=this.props.getItemProps(n,t,this.props);return _.default.createElement(o,r)}},{key:"render",value:function(){return _.default.createElement("div",{className:"uploadfield"},this.renderDropzone(),this.props.files.map(this.renderChild),this.renderModal())}}]),t}(m.Component);O.propTypes={id:m.PropTypes.string.isRequired,name:m.PropTypes.string.isRequired,onChange:m.PropTypes.func,value:m.PropTypes.shape({Files:m.PropTypes.arrayOf(m.PropTypes.number)}),files:m.PropTypes.arrayOf(P.default),readOnly:m.PropTypes.bool,disabled:m.PropTypes.bool,data:m.PropTypes.shape({files:m.PropTypes.arrayOf(P.default),createFileEndpoint:m.PropTypes.shape({url:m.PropTypes.string.isRequired,method:m.PropTypes.string.isRequired,payloadFormat:m.PropTypes.string.isRequired}),multi:m.PropTypes.bool,parentid:m.PropTypes.number,canUpload:m.PropTypes.bool,canAttach:m.PropTypes.bool,maxFiles:m.PropTypes.number}),UploadFieldItem:m.PropTypes.oneOfType([m.PropTypes.node,m.PropTypes.func]),AssetDropzone:m.PropTypes.oneOfType([m.PropTypes.node,m.PropTypes.func]),InsertMediaModal:m.PropTypes.oneOfType([m.PropTypes.node,m.PropTypes.func]),getItemProps:m.PropTypes.func},O.defaultProps={value:{Files:[]},className:"",getItemProps:function(e){return e}};var F=(0,g.connect)(a,d)(O);t.Component=O,t.ConnectedUploadField=F,t.default=(0,y.compose)((0,v.inject)(["UploadFieldItem","AssetDropzone","InsertMediaModal"]),S.default)(F)},"./client/src/components/UploadField/UploadFieldItem.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i=function(){function e(e,t){for(var o=0;o0}},{key:"missing",value:function(){return!this.exists()&&this.saved()}},{key:"isImageSmallerThanThumbnail",value:function(){if(!this.isImage()||this.missing())return!1;var e=this.props.item.width,t=this.props.item.height;return t&&e&&t0}).length)return alert(r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_FOLDER","These folders contain files which are currently in use, you must move or delete their contents before you can delete the folder.")),void o("cancelled");var n=e.filter(function(e){return"folder"!==e.type&&e.inUseCount>0}),s=r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_CONFIRM","Are you sure you want to delete these files?");1===e.length&&1===n.length?s=r.default.sprintf(r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_SINGLE_CONFIRM","This file is currently used in %s place(s), are you sure you want to delete it?"),e[0].inUseCount):n.length>0&&(s=r.default.sprintf(r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_MULTI_CONFIRM","There are %s files currently in use, are you sure you want to delete these files?"),n.length)),n.length>0&&(s+="\n\n",s+=r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_WARNING","Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.")),confirm(s)?t():o("cancelled")})})},{value:"edit",label:r.default._t("AssetAdmin.BULK_ACTIONS_EDIT","Edit"),className:"font-icon-edit",destructive:!1,canApply:function(e){return 1===e.length},callback:null},{value:"move",label:r.default._t("AssetAdmin.BULK_ACTIONS_MOVE","Move"),className:"font-icon-folder-move",canApply:function(e){return e.every(function(e){return e&&e.canEdit})},destructive:!1,callback:null},{value:"publish",label:r.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH","Publish"),className:"font-icon-rocket",destructive:!1,callback:null,canApply:function(e){return e.some(function(e){return e&&!e.published})&&e.every(function(e){return e.canEdit&&"folder"!==e.type})},confirm:null},{value:"unpublish",label:r.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH","Unpublish"),className:"font-icon-cancel-circled",destructive:!1,callback:null,canApply:function(e){return e.some(function(e){return e.published})&&e.every(function(e){return e.canEdit&&"folder"!==e.type})},confirm:null},{value:"insert",label:r.default._t("AssetAdmin.BULK_ACTIONS_INSERT","Insert"),className:"font-icon-plus-circled btn-primary",destructive:!1,callback:null,canApply:function(e){return e.length},confirm:null}],BULK_ACTIONS_PLACEHOLDER:r.default._t("AssetAdmin.BULK_ACTIONS_PLACEHOLDER"),SPACE_KEY_CODE:32,RETURN_KEY_CODE:13,DEFAULT_PREVIEW:"framework/client/dist/images/app_icons/generic_92.png",MODAL_MOVE:"MODAL_MOVE"}},"./client/src/containers/AssetAdmin/AssetAdmin.js":function(e,t,o){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function s(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t1&&void 0!==arguments[1])||arguments[1];return b.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:this.props.securityId}}:{}))}},{key:"handleBackButtonClick",value:function(e){e.preventDefault(),this.props.actions.gallery.deselectFiles(),this.props.folder?this.handleOpenFolder(this.props.folder.parentId||0):this.handleOpenFolder(0)}},{key:"resetFile",value:function(e){e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId),this.props.fileId===e.id&&(this.handleCloseFile(),this.handleOpenFile(e.id))}},{key:"handleFolderIcon",value:function(e){e.preventDefault(),this.handleOpenFile(this.getFolderId())}},{key:"handleOpenFile",value:function(e){this.handleBrowse(this.getFolderId(),e,this.props.query)}},{key:"handleSubmitEditor",value:function(e,t,o){var n=this,r=null;if("action_insert"===t&&"select"===this.props.type){var s=this.getFiles(),l=s.find(function(t){return t.id===parseInt(e.ID,10)});return this.props.onInsertMany(null,[l]),Promise.resolve()}if("function"==typeof this.props.onSubmitEditor){var i=this.findFile(this.props.fileId);r=this.props.onSubmitEditor(e,t,o,i)}else r=o();if(!r)throw new Error("Promise was not returned for submitting");return r.then(function(e){return"action_createfolder"===t&&"admin"===n.props.type&&n.handleOpenFile(e.record.id),n.props.actions.files.readFiles().then(function(){return"action_createfolder"===t&&"admin"!==n.props.type&&n.handleOpenFolder(n.getFolderId()),e})})}},{key:"handleCloseFile",value:function(){this.handleBrowse(this.getFolderId(),null,this.props.query)}},{key:"handleOpenFolder",value:function(e){var t=Object.assign({},this.props.query);delete t.page,delete t.filter,this.handleBrowse(e,null,t)}},{key:"handleDelete",value:function(e){var t=this,o=e.map(function(e){var o=t.findFile(e);if(!o)throw new Error("File selected for deletion cannot be found: "+e);return o.queuedId&&t.props.actions.queuedFiles.removeQueuedFile(o.queuedId),o}),n=o.map(function(e){return e.id}),r=this.props.folder?this.props.folder.id:0;return this.props.actions.files.deleteFiles(n).then(function(e){var o=e.data.deleteFiles;return t.handleBrowse(r,null,t.props.query),o})}},{key:"doUnpublish",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.map(function(e){var o=t.findFile(e);if(!o)throw new Error("File selected for unpublishing cannot be found: "+e);if("folder"===o.type)throw new Error("Cannot unpublish folders");return o}),r=n.map(function(e){return e.id});return this.props.actions.files.unpublishFiles(r,o).then(function(e){var o=e.data.unpublishFiles,n=o.filter(function(e){return"File"===e.__typename}),r=o.filter(function(e){return"PublicationNotice"===e.__typename&&"HAS_OWNERS"===e.Type}),s=n.map(function(e){return t.resetFile(e),e}),l=r.slice(0,4),i=r.slice(5),a=l.map(function(e){return e.Message});if(i.length&&a.push(j.default.inject(j.default._t("AssetAdmin.BULK_OWNED_WARNING_REMAINING","And {count} other file(s)"),{count:i.length})),l.length){var d=[j.default.inject(j.default._t("AssetAdmin.BULK_OWNED_WARNING_HEADING","{count} file(s) are being used by other published content."),{count:r.length}),a.join("\n"),j.default._t("AssetAdmin.BULK_OWNED_WARNING_FOOTER","Unpublishing will only remove files from the published version of the content. They will remain on the draft version. Unpublish anyway?")];if(confirm(d.join("\n\n"))){var u=r.reduce(function(e,t){return e.concat(t.IDs)},[]);return t.doUnpublish(u,!0).then(function(e){return s.concat(e)})}}return s})}},{key:"handleUnpublish",value:function(e){var t=this;return this.doUnpublish(e).then(function(e){var o=t.props.fileId;t.props.actions.files.readFiles().then(function(){o&&e.find(function(e){return e.id===o})&&(t.handleCloseFile(),t.handleOpenFile(o))})})}},{key:"doPublish",value:function(e){var t=this,o=e.map(function(e){var o=t.findFile(e);if(!o)throw new Error("File selected for publishing cannot be found: "+e);if("folder"===o.type)throw new Error("Cannot publish folders");return o}),n=o.map(function(e){return e.id});return this.props.actions.files.publishFiles(n).then(function(e){return e.data.publishFiles.filter(function(e){return"File"===e.__typename}).map(function(e){return t.resetFile(e),e})})}},{key:"findFile",value:function(e){return this.getFiles().find(function(t){return t.id===parseInt(e,10)})}},{key:"handleUpload",value:function(){}},{key:"handleCreateFolder",value:function(){this.props.onBrowse(this.getFolderId(),null,this.props.query,X.default.ACTIONS.CREATE_FOLDER)}},{key:"handleMoveFilesSuccess",value:function(e,t){var o=this;this.props.queuedFiles.items.filter(function(e){return t.includes(e.id)}).forEach(function(e){e.queuedId&&o.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}),this.props.actions.gallery.deselectFiles(),this.props.actions.files.readFiles()}},{key:"renderGallery",value:function(){var e=this.props.sectionConfig,t=e.createFileEndpoint.url,o=e.createFileEndpoint.method,n=this.props.query&&parseInt(this.props.query.limit||e.limit,10),r=this.props.query&&parseInt(this.props.query.page||1,10),s=this.props.query&&this.props.query.sort,l=this.props.query&&this.props.query.view,i=this.props.query.filter||{};return _.default.createElement(k.default,{files:this.getFiles(),fileId:this.props.fileId,folderId:this.getFolderId(),folder:this.props.folder,type:this.props.type,limit:n,page:r,totalCount:this.props.filesTotalCount,view:l,filters:i,graphQLErrors:this.props.graphQLErrors,createFileApiUrl:t,createFileApiMethod:o,onDelete:this.handleDelete,onInsertMany:this.props.onInsertMany,onPublish:this.doPublish,onUnpublish:this.doUnpublish,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSuccessfulUpload:this.handleUpload,onCreateFolder:this.handleCreateFolder,onMoveFilesSuccess:this.handleMoveFilesSuccess,onClearSearch:this.handleClearSearch,onSort:this.handleSort,onSetPage:this.handleSetPage,onViewChange:this.handleViewChange,sort:s,sectionConfig:e,loading:this.props.loading,maxFilesSelect:this.props.maxFiles})}},{key:"renderEditor",value:function(){var e=this.props.sectionConfig,t=d({config:e,viewAction:this.props.viewAction,folderId:this.getFolderId(),type:this.props.type,fileId:this.props.fileId}),o=t.schemaUrl,n=t.targetId;return o?_.default.createElement(A.default,{className:this.props.dialog?"editor--dialog":"",targetId:n,file:this.findFile(n),onClose:this.handleCloseFile,schemaUrl:o,schemaUrlQueries:this.props.requireLinkText?[{name:"requireLinkText",value:!0}]:[],onSubmit:this.handleSubmitEditor,onDelete:this.handleDelete,onUnpublish:this.handleUnpublish,addToCampaignSchemaUrl:e.form.addToCampaignForm.schemaUrl}):null}},{key:"render",value:function(){var e=Boolean(this.props.folderId||(0,G.hasFilters)(this.props.query.filter)),t=this.props.sectionConfig.form.fileSearchForm.schemaUrl,o=this.props.query.filter||{},n=(0,C.default)("fill-height asset-admin","select"===this.props.type&&{"asset-admin--single-select":1===this.props.maxFiles,"asset-admin--multi-select":1!==this.props.maxFiles});return _.default.createElement("div",{className:n},_.default.createElement(L.default,{showBackButton:e,onBackButtonClick:this.handleBackButtonClick},_.default.createElement(R.default,{multiline:!0}),_.default.createElement("div",{className:"asset-admin__toolbar-extra pull-xs-right fill-width vertical-align-items"},_.default.createElement(B.default,{onSearch:this.handleDoSearch,id:"AssetSearchForm",searchFormSchemaUrl:t,folderId:this.getFolderId(),filters:o}),this.props.toolbarChildren)),_.default.createElement("div",{className:"flexbox-area-grow fill-width fill-height gallery"},this.renderGallery(),this.renderEditor()))}}]),t}(m.Component);ee.propTypes={dialog:m.PropTypes.bool,sectionConfig:J.default,fileId:m.PropTypes.number,folderId:m.PropTypes.number,onBrowse:m.PropTypes.func,onReplaceUrl:m.PropTypes.func,onInsertMany:m.PropTypes.func,graphQLErrors:m.PropTypes.arrayOf(m.PropTypes.string),getUrl:m.PropTypes.func,query:m.PropTypes.shape({sort:m.PropTypes.string,limit:m.PropTypes.oneOfType([m.PropTypes.number,m.PropTypes.string]),page:m.PropTypes.oneOfType([m.PropTypes.number,m.PropTypes.string]),filter:m.PropTypes.object}),onSubmitEditor:m.PropTypes.func,type:m.PropTypes.oneOf(["insert-media","insert-link","select","admin"]),files:m.PropTypes.array,queuedFiles:m.PropTypes.shape({items:m.PropTypes.array.isRequired}),filesTotalCount:m.PropTypes.number,folder:m.PropTypes.shape({id:m.PropTypes.number,title:m.PropTypes.string,parents:m.PropTypes.array,parentId:m.PropTypes.number,canView:m.PropTypes.bool,canEdit:m.PropTypes.bool}),loading:m.PropTypes.bool,actions:m.PropTypes.object,maxFiles:m.PropTypes.number},ee.defaultProps={type:"admin",query:{sort:"",limit:null,page:0,filter:{}},maxFiles:null},t.Component=ee,t.getFormSchema=d,t.default=(0,y.compose)((0,g.connect)(c,p),H.default,V.default,K.default,$.default,function(e){return(0,U.withApollo)(e)})(ee)},"./client/src/containers/AssetAdmin/AssetAdminRouter.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i(e){var t=e.base,o=e.folderId,n=e.fileId,r=e.query,s=e.action;if(s&&-1===C.indexOf(s))throw new Error("Invalid action provided: "+s);var l=null;return l=n?t+"/show/"+o+"/"+b.default.ACTIONS.EDIT_FILE+"/"+n:o?t+"/show/"+o:t+"/",s===b.default.ACTIONS.CREATE_FOLDER&&(l=t+"/show/"+(o||0)+"/"+s),r&&Object.keys(r).length>0&&(l=l+"?"+y.default.stringify(r)),l}function a(e){return{sectionConfig:e.config.sections.find(function(e){return e.name===S})}}Object.defineProperty(t,"__esModule",{value:!0}),t.buildUrl=t.Component=void 0;var d=function(){function e(e,t){for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:b.default.ACTIONS.EDIT_FILE,r=parseInt(e||0,10),s=parseInt(t||0,10),l=r!==this.getFolderId(),a=Object.assign({},o);return(l||a.page<=1)&&delete a.page,i({base:this.props.sectionConfig.url,folderId:r,fileId:s,query:a,action:n})}},{key:"getFolderId",value:function(){return this.props.params&&this.props.params.folderId?parseInt(this.props.params.folderId,10):0}},{key:"getFileId",value:function(){return this.props.params&&this.props.params.fileId?parseInt(this.props.params.fileId,10):0}},{key:"getViewAction",value:function(){return this.props.params&&this.props.params.viewAction?this.props.params.viewAction:b.default.ACTIONS.EDIT_FILE}},{key:"getSectionProps",value:function(){return{sectionConfig:this.props.sectionConfig,type:"admin",folderId:this.getFolderId(),viewAction:this.getViewAction(),fileId:this.getFileId(),query:this.getQuery(),getUrl:this.getUrl,onBrowse:this.handleBrowse,onReplaceUrl:this.handleReplaceUrl}}},{key:"getQuery",value:function(){return(0,_.decodeQuery)(this.props.location.search)}},{key:"handleBrowse",value:function(e,t,o,n){var r=this.getUrl(e,t,o,n);this.props.router.push(r)}},{key:"handleReplaceUrl",value:function(e,t,o,n){var r=this.getUrl(e,t,o,n);this.props.router.replace(r)}},{key:"render",value:function(){return this.props.sectionConfig?c.default.createElement(m.default,this.getSectionProps()):null}}]),t}(u.Component);P.propTypes={sectionConfig:j.default,location:u.PropTypes.shape({pathname:u.PropTypes.string,query:u.PropTypes.object,search:u.PropTypes.string}),params:u.PropTypes.object,router:u.PropTypes.object},t.Component=P,t.buildUrl=i,t.default=(0,f.withRouter)((0,p.connect)(a)(P))},"./client/src/containers/AssetAdmin/stateRouter.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i(e){function t(t){var o=t.config.sections.find(function(e){return e.name===m});return{Component:e,sectionConfig:o}}return(0,c.connect)(t)(g)}Object.defineProperty(t,"__esModule",{value:!0}),t.AssetAdminStateRouter=void 0;var a=function(){function e(e,t){for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h.default.ACTIONS.EDIT_FILE,r=parseInt(e||0,10),s=parseInt(t||0,10),l=this.getFolderId(),i=r!==l&&null!==l,a=Object.assign({},o);return(i||a.page<=1)&&delete a.page,(0,p.buildUrl)({base:this.props.sectionConfig.url,folderId:r,fileId:s,query:a,action:n})}},{key:"getFolderId",value:function(){return null===this.state.folderId?null:parseInt(this.state.folderId||0,10)}},{key:"getFileId",value:function(){return parseInt(this.state.fileId||this.props.fileId||0,10)}},{key:"getViewAction",value:function(){return this.state.action||h.default.ACTIONS.EDIT_FILE}},{key:"getSectionProps",value:function(){var e=Object.assign({},this.props,{folderId:this.getFolderId(),fileId:this.getFileId(),viewAction:this.getViewAction(),query:this.state.query,getUrl:this.getUrl,onBrowse:this.handleBrowse});return delete e.Component,e}},{key:"handleBrowse",value:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h.default.ACTIONS.EDIT_FILE;if(n&&-1===Object.values(h.default.ACTIONS).indexOf(n))throw new Error("Invalid action provided: "+n);this.setState({folderId:e,fileId:t,query:o,action:n})}},{key:"render",value:function(){var e=this.getSectionProps(),t=this.props.Component;return u.default.createElement(t,e)}}]),t}(d.Component);g.propTypes={Component:d.PropTypes.oneOfType([d.PropTypes.element,d.PropTypes.func]),sectionConfig:d.PropTypes.shape({url:d.PropTypes.string.isRequired}).isRequired,fileId:d.PropTypes.number},t.AssetAdminStateRouter=g,t.default=i},"./client/src/containers/Editor/Editor.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i(e){return{actions:{unsavedForms:(0,p.bindActionCreators)(j,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var a=function(){function e(e,t){for(var o=0;o0&&(n=u.default.sprintf(u.default._t("AssetAdmin.BULK_ACTIONS_DELETE_SINGLE_CONFIRM","This file is currently used in %s place(s), are you sure you want to delete it?"),this.props.file.inUseCount),n+="\n\n",n+=u.default._t("AssetAdmin.BULK_ACTIONS_DELETE_WARNING","Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.")),confirm(n)&&(this.props.actions.unsavedForms.removeFormChanged("AssetAdmin.EditForm"),this.props.onDelete([t.ID])),e.preventDefault()}}},{key:"handleCancelKeyDown",value:function(e){e.keyCode!==_.default.SPACE_KEY_CODE&&e.keyCode!==_.default.RETURN_KEY_CODE||this.handleClose(e)}},{key:"handleSubmit",value:function(e,t,o){return"function"==typeof this.props.onSubmit?this.props.onSubmit(e,t,o):o()}},{key:"handleClose",value:function(e){this.props.onClose(),this.closeModal(),e&&e.preventDefault()}},{key:"openModal",value:function(){this.setState({openModal:!0})}},{key:"closeModal",value:function(){this.setState({openModal:!1})}},{key:"handleLoadingError",value:function(e){this.setState({loadingForm:!1,loadingError:e.errors[0]})}},{key:"handleLoadingSuccess",value:function(){this.setState({loadingForm:!1,loadingError:null})}},{key:"handleFetchingSchema",value:function(){this.setState({loadingForm:!0})}},{key:"renderCancelButton",value:function(){return h.default.createElement("a",{role:"button",tabIndex:0,className:"btn btn--close-panel btn--no-text font-icon-cancel btn--icon-xl",onClick:this.handleClose,onKeyDown:this.handleCancelKeyDown,type:"button","aria-label":u.default._t("AssetAdmin.CANCEL")})}},{key:"render",value:function(){var e=this.props.schemaUrlQueries.map(function(e){return e.name+"="+e.value}).join("&").trim();e=e?"?"+e:"";var t=this.props.schemaUrl+"/"+this.props.targetId+e,o=this.props.addToCampaignSchemaUrl+"/"+this.props.targetId,n=["panel","form--no-dividers","editor"];this.props.className&&n.push(this.props.className);var r=null;if(this.state.loadingError){var s=this.state.loadingError.value;404===this.state.loadingError.code&&(s=u.default._t("AssetAdmin.FILE_MISSING","File cannot be found")),s||(s=u.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")),r=h.default.createElement("div",{className:"editor__file-preview-message--file-missing"},s)}var l=u.default._t("Admin.ADD_TO_CAMPAIGN","Add to campaign");return h.default.createElement("div",{className:n.join(" ")},h.default.createElement("div",{className:"editor__details fill-height"},h.default.createElement(y.default,{identifier:"AssetAdmin.EditForm",schemaUrl:t,afterMessages:this.renderCancelButton(),onSubmit:this.handleSubmit,onAction:this.handleAction,onLoadingSuccess:this.handleLoadingSuccess,onLoadingError:this.handleLoadingError,onFetchingSchema:this.handleFetchingSchema}),r,h.default.createElement(b.default,{title:l,identifier:"AssetAdmin.AddToCampaign",isOpen:this.state.openModal,onClosed:this.closeModal,schemaUrl:o,bodyClassName:"modal__dialog",responseClassBad:"modal__response modal__response--error",responseClassGood:"modal__response modal__response--good"}),this.state.loadingForm&&[h.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),h.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})]))}}]),t}(f.Component);P.propTypes={file:C.default,className:f.PropTypes.string,targetId:f.PropTypes.number.isRequired,onClose:f.PropTypes.func.isRequired,onSubmit:f.PropTypes.func.isRequired,onDelete:f.PropTypes.func.isRequired,schemaUrl:f.PropTypes.string.isRequired,schemaUrlQueries:f.PropTypes.arrayOf(f.PropTypes.shape({name:f.PropTypes.string,value:f.PropTypes.any})),addToCampaignSchemaUrl:f.PropTypes.string,actions:f.PropTypes.object},t.Component=P,t.default=(0,c.connect)(function(){return{}},i)(P)},"./client/src/containers/Gallery/Gallery.js":function(e,t,o){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 a(e,t){var o=t.sort,n=e.assetAdmin.gallery,r=n.selectedFiles,s=n.errorMessage,l=n.noticeMessage,i=n.enableDropzone,a=n.badges,d=n.concatenateSelect,u=n.loading,c=n.sorters,p=n.lastSelected;return!o&&c&&c[0]&&(o=c[0].field+","+c[0].direction),{lastSelected:p,selectedFiles:r,errorMessage:s,noticeMessage:l,enableDropzone:i,badges:a,concatenateSelect:d,loading:t.loading||u,queuedFiles:e.assetAdmin.queuedFiles,securityId:e.config.SecurityID,sorters:c,sort:o}}function d(e){return{actions:{gallery:(0,w.bindActionCreators)(G,e),queuedFiles:(0,w.bindActionCreators)(q,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.galleryViewDefaultProps=t.galleryViewPropTypes=t.Component=void 0;var u=Object.assign||function(e){for(var t=1;t=s&&t<=l}).map(function(e){return e.id})}},{key:"getSelectableFiles",value:function(){var e=this.props.files.filter(function(e){return e.id});return"select"===this.props.type?e.filter(function(e){return"folder"!==e.type}):e}},{key:"handleBulkInsert",value:function(e,t){this.props.onInsertMany(e,t)}},{key:"handleBulkDelete",value:function(e,t){var o=this;return this.props.onDelete(t.map(function(e){return e.id})).then(function(e){var n=e.filter(function(e){return e}).length;n!==t.length?(o.props.actions.gallery.setErrorMessage(_.default.sprintf(_.default._t("AssetAdmin.BULK_ACTIONS_DELETE_FAIL","%s folders/files were successfully deleted, but %s files were not able to be deleted."),n,t.length-n)),o.props.actions.gallery.setNoticeMessage(null)):(o.props.actions.gallery.setNoticeMessage(_.default.sprintf(_.default._t("AssetAdmin.BULK_ACTIONS_DELETE_SUCCESS","%s folders/files were successfully deleted."),n)),o.props.actions.gallery.setErrorMessage(null),o.props.actions.gallery.deselectFiles())})}},{key:"handleBulkPublish",value:function(e,t){var o=this,n=t.map(function(e){return e.id});return n.length?(this.props.actions.gallery.setLoading(!0),this.props.onPublish(n).then(function(e){o.props.actions.gallery.setLoading(!1),o.props.actions.gallery.setNoticeMessage(_.default.sprintf(_.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH_SUCCESS","%s folders/files were successfully published."),e.length)),o.props.actions.gallery.setErrorMessage(null),o.props.actions.gallery.deselectFiles()})):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}},{key:"handleBulkUnpublish",value:function(e,t){var o=this,n=t.filter(function(e){return e.published}).map(function(e){return e.id});return n.length?(this.props.actions.gallery.setLoading(!0),this.props.onUnpublish(n).then(function(e){o.props.actions.gallery.setLoading(!1),o.props.actions.gallery.setNoticeMessage(_.default.sprintf(_.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH_SUCCESS","%s folders/files were successfully unpublished."),e.length)),o.props.actions.gallery.setErrorMessage(null),o.props.actions.gallery.deselectFiles()})):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}},{key:"initSortDropdown",value:function(){if("tile"===this.props.view){var e=this.getSortElement();e.chosen({allow_single_deselect:!0,disable_search_threshold:20}),e.off("change"),e.on("change",function(){return j.default.Simulate.click(e.find(":selected")[0])})}}},{key:"handleSort",value:function(e){this.props.actions.queuedFiles.purgeUploadQueue(),this.props.onSort(e)}},{key:"handleSetPage",value:function(e){this.props.onSetPage(e)}},{key:"handleCancelUpload",value:function(e){e.xhr.abort(),this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}},{key:"handleRemoveErroredUpload",value:function(e){this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}},{key:"handleAddedFile",value:function(e){this.props.actions.queuedFiles.addQueuedFile(e)}},{key:"handlePreviewLoaded",value:function(e,t){this.props.actions.queuedFiles.updateQueuedFile(e.queuedId,t)}},{key:"handleSending",value:function(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{xhr:t})}},{key:"handleUploadProgress",value:function(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{progress:t})}},{key:"handleSuccessfulUpload",value:function(e){var t=JSON.parse(e.xhr.response);if(void 0!==t[0].error)return void this.handleFailedUpload(e);if(this.props.actions.queuedFiles.succeedUpload(e._queuedId,t[0]),this.props.onSuccessfulUpload&&this.props.onSuccessfulUpload(t),"admin"!==this.props.type&&!this.props.fileId&&0===this.props.queuedFiles.items.length){var o=t.pop();this.props.onOpenFile(o.id)}}},{key:"handleFailedUpload",value:function(e,t){this.props.actions.queuedFiles.failUpload(e._queuedId,t)}},{key:"itemIsSelected",value:function(e){return this.props.selectedFiles.indexOf(e)>-1}},{key:"toggleSelectConcat",value:function(e){this.props.actions.gallery.setConcatenateSelect(this.isConcat(e))}},{key:"isConcat",value:function(e){return e.metaKey||e.ctrlKey||e.shiftKey}},{key:"itemIsHighlighted",value:function(e){return this.props.fileId===e}},{key:"hasOpenedItem",value:function(){return!!this.props.fileId}},{key:"handleClearSearch",value:function(e){this.props.onClearSearch(e)}},{key:"handleGroupSelect",value:function(e,t){var o=this,n=this.props.actions.gallery,r=n.setSelectedFiles,s=n.selectFiles,l=this.getSelectableFiles(),i=e.filter(function(t,o){return e.indexOf(t)===o&&l.find(function(e){return e.id===t})}),a=this.props.concatenateSelect||this.isConcat(t);if(null!==this.props.maxFilesSelect){var d=i.length;if(a&&(d=this.props.selectedFiles.filter(function(e){return!o.props.selectedFiles.includes(e)}).concat(this.props.selectedFiles).length),d>=this.props.maxFilesSelect)return}a?r(i):s(i)}},{key:"handleClearSelection",value:function(){this.props.actions.gallery.deselectFiles()}},{key:"handleOpenFolder",value:function(e,t){e.preventDefault(),this.props.actions.gallery.setErrorMessage(null),this.props.actions.gallery.setNoticeMessage(null),this.props.onOpenFolder(t.id)}},{key:"handleOpenFile",value:function(e,t){e.preventDefault(),null!==t.created&&(this.props.selectedFiles.length&&1!==this.props.maxFilesSelect||"select"!==this.props.type||this.handleSelect(e,t),this.props.onOpenFile(t.id,t))}},{key:"handleSelect",value:function(e,t){var o=this.props.maxFilesSelect,n=this.getSelectableFiles(),r=n.filter(function(e){return e.id===t.id}).map(function(e){return e.id});if(1===o)return void this.props.actions.gallery.setSelectedFiles(r);if(-1===this.props.selectedFiles.indexOf(t.id)){if(e.shiftKey&&(r=this.getSelection(this.props.lastSelected,t.id)),this.props.selectedFiles.filter(function(e){return!r.includes(e)}).concat(r).length>o&&null!==o)return;this.props.actions.gallery.selectFiles(r),this.props.actions.gallery.setLastSelected(t.id)}else this.props.actions.gallery.deselectFiles([t.id]),e.shiftKey&&this.props.actions.gallery.setLastSelected(null)}},{key:"handleEnableDropzone",value:function(e){this.props.actions.gallery.setEnableDropzone(e)}},{key:"handleMoveFiles",value:function(e,t){var o=this;this.props.actions.files.moveFiles(e,t).then(function(){var n=R.default.MOVE_SUCCESS_DURATION,r="+"+t.length;o.props.actions.gallery.setFileBadge(e,r,"success",n),"function"==typeof o.props.onMoveFilesSuccess&&o.props.onMoveFilesSuccess(e,t)}).catch(function(){o.props.actions.gallery.setErrorMessage(_.default._t("AssetAdmin.FAILED_MOVE","There was an error moving the selected items."))})}},{key:"handleBulkEdit",value:function(e,t){this.handleOpenFile(e,t[0])}},{key:"handleBulkMove",value:function(){this.props.actions.gallery.activateModal(R.default.MODAL_MOVE)}},{key:"renderSearchAlert",value:function(){var e=this.props.filters;if(!e||0===Object.keys(e).length)return null;var t=this.getSearchMessage(e);if(""===t)return null;var o=y.default.createElement("div",null,y.default.createElement("button",{onClick:this.handleClearSearch,className:"btn btn-info font-icon-cancel form-alert__btn--right"},_.default._t("AssetAdmin.SEARCHCLEARRESULTS","Clear results")),t);return y.default.createElement(L.default,{value:{react:o},type:"warning"})}},{key:"renderTransitionBulkActions",value:function(){return y.default.createElement(C.default,{transitionName:"bulk-actions",transitionEnterTimeout:R.default.CSS_TRANSITION_TIME,transitionLeaveTimeout:R.default.CSS_TRANSITION_TIME},this.renderBulkActions())}},{key:"renderBulkActions",value:function(){var e=this,t="select"===this.props.type?function(e){return"insert"===e.value}:function(e){return"insert"!==e.value},o=R.default.BULK_ACTIONS.filter(t).map(function(t){if(t.callback)return t;switch(t.value){case"delete":return u({},t,{callback:e.handleBulkDelete});case"edit":return u({},t,{callback:e.handleBulkEdit});case"move":return u({},t,{callback:e.handleBulkMove});case"publish":return u({},t,{callback:e.handleBulkPublish});case"unpublish":return u({},t,{callback:e.handleBulkUnpublish});case"insert":return u({},t,{callback:e.handleBulkInsert});default:return t}}),n=this.props.selectedFiles.map(function(t){return e.props.files.find(function(e){return e&&t===e.id})}).filter(function(e){return e});return n.length>0&&["admin","select"].includes(this.props.type)?y.default.createElement(I.default,{actions:o,items:n,total:this.props.maxFilesSelect,key:n.length>0,container:this.gallery,showCount:1!==this.props.maxFilesSelect}):null}},{key:"renderGalleryView",value:function(){var e=this,t="table"===this.props.view?k.default:A.default,o=this.props.files.map(function(t){return u({},t,{selected:e.itemIsSelected(t.id),highlighted:e.itemIsHighlighted(t.id)})}),n=this.props,r=n.type,s=n.loading,l=n.page,i=n.totalCount,a=n.limit,d=n.sort,c=n.selectedFiles,p=n.badges,f={selectableItems:["admin","select"].includes(r),selectableFolders:"select"!==this.props.type,files:o,loading:s,page:l,totalCount:i,limit:a,sort:d,selectedFiles:c,badges:p,onSort:this.handleSort,onSetPage:this.handleSetPage,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSelect:this.handleSelect,onCancelUpload:this.handleCancelUpload,onDropFiles:this.handleMoveFiles,onRemoveErroredUpload:this.handleRemoveErroredUpload,onEnableDropzone:this.handleEnableDropzone,sectionConfig:this.props.sectionConfig,canDrag:"admin"===this.props.type,maxFilesSelect:this.props.maxFilesSelect};return y.default.createElement(t,f)}},{key:"renderToolbar",value:function(){var e=this.props,t=e.GalleryToolbar,o=e.sort,n=e.view,r=e.folder,s=e.onCreateFolder,l=e.onOpenFolder,i=e.onViewChange,a={onMoveFiles:this.handleMoveFiles,onSort:this.handleSort,onCreateFolder:s,onOpenFolder:l,onViewChange:i,view:n,sort:o,folder:r};return y.default.createElement(t,a)}},{key:"render",value:function(){var e=this,t=this.props,o=t.folder,n=t.loading,r=t.errorMessage,s=t.graphQLErrors,l=t.noticeMessage,i=s&&s.length>0;if(!o)return r||i?y.default.createElement("div",{className:"gallery__error flexbox-area-grow"},y.default.createElement("div",{className:"gallery__error-message"},y.default.createElement("h3",null,_.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error.")),r&&y.default.createElement("p",null,r),i&&s.map(function(e,t){return y.default.createElement("p",{key:t},e)}))):n?y.default.createElement("div",{className:"flexbox-area-grow"},y.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),y.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})):y.default.createElement("div",{className:"flexbox-area-grow"},y.default.createElement("div",{className:"editor__file-preview-message--file-missing m-t-3"},_.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")));var a=y.default.createElement("div",{className:"gallery_messages"},r&&y.default.createElement(L.default,{value:r,type:"danger"}),l&&y.default.createElement(L.default,{value:l,type:"success"}),this.renderSearchAlert()),d={height:R.default.THUMBNAIL_HEIGHT,width:R.default.THUMBNAIL_WIDTH},c=u({url:this.props.createFileApiUrl,method:this.props.createFileApiMethod,paramName:"Upload",clickable:"#upload-button"},this.props.sectionConfig.dropzoneOptions),p=this.props.securityId,f=this.props.folder.canEdit&&this.props.enableDropzone,h=["panel","panel--padded","panel--scrollable","gallery__main","fill-height"];"insert"===this.props.type&&h.push("insert-media-modal__main");var m=h;return this.hasOpenedItem()&&m.push("gallery__main--has-opened-item"),y.default.createElement("div",{className:"flexbox-area-grow gallery__outer",ref:function(t){e.gallery=t}},this.renderTransitionBulkActions(),y.default.createElement(Q.default,{className:h.join(" ")},this.renderToolbar(),y.default.createElement(W.SelectableGroup,{enabled:"tile"===this.props.view&&"admin"===this.props.type,className:"flexbox-area-grow fill-height gallery__main--selectable",onSelection:this.handleGroupSelect,onNonItemClick:this.handleClearSelection,preventDefault:!1,fixedPosition:!0},y.default.createElement(O.default,{name:"gallery-container",className:"flexbox-area-grow",canUpload:f,onAddedFile:this.handleAddedFile,onPreviewLoaded:this.handlePreviewLoaded,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:d,folderId:this.props.folderId,options:c,securityID:p,uploadButton:!1},a,this.renderGalleryView()))),this.props.loading&&[y.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),y.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})],y.default.createElement(Z.default,{sectionConfig:this.props.sectionConfig,folderId:this.props.folderId,onSuccess:this.props.onMoveFilesSuccess,onOpenFolder:this.props.onOpenFolder}))}}]),t}(g.Component),te={page:1,limit:15},oe={sectionConfig:Y.default,loading:g.PropTypes.bool,sort:g.PropTypes.string,files:g.PropTypes.arrayOf(g.PropTypes.shape({id:g.PropTypes.number,parent:g.PropTypes.shape({id:g.PropTypes.number})})).isRequired,selectedFiles:g.PropTypes.arrayOf(g.PropTypes.number),totalCount:g.PropTypes.number,page:g.PropTypes.number,limit:g.PropTypes.number,badges:g.PropTypes.arrayOf(g.PropTypes.shape({id:g.PropTypes.number,message:g.PropTypes.node,status:g.PropTypes.string})),onOpenFile:g.PropTypes.func.isRequired,onOpenFolder:g.PropTypes.func.isRequired,onSort:g.PropTypes.func.isRequired,onSetPage:g.PropTypes.func.isRequired,maxFilesSelect:g.PropTypes.number},ne=Object.assign({},te,{selectableItems:!1}),re=Object.assign({},oe,{selectableItems:g.PropTypes.bool,selectableFolders:g.PropTypes.bool,onSelect:g.PropTypes.func,onCancelUpload:g.PropTypes.func,onDelete:y.default.PropTypes.func,onRemoveErroredUpload:g.PropTypes.func,onEnableDropzone:g.PropTypes.func});ee.defaultProps=Object.assign({},te,{type:"admin",view:"tile",enableDropzone:!0}),ee.propTypes=Object.assign({},oe,{onUploadSuccess:y.default.PropTypes.func,onCreateFolder:y.default.PropTypes.func,onMoveFilesSuccess:y.default.PropTypes.func,onDelete:y.default.PropTypes.func,onPublish:y.default.PropTypes.func,onUnpublish:y.default.PropTypes.func,type:g.PropTypes.oneOf(["insert-media","insert-link","select","admin"]),view:g.PropTypes.oneOf(["tile","table"]),lastSelected:g.PropTypes.number,dialog:g.PropTypes.bool,fileId:g.PropTypes.number,folderId:g.PropTypes.number.isRequired,folder:g.PropTypes.shape({id:g.PropTypes.number,title:g.PropTypes.string,parentId:g.PropTypes.number,canView:g.PropTypes.bool,canEdit:g.PropTypes.bool}),files:g.PropTypes.array,errorMessage:g.PropTypes.string,graphQLErrors:g.PropTypes.arrayOf(g.PropTypes.string),actions:g.PropTypes.object,securityId:g.PropTypes.string,onViewChange:g.PropTypes.func.isRequired,createFileApiUrl:g.PropTypes.string,createFileApiMethod:g.PropTypes.string,search:g.PropTypes.object,enableDropzone:g.PropTypes.bool,concatenateSelect:g.PropTypes.bool,GalleryToolbar:g.PropTypes.func,sorters:g.PropTypes.arrayOf(g.PropTypes.shape({field:g.PropTypes.string.isRequired,direction:g.PropTypes.oneOf(["asc","desc"]).isRequired,label:g.PropTypes.string.isRequired})).isRequired}),t.Component=ee,t.galleryViewPropTypes=re,t.galleryViewDefaultProps=ne,t.default=(0,w.compose)((0,J.inject)(["GalleryToolbar"],null,function(){return"AssetAdmin.Gallery"}),(0,P.connect)(a,d),z.default,function(e){return(0,V.withApollo)(e)})(ee)},"./client/src/containers/Gallery/GalleryDND.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i=function(){function e(e,t){for(var o=0;o1&&void 0!==arguments[1])||arguments[1];return h.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:_.default.get("SecurityID")}}:{}))},S=function(e){function t(e){r(this,t);var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.state={detailView:null,history:[],loadedDetails:!1},o.handleClick=o.handleClick.bind(o),o.handleBack=o.handleBack.bind(o),o.timer=null,o.api=j(e.sectionConfig.historyEndpoint),o}return l(t,e),d(t,[{key:"componentDidMount",value:function(){this.refreshHistoryIfNeeded()}},{key:"componentWillReceiveProps",value:function(e){this.refreshHistoryIfNeeded(e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timer),this.timer=null}},{key:"refreshHistoryIfNeeded",value:function(e){var t=this;if(!e&&!this.state.loadedDetails||e.data.fileId!==this.props.data.fileId||e.data.latestVersionId!==this.props.data.latestVersionId){this.setState({loadedDetails:!1});var o=e?e.data.fileId:this.props.data.fileId;clearTimeout(this.timer),this.timer=setTimeout(function(){t.api({fileId:o}).then(function(e){t.timer&&t.setState({history:e,loadedDetails:!0})})},250)}}},{key:"handleClick",value:function(e){this.setState({viewDetails:e})}},{key:"handleBack",value:function(e){e.preventDefault(),this.setState({viewDetails:null})}},{key:"render",value:function(){var e=this;if(!this.state.loadedDetails)return c.default.createElement("div",{className:"history-list history-list--loading"},"Loading...");if(this.state.viewDetails){var t=[this.props.historySchemaUrl,this.props.data.fileId,this.state.viewDetails].join("/"),o=["btn","btn-secondary","btn--icon-xl","btn--no-text","font-icon-left-open-big","history-list__back"].join(" ");return c.default.createElement("div",{className:"history-list"},c.default.createElement("a",{href:"#",className:o,onClick:this.handleBack}),c.default.createElement(b.default,{identifier:"AssetAdmin.HistoryList",schemaUrl:t}))}var n=this.state.history||[];return c.default.createElement("div",{className:"history-list"},c.default.createElement("ul",{className:"list-group list-group-flush history-list__list"},n.map(function(t){return c.default.createElement(y.default,a({key:t.versionid},t,{onClick:e.handleClick}))})))}}]),t}(u.Component);S.propTypes={sectionConfig:c.default.PropTypes.shape({form:c.default.PropTypes.object,historyEndpoint:c.default.PropTypes.shape({url:c.default.PropTypes.string,method:c.default.PropTypes.string,responseFormat:c.default.PropTypes.string})}),historySchemaUrl:c.default.PropTypes.string,data:c.default.PropTypes.object},S.defaultProps={data:{fieldId:0}},t.Component=S,t.default=(0,p.connect)(i)(S)},"./client/src/containers/MoveModal/MoveModal.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i(e){var t=e.assetAdmin.gallery,o=t.modal,n=t.selectedFiles;return{isOpen:o===g.default.MODAL_MOVE,selectedFiles:n,title:m.default.sprintf(m.default._t("AssetAdmin.MOVE_ITEMS_TO","Move %s item(s) to..."),n.length)}}function a(e){return{onClosed:function(){e((0,y.deactivateModal)())},setNotice:function(t){e((0,y.setNoticeMessage)(t))},setError:function(t){e((0,y.setErrorMessage)(t))},setBadge:function(){e(y.setFileBadge.apply(void 0,arguments))}}}Object.defineProperty(t,"__esModule",{value:!0});var d=function(){function e(e,t){for(var o=0;o0)return c.default.createElement("div",{className:"gallery__progress-bar--complete"});var t={className:"gallery__progress-bar-progress",style:{width:e.progress+"%"}};return c.default.createElement("div",{className:"gallery__progress-bar"},c.default.createElement("div",t))}},{key:"renderTitle",value:function(e){var t=this.renderProgressBar(e.rowData);return c.default.createElement("div",{className:"fill-width"},c.default.createElement("div",{className:"flexbox-area-grow"},e.data),t)}},{key:"renderSelect",value:function(e){if(this.props.selectableItems&&(this.props.selectableFolders||"folder"!==e.rowData.type)){var t={type:"checkbox",title:m.default._t("AssetAdmin.SELECT"),checked:e.data,tabIndex:-1,onMouseDown:this.preventFocus};return![null,1].includes(this.props.maxFilesSelect)&&this.props.selectedFiles.length>=this.props.maxFilesSelect&&!e.data&&(t.disabled=!0),c.default.createElement("input",t)}return null}},{key:"renderDate",value:function(e){return"folder"===e.rowData.type?null:c.default.createElement("span",null,e.data)}},{key:"renderThumbnail",value:function(e){var t=e.data||e.rowData.url,o=e.rowData.queuedId&&!e.rowData.id,n=e.rowData.category||"false",r="gallery__table-image",s=[r],l={};return s.push(r+"--"+n),"image"===n&&t&&(l.backgroundImage='url("'+t+'")'),o||t||"folder"===n||s.push(r+"--error"),c.default.createElement("div",{className:s.join(" "),style:l})}},{key:"render",value:function(){return c.default.createElement(f.default,this.getTableProps())}}]),t}(u.Component);y.defaultProps=_.galleryViewDefaultProps,y.propTypes=i({},_.galleryViewPropTypes,{sort:u.PropTypes.string.isRequired}),t.Component=y,t.default=y},"./client/src/containers/ThumbnailView/ThumbnailView.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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}),t.Component=void 0;var i=Object.assign||function(e){for(var t=1;t=this.props.maxFilesSelect,b=1===this.props.maxFilesSelect?c.onActivate:this.props.onSelect;c=i({},c,{selectable:!0,onSelect:b,maxSelected:v})}if("folder"===e.type){var E=this.props.onDropFiles;return c=i({},c,{onDropFiles:E}),p.default.createElement(n,c)}return p.default.createElement(o,c)}},{key:"render",value:function(){return p.default.createElement("div",{className:"gallery__main-view--tile"},p.default.createElement("div",{className:"gallery__folders"},this.props.files.filter(this.folderFilter).map(this.renderItem)),p.default.createElement("div",{className:"gallery__files"},this.props.files.filter(this.fileFilter).map(this.renderItem)),0===this.props.files.length&&!this.props.loading&&p.default.createElement("p",{className:"gallery__no-item-notice"},u.default._t("AssetAdmin.NOITEMSFOUND")),p.default.createElement("div",{className:"gallery__load"},this.renderPagination()))}}]),t}(c.Component);g.defaultProps=h.galleryViewDefaultProps,g.propTypes=i({},h.galleryViewPropTypes,{File:c.PropTypes.oneOfType([c.PropTypes.node,c.PropTypes.func]).isRequired,Folder:c.PropTypes.oneOfType([c.PropTypes.node,c.PropTypes.func]).isRequired});var y=(0,f.inject)(["GalleryItemFile","GalleryItemFolder"],function(e,t){return{File:e,Folder:t}},function(){return"AssetAdmin.Gallery.ThumbnailView"});t.Component=g,t.default=y(g)},"./client/src/entwine/UploadField/UploadFieldEntwine.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var r=Object.assign||function(e){for(var t=1;t');this.before(o),t=o[0]}return t},onunmatch:function(){this._super(),u.default.unmountComponentAtNode(this.siblings(".uploadfield-holder")[0])},onmatch:function(){var e=this.closest(".cms-content").attr("id"),t=e?{context:e}:{},o=(0,p.loadComponent)("UploadField",t);this.setComponent(o),this._super(),this.hide(),this.refresh()},onclick:function(e){e.preventDefault()},refresh:function(){var t=this.getAttributes(),o=e(this).closest("form"),n=function(){setTimeout(function(){o.trigger("change")},0)},s=this.getComponent();u.default.render(a.default.createElement(s,r({},t,{onChange:n,noHolder:!0})),this.getContainer())},getAttributes:function(){var t=e(this).data("state"),o=e(this).data("schema");return(0,c.schemaMerge)(o,t)}})})},"./client/src/lib/configShape.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(0),r=n.PropTypes.shape({url:n.PropTypes.string,limit:n.PropTypes.number,imageRetry:n.PropTypes.shape({minRetry:n.PropTypes.number,maxRetry:n.PropTypes.number,expiry:n.PropTypes.number}),form:n.PropTypes.object,dropzoneOptions:n.PropTypes.object});t.default=r},"./client/src/lib/fileFragments.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fileInterface="\n fragment FileInterfaceFields on FileInterface {\n canDelete\n canEdit\n canView\n category\n exists\n filename\n id\n lastEdited\n name\n parentId\n title\n type\n url\n }\n",t.file="\n fragment FileFields on File {\n draft\n extension\n published\n modified\n size\n smallThumbnail\n thumbnail\n inUseCount\n }\n",t.folder="\n fragment FolderFields on Folder {\n filesInUseCount\n }\n"},"./client/src/lib/fileShape.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(0),r=n.PropTypes.shape({canEdit:n.PropTypes.bool,canDelete:n.PropTypes.bool,canView:n.PropTypes.bool,exists:n.PropTypes.bool,type:n.PropTypes.string,smallThumbnail:n.PropTypes.string,thumbnail:n.PropTypes.string,width:n.PropTypes.number,height:n.PropTypes.number,category:n.PropTypes.oneOfType([n.PropTypes.bool,n.PropTypes.string]),id:n.PropTypes.number,inUseCount:n.PropTypes.number,url:n.PropTypes.string,title:n.PropTypes.string,progress:n.PropTypes.number});t.default=r},"./client/src/lib/fileStructure.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(13),r=function(e){return e&&e.__esModule?e:{default:e}}(n),s=(0,r.default)({name:null,canDelete:!1,canEdit:!1,category:null,created:null,extension:null,filename:null,id:0,lastEdited:null,messages:null,owner:{id:0,title:null},parent:{filename:null,id:0,title:null},queuedId:null,size:null,title:null,type:null,url:null,xhr:null,thumbnail:null,smallThumbnail:null,height:null,width:null});t.default=s},"./client/src/state/files/buildPublicationMutation.js":function(e,t,o){"use strict";function n(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return o({variables:{IDs:e,Quiet:n,Force:t}})};return{actions:r({},s,{files:r({},s.files,n({},e,l))})}}}}};t.default=d},"./client/src/state/files/deleteFilesMutation.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=t.mutation=void 0;var n=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:null;return function(t){return t({type:y.default.SELECT_FILES,payload:{ids:e}})}}function i(e){return function(t){return t({type:y.default.CONCATENATE_SELECT,payload:!!e})}}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(t){return t({type:y.default.DESELECT_FILES,payload:{ids:e}})}}function d(e){return function(t){return t({type:y.default.SET_NOTICE_MESSAGE,payload:{message:e}})}}function u(e){return function(t){return t({type:y.default.SET_ERROR_MESSAGE,payload:{message:e}})}}function c(e){return function(t){return t({type:y.default.SET_ENABLE_DROPZONE,payload:{enableDropzone:e}})}}function p(e){return function(t){t({type:y.default.CLEAR_FILE_BADGE,payload:{id:e}})}}function f(e,t,o,n){return function(r,s){var l=s(),i=l.assetAdmin,a=i.gallery.badges.find(function(t){return t.id===e});a&&a.timer&&clearTimeout(a.timer);var d=n>0?setTimeout(function(){return p(e)(r)},n):null;r({type:y.default.SET_FILE_BADGE,payload:{id:e,message:t,status:o,timer:d}})}}function h(e){return function(t){t({type:y.default.ACTIVATE_MODAL,payload:e})}}function m(){return function(e){e({type:y.default.DEACTIVATE_MODAL})}}function _(e){return function(t){t({type:y.default.SET_LOADING,payload:!!e})}}Object.defineProperty(t,"__esModule",{value:!0}),t.setLastSelected=n,t.setSelectedFiles=r,t.loadFile=s,t.selectFiles=l,t.setConcatenateSelect=i,t.deselectFiles=a,t.setNoticeMessage=d,t.setErrorMessage=u,t.setEnableDropzone=c,t.clearFileBadge=p,t.setFileBadge=f,t.activateModal=h,t.deactivateModal=m,t.setLoading=_;var g=o("./client/src/state/gallery/GalleryActionTypes.js"),y=function(e){return e&&e.__esModule?e:{default:e}}(g)},"./client/src/state/gallery/GalleryReducer.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.type,n=t.payload;switch(o){case d.default.SET_LAST_SELECTED:return s({},e,{lastSelected:n.id});case d.default.SET_FILE_BADGE:return s({},e,{badges:e.badges.filter(function(e){return e.id!==n.id}).concat([n])});case d.default.CLEAR_FILE_BADGE:return s({},e,{badges:e.badges.filter(function(e){return e.id!==n.id})});case d.default.SET_ENABLE_DROPZONE:return s({},e,{enableDropzone:n.enableDropzone});case d.default.SET_NOTICE_MESSAGE:return s({},e,{noticeMessage:n.message});case d.default.SET_ERROR_MESSAGE:return s({},e,{errorMessage:n.message});case d.default.LOAD_FILE_SUCCESS:var r=e.files.find(function(e){return e.id===n.id});if(r){var l=s({},r,n.file);return(0,i.default)(s({},e,{files:e.files.map(function(e){return e.id===l.id?l:e})}))}return e.folder.id===n.id?(0,i.default)(s({},e,{folder:s({},e.folder,n.file)})):e;case d.default.SET_SELECTED_FILES:return(0,i.default)(s({},e,{selectedFiles:Array.isArray(n.files)?n.files:[]}));case d.default.SELECT_FILES:var a=null;return a=null===n.ids?e.files.map(function(e){return e.id}):e.selectedFiles.concat(n.ids.filter(function(t){return-1===e.selectedFiles.indexOf(t)})),(0,i.default)(s({},e,{selectedFiles:a}));case d.default.DESELECT_FILES:var u=null;return u=null===n.ids?[]:e.selectedFiles.filter(function(e){return-1===n.ids.indexOf(e)}),(0,i.default)(s({},e,{selectedFiles:u}));case d.default.ACTIVATE_MODAL:return(0,i.default)(s({},e,{modal:n}));case d.default.DEACTIVATE_MODAL:return(0,i.default)(s({},e,{modal:null}));case d.default.CONCATENATE_SELECT:return(0,i.default)(s({},e,{concatenateSelect:n}));case d.default.SET_LOADING:return(0,i.default)(s({},e,{loading:n}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:p;r(this,e),this.options=s({},c,t),this.factory=o}return l(e,[{key:"loadImage",value:function(e){return this.options.minRetry&&u.default.lock(e)?this.loadImageLoop(e,this.options.minRetry):null}},{key:"loadImageLoop",value:function(e,t){var o=this;return this.options.onStatusChange(e,a.default.LOADING),new Promise(function(t,n){return o.factory(e,t,n)}).then(function(){return o.handleSuccess(e)}).catch(function(){return o.handleError(e,t)})}},{key:"handleReset",value:function(e,t){this.options.onReset(e),t()}},{key:"handleTimeout",value:function(e,t){var o=setTimeout(e,t);return this.options.onTimeout(o,t),o}},{key:"handleSuccess",value:function(e){u.default.unlock(e),this.options.onStatusChange(e,a.default.SUCCESS)}},{key:"handleFailure",value:function(e){var t=this;return u.default.unlock(e),this.options.onStatusChange(e,a.default.FAILED),this.options.expiry?new Promise(function(o){t.handleTimeout(function(){return t.handleReset(e,o)},1e3*t.options.expiry)}):null}},{key:"handleError",value:function(e,t){return t>this.options.maxRetry?this.handleFailure(e):(this.options.onStatusChange(e,a.default.WAITING),this.handleRetry(e,t))}},{key:"handleRetry",value:function(e,t){var o=this,n=new Promise(function(n){o.handleTimeout(function(){return n(o.loadImageLoop(e,2*t))},1e3*t)});return this.options.onRetry(e,t,n),n}},{key:"setOnRetry",value:function(e){this.options.onRetry=e}},{key:"setOnReset",value:function(e){this.options.onReset=e}},{key:"setOnStatusChange",value:function(e){this.options.onStatusChange=e}},{key:"setOnTimeout",value:function(e){this.options.onTimeout=e}}]),e}();t.defaultImageFactory=p,t.default=f},"./client/src/state/imageLoad/ImageLoadActionTypes.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={SET_STATUS:"IMAGE_LOAD_SET_STATUS",RESET:"IMAGE_LOAD_RESET"}},"./client/src/state/imageLoad/ImageLoadActions.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){return function(o,n){if(!e)return null;if(n().assetAdmin.imageLoad.files.find(function(t){return t.url===e}))return null;var r=s({},t,{onStatusChange:function(e,t){return o({type:i.default.SET_STATUS,payload:{status:t,url:e}})},onReset:function(e){return o({type:i.default.RESET,payload:{url:e}})}});return new d.default(r).loadImage(e)}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t=0||(this.urls=[].concat(n(this.urls),[e]),0))}},{key:"unlock",value:function(e){this.urls=this.urls.filter(function(t){return t!==e})}}]),e}();window.ss=window.ss||{},window.ss.imagelocker=window.ss.imagelocker||new l,t.Component=l,t.default=window.ss.imagelocker},"./client/src/state/imageLoad/ImageLoadReducer.js":function(e,t,o){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.type,r=t.payload;switch(o){case i.default.SET_STATUS:return s({},e,{files:[].concat(n(e.files.filter(function(e){return e.url!==r.url})),[r])});case i.default.RESET:return s({},e,{files:[].concat(n(e.files.filter(function(e){return e.url!==r.url})))});default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:u,t=arguments[1];switch(t.type){case d.default.PREVIEWFIELD_ADD_FILE:return(0,i.default)(Object.assign({},e,r({},t.payload.id,t.payload.file)));case d.default.PREVIEWFIELD_FAIL_UPLOAD:return(0,i.default)(Object.assign({},e,r({},t.payload.id,Object.assign({},e[t.payload.id],t.payload.message))));case d.default.PREVIEWFIELD_REMOVE_FILE:return(0,i.default)(Object.assign({},e,r({},t.payload.id,void 0)));case d.default.PREVIEWFIELD_UPDATE_FILE:return(0,i.default)(Object.assign({},e,r({},t.payload.id,Object.assign({},e[t.payload.id],t.payload.data))));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var l=o(13),i=n(l),a=o("./client/src/state/previewField/PreviewFieldActionTypes.js"),d=n(a),u={};t.default=s},"./client/src/state/queuedFiles/QueuedFilesActionTypes.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={ADD_QUEUED_FILE:"ADD_QUEUED_FILE",FAIL_UPLOAD:"FAIL_UPLOAD",PURGE_UPLOAD_QUEUE:"PURGE_UPLOAD_QUEUE",REMOVE_QUEUED_FILE:"REMOVE_QUEUED_FILE",SUCCEED_UPLOAD:"SUCCEED_UPLOAD",UPDATE_QUEUED_FILE:"UPDATE_QUEUED_FILE"}},"./client/src/state/queuedFiles/QueuedFilesActions.js":function(e,t,o){"use strict";function n(e){return function(t){return t({type:u.default.ADD_QUEUED_FILE,payload:{file:e}})}}function r(e,t){return function(o){var n=t.message;return t.errors&&t.errors.length&&(n=t.errors[0]),"string"==typeof t&&(n={value:t,type:"error"}),o({type:u.default.FAIL_UPLOAD,payload:{queuedId:e,message:n}})}}function s(){return function(e){return e({type:u.default.PURGE_UPLOAD_QUEUE,payload:null})}}function l(e){return function(t){return t({type:u.default.REMOVE_QUEUED_FILE,payload:{queuedId:e}})}}function i(e,t){return function(o){return o({type:u.default.SUCCEED_UPLOAD,payload:{queuedId:e,json:t}})}}function a(e,t){return function(o){return o({type:u.default.UPDATE_QUEUED_FILE,payload:{queuedId:e,updates:t}})}}Object.defineProperty(t,"__esModule",{value:!0}),t.addQueuedFile=n,t.failUpload=r,t.purgeUploadQueue=s,t.removeQueuedFile=l,t.succeedUpload=i,t.updateQueuedFile=a;var d=o("./client/src/state/queuedFiles/QueuedFilesActionTypes.js"),u=function(e){return e&&e.__esModule?e:{default:e}}(d)},"./client/src/state/queuedFiles/QueuedFilesReducer.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:m,t=arguments[1];switch(t.type){case u.default.ADD_QUEUED_FILE:return(0,a.default)(l({},e,{items:[].concat(r(e.items),[l({},p.default,t.payload.file)])}));case u.default.FAIL_UPLOAD:return(0,a.default)(l({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?l({},e,{message:t.payload.message}):e})}));case u.default.PURGE_UPLOAD_QUEUE:return(0,a.default)(l({},e,{items:e.items.filter(function(e){return!e.id})}));case u.default.REMOVE_QUEUED_FILE:return(0,a.default)(l({},e,{items:e.items.filter(function(e){return e.queuedId!==t.payload.queuedId})}));case u.default.SUCCEED_UPLOAD:return(0,a.default)(l({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?l({},e,t.payload.json,{messages:[{value:h.default._t("AssetAdmin.DROPZONE_SUCCESS_UPLOAD"),type:"success",extraClass:"success"}]}):e})}));case u.default.UPDATE_QUEUED_FILE:return(0,a.default)(l({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?l({},e,t.payload.updates):e})}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:f,t=arguments[1],o=(0,p.default)(e,t,h);switch(t.type){case a.default.UPLOADFIELD_ADD_FILE:return o(function(e){return e.files.find(function(e){return e.id===t.payload.file.id})?e:l({},e,{files:[].concat(r(e.files),[l({},u.default,t.payload.file)])})});case a.default.UPLOADFIELD_SET_FILES:return o(function(){return{files:t.payload.files}});case a.default.UPLOADFIELD_UPLOAD_FAILURE:return o(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,{message:t.payload.message}):e})}});case a.default.UPLOADFIELD_REMOVE_FILE:return o(function(e){return{files:e.files.filter(function(e){return!(t.payload.file.queuedId&&e.queuedId===t.payload.file.queuedId||t.payload.file.id&&e.id===t.payload.file.id)})}});case a.default.UPLOADFIELD_UPLOAD_SUCCESS:return o(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.json):e})}});case a.default.UPLOADFIELD_UPDATE_QUEUED_FILE:return o(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.updates):e})}});default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t0?s.default._t("AssetAdmin.UPDATE_FILE","Update file"):s.default._t("AssetAdmin.INSERT_FILE","Insert file");return e.mutateField("action_insert",function(e){return n({},e,{title:r||e.title})}),e.getState()};t.default=l},"./client/src/transforms/FormAction/ownerAwareUnpublish.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0?[a.default.inject(a.default._t("AssetAdmin.SINGLE_OWNED_WARNING_1","This file is being used in {count} other published section(s)."),{count:r}),a.default._t("AssetAdmin.SINGLE_OWNED_WARNING_2","Ensure files are removed from content areas prior to unpublishing them. Otherwise, they will appear as broken links."),a.default._t("AssetAdmin.SINGLE_OWNED_WARNING_3","Do you want to unpublish this file anyway?")].join("\n\n"):a.default._t("AssetAdmin.CONFIRMUNPUBLISH","Are you sure you want to unpublish this record?"),confirm(s)?o(e,n):e.preventDefault()}});return l.default.createElement(e,n)}};t.default=d},"./client/src/transforms/TreeDropdownField/moveTreeDropdownField.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disabledTreeDropdownField=void 0;var n=Object.assign||function(e){for(var t=1;t'),this.element.appendChild(o)),n=o.getElementsByTagName("span")[0],n&&(null!=n.textContent?n.textContent=this.options.dictFallbackMessage:null!=n.innerText&&(n.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e){var t,o,n;return t={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},o=e.width/e.height,t.optWidth=this.options.thumbnailWidth,t.optHeight=this.options.thumbnailHeight,null==t.optWidth&&null==t.optHeight?(t.optWidth=t.srcWidth,t.optHeight=t.srcHeight):null==t.optWidth?t.optWidth=o*t.optHeight:null==t.optHeight&&(t.optHeight=1/o*t.optWidth),n=t.optWidth/t.optHeight,e.heightn?(t.srcHeight=e.height,t.srcWidth=t.srcHeight*n):(t.srcWidth=e.width,t.srcHeight=t.srcWidth/n),t.srcX=(e.width-t.srcWidth)/2,t.srcY=(e.height-t.srcHeight)/2,t},drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:a,dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:a,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var o,n,r,s,l,i,a,d,u,c,p,f,h;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(e.previewElement=t.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),c=e.previewElement.querySelectorAll("[data-dz-name]"),s=0,a=c.length;s'+this.options.dictRemoveFile+""),e.previewElement.appendChild(e._removeLink)),n=function(o){return function(n){return n.preventDefault(),n.stopPropagation(),e.status===t.UPLOADING?t.confirm(o.options.dictCancelUploadConfirmation,function(){return o.removeFile(e)}):o.options.dictRemoveFileConfirmation?t.confirm(o.options.dictRemoveFileConfirmation,function(){return o.removeFile(e)}):o.removeFile(e)}}(this),f=e.previewElement.querySelectorAll("[data-dz-remove]"),h=[],i=0,u=f.length;i\n
\n
\n
\n
\n
\n
\n
\n
\n \n Check\n \n \n \n \n \n
\n
\n \n Error\n \n \n \n \n \n \n \n
\n'},o=function(){var e,t,o,n,r,s,l;for(n=arguments[0],o=2<=arguments.length?u.call(arguments,1):[],s=0,l=o.length;s'+this.options.dictDefaultMessage+"")),this.clickableElements.length&&(n=function(e){return function(){return e.hiddenFileInput&&e.hiddenFileInput.parentNode.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(null==e.options.maxFiles||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",null!=e.options.acceptedFiles&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),null!=e.options.capture&&e.hiddenFileInput.setAttribute("capture",e.options.capture),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",document.querySelector(e.options.hiddenInputContainer).appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var t,o,r,s;if(o=e.hiddenFileInput.files,o.length)for(r=0,s=o.length;r',this.options.dictFallbackText&&(n+="

"+this.options.dictFallbackText+"

"),n+='',o=t.createElement(n),"FORM"!==this.element.tagName?(r=t.createElement('
'),r.appendChild(o)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=r?r:o)},t.prototype.getExistingFallback=function(){var e,t,o,n,r,s;for(t=function(e){var t,o,n;for(o=0,n=e.length;o0){for(l=["TB","GB","MB","KB","b"],o=i=0,a=l.length;i=t){n=e/Math.pow(this.options.filesizeBase,4-o),r=s;break}n=Math.round(10*n)/10}return""+n+" "+r},t.prototype._updateMaxFilesReachedClass=function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},t.prototype.drop=function(e){var t,o;e.dataTransfer&&(this.emit("drop",e),t=e.dataTransfer.files,this.emit("addedfiles",t),t.length&&(o=e.dataTransfer.items,o&&o.length&&null!=o[0].webkitGetAsEntry?this._addFilesFromItems(o):this.handleFiles(t)))},t.prototype.paste=function(e){var t,o;if(null!=(null!=e&&null!=(o=e.clipboardData)?o.items:void 0))return this.emit("paste",e),t=e.clipboardData.items,t.length?this._addFilesFromItems(t):void 0},t.prototype.handleFiles=function(e){var t,o,n,r;for(r=[],o=0,n=e.length;o0){for(s=0,l=o.length;s1024*this.options.maxFilesize*1024?o(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):t.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(o(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,o):o(this.options.dictInvalidFileType)},t.prototype.addFile=function(e){return e.upload={progress:0,total:e.size,bytesSent:0},this.files.push(e),e.status=t.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,function(t){return function(o){return o?(e.accepted=!1,t._errorProcessing([e],o)):(e.accepted=!0,t.options.autoQueue&&t.enqueueFile(e)),t._updateMaxFilesReachedClass()}}(this))},t.prototype.enqueueFiles=function(e){var t,o,n;for(o=0,n=e.length;o=t)&&(n=this.getQueuedFiles(),n.length>0)){if(this.options.uploadMultiple)return this.processFiles(n.slice(0,t-o));for(;e=M;u=0<=M?++x:--x)s.append(this._getParamName(u),e[u],this._renameFilename(e[u].name));return this.submitRequest(j,s,e)},t.prototype.submitRequest=function(e,t,o){return e.send(t)},t.prototype._finished=function(e,o,n){var r,s,l;for(s=0,l=e.length;sd;)t=r[4*(i-1)+3],0===t?s=i:d=i,i=s+d>>1;return a=i/l,0===a?1:a},i=function(e,t,o,n,r,s,i,a,d,u){var c;return c=l(t),e.drawImage(t,o,n,r,s,i,a,d,u/c)},s=function(e,t){var o,n,r,s,l,i,a,d,u;if(r=!1,u=!0,n=e.document,d=n.documentElement,o=n.addEventListener?"addEventListener":"attachEvent",a=n.addEventListener?"removeEventListener":"detachEvent",i=n.addEventListener?"":"on",s=function(o){if("readystatechange"!==o.type||"complete"===n.readyState)return("load"===o.type?e:n)[a](i+o.type,s,!1),!r&&(r=!0)?t.call(e,o.type||o):void 0},l=function(){try{d.doScroll("left")}catch(e){return void setTimeout(l,50)}return s("poll")},"complete"!==n.readyState){if(n.createEventObject&&d.doScroll){try{u=!e.frameElement}catch(e){}u&&l()}return n[o](i+"DOMContentLoaded",s,!1),n[o](i+"readystatechange",s,!1),e[o](i+"load",s,!1)}},o._autoDiscoverFunction=function(){if(o.autoDiscover)return o.discover()},s(window,o._autoDiscoverFunction)}).call(this)}).call(t,o(6),o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/expose-loader/index.js?InsertEmbedModal!./client/src/components/InsertEmbedModal/InsertEmbedModal.js-exposed":function(e,t,o){(function(t){e.exports=t.InsertEmbedModal=o('./node_modules/babel-loader/lib/index.js?{"presets":[["env",{"modules":false}],"react"],"plugins":["transform-object-rest-spread"],"comments":false,"cacheDirectory":false}!./client/src/components/InsertEmbedModal/InsertEmbedModal.js')}).call(t,o("./node_modules/webpack/buildin/global.js"))},"./node_modules/expose-loader/index.js?InsertMediaModal!./client/src/containers/InsertMediaModal/InsertMediaModal.js-exposed":function(e,t,o){(function(t){e.exports=t.InsertMediaModal=o('./node_modules/babel-loader/lib/index.js?{"presets":[["env",{"modules":false}],"react"],"plugins":["transform-object-rest-spread"],"comments":false,"cacheDirectory":false}!./client/src/containers/InsertMediaModal/InsertMediaModal.js')}).call(t,o("./node_modules/webpack/buildin/global.js"))},"./node_modules/griddle-react/modules/columnProperties.js":function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o0}},{key:"getMetadataColumnProperty",value:function(e,t,o){var n=this.getColumnMetadataByName(e);return void 0===n||null===n?o:n.hasOwnProperty(t)?n[t]:o}},{key:"orderColumns",value:function(e){var t=this;return a(e,function(e){var o=i(t.columnMetadata,{columnName:e});return void 0===o||null===o||isNaN(o.order)?100:o.order})}},{key:"getColumns",value:function(){var e=0===this.filteredColumns.length?this.allColumns:this.filteredColumns;return e=d(e,this.metadataColumns),e=this.orderColumns(e)}}]),e}();e.exports=u},"./node_modules/griddle-react/modules/customFilterContainer.jsx.js":function(e,t,o){"use strict";var n=o(0),r=n.createClass({displayName:"CustomFilterContainer",getDefaultProps:function(){return{placeholderText:""}},render:function(){var e=this;return"function"!=typeof e.props.customFilterComponent?(console.log("Couldn't find valid template."),n.createElement("div",null)):n.createElement(e.props.customFilterComponent,{changeFilter:this.props.changeFilter,results:this.props.results,currentResults:this.props.currentResults,placeholderText:this.props.placeholderText})}});e.exports=r},"./node_modules/griddle-react/modules/customPaginationContainer.jsx.js":function(e,t,o){"use strict";var n=Object.assign||function(e){for(var t=1;t0&&(e=n.createElement("button",{type:"button",onClick:this.props.previous,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 0 0 10px"}:null},this.props.previousIconComponent,this.props.previousText)),this.props.currentPage!==this.props.maxPage-1&&(t=n.createElement("button",{type:"button",onClick:this.props.next,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 10px 0 0"}:null},this.props.nextText,this.props.nextIconComponent));var o=null,s=null,l=null;if(!0===this.props.useGriddleStyles){var i={float:"left",minHeight:"1px",marginTop:"5px"};l=r({textAlign:"right",width:"34%"},i),s=r({textAlign:"center",width:"33%"},i),o=r({width:"33%"},i)}for(var a=[],d=1;d<=this.props.maxPage;d++)a.push(n.createElement("option",{value:d,key:d},d));return n.createElement("div",{style:this.props.useGriddleStyles?{minHeight:"35px"}:null},n.createElement("div",{className:this.props.previousClassName,style:o},e),n.createElement("div",{className:"griddle-page",style:s},n.createElement("select",{value:this.props.currentPage+1,onChange:this.pageChange},a)," / ",this.props.maxPage),n.createElement("div",{className:this.props.nextClassName,style:l},t))}});e.exports=s},"./node_modules/griddle-react/modules/gridRow.jsx.js":function(e,t,o){"use strict";var n=o(0),r=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/modules/deep.js")),s=o("./node_modules/griddle-react/node_modules/lodash/isFunction.js"),l=o("./node_modules/griddle-react/node_modules/lodash/zipObject.js"),i=o("./node_modules/griddle-react/node_modules/lodash/assign.js"),a=o("./node_modules/griddle-react/node_modules/lodash/defaults.js"),d=o("./node_modules/griddle-react/node_modules/lodash/toPairs.js"),u=o("./node_modules/griddle-react/node_modules/lodash/without.js"),c=n.createClass({displayName:"GridRow",getDefaultProps:function(){return{isChildRow:!1,showChildren:!1,data:{},columnSettings:null,rowSettings:null,hasChildren:!1,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null}},handleClick:function(e){null!==this.props.onRowClick&&s(this.props.onRowClick)?this.props.onRowClick(this,e):this.props.hasChildren&&this.props.toggleChildren()},handleSelectionChange:function(e){},handleSelectClick:function(e){this.props.multipleSelectionSettings.isMultipleSelection&&("checkbox"===e.target.type?this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,this.refs.selected.checked):this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,!this.refs.selected.checked))},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRow: The columnSettings prop is null and it shouldn't be")},formatData:function(e){return"boolean"==typeof e?String(e):e},render:function(){var e=this;this.verifyProps();var t=this,o=null;this.props.useGriddleStyles&&(o={margin:"0px",padding:t.props.paddingHeight+"px 5px "+t.props.paddingHeight+"px 5px",height:t.props.rowHeight?this.props.rowHeight-2*t.props.paddingHeight+"px":null,backgroundColor:"#FFF",borderTopColor:"#DDD",color:"#222"});var c=this.props.columnSettings.getColumns(),p=l(c,[]),f=i({},this.props.data);a(f,p);var h,m,_=d(r.pick(f,u(c,"children"))),g=_.map(function(t,r){var s=null,l=e.props.columnSettings.getColumnMetadataByName(t[0]),a=0===r&&e.props.hasChildren&&!1===e.props.showChildren&&e.props.useGriddleIcons?n.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px",marginRight:"5px"}:null},e.props.parentRowCollapsedComponent):0===r&&e.props.hasChildren&&e.props.showChildren&&e.props.useGriddleIcons?n.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px"}:null},e.props.parentRowExpandedComponent):"";if(0===r&&e.props.isChildRow&&e.props.useGriddleStyles&&(o=i(o,{paddingLeft:10})),e.props.columnSettings.hasColumnMetadata()&&void 0!==l&&null!==l)if(void 0!==l.customComponent&&null!==l.customComponent){var d=n.createElement(l.customComponent,{data:t[1],rowData:f,metadata:l});s=n.createElement("td",{onClick:e.handleClick,className:l.cssClassName,key:r,style:o},d)}else s=n.createElement("td",{onClick:e.handleClick,className:l.cssClassName,key:r,style:o},a,e.formatData(t[1]));return s||n.createElement("td",{onClick:e.handleClick,key:r,style:o},a,t[1])});null!==this.props.onRowClick&&s(this.props.onRowClick)?(h=null,m=this.handleSelectClick):this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection?(h=this.handleSelectClick,m=null):(h=null,m=null),g&&this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection&&(this.props.multipleSelectionSettings.getSelectedRowIds(),g.unshift(n.createElement("td",{key:"selection",style:o,className:"griddle-select griddle-select-cell",onClick:m},n.createElement("input",{type:"checkbox",checked:this.props.multipleSelectionSettings.getIsRowChecked(f),onChange:this.handleSelectionChange,ref:"selected"}))));var y=t.props.rowSettings&&t.props.rowSettings.getBodyRowMetadataClass(t.props.data)||"standard-row";return t.props.isChildRow?y="child-row":t.props.hasChildren&&(y=t.props.showChildren?this.props.parentRowExpandedClassName:this.props.parentRowCollapsedClassName),n.createElement("tr",{onClick:h,className:y},g)}});e.exports=c},"./node_modules/griddle-react/modules/gridRowContainer.jsx.js":function(e,t,o){"use strict";var n=o(0),r=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/node_modules/lodash/pick.js")),s=n.createClass({displayName:"GridRowContainer",getDefaultProps:function(){return{useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,columnSettings:null,rowSettings:null,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null}},getInitialState:function(){return{data:{},showChildren:!1}},componentWillReceiveProps:function(){this.setShowChildren(!1)},toggleChildren:function(){this.setShowChildren(!1===this.state.showChildren)},setShowChildren:function(e){this.setState({showChildren:e})},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRowContainer: The columnSettings prop is null and it shouldn't be")},render:function(){this.verifyProps();var e=this;if(void 0===this.props.data)return n.createElement("tbody",null);var t=[],o=this.props.columnSettings.getColumns();t.push(n.createElement(this.props.rowSettings.rowComponent,{useGriddleStyles:this.props.useGriddleStyles,isSubGriddle:this.props.isSubGriddle,data:this.props.rowSettings.isCustom?r(this.props.data,o):this.props.data,rowData:this.props.rowSettings.isCustom?this.props.data:null,columnSettings:this.props.columnSettings,rowSettings:this.props.rowSettings,hasChildren:e.props.hasChildren,toggleChildren:e.toggleChildren,showChildren:e.state.showChildren,key:e.props.uniqueId+"_base_row",useGriddleIcons:e.props.useGriddleIcons,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedComponent:this.props.parentRowExpandedComponent,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight,onRowClick:e.props.onRowClick,multipleSelectionSettings:this.props.multipleSelectionSettings}));var s=null;return e.state.showChildren&&(s=e.props.hasChildren&&this.props.data.children.map(function(t,o){var r=e.props.rowSettings.getRowKey(t,o);if(void 0!==t.children){var s=e.constructor.Griddle;return n.createElement("tr",{key:r,style:{paddingLeft:5}},n.createElement("td",{colSpan:e.props.columnSettings.getVisibleColumnCount(),className:"griddle-parent",style:e.props.useGriddleStyles?{border:"none",padding:"0 0 0 5px"}:null},n.createElement(s,{rowMetadata:{key:"id"},isSubGriddle:!0,results:[t],columns:e.props.columnSettings.getColumns(),tableClassName:e.props.tableClassName,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,showTableHeading:!1,showPager:!1,columnMetadata:e.props.columnSettings.columnMetadata,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight})))}return n.createElement(e.props.rowSettings.rowComponent,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,data:t,columnSettings:e.props.columnSettings,isChildRow:!0,columnMetadata:e.props.columnSettings.columnMetadata,key:r})})),!1===e.props.hasChildren?t[0]:n.createElement("tbody",null,e.state.showChildren?t.concat(s):t)}});e.exports=s},"./node_modules/griddle-react/modules/gridSettings.jsx.js":function(e,t,o){"use strict";var n=o(0),r=o("./node_modules/griddle-react/node_modules/lodash/includes.js"),s=o("./node_modules/griddle-react/node_modules/lodash/without.js"),l=o("./node_modules/griddle-react/node_modules/lodash/find.js"),i=n.createClass({displayName:"GridSettings",getDefaultProps:function(){return{columns:[],columnMetadata:[],selectedColumns:[],settingsText:"",maxRowsText:"",resultsPerPage:0,enableToggleCustom:!1,useCustomComponent:!1,useGriddleStyles:!0,toggleCustomComponent:function(){}}},setPageSize:function(e){var t=parseInt(e.target.value,10);this.props.setPageSize(t)},handleChange:function(e){var t=e.target.dataset?e.target.dataset.name:e.target.getAttribute("data-name");!0===e.target.checked&&!1===r(this.props.selectedColumns,t)?(this.props.selectedColumns.push(t),this.props.setColumns(this.props.selectedColumns)):this.props.setColumns(s(this.props.selectedColumns,t))},render:function(){var e=this,t=[];!1===e.props.useCustomComponent&&(t=this.props.columns.map(function(t,o){var s=r(e.props.selectedColumns,t),i=l(e.props.columnMetadata,{columnName:t}),a=t;return void 0!==i&&void 0!==i.displayName&&null!=i.displayName&&(a=i.displayName),void 0!==i&&null!=i&&i.locked?n.createElement("div",{className:"column checkbox"},n.createElement("label",null,n.createElement("input",{type:"checkbox",disabled:!0,name:"check",checked:s,"data-name":t}),a)):void 0!==i&&null!=i&&void 0!==i.visible&&!1===i.visible?null:n.createElement("div",{className:"griddle-column-selection checkbox",key:t,style:e.props.useGriddleStyles?{float:"left",width:"20%"}:null},n.createElement("label",null,n.createElement("input",{type:"checkbox",name:"check",onChange:e.handleChange,checked:s,"data-name":t}),a))}));var o=e.props.enableToggleCustom?n.createElement("div",{className:"form-group"},n.createElement("label",{htmlFor:"maxRows"},n.createElement("input",{type:"checkbox",checked:this.props.useCustomComponent,onChange:this.props.toggleCustomComponent})," ",this.props.enableCustomFormatText)):"",s=this.props.showSetPageSize?n.createElement("div",null,n.createElement("label",{htmlFor:"maxRows"},this.props.maxRowsText,":",n.createElement("select",{onChange:this.setPageSize,value:this.props.resultsPerPage},n.createElement("option",{value:"5"},"5"),n.createElement("option",{value:"10"},"10"),n.createElement("option",{value:"25"},"25"),n.createElement("option",{value:"50"},"50"),n.createElement("option",{value:"100"},"100")))):"";return n.createElement("div",{className:"griddle-settings",style:this.props.useGriddleStyles?{backgroundColor:"#FFF",border:"1px solid #DDD",color:"#222",padding:"10px",marginBottom:"10px"}:null},n.createElement("h6",null,this.props.settingsText),n.createElement("div",{className:"griddle-columns",style:this.props.useGriddleStyles?{clear:"both",display:"table",width:"100%",borderBottom:"1px solid #EDEDED",marginBottom:"10px"}:null},t),s,o)}});e.exports=i},"./node_modules/griddle-react/modules/gridTable.jsx.js":function(e,t,o){"use strict";var n=o(0),r=o("./node_modules/griddle-react/modules/gridTitle.jsx.js"),s=o("./node_modules/griddle-react/modules/gridRowContainer.jsx.js"),l=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/modules/rowProperties.js"),n.createClass({displayName:"GridTable",getDefaultProps:function(){return{data:[],columnSettings:null,rowSettings:null,sortSettings:null,multipleSelectionSettings:null,className:"",enableInfiniteScroll:!1,nextPage:null,hasMorePages:!1,useFixedHeader:!1,useFixedLayout:!0,paddingHeight:null,rowHeight:null,filterByColumn:null,infiniteScrollLoadTreshold:null,bodyHeight:null,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",externalLoadingComponent:null,externalIsLoading:!1,onRowClick:null}},getInitialState:function(){return{scrollTop:0,scrollHeight:this.props.bodyHeight,clientHeight:this.props.bodyHeight}},componentDidMount:function(){this.gridScroll()},componentDidUpdate:function(e,t){this.gridScroll()},gridScroll:function(){if(this.props.enableInfiniteScroll&&!this.props.externalIsLoading){var e=this.refs.scrollable,t=e.scrollTop,o=e.scrollHeight,n=e.clientHeight;if(null!==this.props.rowHeight&&this.state.scrollTop!==t&&Math.abs(this.state.scrollTop-t)>=this.getAdjustedRowHeight()){var r={scrollTop:t,scrollHeight:o,clientHeight:n};this.setState(r)}.6*(o-(t+n)-this.props.infiniteScrollLoadTreshold)<=this.props.infiniteScrollLoadTreshold&&this.props.nextPage()}},verifyProps:function(){null===this.props.columnSettings&&console.error("gridTable: The columnSettings prop is null and it shouldn't be"),null===this.props.rowSettings&&console.error("gridTable: The rowSettings prop is null and it shouldn't be")},getAdjustedRowHeight:function(){return this.props.rowHeight+2*this.props.paddingHeight},getNodeContent:function(){this.verifyProps();var e=this,t=!1;if(!this.props.externalIsLoading||this.props.enableInfiniteScroll){var o=e.props.data,r=null,l=null;if(this.props.enableInfiniteScroll&&null!==this.props.rowHeight&&void 0!==this.refs.scrollable){var i=e.getAdjustedRowHeight(),a=Math.ceil(e.state.clientHeight/i),d=Math.max(0,Math.floor(e.state.scrollTop/i)-.25*a),u=Math.min(d+1.25*a,this.props.data.length-1);o=o.slice(d,u+1);var c={height:d*i+"px"};r=n.createElement("tr",{key:"above-"+c.height,style:c});var p={height:(this.props.data.length-u)*i+"px"};l=n.createElement("tr",{key:"below-"+p.height,style:p})}var f=o.map(function(o,r){var l=void 0!==o.children&&o.children.length>0,i=e.props.rowSettings.getRowKey(o,r);return l&&(t=l),n.createElement(s,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,data:o,key:i+"-container",uniqueId:i,columnSettings:e.props.columnSettings,rowSettings:e.props.rowSettings,paddingHeight:e.props.paddingHeight,multipleSelectionSettings:e.props.multipleSelectionSettings,rowHeight:e.props.rowHeight,hasChildren:l,tableClassName:e.props.className,onRowClick:e.props.onRowClick})});if(this.props.showNoData){var h=this.props.columnSettings.getVisibleColumnCount();f.push(n.createElement("tr",{key:"no-data-section"},n.createElement("td",{colSpan:h},this.props.noDataSection)))}return r&&f.unshift(r),l&&f.push(l),{nodes:f,anyHasChildren:t}}return null},render:function(){var e=[],t=!1,o=this.getNodeContent();o&&(e=o.nodes,t=o.anyHasChildren);var s=null,l=null,i={width:"100%"};if(this.props.useFixedLayout&&(i.tableLayout="fixed"),this.props.enableInfiniteScroll&&(s={position:"relative",overflowY:"scroll",height:this.props.bodyHeight+"px",width:"100%"}),this.props.externalIsLoading){var a=null,d=null;this.props.useGriddleStyles&&(a={textAlign:"center",paddingBottom:"40px"}),d=this.props.columnSettings.getVisibleColumnCount();var u=this.props.externalLoadingComponent?n.createElement(this.props.externalLoadingComponent,null):n.createElement("div",null,"Loading...");l=n.createElement("tbody",null,n.createElement("tr",null,n.createElement("td",{style:a,colSpan:d},u)))}var c=this.props.showTableHeading?n.createElement(r,{useGriddleStyles:this.props.useGriddleStyles,useGriddleIcons:this.props.useGriddleIcons,sortSettings:this.props.sortSettings,multipleSelectionSettings:this.props.multipleSelectionSettings,columnSettings:this.props.columnSettings,filterByColumn:this.props.filterByColumn,rowSettings:this.props.rowSettings}):void 0;t||(e=n.createElement("tbody",null,e));var p=n.createElement("tbody",null);if(this.props.showPager){var f=this.props.useGriddleStyles?{padding:"0px",backgroundColor:"#EDEDED",border:"0px",color:"#222",height:this.props.showNoData?"20px":null}:null;p=n.createElement("tbody",null,n.createElement("tr",null,n.createElement("td",{colSpan:this.props.multipleSelectionSettings.isMultipleSelection?this.props.columnSettings.getVisibleColumnCount()+1:this.props.columnSettings.getVisibleColumnCount(),style:f,className:"footer-container"},this.props.showNoData?null:this.props.pagingContent)))}return this.props.useFixedHeader?(this.props.useGriddleStyles&&(i.tableLayout="fixed"),n.createElement("div",null,n.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},c),n.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:s},n.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},e,l,p)))):n.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:s},n.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},c,e,l,p))}}));e.exports=l},"./node_modules/griddle-react/modules/gridTitle.jsx.js":function(e,t,o){"use strict";var n=Object.assign||function(e){for(var t=1;t=0)return!0;return!1})},defaultColumnFilter:function(e,t){return A(g.getObjectValues(e),function(e){return e.toString().toLowerCase().indexOf(t.toLowerCase())>=0}).length>0},filterByColumnFilters:function(e){var t=this.defaultColumnFilter,o=Object.keys(e).reduce(function(o,n){return A(o,function(o){var r=g.getAt(o,n||""),s=e[n];return t(r,s)})},this.props.results),n={columnFilters:e};e?(n.filteredResults=o,n.maxPage=this.getMaxPage(n.filteredResults)):this.state.filter?n.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,filter):this.defaultFilter(this.props.results,filter):n.filteredResults=null,this.setState(n)},filterByColumn:function(e,t){var o=this.state.columnFilters;if(o.hasOwnProperty(t)&&!e)o=F(o,t);else{var n={};n[t]=e,o=x({},o,n)}this.filterByColumnFilters(o)},setFilter:function(e){if(this.props.useExternal)return void this.props.externalSetFilter(e);var t=this,o={page:0,filter:e};o.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,e):this.defaultFilter(this.props.results,e),o.maxPage=t.getMaxPage(o.filteredResults),(O(e)||T(e)||w(e))&&(o.filter=e,o.filteredResults=null),t.setState(o),this._resetSelectedRows()},setPageSize:function(e){if(this.props.useExternal)return this.setState({resultsPerPage:e}),void this.props.externalSetPageSize(e);this.state.resultsPerPage=e,this.setMaxPage()},toggleColumnChooser:function(){this.setState({showColumnChooser:!this.state.showColumnChooser})},isNullOrUndefined:function(e){return void 0===e||null===e},shouldUseCustomRowComponent:function(){return this.isNullOrUndefined(this.state.useCustomRowComponent)?this.props.useCustomRowComponent:this.state.useCustomRowComponent},shouldUseCustomGridComponent:function(){return this.isNullOrUndefined(this.state.useCustomGridComponent)?this.props.useCustomGridComponent:this.state.useCustomGridComponent},toggleCustomComponent:function(){"grid"===this.state.customComponentType?this.setState({useCustomGridComponent:!this.shouldUseCustomGridComponent()}):"row"===this.state.customComponentType&&this.setState({useCustomRowComponent:!this.shouldUseCustomRowComponent()})},getMaxPage:function(e,t){return this.props.useExternal?this.props.externalMaxPage:(t||(t=(e||this.getCurrentResults()).length),Math.ceil(t/this.state.resultsPerPage))},setMaxPage:function(e){var t=this.getMaxPage(e);this.state.maxPage!==t&&this.setState({page:0,maxPage:t,filteredColumns:this.columnSettings.filteredColumns})},setPage:function(e){if(this.props.useExternal)return void this.props.externalSetPage(e);if(e*this.state.resultsPerPage<=this.state.resultsPerPage*this.state.maxPage){var t=this,o={page:e};t.setState(o)}this.props.enableInfiniteScroll&&this.setState({isSelectAllChecked:!1})},setColumns:function(e){this.columnSettings.filteredColumns=P(e)?e:[e],this.setState({filteredColumns:this.columnSettings.filteredColumns})},nextPage:function(){var e=this.getCurrentPage();e0&&this.setPage(e-1)},changeSort:function(e){if(!1!==this.props.enableSort){if(this.props.useExternal){var t=this.props.externalSortColumn!==e||!this.props.externalSortAscending;return this.setState({sortColumn:e,sortDirection:t?"asc":"desc"}),void this.props.externalChangeSort(e,t)}var o=b(this.props.columnMetadata,{columnName:e})||{},n=o.sortDirectionCycle?o.sortDirectionCycle:[null,"asc","desc"],r=null,s=n.indexOf(this.state.sortDirection&&e===this.state.sortColumn?this.state.sortDirection:null);s=(s+1)%n.length,r=n[s]?n[s]:null;var l={page:0,sortColumn:e,sortDirection:r};this.setState(l)}},componentWillReceiveProps:function(e){if(this.setMaxPage(e.results),e.resultsPerPage!==this.props.resultsPerPage&&this.setPageSize(e.resultsPerPage),this.columnSettings.columnMetadata=e.columnMetadata,e.results.length>0){var t=g.keys(e.results[0]);this.columnSettings.allColumns.length==t.length&&this.columnSettings.allColumns.every(function(e,o){return e===t[o]})||(this.columnSettings.allColumns=t)}else this.columnSettings.allColumns.length>0&&(this.columnSettings.allColumns=[]);if(e.selectedRowIds){var o=this.getDataForRender(this.getCurrentResults(e.results),this.columnSettings.getColumns(),!0);this.setState({isSelectAllChecked:this._getAreAllRowsChecked(e.selectedRowIds,I(o,this.props.uniqueIdentifier)),selectedRowIds:e.selectedRowIds})}},getInitialState:function(){return{maxPage:0,page:0,filteredResults:null,filteredColumns:[],filter:"",columnFilters:{},resultsPerPage:this.props.resultsPerPage||5,showColumnChooser:!1,isSelectAllChecked:!1,selectedRowIds:this.props.selectedRowIds}},componentWillMount:function(){this.verifyExternal(),this.verifyCustom(),this.columnSettings=new m(this.props.results.length>0?g.keys(this.props.results[0]):[],this.props.columns,this.props.childrenColumnName,this.props.columnMetadata,this.props.metadataColumns),this.rowSettings=new _(this.props.rowMetadata,this.props.useCustomTableRowComponent&&this.props.customTableRowComponent?this.props.customTableRowComponent:u,this.props.useCustomTableRowComponent),this.props.initialSort&&(this.props.useExternal?this.setState({sortColumn:this.props.externalSortColumn,sortDirection:this.props.externalSortAscending?"asc":"desc"}):this.changeSort(this.props.initialSort)),this.setMaxPage(),this.shouldUseCustomGridComponent()?this.setState({customComponentType:"grid"}):this.shouldUseCustomRowComponent()?this.setState({customComponentType:"row"}):this.setState({filteredColumns:this.columnSettings.filteredColumns})},componentDidMount:function(){if(this.props.componentDidMount&&"function"==typeof this.props.componentDidMount)return this.props.componentDidMount()},componentDidUpdate:function(){if(this.props.componentDidUpdate&&"function"==typeof this.props.componentDidUpdate)return this.props.componentDidUpdate(this.state)},verifyExternal:function(){!0===this.props.useExternal&&(null===this.props.externalSetPage&&console.error("useExternal is set to true but there is no externalSetPage function specified."),null===this.props.externalChangeSort&&console.error("useExternal is set to true but there is no externalChangeSort function specified."),null===this.props.externalSetFilter&&console.error("useExternal is set to true but there is no externalSetFilter function specified."),null===this.props.externalSetPageSize&&console.error("useExternal is set to true but there is no externalSetPageSize function specified."),null===this.props.externalMaxPage&&console.error("useExternal is set to true but externalMaxPage is not set."),null===this.props.externalCurrentPage&&console.error("useExternal is set to true but externalCurrentPage is not set. Griddle will not page correctly without that property when using external data."))},verifyCustom:function(){!0===this.props.useCustomGridComponent&&null===this.props.customGridComponent&&console.error("useCustomGridComponent is set to true but no custom component was specified."),!0===this.props.useCustomRowComponent&&null===this.props.customRowComponent&&console.error("useCustomRowComponent is set to true but no custom component was specified."),!0===this.props.useCustomGridComponent&&!0===this.props.useCustomRowComponent&&console.error("Cannot currently use both customGridComponent and customRowComponent."),!0===this.props.useCustomFilterer&&null===this.props.customFilterer&&console.error("useCustomFilterer is set to true but no custom filter function was specified."),!0===this.props.useCustomFilterComponent&&null===this.props.customFilterComponent&&console.error("useCustomFilterComponent is set to true but no customFilterComponent was specified.")},getDataForRender:function(e,t,o){var n=this,r=this;if(""!==this.state.sortColumn){var s,l=this.state.sortColumn,i=A(this.props.columnMetadata,{columnName:l}),a={columns:[],orders:[]};if(i.length>0&&(s=i[0].hasOwnProperty("customCompareFn")&&i[0].customCompareFn,i[0].multiSort&&(a=i[0].multiSort)),this.state.sortDirection)if("function"==typeof s)2===s.length?(e=e.sort(function(e,t){return s(k(e,l),k(t,l))}),"desc"===this.state.sortDirection&&e.reverse()):1===s.length&&(e=D(e,function(e){return s(k(e,l))},[this.state.sortDirection]));else{var d=[function(e){return(k(e,l)||"").toString().toLowerCase()}],u=[this.state.sortDirection];a.columns.forEach(function(e,t){d.push(function(t){return(k(t,e)||"").toString().toLowerCase()}),"asc"===a.orders[t]||"desc"===a.orders[t]?u.push(a.orders[t]):u.push(n.state.sortDirection)}),e=D(e,d,u)}}var c=this.getCurrentPage();if(!this.props.useExternal&&o&&this.state.resultsPerPage*(c+1)<=this.state.resultsPerPage*this.state.maxPage&&c>=0)if(this.isInfiniteScrollEnabled())e=E(e,(c+1)*this.state.resultsPerPage);else{var p=y(e,c*this.state.resultsPerPage);e=(v||S)(p,p.length-this.state.resultsPerPage)}for(var f=(this.columnSettings.getMetadataColumns,[]),h=0;h0&&(m.children=r.getDataForRender(m[r.props.childrenColumnName],t,!1),"children"!==r.props.childrenColumnName&&delete m[r.props.childrenColumnName]),f.push(m)}return f},getCurrentResults:function(e){return this.state.filteredResults||e||this.props.results},getCurrentPage:function(){return this.props.externalCurrentPage||this.state.page},getCurrentSort:function(){return this.props.useExternal?this.props.externalSortColumn:this.state.sortColumn},getCurrentSortAscending:function(){return this.props.useExternal?this.props.externalSortAscending:"asc"===this.state.sortDirection},getCurrentMaxPage:function(){return this.props.useExternal?this.props.externalMaxPage:this.state.maxPage},getSortObject:function(){return{enableSort:this.props.enableSort,changeSort:this.changeSort,sortColumn:this.getCurrentSort(),sortAscending:this.getCurrentSortAscending(),sortDirection:this.state.sortDirection,sortAscendingClassName:this.props.sortAscendingClassName,sortDescendingClassName:this.props.sortDescendingClassName,sortAscendingComponent:this.props.sortAscendingComponent,sortDescendingComponent:this.props.sortDescendingComponent,sortDefaultComponent:this.props.sortDefaultComponent}},_toggleSelectAll:function(){var e=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),t=!this.state.isSelectAllChecked,o=JSON.parse(JSON.stringify(this.state.selectedRowIds)),n=this;j(e,function(e){n._updateSelectedRowIds(e[n.props.uniqueIdentifier],o,t)},this),this.setState({isSelectAllChecked:t,selectedRowIds:o}),this.props.onSelectionChange&&this.props.onSelectionChange(o,t)},_toggleSelectRow:function(e,t){var o=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),n=JSON.parse(JSON.stringify(this.state.selectedRowIds));this._updateSelectedRowIds(e[this.props.uniqueIdentifier],n,t);var r=this._getAreAllRowsChecked(n,I(o,this.props.uniqueIdentifier));this.setState({isSelectAllChecked:r,selectedRowIds:n}),this.props.onSelectionChange&&this.props.onSelectionChange(n,r)},_updateSelectedRowIds:function(e,t,o){o?void 0===b(t,function(t){return e===t})&&t.push(e):t.splice(t.indexOf(e),1)},_getIsSelectAllChecked:function(){return this.state.isSelectAllChecked},_getAreAllRowsChecked:function(e,t){return t.length===C(t,e).length},_getIsRowChecked:function(e){return this.state.selectedRowIds.indexOf(e[this.props.uniqueIdentifier])>-1},getSelectedRowIds:function(){return this.state.selectedRowIds},_resetSelectedRows:function(){this.setState({isSelectAllChecked:!1,selectedRowIds:[]})},getMultipleSelectionObject:function(){return{isMultipleSelection:!b(this.props.results,function(e){return"children"in e})&&this.props.isMultipleSelection,toggleSelectAll:this._toggleSelectAll,getIsSelectAllChecked:this._getIsSelectAllChecked,toggleSelectRow:this._toggleSelectRow,getSelectedRowIds:this.getSelectedRowIds,getIsRowChecked:this._getIsRowChecked}},isInfiniteScrollEnabled:function(){return!this.props.useCustomPagerComponent&&this.props.enableInfiniteScroll},getClearFixStyles:function(){return{clear:"both",display:"table",width:"100%"}},getSettingsStyles:function(){return{float:"left",width:"50%",textAlign:"right"}},getFilterStyles:function(){return{float:"left",width:"50%",textAlign:"left",color:"#222",minHeight:"1px"}},getFilter:function(){return this.props.showFilter&&!1===this.shouldUseCustomGridComponent()?this.props.useCustomFilterComponent?r.createElement(h,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText,customFilterComponent:this.props.customFilterComponent,results:this.props.results,currentResults:this.getCurrentResults()}):r.createElement(l,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText}):""},getSettings:function(){return this.props.showSettings?r.createElement("button",{type:"button",className:this.props.settingsToggleClassName,onClick:this.toggleColumnChooser,style:this.props.useGriddleStyles?{background:"none",border:"none",padding:0,margin:0,fontSize:14}:null},this.props.settingsText,this.props.settingsIconComponent):""},getTopSection:function(e,t){if(!1===this.props.showFilter&&!1===this.props.showSettings)return"";var o=null,n=null,s=null;return this.props.useGriddleStyles&&(o=this.getFilterStyles(),n=this.getSettingsStyles(),s=this.getClearFixStyles()),r.createElement("div",{className:"top-section",style:s},r.createElement("div",{className:"griddle-filter",style:o},e),r.createElement("div",{className:"griddle-settings-toggle",style:n},t))},getPagingSection:function(e,t){if(!1!==(this.props.showPager&&!this.isInfiniteScrollEnabled()&&!this.shouldUseCustomGridComponent()))return r.createElement("div",{className:"griddle-footer"},this.props.useCustomPagerComponent?r.createElement(f,{customPagerComponentOptions:this.props.customPagerComponentOptions,next:this.nextPage,previous:this.previousPage,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText,customPagerComponent:this.props.customPagerComponent}):r.createElement(i,{useGriddleStyles:this.props.useGriddleStyles,next:this.nextPage,previous:this.previousPage,nextClassName:this.props.nextClassName,nextIconComponent:this.props.nextIconComponent,previousClassName:this.props.previousClassName,previousIconComponent:this.props.previousIconComponent,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText}))},getColumnSelectorSection:function(e,t){return this.state.showColumnChooser?r.createElement(a,{columns:e,selectedColumns:t,setColumns:this.setColumns,settingsText:this.props.settingsText,settingsIconComponent:this.props.settingsIconComponent,maxRowsText:this.props.maxRowsText,setPageSize:this.setPageSize,showSetPageSize:!this.shouldUseCustomGridComponent(),resultsPerPage:this.state.resultsPerPage,enableToggleCustom:this.props.enableToggleCustom,toggleCustomComponent:this.toggleCustomComponent,useCustomComponent:this.shouldUseCustomRowComponent()||this.shouldUseCustomGridComponent(),useGriddleStyles:this.props.useGriddleStyles,enableCustomFormatText:this.props.enableCustomFormatText,columnMetadata:this.props.columnMetadata}):""},getCustomGridSection:function(){return r.createElement(this.props.customGridComponent,n({data:this.props.results,className:this.props.customGridComponentClassName},this.props.gridMetadata))},getCustomRowSection:function(e,t,o,n,s){return r.createElement("div",null,r.createElement(p,{data:e,columns:t,metadataColumns:o,globalData:s,className:this.props.customRowComponentClassName,customComponent:this.props.customRowComponent,style:this.props.useGriddleStyles?this.getClearFixStyles():null}),this.props.showPager&&n)},getStandardGridSection:function(e,t,o,n,l){var i=this.getSortObject(),a=this.getMultipleSelectionObject(),d=this.shouldShowNoDataSection(e),u=this.getNoDataSection();return r.createElement("div",{className:"griddle-body"},r.createElement(s,{useGriddleStyles:this.props.useGriddleStyles,noDataSection:u,showNoData:d,columnSettings:this.columnSettings,rowSettings:this.rowSettings,sortSettings:i,multipleSelectionSettings:a,filterByColumn:this.filterByColumn,isSubGriddle:this.props.isSubGriddle,useGriddleIcons:this.props.useGriddleIcons,useFixedLayout:this.props.useFixedLayout,showPager:this.props.showPager,pagingContent:n,data:e,className:this.props.tableClassName,enableInfiniteScroll:this.isInfiniteScrollEnabled(),nextPage:this.nextPage,showTableHeading:this.props.showTableHeading,useFixedHeader:this.props.useFixedHeader,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,parentRowExpandedComponent:this.props.parentRowExpandedComponent,bodyHeight:this.props.bodyHeight,paddingHeight:this.props.paddingHeight,rowHeight:this.props.rowHeight,infiniteScrollLoadTreshold:this.props.infiniteScrollLoadTreshold,externalLoadingComponent:this.props.externalLoadingComponent,externalIsLoading:this.props.externalIsLoading,hasMorePages:l,onRowClick:this.props.onRowClick}))},getContentSection:function(e,t,o,n,r,s){return this.shouldUseCustomGridComponent()&&null!==this.props.customGridComponent?this.getCustomGridSection():this.shouldUseCustomRowComponent()?this.getCustomRowSection(e,t,o,n,s):this.getStandardGridSection(e,t,o,n,r)},getNoDataSection:function(){return null!=this.props.customNoDataComponent?r.createElement("div",{className:this.props.noDataClassName},r.createElement(this.props.customNoDataComponent,this.props.customNoDataComponentProps)):r.createElement(d,{noDataMessage:this.props.noDataMessage})},shouldShowNoDataSection:function(e){return!this.props.allowEmptyGrid&&(!1===this.props.useExternal&&(void 0===e||0===e.length)||!0===this.props.useExternal&&!1===this.props.externalIsLoading&&0===e.length)},render:function(){var e=this.getCurrentResults(),t=(this.props.tableClassName,this.getFilter()),o=this.getSettings(),n=this.getTopSection(t,o),s=[],l=this.columnSettings.getColumns(),i=this.getDataForRender(e,l,!0),a=this.columnSettings.getMetadataColumns();this.props.columnMetadata?j(this.props.columnMetadata,function(e){"boolean"==typeof e.visible&&!1===e.visible||s.push(e.columnName)}):s=g.keys(F(e[0],a)),s=this.columnSettings.orderColumns(s);var d=this.getCurrentPage(),u=this.getCurrentMaxPage(),c=d+10?"griddle "+this.props.gridClassName:"griddle";return m+=this.shouldUseCustomRowComponent()?" griddle-custom":"",r.createElement("div",{className:m},n,h,r.createElement("div",{className:"griddle-container",style:this.props.useGriddleStyles&&!this.props.isSubGriddle?{border:"1px solid #DDD"}:null},f))}});c.Griddle=e.exports=N},"./node_modules/griddle-react/modules/rowProperties.js":function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o-1}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseIndexOf.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_arrayIncludesWith.js":function(e,t){function o(e,t,o){for(var n=-1,r=null==e?0:e.length;++n=u&&(p=d,f=!1,t=new r(t));e:for(;++c0&&o(u)?t>1?n(u,t-1,o,l,i):r(i,u):l||(i[i.length]=u)}return i}var r=o("./node_modules/griddle-react/node_modules/lodash/_arrayPush.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_isFlattenable.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_baseFor.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_createBaseFor.js"),r=n();e.exports=r},"./node_modules/griddle-react/node_modules/lodash/_baseForOwn.js":function(e,t,o){function n(e,t){return e&&r(e,t,s)}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseFor.js"),s=o("./node_modules/griddle-react/node_modules/lodash/keys.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_baseGet.js":function(e,t,o){function n(e,t){t=r(t,e);for(var o=0,n=t.length;null!=e&&o=120&&g.length>=120)?new r(f&&g):void 0}g=e[0];var y=-1,v=h[0];e:for(;++yr?0:r+t),o=o>r?r:o,o<0&&(o+=r),r=t>o?0:o-t>>>0,t>>>=0;for(var s=Array(r);++nt||l&&i&&d&&!a&&!u||n&&i&&d||!o&&d||!s)return 1;if(!n&&!l&&!u&&e=a?d:d*("desc"==o[n]?-1:1)}return e.index-t.index}var r=o("./node_modules/griddle-react/node_modules/lodash/_compareAscending.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_copyArray.js":function(e,t){function o(e,t){var o=-1,n=e.length;for(t||(t=Array(n));++o1?o[r-1]:void 0,i=r>2?o[2]:void 0;for(l=e.length>3&&"function"==typeof l?(r--,l):void 0,i&&s(o[0],o[1],i)&&(l=r<3?void 0:l,r=1),t=Object(t);++n-1?i[a?t[d]:d]:void 0}}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseIteratee.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js"),l=o("./node_modules/griddle-react/node_modules/lodash/keys.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_createToPairs.js":function(e,t,o){function n(e){return function(t){var o=s(t);return o==a?l(t):o==d?i(t):r(t,e(t))}}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseToPairs.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_getTag.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_mapToArray.js"),i=o("./node_modules/griddle-react/node_modules/lodash/_setToPairs.js"),a="[object Map]",d="[object Set]";e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_customDefaultsAssignIn.js":function(e,t,o){function n(e,t,o,n){return void 0===e||r(e,s[o])&&!l.call(n,o)?t:e}var r=o("./node_modules/griddle-react/node_modules/lodash/eq.js"),s=Object.prototype,l=s.hasOwnProperty;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_customOmitClone.js":function(e,t,o){function n(e){return r(e)?void 0:e}var r=o("./node_modules/griddle-react/node_modules/lodash/isPlainObject.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_defineProperty.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_getNative.js"),r=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=r},"./node_modules/griddle-react/node_modules/lodash/_equalArrays.js":function(e,t,o){function n(e,t,o,n,d,u){var c=o&i,p=e.length,f=t.length;if(p!=f&&!(c&&f>p))return!1;var h=u.get(e);if(h&&u.get(t))return h==t;var m=-1,_=!0,g=o&a?new r:void 0;for(u.set(e,t),u.set(t,e);++m-1&&e%1==0&&e-1}var r=o("./node_modules/griddle-react/node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_listCacheSet.js":function(e,t,o){function n(e,t){var o=this.__data__,n=r(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this}var r=o("./node_modules/griddle-react/node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapCacheClear.js":function(e,t,o){function n(){this.size=0,this.__data__={hash:new r,map:new(l||s),string:new r}}var r=o("./node_modules/griddle-react/node_modules/lodash/_Hash.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_ListCache.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_Map.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapCacheDelete.js":function(e,t,o){function n(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}var r=o("./node_modules/griddle-react/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapCacheGet.js":function(e,t,o){function n(e){return r(this,e).get(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapCacheHas.js":function(e,t,o){function n(e){return r(this,e).has(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapCacheSet.js":function(e,t,o){function n(e,t){var o=r(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this}var r=o("./node_modules/griddle-react/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapToArray.js":function(e,t){function o(e){var t=-1,o=Array(e.size);return e.forEach(function(e,n){o[++t]=[n,e]}),o}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_matchesStrictComparable.js":function(e,t){function o(e,t){return function(o){return null!=o&&o[e]===t&&(void 0!==t||e in Object(o))}}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_memoizeCapped.js":function(e,t,o){function n(e){var t=r(e,function(e){return o.size===s&&o.clear(),e}),o=t.cache;return t}var r=o("./node_modules/griddle-react/node_modules/lodash/memoize.js"),s=500;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_nativeCreate.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_getNative.js"),r=n(Object,"create");e.exports=r},"./node_modules/griddle-react/node_modules/lodash/_nativeKeys.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_overArg.js"),r=n(Object.keys,Object);e.exports=r},"./node_modules/griddle-react/node_modules/lodash/_nativeKeysIn.js":function(e,t){function o(e){var t=[];if(null!=e)for(var o in Object(e))t.push(o);return t}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_nodeUtil.js":function(e,t,o){(function(e){var n=o("./node_modules/griddle-react/node_modules/lodash/_freeGlobal.js"),r="object"==typeof t&&t&&!t.nodeType&&t,s=r&&"object"==typeof e&&e&&!e.nodeType&&e,l=s&&s.exports===r,i=l&&n.process,a=function(){try{return i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a}).call(t,o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/griddle-react/node_modules/lodash/_objectToString.js":function(e,t){function o(e){return r.call(e)}var n=Object.prototype,r=n.toString;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_overArg.js":function(e,t){function o(e,t){return function(o){return e(t(o))}}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_overRest.js":function(e,t,o){function n(e,t,o){return t=s(void 0===t?e.length-1:t,0),function(){for(var n=arguments,l=-1,i=s(n.length-t,0),a=Array(i);++l0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var n=800,r=16,s=Date.now;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_stackClear.js":function(e,t,o){function n(){this.__data__=new r,this.size=0}var r=o("./node_modules/griddle-react/node_modules/lodash/_ListCache.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_stackDelete.js":function(e,t){function o(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_stackGet.js":function(e,t){function o(e){return this.__data__.get(e)}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_stackHas.js":function(e,t){function o(e){return this.__data__.has(e)}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_stackSet.js":function(e,t,o){function n(e,t){var o=this.__data__;if(o instanceof r){var n=o.__data__;if(!s||n.length-1:!!u&&r(e,t,o)>-1}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseIndexOf.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isString.js"),i=o("./node_modules/griddle-react/node_modules/lodash/toInteger.js"),a=o("./node_modules/griddle-react/node_modules/lodash/values.js"),d=Math.max;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/initial.js":function(e,t,o){function n(e){return(null==e?0:e.length)?r(e,0,-1):[]}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseSlice.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/intersection.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_arrayMap.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_baseIntersection.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseRest.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_castArrayLikeObject.js"),i=s(function(e){var t=n(e,l);return t.length&&t[0]===e[0]?r(t):[]});e.exports=i},"./node_modules/griddle-react/node_modules/lodash/isArguments.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_baseIsArguments.js"),r=o("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js"),s=Object.prototype,l=s.hasOwnProperty,i=s.propertyIsEnumerable,a=n(function(){return arguments}())?n:function(e){return r(e)&&l.call(e,"callee")&&!i.call(e,"callee")};e.exports=a},"./node_modules/griddle-react/node_modules/lodash/isArray.js":function(e,t){var o=Array.isArray;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isArrayLike.js":function(e,t,o){function n(e){return null!=e&&s(e.length)&&!r(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/isFunction.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isLength.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isArrayLikeObject.js":function(e,t,o){function n(e){return s(e)&&r(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isBuffer.js":function(e,t,o){(function(e){var n=o("./node_modules/griddle-react/node_modules/lodash/_root.js"),r=o("./node_modules/griddle-react/node_modules/lodash/stubFalse.js"),s="object"==typeof t&&t&&!t.nodeType&&t,l=s&&"object"==typeof e&&e&&!e.nodeType&&e,i=l&&l.exports===s,a=i?n.Buffer:void 0,d=a?a.isBuffer:void 0,u=d||r;e.exports=u}).call(t,o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/griddle-react/node_modules/lodash/isEmpty.js":function(e,t,o){function n(e){if(null==e)return!0;if(a(e)&&(i(e)||"string"==typeof e||"function"==typeof e.splice||d(e)||c(e)||l(e)))return!e.length;var t=s(e);if(t==p||t==f)return!e.size;if(u(e))return!r(e).length;for(var o in e)if(m.call(e,o))return!1;return!0}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseKeys.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_getTag.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isArguments.js"),i=o("./node_modules/griddle-react/node_modules/lodash/isArray.js"),a=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js"),d=o("./node_modules/griddle-react/node_modules/lodash/isBuffer.js"),u=o("./node_modules/griddle-react/node_modules/lodash/_isPrototype.js"),c=o("./node_modules/griddle-react/node_modules/lodash/isTypedArray.js"),p="[object Map]",f="[object Set]",h=Object.prototype,m=h.hasOwnProperty;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isFunction.js":function(e,t,o){function n(e){if(!s(e))return!1;var t=r(e);return t==i||t==a||t==l||t==d}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isObject.js"),l="[object AsyncFunction]",i="[object Function]",a="[object GeneratorFunction]",d="[object Proxy]";e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isLength.js":function(e,t){function o(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}var n=9007199254740991;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isNull.js":function(e,t){function o(e){return null===e}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isObject.js":function(e,t){function o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isObjectLike.js":function(e,t){function o(e){return null!=e&&"object"==typeof e}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isPlainObject.js":function(e,t,o){function n(e){if(!l(e)||r(e)!=i)return!1;var t=s(e);if(null===t)return!0;var o=c.call(t,"constructor")&&t.constructor;return"function"==typeof o&&o instanceof o&&u.call(o)==p}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_getPrototype.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js"),i="[object Object]",a=Function.prototype,d=Object.prototype,u=a.toString,c=d.hasOwnProperty,p=u.call(Object);e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isString.js":function(e,t,o){function n(e){return"string"==typeof e||!s(e)&&l(e)&&r(e)==i}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isArray.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js"),i="[object String]";e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isSymbol.js":function(e,t,o){function n(e){return"symbol"==typeof e||s(e)&&r(e)==l}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js"),l="[object Symbol]";e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isTypedArray.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_baseIsTypedArray.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_baseUnary.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_nodeUtil.js"),l=s&&s.isTypedArray,i=l?r(l):n;e.exports=i},"./node_modules/griddle-react/node_modules/lodash/isUndefined.js":function(e,t){function o(e){return void 0===e}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/keys.js":function(e,t,o){function n(e){return l(e)?r(e):s(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_arrayLikeKeys.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseKeys.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/keysIn.js":function(e,t,o){function n(e){return l(e)?r(e,!0):s(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_arrayLikeKeys.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseKeysIn.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/last.js":function(e,t){function o(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/map.js":function(e,t,o){function n(e,t){return(i(e)?r:l)(e,s(t,3))}var r=o("./node_modules/griddle-react/node_modules/lodash/_arrayMap.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseIteratee.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_baseMap.js"),i=o("./node_modules/griddle-react/node_modules/lodash/isArray.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/memoize.js":function(e,t,o){function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(s);var o=function(){var n=arguments,r=t?t.apply(this,n):n[0],s=o.cache;if(s.has(r))return s.get(r);var l=e.apply(this,n);return o.cache=s.set(r,l)||s,l};return o.cache=new(n.Cache||r),o}var r=o("./node_modules/griddle-react/node_modules/lodash/_MapCache.js"),s="Expected a function";n.Cache=r,e.exports=n},"./node_modules/griddle-react/node_modules/lodash/omit.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_arrayMap.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_baseClone.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseUnset.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_castPath.js"),i=o("./node_modules/griddle-react/node_modules/lodash/_copyObject.js"),a=o("./node_modules/griddle-react/node_modules/lodash/_customOmitClone.js"),d=o("./node_modules/griddle-react/node_modules/lodash/_flatRest.js"),u=o("./node_modules/griddle-react/node_modules/lodash/_getAllKeysIn.js"),c=d(function(e,t){var o={};if(null==e)return o;var d=!1;t=n(t,function(t){return t=l(t,e),d||(d=t.length>1),t}),i(e,u(e),o),d&&(o=r(o,7,a));for(var c=t.length;c--;)s(o,t[c]);return o});e.exports=c},"./node_modules/griddle-react/node_modules/lodash/orderBy.js":function(e,t,o){function n(e,t,o,n){return null==e?[]:(s(t)||(t=null==t?[]:[t]),o=n?void 0:o,s(o)||(o=null==o?[]:[o]),r(e,t,o))}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseOrderBy.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isArray.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/pick.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_basePick.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_flatRest.js"),s=r(function(e,t){return null==e?{}:n(e,t)});e.exports=s},"./node_modules/griddle-react/node_modules/lodash/property.js":function(e,t,o){function n(e){return l(e)?r(i(e)):s(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseProperty.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_basePropertyDeep.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_isKey.js"),i=o("./node_modules/griddle-react/node_modules/lodash/_toKey.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/sortBy.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_baseFlatten.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_baseOrderBy.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseRest.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_isIterateeCall.js"),i=s(function(e,t){if(null==e)return[];var o=t.length;return o>1&&l(e,t[0],t[1])?t=[]:o>2&&l(t[0],t[1],t[2])&&(t=[t[0]]),r(e,n(t,1),[])});e.exports=i},"./node_modules/griddle-react/node_modules/lodash/stubArray.js":function(e,t){function o(){return[]}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/stubFalse.js":function(e,t){function o(){return!1}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/take.js":function(e,t,o){function n(e,t,o){return e&&e.length?(t=o||void 0===t?1:s(t),r(e,0,t<0?0:t)):[]}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseSlice.js"),s=o("./node_modules/griddle-react/node_modules/lodash/toInteger.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/toFinite.js":function(e,t,o){function n(e){return e?(e=r(e))===s||e===-s?(e<0?-1:1)*l:e===e?e:0:0===e?e:0}var r=o("./node_modules/griddle-react/node_modules/lodash/toNumber.js"),s=1/0,l=1.7976931348623157e308;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/toInteger.js":function(e,t,o){function n(e){var t=r(e),o=t%1;return t===t?o?t-o:t:0}var r=o("./node_modules/griddle-react/node_modules/lodash/toFinite.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/toNumber.js":function(e,t,o){function n(e){if("number"==typeof e)return e;if(s(e))return l;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var o=d.test(e);return o||u.test(e)?c(e.slice(2),o?2:8):a.test(e)?l:+e}var r=o("./node_modules/griddle-react/node_modules/lodash/isObject.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isSymbol.js"),l=NaN,i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/toPairs.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_createToPairs.js"),r=o("./node_modules/griddle-react/node_modules/lodash/keys.js"),s=n(r);e.exports=s},"./node_modules/griddle-react/node_modules/lodash/toString.js":function(e,t,o){function n(e){return null==e?"":r(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseToString.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/uniqueId.js":function(e,t,o){function n(e){var t=++s;return r(e)+t}var r=o("./node_modules/griddle-react/node_modules/lodash/toString.js"),s=0;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/values.js":function(e,t,o){function n(e){return null==e?[]:r(e,s(e))}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseValues.js"),s=o("./node_modules/griddle-react/node_modules/lodash/keys.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/without.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_baseDifference.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_baseRest.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isArrayLikeObject.js"),l=r(function(e,t){return s(e)?n(e,t):[]});e.exports=l},"./node_modules/griddle-react/node_modules/lodash/zipObject.js":function(e,t,o){function n(e,t){return s(e||[],t||[],r)}var r=o("./node_modules/griddle-react/node_modules/lodash/_assignValue.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseZipObject.js");e.exports=n},"./node_modules/react-selectable/dist/react-selectable.js":function(e,t,o){!function(t,n){e.exports=function(e,t){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.nodeInRoot=t.isNodeIn=t.createSelectable=t.SelectableGroup=void 0;var r=o(1),s=n(r),l=o(9),i=n(l),a=o(5),d=n(a),u=o(4),c=n(u);t.SelectableGroup=s.default,t.createSelectable=i.default,t.isNodeIn=d.default,t.nodeInRoot=c.default},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i=function(){function e(e,t){for(var o=0;oo+i||t+r-an+l)};t.default=function(e,t,o){var n=e instanceof HTMLElement?(0,r.default)(e):e,l=t instanceof HTMLElement?(0,r.default)(t):t;return s(n.top,n.left,l.top,l.left,n.offsetWidth,n.offsetHeight,l.offsetWidth,l.offsetHeight,o)}},function(e,t){(function(t){"use strict";function o(e,t,o){function n(t){var o=m,n=_;return m=_=void 0,E=t,y=e.apply(n,o)}function s(e){return E=e,v=setTimeout(u,t),P?n(e):y}function l(e){var o=e-b,n=e-E,r=t-o;return w?S(r,g-n):r}function a(e){var o=e-b,n=e-E;return void 0===b||o>=t||o<0||w&&n>=g}function u(){var e=C();if(a(e))return c(e);v=setTimeout(u,l(e))}function c(e){return v=void 0,T&&m?n(e):(m=_=void 0,y)}function p(){void 0!==v&&clearTimeout(v),E=0,m=b=_=v=void 0}function f(){return void 0===v?y:c(C())}function h(){var e=C(),o=a(e);if(m=arguments,_=this,b=e,o){if(void 0===v)return s(b);if(w)return v=setTimeout(u,t),n(b)}return void 0===v&&(v=setTimeout(u,t)),y}var m,_,g,y,v,b,E=0,P=!1,w=!1,T=!0;if("function"!=typeof e)throw new TypeError(d);return t=i(t)||0,r(o)&&(P=!!o.leading,w="maxWait"in o,g=w?j(i(o.maxWait)||0,t):g,T="trailing"in o?!!o.trailing:T),h.cancel=p,h.flush=f,h}function n(e,t,n){var s=!0,l=!0;if("function"!=typeof e)throw new TypeError(d);return r(n)&&(s="leading"in n?!!n.leading:s,l="trailing"in n?!!n.trailing:l),o(e,t,{leading:s,maxWait:t,trailing:l})}function r(e){var t=void 0===e?"undefined":a(e);return!!e&&("object"==t||"function"==t)}function s(e){return!!e&&"object"==(void 0===e?"undefined":a(e))}function l(e){return"symbol"==(void 0===e?"undefined":a(e))||s(e)&&E.call(e)==c}function i(e){if("number"==typeof e)return e;if(l(e))return u;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(p,"");var o=h.test(e);return o||m.test(e)?_(e.slice(2),o?2:8):f.test(e)?u:+e}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d="Expected a function",u=NaN,c="[object Symbol]",p=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,m=/^0o[0-7]+$/i,_=parseInt,g="object"==(void 0===t?"undefined":a(t))&&t&&t.Object===Object&&t,y="object"==("undefined"==typeof self?"undefined":a(self))&&self&&self.Object===Object&&self,v=g||y||Function("return this")(),b=Object.prototype,E=b.toString,j=Math.max,S=Math.min,C=function(){return v.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i=function(){function e(e,t){for(var o=0;o-1}var r=o("./node_modules/redux-form/node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/redux-form/node_modules/lodash/_listCacheSet.js":function(e,t,o){function n(e,t){var o=this.__data__,n=r(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this}var r=o("./node_modules/redux-form/node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/redux-form/node_modules/lodash/_mapCacheClear.js":function(e,t,o){function n(){this.size=0,this.__data__={hash:new r,map:new(l||s),string:new r}}var r=o("./node_modules/redux-form/node_modules/lodash/_Hash.js"),s=o("./node_modules/redux-form/node_modules/lodash/_ListCache.js"),l=o("./node_modules/redux-form/node_modules/lodash/_Map.js");e.exports=n},"./node_modules/redux-form/node_modules/lodash/_mapCacheDelete.js":function(e,t,o){function n(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}var r=o("./node_modules/redux-form/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/redux-form/node_modules/lodash/_mapCacheGet.js":function(e,t,o){function n(e){return r(this,e).get(e)}var r=o("./node_modules/redux-form/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/redux-form/node_modules/lodash/_mapCacheHas.js":function(e,t,o){function n(e){return r(this,e).has(e)}var r=o("./node_modules/redux-form/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/redux-form/node_modules/lodash/_mapCacheSet.js":function(e,t,o){function n(e,t){var o=r(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this}var r=o("./node_modules/redux-form/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/redux-form/node_modules/lodash/_memoizeCapped.js":function(e,t,o){function n(e){var t=r(e,function(e){return o.size===s&&o.clear(),e}),o=t.cache;return t}var r=o("./node_modules/redux-form/node_modules/lodash/memoize.js"),s=500;e.exports=n},"./node_modules/redux-form/node_modules/lodash/_nativeCreate.js":function(e,t,o){var n=o("./node_modules/redux-form/node_modules/lodash/_getNative.js"),r=n(Object,"create");e.exports=r},"./node_modules/redux-form/node_modules/lodash/_objectToString.js":function(e,t){function o(e){return r.call(e)}var n=Object.prototype,r=n.toString;e.exports=o},"./node_modules/redux-form/node_modules/lodash/_root.js":function(e,t,o){var n=o("./node_modules/redux-form/node_modules/lodash/_freeGlobal.js"),r="object"==typeof self&&self&&self.Object===Object&&self,s=n||r||Function("return this")();e.exports=s},"./node_modules/redux-form/node_modules/lodash/_stringToPath.js":function(e,t,o){var n=o("./node_modules/redux-form/node_modules/lodash/_memoizeCapped.js"),r=/^\./,s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/\\(\\)?/g,i=n(function(e){var t=[];return r.test(e)&&t.push(""),e.replace(s,function(e,o,n,r){t.push(n?r.replace(l,"$1"):o||e)}),t});e.exports=i},"./node_modules/redux-form/node_modules/lodash/_toKey.js":function(e,t,o){function n(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}var r=o("./node_modules/redux-form/node_modules/lodash/isSymbol.js"),s=1/0;e.exports=n},"./node_modules/redux-form/node_modules/lodash/_toSource.js":function(e,t){function o(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var n=Function.prototype,r=n.toString;e.exports=o},"./node_modules/redux-form/node_modules/lodash/eq.js":function(e,t){function o(e,t){return e===t||e!==e&&t!==t}e.exports=o},"./node_modules/redux-form/node_modules/lodash/isArray.js":function(e,t){var o=Array.isArray;e.exports=o},"./node_modules/redux-form/node_modules/lodash/isFunction.js":function(e,t,o){function n(e){if(!s(e))return!1;var t=r(e);return t==i||t==a||t==l||t==d}var r=o("./node_modules/redux-form/node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/redux-form/node_modules/lodash/isObject.js"),l="[object AsyncFunction]",i="[object Function]",a="[object GeneratorFunction]",d="[object Proxy]";e.exports=n},"./node_modules/redux-form/node_modules/lodash/isObject.js":function(e,t){function o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=o},"./node_modules/redux-form/node_modules/lodash/isObjectLike.js":function(e,t){function o(e){return null!=e&&"object"==typeof e}e.exports=o},"./node_modules/redux-form/node_modules/lodash/isSymbol.js":function(e,t,o){function n(e){return"symbol"==typeof e||s(e)&&r(e)==l}var r=o("./node_modules/redux-form/node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/redux-form/node_modules/lodash/isObjectLike.js"),l="[object Symbol]";e.exports=n},"./node_modules/redux-form/node_modules/lodash/memoize.js":function(e,t,o){function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(s);var o=function(){var n=arguments,r=t?t.apply(this,n):n[0],s=o.cache;if(s.has(r))return s.get(r);var l=e.apply(this,n);return o.cache=s.set(r,l)||s,l};return o.cache=new(n.Cache||r),o}var r=o("./node_modules/redux-form/node_modules/lodash/_MapCache.js"),s="Expected a function";n.Cache=r,e.exports=n},"./node_modules/redux-form/node_modules/lodash/toPath.js":function(e,t,o){function n(e){return l(e)?r(e,d):i(e)?[e]:s(a(u(e)))}var r=o("./node_modules/redux-form/node_modules/lodash/_arrayMap.js"),s=o("./node_modules/redux-form/node_modules/lodash/_copyArray.js"),l=o("./node_modules/redux-form/node_modules/lodash/isArray.js"),i=o("./node_modules/redux-form/node_modules/lodash/isSymbol.js"),a=o("./node_modules/redux-form/node_modules/lodash/_stringToPath.js"),d=o("./node_modules/redux-form/node_modules/lodash/_toKey.js"),u=o("./node_modules/redux-form/node_modules/lodash/toString.js");e.exports=n},"./node_modules/redux-form/node_modules/lodash/toString.js":function(e,t,o){function n(e){return null==e?"":r(e)}var r=o("./node_modules/redux-form/node_modules/lodash/_baseToString.js");e.exports=n},"./node_modules/webpack/buildin/global.js":function(e,t){var o;o=function(){return this}();try{o=o||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(o=window)}e.exports=o},"./node_modules/webpack/buildin/module.js":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},0:function(e,t){e.exports=React},1:function(e,t){e.exports=i18n},10:function(e,t){e.exports=InsertMediaModal},11:function(e,t){e.exports=FormBuilderModal},12:function(e,t){e.exports=DataFormat},13:function(e,t){e.exports=DeepFreezeStrict},14:function(e,t){e.exports=GraphQLTag},15:function(e,t){e.exports=ReactDND},16:function(e,t){e.exports=SchemaActions},17:function(e,t){e.exports=Badge},18:function(e,t){e.exports=FormBuilderLoader},19:function(e,t){e.exports=Backend},2:function(e,t){e.exports=Injector},20:function(e,t){e.exports=Config},21:function(e,t){e.exports=ReactDNDHtml5Backend},22:function(e,t){e.exports=Reactstrap},23:function(e,t){e.exports=ReduxForm},24:function(e,t){e.exports=getFormState},26:function(e,t){e.exports=Breadcrumb},27:function(e,t){e.exports=BreadcrumbsActions},28:function(e,t){e.exports=FieldHolder},29:function(e,t){e.exports=FileSchemaModalHandler},3:function(e,t){e.exports=ReactRedux},30:function(e,t){e.exports=Focusedzone},31:function(e,t){e.exports=FormAlert},32:function(e,t){e.exports=ReactAddonsCssTransitionGroup},33:function(e,t){e.exports=ReactAddonsTestUtils},34:function(e,t){e.exports=ReactRouteRegister},35:function(e,t){e.exports=ReactRouter},36:function(e,t){e.exports=Toolbar},37:function(e,t){e.exports=TreeDropdownField},38:function(e,t){e.exports=UnsavedFormsActions},39:function(e,t){e.exports=qs},4:function(e,t){e.exports=Redux},40:function(e,t){e.exports=reduxFieldReducer},41:function(e,t){e.exports=schemaFieldValues},5:function(e,t){e.exports=ReactDom},6:function(e,t){e.exports=jQuery},8:function(e,t){e.exports=ReactApollo},9:function(e,t){e.exports=classnames}}); \ No newline at end of file +!function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var o={};t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s="./client/src/bundles/bundle.js")}({"./client/src/boot/applyTransform.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(2),s=n(r),l=o("./client/src/transforms/AssetAdmin/insertAssetModal.js"),i=n(l),a=o("./client/src/transforms/FormAction/ownerAwareUnpublish.js"),d=n(a),u=o("./client/src/transforms/TreeDropdownField/moveTreeDropdownField.js"),c=n(u),p=function(){s.default.transform("insert-media-modal",function(e){e.form.alterSchema("AssetAdmin.EditForm.fileInsertForm",i.default)}),s.default.transform("move-form-disabled",function(e){e.component("TreeDropdownField.AssetAdmin.MoveForm",c.default)}),s.default.transform("owner-unpublishing",function(e){e.component("FormAction.AssetAdmin.EditForm.action_unpublish",d.default)})};t.default=p},"./client/src/boot/index.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var r=o(20),s=n(r),l=o(34),i=n(l),a=o("./client/src/containers/AssetAdmin/AssetAdminRouter.js"),d=n(a),u=o("./client/src/boot/applyTransform.js"),c=n(u),p=o("./client/src/boot/registerReducers.js"),f=n(p),h=o("./client/src/boot/registerComponents.js"),m=n(h),_=o("./client/src/boot/registerQueries.js"),g=n(_);document.addEventListener("DOMContentLoaded",function(){(0,m.default)(),(0,c.default)();var e=s.default.getSection("SilverStripe\\AssetAdmin\\Controller\\AssetAdmin");i.default.add({path:e.url,component:d.default,indexRoute:{component:d.default},childRoutes:[{path:"show/:folderId/:viewAction/:fileId",component:d.default},{path:"show/:folderId/:viewAction",component:d.default},{path:"show/:folderId",component:d.default}]}),(0,g.default)(),(0,f.default)()})},"./client/src/boot/registerComponents.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(2),s=n(r),l=o("./client/src/components/UploadField/UploadField.js"),i=n(l),a=o("./client/src/components/UploadField/UploadFieldItem.js"),d=n(a),u=o("./client/src/components/AssetDropzone/AssetDropzone.js"),c=n(u),p=o(10),f=n(p),h=o("./client/src/components/PreviewImageField/PreviewImageField.js"),m=n(h),_=o("./client/src/components/ProportionConstraintField/ProportionConstraintField.js"),g=n(_),y=o("./client/src/containers/HistoryList/HistoryList.js"),v=n(y),b=o("./client/src/components/GalleryToolbar/GalleryToolbar.js"),E=n(b),j=o("./client/src/components/GalleryItem/GalleryItem.js"),S=function(){s.default.component.registerMany({UploadField:i.default,UploadFieldItem:d.default,PreviewImageField:m.default,HistoryList:v.default,ProportionConstraintField:g.default,AssetDropzone:c.default,InsertMediaModal:f.default,GalleryToolbar:E.default,GalleryItemFile:j.File,GalleryItemFolder:j.Folder})};t.default=S},"./client/src/boot/registerQueries.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(2),r=function(e){return e&&e.__esModule?e:{default:e}}(n),s=o("./client/src/lib/fileFragments.js"),l=function(){r.default.query.registerFragment("FileInterfaceFields",s.fileInterface),r.default.query.registerFragment("FileFields",s.file),r.default.query.registerFragment("FolderFields",s.folder)};t.default=l},"./client/src/boot/registerReducers.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=o(2),s=n(r),l=o(4),i=o("./client/src/state/gallery/GalleryReducer.js"),a=n(i),d=o("./client/src/state/queuedFiles/QueuedFilesReducer.js"),u=n(d),c=o("./client/src/state/uploadField/UploadFieldReducer.js"),p=n(c),f=o("./client/src/state/previewField/PreviewFieldReducer.js"),h=n(f),m=o("./client/src/state/imageLoad/ImageLoadReducer.js"),_=n(m),g=function(){s.default.reducer.register("assetAdmin",(0,l.combineReducers)({gallery:a.default,queuedFiles:u.default,uploadField:p.default,previewField:h.default,imageLoad:_.default}))};t.default=g},"./client/src/bundles/bundle.js":function(e,t,o){"use strict";o("./node_modules/expose-loader/index.js?InsertMediaModal!./client/src/containers/InsertMediaModal/InsertMediaModal.js-exposed"),o("./node_modules/expose-loader/index.js?InsertEmbedModal!./client/src/components/InsertEmbedModal/InsertEmbedModal.js-exposed"),o("./client/src/boot/index.js"),o("./client/src/entwine/UploadField/UploadFieldEntwine.js")},"./client/src/components/AssetDropzone/AssetDropzone.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i=Object.assign||function(e){for(var t=1;t2});return t<2?p.default.createElement(m.Button,{className:o,key:e.value,onClick:this.handleChangeValue,value:e.value},e.label):p.default.createElement(m.DropdownItem,{type:"button",className:o,key:e.value,onClick:this.handleChangeValue,value:e.value},e.label)}},{key:"render",value:function(){var e=this;if(!this.props.items.length)return null;var t=this.props.actions.filter(function(t){return!t.canApply||t.canApply(e.props.items)});if(t=t.map(this.renderChild),!t.length)return null;var o=this.props,n=o.ActionMenu,r=o.showCount,s=this.props.items.length;return p.default.createElement("div",{className:"bulk-actions fieldholder-small"},r&&p.default.createElement("div",{className:"bulk-actions-counter"},s),t.slice(0,2),t.length>2&&n?p.default.createElement(n,{id:"BulkActions",className:"bulk-actions__more-actions-menu"},t.slice(2)):t.slice(2))}}]),t}(c.Component);y.propTypes={items:c.PropTypes.array,actions:c.PropTypes.arrayOf(c.PropTypes.shape({value:c.PropTypes.string.isRequired,label:c.PropTypes.string.isRequired,className:c.PropTypes.string,destructive:c.PropTypes.bool,callback:c.PropTypes.func,canApply:c.PropTypes.func,confirm:c.PropTypes.func})),ActionMenu:c.PropTypes.oneOfType([c.PropTypes.node,c.PropTypes.func]),showCount:c.PropTypes.bool},y.defaultProps={items:[],actions:[],ActionMenu:null,total:null,showCount:!0,totalReachedMessage:u.default._t("")};var v=(0,f.connect)(i)(y);t.Component=y,t.default=(0,h.inject)(["ActionMenu"],function(e){return{ActionMenu:e}},function(){return"BulkActions"})(v)},"./client/src/components/GalleryItem/GalleryItem.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var o={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);return o}function s(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function l(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 a(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 d(e){return e.item.thumbnail&&"image"===e.item.category&&e.item.exists&&!e.item.queuedId&&e.sectionConfig.imageRetry.minRetry&&e.sectionConfig.imageRetry.maxRetry}function u(e,t){if(d(t)){var o=e.assetAdmin.imageLoad,n=o.files.find(function(e){return t.item.thumbnail===e.url});return{loadState:n&&n.status||L.default.NONE}}return{loadState:L.default.DISABLED}}function c(e){return{actions:{imageLoad:(0,D.bindActionCreators)(R,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.File=t.Folder=t.Component=void 0;var p=Object.assign||function(e){for(var t=1;t0}},{key:"missing",value:function(){return!this.exists()&&this.saved()}},{key:"uploading",value:function(){return this.props.item.queuedId&&!this.saved()}},{key:"exists",value:function(){return this.props.item.exists}},{key:"isImage",value:function(){return"image"===this.props.item.category}},{key:"canBatchSelect",value:function(){return this.props.selectable&&this.props.item.canEdit}},{key:"hasError",value:function(){var e=!1;return this.props.item.message&&(e="error"===this.props.item.message.type),e}},{key:"handleActivate",value:function(e){e.stopPropagation(),"function"==typeof this.props.onActivate&&this.saved()&&this.props.onActivate(e,this.props.item)}},{key:"handleSelect",value:function(e){e.stopPropagation(),e.preventDefault(),"function"==typeof this.props.onSelect&&this.props.onSelect(e,this.props.item)}},{key:"handleKeyDown",value:function(e){E.default.SPACE_KEY_CODE===e.keyCode&&(e.preventDefault(),this.canBatchSelect()&&this.handleSelect(e)),E.default.RETURN_KEY_CODE===e.keyCode&&this.handleActivate(e)}},{key:"handleCancelUpload",value:function(e){e.stopPropagation(),e.preventDefault(),this.hasError()?this.props.onRemoveErroredUpload(this.props.item):this.props.onCancelUpload&&this.props.onCancelUpload(this.props.item)}},{key:"render",value:function(){var e=this,t=null,o=null,n=null,r=this.props.item,s=r.id,l=r.queuedId,i=s?"item-"+s:"queued-"+l;if(this.props.selectable&&(this.canBatchSelect()&&(t=this.handleSelect),o="font-icon-tick"),this.uploading())t=this.handleCancelUpload,o="font-icon-cancel";else if(this.exists()){var a=m.default._t("AssetAdmin.DETAILS","Details");n=g.default.createElement("div",{className:"gallery-item--overlay font-icon-edit"},a)}var d=this.props.badge,u={className:"gallery-item__checkbox",type:"checkbox",title:m.default._t("AssetAdmin.SELECT","Select"),tabIndex:-1,onMouseDown:U,id:i},c=["gallery-item__checkbox-label",o];this.canBatchSelect()||(u.disabled=!0,c.push("gallery-item__checkbox-label--disabled"));var f={className:c.join(" "),onClick:t};return g.default.createElement("div",{className:this.getItemClassNames(),"data-id":this.props.item.id,tabIndex:0,role:"button",onKeyDown:this.handleKeyDown,onClick:this.handleActivate},!!d&&g.default.createElement(F.default,{className:"gallery-item__badge",status:d.status,message:d.message}),g.default.createElement("div",{ref:function(t){e.thumbnail=t},className:this.getThumbnailClassNames(),style:this.getThumbnailStyles()},n,this.getStatusFlags()),this.getProgressBar(),this.getErrorMessage(),this.props.children,g.default.createElement("div",{className:"gallery-item__title",ref:function(t){e.title=t}},g.default.createElement("label",p({},f,{htmlFor:i}),g.default.createElement("input",u)),this.props.item.title))}}]),t}(_.Component);G.propTypes={sectionConfig:x.default,item:S.default,loadState:_.PropTypes.oneOf(Object.values(L.default)),highlighted:_.PropTypes.bool,selected:_.PropTypes.bool,isDropping:_.PropTypes.bool,isDragging:_.PropTypes.bool,message:_.PropTypes.shape({value:_.PropTypes.string,type:_.PropTypes.string}),selectable:_.PropTypes.bool,onActivate:_.PropTypes.func,onSelect:_.PropTypes.func,onCancelUpload:_.PropTypes.func,onRemoveErroredUpload:_.PropTypes.func,badge:_.PropTypes.shape({status:_.PropTypes.string,message:_.PropTypes.string}),updateStatusFlags:_.PropTypes.func,updateProgressBar:_.PropTypes.func,updateErrorMessage:_.PropTypes.func},G.defaultProps={item:{},sectionConfig:{imageRetry:{}},updateStatusFlags:function(e){return e},updateProgressBar:function(e){return e},updateErrorMessage:function(e){return e}};var B=(0,A.connect)(u,c)(G),H=(0,k.createSelectable)((0,P.default)("GalleryItem")(B)),q=(0,k.createSelectable)((0,T.default)("GalleryItem")(H));t.Component=G,t.Folder=q,t.File=H,t.default=B},"./client/src/components/GalleryItem/GalleryItemDragLayer.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i=Object.assign||function(e){for(var t=1;t1?u.default.createElement("div",{key:"1",className:"gallery-item__drag-shadow"}):null,t>2?u.default.createElement("div",{key:"2",className:"gallery-item__drag-shadow gallery-item__drag-shadow--second"}):null];return u.default.createElement("div",{className:"gallery-item__drag-layer"},u.default.createElement("div",{className:"gallery-item__drag-layer-item",style:this.getOffset()},u.default.createElement("div",{className:"gallery-item__drag-layer-preview"},o,u.default.createElement(f.default,i({},e.props,{isDragging:!0}))),t>1?u.default.createElement(m.default,{className:"gallery-item__drag-layer-count",status:"info",message:""+t}):null))}}]),t}(d.Component);_.propTypes={item:d.PropTypes.object,offset:d.PropTypes.shape({x:d.PropTypes.number.isRequired,y:d.PropTypes.number.isRequired}),isDragging:d.PropTypes.bool.isRequired};var g=function(e){return{item:e.getItem(),offset:e.getInitialClientOffset(),dragged:e.getDifferenceFromInitialOffset(),isDragging:e.isDragging()}};t.default=(0,c.DragLayer)(g)(_)},"./client/src/components/GalleryItem/draggable.js":function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(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):e.__proto__=t)}function l(e){var t={canDrag:function(e){return e.canDrag},beginDrag:function(e){var t=e.item.id;"function"==typeof e.onDrag&&e.onDrag(!0,t);var o=e.selectedFiles.concat([]);return o.includes(t)||o.push(t),{selected:o,props:e}},endDrag:function(e){var t=e.item.id;"function"==typeof e.onDrag&&e.onDrag(!1,t)}},o=function(e,t){return{connectDragPreview:e.dragPreview(),connectDragSource:e.dragSource(),isDragging:t.isDragging()}},l=(0,u.DragSource)(e,t,o);return function(e){var t=function(t){function o(){return n(this,o),r(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return s(o,t),i(o,[{key:"componentDidMount",value:function(){this.props.connectDragPreview((0,c.getEmptyImage)(),{captureDraggingState:!0})}},{key:"render",value:function(){var t=this.props.connectDragSource,o=d.default.createElement(e,this.props);return t("string"==typeof o.type?o:d.default.createElement("div",{className:"gallery-item__draggable"},o))}}]),o}(a.Component);return t.propTypes={connectDragSource:a.PropTypes.func.isRequired,connectDragPreview:a.PropTypes.func.isRequired,item:a.PropTypes.shape({id:a.PropTypes.number.isRequired}).isRequired,onDrag:a.PropTypes.func,selectedFiles:a.PropTypes.arrayOf(a.PropTypes.number)},l(t)}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var o=0;o0&&r<100?f.default.createElement("div",{className:"preview-image-field__progress"},f.default.createElement("div",{className:"preview-image-field__progress-bar",style:{width:r+"%"}})):null,i=this.props.upload.message,a=null;return i?a=f.default.createElement("div",{className:"preview-image-field__message preview-image-field__message--"+i.type},i.value):100===r&&(a=f.default.createElement("div",{className:"preview-image-field__message preview-image-field__message--success"},c.default._t("AssetAdmin.REPlACE_FILE_SUCCESS","Upload successful, the file will be replaced when you Save."))),f.default.createElement("div",{className:"editor__thumbnail-container"},s||n,l,a)}},{key:"renderToolbar",value:function(){var e=this.canEdit();return this.props.data.url||e?f.default.createElement("div",{className:"preview-image-field__toolbar fill-height"},this.props.data.url?f.default.createElement("a",{href:this.props.data.url,target:"_blank",className:this.getButtonClasses("link")},"Open"):null,e?f.default.createElement("button",{id:"preview-replace-button",onClick:this.preventDefault,className:this.getButtonClasses("replace"),type:"button"},"Replace"):null,this.props.upload.progress||this.props.upload.message?f.default.createElement("button",{onClick:this.handleCancelUpload,className:this.getButtonClasses("remove"),type:"button"},"Remove"):null):null}},{key:"render",value:function(){var e=this.getDropzoneProps();if(this.canEdit())return f.default.createElement(m.default,e,this.renderImage(),this.renderToolbar());var t=["preview-image-field__container",this.props.className,this.props.extraClass];return f.default.createElement("div",{className:t.join(" ")},this.renderImage(),this.renderToolbar())}}]),t}(p.Component);O.propTypes={id:p.PropTypes.string.isRequired,name:p.PropTypes.string,className:p.PropTypes.string,extraClass:p.PropTypes.string,readOnly:p.PropTypes.bool,disabled:p.PropTypes.bool,onAutofill:p.PropTypes.func,formid:p.PropTypes.string,nameValue:p.PropTypes.string,data:p.PropTypes.shape({id:p.PropTypes.number,parentid:p.PropTypes.number,version:p.PropTypes.number,url:p.PropTypes.string,mock:p.PropTypes.bool,exists:p.PropTypes.bool,preview:p.PropTypes.string,category:p.PropTypes.string,nameField:p.PropTypes.string,uploadFileEndpoint:p.PropTypes.shape({url:p.PropTypes.string.isRequired,method:p.PropTypes.string.isRequired,payloadFormat:p.PropTypes.string}),initialValues:p.PropTypes.object}).isRequired,upload:p.PropTypes.shape({url:p.PropTypes.string,progress:p.PropTypes.number,xhr:p.PropTypes.object,category:p.PropTypes.string,message:p.PropTypes.shape({type:p.PropTypes.string.isRequired,value:p.PropTypes.string.isRequired})}),actions:p.PropTypes.object,securityID:p.PropTypes.string,confirm:p.PropTypes.func},O.defaultProps={extraClass:"",className:"",data:{},upload:{},confirm:function(e){return window.confirm(e)}},t.Component=O,t.default=(0,y.connect)(i,a)(O)},"./client/src/components/ProportionConstraintField/ProportionConstraintField.js":function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(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):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var l=function(){function e(e,t){for(var o=0;o0}function a(e,t){var o=e.form.formSchemas[t.searchFormSchemaUrl];if(!o||!o.name)return{formData:{}};var n=(0,w.default)((0,I.default)(e),o.name);return{formData:n&&n.values||{}}}function d(e){return{actions:{schema:(0,y.bindActionCreators)(S,e),reduxForm:(0,y.bindActionCreators)({reset:C.reset,initialize:C.initialize},e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.hasFilters=t.Component=void 0;var u=function(){function e(e,t){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:this.props;if("function"==typeof t.onChange){var o=t.files.filter(function(e){return e.id}).map(function(e){return e.id}),n={Files:o};t.onChange(e,{id:t.id,value:n})}}},{key:"handleUploadButton",value:function(e){e.preventDefault()}},{key:"handleAddShow",value:function(e){e.preventDefault(),this.setState({selecting:!0,selectingItem:null})}},{key:"handleHide",value:function(){this.setState({selecting:!1,selectingItem:null})}},{key:"handleAddInsert",value:function(e,t,o){return this.props.actions.uploadField.addFile(this.props.id,o),this.handleHide(),Promise.resolve({})}},{key:"handleInsertMany",value:function(e,t){var o=this;if(this.state.selectingItem)return void this.handleReplace(e,null,t[0]);t.forEach(function(t){o.handleAddInsert(e,null,t)})}},{key:"handleReplace",value:function(e,t,o){var n=this.state.selectingItem,r=this.props,s=r.id,l=r.actions.uploadField,i=l.addFile,a=l.removeFile;if(!n)throw new Error("Tried to replace a file when none was selected.");return a(s,n),i(s,o),this.handleHide(),Promise.resolve({})}},{key:"canEdit",value:function(){return!this.props.disabled&&!this.props.readOnly&&(this.props.data.canUpload||this.props.data.canAttach)}},{key:"canUpload",value:function(){return this.canEdit()&&this.props.data.canUpload}},{key:"canAttach",value:function(){return this.canEdit()&&this.props.data.canAttach}},{key:"renderDropzone",value:function(){var e=this.props.AssetDropzone;if(!this.props.data.createFileEndpoint)return null;var t={height:E.default.SMALL_THUMBNAIL_HEIGHT,width:E.default.SMALL_THUMBNAIL_WIDTH},o=this.getMaxFiles(),n={url:this.props.data.createFileEndpoint.url,method:this.props.data.createFileEndpoint.method,paramName:"Upload",maxFiles:o,thumbnailWidth:E.default.SMALL_THUMBNAIL_WIDTH,thumbnailHeight:E.default.SMALL_THUMBNAIL_HEIGHT},r=["uploadfield__dropzone"];if(0===o&&r.push("uploadfield__dropzone--hidden"),!this.canEdit())return this.props.files.length?null:_.default.createElement("p",null,h.default._t("AssetAdmin.EMPTY","No files"));var s=this.props.securityId,l=[];return this.canUpload()&&l.push(_.default.createElement("button",{key:"uploadbutton",type:"button",onClick:this.handleUploadButton,className:"uploadfield__upload-button"},h.default._t("AssetAdmin.BROWSE","Browse"))),this.canAttach()&&(l.length&&l.push(_.default.createElement("span",{key:"uploadjoin",className:"uploadfield__join"},h.default._t("AssetAdmin.OR","or"))),l.push(_.default.createElement("button",{key:"attachbutton",type:"button",onClick:this.handleAddShow,className:"uploadfield__add-button"},h.default._t("AssetAdmin.ADD_FILES","Add from files")))),_.default.createElement(e,{name:this.props.name,canUpload:this.canUpload(),uploadButton:!1,uploadSelector:".uploadfield__upload-button, .uploadfield__backdrop",folderId:this.props.data.parentid,onAddedFile:this.handleAddedFile,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:t,options:n,securityID:s,className:r.join(" ")},_.default.createElement("div",{className:"uploadfield__backdrop"}),_.default.createElement("span",{className:"uploadfield__droptext"},l))}},{key:"renderModal",value:function(){var e=this.props.InsertMediaModal,t=this.state,o=t.selecting,n=t.selectingItem,r=this.getMaxFiles(),s=this.getFolderId();return _.default.createElement(e,{title:!1,isOpen:o,onInsert:n?this.handleReplace:this.handleAddInsert,onClosed:this.handleHide,onInsertMany:this.handleInsertMany,maxFiles:n?1:r,type:"select",bodyClassName:"modal__dialog",className:"insert-media-react__dialog-wrapper",fileAttributes:n?{ID:n.id}:null,folderId:s})}},{key:"renderChild",value:function(e,t){var o=this.props.UploadFieldItem,n={key:e.id?"file-"+e.id:"queued-"+e.queuedId,item:e,name:this.props.name,onRemove:this.handleItemRemove,canEdit:this.canEdit(),onView:this.handleReplaceShow},r=this.props.getItemProps(n,t,this.props);return _.default.createElement(o,r)}},{key:"render",value:function(){return _.default.createElement("div",{className:"uploadfield"},this.renderDropzone(),this.props.files.map(this.renderChild),this.renderModal())}}]),t}(m.Component);O.propTypes={id:m.PropTypes.string.isRequired,name:m.PropTypes.string.isRequired,onChange:m.PropTypes.func,value:m.PropTypes.shape({Files:m.PropTypes.arrayOf(m.PropTypes.number)}),files:m.PropTypes.arrayOf(P.default),readOnly:m.PropTypes.bool,disabled:m.PropTypes.bool,data:m.PropTypes.shape({files:m.PropTypes.arrayOf(P.default),createFileEndpoint:m.PropTypes.shape({url:m.PropTypes.string.isRequired,method:m.PropTypes.string.isRequired,payloadFormat:m.PropTypes.string.isRequired}),multi:m.PropTypes.bool,parentid:m.PropTypes.number,canUpload:m.PropTypes.bool,canAttach:m.PropTypes.bool,maxFiles:m.PropTypes.number}),UploadFieldItem:m.PropTypes.oneOfType([m.PropTypes.node,m.PropTypes.func]),AssetDropzone:m.PropTypes.oneOfType([m.PropTypes.node,m.PropTypes.func]),InsertMediaModal:m.PropTypes.oneOfType([m.PropTypes.node,m.PropTypes.func]),getItemProps:m.PropTypes.func},O.defaultProps={value:{Files:[]},className:"",getItemProps:function(e){return e}};var F=(0,g.connect)(a,d)(O);t.Component=O,t.ConnectedUploadField=F,t.default=(0,y.compose)((0,v.inject)(["UploadFieldItem","AssetDropzone","InsertMediaModal"]),S.default)(F)},"./client/src/components/UploadField/UploadFieldItem.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i=function(){function e(e,t){for(var o=0;o0}},{key:"missing",value:function(){return!this.exists()&&this.saved()}},{key:"isImageSmallerThanThumbnail",value:function(){if(!this.isImage()||this.missing())return!1;var e=this.props.item.width,t=this.props.item.height;return t&&e&&t0}).length)return alert(r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_FOLDER","These folders contain files which are currently in use, you must move or delete their contents before you can delete the folder.")),void o("cancelled");var n=e.filter(function(e){return"folder"!==e.type&&e.inUseCount>0}),s=r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_CONFIRM","Are you sure you want to delete these files?");1===e.length&&1===n.length?s=r.default.sprintf(r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_SINGLE_CONFIRM","This file is currently used in %s place(s), are you sure you want to delete it?"),e[0].inUseCount):n.length>0&&(s=r.default.sprintf(r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_MULTI_CONFIRM","There are %s files currently in use, are you sure you want to delete these files?"),n.length)),n.length>0&&(s+="\n\n",s+=r.default._t("AssetAdmin.BULK_ACTIONS_DELETE_WARNING","Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.")),confirm(s)?t():o("cancelled")})})},{value:"edit",label:r.default._t("AssetAdmin.BULK_ACTIONS_EDIT","Edit"),className:"font-icon-edit",destructive:!1,canApply:function(e){return 1===e.length},callback:null},{value:"move",label:r.default._t("AssetAdmin.BULK_ACTIONS_MOVE","Move"),className:"font-icon-folder-move",canApply:function(e){return e.every(function(e){return e&&e.canEdit})},destructive:!1,callback:null},{value:"publish",label:r.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH","Publish"),className:"font-icon-rocket",destructive:!1,callback:null,canApply:function(e){return e.some(function(e){return e&&!e.published})&&e.every(function(e){return e.canEdit&&"folder"!==e.type})},confirm:null},{value:"unpublish",label:r.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH","Unpublish"),className:"font-icon-cancel-circled",destructive:!1,callback:null,canApply:function(e){return e.some(function(e){return e.published})&&e.every(function(e){return e.canEdit&&"folder"!==e.type})},confirm:null},{value:"insert",label:r.default._t("AssetAdmin.BULK_ACTIONS_INSERT","Insert"),className:"font-icon-plus-circled btn-primary",destructive:!1,callback:null,canApply:function(e){return e.length},confirm:null}],BULK_ACTIONS_PLACEHOLDER:r.default._t("AssetAdmin.BULK_ACTIONS_PLACEHOLDER"),SPACE_KEY_CODE:32,RETURN_KEY_CODE:13,DEFAULT_PREVIEW:"framework/client/dist/images/app_icons/generic_92.png",MODAL_MOVE:"MODAL_MOVE"}},"./client/src/containers/AssetAdmin/AssetAdmin.js":function(e,t,o){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function s(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t1&&void 0!==arguments[1])||arguments[1];return b.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:this.props.securityId}}:{}))}},{key:"handleBackButtonClick",value:function(e){e.preventDefault(),this.props.actions.gallery.deselectFiles(),this.props.folder?this.handleOpenFolder(this.props.folder.parentId||0):this.handleOpenFolder(0)}},{key:"resetFile",value:function(e){e.queuedId&&this.props.actions.queuedFiles.removeQueuedFile(e.queuedId),this.props.fileId===e.id&&(this.handleCloseFile(),this.handleOpenFile(e.id))}},{key:"handleFolderIcon",value:function(e){e.preventDefault(),this.handleOpenFile(this.getFolderId())}},{key:"handleOpenFile",value:function(e){this.handleBrowse(this.getFolderId(),e,this.props.query)}},{key:"handleSubmitEditor",value:function(e,t,o){var n=this,r=null;if("action_insert"===t&&"select"===this.props.type){var s=this.getFiles(),l=s.find(function(t){return t.id===parseInt(e.ID,10)});return this.props.onInsertMany(null,[l]),Promise.resolve()}if("function"==typeof this.props.onSubmitEditor){var i=this.findFile(this.props.fileId);r=this.props.onSubmitEditor(e,t,o,i)}else r=o();if(!r)throw new Error("Promise was not returned for submitting");return r.then(function(e){return"action_createfolder"===t&&"admin"===n.props.type&&n.handleOpenFile(e.record.id),n.props.actions.files.readFiles().then(function(){return"action_createfolder"===t&&"admin"!==n.props.type&&n.handleOpenFolder(n.getFolderId()),e})})}},{key:"handleCloseFile",value:function(){this.handleBrowse(this.getFolderId(),null,this.props.query)}},{key:"handleOpenFolder",value:function(e){var t=Object.assign({},this.props.query);delete t.page,delete t.filter,this.handleBrowse(e,null,t)}},{key:"handleDelete",value:function(e){var t=this,o=e.map(function(e){var o=t.findFile(e);if(!o)throw new Error("File selected for deletion cannot be found: "+e);return o.queuedId&&t.props.actions.queuedFiles.removeQueuedFile(o.queuedId),o}),n=o.map(function(e){return e.id}),r=this.props.folder?this.props.folder.id:0;return this.props.actions.files.deleteFiles(n).then(function(e){var o=e.data.deleteFiles;return t.handleBrowse(r,null,t.props.query),o})}},{key:"doUnpublish",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.map(function(e){var o=t.findFile(e);if(!o)throw new Error("File selected for unpublishing cannot be found: "+e);if("folder"===o.type)throw new Error("Cannot unpublish folders");return o}),r=n.map(function(e){return e.id});return this.props.actions.files.unpublishFiles(r,o).then(function(e){var o=e.data.unpublishFiles,n=o.filter(function(e){return"File"===e.__typename}),r=o.filter(function(e){return"PublicationNotice"===e.__typename&&"HAS_OWNERS"===e.Type}),s=n.map(function(e){return t.resetFile(e),e}),l=r.slice(0,4),i=r.slice(5),a=l.map(function(e){return e.Message});if(i.length&&a.push(j.default.inject(j.default._t("AssetAdmin.BULK_OWNED_WARNING_REMAINING","And {count} other file(s)"),{count:i.length})),l.length){var d=[j.default.inject(j.default._t("AssetAdmin.BULK_OWNED_WARNING_HEADING","{count} file(s) are being used by other published content."),{count:r.length}),a.join("\n"),j.default._t("AssetAdmin.BULK_OWNED_WARNING_FOOTER","Unpublishing will only remove files from the published version of the content. They will remain on the draft version. Unpublish anyway?")];if(confirm(d.join("\n\n"))){var u=r.reduce(function(e,t){return e.concat(t.IDs)},[]);return t.doUnpublish(u,!0).then(function(e){return s.concat(e)})}}return s})}},{key:"handleUnpublish",value:function(e){var t=this;return this.doUnpublish(e).then(function(e){var o=t.props.fileId;t.props.actions.files.readFiles().then(function(){o&&e.find(function(e){return e.id===o})&&(t.handleCloseFile(),t.handleOpenFile(o))})})}},{key:"doPublish",value:function(e){var t=this,o=e.map(function(e){var o=t.findFile(e);if(!o)throw new Error("File selected for publishing cannot be found: "+e);if("folder"===o.type)throw new Error("Cannot publish folders");return o}),n=o.map(function(e){return e.id});return this.props.actions.files.publishFiles(n).then(function(e){return e.data.publishFiles.filter(function(e){return"File"===e.__typename}).map(function(e){return t.resetFile(e),e})})}},{key:"findFile",value:function(e){return this.getFiles().find(function(t){return t.id===parseInt(e,10)})}},{key:"handleUpload",value:function(){}},{key:"handleCreateFolder",value:function(){this.props.onBrowse(this.getFolderId(),null,this.props.query,X.default.ACTIONS.CREATE_FOLDER)}},{key:"handleMoveFilesSuccess",value:function(e,t){var o=this;this.props.queuedFiles.items.filter(function(e){return t.includes(e.id)}).forEach(function(e){e.queuedId&&o.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}),this.props.actions.gallery.deselectFiles(),this.props.actions.files.readFiles()}},{key:"renderGallery",value:function(){var e=this.props.sectionConfig,t=e.createFileEndpoint.url,o=e.createFileEndpoint.method,n=this.props.query&&parseInt(this.props.query.limit||e.limit,10),r=this.props.query&&parseInt(this.props.query.page||1,10),s=this.props.query&&this.props.query.sort,l=this.props.query&&this.props.query.view,i=this.props.query.filter||{};return _.default.createElement(k.default,{files:this.getFiles(),fileId:this.props.fileId,folderId:this.getFolderId(),folder:this.props.folder,type:this.props.type,limit:n,page:r,totalCount:this.props.filesTotalCount,view:l,filters:i,graphQLErrors:this.props.graphQLErrors,createFileApiUrl:t,createFileApiMethod:o,onDelete:this.handleDelete,onInsertMany:this.props.onInsertMany,onPublish:this.doPublish,onUnpublish:this.doUnpublish,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSuccessfulUpload:this.handleUpload,onCreateFolder:this.handleCreateFolder,onMoveFilesSuccess:this.handleMoveFilesSuccess,onClearSearch:this.handleClearSearch,onSort:this.handleSort,onSetPage:this.handleSetPage,onViewChange:this.handleViewChange,sort:s,sectionConfig:e,loading:this.props.loading,maxFilesSelect:this.props.maxFiles})}},{key:"renderEditor",value:function(){var e=this.props.sectionConfig,t=d({config:e,viewAction:this.props.viewAction,folderId:this.getFolderId(),type:this.props.type,fileId:this.props.fileId}),o=t.schemaUrl,n=t.targetId;return o?_.default.createElement(A.default,{className:this.props.dialog?"editor--dialog":"",targetId:n,file:this.findFile(n),onClose:this.handleCloseFile,schemaUrl:o,schemaUrlQueries:this.props.requireLinkText?[{name:"requireLinkText",value:!0}]:[],onSubmit:this.handleSubmitEditor,onDelete:this.handleDelete,onUnpublish:this.handleUnpublish,addToCampaignSchemaUrl:e.form.addToCampaignForm.schemaUrl}):null}},{key:"render",value:function(){var e=Boolean(this.props.folderId||(0,G.hasFilters)(this.props.query.filter)),t=this.props.sectionConfig.form.fileSearchForm.schemaUrl,o=this.props.query.filter||{},n=(0,C.default)("fill-height asset-admin","select"===this.props.type&&{"asset-admin--single-select":1===this.props.maxFiles,"asset-admin--multi-select":1!==this.props.maxFiles});return _.default.createElement("div",{className:n},_.default.createElement(L.default,{showBackButton:e,onBackButtonClick:this.handleBackButtonClick},_.default.createElement(R.default,{multiline:!0}),_.default.createElement("div",{className:"asset-admin__toolbar-extra pull-xs-right fill-width vertical-align-items"},_.default.createElement(B.default,{onSearch:this.handleDoSearch,id:"AssetSearchForm",searchFormSchemaUrl:t,folderId:this.getFolderId(),filters:o}),this.props.toolbarChildren)),_.default.createElement("div",{className:"flexbox-area-grow fill-width fill-height gallery"},this.renderGallery(),this.renderEditor()))}}]),t}(m.Component);ee.propTypes={dialog:m.PropTypes.bool,sectionConfig:J.default,fileId:m.PropTypes.number,folderId:m.PropTypes.number,onBrowse:m.PropTypes.func,onReplaceUrl:m.PropTypes.func,onInsertMany:m.PropTypes.func,graphQLErrors:m.PropTypes.arrayOf(m.PropTypes.string),getUrl:m.PropTypes.func,query:m.PropTypes.shape({sort:m.PropTypes.string,limit:m.PropTypes.oneOfType([m.PropTypes.number,m.PropTypes.string]),page:m.PropTypes.oneOfType([m.PropTypes.number,m.PropTypes.string]),filter:m.PropTypes.object}),onSubmitEditor:m.PropTypes.func,type:m.PropTypes.oneOf(["insert-media","insert-link","select","admin"]),files:m.PropTypes.array,queuedFiles:m.PropTypes.shape({items:m.PropTypes.array.isRequired}),filesTotalCount:m.PropTypes.number,folder:m.PropTypes.shape({id:m.PropTypes.number,title:m.PropTypes.string,parents:m.PropTypes.array,parentId:m.PropTypes.number,canView:m.PropTypes.bool,canEdit:m.PropTypes.bool}),loading:m.PropTypes.bool,actions:m.PropTypes.object,maxFiles:m.PropTypes.number},ee.defaultProps={type:"admin",query:{sort:"",limit:null,page:0,filter:{}},maxFiles:null},t.Component=ee,t.getFormSchema=d,t.default=(0,y.compose)((0,g.connect)(c,p),q.default,V.default,K.default,$.default,function(e){return(0,U.withApollo)(e)})(ee)},"./client/src/containers/AssetAdmin/AssetAdminRouter.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i(e){var t=e.base,o=e.folderId,n=e.fileId,r=e.query,s=e.action;if(s&&-1===C.indexOf(s))throw new Error("Invalid action provided: "+s);var l=null;return l=n?t+"/show/"+o+"/"+b.default.ACTIONS.EDIT_FILE+"/"+n:o?t+"/show/"+o:t+"/",s===b.default.ACTIONS.CREATE_FOLDER&&(l=t+"/show/"+(o||0)+"/"+s),r&&Object.keys(r).length>0&&(l=l+"?"+y.default.stringify(r)),l}function a(e){return{sectionConfig:e.config.sections.find(function(e){return e.name===S})}}Object.defineProperty(t,"__esModule",{value:!0}),t.buildUrl=t.Component=void 0;var d=function(){function e(e,t){for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:b.default.ACTIONS.EDIT_FILE,r=parseInt(e||0,10),s=parseInt(t||0,10),l=r!==this.getFolderId(),a=Object.assign({},o);return(l||a.page<=1)&&delete a.page,i({base:this.props.sectionConfig.url,folderId:r,fileId:s,query:a,action:n})}},{key:"getFolderId",value:function(){return this.props.params&&this.props.params.folderId?parseInt(this.props.params.folderId,10):0}},{key:"getFileId",value:function(){return this.props.params&&this.props.params.fileId?parseInt(this.props.params.fileId,10):0}},{key:"getViewAction",value:function(){return this.props.params&&this.props.params.viewAction?this.props.params.viewAction:b.default.ACTIONS.EDIT_FILE}},{key:"getSectionProps",value:function(){return{sectionConfig:this.props.sectionConfig,type:"admin",folderId:this.getFolderId(),viewAction:this.getViewAction(),fileId:this.getFileId(),query:this.getQuery(),getUrl:this.getUrl,onBrowse:this.handleBrowse,onReplaceUrl:this.handleReplaceUrl}}},{key:"getQuery",value:function(){return(0,_.decodeQuery)(this.props.location.search)}},{key:"handleBrowse",value:function(e,t,o,n){var r=this.getUrl(e,t,o,n);this.props.router.push(r)}},{key:"handleReplaceUrl",value:function(e,t,o,n){var r=this.getUrl(e,t,o,n);this.props.router.replace(r)}},{key:"render",value:function(){return this.props.sectionConfig?c.default.createElement(m.default,this.getSectionProps()):null}}]),t}(u.Component);P.propTypes={sectionConfig:j.default,location:u.PropTypes.shape({pathname:u.PropTypes.string,query:u.PropTypes.object,search:u.PropTypes.string}),params:u.PropTypes.object,router:u.PropTypes.object},t.Component=P,t.buildUrl=i,t.default=(0,f.withRouter)((0,p.connect)(a)(P))},"./client/src/containers/AssetAdmin/stateRouter.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i(e){function t(t){var o=t.config.sections.find(function(e){return e.name===m});return{Component:e,sectionConfig:o}}return(0,c.connect)(t)(g)}Object.defineProperty(t,"__esModule",{value:!0}),t.AssetAdminStateRouter=void 0;var a=function(){function e(e,t){for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h.default.ACTIONS.EDIT_FILE,r=parseInt(e||0,10),s=parseInt(t||0,10),l=this.getFolderId(),i=r!==l&&null!==l,a=Object.assign({},o);return(i||a.page<=1)&&delete a.page,(0,p.buildUrl)({base:this.props.sectionConfig.url,folderId:r,fileId:s,query:a,action:n})}},{key:"getFolderId",value:function(){return null===this.state.folderId?null:parseInt(this.state.folderId||0,10)}},{key:"getFileId",value:function(){return parseInt(this.state.fileId||this.props.fileId||0,10)}},{key:"getViewAction",value:function(){return this.state.action||h.default.ACTIONS.EDIT_FILE}},{key:"getSectionProps",value:function(){var e=Object.assign({},this.props,{folderId:this.getFolderId(),fileId:this.getFileId(),viewAction:this.getViewAction(),query:this.state.query,getUrl:this.getUrl,onBrowse:this.handleBrowse});return delete e.Component,e}},{key:"handleBrowse",value:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h.default.ACTIONS.EDIT_FILE;if(n&&-1===Object.values(h.default.ACTIONS).indexOf(n))throw new Error("Invalid action provided: "+n);this.setState({folderId:e,fileId:t,query:o,action:n})}},{key:"render",value:function(){var e=this.getSectionProps(),t=this.props.Component;return u.default.createElement(t,e)}}]),t}(d.Component);g.propTypes={Component:d.PropTypes.oneOfType([d.PropTypes.element,d.PropTypes.func]),sectionConfig:d.PropTypes.shape({url:d.PropTypes.string.isRequired}).isRequired,fileId:d.PropTypes.number},t.AssetAdminStateRouter=g,t.default=i},"./client/src/containers/Editor/Editor.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i(e){return{actions:{unsavedForms:(0,p.bindActionCreators)(j,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.Component=void 0;var a=function(){function e(e,t){for(var o=0;o0&&(n=u.default.sprintf(u.default._t("AssetAdmin.BULK_ACTIONS_DELETE_SINGLE_CONFIRM","This file is currently used in %s place(s), are you sure you want to delete it?"),this.props.file.inUseCount),n+="\n\n",n+=u.default._t("AssetAdmin.BULK_ACTIONS_DELETE_WARNING","Ensure files are removed from content areas prior to deleting them, otherwise they will appear as broken links.")),confirm(n)&&(this.props.actions.unsavedForms.removeFormChanged("AssetAdmin.EditForm"),this.props.onDelete([t.ID])),e.preventDefault()}}},{key:"handleCancelKeyDown",value:function(e){e.keyCode!==_.default.SPACE_KEY_CODE&&e.keyCode!==_.default.RETURN_KEY_CODE||this.handleClose(e)}},{key:"handleSubmit",value:function(e,t,o){return"function"==typeof this.props.onSubmit?this.props.onSubmit(e,t,o):o()}},{key:"handleClose",value:function(e){this.props.onClose(),this.closeModal(),e&&e.preventDefault()}},{key:"openModal",value:function(){this.setState({openModal:!0})}},{key:"closeModal",value:function(){this.setState({openModal:!1})}},{key:"handleLoadingError",value:function(e){this.setState({loadingForm:!1,loadingError:e.errors[0]})}},{key:"handleLoadingSuccess",value:function(){this.setState({loadingForm:!1,loadingError:null})}},{key:"handleFetchingSchema",value:function(){this.setState({loadingForm:!0})}},{key:"renderCancelButton",value:function(){return h.default.createElement("a",{role:"button",tabIndex:0,className:"btn btn--close-panel btn--no-text font-icon-cancel btn--icon-xl",onClick:this.handleClose,onKeyDown:this.handleCancelKeyDown,type:"button","aria-label":u.default._t("AssetAdmin.CANCEL")})}},{key:"render",value:function(){var e=this.props.schemaUrlQueries.map(function(e){return e.name+"="+e.value}).join("&").trim();e=e?"?"+e:"";var t=this.props.schemaUrl+"/"+this.props.targetId+e,o=this.props.addToCampaignSchemaUrl+"/"+this.props.targetId,n=["panel","form--no-dividers","editor"];this.props.className&&n.push(this.props.className);var r=null;if(this.state.loadingError){var s=this.state.loadingError.value;404===this.state.loadingError.code&&(s=u.default._t("AssetAdmin.FILE_MISSING","File cannot be found")),s||(s=u.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")),r=h.default.createElement("div",{className:"editor__file-preview-message--file-missing"},s)}var l=u.default._t("Admin.ADD_TO_CAMPAIGN","Add to campaign");return h.default.createElement("div",{className:n.join(" ")},h.default.createElement("div",{className:"editor__details fill-height"},h.default.createElement(y.default,{identifier:"AssetAdmin.EditForm",schemaUrl:t,afterMessages:this.renderCancelButton(),onSubmit:this.handleSubmit,onAction:this.handleAction,onLoadingSuccess:this.handleLoadingSuccess,onLoadingError:this.handleLoadingError,onFetchingSchema:this.handleFetchingSchema}),r,h.default.createElement(b.default,{title:l,identifier:"AssetAdmin.AddToCampaign",isOpen:this.state.openModal,onClosed:this.closeModal,schemaUrl:o,bodyClassName:"modal__dialog",responseClassBad:"modal__response modal__response--error",responseClassGood:"modal__response modal__response--good"}),this.state.loadingForm&&[h.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),h.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})]))}}]),t}(f.Component);P.propTypes={file:C.default,className:f.PropTypes.string,targetId:f.PropTypes.number.isRequired,onClose:f.PropTypes.func.isRequired,onSubmit:f.PropTypes.func.isRequired,onDelete:f.PropTypes.func.isRequired,schemaUrl:f.PropTypes.string.isRequired,schemaUrlQueries:f.PropTypes.arrayOf(f.PropTypes.shape({name:f.PropTypes.string,value:f.PropTypes.any})),addToCampaignSchemaUrl:f.PropTypes.string,actions:f.PropTypes.object},t.Component=P,t.default=(0,c.connect)(function(){return{}},i)(P)},"./client/src/containers/Gallery/Gallery.js":function(e,t,o){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t.default=e,t}function r(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}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 a(e,t){var o=t.sort,n=e.assetAdmin.gallery,r=n.selectedFiles,s=n.errorMessage,l=n.noticeMessage,i=n.enableDropzone,a=n.badges,d=n.concatenateSelect,u=n.loading,c=n.sorters,p=n.lastSelected;return!o&&c&&c[0]&&(o=c[0].field+","+c[0].direction),{lastSelected:p,selectedFiles:r,errorMessage:s,noticeMessage:l,enableDropzone:i,badges:a,concatenateSelect:d,loading:t.loading||u,queuedFiles:e.assetAdmin.queuedFiles,securityId:e.config.SecurityID,sorters:c,sort:o}}function d(e){return{actions:{gallery:(0,w.bindActionCreators)(G,e),queuedFiles:(0,w.bindActionCreators)(H,e)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.galleryViewDefaultProps=t.galleryViewPropTypes=t.Component=void 0;var u=Object.assign||function(e){for(var t=1;t=s&&t<=l}).map(function(e){return e.id})}},{key:"getSelectableFiles",value:function(){var e=this.props.files.filter(function(e){return e.id});return"select"===this.props.type?e.filter(function(e){return"folder"!==e.type}):e}},{key:"handleBulkInsert",value:function(e,t){this.props.onInsertMany(e,t)}},{key:"handleBulkDelete",value:function(e,t){var o=this;return this.props.onDelete(t.map(function(e){return e.id})).then(function(e){var n=e.filter(function(e){return e}).length;n!==t.length?(o.props.actions.gallery.setErrorMessage(_.default.sprintf(_.default._t("AssetAdmin.BULK_ACTIONS_DELETE_FAIL","%s folders/files were successfully deleted, but %s files were not able to be deleted."),n,t.length-n)),o.props.actions.gallery.setNoticeMessage(null)):(o.props.actions.gallery.setNoticeMessage(_.default.sprintf(_.default._t("AssetAdmin.BULK_ACTIONS_DELETE_SUCCESS","%s folders/files were successfully deleted."),n)),o.props.actions.gallery.setErrorMessage(null),o.props.actions.gallery.deselectFiles())})}},{key:"handleBulkPublish",value:function(e,t){var o=this,n=t.map(function(e){return e.id});return n.length?(this.props.actions.gallery.setLoading(!0),this.props.onPublish(n).then(function(e){o.props.actions.gallery.setLoading(!1),o.props.actions.gallery.setNoticeMessage(_.default.sprintf(_.default._t("AssetAdmin.BULK_ACTIONS_PUBLISH_SUCCESS","%s folders/files were successfully published."),e.length)),o.props.actions.gallery.setErrorMessage(null),o.props.actions.gallery.deselectFiles()})):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}},{key:"handleBulkUnpublish",value:function(e,t){var o=this,n=t.filter(function(e){return e.published}).map(function(e){return e.id});return n.length?(this.props.actions.gallery.setLoading(!0),this.props.onUnpublish(n).then(function(e){o.props.actions.gallery.setLoading(!1),o.props.actions.gallery.setNoticeMessage(_.default.sprintf(_.default._t("AssetAdmin.BULK_ACTIONS_UNPUBLISH_SUCCESS","%s folders/files were successfully unpublished."),e.length)),o.props.actions.gallery.setErrorMessage(null),o.props.actions.gallery.deselectFiles()})):(this.props.actions.gallery.deselectFiles(),Promise.resolve(!0))}},{key:"initSortDropdown",value:function(){if("tile"===this.props.view){var e=this.getSortElement();e.chosen({allow_single_deselect:!0,disable_search_threshold:20}),e.off("change"),e.on("change",function(){return j.default.Simulate.click(e.find(":selected")[0])})}}},{key:"handleSort",value:function(e){this.props.actions.queuedFiles.purgeUploadQueue(),this.props.onSort(e)}},{key:"handleSetPage",value:function(e){this.props.onSetPage(e)}},{key:"handleCancelUpload",value:function(e){e.xhr.abort(),this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}},{key:"handleRemoveErroredUpload",value:function(e){this.props.actions.queuedFiles.removeQueuedFile(e.queuedId)}},{key:"handleAddedFile",value:function(e){this.props.actions.queuedFiles.addQueuedFile(e)}},{key:"handlePreviewLoaded",value:function(e,t){this.props.actions.queuedFiles.updateQueuedFile(e.queuedId,t)}},{key:"handleSending",value:function(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{xhr:t})}},{key:"handleUploadProgress",value:function(e,t){this.props.actions.queuedFiles.updateQueuedFile(e._queuedId,{progress:t})}},{key:"handleSuccessfulUpload",value:function(e){var t=JSON.parse(e.xhr.response);if(void 0!==t[0].error)return void this.handleFailedUpload(e);if(this.props.actions.queuedFiles.succeedUpload(e._queuedId,t[0]),this.props.onSuccessfulUpload&&this.props.onSuccessfulUpload(t),"admin"!==this.props.type&&!this.props.fileId&&0===this.props.queuedFiles.items.length){var o=t.pop();this.props.onOpenFile(o.id)}}},{key:"handleFailedUpload",value:function(e,t){this.props.actions.queuedFiles.failUpload(e._queuedId,t)}},{key:"itemIsSelected",value:function(e){return this.props.selectedFiles.indexOf(e)>-1}},{key:"toggleSelectConcat",value:function(e){this.props.actions.gallery.setConcatenateSelect(this.isConcat(e))}},{key:"isConcat",value:function(e){return e.metaKey||e.ctrlKey||e.shiftKey}},{key:"itemIsHighlighted",value:function(e){return this.props.fileId===e}},{key:"hasOpenedItem",value:function(){return!!this.props.fileId}},{key:"handleClearSearch",value:function(e){this.props.onClearSearch(e)}},{key:"handleGroupSelect",value:function(e,t){var o=this,n=this.props.actions.gallery,r=n.setSelectedFiles,s=n.selectFiles,l=this.getSelectableFiles(),i=e.filter(function(t,o){return e.indexOf(t)===o&&l.find(function(e){return e.id===t})}),a=this.props.concatenateSelect||this.isConcat(t);if(null!==this.props.maxFilesSelect){var d=i.length;if(a&&(d=this.props.selectedFiles.filter(function(e){return!o.props.selectedFiles.includes(e)}).concat(this.props.selectedFiles).length),d>=this.props.maxFilesSelect)return}a?r(i):s(i)}},{key:"handleClearSelection",value:function(){this.props.actions.gallery.deselectFiles()}},{key:"handleOpenFolder",value:function(e,t){e.preventDefault(),this.props.actions.gallery.setErrorMessage(null),this.props.actions.gallery.setNoticeMessage(null),this.props.onOpenFolder(t.id)}},{key:"handleOpenFile",value:function(e,t){e.preventDefault(),null!==t.created&&(this.props.selectedFiles.length&&1!==this.props.maxFilesSelect||"select"!==this.props.type||this.handleSelect(e,t),this.props.onOpenFile(t.id,t))}},{key:"handleSelect",value:function(e,t){var o=this.props.maxFilesSelect,n=this.getSelectableFiles(),r=n.filter(function(e){return e.id===t.id}).map(function(e){return e.id});if(1===o)return void this.props.actions.gallery.setSelectedFiles(r);if(-1===this.props.selectedFiles.indexOf(t.id)){if(e.shiftKey&&(r=this.getSelection(this.props.lastSelected,t.id)),this.props.selectedFiles.filter(function(e){return!r.includes(e)}).concat(r).length>o&&null!==o)return;this.props.actions.gallery.selectFiles(r),this.props.actions.gallery.setLastSelected(t.id)}else this.props.actions.gallery.deselectFiles([t.id]),e.shiftKey&&this.props.actions.gallery.setLastSelected(null)}},{key:"handleEnableDropzone",value:function(e){this.props.actions.gallery.setEnableDropzone(e)}},{key:"handleMoveFiles",value:function(e,t){var o=this;this.props.actions.files.moveFiles(e,t).then(function(){var n=R.default.MOVE_SUCCESS_DURATION,r="+"+t.length;o.props.actions.gallery.setFileBadge(e,r,"success",n),"function"==typeof o.props.onMoveFilesSuccess&&o.props.onMoveFilesSuccess(e,t)}).catch(function(){o.props.actions.gallery.setErrorMessage(_.default._t("AssetAdmin.FAILED_MOVE","There was an error moving the selected items."))})}},{key:"handleBulkEdit",value:function(e,t){this.handleOpenFile(e,t[0])}},{key:"handleBulkMove",value:function(){this.props.actions.gallery.activateModal(R.default.MODAL_MOVE)}},{key:"renderSearchAlert",value:function(){var e=this.props.filters;if(!e||0===Object.keys(e).length)return null;var t=this.getSearchMessage(e);if(""===t)return null;var o=y.default.createElement("div",null,y.default.createElement("button",{onClick:this.handleClearSearch,className:"btn btn-info font-icon-cancel form-alert__btn--right"},_.default._t("AssetAdmin.SEARCHCLEARRESULTS","Clear results")),t);return y.default.createElement(L.default,{value:{react:o},type:"warning"})}},{key:"renderTransitionBulkActions",value:function(){return y.default.createElement(C.default,{transitionName:"bulk-actions",transitionEnterTimeout:R.default.CSS_TRANSITION_TIME,transitionLeaveTimeout:R.default.CSS_TRANSITION_TIME},this.renderBulkActions())}},{key:"renderBulkActions",value:function(){var e=this,t="select"===this.props.type?function(e){return"insert"===e.value}:function(e){return"insert"!==e.value},o=R.default.BULK_ACTIONS.filter(t).map(function(t){if(t.callback)return t;switch(t.value){case"delete":return u({},t,{callback:e.handleBulkDelete});case"edit":return u({},t,{callback:e.handleBulkEdit});case"move":return u({},t,{callback:e.handleBulkMove});case"publish":return u({},t,{callback:e.handleBulkPublish});case"unpublish":return u({},t,{callback:e.handleBulkUnpublish});case"insert":return u({},t,{callback:e.handleBulkInsert});default:return t}}),n=this.props.selectedFiles.map(function(t){return e.props.files.find(function(e){return e&&t===e.id})}).filter(function(e){return e});return n.length>0&&["admin","select"].includes(this.props.type)?y.default.createElement(I.default,{actions:o,items:n,total:this.props.maxFilesSelect,key:n.length>0,container:this.gallery,showCount:1!==this.props.maxFilesSelect}):null}},{key:"renderGalleryView",value:function(){var e=this,t="table"===this.props.view?k.default:A.default,o=this.props.files.map(function(t){return u({},t,{selected:e.itemIsSelected(t.id),highlighted:e.itemIsHighlighted(t.id)})}),n=this.props,r=n.type,s=n.loading,l=n.page,i=n.totalCount,a=n.limit,d=n.sort,c=n.selectedFiles,p=n.badges,f={selectableItems:["admin","select"].includes(r),selectableFolders:"select"!==this.props.type,files:o,loading:s,page:l,totalCount:i,limit:a,sort:d,selectedFiles:c,badges:p,onSort:this.handleSort,onSetPage:this.handleSetPage,onOpenFile:this.handleOpenFile,onOpenFolder:this.handleOpenFolder,onSelect:this.handleSelect,onCancelUpload:this.handleCancelUpload,onDropFiles:this.handleMoveFiles,onRemoveErroredUpload:this.handleRemoveErroredUpload,onEnableDropzone:this.handleEnableDropzone,sectionConfig:this.props.sectionConfig,canDrag:"admin"===this.props.type,maxFilesSelect:this.props.maxFilesSelect};return y.default.createElement(t,f)}},{key:"renderToolbar",value:function(){var e=this.props,t=e.GalleryToolbar,o=e.sort,n=e.view,r=e.folder,s=e.onCreateFolder,l=e.onOpenFolder,i=e.onViewChange,a={onMoveFiles:this.handleMoveFiles,onSort:this.handleSort,onCreateFolder:s,onOpenFolder:l,onViewChange:i,view:n,sort:o,folder:r};return y.default.createElement(t,a)}},{key:"render",value:function(){var e=this,t=this.props,o=t.folder,n=t.loading,r=t.errorMessage,s=t.graphQLErrors,l=t.noticeMessage,i=s&&s.length>0;if(!o)return r||i?y.default.createElement("div",{className:"gallery__error flexbox-area-grow"},y.default.createElement("div",{className:"gallery__error-message"},y.default.createElement("h3",null,_.default._t("AssetAdmin.DROPZONE_RESPONSE_ERROR","Server responded with an error.")),r&&y.default.createElement("p",null,r),i&&s.map(function(e,t){return y.default.createElement("p",{key:t},e)}))):n?y.default.createElement("div",{className:"flexbox-area-grow"},y.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),y.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})):y.default.createElement("div",{className:"flexbox-area-grow"},y.default.createElement("div",{className:"editor__file-preview-message--file-missing m-t-3"},_.default._t("Admin.UNKNOWN_ERROR","An unknown error has occurred")));var a=y.default.createElement("div",{className:"gallery_messages"},r&&y.default.createElement(L.default,{value:r,type:"danger"}),l&&y.default.createElement(L.default,{value:l,type:"success"}),this.renderSearchAlert()),d={height:R.default.THUMBNAIL_HEIGHT,width:R.default.THUMBNAIL_WIDTH},c=u({url:this.props.createFileApiUrl,method:this.props.createFileApiMethod,paramName:"Upload",clickable:"#upload-button"},this.props.sectionConfig.dropzoneOptions),p=this.props.securityId,f=this.props.folder.canEdit&&this.props.enableDropzone,h=["panel","panel--padded","panel--scrollable","gallery__main","fill-height"];"insert"===this.props.type&&h.push("insert-media-modal__main");var m=h;return this.hasOpenedItem()&&m.push("gallery__main--has-opened-item"),y.default.createElement("div",{className:"flexbox-area-grow gallery__outer",ref:function(t){e.gallery=t}},this.renderTransitionBulkActions(),y.default.createElement(Q.default,{className:h.join(" ")},this.renderToolbar(),y.default.createElement(W.SelectableGroup,{enabled:"tile"===this.props.view&&"admin"===this.props.type,className:"flexbox-area-grow fill-height gallery__main--selectable",onSelection:this.handleGroupSelect,onNonItemClick:this.handleClearSelection,preventDefault:!1,fixedPosition:!0},y.default.createElement(O.default,{name:"gallery-container",className:"flexbox-area-grow",canUpload:f,onAddedFile:this.handleAddedFile,onPreviewLoaded:this.handlePreviewLoaded,onError:this.handleFailedUpload,onSuccess:this.handleSuccessfulUpload,onSending:this.handleSending,onUploadProgress:this.handleUploadProgress,preview:d,folderId:this.props.folderId,options:c,securityID:p,uploadButton:!1},a,this.renderGalleryView()))),this.props.loading&&[y.default.createElement("div",{key:"overlay",className:"cms-content-loading-overlay ui-widget-overlay-light"}),y.default.createElement("div",{key:"spinner",className:"cms-content-loading-spinner"})],y.default.createElement(Z.default,{sectionConfig:this.props.sectionConfig,folderId:this.props.folderId,onSuccess:this.props.onMoveFilesSuccess,onOpenFolder:this.props.onOpenFolder}))}}]),t}(g.Component),te={page:1,limit:15},oe={sectionConfig:Y.default,loading:g.PropTypes.bool,sort:g.PropTypes.string,files:g.PropTypes.arrayOf(g.PropTypes.shape({id:g.PropTypes.number,parent:g.PropTypes.shape({id:g.PropTypes.number})})).isRequired,selectedFiles:g.PropTypes.arrayOf(g.PropTypes.number),totalCount:g.PropTypes.number,page:g.PropTypes.number,limit:g.PropTypes.number,badges:g.PropTypes.arrayOf(g.PropTypes.shape({id:g.PropTypes.number,message:g.PropTypes.node,status:g.PropTypes.string})),onOpenFile:g.PropTypes.func.isRequired,onOpenFolder:g.PropTypes.func.isRequired,onSort:g.PropTypes.func.isRequired,onSetPage:g.PropTypes.func.isRequired,maxFilesSelect:g.PropTypes.number},ne=Object.assign({},te,{selectableItems:!1}),re=Object.assign({},oe,{selectableItems:g.PropTypes.bool,selectableFolders:g.PropTypes.bool,onSelect:g.PropTypes.func,onCancelUpload:g.PropTypes.func,onDelete:y.default.PropTypes.func,onRemoveErroredUpload:g.PropTypes.func,onEnableDropzone:g.PropTypes.func});ee.defaultProps=Object.assign({},te,{type:"admin",view:"tile",enableDropzone:!0}),ee.propTypes=Object.assign({},oe,{onUploadSuccess:y.default.PropTypes.func,onCreateFolder:y.default.PropTypes.func,onMoveFilesSuccess:y.default.PropTypes.func,onDelete:y.default.PropTypes.func,onPublish:y.default.PropTypes.func,onUnpublish:y.default.PropTypes.func,type:g.PropTypes.oneOf(["insert-media","insert-link","select","admin"]),view:g.PropTypes.oneOf(["tile","table"]),lastSelected:g.PropTypes.number,dialog:g.PropTypes.bool,fileId:g.PropTypes.number,folderId:g.PropTypes.number.isRequired,folder:g.PropTypes.shape({id:g.PropTypes.number,title:g.PropTypes.string,parentId:g.PropTypes.number,canView:g.PropTypes.bool,canEdit:g.PropTypes.bool}),files:g.PropTypes.array,errorMessage:g.PropTypes.string,graphQLErrors:g.PropTypes.arrayOf(g.PropTypes.string),actions:g.PropTypes.object,securityId:g.PropTypes.string,onViewChange:g.PropTypes.func.isRequired,createFileApiUrl:g.PropTypes.string,createFileApiMethod:g.PropTypes.string,search:g.PropTypes.object,enableDropzone:g.PropTypes.bool,concatenateSelect:g.PropTypes.bool,GalleryToolbar:g.PropTypes.func,sorters:g.PropTypes.arrayOf(g.PropTypes.shape({field:g.PropTypes.string.isRequired,direction:g.PropTypes.oneOf(["asc","desc"]).isRequired,label:g.PropTypes.string.isRequired})).isRequired}),t.Component=ee,t.galleryViewPropTypes=re,t.galleryViewDefaultProps=ne,t.default=(0,w.compose)((0,J.inject)(["GalleryToolbar"],null,function(){return"AssetAdmin.Gallery"}),(0,P.connect)(a,d),z.default,function(e){return(0,V.withApollo)(e)})(ee)},"./client/src/containers/Gallery/GalleryDND.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i=function(){function e(e,t){for(var o=0;o1&&void 0!==arguments[1])||arguments[1];return h.default.createEndpointFetcher(Object.assign({},e,t?{defaultData:{SecurityID:_.default.get("SecurityID")}}:{}))},S=function(e){function t(e){r(this,t);var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.state={detailView:null,history:[],loadedDetails:!1},o.handleClick=o.handleClick.bind(o),o.handleBack=o.handleBack.bind(o),o.timer=null,o.api=j(e.sectionConfig.historyEndpoint),o}return l(t,e),d(t,[{key:"componentDidMount",value:function(){this.refreshHistoryIfNeeded()}},{key:"componentWillReceiveProps",value:function(e){this.refreshHistoryIfNeeded(e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timer),this.timer=null}},{key:"refreshHistoryIfNeeded",value:function(e){var t=this;if(!e&&!this.state.loadedDetails||e.data.fileId!==this.props.data.fileId||e.data.latestVersionId!==this.props.data.latestVersionId){this.setState({loadedDetails:!1});var o=e?e.data.fileId:this.props.data.fileId;clearTimeout(this.timer),this.timer=setTimeout(function(){t.api({fileId:o}).then(function(e){t.timer&&t.setState({history:e,loadedDetails:!0})})},250)}}},{key:"handleClick",value:function(e){this.setState({viewDetails:e})}},{key:"handleBack",value:function(e){e.preventDefault(),this.setState({viewDetails:null})}},{key:"render",value:function(){var e=this;if(!this.state.loadedDetails)return c.default.createElement("div",{className:"history-list history-list--loading"},"Loading...");if(this.state.viewDetails){var t=[this.props.historySchemaUrl,this.props.data.fileId,this.state.viewDetails].join("/"),o=["btn","btn-secondary","btn--icon-xl","btn--no-text","font-icon-left-open-big","history-list__back"].join(" ");return c.default.createElement("div",{className:"history-list"},c.default.createElement("a",{href:"#",className:o,onClick:this.handleBack}),c.default.createElement(b.default,{identifier:"AssetAdmin.HistoryList",schemaUrl:t}))}var n=this.state.history||[];return c.default.createElement("div",{className:"history-list"},c.default.createElement("ul",{className:"list-group list-group-flush history-list__list"},n.map(function(t){return c.default.createElement(y.default,a({key:t.versionid},t,{onClick:e.handleClick}))})))}}]),t}(u.Component);S.propTypes={sectionConfig:c.default.PropTypes.shape({form:c.default.PropTypes.object,historyEndpoint:c.default.PropTypes.shape({url:c.default.PropTypes.string,method:c.default.PropTypes.string,responseFormat:c.default.PropTypes.string})}),historySchemaUrl:c.default.PropTypes.string,data:c.default.PropTypes.object},S.defaultProps={data:{fieldId:0}},t.Component=S,t.default=(0,p.connect)(i)(S)},"./client/src/containers/MoveModal/MoveModal.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i(e){var t=e.assetAdmin.gallery,o=t.modal,n=t.selectedFiles;return{isOpen:o===g.default.MODAL_MOVE,selectedFiles:n,title:m.default.sprintf(m.default._t("AssetAdmin.MOVE_ITEMS_TO","Move %s item(s) to..."),n.length)}}function a(e){return{onClosed:function(){e((0,y.deactivateModal)())},setNotice:function(t){e((0,y.setNoticeMessage)(t))},setError:function(t){e((0,y.setErrorMessage)(t))},setBadge:function(){e(y.setFileBadge.apply(void 0,arguments))}}}Object.defineProperty(t,"__esModule",{value:!0});var d=function(){function e(e,t){for(var o=0;o0)return c.default.createElement("div",{className:"gallery__progress-bar--complete"});var t={className:"gallery__progress-bar-progress",style:{width:e.progress+"%"}};return c.default.createElement("div",{className:"gallery__progress-bar"},c.default.createElement("div",t))}},{key:"renderTitle",value:function(e){var t=this.renderProgressBar(e.rowData);return c.default.createElement("div",{className:"fill-width"},c.default.createElement("div",{className:"flexbox-area-grow"},e.data),t)}},{key:"renderSelect",value:function(e){if(this.props.selectableItems&&(this.props.selectableFolders||"folder"!==e.rowData.type)){var t={type:"checkbox",title:m.default._t("AssetAdmin.SELECT"),checked:e.data,tabIndex:-1,onMouseDown:this.preventFocus};return![null,1].includes(this.props.maxFilesSelect)&&this.props.selectedFiles.length>=this.props.maxFilesSelect&&!e.data&&(t.disabled=!0),c.default.createElement("input",t)}return null}},{key:"renderDate",value:function(e){return"folder"===e.rowData.type?null:c.default.createElement("span",null,e.data)}},{key:"renderThumbnail",value:function(e){var t=e.data||e.rowData.url,o=e.rowData.queuedId&&!e.rowData.id,n=e.rowData.category||"false",r="gallery__table-image",s=[r],l={};return s.push(r+"--"+n),"image"===n&&t&&(l.backgroundImage='url("'+t+'")'),o||t||"folder"===n||s.push(r+"--error"),c.default.createElement("div",{className:s.join(" "),style:l})}},{key:"render",value:function(){return c.default.createElement(f.default,this.getTableProps())}}]),t}(u.Component);y.defaultProps=_.galleryViewDefaultProps,y.propTypes=i({},_.galleryViewPropTypes,{sort:u.PropTypes.string.isRequired}),t.Component=y,t.default=y},"./client/src/containers/ThumbnailView/ThumbnailView.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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}),t.Component=void 0;var i=Object.assign||function(e){for(var t=1;t=this.props.maxFilesSelect,b=1===this.props.maxFilesSelect?c.onActivate:this.props.onSelect;c=i({},c,{selectable:!0,onSelect:b,maxSelected:v})}if("folder"===e.type){var E=this.props.onDropFiles;return c=i({},c,{onDropFiles:E}),p.default.createElement(n,c)}return p.default.createElement(o,c)}},{key:"render",value:function(){return p.default.createElement("div",{className:"gallery__main-view--tile"},p.default.createElement("div",{className:"gallery__folders"},this.props.files.filter(this.folderFilter).map(this.renderItem)),p.default.createElement("div",{className:"gallery__files"},this.props.files.filter(this.fileFilter).map(this.renderItem)),0===this.props.files.length&&!this.props.loading&&p.default.createElement("p",{className:"gallery__no-item-notice"},u.default._t("AssetAdmin.NOITEMSFOUND")),p.default.createElement("div",{className:"gallery__load"},this.renderPagination()))}}]),t}(c.Component);g.defaultProps=h.galleryViewDefaultProps,g.propTypes=i({},h.galleryViewPropTypes,{File:c.PropTypes.oneOfType([c.PropTypes.node,c.PropTypes.func]).isRequired,Folder:c.PropTypes.oneOfType([c.PropTypes.node,c.PropTypes.func]).isRequired});var y=(0,f.inject)(["GalleryItemFile","GalleryItemFolder"],function(e,t){return{File:e,Folder:t}},function(){return"AssetAdmin.Gallery.ThumbnailView"});t.Component=g,t.default=y(g)},"./client/src/entwine/UploadField/UploadFieldEntwine.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}var r=Object.assign||function(e){for(var t=1;t');this.before(o),t=o[0]}return t},onunmatch:function(){this._super(),u.default.unmountComponentAtNode(this.siblings(".uploadfield-holder")[0])},onmatch:function(){var e=this.closest(".cms-content").attr("id"),t=e?{context:e}:{},o=(0,p.loadComponent)("UploadField",t);this.setComponent(o),this._super(),this.hide(),this.refresh()},onclick:function(e){e.preventDefault()},refresh:function(){var t=this.getAttributes(),o=e(this).closest("form"),n=function(){setTimeout(function(){o.trigger("change")},0)},s=this.getComponent();u.default.render(a.default.createElement(s,r({},t,{onChange:n,noHolder:!0})),this.getContainer())},getAttributes:function(){var t=e(this).data("state"),o=e(this).data("schema");return(0,c.schemaMerge)(o,t)}})})},"./client/src/lib/configShape.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(0),r=n.PropTypes.shape({url:n.PropTypes.string,limit:n.PropTypes.number,imageRetry:n.PropTypes.shape({minRetry:n.PropTypes.number,maxRetry:n.PropTypes.number,expiry:n.PropTypes.number}),form:n.PropTypes.object,dropzoneOptions:n.PropTypes.object});t.default=r},"./client/src/lib/fileFragments.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fileInterface="\n fragment FileInterfaceFields on FileInterface {\n canDelete\n canEdit\n canView\n category\n exists\n filename\n id\n lastEdited\n name\n parentId\n title\n type\n url\n }\n",t.file="\n fragment FileFields on File {\n draft\n extension\n published\n modified\n size\n smallThumbnail\n thumbnail\n inUseCount\n }\n",t.folder="\n fragment FolderFields on Folder {\n filesInUseCount\n }\n"},"./client/src/lib/fileShape.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(0),r=n.PropTypes.shape({canEdit:n.PropTypes.bool,canDelete:n.PropTypes.bool,canView:n.PropTypes.bool,exists:n.PropTypes.bool,type:n.PropTypes.string,smallThumbnail:n.PropTypes.string,thumbnail:n.PropTypes.string,width:n.PropTypes.number,height:n.PropTypes.number,category:n.PropTypes.oneOfType([n.PropTypes.bool,n.PropTypes.string]),id:n.PropTypes.number,inUseCount:n.PropTypes.number,url:n.PropTypes.string,title:n.PropTypes.string,progress:n.PropTypes.number});t.default=r},"./client/src/lib/fileStructure.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o(13),r=function(e){return e&&e.__esModule?e:{default:e}}(n),s=(0,r.default)({name:null,canDelete:!1,canEdit:!1,category:null,created:null,extension:null,filename:null,id:0,lastEdited:null,messages:null,owner:{id:0,title:null},parent:{filename:null,id:0,title:null},queuedId:null,size:null,title:null,type:null,url:null,xhr:null,thumbnail:null,smallThumbnail:null,height:null,width:null});t.default=s},"./client/src/state/files/buildPublicationMutation.js":function(e,t,o){"use strict";function n(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return o({variables:{IDs:e,Quiet:n,Force:t}})};return{actions:r({},s,{files:r({},s.files,n({},e,l))})}}}}};t.default=d},"./client/src/state/files/deleteFilesMutation.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=t.mutation=void 0;var n=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:null;return function(t){return t({type:y.default.SELECT_FILES,payload:{ids:e}})}}function i(e){return function(t){return t({type:y.default.CONCATENATE_SELECT,payload:!!e})}}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(t){return t({type:y.default.DESELECT_FILES,payload:{ids:e}})}}function d(e){return function(t){return t({type:y.default.SET_NOTICE_MESSAGE,payload:{message:e}})}}function u(e){return function(t){return t({type:y.default.SET_ERROR_MESSAGE,payload:{message:e}})}}function c(e){return function(t){return t({type:y.default.SET_ENABLE_DROPZONE,payload:{enableDropzone:e}})}}function p(e){return function(t){t({type:y.default.CLEAR_FILE_BADGE,payload:{id:e}})}}function f(e,t,o,n){return function(r,s){var l=s(),i=l.assetAdmin,a=i.gallery.badges.find(function(t){return t.id===e});a&&a.timer&&clearTimeout(a.timer);var d=n>0?setTimeout(function(){return p(e)(r)},n):null;r({type:y.default.SET_FILE_BADGE,payload:{id:e,message:t,status:o,timer:d}})}}function h(e){return function(t){t({type:y.default.ACTIVATE_MODAL,payload:e})}}function m(){return function(e){e({type:y.default.DEACTIVATE_MODAL})}}function _(e){return function(t){t({type:y.default.SET_LOADING,payload:!!e})}}Object.defineProperty(t,"__esModule",{value:!0}),t.setLastSelected=n,t.setSelectedFiles=r,t.loadFile=s,t.selectFiles=l,t.setConcatenateSelect=i,t.deselectFiles=a,t.setNoticeMessage=d,t.setErrorMessage=u,t.setEnableDropzone=c,t.clearFileBadge=p,t.setFileBadge=f,t.activateModal=h,t.deactivateModal=m,t.setLoading=_;var g=o("./client/src/state/gallery/GalleryActionTypes.js"),y=function(e){return e&&e.__esModule?e:{default:e}}(g)},"./client/src/state/gallery/GalleryReducer.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.type,n=t.payload;switch(o){case d.default.SET_LAST_SELECTED:return s({},e,{lastSelected:n.id});case d.default.SET_FILE_BADGE:return s({},e,{badges:e.badges.filter(function(e){return e.id!==n.id}).concat([n])});case d.default.CLEAR_FILE_BADGE:return s({},e,{badges:e.badges.filter(function(e){return e.id!==n.id})});case d.default.SET_ENABLE_DROPZONE:return s({},e,{enableDropzone:n.enableDropzone});case d.default.SET_NOTICE_MESSAGE:return s({},e,{noticeMessage:n.message});case d.default.SET_ERROR_MESSAGE:return s({},e,{errorMessage:n.message});case d.default.LOAD_FILE_SUCCESS:var r=e.files.find(function(e){return e.id===n.id});if(r){var l=s({},r,n.file);return(0,i.default)(s({},e,{files:e.files.map(function(e){return e.id===l.id?l:e})}))}return e.folder.id===n.id?(0,i.default)(s({},e,{folder:s({},e.folder,n.file)})):e;case d.default.SET_SELECTED_FILES:return(0,i.default)(s({},e,{selectedFiles:Array.isArray(n.files)?n.files:[]}));case d.default.SELECT_FILES:var a=null;return a=null===n.ids?e.files.map(function(e){return e.id}):e.selectedFiles.concat(n.ids.filter(function(t){return-1===e.selectedFiles.indexOf(t)})),(0,i.default)(s({},e,{selectedFiles:a}));case d.default.DESELECT_FILES:var u=null;return u=null===n.ids?[]:e.selectedFiles.filter(function(e){return-1===n.ids.indexOf(e)}),(0,i.default)(s({},e,{selectedFiles:u}));case d.default.ACTIVATE_MODAL:return(0,i.default)(s({},e,{modal:n}));case d.default.DEACTIVATE_MODAL:return(0,i.default)(s({},e,{modal:null}));case d.default.CONCATENATE_SELECT:return(0,i.default)(s({},e,{concatenateSelect:n}));case d.default.SET_LOADING:return(0,i.default)(s({},e,{loading:n}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:p;r(this,e),this.options=s({},c,t),this.factory=o}return l(e,[{key:"loadImage",value:function(e){return this.options.minRetry&&u.default.lock(e)?this.loadImageLoop(e,this.options.minRetry):null}},{key:"loadImageLoop",value:function(e,t){var o=this;return this.options.onStatusChange(e,a.default.LOADING),new Promise(function(t,n){return o.factory(e,t,n)}).then(function(){return o.handleSuccess(e)}).catch(function(){return o.handleError(e,t)})}},{key:"handleReset",value:function(e,t){this.options.onReset(e),t()}},{key:"handleTimeout",value:function(e,t){var o=setTimeout(e,t);return this.options.onTimeout(o,t),o}},{key:"handleSuccess",value:function(e){u.default.unlock(e),this.options.onStatusChange(e,a.default.SUCCESS)}},{key:"handleFailure",value:function(e){var t=this;return u.default.unlock(e),this.options.onStatusChange(e,a.default.FAILED),this.options.expiry?new Promise(function(o){t.handleTimeout(function(){return t.handleReset(e,o)},1e3*t.options.expiry)}):null}},{key:"handleError",value:function(e,t){return t>this.options.maxRetry?this.handleFailure(e):(this.options.onStatusChange(e,a.default.WAITING),this.handleRetry(e,t))}},{key:"handleRetry",value:function(e,t){var o=this,n=new Promise(function(n){o.handleTimeout(function(){return n(o.loadImageLoop(e,2*t))},1e3*t)});return this.options.onRetry(e,t,n),n}},{key:"setOnRetry",value:function(e){this.options.onRetry=e}},{key:"setOnReset",value:function(e){this.options.onReset=e}},{key:"setOnStatusChange",value:function(e){this.options.onStatusChange=e}},{key:"setOnTimeout",value:function(e){this.options.onTimeout=e}}]),e}();t.defaultImageFactory=p,t.default=f},"./client/src/state/imageLoad/ImageLoadActionTypes.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={SET_STATUS:"IMAGE_LOAD_SET_STATUS",RESET:"IMAGE_LOAD_RESET"}},"./client/src/state/imageLoad/ImageLoadActions.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){return function(o,n){if(!e)return null;if(n().assetAdmin.imageLoad.files.find(function(t){return t.url===e}))return null;var r=s({},t,{onStatusChange:function(e,t){return o({type:i.default.SET_STATUS,payload:{status:t,url:e}})},onReset:function(e){return o({type:i.default.RESET,payload:{url:e}})}});return new d.default(r).loadImage(e)}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t=0||(this.urls=[].concat(n(this.urls),[e]),0))}},{key:"unlock",value:function(e){this.urls=this.urls.filter(function(t){return t!==e})}}]),e}();window.ss=window.ss||{},window.ss.imagelocker=window.ss.imagelocker||new l,t.Component=l,t.default=window.ss.imagelocker},"./client/src/state/imageLoad/ImageLoadReducer.js":function(e,t,o){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.type,r=t.payload;switch(o){case i.default.SET_STATUS:return s({},e,{files:[].concat(n(e.files.filter(function(e){return e.url!==r.url})),[r])});case i.default.RESET:return s({},e,{files:[].concat(n(e.files.filter(function(e){return e.url!==r.url})))});default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:u,t=arguments[1];switch(t.type){case d.default.PREVIEWFIELD_ADD_FILE:return(0,i.default)(Object.assign({},e,r({},t.payload.id,t.payload.file)));case d.default.PREVIEWFIELD_FAIL_UPLOAD:return(0,i.default)(Object.assign({},e,r({},t.payload.id,Object.assign({},e[t.payload.id],t.payload.message))));case d.default.PREVIEWFIELD_REMOVE_FILE:return(0,i.default)(Object.assign({},e,r({},t.payload.id,void 0)));case d.default.PREVIEWFIELD_UPDATE_FILE:return(0,i.default)(Object.assign({},e,r({},t.payload.id,Object.assign({},e[t.payload.id],t.payload.data))));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var l=o(13),i=n(l),a=o("./client/src/state/previewField/PreviewFieldActionTypes.js"),d=n(a),u={};t.default=s},"./client/src/state/queuedFiles/QueuedFilesActionTypes.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={ADD_QUEUED_FILE:"ADD_QUEUED_FILE",FAIL_UPLOAD:"FAIL_UPLOAD",PURGE_UPLOAD_QUEUE:"PURGE_UPLOAD_QUEUE",REMOVE_QUEUED_FILE:"REMOVE_QUEUED_FILE",SUCCEED_UPLOAD:"SUCCEED_UPLOAD",UPDATE_QUEUED_FILE:"UPDATE_QUEUED_FILE"}},"./client/src/state/queuedFiles/QueuedFilesActions.js":function(e,t,o){"use strict";function n(e){return function(t){return t({type:u.default.ADD_QUEUED_FILE,payload:{file:e}})}}function r(e,t){return function(o){var n=t.message;return t.errors&&t.errors.length&&(n=t.errors[0]),"string"==typeof t&&(n={value:t,type:"error"}),o({type:u.default.FAIL_UPLOAD,payload:{queuedId:e,message:n}})}}function s(){return function(e){return e({type:u.default.PURGE_UPLOAD_QUEUE,payload:null})}}function l(e){return function(t){return t({type:u.default.REMOVE_QUEUED_FILE,payload:{queuedId:e}})}}function i(e,t){return function(o){return o({type:u.default.SUCCEED_UPLOAD,payload:{queuedId:e,json:t}})}}function a(e,t){return function(o){return o({type:u.default.UPDATE_QUEUED_FILE,payload:{queuedId:e,updates:t}})}}Object.defineProperty(t,"__esModule",{value:!0}),t.addQueuedFile=n,t.failUpload=r,t.purgeUploadQueue=s,t.removeQueuedFile=l,t.succeedUpload=i,t.updateQueuedFile=a;var d=o("./client/src/state/queuedFiles/QueuedFilesActionTypes.js"),u=function(e){return e&&e.__esModule?e:{default:e}}(d)},"./client/src/state/queuedFiles/QueuedFilesReducer.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:m,t=arguments[1];switch(t.type){case u.default.ADD_QUEUED_FILE:return(0,a.default)(l({},e,{items:[].concat(r(e.items),[l({},p.default,t.payload.file)])}));case u.default.FAIL_UPLOAD:return(0,a.default)(l({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?l({},e,{message:t.payload.message}):e})}));case u.default.PURGE_UPLOAD_QUEUE:return(0,a.default)(l({},e,{items:e.items.filter(function(e){return!e.id})}));case u.default.REMOVE_QUEUED_FILE:return(0,a.default)(l({},e,{items:e.items.filter(function(e){return e.queuedId!==t.payload.queuedId})}));case u.default.SUCCEED_UPLOAD:return(0,a.default)(l({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?l({},e,t.payload.json,{messages:[{value:h.default._t("AssetAdmin.DROPZONE_SUCCESS_UPLOAD"),type:"success",extraClass:"success"}]}):e})}));case u.default.UPDATE_QUEUED_FILE:return(0,a.default)(l({},e,{items:e.items.map(function(e){return e.queuedId===t.payload.queuedId?l({},e,t.payload.updates):e})}));default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:f,t=arguments[1],o=(0,p.default)(e,t,h);switch(t.type){case a.default.UPLOADFIELD_ADD_FILE:return o(function(e){return e.files.find(function(e){return e.id===t.payload.file.id})?e:l({},e,{files:[].concat(r(e.files),[l({},u.default,t.payload.file)])})});case a.default.UPLOADFIELD_SET_FILES:return o(function(){return{files:t.payload.files}});case a.default.UPLOADFIELD_UPLOAD_FAILURE:return o(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,{message:t.payload.message}):e})}});case a.default.UPLOADFIELD_REMOVE_FILE:return o(function(e){return{files:e.files.filter(function(e){return!(t.payload.file.queuedId&&e.queuedId===t.payload.file.queuedId||t.payload.file.id&&e.id===t.payload.file.id)})}});case a.default.UPLOADFIELD_UPLOAD_SUCCESS:return o(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.json):e})}});case a.default.UPLOADFIELD_UPDATE_QUEUED_FILE:return o(function(e){return{files:e.files.map(function(e){return e.queuedId===t.payload.queuedId?Object.assign({},e,t.payload.updates):e})}});default:return e}}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t0?s.default._t("AssetAdmin.UPDATE_FILE","Update file"):s.default._t("AssetAdmin.INSERT_FILE","Insert file");return e.mutateField("action_insert",function(e){return n({},e,{title:r||e.title})}),e.getState()};t.default=l},"./client/src/transforms/FormAction/ownerAwareUnpublish.js":function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0?[a.default.inject(a.default._t("AssetAdmin.SINGLE_OWNED_WARNING_1","This file is being used in {count} other published section(s)."),{count:r}),a.default._t("AssetAdmin.SINGLE_OWNED_WARNING_2","Ensure files are removed from content areas prior to unpublishing them. Otherwise, they will appear as broken links."),a.default._t("AssetAdmin.SINGLE_OWNED_WARNING_3","Do you want to unpublish this file anyway?")].join("\n\n"):a.default._t("AssetAdmin.CONFIRMUNPUBLISH","Are you sure you want to unpublish this record?"),confirm(s)?o(e,n):e.preventDefault()}});return l.default.createElement(e,n)}};t.default=d},"./client/src/transforms/TreeDropdownField/moveTreeDropdownField.js":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disabledTreeDropdownField=void 0;var n=Object.assign||function(e){for(var t=1;t'),this.element.appendChild(o)),n=o.getElementsByTagName("span")[0],n&&(null!=n.textContent?n.textContent=this.options.dictFallbackMessage:null!=n.innerText&&(n.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e){var t,o,n;return t={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},o=e.width/e.height,t.optWidth=this.options.thumbnailWidth,t.optHeight=this.options.thumbnailHeight,null==t.optWidth&&null==t.optHeight?(t.optWidth=t.srcWidth,t.optHeight=t.srcHeight):null==t.optWidth?t.optWidth=o*t.optHeight:null==t.optHeight&&(t.optHeight=1/o*t.optWidth),n=t.optWidth/t.optHeight,e.heightn?(t.srcHeight=e.height,t.srcWidth=t.srcHeight*n):(t.srcWidth=e.width,t.srcHeight=t.srcWidth/n),t.srcX=(e.width-t.srcWidth)/2,t.srcY=(e.height-t.srcHeight)/2,t},drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:a,dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:a,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var o,n,r,s,l,i,a,d,u,c,p,f,h;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(e.previewElement=t.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),c=e.previewElement.querySelectorAll("[data-dz-name]"),s=0,a=c.length;s'+this.options.dictRemoveFile+""),e.previewElement.appendChild(e._removeLink)),n=function(o){return function(n){return n.preventDefault(),n.stopPropagation(),e.status===t.UPLOADING?t.confirm(o.options.dictCancelUploadConfirmation,function(){return o.removeFile(e)}):o.options.dictRemoveFileConfirmation?t.confirm(o.options.dictRemoveFileConfirmation,function(){return o.removeFile(e)}):o.removeFile(e)}}(this),f=e.previewElement.querySelectorAll("[data-dz-remove]"),h=[],i=0,u=f.length;i\n
\n
\n
\n
\n
\n
\n
\n
\n \n Check\n \n \n \n \n \n
\n
\n \n Error\n \n \n \n \n \n \n \n
\n'},o=function(){var e,t,o,n,r,s,l;for(n=arguments[0],o=2<=arguments.length?u.call(arguments,1):[],s=0,l=o.length;s'+this.options.dictDefaultMessage+"")),this.clickableElements.length&&(n=function(e){return function(){return e.hiddenFileInput&&e.hiddenFileInput.parentNode.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(null==e.options.maxFiles||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",null!=e.options.acceptedFiles&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),null!=e.options.capture&&e.hiddenFileInput.setAttribute("capture",e.options.capture),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",document.querySelector(e.options.hiddenInputContainer).appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var t,o,r,s;if(o=e.hiddenFileInput.files,o.length)for(r=0,s=o.length;r',this.options.dictFallbackText&&(n+="

"+this.options.dictFallbackText+"

"),n+='',o=t.createElement(n),"FORM"!==this.element.tagName?(r=t.createElement('
'),r.appendChild(o)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=r?r:o)},t.prototype.getExistingFallback=function(){var e,t,o,n,r,s;for(t=function(e){var t,o,n;for(o=0,n=e.length;o0){for(l=["TB","GB","MB","KB","b"],o=i=0,a=l.length;i=t){n=e/Math.pow(this.options.filesizeBase,4-o),r=s;break}n=Math.round(10*n)/10}return""+n+" "+r},t.prototype._updateMaxFilesReachedClass=function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},t.prototype.drop=function(e){var t,o;e.dataTransfer&&(this.emit("drop",e),t=e.dataTransfer.files,this.emit("addedfiles",t),t.length&&(o=e.dataTransfer.items,o&&o.length&&null!=o[0].webkitGetAsEntry?this._addFilesFromItems(o):this.handleFiles(t)))},t.prototype.paste=function(e){var t,o;if(null!=(null!=e&&null!=(o=e.clipboardData)?o.items:void 0))return this.emit("paste",e),t=e.clipboardData.items,t.length?this._addFilesFromItems(t):void 0},t.prototype.handleFiles=function(e){var t,o,n,r;for(r=[],o=0,n=e.length;o0){for(s=0,l=o.length;s1024*this.options.maxFilesize*1024?o(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):t.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(o(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,o):o(this.options.dictInvalidFileType)},t.prototype.addFile=function(e){return e.upload={progress:0,total:e.size,bytesSent:0},this.files.push(e),e.status=t.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,function(t){return function(o){return o?(e.accepted=!1,t._errorProcessing([e],o)):(e.accepted=!0,t.options.autoQueue&&t.enqueueFile(e)),t._updateMaxFilesReachedClass()}}(this))},t.prototype.enqueueFiles=function(e){var t,o,n;for(o=0,n=e.length;o=t)&&(n=this.getQueuedFiles(),n.length>0)){if(this.options.uploadMultiple)return this.processFiles(n.slice(0,t-o));for(;e=M;u=0<=M?++x:--x)s.append(this._getParamName(u),e[u],this._renameFilename(e[u].name));return this.submitRequest(j,s,e)},t.prototype.submitRequest=function(e,t,o){return e.send(t)},t.prototype._finished=function(e,o,n){var r,s,l;for(s=0,l=e.length;sd;)t=r[4*(i-1)+3],0===t?s=i:d=i,i=s+d>>1;return a=i/l,0===a?1:a},i=function(e,t,o,n,r,s,i,a,d,u){var c;return c=l(t),e.drawImage(t,o,n,r,s,i,a,d,u/c)},s=function(e,t){var o,n,r,s,l,i,a,d,u;if(r=!1,u=!0,n=e.document,d=n.documentElement,o=n.addEventListener?"addEventListener":"attachEvent",a=n.addEventListener?"removeEventListener":"detachEvent",i=n.addEventListener?"":"on",s=function(o){if("readystatechange"!==o.type||"complete"===n.readyState)return("load"===o.type?e:n)[a](i+o.type,s,!1),!r&&(r=!0)?t.call(e,o.type||o):void 0},l=function(){try{d.doScroll("left")}catch(e){return void setTimeout(l,50)}return s("poll")},"complete"!==n.readyState){if(n.createEventObject&&d.doScroll){try{u=!e.frameElement}catch(e){}u&&l()}return n[o](i+"DOMContentLoaded",s,!1),n[o](i+"readystatechange",s,!1),e[o](i+"load",s,!1)}},o._autoDiscoverFunction=function(){if(o.autoDiscover)return o.discover()},s(window,o._autoDiscoverFunction)}).call(this)}).call(t,o(6),o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/expose-loader/index.js?InsertEmbedModal!./client/src/components/InsertEmbedModal/InsertEmbedModal.js-exposed":function(e,t,o){(function(t){e.exports=t.InsertEmbedModal=o('./node_modules/babel-loader/lib/index.js?{"presets":[["env",{"modules":false}],"react"],"plugins":["transform-object-rest-spread"],"comments":false,"cacheDirectory":false}!./client/src/components/InsertEmbedModal/InsertEmbedModal.js')}).call(t,o("./node_modules/webpack/buildin/global.js"))},"./node_modules/expose-loader/index.js?InsertMediaModal!./client/src/containers/InsertMediaModal/InsertMediaModal.js-exposed":function(e,t,o){(function(t){e.exports=t.InsertMediaModal=o('./node_modules/babel-loader/lib/index.js?{"presets":[["env",{"modules":false}],"react"],"plugins":["transform-object-rest-spread"],"comments":false,"cacheDirectory":false}!./client/src/containers/InsertMediaModal/InsertMediaModal.js')}).call(t,o("./node_modules/webpack/buildin/global.js"))},"./node_modules/griddle-react/modules/columnProperties.js":function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o0}},{key:"getMetadataColumnProperty",value:function(e,t,o){var n=this.getColumnMetadataByName(e);return void 0===n||null===n?o:n.hasOwnProperty(t)?n[t]:o}},{key:"orderColumns",value:function(e){var t=this;return a(e,function(e){var o=i(t.columnMetadata,{columnName:e});return void 0===o||null===o||isNaN(o.order)?100:o.order})}},{key:"getColumns",value:function(){var e=0===this.filteredColumns.length?this.allColumns:this.filteredColumns;return e=d(e,this.metadataColumns),e=this.orderColumns(e)}}]),e}();e.exports=u},"./node_modules/griddle-react/modules/customFilterContainer.jsx.js":function(e,t,o){"use strict";var n=o(0),r=n.createClass({displayName:"CustomFilterContainer",getDefaultProps:function(){return{placeholderText:""}},render:function(){var e=this;return"function"!=typeof e.props.customFilterComponent?(console.log("Couldn't find valid template."),n.createElement("div",null)):n.createElement(e.props.customFilterComponent,{changeFilter:this.props.changeFilter,results:this.props.results,currentResults:this.props.currentResults,placeholderText:this.props.placeholderText})}});e.exports=r},"./node_modules/griddle-react/modules/customPaginationContainer.jsx.js":function(e,t,o){"use strict";var n=Object.assign||function(e){for(var t=1;t0&&(e=n.createElement("button",{type:"button",onClick:this.props.previous,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 0 0 10px"}:null},this.props.previousIconComponent,this.props.previousText)),this.props.currentPage!==this.props.maxPage-1&&(t=n.createElement("button",{type:"button",onClick:this.props.next,style:this.props.useGriddleStyles?{color:"#222",border:"none",background:"none",margin:"0 10px 0 0"}:null},this.props.nextText,this.props.nextIconComponent));var o=null,s=null,l=null;if(!0===this.props.useGriddleStyles){var i={float:"left",minHeight:"1px",marginTop:"5px"};l=r({textAlign:"right",width:"34%"},i),s=r({textAlign:"center",width:"33%"},i),o=r({width:"33%"},i)}for(var a=[],d=1;d<=this.props.maxPage;d++)a.push(n.createElement("option",{value:d,key:d},d));return n.createElement("div",{style:this.props.useGriddleStyles?{minHeight:"35px"}:null},n.createElement("div",{className:this.props.previousClassName,style:o},e),n.createElement("div",{className:"griddle-page",style:s},n.createElement("select",{value:this.props.currentPage+1,onChange:this.pageChange},a)," / ",this.props.maxPage),n.createElement("div",{className:this.props.nextClassName,style:l},t))}});e.exports=s},"./node_modules/griddle-react/modules/gridRow.jsx.js":function(e,t,o){"use strict";var n=o(0),r=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/modules/deep.js")),s=o("./node_modules/griddle-react/node_modules/lodash/isFunction.js"),l=o("./node_modules/griddle-react/node_modules/lodash/zipObject.js"),i=o("./node_modules/griddle-react/node_modules/lodash/assign.js"),a=o("./node_modules/griddle-react/node_modules/lodash/defaults.js"),d=o("./node_modules/griddle-react/node_modules/lodash/toPairs.js"),u=o("./node_modules/griddle-react/node_modules/lodash/without.js"),c=n.createClass({displayName:"GridRow",getDefaultProps:function(){return{isChildRow:!1,showChildren:!1,data:{},columnSettings:null,rowSettings:null,hasChildren:!1,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null}},handleClick:function(e){null!==this.props.onRowClick&&s(this.props.onRowClick)?this.props.onRowClick(this,e):this.props.hasChildren&&this.props.toggleChildren()},handleSelectionChange:function(e){},handleSelectClick:function(e){this.props.multipleSelectionSettings.isMultipleSelection&&("checkbox"===e.target.type?this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,this.refs.selected.checked):this.props.multipleSelectionSettings.toggleSelectRow(this.props.data,!this.refs.selected.checked))},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRow: The columnSettings prop is null and it shouldn't be")},formatData:function(e){return"boolean"==typeof e?String(e):e},render:function(){var e=this;this.verifyProps();var t=this,o=null;this.props.useGriddleStyles&&(o={margin:"0px",padding:t.props.paddingHeight+"px 5px "+t.props.paddingHeight+"px 5px",height:t.props.rowHeight?this.props.rowHeight-2*t.props.paddingHeight+"px":null,backgroundColor:"#FFF",borderTopColor:"#DDD",color:"#222"});var c=this.props.columnSettings.getColumns(),p=l(c,[]),f=i({},this.props.data);a(f,p);var h,m,_=d(r.pick(f,u(c,"children"))),g=_.map(function(t,r){var s=null,l=e.props.columnSettings.getColumnMetadataByName(t[0]),a=0===r&&e.props.hasChildren&&!1===e.props.showChildren&&e.props.useGriddleIcons?n.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px",marginRight:"5px"}:null},e.props.parentRowCollapsedComponent):0===r&&e.props.hasChildren&&e.props.showChildren&&e.props.useGriddleIcons?n.createElement("span",{style:e.props.useGriddleStyles?{fontSize:"10px"}:null},e.props.parentRowExpandedComponent):"";if(0===r&&e.props.isChildRow&&e.props.useGriddleStyles&&(o=i(o,{paddingLeft:10})),e.props.columnSettings.hasColumnMetadata()&&void 0!==l&&null!==l)if(void 0!==l.customComponent&&null!==l.customComponent){var d=n.createElement(l.customComponent,{data:t[1],rowData:f,metadata:l});s=n.createElement("td",{onClick:e.handleClick,className:l.cssClassName,key:r,style:o},d)}else s=n.createElement("td",{onClick:e.handleClick,className:l.cssClassName,key:r,style:o},a,e.formatData(t[1]));return s||n.createElement("td",{onClick:e.handleClick,key:r,style:o},a,t[1])});null!==this.props.onRowClick&&s(this.props.onRowClick)?(h=null,m=this.handleSelectClick):this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection?(h=this.handleSelectClick,m=null):(h=null,m=null),g&&this.props.multipleSelectionSettings&&this.props.multipleSelectionSettings.isMultipleSelection&&(this.props.multipleSelectionSettings.getSelectedRowIds(),g.unshift(n.createElement("td",{key:"selection",style:o,className:"griddle-select griddle-select-cell",onClick:m},n.createElement("input",{type:"checkbox",checked:this.props.multipleSelectionSettings.getIsRowChecked(f),onChange:this.handleSelectionChange,ref:"selected"}))));var y=t.props.rowSettings&&t.props.rowSettings.getBodyRowMetadataClass(t.props.data)||"standard-row";return t.props.isChildRow?y="child-row":t.props.hasChildren&&(y=t.props.showChildren?this.props.parentRowExpandedClassName:this.props.parentRowCollapsedClassName),n.createElement("tr",{onClick:h,className:y},g)}});e.exports=c},"./node_modules/griddle-react/modules/gridRowContainer.jsx.js":function(e,t,o){"use strict";var n=o(0),r=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/node_modules/lodash/pick.js")),s=n.createClass({displayName:"GridRowContainer",getDefaultProps:function(){return{useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,columnSettings:null,rowSettings:null,paddingHeight:null,rowHeight:null,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",onRowClick:null,multipleSelectionSettings:null}},getInitialState:function(){return{data:{},showChildren:!1}},componentWillReceiveProps:function(){this.setShowChildren(!1)},toggleChildren:function(){this.setShowChildren(!1===this.state.showChildren)},setShowChildren:function(e){this.setState({showChildren:e})},verifyProps:function(){null===this.props.columnSettings&&console.error("gridRowContainer: The columnSettings prop is null and it shouldn't be")},render:function(){this.verifyProps();var e=this;if(void 0===this.props.data)return n.createElement("tbody",null);var t=[],o=this.props.columnSettings.getColumns();t.push(n.createElement(this.props.rowSettings.rowComponent,{useGriddleStyles:this.props.useGriddleStyles,isSubGriddle:this.props.isSubGriddle,data:this.props.rowSettings.isCustom?r(this.props.data,o):this.props.data,rowData:this.props.rowSettings.isCustom?this.props.data:null,columnSettings:this.props.columnSettings,rowSettings:this.props.rowSettings,hasChildren:e.props.hasChildren,toggleChildren:e.toggleChildren,showChildren:e.state.showChildren,key:e.props.uniqueId+"_base_row",useGriddleIcons:e.props.useGriddleIcons,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedComponent:this.props.parentRowExpandedComponent,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight,onRowClick:e.props.onRowClick,multipleSelectionSettings:this.props.multipleSelectionSettings}));var s=null;return e.state.showChildren&&(s=e.props.hasChildren&&this.props.data.children.map(function(t,o){var r=e.props.rowSettings.getRowKey(t,o);if(void 0!==t.children){var s=e.constructor.Griddle;return n.createElement("tr",{key:r,style:{paddingLeft:5}},n.createElement("td",{colSpan:e.props.columnSettings.getVisibleColumnCount(),className:"griddle-parent",style:e.props.useGriddleStyles?{border:"none",padding:"0 0 0 5px"}:null},n.createElement(s,{rowMetadata:{key:"id"},isSubGriddle:!0,results:[t],columns:e.props.columnSettings.getColumns(),tableClassName:e.props.tableClassName,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,showTableHeading:!1,showPager:!1,columnMetadata:e.props.columnSettings.columnMetadata,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,paddingHeight:e.props.paddingHeight,rowHeight:e.props.rowHeight})))}return n.createElement(e.props.rowSettings.rowComponent,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,data:t,columnSettings:e.props.columnSettings,isChildRow:!0,columnMetadata:e.props.columnSettings.columnMetadata,key:r})})),!1===e.props.hasChildren?t[0]:n.createElement("tbody",null,e.state.showChildren?t.concat(s):t)}});e.exports=s},"./node_modules/griddle-react/modules/gridSettings.jsx.js":function(e,t,o){"use strict";var n=o(0),r=o("./node_modules/griddle-react/node_modules/lodash/includes.js"),s=o("./node_modules/griddle-react/node_modules/lodash/without.js"),l=o("./node_modules/griddle-react/node_modules/lodash/find.js"),i=n.createClass({displayName:"GridSettings",getDefaultProps:function(){return{columns:[],columnMetadata:[],selectedColumns:[],settingsText:"",maxRowsText:"",resultsPerPage:0,enableToggleCustom:!1,useCustomComponent:!1,useGriddleStyles:!0,toggleCustomComponent:function(){}}},setPageSize:function(e){var t=parseInt(e.target.value,10);this.props.setPageSize(t)},handleChange:function(e){var t=e.target.dataset?e.target.dataset.name:e.target.getAttribute("data-name");!0===e.target.checked&&!1===r(this.props.selectedColumns,t)?(this.props.selectedColumns.push(t),this.props.setColumns(this.props.selectedColumns)):this.props.setColumns(s(this.props.selectedColumns,t))},render:function(){var e=this,t=[];!1===e.props.useCustomComponent&&(t=this.props.columns.map(function(t,o){var s=r(e.props.selectedColumns,t),i=l(e.props.columnMetadata,{columnName:t}),a=t;return void 0!==i&&void 0!==i.displayName&&null!=i.displayName&&(a=i.displayName),void 0!==i&&null!=i&&i.locked?n.createElement("div",{className:"column checkbox"},n.createElement("label",null,n.createElement("input",{type:"checkbox",disabled:!0,name:"check",checked:s,"data-name":t}),a)):void 0!==i&&null!=i&&void 0!==i.visible&&!1===i.visible?null:n.createElement("div",{className:"griddle-column-selection checkbox",key:t,style:e.props.useGriddleStyles?{float:"left",width:"20%"}:null},n.createElement("label",null,n.createElement("input",{type:"checkbox",name:"check",onChange:e.handleChange,checked:s,"data-name":t}),a))}));var o=e.props.enableToggleCustom?n.createElement("div",{className:"form-group"},n.createElement("label",{htmlFor:"maxRows"},n.createElement("input",{type:"checkbox",checked:this.props.useCustomComponent,onChange:this.props.toggleCustomComponent})," ",this.props.enableCustomFormatText)):"",s=this.props.showSetPageSize?n.createElement("div",null,n.createElement("label",{htmlFor:"maxRows"},this.props.maxRowsText,":",n.createElement("select",{onChange:this.setPageSize,value:this.props.resultsPerPage},n.createElement("option",{value:"5"},"5"),n.createElement("option",{value:"10"},"10"),n.createElement("option",{value:"25"},"25"),n.createElement("option",{value:"50"},"50"),n.createElement("option",{value:"100"},"100")))):"";return n.createElement("div",{className:"griddle-settings",style:this.props.useGriddleStyles?{backgroundColor:"#FFF",border:"1px solid #DDD",color:"#222",padding:"10px",marginBottom:"10px"}:null},n.createElement("h6",null,this.props.settingsText),n.createElement("div",{className:"griddle-columns",style:this.props.useGriddleStyles?{clear:"both",display:"table",width:"100%",borderBottom:"1px solid #EDEDED",marginBottom:"10px"}:null},t),s,o)}});e.exports=i},"./node_modules/griddle-react/modules/gridTable.jsx.js":function(e,t,o){"use strict";var n=o(0),r=o("./node_modules/griddle-react/modules/gridTitle.jsx.js"),s=o("./node_modules/griddle-react/modules/gridRowContainer.jsx.js"),l=(o("./node_modules/griddle-react/modules/columnProperties.js"),o("./node_modules/griddle-react/modules/rowProperties.js"),n.createClass({displayName:"GridTable",getDefaultProps:function(){return{data:[],columnSettings:null,rowSettings:null,sortSettings:null,multipleSelectionSettings:null,className:"",enableInfiniteScroll:!1,nextPage:null,hasMorePages:!1,useFixedHeader:!1,useFixedLayout:!0,paddingHeight:null,rowHeight:null,filterByColumn:null,infiniteScrollLoadTreshold:null,bodyHeight:null,useGriddleStyles:!0,useGriddleIcons:!0,isSubGriddle:!1,parentRowCollapsedClassName:"parent-row",parentRowExpandedClassName:"parent-row expanded",parentRowCollapsedComponent:"â–¶",parentRowExpandedComponent:"â–¼",externalLoadingComponent:null,externalIsLoading:!1,onRowClick:null}},getInitialState:function(){return{scrollTop:0,scrollHeight:this.props.bodyHeight,clientHeight:this.props.bodyHeight}},componentDidMount:function(){this.gridScroll()},componentDidUpdate:function(e,t){this.gridScroll()},gridScroll:function(){if(this.props.enableInfiniteScroll&&!this.props.externalIsLoading){var e=this.refs.scrollable,t=e.scrollTop,o=e.scrollHeight,n=e.clientHeight;if(null!==this.props.rowHeight&&this.state.scrollTop!==t&&Math.abs(this.state.scrollTop-t)>=this.getAdjustedRowHeight()){var r={scrollTop:t,scrollHeight:o,clientHeight:n};this.setState(r)}.6*(o-(t+n)-this.props.infiniteScrollLoadTreshold)<=this.props.infiniteScrollLoadTreshold&&this.props.nextPage()}},verifyProps:function(){null===this.props.columnSettings&&console.error("gridTable: The columnSettings prop is null and it shouldn't be"),null===this.props.rowSettings&&console.error("gridTable: The rowSettings prop is null and it shouldn't be")},getAdjustedRowHeight:function(){return this.props.rowHeight+2*this.props.paddingHeight},getNodeContent:function(){this.verifyProps();var e=this,t=!1;if(!this.props.externalIsLoading||this.props.enableInfiniteScroll){var o=e.props.data,r=null,l=null;if(this.props.enableInfiniteScroll&&null!==this.props.rowHeight&&void 0!==this.refs.scrollable){var i=e.getAdjustedRowHeight(),a=Math.ceil(e.state.clientHeight/i),d=Math.max(0,Math.floor(e.state.scrollTop/i)-.25*a),u=Math.min(d+1.25*a,this.props.data.length-1);o=o.slice(d,u+1);var c={height:d*i+"px"};r=n.createElement("tr",{key:"above-"+c.height,style:c});var p={height:(this.props.data.length-u)*i+"px"};l=n.createElement("tr",{key:"below-"+p.height,style:p})}var f=o.map(function(o,r){var l=void 0!==o.children&&o.children.length>0,i=e.props.rowSettings.getRowKey(o,r);return l&&(t=l),n.createElement(s,{useGriddleStyles:e.props.useGriddleStyles,isSubGriddle:e.props.isSubGriddle,parentRowExpandedClassName:e.props.parentRowExpandedClassName,parentRowCollapsedClassName:e.props.parentRowCollapsedClassName,parentRowExpandedComponent:e.props.parentRowExpandedComponent,parentRowCollapsedComponent:e.props.parentRowCollapsedComponent,data:o,key:i+"-container",uniqueId:i,columnSettings:e.props.columnSettings,rowSettings:e.props.rowSettings,paddingHeight:e.props.paddingHeight,multipleSelectionSettings:e.props.multipleSelectionSettings,rowHeight:e.props.rowHeight,hasChildren:l,tableClassName:e.props.className,onRowClick:e.props.onRowClick})});if(this.props.showNoData){var h=this.props.columnSettings.getVisibleColumnCount();f.push(n.createElement("tr",{key:"no-data-section"},n.createElement("td",{colSpan:h},this.props.noDataSection)))}return r&&f.unshift(r),l&&f.push(l),{nodes:f,anyHasChildren:t}}return null},render:function(){var e=[],t=!1,o=this.getNodeContent();o&&(e=o.nodes,t=o.anyHasChildren);var s=null,l=null,i={width:"100%"};if(this.props.useFixedLayout&&(i.tableLayout="fixed"),this.props.enableInfiniteScroll&&(s={position:"relative",overflowY:"scroll",height:this.props.bodyHeight+"px",width:"100%"}),this.props.externalIsLoading){var a=null,d=null;this.props.useGriddleStyles&&(a={textAlign:"center",paddingBottom:"40px"}),d=this.props.columnSettings.getVisibleColumnCount();var u=this.props.externalLoadingComponent?n.createElement(this.props.externalLoadingComponent,null):n.createElement("div",null,"Loading...");l=n.createElement("tbody",null,n.createElement("tr",null,n.createElement("td",{style:a,colSpan:d},u)))}var c=this.props.showTableHeading?n.createElement(r,{useGriddleStyles:this.props.useGriddleStyles,useGriddleIcons:this.props.useGriddleIcons,sortSettings:this.props.sortSettings,multipleSelectionSettings:this.props.multipleSelectionSettings,columnSettings:this.props.columnSettings,filterByColumn:this.props.filterByColumn,rowSettings:this.props.rowSettings}):void 0;t||(e=n.createElement("tbody",null,e));var p=n.createElement("tbody",null);if(this.props.showPager){var f=this.props.useGriddleStyles?{padding:"0px",backgroundColor:"#EDEDED",border:"0px",color:"#222",height:this.props.showNoData?"20px":null}:null;p=n.createElement("tbody",null,n.createElement("tr",null,n.createElement("td",{colSpan:this.props.multipleSelectionSettings.isMultipleSelection?this.props.columnSettings.getVisibleColumnCount()+1:this.props.columnSettings.getVisibleColumnCount(),style:f,className:"footer-container"},this.props.showNoData?null:this.props.pagingContent)))}return this.props.useFixedHeader?(this.props.useGriddleStyles&&(i.tableLayout="fixed"),n.createElement("div",null,n.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},c),n.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:s},n.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},e,l,p)))):n.createElement("div",{ref:"scrollable",onScroll:this.gridScroll,style:s},n.createElement("table",{className:this.props.className,style:this.props.useGriddleStyles&&i||null},c,e,l,p))}}));e.exports=l},"./node_modules/griddle-react/modules/gridTitle.jsx.js":function(e,t,o){"use strict";var n=Object.assign||function(e){for(var t=1;t=0)return!0;return!1})},defaultColumnFilter:function(e,t){return A(g.getObjectValues(e),function(e){return e.toString().toLowerCase().indexOf(t.toLowerCase())>=0}).length>0},filterByColumnFilters:function(e){var t=this.defaultColumnFilter,o=Object.keys(e).reduce(function(o,n){return A(o,function(o){var r=g.getAt(o,n||""),s=e[n];return t(r,s)})},this.props.results),n={columnFilters:e};e?(n.filteredResults=o,n.maxPage=this.getMaxPage(n.filteredResults)):this.state.filter?n.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,filter):this.defaultFilter(this.props.results,filter):n.filteredResults=null,this.setState(n)},filterByColumn:function(e,t){var o=this.state.columnFilters;if(o.hasOwnProperty(t)&&!e)o=F(o,t);else{var n={};n[t]=e,o=x({},o,n)}this.filterByColumnFilters(o)},setFilter:function(e){if(this.props.useExternal)return void this.props.externalSetFilter(e);var t=this,o={page:0,filter:e};o.filteredResults=this.props.useCustomFilterer?this.props.customFilterer(this.props.results,e):this.defaultFilter(this.props.results,e),o.maxPage=t.getMaxPage(o.filteredResults),(O(e)||T(e)||w(e))&&(o.filter=e,o.filteredResults=null),t.setState(o),this._resetSelectedRows()},setPageSize:function(e){if(this.props.useExternal)return this.setState({resultsPerPage:e}),void this.props.externalSetPageSize(e);this.state.resultsPerPage=e,this.setMaxPage()},toggleColumnChooser:function(){this.setState({showColumnChooser:!this.state.showColumnChooser})},isNullOrUndefined:function(e){return void 0===e||null===e},shouldUseCustomRowComponent:function(){return this.isNullOrUndefined(this.state.useCustomRowComponent)?this.props.useCustomRowComponent:this.state.useCustomRowComponent},shouldUseCustomGridComponent:function(){return this.isNullOrUndefined(this.state.useCustomGridComponent)?this.props.useCustomGridComponent:this.state.useCustomGridComponent},toggleCustomComponent:function(){"grid"===this.state.customComponentType?this.setState({useCustomGridComponent:!this.shouldUseCustomGridComponent()}):"row"===this.state.customComponentType&&this.setState({useCustomRowComponent:!this.shouldUseCustomRowComponent()})},getMaxPage:function(e,t){return this.props.useExternal?this.props.externalMaxPage:(t||(t=(e||this.getCurrentResults()).length),Math.ceil(t/this.state.resultsPerPage))},setMaxPage:function(e){var t=this.getMaxPage(e);this.state.maxPage!==t&&this.setState({page:0,maxPage:t,filteredColumns:this.columnSettings.filteredColumns})},setPage:function(e){if(this.props.useExternal)return void this.props.externalSetPage(e);if(e*this.state.resultsPerPage<=this.state.resultsPerPage*this.state.maxPage){var t=this,o={page:e};t.setState(o)}this.props.enableInfiniteScroll&&this.setState({isSelectAllChecked:!1})},setColumns:function(e){this.columnSettings.filteredColumns=P(e)?e:[e],this.setState({filteredColumns:this.columnSettings.filteredColumns})},nextPage:function(){var e=this.getCurrentPage();e0&&this.setPage(e-1)},changeSort:function(e){if(!1!==this.props.enableSort){if(this.props.useExternal){var t=this.props.externalSortColumn!==e||!this.props.externalSortAscending;return this.setState({sortColumn:e,sortDirection:t?"asc":"desc"}),void this.props.externalChangeSort(e,t)}var o=b(this.props.columnMetadata,{columnName:e})||{},n=o.sortDirectionCycle?o.sortDirectionCycle:[null,"asc","desc"],r=null,s=n.indexOf(this.state.sortDirection&&e===this.state.sortColumn?this.state.sortDirection:null);s=(s+1)%n.length,r=n[s]?n[s]:null;var l={page:0,sortColumn:e,sortDirection:r};this.setState(l)}},componentWillReceiveProps:function(e){if(this.setMaxPage(e.results),e.resultsPerPage!==this.props.resultsPerPage&&this.setPageSize(e.resultsPerPage),this.columnSettings.columnMetadata=e.columnMetadata,e.results.length>0){var t=g.keys(e.results[0]);this.columnSettings.allColumns.length==t.length&&this.columnSettings.allColumns.every(function(e,o){return e===t[o]})||(this.columnSettings.allColumns=t)}else this.columnSettings.allColumns.length>0&&(this.columnSettings.allColumns=[]);if(e.selectedRowIds){var o=this.getDataForRender(this.getCurrentResults(e.results),this.columnSettings.getColumns(),!0);this.setState({isSelectAllChecked:this._getAreAllRowsChecked(e.selectedRowIds,I(o,this.props.uniqueIdentifier)),selectedRowIds:e.selectedRowIds})}},getInitialState:function(){return{maxPage:0,page:0,filteredResults:null,filteredColumns:[],filter:"",columnFilters:{},resultsPerPage:this.props.resultsPerPage||5,showColumnChooser:!1,isSelectAllChecked:!1,selectedRowIds:this.props.selectedRowIds}},componentWillMount:function(){this.verifyExternal(),this.verifyCustom(),this.columnSettings=new m(this.props.results.length>0?g.keys(this.props.results[0]):[],this.props.columns,this.props.childrenColumnName,this.props.columnMetadata,this.props.metadataColumns),this.rowSettings=new _(this.props.rowMetadata,this.props.useCustomTableRowComponent&&this.props.customTableRowComponent?this.props.customTableRowComponent:u,this.props.useCustomTableRowComponent),this.props.initialSort&&(this.props.useExternal?this.setState({sortColumn:this.props.externalSortColumn,sortDirection:this.props.externalSortAscending?"asc":"desc"}):this.changeSort(this.props.initialSort)),this.setMaxPage(),this.shouldUseCustomGridComponent()?this.setState({customComponentType:"grid"}):this.shouldUseCustomRowComponent()?this.setState({customComponentType:"row"}):this.setState({filteredColumns:this.columnSettings.filteredColumns})},componentDidMount:function(){if(this.props.componentDidMount&&"function"==typeof this.props.componentDidMount)return this.props.componentDidMount()},componentDidUpdate:function(){if(this.props.componentDidUpdate&&"function"==typeof this.props.componentDidUpdate)return this.props.componentDidUpdate(this.state)},verifyExternal:function(){!0===this.props.useExternal&&(null===this.props.externalSetPage&&console.error("useExternal is set to true but there is no externalSetPage function specified."),null===this.props.externalChangeSort&&console.error("useExternal is set to true but there is no externalChangeSort function specified."),null===this.props.externalSetFilter&&console.error("useExternal is set to true but there is no externalSetFilter function specified."),null===this.props.externalSetPageSize&&console.error("useExternal is set to true but there is no externalSetPageSize function specified."),null===this.props.externalMaxPage&&console.error("useExternal is set to true but externalMaxPage is not set."),null===this.props.externalCurrentPage&&console.error("useExternal is set to true but externalCurrentPage is not set. Griddle will not page correctly without that property when using external data."))},verifyCustom:function(){!0===this.props.useCustomGridComponent&&null===this.props.customGridComponent&&console.error("useCustomGridComponent is set to true but no custom component was specified."),!0===this.props.useCustomRowComponent&&null===this.props.customRowComponent&&console.error("useCustomRowComponent is set to true but no custom component was specified."),!0===this.props.useCustomGridComponent&&!0===this.props.useCustomRowComponent&&console.error("Cannot currently use both customGridComponent and customRowComponent."),!0===this.props.useCustomFilterer&&null===this.props.customFilterer&&console.error("useCustomFilterer is set to true but no custom filter function was specified."),!0===this.props.useCustomFilterComponent&&null===this.props.customFilterComponent&&console.error("useCustomFilterComponent is set to true but no customFilterComponent was specified.")},getDataForRender:function(e,t,o){var n=this,r=this;if(""!==this.state.sortColumn){var s,l=this.state.sortColumn,i=A(this.props.columnMetadata,{columnName:l}),a={columns:[],orders:[]};if(i.length>0&&(s=i[0].hasOwnProperty("customCompareFn")&&i[0].customCompareFn,i[0].multiSort&&(a=i[0].multiSort)),this.state.sortDirection)if("function"==typeof s)2===s.length?(e=e.sort(function(e,t){return s(k(e,l),k(t,l))}),"desc"===this.state.sortDirection&&e.reverse()):1===s.length&&(e=D(e,function(e){return s(k(e,l))},[this.state.sortDirection]));else{var d=[function(e){return(k(e,l)||"").toString().toLowerCase()}],u=[this.state.sortDirection];a.columns.forEach(function(e,t){d.push(function(t){return(k(t,e)||"").toString().toLowerCase()}),"asc"===a.orders[t]||"desc"===a.orders[t]?u.push(a.orders[t]):u.push(n.state.sortDirection)}),e=D(e,d,u)}}var c=this.getCurrentPage();if(!this.props.useExternal&&o&&this.state.resultsPerPage*(c+1)<=this.state.resultsPerPage*this.state.maxPage&&c>=0)if(this.isInfiniteScrollEnabled())e=E(e,(c+1)*this.state.resultsPerPage);else{var p=y(e,c*this.state.resultsPerPage);e=(v||S)(p,p.length-this.state.resultsPerPage)}for(var f=(this.columnSettings.getMetadataColumns,[]),h=0;h0&&(m.children=r.getDataForRender(m[r.props.childrenColumnName],t,!1),"children"!==r.props.childrenColumnName&&delete m[r.props.childrenColumnName]),f.push(m)}return f},getCurrentResults:function(e){return this.state.filteredResults||e||this.props.results},getCurrentPage:function(){return this.props.externalCurrentPage||this.state.page},getCurrentSort:function(){return this.props.useExternal?this.props.externalSortColumn:this.state.sortColumn},getCurrentSortAscending:function(){return this.props.useExternal?this.props.externalSortAscending:"asc"===this.state.sortDirection},getCurrentMaxPage:function(){return this.props.useExternal?this.props.externalMaxPage:this.state.maxPage},getSortObject:function(){return{enableSort:this.props.enableSort,changeSort:this.changeSort,sortColumn:this.getCurrentSort(),sortAscending:this.getCurrentSortAscending(),sortDirection:this.state.sortDirection,sortAscendingClassName:this.props.sortAscendingClassName,sortDescendingClassName:this.props.sortDescendingClassName,sortAscendingComponent:this.props.sortAscendingComponent,sortDescendingComponent:this.props.sortDescendingComponent,sortDefaultComponent:this.props.sortDefaultComponent}},_toggleSelectAll:function(){var e=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),t=!this.state.isSelectAllChecked,o=JSON.parse(JSON.stringify(this.state.selectedRowIds)),n=this;j(e,function(e){n._updateSelectedRowIds(e[n.props.uniqueIdentifier],o,t)},this),this.setState({isSelectAllChecked:t,selectedRowIds:o}),this.props.onSelectionChange&&this.props.onSelectionChange(o,t)},_toggleSelectRow:function(e,t){var o=this.getDataForRender(this.getCurrentResults(),this.columnSettings.getColumns(),!0),n=JSON.parse(JSON.stringify(this.state.selectedRowIds));this._updateSelectedRowIds(e[this.props.uniqueIdentifier],n,t);var r=this._getAreAllRowsChecked(n,I(o,this.props.uniqueIdentifier));this.setState({isSelectAllChecked:r,selectedRowIds:n}),this.props.onSelectionChange&&this.props.onSelectionChange(n,r)},_updateSelectedRowIds:function(e,t,o){o?void 0===b(t,function(t){return e===t})&&t.push(e):t.splice(t.indexOf(e),1)},_getIsSelectAllChecked:function(){return this.state.isSelectAllChecked},_getAreAllRowsChecked:function(e,t){return t.length===C(t,e).length},_getIsRowChecked:function(e){return this.state.selectedRowIds.indexOf(e[this.props.uniqueIdentifier])>-1},getSelectedRowIds:function(){return this.state.selectedRowIds},_resetSelectedRows:function(){this.setState({isSelectAllChecked:!1,selectedRowIds:[]})},getMultipleSelectionObject:function(){return{isMultipleSelection:!b(this.props.results,function(e){return"children"in e})&&this.props.isMultipleSelection,toggleSelectAll:this._toggleSelectAll,getIsSelectAllChecked:this._getIsSelectAllChecked,toggleSelectRow:this._toggleSelectRow,getSelectedRowIds:this.getSelectedRowIds,getIsRowChecked:this._getIsRowChecked}},isInfiniteScrollEnabled:function(){return!this.props.useCustomPagerComponent&&this.props.enableInfiniteScroll},getClearFixStyles:function(){return{clear:"both",display:"table",width:"100%"}},getSettingsStyles:function(){return{float:"left",width:"50%",textAlign:"right"}},getFilterStyles:function(){return{float:"left",width:"50%",textAlign:"left",color:"#222",minHeight:"1px"}},getFilter:function(){return this.props.showFilter&&!1===this.shouldUseCustomGridComponent()?this.props.useCustomFilterComponent?r.createElement(h,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText,customFilterComponent:this.props.customFilterComponent,results:this.props.results,currentResults:this.getCurrentResults()}):r.createElement(l,{changeFilter:this.setFilter,placeholderText:this.props.filterPlaceholderText}):""},getSettings:function(){return this.props.showSettings?r.createElement("button",{type:"button",className:this.props.settingsToggleClassName,onClick:this.toggleColumnChooser,style:this.props.useGriddleStyles?{background:"none",border:"none",padding:0,margin:0,fontSize:14}:null},this.props.settingsText,this.props.settingsIconComponent):""},getTopSection:function(e,t){if(!1===this.props.showFilter&&!1===this.props.showSettings)return"";var o=null,n=null,s=null;return this.props.useGriddleStyles&&(o=this.getFilterStyles(),n=this.getSettingsStyles(),s=this.getClearFixStyles()),r.createElement("div",{className:"top-section",style:s},r.createElement("div",{className:"griddle-filter",style:o},e),r.createElement("div",{className:"griddle-settings-toggle",style:n},t))},getPagingSection:function(e,t){if(!1!==(this.props.showPager&&!this.isInfiniteScrollEnabled()&&!this.shouldUseCustomGridComponent()))return r.createElement("div",{className:"griddle-footer"},this.props.useCustomPagerComponent?r.createElement(f,{customPagerComponentOptions:this.props.customPagerComponentOptions,next:this.nextPage,previous:this.previousPage,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText,customPagerComponent:this.props.customPagerComponent}):r.createElement(i,{useGriddleStyles:this.props.useGriddleStyles,next:this.nextPage,previous:this.previousPage,nextClassName:this.props.nextClassName,nextIconComponent:this.props.nextIconComponent,previousClassName:this.props.previousClassName,previousIconComponent:this.props.previousIconComponent,currentPage:e,maxPage:t,setPage:this.setPage,nextText:this.props.nextText,previousText:this.props.previousText}))},getColumnSelectorSection:function(e,t){return this.state.showColumnChooser?r.createElement(a,{columns:e,selectedColumns:t,setColumns:this.setColumns,settingsText:this.props.settingsText,settingsIconComponent:this.props.settingsIconComponent,maxRowsText:this.props.maxRowsText,setPageSize:this.setPageSize,showSetPageSize:!this.shouldUseCustomGridComponent(),resultsPerPage:this.state.resultsPerPage,enableToggleCustom:this.props.enableToggleCustom,toggleCustomComponent:this.toggleCustomComponent,useCustomComponent:this.shouldUseCustomRowComponent()||this.shouldUseCustomGridComponent(),useGriddleStyles:this.props.useGriddleStyles,enableCustomFormatText:this.props.enableCustomFormatText,columnMetadata:this.props.columnMetadata}):""},getCustomGridSection:function(){return r.createElement(this.props.customGridComponent,n({data:this.props.results,className:this.props.customGridComponentClassName},this.props.gridMetadata))},getCustomRowSection:function(e,t,o,n,s){return r.createElement("div",null,r.createElement(p,{data:e,columns:t,metadataColumns:o,globalData:s,className:this.props.customRowComponentClassName,customComponent:this.props.customRowComponent,style:this.props.useGriddleStyles?this.getClearFixStyles():null}),this.props.showPager&&n)},getStandardGridSection:function(e,t,o,n,l){var i=this.getSortObject(),a=this.getMultipleSelectionObject(),d=this.shouldShowNoDataSection(e),u=this.getNoDataSection();return r.createElement("div",{className:"griddle-body"},r.createElement(s,{useGriddleStyles:this.props.useGriddleStyles,noDataSection:u,showNoData:d,columnSettings:this.columnSettings,rowSettings:this.rowSettings,sortSettings:i,multipleSelectionSettings:a,filterByColumn:this.filterByColumn,isSubGriddle:this.props.isSubGriddle,useGriddleIcons:this.props.useGriddleIcons,useFixedLayout:this.props.useFixedLayout,showPager:this.props.showPager,pagingContent:n,data:e,className:this.props.tableClassName,enableInfiniteScroll:this.isInfiniteScrollEnabled(),nextPage:this.nextPage,showTableHeading:this.props.showTableHeading,useFixedHeader:this.props.useFixedHeader,parentRowCollapsedClassName:this.props.parentRowCollapsedClassName,parentRowExpandedClassName:this.props.parentRowExpandedClassName,parentRowCollapsedComponent:this.props.parentRowCollapsedComponent,parentRowExpandedComponent:this.props.parentRowExpandedComponent,bodyHeight:this.props.bodyHeight,paddingHeight:this.props.paddingHeight,rowHeight:this.props.rowHeight,infiniteScrollLoadTreshold:this.props.infiniteScrollLoadTreshold,externalLoadingComponent:this.props.externalLoadingComponent,externalIsLoading:this.props.externalIsLoading,hasMorePages:l,onRowClick:this.props.onRowClick}))},getContentSection:function(e,t,o,n,r,s){return this.shouldUseCustomGridComponent()&&null!==this.props.customGridComponent?this.getCustomGridSection():this.shouldUseCustomRowComponent()?this.getCustomRowSection(e,t,o,n,s):this.getStandardGridSection(e,t,o,n,r)},getNoDataSection:function(){return null!=this.props.customNoDataComponent?r.createElement("div",{className:this.props.noDataClassName},r.createElement(this.props.customNoDataComponent,this.props.customNoDataComponentProps)):r.createElement(d,{noDataMessage:this.props.noDataMessage})},shouldShowNoDataSection:function(e){return!this.props.allowEmptyGrid&&(!1===this.props.useExternal&&(void 0===e||0===e.length)||!0===this.props.useExternal&&!1===this.props.externalIsLoading&&0===e.length)},render:function(){var e=this.getCurrentResults(),t=(this.props.tableClassName,this.getFilter()),o=this.getSettings(),n=this.getTopSection(t,o),s=[],l=this.columnSettings.getColumns(),i=this.getDataForRender(e,l,!0),a=this.columnSettings.getMetadataColumns();this.props.columnMetadata?j(this.props.columnMetadata,function(e){"boolean"==typeof e.visible&&!1===e.visible||s.push(e.columnName)}):s=g.keys(F(e[0],a)),s=this.columnSettings.orderColumns(s);var d=this.getCurrentPage(),u=this.getCurrentMaxPage(),c=d+10?"griddle "+this.props.gridClassName:"griddle";return m+=this.shouldUseCustomRowComponent()?" griddle-custom":"",r.createElement("div",{className:m},n,h,r.createElement("div",{className:"griddle-container",style:this.props.useGriddleStyles&&!this.props.isSubGriddle?{border:"1px solid #DDD"}:null},f))}});c.Griddle=e.exports=N},"./node_modules/griddle-react/modules/rowProperties.js":function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var o=0;o-1}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseIndexOf.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_arrayIncludesWith.js":function(e,t){function o(e,t,o){for(var n=-1,r=null==e?0:e.length;++n=u&&(p=d,f=!1,t=new r(t));e:for(;++c0&&o(u)?t>1?n(u,t-1,o,l,i):r(i,u):l||(i[i.length]=u)}return i}var r=o("./node_modules/griddle-react/node_modules/lodash/_arrayPush.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_isFlattenable.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_baseFor.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_createBaseFor.js"),r=n();e.exports=r},"./node_modules/griddle-react/node_modules/lodash/_baseForOwn.js":function(e,t,o){function n(e,t){return e&&r(e,t,s)}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseFor.js"),s=o("./node_modules/griddle-react/node_modules/lodash/keys.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_baseGet.js":function(e,t,o){function n(e,t){t=r(t,e);for(var o=0,n=t.length;null!=e&&o=120&&g.length>=120)?new r(f&&g):void 0}g=e[0];var y=-1,v=h[0];e:for(;++yr?0:r+t),o=o>r?r:o,o<0&&(o+=r),r=t>o?0:o-t>>>0,t>>>=0;for(var s=Array(r);++nt||l&&i&&d&&!a&&!u||n&&i&&d||!o&&d||!s)return 1;if(!n&&!l&&!u&&e=a?d:d*("desc"==o[n]?-1:1)}return e.index-t.index}var r=o("./node_modules/griddle-react/node_modules/lodash/_compareAscending.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_copyArray.js":function(e,t){function o(e,t){var o=-1,n=e.length;for(t||(t=Array(n));++o1?o[r-1]:void 0,i=r>2?o[2]:void 0;for(l=e.length>3&&"function"==typeof l?(r--,l):void 0,i&&s(o[0],o[1],i)&&(l=r<3?void 0:l,r=1),t=Object(t);++n-1?i[a?t[d]:d]:void 0}}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseIteratee.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js"),l=o("./node_modules/griddle-react/node_modules/lodash/keys.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_createToPairs.js":function(e,t,o){function n(e){return function(t){var o=s(t);return o==a?l(t):o==d?i(t):r(t,e(t))}}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseToPairs.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_getTag.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_mapToArray.js"),i=o("./node_modules/griddle-react/node_modules/lodash/_setToPairs.js"),a="[object Map]",d="[object Set]";e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_customDefaultsAssignIn.js":function(e,t,o){function n(e,t,o,n){return void 0===e||r(e,s[o])&&!l.call(n,o)?t:e}var r=o("./node_modules/griddle-react/node_modules/lodash/eq.js"),s=Object.prototype,l=s.hasOwnProperty;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_customOmitClone.js":function(e,t,o){function n(e){return r(e)?void 0:e}var r=o("./node_modules/griddle-react/node_modules/lodash/isPlainObject.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_defineProperty.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_getNative.js"),r=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=r},"./node_modules/griddle-react/node_modules/lodash/_equalArrays.js":function(e,t,o){function n(e,t,o,n,d,u){var c=o&i,p=e.length,f=t.length;if(p!=f&&!(c&&f>p))return!1;var h=u.get(e);if(h&&u.get(t))return h==t;var m=-1,_=!0,g=o&a?new r:void 0;for(u.set(e,t),u.set(t,e);++m-1&&e%1==0&&e-1}var r=o("./node_modules/griddle-react/node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_listCacheSet.js":function(e,t,o){function n(e,t){var o=this.__data__,n=r(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this}var r=o("./node_modules/griddle-react/node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapCacheClear.js":function(e,t,o){function n(){this.size=0,this.__data__={hash:new r,map:new(l||s),string:new r}}var r=o("./node_modules/griddle-react/node_modules/lodash/_Hash.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_ListCache.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_Map.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapCacheDelete.js":function(e,t,o){function n(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}var r=o("./node_modules/griddle-react/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapCacheGet.js":function(e,t,o){function n(e){return r(this,e).get(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapCacheHas.js":function(e,t,o){function n(e){return r(this,e).has(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapCacheSet.js":function(e,t,o){function n(e,t){var o=r(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this}var r=o("./node_modules/griddle-react/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_mapToArray.js":function(e,t){function o(e){var t=-1,o=Array(e.size);return e.forEach(function(e,n){o[++t]=[n,e]}),o}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_matchesStrictComparable.js":function(e,t){function o(e,t){return function(o){return null!=o&&o[e]===t&&(void 0!==t||e in Object(o))}}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_memoizeCapped.js":function(e,t,o){function n(e){var t=r(e,function(e){return o.size===s&&o.clear(),e}),o=t.cache;return t}var r=o("./node_modules/griddle-react/node_modules/lodash/memoize.js"),s=500;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_nativeCreate.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_getNative.js"),r=n(Object,"create");e.exports=r},"./node_modules/griddle-react/node_modules/lodash/_nativeKeys.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_overArg.js"),r=n(Object.keys,Object);e.exports=r},"./node_modules/griddle-react/node_modules/lodash/_nativeKeysIn.js":function(e,t){function o(e){var t=[];if(null!=e)for(var o in Object(e))t.push(o);return t}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_nodeUtil.js":function(e,t,o){(function(e){var n=o("./node_modules/griddle-react/node_modules/lodash/_freeGlobal.js"),r="object"==typeof t&&t&&!t.nodeType&&t,s=r&&"object"==typeof e&&e&&!e.nodeType&&e,l=s&&s.exports===r,i=l&&n.process,a=function(){try{return i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a}).call(t,o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/griddle-react/node_modules/lodash/_objectToString.js":function(e,t){function o(e){return r.call(e)}var n=Object.prototype,r=n.toString;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_overArg.js":function(e,t){function o(e,t){return function(o){return e(t(o))}}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_overRest.js":function(e,t,o){function n(e,t,o){return t=s(void 0===t?e.length-1:t,0),function(){for(var n=arguments,l=-1,i=s(n.length-t,0),a=Array(i);++l0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var n=800,r=16,s=Date.now;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_stackClear.js":function(e,t,o){function n(){this.__data__=new r,this.size=0}var r=o("./node_modules/griddle-react/node_modules/lodash/_ListCache.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/_stackDelete.js":function(e,t){function o(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_stackGet.js":function(e,t){function o(e){return this.__data__.get(e)}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_stackHas.js":function(e,t){function o(e){return this.__data__.has(e)}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/_stackSet.js":function(e,t,o){function n(e,t){var o=this.__data__;if(o instanceof r){var n=o.__data__;if(!s||n.length-1:!!u&&r(e,t,o)>-1}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseIndexOf.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isString.js"),i=o("./node_modules/griddle-react/node_modules/lodash/toInteger.js"),a=o("./node_modules/griddle-react/node_modules/lodash/values.js"),d=Math.max;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/initial.js":function(e,t,o){function n(e){return(null==e?0:e.length)?r(e,0,-1):[]}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseSlice.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/intersection.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_arrayMap.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_baseIntersection.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseRest.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_castArrayLikeObject.js"),i=s(function(e){var t=n(e,l);return t.length&&t[0]===e[0]?r(t):[]});e.exports=i},"./node_modules/griddle-react/node_modules/lodash/isArguments.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_baseIsArguments.js"),r=o("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js"),s=Object.prototype,l=s.hasOwnProperty,i=s.propertyIsEnumerable,a=n(function(){return arguments}())?n:function(e){return r(e)&&l.call(e,"callee")&&!i.call(e,"callee")};e.exports=a},"./node_modules/griddle-react/node_modules/lodash/isArray.js":function(e,t){var o=Array.isArray;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isArrayLike.js":function(e,t,o){function n(e){return null!=e&&s(e.length)&&!r(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/isFunction.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isLength.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isArrayLikeObject.js":function(e,t,o){function n(e){return s(e)&&r(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isBuffer.js":function(e,t,o){(function(e){var n=o("./node_modules/griddle-react/node_modules/lodash/_root.js"),r=o("./node_modules/griddle-react/node_modules/lodash/stubFalse.js"),s="object"==typeof t&&t&&!t.nodeType&&t,l=s&&"object"==typeof e&&e&&!e.nodeType&&e,i=l&&l.exports===s,a=i?n.Buffer:void 0,d=a?a.isBuffer:void 0,u=d||r;e.exports=u}).call(t,o("./node_modules/webpack/buildin/module.js")(e))},"./node_modules/griddle-react/node_modules/lodash/isEmpty.js":function(e,t,o){function n(e){if(null==e)return!0;if(a(e)&&(i(e)||"string"==typeof e||"function"==typeof e.splice||d(e)||c(e)||l(e)))return!e.length;var t=s(e);if(t==p||t==f)return!e.size;if(u(e))return!r(e).length;for(var o in e)if(m.call(e,o))return!1;return!0}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseKeys.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_getTag.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isArguments.js"),i=o("./node_modules/griddle-react/node_modules/lodash/isArray.js"),a=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js"),d=o("./node_modules/griddle-react/node_modules/lodash/isBuffer.js"),u=o("./node_modules/griddle-react/node_modules/lodash/_isPrototype.js"),c=o("./node_modules/griddle-react/node_modules/lodash/isTypedArray.js"),p="[object Map]",f="[object Set]",h=Object.prototype,m=h.hasOwnProperty;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isFunction.js":function(e,t,o){function n(e){if(!s(e))return!1;var t=r(e);return t==i||t==a||t==l||t==d}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isObject.js"),l="[object AsyncFunction]",i="[object Function]",a="[object GeneratorFunction]",d="[object Proxy]";e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isLength.js":function(e,t){function o(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}var n=9007199254740991;e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isNull.js":function(e,t){function o(e){return null===e}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isObject.js":function(e,t){function o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isObjectLike.js":function(e,t){function o(e){return null!=e&&"object"==typeof e}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/isPlainObject.js":function(e,t,o){function n(e){if(!l(e)||r(e)!=i)return!1;var t=s(e);if(null===t)return!0;var o=c.call(t,"constructor")&&t.constructor;return"function"==typeof o&&o instanceof o&&u.call(o)==p}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_getPrototype.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js"),i="[object Object]",a=Function.prototype,d=Object.prototype,u=a.toString,c=d.hasOwnProperty,p=u.call(Object);e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isString.js":function(e,t,o){function n(e){return"string"==typeof e||!s(e)&&l(e)&&r(e)==i}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isArray.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js"),i="[object String]";e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isSymbol.js":function(e,t,o){function n(e){return"symbol"==typeof e||s(e)&&r(e)==l}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isObjectLike.js"),l="[object Symbol]";e.exports=n},"./node_modules/griddle-react/node_modules/lodash/isTypedArray.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_baseIsTypedArray.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_baseUnary.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_nodeUtil.js"),l=s&&s.isTypedArray,i=l?r(l):n;e.exports=i},"./node_modules/griddle-react/node_modules/lodash/isUndefined.js":function(e,t){function o(e){return void 0===e}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/keys.js":function(e,t,o){function n(e){return l(e)?r(e):s(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_arrayLikeKeys.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseKeys.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/keysIn.js":function(e,t,o){function n(e){return l(e)?r(e,!0):s(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_arrayLikeKeys.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseKeysIn.js"),l=o("./node_modules/griddle-react/node_modules/lodash/isArrayLike.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/last.js":function(e,t){function o(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/map.js":function(e,t,o){function n(e,t){return(i(e)?r:l)(e,s(t,3))}var r=o("./node_modules/griddle-react/node_modules/lodash/_arrayMap.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseIteratee.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_baseMap.js"),i=o("./node_modules/griddle-react/node_modules/lodash/isArray.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/memoize.js":function(e,t,o){function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(s);var o=function(){var n=arguments,r=t?t.apply(this,n):n[0],s=o.cache;if(s.has(r))return s.get(r);var l=e.apply(this,n);return o.cache=s.set(r,l)||s,l};return o.cache=new(n.Cache||r),o}var r=o("./node_modules/griddle-react/node_modules/lodash/_MapCache.js"),s="Expected a function";n.Cache=r,e.exports=n},"./node_modules/griddle-react/node_modules/lodash/omit.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_arrayMap.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_baseClone.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseUnset.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_castPath.js"),i=o("./node_modules/griddle-react/node_modules/lodash/_copyObject.js"),a=o("./node_modules/griddle-react/node_modules/lodash/_customOmitClone.js"),d=o("./node_modules/griddle-react/node_modules/lodash/_flatRest.js"),u=o("./node_modules/griddle-react/node_modules/lodash/_getAllKeysIn.js"),c=d(function(e,t){var o={};if(null==e)return o;var d=!1;t=n(t,function(t){return t=l(t,e),d||(d=t.length>1),t}),i(e,u(e),o),d&&(o=r(o,7,a));for(var c=t.length;c--;)s(o,t[c]);return o});e.exports=c},"./node_modules/griddle-react/node_modules/lodash/orderBy.js":function(e,t,o){function n(e,t,o,n){return null==e?[]:(s(t)||(t=null==t?[]:[t]),o=n?void 0:o,s(o)||(o=null==o?[]:[o]),r(e,t,o))}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseOrderBy.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isArray.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/pick.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_basePick.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_flatRest.js"),s=r(function(e,t){return null==e?{}:n(e,t)});e.exports=s},"./node_modules/griddle-react/node_modules/lodash/property.js":function(e,t,o){function n(e){return l(e)?r(i(e)):s(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseProperty.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_basePropertyDeep.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_isKey.js"),i=o("./node_modules/griddle-react/node_modules/lodash/_toKey.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/sortBy.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_baseFlatten.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_baseOrderBy.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseRest.js"),l=o("./node_modules/griddle-react/node_modules/lodash/_isIterateeCall.js"),i=s(function(e,t){if(null==e)return[];var o=t.length;return o>1&&l(e,t[0],t[1])?t=[]:o>2&&l(t[0],t[1],t[2])&&(t=[t[0]]),r(e,n(t,1),[])});e.exports=i},"./node_modules/griddle-react/node_modules/lodash/stubArray.js":function(e,t){function o(){return[]}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/stubFalse.js":function(e,t){function o(){return!1}e.exports=o},"./node_modules/griddle-react/node_modules/lodash/take.js":function(e,t,o){function n(e,t,o){return e&&e.length?(t=o||void 0===t?1:s(t),r(e,0,t<0?0:t)):[]}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseSlice.js"),s=o("./node_modules/griddle-react/node_modules/lodash/toInteger.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/toFinite.js":function(e,t,o){function n(e){return e?(e=r(e))===s||e===-s?(e<0?-1:1)*l:e===e?e:0:0===e?e:0}var r=o("./node_modules/griddle-react/node_modules/lodash/toNumber.js"),s=1/0,l=1.7976931348623157e308;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/toInteger.js":function(e,t,o){function n(e){var t=r(e),o=t%1;return t===t?o?t-o:t:0}var r=o("./node_modules/griddle-react/node_modules/lodash/toFinite.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/toNumber.js":function(e,t,o){function n(e){if("number"==typeof e)return e;if(s(e))return l;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var o=d.test(e);return o||u.test(e)?c(e.slice(2),o?2:8):a.test(e)?l:+e}var r=o("./node_modules/griddle-react/node_modules/lodash/isObject.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isSymbol.js"),l=NaN,i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/toPairs.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_createToPairs.js"),r=o("./node_modules/griddle-react/node_modules/lodash/keys.js"),s=n(r);e.exports=s},"./node_modules/griddle-react/node_modules/lodash/toString.js":function(e,t,o){function n(e){return null==e?"":r(e)}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseToString.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/uniqueId.js":function(e,t,o){function n(e){var t=++s;return r(e)+t}var r=o("./node_modules/griddle-react/node_modules/lodash/toString.js"),s=0;e.exports=n},"./node_modules/griddle-react/node_modules/lodash/values.js":function(e,t,o){function n(e){return null==e?[]:r(e,s(e))}var r=o("./node_modules/griddle-react/node_modules/lodash/_baseValues.js"),s=o("./node_modules/griddle-react/node_modules/lodash/keys.js");e.exports=n},"./node_modules/griddle-react/node_modules/lodash/without.js":function(e,t,o){var n=o("./node_modules/griddle-react/node_modules/lodash/_baseDifference.js"),r=o("./node_modules/griddle-react/node_modules/lodash/_baseRest.js"),s=o("./node_modules/griddle-react/node_modules/lodash/isArrayLikeObject.js"),l=r(function(e,t){return s(e)?n(e,t):[]});e.exports=l},"./node_modules/griddle-react/node_modules/lodash/zipObject.js":function(e,t,o){function n(e,t){return s(e||[],t||[],r)}var r=o("./node_modules/griddle-react/node_modules/lodash/_assignValue.js"),s=o("./node_modules/griddle-react/node_modules/lodash/_baseZipObject.js");e.exports=n},"./node_modules/react-selectable/dist/react-selectable.js":function(e,t,o){!function(t,n){e.exports=function(e,t){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.nodeInRoot=t.isNodeIn=t.createSelectable=t.SelectableGroup=void 0;var r=o(1),s=n(r),l=o(9),i=n(l),a=o(5),d=n(a),u=o(4),c=n(u);t.SelectableGroup=s.default,t.createSelectable=i.default,t.isNodeIn=d.default,t.nodeInRoot=c.default},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i=function(){function e(e,t){for(var o=0;oo+i||t+r-an+l)};t.default=function(e,t,o){var n=e instanceof HTMLElement?(0,r.default)(e):e,l=t instanceof HTMLElement?(0,r.default)(t):t;return s(n.top,n.left,l.top,l.left,n.offsetWidth,n.offsetHeight,l.offsetWidth,l.offsetHeight,o)}},function(e,t){(function(t){"use strict";function o(e,t,o){function n(t){var o=m,n=_;return m=_=void 0,E=t,y=e.apply(n,o)}function s(e){return E=e,v=setTimeout(u,t),P?n(e):y}function l(e){var o=e-b,n=e-E,r=t-o;return w?S(r,g-n):r}function a(e){var o=e-b,n=e-E;return void 0===b||o>=t||o<0||w&&n>=g}function u(){var e=C();if(a(e))return c(e);v=setTimeout(u,l(e))}function c(e){return v=void 0,T&&m?n(e):(m=_=void 0,y)}function p(){void 0!==v&&clearTimeout(v),E=0,m=b=_=v=void 0}function f(){return void 0===v?y:c(C())}function h(){var e=C(),o=a(e);if(m=arguments,_=this,b=e,o){if(void 0===v)return s(b);if(w)return v=setTimeout(u,t),n(b)}return void 0===v&&(v=setTimeout(u,t)),y}var m,_,g,y,v,b,E=0,P=!1,w=!1,T=!0;if("function"!=typeof e)throw new TypeError(d);return t=i(t)||0,r(o)&&(P=!!o.leading,w="maxWait"in o,g=w?j(i(o.maxWait)||0,t):g,T="trailing"in o?!!o.trailing:T),h.cancel=p,h.flush=f,h}function n(e,t,n){var s=!0,l=!0;if("function"!=typeof e)throw new TypeError(d);return r(n)&&(s="leading"in n?!!n.leading:s,l="trailing"in n?!!n.trailing:l),o(e,t,{leading:s,maxWait:t,trailing:l})}function r(e){var t=void 0===e?"undefined":a(e);return!!e&&("object"==t||"function"==t)}function s(e){return!!e&&"object"==(void 0===e?"undefined":a(e))}function l(e){return"symbol"==(void 0===e?"undefined":a(e))||s(e)&&E.call(e)==c}function i(e){if("number"==typeof e)return e;if(l(e))return u;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(p,"");var o=h.test(e);return o||m.test(e)?_(e.slice(2),o?2:8):f.test(e)?u:+e}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d="Expected a function",u=NaN,c="[object Symbol]",p=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,m=/^0o[0-7]+$/i,_=parseInt,g="object"==(void 0===t?"undefined":a(t))&&t&&t.Object===Object&&t,y="object"==("undefined"==typeof self?"undefined":a(self))&&self&&self.Object===Object&&self,v=g||y||Function("return this")(),b=Object.prototype,E=b.toString,j=Math.max,S=Math.min,C=function(){return v.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t,o){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function r(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 l(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 i=function(){function e(e,t){for(var o=0;o-1}var r=o("./node_modules/redux-form/node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/redux-form/node_modules/lodash/_listCacheSet.js":function(e,t,o){function n(e,t){var o=this.__data__,n=r(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this}var r=o("./node_modules/redux-form/node_modules/lodash/_assocIndexOf.js");e.exports=n},"./node_modules/redux-form/node_modules/lodash/_mapCacheClear.js":function(e,t,o){function n(){this.size=0,this.__data__={hash:new r,map:new(l||s),string:new r}}var r=o("./node_modules/redux-form/node_modules/lodash/_Hash.js"),s=o("./node_modules/redux-form/node_modules/lodash/_ListCache.js"),l=o("./node_modules/redux-form/node_modules/lodash/_Map.js");e.exports=n},"./node_modules/redux-form/node_modules/lodash/_mapCacheDelete.js":function(e,t,o){function n(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}var r=o("./node_modules/redux-form/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/redux-form/node_modules/lodash/_mapCacheGet.js":function(e,t,o){function n(e){return r(this,e).get(e)}var r=o("./node_modules/redux-form/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/redux-form/node_modules/lodash/_mapCacheHas.js":function(e,t,o){function n(e){return r(this,e).has(e)}var r=o("./node_modules/redux-form/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/redux-form/node_modules/lodash/_mapCacheSet.js":function(e,t,o){function n(e,t){var o=r(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this}var r=o("./node_modules/redux-form/node_modules/lodash/_getMapData.js");e.exports=n},"./node_modules/redux-form/node_modules/lodash/_memoizeCapped.js":function(e,t,o){function n(e){var t=r(e,function(e){return o.size===s&&o.clear(),e}),o=t.cache;return t}var r=o("./node_modules/redux-form/node_modules/lodash/memoize.js"),s=500;e.exports=n},"./node_modules/redux-form/node_modules/lodash/_nativeCreate.js":function(e,t,o){var n=o("./node_modules/redux-form/node_modules/lodash/_getNative.js"),r=n(Object,"create");e.exports=r},"./node_modules/redux-form/node_modules/lodash/_objectToString.js":function(e,t){function o(e){return r.call(e)}var n=Object.prototype,r=n.toString;e.exports=o},"./node_modules/redux-form/node_modules/lodash/_root.js":function(e,t,o){var n=o("./node_modules/redux-form/node_modules/lodash/_freeGlobal.js"),r="object"==typeof self&&self&&self.Object===Object&&self,s=n||r||Function("return this")();e.exports=s},"./node_modules/redux-form/node_modules/lodash/_stringToPath.js":function(e,t,o){var n=o("./node_modules/redux-form/node_modules/lodash/_memoizeCapped.js"),r=/^\./,s=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/\\(\\)?/g,i=n(function(e){var t=[];return r.test(e)&&t.push(""),e.replace(s,function(e,o,n,r){t.push(n?r.replace(l,"$1"):o||e)}),t});e.exports=i},"./node_modules/redux-form/node_modules/lodash/_toKey.js":function(e,t,o){function n(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-s?"-0":t}var r=o("./node_modules/redux-form/node_modules/lodash/isSymbol.js"),s=1/0;e.exports=n},"./node_modules/redux-form/node_modules/lodash/_toSource.js":function(e,t){function o(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var n=Function.prototype,r=n.toString;e.exports=o},"./node_modules/redux-form/node_modules/lodash/eq.js":function(e,t){function o(e,t){return e===t||e!==e&&t!==t}e.exports=o},"./node_modules/redux-form/node_modules/lodash/isArray.js":function(e,t){var o=Array.isArray;e.exports=o},"./node_modules/redux-form/node_modules/lodash/isFunction.js":function(e,t,o){function n(e){if(!s(e))return!1;var t=r(e);return t==i||t==a||t==l||t==d}var r=o("./node_modules/redux-form/node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/redux-form/node_modules/lodash/isObject.js"),l="[object AsyncFunction]",i="[object Function]",a="[object GeneratorFunction]",d="[object Proxy]";e.exports=n},"./node_modules/redux-form/node_modules/lodash/isObject.js":function(e,t){function o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=o},"./node_modules/redux-form/node_modules/lodash/isObjectLike.js":function(e,t){function o(e){return null!=e&&"object"==typeof e}e.exports=o},"./node_modules/redux-form/node_modules/lodash/isSymbol.js":function(e,t,o){function n(e){return"symbol"==typeof e||s(e)&&r(e)==l}var r=o("./node_modules/redux-form/node_modules/lodash/_baseGetTag.js"),s=o("./node_modules/redux-form/node_modules/lodash/isObjectLike.js"),l="[object Symbol]";e.exports=n},"./node_modules/redux-form/node_modules/lodash/memoize.js":function(e,t,o){function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(s);var o=function(){var n=arguments,r=t?t.apply(this,n):n[0],s=o.cache;if(s.has(r))return s.get(r);var l=e.apply(this,n);return o.cache=s.set(r,l)||s,l};return o.cache=new(n.Cache||r),o}var r=o("./node_modules/redux-form/node_modules/lodash/_MapCache.js"),s="Expected a function";n.Cache=r,e.exports=n},"./node_modules/redux-form/node_modules/lodash/toPath.js":function(e,t,o){function n(e){return l(e)?r(e,d):i(e)?[e]:s(a(u(e)))}var r=o("./node_modules/redux-form/node_modules/lodash/_arrayMap.js"),s=o("./node_modules/redux-form/node_modules/lodash/_copyArray.js"),l=o("./node_modules/redux-form/node_modules/lodash/isArray.js"),i=o("./node_modules/redux-form/node_modules/lodash/isSymbol.js"),a=o("./node_modules/redux-form/node_modules/lodash/_stringToPath.js"),d=o("./node_modules/redux-form/node_modules/lodash/_toKey.js"),u=o("./node_modules/redux-form/node_modules/lodash/toString.js");e.exports=n},"./node_modules/redux-form/node_modules/lodash/toString.js":function(e,t,o){function n(e){return null==e?"":r(e)}var r=o("./node_modules/redux-form/node_modules/lodash/_baseToString.js");e.exports=n},"./node_modules/webpack/buildin/global.js":function(e,t){var o;o=function(){return this}();try{o=o||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(o=window)}e.exports=o},"./node_modules/webpack/buildin/module.js":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},0:function(e,t){e.exports=React},1:function(e,t){e.exports=i18n},10:function(e,t){e.exports=InsertMediaModal},11:function(e,t){e.exports=FormBuilderModal},12:function(e,t){e.exports=DataFormat},13:function(e,t){e.exports=DeepFreezeStrict},14:function(e,t){e.exports=GraphQLTag},15:function(e,t){e.exports=ReactDND},16:function(e,t){e.exports=SchemaActions},17:function(e,t){e.exports=Badge},18:function(e,t){e.exports=FormBuilderLoader},19:function(e,t){e.exports=Backend},2:function(e,t){e.exports=Injector},20:function(e,t){e.exports=Config},21:function(e,t){e.exports=ReactDNDHtml5Backend},22:function(e,t){e.exports=Reactstrap},23:function(e,t){e.exports=ReduxForm},24:function(e,t){e.exports=getFormState},26:function(e,t){e.exports=Breadcrumb},27:function(e,t){e.exports=BreadcrumbsActions},28:function(e,t){e.exports=FieldHolder},29:function(e,t){e.exports=FileSchemaModalHandler},3:function(e,t){e.exports=ReactRedux},30:function(e,t){e.exports=Focusedzone},31:function(e,t){e.exports=FormAlert},32:function(e,t){e.exports=ReactAddonsCssTransitionGroup},33:function(e,t){e.exports=ReactAddonsTestUtils},34:function(e,t){e.exports=ReactRouteRegister},35:function(e,t){e.exports=ReactRouter},36:function(e,t){e.exports=Toolbar},37:function(e,t){e.exports=TreeDropdownField},38:function(e,t){e.exports=UnsavedFormsActions},39:function(e,t){e.exports=qs},4:function(e,t){e.exports=Redux},40:function(e,t){e.exports=reduxFieldReducer},41:function(e,t){e.exports=schemaFieldValues},5:function(e,t){e.exports=ReactDom},6:function(e,t){e.exports=jQuery},8:function(e,t){e.exports=ReactApollo},9:function(e,t){e.exports=classnames}}); \ No newline at end of file diff --git a/client/src/containers/AssetAdmin/AssetAdmin.js b/client/src/containers/AssetAdmin/AssetAdmin.js index 4db699150..78edddfd4 100644 --- a/client/src/containers/AssetAdmin/AssetAdmin.js +++ b/client/src/containers/AssetAdmin/AssetAdmin.js @@ -195,23 +195,19 @@ class AssetAdmin extends Component { queuedFiles, } = this.props; - return [ + const combinedFilesList = [ // Exclude uploaded files that have been reloaded via graphql ...queuedFiles .items .filter(item => !item.id || !files.find(file => file.id === item.id)), ...files, - ].sort((left, right) => { - if (left.type !== right.type) { - if (left.type === 'folder') { - return -1; - } - if (right.type === 'folder') { - return 1; - } - } - return right.queuedId - left.queuedId; - }); + ]; + + // Seperate folder and files then return an array with folders at the top (for table view) + const foldersList = combinedFilesList.filter((file) => file.type === 'folder'); + const filesList = combinedFilesList.filter((file) => file.type !== 'folder'); + + return foldersList.concat(filesList); } /** diff --git a/code/GraphQL/FolderTypeCreator.php b/code/GraphQL/FolderTypeCreator.php index 6bf7abde1..6a18cbad4 100644 --- a/code/GraphQL/FolderTypeCreator.php +++ b/code/GraphQL/FolderTypeCreator.php @@ -157,19 +157,6 @@ public function resolveChildrenConnection( $filter['parentId'] = $object->ID; $list = $filterInputType->filterList($list, $filter); - // Sort folders first - $list = $list->alterDataQuery(function (DataQuery $query, DataList $list) { - $existingOrderBys = $query->query()->getOrderBy(); - $query->sort( - '(CASE WHEN "ClassName"=\'SilverStripe\\\\Assets\\\\Folder\' THEN 1 ELSE 0 END)', - 'DESC', - true - ); - foreach ($existingOrderBys as $field => $dir) { - $query->sort($field, $dir, false); - } - }); - // Filter by permission $ids = $list->column('ID'); $permissionChecker = File::singleton()->getPermissionChecker(); diff --git a/tests/php/GraphQL/FolderTypeCreatorTest.php b/tests/php/GraphQL/FolderTypeCreatorTest.php index 9a521adfb..6b65f4b88 100644 --- a/tests/php/GraphQL/FolderTypeCreatorTest.php +++ b/tests/php/GraphQL/FolderTypeCreatorTest.php @@ -18,29 +18,6 @@ class FolderTypeCreatorTest extends SapphireTest protected $usesDatabase = true; - public function testItSortsChildrenOnTypeByDefault() - { - $rootFolder = Folder::singleton(); - - $file = File::create(['Name' => 'aaa file']); - $file->write(); - - $folder = Folder::create(['Name' => 'bbb folder']); - $folder->write(); - - $list = $this->resolveChildrenConnection( - $rootFolder, - [] - ); - $this->assertEquals( - [ - $folder->Name, - $file->Name, - ], - $list['edges']->column('Name') - ); - } - public function testItDoesNotFilterByParentIdWithRecursiveFlag() { $rootFolder = Folder::singleton();